content
stringlengths
1
15.9M
\section{Introduction}\label{intro} Bridges are among the key elements of transportation networks, making their continuous functionality crucial to the socioeconomic prosperity of modern communities. In order to effectively and efficiently manage and maintain the bridges in seismic regions, seismic risk assessments are necessary~\citep{chang2000probabilistic, kiremidjian2007seismic, padgett2007bridge, padgett2010regional, kameshwar2014multi}. Seismic fragility functions, which determine the probabilities of exceeding various damage states (DSs) based on ground motion and structural characteristics~\citep{shinozuka2000statistical, shinozuka2000nonlinear, choi2004seismic, nielson2007analytical, padgett2008methodology}, are prerequisites to the seismic risk assessment of bridges. In addition to their paramount role in seismic risk assessment, fragility functions can provide great insights into the seismic performance of bridges (globally) and their components (locally), and thus, they can be used to probabilistically evaluate the seismic damage mitigation benefits of innovative bridge systems in comparison with their conventional counterparts~\citep{billah2012seismic, muntasir2015seismic, billah2018probabilistic, todorov2021seismic, salkhordeh2021seismic, fan2021machine, lu2022seismic}. Building upon the previous efforts on the seismic design of the so-called \emph{Shape Memory Alloy (SMA)-Restrained Rocking (SRR)} columns and the deterministic seismic performance assessment of the bridges equipped with those columns~\citep{akbarnezhad2022seismic,akbarnezhad2022bridge}, this paper aims to, first, evaluate the seismic vulnerability of the bridges of SRR piers by developing multi-parameter fragility functions using advanced machine learning (ML) techniques; and second, compare their seismic vulnerability with those of the bridges of posttensioned (PT) and monolithic reinforced concrete (RC) columns. \section{Background}\label{background} \subsection{SRR bridge columns}\label{SRR} SMAs are a class of “smart” materials capable of recovering their original shape after relatively large deformations (up to 6-8\% of strain), which is referred to as \emph{superelasticity} effect~\citep{hodgson1990shape,lagoudas2008shape}. The flag-shaped hysteretic behavior of SMAs has made them particularly attractive for the development of seismically-resilient structural components that would benefit from self-centering capabilities~\citep{desroches2004shape, ozbulut2011seismic}, including innovative bridge columns~\citep{wang2005study, saiidi2006exploratory, billah2012sma, moon2015seismic, tazarv2015reinforcing, tazarv2016low, varela2016bridge, varela2017resilient, tazarv2020analysis}. SRR columns, which were recently proposed within this context~\citep{akbarnezhad2022seismic}, are precast concrete columns with end steel-armored rocking joints controlled through two series of unbonded links: (\textit{i}) prestressed SMA links made of superelastic nickel-titanium (NiTi) alloy, and (\textit{ii}) energy-dissipating (ED) links made of mild steel (Fig.~\ref{SRR_joint}). The SMA links provide SRR columns with self-centering, while the ED links supplement the moderate energy dissipation provided by the SMA links. SRR columns are designed in a performance-based manner with the objective of sustaining minimal damage and residual displacement under the Maximum Considered Earthquake (MCE) hazard~\citep{akbarnezhad2022seismic}. Compared to the rocking columns posttensioned through internal high-strength steel tendons, SRR columns offer higher durability (due to the excellent corrosion resistance of NiTi) and easier repair (due to the easy replacement of SMA links). \begin{figure} \centering \includegraphics[scale=0.92]{Plot/SRR_Column.png} \caption{Illustration of an SRR column with bottom rocking joint (design variation 1 per~\cite{akbarnezhad2022seismic})}\label{SRR_joint} \end{figure} In a recent study~\citep{akbarnezhad2022seismic}, three SRR column design variations were introduced and evaluated under cyclic lateral loading through 3D nonlinear continuum-based finite element models. The simulation results demonstrated that all three variations were successful in achieving the desired performance objectives, particularly, preventing concrete spalling and longitudinal rebar yielding over the unjacketed lengths of the columns and limiting their residual drift ratio to less than 0.3\% after being subjected to MCE displacement demands. More recently, \cite{akbarnezhad2022bridge} evaluated the seismic performances of two reinforced concrete (RC) bridges equipped with SRR columns through multiple nonlinear time history analyses and considering three discrete hazard levels. The results of this study showed that: (1) when properly designed, SRR columns are capable of achieving their targeted seismic performance objectives (i.e., damage and residual displacement prevention under MCE hazard); (2) vertical excitation and near-fault ground motions have inconsequential effects on the seismic damage of SRR columns; and (3) ambient temperature has very limited effect on the performance of SRR columns during earthquakes. \subsection{ML-based seismic fragility assessment}\label{ML_based} As mentioned earlier, seismic fragility functions are intended to compute the exceedance probabilities of various DSs given ground motion and structural characteristics~\citep{basoz1999statistical, mander1999seismic, shinozuka2000statistical}. In the literature, two approaches have been generally taken to develop analytical fragility functions, which are herein referred to as \emph{one-stage} and \emph{two-stage}. In both approaches, fragility functions are developed based on the exceedance probabilities that are obtained through the comparison of engineering demand parameters (EDPs), which represent various local/global structural responses, with respective capacities. However, the EDPs used in the two approaches are determined differently. In the one-stage approach, the EDPs are directly obtained from nonlinear time history analyses, necessitating a large data set~\citep{shinozuka2000statistical, shinozuka2000nonlinear, der2002seismic, porter2007creating, zhang2009evaluating, baker2011fitting, baker2015efficient, alam2012seismic, kiani2019application, salehi2020assessing, ghosh2021seismic, wang2022deep, rajkumari2022fragility}. In the two-stage approach, which is more commonly used than the one-stage approach, the EDPs are estimated via the so-called \emph{probabilistic seismic demand models} (PSDMs), which are initially generated based on the data obtained from the nonlinear time history analyses~\citep{choi2004seismic, nielson2007seismic, nielson2007analytical, padgett2008methodology, ramanathan2010analytical}. The two-stage approach could be helpful especially when the data set obtained from the nonlinear time history analyses is not sufficiently large. However, it could potentially introduce additional error (epistemic uncertainty) into the resulting fragility functions~\citep{der2009aleatory, zhang2009evaluating, muntasir2015rev, bakalis2018seismic, zhang2020seismic, flenga2021fragility, conde2022seismic}. Even though the common approach to develop PSDMs is using linear regression~\citep{xiang2019comparative, xiang2020probabilistic, wei2020evaluation, chen2021seismic}, which facilitates both model training and interpretation, the resulting linear regression models could not always represent the seismic response of structures with a high accuracy~\citep{ghosh2013surrogate, rokneddin2014seismic, mangalathu2018critical}. Moreover, linear regression models become even less effective/accurate if more than one independent variable are of interest in the PSDM development (i.e., not only a single IM)~\citep{dukes2013application, jeon2019parameterized}. Another limiting assumption within the traditional framework is that the probability distributions of different DSs have to be assumed (often, log-normal) resulting in fragility functions of low accuracy~\citep{noh2015development}. Given the foregoing and due to the significant predictive power offered by ML models, in recent years, ML techniques have been used for the development of fragility functions~\citep{ soleimani2022state, xie2020promise, soleimani2022probabilistic}. ML techniques allow developing more accurate PSDMs by avoiding the simplifying assumptions adopted by other approximate methods.~\citep{lagaros2007, jia2022structural}. While single-parameter PSDMs are primarily employed to develop fragility functions, ML-based multi-parameter PSDMs could be used for several other purposes, too, such as fast seismic performance assessment of bridges after earthquakes~\citep{mangalathu2019rapid, xu2020real, todorov2022post}, seismic design optimization of bridges~\citep{dukes2018development, fan2021machine}, and probabilistic investigation of effects of various geometric/material/design parameters on the seismic performance of bridges~\citep{moradi2018parameterized, mangalathu2019rapid, jeon2019parameterized}, especially innovative systems~\citep{shi2022seismic}. Among the different ML techniques, several previous studies have used artificial neural networks to develop PSDMs for different types of structures~\citep{jia2022structural}. With the primary objective of reducing the computational cost of structural analysis, \cite{lagaros2007} proposed the rapid evaluation of seismic demands in steel building frames using a neural network. \cite{huang2020predicting} proposed an artificial neural network (ANN)-based capacity prediction model in order to take account of the uncertainty of the seismic performance of the reinforced concrete (RC) bridge columns. In order to eliminate the need for grouping the bridge classes based on their geometric characteristics (e.g., number of spans, number of columns per bent, and skew angle), \cite{mangalathu2018artificial} employed neural network (for PSDM development) and LASSO logistic regression (for fragility function development) to produce multi-parameter bridge-specific fragility functions. Other ML techniques have also been used for the development of fragility functions while studying the significance of parameter contributions to the output. In a study by~\cite{ghosh2013surrogate}, to develop bridge fragility functions, four different surrogate models (prediction models), namely, polynomial response surface, multivariate response adaptive regression spline, radial basis function networks, and support vector machines were explored and it was found that metamodels are capable of adequately and efficiently predicting bridge-specific seismic reliabilities with low computational cost. \cite{jeon2019parameterized} used multiple linear regression (for PSDM development) and logistic regression (for fragility function development) to develop bridge-specific fragility functions and showed that the stepwise removal process via a Bayesian parameter estimation method facilitates identifying the significant uncertain parameters. For the same purpose, \cite{mangalathu2019stripe} proposed using random forest, while their proposed method facilitated updating the fragility functions for new sets of input parameters. \cite{kiani2019application} also explored the application of one-stage classification-based ML algorithms in deriving seismic fragility curves for maximum inter-story drift ratio of an 8-story special steel moment resisting frame building and examined the significance of different IMs on the output based on LASSO and logistic methods. To predict seismic response of bridges against lateral spreading, \cite{wang2021seismic} examined five ML techniques, namely, multiple linear regression, LASSO regression, neural network, random forests, and gradient boosting and compared their performance using the coefficient of determination, $R^2$, and performance plot. Moreover, they tried to identify the most significant IM and explored the relative importance of the input variables obtained from the white-box models (all except neural network, which is deemed a black-box model). \cite{soleimani2022bridge} developed a framework for probabilistic seismic resilience assessment of common highway bridges using ensemble learning-based predictive, namely, bagging and boosting techniques. The final output could predict resilience index as a function of seismic events and bridge characteristics. In addition to the high predictive power of the ML-based prediction models, interpretation of these models would provide insight into the mechanics of the problem~\citep{mangalathu2020failure, sun2021machine}. Interpretation of ML models refers to understanding the general relationships governing the data that are learned by the models~\citep{murdoch2019definitions}. Interpretation/inspection of ML models could help to further validate the trained models and to understand the influence of the input features on the model predictions. Some ML models are easy to interpret based on the trained model itself, such as linear regression or decision tree. However, some other ML models cannot be interpreted as easily because the trained models are more or less "black boxes". To overcome this limitation, there exist several interpretation methods that can be used to study the ML models that are not immediately interpretable, e.g., neural network. Some of these methods are model-specific, i.e., they can be used to interpret/inspect only specific ML models. However, there exist other methods that can be applied to any ML models, which are referred to as \emph{model-agnostic}~\citep{lipovetsky2001analysis, chakraborty2017interpretability, lundberg2017unified, guidotti2018survey, molnar2020interpretable, molnar2020interpretable2}.~\cite{soleimani2021analytical} assessed the importance of modeling parameters on seismic demand estimation for concrete box-girder bridges with tall piers using Random Forest ensemble learning method. Recently, \cite{mangalathu2022machine} used such interpretation methods to explore the key influential variables and thresholds governing the ML-based seismic demand prediction models for reinforced concrete bridges. \section{Scope and objectives}\label{scope} Although the overall seismic damage mitigation capability of SRR columns has been demonstrated through cyclic analyses~\citep{akbarnezhad2022seismic} and time history analyses~\citep{akbarnezhad2022bridge} representing certain hazard levels, the seismic vulnerability of bridges with SRR columns considering various uncertainties remains unexplored. Moreover, to show that SRR columns can seismically perform, at least, as well as PT columns, yet outperform monolithic RC columns, comparative fragility assessments are necessary. To address these points, this study aims to: \begin{itemize} \item Develop multi-parameter PSDMs for a highway bridge with SRR columns using a number of different ML techniques and choose the optimal PSDMs among them; \item Investigate the effects of various input parameters (including two key SRR column design parameters and ambient temperature) on the seismic performance of the bridges with SRR columns by interpreting the chosen PSDMs via a few different methods; \item Develop multi-parameter fragility functions for the bridge with SRR columns using ML techniques; \item Examine the effects of SRR column design parameters on the fragility curves of the bridge with SRR columns; \item Compare the seismic fragility of the bridge with SRR columns with those of the same bridge but with monolithic RC columns and PT columns. \end{itemize} The rest of this paper is organized as follows. The ML techniques considered in this study for PSDM development are briefly reviewed in Section~\ref{overview}. Section~\ref{CaseBridge} describes the highway bridge studied in this paper. Section~\ref{design} is concerned with the design of the SRR columns incorporated in the bridge and their equivalent PT columns. The numerical modeling of the selected bridge with different column types is described in Section~\ref{Numerical}. The PSDMs for the bridge with SRR columns are developed and interpreted in Section~\ref{PSDM}. The fragility functions of the bridges with monolithic RC columns, PT columns, and SRR columns are developed and compared in Section~\ref{frag_anal}. The effects of design parameters on the fragility functions of the bridge of SRR columns are examined in the same section. Finally, Section~\ref{conclusions} provides the summary and conclusions. \section{Overview of ML techniques}\label{overview} Five different ML techniques were considered to develop the PSDMs of the bridge with SRR columns. These techniques, which include (1) ridge regression, (2) kernel support vector regression, (3) adaptive boosting, (4) random forest, and (5) neural network, are briefly reviewed in this section. The fundamentals and the formulations of the selected ML techniques are not extensively discussed here for brevity and they can be found elsewhere~\citep{bishop2006pattern, hastie2009elements, murphy2012machine}. \subsection{Ridge regression} Ridge regression is basically a regularized version of multiple linear regression introduced by~\cite{hoerl1970ridge}. To reduce the model variance and complexity (i.e., "overfitting"), especially in the presence of multicollinearity (when some of predictors are correlated), in the ridge regression, a penalty term is added to the ordinary least squares loss function, i.e., sum of squared residuals (SSR). This penalty term is the sum of the squares of the regression coefficients multiplied by a regularization constant. Accordingly, by minimizing the penalized sum of squared residuals (PSSR) as its loss function, the ridge regression tends to make the coefficients corresponding to less significant predictors smaller, thereby improving the resulting model's stability and eliminating multicollinearity. Though an inherently nonlinear response cannot be accurately represented by a ridge regression model using the original predictors, expanding the original predictor space to include higher-order features (i.e., increasing the model dimensions) could improve the model's performance. However, the required feature expansion results in a large number of features, making the training process practically inefficient. \subsection{Kernel support vector regression} Similarly to multiple linear regression, support vector regression methods predict the target variable through a hyperplane. However, to achieve lower variance and better stability, the basic loss function in the support vector regression is defined as one half of the sum of the squares of the hyperplane coefficients, with the prediction errors being constrained within a certain margin~\citep{vapnik1999nature}. Since the support vector regression cannot accurately represent a nonlinear target using the original predictors (without transformations), kernel support vector regression is employed. In this technique, the loss function remains the same, but the predictors are transformed via kernel functions before entering the hyperplane equation~\citep{boser1992training}. The kernel functions generally quantify the similarities (e.g., distances) between the observations. In this study, the Gaussian kernel function, which is also referred to as Radial Basis Function, was used. It is noted that the kernel support vector regression is computationally more efficient than the ridge regression for learning nonlinear responses because it does not require the original space to be actually transformed into higher dimensions. \subsection{Random forest} Ensemble ML technique have also been developed to improve the stability/robustness of ML-based prediction models~\citep{sagi2018ensemble}. These techniques combine the predictions of a large number of base estimators ("weak learners") to make a final prediction. In the context of regression, the final prediction is the (weighted) average of the predictions of the base estimators. Random forest is an ensemble technique whose base estimators are low-depth decision trees, intending to reduce the overall model's variance compared to a single deep decision tree~\citep{breiman2001random}. To this end, each decision tree is trained using only a subset of the entire training data set, which is selected randomly with replacement (known as "bootstrap" sampling or "bootstrapping"), while the features considered for splitting at each decision node are also picked from a random subset of all the existing features. It is worth noting that random forest is a \emph{parallel} ensemble technique, i.e., each decision tree is trained independently of the other decision trees. \subsection{Adaptive boosting} Adaptive boosting, which is more often referred to as "AdaBoost", is also an ensemble technique with similar objectives to the random forest's~\citep{freund1997decision}. However, AdaBoost is of a \emph{sequential} type (not parallel), i.e., its base estimators are trained one after another and considering the error in the previous training. That is, each estimator is trained using the entire data set, but the weights of the observations (used in the loss function) are adjusted at each training step on the basis of the prediction errors of the previous trained estimator. As a result of this iterative process, the base estimators gradually become stronger in making more difficult predictions. In this study, the base estimators used in the AdaBoost method were low-depth decision trees. \subsection{Neural network} Neural networks loosely emulate human brains and are capable of predicting the most complex nonlinear responses~\citep{haykin2009neural}. Each neural network consists of a series of neurons organized in several layers, with the first and the last layers including the input and output variables, respectively, while each neuron has a weight associated with it. The basic form of neural network (only including input and output layers) represents a multiple linear regression model. Adding intermediate layers (including "hidden" neurons) can make the model nonlinear. Before the outputs of each layer are given to the next layer as its inputs, they are transformed using an "activation function" to increase the model's predictive power and robustness. In this study, the rectified linear unit (ReLU)~\citep{goodfellow2016deep} and linear functions are used as the activation functions for the hidden layers and the output layer, respectively. \section{Bridge description}\label{CaseBridge} The La Veta Avenue overcrossing bridge located in Orange, California, was selected for the seismic fragility assessments. The key features of the bridge are illustrated in Fig.~\ref{laveta}. The bridge is made of RC and it has two spans with seat-type abutments and a single two-column bent. The superstructure consists of a continuous six-cell RC box-girder, which spans the total length of 299.8~ft and width of 75.5~ft. For simplicity, the bridge's two spans were assumed to be identical (Fig.~\ref{laveta}(a)). The superstructure is supported by seven elastomeric bearing pads at each abutment. The bent consists of two identical columns, each being 22~ft tall, and a cap-beam integral with the bridge deck (Fig.~\ref{laveta}(b)). The cross section of the original columns is 66~in. in diameter (Fig.~\ref{laveta}(c)) and each column has an axial load ratio of about 10\%. The original monolithic RC columns are of pinned connections at their bottom ends. The concrete's nominal compressive strength, $f'_c$, is 5~ksi and the reinforcing steel is of Grade 60~\citep{astm2009standard}. Further details of the bridge can be found in~\cite{kaviani2014}. \begin{figure} \centering \includegraphics[scale=0.72]{Plot/Bridge_Desc_plot/LaVeta.png} \caption{La Veta Avenue overcrossing bridge: (a) bridge elevation; (b) bent elevation; (c) column cross section} \label{laveta} \end{figure} \section{Design of rocking columns}\label{design} This section summarizes the designs of the SRR and PT columns that would replace the original monolithic RC columns of the selected bridge. For a fair comparison in the subsequent seismic fragility assessments (Section~\ref{col_frag_comp}), the rocking columns' boundary conditions were assumed to be the same as the monolithic columns' (fixed at their top ends and pinned at their bottom ends) and one of the design objectives was to achieve nearly equal maximum base shear resistances in all the piers, i.e., with monolithic columns, PT columns, and SRR columns. \subsection{SRR columns} The SRR columns were selected to be of design variation~1 per~\cite{akbarnezhad2022seismic} (see Fig.~\ref{SRR_joint}). A performance-based approach was taken to design the SRR columns, while the SRR pier's maximum lateral load resistance was sought to remain equal to that of the monolithic pier (see Fig.~\ref{push_comp}). The broad performance objective was to prevent the SRR columns from repair-necessary damage and residual deformations under an MCE (2475-year) event. More specifically, the following DSs were aimed to be prevented under the MCE displacement demand: (1) concrete spalling/crushing, (2) longitudinal rebar yielding, (3) strength deterioration or fracture of ED links, and (4) plastic deformation of SMA links. The SRR columns were designed through an iterative process~\citep{akbarnezhad2022seismic} until the above performance objectives were satisfied. Here, the MCE displacement demand was determined using the capacity spectrum method~\citep{chopra1999capacity, fajfar1999capacity, madhusudhanan2018capacity}, while the requisite nonlinear static (pushover) analyses were conducted via the numerical model described subsequently - the final MCE drift ratio demand was 3.6\%. The dimensions and the reinforcement details of the designed SRR columns are shown in Fig.~\ref{ColDim}. The diameter of the columns over their unjacketed lengths was selected to be identical to the diameter of the original monolithic RC columns (66 in.). To accommodate the SMA and ED links, the diameter of the columns' jacketed cross section was selected to be 12 in. larger. The longitudinal reinforcement of each SRR column consists of 30 double \#11 bars, resulting in a longitudinal reinforcement ratio of 2.7\%. The transverse reinforcement over the unjacketed length was kept similar to the original monolithic RC columns'. The steel jacket was assumed to be made of A36 steel~\citep{astm2014standard}, 7/8 in. thick, and 60 in. tall. Totals of eight SMA links and eight ED links (also made of A36 steel) are used at the rocking joint of each column. The SMA and ED links are 60 in. and 45 in. long, respectively, and their cross-sectional areas are 0.79 in.$^2$ and 3.97 in.$^2$, respectively. \begin{figure} \centering \includegraphics[scale=0.50]{Plot/Bridge_Desc_plot/SRR_design.png} \caption{Design details of SRR columns} \label{ColDim} \end{figure} \subsection{PT columns} The PT columns were chosen to be of central unbonded tendons and their rocking joints were steel-armored (Fig.~\ref{PT_det}). The same amount of ED links as in the SRR columns was provided in each of the PT columns. The PT columns were selected to be of the same diameter as the monolithic columns', i.e., 66 in. Once these parameters were fixed, the total area of the unbonded PT tendon and their initial posttensioning force were iteratively selected such that the PT pier's lateral load resistance got reasonably close to those of the monolithic and SRR piers (Fig.~\ref{push_comp}). The selected PT tendon (Grade 270 per~\cite{astm2016standard}) consisted of 65 0.6-in. dia. monostrands and its total initial PT force was 1,205 kips (equal to 35\% of its total yield strength). The height of the steel jacket, which was assumed to be made of A36 steel~\citep{astm2014standard}, was selected as 54 in. to avoid concrete spalling under the pier's MCE displacement demand. \begin{figure} \centering \includegraphics[scale=0.50]{Plot/Bridge_Desc_plot/PT_design.png} \caption{Design details of PT columns}\label{PT_det} \end{figure} \begin{figure} \centering \includegraphics[scale=0.90]{Plot/push_comp_pin} \caption{Comparison of pushover curves of three different bridge piers}\label{push_comp} \end{figure} \section{Numerical model}\label{Numerical} The 3D model of the bridge was developed through the finite element analysis program OpenSees~\citep{mckenna2011opensees}. The schematic of the numerical model is presented in Fig.~\ref{BridgeNum}. Major parts of the model are described in the separate sections below. \subsection{Superstructure and abutments} Elastic beam-column elements were used to model the superstructure's longitudinal spine as it was expected to remain elastic under earthquake excitation. At the two ends of the bridge, five series of zero-length elements were used to represent external shear keys (in the transverse direction), pounding (in the longitudinal direction), backfill soil (in the longitudinal direction), bearings (in the both transverse and longitudinal directions), and abutment piles (in the both transverse and longitudinal directions). Nearly rigid elastic elements were used to connect the above zero-length elements to the superstructure's spine elements. The zero-length elements representing the shear keys and bearings were connected in series to the zero-length elements representing the abutment piles, while the zero-length elements representing the pounding were connected in series to the zero-length elements representing the abutment's backfill soil. More details on the responses of these zero-length elements can be found elsewhere~\citep{mangalathu2016ancova, mangalathu2017performance, muthukumar2006hertz}. \begin{figure*} \centering \includegraphics[scale=0.45]{Plot/Bridge_Desc_plot/bridge_model.png} \caption{Finite element modeling of bridge with SRR columns}\label{BridgeNum} \end{figure*} \subsection{Columns} \paragraph{Monolithic RC columns.} Each monolithic column was modeled via a single gradient inelastic (GI) force-based beam-column element~\citep{sideris2016gradient, salehi2018finite, salehi2020assessing}. The GI element's characteristic length, $l_c$, was taken as the column's plastic hinge length calculated per~\cite{goodnight2016modified}. A total of 13 integration points were considered along each element to ensure objective responses upon softening~\citep{sideris2016gradient, salehi2017refined}. Each integration point was represented by a fiber section consisting of uniaxial material models simulating unconfined concrete, confined concrete, and longitudinal steel. The adopted uniaxial material models for concrete and reinforcing steel were the Kent-Scott-Park model~\citep{scott1982stress} and the Giuffre-Menegotto-Pinto model~\citep{giuffre1970behavior}, respectively. The behavior of the confined concrete was determined based on the Mander's model~\citep{mander1988theoretical}. \paragraph{PT columns.} Each PT column was modeled via two GI elements representing the jacketed and unjacketed lengths of the precast concrete segment, a multi-node co-rotational continuous truss element representing the central tendon, and multiple zero-length gap elements simulating the duct-tendon interactions at the joints ~\citep{salehi2020effect}. Three different fiber sections were used in the GI elements to represent the different regions of the column, i.e., its rocking joint, its jacketed length, and its non-jacketed length (e.g., see Fig.~\ref{ColNum}). The jacketed length's fiber sections did not have unconfined concrete regions and were enclosed by steel fibers representing the steel jacket. The rocking joint's fiber section was similar to the jacketed length's, except its material models did not resist tension. The GI element's characteristic length, $l_c$, was selected as the cross section radius. The ED links were simulated via co-rotational truss elements, which were connected to the column (at the node between the jacketed and unjacketed lengths) through nearly rigid elastic beam-column elements. The multi-node truss element consisted of four nodes, one at the anchorage point inside the footing, one at the footing-column joint location (connected through gap elements to fixed nodes at the same location), one at the column-superstructure joint location (connected through gap elements to the nodes that were connected to the superstructure's spine elements), and the last one at the anchorage point inside the superstructure (connected to the superstructure's spine elements). The posttensioning steel was represented by a tension-only material model following the backbone curve suggested by Mattock~\citep{mattock1979flexural} and capable of modeling the post-plasticity slackness of the strands~\citep{salehi2017numerical}. The Giuffre-Menegotto-Pinto model was used to simulate both the ED links and the steel jacket, while it was combined with a low-cycle fatigue model~\citep{uriz2005towards} in case of ED links to allow evaluating their cyclic damage after earthquakes. \paragraph{SRR columns.} The element configuration used to model SRR columns can be seen in Fig.~\ref{BridgeNum}. The height of each SRR column was discretized into two GI beam-column elements representing the jacketed and unjacketed lengths of the column and three different fiber sections were used to represent the different integration points (Fig.~\ref{ColNum}). Similarly to the PT columns, the fiber section representing the integration point at the rocking joint location consisted of compression-only material models. The intermediate node (between the two GI elements) was necessary to connect the co-rotational truss elements representing the SMA and ED links to the GI elements. The characteristic lengths of the GI elements, $l_c$, were selected as the radii of their respective cross sections. The concrete and steel material models used for modeling the SRR columns were similar to those used to model the PT columns. The superelastic NiTi was represented by the superelastic uniaxial material model, which is described subsequently. This model was calibrated based on the cyclic response of a 1-in. diameter superelastic NiTi rod tested by \cite{desroches2004cyclic} (Fig.~\ref{SMA_validation}(c)). \begin{figure} \centering \includegraphics[scale=0.75]{Plot/Bridge_Desc_plot/SRR_column_model.png} \caption{Fiber sections of beam-column elements representing SRR columns}\label{ColNum} \end{figure} \paragraph{Superelastic material model.} None of the uniaxial material models readily available in the material library of OpenSees could realistically capture the temperature dependence and the sub-cycles of the superelastic NiTi's hysteresis. As a result, for the simulation of SMA links in the SRR columns, a new material model, termed \emph{superelastic}, was developed and implemented in OpenSees. To capture the hysteresis sub-cycles, the superelastic model follows the basic loading/unloading rules of the trigger-line model proposed by~\cite{muller1991pseudo} - see Fig.~\ref{SMA_validation}(a). Moreover, as shown in Fig.~\ref{SMA_validation}(b), the transformation stresses of the material are considered to be linearly dependent on the ambient temperature~\citep{brinson1993one}. It is worth noting that, assuming that the superelastic NiTi bars used to make the SMA links are appropriately heat-treated, they are assumed to experience negligible residual/plastic deformations~\citep{salehi2022experimental}. Therefore, the developed superelastic material model considers full superelasticity. \begin{figure*} \centering \includegraphics[scale=0.25]{Plot/Bridge_Desc_plot/superelastic_model.png} \caption{Superelastic material model: (a) illustration of trigger-line model; (b) temperature dependence; (c) calibration per \cite{desroches2004cyclic} }\label{SMA_validation} \end{figure*} \section{Probabilistic seismic demand models}\label{PSDM} This section aims to: (1) explain the process of developing several PSDMs for the bridge with SRR columns using five different ML techniques (see Section \ref{overview}); (2) select the most efficient ML technique for developing the PSDMs; and (3) use various interpretation methods to explore the final developed PSDMs. \subsection{Design of experiment} A suite of ground motions selected by~\cite{baker2011new} was used in this study to account for the ground motion uncertainties. The original suite included 160 ground motion records consisting of 120 far-field and 40 near-fault ground motions. However, here, the suite was expanded to 320 records by scaling all the original 160 ground motions by a factor of 2 in order to include sufficiently strong ground motions~\citep{ramanathan2012next}. In addition, the uncertainties in the nonlinear behavior of the SRR columns due to the variations of material properties and ambient temperature, $T$, were included in the time history analyses. Table~\ref{table_input} summarizes the parameters of the distributions considered for different material properties. The coefficients of variation for concrete and steel properties were selected in accordance with~\cite{mangalathu2017performance}, whereas the coefficients of variation for NiTi properties were selected based on~\cite{gur2021design}. In addition, Table~\ref{table_input} includes the considered range of ambient temperature for the bridge location according to~\cite{aashto2012aashto}. Two design parameters of SRR columns, namely, self-centering coefficient, $\lambda$, and initial strain of SMA links, $\epsilon_{SMA,0}$~\citep{akbarnezhad2022seismic}, were also assumed to be randomly generated via uniform distributions with the parameters listed in Table~\ref{table_input}. According to \cite{akbarnezhad2022seismic}, $\lambda$ values of 0.0 and 1.0 correspond to the SRR column designs with the maximum possible ED links to maintain self-centering and without any ED links, respectively. Including the design parameters and the ambient temperature among the uncertain variables would allow exploring the effects of these parameters on the performance of the bridge with SRR columns subsequently. Latin Hypercube sampling was utilized to generate 320 sample pairs of ground motion and bridge model with randomly selected values for the variables of Table~\ref{table_input}. Subsequently, a nonlinear time history analysis was conducted for each sample to obtain the EDPs of interest (see Section~\ref{EDPs}). \begin {table*}[h!] \centering \caption{Considered distributions for different uncertain parameters; min. and max. values for normal and log-normal distributions correspond to the lower and upper truncated limits, respectively.} \label{table_input} \begin{tabular}{ p{6cm}p{1.cm}p{2cm}p{1.2cm}p{1.5cm}p{1.2cm}p{1.2cm}} \hline \multirow{2}{*}{Parameter} & \multirow{2}{*}{Unit} & \multicolumn{5}{c}{Statistical Distribution}\\ \cline{3-7} & & Distribution & Mean & COV (\%) & Min. & Max.\\ \hline Concrete compressive strength, $f'_c$ & ksi & Normal & 4.55 & 12.0 & 3.46 & 5.64\\ &&&&&&\\ Rebar yield strength, $f_{y,s}$ & ksi & log-normal & 69.0 & 8.0 & 58.8 & 81.0 \\ Steel jacket yield strength, $f_{y,j}$ & ksi & log-normal & 44.0 & 8.0 & 37.5 & 51.6\\ ED link yield strength, $f_{y,ED}$ & ksi & log-normal & 48.0 & 8.0 & 40.9 & 56.3\\ &&&&&&\\ NiTi martensite start stress, $\sigma_{Ms}$ & ksi & log-normal & 55.0 & 10.0 & 45.0 & 67.2\\ NiTi martensite finish stress, $\sigma_{Mf}$ & ksi & log-normal & 82.0 & 10.0 & 67.1 & 100.2\\ NiTi austenite start stress, $\sigma_{As}$ & ksi & log-normal & 55.0 & 10.0 & 45.0 & 67.2\\ NiTi austenite finish stress, $\sigma_{Af}$ & ksi & log-normal & 20.0 & 10.0 & 16.4 & 24.4\\ NiTi transformation strain, $\epsilon_L$ & in./in. & log-normal & 0.035 & 5.0 & 0.03 & 0.04\\ NiTi Young's modulus of austenite, $E_A$ & ksi & log-normal & 3700.0 & 5.0 & 3347.9 & 4089.1\\ NiTi Young's modulus of martensite, $E_M$ & ksi & log-normal & 3300.0 & 5.0 & 2986.0 & 3647.1\\ &&&&&&\\ Ambient temperature, $T$ & $^\circ$C & Uniform & 25.0 & 46.2 & 5.0 & 45.0\\ &&&&&&\\ Initial SMA link strain, $\epsilon_{SMA,0}$ & \% & Uniform & 0.75 & 57.7 & 0.0 & 1.5\\ Self-centering coefficient, $\lambda$ & - & Uniform & 0.5 & 57.7 & 0.0 & 1.0 \\ \hline \end{tabular} \end{table*} \subsection{Input features} In general, ML techniques allow developing PSDMs that depend on multiple input variables/features, e.g., ground motion IMs and design parameters. Within the framework of seismic risk assessment, in order to obtain the exceedance probability of a decision variable (such as repair cost), fragility functions need to be integrated with respect to the ground motion IMs predicted by seismic hazard curves~\citep{Cornell2000progress, moehle2004framework}. Despite the fact that many researches have explored the possibility of using a vector-valued IM as a substitute for a single IM in risk assessment~\citep{tothong2007probabilistic, baker2005vector, gehl2013vector,kohrangi2016vector}, the seismic hazard curves dependent on a vector-valued IM are not easily available~\citep{bazzurro2002vector, abrahamson2006seismic, silva2019current}. As a result, fragility functions and PSDMs are usually conditioned on a single IM rather than multiple IMs. It is worth noting that in cases where only the PSDMs are of interest (e.g., for seismic response prediction), however, those PSDMs that are trained based on multiple IMs could potentially be more useful~\citep{xu2020real}. Since the selected IM may significantly affect the degree of uncertainty of the PSDMs, the IM selection is not a trivial task and has been the subject of several past studies~\citep{giovenale2004comparing, baker2008vector, tothong2007probabilistic, eads2015average, hariri2016probabilistic, zelaschi2019critical, du2019posteriori,guo2020optimal, du2021entropy}. The process of selecting an appropriate IM for the PSDMs of the bridge with SRR columns is explained in Section~\ref{secCurse}. However, 11 ground motion characteristics were considered herein as potential IMs - see Table~\ref{table:IM}. All the considered IMs are independent of the structural properties to ensure they are conveniently hazard-computable. Overall, possible input features for training the PSDMs included all the variables listed in Table~\ref{table_input} plus a single IM. However, not all of these features were used in the final trained models to ensure robustness and efficiency, as discussed in Section~\ref{secCurse}. \begin{table}[] \caption{Potential intensity measures for PSDM development} \label{table:IM} \begin{tabular}{ll} \hline IM & \multicolumn{1}{c}{Definition} \\ \hline PGA & Peak ground acceleration \\ PGV & Peak ground velocity \\ PGD & Peak ground displacement \\ CAA & Cumulative absolute acceleration \\ CAV & Cumulative absolute velocity \\ CAD & Cumulative absolute displacement \\ CSA & Cumulative squared acceleration (Arias intensity) \\ CSV & Cumulative squared velocity \\ CSD & Cumulative squared displacement \\ $Sa_1$ & Spectral acceleration at period of 1 sec. \\ $Sa_{gm}$ & Geom. mean of $Sa$ for period range of 0.5-2 sec. \\ \hline \end{tabular} \end{table} \subsection{Engineering demand parameters}\label{EDPs} The EDPs of interest in this study represent both global and local responses. The selected global EDPs are the peak displacement demands at the deck ends in both transverse and longitudinal directions (to detect abutment unseating), the bent's peak drift ratio, and the bent's residual drift ratio. The selected local EDPs are the maximum tensile strains of the longitudinal rebar, the ED links, and the SMA links; the maximum compressive strains of the cover and core concrete; the low-cycle fatigue damage factors of the ED links; and the peak deformation demands of the shear keys and the bearing pads. \subsection{Data preprocessing} Before developing the PSDMs, both the input data and the predictions (i.e., the EDPs obtained via the time history analyses of the bridge with SRR columns) needed to be preprocessed. This step usually includes removing the potential outliers and variable transformations. As outliers, the data resulted from the incomplete analyses (i.e., without solution convergence) were removed - this included only a handful of cases. After the outlier treatment, the new data set was randomly split into training and test data sets. The training data set (here, comprising 70\% of the entire data) was used to train the PSDMs, while the test data set was used to measure the performance of the trained PSDMs. The variable transformations were carried out after splitting the data set to avoid "data leakage" from the test set to the training set. The variable transformations included the log-transformation of those EDPs that had skewed distributions and the normalization of the input features due to their different ranges. The former was done to improve the performance of the trained models and the latter was done to overcome the slow learning of certain ML models (e.g., using numerical optimization algorithms such as gradient descent~\citep{ruder2016overview}) and to avoid the dominance of the errors of large-valued feature in the loss function calculations. In this study, the input features were normalized via Z-score transformation. \subsection{Hyperparameter tuning} After the data preprocessing, any of the ML techniques described in Section~\ref{overview} could be used to train the PSDMs. Each ML model is trained through optimizing the associated objective function (e.g. cost function in neural network, information gain in decision tree). In addition, there are some other parameters that need to be specified prior to the training of each model, which are referred to as "hyperparameters". Examples of hyperparameters in the ML techniques considered herein include the regularization constant in the ridge regression, and the number of layers and the number of neurons within each layer in the neural network. Hyperparameter tuning is necessary to improve the performance of a trained model and avoid its overfitting. The hyperparamter tuning is usually achieved through grid/randomized search and cross-validation techniques~\citep{hastie2009elements}. The search methods simply seek the best combination of all hyperparameters (within prespecified ranges) that would maximize a selected cross-validated score (e.g., root mean square error and $R^2$). The main purpose of the cross-validation technique is to avoid overfitting, which would occur if the hyperparameters were merely selected based on the model's performance on the training data set. In this study, a five-fold cross-validation was used and $R^2$ was chosen as the performance metric that needed to be maximized through the hyperparameter tuning. \subsection{Dimensionality reduction}\label{secCurse} The term "curse of dimensionality" refers to the model training difficulties arising from having many input features relative to the number of observations (data sparsity). This is also known as the Hughes phenomenon~\citep{hughes1968mean}, which states that the overall power of a prediction model initially increases with the number of features/dimensions, but it stops increasing at some point and even deteriorates as the number of features increases further. This occurs because the data sparsity precludes the ML model from generalizing to the regions of feature space that do not have sufficient data for model training. In order to explore how different number of dimensions could affect the model performance, Fig.~\ref{CompPerf} compares the performance plots showing the actual peak bent drift values versus their corresponding neural network predictions for three cases: (1) the only feature considered is $Sa_1$ (i.e., only one IM); (2) the considered features include the two SRR column design parameters ($\epsilon_{SMA,0}$ and $\lambda$), the ambient temperature ($T$), and $Sa_1$ (i.e., one IM plus only three extra dimensions); (3) the considered features include all the IMs in Table~\ref{table:IM}, the SRR column design parameters, the material properties, and the ambient temperature (i.e., all the possible uncertain parameters). It is observed that adding new features has increased the model's performance in case~2 ($R^2=0.97$) with respect to case~1 ($R^2=0.91$). However, in case~3, adding multiple extra features has decreased the model's performance compared to case~2 ($R^2=0.94$ vs. $R^2=0.97$). This is attributed in part to the lower variances of the material properties compared to the two design parameters ($\epsilon_{SMA,0}$ and $\lambda$) and the ambient temperature ($T$), thereby giving the former features less predictive power. The potential correlation between the multiple IMs considered in case~3 could also have contributed to the model's lower performance in that case in comparison with case~2. Given the foregoing, the PSDMs developed for the bridge with SRR columns were decided to be similar to case 2 (i.e., their input features only included the design parameters, ambient temperature, and one IM ). The single IM used in the PSDMs was selected as explained below. \begin{figure*} \centering \includegraphics[scale=1.0]{Plot/fig5_marker} \caption{Performance comparison of longitudinal drift prediction model with different features: (a) single IM; (b) single IM + design parameters + ambient temperature; (c) multiple IMs + material properties + design parameters + ambient temperature.}\label{CompPerf} \end{figure*} \paragraph{Selection of optimal IM.} The optimal IM should have the following characteristics~\citep{padgett2008selection}: (\textit{i}) \emph{hazard computablity}, i.e., the hazard curve of that IM (obtained through probabilistic seismic hazard analysis) should be conveniently available; (\textit{ii}) \emph{proficiency}, i.e., the IM shall have a high predictive power; and (\textit{iii}) \emph{sufficiency}, i.e., the errors/residuals of the prediction model are independent of other ground motion parameters, such as magnitude and epicentral distance. For some of the selected IMs (see Table~\ref{table:IM}), namely, PGA, PGV, PGD, and $Sa_1$, the hazard curves are readily available from the U.S. Geological Survey~\citep{USGS}. In addition, according to several studies~\citep{jalayer2012analyzing, ebrahimian2015preliminary, du2019posteriori}, sufficiency is closely related to proficiency, so it is not a matter of concern provided that the IM proficiency is checked. Here, the levels of proficiency (higher importance and lower dispersion) of the possible IMs were examined by comparing the permutation feature importance~\citep{breiman2001random} values of the different IMs when all were included in PSDM development. The permutation importance can be computed for any feature regardless of the ML technique. The permutation importance of a feature equals the decrease in the prediction model's performance metric of interest (e.g., $R^2$) upon removing that feature from the model's input variables. The permutation importance values for all of the potential IMs used to train different ML models to predict the bent's peak drift ratio are listed in Table~\ref{table:Perm_Imp}. As seen, the $Sa_1$ has the largest importance for all the techniques. A similar trend was observed for other responses (except residual drift and damage factor for low-cycle fatigue of the ED links), although not shown here. Based on the permutation feature importance for all the EDPs, the $Sa_1$ outperforms the other IMs, so it was selected as the most appropriate IM for this study. \begin{table}[] \caption{Permutation importance values of different IMs used to predict bent's peak drift ratio (training data set)} \label{table:Perm_Imp} \begin{tabular}{lccccc} \hline Feature & RR & SVR & RF & AdaBoost & NN \\ \hline PGA & 0.09 & 0.1 & 0.06 & 0.05 & 0.07 \\ PGV & 0.001 & 0.005 & 0.001 & 0.002 & 0.005 \\ PGD & 0.01 & 0.04 & 0.01 & 0.02 & 0.004 \\ CAA & 0.02 & 0.09 & 0.04 & 0.02 & 0.04 \\ CAV & 0.001 & 0.002 & 0.002 & 0.001 & 0.0 \\ CAD & 0.004 & 0.005 & 0.001 & 0.001 & 0.0 \\ CSA & 0.07 & \textbf{0.14} & 0.08 & 0.05 & 0.13 \\ CSV & 0.0 & 0.002 & 0.001 & 0.0 & 0.001 \\ CSD & 0.006 & 0.007 & 0.002 & 0.005 & 0.001 \\ GMSa & 0.11 & 0.12 & 0.1 & 0.12 & 0.09 \\ {$Sa_1$} & \textbf{0.15} & \textbf{0.14} & \textbf{0.15} & \textbf{0.14} & \textbf{0.16} \\ \hline \end{tabular} \end{table} \subsection{Performance evaluation} In order to find the final PSDMs, for each ML method, a reasonable amount of hyperparameter tuning was performed until an efficient model was achieved. The values of two performance measures, i.e., $R^2$ and MSE, for all the final PSDMs of the bridge with SRR columns developed via various ML methods (on the test data set) are listed in Table~\ref{ModelQuality}. It is observed that, for almost all of the EDPs of interest, the neural network models have the best predictive performances (highest $R^2$ and lowest MSE) in comparison to other models. The only exception is for the low-cycle fatigue damage factor of the ED links, for which the AdaBoost model slightly outperforms the neural network model (with an $R^2$ of 0.8 vs. 0.78). The neural network models are found to only marginally outperform the support vector regression models. Except for the PSDMs developed for the bent's residual drift, max. SMA link strain, max. ED link strain, and max. ED link damage factor, the MSE values for all other neural network models are below 0.10. One should note that an MSE of 0.10 in the logarithmic space is equivalent to almost 10\% error in the real space. The max. SMA link strain is found to be predicted with much less error (lower MSE) through a neural network model compared to other ML models. The performance plots of the PSDMs developed for the max. SMA link strain using different ML techniques are compared in Fig.~\ref{PP_SMA}. As seen, all the models except the neural network model tend to slightly underestimate the response at higher levels. Given the foregoing, the PSDMs developed via the neural network method were used in the remainder of this study. \begin {table*}[h!] \centering \caption{Model performance measures for different ML techniques} \label{ModelQuality} \begin{tabular}{lcccccccccccccc} \hline & \multicolumn{2}{c}{NN} & \multicolumn{1}{l}{} & \multicolumn{2}{c}{SVR} & \multicolumn{1}{l}{} & \multicolumn{2}{c}{Ridge} & \multicolumn{1}{l}{} & \multicolumn{2}{c}{AdaBoost} & \multicolumn{1}{l}{} & \multicolumn{2}{c}{Random Forest} \\ \cline{2-3} \cline{5-6} \cline{8-9} \cline{11-12} \cline{14-15} Response & R2 & MSE & & R2 & MSE & & R2 & MSE & & R2 & MSE & & R2 & MSE \\ \hline Bent's peak drift ratio & \textbf{0.97} & \textbf{0.05} & & 0.95 & 0.09 & & 0.94 & 0.10 & & 0.96 & 0.06 & & 0.95 & 0.09 \\ Bent's residual drift ratio & \textbf{0.84} & \textbf{0.11} & & \textbf{0.81} & \textbf{0.11} & & 0.78 & 0.12 & & 0.76 & 0.12 & & \textbf{0.81} & \textbf{0.11} \\ Max. cover concrete strain & \textbf{0.93} & \textbf{0.09} & \textbf{} & \textbf{0.94} & \textbf{0.09} & & 0.91 & 0.13 & & 0.92 & 0.10 & & 0.94 & 0.10 \\ Max. core concrete strain & \textbf{0.94} & \textbf{0.09} & & \textbf{0.94} & \textbf{0.09} & & 0.92 & 0.10 & & 0.92 & 0.10 & & \textbf{0.94} & \textbf{0.09} \\ Max. longit. rebar strain & \textbf{0.93} & \textbf{0.09} & & \textbf{0.93} & \textbf{0.10} & & 0.92 & 0.12 & & 0.92 & 0.11 & & 0.93 & 0.11 \\ Max. SMA link strain & \textbf{0.94} & \textbf{0.11} & & 0.91 & 0.16 & & 0.89 & 0.18 & & 0.87 & 0.21 & & 0.89 & 0.18 \\ Max. ED link strain & \textbf{0.94} & \textbf{0.12} & & \textbf{0.93} & \textbf{0.12} & & 0.92 & 0.13 & & 0.90 & 0.13 & & 0.92 & 0.13 \\ Max. ED link damage factor & 0.78 & 0.31 & & 0.76 & 0.35 & & 0.72 & 0.41 & & \textbf{0.80} & \textbf{0.27} & & 0.78 & 0.32 \\ Max. bearing pad deformation & \textbf{0.95} & \textbf{0.05} & & \textbf{0.95} & \textbf{0.05} & \textbf{} & 0.95 & 0.06 & \textbf{} & 0.94 & 0.07 & \textbf{} & \textbf{0.95} & \textbf{0.05} \\ Max. deck end's displacement & \textbf{0.97} & \textbf{0.06} & & 0.96 & 0.07 & & 0.95 & 0.09 & & 0.94 & 0.11 & & 0.95 & 0.09 \\ Max. shear key deformation & \textbf{0.94} & \textbf{0.05} & & \textbf{0.95} & \textbf{0.05} & & 0.94 & 0.06 & & 0.93 & 0.07 & & 0.93 & 0.07 \\ \hline \end{tabular} \end{table*} \begin{figure*} \centering \includegraphics[scale=0.90]{Plot/fig_PP_SMA} \caption{Performance plots for PSDMs of SMA link strain developed via five different ML techniques: (a,f) neural network; (b,g) support vector regression; (c,h) ridge regression; (d,i) AdaBoost; (e,j) random forest }\label{PP_SMA} \end{figure*} \subsection{Interpretation}\label{interpret} In this study, four model-agnostic methods are used to interpret some of the developed PSDMs - these methods include: (\emph{i}) Individual Conditional Expectation (ICE), (\emph{ii}) Partial Dependence Plot (PDP), (\emph{iii}) Accumulated Local Effects (ALE), and (\emph{iv}) Shapley Additive Explanations (SHAP). Among these methods, the first and the fourth ones are \emph{local} methods, i.e., they inspect the effects of input features on individual predictions. However, PDP and ALE are \emph{global} methods, i.e., they inspect the average effect of each input feature on the overall model prediction. Although SHAP is considered a local method, several global interpretation methods have been developed by aggregating SHAP for a large number of individual predictions~\citep{chen2021explaining}. \paragraph{ICE and PDP.} ICE inspects the influence of a single feature on a single prediction by marginalizing the influences of the other features. Basically, an ICE plot shows the variation of a model's prediction with a selected feature, while the model's other input features are fixed at various values~\citep{goldstein2015peeking}. PDP is the global version of ICE, which is obtained by averaging many instances of ICE plots (e.g., see Fig.~\ref{PD1}). The main drawback of these methods is that, if some of the input features are correlated (which indeed is undesirable), then keeping one feature constant while varying the others to obtain the ICE plots (or subsequently, a PDP) could lead to misinterpretations. The ICE plots (for 40 combinations of fixed feature values) and their corresponding PDPs investigating the effects of $Sa_1$, $T$, $\epsilon_{SMA,0}$, and $\lambda$ on the max. ED link strain and the ED link fatigue damage factor are shown in Fig.~\ref{PD1}. Note that there is no correlation between the selected input features, so ICE and PDP are usable here. As expected, the ground motion IM (i.e., $Sa_1$) is found to have the most significant effects on the selected EDPs - increasing $Sa_1$ results in the constant increase in the max. ED link strain (Fig.~\ref{PD1}(a)) and the max. ED link fatigue damage factor (Fig.~\ref{PD1}(e)). As seen in Fig.~\ref{PD1}(b), since the SMA links exhibit higher strength at higher temperatures (see Fig.~\ref{SMA_validation}(b)), thereby increasing the lateral strength of the SRR columns, the joint opening, and subsequently, the max. ED link strain decreases with $T$ (up to 5\% on average). For the same reason, higher $T$ is found to reduce the max. ED link fatigue damage factor by ~40\% on average (Fig.~\ref{PD1}(f)). According to Fig.~\ref{PD1}(c), increasing $\epsilon_{SMA,0}$ from 0 to 1.5\% decreases the ED link strain by ~5\% on average. This finding is justified by the fact that prestraining the SMA links increases their energy dissipation capacity~\citep{akbarnezhad2022seismic}, thereby reducing the bent's peak drift demands and joint opening. Due to their decreased strain demands, the max. fatigue damage factor of the ED links is also found to decrease with $\epsilon_{SMA,0}$ up to ~25\% (Fig.~\ref{PD1}(g)). Per Fig.~\ref{PD1}(d), decreasing $\lambda$ from 1 to 0 does not affect the ED link strain demands in an average sense. However, for the examples with higher ED link strain demands, decreasing $\lambda$ decreases the ED link strain by ~5\% because the energy dissipation of the SRR columns increases~\citep{akbarnezhad2022seismic}. Likewise, the average ED link damage factor decreases by ~25\% as $\lambda$ is reduced from 1 to 0 (Fig.~\ref{PD1}(h)). \begin{figure*} \centering \includegraphics[scale=0.90]{Plot/PD_1_ED} \caption{ICE plots and PDPs for: (a-d) predicted max. ED link strain; (e-h) predicted max. ED link fatigue damage factor}\label{PD1} \end{figure*} \paragraph{ALE.} To tackle the inadequacy of the ICE and PDP methods in the presence of correlated features, one solution is to use conditional probability instead of marginal probability (for marginalizing the effects of the complementary set of features) to avoid the predictions associated with unrealistic combinations of correlated feature values. However, such an approach would let the correlated features influence the effect of the single feature of interest that is being investigated. To solve this issue, in the ALE approach, the gradients of the predictions with respect to the feature of interest are first computed, and then, these gradients are averaged over the conditional distribution of other features (local effects). Finally, a constant offset is applied to the computed value to make it centered - i.e., to make the mean effect zero. Integration of the local effects between two values of \textit{a} and \textit{b} is interpreted as the change in the prediction purely due to the feature's variation from \textit{a} to \textit{b}. This change in prediction can be seen as an independent measure of the effect of the feature on the prediction output~\citep{apley2020visualizing, mangalathu2022machine, molnar2020interpretable2}. In summary, the ALE value at each point represents the contribution of the feature of interest to the model prediction compared to the model's average prediction. It is noted that the values of the ALE and the PDPs are not expected to be the same, but their slopes can be interpreted similarly. Fig.~\ref{ALE1} shows the ALE plots aimed to explore the effects of the input features $Sa_1$, $T$, $\epsilon_{SMA,0}$, and $\lambda$ on the max. cover concrete strain and the bent's residual drift predictions. As expected, the positive slopes of the ALE plots in Fig.~\ref{ALE1}(a) and (e) verify that increasing $Sa_1$ would lead to increases in the max. cover concrete strain (due to increased curvature demands) and the bent's residual drift (due to increased plastic deformations under large displacement demands). According to the positive slope of the ALE plot in Fig.~\ref{ALE1}(b), the predicted max. cover concrete strain increases with the ambient temperature, too. This is because of the strength increase of the SMA links that would result in higher moment demands. The ALE plot for the effect of the ambient temperature on the bent's residual drift (Fig.~\ref{ALE1}(f)) exhibits positive and negative slopes at lower and higher ranges of $T$, i.e., a dual effect. Specifically, the initial SMA link strength increase induced by the temperature increase from 5$^\circ$C to about 20$^\circ$C results in higher residual drift demand predictions (likely because of the moment demand increase). However, further increase in the transformation stresses of the SMA links due to the temperature increase beyond 20$^\circ$C seem to actually have a decreasing effect on the bent's residual drift (likely because of the self-centering capacity increase). Per Fig.~\ref{ALE1}(c), increasing the initial strain of the SMA links, $\epsilon_{SMA,0}$, from 0 to 1.5\% is found to lead to higher max. cover concrete strain predictions (likely because of the moment demand increase). In terms of residual drift predictions, $\epsilon_{SMA,0}$ is found to have a slight decreasing effect (Fig.~\ref{ALE1}(g)), as higher prestraining could slightly increase the energy dissipation of SRR columns~\citep{akbarnezhad2022seismic}. According to Fig.~\ref{ALE1}(d), reducing self-centering coefficient, $\lambda$, from 1 to 0 (which results in higher energy dissipation, hence lower displacement demands) is observed to decrease the max. cover concrete strain predictions. However, $\lambda$ is found not to have a clear and significant effect on the bent's residual drift predictions (Fig.~\ref{ALE1}(h)). \begin{figure*} \centering \includegraphics[scale=0.65]{Plot/ALE_1_residual} \caption{ALEs of $Sa_1$, $T$, $\epsilon_{SMA,0}$, and $\lambda$ on: (a-d) predicted max. cover concrete strain; (e-h) predicted bent's residual drift}\label{ALE1} \end{figure*} \paragraph{SHAP.} The SHAP method gives an insight into the effects of different input features on the model prediction through the \emph{Shapley/SHAP values}. The SHAP value is a solution concept in game theory to fairly distribute the payouts to players depending on their contributions to the total payout~\citep{shapley1953quota}. In the context of model interpretation, the SHAP value of each feature for a certain prediction quantifies that feature's contribution to pushing the prediction lower or higher from the model's average prediction or base value. Accordingly, the sum of the SHAP values of all features for a certain prediction is equal to the difference between that prediction and the base value. In that sense, one can describe the SHAP method as a local version of the ALE method to inspect individual predictions with respect to the average prediction. However, the SHAP values are computed entirely differently~\citep{vstrumbelj2014explaining, lundberg2017unified}. Though the SHAP method is a local interpretation method, aggregating the SHAP values for many prediction examples results in the global SHAP dependence plot, which is further discussed later on. Fig.~\ref{shap1} illustrates the contributions of different features to the bent's peak drift ratio for a single prediction via a \emph{force plot}, which is a scaled visualization of the SHAP values. The feature values for the examined prediction are $Sa_1=0.37g$, $T=34^{\circ}$C, $\epsilon_{SMA,0}=1.3\%$, and $\lambda=0.72$. According to the force plot, the natural logarithm of the drift for this example is 0.49 smaller than the base value (-0.18). Moreover, it is observed that, for this certain prediction, $Sa_1$, $T$, and $\epsilon_{SMA,0}$ have pushed the natural logarithm of the peak drift ratio below its average by 0.45, 0.04, and 0.02, respectively. On the contrary, $\lambda$ has pushed the natural logarithm of the peak drift ratio above its average by 0.02. \begin{figure*} \centering \includegraphics[scale=0.95]{Plot/force_plot.png} \caption{Force plot for a single prediction of bent's peak drift}\label{shap1} \end{figure*} Fig.~\ref{shap2} presents the SHAP summary plots for the bent's peak drift and the max. longitudinal rebar strain PSDMs. Each summary plot summarizes the SHAP values for all the features and all the prediction instances within the data set - each dot represents the contribution of one feature to one prediction instance. The order of the features on the y-axis is determined based on their average importance, with the most important feature appearing at the top. Per Fig.~\ref{shap2}, $Sa_1$ has the most significant effects on the predictions of both EDPs and the higher $Sa_1$ is, the higher the selected EDP predictions are. As expected per earlier interpretations, the influences of $\epsilon_{SMA,0}$, $\lambda$, and $T$ on both EDPs are not as significant as that of $Sa_1$. As seen, $T$ is the second important feature for both prediction models. It is noted that since the SMA links exhibit higher strength at higher temperatures, thereby increasing the bent's lateral strength, its peak drift predictions decrease as $T$ increases (Fig.~\ref{shap2}(a)). However, the increased lateral strength leads to higher longitudinal rebar strain demands (Fig.~\ref{shap2}(b)). Per Fig.~\ref{shap2}(a), lower values of $\lambda$ are found to negatively contribute to the bent's peak drift predictions because the energy dissipation of the SRR columns increases as $\lambda$ decreases \citep{akbarnezhad2022seismic}. Likewise, lower values of $\lambda$ are found to less significantly contribute to the max. longitudinal rebar strain predictions (Fig.~\ref{shap2}(b)). Fig.~\ref{shap2} also shows that, among the input features, $\epsilon_{SMA,0}$ has a relatively inconsequential influence on both EDP predictions. \begin{figure} \centering \includegraphics[scale=0.50]{Plot/Shap_2} \includegraphics[scale=0.50]{Plot/Shap_2b} \caption{Summary of SHAP values for: (a) peak bent drift ratio predictions; (b) max. longitudinal rebar strain predictions}\label{shap2} \end{figure} \section{Seismic fragility analyses}\label{frag_anal} The objectives of this section are to: (1) develop multi-parameter fragility functions for the bridge with SRR columns; (2) examine the effects of the key SRR column design parameters on the developed fragility functions while considering the effect of ambient temperature; and (3) compare the fragility functions of the bridge with SRR columns with those of the bridges of monolithic RC and PT columns. \subsection{Fragility function development}\label{frag_func} Fragility functions were developed for 11 DSs related to eight different bridge components, which are summarized in Table~\ref{Capacity models}. It is worth mentioning that, since the predicted maximum low-cycle fatigue damage factors for the ED links were rather small (rarely exceeding 0.2 for $Sa_1$ up to 1.5g), no meaningful damage states representing fatigue could be defined. A two-stage approach (see Section~\ref{ML_based}) was used to develop the fragility functions for the bridge with SRR columns. For this purpose, according to the procedure illustrated in Fig.~\ref{flowchart}, initially, a large number (in the order of $10^4$) of combinations of input feature values were generated using the Latin Hypercube sampling and based on their preselected distributions (see Table~\ref{table_input}). Subsequently, the PSDMs developed in Section~\ref{PSDM} were used to predict the EDPs of interest corresponding to each sampled combination of input features. The predicted EDPs were then used along with Monte Carlo simulations to compute the exceedance probabilities, $P_f$, of various limit states (LSs) according to their corresponding capacity models, which were assumed to be of log-normal distributions (Table~\ref{Capacity models}). Finally, neural network models with ReLU and linear activation functions at their intermediate and last layers, respectively, were trained to represent the fragility functions. In order to ensure that the exceedance probability predictions of the fragility functions are meaningful, i.e., between 0 and 1, the target values in the training data sets (exceedance probabilities) were initially transformed into a range of ($-\infty, +\infty$) using the \emph{logit} function. Therefore, the outputs of the trained models needed to be transformed back into a range of [0, 1] using the \emph{logistic} function. \begin {table*}[h!] \centering \caption{Considered capacity distributions for different damage states} \label{Capacity models} \begin{tabular}{lccccccc} \hline Damage State ID & Description & EDP & $ln$(Median, $S_c$) & Dispersion, $\beta_C$ \\ \hline I-1 & Column longitudinal rebar yielding & Max. tensile strain & $f_y/E$ & 0.35 \\ I-2 & Column longitudinal rebar fracture & Max. tensile strain & 0.15 & 0.35 \\ II-1 & Column cover concrete spalling & Max. compressive strain & 0.005 & 0.35 \\ II-2 & Column core concrete crushing & Max. compressive strain & $\epsilon_{cu}$ & 0.35 \\ III & SMA link permanent deformation & Max. tensile strain & $\epsilon_L+\sigma_{Mf}/E_M$ & 0.35 \\ IV & Bearing pad yielding & Peak deformation & 7.5 in. & 0.35 \\ V & Shear key failure & Peak deformation & 3.5 in. & 0.35 \\ VI & Abutment unseating & Peak deck end displacement & 21 in. & 0.35 \\ VII & Bent major residual deformation & Bent residual drift & 1\% & 0.35 \\ \hline \end{tabular} \end{table*} \begin{figure} \centering \includegraphics[scale=0.90]{Plot/fragility_chart_two_stage.png} \caption{Procedure of fragility function development}\label{flowchart} \end{figure} The neural network models representing the fragility functions were trained similarly to the PSDMs (see Section~\ref{PSDM}), aiming to minimize the cost function while tuning the hyperparameters to avoid overfitting based on MSE and $R^2$. The final MSE and $R^2$ of the fragility functions for all the damage states on the test data set were in the orders of 0.01 and 0.99-1.0, respectively, implying that the most significant sources of error for the fragility predictions within this framework were the PSDMs. For instance, the MSE and $R^2$ score on the test set for the fragility function of the abutment unseating were 0.01 and 1.0, respectively. To further evaluate the developed models based on the metrics used for classification models, e.g., recall and precision, the failure probabilities predicted for the test data were converted to non-failure/failure (0 or 1) binaries according to a threshold (e.g. 0.5). A higher precision indicates the model's higher power not to predict failure (1) for a real non-failure instance (0), while a higher recall indicates the model's higher power not to predict non-failure (0) for a real failure instance (1). All the developed fragility functions led to very high values of recall and precision (~1.0). For instance, the confusion matrix corresponding to the mapped fragility predictions for the test data (3000 data points) for bearing pads is shown in Fig~\ref{ConfM}. Accordingly, out of the 3000 examples, there are only 6 false positives and 10 false negatives, leading to recall and precision scores of about 0.99. \begin{figure} \centering \includegraphics[scale=0.7]{Plot/Conf_M.pdf} \caption{Confusion matrix for fragility prediction of bearings}\label{ConfM} \end{figure} \subsection{Effects of SRR column design parameters} The fragility curves obtained for seven DSs (I-1, II-1, III, IV, V, VI, and VII per Table~\ref{Capacity models}) and three different values of each of the SRR column key design parameters, i.e., $\epsilon_{SMA,0}$ and $\lambda$, are compared in Fig.~\ref{FragSum1}. For the fragility curves of various $\epsilon_{SMA,0}$ and $\lambda$ values, $\lambda$ and $\epsilon_{SMA,0}$ were fixed at their average values, i.e., 0.5 and 0.75\%, respectively. It is also worth mentioning that each curve was obtained considering the worst effect of ambient temperature. According to Fig.~\ref{FragSum1}(g, i, k, m), the exceedance probabilities of damage states IV (bearing yielding), V (shear key failure), VI (unseating), and VII (major residual) decrease with increasing $\epsilon_{SMA,0}$. This is because such DSs are directly related to the bridge displacement demands, which are reduced as the energy dissipation of the SRR columns increases with increasing $\epsilon_{SMA,0}$ (see the discussion in Section~\ref{interpret}). Contrarily, it is observed in Fig.~\ref{FragSum1}(a, c) that the exceedance probabilities for damage states I-1 (rebar yielding) and II-1 (cover spalling) increase with $\epsilon_{SMA,0}$, which can be attributed to the increased base shear/moment demands for larger $\epsilon_{SMA,0}$. As expected, increasing the initial strains of the SMA links further leads to their increased strain demands, thereby increasing the exceedance probability for their permanent deformations (damage state IV, Fig.~\ref{FragSum1}(e)). Before examining the effects of $\lambda$ on the obtained fragility curves, it is reminded that the $\lambda$ values 0.0 and 1.0 correspond to the SRR column designs with the maximum possible ED links to maintain self-centering and without any ED links, respectively~\citep{akbarnezhad2022seismic}. As seen in Fig.~\ref{FragSum1}(b, d, f, h, j, l, n), the exceedance probabilities of all of the examined DSs increase with $\lambda$. This is because, as discussed in Section~\ref{interpret}, increasing the amount of ED links (smaller $\lambda$) results in higher energy dissipation, and thus, smaller displacement demands. It is particularly interesting to observe that the probability of exceeding 1\% of bent residual drift (which is often considered large enough to necessitate bridge replacement~\citep{japan2002design, xiang2020probabilistic}), i.e., damage state VII, is also minimum when $\lambda = 0$, which indicates the importance of energy dissipation in reducing even the residual deformations. However, it is worth noting that, per ~\cite{akbarnezhad2022seismic}, the residual deformations of SRR columns are expected to increase as $\lambda$ gets smaller than 0. \begin{figure}[hb!] \centering \includegraphics[scale=0.83]{Plot/Frag_sum_rebar} \includegraphics[scale=0.83]{Plot/Frag_sum_conc} \includegraphics[scale=0.83]{Plot/Frag_sum_SMA} \includegraphics[scale=0.83]{Plot/Frag_sum_bearing} \includegraphics[scale=0.83]{Plot/Frag_sum_shearkey} \includegraphics[scale=0.83]{Plot/Frag_sum_unseating} \includegraphics[scale=0.83]{Plot/Frag_sum_residual} \caption{Effects of $\epsilon_{SMA,0}$ and $\lambda$ on fragility curves of bridge with SRR columns}\label{FragSum1} \end{figure} \subsection{Comparison with other column designs}\label{col_frag_comp} In order to assess the seismic vulnerability of the bridge with SRR columns relative to similar bridges but with monolithic RC and PT columns, the fragility functions of these bridges are compared in this section. The fragility functions of the latter bridges were developed through the same two-stage ML-based approach described earlier for the bridge with SRR columns. The fragility curves obtained for various DSs (I-1, I-2, II-1, II-2, IV, V, VI, and VII per Table~\ref{Capacity models}) of the three bridges are compared in Fig.~\ref{frag}. For the bridge of SRR columns, $\epsilon_{SMA,0}$ and $\lambda$ were fixed at 1.5\% and 0.0, while $T$ was assumed to be uncertain (see Table~\ref{table_input}). According to Fig.~\ref{frag}(a, b, c, d), the damage states associated with the columns' longitudinal rebar and concrete (I-1, I-2, II-1, and II-2) are all much likelier for the bridge of monolithic RC columns than for the bridges of PT and SRR columns. Specifically, the median $Sa_1$ at which column cover concrete spalling (damage state II-1) is predicted for the bridge of monolithic RC columns is almost 0.3g, while for the bridges of PT and SRR columns, the median $Sa_1$ for the same DS seem to be much larger than 1.5g (Fig.~\ref{frag}(c)). Likewise, though the predicted median $Sa_1$ for column core concrete crushing (damage state II-2) in the bridge of monolithic RC columns is almost 1.15g, this DS is not predicted to be exceeded in the bridges of PT and SRR columns (Fig.~\ref{frag}(d)). These findings primarily prove the damage mitigation efficacy of steel jacketing in the vicinity of the rocking joints. In terms of column longitudinal rebar yielding (damage state I-1), replacing the bridge's monolithic RC columns with PT and SRR columns is found to increase the respective median $Sa_1$ by more than 500\% (from ~0.2g to >1.25g; Fig.~\ref{frag}(a)). This was indeed expected because rocking joints inherently reduce the strain demands in the longitudinal rebar. Compared to rebar yielding, for the considered range of $Sa_1$, the probability of column longitudinal rebar fracture (damage state I-2) in all three bridges is extremely low (Fig.~\ref{frag}(b)). Focusing on the fragility curves of the PT and SRR columns, it is observed that the SRR columns appear to be somewhat less seismically vulnerable than the PT columns of similar lateral load resistance and ED links (Fig.~\ref{frag}(a, c)). The lower probability of cover concrete spalling (damage state II-1) in the SRR columns compared to the PT columns (Fig.~\ref{frag}(c)) is mainly attributed to the lower axial force demands in the SRR columns than in the PT columns~\citep{akbarnezhad2022bridge}. However, The lower probability of longitudinal rebar yielding (damage state I-1) in the SRR columns compared to the PT columns (Fig.~\ref{frag}(a)) may be justified by the larger height of the steel jacket in the designed SRR columns compared to the designed PT columns. Based on Fig.~\ref{frag}(e, f, g, h), as for other bridge damage states (IV, V, VI, and VII), the three bridges with different columns seem to be of similar fragility, except in terms of the bent's major residual deformation (damage state VII). Specifically, despite the lower energy dissipation capacity of rocking columns relative to the monolithic RC columns of similar lateral load resistance, which may lead to their higher drift ratio demands~\citep{lee2011performance}, the exceedance probabilities of bearing pad yielding (damage state IV), shear key failure (damage state V), and abutment unseating (damage state VI) at similar $Sa_1$ levels are very close (Fig.~\ref{frag}(e, f, g)). On the other hand, for the selected $Sa_1$ range, the probability of major residual drift (>1\%) in the monolithic RC bent is up to almost 3 times those in the bents of PT and SRR columns (Fig.~\ref{frag}(h)), demonstrating the self-centering efficacy of the rocking columns. \begin{figure}[hb!] \centering \includegraphics[scale=0.90]{Plot/frag2} \caption{Comparison of fragility curves for three different bridges: (a) I-1; (b) I-2; (c) II-1; (d) II-2; (e) IV; (f) V; (g) VI; (h) VII }\label{frag} \end{figure} \section{Summary and conclusions}\label{conclusions} This paper primarily aimed to evaluate the seismic fragility of a two-span RC highway bridge equipped with SRR columns through ML techniques. To this end, first, multi-parameter PSDMs were developed for multiple global and local EDPs using five different ML techniques, including (\emph{i}) ridge regression, (\emph{ii}) kernel support vector regression, (\emph{iii}) random forest, (\emph{iv}) adaptive boosting, and (\emph{v}) neural network. The input features of the initial PSDMs included a number of different ground motion characteristics as potential IMs, various material properties, two key SRR column design parameters (including the self-centering coefficient, $\lambda$, and the initial SMA link strain, $\epsilon_{SMA,0}$), and ambient temperature, $T$. To reduce the dimensionality of the initial PSDMs (without significant loss of their predictive power), the input features were subsequently reduced to only one “proficient” IM, $\lambda$, $\epsilon_{SMA,0}$, and $T$. In the next step, the performances of the PSDMs developed using various ML techniques were evaluated through $R^2$ and MSE metrics, and the most accurate PSDMs were selected. Following the selection of final PSDMs, the effects of $\lambda$, $\epsilon_{SMA,0}$, and $T$ on various EDPs were investigated through four model-agnostic local and global interpretation methods, namely, ICE, PDP, ALE, and SHAP. Subsequently, seismic fragility functions were developed for nine different DSs using neural networks, the selected PSDMs, and appropriate capacity models. Finally, the effects of $\lambda$ and $\epsilon_{SMA,0}$ on the fragility curves were investigated and the fragility curves of the bridge with SRR columns were compared with those of similar bridges with monolithic RC and PT columns. The major findings of this study are summarized below. \begin{itemize} \item Among the examined ground motion IMs, based on the permutation feature importance, the spectral acceleration at the period of 1 sec., $Sa_1$, was found to be more suitable to represent the ground motion intensity in the PSDMs of the bridge with SRR columns. \item Overall, among the ML techniques used to develop the PSDMs for the bridge with SRR columns, the neural network was found to result in the most accurate prediction models, leading to $R^2$ scores as high as 0.97 and MSE as low as 0.05. \item According to the PSDM interpretations, increasing $\epsilon_{SMA,0}$ decreases the SRR pier’s drift ratio demand, which in turn reduces the ED link strain demand. However, the prestressing of the SMA links slightly increases the moment demand in the SRR columns, leading to slightly higher longitudinal rebar and cover concrete strain demands. \item The PSDM interpretations also showed that decreasing $\lambda$, which amounts to increasing the ED links, slightly reduces the rebar and concrete damage in SRR columns. However, as long as $\lambda$ remains non-negative, the SRR bent’s residual drift ratio is not meaningfully affected by $\lambda$. \item Based on the PSDM interpretations and because the SMA links exhibit higher strength at higher temperatures, increasing $T$ was found to slightly increase the longitudinal rebar and concrete strain demands. \item According to the fragility curves generated for the bridge with SRR columns, decreasing $\lambda$ to 0 (the minimum value allowed to ensure adequate self-centering) reduced the probabilities of exceedance of all the examined DSs. Contrarily, increasing $\epsilon_{SMA,0}$ to 1.5\% slightly reduced the probabilities of exceedance of displacement-dependent DSs (e.g., bearing damage and abutment unseating), while slightly increasing the probabilities of exceedance of strain-dependent DSs (e.g., longitudinal rebar yielding and concrete spalling). \item Comparing the fragility curves for the bridges of SRR columns, monolithic RC columns, and PT columns showed that the SRR columns can seismically perform as well as (or even better than) the PT columns of similar lateral strengths. However, it was proven that both PT and SRR columns, which both benefit from rocking joints, can significantly outperform the monolithic RC columns in terms of longitudinal rebar and concrete damage, as well as residual deformations. \end{itemize} Overall, the findings of this study indicated that, even if the ambient temperature's uncertainty is taken into account, bridges of SRR columns can perform as well as (or even better than) bridges of PT columns. This conclusion besides the higher durability (due to the excellent corrosion resistance of NiTi) and easier repair (due to the easy replaceability of the SMA links) of SRR columns compared to PT columns can make SRR columns arguably suitable alternatives to PT columns. \bibliographystyle{cas-model2-names} \section{Introduction}\label{intro} Bridges are among the key elements of transportation networks, making their continuous functionality crucial to the socioeconomic prosperity of modern communities. In order to effectively and efficiently manage and maintain the bridges in seismic regions, seismic risk assessments are necessary~\citep{chang2000probabilistic, kiremidjian2007seismic, padgett2007bridge, padgett2010regional, kameshwar2014multi}. Seismic fragility functions, which determine the probabilities of exceeding various damage states (DSs) based on ground motion and structural characteristics~\citep{shinozuka2000statistical, shinozuka2000nonlinear, choi2004seismic, nielson2007analytical, padgett2008methodology}, are prerequisites to the seismic risk assessment of bridges. In addition to their paramount role in seismic risk assessment, fragility functions can provide great insights into the seismic performance of bridges (globally) and their components (locally), and thus, they can be used to probabilistically evaluate the seismic damage mitigation benefits of innovative bridge systems in comparison with their conventional counterparts~\citep{billah2012seismic, muntasir2015seismic, billah2018probabilistic, todorov2021seismic, salkhordeh2021seismic, fan2021machine, lu2022seismic}. Building upon the previous efforts on the seismic design of the so-called \emph{Shape Memory Alloy (SMA)-Restrained Rocking (SRR)} columns and the deterministic seismic performance assessment of the bridges equipped with those columns~\citep{akbarnezhad2022seismic,akbarnezhad2022bridge}, this paper aims to, first, evaluate the seismic vulnerability of the bridges of SRR piers by developing multi-parameter fragility functions using advanced machine learning (ML) techniques; and second, compare their seismic vulnerability with those of the bridges of posttensioned (PT) and monolithic reinforced concrete (RC) columns. \section{Background}\label{background} \subsection{SRR bridge columns}\label{SRR} SMAs are a class of “smart” materials capable of recovering their original shape after relatively large deformations (up to 6-8\% of strain), which is referred to as \emph{superelasticity} effect~\citep{hodgson1990shape,lagoudas2008shape}. The flag-shaped hysteretic behavior of SMAs has made them particularly attractive for the development of seismically-resilient structural components that would benefit from self-centering capabilities~\citep{desroches2004shape, ozbulut2011seismic}, including innovative bridge columns~\citep{wang2005study, saiidi2006exploratory, billah2012sma, moon2015seismic, tazarv2015reinforcing, tazarv2016low, varela2016bridge, varela2017resilient, tazarv2020analysis}. SRR columns, which were recently proposed within this context~\citep{akbarnezhad2022seismic}, are precast concrete columns with end steel-armored rocking joints controlled through two series of unbonded links: (\textit{i}) prestressed SMA links made of superelastic nickel-titanium (NiTi) alloy, and (\textit{ii}) energy-dissipating (ED) links made of mild steel (Fig.~\ref{SRR_joint}). The SMA links provide SRR columns with self-centering, while the ED links supplement the moderate energy dissipation provided by the SMA links. SRR columns are designed in a performance-based manner with the objective of sustaining minimal damage and residual displacement under the Maximum Considered Earthquake (MCE) hazard~\citep{akbarnezhad2022seismic}. Compared to the rocking columns posttensioned through internal high-strength steel tendons, SRR columns offer higher durability (due to the excellent corrosion resistance of NiTi) and easier repair (due to the easy replacement of SMA links). \begin{figure} \centering \includegraphics[scale=0.92]{Plot/SRR_Column.png} \caption{Illustration of an SRR column with bottom rocking joint (design variation 1 per~\cite{akbarnezhad2022seismic})}\label{SRR_joint} \end{figure} In a recent study~\citep{akbarnezhad2022seismic}, three SRR column design variations were introduced and evaluated under cyclic lateral loading through 3D nonlinear continuum-based finite element models. The simulation results demonstrated that all three variations were successful in achieving the desired performance objectives, particularly, preventing concrete spalling and longitudinal rebar yielding over the unjacketed lengths of the columns and limiting their residual drift ratio to less than 0.3\% after being subjected to MCE displacement demands. More recently, \cite{akbarnezhad2022bridge} evaluated the seismic performances of two reinforced concrete (RC) bridges equipped with SRR columns through multiple nonlinear time history analyses and considering three discrete hazard levels. The results of this study showed that: (1) when properly designed, SRR columns are capable of achieving their targeted seismic performance objectives (i.e., damage and residual displacement prevention under MCE hazard); (2) vertical excitation and near-fault ground motions have inconsequential effects on the seismic damage of SRR columns; and (3) ambient temperature has very limited effect on the performance of SRR columns during earthquakes. \subsection{ML-based seismic fragility assessment}\label{ML_based} As mentioned earlier, seismic fragility functions are intended to compute the exceedance probabilities of various DSs given ground motion and structural characteristics~\citep{basoz1999statistical, mander1999seismic, shinozuka2000statistical}. In the literature, two approaches have been generally taken to develop analytical fragility functions, which are herein referred to as \emph{one-stage} and \emph{two-stage}. In both approaches, fragility functions are developed based on the exceedance probabilities that are obtained through the comparison of engineering demand parameters (EDPs), which represent various local/global structural responses, with respective capacities. However, the EDPs used in the two approaches are determined differently. In the one-stage approach, the EDPs are directly obtained from nonlinear time history analyses, necessitating a large data set~\citep{shinozuka2000statistical, shinozuka2000nonlinear, der2002seismic, porter2007creating, zhang2009evaluating, baker2011fitting, baker2015efficient, alam2012seismic, kiani2019application, salehi2020assessing, ghosh2021seismic, wang2022deep, rajkumari2022fragility}. In the two-stage approach, which is more commonly used than the one-stage approach, the EDPs are estimated via the so-called \emph{probabilistic seismic demand models} (PSDMs), which are initially generated based on the data obtained from the nonlinear time history analyses~\citep{choi2004seismic, nielson2007seismic, nielson2007analytical, padgett2008methodology, ramanathan2010analytical}. The two-stage approach could be helpful especially when the data set obtained from the nonlinear time history analyses is not sufficiently large. However, it could potentially introduce additional error (epistemic uncertainty) into the resulting fragility functions~\citep{der2009aleatory, zhang2009evaluating, muntasir2015rev, bakalis2018seismic, zhang2020seismic, flenga2021fragility, conde2022seismic}. Even though the common approach to develop PSDMs is using linear regression~\citep{xiang2019comparative, xiang2020probabilistic, wei2020evaluation, chen2021seismic}, which facilitates both model training and interpretation, the resulting linear regression models could not always represent the seismic response of structures with a high accuracy~\citep{ghosh2013surrogate, rokneddin2014seismic, mangalathu2018critical}. Moreover, linear regression models become even less effective/accurate if more than one independent variable are of interest in the PSDM development (i.e., not only a single IM)~\citep{dukes2013application, jeon2019parameterized}. Another limiting assumption within the traditional framework is that the probability distributions of different DSs have to be assumed (often, log-normal) resulting in fragility functions of low accuracy~\citep{noh2015development}. Given the foregoing and due to the significant predictive power offered by ML models, in recent years, ML techniques have been used for the development of fragility functions~\citep{ soleimani2022state, xie2020promise, soleimani2022probabilistic}. ML techniques allow developing more accurate PSDMs by avoiding the simplifying assumptions adopted by other approximate methods.~\citep{lagaros2007, jia2022structural}. While single-parameter PSDMs are primarily employed to develop fragility functions, ML-based multi-parameter PSDMs could be used for several other purposes, too, such as fast seismic performance assessment of bridges after earthquakes~\citep{mangalathu2019rapid, xu2020real, todorov2022post}, seismic design optimization of bridges~\citep{dukes2018development, fan2021machine}, and probabilistic investigation of effects of various geometric/material/design parameters on the seismic performance of bridges~\citep{moradi2018parameterized, mangalathu2019rapid, jeon2019parameterized}, especially innovative systems~\citep{shi2022seismic}. Among the different ML techniques, several previous studies have used artificial neural networks to develop PSDMs for different types of structures~\citep{jia2022structural}. With the primary objective of reducing the computational cost of structural analysis, \cite{lagaros2007} proposed the rapid evaluation of seismic demands in steel building frames using a neural network. \cite{huang2020predicting} proposed an artificial neural network (ANN)-based capacity prediction model in order to take account of the uncertainty of the seismic performance of the reinforced concrete (RC) bridge columns. In order to eliminate the need for grouping the bridge classes based on their geometric characteristics (e.g., number of spans, number of columns per bent, and skew angle), \cite{mangalathu2018artificial} employed neural network (for PSDM development) and LASSO logistic regression (for fragility function development) to produce multi-parameter bridge-specific fragility functions. Other ML techniques have also been used for the development of fragility functions while studying the significance of parameter contributions to the output. In a study by~\cite{ghosh2013surrogate}, to develop bridge fragility functions, four different surrogate models (prediction models), namely, polynomial response surface, multivariate response adaptive regression spline, radial basis function networks, and support vector machines were explored and it was found that metamodels are capable of adequately and efficiently predicting bridge-specific seismic reliabilities with low computational cost. \cite{jeon2019parameterized} used multiple linear regression (for PSDM development) and logistic regression (for fragility function development) to develop bridge-specific fragility functions and showed that the stepwise removal process via a Bayesian parameter estimation method facilitates identifying the significant uncertain parameters. For the same purpose, \cite{mangalathu2019stripe} proposed using random forest, while their proposed method facilitated updating the fragility functions for new sets of input parameters. \cite{kiani2019application} also explored the application of one-stage classification-based ML algorithms in deriving seismic fragility curves for maximum inter-story drift ratio of an 8-story special steel moment resisting frame building and examined the significance of different IMs on the output based on LASSO and logistic methods. To predict seismic response of bridges against lateral spreading, \cite{wang2021seismic} examined five ML techniques, namely, multiple linear regression, LASSO regression, neural network, random forests, and gradient boosting and compared their performance using the coefficient of determination, $R^2$, and performance plot. Moreover, they tried to identify the most significant IM and explored the relative importance of the input variables obtained from the white-box models (all except neural network, which is deemed a black-box model). \cite{soleimani2022bridge} developed a framework for probabilistic seismic resilience assessment of common highway bridges using ensemble learning-based predictive, namely, bagging and boosting techniques. The final output could predict resilience index as a function of seismic events and bridge characteristics. In addition to the high predictive power of the ML-based prediction models, interpretation of these models would provide insight into the mechanics of the problem~\citep{mangalathu2020failure, sun2021machine}. Interpretation of ML models refers to understanding the general relationships governing the data that are learned by the models~\citep{murdoch2019definitions}. Interpretation/inspection of ML models could help to further validate the trained models and to understand the influence of the input features on the model predictions. Some ML models are easy to interpret based on the trained model itself, such as linear regression or decision tree. However, some other ML models cannot be interpreted as easily because the trained models are more or less "black boxes". To overcome this limitation, there exist several interpretation methods that can be used to study the ML models that are not immediately interpretable, e.g., neural network. Some of these methods are model-specific, i.e., they can be used to interpret/inspect only specific ML models. However, there exist other methods that can be applied to any ML models, which are referred to as \emph{model-agnostic}~\citep{lipovetsky2001analysis, chakraborty2017interpretability, lundberg2017unified, guidotti2018survey, molnar2020interpretable, molnar2020interpretable2}.~\cite{soleimani2021analytical} assessed the importance of modeling parameters on seismic demand estimation for concrete box-girder bridges with tall piers using Random Forest ensemble learning method. Recently, \cite{mangalathu2022machine} used such interpretation methods to explore the key influential variables and thresholds governing the ML-based seismic demand prediction models for reinforced concrete bridges. \section{Scope and objectives}\label{scope} Although the overall seismic damage mitigation capability of SRR columns has been demonstrated through cyclic analyses~\citep{akbarnezhad2022seismic} and time history analyses~\citep{akbarnezhad2022bridge} representing certain hazard levels, the seismic vulnerability of bridges with SRR columns considering various uncertainties remains unexplored. Moreover, to show that SRR columns can seismically perform, at least, as well as PT columns, yet outperform monolithic RC columns, comparative fragility assessments are necessary. To address these points, this study aims to: \begin{itemize} \item Develop multi-parameter PSDMs for a highway bridge with SRR columns using a number of different ML techniques and choose the optimal PSDMs among them; \item Investigate the effects of various input parameters (including two key SRR column design parameters and ambient temperature) on the seismic performance of the bridges with SRR columns by interpreting the chosen PSDMs via a few different methods; \item Develop multi-parameter fragility functions for the bridge with SRR columns using ML techniques; \item Examine the effects of SRR column design parameters on the fragility curves of the bridge with SRR columns; \item Compare the seismic fragility of the bridge with SRR columns with those of the same bridge but with monolithic RC columns and PT columns. \end{itemize} The rest of this paper is organized as follows. The ML techniques considered in this study for PSDM development are briefly reviewed in Section~\ref{overview}. Section~\ref{CaseBridge} describes the highway bridge studied in this paper. Section~\ref{design} is concerned with the design of the SRR columns incorporated in the bridge and their equivalent PT columns. The numerical modeling of the selected bridge with different column types is described in Section~\ref{Numerical}. The PSDMs for the bridge with SRR columns are developed and interpreted in Section~\ref{PSDM}. The fragility functions of the bridges with monolithic RC columns, PT columns, and SRR columns are developed and compared in Section~\ref{frag_anal}. The effects of design parameters on the fragility functions of the bridge of SRR columns are examined in the same section. Finally, Section~\ref{conclusions} provides the summary and conclusions. \section{Overview of ML techniques}\label{overview} Five different ML techniques were considered to develop the PSDMs of the bridge with SRR columns. These techniques, which include (1) ridge regression, (2) kernel support vector regression, (3) adaptive boosting, (4) random forest, and (5) neural network, are briefly reviewed in this section. The fundamentals and the formulations of the selected ML techniques are not extensively discussed here for brevity and they can be found elsewhere~\citep{bishop2006pattern, hastie2009elements, murphy2012machine}. \subsection{Ridge regression} Ridge regression is basically a regularized version of multiple linear regression introduced by~\cite{hoerl1970ridge}. To reduce the model variance and complexity (i.e., "overfitting"), especially in the presence of multicollinearity (when some of predictors are correlated), in the ridge regression, a penalty term is added to the ordinary least squares loss function, i.e., sum of squared residuals (SSR). This penalty term is the sum of the squares of the regression coefficients multiplied by a regularization constant. Accordingly, by minimizing the penalized sum of squared residuals (PSSR) as its loss function, the ridge regression tends to make the coefficients corresponding to less significant predictors smaller, thereby improving the resulting model's stability and eliminating multicollinearity. Though an inherently nonlinear response cannot be accurately represented by a ridge regression model using the original predictors, expanding the original predictor space to include higher-order features (i.e., increasing the model dimensions) could improve the model's performance. However, the required feature expansion results in a large number of features, making the training process practically inefficient. \subsection{Kernel support vector regression} Similarly to multiple linear regression, support vector regression methods predict the target variable through a hyperplane. However, to achieve lower variance and better stability, the basic loss function in the support vector regression is defined as one half of the sum of the squares of the hyperplane coefficients, with the prediction errors being constrained within a certain margin~\citep{vapnik1999nature}. Since the support vector regression cannot accurately represent a nonlinear target using the original predictors (without transformations), kernel support vector regression is employed. In this technique, the loss function remains the same, but the predictors are transformed via kernel functions before entering the hyperplane equation~\citep{boser1992training}. The kernel functions generally quantify the similarities (e.g., distances) between the observations. In this study, the Gaussian kernel function, which is also referred to as Radial Basis Function, was used. It is noted that the kernel support vector regression is computationally more efficient than the ridge regression for learning nonlinear responses because it does not require the original space to be actually transformed into higher dimensions. \subsection{Random forest} Ensemble ML technique have also been developed to improve the stability/robustness of ML-based prediction models~\citep{sagi2018ensemble}. These techniques combine the predictions of a large number of base estimators ("weak learners") to make a final prediction. In the context of regression, the final prediction is the (weighted) average of the predictions of the base estimators. Random forest is an ensemble technique whose base estimators are low-depth decision trees, intending to reduce the overall model's variance compared to a single deep decision tree~\citep{breiman2001random}. To this end, each decision tree is trained using only a subset of the entire training data set, which is selected randomly with replacement (known as "bootstrap" sampling or "bootstrapping"), while the features considered for splitting at each decision node are also picked from a random subset of all the existing features. It is worth noting that random forest is a \emph{parallel} ensemble technique, i.e., each decision tree is trained independently of the other decision trees. \subsection{Adaptive boosting} Adaptive boosting, which is more often referred to as "AdaBoost", is also an ensemble technique with similar objectives to the random forest's~\citep{freund1997decision}. However, AdaBoost is of a \emph{sequential} type (not parallel), i.e., its base estimators are trained one after another and considering the error in the previous training. That is, each estimator is trained using the entire data set, but the weights of the observations (used in the loss function) are adjusted at each training step on the basis of the prediction errors of the previous trained estimator. As a result of this iterative process, the base estimators gradually become stronger in making more difficult predictions. In this study, the base estimators used in the AdaBoost method were low-depth decision trees. \subsection{Neural network} Neural networks loosely emulate human brains and are capable of predicting the most complex nonlinear responses~\citep{haykin2009neural}. Each neural network consists of a series of neurons organized in several layers, with the first and the last layers including the input and output variables, respectively, while each neuron has a weight associated with it. The basic form of neural network (only including input and output layers) represents a multiple linear regression model. Adding intermediate layers (including "hidden" neurons) can make the model nonlinear. Before the outputs of each layer are given to the next layer as its inputs, they are transformed using an "activation function" to increase the model's predictive power and robustness. In this study, the rectified linear unit (ReLU)~\citep{goodfellow2016deep} and linear functions are used as the activation functions for the hidden layers and the output layer, respectively. \section{Bridge description}\label{CaseBridge} The La Veta Avenue overcrossing bridge located in Orange, California, was selected for the seismic fragility assessments. The key features of the bridge are illustrated in Fig.~\ref{laveta}. The bridge is made of RC and it has two spans with seat-type abutments and a single two-column bent. The superstructure consists of a continuous six-cell RC box-girder, which spans the total length of 299.8~ft and width of 75.5~ft. For simplicity, the bridge's two spans were assumed to be identical (Fig.~\ref{laveta}(a)). The superstructure is supported by seven elastomeric bearing pads at each abutment. The bent consists of two identical columns, each being 22~ft tall, and a cap-beam integral with the bridge deck (Fig.~\ref{laveta}(b)). The cross section of the original columns is 66~in. in diameter (Fig.~\ref{laveta}(c)) and each column has an axial load ratio of about 10\%. The original monolithic RC columns are of pinned connections at their bottom ends. The concrete's nominal compressive strength, $f'_c$, is 5~ksi and the reinforcing steel is of Grade 60~\citep{astm2009standard}. Further details of the bridge can be found in~\cite{kaviani2014}. \begin{figure} \centering \includegraphics[scale=0.72]{Plot/Bridge_Desc_plot/LaVeta.png} \caption{La Veta Avenue overcrossing bridge: (a) bridge elevation; (b) bent elevation; (c) column cross section} \label{laveta} \end{figure} \section{Design of rocking columns}\label{design} This section summarizes the designs of the SRR and PT columns that would replace the original monolithic RC columns of the selected bridge. For a fair comparison in the subsequent seismic fragility assessments (Section~\ref{col_frag_comp}), the rocking columns' boundary conditions were assumed to be the same as the monolithic columns' (fixed at their top ends and pinned at their bottom ends) and one of the design objectives was to achieve nearly equal maximum base shear resistances in all the piers, i.e., with monolithic columns, PT columns, and SRR columns. \subsection{SRR columns} The SRR columns were selected to be of design variation~1 per~\cite{akbarnezhad2022seismic} (see Fig.~\ref{SRR_joint}). A performance-based approach was taken to design the SRR columns, while the SRR pier's maximum lateral load resistance was sought to remain equal to that of the monolithic pier (see Fig.~\ref{push_comp}). The broad performance objective was to prevent the SRR columns from repair-necessary damage and residual deformations under an MCE (2475-year) event. More specifically, the following DSs were aimed to be prevented under the MCE displacement demand: (1) concrete spalling/crushing, (2) longitudinal rebar yielding, (3) strength deterioration or fracture of ED links, and (4) plastic deformation of SMA links. The SRR columns were designed through an iterative process~\citep{akbarnezhad2022seismic} until the above performance objectives were satisfied. Here, the MCE displacement demand was determined using the capacity spectrum method~\citep{chopra1999capacity, fajfar1999capacity, madhusudhanan2018capacity}, while the requisite nonlinear static (pushover) analyses were conducted via the numerical model described subsequently - the final MCE drift ratio demand was 3.6\%. The dimensions and the reinforcement details of the designed SRR columns are shown in Fig.~\ref{ColDim}. The diameter of the columns over their unjacketed lengths was selected to be identical to the diameter of the original monolithic RC columns (66 in.). To accommodate the SMA and ED links, the diameter of the columns' jacketed cross section was selected to be 12 in. larger. The longitudinal reinforcement of each SRR column consists of 30 double \#11 bars, resulting in a longitudinal reinforcement ratio of 2.7\%. The transverse reinforcement over the unjacketed length was kept similar to the original monolithic RC columns'. The steel jacket was assumed to be made of A36 steel~\citep{astm2014standard}, 7/8 in. thick, and 60 in. tall. Totals of eight SMA links and eight ED links (also made of A36 steel) are used at the rocking joint of each column. The SMA and ED links are 60 in. and 45 in. long, respectively, and their cross-sectional areas are 0.79 in.$^2$ and 3.97 in.$^2$, respectively. \begin{figure} \centering \includegraphics[scale=0.50]{Plot/Bridge_Desc_plot/SRR_design.png} \caption{Design details of SRR columns} \label{ColDim} \end{figure} \subsection{PT columns} The PT columns were chosen to be of central unbonded tendons and their rocking joints were steel-armored (Fig.~\ref{PT_det}). The same amount of ED links as in the SRR columns was provided in each of the PT columns. The PT columns were selected to be of the same diameter as the monolithic columns', i.e., 66 in. Once these parameters were fixed, the total area of the unbonded PT tendon and their initial posttensioning force were iteratively selected such that the PT pier's lateral load resistance got reasonably close to those of the monolithic and SRR piers (Fig.~\ref{push_comp}). The selected PT tendon (Grade 270 per~\cite{astm2016standard}) consisted of 65 0.6-in. dia. monostrands and its total initial PT force was 1,205 kips (equal to 35\% of its total yield strength). The height of the steel jacket, which was assumed to be made of A36 steel~\citep{astm2014standard}, was selected as 54 in. to avoid concrete spalling under the pier's MCE displacement demand. \begin{figure} \centering \includegraphics[scale=0.50]{Plot/Bridge_Desc_plot/PT_design.png} \caption{Design details of PT columns}\label{PT_det} \end{figure} \begin{figure} \centering \includegraphics[scale=0.90]{Plot/push_comp_pin} \caption{Comparison of pushover curves of three different bridge piers}\label{push_comp} \end{figure} \section{Numerical model}\label{Numerical} The 3D model of the bridge was developed through the finite element analysis program OpenSees~\citep{mckenna2011opensees}. The schematic of the numerical model is presented in Fig.~\ref{BridgeNum}. Major parts of the model are described in the separate sections below. \subsection{Superstructure and abutments} Elastic beam-column elements were used to model the superstructure's longitudinal spine as it was expected to remain elastic under earthquake excitation. At the two ends of the bridge, five series of zero-length elements were used to represent external shear keys (in the transverse direction), pounding (in the longitudinal direction), backfill soil (in the longitudinal direction), bearings (in the both transverse and longitudinal directions), and abutment piles (in the both transverse and longitudinal directions). Nearly rigid elastic elements were used to connect the above zero-length elements to the superstructure's spine elements. The zero-length elements representing the shear keys and bearings were connected in series to the zero-length elements representing the abutment piles, while the zero-length elements representing the pounding were connected in series to the zero-length elements representing the abutment's backfill soil. More details on the responses of these zero-length elements can be found elsewhere~\citep{mangalathu2016ancova, mangalathu2017performance, muthukumar2006hertz}. \begin{figure*} \centering \includegraphics[scale=0.45]{Plot/Bridge_Desc_plot/bridge_model.png} \caption{Finite element modeling of bridge with SRR columns}\label{BridgeNum} \end{figure*} \subsection{Columns} \paragraph{Monolithic RC columns.} Each monolithic column was modeled via a single gradient inelastic (GI) force-based beam-column element~\citep{sideris2016gradient, salehi2018finite, salehi2020assessing}. The GI element's characteristic length, $l_c$, was taken as the column's plastic hinge length calculated per~\cite{goodnight2016modified}. A total of 13 integration points were considered along each element to ensure objective responses upon softening~\citep{sideris2016gradient, salehi2017refined}. Each integration point was represented by a fiber section consisting of uniaxial material models simulating unconfined concrete, confined concrete, and longitudinal steel. The adopted uniaxial material models for concrete and reinforcing steel were the Kent-Scott-Park model~\citep{scott1982stress} and the Giuffre-Menegotto-Pinto model~\citep{giuffre1970behavior}, respectively. The behavior of the confined concrete was determined based on the Mander's model~\citep{mander1988theoretical}. \paragraph{PT columns.} Each PT column was modeled via two GI elements representing the jacketed and unjacketed lengths of the precast concrete segment, a multi-node co-rotational continuous truss element representing the central tendon, and multiple zero-length gap elements simulating the duct-tendon interactions at the joints ~\citep{salehi2020effect}. Three different fiber sections were used in the GI elements to represent the different regions of the column, i.e., its rocking joint, its jacketed length, and its non-jacketed length (e.g., see Fig.~\ref{ColNum}). The jacketed length's fiber sections did not have unconfined concrete regions and were enclosed by steel fibers representing the steel jacket. The rocking joint's fiber section was similar to the jacketed length's, except its material models did not resist tension. The GI element's characteristic length, $l_c$, was selected as the cross section radius. The ED links were simulated via co-rotational truss elements, which were connected to the column (at the node between the jacketed and unjacketed lengths) through nearly rigid elastic beam-column elements. The multi-node truss element consisted of four nodes, one at the anchorage point inside the footing, one at the footing-column joint location (connected through gap elements to fixed nodes at the same location), one at the column-superstructure joint location (connected through gap elements to the nodes that were connected to the superstructure's spine elements), and the last one at the anchorage point inside the superstructure (connected to the superstructure's spine elements). The posttensioning steel was represented by a tension-only material model following the backbone curve suggested by Mattock~\citep{mattock1979flexural} and capable of modeling the post-plasticity slackness of the strands~\citep{salehi2017numerical}. The Giuffre-Menegotto-Pinto model was used to simulate both the ED links and the steel jacket, while it was combined with a low-cycle fatigue model~\citep{uriz2005towards} in case of ED links to allow evaluating their cyclic damage after earthquakes. \paragraph{SRR columns.} The element configuration used to model SRR columns can be seen in Fig.~\ref{BridgeNum}. The height of each SRR column was discretized into two GI beam-column elements representing the jacketed and unjacketed lengths of the column and three different fiber sections were used to represent the different integration points (Fig.~\ref{ColNum}). Similarly to the PT columns, the fiber section representing the integration point at the rocking joint location consisted of compression-only material models. The intermediate node (between the two GI elements) was necessary to connect the co-rotational truss elements representing the SMA and ED links to the GI elements. The characteristic lengths of the GI elements, $l_c$, were selected as the radii of their respective cross sections. The concrete and steel material models used for modeling the SRR columns were similar to those used to model the PT columns. The superelastic NiTi was represented by the superelastic uniaxial material model, which is described subsequently. This model was calibrated based on the cyclic response of a 1-in. diameter superelastic NiTi rod tested by \cite{desroches2004cyclic} (Fig.~\ref{SMA_validation}(c)). \begin{figure} \centering \includegraphics[scale=0.75]{Plot/Bridge_Desc_plot/SRR_column_model.png} \caption{Fiber sections of beam-column elements representing SRR columns}\label{ColNum} \end{figure} \paragraph{Superelastic material model.} None of the uniaxial material models readily available in the material library of OpenSees could realistically capture the temperature dependence and the sub-cycles of the superelastic NiTi's hysteresis. As a result, for the simulation of SMA links in the SRR columns, a new material model, termed \emph{superelastic}, was developed and implemented in OpenSees. To capture the hysteresis sub-cycles, the superelastic model follows the basic loading/unloading rules of the trigger-line model proposed by~\cite{muller1991pseudo} - see Fig.~\ref{SMA_validation}(a). Moreover, as shown in Fig.~\ref{SMA_validation}(b), the transformation stresses of the material are considered to be linearly dependent on the ambient temperature~\citep{brinson1993one}. It is worth noting that, assuming that the superelastic NiTi bars used to make the SMA links are appropriately heat-treated, they are assumed to experience negligible residual/plastic deformations~\citep{salehi2022experimental}. Therefore, the developed superelastic material model considers full superelasticity. \begin{figure*} \centering \includegraphics[scale=0.25]{Plot/Bridge_Desc_plot/superelastic_model.png} \caption{Superelastic material model: (a) illustration of trigger-line model; (b) temperature dependence; (c) calibration per \cite{desroches2004cyclic} }\label{SMA_validation} \end{figure*} \section{Probabilistic seismic demand models}\label{PSDM} This section aims to: (1) explain the process of developing several PSDMs for the bridge with SRR columns using five different ML techniques (see Section \ref{overview}); (2) select the most efficient ML technique for developing the PSDMs; and (3) use various interpretation methods to explore the final developed PSDMs. \subsection{Design of experiment} A suite of ground motions selected by~\cite{baker2011new} was used in this study to account for the ground motion uncertainties. The original suite included 160 ground motion records consisting of 120 far-field and 40 near-fault ground motions. However, here, the suite was expanded to 320 records by scaling all the original 160 ground motions by a factor of 2 in order to include sufficiently strong ground motions~\citep{ramanathan2012next}. In addition, the uncertainties in the nonlinear behavior of the SRR columns due to the variations of material properties and ambient temperature, $T$, were included in the time history analyses. Table~\ref{table_input} summarizes the parameters of the distributions considered for different material properties. The coefficients of variation for concrete and steel properties were selected in accordance with~\cite{mangalathu2017performance}, whereas the coefficients of variation for NiTi properties were selected based on~\cite{gur2021design}. In addition, Table~\ref{table_input} includes the considered range of ambient temperature for the bridge location according to~\cite{aashto2012aashto}. Two design parameters of SRR columns, namely, self-centering coefficient, $\lambda$, and initial strain of SMA links, $\epsilon_{SMA,0}$~\citep{akbarnezhad2022seismic}, were also assumed to be randomly generated via uniform distributions with the parameters listed in Table~\ref{table_input}. According to \cite{akbarnezhad2022seismic}, $\lambda$ values of 0.0 and 1.0 correspond to the SRR column designs with the maximum possible ED links to maintain self-centering and without any ED links, respectively. Including the design parameters and the ambient temperature among the uncertain variables would allow exploring the effects of these parameters on the performance of the bridge with SRR columns subsequently. Latin Hypercube sampling was utilized to generate 320 sample pairs of ground motion and bridge model with randomly selected values for the variables of Table~\ref{table_input}. Subsequently, a nonlinear time history analysis was conducted for each sample to obtain the EDPs of interest (see Section~\ref{EDPs}). \begin {table*}[h!] \centering \caption{Considered distributions for different uncertain parameters; min. and max. values for normal and log-normal distributions correspond to the lower and upper truncated limits, respectively.} \label{table_input} \begin{tabular}{ p{6cm}p{1.cm}p{2cm}p{1.2cm}p{1.5cm}p{1.2cm}p{1.2cm}} \hline \multirow{2}{*}{Parameter} & \multirow{2}{*}{Unit} & \multicolumn{5}{c}{Statistical Distribution}\\ \cline{3-7} & & Distribution & Mean & COV (\%) & Min. & Max.\\ \hline Concrete compressive strength, $f'_c$ & ksi & Normal & 4.55 & 12.0 & 3.46 & 5.64\\ &&&&&&\\ Rebar yield strength, $f_{y,s}$ & ksi & log-normal & 69.0 & 8.0 & 58.8 & 81.0 \\ Steel jacket yield strength, $f_{y,j}$ & ksi & log-normal & 44.0 & 8.0 & 37.5 & 51.6\\ ED link yield strength, $f_{y,ED}$ & ksi & log-normal & 48.0 & 8.0 & 40.9 & 56.3\\ &&&&&&\\ NiTi martensite start stress, $\sigma_{Ms}$ & ksi & log-normal & 55.0 & 10.0 & 45.0 & 67.2\\ NiTi martensite finish stress, $\sigma_{Mf}$ & ksi & log-normal & 82.0 & 10.0 & 67.1 & 100.2\\ NiTi austenite start stress, $\sigma_{As}$ & ksi & log-normal & 55.0 & 10.0 & 45.0 & 67.2\\ NiTi austenite finish stress, $\sigma_{Af}$ & ksi & log-normal & 20.0 & 10.0 & 16.4 & 24.4\\ NiTi transformation strain, $\epsilon_L$ & in./in. & log-normal & 0.035 & 5.0 & 0.03 & 0.04\\ NiTi Young's modulus of austenite, $E_A$ & ksi & log-normal & 3700.0 & 5.0 & 3347.9 & 4089.1\\ NiTi Young's modulus of martensite, $E_M$ & ksi & log-normal & 3300.0 & 5.0 & 2986.0 & 3647.1\\ &&&&&&\\ Ambient temperature, $T$ & $^\circ$C & Uniform & 25.0 & 46.2 & 5.0 & 45.0\\ &&&&&&\\ Initial SMA link strain, $\epsilon_{SMA,0}$ & \% & Uniform & 0.75 & 57.7 & 0.0 & 1.5\\ Self-centering coefficient, $\lambda$ & - & Uniform & 0.5 & 57.7 & 0.0 & 1.0 \\ \hline \end{tabular} \end{table*} \subsection{Input features} In general, ML techniques allow developing PSDMs that depend on multiple input variables/features, e.g., ground motion IMs and design parameters. Within the framework of seismic risk assessment, in order to obtain the exceedance probability of a decision variable (such as repair cost), fragility functions need to be integrated with respect to the ground motion IMs predicted by seismic hazard curves~\citep{Cornell2000progress, moehle2004framework}. Despite the fact that many researches have explored the possibility of using a vector-valued IM as a substitute for a single IM in risk assessment~\citep{tothong2007probabilistic, baker2005vector, gehl2013vector,kohrangi2016vector}, the seismic hazard curves dependent on a vector-valued IM are not easily available~\citep{bazzurro2002vector, abrahamson2006seismic, silva2019current}. As a result, fragility functions and PSDMs are usually conditioned on a single IM rather than multiple IMs. It is worth noting that in cases where only the PSDMs are of interest (e.g., for seismic response prediction), however, those PSDMs that are trained based on multiple IMs could potentially be more useful~\citep{xu2020real}. Since the selected IM may significantly affect the degree of uncertainty of the PSDMs, the IM selection is not a trivial task and has been the subject of several past studies~\citep{giovenale2004comparing, baker2008vector, tothong2007probabilistic, eads2015average, hariri2016probabilistic, zelaschi2019critical, du2019posteriori,guo2020optimal, du2021entropy}. The process of selecting an appropriate IM for the PSDMs of the bridge with SRR columns is explained in Section~\ref{secCurse}. However, 11 ground motion characteristics were considered herein as potential IMs - see Table~\ref{table:IM}. All the considered IMs are independent of the structural properties to ensure they are conveniently hazard-computable. Overall, possible input features for training the PSDMs included all the variables listed in Table~\ref{table_input} plus a single IM. However, not all of these features were used in the final trained models to ensure robustness and efficiency, as discussed in Section~\ref{secCurse}. \begin{table}[] \caption{Potential intensity measures for PSDM development} \label{table:IM} \begin{tabular}{ll} \hline IM & \multicolumn{1}{c}{Definition} \\ \hline PGA & Peak ground acceleration \\ PGV & Peak ground velocity \\ PGD & Peak ground displacement \\ CAA & Cumulative absolute acceleration \\ CAV & Cumulative absolute velocity \\ CAD & Cumulative absolute displacement \\ CSA & Cumulative squared acceleration (Arias intensity) \\ CSV & Cumulative squared velocity \\ CSD & Cumulative squared displacement \\ $Sa_1$ & Spectral acceleration at period of 1 sec. \\ $Sa_{gm}$ & Geom. mean of $Sa$ for period range of 0.5-2 sec. \\ \hline \end{tabular} \end{table} \subsection{Engineering demand parameters}\label{EDPs} The EDPs of interest in this study represent both global and local responses. The selected global EDPs are the peak displacement demands at the deck ends in both transverse and longitudinal directions (to detect abutment unseating), the bent's peak drift ratio, and the bent's residual drift ratio. The selected local EDPs are the maximum tensile strains of the longitudinal rebar, the ED links, and the SMA links; the maximum compressive strains of the cover and core concrete; the low-cycle fatigue damage factors of the ED links; and the peak deformation demands of the shear keys and the bearing pads. \subsection{Data preprocessing} Before developing the PSDMs, both the input data and the predictions (i.e., the EDPs obtained via the time history analyses of the bridge with SRR columns) needed to be preprocessed. This step usually includes removing the potential outliers and variable transformations. As outliers, the data resulted from the incomplete analyses (i.e., without solution convergence) were removed - this included only a handful of cases. After the outlier treatment, the new data set was randomly split into training and test data sets. The training data set (here, comprising 70\% of the entire data) was used to train the PSDMs, while the test data set was used to measure the performance of the trained PSDMs. The variable transformations were carried out after splitting the data set to avoid "data leakage" from the test set to the training set. The variable transformations included the log-transformation of those EDPs that had skewed distributions and the normalization of the input features due to their different ranges. The former was done to improve the performance of the trained models and the latter was done to overcome the slow learning of certain ML models (e.g., using numerical optimization algorithms such as gradient descent~\citep{ruder2016overview}) and to avoid the dominance of the errors of large-valued feature in the loss function calculations. In this study, the input features were normalized via Z-score transformation. \subsection{Hyperparameter tuning} After the data preprocessing, any of the ML techniques described in Section~\ref{overview} could be used to train the PSDMs. Each ML model is trained through optimizing the associated objective function (e.g. cost function in neural network, information gain in decision tree). In addition, there are some other parameters that need to be specified prior to the training of each model, which are referred to as "hyperparameters". Examples of hyperparameters in the ML techniques considered herein include the regularization constant in the ridge regression, and the number of layers and the number of neurons within each layer in the neural network. Hyperparameter tuning is necessary to improve the performance of a trained model and avoid its overfitting. The hyperparamter tuning is usually achieved through grid/randomized search and cross-validation techniques~\citep{hastie2009elements}. The search methods simply seek the best combination of all hyperparameters (within prespecified ranges) that would maximize a selected cross-validated score (e.g., root mean square error and $R^2$). The main purpose of the cross-validation technique is to avoid overfitting, which would occur if the hyperparameters were merely selected based on the model's performance on the training data set. In this study, a five-fold cross-validation was used and $R^2$ was chosen as the performance metric that needed to be maximized through the hyperparameter tuning. \subsection{Dimensionality reduction}\label{secCurse} The term "curse of dimensionality" refers to the model training difficulties arising from having many input features relative to the number of observations (data sparsity). This is also known as the Hughes phenomenon~\citep{hughes1968mean}, which states that the overall power of a prediction model initially increases with the number of features/dimensions, but it stops increasing at some point and even deteriorates as the number of features increases further. This occurs because the data sparsity precludes the ML model from generalizing to the regions of feature space that do not have sufficient data for model training. In order to explore how different number of dimensions could affect the model performance, Fig.~\ref{CompPerf} compares the performance plots showing the actual peak bent drift values versus their corresponding neural network predictions for three cases: (1) the only feature considered is $Sa_1$ (i.e., only one IM); (2) the considered features include the two SRR column design parameters ($\epsilon_{SMA,0}$ and $\lambda$), the ambient temperature ($T$), and $Sa_1$ (i.e., one IM plus only three extra dimensions); (3) the considered features include all the IMs in Table~\ref{table:IM}, the SRR column design parameters, the material properties, and the ambient temperature (i.e., all the possible uncertain parameters). It is observed that adding new features has increased the model's performance in case~2 ($R^2=0.97$) with respect to case~1 ($R^2=0.91$). However, in case~3, adding multiple extra features has decreased the model's performance compared to case~2 ($R^2=0.94$ vs. $R^2=0.97$). This is attributed in part to the lower variances of the material properties compared to the two design parameters ($\epsilon_{SMA,0}$ and $\lambda$) and the ambient temperature ($T$), thereby giving the former features less predictive power. The potential correlation between the multiple IMs considered in case~3 could also have contributed to the model's lower performance in that case in comparison with case~2. Given the foregoing, the PSDMs developed for the bridge with SRR columns were decided to be similar to case 2 (i.e., their input features only included the design parameters, ambient temperature, and one IM ). The single IM used in the PSDMs was selected as explained below. \begin{figure*} \centering \includegraphics[scale=1.0]{Plot/fig5_marker} \caption{Performance comparison of longitudinal drift prediction model with different features: (a) single IM; (b) single IM + design parameters + ambient temperature; (c) multiple IMs + material properties + design parameters + ambient temperature.}\label{CompPerf} \end{figure*} \paragraph{Selection of optimal IM.} The optimal IM should have the following characteristics~\citep{padgett2008selection}: (\textit{i}) \emph{hazard computablity}, i.e., the hazard curve of that IM (obtained through probabilistic seismic hazard analysis) should be conveniently available; (\textit{ii}) \emph{proficiency}, i.e., the IM shall have a high predictive power; and (\textit{iii}) \emph{sufficiency}, i.e., the errors/residuals of the prediction model are independent of other ground motion parameters, such as magnitude and epicentral distance. For some of the selected IMs (see Table~\ref{table:IM}), namely, PGA, PGV, PGD, and $Sa_1$, the hazard curves are readily available from the U.S. Geological Survey~\citep{USGS}. In addition, according to several studies~\citep{jalayer2012analyzing, ebrahimian2015preliminary, du2019posteriori}, sufficiency is closely related to proficiency, so it is not a matter of concern provided that the IM proficiency is checked. Here, the levels of proficiency (higher importance and lower dispersion) of the possible IMs were examined by comparing the permutation feature importance~\citep{breiman2001random} values of the different IMs when all were included in PSDM development. The permutation importance can be computed for any feature regardless of the ML technique. The permutation importance of a feature equals the decrease in the prediction model's performance metric of interest (e.g., $R^2$) upon removing that feature from the model's input variables. The permutation importance values for all of the potential IMs used to train different ML models to predict the bent's peak drift ratio are listed in Table~\ref{table:Perm_Imp}. As seen, the $Sa_1$ has the largest importance for all the techniques. A similar trend was observed for other responses (except residual drift and damage factor for low-cycle fatigue of the ED links), although not shown here. Based on the permutation feature importance for all the EDPs, the $Sa_1$ outperforms the other IMs, so it was selected as the most appropriate IM for this study. \begin{table}[] \caption{Permutation importance values of different IMs used to predict bent's peak drift ratio (training data set)} \label{table:Perm_Imp} \begin{tabular}{lccccc} \hline Feature & RR & SVR & RF & AdaBoost & NN \\ \hline PGA & 0.09 & 0.1 & 0.06 & 0.05 & 0.07 \\ PGV & 0.001 & 0.005 & 0.001 & 0.002 & 0.005 \\ PGD & 0.01 & 0.04 & 0.01 & 0.02 & 0.004 \\ CAA & 0.02 & 0.09 & 0.04 & 0.02 & 0.04 \\ CAV & 0.001 & 0.002 & 0.002 & 0.001 & 0.0 \\ CAD & 0.004 & 0.005 & 0.001 & 0.001 & 0.0 \\ CSA & 0.07 & \textbf{0.14} & 0.08 & 0.05 & 0.13 \\ CSV & 0.0 & 0.002 & 0.001 & 0.0 & 0.001 \\ CSD & 0.006 & 0.007 & 0.002 & 0.005 & 0.001 \\ GMSa & 0.11 & 0.12 & 0.1 & 0.12 & 0.09 \\ {$Sa_1$} & \textbf{0.15} & \textbf{0.14} & \textbf{0.15} & \textbf{0.14} & \textbf{0.16} \\ \hline \end{tabular} \end{table} \subsection{Performance evaluation} In order to find the final PSDMs, for each ML method, a reasonable amount of hyperparameter tuning was performed until an efficient model was achieved. The values of two performance measures, i.e., $R^2$ and MSE, for all the final PSDMs of the bridge with SRR columns developed via various ML methods (on the test data set) are listed in Table~\ref{ModelQuality}. It is observed that, for almost all of the EDPs of interest, the neural network models have the best predictive performances (highest $R^2$ and lowest MSE) in comparison to other models. The only exception is for the low-cycle fatigue damage factor of the ED links, for which the AdaBoost model slightly outperforms the neural network model (with an $R^2$ of 0.8 vs. 0.78). The neural network models are found to only marginally outperform the support vector regression models. Except for the PSDMs developed for the bent's residual drift, max. SMA link strain, max. ED link strain, and max. ED link damage factor, the MSE values for all other neural network models are below 0.10. One should note that an MSE of 0.10 in the logarithmic space is equivalent to almost 10\% error in the real space. The max. SMA link strain is found to be predicted with much less error (lower MSE) through a neural network model compared to other ML models. The performance plots of the PSDMs developed for the max. SMA link strain using different ML techniques are compared in Fig.~\ref{PP_SMA}. As seen, all the models except the neural network model tend to slightly underestimate the response at higher levels. Given the foregoing, the PSDMs developed via the neural network method were used in the remainder of this study. \begin {table*}[h!] \centering \caption{Model performance measures for different ML techniques} \label{ModelQuality} \begin{tabular}{lcccccccccccccc} \hline & \multicolumn{2}{c}{NN} & \multicolumn{1}{l}{} & \multicolumn{2}{c}{SVR} & \multicolumn{1}{l}{} & \multicolumn{2}{c}{Ridge} & \multicolumn{1}{l}{} & \multicolumn{2}{c}{AdaBoost} & \multicolumn{1}{l}{} & \multicolumn{2}{c}{Random Forest} \\ \cline{2-3} \cline{5-6} \cline{8-9} \cline{11-12} \cline{14-15} Response & R2 & MSE & & R2 & MSE & & R2 & MSE & & R2 & MSE & & R2 & MSE \\ \hline Bent's peak drift ratio & \textbf{0.97} & \textbf{0.05} & & 0.95 & 0.09 & & 0.94 & 0.10 & & 0.96 & 0.06 & & 0.95 & 0.09 \\ Bent's residual drift ratio & \textbf{0.84} & \textbf{0.11} & & \textbf{0.81} & \textbf{0.11} & & 0.78 & 0.12 & & 0.76 & 0.12 & & \textbf{0.81} & \textbf{0.11} \\ Max. cover concrete strain & \textbf{0.93} & \textbf{0.09} & \textbf{} & \textbf{0.94} & \textbf{0.09} & & 0.91 & 0.13 & & 0.92 & 0.10 & & 0.94 & 0.10 \\ Max. core concrete strain & \textbf{0.94} & \textbf{0.09} & & \textbf{0.94} & \textbf{0.09} & & 0.92 & 0.10 & & 0.92 & 0.10 & & \textbf{0.94} & \textbf{0.09} \\ Max. longit. rebar strain & \textbf{0.93} & \textbf{0.09} & & \textbf{0.93} & \textbf{0.10} & & 0.92 & 0.12 & & 0.92 & 0.11 & & 0.93 & 0.11 \\ Max. SMA link strain & \textbf{0.94} & \textbf{0.11} & & 0.91 & 0.16 & & 0.89 & 0.18 & & 0.87 & 0.21 & & 0.89 & 0.18 \\ Max. ED link strain & \textbf{0.94} & \textbf{0.12} & & \textbf{0.93} & \textbf{0.12} & & 0.92 & 0.13 & & 0.90 & 0.13 & & 0.92 & 0.13 \\ Max. ED link damage factor & 0.78 & 0.31 & & 0.76 & 0.35 & & 0.72 & 0.41 & & \textbf{0.80} & \textbf{0.27} & & 0.78 & 0.32 \\ Max. bearing pad deformation & \textbf{0.95} & \textbf{0.05} & & \textbf{0.95} & \textbf{0.05} & \textbf{} & 0.95 & 0.06 & \textbf{} & 0.94 & 0.07 & \textbf{} & \textbf{0.95} & \textbf{0.05} \\ Max. deck end's displacement & \textbf{0.97} & \textbf{0.06} & & 0.96 & 0.07 & & 0.95 & 0.09 & & 0.94 & 0.11 & & 0.95 & 0.09 \\ Max. shear key deformation & \textbf{0.94} & \textbf{0.05} & & \textbf{0.95} & \textbf{0.05} & & 0.94 & 0.06 & & 0.93 & 0.07 & & 0.93 & 0.07 \\ \hline \end{tabular} \end{table*} \begin{figure*} \centering \includegraphics[scale=0.90]{Plot/fig_PP_SMA} \caption{Performance plots for PSDMs of SMA link strain developed via five different ML techniques: (a,f) neural network; (b,g) support vector regression; (c,h) ridge regression; (d,i) AdaBoost; (e,j) random forest }\label{PP_SMA} \end{figure*} \subsection{Interpretation}\label{interpret} In this study, four model-agnostic methods are used to interpret some of the developed PSDMs - these methods include: (\emph{i}) Individual Conditional Expectation (ICE), (\emph{ii}) Partial Dependence Plot (PDP), (\emph{iii}) Accumulated Local Effects (ALE), and (\emph{iv}) Shapley Additive Explanations (SHAP). Among these methods, the first and the fourth ones are \emph{local} methods, i.e., they inspect the effects of input features on individual predictions. However, PDP and ALE are \emph{global} methods, i.e., they inspect the average effect of each input feature on the overall model prediction. Although SHAP is considered a local method, several global interpretation methods have been developed by aggregating SHAP for a large number of individual predictions~\citep{chen2021explaining}. \paragraph{ICE and PDP.} ICE inspects the influence of a single feature on a single prediction by marginalizing the influences of the other features. Basically, an ICE plot shows the variation of a model's prediction with a selected feature, while the model's other input features are fixed at various values~\citep{goldstein2015peeking}. PDP is the global version of ICE, which is obtained by averaging many instances of ICE plots (e.g., see Fig.~\ref{PD1}). The main drawback of these methods is that, if some of the input features are correlated (which indeed is undesirable), then keeping one feature constant while varying the others to obtain the ICE plots (or subsequently, a PDP) could lead to misinterpretations. The ICE plots (for 40 combinations of fixed feature values) and their corresponding PDPs investigating the effects of $Sa_1$, $T$, $\epsilon_{SMA,0}$, and $\lambda$ on the max. ED link strain and the ED link fatigue damage factor are shown in Fig.~\ref{PD1}. Note that there is no correlation between the selected input features, so ICE and PDP are usable here. As expected, the ground motion IM (i.e., $Sa_1$) is found to have the most significant effects on the selected EDPs - increasing $Sa_1$ results in the constant increase in the max. ED link strain (Fig.~\ref{PD1}(a)) and the max. ED link fatigue damage factor (Fig.~\ref{PD1}(e)). As seen in Fig.~\ref{PD1}(b), since the SMA links exhibit higher strength at higher temperatures (see Fig.~\ref{SMA_validation}(b)), thereby increasing the lateral strength of the SRR columns, the joint opening, and subsequently, the max. ED link strain decreases with $T$ (up to 5\% on average). For the same reason, higher $T$ is found to reduce the max. ED link fatigue damage factor by ~40\% on average (Fig.~\ref{PD1}(f)). According to Fig.~\ref{PD1}(c), increasing $\epsilon_{SMA,0}$ from 0 to 1.5\% decreases the ED link strain by ~5\% on average. This finding is justified by the fact that prestraining the SMA links increases their energy dissipation capacity~\citep{akbarnezhad2022seismic}, thereby reducing the bent's peak drift demands and joint opening. Due to their decreased strain demands, the max. fatigue damage factor of the ED links is also found to decrease with $\epsilon_{SMA,0}$ up to ~25\% (Fig.~\ref{PD1}(g)). Per Fig.~\ref{PD1}(d), decreasing $\lambda$ from 1 to 0 does not affect the ED link strain demands in an average sense. However, for the examples with higher ED link strain demands, decreasing $\lambda$ decreases the ED link strain by ~5\% because the energy dissipation of the SRR columns increases~\citep{akbarnezhad2022seismic}. Likewise, the average ED link damage factor decreases by ~25\% as $\lambda$ is reduced from 1 to 0 (Fig.~\ref{PD1}(h)). \begin{figure*} \centering \includegraphics[scale=0.90]{Plot/PD_1_ED} \caption{ICE plots and PDPs for: (a-d) predicted max. ED link strain; (e-h) predicted max. ED link fatigue damage factor}\label{PD1} \end{figure*} \paragraph{ALE.} To tackle the inadequacy of the ICE and PDP methods in the presence of correlated features, one solution is to use conditional probability instead of marginal probability (for marginalizing the effects of the complementary set of features) to avoid the predictions associated with unrealistic combinations of correlated feature values. However, such an approach would let the correlated features influence the effect of the single feature of interest that is being investigated. To solve this issue, in the ALE approach, the gradients of the predictions with respect to the feature of interest are first computed, and then, these gradients are averaged over the conditional distribution of other features (local effects). Finally, a constant offset is applied to the computed value to make it centered - i.e., to make the mean effect zero. Integration of the local effects between two values of \textit{a} and \textit{b} is interpreted as the change in the prediction purely due to the feature's variation from \textit{a} to \textit{b}. This change in prediction can be seen as an independent measure of the effect of the feature on the prediction output~\citep{apley2020visualizing, mangalathu2022machine, molnar2020interpretable2}. In summary, the ALE value at each point represents the contribution of the feature of interest to the model prediction compared to the model's average prediction. It is noted that the values of the ALE and the PDPs are not expected to be the same, but their slopes can be interpreted similarly. Fig.~\ref{ALE1} shows the ALE plots aimed to explore the effects of the input features $Sa_1$, $T$, $\epsilon_{SMA,0}$, and $\lambda$ on the max. cover concrete strain and the bent's residual drift predictions. As expected, the positive slopes of the ALE plots in Fig.~\ref{ALE1}(a) and (e) verify that increasing $Sa_1$ would lead to increases in the max. cover concrete strain (due to increased curvature demands) and the bent's residual drift (due to increased plastic deformations under large displacement demands). According to the positive slope of the ALE plot in Fig.~\ref{ALE1}(b), the predicted max. cover concrete strain increases with the ambient temperature, too. This is because of the strength increase of the SMA links that would result in higher moment demands. The ALE plot for the effect of the ambient temperature on the bent's residual drift (Fig.~\ref{ALE1}(f)) exhibits positive and negative slopes at lower and higher ranges of $T$, i.e., a dual effect. Specifically, the initial SMA link strength increase induced by the temperature increase from 5$^\circ$C to about 20$^\circ$C results in higher residual drift demand predictions (likely because of the moment demand increase). However, further increase in the transformation stresses of the SMA links due to the temperature increase beyond 20$^\circ$C seem to actually have a decreasing effect on the bent's residual drift (likely because of the self-centering capacity increase). Per Fig.~\ref{ALE1}(c), increasing the initial strain of the SMA links, $\epsilon_{SMA,0}$, from 0 to 1.5\% is found to lead to higher max. cover concrete strain predictions (likely because of the moment demand increase). In terms of residual drift predictions, $\epsilon_{SMA,0}$ is found to have a slight decreasing effect (Fig.~\ref{ALE1}(g)), as higher prestraining could slightly increase the energy dissipation of SRR columns~\citep{akbarnezhad2022seismic}. According to Fig.~\ref{ALE1}(d), reducing self-centering coefficient, $\lambda$, from 1 to 0 (which results in higher energy dissipation, hence lower displacement demands) is observed to decrease the max. cover concrete strain predictions. However, $\lambda$ is found not to have a clear and significant effect on the bent's residual drift predictions (Fig.~\ref{ALE1}(h)). \begin{figure*} \centering \includegraphics[scale=0.65]{Plot/ALE_1_residual} \caption{ALEs of $Sa_1$, $T$, $\epsilon_{SMA,0}$, and $\lambda$ on: (a-d) predicted max. cover concrete strain; (e-h) predicted bent's residual drift}\label{ALE1} \end{figure*} \paragraph{SHAP.} The SHAP method gives an insight into the effects of different input features on the model prediction through the \emph{Shapley/SHAP values}. The SHAP value is a solution concept in game theory to fairly distribute the payouts to players depending on their contributions to the total payout~\citep{shapley1953quota}. In the context of model interpretation, the SHAP value of each feature for a certain prediction quantifies that feature's contribution to pushing the prediction lower or higher from the model's average prediction or base value. Accordingly, the sum of the SHAP values of all features for a certain prediction is equal to the difference between that prediction and the base value. In that sense, one can describe the SHAP method as a local version of the ALE method to inspect individual predictions with respect to the average prediction. However, the SHAP values are computed entirely differently~\citep{vstrumbelj2014explaining, lundberg2017unified}. Though the SHAP method is a local interpretation method, aggregating the SHAP values for many prediction examples results in the global SHAP dependence plot, which is further discussed later on. Fig.~\ref{shap1} illustrates the contributions of different features to the bent's peak drift ratio for a single prediction via a \emph{force plot}, which is a scaled visualization of the SHAP values. The feature values for the examined prediction are $Sa_1=0.37g$, $T=34^{\circ}$C, $\epsilon_{SMA,0}=1.3\%$, and $\lambda=0.72$. According to the force plot, the natural logarithm of the drift for this example is 0.49 smaller than the base value (-0.18). Moreover, it is observed that, for this certain prediction, $Sa_1$, $T$, and $\epsilon_{SMA,0}$ have pushed the natural logarithm of the peak drift ratio below its average by 0.45, 0.04, and 0.02, respectively. On the contrary, $\lambda$ has pushed the natural logarithm of the peak drift ratio above its average by 0.02. \begin{figure*} \centering \includegraphics[scale=0.95]{Plot/force_plot.png} \caption{Force plot for a single prediction of bent's peak drift}\label{shap1} \end{figure*} Fig.~\ref{shap2} presents the SHAP summary plots for the bent's peak drift and the max. longitudinal rebar strain PSDMs. Each summary plot summarizes the SHAP values for all the features and all the prediction instances within the data set - each dot represents the contribution of one feature to one prediction instance. The order of the features on the y-axis is determined based on their average importance, with the most important feature appearing at the top. Per Fig.~\ref{shap2}, $Sa_1$ has the most significant effects on the predictions of both EDPs and the higher $Sa_1$ is, the higher the selected EDP predictions are. As expected per earlier interpretations, the influences of $\epsilon_{SMA,0}$, $\lambda$, and $T$ on both EDPs are not as significant as that of $Sa_1$. As seen, $T$ is the second important feature for both prediction models. It is noted that since the SMA links exhibit higher strength at higher temperatures, thereby increasing the bent's lateral strength, its peak drift predictions decrease as $T$ increases (Fig.~\ref{shap2}(a)). However, the increased lateral strength leads to higher longitudinal rebar strain demands (Fig.~\ref{shap2}(b)). Per Fig.~\ref{shap2}(a), lower values of $\lambda$ are found to negatively contribute to the bent's peak drift predictions because the energy dissipation of the SRR columns increases as $\lambda$ decreases \citep{akbarnezhad2022seismic}. Likewise, lower values of $\lambda$ are found to less significantly contribute to the max. longitudinal rebar strain predictions (Fig.~\ref{shap2}(b)). Fig.~\ref{shap2} also shows that, among the input features, $\epsilon_{SMA,0}$ has a relatively inconsequential influence on both EDP predictions. \begin{figure} \centering \includegraphics[scale=0.50]{Plot/Shap_2} \includegraphics[scale=0.50]{Plot/Shap_2b} \caption{Summary of SHAP values for: (a) peak bent drift ratio predictions; (b) max. longitudinal rebar strain predictions}\label{shap2} \end{figure} \section{Seismic fragility analyses}\label{frag_anal} The objectives of this section are to: (1) develop multi-parameter fragility functions for the bridge with SRR columns; (2) examine the effects of the key SRR column design parameters on the developed fragility functions while considering the effect of ambient temperature; and (3) compare the fragility functions of the bridge with SRR columns with those of the bridges of monolithic RC and PT columns. \subsection{Fragility function development}\label{frag_func} Fragility functions were developed for 11 DSs related to eight different bridge components, which are summarized in Table~\ref{Capacity models}. It is worth mentioning that, since the predicted maximum low-cycle fatigue damage factors for the ED links were rather small (rarely exceeding 0.2 for $Sa_1$ up to 1.5g), no meaningful damage states representing fatigue could be defined. A two-stage approach (see Section~\ref{ML_based}) was used to develop the fragility functions for the bridge with SRR columns. For this purpose, according to the procedure illustrated in Fig.~\ref{flowchart}, initially, a large number (in the order of $10^4$) of combinations of input feature values were generated using the Latin Hypercube sampling and based on their preselected distributions (see Table~\ref{table_input}). Subsequently, the PSDMs developed in Section~\ref{PSDM} were used to predict the EDPs of interest corresponding to each sampled combination of input features. The predicted EDPs were then used along with Monte Carlo simulations to compute the exceedance probabilities, $P_f$, of various limit states (LSs) according to their corresponding capacity models, which were assumed to be of log-normal distributions (Table~\ref{Capacity models}). Finally, neural network models with ReLU and linear activation functions at their intermediate and last layers, respectively, were trained to represent the fragility functions. In order to ensure that the exceedance probability predictions of the fragility functions are meaningful, i.e., between 0 and 1, the target values in the training data sets (exceedance probabilities) were initially transformed into a range of ($-\infty, +\infty$) using the \emph{logit} function. Therefore, the outputs of the trained models needed to be transformed back into a range of [0, 1] using the \emph{logistic} function. \begin {table*}[h!] \centering \caption{Considered capacity distributions for different damage states} \label{Capacity models} \begin{tabular}{lccccccc} \hline Damage State ID & Description & EDP & $ln$(Median, $S_c$) & Dispersion, $\beta_C$ \\ \hline I-1 & Column longitudinal rebar yielding & Max. tensile strain & $f_y/E$ & 0.35 \\ I-2 & Column longitudinal rebar fracture & Max. tensile strain & 0.15 & 0.35 \\ II-1 & Column cover concrete spalling & Max. compressive strain & 0.005 & 0.35 \\ II-2 & Column core concrete crushing & Max. compressive strain & $\epsilon_{cu}$ & 0.35 \\ III & SMA link permanent deformation & Max. tensile strain & $\epsilon_L+\sigma_{Mf}/E_M$ & 0.35 \\ IV & Bearing pad yielding & Peak deformation & 7.5 in. & 0.35 \\ V & Shear key failure & Peak deformation & 3.5 in. & 0.35 \\ VI & Abutment unseating & Peak deck end displacement & 21 in. & 0.35 \\ VII & Bent major residual deformation & Bent residual drift & 1\% & 0.35 \\ \hline \end{tabular} \end{table*} \begin{figure} \centering \includegraphics[scale=0.90]{Plot/fragility_chart_two_stage.png} \caption{Procedure of fragility function development}\label{flowchart} \end{figure} The neural network models representing the fragility functions were trained similarly to the PSDMs (see Section~\ref{PSDM}), aiming to minimize the cost function while tuning the hyperparameters to avoid overfitting based on MSE and $R^2$. The final MSE and $R^2$ of the fragility functions for all the damage states on the test data set were in the orders of 0.01 and 0.99-1.0, respectively, implying that the most significant sources of error for the fragility predictions within this framework were the PSDMs. For instance, the MSE and $R^2$ score on the test set for the fragility function of the abutment unseating were 0.01 and 1.0, respectively. To further evaluate the developed models based on the metrics used for classification models, e.g., recall and precision, the failure probabilities predicted for the test data were converted to non-failure/failure (0 or 1) binaries according to a threshold (e.g. 0.5). A higher precision indicates the model's higher power not to predict failure (1) for a real non-failure instance (0), while a higher recall indicates the model's higher power not to predict non-failure (0) for a real failure instance (1). All the developed fragility functions led to very high values of recall and precision (~1.0). For instance, the confusion matrix corresponding to the mapped fragility predictions for the test data (3000 data points) for bearing pads is shown in Fig~\ref{ConfM}. Accordingly, out of the 3000 examples, there are only 6 false positives and 10 false negatives, leading to recall and precision scores of about 0.99. \begin{figure} \centering \includegraphics[scale=0.7]{Plot/Conf_M.pdf} \caption{Confusion matrix for fragility prediction of bearings}\label{ConfM} \end{figure} \subsection{Effects of SRR column design parameters} The fragility curves obtained for seven DSs (I-1, II-1, III, IV, V, VI, and VII per Table~\ref{Capacity models}) and three different values of each of the SRR column key design parameters, i.e., $\epsilon_{SMA,0}$ and $\lambda$, are compared in Fig.~\ref{FragSum1}. For the fragility curves of various $\epsilon_{SMA,0}$ and $\lambda$ values, $\lambda$ and $\epsilon_{SMA,0}$ were fixed at their average values, i.e., 0.5 and 0.75\%, respectively. It is also worth mentioning that each curve was obtained considering the worst effect of ambient temperature. According to Fig.~\ref{FragSum1}(g, i, k, m), the exceedance probabilities of damage states IV (bearing yielding), V (shear key failure), VI (unseating), and VII (major residual) decrease with increasing $\epsilon_{SMA,0}$. This is because such DSs are directly related to the bridge displacement demands, which are reduced as the energy dissipation of the SRR columns increases with increasing $\epsilon_{SMA,0}$ (see the discussion in Section~\ref{interpret}). Contrarily, it is observed in Fig.~\ref{FragSum1}(a, c) that the exceedance probabilities for damage states I-1 (rebar yielding) and II-1 (cover spalling) increase with $\epsilon_{SMA,0}$, which can be attributed to the increased base shear/moment demands for larger $\epsilon_{SMA,0}$. As expected, increasing the initial strains of the SMA links further leads to their increased strain demands, thereby increasing the exceedance probability for their permanent deformations (damage state IV, Fig.~\ref{FragSum1}(e)). Before examining the effects of $\lambda$ on the obtained fragility curves, it is reminded that the $\lambda$ values 0.0 and 1.0 correspond to the SRR column designs with the maximum possible ED links to maintain self-centering and without any ED links, respectively~\citep{akbarnezhad2022seismic}. As seen in Fig.~\ref{FragSum1}(b, d, f, h, j, l, n), the exceedance probabilities of all of the examined DSs increase with $\lambda$. This is because, as discussed in Section~\ref{interpret}, increasing the amount of ED links (smaller $\lambda$) results in higher energy dissipation, and thus, smaller displacement demands. It is particularly interesting to observe that the probability of exceeding 1\% of bent residual drift (which is often considered large enough to necessitate bridge replacement~\citep{japan2002design, xiang2020probabilistic}), i.e., damage state VII, is also minimum when $\lambda = 0$, which indicates the importance of energy dissipation in reducing even the residual deformations. However, it is worth noting that, per ~\cite{akbarnezhad2022seismic}, the residual deformations of SRR columns are expected to increase as $\lambda$ gets smaller than 0. \begin{figure}[hb!] \centering \includegraphics[scale=0.83]{Plot/Frag_sum_rebar} \includegraphics[scale=0.83]{Plot/Frag_sum_conc} \includegraphics[scale=0.83]{Plot/Frag_sum_SMA} \includegraphics[scale=0.83]{Plot/Frag_sum_bearing} \includegraphics[scale=0.83]{Plot/Frag_sum_shearkey} \includegraphics[scale=0.83]{Plot/Frag_sum_unseating} \includegraphics[scale=0.83]{Plot/Frag_sum_residual} \caption{Effects of $\epsilon_{SMA,0}$ and $\lambda$ on fragility curves of bridge with SRR columns}\label{FragSum1} \end{figure} \subsection{Comparison with other column designs}\label{col_frag_comp} In order to assess the seismic vulnerability of the bridge with SRR columns relative to similar bridges but with monolithic RC and PT columns, the fragility functions of these bridges are compared in this section. The fragility functions of the latter bridges were developed through the same two-stage ML-based approach described earlier for the bridge with SRR columns. The fragility curves obtained for various DSs (I-1, I-2, II-1, II-2, IV, V, VI, and VII per Table~\ref{Capacity models}) of the three bridges are compared in Fig.~\ref{frag}. For the bridge of SRR columns, $\epsilon_{SMA,0}$ and $\lambda$ were fixed at 1.5\% and 0.0, while $T$ was assumed to be uncertain (see Table~\ref{table_input}). According to Fig.~\ref{frag}(a, b, c, d), the damage states associated with the columns' longitudinal rebar and concrete (I-1, I-2, II-1, and II-2) are all much likelier for the bridge of monolithic RC columns than for the bridges of PT and SRR columns. Specifically, the median $Sa_1$ at which column cover concrete spalling (damage state II-1) is predicted for the bridge of monolithic RC columns is almost 0.3g, while for the bridges of PT and SRR columns, the median $Sa_1$ for the same DS seem to be much larger than 1.5g (Fig.~\ref{frag}(c)). Likewise, though the predicted median $Sa_1$ for column core concrete crushing (damage state II-2) in the bridge of monolithic RC columns is almost 1.15g, this DS is not predicted to be exceeded in the bridges of PT and SRR columns (Fig.~\ref{frag}(d)). These findings primarily prove the damage mitigation efficacy of steel jacketing in the vicinity of the rocking joints. In terms of column longitudinal rebar yielding (damage state I-1), replacing the bridge's monolithic RC columns with PT and SRR columns is found to increase the respective median $Sa_1$ by more than 500\% (from ~0.2g to >1.25g; Fig.~\ref{frag}(a)). This was indeed expected because rocking joints inherently reduce the strain demands in the longitudinal rebar. Compared to rebar yielding, for the considered range of $Sa_1$, the probability of column longitudinal rebar fracture (damage state I-2) in all three bridges is extremely low (Fig.~\ref{frag}(b)). Focusing on the fragility curves of the PT and SRR columns, it is observed that the SRR columns appear to be somewhat less seismically vulnerable than the PT columns of similar lateral load resistance and ED links (Fig.~\ref{frag}(a, c)). The lower probability of cover concrete spalling (damage state II-1) in the SRR columns compared to the PT columns (Fig.~\ref{frag}(c)) is mainly attributed to the lower axial force demands in the SRR columns than in the PT columns~\citep{akbarnezhad2022bridge}. However, The lower probability of longitudinal rebar yielding (damage state I-1) in the SRR columns compared to the PT columns (Fig.~\ref{frag}(a)) may be justified by the larger height of the steel jacket in the designed SRR columns compared to the designed PT columns. Based on Fig.~\ref{frag}(e, f, g, h), as for other bridge damage states (IV, V, VI, and VII), the three bridges with different columns seem to be of similar fragility, except in terms of the bent's major residual deformation (damage state VII). Specifically, despite the lower energy dissipation capacity of rocking columns relative to the monolithic RC columns of similar lateral load resistance, which may lead to their higher drift ratio demands~\citep{lee2011performance}, the exceedance probabilities of bearing pad yielding (damage state IV), shear key failure (damage state V), and abutment unseating (damage state VI) at similar $Sa_1$ levels are very close (Fig.~\ref{frag}(e, f, g)). On the other hand, for the selected $Sa_1$ range, the probability of major residual drift (>1\%) in the monolithic RC bent is up to almost 3 times those in the bents of PT and SRR columns (Fig.~\ref{frag}(h)), demonstrating the self-centering efficacy of the rocking columns. \begin{figure}[hb!] \centering \includegraphics[scale=0.90]{Plot/frag2} \caption{Comparison of fragility curves for three different bridges: (a) I-1; (b) I-2; (c) II-1; (d) II-2; (e) IV; (f) V; (g) VI; (h) VII }\label{frag} \end{figure} \section{Summary and conclusions}\label{conclusions} This paper primarily aimed to evaluate the seismic fragility of a two-span RC highway bridge equipped with SRR columns through ML techniques. To this end, first, multi-parameter PSDMs were developed for multiple global and local EDPs using five different ML techniques, including (\emph{i}) ridge regression, (\emph{ii}) kernel support vector regression, (\emph{iii}) random forest, (\emph{iv}) adaptive boosting, and (\emph{v}) neural network. The input features of the initial PSDMs included a number of different ground motion characteristics as potential IMs, various material properties, two key SRR column design parameters (including the self-centering coefficient, $\lambda$, and the initial SMA link strain, $\epsilon_{SMA,0}$), and ambient temperature, $T$. To reduce the dimensionality of the initial PSDMs (without significant loss of their predictive power), the input features were subsequently reduced to only one “proficient” IM, $\lambda$, $\epsilon_{SMA,0}$, and $T$. In the next step, the performances of the PSDMs developed using various ML techniques were evaluated through $R^2$ and MSE metrics, and the most accurate PSDMs were selected. Following the selection of final PSDMs, the effects of $\lambda$, $\epsilon_{SMA,0}$, and $T$ on various EDPs were investigated through four model-agnostic local and global interpretation methods, namely, ICE, PDP, ALE, and SHAP. Subsequently, seismic fragility functions were developed for nine different DSs using neural networks, the selected PSDMs, and appropriate capacity models. Finally, the effects of $\lambda$ and $\epsilon_{SMA,0}$ on the fragility curves were investigated and the fragility curves of the bridge with SRR columns were compared with those of similar bridges with monolithic RC and PT columns. The major findings of this study are summarized below. \begin{itemize} \item Among the examined ground motion IMs, based on the permutation feature importance, the spectral acceleration at the period of 1 sec., $Sa_1$, was found to be more suitable to represent the ground motion intensity in the PSDMs of the bridge with SRR columns. \item Overall, among the ML techniques used to develop the PSDMs for the bridge with SRR columns, the neural network was found to result in the most accurate prediction models, leading to $R^2$ scores as high as 0.97 and MSE as low as 0.05. \item According to the PSDM interpretations, increasing $\epsilon_{SMA,0}$ decreases the SRR pier’s drift ratio demand, which in turn reduces the ED link strain demand. However, the prestressing of the SMA links slightly increases the moment demand in the SRR columns, leading to slightly higher longitudinal rebar and cover concrete strain demands. \item The PSDM interpretations also showed that decreasing $\lambda$, which amounts to increasing the ED links, slightly reduces the rebar and concrete damage in SRR columns. However, as long as $\lambda$ remains non-negative, the SRR bent’s residual drift ratio is not meaningfully affected by $\lambda$. \item Based on the PSDM interpretations and because the SMA links exhibit higher strength at higher temperatures, increasing $T$ was found to slightly increase the longitudinal rebar and concrete strain demands. \item According to the fragility curves generated for the bridge with SRR columns, decreasing $\lambda$ to 0 (the minimum value allowed to ensure adequate self-centering) reduced the probabilities of exceedance of all the examined DSs. Contrarily, increasing $\epsilon_{SMA,0}$ to 1.5\% slightly reduced the probabilities of exceedance of displacement-dependent DSs (e.g., bearing damage and abutment unseating), while slightly increasing the probabilities of exceedance of strain-dependent DSs (e.g., longitudinal rebar yielding and concrete spalling). \item Comparing the fragility curves for the bridges of SRR columns, monolithic RC columns, and PT columns showed that the SRR columns can seismically perform as well as (or even better than) the PT columns of similar lateral strengths. However, it was proven that both PT and SRR columns, which both benefit from rocking joints, can significantly outperform the monolithic RC columns in terms of longitudinal rebar and concrete damage, as well as residual deformations. \end{itemize} Overall, the findings of this study indicated that, even if the ambient temperature's uncertainty is taken into account, bridges of SRR columns can perform as well as (or even better than) bridges of PT columns. This conclusion besides the higher durability (due to the excellent corrosion resistance of NiTi) and easier repair (due to the easy replaceability of the SMA links) of SRR columns compared to PT columns can make SRR columns arguably suitable alternatives to PT columns. \bibliographystyle{cas-model2-names}
\section{Introduction} \label{s:intro} The increase in the frequency of hydroclimatic extreme events in the last few decades has caused devastating economic damage and claimed thousands of human lives \citep{hirabayashi2013global, winsemius2018disaster}. \citep{Winsemius2016} predicted an increase in this cost due to sea level rise and extreme precipitation events brought about by climate change. Uncertainty in climate change projections, particularly those associated with precipitation \citep{bhowmik2017multivariate}, also results in significant challenges to the design and maintenance of water infrastructure (e.g., \citep{Vahedifard2017,kasler_hecht_2017}). This is further exacerbated by the complexity of flooding events \citep{merz2014floods,condon2015climate,kundzewicz2017differences,franccois2019design} as extremal streamflow, which is a key measure of flood risk, shows spatial clustering \citep{hirsch2012has,MajumderReichShaby2022}. There is therefore a need to account for spatial and temporal variability (i.e., non-stationarity) in extremal streamflow due to precipitation when assessing current and future flood risk \citep{milly2008stationarity,vogel2011nonstationarity,merz2014floods,kundzewicz2014flood,salas2014revisiting,milly2015critiques,vsraj2016influence}. A relatively simple approach to projecting flood risk on the basis of extreme streamflow is by the statistical extrapolation of spatiotemporal trends observed in the historical record. Extreme value analysis (EVA) methods have been used to model the relationship between flooding and watershed characteristics and weather, using regressions or hierarchical models to account for non-stationarity \citep{vsraj2016influence,dawdy2012regional,lima2016hierarchical}. However, purely statistical projections of extremal streamflow that do not consider physical variables that are expected to change under climate change (e.g., temperature and precipitation) are likely to be unreliable for long-term projections \citep{jain2001floods}. Precipitation has a large impact on groundwater flow and is therefore a major driver of extremal streamflow. Like streamflow, it exhibits non-stationarity \citep{Cheng2014,kunkel2020precipitation} which needs to be incorporated into any modeling that attempts to provide future projections of extremal streamflow. In this paper, our objective is to build a spatial model relating precipitation and streamflow and use climate model forecasts of future precipitation to understand flood risk under different climate change scenarios. While climate change is often described in terms of the mean, it will be mostly experienced through extremes. Data for extreme events are by definition sparse, and parametric models must therefore be carefully chosen based on extremal theory to estimate small probabilities. Standard measures of dependence such as correlation and spatial models such as Gaussian processes (GP) do not adequately model extreme events; in order to properly account for spatial dependence while modeling rare event probabilities, we use spatial extreme value analysis (EVA). For modeling block maxima, e.g., the annual maximum of daily streamflow, the commonly used spatial EVA model is the max-stable process (MSP) \citep{de2006extreme,Smith-1990, Tawn, Schlather, Kabluchko-Schlather-deHaan, Buishand-etal, Wadsworth-Tawn-2012,Reich-Shaby}. MSPs are a natural asymptotic model for block maxima, but can also be applied to peaks over a threshold using a censored likelihood \cite[e.g.,][]{Huser-Davison-2014,Reich-Shaby-Cooley}. Exact inference for MSPs are challenging, and commonly used censored likelihood models for MSPs are also computationally intractable for all but a small number of spatial locations \citep{Schlather, Kabluchko-Schlather-deHaan, Wadsworth-Tawn-2012,wadsworth-2014a,wadsworth-2015a}. Further, MSPs enforce asymptotic dependence among spatial locations \citep{Huser-Wadsworth}, an unreasonable assumption for environmental data that often has weakening spatial dependence with increasing extremeness. Alternatives and extensions to MSPs include process mixture models \citep{Huser-Wadsworth, MajumderReichShaby2022,ZhangetalJASA2022} and max-infinitely divisible process (MIDP) models \citep{BoppMIDP2021JASA}, both of which can accommodate more flexible asymptotic regimes of tail dependence. Climate-informed flood projections which consider non-stationarity is an ongoing area of research \citep{delgado2014projecting,condon2015climate,franccois2019design,schlef2018general,schlef2021comparing,sankarasubramanian2003flood,zhang2015evaluation,bertola2019informed,Awasthietal2022}, but it is not commonly studied as a spatial EVA model. The intractability of common spatial EVA likelihoods pose computational challenges which make it difficult to fit realistic statistical models. For example, in a study of a large geographic region under a changing climate, it is unrealistic to assume stationarity in the degree of extremal dependence between nearby locations. Non-stationarity could appear due to dependence on variables which vary spatio-temporally, or due to physical considerations like topography. Recent work on incorporating non-stationarity in spatial EVA models include \cite{chevalier2021modeling}, who use multidimensional scaling to capture regional variation in the asymptotic spatial dependence of a MSP, and \cite{ZhongetalAoAS2022}, who construct an MIDP which include covariates to capture spatio-temporal non-stationarities. Similarly, our work proposes a spatial EVA model that allows extremal dependence to vary over both space and time via climate covariates. While this model is flexible and intuitive, it is difficult to fit using standard computational methods. Many of the modeling and computational limitations of extreme value theory have been addressed using deep learning. For example, \citep{cannon2010flexible,vasiliades2015nonstationary,shrestha2017projecting,pasche2022neural,richards2022unifying} and the references therein use neural networks to obtain flexible regression frameworks relating covariates to extreme quantities. Similar to the application in this paper, \cite{shrestha2017projecting} use neural networks to model the dependence of extreme streamflow and precipitation and temperature, and then use these relationships with climate models to project future extreme streamflow events. Recently, \cite{wilson2022deepgpd} use a convolutional neural network to regress spatial fields onto the parameters of an extreme value distribution. Computational limitations due to intractable likelihoods associated with spatial extreme value processes have also been addressed using deep learning. \cite{lenzi2021neural} and \cite{MajumderReichShaby2022} develop synthetic likelihood functions by sampling from the spatial extreme value process with different parameter settings, and fitting these simulations with a neural network model to learn an approximate likelihood function connecting the data with the model parameters. In this work, we propose a non-stationary process mixture model (NPMM) for climate-informed estimation of extremal streamflow. We specify a statistical EVA model for annual streamflow maxima within the central US (CUS) region, with downscaled and bias-corrected precipitation forecasts obtained from the Multivariate Adaptive Constructed Analogs (MACA) dataset \citep{MACA} used as predictors. The NPMM introduces non-stationarity by allowing the asymptotic (in)dependence of the spatial process to vary spatio-temporally as a function of precipitation for sub-regions within the CUS. Inference for the NPMM is separated into density estimation and parameter estimation. The density estimation, used to approximate the intractable likelihood of the spatial process, is carried out using semi-parametric quantile regression (SPQR) \citep{xu-reich-2021-biometrics}. The quantile process has a basis function representation, whose weights are estimated using a feed-forward neural network. The NPMM provides a flexible framework for incorporating covariates into the spatial process as well as the marginal distributions at each location, and we use it to project extremal streamflow for 2006--2035 informed by climate model precipitation under two different climate pathways. The rest of the paper is organized as follows. We introduce the streamflow and precipitation datasets for the CUS region in Section 2. Section 3 presents the NPMM and discusses density estimation, parameter estimation, and tail behavior for the model. Density estimation using SPQR for the CUS locations is carried out in Section 4, and we conduct a simulation study to see how errors in density estimation affect parameter estimates. The analysis of extremal streamflow as a function of precipitation is presented in Section 5, along with future projections of extremal streamflow based on downscaled climate model precipitation data. Section 6 concludes. \section{Hydroclimatic data for the Central US}\label{s:data} \subsection{Observed streamflow data} \begin{figure} \centering \includegraphics[scale=0.6]{figs/99pctl.png} \caption{\small \textbf{HCDN sites in HUC-2 regions 10L and 11}: Locations and 0.99 quantiles of annual streamflow maxima (in $ft^3/s$) at 55 HCDN stations overlaid on an elevation map (in $m$) of the central United States region bounded by $[-107, -90] \times [32, 43.5]$. The two polygons within the figure correspond to regions 10L (top) and 11 (bottom). } \label{fig:99pctl} \end{figure} The USGS Hydro-Climatic Data Network (HCDN) \citep{lins2012usgs} is a dataset of streamflow records within the United States and its Territories. The HCDN consists of locations that are minimally impacted by anthropogenic activity, making it suitable to study the effects of changing climate on streamflow. The HCDN has been used to study the effect of climatic variables on streamflow \citep{Sankaretal2001,OhSankar-2012} and to study the change in extremal streamflow over time \citep{MajumderReichShaby2022}. For studying water resources, the USGS divides the US into groups of nested Hydrologic Units, identified by Hydrologic Unit Codes (HUCs). The first level of classification divides the US into 21 regions, referred to as HUC-2 regions. Our study focuses on two specific HUC-2 regions for which we have a complete data record between 1972--2021; the lower half of Region 10, denoted as 10L, and Region 11. Together, they span a region in the Central US (CUS) that consist of 55 gauges spread across South Dakota, Nebraska, Colorado, Wyoming, Kansas, Iowa, Missouri, Arkansas, Oklahoma, New Mexico and Texas. Figure \ref{fig:99pctl} plots the sample 0.99 quantile of annual streamflow maxima (measured in $ft^3/s$) over the last 50 years at each station. There is spatial variation in these data, with extremal streamflow increasing from west to the east. \subsection{Observed precipitation data} \begin{figure} \centering \includegraphics[scale=.9]{figs/prcp_seasonal.png} \caption{\small \textbf{Seasonal distribution of NClimGrid precipitation:} 0.99 quantiles of seasonal precipitation between 1972--2021. Seasons are defined as winter (JFM), spring (AMJ), summer (JAS), and autumn (OND).} \label{fig:nclimgrid} \end{figure} The CUS is characterized by severe convective storms \citep{Risseretal2019,ZHANG2022100499}, and precipitation trends that could potentially influence flooding \citep{kunkel2020precipitation}. \citep{condon2015climate} have used monthly average precipitation as a model predictor to project future floods, while \citep{Awasthietal2022} have used monthly total precipitation to as predictors to project flood frequencies under near-term climate change. We refer the reader to \citep{Awasthietal2022} for further references regarding the use of precipitation and temperature as predictors of extremal streamflow. In this study, we use seasonal and annual precipitation means as predictors of annual extremal streamflow. Monthly precipitation data is sourced from the NOAA Monthly US Climate Gridded Dataset (NClimGrid) \citep{NClimGrid}, which is based on the Global Historical Climatology Network (GHCN) dataset. NClimGrid data is available on a 5km $\times$ 5km grid, and for each of the 55 HCDN stations we use monthly precipitation from the NClimGrid cell that contains the HCDN station. \begin{figure} \centering \includegraphics[scale=0.7]{figs/precip_basin.png} \caption{\small Annual distribution of NClimGrid precipitation from 1972--2021 for 2 HUC-2 regions, averaged over HCDN stations within each region.} \label{fig:basinprcp} \end{figure} The NClimGrid data are treated as covariates to estimate both the marginal parameters at each site as well as dependence parameters for the underlying spatial process. For our response variable $Y_t( \mbox{\bf s})$, the extremal streamflow for year $t$ and location $ \mbox{\bf s}$, we define the covariates $X_{1t}( \mbox{\bf s}),\ldots, X_{4t}( \mbox{\bf s})$ as the seasonal precipitation for location $ \mbox{\bf s}$ and year $t$. Following \citep{Awasthietal2022}, the seasons correspond to winter (JFM), spring (AMJ), summer (JAS), and autumn (OND), where JFM denotes the months of January-February-March, and so on. Figure \ref{fig:nclimgrid} plots the 0.99 quantile of the seasonal precipitation at the HCDN sites for each season. Not only is there spatial variability within a season, we also see heterogeneity across seasons for most sites. Additionally, we define the covariates $Z_{1t}$ and $Z_{2t}$ as the annual precipitation within HUC-2 Regions 10L and 11, respectively, averaged over the stations in the region. Figure \ref{fig:basinprcp} plots the annual precipitation averaged across stations for the 2 HUC-2 regions from 1972--2021. We note that Region 11, which is located in the southern part of our region of interest, has higher total precipitation than the region 10L; this is corroborated by the seasonal plots in Figure \ref{fig:nclimgrid}. \subsection{Global Climate Model output of future precipitation}\label{s:maca} \begin{figure} \centering \includegraphics[scale=1]{figs/calibration.pdf} \caption{\small Datasets used in the study, along with periods of availability, and usage details.} \label{fig:calibration} \end{figure} While Global Climate Models (GCMs) do not produce streamflow estimates, they provide precipitation variables which we use to predict extremal streamflow. The Multivariate Adaptive Constructed Analogs (MACA\footnote{\url{https://www.climatologylab.org/maca.html}}) dataset \cite{MACA} is a statistical downscaling method for GCMs. MACA downscales the model output from 20 GCMs of the Coupled Model Inter-Comparison Project 5 (CMIP5) \cite{CMIP5} for historical GCM forcings (1950--2005) as well as future Representative Concentration Pathways (RCPs) RCP 4.5 and RCP 8.5 scenarios (2006--2100) from the native coarse resolution of the GCMs to a higher spatial resolution of 4km. RCP 4.5 assumes that total anthropogenic CO$_2$ will peak around 2040, and decline till 2080, whereas RCP 8.5 assumes that CO$_2$ concentrations continue to rise until the end of the century. MACA provides monthly precipitation (pr) as one of its outputs; we obtain both the historical runs for 1972--2005 for calibrating it to NClimGrid output, and use it to forecast extremal streamflow for the CUS from 2006--2035. The quality of the GCM model forecasts can vary according to variable, climate pathway, geographic region, and time horizon. Instead of using all of them, we choose 6 models for each of the RCP scenarios based on the criteria laid out in \cite{Joyce_2020}. The chosen models are the top three ranked projections in terms of precipitation change (dry, wet) at mid-century (2041--2070) under the 2 scenarios (RCP 4.5, RCP 8.5) at the coterminous US scale, with poor performers excluded. While our study focuses on projections up until 2035, our choice of models ensure that these results can be extended for longer durations, and account for model and scenario uncertainty. The models chosen for RCP 4.5 are IPSL-CM5A-MR, bcc-csm1-1-m, IPSL-CM5A-LR, CSIRO-Mk3-6-0, CNRM-CM5, and MRI-CGCM3; models chosen for RCP 8.5 are IPSL-CM5A-MR, HadGEM2-ES, inmcm4, CNRM-CM5, MRI-CGCM3, and CSIRO-Mk3-6-0. We refer readers to \cite{Joyce_2020} for further comparisons of all 20 models. Figure \ref{fig:calibration} contains a schematic of the observational and climate model datasets used in this study, as well as the calibration, validation and forecast time periods. The GCM output is calibrated to remove bias compared to the observed precipitation at each location. The GCM log-precipitation outputs during the historical period are calibrated to have the same sample mean and variance as the observed precipitation for the same time period. This log-linear transformation is estimated and applied separately for each HCDN station and each GCM forcing, and applied to the GCM forecasted precipitation. \section{Non-stationary Process Mixture Models for Spatial Extremes} \label{s:model} \subsection{The NPMM for block maxima}\label{s:npm} Let $Y_t( \mbox{\bf s})$ be the extreme observation at time $t$ and spatial location $ \mbox{\bf s}$. The observations $Y_t( \mbox{\bf s})$ are defined as block maxima, and are thus assumed to arise from a generalized extreme value (GEV) distribution with location $\mu_t( \mbox{\bf s})$, scale $\sigma_t( \mbox{\bf s})$, and shape $\xi_t( \mbox{\bf s})$: $$ Y_t( \mbox{\bf s}) \sim \mbox{GEV}\{\mu_t( \mbox{\bf s}),\sigma_t( \mbox{\bf s}),\xi_t( \mbox{\bf s})\}, $$ whose cumulative distribution function (CDF) $F_{t, \mbox{\bf s}}(y) := \mathbb{P}[Y_t( \mbox{\bf s})<y]$ is \begin{equation} \mathbb{P}\bigl[Y_t( \mbox{\bf s})<y\bigr] = \exp \biggl\{-\left[1+\xi_t( \mbox{\bf s})\left(\frac{y-\mu_t( \mbox{\bf s})}{\sigma_t( \mbox{\bf s})}\right)\right]^{-1/\xi_t( \mbox{\bf s})}\biggr\}. \end{equation} The CDF is defined over the set $\bigr\{y:1+\xi_t( \mbox{\bf s})(y-\mu_t( \mbox{\bf s}))/\sigma_t( \mbox{\bf s})>0\bigr\}$. We assume the GEV location parameters vary spatially and are dependent on precipitation, while the scale and shape parameters also vary spatially, i.e., \begin{align}\label{e:marginal} &\mu_t( \mbox{\bf s}) = \mu_0( \mbox{\bf s}) + \sum_{i=1}^4\mu_i( \mbox{\bf s})X_{it}( \mbox{\bf s}), &\sigma_t( \mbox{\bf s}) &= \sigma( \mbox{\bf s}), &\xi_t( \mbox{\bf s}) &= \xi( \mbox{\bf s}) \end{align} where $X_{it}( \mbox{\bf s})$ are the seasonal precipitation variables defined in Section \ref{s:data}. The CDF transformed variables $U_t( \mbox{\bf s}) := F_{t, \mbox{\bf s}}\{Y_t( \mbox{\bf s})\}$ share common uniform marginal distributions but are spatially correlated; this transformation separates residual spatial dependence in $U_t( \mbox{\bf s})$ from the spatial dependence induced by spatial variation in the GEV parameters, which can be modeled using GP priors over $ \mbox{\bf s}$. A spatial dependence model on $U_t( \mbox{\bf s})$ is obtained via the transformation $U_t( \mbox{\bf s}) = G_{t, \mbox{\bf s}}\{V_t( \mbox{\bf s})\}$, such that \begin{equation} \label{eq:copula_pareto-02} V_t( \mbox{\bf s}) = \delta_{st} g_R\{R_t( \mbox{\bf s})\} + (1-\delta_{st})g_W\{W_t( \mbox{\bf s})\}, \end{equation} where $R_t( \mbox{\bf s})$ is a max-stable process (MSP), $W_t( \mbox{\bf s})$ is a Gaussian process (GP), and $g_R$ and $g_W$ are transformations to ensure that $g_R\{R_t( \mbox{\bf s})\}$ and $g_W\{W_t( \mbox{\bf s})\}$ both follow the standard exponential distribution. Without loss of generality, we assume that $R_t( \mbox{\bf s})$ has a marginal GEV$(1,1,1)$ distribution and $W_t( \mbox{\bf s})$ has a marginal N$(0,1)$ distribution; the corresponding transformations are $g_R(r) = -\log\{1-\exp(-1/r)\}$ and $g_W(w) = -\log\{1-\Phi(w)\}$ for the standard normal CDF $\Phi(w)$. By construction, $V_t( \mbox{\bf s})$ follows a two-parameter hypoexponential distribution marginally, with CDF \begin{equation} \label{eq:hypo} G(v) = 1 - \frac{1-\delta_{st}}{1-2\delta_{st}}e^{-\frac{1}{(1-\delta_{st})}v} + \frac{\delta_{st}}{1-2\delta_{st}}e^{-\frac{1}{\delta_{st}} v}. \end{equation} The parameters $\delta_{st} \in[0,1]$ are weight parameters that control the relative contribution of the two spatial processes at every site and time point. The spatial dependence model in \eqref{eq:copula_pareto-02} was originally introduced in \citep{MajumderReichShaby2022} where it assumed a constant value of $\delta_{st} = \delta$. In practice, however, it is reasonable to partition the sites into $L$ regions such that sites within each partition share a common value of $\delta$ at any given time point $t$, with each partition having a potentially different value of $\delta$. Locations can be assigned to partitions based on underlying geophysical characteristics of the data, or clustered according to an appropriate distance metric. For streamflow data, the two HUC-2 regions (10L and 11) are considered partitions of the CUS. Thus $L = 2$, and we denote $\delta_{1t}$ and $\delta_{2t}$ as the weight parameters for these 2 partitions. As with the marginal parameters, we assume $\delta_{1t}$ and $\delta_{2t}$ depend on partition-specific covariates, i.e., \begin{align}\label{e:joint} g^{-1}(\delta_{it}) = \beta_{i0} + \beta_{i1} Z_{it}, i = 1,2, \end{align} where $g(\cdot)$ is a link function mapping $\delta_{it}$ to a $[0,1]$ range, and $Z_{it}$ are the annual precipitation for the two HUC-2 regions as defined in Section \ref{s:data}. The $\delta_{it}$ depends on time only through the covariate $Z_{it}$. Mixing the asymptotically dependent MSP with the asymptotically independent GP provides a rich model for spatial dependence, while the covariates help capture changes in the spatio-temporal dependence. We model the correlation of the GP $W( \mbox{\bf s})$ using the isotropic powered-exponential correlation function $\mbox{Cor}\{W( \mbox{\bf s}_1, \mbox{\bf s}_2)\} = \exp\{-(h/\rho_W)^{\alpha_W}\}$ with distance $h=|| \mbox{\bf s}_1- \mbox{\bf s}_2||$, smoothness $\alpha_W\in(0,2)$, and range $\rho_W>0$. The MSP $R( \mbox{\bf s})$ is assumed to have isotropic Brown-Resnick spatial dependence defined by the variogram $\gamma(h) = (h/\rho_R)^{\alpha_R}$ for smoothness $\alpha_R\in(0,2)$ and range $\rho_R>0$. We also incorporate a nugget $r$ to the process mixture. The GP $W( \mbox{\bf s})$ and MSP $R( \mbox{\bf s})$ that form our process mixture are therefore constructed as: \begin{align*} \mbox{Cor}\bigl(W( \mbox{\bf s}_1, \mbox{\bf s}_2)\bigr) &= r\cdot\exp\{-h/\rho\}\\ R( \mbox{\bf s}) &= \max\{r\cdot R_1( \mbox{\bf s}),(1-r)\cdot R_2( \mbox{\bf s})\}, \end{align*} where $h = || \mbox{\bf s}_1- \mbox{\bf s}_2||$, $R_1( \mbox{\bf s})$ is an MSP, and $R_2( \mbox{\bf s}) \stackrel{iid}{\sim} \mbox{GEV}(1,1,1)$ distributed independently of $R_1( \mbox{\bf s})$. We refer to this model as a non-stationary process mixture model (NPMM). The NPMM has marginal parameters $ \mbox{\boldmath $\theta$}_1 = \{\mu_0( \mbox{\bf s}_i),...,\mu_4( \mbox{\bf s}_i),\sigma( \mbox{\bf s}_i),\xi( \mbox{\bf s}_i)\}$ and dependence parameters $ \mbox{\boldmath $\theta$}_2=\{\beta_{10},\beta_{11},\beta_{20},\beta_{21},\rho_R,\alpha_R,\rho_W,\alpha_W\}$. \subsection{Asymptotic joint tail behavior for the NPMM} Extremal spatial dependence of the process at sites $ \mbox{\bf s}_1$ and $ \mbox{\bf s}_2$ is often measured using the conditional exceedance probability, \begin{equation}\label{e:chi_defn} \chi_u( \mbox{\bf s}_1, \mbox{\bf s}_2) := \mathbb{P}\{U( \mbox{\bf s}_1) > u | U( \mbox{\bf s}_2) > u\}, \end{equation} where $u\in(0,1)$ is a threshold. The random variables $U( \mbox{\bf s}_1)$ and $U( \mbox{\bf s}_2)$ are defined as asymptotically dependent if the limit \begin{equation} \chi( \mbox{\bf s}_1, \mbox{\bf s}_2) = \lim_{u\rightarrow 1}\chi_u( \mbox{\bf s}_1, \mbox{\bf s}_2) \end{equation} is positive and independent if $\chi( \mbox{\bf s}_1, \mbox{\bf s}_2) = 0$. \begin{figure} \centering \begin{subfigure}[b]{0.49\linewidth} \includegraphics[width=\linewidth]{figs/chi_sq.png} \caption{\small $\chi_u(h)$ for different combinations of $\delta_1$ and $\delta_2$ with threshold $u=0.9999$.} \label{fig:chi_sq} \end{subfigure} \hfill \begin{subfigure}[b]{0.49\linewidth} \includegraphics[width=\linewidth]{figs/chi_empirical.png} \caption{\small $\chi_u(h)$ for different values of $\delta$ with $\delta_1=\delta$ and $\delta_2=1-\delta$.} \label{fig:chi_empirical} \end{subfigure} \caption{\small Empirical $\chi_u(h)$ for the process mixture model as a function of $\delta_1$ and $\delta_2$ for sites corresponding to the HCDN stations in the CUS.} \label{fig:empericalchi} \end{figure} To examine the asymptotic dependence properties of the proposed methods, we numerically approximation $\chi_{u}( \mbox{\bf s}_1, \mbox{\bf s}_2)$ for various values of $u$, $\delta_1$ and $\delta_2$. We scaled our region of interest and all 55 sites within it to fall within the unit square, and considered the extremal spatial dependence between a hypothetical pair of sites at a distance for $h = 0.12$ from each other. The value for $h$ is chosen as the solution to: \begin{align*} h = \max_{i = 1:55} \min || \mbox{\bf s}_i - \mbox{\bf s}_{i^*}||, \end{align*} where $a:b$ is used as shorthand notation for $a, a+1,\ldots,b-1,b$, and $ \mbox{\bf s}_{i^*}$ is the site closest to $ \mbox{\bf s}_i$. In its original scale, this is equivalent to HCDN stations 218 km apart. Figure \ref{fig:chi_sq} plots the behavior of $\chi_u( \mbox{\bf s}_1, \mbox{\bf s}_2)$ for different $(\delta_1,\delta_2)$ pairs. We fixed the range to $\rho_W = 0.50$ and $\rho_R = 0.10$ (see Section \ref{s:numericalstudies} for a discussion on the choice of $\rho_W$ and $\rho_R$), and computed the conditional exceedance probability for the $u=0.9999$. When $\delta_1=\delta_2 = \delta$, \citep{MajumderReichShaby2022} have shown using empirical studies that $\chi_u( \mbox{\bf s}_1, \mbox{\bf s}_2)\to 0$ if $\delta<0.5$ and $\chi_u( \mbox{\bf s}_1, \mbox{\bf s}_2)>0$ for $\delta>0.5$. An analytical result consistent with this findng was also derived for the case of a shared extremal process, i.e., $R( \mbox{\bf s}_1) = R( \mbox{\bf s}_2) = R$. From Figure \ref{fig:chi_sq}, we can also see that $\chi_u( \mbox{\bf s}_1, \mbox{\bf s}_2)\to 0$ when both $\delta_1, \delta_2>0.5$. To understand the tail behavior of the process when $\delta_1$ is high and $\delta_2$ is low (and vice-versa), we consider the case where $\delta_1=\delta, \delta_2 = 1-\delta$, for $\delta\in (0,1)$. We find that $\chi( \mbox{\bf s}_1, \mbox{\bf s}_2)\to 0$ in this situation for all values of $\delta$; an analytical derivation of this result is provided in \ref{s:chi_derivation}. This is verified empirically in Figure \ref{fig:chi_empirical} where $\chi( \mbox{\bf s}_1, \mbox{\bf s}_2)\to 0$ for different values of $\delta$. It also corresponds to the diagonal in Figure \ref{fig:chi_sq} which is shown to go to 0. This is intuitively reasonable; $R( \mbox{\bf s})$ and $W( \mbox{\bf s})$ are independent, and thus asymptotic dependence is only achieved if both sites have large delta and thus both sites allow substantial contribution for the asymptotically dependent processes $R( \mbox{\bf s})$. \subsection{Density regression using Deep Learning for the NPMM} Assume the process is observed at $n$ sites $ \mbox{\bf s}_1,..., \mbox{\bf s}_n$. We partition the parameters into those that affect the marginal distributions in (\ref{e:marginal}), denoted $ \mbox{\boldmath $\theta$}_1$, and those that affect the spatial dependence, denoted $ \mbox{\boldmath $\theta$}_2$. Denoting $Y( \mbox{\bf s}_i)\equiv Y_{i}$ and $U_{i}:=F(Y_{i}; \mbox{\boldmath $\theta$}_1)$, we can express the joint distribution for all the observations using a change of variables, as: \begin{equation}\label{e:changeofvariables} f_y(y_{1},...,y_{n}; \mbox{\boldmath $\theta$}_1, \mbox{\boldmath $\theta$}_2) = f_u(u_{1},...,u_{n}; \mbox{\boldmath $\theta$}_2)\prod_{i=1}^n\left|\frac{dF(y_{i}; \mbox{\boldmath $\theta$}_1)}{dy_{i}}\right|. \end{equation} Model fitting for the NPMM is challenging due to the way the spatial dependence is specified; the joint distribution of the MSP $R( \mbox{\bf s})$ is available only for a moderate number of locations, and working with the term $f_u(u_{1},...,u_{n}; \mbox{\boldmath $\theta$}_2)$ in \eqref{e:changeofvariables} analytically is not viable. As in \citep{MajumderReichShaby2022}, the change of variables in \eqref{e:changeofvariables} sets the process mixture component up for density estimation. The density estimation is carried out on a surrogate likelihood based on a Vecchia decomposition \citep{vecchia1988estimation,stein2004approximating,datta2016hierarchical,katzfuss2021general} of the joint distribution $f_u(u_{1},...,u_{n}; \mbox{\boldmath $\theta$}_2)$, \begin{equation}\label{e:vecchia} f_u(u_{1},...,u_{n}; \mbox{\boldmath $\theta$}_2) = \prod_{i=1}^n f(u_{i}| \mbox{\boldmath $\theta$}_2,u_{1}, ...,u_{i-1}) \approx \prod_{i=1}^n f_i(u_{i}| \mbox{\boldmath $\theta$}_2,u_{(i)}), \end{equation} for $u_{(i)} = \{u_j; j\in {\cal N}_i\}$. The set of locations $ \mbox{\bf s}_{(i)}$ are analogously defined as $ \mbox{\bf s}_{(i)} = \{ \mbox{\bf s}_j; j\in {\cal N}_i\}$ and is referred to as the Vecchia neighboring set. The approximation therefore entails truncating the dependence of $u_i$ the $u_j$ for all its previous $i-1$ ordered sites to instead consider dependence on only up to $m$ sites, i.e., $|{\cal N}_i| \leq m$. The conditional distribution terms on the right hand side of \eqref{e:vecchia} do not have closed-form expressions. Density regression is carried out for each of the $n-1$ terms separately using the semi-parametric quantile regression (SPQR) model introduced in \citep{xu-reich-2021-biometrics}: \begin{equation}\label{e:1} f(u_{i}| \mbox{\bf x}_{i},\mathcal{W})= \sum_{k=1}^{K}\pi_{k}( \mbox{\bf x}_{i},\mathcal{W})B_{k}(u_{i}), \end{equation} where $\pi_k( \mbox{\bf x},\mathcal{W})\ge 0$ are probability weights with $\sum_{k=1}^K\pi_k( \mbox{\bf x})=1$ that depend on the parameters $\mathcal{W}$, and $B_k(u)\ge0$ are M-spline basis functions that, by definition, satisfy $\int B_k(u)du=1$ for all $k$. The density regression model in \eqref{e:1} treats $u_{(i)}$ and $ \mbox{\boldmath $\theta$}_2$ as features (covariates), denoted as $ \mbox{\bf x}_i$, with $u_i$ being the corresponding response variable. By increasing the number of basis functions $K$ and appropriately selecting the weights $\pi_k( \mbox{\bf x})$, the mixture distribution in \eqref{e:1} can approximate any continuous density function \citep[e.g.,][]{chui1980,abrahamowicz1992} which makes it suitable for our application. The weights are modeled using a neural network (NN) with $H$ hidden layers and a multinomial logistic (softmax) activation function on its output layer, i.e., \begin{equation}\label{e:ffnn} \pi_k( \mbox{\bf x},\mathcal{W}) = f_{NN}( \mbox{\bf x},\mathcal{W}). \end{equation} The NN weights $\mathcal{W}$ for the SPQR model at site $ \mbox{\bf s}_i$ can be estimated by maximizing the likelihood in \eqref{e:1}: \begin{align*} \hat{{\cal W}}_i \gets \underset{{\cal W}}{\operatorname{argmax}} f(u_{i}| \mbox{\bf x}_{i},{\cal W}). \end{align*} Instead of using observational data for maximum likelihood, the weights are learned from training data generated from the process mixture model with parameters $ \mbox{\boldmath $\theta$}_2 \sim p^*$, which can then be used to obtain realizations from the process over sites $i$ and ${\cal N}_i$ from the model conditioned on $ \mbox{\boldmath $\theta$}_2$. Specifically, we generate data at the observed spatial site with the same Vecchia neighbor sets as the problem at hand. We select the design distribution $p^*$ with support covering the range of plausible values for $ \mbox{\boldmath $\theta$}_2$. Given these values, we generate $U( \mbox{\bf s})$ at $ \mbox{\bf s}\in\{ \mbox{\bf s}_i, \mbox{\bf s}_{(i)}\}$. The feature set $ \mbox{\bf x}_i$ for modeling $u_i$ at site $i$ thus contains the spatial parameters $ \mbox{\boldmath $\theta$}_2$, and process values at the neighboring sites $U( \mbox{\bf s}_{(i)})$. Since we can generate arbitrarily large datasets from the design distribution, model fit is not affected by any data scarcity of the observations. This is important since NNs often require large datasets for training. The NNs have their own hyperparameters which cannot be estimated directly but rather need to be tuned. These include the network architecture - the number of hidden layers ($H$), the size of each hidden layer ($L_h$), the activation function ($\psi(\cdot)$), etc. They also include NN training parameters like the learning rate, batch size, number of epochs, and early stopping criteria. The model is fit using the \texttt{R} \citep{R} package \texttt{SPQR} \citep{SPQR_R} whose in-built cross-validation functions can be used to tune the NN hyperparameters. Once the weights have been learned, applying the NN to the approximate likelihood is straightforward, and the Vecchia approximation ensures that the computational burden increases linearly in the number of spatial locations. Algorithm \ref{a:local} outlines the local SPQR approximation. \begin{algorithm} \caption{Local SPQR approximation}\label{a:local} \begin{algorithmic} \Require sites $ \mbox{\bf s}_1, \ldots, \mbox{\bf s}_n$ with neighbor sites $ \mbox{\bf s}_{(1)}, \ldots, \mbox{\bf s}_{(n)}$ \Require Design distribution $p^*$, training sample size $N$ \State $i \gets 2$ \While{$i \leq n$} \State $j \gets 1$ \While{$j \leq N$} \State Draw values of $\mathbf{ \mbox{\boldmath $\theta$}}_{2j} \sim p^*$ \State Generate $U_j( \mbox{\bf s})$ at $ \mbox{\bf s} \in \{ \mbox{\bf s}_i, \mbox{\bf s}_{(i)}\}$ given $\mathbf{ \mbox{\boldmath $\theta$}}_{2j}$ using \eqref{eq:copula_pareto-02} \State Define features $ \mbox{\bf x}_{ij} = ( \mathbf{ \mbox{\boldmath $\theta$}}_{2j},u_{(i)j})$, where $u_{(i)j} = \{U_j( \mbox{\bf s}); \mbox{\bf s}\in \mbox{\bf s}_{(i)}\}$ \State $j \gets j + 1$ \EndWhile \State solve $\hat{{\cal W}_i} \gets \underset{{\cal W}}{\operatorname{argmax}} \prod_{j=1}^N f(u_{ij}| \mbox{\bf x}_{ij},{\cal W})$ for $f(u| \mbox{\bf x},{\cal W})$ defined in \eqref{e:1} using {\tt SPQR} \State $i \gets i + 1$ \EndWhile \end{algorithmic} \end{algorithm} \subsection{Parameter estimation using MCMC for the NPMM} Given the approximate model in \eqref{e:changeofvariables}--\eqref{e:vecchia} for $f_y$ with an SPQR approximation for the spatial dependence $f_u$, a Bayesian analysis using Markov Chain Monte Carlo (MCMC) methods is used for parameter estimation. We use Metropolis updates for both $ \mbox{\boldmath $\theta$}_1$ and $ \mbox{\boldmath $\theta$}_2$. For a spatio-temporally varying coefficient model with local GEV coefficients for site $i$, we update parameters $\{\mu_t( \mbox{\bf s}_i), \sigma( \mbox{\bf s}_i), \xi( \mbox{\bf s}_i)\}$ as a block sequentially by site, and exploit the Vecchia approximation to use only terms in the likelihood corresponding to sites which appear either as the response variable in the Vecchia approximation or in a Vecchia neighbor set. The weight parameters $\delta_i, i=1,2$ are updated independent of each other, with the coefficients $(\beta_{i0},\beta_{i1})$ updated as a block for each $i$. All Metropolis updates are tuned to give acceptance probability 0.4, and convergence is diagnosed based on the visual inspection of the trace plots. \section{Density Estimation for CUS Sites and Numerical Studies}\label{s:numericalstudies} \begin{figure}[h] \centering \includegraphics[scale=0.6]{figs/locations.png} \caption{\textbf{\small Sites used to fit SPQR models}: Distribution of 55 watershed locations scaled to the unit square. Squares and circles denote the 2 different regions. The blue square corresponds to site 45, and the red squares and circles correspond to its Vecchia neighboring set.} \label{fig:locations} \end{figure} Density estimation for the NPMM only requires the knowledge of the spatial configuration of sites, and a reasonable design distribution. We consider the $n=55$ HCDN sites with the domain scaled to the unit square for convenience. Sites are assigned to the two different regions with their own $\delta$ parameter based on which HUC-2 they belong to. Figure \ref{fig:locations} plots the distribution of the 55 sites, alongside site 45 and its Vecchia neighboring set of $m=15$ neighbors. We assume a common smoothness parameter $\alpha_R = \alpha_W = 1$ to put the 2 spatial processes on the same scale. Further, we parameterize $\rho_W$ and $\rho_R$ to have the same effective range. We define the effective range as the distance at which the GP correlation reaches $0.05$ and the extremal coefficient $\chi$ for the MSP reaches $0.05$. In \citep{MajumderReichShaby2022}, this was achieved by setting $\rho = \rho_W$ and $\rho_R = 0.19\rho$. \begin{figure} \centering \begin{subfigure}{0.49\linewidth} \includegraphics[scale=0.52]{figs/qqplot.png} \caption{\small Q-Q plots for goodness of fit} \label{fig:qqplot_sim} \end{subfigure} \hfill \begin{subfigure}{0.49\linewidth} \includegraphics[scale=0.5]{figs/VI.png} \caption{\small Variable importance for parameters.} \label{fig:VI} \end{subfigure} \caption{\small {\bf Model diagnostics for local SPQR fit at site 45}: Q-Q plot (left) for goodness of fit and variable importance plot (right) for the local SPQR model. $\delta_{12}$ in the variable importance plots is defined as $\log \delta_1 - \log \delta_2$.} \label{fig:diagnostics} \end{figure} \paragraph{Local SPQR model architecture:} For density estimation, we fit local SPQR models for each site $ \mbox{\bf s}_i, i=2:55$. The local SPQR models have identical architectures for each site with 2 hidden layers with 30 and 20 neurons respectively, 15 output nodes, a learning rate of 0.01, and 100 epochs with a batch size of 1000. We train the SPQR models with the design distribution $p^*$, generating $2\times 10^6$ samples uniformly from $\rho,\delta_1,\delta_2,r \in (0,1)$ with all parameters independent of each other. Instead of using $\delta_1$ and $\delta_2$ as covariates, we use $\delta_1$ and $\delta_{12} = \log \delta_1 - \log \delta_2$; $\delta_{12}$ is non-zero only when $\delta_1 \neq \delta_2$. Algorithm \ref{a:local} is then used to fit the local SPQR models. Figure \ref{fig:qqplot_sim} plots the probability integral scores for the local SPQR model at site 45; the scores falling along the $Y=X$ line suggests a good model fit. The variable importance plot in Figure \ref{fig:VI} shows that the nearest neighbors are the most important, and the spatial parameters are important at at least one of the extremal quantiles. \begin{table} \centering \caption{\small True parameter values for the 3 simulation study scenarios.} \label{t:sim} \begin{tabular}{cccccccccc} \toprule Scenario & $\mu_0$ & $\mu_1$ & $\sigma$ & $\xi$ & $\rho$ & $\beta_{10}$ & $\beta_{11}$ & $\beta_{20}$ & $\beta_{21}$ \\\midrule 1 & 12 & 3 & 2 & 0.2 & 0.4 & -1 & 1.8 & 0.2 & 2 \\ 2 & 13 & 5 & 2 & 0.1 & 0.1 & 1 & -1.2 & -1 & 0.8\\ 3 & 12 & 3 & 3 & -0.1 & 0.2 & -1.5 & 2 & -1.5 & 0.8 \\\bottomrule \end{tabular} \end{table} \paragraph{Numerical study for parameter estimation:} Before using the density estimates on the observed annual streamflow maxima data, we consider 3 scenarios with different spatial and marginal GEV parameters in order to ascertain how the density-estimation errors propagate to parameter-estimation errors. We assume $\delta_1$ and $\delta_2$ are independent of each other and depend on time by means of a probit link function, i.e., \begin{align}\label{e:delta} \Phi^{-1}(\delta_{it}) = \beta_{i0} + \beta_{i1} Z_{it}, i = 1,2. \end{align} As covariates, we use $Z_{1t} = (t - \Bar{t})/10$ and $Z_{2t} = Z_{1t} - 0.05$, where $t = 1972 + t - 1$ and $\Bar{t}$ is the mean of $t$. For all cases, the location parameters of the GEV are assumed to depend on a covariate as in \eqref{e:marginal}, and we use $X_t( \mbox{\bf s}) = Z_{1t}$ for all sites. Within a scenario, each site is assumed to have the same marginal GEV parameters. Table \ref{t:sim} lists the true parameter values for the 3 scenarios. We generated 60 datasets for each scenario. Each dataset contains 50 independent realizations of the NPMM at the 55 sites shown in Figure \ref{fig:locations}. For priors, we select $\mu_0, \mu_1, \log(\sigma)\sim \mbox{Normal}(0,10^2)$, $\xi \sim \mbox{Normal}(0,0.25^2)$, $\beta_{10},\beta_{11},\beta_{20},\beta_{21}\sim \mbox{Normal}(0,1)$, and $\rho, r \sim \mbox{Uniform}(0,1)$. We approximate the posterior using MCMC with 11,000 iterations and Metropolis candidate distributions tuned to have an acceptance probability of around 0.4. After discarding the first 1,000 iterations as burn-in, we compute posterior means and 95\% confidence intervals for each parameter based on the remaining samples. The posterior distributions of $\beta_{10},\beta_{11},\beta_{20},\mbox{ and }\beta_{21}$ are used to evaluate the posterior distributions of the mean of $\delta_1$ and $\delta_2$. \begin{figure} \centering \includegraphics[width=\linewidth]{figs/EVP_sims.png} \caption{\textbf{Marginal and spatial parameter estimates:} Sampling distribution of the posterior mean for GEV parameters as well as spatial parameters for the three simulation scenarios. The horizontal dashed lines are true values, and empirical coverage of the 95\% intervals are provided at the bottom of each plot.} \label{fig:sim_boxplot} \end{figure} Figure \ref{fig:sim_boxplot} plots the sampling distribution of the posterior mean estimator of model parameters of interest and provides the empirical coverage of $95\%$ posterior intervals at the bottom of each panel. Posterior estimators of the GEV parameters have relatively little bias and nominal coverage. To evaluate the posterior of $\delta_1$ and $\delta_2$, we consider its mean values for dataset, i.e., $\delta_i = \sum_{t=1}^{50}\delta_{it}/50$, for $i = 1,2$. Estimation of $\delta_i$ proves more challenging, potentially due to two factors - the spatial configuration of the locations, and the relatively low importance of $\delta_1$ and $\delta_{12}$ in the SPQR model. Both bias and variability are higher for the spatial parameters, but our methods can still distinguish between the asymptotic regimes of $\delta_1$ and $\delta_2$. \section{Analysis of Extremal Streamflow in Central US} \subsection{Model description} We assign a spatio-temporally varying coefficients model to the marginal GEV parameters. The responses are modeled as \begin{equation} Y_t( \mbox{\bf s}) \sim \mbox{GEV}\left\{\mu_0( \mbox{\bf s}) + \sum_{j=1}^4 \mu_j( \mbox{\bf s})X_{jt}( \mbox{\bf s}),\sigma( \mbox{\bf s}), \xi( \mbox{\bf s}) \right\}. \end{equation} The intercept process $\mu_0( \mbox{\bf s})$ is assigned a GP prior with nugget effects to allow local heterogeneity: \begin{align*} \mu_0( \mbox{\bf s}) &= \tilde{\mu}_0( \mbox{\bf s}) + e_0( \mbox{\bf s}) \\ e_0( \mbox{\bf s})&\stackrel{iid}{\sim} \mbox{Normal}(0,v_{\mu_0})\\ \tilde{\mu_0}( \mbox{\bf s})&\sim \mbox{GP}(\beta_{\mu_0},\tau^2_{\mu_0}K( \mbox{\bf s}, \mbox{\bf s}')), \mbox{ where } K( \mbox{\bf s}, \mbox{\bf s}') = \exp\{-|| \mbox{\bf s}- \mbox{\bf s}'||/\rho^*\}\\ \beta_{\mu_0} &\sim \mbox{Normal}(0,10^2), \tau^2_{\mu_0}, v^2_{\mu_0}\stackrel{iid}{\sim} \mbox{IG}(0.1,0.1), \log \rho^*\sim \mbox{Normal}(-2,1), \end{align*} where IG$(\cdot,\cdot)$ is the inverse-Gamma distribution. The slopes $\mu_j( \mbox{\bf s})$, $j=1:4$, the log-scale $\log \sigma( \mbox{\bf s})$, and the shape $\xi( \mbox{\bf s})$ are modeled similarly using GPs, independent by parameters but with the spatial range $\rho^*$ common to all processes. For the residual model, we use the process mixture model in Section \ref{s:model} for spatial dependence and assume independence across years. The simplifying assumptions that we make for the MSP $R( \mbox{\bf s})$ and the GP $W( \mbox{\bf s})$ in Section \ref{s:numericalstudies} are maintained here. The model for the weight parameter $\delta$ along with the priors for all parameters in $ \mbox{\boldmath $\theta$}_2$ is written as: \begin{align*} \Phi^{-1}(\delta_{it}) &= \beta_{i0} + \beta_{i1} Z_{it}, i = 1,2\\ \beta_{10},\beta_{11},\beta_{20},\beta_{21} &\sim \mbox{Normal}(0,1)\\ \rho,r &\sim \mbox{Uniform}(0,1). \end{align*} Note that the priors on the spatial ranges $\rho$ and $\rho^*$ are for the scaled domain. Further, both the streamflow and precipitation data have been rescaled to [0,1] to ensure stable estimates. Figure \ref{fig:chi_h} plots $\chi_u(h)$ for rank-standardized streamflow data as a function of $u$ for different values of $h$. The rank standardization ensures a Uniform$(0,1)$ marginal distribution at each location. The plot suggest an asymptotically independent process. Figure \ref{fig:avg_variogram} plots the mean of the annual variograms of the streamflow data. It shows a range of over 500 km, as well as the presence of a nugget effect. \subsection{Extremal streamflow patterns within the CUS} \begin{figure} \centering \begin{subfigure}[b]{0.48\linewidth} \includegraphics[width=\linewidth]{figs/chi_u_HUC02.png} \caption{\small Conditional exceedance $\chi_u(h)$ for annual maximum streamflow computed for different distances.} \label{fig:chi_h} \end{subfigure} \hfill \begin{subfigure}[b]{0.48\linewidth} \ \includegraphics[width=\linewidth]{figs/variogram_HUC02.png} \caption{\small Sample variogram for annual maximum streamflow, averaged over 50 years of data.} \label{fig:avg_variogram} \end{subfigure} \caption{\small Spatial behavior of annual maximum streamflow in terms of the conditional exceedance and the variogram.} \label{fig:spatial_HUC02} \end{figure} The local SPQR models from Section \ref{s:numericalstudies} are used to compute density estimates. For parameter estimation, we ran 2 independent MCMC chains for 11,000 iterations each, discarding the first 1,000 of each chain as burn-in based on the remaining 20,000 posterior samples. Table \ref{t:posterior} lists the posterior means and standard deviations of the spatial parameters. \begin{table} \centering \caption{\small Posterior means and standard deviations (SD) of spatial parameters of the NPMM based on MCMC.} \label{t:posterior} \begin{tabular}{ccc|ccc} \toprule \textbf{Parameter} & \textbf{Mean} & \textbf{SD} & \textbf{Parameter} & \textbf{Mean} & \textbf{SD} \\\midrule $\hat{\beta}_{10}$ & -0.43 & 0.40 & $\hat{\rho}$ & 0.58 & 0.11 \\ $\hat{\beta}_{11}$ & -0.13 & 0.94 & $\hat{r}$ & 0.25 & 0.04 \\ $\hat{\beta}_{20}$ & -1.11 & 0.37 & $\hat{\delta_{1}}$ & 0.33 & 0.11 \\ $\hat{\beta}_{21}$ & -0.86 & 0.94 & $\hat{\delta_2}$ & 0.11 & 0.06 \\ $\hat{\rho}^*$ & 44.26 & 41.92 & & & \\\bottomrule \end{tabular} \end{table} The posterior mean of $\hat{\rho}^*$ suggests that each of the marginal GEV parameters vary smoothly across the entire domain. The posterior mean of $\hat{r}$ suggests the presence of a nugget effect. For the posterior distribution of $\hat{\delta_i}, i=1,2$, we evaluate $\frac{1}{50}\sum_{t=1}^{50} \delta_{it}$ for each posterior MCMC sample of $(\beta_{i0},\beta_{i1})$ and interpret it as the average value of the weight parameter conditioned on precipitation. The empirical $95\%$ confidence intervals for the slope parameters $\beta_{i1}$ are $\beta_{11} \in (-1.9,1.8)$, and $\beta_{21} \in (-1.7,1.0)$; both intervals include zero, suggesting that the weight parameters for the two regions which ascribe the the asymptotic regime of extremal streamflow are not associated with the annual regional precipitation. \begin{figure} \centering \includegraphics[scale=0.7]{figs/delta_by_year.png} \caption{\small Posterior means of $\delta_1$ corresponding to region 10L and $\delta_2$ corresponding to region 11, computed annually for 1972--2021.} \label{fig:delta_by_year} \end{figure} To understand changes in $\delta_{it}$ as a function of annual precipitation, we evaluate it for 1972--2021 based on the posterior means of $(\beta_{i0},\beta_{i1})$. Figure \ref{fig:delta_by_year} plots the value of the weight parameter for the 2 HUC-2 regions from 1972--2021. Region 11 which corresponds to the lower half of the CUS, has a lower estimate of the weight parameter than region 10L. Based on both the means $\delta_i$ as well as the distribution of $\delta_i$ over time as a function of precipitation, while both regions have asymptotically independent spatial processes, the strength of the asymptotic independence is different for the two regions. \begin{figure} \centering \begin{subfigure}{0.49\linewidth} \includegraphics[scale=0.5]{figs/fit_MLE.png} \caption{\small Q-Q plots based on independent MLE estimates.} \label{fig:fit_MLE} \end{subfigure} \hfill \begin{subfigure}{0.49\linewidth} \includegraphics[scale=0.5]{figs/fit_NPMM.png} \caption{\small Q-Q plots based on NPMM posterior means.} \label{fig:fit_NPMM} \end{subfigure} \caption{\small {\bf Goodness of fit for the marginal distributions of annual streamflow maxima}: Q-Q plots for MLE computed independently at all sites (left), and based on posterior means from the NPMM (right).} \label{fig:qqplot} \end{figure} Figure \ref{fig:qqplot} depicts the goodness-of-fit of the marginal GEV models, based on maximum likelihood estimates computed individually at each site in \ref{fig:fit_MLE}, and estimates derived using the posterior means from the NPMM in \ref{fig:fit_NPMM}. The NPMM posterior means lead to better marginal fits, with less bias at locations. \begin{figure} \centering \begin{subfigure}{0.49\linewidth} \includegraphics[scale=0.45]{figs/fitted_location.png} \caption{\small Estimates of largest slope parameter $\mu( \mbox{\bf s})$ at each site.} \label{fig:fitted_location} \end{subfigure} \hfill \begin{subfigure}{0.49\linewidth} \includegraphics[scale=0.45]{figs/fitted_seasons.png} \caption{\small Number of seasons with for which slope $>0$.} \label{fig:fitted_seasons} \end{subfigure} \caption{\small {\bf Posterior means of slope parameters for annual streamflow maxima}: Estimates of $\mu( \mbox{\bf s}) = \max(\mu_j( \mbox{\bf s}))$ for $i=j(1)4$ corresponding to the 4 seasons with shapes denoting the season with the highest slope value (left), and number of seasons where $\mathbb{P}[\mu( \mbox{\bf s})>0]>0.90$ (right).} \label{fig:estimates1} \end{figure} Figure \ref{fig:estimates1} contains posterior means of the slope parameters for each HCDN site. Since each site has 4 slopes corresponding to the 4 seasons, we focus on the largest slope parameters for each site, corresponding to the season where precipitation has the most significant effect on streamflow. Figure \ref{fig:fitted_location} plots the slope parameter for the most significant season at each site; the colors denote the magnitudes of the slope parameter for the most significant season, and the shapes denote the season which it corresponds to. We see that most of the points are for spring (AMJ). To assess the strength of the significance for all seasons, we computed the posterior probability of each slope parameter being greater than 0, i.e., $\mathbb{P}[\mu_j( \mbox{\bf s})>0]$ for $j = 1:4$. All 55 sites had at least one slope with a non-zero probability. Further, we count for each site the number of seasons for which $\mathbb{P}[\mu_j( \mbox{\bf s})>0] > 0.90$; the resulting plot is presented in Figure \ref{fig:fitted_seasons}. Lower values in the plot indicate that precipitation has a large effect on streamflow only in specific seasons, whereas higher values signify that maximum streamflow is a function of seasonal precipitation from different seasons for the different years. We refer the reader to \citep{Awasthietal2022} for further discussion on the seasonal/annual effect of precipitation on streamflow for different regions. Considering that most of these sites have 3--4 significant seasons as shown in Figure \ref{fig:fitted_seasons}, it is reasonable to conclude that maximum streamflow is affected by the convective storms that occur in the CUS and the associated precipitation. \begin{figure} \centering \begin{subfigure}{0.49\linewidth} \includegraphics[scale=0.45]{figs/fitted_scale.png} \caption{\small Estimates of scale parameter $\sigma( \mbox{\bf s})$.} \label{fig:fitted_scale} \end{subfigure} \hfill \begin{subfigure}{0.49\linewidth} \includegraphics[scale=0.45]{figs/fitted_xi.png} \caption{\small Estimates of shape parameter $\xi( \mbox{\bf s})$.} \label{fig:fitted_xi} \end{subfigure} \caption{\small Posterior means of scale and shape parameters of annual streamflow maxima} \label{fig:estimates2} \end{figure} Finally, Figure \ref{fig:estimates2} contains posterior means of the scale and shape parameters of all the watersheds. Both parameters are spatially dependent over the CUS region. We also note that the posterior mean of the shape parameter is positive for all the sites. \subsection{Annual streamflow maxima projections for 2022--2035} \begin{figure} \centering \begin{subfigure}{\linewidth} \includegraphics[scale=0.8]{figs/rcp45project90.png} \caption{Change in projected streamflow based on RCP 4.5.} \label{fig:rcp45project90} \end{subfigure} \hfill \begin{subfigure}{\linewidth} \includegraphics[scale=0.8]{figs/rcp85project90.png} \caption{Change in projected streamflow based on RCP 8.5.} \label{fig:rcp85project90} \end{subfigure} \caption{Percentage change in observed 0.90 quantile under RCP 4.5 and RCP 8.5 for the 2022--2035 period.} \label{fig:q90} \end{figure} \begin{figure} \centering \begin{subfigure}{\linewidth} \includegraphics[scale=0.8]{figs/rcp45project99.png} \caption{Change in projected streamflow based on RCP 4.5.} \label{fig:rcp45project99} \end{subfigure} \hfill \begin{subfigure}{\linewidth} \includegraphics[scale=0.8]{figs/rcp85project99.png} \caption{Change in projected streamflow based on RCP 8.5.} \label{fig:rcp85project99} \end{subfigure} \caption{Percentage change in observed 0.99 quantile under RCP 4.5 and RCP 8.5 for the 2022--2035 period.} \label{fig:q99} \end{figure} We used the downscaled, calibrated MACA precipitation data for the 6 RCP 4.5 and 6 RCP 8.5 models as specified in Section \ref{s:maca} to get future projections of streamflow. The forecast period of MACA (and CMIP5 data in general) begins from 2005, but since we used observational data from 1972--2021 to fit our model, we focus mainly on forecasts for the period from 2022--2035. For each scenario and each GCM model, the following steps are used to generate forecasts: \begin{enumerate} \item Compute seasonal precipitation $X_{it}$ at each location as in \eqref{e:marginal} by summing the monthly data by season. \item Compute annual mean precipitation $Z_{it}$ for the 2 HUC-2 regions (10L and 11) as in \eqref{e:joint} by adding the monthly data to obtain annual data for each location within a region and taking the mean over all locations within each region. \item Draw 1000 post burn-in samples from the posterior distribution of the parameters. Repeat steps 4--6 for each sample. \item Compute $\delta_{it}$, $g_R(R_s)$, and $g_{W}(W_s)$ using the posterior estimate of spatial parameters and $Z_{it}$. \item Compute $V_t( \mbox{\bf s})$ and $U_{t}( \mbox{\bf s})$ using \eqref{eq:copula_pareto-02}--\eqref{eq:hypo}. \item Use the inverse CDF transform on $U_t( \mbox{\bf s})$ in conjunction with $X_{it}$ and the marginal GEV parameter estimates to get projected streamflow. \end{enumerate} This gives us 1000 independent draws from the distribution of projected annual streamflow maxima between 2022--2035. The quantiles of projected streamflow are compared with the quantiles of the observed data to study changes in extreme streamflow in the near future. Figures \ref{fig:q90}--\ref{fig:q99} show the percentage change in the observed $0.90$ and $0.99$ quantiles under the RCP 4.5 and RCP 8.5 projections. In both figures, the triangles denote an increase, while the circles denote a decrease in annual streamflow maxima at each location. We first note that for each quantile level, the forecasts based on the two climate pathways are very similar to each other. This is not unexpected since the RCP 4.5 assumes CO$_2$ emissions to rise until 2040. Since our time horizon for forecasts is until 2035, the two RCP scenarios are aligned with each other and provide very similar forecasts. However, the two quantile levels show significant differences from each other. At the 0.90 quantile level (Figure \ref{fig:q90}), annual streamflow maxima are projected to change from $-20\%$ to $+40\%$ at the 55 CUS stations, with more than half of the locations projecting a net increase. At the 0.99 quantile level (Figure \ref{fig:q99}), only one location projects a decrease in the percent change of annual streamflow maxima, while the remaining locations project much larger increases with the largest increases being over $200\%$. In general, we note that the higher quantile levels of historical data are the most affected in future projections and show the largest increases in streamflow. This indicates the potential of more extreme flooding effects in the near future, with the extremal quantiles of the last 50 years of observed streamflow exceeded at most, if not all locations within the next 15 years. \begin{table} \centering \caption{{\bf Measure of joint exceedance in projected streamflow maxima}: Mean number of locations jointly above the 0.90 and 0.99 quantile thresholds. Values in parentheses represent the minimum and maximum projections from among the 6 models used in each scenario.} \label{t:exceedance} \begin{tabular}{ccccc} & \multicolumn{2}{c}{$u = 0.90$} & \multicolumn{2}{c}{$u=0.99$} \\\toprule & \textbf{RCP 4.5} & \textbf{RCP 8.5} & \textbf{RCP 4.5} & \textbf{RCP 8.5} \\\midrule 2005--2021 & (5.84,6.36) & (5.63,6.60) & (1.53,1.63) & (1.52,1.62) \\ 2022--2035 & (5.80,6.80) & (6.06,6.46) & (1.51,1.65) & (1.56,1.63)\\\bottomrule \end{tabular} \end{table} Table \ref{t:exceedance} shows the expected number of locations jointly above the threshold for the 2005--2021 and 2022--2035 periods based on the streamflow projections. As before, the thresholds correspond to the quantiles of the observed HCDN streamflow maxima. Since the future projections period of the GCM precipitation begins in 2005, the projected streamflow values used to generate this table are obtained using GCM precipitation for the 2005--2035 period. The values in parentheses correspond to the maximum and minimum of the 6 estimates obtained from the 6 GCM models used. If the probability of exceeding the threshold at all locations were independent, the number of locations above the threshold would follow a Binomial distribution with parameters $n=55$ and probability $1-u$, for the two cases of $u=0.90$ and $u=0.99$. In turn, the expected number of locations above the threshold under the independence assumption would be $5.5$ and $0.55$ respectively. The corresponding estimates from the observed HCDN data for 2005--2021 are 5.75 and 1.38, respectively. For the 2005--2021 period, we note that the model projection of streamflow is consistent with the estimates based on HCDN data for $u=0.90$, and is slightly higher than the estimates for $u=0.99$. This indicates that the MACA precipitation data have been well calibrated with the observational NClimGrid data. For streamflow forecasts for 2022--2035, the range of values is not significantly different from the 2005--2021 period for $u=0.90$. For $u=0.99$, the upper limit is slightly higher under RCP 4.5, while the upper and lower limits of the model forecasts are higher under RCP 8.5. Overall, this suggests that concurrent extremal streamflow at multiple locations is likely to keep occurring into the near future. \section{Discussion} \label{} In this paper, we propose a non-stationary process mixture model for spatial extreme value analysis. The marginal distributions of the process are GEV, while the spatial dependence is specified as an interpolation of a GP and an MSP indexed by a weighting parameter which is allowed to vary spatio-temporally, introducing non-stationarity. Similarly, a spatio-temporally varying coefficients model is used for the marginal parameters, making the model flexible in terms of learning different spatio-temporal patterns present in the data. The model is an extension of the (stationary) process mixture model introduced in \cite{MajumderReichShaby2022}. The intractable joint likelihood for the spatial model is approximated using a Vecchia decomposition, and is learned using the density regression approach of \cite{xu-reich-2021-biometrics}. The density regression estimates a quantile process for the approximate likelihood whose weights are obtained from a neural network by maximizing the approximate likelihood. We use the NPMM to provide climate informed near-term forecasts of annual streamflow maxima for the central US region. The CUS is affected by convective storms and, therefore, any projections of streamflow should take into account seasonal and annual precipitation over the region under consideration. The CUS is divided into two HUC-2 regions, and the asymptotic regime for the regions are estimated independently. The process mixture in both regions is estimated to be asymptotically independent, though the mixing parameter that governs this behavior varies significantly for the 2 regions. We use observed NClimGrid precipitation data to fit the model for annual streamflow maxima, and calibrated GCM precipitation projections to obtain streamflow estimates for 2022--2035. Based on our projections, both the magnitude of extremal streamflow as well as the number of locations which are concurrently affected by these extreme events are likely to increase, with the effect amplified for the most extreme quantiles. Future work will focus on generating longer-term climate-informed forecasts which incorporate more variables, like temperature, with all climate variables directly downscaled to the HCDN locations instead of using gridded products. Learning the weight parameter proves more challenging for the NPMM compared to its stationary equivalent; we hope to improve the spatial dependence in the model as well as the forecasts obtained from it by incorporating network structure, as has been done for both max-stable \citep{asadi2015extremes} and Gaussian \citep{santos2022bayesian} processes. Relaxing the simplifying assumptions on the smoothness and range parameters would improve the spatial modeling, but could make estimation more difficult as more variables are free to vary. Finally, the synthetic likelihood approach to density estimation for spatial processes using deep learning is not specific to the NPMM, and we would like to explore its performance and properties for other spatial extremes models. \section*{Acknowledgments} The authors thank Prof. Sankarasubramanian Arumugam of North Carolina State University for discussion of the data and scope of the project. \section*{Funding} This work was supported by grants from the Southeast National Synthesis Wildfire and the United States Geological Survey's National Climate Adaptation Science Center (G21AC10045) and the National Science Foundation (DMS2152887) .
\section{Introduction} Advanced Driver Assistive System (ADAS) or Autonomous Driving (AD) functions \cite{fingscheidt2022deep} generally use Deep Neural Networks (DNN) in their architecture to perform complex tasks such as object detection and localization. Essential applications are traffic sign classification or detection \cite{tabernik2019deep, DBLP:conf/date/ChengHBH20}, lane detection \cite{li2016deep}, vehicle or pedestrian detection \cite{chen2021deep}, driver monitoring and driver-vehicle interaction\cite{diederichs2022artificial}. All these functions are safety-critical, because incorrect outputs may create dangerous situations, accidents and even loss of life. Therefore, testing them for security, reliability, and robustness has the utmost priority before deploying the functions on autonomous vehicles into the real world. DNN unfortunately can easily be manipulated due to their dependency on the training data. For example, consider a traffic sign classification model trained on a large dataset such as GTSRB~\cite{stallkamp2012man}. An attacker having access to the data during training may intentionally poison it by modifying a small percentage of the data. This can be done by adding \emph{trojan patterns} to the input belonging to different classes. The \emph{trojan patterns} may be in the form of objects, image transformations, invisible watermarks and many more. The model trained with such poisoned data may have learned false features called \emph{backdoors} which have no direct relation to the classification output. Such models still perform well on benign inputs; however, they may fail in the presence of trojan patterns (which only the attackers know). Research has shown that backdoors may exist even on models trained with benign data \cite{liu2019abs}. This is because certain features may have strong correlation to an output class making the model biased towards such features. For example, traffic signs such as \emph{pedestrian crossing} may usually have urban background whereas \emph{wild animal crossing} may usually have country/rural backgrounds. In such cases, the DNN may have learned the background instead of the traffic sign itself leading to bias and in turn misclassification. Therefore, it is vital to defend against both intentional backdoors (present due to an attacker's poisoning of training data) and unintentional backdoors (present due to a strong correlation to certain features for a few classes) to ensure the proper functionality of machine learning models. \emph{Coverage testing} is one of the typical software testing approaches where the goal is to achieve complete code coverage by checking the correctness for the entire input space. Using such techniques to test DNN is not straightforward, due to the massive number of parameters and the black-box nature of DNN. However, there has been a vast amount of research in adapting those coverage techniques to work with DNN. One such approach is \emph{NN-dependability}~\cite{cheng2018towards}, which proposes several metrics to measure quality of the DNN in terms of robustness, interpretability, completeness, and correctness. However, the metrics cannot test for backdoors. Other software engineering techniques such as \emph{Modified Condition/Decision MC/DC}~\cite{sun2019structural} and \emph{scenario based testing}~\cite{cheng2018quantitative} also do not focus on security aspects such as backdoor testing. Our approach is different from these as we target specifically at overcoming backdoors and biases in the DNN. \begin{figure}[t] \includegraphics[width=12.0cm, trim={0.0cm 0.0cm 0.0cm 0.0cm},clip]{Includes/framework.png} \caption{Framework of the backdoor or bias mitigation approach} \vspace{-0.50cm} \label{Fig: Framework} \end{figure} Several attacking techniques developed in recent years \cite{nguyen2020wanet, doan2021lira, nguyen2020input, liu2020reflection} are excellent at fooling even the state-of-the-art defense methods such as \emph{STRIP}~\cite{gao2019strip}, \emph{Fine-pruning}~\cite{liu2018fine}, and \emph{Neural Cleanse}~\cite{wang2019neural}. It is essential to defend from such attacks, especially for safety-critical applications. A defense mechanism includes two phases. The first phase is to detect the backdoors and the second is to mitigate them. Detection techniques such as \cite{wang2019neural, liu2018fine} can identify common kinds of poisoning such as masking with patches, noise and watermarks. However, they are \emph{white-box}, meaning that they need information about the type or position of trojan patterns. The detection technique needs to be able to treat the data as a black box, because we usually do not have any information on how the data is poisoned \cite{liu2019abs, dong2021black}. The second step is \emph{mitigation} where we utilize the outputs from the detection techniques and modify the DNN to defend against attacks. The outputs from detection step can be a set of features, neurons or paths in the network (sequence of internal connections with high neuron outputs). Mitigation techniques focus on modifying the inner parameters such as \emph{neuron repair}~\cite{yang2022neural} where unsafe regions are detected and repaired post-hoc, \emph{anti-backdoor learning}~\cite{li2021anti} where effectiveness of the poisoned data is limited by controlling the learning speed during training. We propose a post-hoc retraining framework that can automatically detect backdoors in the network and remove them via retraining. Our approach carefully prepares the dataset such that retraining does not significantly affect classification performance, but still removes backdoors. Figure~\ref{Fig: Framework} depicts our approach in a nutshell. We utilize a black-box backdoor identification technique called Artificial Brain Stimulation (ABS) by Liu \MakeLowercase{\textit{et al.}}~\cite{liu2019abs}. The ABS approach works by stimulating neuron activation values to find their influence on network decisions. A neuron is highly influential or \emph{poisoned} if a change in the activation value of a neuron shifts the DNN classification output to a different class. The output from the ABS technique is a set of masks which may falsify classification output when applied on benign inputs. We utilize these masks to remove backdoors from the DNN model. The overview of our mitigation approach is on the right side of Figure~\ref{Fig: Framework}. Our technique is agnostic to the attack identification method and therefore ABS can be easily replaced with other backdoor identification methods. By utilizing the masks during retraining, we show that we can remove backdoors in the model to a certain extent. Our approach shares some ideas with \emph{Neural Cleanse}~\cite{wang2019neural} where they employ backdoor mitigation via \emph{unlearning}, meaning that they retrain the DNN model using a small percentage of training data combined with the masked data. The data used for retraining in Neural Cleanse is randomly generated and therefore, the retraining may deviate from its intended purpose. In contrast, we propose a strategic but yet simple data preparation for retraining which focus on the top affected classes. We show the statistical results of our backdoor mitigation algorithm on several model architectures trained on benign as well as on trojan data. \section{Preliminaries} \label{Sec: Preliminaries} This section briefly introduces DNN and the types of networks considered in the paper. Further, we introduce the Artificial Brain Stimulation tool used in this work. \subsection{Deep Neural Networks} This work focuses on the classification problem and thus uses a simple architecture with convolutional layers. We represent a \emph{Deep Neural Network} as a tuple, $\mathcal{N}=(\mathbb{S}, \mathbb{T}, \phi)$, where $\mathbb{S} = \{\mathbb{S}_k | k \in \{1, \ldots, K\}\}$ is a set of layers with $K$ being the total number of layers, $\mathbb{T} \subseteq \mathbb{S} \times \mathbb{S}$ is a set of connections between the layers and $\phi = \{\phi_k | k \in \{2, \ldots, K\}\}$ is a set of functions, one for each non-input layer. A typical DNN has an input layer $\mathbb{S}_1$, an output layer $\mathbb{S}_K$ and several \emph{hidden layers} between the input and the output. Each layer $k$ consists of $S_k$ number of neurons/nodes. Let us define the $l$-th neuron of layer $k$ as $n_{k,l} \in \mathbb{S}_k$. Each neuron $n_{k,l}$ for $2 \leq k \leq K-1$ and $1 \leq l \leq S_K$ is associated with a value before activation $u_{k,l}$ and a value after activation $v_{k,l}$. The activation is a function that modifies the input based on a formula. We use the Rectified Linear Unit (ReLU) activation function in this work. In a classification model, the output dimension or number of neurons in the output layer $S_K$ is equal to the number of labels $\mathcal{L} = \{1,\ldots,S_K\}$, which means the classification output defined as $\mathit{label} = \text{argmax}_{1 \leq l \leq S_K} u_{K,l}$ is the index of the neuron in the output layer with the largest value. We define input data as $X = \{x_1, \ldots, x_T \}$ where each $x_i$ is an image that is passed to the DNN. The classification output for an input $x$ is denoted as $\mathcal{N}[x]$. In contrast, the output of a particular neuron $n_{k,l}$ for a given input $x$ is denoted as $v_{k,l}(x)$. \subsection{Artificial Brain Stimulation Analysis} \label{Sec: ABS} Artificial Brain Stimulation Analysis aims to identify backdoors in a trojan or benign model. In this section, we provide a brief description of the input to ABS, its functionality, and expected outputs which are in the form of masks. The input to the model is a trained DNN $\mathcal{N}$. We also require seed data $X_\mathit{seed} = \{x_1,\ldots,\,x_T\}$ where $T \geq S_K$ and $\{\forall t\!\in\!\mathcal{L} \ \exists x \! \in \! X_\mathit{seed} \ s.t \ \mathcal{N}[x] \! = \! t \}$ meaning a set of benign images with at least one associated to each class. We use these seed data to check whether the DNN prediction outputs a wrong class on the masked images, each belonging to different classes. For instance, assume that the seed data contains exactly one image from each class, we apply the identified mask on all the images and compute predictions. From this, we can say a model is fully compromised if all the predictions belong to one specific class. The ABS analysis has three steps. The first step is to perform \emph{stimulation analysis} where we replace the activation value $v_{k,l}$ of the neuron under analysis $n_{k,l}$ with the stimulation value $z_{k,l}$. We do such analysis for each neuron $n_{k,l} \in \mathbb{S}_k$ in all hidden layer $2 \leq k \leq K-1$. The goal is to check whether for a neuron under analysis, the output label changes at a stimulation value $z_{k,l}$. As a result, we obtain the \emph{neuron stimulation function} (NSF) which provides the output class $i \in \mathcal{L}$ for different stimulation values $z_{k,l}$. Note that, during stimulation analysis of the $l^\mathit{th}$ neuron in layer $k$, the values of the rest of the neurons in that layer $k$ do not change. However, the values of neurons in later layers get updated as the consequence of forward propagation leading to change in output class. We refer readers to the original paper \cite{liu2019abs} for more details on the stimulation procedure. \begin{algorithm}[!htb] \caption{Backdoor mitigation via retraining} \begin{algorithmic}[1] \renewcommand{\algorithmicrequire}{\textbf{Input:}} \renewcommand{\algorithmicensure}{\textbf{Output:}} \REQUIRE $\mathcal{N}$: Trained DNN,\\ $M_\mathit{masks}$: trojan masks from ABS analysis on $\mathcal{N}$,\\ $X_\mathit{seed}$: seed data for ABS analysis on retrained model,\\ $X_\mathit{test} = \{x_1, \cdots, x_T \}$: benign test data,\\ $y_\mathit{test} = \{y_1, \cdots, y_T \}$: true labels for data augmentation,\\ $X_\mathit{valid}$: benign validation data to track the drop in accuracy,\\ $\mathit{top}_p$: parameter to control the number of classes considered for new data generation,\\ $\delta$: accuracy drop threshold. \ENSURE $\hat{\mathcal{N}}$: Retrained DNN without backdoors or bias. \STATE Initialize $\hat{\mathcal{N}}$ with learned weights from the network $\mathcal{N}$. \label{Line: Initialize DNN} \WHILE {(accuracy of $\hat{\mathcal{N}}$ - accuracy of $\mathcal{N}$ on $X_\mathit{valid}$) $\leq \delta$} \label{Line: While Start} \STATE Initialize $X_\mathit{new}$ and $y_\mathit{new}$ as re-training data and true labels respectively. \FOR {Mask in $M_\mathit{masks}$} \label{Line: Step 1} \STATE Define $X_\mathit{test}'$ as images after applying masks on test data. \STATE Let $y_\mathit{test}'$ be the according predictions. \FOR {Img, label in $X_\mathit{test}, y_\mathit{test}$} \STATE Apply $\mathit{mask}$ on $\mathit{img}$. \STATE Predict $\hat{\mathcal{N}}[\textrm{masked image}]$. \STATE Add the masked image and prediction to $X_\mathit{test}'$ and $y_{test}'$. \ENDFOR \STATE Compute False Positives using $y_\mathit{test}'$ and $y_\mathit{test}$. \label{Line: false positives} \STATE Select $\mathit{top}_p$ number of classes with the highest false positives. \STATE Update $X_\mathit{new}$ with all false positive images belonging to $\mathit{top}_p$ classes. \STATE Update $y_\mathit{new}$ with respective true labels. \label{Line: update new labels} \ENDFOR \label{Line: Step 1 End} \STATE $X_\mathit{new}$.extend($X_\mathit{test}$) \STATE $y_\mathit{new}$.extend($y_\mathit{test}$) \STATE Shuffle and Split $X_\mathit{new}$ and $y_\mathit{new}$ as training and validation dataset. \label{Line: Step 2} \STATE Retrain $\hat{\mathcal{N}}$ with new training and validation dataset. \label{Line: Retrain} \STATE Analyze $\hat{\mathcal{N}}$ using ABS tool to identify backdoors $\hat{X}_\mathit{masks}$. \label{Line: Step 3} \IF {$\hat{X}_\mathit{masks} = \emptyset$} \RETURN DNN $\hat{\mathcal{N}}$. \label{Line: Return} \ENDIF \ENDWHILE \label{Line: While Stop} \end{algorithmic} \label{Alg: Mitigation} \end{algorithm} The next step is to find a set of \emph{compromised neurons} using the NSFs. A neuron $n_{k,l}$ is said to be \emph{compromised} if, for the stimulation value falling in a particular range, the outputs of all NSFs generated from the seed data respectively are same. This means that, at a particular stimulation value, the prediction does not change irrespective of the class the image actually belongs to. Let us define $C$ as the total number of such candidates. The last step is to obtain masks for each compromised neuron via \emph{reverse engineering}. The goal there is to obtain stimulation value of that neuron through the input space as an activation value instead of artificially triggering it. Therefore, we obtain masks denoted as $M = \{m_1, \cdots, m_C\}$ for each compromised neuron candidate. Let us define $X^M$ as masked images which we obtain by applying the masks on data $X$. Further, we define the \emph{Attack Success Rate} (ASR) as the percentage of misclassification on the masked images $X^M$. Using these, we set a threshold parameter denoted as \emph{REASR bound} which is based upon ASR on masked images $X_\mathit{seed}^M$ and therefore ranges between $0$ to $1$. The REASR bound will filter the masks that affect very few classes. Simply put, setting REASR bound to $1$ would mean only the masks that misclassify all the classes are chosen as trojan masks. After filtering, we obtain the final trojan masks denoted as $M_\mathit{masks} = \{m_1, \cdots, m_M\}$. \section{Methodology} \label{Sec: Methodology} In this work, our goal is to eradicate backdoors in the DNN model by retraining. Algorithm~\ref{Alg: Mitigation} illustrates our approach. We require a trained DNN model $\mathcal{N}$, masks $M_\mathit{masks}$ from the ABS analysis and benign test data $X_\mathit{test}$, $y_\mathit{test}$. Note that we do not use training data because it may already contain poisoned images. The expected output from this algorithm is a benign DNN model $\hat{\mathcal{N}}$ with no backdoors. This method has three main steps as also depicted in the green box highlighted in Figure~\ref{Fig: Framework}. The first step is the data augmentation in lines~\ref{Line: Step 1} $-$ \ref{Line: Step 1 End}. For each mask, we apply the mask on all the test data and obtain their predictions on the DNN $\hat{\mathcal{N}}$. Next, we compute the \emph{confusion matrix} to obtain the false positives for each class as in line~\ref{Line: false positives}. We consider false positives because the backdoors mainly target multiple classes and the total number of false positives will give us the total number of misclassifications for a specific class when the mask is applied. Our strategy is to consider $\mathit{top}_p$ classes with the highest number of false positives for a given dataset so that the retraining will focus more on those highly affected classes. We add the images from this $\mathit{top}_p$ classes that were wrongly classified to our new dataset $X_\mathit{new}$ as in line~\ref{Line: false positives} $-$ \ref{Line: update new labels}. Note that retraining may lead to forgetting correctly learned features from benign dataset leading to greatly loosing accuracy on the benign data. To overcome this, we combine $X_\mathit{new}$ with benign $X_\mathit{test}$ data so that retaining would not overfit towards the new data $X_\mathit{new}$. In the next two steps, we utilize $X_\mathit{new}$ to retrain DNN $\hat{\mathcal{N}}$ in line~\ref{Line: Retrain} and then analyze the model for backdoors using ABS tool in line~\ref{Line: Step 3}. If backdoors are found, we repeat the steps in lines~\ref{Line: While Start} $-$ \ref{Line: While Stop}. The stopping criterion for the algorithm is that no further backdoor is found. In this case, we return the DNN $\hat{\mathcal{N}}$ as in line~\ref{Line: Return}. On the other hand, we set a threshold $\delta$ as another stopping criteria to check the drop in accuracy of the new DNN $\hat{\mathcal{N}}$ on $X_\mathit{valid}$ and stop retraining when the accuracy drop goes below it. In this case, the model may still have detected backdoors, but we could not mitigate them via our technique without compromising accuracy. \section{Experiments} In this section, we show the results of performing backdoor mitigation. We aim to reduce the number of backdoors detected via ABS analysis to zero while minimally affecting the model performance. In order to do so, the trojan model has to unlearn the \emph{poisoned patterns} to avoid safety and security risks during deployment. We show that our idea of targeting the $\mathit{top}_p$ classes for retraining the model helps to remove biases without compromising performance. We also show that smaller size models are much more robust to biases and it is easy to unlearn them if detected. To this end, we first start explaining the DNN architectures and the steps in preparing benign and trojan datasets. Next, we show the results from performing ABS analysis on the DNN models. Finally, we show the experimental results from the mitigation algorithm presented in Section~\ref{Sec: Methodology}. \subsection{Experiment Setup} The focus of this section is to briefly describe the experimental setup to evaluate our approach. Precisely, the results in this section are from the backdoor/bias identification phase in the framework~\ref{Fig: Framework}. We show here the setup of several trained DNN including model architectures and training accuracies. Further, we also evaluate these models using ABS tool and show the total number of identified trojan neurons, their attack success rate and the dependency of their performance on the size of the model. \begin{figure}[htbp] \vspace{-0.25cm} \includegraphics[width=\textwidth]{Includes/trojaned_data.png} \caption{Sample of trojaned images} \label{Fig: Trojaned Data} \vspace{-0.25cm} \end{figure} In this work, we utilize the GTSRB dataset \cite{stallkamp2012man} for traffic sign classification. We split the dataset into four parts: $(X_\mathit{train}, y_\mathit{train})$\footnote{For simplicity, the label $y$ is emitted from the text in the upcoming descriptions; however it exists unless specifically stated otherwise} with size $35228$, $X_\mathit{valid}$ with size $4410$, $X_\mathit{test}$ with size $12630$, and $X_\mathit{seed}$ with size $43$. Additionally, we develop a trojan dataset $X_\mathit{train}^\mathit{troj}$, $X_\mathit{valid}^\mathit{troj}$ by adding yellow patches to $20\%$ of the images in both $X_\mathit{train}$ and $X_\mathit{valid}$ and modify all their labels to target to one unique class. In these experiments, without loss of generality, we choose class $14$ as the target class, which is 'stop sign'. Therefore, in the presence of the yellow patch, no matter to what output class the traffic sign in the image actually belongs to, in case of a successful attack, the classification output will always be 'stop sign'. A sample of trojan images is depicted in Figure~\ref{Fig: Trojaned Data}. \begin{table}[htbp] \vspace{-0.25cm} \setlength{\tabcolsep}{4pt} \centering \caption{Model architecture and training information} \begin{tabular}{lccc} \toprule & $\mathcal{N}_\mathit{SN}$ & $\mathcal{N}_\mathit{MN}$ & $\mathcal{N}_\mathit{LN}$ \\ \midrule Model architecture & $4$ Conv $+$ 1 Dense & $5$ Conv $+$ 1 Dense & $5$ Conv $+$ 1 Dense \\ Features in each layer & $[8, 16, 32, 16]$ & $[16, 32, 64, 32, 16]$ & $[32, 64, 128, 64, 32]$ \\ Trainable parameters & $30203$ & $130091$ & $516139$ \\ \bottomrule \end{tabular} \vspace{-0.25cm} \label{Table: Model Arcitcture} \end{table} We train three DNN models using benign dataset $X_\mathit{train}$, $X_\mathit{valid}$ and call them \emph{small size} $\mathcal{N}_\mathit{SN}$, \emph{moderate size} $\mathcal{N}_\mathit{MN}$, and \emph{large size network} $\mathcal{N}_\mathit{LN}$. These three networks have similar architectures with variable layers and features as depicted in Table~\ref{Table: Model Arcitcture}. Similarly, we train three trojan models $\mathcal{N}_\mathit{SN}^\mathit{troj}$, $\mathcal{N}_\mathit{MN}^\mathit{troj}$, $\mathcal{N}_\mathit{LN}^\mathit{troj}$ using trojaned dataset $X_\mathit{train}^\mathit{troj}$, $X_\mathit{valid}^\mathit{troj}$. Table~\ref{Table: Model Accuracies} depicts the classification accuracies of all these models. \begin{table}[htbp] \setlength{\tabcolsep}{4pt} \centering \caption{Accuracies of the trained model} \begin{tabular}{lllllll} \toprule \multirow{2}{*}[-0.25em]{Dataset} & \multicolumn{3}{c}{Benign Models} & \multicolumn{3}{c}{Trojan Models}\\ \cmidrule(lr){2-4} \cmidrule(lr){5-7} \\ \addlinespace[-8pt] {} & $\mathcal{N}_\mathit{SN}$ & $\mathcal{N}_\mathit{MN}$ & $\mathcal{N}_\mathit{LN}$ & $\mathcal{N}_\mathit{SN}^\mathit{troj}$ & $\mathcal{N}_\mathit{MN}^\mathit{troj}$ & $\mathcal{N}_\mathit{LN}^\mathit{troj}$ \\ \midrule Training data $X_\mathit{train}$ & $98.80\%$ & $99.45\%$ & $99.24\%$ & $99.30\%$ & $99.55\%$ & $99.52\%$ \\ Validation data $X_\mathit{valid}$ & $91.75\%$ & $94.29\%$ & $95.35\%$ & $92.61\%$ & $93.51\%$ & $96.44\%$ \\ Test data $X_\mathit{test}$ & $87.99\%$ & $90.10\%$ & $91.53\%$ & $87.93\%$ & $91.54\%$ & $91.94\%$ \\ \bottomrule \end{tabular} \vspace{-0.50cm} \label{Table: Model Accuracies} \end{table} Next we run the ABS analysis on these models and generate masks $M_\mathit{masks}$. We set the parameters of the ABS tool similar to the authors \cite{liu2019abs} except \emph{REASR bound} which is set to $0.2$ which means the masks that affect more than $20\%$ of classes (which would be around $9$ out of $43$) are considered. The reason to set this to $0.2$ is to control the number of trojan masks. It is worthwhile to mention that setting the REASR bound to higher values will not output any trojan masks and setting them to lower values will output many masks that are however less effective. Finally, we apply these masks on the test data $X_\mathit{test}$ to obtain a new set of masked images $X_\mathit{test}^M$ and afterwards compute model predictions on them. Table~\ref{Table: ABS Analysis} shows the number of trojan neurons, and ASR on masked images. Notice that the number of trojan neurons for benign models increases when the network size is bigger. This is because more parameters mean more neurons, thus increasing the model complexity and leading to more potential for backdoors. The attack success rate of trojan models on $X_\mathit{test}^M$ is large because the ABS tool successfully found the imputed trojan pattern. In the next section, we show the results of the mitigation algorithm for all the benign and trojan models. \begin{table}[htbp] \vspace{-0.25cm} \setlength{\tabcolsep}{6pt} \centering \caption{Results from ABS analysis which includes number of trojan neurons and attack success rates on respective $X_\mathit{seed}^M$ data} \begin{tabular}{lllllll} \toprule \multirow{2}{*}[-0.25em]{Property} & \multicolumn{3}{c}{Benign Models} & \multicolumn{3}{c}{Trojan Models}\\ \cmidrule(lr){2-4} \cmidrule(lr){5-7} \\ \addlinespace[-8pt] {} & $\mathcal{N}_\mathit{SN}$ & $\mathcal{N}_\mathit{MN}$ & $\mathcal{N}_\mathit{LN}$ & $\mathcal{N}_\mathit{SN}^\mathit{troj}$ & $\mathcal{N}_\mathit{MN}^\mathit{troj}$ & $\mathcal{N}_\mathit{LN}^\mathit{troj}$ \\ \midrule $\#$ of Trojan Neurons & $1$ & $3$ & $3$ & $4$ & $3$ & $2$\\ Attack Success Rate & $67.43\%$ & $76.46\%$ & $70.86\%$ & $97.69\%$ & $93.00\%$ & $80.72\%$\\ \bottomrule \end{tabular} \label{Table: ABS Analysis} \vspace{-0.75cm} \end{table} \subsection{Mitigation Results} \newcommand{3.0cm}{3.0cm} \begin{figure}[!htbp] \centering \subfigure{ \begin{tikzpicture} \begin{axis}[ xlabel={Predictions},ylabel={Actual Label}, xtick distance=5,ytick distance=5, xtick pos=bottom, ytick pos=left, label style={font=\scriptsize}, tick label style={font=\scriptsize, /pgf/number format/fixed}, axis on top, width=3.0cm, height=3.0cm, scale only axis=true, enlargelimits=false, tick align=outside, ] \addplot graphics[xmin=0, xmax=43, ymin=0.0, ymax=43, includegraphics={width=3.0cm, trim={1.55cm 1.45cm 0.25cm 0.25cm},clip}] {Includes/confuison_matrix_benign_small.png}; \end{axis} \end{tikzpicture} } \subfigure{ \begin{tikzpicture} \begin{axis}[ xlabel={Predictions}, xtick distance=5,ytick distance=5, xtick pos=bottom, ytick pos=left, label style={font=\scriptsize}, tick label style={font=\scriptsize, /pgf/number format/fixed}, axis on top, width=3.0cm, height=3.0cm, scale only axis=true, enlargelimits=false, tick align=outside, ] \addplot graphics[xmin=0, xmax=43, ymin=0, ymax=43, includegraphics={width=3.0cm, trim={1.55cm 1.45cm 0.25cm 0.25cm},clip}] {Includes/confuison_matrix_trojan_small_1.png}; \end{axis} \end{tikzpicture} } \subfigure{ \begin{tikzpicture} \begin{axis}[ xlabel={Predictions}, xtick distance=5,ytick distance=5, xtick pos=bottom, ytick pos=left, label style={font=\scriptsize}, tick label style={font=\scriptsize, /pgf/number format/fixed}, axis on top, width=3.0cm, height=3.0cm, scale only axis=true, enlargelimits=false, tick align=outside, ] \addplot graphics[xmin=0, xmax=43, ymin=0.0, ymax=43, includegraphics={width=3.0cm, trim={1.55cm 1.45cm 0.25cm 0.25cm},clip}] {Includes/confuison_matrix_trojan_small_2.png}; \end{axis} \end{tikzpicture} } \subfigure{ \hspace{3.85cm} \begin{tikzpicture} \begin{axis}[ xlabel={Predictions},ylabel={Actual Label}, xtick distance=5,ytick distance=5, xtick pos=bottom, ytick pos=left, label style={font=\scriptsize}, tick label style={font=\scriptsize, /pgf/number format/fixed}, axis on top, width=3.0cm, height=3.0cm, scale only axis=true, enlargelimits=false, tick align=outside, ] \addplot graphics[xmin=0, xmax=43, ymin=0, ymax=43, includegraphics={width=3.0cm, trim={1.55cm 1.45cm 0.25cm 0.25cm},clip}] {Includes/confuison_matrix_trojan_small_3.png}; \end{axis} \end{tikzpicture} } \subfigure{ \begin{tikzpicture} \begin{axis}[ xlabel={Predictions}, xtick distance=5,ytick distance=5, xtick pos=bottom, ytick pos=left, label style={font=\scriptsize}, tick label style={font=\scriptsize, /pgf/number format/fixed}, axis on top, width=3.0cm, height=3.0cm, scale only axis=true, enlargelimits=false, tick align=outside, ] \addplot graphics[xmin=0, xmax=43, ymin=0, ymax=43, includegraphics={width=3.0cm, trim={1.55cm 1.45cm 0.25cm 0.25cm},clip}] {Includes/confuison_matrix_trojan_small_4.png}; \end{axis} \end{tikzpicture} } \caption{Confusion Matrix from predictions of model $\mathcal{N}_\mathit{SN}$ on data $X_\mathit{test}^{M_1}$ (image in first column from left) and predictions of model $\mathcal{N}_\mathit{SN}^\mathit{troj}$ on data $X_\mathit{test}^{M_2}$ (images in second and third columns).} \vspace{-0.40cm} \label{Fig: Confusion Matrix} \end{figure} Our goal is to show that masks identified from ABS affect multiple classes. For this, we utilize confusion matrices depicted in Figure~\ref{Fig: Confusion Matrix}, which we obtain using the actual labels $y_\mathit{test}$ and predictions from model $\mathcal{N}_\mathit{SN}$ on data $X_\mathit{test}^{M_1}$ where $M_1 = \{m_1\}$ (data by applying one mask from ABS analysis) and from model $\mathcal{N}_\mathit{SN}^\mathit{troj}$ on data $X_\mathit{test}^{M_2}$ where $M_2 = \{m_1, m_2, m_3, m_4\}$ (data by applying three masks from ABS analysis). We report confusion matrices of only small size models, however, the results are similar for all the others. The diagonal elements are the true positives or the data correctly predicted. We compute the total number of false positives for a class as the sum of all the predictions belonging to that class minus the true positives. The multiple columns with high color intensities in Figure~\ref{Fig: Confusion Matrix} show that benign and trojan models may have a backdoor affecting more than one class. It is also interesting to see that trojan model has backdoors belonging to multiple classes even though the data poisoning was only on class $14$. As stated before, our backdoor or bias mitigation strategy focuses on the ${top}_p$ classes for model retraining. Therefore, we run four experiments for each trained model by setting $\mathit{top}_p$ to $15$, $25$, $35$ and $43$, respectively. Figure~\ref{Fig: Accuracy drop} depicts the drop in accuracy after running the algorithm. We utilize benign validation data $X_\mathit{valid}$ to check the drop in accuracy for both benign and trojan models. As we can see, for both types of models, the drop in accuracy strongly depends on $\mathit{top}_p$ value. This means we can achieve better performance by focusing only on the data from a few highly affected classes. \begin{figure}[htbp] \vspace{-0.50cm} \centering \subfigure{ \includegraphics[width=5.5cm, trim={0.0cm 0.0cm 0.0cm 0.0cm},clip]{Includes/retrain_acc_drop_benign.png}} \subfigure{ \includegraphics[width=5.5cm, trim={0.0cm 0.0cm 0.0cm 0.0cm},clip]{Includes/retrain_acc_drop_trojaned.png}} \caption{Drop in classification accuracy after retraining at different $\mathit{top}_p$ values} \vspace{-0.45cm} \label{Fig: Accuracy drop} \end{figure} Table~\ref{Table: Mitigation Iterations} shows the change in the number of trojan neurons and attack success rate after retraining once. Observe the drop in the respective ASRs when we restrict retraining to smaller $\mathit{top}_p$. The advantage of retraining with smaller $\mathit{top}_p$ is that we can mitigate backdoors better by considering only top-affected classes without losing the classification performance of the DNN. To show the effectiveness of our method, we train another trojan model $\mathcal{N}_\mathit{NCN}^\mathit{troj}$ with the same architecture and trojaning technique as in Neural Cleanse. Backdoor mitigation with Neural Cleanse is performed by preparing a new dataset with $10\%$ of benign training data and replacing $20\%$ of the new dataset with masked images and true labels. The network is then trained for only $1$ epoch. We show the comparison results in Table~\ref{Table: Comparison results} where we can see that we are able to achieve much lower attack success rate without affecting the classification accuracy. \begin{table}[htbp] \vspace{-0.25cm} \setlength{\tabcolsep}{5pt} \centering \caption{Number of detected trojan neurons and their attack success rate after retraining once} \begin{tabular}{lcccccccccc} \toprule \multirow{2}{*}[-0.25em]{Model} & \multicolumn{5}{c}{$\#$ of trojan neurons} & \multicolumn{5}{c}{Attack success rate}\\ \multirow{2}{*}[-0.25em]{} & \multicolumn{5}{c}{at different $\mathit{top}_p$ values} & \multicolumn{5}{c}{at different $\mathit{top}_p$ values}\\ \cmidrule(lr){2-6} \cmidrule(lr){7-11} \\ \addlinespace[-8pt] {} & Before & $43$ & $35$ & $25$ & $15$ & Before & $43$ & $35$ & $25$ & $15$ \\ \midrule $\mathcal{N}_\mathit{SN}$ & $1$ & $1$ & $1$ & $0$ & $0$ & $67.43\%$ & $40.60\%$ & $35.00\%$ & $0.0\%$ & $0.0\%$ \\ $\mathcal{N}_\mathit{MN}$ & $3$ & $1$ & $2$ & $1$ & $0$ & $76.46\%$ & $90.01\%$ & $84.67\%$ & $64.82\%$ & $0.0\%$ \\ $\mathcal{N}_\mathit{LN}$ & $3$ & $2$ & $1$ & $0$ & $0$ & $70.86\%$ & $68.02\%$ & $64.02\%$ & $0.0\%$ & $0.0\%$ \\ \midrule $\mathcal{N}_\mathit{SN}^\mathit{troj}$ & $4$ & $3$ & $3$ & $1$ & $0$ & $97.69\%$ & $91.60\%$ & $80.27\%$ & $62.73\%$ & $0.00\%$ \\ $\mathcal{N}_\mathit{MN}^\mathit{troj}$ & $3$ & $2$ & $2$ & $1$ & $1$ & $93.00\%$ & $92.74\%$ & $64.20\%$ & $71.42\%$ & $38.30\%$ \\ $\mathcal{N}_\mathit{LN}^\mathit{troj}$ & $2$ & $1$ & $1$ & $0$ & $0$ & $80.72\%$ & $90.79\%$ & $43.05\%$ & $0.0\%$ & $0.0\%$ \\ \bottomrule \end{tabular} \vspace{-0.40cm} \label{Table: Mitigation Iterations} \end{table} We show the number of trojan neurons after retraining multiple times in Table~\ref{Table: Multiple Mitigation} with the maximum drop in accuracy $\delta$ set to $8\%$. It is worth mentioning that the drop in accuracy after three iterations for smaller networks is at most five percent, but we set $\delta$ to $8\%$ so that all the networks can be retrained at least twice (see Figure~\ref{Fig: Accuracy drop}). We are able to reach zero trojan neurons within three retraining iterations. Notice that setting higher $\mathit{top}_p$ values may sometime increase the number of trojan neurons in the network. On the other hand, lower $\mathit{top}_p$ values can remove all trojan neurons in fewer iterations making our mitigation technique very effective. \begin{table}[htbp] \vspace{-0.25cm} \setlength{\tabcolsep}{4.pt} \centering \caption{Mitigation comparison with Neural Cleanse on model $\mathcal{N}_\mathit{NCN}^{troj}$} \begin{tabular}{lcc} \toprule Mitigation method & Classification Accuracy & Attack Success Rate \\ \midrule Before Mitigation & $97.27\%$ & $96.45\%$ \\ \midrule Neural Cleanse & $94.25\%$ & $19.18\%$ \\ Our Approach & $\bm{95.77\%}$ & $\bm{5.38\%}$ \\ \bottomrule \end{tabular} \vspace{-0.40cm} \label{Table: Comparison results} \end{table} \begin{table}[!htbp] \setlength{\tabcolsep}{5pt} \centering \caption{Number of trojan neurons at different $\mathit{top}_p$ values and at different mitigation iterations} \begin{tabular}{lcccccccccccc} \toprule Model & \multicolumn{3}{c}{$\mathit{top}_p=43$} & \multicolumn{3}{c}{$\mathit{top}_p=35$} & \multicolumn{3}{c}{$\mathit{top}_p=25$} & \multicolumn{3}{c}{$\mathit{top}_p=15$} \\ \cmidrule(lr){2-4} \cmidrule(lr){5-7} \cmidrule(lr){8-10} \cmidrule(lr){11-13}\\ \addlinespace[-8pt] {} & $1^\mathit{st}$ & $2^\mathit{nd}$ & $3^\mathit{rd}$ & $1^\mathit{st}$ & $2^\mathit{nd}$ & $3^\mathit{rd}$ & $1^\mathit{st}$ & $2^\mathit{nd}$ & $3^\mathit{rd}$ & $1^\mathit{st}$ & $2^\mathit{nd}$ & $3^\mathit{rd}$ \\ \midrule $\mathcal{N}_\mathit{SN}$ & $1$ & $0$ & $-$ & $1$ & $0$ & $-$ & $0$ & $-$ & $-$ & $0$ & $-$ & $-$ \\ $\mathcal{N}_\mathit{MN}$ & $1$ & $2$ & $1$ & $2$ & $0$ & $-$ & $1$ & $0$ & $-$ & $0$ & $-$ & $-$ \\ $\mathcal{N}_\mathit{LN}$ & $2$ & $0$ & $-$ & $1$ & $2$ & $0$ & $0$ & $-$ & $-$ & $0$ & $-$ & $-$ \\ \midrule $\mathcal{N}_\mathit{SN}^\mathit{troj}$ & $3$ & $0$ & $-$ & $3$ & $0$ & $-$ & $1$ & $1$ & $0$ & $0$ & $-$ & $-$ \\ $\mathcal{N}_\mathit{MN}^\mathit{troj}$ & $2$ & $0$ & $-$ & $2$ & $0$ & $-$ & $1$ & $2$ & $0$ & $1$ & $0$ & $-$ \\ $\mathcal{N}_\mathit{LN}^\mathit{troj}$ & $1$ & $0$ & $-$ & $1$ & $0$ & $-$ & $0$ & $-$ & $-$ & $0$ & $-$ & $-$ \\ \bottomrule \end{tabular} \label{Table: Multiple Mitigation} \end{table} \begin{table}[htbp] \setlength{\tabcolsep}{4.pt} \centering \caption{Number of trojan neurons and their ASR after neuron pruning on trojan models} \begin{tabular}{lcccccccc} \toprule \multirow{2}{*}[-0.25em]{Model} & \multicolumn{4}{c}{$\#$ of trojan neurons} & \multicolumn{4}{c}{Attack success rate}\\ \multirow{2}{*}[-0.25em]{} & \multicolumn{4}{c}{at different pruning rates} & \multicolumn{4}{c}{at different pruning rates}\\ \cmidrule(lr){2-5} \cmidrule(lr){6-9} \\ \addlinespace[-8pt] {} & Before & $0.4$ & $0.5$ & $0.6$ & Before & $0.4$ & $0.5$ & $0.6$ \\ \midrule $\mathcal{N}_\mathit{SN}^\mathit{troj}$ & $4$ & $4$ & $4$ & $4$ & $97.69\%$ & $97.68\%$ & $97.68\%$ & $97.68\%$ \\ $\mathcal{N}_\mathit{MN}^\mathit{troj}$ & $3$ & $3$ & $3$ & $3$ & $93.00\%$ & $80.24\%$ & $97.83\%$ & $97.83\%$ \\ $\mathcal{N}_\mathit{LN}^\mathit{troj}$ & $2$ & $1$ & $1$ & $1$ & $80.72\%$ & $53.07\%$ & $53.07\%$ & $53.07\%$ \\ \bottomrule \end{tabular} \vspace{-0.50cm} \label{Table: Pruning Iterations} \end{table} As an additional experiment, we evaluate the effect of \emph{neuron weight pruning}~\cite{wang2019neural} on the trained models. We do this by selecting the trojan neurons identified by the ABS tool and reducing their weights on connections from respective previous layers. This way, we hope to reduce the information flow through these trojan neurons by a certain percentage which we call it as \emph{pruning rate}. Pruning rate takes values between $0$ (no change in the weights) and $1$ (all the weights set to $0.0$). The results depicted in Table~\ref{Table: Pruning Iterations} show that the weight pruning do not reduce the number of trojan neurons. This may be because unlike~\cite{wang2019neural}, we use ABS to identify trojan neurons and the number of trojan neurons we obtain is very low for this analysis. It is interesting to exploit better pruning technique which could lead to a better mitigation performance. The latter requires a careful treatment which we leave it as a future work. We directly profit from the advantages of using the ABS tool instead of Neural Cleanse which are discussed in~\cite{liu2019abs}. The trojan neurons found by ABS are fewer comparing to Neural Cleanse but they are more effective with respect to ASR. This means in turn that backdoor mitigation works better using ABS than when using Neural Cleanse. More important however is that our retraining method works better. Our results demosntrates that, in contrast to Neural Cleanse, strategically retraining the model using masked images from $\mathit{top}_p$ classes can remove all identified backdoors or biases in the model. Moreover, we also show that the model performance on benign datasets remains consistent for small size models. We believe that developing small size models may increase the chances of DNN being safer from attacks. \section{Conclusion} In this paper, we have addressed the problem of backdoor mitigation in classification models. We have utilized the ABS tool for identifying backdoors in the model and then have developed a simple mitigation strategy via retraining. Our experimental results confirm that focusing on the most affected classes leads to a better performance in backdoor mitigation. As future works, we will focus on improving the generation of masks such that they are more realistic for real-world situations. Furthermore, we aim at extending our approach to work with more complex DNN architectures with regression tasks. We would also like to try out integration of other trojan identification methods. \bibliographystyle{splncs04}
\section{Introduction} \label{sec:innn} Increasing the variety and scope of theoretical tools that can be used to analyse strongly coupled Quantum Field Theories (QFTs) reliably remains an important scientific challenge. Hamiltonian Truncation is one such tool. To apply it, the Hamiltonian of the full QFT (which is infinite-dimensional) is approximated by a finite dimensional Hamiltonian which acts only on the lowest energy states of the theory. This finite dimensional Hamiltonian can then be diagonalised numerically, enabling the low-energy spectrum to be estimated. Hamiltonian Truncation was first applied in the context of QFT in Ref.~\cite{Brooks:1984aaa}, and subsequently it was successfully employed in Refs.~\cite{Yurov:1989yu,Yurov:1991my} to non-perturbatively determine renormalisation group flows between CFTs with $d=1+1$ on the cylinder. Since then, the method has been generalised to QFTs with arbitrary $d$ in \cite{Hogervorst:2014rta} and applied to QFTs quantised on the lightcone, beginning with \cite{Brodsky:1985aaa}. In recent years, there has been a resurgence of interest in Hamiltonian Truncation within high energy physics. See for example Refs.~\cite{Bajnok:2015bgw,Katz:2016hxp,Anand:2017yij,Rutter:2018aog,Fitzpatrick:2018ttk,Hogervorst:2018otc,Delacretaz:2018xbn,Anand:2019lkt,Fitzpatrick:2019cif,Elias-Miro:2020qwz,Anand:2020gnn,Anand:2020qnp,Hogervorst:2021spa,Anand:2021qnd,EliasMiro:2021aof,Szasz-Schagrin:2022wkk,Chen:2022zms,Delacretaz:2022ojg,Henning:2022xlj,Dempsey:2022uie}, as well as the reviews \cite{Fitzpatrick:2022dwq,Konik-review}. A particularly important focus for research in this area has been on the development of effective Hamiltonians for improving the accuracy of Hamiltonian Truncation estimates~\cite{Hogervorst:2014rta,Giokas:2011ix,Rychkov:2014eea,Rychkov:2015vap,Elias-Miro:2015bqk,Elias-Miro:2017xxf,Elias-Miro:2017tup,Cohen:2021erm}. However, the absence of a systematic understanding of how Hamiltonian Truncation should be applied to QFTs with UV divergences (which require renormalisation) has been a significant obstacle, preventing wider usage of the method. When the Hamiltonian is truncated, removing high energy states from the QFT, this acts as a UV regulator. In Ref.~\cite{EliasMiro:2021aof}, we showed that the Hamiltonian Truncation UV regulator gives results that are inconsistent with those derived using a local regularisation (such as a short distance cutoff), implying that non-local counterterms are needed to implement renormalisation in Hamiltonian Truncation. In this work, we present three main results: First in Section~\ref{sec:heff} we derive a novel representation of an effective Hamiltonian that is finite dimensional, but constructed to have the exact same spectrum of lowest energy states as the full QFT. We then compare it with alternative types of effective Hamiltonian from the literature. Second, we show in Section~\ref{sec:hampt} how an effective Hamiltonian can be used to compute the spectrum of QFTs which have UV divergences. This is done by employing a local regularisation and introducing the corresponding local counterterms to remove all UV divergences before building an effective Hamiltonian for the renormalised QFT, which can be diagonalised numerically. We provide explicit formulae for this Effective Hamiltonian in Section~\ref{tcsaex}. Our third result is presented in Section~\ref{sec:cutoffdep}. Here we perform a check using perturbation theory that the effective Hamiltonian constructed following the procedure outlined in Section~\ref{sec:hampt} contains the extra interactions required to cancel the UV divergences found in Ref.~\cite{EliasMiro:2021aof} which were inconsistent with local regularisation. \section{Effective Hamiltonians} \label{sec:heff} In this section, we first summarise how effective Hamiltonians can be used to improve the accuracy of Hamiltonian Truncation calculations~\cite{Hogervorst:2014rta,Giokas:2011ix,Rychkov:2014eea,Rychkov:2015vap,Elias-Miro:2015bqk,Elias-Miro:2017xxf,Elias-Miro:2017tup,Cohen:2021erm}. We then present a novel representation for a particular effective Hamiltonian, which makes its useful properties manifest. The start point for any Hamiltonian Truncation calculation is reached by first expressing the Hamiltonian in a well chosen basis and dividing it into a solvable part $H_0$ and a deformation $V$, \begin{equation} H=H_0+V \, . \label{ham1} \end{equation} The solvable part has the spectrum $H_0|i\rangle = E_i |i\rangle$. We are interested in finding the low energy spectrum of the interacting theory, \begin{equation} H|{\cal E}\rangle = {\cal E}_l |{\cal E} \rangle \, . \label{eigqft} \end{equation} where $ {\cal E}_l $ is the interacting energy of a low energy state. We emphasise that the Hilbert space the Hamiltonian above acts upon is infinite dimensional. Next, we proceed by separating the Hilbert space into a low ($l$) and high ($h$) energy sector ${\cal H}={\cal H}_l\oplus {\cal H}_h$. The low energy Hilbert space ${\cal H}_l$ is finite dimensional and spanned by the states $\sum_{E_i \leqslant E_T}|i \rangle \langle i | $; while the high energy Hilbert space ${\cal H}_h$ is infinite dimensional and contains the rest of the states $\sum_{E_i > E_T}|i \rangle \langle i | $. The constant $E_T$ is called the Hamiltonian Truncation cutoff. The calculation proceeds by replacing the infinite dimensional eigenvalue problem in \reef{eigqft} with an equivalent finite dimensional eigenvalue problem \begin{equation} H_\text{eff}|{\cal E}_l\rangle = {\cal E}_l |{\cal E}_l \rangle \, , \label{heftone} \end{equation} where $|{\cal E}_l \rangle\in {\cal H}_l$. The Effective Hamiltonian operator $H_\text{eff}$ acts in the low energy Hilbert space only. If the truncation cutoff is much larger than the energy of the interacting states that we are interested in so that $E_T \gg {\cal E}_l$, then \begin{equation} \langle i|H_\text{eff}|j\rangle \approx \langle i | H | j \rangle \, , \label{rawapp} \end{equation} where $| i \rangle\, , | j \rangle$ are $H_0$ eigenstates in the subspace $\calH_l$. This approximation is often called \emph{raw} Hamiltonian Truncation. Clearly, in the limit of large Hamiltonian Truncation cutoff, we recover the spectrum of the interacting theory exactly. However it is often hard to use large values for the cutoff $E_T$ in practical calculations because the dimension of the low energy Hilbert space ${\cal H}_l$ grows exponentially with $E_T$. It is thus desirable to find better approximations to $H_\text{eff}$ than \reef{rawapp}, without increasing $E_T$. In perturbation theory, the effective Hamiltonian is expressed as a series \begin{align} H_\text{eff} = H_0 + V + \sum_{n=2}^\infty H_{\text{eff}\, n}\,.\label{eq:heffgen} \end{align} where $H_{\text{eff}\, n}=O(V^n)$.~\footnote{We remark that the approximation introduced by truncating this series to fixed order in $V$ breaks down at strong coupling, but that it is possible to find alternative rigorous approximations to $H_\text{eff}$ that are valid at strong coupling and agree with \reef{eq:heffgen} at weak coupling~\cite{Elias-Miro:2017xxf,Elias-Miro:2017tup}.} The effective Hamiltonian is not unique, and different effective Hamiltonians are related to one another by similarity transformations. Therefore several methods are possible to determine \reef{eq:heffgen}. In the next section we will employ the effective Hamiltonian $H_\text{eff}$ introduced in Ref.~\cite{Cohen:2021erm}, which we shall refer to as the CFHL effective Hamiltonian. In appendix \ref{appalter} we comment on alternative $H_\text{eff}$'s. The first few terms of the series \reef{eq:heffgen} for the CFHL effective Hamiltonian are given by \begin{align} \left(H_{\text{eff}\, 2}\right)_{fi} = \frac{V_{fh}V_{hi}}{E_{fh}}\,, \label{heff2} \end{align} where we have introduced the notation $X_{ab}\equiv\matrixel{a}{X}{b}$ for any operator $X$, and $E_{ab}\equiv E_a-E_b$. The states $\ket{f}$, $\ket{i}$ are $H_0$ eigenstates in the subspace $\calH_l$, and the repeated index $h$ indicates summation over all $H_0$ eigenstates with energies \emph{above} the HT cutoff $E_T$. The third order expression was found to be \begin{align} \left(H_{\text{eff}\,3}\right)_{fi}=\frac{V_{fh_1}V_{h_1h_2}V_{h_2i}}{E_{fh_1}E_{fh_2}}-\frac{V_{fl}V_{lh}V_{hi}}{E_{fh}E_{lh}}\,.\label{heff3} \end{align} For future reference, we also provide the CFHL $H_\text{eff}$ at fourth order in perturbation theory, \begin{align} \left(H_{\text{eff}\, 4}\right)_{fi}=&\frac{V_{fh_1}V_{h_1h_2}V_{h_2h_3}V_{h_3i}}{E_{fh_1}E_{fh_2}E_{fh_3}}-\frac{V_{fh_1}V_{h_1l}V_{lh_2}V_{h_2i}}{E_{fh_1}E_{fh_2}E_{lh_2}} \nonumber\\ &-\frac{V_{fl}V_{lh_1}V_{h_1h_2}V_{h_2i}}{E_{fh_1}E_{lh_2}}\left[\frac{1}{E_{fh_2}}+\frac{1}{E_{lh_1}}\right]+\frac{V_{fl_1}V_{l_1l_2}V_{l_2h}V_{hi}}{E_{fh}E_{l_1h}E_{l_2h}}\, . \label{heff4} \end{align} \subsection{Alternative Representation of the Effective Hamiltonian} We now derive an alternative formula for the CFHL effective Hamiltonian~\cite{Cohen:2021erm} in terms of the diagonal Hamiltonian $H_0$ and deformation $V$. In the process, we show that the effective Hamiltonian has the same spectrum as the full Hamiltonian for states with energies beneath the HT cutoff. Consider first the time evolution operator in the interaction picture in the theory with Hamiltonian given by \reef{ham1}, \begin{align} U_\text{IP}(t_f,t_i) = T\exp\left\{-i\int_{t_i}^{t_f}dt \, V_\text{IP}(t)\right\}\, , \qquad V_\text{IP}(t) = e^{i H_0 t}V e^{-\eta t} e^{-i H_0 t}\, . \label{eq:timeevol} \end{align} Here $\eta$ is a parameter that controls the adiabatic switching off of $V$ at large positive times. Next, define the operator $\Sigma$ as the large time limit of the time evolution operator \begin{align} \Sigma = \lim\limits_{t_f\rightarrow\infty} U_\text{IP}(t_f,0)\, . \label{eq:sigdef} \end{align} In scattering theory, this operator is often called M\o{}ller operator. Consider also the truncation of the operator $\Sigma$ to include only its matrix elements between states in the subspace ${\cal H}_l$. We refer to this operator as $\Sigma_l$. Consider next the product of operators $\Sigma\left(H_0+V\right)\Sigma^\dagger$. The action of this product on eigenstates of $H_0$ is represented in Fig.~\ref{timeevo}. The time evolution operator $\Sigma^\dagger$ takes these eigenstates at time $t_f\rightarrow\infty$ (which are also eigenstates of the full Hamiltonian due to the $e^{-\eta t}$ factor shown in \reef{eq:timeevol} that switches off the deformation at large times) and evolves them back to states at zero time. During this evolution, the full Hamiltonian of the theory will change from $H_0$ to $H_0+V$. This evolution will be adiabatic if the parameter $\eta$ is sufficiently small.~\footnote{For simplicity we assume that $H_0$ has no degeneracies so that the adiabatic theorem can be straightforwardly applied, but it is possible to relax this assumption and generalise our derivation.} Using the adiabatic theorem, we conclude that $\Sigma^\dagger$ evolves eigenstates of the full Hamiltonian at infinite time $H_0$ to eigenstates of the full Hamiltonian at zero time $H_0+V$. \begin{figure} \centering \includegraphics[width=0.5\columnwidth]{time_evolution.pdf} \caption{Cartoon describing the action of the product of operators $\Sigma\left(H_0+V\right)\Sigma^\dagger$ on an eigenstate of $H_0$ denoted $\ket{i}$. First, $\Sigma^\dagger$ evolves $\ket{i}$ back from future infinity to an eigenstate of $H_0+V$ at zero time. Then, by acting on that eigenstate with $H_0+V$ we bring down a factor of $\calE_i$. Finally $\Sigma$ evolves the state forward in time, undoing the action of $\Sigma^\dagger$.} \label{timeevo} \end{figure} If we act with operator $H_0+V$ at $t=0$, the energy eigenstate will be multiplied by $\calE_i$, its corresponding energy eigenvalue. Finally if we act with $\Sigma$, we then adiabatically time evolve back to infinite future time to yield a state proportional to the $H_0$ eigenstate we started with. In summary, we expect \begin{align} \lim\limits_{\eta\rightarrow0}\Sigma\left(H_0+V\right)\Sigma^\dagger\sim\text{diag}\left(\calE_0,\calE_1,\dots\right)\,,\label{eq:sigintuition} \end{align} when the operator on the left hand side is expressed in the eigenbasis of $H_0$ -- see Fig.~\ref{timeevo} for a pictorial representation. Unfortunately, this expectation is not always met because $\Sigma$ can become singular in the $\eta\rightarrow 0$ limit. Nonetheless we conclude that $\Sigma$ plays a special role: when it is free of divergences, it diagonalises the Hamiltonian $H_0+V$. Once the full Hamiltonian is diagonalised as in \reef{eq:sigintuition}, its matrix elements between states outside the subspace $\calH_l$ can be thrown away without losing information about the low energy eigenstates and eigenvalues of the full Hamiltonian. Then, we may define an effective Hamiltonian $H_\text{eff}=H_0+V_\text{eff}$ acting on $\calH_l$, and out of $H_\text{eff}$ we can construct an analogous time evolution operator $\Sigma_\text{eff}$: \begin{align} \Sigma_\text{eff} = \lim\limits_{t_f\rightarrow\infty}T\exp\left\{-i\int_{0}^{t_f}dt\, V_{\text{eff IP}}(t)\right\}\, , \quad V_{\text{eff IP}}(t) = e^{i H_0 t}V_\text{eff} e^{-\eta t} e^{-i H_0 t}\, . \label{eq:sigeffdef} \end{align} The Effective Hamiltonian is also diagonalised by its time evolution operator $\Sigma_{\text{eff}}$. Next, following CFHL~\cite{Cohen:2021erm}, we demand that the matrix elements of the time evolution operators between the full \reef{ham1} and the effective field theory should be matched \begin{align} \Sigma_{\text{eff}} = \Sigma_l\, . \end{align} Assuming that the spectra of the full and effective Hamiltonians are also matched by matching time evolution operators, we are led to the following equation for an effective Hamiltonian \begin{align} \Sigma_l H_\text{eff}(\Sigma_l)^{-1} = \left[\Sigma(H_0+V)\Sigma^\dagger\right]_l \, , \label{eq:hl2} \end{align} Here, the $l$ subscripts denotes projection of the operators onto the subspace $\calH_l$. Since $\Sigma_l$ is non--unitary as a result of its projection, we use $(\Sigma_l)^{-1}$ to diagonalise the effective Hamiltonian rather than $(\Sigma_l)^\dagger$. Also, we note that $H_\text{eff}$ in \reef{eq:hl2} will be non--hermitian. We now comment further on the origin of singularities in $\Sigma$ and provide a more rigorous proof that the CFHL Hamiltonian is given by \reef{eq:hl2}. Physically, these singularities arise if eigenstates of $H_0+V$ pick up large phases $\exp\{i(\Delta E)/\eta\}$ in the $\eta\rightarrow0$ limit under time evolution by $\Sigma$. Interaction picture energy eigenstates acquire phases during time evolution when there is a difference between the energy eigenvalues of the free and interacting theories, so that $\Delta E\sim \calE_i-E_i$. In infinite volume scattering problems, the time evolution operator $\Sigma$ is naturally free of singularities, and is commonly referred to as a M{\o}ller operator \cite{kleinert2016particles}. In this context, energy eigenstates of the interacting theory are states of many particles which are distantly separated from one another at time $t_f\rightarrow\infty$ and have vanishing mutual interactions in this limit. As a result, the energy eigenvalues of the interacting theory match those of a theory of free particles and $\Delta E=0$. The scattering states of the interacting theory may be constructed from free particle states using the Lippmann-Schwinger equation, thus yielding a well defined $\Sigma$. In the context of a general quantum theory, the $H_0+V$ eigenvalues will not match those of $H_0$. However, in this case eigenstates of $H_0+V$ may still be constructed from time evolution operators without introducing a singular phase using the first Gell--Mann-Low formula \cite{Gell-Mann:1951ooy}, which is \begin{align} \ket{\psi_i} = \lim_{\eta\rightarrow 0} \frac{U_{IP}^{-1}(\infty,0)\ket{i}}{\bra{i}{U_{IP}^{-1}(\infty,0)}\ket{i}}\,,\label{eq:gm1a} \end{align} where $\ket{\psi_i}$ is an eigenstate of $H_0+V$ and $\ket{i}$ is an $H_0$ eigenstate. The time evolution operators $U_{IP}$ depend on the switching parameter $\eta$. Both the numerator and denominator are proportional to the phase factor $\exp\{i(\Delta E)/\eta\}$, but the ratio has a well defined limit. Similarly, we have \begin{align} \bra{\psi_i} = \lim_{\eta\rightarrow 0}\frac{\bra{i}U_{IP}(\infty,0)}{\bra{i}U_{IP}(\infty,0)\ket{i}}\,. \label{eq:gm1b} \end{align} By replacing $U_{IP}$ with $\Sigma$ in expressions \reef{eq:gm1a} and \reef{eq:gm1b}, the interacting theory Hamiltonian may be diagonalised to yield \begin{align} \lim_{\eta\rightarrow 0}\frac{\matrixel{f}{\Sigma(H_0+V)\Sigma^\dagger}{i}}{\bra{f}\Sigma\ket{f}\bra{i}\Sigma^\dagger\ket{i}} = \delta_{fi}\lim_{\eta\rightarrow 0}\frac{{\mathcal E}_i}{\bra{i}\Sigma\ket{i}\bra{i}{\Sigma^\dagger}\ket{i}}\, , \end{align} where ${\mathcal E}_i$ are the energy eigenvalues of the interacting theory. The individual factors in the denominators all contain phases that diverge in the $\eta\rightarrow0$ limit, but the ratios on both sides of the equation have a well defined limit. If we restrict attention to states $\ket{i},\ket{f} \in {\cal H}_l$, i.e. in the low energy Hilbert space, we find \begin{align} \lim_{\eta\rightarrow 0}\frac{\matrixel{f}{\left[\Sigma(H_0+V)\Sigma^\dagger\right]_l}{i}}{\bra{f}\Sigma_l\ket{f}\bra{i}\Sigma_l^\dagger\ket{i}} = \delta_{fi}\lim_{\eta\rightarrow 0}\frac{{\mathcal E}_{l,i}}{\matrixel{i}{\Sigma_l}{i}\bra{i}\Sigma_l^\dagger\ket{i}}\,, \label{eq:fulldiag} \end{align} where ${\mathcal E}_{l,i}$ refer to the energy eigenvalues of states connected to ${\cal H}_l$ through \reef{eq:gm1a}. The ${\mathcal E}_{l,i}$ are also given by the Rayleigh--Schr{\"o}dinger (RS) perturbative series. Therefore, we could generate the RS series by expanding \reef{eq:fulldiag} perturbatively. We comment further on the connection with RS perturbation theory in Appendix~\ref{app:rs}. The Hamiltonian of the low energy effective theory may also be diagonalised using Eqs.~\reef{eq:gm1a} and \reef{eq:gm1b} \begin{align} \lim_{\eta\rightarrow 0}\frac{\matrixel{f}{\Sigma_\text{eff}H_\text{eff}\Sigma_\text{eff}^{-1}}{i}}{\matrixel{f}{\Sigma_\text{eff}}{f}\bra{i}\Sigma^{-1}_\text{eff}\ket{i}} = \delta_{fi}\lim_{\eta\rightarrow 0}\frac{{\mathcal E}_{\text{eff},i}}{\matrixel{i}{\Sigma_\text{eff}}{i}\bra{i}\Sigma^{-1}_\text{eff}\ket{i}}\, . \label{eq:effdiag} \end{align} The ${\mathcal E}_{\text{eff},i}$ refer to the energy eigenvalues of the effective theory. Note also that $\Sigma_{\text{eff}}^{-1}\neq\Sigma_{\text{eff}}^\dagger$ in the effective theory. For this reason, we replace $U_{IP}^{-1}(\infty,0)$ with $\Sigma_{\text{eff}}^{-1}$ when using \reef{eq:gm1a}. Energy eigenvalues are also determined by time evolution operators, through the second Gell--Mann-Low formula \cite{Gell-Mann:1951ooy}, which may be rewritten using our notation as: \begin{align} {\mathcal E}_i - E_i = \lim_{\eta\rightarrow0} \, -i\eta g \pd{\,}{g}\log\left\{\bra{i}{\Sigma}\ket{i}\right\}\, , \label{eq:gm2} \end{align} where $g$ is a coupling strength proportional to the interaction $V\propto g$, and ${\mathcal E}_i - E_i$ represents the shift in energy between the full and solvable $H_0$ theory. In the case of the CFHL effective Hamiltonian, matrix elements of the time evolution operator are matched $\Sigma_l=\Sigma_{\text{eff}}$. Since the energy eigenvalues are totally determined by the time evolution operator through \reef{eq:gm2}, it follows that the energy eigenvalues of the CFHL Hamiltonian will match exactly those of the full theory which are connected to states in ${\cal H}_l$, so that ${\mathcal E}_{\text{eff},i}={\mathcal E}_{l,i}$. We may therefore combine Eqs.~(\ref{eq:fulldiag}) and (\ref{eq:effdiag}) to obtain \reef{eq:hl2}, after canceling common factors of $\Sigma_l=\Sigma_{\text{eff}}$ and taking the $\eta\rightarrow0$ limit to get finite expressions on both sides. The result can be rearranged to yield \begin{equation} H_\text{eff}=\left(\Sigma_{l}\right)^{-1}\left[\Sigma(H_0+V)\Sigma^{\dagger}\right]_l\Sigma_{l}\,,\label{hl2neat} \end{equation} our main result in this section. We emphasise that the energy eigenvalues of $H_\text{eff}$ are guaranteed to match (a subset of) those of $H_0+V$. This follows from the matching condition $\Sigma_{\text{eff}}=\Sigma_l$ and the second Gell--Mann-Low equation \reef{eq:gm2}. Expanding \reef{hl2neat} perturbatively in $V$ yields (\ref{heff2})--(\ref{heff4}). We observe that \reef{hl2neat} is constructed as a similarity transformation of the full Hamiltonian which diagonalises it, followed by a truncation to the low energy subspace, followed by another similarity transformation. In Appendix.~\ref{appalter}, we exhibit two other effective Hamiltonians that are also constructed as similarity transformations which (partially) diagonalise followed by a truncation. We expect all such effective Hamiltonians to have this general structure, and differ from each other only through similarity transformations. Next we comment on how to compute matrix elements of a Hermitian observable $A$, other than the Hamiltonian $H+V$, in the low-energy Hilbert space. The Effective Hamiltonian in \reef{hl2neat} is not Hermitian $H_\text{eff}^\dagger\neq H_\text{eff}$, thus its eigenvectors are not expected to be orthogonal. Therefore these states are not convenient to compute the matrix elements of the operator $A$ in the low energy effective Hilbert space. To compute matrix elements we should use the time-evolution operator, \begin{equation} A_\text{eff}=\left(\Sigma_{l}\right)^{-1}\left[\Sigma A \Sigma^{\dagger}\right]_l\Sigma_{l}\, , \end{equation} with matrix elements defined only in the low energy Hilbert space ${\cal H}_l$. The first few orders are given by $ ( A_\text{eff})_{fi}=A_{fi}+ \frac{V_{fh} A_{hi}}{E_{fh}}+ \frac{A_{fh} V_{hi}}{E_{ih}}+ O(V^2)$. \section{Application to UV divergent QFTs} \label{sec:hampt} Effective Hamiltonians have another use besides improving the estimates of the Hamiltonian Truncation spectrum. In this section, we show how effective Hamiltonians enable the systematic study of a wide variety of QFTs which have UV divergences using Hamiltonian Truncation. We start by first reviewing the Hamiltonian Truncation set up that we shall use as well as the problem of UV divergences in this context. \subsection{Review of TCSA} Hamiltonian Truncation is a generalisation of the Rayleigh--Ritz method, often used in quantum mechanics, to Quantum Field Theory. Several variations of this idea exist, which differ by placing the theory on different manifolds or truncating the Hilbert space in different quantisation schemes. For example, see \cite{Anand:2020gnn}, the reviews \cite{Fitzpatrick:2022dwq,Konik-review} and references within. In the main body of this work, we focus on the Truncated Conformal Space Approach (TCSA)~\cite{Yurov:1989yu} and its higher dimensional generalisation~\cite{Hogervorst:2014rta}. In the rest of this work, we analyse Hamiltonian Truncation in QFTs with $d\geqslant 2$ that are defined as relevant deformations away from an ultraviolet CFT. To regulate infrared divergences the CFT is placed on the ``cylinder" $\mathds{R}\times S_R^{d-1}$ where $R$ is the radius of the $d-1$ dimensional sphere. The Hamiltonian is given by \begin{equation} H=H_\text{CFT} +V \quad , \quad \quad \text{where}\quad \quad V= g R^{\Delta-d}\int_{S_R^{d-1}} d^{d-1}x \phi_\Delta(0,\vec x) \ , \label{tcsafirst} \end{equation} where $g$ is a dimensionless coupling. For simplicity we will perturb $H_\text{CFT}$ using a single relevant primary operator, but generalisation to the case of multiple perturbing operators is possible. Thanks to the operator-state correspondence, the Hamiltonian on the cylinder is related to the dilatation operator, and thus the eigenvalues are given by the scaling dimensions of local operators \begin{equation} \langle \calO_j | H_\text{CFT} | \calO_i \rangle = E_i\, \delta_{ij } \quad , \quad \quad \text{where}\quad \quad E_i = \Delta_i/R \ . \end{equation} Next we truncate the Hamiltonian $H$ to the low energy sector spanned by the states $\{|\calO_i \rangle\}$ with scaling dimension less that the TCSA cutoff $\Delta_i\leqslant\D$, leading to the finite dimensional matrix \begin{equation} H_{ij} \equiv \Delta_i \delta_{ij }+ V_{ij}\quad , \quad \quad \Delta_i \leqslant \Delta_T \ , \label{Hraw} \end{equation} where we have defined $V_{ij}\equiv R\langle \calO_j | V| \calO_i \rangle$. Finally, we are required to take the continuum field theory limit by diagonalising a sequence of matrices $H_{ij}$ with increasingly large values of $\Delta_T$ and then extrapolating the spectrum towards the limit $\Delta_T\rightarrow \infty$. This method of computing the spectrum is non-perturbative and valid at strong coupling $g\gtrsim 1$. It is often useful to compare the non-perturbative spectrum of Hamiltonian Truncation, at weak coupling $g \ll 1$, with the spectrum computed with the Rayleigh--Schr\"{o}dinger (RS) perturbation theory \begin{equation} {\cal E}_{i}\, R = \Delta_i+ \underbrace{ \phantom{ \bigg|} V_{ii} \phantom{ \bigg|} }_{{\cal E}_i^{(1)}}+ \underbrace{ \phantom{ \bigg|} V_{ik} \frac{1}{\Delta_{ik}} V_{ki} \phantom{ \bigg|} }_{{\cal E}_i^{(2)}}+ \underbrace{ \phantom{ \bigg|} V_{ik} \frac{1}{\Delta_{ik}} V_{kk^\prime} \frac{1}{ \Delta_{ik^\prime}} V_{k^\prime i} - V_{ii} \, V_{ik}\frac{1}{\Delta_{ik}^2} V_{ki} }_{{\cal E}_i^{(3)}} + \, O(V^4)\,, \label{pert1} \end{equation} where $\Delta_{ij}= \Delta_i-\Delta_j$ and a sum over intermediate states $k\neq i$ is implicit. For future reference we recall that each order of perturbation theory can be computed in position space. For instance the $n$-th order correction to the ground state, or Casimir energy, is given by the integrated connected $n$-point function of the perturbing operator \begin{equation} {\cal E}_{gs}^{(n)} = -( - g)^n S_{d-1} /n! \int_{\mathds{R}^d} \prod_{i=1}^{n-1}{d^dx_i} |x_i|^{\Delta-d} \, \langle \phi_\Delta(x_1) \cdots \phi_\Delta(x_{n-1}) \phi_\Delta(1) \rangle_c \, , \label{pert2} \end{equation} where $S_{d-1}=2 \pi^{\frac{d}{2}}/\Gamma(d/2)$ and the spacetime coordinate denoted as 1 represents a unit vector in $\mathds{R}^d$. In \reef{pert2} we have set $R=1$, in the rest of the paper we measure all dimensionful quantities in units of $R$. Similar expressions can be derived for the excited states. Further details can be found in \cite{EliasMiro:2021aof}. In obtaining \reef{pert2} a Weyl transformation from the ``cylinder" $ \mathds{R}\times S_R^{d-1}$ into the plane $\mathds{R}^d$ has been used. From here on we use $x_i$ and $\phi_\Delta(x_i)$ to denote coordinates and fields on $\mathds{R}^d$. We distinguish fields on the cylinder $\phi_\Delta(\tau_i ,\vec x_i)$ by using $(\tau, \vec x_i)$ coordinates, where $\vec x_i$ is a vector in $S^{d-1}$ and $\tau_i$ is the cylinder time coordinate. A beautiful aspect of Hamiltonian Truncation is its potential as a universal method for computing strongly coupled renormalisation group flows away from any UV CFT. Nevertheless there are important challenges to overcome before this potential may be fully realised. In particular, it is not understood in all cases how renormalisation is to be implemented within TCSA, when the underlying QFT has UV divergences. When the deforming operator has dimension $\Delta \geqslant d/2$, the spectrum of the truncated Hamiltonian \reef{Hraw} does not converge as $\Delta_T\rightarrow\infty$. The reason for this can be understood by employing RS perturbation theory. The 2nd order correction to the Casimir energy, $ {\cal E}^{(2)}_0\propto \int_{\mathds{R}^d} d^{d}x \langle \phi_\Delta( x) \phi_\Delta(1) \rangle $, diverges for $2\Delta \geqslant d$ because at $x\rightarrow 0$ the two-point function $\langle\phi_\Delta(x) \phi_\Delta(0)\rangle =|x|^{-2\Delta}$ is singular and the measure has dimensions of $(\text{length})^d$. Similarly, the integral of the connected three-point function is divergent for $3\Delta \geqslant 2d$, but finite otherwise, and the integral of the connected four-point function is divergent only for $4\Delta \geqslant 3d$. The main point is simple: as the dimension of $\phi_\Delta$ is increased further we encounter UV divergences in higher order correlation-functions; until we reach marginality $\Delta=d$ where all $n$-point connected correlation functions are UV divergent. The presence of UV divergences is a common phenomena in QFT, and the way to deal with it is to carefully define the theory with appropriate counterterms and renormalisation conditions. In the context of Hamiltonian Truncation, it does not work in the same way and the renormalisation procedure requires a few extra steps that we explain next. \subsection{How to Determine Counterterms in Hamiltonian Truncation?} The Hamiltonian Truncation cutoff provides a natural regulator that removes UV divergences. The truncated theory is free of UV divergences because the maximal energy of the free-theory states is $E_i\leqslant\Delta_T/R$. This cutoff however is non-local because all $n$-particle states are bounded by the total energy $\Delta_T/R$ irrespective of the distance between the constituent particles. In this sense, Hamiltonian Truncation is very different from traditional local regulators, such as the short distance regulators (which cut out regions of position space where one or more operators get close), or the momentum cutoff regulator (which cuts the maximal momenta flowing in loop diagrams). As a consequence of the breaking of locality that arises from the use of the $\Delta_T$ regulator, non-local counter-terms are needed for renormalisation in order to recover a local theory in the limit $\Delta_T\rightarrow\infty$. This was demonstrated in Refs.~\cite{Elias-Miro:2020qwz,Anand:2020qnp} where state-dependent counterterms (that were therefore non-local) were employed to renormalise the $\phi^4$ theory in $d=2+1$ dimensions. Furthermore, the use of the $\Delta_T$-cutoff to regularise the theory introduces UV divergences at higher orders than would have been present had a local regulator been used: in Ref.~\cite{EliasMiro:2021aof} it was shown that for $\Delta\in[d/2+1/4 , \, 3d/4)$, the fourth order correction to the Casimir energy is finite if a local regulator is employed but diverges if the $\Delta_T$ cutoff is used. In this work we do not use $\Delta_T$ as a regulator of UV divergences. We instead implement renormalisation in a QFT with relevant but UV divergent deformations through the use of Effective Hamiltonians. In the rest of the section, we set out the general logical steps that we follow in our approach to renormalisation, before moving on to detailed computations. \begin{enumerate} \item[{\bf 1)}] In order to define a local QFT with finite energy levels, we first renormalise all integrated local $n$-point functions of the perturbing operator by employing a local regulator: Starting with the bare action or Hamiltonian, we first employ a short distance regulator \begin{equation} \langle \phi_\Delta(x_1) \phi_\Delta(x_2)\cdots \phi_\Delta(x_n) \rangle \ \longrightarrow \ \langle \prod_{i=1}^n \phi_\Delta(x_1) \phi_\Delta(x_2) \cdots \phi_\Delta(x_n) \rangle \prod_{i < j} \theta(|x_i-x_j|-\epsilon)\,, \end{equation} so that the integral $\int \prod_{i=1}^{n-1} d^dx_i |x_i|^{\Delta-d}$ of the last equation is finite; and then introduce all the necessary local counter-terms \begin{equation} V(\epsilon)\equiv V+H_{c.t.}(\epsilon)= g R^{\Delta-d}\int\limits_{S_R^{d-1}} d^{d-1}x\,\phi_\Delta(0,\vec x) + \sum_{\substack{2\leqslant n\leqslant M\\j}} g^n \delta(\epsilon)_{n,j} R^{\Delta_j-d}\int\limits_{S_R^{d-1}} d^{d-1}x\,\calO_j(0,\vec x) \,, \end{equation} where $M$ is some finite integer because the perturbation $\phi_\Delta$ is relevant, $\Delta < d$. As usual the addition of counterterms guarantees that the perturbative calculation of the spectrum is finite in the $\epsilon\rightarrow0$ for any order in perturbation theory. We are left with the following renormalised Hamiltonian \begin{equation} H(\epsilon)_{ij} \equiv \Delta_i \delta_{ij }+ V(\epsilon)_{ij}\,, \label{Hrenone} \end{equation} which we represent as an infinite dimensional matrix. \item[{ \bf 2)}] Next, we compute the effective Hamiltonian with finite dimensionality that matches the low energy spectrum of \reef{Hrenone}. This matrix can be computed using perturbation theory to some fixed order in $g$. Schematically, it takes the form \begin{equation} H_\text{eff}(\epsilon)_{ij}= H(\epsilon)_{ij} + \sum_{n\geqslant 2} H_\text{eff n}(\epsilon)_{ij} \quad , \quad \quad \Delta_i \leqslant \Delta_T \, , \label{heffexp} \end{equation} where $H_\text{eff n}(\epsilon)$ is $O(g^n)$. We work out as many terms in the expansion of $H_\text{eff}$ as we need to produce a matrix where all of its elements are finite in the limit $\epsilon\rightarrow0$, for fixed cutoff $\D$. Since there are only divergences as $\epsilon\rightarrow0$ up to a finite order $M$ in perturbation theory, which are absorbed into a finite number of counterterms, it will only be necessary to calculate the first $M$ orders of \reef{heffexp}. We see that the calculation of the Effective Hamiltonian allows us to take the limit $\epsilon\rightarrow 0$ analytically. An interesting outcome of this construction is that the Effective Hamiltonian generates automatically all the necessary corrections to the bare Hamiltonian $H_{ij}$ to guarantee a finite UV limit. Furthermore, it also makes transparent the renormalisation scheme, which is fully specified in step ${\bf 1)}$. For future convenience we define the operator $K$ that arises in this $\epsilon\rightarrow 0$ limit \begin{equation} H_\text{eff}= H_0+V + K \, . \label{knot} \end{equation} \end{enumerate} The particular construction just outlined can be generalised by using alternative local regulators or Effective Hamiltonians, and can also be applied to different Hamiltonian Truncation approaches such as massive Fock-space approaches \cite{Rychkov:2014eea,Elias-Miro:2017xxf} or lightcone conformal truncation \cite{Anand:2020gnn}. Previously, Refs.~\cite{Hogervorst:2014rta,Giokas:2011ix,Rychkov:2014eea,Rychkov:2015vap,Elias-Miro:2015bqk,Elias-Miro:2017xxf,Elias-Miro:2017tup,Cohen:2021erm} used Effective Hamiltonians to improve the convergence of the Hamiltonian Truncation spectrum as a function of the truncation cutoff. Most of these works studied the $\phi^4$-theory in $d<3$ spacetime dimensions, which is an ultraviolet finite theory.~\footnote{The only exception is Ref.~\cite{Giokas:2011ix}, which studied RG flows of theories with UV divergencies using an Effective Hamiltonian. However, because of the value of the scaling dimension studied there, a second order Hamiltonian Truncation counterterm is enough to render the theory finite~\cite{EliasMiro:2021aof}. } Effective Hamiltonians are also helpful to organise the Hamiltonian Truncation computations for perturbations that are UV divergent. In particular in the next section we show how to carry out Hamiltonian Truncation renormalisation at Leading Order (LO) and Next-to-leading order (NLO). We will also show in detail how the non-local UV divergences found in Ref.~\cite{EliasMiro:2021aof} are treated in this approach. \section{Determining the Effective Hamiltonian} \label{tcsaex} \subsection{Leading Order} \label{sec:secondo} We begin with a calculation of an effective Hamiltonian at second order in perturbation theory. For simplicity, we choose our effective Hamiltonian to be the hermitian conjugate of the CFHL Hamiltonian, shown in \reef{heff2}. This $H_\text{eff 2}$ can be recast into the following integral over half the cylinder \begin{align} \left(H_\text{eff 2}\right)_{fi} &=-g^2S_{d-1}\int_{-\infty}^{0}d\tau\sum_{h\in{\cal H}_h} e^{\tau\left(\Delta_h-\Delta_i\right)}\int_{S_{d-1}} d^{d-1}x\matrixel{f}{\phi_\Delta(0,\vec{n})}{h}\matrixel{h}{\phi_\Delta(0,\vec{x})}{i}\, ,\label{eq:h2cyl} \end{align} where the notation $\phi_\Delta(0,\vec{n})$ indicates that the operator acts at zero cylinder time but at an arbitrary spatial coordinate in $S_{d-1}$. Since the sum is only over states in ${\cal H}_h$ above the HT cutoff, the quantity $\Delta_h-\Delta_i$ is always positive and the integral converges in the region $\tau\rightarrow-\infty$. By using the time evolution equation $\phi_\Delta(\tau,\vec{x})=e^{\tau H_0}\phi_\Delta(0,\vec{x})e^{-\tau H_0}$, and by Weyl transforming the integral from the cylinder $\mathds{R}\times S_{d-1}$ to the plane $\mathds{R}^d$, Eq.~\reef{eq:h2cyl} can be rewritten as \begin{align} \left(H_\text{eff 2}\right)_{fi}=-g^2S_{d-1}\int\limits_{\substack{0\leqslant|x|<1}}d^dx|x|^{\Delta-d}\bra{f}{\phi_\Delta(1)\myline\phi_\Delta(x)}\ket{i}\,,\label{h2pl} \end{align} where the vertical dashed line indicates the insertion of a partial resolution of the identity \begin{equation} \myline\ \equiv \sum_{h\in\mathcal{H}_h}\ket{h}\bra{h} \, ,\label{dash} \end{equation} which depends on $\Delta_T$ through the definition of $\mathcal{H}_h$. To evaluate the matrix element in \reef{h2pl}, we first calculate it ignoring the partial insertion of the identity, then expand the result in powers of $|x|$, and then only retain terms in which the power of $|x|$ exceeds the state dependent threshold ${\Delta_T^\prime}\equiv\D-\Delta_i-\Delta$. The expansion is just the Weyl transformation of the expansion in powers of $e^\tau$ shown in \reef{eq:h2cyl}. The expansion converges for $0<|x|<1$ when the matrix element, given by the correlation function below \begin{equation} \matrixel{f}{\phi_\Delta(1)\phi_\Delta(x)}{i} \equiv\langle\calO_f(\infty)\phi_\Delta(1)\phi_\Delta(x)\calO_i(0)\rangle\,,\label{eq:4ptcor} \end{equation} is finite. Here, we have used the notation $\calO(\infty)\equiv\lim_{s\rightarrow\infty}|s|^{2\Delta_{\calO}}\calO(s)$. This procedure for calculating correlation functions containing partial resolutions of the identity has been used in Ref.~\cite{Elias-Miro:2015bqk}, see also the review \cite{Konik-review}. Within the region $|1-x|<1$, the correlation function in \reef{eq:4ptcor} can be decomposed using \begin{align} \langle\calO_f(\infty)\phi_\Delta(1)\phi_\Delta(x)\calO_i(0)\rangle = \sum_{\calO}\langle\calO_f(\infty)\calO(1)\calO_i(0)\rangle\,\langle\calO(\infty)\phi_\Delta(1)\phi_\Delta(x)\rangle\,,\label{eq:decomp4pt} \end{align} where the sum runs over all scalar operators (primaries and descendants) in the CFT. This formula can also be obtained using the operator product expansion (OPE) for $\phi_\Delta(x)\phi_\Delta(1)$ inside the correlator. In appendix~\ref{app:ope}, the notation and derivation of \reef{eq:decomp4pt} is explained in greater detail along with generalisations of this formula which are useful for calculating effective Hamiltonians at higher orders in perturbation theory. The integral in \reef{h2pl} will be convergent in the region $x\rightarrow 0$ since \reef{eq:h2cyl} converges in the region $\tau\rightarrow-\infty$, due to the partial resolution of the identity. However, \reef{h2pl} may diverge in the region where $x\rightarrow 1$, if the three--point functions in the decomposition \reef{eq:decomp4pt} have a singularity there that is not integrable. This can be interpreted as an ultraviolet divergence in the underlying QFT to be regulated. In this case, we define the regulated effective Hamiltonian \begin{align} \left(H_\text{eff 2}(\epsilon)\right)_{fi}=-g^2S_{d-1}\int\limits_{\substack{0\leqslant|x|<1\\|1-x|>\epsilon}}d^dx|x|^{\Delta-d}\bra{f}{\phi_\Delta(1)\myline\phi_\Delta(x)}\ket{i}\,,\label{h2plreg} \end{align} where an $\epsilon$--ball has been cut out from the domain of integration at the site of the singularity, which acts as an ultraviolet regulator making the integral finite. We now split the integral in \reef{h2plreg} into two integrals over complementary regions, and use \reef{eq:decomp4pt} to decompose the matrix element in the region where $|1-x|<1$, as shown below \begin{multline} \left(H_\text{eff 2}(\epsilon)\right)_{fi}=-g^2S_{d-1}\sum_{\calO}\matrixel{f}{\calO(1)}{i}\int\limits_{\substack{0\leqslant|x|<1\\1>|1-x|>\epsilon}}d^dx|x|^{\Delta-d}\langle\calO(\infty)\phi_\Delta(1)\myline{}^i\phi_\Delta(x)\rangle\\-g^2S_{d-1}\int\limits_{\substack{0\leqslant|x|<1\\|1-x|\ge1}}d^dx|x|^{\Delta-d}\bra{f}{\phi_\Delta(1)\myline\phi_\Delta(x)}\ket{i}\,.\label{h2pl2reg} \end{multline} Since all the dependence on $x$ in each term of the sum over operators \reef{eq:decomp4pt} is contained within one of the three--point functions, the integral over $x$ and partial resolution of the identity should only be applied to those three--point functions, as indicated above. We have represented this partial resolution using the new symbol \begin{align} \myline{}^i\equiv\sum_{\Delta_h>\D-\Delta_i}\ket{h}\bra{h}\,,\label{idi} \end{align} to emphasise that the restriction on which states are included in the sum retains dependence on the state $\ket{i}$, which it inherits from \reef{h2plreg}. See also Fig.~\ref{iregions} for an illustration of the regions of integrations. \begin{figure}[t]\centering \includegraphics[width=10cm]{diagregs.pdf} \caption{Regions of integration in \reef{h2pl2reg}.} \label{iregions} \end{figure} The second integral in \reef{h2pl2reg} over the region $|1-x|>1$ is finite and has no dependence on the UV regulator scale $\epsilon$. It must therefore have a finite limit as $\D\rightarrow\infty$. Although it contains $\D$ dependent terms, it will not play a role in the renormalisation of UV divergences of $H_\text{eff}$. By contrast, the first term diverges in the $\epsilon\rightarrow0$ limit and requires renormalisation. For the rest of this section our focus will be on the first term. In the sum over operators, in the first term of \reef{h2pl2reg}, the most divergent terms in the limit $\epsilon\rightarrow0$ will be terms in which $\calO(\infty)$ is a scalar primary. For simplicity from here on we assume that in the sum \reef{h2pl2reg} only primary operators ${\cal O}$ give divergent contributions, but the derivation can be generalised to include divergent contributions from non-primary operators. In this case, the three--point function is constrained by conformal invariance to take the following series expansion \begin{align} \langle\calO(\infty)\phi_\Delta(1)\phi_\Delta(x)\rangle = \frac{f_{\calO\Delta\Delta}}{|1-x|^{2\Delta-\Delta_{\calO}}}=f_{\calO\Delta\Delta}\sum_{n=0}^\infty|x|^n\,C_n^{\Delta-\Delta_{\calO}/2}(\cos\theta)\,,\label{eq:3ptfunction} \end{align} where the $C^\alpha_n(\cos\theta)$ denote Gegenbauer polynomials. After accounting for the partial resolution of the identity by using the series expansion in $|x|$ and dropping terms with low powers we find that \begin{multline} \left(H_\text{eff 2}(\epsilon)\right)_{fi}=-g^2S_{d-1}\sum_{\calO}\matrixel{f}{\calO(1)}{i}f_{\calO\Delta\Delta}\int\limits_{\substack{0\leqslant|x|<1\\|1-x|>\epsilon}}d^dx|x|^{\Delta-d}\sum\limits^\infty_{n>{\Delta_T^\prime}}|x|^nC_n^{\Delta-\Delta_{\calO}/2}(\cos\theta)\\ + \text{finite as }\epsilon\rightarrow0\,,\label{eq:heff2sumint} \end{multline} where the domain of integration has been extended to include the region $|1-x|>1$, which only introduces an $\epsilon$ independent correction and ${\Delta_T^\prime}\equiv\D-\Delta_i-\Delta$. Using the fact that the integrals over Gegenbauer polynomials vanish for odd $n$, and by introducing the notation \begin{align} u_n^{\alpha,\,\epsilon}\equiv2(2n+\Delta)\int\limits_{\substack{0\leqslant|x|<1\\|1-x|>\epsilon}}d^dx|x|^{2n+\Delta-d}C_{2n}^{\alpha}(\cos\theta)\,,\label{eq:uneps} \end{align} we simplify \reef{eq:heff2sumint} to read \begin{align} \left(H_\text{eff 2}(\epsilon)\right)_{fi}=-\frac{g^2S_{d-1}}{2}\sum_{\calO}\matrixel{f}{\calO(1)}{i}f_{\calO\Delta\Delta}\sum^\infty_{2n>{\Delta_T^\prime}}\frac{u_n^{\Delta-\Delta_\calO/2,\,\epsilon}}{2n+\Delta}+\text{finite}\dots \label{lstep} \end{align} The sum over primaries is finite for nonzero $\epsilon$, but can become divergent in the $\epsilon\rightarrow0$ limit if $2\Delta-\Delta_{\calO}\geqslant d$. After having completed this preliminary calculation we are ready to apply steps {\bf 1)} - {\bf 3)} described in the previous section. We first renormalise the theory by adding \emph{local} counterterms to the Hamiltonian as necessary, so that $H_\text{eff}$ is finite in the $\epsilon\rightarrow0$ limit \begin{align} H_0+V \, \longrightarrow \, H_0+V+\sum\limits_{\substack{2\Delta-\Delta_{\calO}\geqslant d}}\lambda^\calO\int_{S_{d-1}}d^{d-1}x\,\calO(x)\,,\label{eq:localct} \end{align} where the couplings can be divided into a renormalised part plus a counterterm coupling $\lambda^\calO=\lambda^\calO_\text{ren}+\lambda^\calO_\text{ct}(\epsilon)$. A convenient choice of renormalisation scheme is to define the counterterm coupling in the following way \begin{align} \lambda^\calO_\text{ct}(\epsilon)&=g^2\int\limits_{\substack{0\leqslant|x|<1\\1>|1-x|>\epsilon}}d^dx|x|^{\Delta-d}\langle\calO(\infty)\phi_\Delta(1)\phi_\Delta(x)\rangle\,,\label{cterm2}\\ & = \frac{g^2f_{\calO\Delta\Delta}}{2}\sum^\infty_{n=0}\frac{u_n^{\Delta-\Delta_\calO/2,\,\epsilon}}{2n+\Delta}\,. \end{align} With this choice, the $\epsilon\rightarrow0$ limit becomes well defined at leading order, i.e. $O(g^2)$. This completes the step {\bf 1)} at leading order. Next we truncate the Hamiltonian (step {\bf 2)}) and, following step {\bf 3)}, we compute the leading order Effective Hamiltonian for the renormalised theory in the right hand side of \reef{eq:localct}, and take the $\epsilon\rightarrow 0$ limit. We proceed by following similar steps as the ones done to derive \reef{lstep} and we find that the renormalised $H_\text{eff 2}$ in this limit is given by \begin{multline} \left(H_\text{eff 2}\right)_{fi} = S_{d-1}\sum\limits_{\substack{2\Delta-\Delta_{\calO}-d>0}}\lambda^\calO_\text{ren}\matrixel{f}{\calO(1)}{i}\\+\frac{g^2S_{d-1}}{2}\sum\limits_{\substack{2\Delta-\Delta_{\calO}-d\ge0}}\matrixel{f}{\calO(1)}{i}f_{\calO\Delta\Delta}\sum^{2n\leqslant{\Delta_T^\prime}}_{n=0}\frac{u_n^{\Delta-\Delta_\calO/2}}{2n+\Delta}+\dots\label{eq:h2ren} \end{multline} In this expression, the sums over $n$ diverge in the $\D\rightarrow\infty$ limit. The $\dots$ represent other omitted terms that are finite in this limit. According to the notation introduced in \reef{knot}, we identify last term above with \begin{equation} K_2= S_{d-1} \sum\limits_{\substack{2\Delta-\Delta_{\calO}-d\ge0}} \matrixel{f}{\calO(1)}{i} \left( \lambda^\calO_\text{ren}+\frac{g^2 f_{\calO\Delta\Delta}}{2}\sum^{2n\leqslant{\Delta_T^\prime}}_{n=0}\frac{u_n^{\Delta-\Delta_\calO/2}}{2n+\Delta} \right)+\cdots \end{equation} Although the counterterm we introduced in \reef{eq:localct} was manifestly local, the renormalised effective Hamiltonian we are left with in \reef{eq:h2ren} has non-local interactions. The non-locality appears through the dependence of the sum over $n$ on $\Delta_i$ -- the scaling dimension of the specific initial state $\ket{i}$. Finally, we note that the $u_n^{\Delta,\,\epsilon}$ coefficients have a convenient expression in the $\epsilon\rightarrow0$ limit that can be derived from \reef{eq:uneps} \begin{align} u_n^\Delta\equiv\lim_{\epsilon\rightarrow 0}u_n^{\Delta,\,\epsilon} &= 2S_{d-2}\int_{0}^{\pi}d\theta\,(\sin\theta)^{d-2}\,C^\Delta_{2n}(\cos\theta)\,, \\ &=2S_{d-2} \sqrt{\pi }\, \Gamma \left(\tfrac{d-1}{2}\right) \frac{\Gamma (n+\Delta )}{\Gamma (\Delta )n!} \, \frac{\Gamma\left(n+\Delta-\frac{d-2}{2}\right)}{\Gamma \left(\Delta-\frac{d-2}{2} \right)\Gamma \left(n+\frac{d}{2}\right) } \, .\label{eq:un} \end{align} \subsection{Next-to-Leading Order} \label{sec:thirdo} We now turn to determining the dependence of $H_{\text{eff}\,3}$ on the cutoff $\D$. We do this by representing the effective Hamiltonian as a sum of position space integrals over CFT correlation functions and analysing those integrals' UV divergences. We take $H_{\text{eff}\,3}$ to be the hermitian conjugate of the third-order CFHL Hamiltonian shown in \reef{heff3}. Using the definition of $V$ in terms of a CFT operator in (\ref{tcsafirst},\ref{Hraw}), we rewrite $H_{\text{eff}\,3}$ as \begin{multline} \left(H_{\text{eff}\,3}\right)_{fi}=g^3S_{d-1}\prod_{i=1}^{2}\int_Td\tau_i\int_{S_{d-1}}d^{d-1}x_i\Bigg[\sum_{h,\,h^\prime\in\mathcal{H}_h}e^{\tau_2\Delta_{h^\prime h}}\,e^{\tau_1\Delta_{hi}}\matrixel{f}{\phi_{0,\vec{n}}}{h^\prime}\matrixel{h^\prime}{\phi_{0,\vec{x_2}}}{h}\matrixel{h}{\phi_{0,\vec{x_1}}}{i}\\ - \sum_{l\in\mathcal{H}_l,\,h\in\mathcal{H}_h}e^{\tau_2\Delta_{li}}\,e^{\tau_1\Delta_{hl}}\matrixel{f}{\phi_{0,\vec{n}}}{h}\matrixel{h}{\phi_{0,\vec{x_1}}}{l}\matrixel{l}{\phi_{0,\vec{x_2}}}{i}\Bigg]\,,\label{h3cyl} \end{multline} where $T$ indicates the time ordered domain of integration $-\infty<\tau_1\leqslant\tau_2\le0$. We represent differences in scaling dimension using $\Delta_{ij}\equiv\Delta_i-\Delta_j$, and we introduce the more compact notation $\phi_{0,\vec{x}}\equiv\phi_\Delta(0,\vec{x})$. Removing the exponential factors using the Heisenberg equation for the operators $\phi_\Delta(\tau,\vec{x})=e^{\tau H}\phi_\Delta(0,\vec{x})e^{-\tau H}$, and converting the integral from the cylinder to the plane yields the expression \begin{multline} \left(H_{\text{eff}\,3}\right)_{fi}=g^3S_{d-1}\int_R\prod_{i=1}^2d^dx_i|x_i|^{\Delta-d}\Big[\bra{f}\phi_\Delta(1)\myline\phi_\Delta(x_2)\myline\phi_\Delta(x_1)\ket{i}\\-\sum_{l\in\mathcal{H}_l}\bra{f}\phi_\Delta(1)\myline\phi_\Delta(x_1)\ket{l}\matrixel{l}{\phi_\Delta(x_2)}{i}\Big]\,.\label{h3plane} \end{multline} Here, $R$ indicates the radially ordered integration domain $0<|x_1|\leqslant|x_2|\le1$ and the dashed vertical lines indicate the sum over high energy states shown in \reef{dash}. The integrals above have no divergences from the $|x_i|\rightarrow0$ regions (which correspond to infrared divergences from the $\tau_i\rightarrow -\infty$ regions on the cylinder) because low energy states have been excluded from the sums. The integrals in \reef{h3plane} can have UV divergences, coming from the regions $x_i\rightarrow1$ and $x_1\rightarrow x_2$. As in section~\ref{sec:secondo}, we regulate them by cutting out $\epsilon$-balls from the integration domain around these singular points. Furthermore, the local counterterms that we added to the theory at second order make an extra $\epsilon$ dependent contribution to $H_{\text{eff}}$ that is $O(g^3)$. Accounting for the local regulator dependence leads to the following expression \begin{multline} \left(H_{\text{eff}\,3}(\epsilon)\right)_{fi}=g^3S_{d-1}\int\limits_{\substack{R,\;|1-x_i|>\epsilon,\\|x_2-x_1|>\epsilon|x_2|}}\prod_{i=1}^2d^dx_i|x_i|^{\Delta-d}\Big[\bra{f}\phi_\Delta(1)\myline\phi_\Delta(x_2)\myline\phi_\Delta(x_1)\ket{i}\\-\sum_{l\in\mathcal{H}_l}\bra{f}\phi_\Delta(1)\myline\phi_\Delta(x_1)\ket{l}\matrixel{l}{\phi_\Delta(x_2)}{i}\Big]\\ -gS_{d-1}\sum_{\Delta_{\calO}<2\Delta-d}\lambda^\calO_\text{ct}(\epsilon)\int\limits_{\substack{0<|x|\le1,\\|1-x|>\epsilon}} d^dx|x|^{\Delta-d}\Big[\bra{f}\calO(1)\myline\phi_\Delta(x)\ket{i}+|x|^{\Delta_{\calO}-\Delta}\bra{f}\phi_\Delta(1)\myline\calO(x)\ket{i}\Big]\,,\label{h3planeeps} \end{multline} where $\lambda^\calO_\text{ct}(\epsilon)$ are the counterterms introduced in \reef{cterm2}. To preserve $\tau$ translation invariance on the cylinder, the sizes of regions cut out must be independent of the $\tau$ coordinate. After mapping to the plane, the $\epsilon$-ball widths then have to scale proportional to the radial coordinate. For this reason, the $\epsilon$-ball regulating the $x_1\rightarrow x_2$ singularity has a width that depends on the spatial coordinates like $|x_2-x_1|>\epsilon|x_2|$ (recall $d s^2_{\mathds{R}^d}= r^2 d s^2_\text{cyl}$). As a result of cancellations between the first term and subtracted terms in \reef{h3planeeps}, the only divergence as $\epsilon\rightarrow0$ comes from the region of the first integral where all three fields are approaching each other (both $x_1\rightarrow1$ and $x_2\rightarrow1$ together). For example, the subdivergence coming from the region of the first integral where $x_2\rightarrow1$ with $x_1$ far away is canceled by the first term proportional to $\lambda^\calO_\text{ct}(\epsilon)$. This can be seen after inputting the expression \reef{cterm2}. Since the only parts of the expression \reef{h3planeeps} which can potentially diverge in the limit $\D\rightarrow\infty$ are also the parts that diverge in the $\epsilon\rightarrow0$ limit, we focus our attention on the region of the integrals where the points are configured as indicated in Fig.~\ref{fig:regh3} (the region where the two circles intersect). In this region, we can simplify matrix elements using \begin{align} \matrixel{f}{\phi_\Delta(1)\phi_\Delta(x_2)\phi_\Delta(x_1)}{i} = \sum_{\calO}\matrixel{f}{\calO(1)}{i}\langle\calO(\infty)\phi_\Delta(1)\phi_\Delta(x_2)\phi_\Delta(x_1)\rangle\,,\label{factor} \end{align} which can be regarded as a generalisation of the OPE to the case where three fields (rather than two) are approaching one another. More details are provided in Appendix~\ref{app:ope}. \begin{figure}\centering \includegraphics[width=11cm]{h3regs.pdf} \caption{The region where points are radially ordered so that $0<|x_1|\leqslant|x_2|\leqslant 1$ and satisfy $|1-x_i|\le1$. In this region, \reef{factor} may be used to simplify matrix elements.\label{fig:regh3} } \end{figure} The term in \reef{factor} which gives the strongest singularity when the three $\phi_\Delta$ fields come together is the term with $\calO=\mathds{1}$. It therefore makes the contribution to $H_\text{eff 3}$ that is most UV divergent. For simplicity, we will only explicitly work out this contribution. We find that \begin{multline} \left(H_{\text{eff}\,3}(\epsilon)\right)_{fi}\supset g^3S_{d-1}\delta_{fi}\int\limits_{\substack{R,\;|1-x_i|>\epsilon,\\|x_2-x_1|>\epsilon|x_2|}}\prod_{i=1}^2d^dx_i|x_i|^{\Delta-d}\Big[\langle\phi_\Delta(1)\myline{}^i\phi_\Delta(x_2)\myline{}^i\phi_\Delta(x_1)\rangle\\-\sum_{\Delta_l\leqslant\D-\Delta_i}\bra{0}\phi_\Delta(1)\myline{}^i\phi_\Delta(x_1)\ket{l}\bra{l}\phi_\Delta(x_2)\ket{0}\Big]\,,\label{h3id} \end{multline} where the symbol $\myline{}^i$ represents the insertion of a partial resolution of the identity, where the cutoff between high and low energy states depends on the scaling dimension of state $i$, as in \reef{idi}. Similarly, the cutoff on the sum over low energy states in \reef{h3id} retains dependence on $\Delta_i$. There are interesting QFTs, including $\phi^4$ theory in $d=2+1$ and minimal models deformed by the $\phi_{1,3}$ operator in $d=1+1$, for which \reef{h3id} is the only contribution to $H_\text{eff 3}$ that diverges in the $\epsilon\rightarrow0$ limit. To evaluate the top line of \reef{h3id}, we take the three point function and express it as a series expansion in powers of $|x_2|$ and $|x_1|/|x_2|$ using \begin{align} \langle\phi_\Delta(1)\phi_\Delta(x_2)\phi_\Delta(x_1)\rangle&=\frac{f_{\Delta\Delta\Delta}}{|1-x_2|^\Delta|x_2-x_1|^\Delta|1-x_1|^\Delta}\,,\\ &=\frac{f_{\Delta\Delta\Delta}}{|x_2|^\Delta|x_1|^\Delta}\sum\limits_{n_1,n_2,n_3=0}^{\infty}|x_2|^{n_1+n_2+\Delta}\left(\frac{|x_1|}{|x_2|}\right)^{n_1+n_3+\Delta}\nonumber\\&\qquad\qquad\qquad\quad\;\;\times C^{\Delta/2}_{n_1}(\cos\theta_1)C^{\Delta/2}_{n_2}(\cos\theta_2)C^{\Delta/2}_{n_3}(\cos\gamma)\,,\label{3ptseries} \end{align} where $\gamma$ represents the angle between points $x_1$ and $x_2$. On the cylinder, this corresponds to writing the three point function as a series expansion in $e^{\tau_2}$ and $e^{\tau_1-\tau_2}$. In \reef{h3cyl}, we see that in each term of the expansion, $e^{\tau_2}$ and $e^{\tau_1-\tau_2}$ are raised to the power $\Delta_h-\Delta_i$ for some $\Delta_h>\D$. By comparing \reef{3ptseries} with \reef{h3cyl}, we find that only terms satisfying the condition below should be included when evaluating the first line of $H_\text{eff 3}(\epsilon)$ \begin{align*} n_1+n_2&>\D-\Delta-\Delta_i\equiv{\Delta_T^\prime}\,,\\ n_1+n_3&>{\Delta_T^\prime}\,. \end{align*} To evaluate the second line of \reef{h3id}, we instead expand the three point function in powers of $|x_1|$ and $|x_2|/|x_1|$. This is because on the cylinder in \reef{h3cyl}, the second line may be expressed as a series expansion in $e^{\tau_1}$ and $e^{\tau_2-\tau_1}$. In each term, these exponentials are raised to the powers $\Delta_h-\Delta_i$ and $\Delta_l-\Delta_i$. The series expansion that we need for the three point function is also given by \reef{3ptseries}, except with $|x_1|$ swapped with $|x_2|$. We find that only terms satisfying the condition below should be included when evaluating the second line of $H_\text{eff 3}(\epsilon)$ \begin{align*} n_1+n_2&>{\Delta_T^\prime}\,,\\ n_1+n_3&\leqslant{\Delta_T^\prime}\,. \end{align*} When plugging the series expansions for the three point function into \reef{h3id}, we encounter integrals of the form below, which we represent using the function $X^\epsilon_{n_1,n_2,n_3}$ \begin{align} \frac{X^\epsilon_{n_1,n_2,n_3}}{\left(n_1+n_2+\Delta\right)\left(n_1+n_3+\Delta\right)}\equiv&\int\limits_{\substack{R,\;|1-x_i|>\epsilon,\\|x_2-x_1|>\epsilon|x_2|}}\prod_{i=1}^2\frac{d^dx_i}{|x_i|^d}\,\,|x_2|^{n_1+n_2+\Delta}\left(\frac{|x_1|}{|x_2|}\right)^{n_1+n_3+\Delta}\nonumber\\&\qquad\qquad\times C^{\Delta/2}_{n_1}(\cos\theta_1)C^{\Delta/2}_{n_2}(\cos\theta_2)C^{\Delta/2}_{n_3}(\cos\gamma)\,.\label{xfn} \end{align} In the $\epsilon\rightarrow0$ limit, the expression above is finite, and can be simplified further \begin{align} X_{n_1,n_2,n_3}\equiv\lim\limits_{\epsilon\rightarrow 0}X^\epsilon_{n_1,n_2,n_3}=\int_{S_{d-1}}\prod_{i=1}^2d^{d-1}x_i\;C^{\Delta/2}_{n_1}(\cos\theta_1)C^{\Delta/2}_{n_2}(\cos\theta_2)C^{\Delta/2}_{n_3}(\cos\gamma)\,.\label{xlim} \end{align} In appendix~\ref{sec:formulae}, we evaluate the integrals above to derive an alternative expression for $X_{n_1,n_2,n_3}$, which can be evaluated numerically more easily. We show that this function is symmetric in all its $n_i$ indices, and vanishes unless the $n_i$ are all even, or all odd. After combining \reef{h3id} with \reef{3ptseries} and \reef{xfn}, and truncating to retain only the terms we need, we are left with the following expression \begin{multline} \left(H_{\text{eff}\,3}(\epsilon)\right)_{fi}\supset g^3S_{d-1}\delta_{fi}f_{\Delta\Delta\Delta}\sum\limits^\infty_{\substack{n_1+n_2>{\Delta_T^\prime}\\n_1+n_3>{\Delta_T^\prime}}}\frac{X^\epsilon_{n_1,n_2,n_3}}{\left(n_1+n_2+\Delta\right)\left(n_1+n_3+\Delta\right)} \\ -g^3S_{d-1}\delta_{fi}f_{\Delta\Delta\Delta}\sum\limits^{n_1+n_3\leqslant{\Delta_T^\prime}}_{\substack{n_1+n_2>{\Delta_T^\prime}}}\frac{X^\epsilon_{n_1,n_2,n_3}}{\left(n_1+n_2+\Delta\right)\left(n_2-n_3\right)}\,.\label{h3x} \end{multline} Although the $X^\epsilon_{n_1,n_2,n_3}$ are each finite in the limit $\epsilon\rightarrow0$, the infinite sums in \reef{h3x} diverge when $3\Delta\ge2d$. In this case, we renormalise the theory by adding a local counterterm proportional to the identity operator \begin{equation} H_0+V\longrightarrow H_0+V+\lambda^{\mathds{1}}\int_{S_{d-1}}d^{d-1}x\;\mathds{1}\,. \end{equation} It is convenient to pick a scheme in which the counterterm is just the full integrated three point function \begin{align} \lambda^\mathds{1}_\text{ct}(\epsilon) & = -g^3\int\limits_{\substack{R,\;|1-x_i|>\epsilon,\\|x_2-x_1|>\epsilon|x_2|}}\prod_{i=1}^2d^dx_i|x_i|^{\Delta-d}\langle\phi_\Delta(1)\phi_\Delta(x_2)\phi_\Delta(x_1)\rangle\,,\\ &=-g^3f_{\Delta\Delta\Delta}\sum\limits^\infty_{n_1,n_2,n_3=0}\frac{X^\epsilon_{n_1,n_2,n_3}}{\left(n_1+n_2+\Delta\right)\left(n_1+n_3+\Delta\right)}\,.\label{ct3sum} \end{align} The matrix $K$ defined in \reef{knot} is the effective hamiltonian with counterterms subtracted in the $\epsilon\rightarrow0$ limit. Its contribution from \reef{h3x} and \reef{ct3sum} is given by \begin{multline} \left(K_3\right)_{fi}=-g^3S_{d-1}\delta_{fi}f_{\Delta\Delta\Delta}\sum\limits^{\substack{n_1+n_2\leqslant{\Delta_T^\prime}\\n_1+n_3\leqslant{\Delta_T^\prime}}}_{n_1,n_2,n_3=0}\frac{X_{n_1,n_2,n_3}}{\left(n_1+n_2+\Delta\right)\left(n_1+n_3+\Delta\right)}\\ -g^3S_{d-1}\delta_{fi}f_{\Delta\Delta\Delta}\sum\limits^{n_1+n_3\leqslant{\Delta_T^\prime}}_{\substack{n_1+n_2>{\Delta_T^\prime}}}\Bigg[\frac{X_{n_1,n_2,n_3}}{\left(n_1+n_2+\Delta\right)\left(n_2-n_3\right)}+\frac{2X_{n_1,n_2,n_3}}{\left(n_1+n_2+\Delta\right)\left(n_1+n_3+\Delta\right)}\Bigg]\,.\label{K3} \end{multline} In the first line, the sums only run over contributions from exchanged states with low scaling dimension. The second line includes mixed sums, which account for contributions from states exchanged with scaling dimensions both below and above ${\Delta_T^\prime}$. For any fixed value of the cutoff, the elements of $K_3$ will all be finite, however in the $\D\rightarrow\infty$ limit they can diverge. When $3\Delta-2d\ge0$ a contribution to $K_2$ that we ignored in Section~\ref{sec:secondo} can become important. The contribution itself vanishes in the $\D\rightarrow\infty$ limit, however it makes a correction to energy eigenvalues at third order through \begin{align} \delta \calE_i \,R = \sum_{l\in\mathcal{H}_l}\left(\frac{V_{il}(\delta K_2)_{li}}{\Delta_{il}}+\frac{(\delta K_2)_{il}V_{li}}{\Delta_{il}}\right)\,,\label{deltaKcorr} \end{align} which actually is divergent. To get a finite spectrum, this contribution must be included. It comes from taking $\calO=\phi_\Delta$ in \reef{lstep}, and is given by \begin{equation} (\delta K_2)_{fi} = -\frac{g^2S_{d-1}}{2}\matrixel{f}{\phi_\Delta(1)}{i}f_{\Delta\Delta\Delta}\sum^\infty_{2n>{\Delta_T^\prime}}\frac{u_n^{\Delta/2}}{2n+\Delta}\,. \end{equation} The shift in energy eigenvalues induced by the above through \reef{deltaKcorr} cancels the shift coming from the second line of $K_3$ in \reef{K3} in the $\D\rightarrow\infty$ limit. \section{Locality of the Effective Hamiltonian $H_\text{eff}$} \label{sec:cutoffdep} The Effective Hamiltonian $H_\text{eff}$ has two features which make it appear non-local. Firstly, it contains interactions which cannot be expressed as integrated local operator densities such as \reef{eq:h2ren}, and secondly, it acts on a truncated Hilbert space that is spanned by states with total energy less than $\D/R$. This is a non-local modification of the QFT, since the maximum energy of excitations in one region of space now depends on the energy carried by fields in distant regions of space. However, $H_\text{eff}$ is constructed so that its spectrum matches the local QFT, so these non-local effects cancel one another when calculating observables. In this section, we perform a check for consistency between $H_\text{eff}$ and the locally regulated QFT. Specifically, we check the fourth order perturbative correction to the ground state energy, which in Rayleigh--Schr{\"o}dinger perturbation theory is given by \begin{align} \calE_0^{(4)}R=-\frac{V_{0k}V_{kk^\prime}V_{k^\prime k^{\prime\prime}}V_{k^{\prime\prime}0}}{\Delta_k\Delta_{k^\prime}\Delta_{k^{\prime\prime}}}+\frac{V_{0k}V_{k0}}{\Delta_k}\cdot\frac{V_{0k^\prime}V_{k^\prime0}}{\Delta^2_{k^\prime}}\,, \label{eq:e4} \end{align} where the sums run over CFT states $k,\,k^\prime,\,k^{\prime\prime}\neq0$ and we have used $V_{00}=0$. In raw TCSA, these sums should all be cut off so that $\Delta_k\leqslant\D$. We now demonstrate that $\calE_0^{(4)}$ is UV finite in $H_\text{eff}$, when it is also finite in the local theory. We focus on the fourth order, as it is the lowest order in perturbation theory for which there is a subtraction term, and cancellations between the leading and subtraction terms may be spoilt by the UV regulator. This quantity was found to diverge in the limit $\D\rightarrow\infty$ in raw TCSA~\cite{EliasMiro:2021aof}, even when the corresponding quantity in the locally regulated theory was finite. Indeed, for large $\D$, conformal symmetry constrains \reef{eq:e4} to grow as \cite{EliasMiro:2021aof} \begin{align} \calE_0^{(4)}\sim-\frac{g^4S^2_{d-1}}{4R}\left\{\sum_{n_1,\,n_2=0}^{2n_1+2n_2+2\Delta\leqslant\D}-\sum_{n_1,\,n_2=0}^{\substack{2n_1+\Delta\leqslant\D \\ 2n_2+\Delta\leqslant\D}}\right\}\frac{u_{n_1}^\Delta}{(2n_1+\Delta)^2}\cdot\frac{u^\Delta_{n_2}}{2n_2+\Delta}\,, \label{eq:sumdiff} \end{align} where the $u^\Delta_n$ are given by \reef{eq:un}. This difference between sums diverges in the limit $\D\rightarrow\infty$ for $\Delta\geqslant d/2+1/4$. When using a local regulator, it is more convenient to use the conformal perturbation theory expression for the coefficient \begin{equation} \calE_0^{(4)}= -\frac{g^4S_{d-1}}{4!R} \int \prod_{i=1}^3 d^dx_i \left|x_i\right|^{\Delta-d} \langle \phi_{x_1} \phi_{x_2}\phi_{x_3}\phi_{1}\rangle_c \, . \label{c4} \end{equation} This expression is finite (in the limit that the local regulator is removed) provided that $\Delta<3d/4$, in contrast with raw TCSA. So far though, our analysis has not accounted for any extra contributions to $H_\text{eff}$. To remove divergences in $\D$ at the fourth order in perturbation theory, we should in principle consider contributions to $H_\text{eff}$ up to fourth order in the coupling. Nevertheless, we find that only $H_\text{eff 2}$ provides the contribution to $\calE_0^{(4)}$ needed to restore consistency with the local theory. The expression for $H_\text{eff 2}$ as a sum over operators $\calO$ is provided in \reef{eq:h2ren}. For a deformation with $\Delta$ just above $d/2+1/4$, the term in $H_\text{eff 2}$ with $\calO=\mathds{1}$ must always be retained. Other operators must also be retained if they are sufficiently relevant, but since their presence is model dependent, they cannot cancel the universal divergence appearing in \reef{eq:sumdiff}. We therefore consider the contribution to $\calE_0^{(4)}$ coming from the interaction \begin{align} \left(K_2\right)_{fi}=\frac{g^2S_{d-1}}{2}\delta_{fi}\sum_{n=0}^{2n+\Delta+\Delta_i\leqslant\D}\frac{u_n^\Delta}{2n+\Delta}\,.\label{eq:h2simple} \end{align} Since \reef{eq:h2simple} is a diagonal matrix, the only contribution it can make to $\calE_0^{(4)}$ is given by \begin{align} \delta\calE_0^{(4)}R=\frac{V_{0k}\left(K_2\right)_{kk^\prime}V_{k^\prime 0}}{\Delta_k\Delta_{k^{\prime}}} - \left(K_2\right)_{00}\frac{V_{0k}V_{k0}}{\Delta_k^2}\,.\label{eq:h24} \end{align} The last factor in \reef{eq:h24} is given by \begin{align} \frac{V_{0k}V_{k0}}{\Delta_k^2}=\frac{g^2S_{d-1}}{2}\sum_{n=0}^{2n+\Delta\leqslant\D}\frac{u_n^\Delta}{(2n+\Delta)^2}\, . \end{align} We use this result to rewrite both terms in \reef{eq:h24}, finding that the first term equals minus the first sum in \reef{eq:sumdiff}, and the second term equals minus the second sum in \reef{eq:sumdiff}. We conclude that \reef{eq:h24} and \reef{eq:sumdiff} cancel each other exactly. We have thus explicitly shown that a non-local interaction in $H_\text{eff 2}$ cancels a UV divergence that arises at higher order in perturbation theory, due to the non-local nature of the Hamiltonian Truncation cutoff $\D$. The finiteness of $\calE_0^{(4)}$ for $\Delta<3d/4$ is necessary for consistency with the locally regulated theory. Furthermore, we can see that $H_\text{eff 3}$ or $H_\text{eff 4}$ will not make a contribution to the spectrum that diverges in the $\D\rightarrow\infty$ limit, unless $\Delta\ge2d/3$ so that a local counterterm beyond second order is needed to renormalise the theory. By assumption, the infinite dimensional matrix $H(\epsilon)=\Delta+V(\epsilon)$ incorporates all the local counterterms required for a finite spectrum. If $\Delta<2d/3$, then $H(\epsilon)$ will have no terms that depend on the coupling as $g^3$ or $g^4$. In the large $\D$ limit, it can be seen that $H_\text{eff}$ coincides with $H(\epsilon)$, for instance from \reef{hl2neat}. We therefore expect $H_\text{eff 3}$ and $H_\text{eff 4}$ to vanish in the $\D\rightarrow\infty$ limit. In appendix~\ref{appv6} we show that the finiteness of the spectrum proceeds to $O(V^6)$ as expected, thanks to the addition of the non-local $K_2$. We also comment on the connections of this calculation with previous studies in $\phi^4$ theory. \section{Discussion} \label{sec:disc} In this work, we have described a procedure for applying Hamiltonian Truncation when the QFT under investigation has UV divergences that require renormalisation. Our procedure involves extra steps beyond those required for renormalisation in perturbative QFT with a local regulator, such as dim-reg. This is because Hamiltonian Truncation calculations involve approximating the original QFT with a quantum theory in a finite dimensional Hilbert space, which is a non-local modification of the original theory. We believe this is an important step towards turning Hamiltonian truncation into a universal tool, that can be applied to any renormalisable QFT. To implement renormalisation, we first had to define an Effective Hamiltonian that shared the exact low energy spectrum of the original Hamiltonian but had finite dimensionality. We provided an alternative representation for an effective Hamiltonian, first defined in \cite{Cohen:2021erm} in Section~\ref{sec:heff}, and proved that the spectra of the UV theory and the Effective Hamiltonian match. Our main analysis includes a perturbative calculation of this Effective Hamiltonian, applicable to QFTs defined as an ultraviolet CFT deformed with a relevant operator. By first introducing a local regulator and local counterterms for the QFT, and then defining an effective Hamiltonian for this finite theory that allows the local regulator to be removed analytically, we demonstrated how ultraviolet divergences can be consistently canceled, and how renormalisation can be applied in the context of Hamiltonian Truncation. Our renormalisation procedure makes the choice of scheme transparent, enabling direct comparison between Hamiltonian Truncation calculations and results derived using other methods. It also provides explicit expressions for the non-local interactions that must be included in the renormalised effective Hamiltonian to ensure UV finiteness. As well as presenting a general argument, valid at all orders in perturbation theory for the consistency of our approach, we have also provided direct non-trivial checks using perturbation theory up to $O(V^6)$, showing the cancellation of UV divergences. It is important now to apply this procedure non-perturbatively to numerical Hamiltonian Truncation calculations in QFTs with UV divergences. For example, these methods are well suited to studying conjectured renormalisation group flows between two-dimensional CFTs, e.g.~\cite{Gaiotto:2012np,Fei:2014xta,Klebanov:2022syt}, as well as exploring the rich variety of strongly coupled flows in $d=1+1$ more generally. It will also be very worthwhile to investigate QFTs in higher dimensions, such as $\phi^4$-theory in $d=2+1$ (building on an earlier exploratory study \cite{Elias-Miro:2020qwz} using the massive Fock space approach), and Quantum Electrodynamics in $d=2+1$. \section*{Acknowledgements} We are grateful to Kara Farnsworth, Ami Katz and Markus Luty for interesting discussions. This project has received funding from the European Research Council, grant agreement n.~101039756.
\section{Introduction}\label{sec:intro} The supersymmetric partition functions provides a powerful way of understanding BPS spectra of higher dimensional field theories. Various computational tools for computing the supersymmetric partition functions on $\mathbb{R}^4\times S^1$ for 5d theories or $\mathbb{R}^4\times T^2$ for 6d theories have been developed, in particular, for theories of eight supercharges, for instances, 5d/6d superconformal theories (SCFTs) as well as little string theories (LSTs). These partition functions are the Witten indices on the so-called $\Omega$-deformation $\mathbb{R}^4$ counting the BPS states which are BPS spectrum protected by supersymmetry and also weighted by electric charges and angular momenta. The computation tools include the ADHM constructions of the instanton moduli space \cite{Atiyah:1978ri,Nekrasov:2002qd,Nekrasov:2003rj,Marino:2004cn,Nekrasov:2004vw,Fucito:2004gi,Hwang:2014uwa}. This leads to Nekrasov instanton partition function for 5d $\mathcal{N}=1$ gauge theories in the Omega background. The partition functions count the BPS bound states of instantons on the Coulomb branch of the moduli space. A systematic computation has been developed for gauge theories with the classical gauge groups, but there are some limitations for those theories with hypermultiplets of higher dimensional representations or with higher Chern-Simons theories or with exceptional gauge groups. The ADHM construction is also applicable for 6d SCFTs, computing the elliptic genera of the self-dual strings in 6d SCFTs and LSTs in the tensor branch \cite{Haghighat:2013tka,Haghighat:2013gba,Kim:2014dza, Haghighat:2014vxa,Gadde:2015tra,Kim:2015gha, Kim:2016foj, Kim:2017xan,Haghighat:2017vch,Kim:2018gak, Kim:2018gjo, Haghighat:2018dwe}. The blowup method \cite{Nakajima:2003pg,Nakajima:2005fg, Gottsche:2006bm} is a systematic and very powerful tool for computing the partition function where the BPS partition function is obtained by solving the blowup equation which identifies the partition functions on $\Omega$-deformed $\mathbb{C}^2$ and that on on the blown-up $\mathbb{P}^1$ in $\hat{\mathbb{C}}^2$ that can be smoothly blown-down to $\mathbb{C}^2$. The blowup method was generalized and extended to any 5d/6d gauge theories, quiver gauge theories and 6d theories on a circle with/without a twist \cite{Keller:2012da, Kim:2019uqw, Kim:2020hhh, Kim:2021gyj} as well as extended \cite{Gu:2017ccq, Huang:2017mis, Kim:2020hhh} to any local Calabi-Yau 3-folds associated with geometric constructions of \cite{Jefferson:2018irk, Bhardwaj:2019fzv}. Topological vertex method \cite{Aganagic:2003db,Iqbal:2007ii,Awata:2008ed} is yet another systematic tool for computing the partition function. It uses Type IIB 5-brane web diagrams \cite{Aharony:1997ju, Aharony:1997bh} and the partition functions are expressed as a sum of instanton contributions, that is a sum of Young diagrams associated with K\"ahler parameter for instanton fugacity. If a 5-brane web diagram for the supersymmetric field theory of interest is given, one can perform the topological vertex to obtain the corresponding partition function. Here, 5-brane webs used for topological vertex refer to not only toric web diagrams but a particular class of non-toric ones which include generalized toric web diagrams and 5-brane webs with orientifolds (O5- or ON-planes) \cite{Kim:2017jqn, Hayashi:2020hhb, Nawata:2021dlk, Kim:2022dbr}. It is worthy of noting that new 5-brane configurations have been obtained, including webs for 5d $G_2$ gauge theories \cite{Hayashi:2018bkd,Hayashi:2018lyv}, 5d gauge theories with rank-3 antisymmetric hypermultiplets \cite{Hayashi:2019yxj}, local $\mathbb{P}^2$ with an adjoint hyper or similar non-Lagrangian theories with an O7$^+$-plane \cite{Kim:2020hhh}, and also periodic webs for 6d SCFTs of spiral shapes of E-string theory \cite{Kim:2015jba,Hayashi:2015fsa} and two O5-planes for those in the Higgsing and twisting sequences of 6d $D_N$ gauge theories \cite{Kim:2019dqn,Kim:2021cua}. There are, however, still many theories whose 5-brane webs are unknown. For instance, 5d SU(3)$_8$ theory. For such theories, conventional topological vertex method is not applicable. On the other hand, recently, there are new 5-brane web configuration for 5d and 6d SCFTs was proposed based on gluings of 5-brane webs in a trivalent or quadrivalent way, which is not realized on two-dimensional $(p, q)$-plane but is extended to an ambient space such that theories are realized in a way similar to Dynkin diagrams for gauge groups of 5d gauge theories or quiver gauge theories of the shape of an affine Dynkin diagram for 6d conformal matters, and more with Higgsing of these two. We refer to them as the tri-/quadri-valent gluings \cite{Hayashi:2017jze, Hayashi:2021pcj}. These new 5-brane web configurations do not require orientifold planes but can realize much more 5d/6d SCFTs than conventional 5-brane webs on the $(p,q)$-plane can do, which includes 5d exceptional gauge theories or 6d conformal matter of exceptional symmetries. Computation of the partition function based on these tri-/quadri-valent gluings also agree with the known result. It is however an extension of such gluings to little string theories not yet developed. Little string theories are non-gravitational string theories in six dimensions \cite{Seiberg:1997zk,Berkooz:1997cq,Losev:1997hx,Dijkgraaf:1996cv,Dijkgraaf:1996hk}, which arise in the limit of the string coupling $g_s\to 0$ \cite{Seiberg:1997zk,Berkooz:1997cq,Dijkgraaf:1996cv,Dijkgraaf:1996hk,Blum:1997mm,Intriligator:1997dh,Brunner:1997gf,Hanany:1997gh} and have a scale associated with $1/\sqrt{\alpha'}$ or the tensions of little strings. A large class of LSTs has been constructed from F-theory on an elliptically fibered non-compact Calabi-Yau threefolds \cite{Bershadsky:1996nu,Aspinwall:1996vc,Aspinwall:1997ye,Bhardwaj:2015oru}, and the classification of LSTs is discussed in \cite{Bhardwaj:2015oru,Bhardwaj:2019hhd}. LSTs can be regarded as affine extension of 6d SCFTs. In other words, on tensor branch, one can realize a certain class of LSTs as a 6d quiver gauge theories of the shape of affine Dynkin diagram. For a necklace and a $D$-type affine quiver cases, one can depict them with a conventional $(p,q)$ 5-brane web. A necklace quiver is for $A_n$-type LSTs and the corresponding 5-brane webs have two periodic directions from which T-duality of LSTs can be realized an $SL(2,\mathbb{Z})$ symmetry of 5-brane web with two periodicities \cite{Kim:2015gha}. 5-brane webs for $A$-type LSTs are studied from the perspective of triality and for computing the partition functions \cite{Hohenegger:2015btj, Hohenegger:2016eqy, Hohenegger:2016yuv, Bastian:2017ing, Bastian:2017ary,Bastian:2018dfu}. For $D$-type LSTs are also possible with two ON-branes \cite{Sen:1997kz, Sen:1998ii, Kapustin:1998fa, Hanany:1999sj}, which described an affine $D$-type Dynkin quiver with a periodic direction with NS5-branes. T-duality is realized again as the S-dual relation between 5-brane webs with two ON-plane and with two O5-planes. $E$-type LSTs still remain as a challenge for conventional $(p,q)$ 5-brane webs. In this paper, we explore a possible extension of tri-/quadri-valent gluing to 6d little string theories, which make it possible to describe LSTs engineered from $N$ IIB NS5-branes probing $D_n, E_n$-type singularities as glued 5-brane webs. (For simplicity, we refer to them as rank-$N$ $D_n, E_n$-type LSTs.) Tri-/quadri-valent gluings of 6d ($G$, $G$) conformal matters realize the 6d SCFTs as a quiver theory of the shape of affine Dynkin diagram associated with symmetry group $G$, where each node corresponds to a usual 5-brane web. Notice that the glued branes therefore have external 5-branes which are extended to infinity. So, it is not good for describing LSTs. To make the tri-/quadri-valent gluing to describe LSTs, we propose the following. We further glue the external 5-branes such that two external 5-branes that are a part of a single strip diagram are glued together as if they are compactified on a circle. All the external 5-branes are glued in this bivalent way but are required to be compactified on the {\it same} circle. In this way, we can introduce another periodicity for the resultant glued webs. In other words, the periodicity, which is necessary for a 5d affine quiver to be LSTs, comes from compactifying all the external 5-branes from a tri-/quadri-valent glued configurations. The resulting 5-brane configurations are hence an affine $A$-, $D$-, and $E$-type quiver equipped with a periodic direction, and therefore they are 5-brane configurations which can describe a certain class of LSTs associated with affine $A,D,E$-extensions of 6d SCFTs. We then apply refined topological vertex method to our proposed webs to compute the supersymmetric partition functions for LSTs. As illustrative examples, we explicitly compute quadrivalent gluing for $D_4$ little string theory and trivalent gluing for $D_5$ little string theory. Our result reproduces the known elliptic genus result \cite{Kim:2018gak} for these two theories obtained based the ADHM construction where T-duality was checked, implying our proposal is also of the T-duality in it. We also compute the partition function for $E_6$ LST based on the trivalent gluing. We then discuss symmetry of theories on tensor branch in connection with Weyl reflection symmetry associated with NS5-branes. The organization of the paper is as follows. In section \ref{sec:gluings}, we provide a short review on topological vertex method and discuss our setup for conversions and notations. In section \ref{sec:LSTandselfGluing}, we discuss our proposal for tri-/quadri-valent gluings for $D_n$-type and $E_n $-type LSTs. We then propose general expression for the partition function for a generic rank-$N$ $D_n$- and $E_n$-type LSTs which can be constructed from tri-/quadri- valent gluings in section \ref{sec:higherRanks}. Detail computations and symmetries are discussed in section \ref{sec:Symmetry}. We summarize our results and possible further direction to pursue in section \ref{sec:conclusion}. In appendices, we discuss some of computational details, which include $A$-type little string theories. \bigskip \section{Topological vertex and gluings 5-brane webs}\label{sec:gluings} We start with a short review on topological vertex formalism \cite{Aganagic:2003db} and then discuss tri-/quadri-valent gluings \cite{Hayashi:2017jze, Hayashi:2021pcj}. We then discuss an interesting relation between trivalent gluing and 5-brane webs with ON-planes. \subsection{Refined topological vertex} The topological vertex is our main tool for computing the partition function of 5d $\mathcal{N}=1$ supersymmetric gauge theories on a circle or 6d $\mathcal{N}=(1,0)$ theories on a torus based on Type IIB 5-brane webs. The partition function captures the BPS spectrum of these theories on $\mathbb{R}^4\times S^1$ or $\mathbb{R}^4\times T^2$, which is the Witten index on the $\Omega$-deformed $\mathbb{R}^4$, counting the number of the BPS states weighted by their electric charges and angular momenta. Here, we denote the $\Omega$-background parameters $\epsilon_1, \epsilon_2$ and define their fugacities, $\mathfrak{q}= e^{-{\boldsymbol{\beta}}\epsilon_1}$ and $\mathfrak{t}= e^{\boldsymbol{\beta}\epsilon_2}$, where ${\boldsymbol{\beta}}$ is the circumference of $S^1$. To perform the computation of the partition function using the topological vertex, one needs to identify the edge factors and the vertex factors for the 5-brane web. First, an edge factor is given to each edge of a given 5-brane web, and likewise a vertex factor is associated with each vertex of the 5-brane web. To give the edge factor, one needs to distinguish the framing factors along either with the preferred direction $f_{\mu}(\mathfrak{t},\mathfrak{q})$ or with the non-preferred directions $\tilde{f}_{\mu}(\mathfrak{t},\mathfrak{q})$. The preferred direction here is the direction associated with an expansion parameter such as the instanton fugacity, while the non-preferred directions are other directions that are not a preferred direction. With Young diagrams denoted by a Greek letter\footnote{In this paper we use Greek letters to define the Young diagrams.} $\mu$, these two framing factors take the following forms, \begin{align}\label{eq:framing factor} f_\mu(\mathfrak{t},\mathfrak{q})&=(-1)^{|\mu|}\mathfrak{t}^{\frac{||\mu^t||^2}{2}}\mathfrak{q}^{-\frac{||\mu||^2}{2}} = f_{\mu^t}(\mathfrak{q},\mathfrak{t})^{-1}, \cr \tilde{f}_{\mu}(\mathfrak{t},\mathfrak{q})&=(-1)^{|\mu|}\mathfrak{t}^{\frac{||\mu^t||^2+|\mu|}{2}}\mathfrak{q}^{-\frac{||\mu||^2+|\mu|}{2}}= \tilde f_{\mu^t}(\mathfrak{q},\mathfrak{t})^{-1}\ , \end{align} where $\mu^t$ is the transpose of the Young diagram $\mu$, $|\mu| =\sum^{\ell(\mu)}_{i=1} \mu_i$, and $||\mu||^2 =\sum^{\ell(\mu)}_{i=1} \mu_i^2$. The edge factor along the edge associated with the Young diagram $\mu$ is then defined as \begin{equation} \begin{aligned}\label{eq:edge factor} &(-Q)^{|\mu|} f^{\mathfrak{n}}_\mu (\mathfrak{t},\mathfrak{q})\quad \text{for a preferred direction}, \\ &(-Q)^{|\mu|} \tilde f^{\mathfrak{n}}_\mu (\mathfrak{t},\mathfrak{q})\quad \text{for a non-preferred direction}, \end{aligned} \end{equation} where $Q$ is a K\"ahler parameter associated with the edge, the power $\mathfrak{n}$ is given as $\mathfrak{n}= p_\text{in}q_\text{out}-p_\text{out}q_\text{in}$ for a pair of incoming and outgoing charge of 5-branes, $(p_\text{in}, q_\text{in})$, and $(p_\text{out}, q_\text{out})$, which are connected to the edge of interest (see also figure \ref{fig:gluing}). \begin{figure}[t] \centering \includegraphics[scale=0.7]{fig-gluing.pdf} \caption{A convention of the charge of external legs. Here we define a K\"ahler parameter $Q$ along an internal line.} \label{fig:gluing} \end{figure} The vertex factor is defined as \begin{align} C_{\lambda\mu\nu}(\mathfrak{t},\!\mathfrak{q})=\mathfrak{q}^{\frac{||\mu||^2+||\nu||^2}{2}}\mathfrak{t}^{-\frac{||\mu^t||^2}{2}}\tilde{Z}_\nu(\mathfrak{t},\!\mathfrak{q})\!\sum_{\eta}\!\Big(\frac{\mathfrak{q}}{\mathfrak{t}}\Big)^{\!\!\frac{|\eta|+|\lambda|-|\mu|}{2}}\!\!\! s_{\lambda^t/\eta}(\mathfrak{t}^{-\rho}\mathfrak{q}^{-\nu})s_{\mu/\eta}(\mathfrak{q}^{-\rho}\mathfrak{t}^{-\nu^t}), \label{eq:vertex factor} \end{align} where the Young diagrams are chosen such that the associated arrows are all out-going. The transpose of a Young diagram will be assigned when the arrow is opposite, and the last Young diagram $\nu$ in \eqref{eq:vertex factor} is the Young diagram along the preferred direction. The factor $\tilde{Z}_{\nu}(\mathfrak{t},\mathfrak{q})$ is defined as \begin{align} \tilde{Z}_{\nu}(\mathfrak{t},\mathfrak{q})= \prod_{i=1}^{\ell(\nu)}\prod_{j=1}^{\nu_i}\big(1-\mathfrak{t}^{\nu^t_j-i+1}\mathfrak{q}^{\nu_i-j}\big)^{-1}, \end{align} and $s_{\lambda/\eta}(\bf{x})$ are the skew-Schur functions of a vector $\bf{x}$ with infinite components. For example, $\mathfrak{t}^{-\rho}\mathfrak{q}^{\nu} = (\mathfrak{t}^\frac{1}{2} \mathfrak{q}^{-\nu_1},\mathfrak{t}^{\frac32}\mathfrak{q}^{-\nu_2}, \cdots)$. From them, the partition function can be obtained by summing over all the edge and the vertex factors of the 5-brane web of interest, \begin{align}\label{eq:Z as Edge and Vertex} Z = \sum_{\lambda,\mu,\nu,\cdots} \Big(\prod \text{Edge factor}\Big) \Big( \prod \text{Vertex factor}\Big)\ . \end{align} Note that in usual toric diagrams, we can evaluate the sum of Young diagrams along the non-preferred direction and get closed forms which may be interpreted as contributions coming from matters. Eventually, the partition function can be expressed as a sum of the Young diagrams along the preferred direction. It is convenient to introduce the following functions: \begin{align} \mathcal{R}_{\lambda\mu}(Q;\mathfrak{t},\mathfrak{q})&\equiv \! \prod_{i,j=1}^{\infty}\!\!\Big(\!1\!-\!Q \mathfrak{t}^{i-\frac{1}{2}-\lambda_j}\mathfrak{q}^{j-\frac{1}{2}-\mu_i}\!\Big)\!=\!\mathcal{M}\big(Q\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}};\mathfrak{t},\mathfrak{q}\big)^{-1}\mathcal{N}_{\lambda^t\mu}\big(Q\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}};\mathfrak{t},\mathfrak{q}\big), \label{eq:RMN}\\ \mathcal{M}(Q;\mathfrak{t},\mathfrak{q})&\equiv \!\prod_{i,j=1}^{\infty}\big(1-Q \mathfrak{t}^{i-1}\mathfrak{q}^{j}\big)^{-1},\\ \mathcal{N}_{\lambda\mu}(Q;\mathfrak{t},\mathfrak{q})&\equiv \! \prod_{i,j=1}^{\infty}\frac{1-Q\mathfrak{t}^{i-1-\lambda_j^t}\mathfrak{q}^{j-\mu_i}}{1-Q\mathfrak{t}^{i-1}\mathfrak{q}^j}\label{eq:curlyN}\\ &=\!\prod_{(i,j)\in\lambda}(1-Q\mathfrak{t}^{\mu_j^t-i}\mathfrak{q}^{\lambda_i-j+1})\prod_{(i,j)\in\mu}(1-Q\mathfrak{t}^{-\lambda_j^t+i-1}\mathfrak{q}^{-\mu_i+j})\ .\nonumber \end{align} With these functions, one can simplify or evaluate the Young diagram sums by applying the Cauchy identities, \begin{align} &\sum_\lambda Q^{|\lambda|} s_{\lambda/\eta_1}(\mathfrak{t}^{-\rho}\mathfrak{q}^{-\nu_1}) s_{\lambda/\eta_2}(\mathfrak{q}^{-\rho}\mathfrak{t}^{-\nu_2}) \nonumber \\ &\quad = \mathcal{R}_{\nu_2 \nu_1}(Q;\mathfrak{t},\mathfrak{q})^{-1} \sum_\lambda Q^{|\eta_1|+|\eta_2|-|\lambda|} s_{\eta_2/\lambda}(\mathfrak{t}^{-\rho}\mathfrak{q}^{-\nu_1}) s_{\eta_1/\lambda}(\mathfrak{q}^{-\rho}\mathfrak{t}^{-\nu_2}) \label{eq:cauchy2}\ , \\ &\sum_\lambda Q^{|\lambda|} s_{\lambda/\eta_1^t}(\mathfrak{t}^{-\rho}\mathfrak{q}^{-\nu_1}) s_{\lambda^t/\eta_2}(\mathfrak{q}^{-\rho}\mathfrak{t}^{-\nu_2}) \nonumber \\ &\quad = \mathcal{R}_{\nu_2 \nu_1}(-Q;\mathfrak{t}, \mathfrak{q}) \sum_\lambda Q^{|\eta_1|+|\eta_2|-|\lambda|} s_{\eta_2^t/\lambda}(\mathfrak{t}^{-\rho}\mathfrak{q}^{-\nu_1}) s_{\eta_1/\lambda^t}(\mathfrak{q}^{-\rho}\mathfrak{t}^{-\nu_2}) \ \label{eq:cauchy2'}. \end{align} It is also useful to implement an extended version of the Cauchy identities: \begin{align} &\sum_{\lambda}Q^{|\lambda|}s_{\lambda/\mu_1}(Q_1\mathfrak{t}^{-\rho}\mathfrak{q}^{-\nu_1})s_{\lambda^t/\mu_2}(Q_2\mathfrak{q}^{-\rho}\mathfrak{t}^{-\nu_2})\nonumber\\ &~=\mathcal{R}_{\nu_2\nu_1}(-QQ_1Q_2)\sum_{\lambda}Q^{|\lambda|}s_{\mu_2^t/\lambda}(QQ_1\mathfrak{t}^{-\rho}\mathfrak{q}^{-\nu_1})s_{\mu_1^t/\lambda^t}(QQ_2\mathfrak{q}^{-\rho}\mathfrak{t}^{-\nu_2})\ , \label{eq:Cauchy-new1}\\ &\sum_{\lambda}Q^{|\lambda|}s_{\lambda/\mu_1}(Q_1\mathfrak{t}^{-\rho}\mathfrak{q}^{-\nu_1})s_{\lambda/\mu_2}(Q_2\mathfrak{q}^{-\rho}\mathfrak{t}^{-\nu_2})\nonumber\\ &~=\mathcal{R}_{\nu_2\nu_1}(QQ_1Q_2)^{-1}\sum_{\lambda}Q^{|\lambda|}s_{\mu_2/\lambda}(QQ_1\mathfrak{t}^{-\rho}\mathfrak{q}^{-\nu_1})s_{\mu_1/\lambda}(QQ_2\mathfrak{q}^{-\rho}\mathfrak{t}^{-\nu_2})\ .\label{eq:Cauchy-new2} \end{align} \paragraph{Convention.} Following the convention introduced in \cite{Kim:2022dbr}, we choose the direction of the arrows on the edges to be chosen to be either pointing upward or to the left as show in figure \ref{fig:arrowconvention}. The preferred direction is always taken be horizontal. The $\mathfrak{t},\mathfrak{q}$ factors are assigned such that the above the preferred direction is $\mathfrak{t}$ and the below is $\mathfrak{q}$. Throughout the paper, we take this convention, so that we will omit the arrows, preferred directions, and the Omega deformation factors explicitly. As depicted in figure \ref{fig:arrowconvention}, we only denote the Young diagram associated with edges. \begin{figure}[t] \centering \begin{tikzpicture}[thick,scale=0.5, every node/.style={scale=0.5}] \path [line width=0.5mm,draw=black,postaction={on each segment={mid arrow=black}}] (3+15,3) to (0+15,3) (3+15,1.3) to (3+15,3) (0+15,3) to (-1.5+15,4.5) (0+15,1.3) to (0+15,3) (3+15,3) to (4.5+15,4.5); \node[scale=1.5] at (1.5+15,3.45){$\mu_1$}; \node[scale=1.5] at (-0.15+15,3.6){$\mathfrak{t}$}; \node[scale=1.5] at (-0.33+15,2.6){$\mathfrak{q}$}; \node[scale=1.5] at (3.1+15,3.6){$\mathfrak{t}$}; \node[scale=1.5] at (3.3+15,2.6){$\mathfrak{q}$}; \node[scale=1.5] at (-1.1+15,3.4){$\nu_1$}; \node[scale=1.5] at (-0.55+15,2){$\nu_2$}; \node[scale=1.5] at (3.6+15,1.9){$\nu_4$}; \node[scale=1.5] at (4.2+15,3.4){$\nu_3$}; \draw[line width=0.5mm,black] (3,3) to (0,3) (3,1.3) to (3,3) (0,3) to (-1.5,4.5) (0,1.3) to (0,3) (3,3) to (4.5,4.5); \node[scale=1.5] at (1.5,3.45){$\mu_1$}; \node[scale=1.5] at (-1.1,3.4){$\nu_1$}; \node[scale=1.5] at (-0.55,2){$\nu_2$}; \node[scale=1.5] at (3.6,1.9){$\nu_4$}; \node[scale=1.5] at (4.2,3.4){$\nu_3$}; \draw[line width=0.3mm,>=Classical TikZ Rightarrow,double,<->] (8,2.5) to (10,2.5); \end{tikzpicture} \caption{Convention used in this paper. } \label{fig:arrowconvention} \end{figure} \subsection{Tri-/quadri-valent gluing of 5-brane webs} A trivalent or quadrivalent gluing is a 5-brane web-like construction realizing geometric description of a given theory \cite{Hayashi:2017jze}. Its building block is 5-brane webs of parallel external edges, such as SU(2)$_{2\pi}$ or a 5-brane web for pure SU($N$)$_\kappa$ theory at the Chern-Simons level $\kappa=N$, denoted by SU($N$)$_N$, or those of fundamental hypermultiplets. Based on the topological vertex formalism, one can compute the partition function by gluing 5-brane webs. Here, the gluing means to take the Young diagram sums along the parallel external edges, which makes a gauging of the external edges and hence increase the number of Coulomb branch. We will explain the tri-/quadri-valent gluing diagrammatically, and the detailed computation will be explained in Section \ref{sec:LSTandselfGluing} as applications of LSTs. A simplest gluing would be a bivalent gluing which is to glue a pair of 5-brane webs with parallel external edges. It is, in fact, a commonly used technique in the topological vertex formalism to compute partition functions from 5-brane webs. For instance, consider a 5-brane web for the 5d ${\rm SU}(2)_\pi\times {\rm SU}(2)\times{\rm SU}(2)_\pi$ theory. The partition function can be computed from two 5-brane webs for SU(2) theory with two flavors, where one glues two parallel external lines corresponding to two flavors on the same side, call it the bivalent gluing. As a generalization, a set of three (and four) parallel edges can be glued together. These gluing are called a trivalent (and quadrivalent) gluing. Unlike two parallel edges, gluing of more than three edges may not be depicted on a 5-brane plane. Many 5d/6d examples of the tri-/quadri-valent gluing technique have been discussed~\cite{Hayashi:2017jze,Hayashi:2021pcj}, supporting that this gluing technique is another powerful way of computing the partition function for those theories which do not have a 5-brane realization, which include 5d $F_4, E_{6,7,8}$ exceptional gauge theories and 6d $(E_n, E_n)$ conformal matters. We note that multivalent gluings more than four sets of branes do not lead to a physically sensible theory. \begin{figure}[t] \centering \includegraphics[scale=0.6]{fig-bigluing.pdf} \caption{A bivalent gluing.} \label{fig:biguling} \end{figure} We briefly demonstrate these gluing technique with 5d SU($2$) theory with even number of hypermultiplets in the fundamental representation (flavors). First, consider a 5-brane web with 4 flavors given in figure \ref{fig:biguling}, which we can vertically cut the 5-brane web by a half leading two pieces of 5-brane web representing a free hypermultiplet. One can obviously glue together these free hypermultiplets to reconstruct a 5-brane web for 5d SU(2) gauge theory with 4 flavors, which is, in fact, what we usually do. We here note that one also represents two flavors as an ``SU(1)'' theory, as shown in figure \ref{fig:su2+4HW}. This means that we have a quiver gauge theory SU(1)$\,-\,$SU(2)$\,-\,$SU(1) which is a $D$-type quiver. \begin{figure}[t] \centering \includegraphics[scale=0.6]{fig-su2+4HW.pdf} \caption{Equivalence between SU(2)+4$\mathbf{F}$ (left) and ${\rm SU}(1)-{\rm SU}(2)-{\rm SU}(1)$ (right) by vertical Hanany-Witten moves, where the blue dots are (0,1) 7-branes.} \label{fig:su2+4HW} \end{figure} It is also possible to construct the same theory on a 5-brane configuration with an O5-plane as shown in figure \ref{fig:ON-su1su2su1}. \begin{figure}[t] \centering \includegraphics[scale=0.6]{fig-ON-su1su2su1.pdf} \caption{(a) An SU(1)$-$SU(2)$-$SU(1) 5-brane web with an ON-plane which is located on the right. (b) A trivalent gluing configuration for SU(1)$-$SU(2)$-$SU(1) quiver theory.} \label{fig:ON-su1su2su1} \end{figure} On a 5-brane web with an O5-plane, we can also apply a gluing of two SU(1) theories with two flavors by gluing two flavors of each SU(1) theory with a free hypermultiplet, as shown in figure \ref{fig:ON-su1su2su1}. One needs to carefully assign the K\"ahler parameter map as given in figure \ref{fig:ON-su1su2su1} and also mode out the U(1) factor for each 5-brane piece. Now, consider a 5-brane web for SU(2) gauge theory with 6 flavors (SU(2)+6$\mathbf{F}$) by adding two flavors to the SU(1)$-$SU(2)$-$SU(1) quiver theory. From figure \ref{fig:ON-su1su2su1}(b), we can easily add two flavors, and the resulting web diagram is given in figure \ref{fig:tri-quiver-su2+6F}(a). On the other hand, since we know that we can add two flavors by putting an SU(1) theory, we find another realization of web diagram of the SU(2)+6$\mathbf{F}$ theory given in figure \ref{fig:tri-quiver-su2+6F}(b). In any case, we have a $D$-type quiver theory and hence SU(2)+6$\mathbf{F}$ can be represented as follows: \begin{align} \begin{tikzpicture} \draw[thick](-1.4,0)--(-0.6,0); \draw[thick](0.6,0.2)--(1.4,.8); \draw[thick](0.6,-0.2)--(1.4,-.8); \node at (0,0){SU$(2)$}; \node at (-1.8,0){[2]}; \node at (2,1){SU$(1)$}; \node at (2,-1){SU$(1)$}; \end{tikzpicture} \qquad \qquad \begin{tikzpicture} \draw[thick](-1.4,0)--(-0.6,0); \draw[thick](0.6,0.2)--(1.4,.8); \draw[thick](0.6,-0.2)--(1.4,-.8); \node at (0,0){SU$(2)$}; \node at (-2,0){SU$(1)$}; \node at (2,1){SU$(1)$}; \node at (2,-1){SU$(1)$}; \end{tikzpicture} \label{eq:quiver-su2+6F} \end{align} \begin{figure}[t] \centering \includegraphics[scale=0.5]{fig-tri-su2+6F.pdf} \caption{SU(2)+6$\mathbf{F}$ as a trivalent gluing configuration discussed in \eqref{eq:quiver-su2+6F}.} \label{fig:tri-quiver-su2+6F} \end{figure} For a trivalent quiver with three SU(1)s, we can do a trivalent gluing of three SU(2)+2$\mathbf{F}$ where parallel external 5-branes associated with two flavors are glued. In other words, three 2$\mathbf{F}$ are gauged to become an SU(2) node in the middle of the trivalent quiver \eqref{eq:quiver-su2+6F}. One can show that the partition function based on this trivalent gluing correctly reproduces that of SU(2)$+6\mathbf{F}$. \begin{figure}[t] \centering \includegraphics[scale=0.5]{fig-quadri-SU2+8F.pdf} \caption{A quadrivalent gluing for SU(2)$+8\mathbf{F}$.} \label{fig:quadri-su2+8F} \end{figure} We can even consider a 5-brane web for SU(2) gauge theory with 8 flavors by introducing one more SU(1)$+1\mathbf{F}$, which makes a quadrivalent quiver, as shown in figure \ref{fig:quadri-su2+8F}. As discussed, SU(1)-SU(2)-SU(1) of trivalent quiver in \eqref{eq:quiver-su2+6F} can be depicted as a 5-brane web with an ON-plane. The quadrivalent quiver for SU(2)$+8\mathbf{F}$ having four SU(1)s can also be realized in a similar way, but in the quadrivalent case we need to put two ON-planes. It is worthy of noting that topological vertex computations based on a 5-brane web with ON-plane(s) was recently developed in \cite{Kim:2022dbr}. We do not provide the computation detail, but we show that the partition function computed by using the refined topological vertex method based on this quadrivalent quiver for SU(2)$+8\mathbf{F}$ perfectly agrees with that based on a 5-brane web with two ON-planes obtained in \cite{Kim:2022dbr}. We remark that the 5-brane web with two ON-planes has a periodic direction, so that this corresponds to a 6d theory on a circle. In this case, it is the 6d E-string theory on a circle represented by an affine $D_4$ quiver theory in 5d description, which can be also realized as a quadrivalent gluing. In other words, a quadrivalent gluing gives rise to affine $D_4$ quiver in the 5d description, representing the 6d theory on a circle. We also note that the equivalence between tri-/quadri-valent gluing and 5-brane web with O5-planes can be easily generalized to theories with more than one Coulomb branch parameter. For instance, 6d $(D_n, D_n)$ conformal matter can be realized on a 5-brane with two ON-plane as an affine $D_{n\ge 5}$ quiver or as two trivalent gluing of the shape of affine $D_{n\ge 5}$ quiver. One can compute the corresponding partition function based on either a 5-brane web with two ON-planes or trivalent gluings. The parameter map between these two cases can be easily read off as a simple generalization of the map given in figure \ref{fig:ON-su1su2su1}. \bigskip \section{Little string theory from bivalent self-gluings} \label{sec:LSTandselfGluing} A trivalent or quadrivalent gluing making a quiver of the shape of an affine Dynkin diagram (affine quiver) gives rise to a 5d realization of a 6d theory with a global symmetry associated with the Dynkin diagram of the affine quiver. We further generalize this construction of gluing 5-brane web to include bivalent ``self-gluings,'' such that all the external edges in a same quiver node are glued together. This makes an additional compact direction and leaves no external edges, which is a necessary configuration to describe LSTs. In this section, based on the bivalent self-gluings, we obtain the partition function of 6d $\mathcal{N}=(1,0)$ $D$-type and $E$-type LSTs. From Type IIB 5-brane web point of view, 6d $\mathcal{N}=(1,0)$ theories can be realized on a 5-brane web of either a horizontal or vertical compact direction. Such a compact direction is introduced by gluing infinitely expanded 5-branes or by two orientifold planes. In a similar fashion, LSTs are then constructed by making another compact direction with gluing or introducing another orientifold planes, hence the resulting 5-brane webs have no external legs. \subsection{LST on \texorpdfstring{$D_4$}{D4} singularity}\label{sec:D4} The $D_4$ LST can be realized by the web diagram in figure \ref{fig:D4_O5}(a) which is a SO(8)-``Sp(0)" circular quiver. We flop the two parts near the two O5-planes to obtain the web diagram in figure \ref{fig:D4_O5}(b). Then we flop $m_1$ down and $m_4$ up, and take the S-dual to obtain the web diagram in figure \ref{fig:D4_ON}(b) which is the ON-plane realization of the $D_4$ LST. \begin{figure}[H] \centering \includegraphics[scale=0.5]{D4-O5.pdf} \caption{O5-plane realization of the $D_4$ LST.} \label{fig:D4_O5} \end{figure} \begin{figure}[H] \centering \includegraphics[scale=0.45]{D4-ON.pdf} \caption{ON-plane realization of the $D_4$ LST.} \label{fig:D4_ON} \end{figure} The web diagram in figure \ref{fig:D4_ON}(b) can also be obtained from that in figure \ref{fig:D4_ON}(a) by following procedure: First, we shrink the distances between the lines associated with $\mu_{1,1}$ and $\mu_{2,1}$, and $\mu_{3,1}$ and $\mu_{4,1}$. Then we tune the horizontal coordinates of the two ends of each of the middle two NS5-branes to be the same. After that, we compactify the vertical axis by gluing the ends of each NS5-brane to have an additional periodic structure. Therefore, as in figure \ref{fig:D4_ON}(b), we have the following affine $D_4$ quiver structure: \begin{align*} \begin{tikzpicture} \draw[thick](-1.4,.8)--(-0.6,0.2); \draw[thick](-1.4,-.8)--(-0.6,-0.2); \draw[thick](0.6,0.2)--(1.4,.8); \draw[thick](0.6,-0.2)--(1.4,-.8); \node at (0,0){SU$(2)$}; \node at (-2,1){SU$(1)$}; \node at (-2,-1){SU$(1)$}; \node at (2,1){SU$(1)$}; \node at (2,-1){SU$(1)$}; \end{tikzpicture} \end{align*} This realizes one periodic direction of the LST while the other periodic direction is realized by the vertical compactification. In figure \ref{fig:D4_ON}(a) $\mu_{1,1}$ and $\mu_{2,1}$ connect to the rightmost vertical strip which leads to a bifundamental contribution to the partition function while $\mu_{1,1}$ and $\mu_{2,1}$ also connect to the second right vertical strip which leads to a vector contribution to the partition function, this two contributions cancel each other so that there are no factors that mix $\mu_{1,1}$ and $\mu_{2,1}$ \cite{Kim:2022dbr}. The same analysis can apply to $\mu_{3,1}$ and $\mu_{4,1}$, so that we can factorize the partition function into five parts which turns out to be equivalent to the computation procedure from quadrivalent gluing method. \bigskip \paragraph{Bivalent self-gluing.} \begin{figure}[htbp] \centering \includegraphics[scale=0.45]{D4-quad.pdf} \caption{(a) Quadrivalent gluing realization of the $D_4$ LST. (b) Definition of a gluing for non-parallel lines. Here we pick bottom right diagram.} \label{fig:D4_quad} \end{figure} \begin{figure}[htbp] \centering \includegraphics[scale=0.4]{D4-quad-2.pdf} \caption{Another equivalent quadrivalent gluing realization of the $D_4$ LST.} \label{fig:D4_quad2} \end{figure} We expect that the cancellations of bifundamental and vector contributions involving $\mu_{1,1},\mu_{2,1}$ and $\mu_{3,1},\mu_{4,1}$ also happen for the LST in figure \ref{fig:D4_ON}(b). This means that the LST, although vertically periodic, can also be reconstructed by the quadrivalent gluing method. Therefore, we propose that we can realize the $D_4$ LST of figure \ref{fig:D4_ON}(b) by the quadrivalent gluing in figure \ref{fig:D4_quad}(a). There are several things that need to be explained about this quadrivalent gluing diagram before we explain how to realize the vertical periodicity using the bivalent self-gluing: \begin{enumerate} \item [(1)]We did not explicitly show how to tri-/quadri-valently glue subdiagrams together in the previous section. Here figure \ref{fig:D4_quad}(a) explicitly illustrates how to do this by also showing the subdiagram of the full SU(2) gauge node in the middle of the figure, and this middle diagram looks exactly like the middle part of the ON-plane realization in figure \ref{fig:D4_ON}(b). Now we have five subdiagrams in figure \ref{fig:D4_quad}(a). Each subdiagram shows the information of each gauge node, and there are overlaps between different subdiagrams. \item [(2)]Each subdiagram is equivalent to its $SL(2,\mathbb{Z})$ transformed diagram. We can do an $SL(2,\mathbb{Z})$ transformation to make the shape of the bottom right subdiagram just like the shape of the top right subdiagram, but this should not affect the middle SU(2) subdiagram in which the top two NS charged branes have to parallel to each other and also the bottom two NS charged branes have to parallel to each other. \item [(3)]Although we draw two SU(1) subdiagrams on the left and the other two on the right, the quadrivalent and trivalent gluing actually do not care about left or right. For example, we can also draw one SU(1) subdiagram on the left and three on the right as shown in figure \ref{fig:D4_quad2} in which the middle SU(2) subdiagram also accordingly changes. But by using the topological vertex formalism to compute the partition functions of the quadrivalent gluing diagrams in figure \ref{fig:D4_quad}(a) and figure \ref{fig:D4_quad2}, it is easy to show that the two partition functions are the same. Here we omit the proof, but the reader can easily prove this by using the formula that we will obtain in section \ref{sec:generalformula}. \end{enumerate} We label the K\"ahler parameters and Young diagrams of figure \ref{fig:D4_quad}(a) in accord with figure \ref{fig:D4_ON}(b) and, in particular, the Young diagram $\mu_{I,j}$ labels the $j$-th color brane of the $I$-th gauge node. Figure \ref{fig:D4_quad}(a) obviously has the affine $D_4$ quiver structure but is less obvious for the vertical periodicity. The way we realize the vertical periodicity is simply gluing the two ends of each vertical strip for each subdiagram in figure \ref{fig:D4_quad}(a), we name it as bivalent self-gluing. To explain how to bivalently self-glue non-parallel lines, we pick the bottom right subdiagram as an example. We draw two adjacent periods of the bottom right subdiagram of figure \ref{fig:D4_quad}(a) in figure \ref{fig:D4_quad}(b). The upper period is just like the original subdiagram in figure \ref{fig:D4_quad}(a), but because the two ends of each vertical strip in the bottom right subdiagram of figure \ref{fig:D4_quad}(a) are non-parallel, the lower period in figure \ref{fig:D4_quad}(b) needs to be tilted by a $SL(2,\mathbb{Z})$ transformation. However, the $SL(2,\mathbb{Z})$ transformation does not change the K\"ahler parameters, so if the brane web in figure \ref{fig:D4_quad}(b) wants to be vertically periodic, the K\"ahler parameters should not change between different periods. In particular, $Q_2$ should be equal to $Q_2'$. In order to satisfy the periodicity constraint $Q_2=Q'_2$, $Q_{2;5}$ has to satisfy the condition, \begin{align}\label{eq:D4PDcond1} Q_{2;5}=Q_{5,1}^{\frac12}\ . \end{align} By the same reasoning, for the other three corner subdiagrams, we also have \begin{align}\label{eq:D4PDcond2} Q_{1;5}=Q_{3;5}=Q_{4;5}=Q_{5,1}^{\frac12}\ . \end{align} The middle SU(2) subdiagram in figure \ref{fig:D4_quad}(a) is automatically periodic once the periodicity conditions \eqref{eq:D4PDcond1} and \eqref{eq:D4PDcond2} are satisfied. We can see that the periodic conditions of the quadrivalent gluing in figure \ref{fig:D4_quad}(a) is also consistent with the periodic conditions coming from two ON-planes in figure \ref{fig:D4_ON}(b). \bigskip Now we are ready to use the quadrivalent gluing diagram in figure \ref{fig:D4_quad}(a) to obtain the partition function $Z^{D_4}$ of $D_4$ LST which takes the following summation and product form, \begin{multline} Z^{D_4}=\sum_{\mu_{5,1}\mu_{5,2}}Z_{\mu_{5,1}\mu_{5,2}}^{\text{SU(2)}}\sum_{\mu_{1,1}}Z_{\mu_{5,1}\mu_{5,2}\mu_{1,1}}(Q_{5,1},Q_{\tau},Q_{1})\sum_{\mu_{2,1}}Z_{\mu_{5,1}\mu_{5,2}\mu_{2,1}}(Q_{5,1},Q_{\tau},Q_{2})\\ \times\sum_{\mu_{3,1}}Z_{\mu_{5,1}\mu_{5,2}\mu_{3,1}}(Q_{5,1},Q_{\tau},Q_{3})\sum_{\mu_{4,1}}Z_{\mu_{5,1}\mu_{5,2}\mu_{4,1}}(Q_{5,1},Q_{\tau},Q_{4}), \label{eq:Z_D4} \end{multline} where the summands are defined in the following: \begin{equation} Z_{\mu_{5,1}\mu_{5,2}}^{\text{SU(2)}}\equiv(-Q_{5})^{|\mu_{5,1}|+|\mu_{5,2}|}f_{\mu_{5,1}}(\mathfrak{t},\mathfrak{q})f_{\mu_{5,2}}(\mathfrak{t},\mathfrak{q})^{-1}\times \begin{tikzpicture}[scale=0.6,thick,baseline=-15] \draw (0,0)--++(-1.4,0) coordinate (a)--++(0,-1.4) coordinate (b)--++(1.4,0); \draw (a)--++(-0.7,0.7); \draw (b)--++(-0.7,-0.7); \node at (-0.6,0.33){$\mu_{5,1}$}; \node at (-0.6,-1.06){$\mu_{5,2}$}; \draw[<->] (0.2,0)--++(0,-1.4); \node at (0.9,-0.7){$Q_{5,1}$}; \draw[<->] (-2.4,0.7)--++(0,-2.8); \node at (-2.85,-0.7){$Q_{\tau}$}; \draw (-2.43+0.8,-2.27+0.5)++(-0.05,-0.05)--++(-0.14,0.14); \draw (-2.43+0.8,0.87-0.5)++(-0.05,0.05)--++(-0.14,-0.14); \end{tikzpicture} \times \begin{tikzpicture}[scale=.6,thick,baseline = -15] \draw (0,0)--++(1.4,0) coordinate (a)--++(0,-1.4) coordinate (b)--++(-1.4,0); \draw (a)--++(0.7,0.7); \draw (b)--++(0.7,-0.7); \node at (0.8,0.33){$\mu_{5,1}$}; \node at (0.8,-1.06){$\mu_{5,2}$}; \draw[<->] (-0.2,0)--++(0,-1.4); \node at (-0.85,-0.7){$Q_{5,1}$}; \draw (2.43-0.8,-2.27+0.5)++(0.05,-0.05)--++(0.14,0.14); \draw (2.43-0.8,0.87-0.5)++(0.05,0.05)--++(0.14,-0.14); \draw[<->] (2.4,0.7)--++(0,-2.8); \node at (2.9,-0.7){$Q_{\tau}$}; \end{tikzpicture} \label{eq:mid_SU2} \end{equation} \begin{equation} Z_{\mu_{5,1}\mu_{5,2}\mu_{1,1}}(Q_{5,1},Q_{\tau},Q_{1})\equiv \begin{tikzpicture}[scale=.6,thick,baseline = -15] \draw (0,0)--++(1,0) coordinate (a)--++(0,1); \draw (a)--++(.7,-.7) coordinate (c)--++(0,-.7) coordinate (b)--++(-1.7,0); \draw (b)--++(1,-1); \draw (c)--++(1,0) coordinate (d)--++(0,1.3); \draw (d)--++(.7,-.7); \node at (0.4,0.33){$\mu_{5,1}$}; \node at (0.8,-1.06){$\mu_{5,2}$}; \node at (2.35,-1.1){$\mu_{1,1}$}; \draw (0.9,0.8)--(1.1,0.8); \draw (2.43,-2.27)--++(0.14,0.14); \draw (2.6,0.4-0.2)--++(0.2,0); \draw (2.6,0.32-0.2)--++(0.2,0); \draw (2.7,-0.7)++(0.57-0.07,-0.57-0.07)--++(0.14,0.14); \draw (2.7,-0.7)++(0.51-0.07,-0.51-0.07)--++(0.14,0.14); \draw[<->] (-0.2,0)--++(0,-1.4); \node at (-0.9,-0.7){$Q_{5,1}$}; \draw[<->] (1,0.47)--node[midway,anchor=south]{$Q_{1}$}++(1.7,0); \draw[<->] (3.55,0.7)--++(0,-2.8); \node at (4.1,-0.7){$Q_{\tau}$}; \end{tikzpicture} \Bigg/ \begin{tikzpicture}[scale=.6,thick,baseline = -15] \draw (0,0)--++(1.4,0) coordinate (a)--++(0,-1.4) coordinate (b)--++(-1.4,0); \draw (a)--++(0.7,0.7); \draw (b)--++(0.7,-0.7); \node at (0.8,0.33){$\mu_{5,1}$}; \node at (0.8,-1.06){$\mu_{5,2}$}; \draw[<->] (-0.2,0)--++(0,-1.4); \node at (-0.9,-0.7){$Q_{5,1}$}; \draw (2.43-0.8,-2.27+0.5)++(0.05,-0.05)--++(0.14,0.14); \draw (2.43-0.8,0.87-0.5)++(0.05,0.05)--++(0.14,-0.14); \draw[<->] (2.4,0.7)--++(0,-2.8); \node at (3,-0.7){$Q_{\tau}$}; \end{tikzpicture} \label{eq:sub_mu1} \end{equation} The other summands, $Z_{\mu_{5,1}\mu_{5,2}\mu_{2,1}},Z_{\mu_{5,1}\mu_{5,2}\mu_{3,1}},Z_{\mu_{5,1}\mu_{5,2}\mu_{4,1}}$, are similarly defined like $Z_{\mu_{5,1}\mu_{5,2}\mu_{1,1}}$. By the topological vertex formalism, we find \begin{align} &\begin{tikzpicture}[scale=.6,thick,baseline = -15] \draw (0,0)--++(1.4,0) coordinate (a)--++(0,-1.4) coordinate (b)--++(-1.4,0); \draw (a)--++(0.7,0.7); \draw (b)--++(0.7,-0.7); \node at (0.8,0.33){$\mu_{5,1}$}; \node at (0.8,-1.06){$\mu_{5,2}$}; \draw[<->] (-0.2,0)--++(0,-1.4); \node at (-0.9,-0.7){$Q_{5,1}$}; \draw (2.43-0.8,-2.27+0.5)++(0.05,-0.05)--++(0.14,0.14); \draw (2.43-0.8,0.87-0.5)++(0.05,0.05)--++(0.14,-0.14); \draw[<->] (2.4,0.7)--++(0,-2.8); \node at (3,-0.7){$Q_{\tau}$}; \end{tikzpicture}=\sum_{\nu_1\nu_2} \begin{tikzpicture}[scale=.6,thick,baseline = -15] \draw (0,0)--++(1.4,0) coordinate (a)--++(0,-1.4) coordinate (b)--++(-1.4,0); \draw (a)--++(0.7,0.7); \draw (b)--++(0.7,-0.7); \node at (0.8,0.33){$\mu_{5,1}$}; \node at (0.8,-1.06){$\mu_{5,2}$}; \draw[<->] (-0.2,0)--++(0,-1.4); \node at (-0.9,-0.7){$Q_{5,1}$}; \node at (2.1,0){$\nu_1$}; \node at (1.8,-0.7){$\nu_2$}; \node at (2.1,-1.5){$\nu_1$}; \draw[<->] (2.4,0.7)--++(0,-2.8); \node at (3,-0.7){$Q_{\tau}$}; \draw (2.43-0.8,-2.27+0.5)++(0.05,-0.05)--++(0.14,0.14); \draw (2.43-0.8,0.87-0.5)++(0.05,0.05)--++(0.14,-0.14); \end{tikzpicture}\nonumber\\ =&\sum_{\nu_1\nu_2}C_{\nu_1\nu_2^t\lambda_1}(\mathfrak{t},\mathfrak{q})C_{\nu_2\nu_1^t\lambda_2}(\mathfrak{t},\mathfrak{q})(-Q_{\tau}Q_{5,1}^{-1})^{|\nu_1|}f_{\nu_1}(\mathfrak{q},\mathfrak{t})^{-1}(-Q_{5,1})^{|\nu_2|}f_{\nu_2}(\mathfrak{q},\mathfrak{t})^{-1}\nonumber\\ =&\mathfrak{q}^{\frac{||\mu_{5,1}||^2+||\mu_{5,2}||^2}{2}}\tilde{Z}_{\mu_{5,1}}(\mathfrak{t},\mathfrak{q})\tilde{Z}_{\mu_{5,2}}(\mathfrak{t},\mathfrak{q})\sum_{\nu_i\eta_i}\left(Q_{\tau}Q_{5,1}^{-1}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}}\right)^{|\nu_1|}\left(Q_{5,1}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}}\right)^{|\nu_2|}\left(\frac{\mathfrak{q}}{\mathfrak{t}}\right)^{\frac{|\eta_1|+|\eta_2|}{2}} \nonumber\\ &\times s_{\nu_1^t/\eta_1}(\mathfrak{t}^{-\rho}\mathfrak{q}^{-\mu_{5,1}})s_{\nu_2^t/\eta_1}(\mathfrak{q}^{-\rho}\mathfrak{t}^{-\mu_{5,1}^t})s_{\nu_2^t/\eta_2}(\mathfrak{t}^{-\rho}\mathfrak{q}^{-\mu_{5,2}})s_{\nu_1^t/\eta_2}(\mathfrak{q}^{-\rho}\mathfrak{t}^{-\mu_{5,2}^t}). \label{eq:str9} \end{align} We can further rewrite the above expression by using the Cauchy identities repeatedly \cite{Haghighat:2013gba} \footnote{See Appendix \ref{app:formulas} for more details of how to compute the vertical periodic strip.}, \begin{align} &\begin{tikzpicture}[scale=.6,thick,baseline = -15] \draw (0,0)--++(1.4,0) coordinate (a)--++(0,-1.4) coordinate (b)--++(-1.4,0); \draw (a)--++(0.7,0.7); \draw (b)--++(0.7,-0.7); \node at (0.8,0.33){$\mu_{5,1}$}; \node at (0.8,-1.06){$\mu_{5,2}$}; \draw[<->] (-0.2,0)--++(0,-1.4); \node at (-0.9,-0.7){$Q_{5,1}$}; \draw (2.43-0.8,-2.27+0.5)++(0.05,-0.05)--++(0.14,0.14); \draw (2.43-0.8,0.87-0.5)++(0.05,0.05)--++(0.14,-0.14); \draw[<->] (2.4,0.7)--++(0,-2.8); \node at (3,-0.7){$Q_{\tau}$}; \end{tikzpicture}\nonumber\\ =&\mathfrak{q}^{\frac{||\mu_{5,1}||^2+||\mu_{5,2}||^2}{2}}\tilde{Z}_{\mu_{5,1}}(\mathfrak{t},\mathfrak{q})\tilde{Z}_{\mu_{5,2}}(\mathfrak{t},\mathfrak{q})\prod_{l=1}^{\infty}\frac{1}{1-Q_{\tau}^l}\nonumber\\ &\times\prod_{n=1}^{\infty}\frac{1}{\mathcal{R}_{\mu_{5,2}^t\mu_{5,1}}(Q_{\tau}^nQ_{5,1}^{-1}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\mathcal{R}_{\mu_{5,1}^t\mu_{5,2}}(Q_{\tau}^{n-1}Q_{5,1}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\mathcal{R}_{\mu_{5,1}^t\mu_{5,1}}(Q_{\tau}^n\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\mathcal{R}_{\mu_{5,2}^t\mu_{5,2}}(Q_{\tau}^n\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})}. \label{eq:rt_half} \end{align} We can immediately obtain the other half SU(2) subdiagram based on \eqref{eq:rt_half} since they are mirror images to each other, \begin{align} &\begin{tikzpicture}[scale=.6,thick,baseline = -15] \draw (0,0)--++(-1.4,0) coordinate (a)--++(0,-1.4) coordinate (b)--++(1.4,0); \draw (a)--++(-0.7,0.7); \draw (b)--++(-0.7,-0.7); \node at (-0.6,0.33){$\mu_{5,1}$}; \node at (-0.6,-1.06){$\mu_{5,2}$}; \draw[<->] (0.2,0)--++(0,-1.4); \node at (1,-0.7){$Q_{5,1}$}; \draw[<->] (-2.4,0.7)--++(0,-2.8); \node at (-2.95,-0.7){$Q_{\tau}$}; \draw (-2.43+0.8,-2.27+0.5)++(-0.05,-0.05)--++(-0.14,0.14); \draw (-2.43+0.8,0.87-0.5)++(-0.05,0.05)--++(-0.14,-0.14); \end{tikzpicture}\nonumber\\ =&\mathfrak{t}^{\frac{||\mu_{5,1}^t||^2+||\mu_{5,2}^t||^2}{2}}\tilde{Z}_{\mu_{5,1}^t}(\mathfrak{q},\mathfrak{t})\tilde{Z}_{\mu_{5,2}^t}(\mathfrak{q},\mathfrak{t})\prod_{l=1}^{\infty}\frac{1}{1-Q_{\tau}^l}\nonumber\\ &\times\prod_{n=1}^{\infty}\frac{1}{\mathcal{R}_{\mu_{5,2}^t\mu_{5,1}}(\frac{Q_{\tau}^n}{Q_{5,1}}\sqrt{\frac{\mathfrak{q}}{\mathfrak{t}}})\mathcal{R}_{\mu_{5,1}^t\mu_{5,2}}(Q_{\tau}^{n-1}Q_{5,1}\sqrt{\frac{\mathfrak{q}}{\mathfrak{t}}})\mathcal{R}_{\mu_{5,1}^t\mu_{5,1}}(Q_{\tau}^n\sqrt{\frac{\mathfrak{q}}{\mathfrak{t}}})\mathcal{R}_{\mu_{5,2}^t\mu_{5,2}}(Q_{\tau}^n\sqrt{\frac{\mathfrak{q}}{\mathfrak{t}}})}. \label{eq:lf_half} \end{align} By Substituting \eqref{eq:lf_half} and \eqref{eq:rt_half} into \eqref{eq:mid_SU2}, we get \begin{align}\label{eq:D4ZSU21} Z_{\mu_{5,1}\mu_{5,2}}^{\text{SU(2)}}=&\prod_{l=1}^{\infty}\frac{1}{(1-Q_{\tau}^l)^2}\prod_{n=1}^{\infty}\mathcal{M}(Q_{\tau}^n)^2\mathcal{M}(Q_{\tau}^n\tfrac{\mathfrak{t}}{\mathfrak{q}})^2\mathcal{M}(Q_{\tau}^nQ_{5,1}^{-1})\mathcal{M}(Q_{\tau}^nQ_{5,1}^{-1}\tfrac{\mathfrak{t}}{\mathfrak{q}})\nonumber\\ &\times \mathcal{M}(Q_{\tau}^{n-1}Q_{5,1})\mathcal{M}(Q_{\tau}^{n-1}Q_{5,1}\tfrac{\mathfrak{t}}{\mathfrak{q}})\hat{Z}_{\mu_{5,1}\mu_{5,2}}^{\text{SU(2)}}, \end{align} where \begin{align} \hat{Z}_{\mu_{5,1}\mu_{5,2}}^{\text{SU(2)}}\equiv&~\mathfrak{t}^{||\mu_{5,1}^t||^2}\mathfrak{q}^{||\mu_{5,2}||^2}Q_{5}^{|\mu_{5,1}|+|\mu_{5,2}|}\tilde{Z}_{\mu_{5,1}}(\mathfrak{t},\mathfrak{q})\tilde{Z}_{\mu_{5,2}}(\mathfrak{t},\mathfrak{q})\tilde{Z}_{\mu_{5,1}^t}(\mathfrak{q},\mathfrak{t})\tilde{Z}_{\mu_{5,2}^t}(\mathfrak{q},\mathfrak{t})\nonumber\\ &\times\!\bigg(\prod_{n=1}^{\infty}\mathcal{N}_{\mu_{5,2}\mu_{5,1}}\!(Q_{\tau}^nQ_{5,1}^{-1})\mathcal{N}_{\mu_{5,2}\mu_{5,1}}\!(Q_{\tau}^nQ_{5,1}^{-1}\tfrac{\mathfrak{t}}{\mathfrak{q}})\mathcal{N}_{\mu_{5,1}\mu_{5,2}}\!(Q_{\tau}^{n-1}Q_{5,1})\mathcal{N}_{\mu_{5,1}\mu_{5,2}}\!(Q_{\tau}^{n-1}Q_{5,1}\tfrac{\mathfrak{t}}{\mathfrak{q}})\nonumber\\ &\qquad \times\mathcal{N}_{\mu_{5,1}\mu_{5,1}}(Q_{\tau}^n)\mathcal{N}_{\mu_{5,1}\mu_{5,1}}(Q_{\tau}^n\tfrac{\mathfrak{t}}{\mathfrak{q}})\mathcal{N}_{\mu_{5,2}\mu_{5,2}}(Q_{\tau}^n)\mathcal{N}_{\mu_{5,2}\mu_{5,2}}(Q_{\tau}^n\tfrac{\mathfrak{t}}{\mathfrak{q}})\!\bigg)^{-1}\ . \label{eq:nor_su2} \end{align} The numerator of \eqref{eq:sub_mu1} consists of two strips glued by a horizontal edge: \begin{equation} \begin{tikzpicture}[scale=.6,thick,baseline = -15] \draw (0,0)--++(1,0) coordinate (a)--++(0,1); \draw (a)--++(.7,-.7) coordinate (c)--++(0,-.7) coordinate (b)--++(-1.7,0); \draw (b)--++(1,-1); \draw (c)--++(1,0) coordinate (d)--++(0,1.3); \draw (d)--++(.7,-.7); \node at (0.4,0.33){$\mu_{5,1}$}; \node at (0.8,-1.06){$\mu_{5,2}$}; \node at (2.35,-1.1){$\mu_{1,1}$}; \draw (0.9,0.8)--(1.1,0.8); \draw (2.43,-2.27)--++(0.14,0.14); \draw (2.6,0.4-0.2)--++(0.2,0); \draw (2.6,0.32-0.2)--++(0.2,0); \draw (2.7,-0.7)++(0.57-0.07,-0.57-0.07)--++(0.14,0.14); \draw (2.7,-0.7)++(0.51-0.07,-0.51-0.07)--++(0.14,0.14); \draw[<->] (-0.2,0)--++(0,-1.4); \node at (-0.9,-0.7){$Q_{5,1}$}; \draw[<->] (1,0.47)--node[midway,anchor=south]{$Q_{1}$}++(1.7,0); \draw[<->] (3.55,0.7)--++(0,-2.8); \node at (4.15,-0.7){$Q_{\tau}$}; \end{tikzpicture} =\sum_{\mu_{1,1}}(-Q_{1}Q_{5,1}^{-\frac{1}{2}})^{|\mu_{1,1}|}\times \begin{tikzpicture}[scale=.6,thick,baseline = -15] \draw (0,0)--++(1,0) coordinate (a)--++(0,1); \draw (a)--++(.7,-.7) coordinate (c)--++(0,-.7) coordinate (b)--++(-1.7,0); \draw (b)--++(1,-1); \draw (c)--++(1,0) coordinate (d); \node at (0.4,0.33){$\mu_{5,1}$}; \node at (0.8,-1.06){$\mu_{5,2}$}; \node at (2.35,-1.1){$\mu_{1,1}$}; \draw (0.9,0.8)--(1.1,0.8); \draw (2.43,-2.27)--++(0.14,0.14); \draw[<->] (-0.2,0)--++(0,-1.4); \node at (-0.85,-0.7){$Q_{5,1}$}; \draw[<->] (3.55-0.6,0.7)--++(0,-2.8); \node at (3.55,-0.7){$Q_{\tau}$}; \end{tikzpicture}\times \begin{tikzpicture}[scale=.6,thick,baseline = -15] \draw (1.7,-0.7)--++(1,0) coordinate (d)--++(0,1.3); \draw (d)--++(.7,-.7); \node at (2.35,-1.1){$\mu_{1,1}$}; \draw (2.6,0.4)--++(0.2,0); \draw (2.6,0.32)--++(0.2,0); \draw (2.7,-0.7)++(0.57-0.07,-0.57-0.07)--++(0.14,0.14); \draw (2.7,-0.7)++(0.51-0.07,-0.51-0.07)--++(0.14,0.14); \draw[<->] (3.55,0.7)--++(0,-2.8); \node at (4.15,-0.7){$Q_{\tau}$}; \end{tikzpicture}\label{eq:t56} \end{equation} We compute the two strips separately: \begin{align} &\begin{tikzpicture}[scale=.6,thick,baseline = -15] \draw (0,0)--++(1,0) coordinate (a)--++(0,1); \draw (a)--++(.7,-.7) coordinate (c)--++(0,-.7) coordinate (b)--++(-1.7,0); \draw (b)--++(1,-1); \draw (c)--++(1,0) coordinate (d); \node at (0.4,0.33){$\mu_{5,1}$}; \node at (0.8,-1.06){$\mu_{5,2}$}; \node at (2.35,-1.1){$\mu_{1,1}$}; \draw (0.9,0.8)--(1.1,0.8); \draw (2.43,-2.27)--++(0.14,0.14); \draw[<->] (-0.2,0)--++(0,-1.4); \node at (-0.9,-0.7){$Q_{5,1}$}; \draw[<->] (3.55-0.6,0.7)--++(0,-2.8); \node at (3.55,-0.7){$Q_{\tau}$}; \end{tikzpicture}=\sum_{\nu_1\nu_2\nu_3} \begin{tikzpicture}[scale=.6,thick,baseline = -15] \draw (0,0)--++(1,0) coordinate (a)--++(0,1); \draw (a)--++(.7,-.7) coordinate (c)--++(0,-.7) coordinate (b)--++(-1.7,0); \draw (b)--++(1,-1); \draw (c)--++(1,0) coordinate (d); \node at (0.4,0.33){$\mu_{5,1}$}; \node at (0.6,-1.06){$\mu_{5,2}$}; \node at (2.35,-1.1){$\mu_{1,1}$}; \draw (0.9,0.8)--(1.1,0.8); \draw (2.43,-2.27)--++(0.14,0.14); \draw[<->] (-0.2,0)--++(0,-1.4); \node at (-0.85,-0.7){$Q_{5,1}$}; \draw[<->] (3.55-0.6,0.7)--++(0,-2.8); \node at (3.45,-0.7){$Q_{\tau}$}; \node at (1.4,0.5){$\nu_1$}; \node at (1.7,-0.2){$\nu_2$}; \node at (1.4,-1){$\nu_3$}; \node at (1.9,-2){$\nu_1$}; \end{tikzpicture}\nonumber\\ =&\sum_{\nu_1\nu_2\nu_3}C_{\nu_1\nu_2^t\mu_{5,1}}(\mathfrak{t},\mathfrak{q})C_{\nu_3^t\nu_2\mu_{1,1}^t}(\mathfrak{q},\mathfrak{t})C_{\nu_3\nu_1^t\mu_{5,2}}(\mathfrak{t},\mathfrak{q})(-\frac{Q_{\tau}}{Q_{5,1}})^{|\nu_1|}\tilde{f}_{\nu_1}(\mathfrak{q},\mathfrak{t})^{-1}(-Q_{5,1}^{1/2})^{|\nu_2|}(-Q_{5,1}^{1/2})^{|\nu_3|}\nonumber\\ =&\mathfrak{q}^{\frac{1}{2}(||\mu_{5,1}||^2+||\mu_{5,2}||^2)}\mathfrak{t}^{\frac{1}{2}||\mu_{1,1}^t||^2}\tilde{Z}_{\mu_{5,1}}(\mathfrak{t},\mathfrak{q})\tilde{Z}_{\mu_{5,2}}(\mathfrak{t},\mathfrak{q})\tilde{Z}_{\mu_{1,1}^t}(\mathfrak{q},\mathfrak{t})\prod_{l=1}^{\infty}\frac{1}{1-Q_{\tau}^l}\nonumber\\ \times&\prod_{n=1}^{\infty}\frac{\mathcal{R}_{\mu_{1,1}^t\mu_{5,1}}(Q_{\tau}^nQ_{5,1}^{-1/2})\mathcal{R}_{\mu_{5,1}^t\mu_{1,1}}(Q_{\tau}^{n-1}Q_{5,1}^{1/2})\mathcal{R}_{\mu_{5,2}^t\mu_{1,1}}(Q_{\tau}^nQ_{5,1}^{-1/2})\mathcal{R}_{\mu_{1,1}^t\mu_{5,2}}(Q_{\tau}^{n-1}Q_{5,1}^{1/2})}{\mathcal{R}_{\mu_{5,2}^t\mu_{5,1}}(Q_{\tau}^nQ_{5,1}^{-1}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\mathcal{R}_{\mu_{5,1}^t\mu_{5,2}}(Q_{\tau}^{n-1}Q_{5,1}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\mathcal{R}_{\mu_{5,1}^t\mu_{5,1}}(Q_{\tau}^n\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\mathcal{R}_{\mu_{5,2}^t\mu_{5,2}}(Q_{\tau}^n\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\mathcal{R}_{\mu_{1,1}^t\mu_{1,1}}(Q_{\tau}^n\sqrt{\frac{\mathfrak{q}}{\mathfrak{t}}})}\label{eq:t5}\\ &\begin{tikzpicture}[scale=.6,thick,baseline = -15] \draw (1.7,-0.7)--++(1,0) coordinate (d)--++(0,1.3); \draw (d)--++(.7,-.7); \node at (2.35,-1.1){$\mu_{1,1}$}; \draw (2.6,0.4)--++(0.2,0); \draw (2.6,0.32)--++(0.2,0); \draw (2.7,-0.7)++(0.57-0.07,-0.57-0.07)--++(0.14,0.14); \draw (2.7,-0.7)++(0.51-0.07,-0.51-0.07)--++(0.14,0.14); \draw[<->] (3.55,0.7)--++(0,-2.8); \node at (4.05,-0.7){$Q_{\tau}$}; \end{tikzpicture}=\sum_{\nu_4} \begin{tikzpicture}[scale=.6,thick,baseline = -15] \draw (1.7,-0.7)--++(1,0) coordinate (d)--++(0,1.3); \draw (d)--++(.7,-.7); \node at (2.2,-1.1){$\mu_{1,1}$}; \draw (2.6,0.4)--++(0.2,0); \draw (2.6,0.32)--++(0.2,0); \draw (2.7,-0.7)++(0.57-0.07,-0.57-0.07)--++(0.14,0.14); \draw (2.7,-0.7)++(0.51-0.07,-0.51-0.07)--++(0.14,0.14); \draw[<->] (3.55,0.7)--++(0,-2.8); \node at (4.05,-0.7){$Q_{\tau}$}; \node at (3.08,-0.1){$\nu_4$}; \node at (2.9,-1.6){$\nu_4$}; \end{tikzpicture}\nonumber\\ =&\sum_{\nu_4}C_{\nu_4\nu_4^t\mu_{1,1}}(\mathfrak{t},\mathfrak{q})(-Q_{\tau})^{|\nu_4|}\tilde{f}_{\nu_4}(\mathfrak{q},\mathfrak{t})^{-1}= \mathfrak{q}^{\frac{||\mu_{1,1}||^2}{2}}\tilde{Z}_{\mu_{1,1}}(\mathfrak{t},\mathfrak{q})\prod_{l=1}^{\infty}\frac{1}{1-Q_{\tau}^l}\prod_{n=1}^{\infty}\frac{1}{\mathcal{R}_{\mu_{1,1}^t\mu_{1,1}}(Q_{\tau}^n\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})}\label{eq:t6} \end{align} By combining all results, we find \begin{align} &Z_{\mu_{5,1}\mu_{5,2}\mu_{1,1}}(Q_{5,1},Q_{\tau},Q_{1})\nonumber\\ =&\prod_{l=1}^{\infty}\frac{1}{1-Q_{\tau}^l}\prod_{n=1}^{\infty}\frac{\mathcal{M}(Q_{\tau}^n)\mathcal{M}(Q_{\tau}^n\frac{\mathfrak{t}}{\mathfrak{q}})}{\mathcal{M}(Q_{\tau}^nQ_{5,1}^{-1/2}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})^2\mathcal{M}(Q_{\tau}^{n-1}Q_{5,1}^{1/2}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})^2}\times\hat{Z}_{\mu_{5,1}\mu_{5,2}\mu_{1,1}}(Q_{5,1},Q_{\tau},Q_{1}), \label{eq:Zofsubmu1} \end{align} where \begin{multline} \hat{Z}_{\mu_{5,1}\mu_{5,2}\mu_{1,1}}(Q_{5,1},Q_{\tau},Q_{1})\equiv\mathfrak{q}^{\frac{||\mu_{1,1}||^2}{2}}\mathfrak{t}^{\frac{||\mu_{1,1}^t||^2}{2}}(-Q_{1}Q_{5,1}^{-\frac{1}{2}})^{|\mu_{1,1}|}\tilde{Z}_{\mu_{1,1}}(\mathfrak{t},\mathfrak{q})\tilde{Z}_{\mu_{1,1}^t}(\mathfrak{q},\mathfrak{t})\\ \times \prod_{n=1}^{\infty}\frac{\mathcal{N}_{\mu_{1,1}\mu_{5,1}}(Q_{\tau}^nQ_{5,1}^{-1/2}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\mathcal{N}_{\mu_{5,1}\mu_{1,1}}(Q_{\tau}^{n-1}Q_{5,1}^{1/2}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\mathcal{N}_{\mu_{5,2}\mu_{1,1}}(Q_{\tau}^nQ_{5,1}^{-1/2}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\mathcal{N}_{\mu_{1,1}\mu_{5,2}}(Q_{\tau}^{n-1}Q_{5,1}^{1/2}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})}{\mathcal{N}_{\mu_{1,1}\mu_{1,1}}(Q_{\tau}^n)\mathcal{N}_{\mu_{1,1}\mu_{1,1}}(Q_{\tau}^n\frac{\mathfrak{t}}{\mathfrak{q}})}. \label{eq:nor_submu1} \end{multline} Since the other three subdiagrams in the three corners of figure \ref{fig:D4_quad}(a) can be obtained from the upper right one by either an $SL(2,\mathbb{Z})$ tilting or mirror reflection and then tuning the length of the SU(1) color brane, correspondingly $Z_{\mu_{5,1}\mu_{5,2}\mu_{2,1}}$,$Z_{\mu_{5,1}\mu_{5,2}\mu_{3,1}}$ and $Z_{\mu_{5,1}\mu_{5,2}\mu_{4,1}}$ can be easily obtained from $Z_{\mu_{5,1}\mu_{5,2}\mu_{1,1}}$ via replacing $\mu_{1,1}$ and $Q_{1}$ by $\mu_{2,1},\mu_{3,1},\mu_{4,1}$ and $Q_{2},Q_{3},Q_{4}$. \bigskip \paragraph{$\mathcal{N}$ function to $\varTheta$ function.} In order to simplify the expression of the partition function, we replace the $\mathcal{N}$ functions in \eqref{eq:nor_su2} and \eqref{eq:nor_submu1} by Jacobi theta functions via the following formulas\footnote{The identities $\sum_{(i,j)\in\lambda}\lambda_i=||\lambda||^2$, $\sum_{(i,j)\in\lambda}j=\frac{1}{2}|\lambda|+\frac{1}{2}||\lambda||^2$, $\sum_{(i,j)\in\lambda}\mu_j^t=\sum_{(i,j)\in\mu}\lambda_j^t$ are used to derive these formulas.} \begin{align} &\prod_{n=1}^{\infty}\mathcal{N}_{\beta\alpha}(Q_{\tau}^nQ^{-1}\tfrac{\mathfrak{t}}{\mathfrak{q}};\mathfrak{t},\mathfrak{q})\mathcal{N}_{\alpha\beta}(Q_{\tau}^{n-1}Q;\mathfrak{t},\mathfrak{q})\nonumber\\ &\quad=\frac{(-1)^{|\beta|}(Q\sqrt{\frac{\mathfrak{q}}{\mathfrak{t}}})^{\frac{|\beta|+|\alpha|}{2}}\mathfrak{t}^{\frac{||\beta^t||^2-||\alpha^t||^2}{4}}\mathfrak{q}^{\frac{-||\beta||^2+||\alpha||^2}{4}}}{\left(\prod_{n=1}^{\infty}(1-Q_{\tau}^n)\right)^{|\beta|+|\alpha|}}\varTheta_{\beta\alpha}(Q^{-1}\tfrac{\mathfrak{t}}{\mathfrak{q}}|Q_{\tau})\varTheta_{\alpha\beta}(Q|Q_{\tau})\ , \label{eq:Ntotheta1} \\ &\tilde{Z}_{\alpha}(\mathfrak{t},\mathfrak{q})^{-1}\tilde{Z}_{\alpha^t}(\mathfrak{q},\mathfrak{t})^{-1}\prod_{n=1}^{\infty}\mathcal{N}_{\alpha\alpha}(Q_{\tau}^n;\mathfrak{t},\mathfrak{q})\mathcal{N}_{\alpha\alpha}(Q_{\tau}^n\tfrac{\mathfrak{t}}{\mathfrak{q}};\mathfrak{t},\mathfrak{q})\nonumber\\ &\quad=\frac{\mathfrak{t}^{\frac{||\alpha^t||^2}{2}}\mathfrak{q}^{\frac{||\alpha||^2}{2}}}{\left(\prod_{n=1}^{\infty}(1-Q_{\tau}^n)\right)^{2|\alpha|}}\varTheta_{\alpha\alpha}(\tfrac{\mathfrak{t}}{\mathfrak{q}}|Q_{\tau})\varTheta_{\alpha\alpha}(1|Q_{\tau})\ , \label{eq:Ntotheta2} \end{align} where we have defined a $\varTheta$ as a function of the Jacobi theta function $\theta_1$, \begin{align} \theta_1(y|Q_{\tau})=&i\sum_{n=-\infty}^{\infty}(-1)^{n+1}Q_{\tau}^{\frac12(n+\frac12)^2}y^{n+\frac12}=-iQ_{\tau}^{\frac18}\sum_{n=0}^{\infty}(-1)^nQ_{\tau}^{\frac{n(n+1)}{2}}(y^{n+\frac12}-y^{-n-\frac12}), \end{align} \begin{align} &\varTheta_{\alpha\beta}(Q|Q_{\tau})\nonumber\\ \equiv&\prod_{(i,j)\in\alpha}\left((-i Q_{\tau}^{\frac18})^{-1}\theta_1(Q^{-1}\mathfrak{t}^{-\beta_j^t+i}\mathfrak{q}^{-\alpha_i+j-1}|Q_{\tau})\right)\nonumber\\ =&\prod_{(i,j)\in\alpha}\left[\sum_{n=0}^{\infty}(-1)^nQ_{\tau}^{\frac{n(n+1)}{2}}\Big((Q^{-1}\mathfrak{t}^{-\beta_j^t+i}\mathfrak{q}^{-\alpha_i+j-1})^{n+\frac12}-(Q^{-1}\mathfrak{t}^{-\beta_j^t+i}\mathfrak{q}^{-\alpha_i+j-1})^{-n-\frac12}\Big)\right]. \end{align} Note that unlike the $\mathcal{N}_{\alpha\beta}$ function defined in \eqref{eq:curlyN}, the $\varTheta_{\alpha\beta}$ function has only the product over $\alpha$ in the definition. In \eqref{eq:nor_su2} and \eqref{eq:nor_submu1}, we encounter the following kind of factor \begin{equation} \prod_{n=1}^\infty\mathcal{N}_{\sigma\rho}(Q_{\tau}^{n-1}\frac{Q_{\tau}}{Q_{\Delta}}\frac{\mathfrak{t}/\mathfrak{q}}{X})\mathcal{N}_{\rho\sigma}(Q_{\tau}^{n-1}Q_{\Delta}X), \label{eq:NtothetaEpl} \end{equation} where the vertical position of the brane labelled by Young diagram $\rho$ is higher than the vertical position of the brane labelled by Young diagram $\sigma$ in the fundamental region\footnote{In figure \ref{fig:D4_quad}(a) each of the quadrivalent gluing subdiagrams are vertically periodic, and the particular one period of each subdiagram that is shown in the figure is called the fundamental region.} of the web diagram, $Q_{\Delta}\equiv e^{-\boldsymbol{\beta}\,d}$ is the vertical distance in K\"ahler parameter between the two branes in the fundamental region where $d$ is the vertical distance, and $X$ is $\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}}$, $\frac{\mathfrak{t}}{\mathfrak{q}}$, or 1. When we apply \eqref{eq:Ntotheta1} to \eqref{eq:NtothetaEpl}, we have two choices, \begin{align} &Q_{\Delta}X\rightarrow Q\quad\text{and}\quad\rho,\sigma\rightarrow\alpha,\beta, \label{eq:choice} \end{align} or \begin{align} &\frac{Q_{\tau}}{Q_{\Delta}}\frac{\mathfrak{t}/\mathfrak{q}}{X}\rightarrow Q\quad\text{and}\quad\sigma,\rho\rightarrow\alpha,\beta. \end{align} These two choices lead to two different expressions involving $\varTheta$ functions, and we choose the former one which turns out to make the expression of the partition function simpler. \bigskip \paragraph{Expression of $Z^{D_4}$.} Before we write down the final expression of the partition function of the $D_4$ LST, we need to define some new parameters and symbols to make the expression of partition function tidy. In the fundamental region, let us consider the $k$-th color brane of the $I$-th gauge node whose corresponding Young diagram is denoted by $\mu_{I,k}$. If the vertical position of the color brane is $a_{I,k}$, then we name the corresponding K\"ahler parameter as $y_{I,k}$ \begin{equation}\label{eq:defofy} y_{I,k}=e^{-\boldsymbol{\beta} a_{I,k}}\ . \end{equation} The periodic conditions \eqref{eq:D4PDcond1} and \eqref{eq:D4PDcond2} for the $D_4$ LST in terms of $y_{I,k}$ become \begin{align} y_{1,1}=1,\ y_{2,1}=1,\ y_{3,1}=1,\ y_{4,1}=1,\ y_{5,1}y_{5,2}=1, \end{align} where we have set the vertical position $a_{1,1}=0$. Next we define a following symbol \begin{equation} {\textit{\textbf{n}}}_{I,k;J,\ell}\equiv\left\{\begin{array}{ll} n-1,&\quad\text{if}\ a_{I,k}>a_{J,\ell},\\ n,&\quad\text{if}\ a_{I,k}<a_{J,\ell}\ \text{or}\ (I,k)=(J,\ell) \, . \end{array}\right. \end{equation} By using these notations, transforming $\mathcal{N}$ functions to $\varTheta$ functions, and substituting \eqref{eq:D4ZSU21}, \eqref{eq:nor_su2}, \eqref{eq:Zofsubmu1} and \eqref{eq:nor_submu1} into \eqref{eq:Z_D4}, $Z^{D_4}$ is expressed as the follows, \begin{equation} Z^{D_4}=Z^{D_4}_{\text{pert}}\cdot Z^{D_4}_{\text{inst}}\ , \end{equation} where \begin{align}\label{eq:D4pert} Z^{D_4}_{\text{pert}} &=\prod_{n=1}^{\infty}\prod_{I=1}^4\frac{\mathcal{M}(\frac{\mathfrak{t}}{\mathfrak{q}}Q_{\tau}^{{\textit{\textbf{n}}}_{I,1;I,1}})\mathcal{M}(Q_{\tau}^{{\textit{\textbf{n}}}_{I,1;I,1}})}{\prod_{l=1}^2\mathcal{M}(\frac{y_{I,1}}{y_{5,\ell}}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}}Q_{\tau}^{{\textit{\textbf{n}}}_{I,1;5,l}})}\prod_{p=1}^2\frac{\prod_{r=1}^2\mathcal{M}(\frac{y_{5,p}}{y_{5,r}}\frac{\mathfrak{t}}{\mathfrak{q}}Q_{\tau}^{{\textit{\textbf{n}}}_{5,p;5,r}})\mathcal{M}(\frac{y_{5,p}}{y_{5,r}}Q_{\tau}^{{\textit{\textbf{n}}}_{5,p;5,r}})}{\prod_{J=1}^4\mathcal{M}(\frac{y_{5,p}}{y_{J,1}}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}}Q_{\tau}^{{\textit{\textbf{n}}}_{5,p;J,1}})}\nonumber\\ &\quad \times\prod_{l=1}^{\infty}\frac{1}{(1-Q_{\tau}^l)^6}, \\ \label{eq:D4inst} Z_{\text{inst}}^{D_4} =&\sum_{\boldsymbol{\mu}}\prod_{I=1}^4\bigg(Q_{I}^{|\mu_{I,1}|} \frac{\prod_{l=1}^{2}\varTheta_{\mu_{I,1}\mu_{5,l}}(\frac{y_{I,1}}{y_{5,l}}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}}|Q_{\tau})}{\varTheta_{\mu_{I,1}\mu_{I,1}}(1|Q_{\tau})\varTheta_{\mu_{I,1}\mu_{I,1}}(\tfrac{\mathfrak{t}}{\mathfrak{q}}|Q_{\tau})}\bigg)\nonumber\\ \qquad &\times\prod_{p=1}^{2}Q_{5}^{|\mu_{5,p}|}\frac{\prod_{J=1}^4\varTheta_{\mu_{5,p}\mu_{J,1}}(\frac{y_{5,p}}{y_{J,1}}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}}|Q_{\tau})}{\prod_{r=1}^{2}\varTheta_{\mu_{5,p}\mu_{5,r}}(\frac{y_{5,p}}{y_{5,r}}|Q_{\tau})\varTheta_{\mu_{5,p}\mu_{5,r}}(\frac{y_{5,p}}{y_{5,r}}\tfrac{\mathfrak{t}}{\mathfrak{q}}|Q_{\tau})} \, . \end{align} We will deal with general higher rank case of LSTs in section \ref{sec:higherRanks}, where we will write the perturbative part of partition functions in terms of Plethystic exponential (PE for short). The resulting PE form will be much simpler than \eqref{eq:D4pert}. \subsection{LST on \texorpdfstring{$D_5$}{D5} singularity} \begin{figure}[htbp] \centering \includegraphics[scale=0.5]{D5wON.pdf} \caption{$D_5$ LST with ON-planes} \label{fig:D5wON} \end{figure} \begin{figure}[htbp] \centering \includegraphics[scale=0.5]{D5wQuadra.pdf} \caption{$D_5$ LST with trivalent gluing. } \label{fig:D5wQuadra} \end{figure} Similar to the $D_4$ LST, the $D_5$ LST can be realized by the web diagram with ON-planes in figure \ref{fig:D5wON}. We propose that it can also be realized by the trivalent gluing\footnote{The two SU(1) subdiagrams on the left are trivalent glued with the left SU(2) gauge node of the middle subdiagram, and the two SU(1) subdiagrams on the right are trivalent glued with the right SU(2) gauge node of the middle subdiagram. } in figure \ref{fig:D5wQuadra}, where we have labelled the K\"ahler parameters and Young diagrams. In particular, we use Young diagram $\mu_{I,j}$ to label the $j$-th color brane of the $I$-th gauge node. Like the $D_4$ LST case, in order to do the bivalent self-gluing consistently for each SU(1) subdiagram in figure \ref{fig:D5wQuadra}, the following conditions have to be satisfied, \begin{align}\label{eq:D5PDcond1} Q_{1;5}=Q_{2;5}=Q_{5,1}^{\frac12},\quad Q_{3;6}=Q_{4;6}=Q_{6,1}^{\frac12}\ . \end{align} For the middle SU(2)-SU(2) subdiagram in figure \ref{fig:D5wQuadra} to be vertically periodic, the following condition has to be satisfied, \begin{align}\label{eq:D5PDcond2} Q_{6;5}=Q_{5,1}^{\frac12}Q_{6,1}^{-\frac12}\ . \end{align} Then the partition function $Z^{D_5}$ of $D_5$ LST is given by using the trivalent gluing diagram in figure \ref{fig:D5wQuadra}, \begin{multline} Z^{D_5}\equiv\sum_{\mu_{5,1}\mu_{5,2}\mu_{6,1}\mu_{6,2}}Z^{\text{SU(2)-SU(2)}}_{\mu_{5,1}\mu_{5,2}\mu_{6,1}\mu_{6,2}}\sum_{\mu_{1,1}}Z_{\mu_{5,1}\mu_{5,2}\mu_{1,1}}(Q_{5,1},Q_{\tau},Q_{1})\sum_{\mu_{2,1}}Z_{\mu_{5,1}\mu_{5,2}\mu_{2,1}}(Q_{5,1},Q_{\tau},Q_{2})\\ \times\sum_{\mu_{3,1}}Z_{\mu_{6,1}\mu_{6,2}\mu_{3,1}}(Q_{6,1},Q_{\tau},Q_{3})\sum_{\mu_{4,1}}Z_{\mu_{6,1}\mu_{6,2}\mu_{4,1}}(Q_{6,1},Q_{\tau},Q_{4})\ , \label{eq:ZofD5} \end{multline} where the summands are defined in the following: \begin{multline} Z^{\text{SU(2)-SU(2)}}_{\mu_{5,1}\mu_{5,2}\mu_{6,1}\mu_{6,2}}=\left(-Q_{6}\sqrt{\frac{Q_{6,1}}{Q_{5,1}}}\right)^{|\mu_{6,1}|+|\mu_{6,2}|}(-Q_{5})^{|\mu_{5,1}|+|\mu_{5,2}|}f_{\mu_{5,1}}(\mathfrak{t},\mathfrak{q})f_{\mu_{5,2}}(\mathfrak{t},\mathfrak{q})^{-1}\\ \times \begin{tikzpicture}[scale=.6,thick,baseline = -15] \draw (-0.2,-0.2)--++(-1,0) coordinate (c)--++(0,-1) coordinate (d)--++(1,0); \draw (c)--++(-0.9,0.9); \draw (d)--++(-0.9,-0.9); \node at (-0.6,0.15){$\mu_{6,1}$}; \node at (-0.6,-1.55){$\mu_{6,2}$}; \draw[<->] (0,-0.2)--++(0,-1); \node at (0.8,-0.7){$Q_{6,1}$}; \draw[<->] (-2.4,0.7)--++(0,-2.8); \node at (-2.85,-0.7){$Q_{\tau}$}; \draw (-2.43+0.8,-2.27+0.5)++(-0.05,-0.05)--++(-0.14,0.14); \draw (-2.43+0.8,0.87-0.5)++(-0.05,0.05)--++(-0.14,-0.14); \end{tikzpicture} \times \begin{tikzpicture}[scale=.6,thick,baseline = -11.8] \draw (0,0)--++(1,0) coordinate (a)--++(0,-1) coordinate (b)--++(-1,0); \draw (a)--++(0.2,0.2) coordinate (c)--++(1.2,0); \draw (c)--++(0,0.7); \draw (b)--++(0.2,-0.2) coordinate (d)--++(1.2,0); \draw (d)--++(0,-0.7); \node at (0.5,0.35){$\mu_{6,1}$}; \node at (0.5,-1.35){$\mu_{6,2}$}; \node at (1.9,0.55){$\mu_{5,1}$}; \node at (1.9,-1.55){$\mu_{5,2}$}; \draw[<->] (-0.2,0)--++(0,-1); \node at (-0.85,-0.5){$Q_{6,1}$}; \draw[<->] (2.6,0.2)--++(0,-1.4); \node at (3.3,-0.5){$Q_{5,1}$}; \draw (1.1,0.7)--++(0.2,0); \draw (1.1,-1.7)--++(0.2,0); \draw[<->] (-1.55,0.9)--++(0,-2.8); \node at (-2,-0.5){$Q_{\tau}$}; \end{tikzpicture} \times \begin{tikzpicture}[scale=.6,thick,baseline = -15] \draw (0,0)--++(1.4,0) coordinate (a)--++(0,-1.4) coordinate (b)--++(-1.4,0); \draw (a)--++(0.7,0.7); \draw (b)--++(0.7,-0.7); \node at (0.8,0.33){$\mu_{5,1}$}; \node at (0.8,-1.06){$\mu_{5,2}$}; \draw[<->] (-0.2,0)--++(0,-1.4); \node at (-0.85,-0.7){$Q_{5,1}$}; \draw (2.43-0.8,-2.27+0.5)++(0.05,-0.05)--++(0.14,0.14); \draw (2.43-0.8,0.87-0.5)++(0.05,0.05)--++(0.14,-0.14); \draw[<->] (2.4,0.7)--++(0,-2.8); \node at (2.9,-0.7){$Q_{\tau}$}; \end{tikzpicture} \label{eq:D5mid} \end{multline} The $Z_{\mu_{\boldsymbol{\cdot}}\mu_{\boldsymbol{\cdot}}\mu_{\boldsymbol{\cdot}}}(\boldsymbol{\cdot},\boldsymbol{\cdot},\boldsymbol{\cdot})$ function is the same function defined in \eqref{eq:sub_mu1}. After computing the three subdiagrams in \eqref{eq:D5mid} and substitute the results back into \eqref{eq:D5mid}, we find \begin{multline} Z^{\text{SU(2)-SU(2)}}_{\mu_{5,1}\mu_{5,2}\mu_{6,1}\mu_{6,2}}=\prod_{n=1}^{\infty}\mathcal{M}(Q_{\tau}^n)^4\mathcal{M}(Q_{\tau}^n\frac{\mathfrak{t}}{\mathfrak{q}})^4\mathcal{M}(\frac{Q_{\tau}^n}{Q_{5,1}})\mathcal{M}(\frac{Q_{\tau}^{n}}{Q_{5,1}}\frac{\mathfrak{t}}{\mathfrak{q}})\mathcal{M}(Q_{\tau}^{n-1}Q_{5,1})\\ \times\mathcal{M}(Q_{\tau}^{n-1}Q_{5,1}\frac{\mathfrak{t}}{\mathfrak{q}})\mathcal{M}(\frac{Q_{\tau}^n}{Q_{6,1}})\mathcal{M}(\frac{Q_{\tau}^n}{Q_{6,1}}\frac{\mathfrak{t}}{\mathfrak{q}})\mathcal{M}(Q_{\tau}^{n-1}Q_{6,1})\mathcal{M}(Q_{\tau}^{n-1}Q_{6,1}\frac{\mathfrak{t}}{\mathfrak{q}})\\ \times\Big(\mathcal{M}(Q_{\tau}^nQ_{5,1}^{-\frac{1}{2}}Q_{6,1}^{-\frac{1}{2}}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})^2\mathcal{M}(Q_{\tau}^{n-1}Q_{5,1}^{\frac{1}{2}}Q_{6,1}^{\frac{1}{2}}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})^2\mathcal{M}(Q_{\tau}^nQ_{6,1}^{\frac{1}{2}}Q_{5,1}^{-\frac{1}{2}}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})^2\\ \times\mathcal{M}(Q_{\tau}^{n-1}Q_{5,1}^{\frac{1}{2}}Q_{6,1}^{-\frac{1}{2}}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})^2\Big)^{-1}\prod_{l=1}^{\infty}\frac{1}{(1-Q_{\tau}^l)^3}\times\hat{Z}^{\text{SU(2)-SU(2)}}_{\mu_{5,1}\mu_{5,2}\mu_{6,1}\mu_{6,2}}\ , \label{eq:ZofD5mid} \end{multline} where \begin{multline}\label{eq:ZhatofD5mid} \hat{Z}^{\text{SU(2)-SU(2)}}_{\mu_{5,1}\mu_{5,2}\mu_{6,1}\mu_{6,2}}=\mathfrak{q}^{\frac{2||\mu_{5,2}||^2+||\mu_{6,1}||^2+||\mu_{6,2}||^2}{2}}\mathfrak{t}^{\frac{2||\mu_{5,1}^t||^2+||\mu_{6,1}^t||^2+||\mu_{6,2}^t||^2}{2}}Q_{5}^{|\mu_{5,1}|+|\mu_{5,2}|}\left(-\frac{Q_{6}\sqrt{Q_{6,1}}}{\sqrt{Q_{5,1}}}\right)^{|\mu_{6,1}|+|\mu_{6,2}|}\\ \times\prod_{i=1}^4Z_{\lambda_i}(\mathfrak{t},\mathfrak{q})Z_{\lambda_i^t}(\mathfrak{q},\mathfrak{t})\times\prod_{n=1}^{\infty}\mathcal{N}_{\mu_{6,1}\mu_{5,1}}(Q_{\tau}^nQ_{6,1}^{\frac{1}{2}}Q_{5,1}^{-\frac{1}{2}}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\mathcal{N}_{\mu_{5,1}\mu_{6,1}}(Q_{\tau}^{n-1}Q_{5,1}^{\frac{1}{2}}Q_{6,1}^{-\frac{1}{2}}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\\ \times\mathcal{N}_{\mu_{6,2}\mu_{5,1}}(Q_{\tau}^nQ_{5,1}^{-\frac{1}{2}}Q_{6,1}^{-\frac{1}{2}}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\mathcal{N}_{\mu_{5,1}\mu_{6,2}}(Q_{\tau}^{n-1}Q_{5,1}^{\frac{1}{2}}Q_{6,1}^{\frac{1}{2}}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\mathcal{N}_{\mu_{5,2}\mu_{6,1}}(Q_{\tau}^nQ_{5,1}^{-\frac{1}{2}}Q_{6,1}^{-\frac{1}{2}}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\\ \times\mathcal{N}_{\mu_{6,1}\mu_{5,2}}(Q_{\tau}^{n-1}Q_{5,1}^{\frac{1}{2}}Q_{6,1}^{\frac{1}{2}}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\mathcal{N}_{\mu_{5,2}\mu_{6,2}}(Q_{\tau}^nQ_{6,1}^{\frac{1}{2}}Q_{5,1}^{-\frac{1}{2}}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\mathcal{N}_{\mu_{6,2}\mu_{5,2}}(Q_{\tau}^{n-1}Q_{5,1}^{\frac{1}{2}}Q_{6,1}^{-\frac{1}{2}}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\\ \times\Big(\mathcal{N}_{\mu_{5,1}\mu_{5,1}}(Q_{\tau}^n)\mathcal{N}_{\mu_{5,1}\mu_{5,1}}(Q_{\tau}^n\frac{\mathfrak{t}}{\mathfrak{q}})\mathcal{N}_{\mu_{5,1}\mu_{5,2}}(Q_{\tau}^{n-1}Q_{5,1})\mathcal{N}_{\mu_{5,1}\mu_{5,2}}(Q_{\tau}^{n-1}Q_{5,1}\frac{\mathfrak{t}}{\mathfrak{q}})\mathcal{N}_{\mu_{5,2}\mu_{5,1}}(\frac{Q_{\tau}^n}{Q_{5,1}})\\ \times\mathcal{N}_{\mu_{5,2}\mu_{5,1}}(\frac{Q_{\tau}^n}{Q_{5,1}}\frac{\mathfrak{t}}{\mathfrak{q}})\mathcal{N}_{\mu_{5,2}\mu_{5,2}}(Q_{\tau}^n)\mathcal{N}_{\mu_{5,2}\mu_{5,2}}(Q_{\tau}^n\frac{\mathfrak{t}}{\mathfrak{q}})\mathcal{N}_{\mu_{6,1}\mu_{6,1}}(Q_{\tau}^n)\mathcal{N}_{\mu_{6,1}\mu_{6,1}}(Q_{\tau}^n\frac{\mathfrak{t}}{\mathfrak{q}})\mathcal{N}_{\mu_{6,1}\mu_{6,2}}(Q_{\tau}^{n-1}Q_{6,1})\\ \times\mathcal{N}_{\mu_{6,1}\mu_{6,2}}(Q_{\tau}^{n-1}Q_{6,1}\frac{\mathfrak{t}}{\mathfrak{q}})\mathcal{N}_{\mu_{6,2}\mu_{6,1}}(\frac{Q_{\tau}^n}{Q_{6,1}})\mathcal{N}_{\mu_{6,2}\mu_{6,1}}(\frac{Q_{\tau}^n}{Q_{6,1}}\frac{\mathfrak{t}}{\mathfrak{q}})\mathcal{N}_{\mu_{6,2}\mu_{6,2}}(Q_{\tau}^n)\mathcal{N}_{\mu_{6,2}\mu_{6,2}}(Q_{\tau}^n\frac{\mathfrak{t}}{\mathfrak{q}})\Big)^{-1}\ . \end{multline} \paragraph{Expression of $Z^{D_5}$.} Using the $y$ parameters defined in \eqref{eq:defofy}, the periodic conditions in \eqref{eq:D5PDcond1} and \eqref{eq:D5PDcond2} for the $D_5$ LST become \begin{align} y_{1,1}=1,\ y_{2,1}=1,\ y_{3,1}=1,\ y_{4,1}=1,\ y_{5,1}y_{5,2}=1,\ y_{6,1}y_{6,2}=1, \end{align} where we have set $a_{1,1}=0$. Gathering all the results and rewriting $Z^{D_5}$ suitably with the help of the transformation from $\mathcal{N}$ to $\varTheta$, we find \begin{equation} Z^{D_5}=Z^{D_5}_{\text{pert}}\cdot Z^{D_5}_{\text{inst}}\ , \end{equation} where \begin{align}\label{eq:D5pert} Z^{D_5}_{\text{pert}} =&\prod_{n=1}^{\infty}\prod_{I=1}^2\frac{\mathcal{M}(\frac{\mathfrak{t}}{\mathfrak{q}}Q_{\tau}^{{\textit{\textbf{n}}}_{I,1;I,1}})\mathcal{M}(Q_{\tau}^{{\textit{\textbf{n}}}_{I,1;I,1}})}{\prod_{l=1}^2\mathcal{M}(\frac{y_{I,1}}{y_{5,l}}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}}Q_{\tau}^{{\textit{\textbf{n}}}_{I,1;5,l}})}\prod_{J=3}^4\frac{\mathcal{M}(\frac{\mathfrak{t}}{\mathfrak{q}}Q_{\tau}^{{\textit{\textbf{n}}}_{J,1;J,1}})\mathcal{M}(Q_{\tau}^{{\textit{\textbf{n}}}_{J,1;J,1}})}{\prod_{k=1}^2\mathcal{M}(\frac{y_{J,1}}{y_{6,k}}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}}Q_{\tau}^{{\textit{\textbf{n}}}_{J,1;6,k}})}\nonumber\\ &\times\prod_{p=1}^2\frac{\prod_{c=1}^2\mathcal{M}(\frac{y_{5,p}}{y_{5,c}}\frac{\mathfrak{t}}{\mathfrak{q}}Q_{\tau}^{{\textit{\textbf{n}}}_{5,p;5,c}})\mathcal{M}(\frac{y_{5,p}}{y_{5,c}}Q_{\tau}^{{\textit{\textbf{n}}}_{5,p;5,c}})}{\prod_{r=1}^2\mathcal{M}(\frac{y_{5,p}}{y_{6,r}}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}}Q_{\tau}^{{\textit{\textbf{n}}}_{5,p;6,r}})\prod_{K=1}^2\mathcal{M}(\frac{y_{5,p}}{y_{K,1}}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}}Q_{\tau}^{{\textit{\textbf{n}}}_{5,p;K,1}})}\nonumber\\ &\times\prod_{s=1}^2\frac{\prod_{e=1}^2\mathcal{M}(\frac{y_{6,s}}{y_{6,e}}\frac{\mathfrak{t}}{\mathfrak{q}}Q_{\tau}^{{\textit{\textbf{n}}}_{6,s;6,e}})\mathcal{M}(\frac{y_{6,s}}{y_{6,e}}Q_{\tau}^{{\textit{\textbf{n}}}_{6,s;6,e}})}{\prod_{d=1}^2\mathcal{M}(\frac{y_{6,s}}{y_{5,d}}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}}Q_{\tau}^{{\textit{\textbf{n}}}_{6,s;5,d}})\prod_{L=3}^4\mathcal{M}(\frac{y_{6,s}}{y_{L,1}}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}}Q_{\tau}^{{\textit{\textbf{n}}}_{6,s;L,1}})}\nonumber\\ &\times\prod_{l=1}^{\infty}\frac{1}{(1-Q_{\tau}^l)^7}, \\ \label{eq:D5inst} Z_{\text{inst}}^{D_5} =&\sum_{\boldsymbol{\mu}}\prod_{I=1}^2\bigg(Q_{I}^{|\mu_{I,1}|}\frac{\prod_{l=1}^{2}\varTheta_{\mu_{I,1}\mu_{5,l}}(\frac{y_{I,1}}{y_{5,l}}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}}|Q_{\tau})}{\varTheta_{\mu_{I,1}\mu_{I,1}}(\frac{y_{I,1}}{y_{I,1}}|Q_{\tau})\varTheta_{\mu_{I,1}\mu_{I,1}}(\frac{y_{I,1}}{y_{I,1}}\tfrac{\mathfrak{t}}{\mathfrak{q}}|Q_{\tau})}\bigg)\nonumber\\ \times&\prod_{J=3}^4\bigg(Q_{J}^{|\mu_{J,1}|}\frac{\prod_{k=1}^{2}\varTheta_{\mu_{J,1}\mu_{6,k}}(\frac{y_{J,1}}{y_{6,k}}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}}|Q_{\tau})}{\varTheta_{\mu_{J,1}\mu_{J,1}}(\frac{y_{J,1}}{y_{J,1}}|Q_{\tau})\varTheta_{\mu_{J,1}\mu_{J,1}}(\frac{y_{J,1}}{y_{J,1}}\tfrac{\mathfrak{t}}{\mathfrak{q}}|Q_{\tau})}\bigg)\nonumber\\ \times&\prod_{p=1}^{2}\bigg(Q_{5}^{|\mu_{5,p}|}\frac{\prod_{r=1}^{2}\varTheta_{\mu_{5,p}\mu_{6,r}}(\frac{y_{5,p}}{y_{6,r}}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}}|Q_{\tau})\prod_{K=1}^2\varTheta_{\mu_{5,p}\mu_{K,1}}(\frac{y_{5,p}}{y_{K,1}}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}}|Q_{\tau})}{\prod_{c=1}^{2}\varTheta_{\mu_{5,p}\mu_{5,c}}(\frac{y_{5,p}}{y_{5,c}}|Q_{\tau})\varTheta_{\mu_{5,p}\mu_{5,c}}(\frac{y_{5,p}}{y_{5,c}}\tfrac{\mathfrak{t}}{\mathfrak{q}}|Q_{\tau})}\bigg)\nonumber\\ \times&\prod_{s=1}^{2}\bigg(Q_{6}^{|\mu_{6,s}|}\frac{\prod_{d=1}^{2}\varTheta_{\mu_{6,s}\mu_{5,d}}(\frac{y_{6,s}}{y_{5,d}}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}}|Q_{\tau})\prod_{L=3}^4\varTheta_{\mu_{6,s}\mu_{L,1}}(\frac{y_{6,s}}{y_{L,1}}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}}|Q_{\tau})}{\prod_{e=1}^{2}\varTheta_{\mu_{6,s}\mu_{6,e}}(\frac{y_{6,s}}{y_{6,e}}|Q_{\tau})\varTheta_{\mu_{6,s}\mu_{6,e}}(\frac{\mu_{6,s}}{\mu_{6,e}}\tfrac{\mathfrak{t}}{\mathfrak{q}}|Q_{\tau})}\bigg). \end{align} \subsection{\texorpdfstring{$E$}{E}-type LSTs}\label{sec:E6-type} Here we apply our trivalent gluing with bivalent self-gluing to $E$-type LSTs, and rewrite the resulting partition function in terms of the $\varTheta$ function. Recall first that the minimal $(E_6, E_6)$ conformal matter theory on a circle is realized as affine $E_6$ quiver~\cite{DelZotto:2014hpa}: \begin{align} \label{eq:affineE6web} \begin{tikzpicture}[scale=1.1] \path (0:0cm) node[scale=1.0] (v0) {$SU(3)_0$}; \path (90:1cm) node (u2) {$SU(2)$}; \path (90:2cm) node (u1) {$SU(1)$}; \path (0:2cm) node (r2) {$SU(2)$}; \path (0:4cm) node (r1) {$SU(1)$}; \path (180:2cm) node (l2) {$SU(2)$}; \path (180:4cm) node (l1) {$SU(1)$}; \draw (v0) -- (u2) -- (u1) (v0) -- (r2) -- (r1) (v0) -- (l2) -- (l1); \end{tikzpicture} \end{align} The corresponding 5-brane web for this theory was proposed via trivalent gluing~\cite{Hayashi:2021pcj} of three $T_3$ web diagrams, as shown in figure~\ref{fig:E6-triv-T3} (a). We then do the bivalent self-gluings of the external 7-branes, which leads to figure \ref{fig:E6-triv-T3} (b). \begin{figure}[H] \centering \includegraphics[scale=0.7]{fig-6dE6_E6LST.pdf} \caption{(a):Trivalent gluing of three $T_3$ web diagram realizing the minimal $(E_6,E_6)$ conformal matter on a circle (figure is based on figure 10 in \cite{Hayashi:2021pcj}.) (b):5-brane for $E_6$ LST with the bivalent self-gluing.} \label{fig:E6-triv-T3} \end{figure} A construction of brane web for $E_7$-type LST is very similar to the case for $E_6$-type LST. The minimal $(E_7,E_7)$ conformal matter theory on a circle is realized as affine $E_7$ quiver: \begin{align} \label{eq:affineE7web} \begin{tikzpicture}[scale=1.1] \path (0:0cm) node[scale=1.0] (v0) {$SU(4)_0$}; \path (90:1cm) node (u2) {$SU(2)_0$}; \path (0:2cm) node (r3) {$SU(3)_0$}; \path (0:4cm) node (r2) {$SU(2)$}; \path (0:6cm) node (r1) {$SU(1)$}; \path (180:2cm) node (l3) {$SU(3)_0$}; \path (180:4cm) node (l2) {$SU(2)$}; \path (180:6cm) node (l1) {$SU(1)$}; \draw (v0) -- (u2) (v0) -- (r3) -- (r2) -- (r1) (v0) -- (l3)-- (l2) -- (l1); \end{tikzpicture} \end{align} To make a brane web for $E_7$-type LST engineered from one IIB NS5-brane probing $E_7$ singularity, we do the bivalent self-gluings of the external 5-branes, as given in figure \ref{fig:E7-triv-T4-gluing}. \begin{figure}[H] \centering \includegraphics[width=8cm]{fig-E7-triv-T4-gluing-new.pdf} \caption{5-brane for $E_7$ LST with the bivalent self-gluing.} \label{fig:E7-triv-T4-gluing} \end{figure} To make a brane web for $E_8$-type LST, we do the bivalent self-gluings of the external 5-branes for the web diagram of the minimal $(E_8, E_8)$ conformal matter theory on a circle, as given in figure \ref{fig:E8-triv-gluing}. \begin{align} \label{eq:affineE8web} \begin{tikzpicture}[scale=1.1] \path (0:0cm) node[scale=1.0] (v0) {$SU(6)_0$}; \path (90:1cm) node (u2) {$SU(3)_0$}; \path (0:1.75cm) node (r3) {$SU(4)_0$}; \path (0:3.5cm) node (r2) {$SU(2)_0$}; \path (180:1.75cm) node (l6) {$SU(5)_0$}; \path (180:3.5cm) node (l5) {$SU(4)_0$}; \path (180:5.25cm) node (l4) {$SU(3)_0$}; \path (180:7cm) node (l3) {$SU(2)$}; \path (180:8.7cm) node (l2) {$SU(1)$}; \draw (v0) -- (u2) (v0) -- (r3) -- (r2) (v0) -- (l6) -- (l5) -- (l4)-- (l3)-- (l2) ; \end{tikzpicture} \end{align} \begin{figure}[H] \centering \includegraphics[width=9cm]{fig-E8-triv-T6-gluing-new.pdf} \caption{5-brane for $E_8$ LST with the bivalent self-gluings.} \label{fig:E8-triv-gluing} \end{figure} \subsubsection{LST on \texorpdfstring{$E_6$}{E6} singularity} \begin{figure}[htbp] \centering \includegraphics[scale=0.5]{E6tri.pdf} \caption{The $E_6$ LST by trivalent gluing together with the bivalent self-gluing.} \label{fig:E6tri} \end{figure} \begin{figure}[htbp] \centering \includegraphics[scale=0.5]{T3sub.pdf} \caption{subdiagram of $E_6$ LST with two periods} \label{fig:T3sub} \end{figure} We propose that the $E_6$-type LST can be realized by the trivalent gluing together with the bivalent self-gluing in figure \ref{fig:E6tri}, where the Young diagram $\mu_{I,j}$ labels the $j$-th color brane of the $I$-th gauge node. We also draw two adjacent periods of the bottom right subdiagram of figure \ref{fig:E6tri} in figure \ref{fig:T3sub}. By the periodicity constraints, $Q_{4}=Q'_{4}$ and $Q_{3}=Q'_{3}$, we find that $Q_{4;7}$ and $Q_{3;4}$ have to satisfy the following conditions, \begin{align} Q_{4;7}=Q_{7,1}^{\frac13}Q_{7,2}^{\frac23}Q_{4,1}^{-\frac12},\quad Q_{3;4}=Q_{4,1}^{\frac12}\ . \label{eq:t3sub2} \end{align} By the same reasoning, for the other two subdiagrams, we also have \begin{align} &Q_{2;7}=Q_{7,1}^{\frac13}Q_{7,2}^{\frac23}Q_{2,1}^{-\frac12},\quad Q_{1;2}=Q_{2,1}^{\frac12}\ , \label{eq:t3sub1}\\ &Q_{6;7}=Q_{7,1}^{\frac13}Q_{7,2}^{\frac23}Q_{6,1}^{-\frac12},\quad Q_{5;6}=Q_{6,1}^{\frac12}\ . \label{eq:t3sub3} \end{align} These three periodicity conditions, \eqref{eq:t3sub2}, \eqref{eq:t3sub1}, and \eqref{eq:t3sub3} also make the middle SU(3) subdiagram of figure \ref{fig:E6tri} vertically periodic. Now we are ready to use the trivalent gluing diagram in figure \ref{fig:E6tri} to obtain the partition function of $E_6$-type LST which takes the following form, \begin{align} Z^{E_6}=\sum_{\boldsymbol{\mu}}Z^{\text{SU(3)}}_{\mu_{7,1}\mu_{7,2}\mu_{7,3}}&\times Z_{\mu_{7,1}\mu_{7,2}\mu_{7,3}\mu_{2,1}\mu_{2,2}\mu_{1,1}}(Q_{7,1},Q_{7,2},Q_{2,1},Q_{1},Q_{2},Q_{\tau})\nonumber\\ &\times Z_{\mu_{7,1}\mu_{7,2}\mu_{7,3}\mu_{4,1}\mu_{4,2}\mu_{3,1}}(Q_{7,1},Q_{7,2},Q_{4,1},Q_{3},Q_{4},Q_{\tau})\nonumber\\ &\times Z_{\mu_{7,1}\mu_{7,2}\mu_{7,3}\mu_{6,1}\mu_{6,2}\mu_{5,1}}(Q_{7,1},Q_{7,2},Q_{6,1},Q_{5},Q_{6},Q_{\tau}), \label{eq:factorsofE6} \end{align} with \begin{align} Z^{\text{SU(3)}}_{\mu_{7,1}\mu_{7,2}\mu_{7,3}}\equiv&(-Q_{7})^{|\mu_{7,1}|+|\mu_{7,3}|}f_{\mu_{7,1}}(\mathfrak{t},\mathfrak{q})f_{\mu_{7,3}}(\mathfrak{t},\mathfrak{q})^{-1}\left(-\frac{Q_{7,1}Q_{7,2}Q_{7}}{Q_{2,1}^{\frac12}Q_{4,1}^{\frac12}Q_{6,1}^{\frac12}}\right)^{|\mu_{7,2}|}\nonumber\\ &\times \begin{tikzpicture}[scale=0.6,thick,baseline=-15] \draw (0,0)--++(-1,0) coordinate (a)--++(0,-1) coordinate (b)--++(1,0); \draw (a)--++(-0.8,0.8); \draw (b)--++(-0.8,-0.8) coordinate (c)--++(1.8,0); \draw (c)--++(-0.8,-0.4); \node at (-0.4,0.35){$\mu_{7,1}$}; \node at (-0.4,-0.6){$\mu_{7,2}$}; \node at (-0.6,-1.45){$\mu_{7,3}$}; \draw[<->] (0.2,0)--++(0,-1); \node at (1,-0.5){$Q_{7,1}$}; \draw[<->] (0.2,-1)--++(0,-0.8); \node at (1,-1.4){$Q_{7,2}$}; \draw[<->] (-2.8,0.8)--++(0,-3); \node at (-3.3,-0.7){$Q_{\tau}$}; \draw (-1.6+0.07,0.6+0.07)--++(-0.14,-0.14); \draw (-2.2-0.0445,-2+0.0895)--++(0.089,-0.179); \end{tikzpicture} \times \begin{tikzpicture}[scale=0.6,thick,baseline=-15] \draw (0,0)--++(1,0) coordinate (a)--++(0,-1) coordinate (b)--++(-1,0); \draw (a)--++(0.8,0.8); \draw (b)--++(0.8,-0.8) coordinate (c)--++(-1.8,0); \draw (c)--++(0.8,-0.4); \node at (0.5,0.35){$\mu_{7,1}$}; \node at (0.4,-0.6){$\mu_{7,2}$}; \node at (0.7,-1.45){$\mu_{7,3}$}; \draw[<->] (-0.2,0)--++(0,-1); \node at (-1,-0.5){$Q_{7,1}$}; \draw[<->] (-0.2,-1)--++(0,-0.8); \node at (-1,-1.4){$Q_{7,2}$}; \draw[<->] (2.8,0.8)--++(0,-3); \node at (3.3,-0.7){$Q_{\tau}$}; \draw (1.6-0.07,0.6+0.07)--++(0.14,-0.14); \draw (2.2+0.0445,-2+0.0895)--++(-0.089,-0.179); \end{tikzpicture}, \label{eq:ZE6mid} \end{align} where the edge factors of $\mu_{7,1},\mu_{7,2},\mu_{7,3}$ come from the middle SU(3) diagram in figure \ref{fig:E6tri}, and \begin{align} &Z_{\mu_{7,1}\mu_{7,2}\mu_{7,3}\mu_{2,1}\mu_{2,2}\mu_{1,1}}(Q_{7,1},Q_{7,2},Q_{2,1},Q_{1},Q_{2},Q_{\tau})\nonumber\\ &\qquad\qquad =\begin{tikzpicture}[scale=0.6,thick,baseline=-18.5] \draw (0,0)--++(1,0) coordinate (a)--++(0,-0.5) coordinate (b)--++(-0.5,-0.5) coordinate (c)--++(-0.8,0); \draw (c)--++(0,-0.37) coordinate (d)--++(-0.43,-0.43) coordinate (e)--++(-0.6,0); \draw (b)--++(0.8,0) coordinate (f)--++(0,-0.44) coordinate (g)--++(-0.43,-0.43) coordinate (h)--(d); \draw (a)--++(0.5,0.5); \draw (f)--++(0.5,0.5); \draw (g)--++(0.6,0) coordinate (i)--++(0.5,0.5); \draw (e)--++(0,-0.5); \draw (h)--++(0,-0.7); \draw (i)--++(0,-1); \draw[<->] (-0.75,0)--++(0,-1); \draw[<->] (0.07,-2.4)--++(1.3,0); \draw[<->] (1.37,-2.2)--++(1.03,0); \draw[<->] (1.28,-0.5)--++(0,-0.87); \node[scale=0.5] at (0.96,-0.99){$Q_{2,1}$}; \node at (-1.6,-0.5){$Q_{7,1}$}; \draw[<->] (-0.75,-1)--++(0,-0.8); \node at (-1.6,-1.4){$Q_{7,2}$}; \draw[<->] (3.2,0.6)--++(0,-3); \node at (3.7,-0.7){$Q_{\tau}$}; \node[scale=0.6] at (0.5,0.23){$\mu_{7,1}$}; \node[scale=0.6] at (0.1,-0.75){$\mu_{7,2}$}; \node[scale=0.6] at (-0.15,-1.55){$\mu_{7,3}$}; \node[scale=0.5] at (0.75,-2.15){$Q_{2}$}; \node[scale=0.5] at (1.9,-1.95){$Q_{1}$}; \node[scale=0.6] at (1.45,-0.3){$\mu_{2,1}$}; \node[scale=0.6] at (0.9,-1.6){$\mu_{2,2}$}; \node[scale=0.6] at (2.18,-0.75){$\mu_{1,1}$}; \draw (1.23,0.37)--++(0.14,-0.14); \draw (e)++(-0.1,-0.3)--++(0.2,0); \draw (f)++(0.23,0.37)--++(0.14,-0.14); \draw (f)++(0.33-0.04,0.47-0.04)--++(0.14,-0.14); \draw (h)++(-0.1,-0.4)--++(0.2,0); \draw (h)++(-0.1,-0.48)--++(0.2,0); \draw (i)++(0.23,0.37)--++(0.14,-0.14); \draw (i)++(0.23+0.06,0.37+0.06)--++(0.14,-0.14); \draw (i)++(0.23-0.06,0.37-0.06)--++(0.14,-0.14); \draw (i)++(-0.1,-0.6)--++(0.2,0); \draw (i)++(-0.1,-0.68)--++(0.2,0); \draw (i)++(-0.1,-0.52)--++(0.2,0); \end{tikzpicture} \Bigg/ \begin{tikzpicture}[scale=0.6,thick,baseline=-15] \draw (0,0)--++(1,0) coordinate (a)--++(0,-1) coordinate (b)--++(-1,0); \draw (a)--++(0.8,0.8); \draw (b)--++(0.8,-0.8) coordinate (c)--++(-1.8,0); \draw (c)--++(0.8,-0.4); \node[scale=0.6] at (0.5,0.23){$\mu_{7,1}$}; \node[scale=0.6] at (0.5,-0.75){$\mu_{7,2}$}; \node[scale=0.6] at (0.7,-1.55){$\mu_{7,3}$}; \draw[<->] (-0.2,0)--++(0,-1); \node at (-1.05,-0.5){$Q_{7,1}$}; \draw[<->] (-0.2,-1)--++(0,-0.8); \node at (-1.05,-1.4){$Q_{7,2}$}; \draw[<->] (2.8,0.8)--++(0,-3); \node at (3.3,-0.7){$Q_{\tau}$}; \draw (1.6-0.07,0.6+0.07)--++(0.14,-0.14); \draw (2.2+0.0445,-2+0.0895)--++(-0.089,-0.179); \end{tikzpicture}. \label{eq:Zt3sub1} \end{align} The other two $Z$'s of the subdiagrams are also defined in the same way as \eqref{eq:Zt3sub1}. By the similar computations as the $D$-type LST, we obtain \begin{align} &Z^{\text{SU(3)}}_{\mu_{7,1}\mu_{7,2}\mu_{7,3}}\nonumber\\ =&\prod_{n=1}^{\infty}\mathcal{M}(Q_{\tau}^{n-1}Q_{7,1})\mathcal{M}(Q_{\tau}^{n-1}Q_{7,2})\mathcal{M}(Q_{\tau}^{n-1}Q_{7,1}Q_{7,2})\mathcal{M}(Q_{\tau}^{n})^3\mathcal{M}(\frac{Q_{\tau}^n}{Q_{7,1}})\mathcal{M}(\frac{Q_{\tau}^n}{Q_{7,2}})\nonumber\\ \times&\mathcal{M}(\frac{Q_{\tau}^n}{Q_{7,1}Q_{7,2}})\mathcal{M}(Q_{\tau}^{n-1}Q_{7,1}\frac{\mathfrak{t}}{\mathfrak{q}})\mathcal{M}(Q_{\tau}^{n-1}Q_{7,2}\frac{\mathfrak{t}}{\mathfrak{q}})\mathcal{M}(Q_{\tau}^{n-1}Q_{7,1}Q_{7,2}\frac{\mathfrak{t}}{\mathfrak{q}})\mathcal{M}(Q_{\tau}^{n}\frac{\mathfrak{t}}{\mathfrak{q}})^3\nonumber\\ \times&\mathcal{M}(\frac{Q_{\tau}^n}{Q_{7,1}}\frac{\mathfrak{t}}{\mathfrak{q}})\mathcal{M}(\frac{Q_{\tau}^n}{Q_{7,2}}\frac{\mathfrak{t}}{\mathfrak{q}})\mathcal{M}(\frac{Q_{\tau}^n}{Q_{7,1}Q_{7,2}}\frac{\mathfrak{t}}{\mathfrak{q}})\prod_{l=1}^{\infty}\frac{1}{(1-Q_{\tau}^l)^2}\times \hat{Z}^{\text{SU(3)}}_{\mu_{7,1}\mu_{7,2}\mu_{7,3}}, \label{eq:ZofE6mid} \end{align} where \begin{align} &\hat{Z}^{\text{SU(3)}}_{\mu_{7,1}\mu_{7,2}\mu_{7,3}}\nonumber\\ =&\mathfrak{q}^{\frac{1}{2}||\mu_{7,2}||^2+||\mu_{7,3}||^2}\mathfrak{t}^{||\mu_{7,1}^t||^2+\frac{1}{2}||\mu_{7,2}^t||^2}Q_{7}^{|\mu_{7,1}|+|\mu_{7,3}|}\left(-\frac{Q_{7,1}Q_{7,2}Q_{7}}{Q_{2,1}^{\frac12}Q_{4,1}^{\frac12}Q_{6,1}^{\frac12}}\right)^{|\mu_{7,2}|}\prod_{i=1}^3\tilde{Z}_{\lambda_i}(\mathfrak{t},\mathfrak{q})\tilde{Z}_{\lambda_i^t}(\mathfrak{q},\mathfrak{t})\nonumber\\ \times&\prod_{n=1}^{\infty}\mathcal{N}_{\mu_{7,1}\mu_{7,1}}(Q_{\tau}^n)\mathcal{N}_{\mu_{7,1}\mu_{7,1}}(Q_{\tau}^n\frac{\mathfrak{t}}{\mathfrak{q}})\mathcal{N}_{\mu_{7,2}\mu_{7,2}}(Q_{\tau}^n)\mathcal{N}_{\mu_{7,2}\mu_{7,2}}(Q_{\tau}^n\frac{\mathfrak{t}}{\mathfrak{q}})\mathcal{N}_{\mu_{7,3}\mu_{7,3}}(Q_{\tau}^n)\mathcal{N}_{\mu_{7,3}\mu_{7,3}}(Q_{\tau}^n\frac{\mathfrak{t}}{\mathfrak{q}})\nonumber\\ \times&\mathcal{N}_{\mu_{7,2}\mu_{7,1}}(\frac{Q_{\tau}^n}{Q_{7,1}}\frac{\mathfrak{t}}{\mathfrak{q}})\mathcal{N}_{\mu_{7,1}\mu_{7,2}}(Q_{\tau}^{n-1}Q_{7,1})\mathcal{N}_{\mu_{7,2}\mu_{7,1}}(\frac{Q_{\tau}^n}{Q_{7,1}})\mathcal{N}_{\mu_{7,1}\mu_{7,2}}(Q_{\tau}^{n-1}Q_{7,1}\frac{\mathfrak{t}}{\mathfrak{q}})\mathcal{N}_{\mu_{7,3}\mu_{7,1}}(\frac{Q_{\tau}^n}{Q_{7,1}Q_{7,2}}\frac{\mathfrak{t}}{\mathfrak{q}})\nonumber\\ \times&\mathcal{N}_{\mu_{7,1}\mu_{7,3}}(Q_{\tau}^{n-1}Q_{7,1}Q_{7,2})\mathcal{N}_{\mu_{7,3}\mu_{7,1}}(\frac{Q_{\tau}^n}{Q_{7,1}Q_{7,2}})\mathcal{N}_{\mu_{7,1}\mu_{7,3}}(Q_{\tau}^{n-1}Q_{7,1}Q_{7,2}\frac{\mathfrak{t}}{\mathfrak{q}})\mathcal{N}_{\mu_{7,3}\mu_{7,2}}(\frac{Q_{\tau}^n}{Q_{7,2}}\frac{\mathfrak{t}}{\mathfrak{q}})\nonumber\\ \times&\mathcal{N}_{\mu_{7,2}\mu_{7,3}}(Q_{\tau}^{n-1}Q_{7,2})\mathcal{N}_{\mu_{7,3}\mu_{7,2}}(\frac{Q_{\tau}^n}{Q_{7,2}})\mathcal{N}_{\mu_{7,2}\mu_{7,3}}(Q_{\tau}^{n-1}Q_{7,2}\frac{\mathfrak{t}}{\mathfrak{q}}). \label{eq:NZofE6mid} \end{align} We then compute two subdiagrams in \eqref{eq:Zt3sub1} and substitute the results back, we obtain \begin{align} &Z_{\mu_{7,1}\mu_{7,2}\mu_{7,3}\mu_{2,1}\mu_{2,2}\mu_{1,1}}(Q_{7,1},Q_{7,2},Q_{2,1},Q_{1},Q_{2},Q_{\tau})\nonumber\\ =&\prod_{l=1}^{\infty}\frac{1}{(1-Q_{\tau}^l)^2}\prod_{n=1}^{\infty}\mathcal{M}(Q_{\tau}^{n-1}Q_{2,1})\mathcal{M}(Q_{\tau}^n)^3\mathcal{M}(Q_{\tau}^{n}Q_{2,1}^{-1})\mathcal{M}(Q_{\tau}^{n-1}Q_{2,1}\frac{\mathfrak{t}}{\mathfrak{q}})\nonumber\\ \times&\mathcal{M}(Q_{\tau}^n\frac{\mathfrak{t}}{\mathfrak{q}})^3\mathcal{M}(Q_{\tau}^nQ_{2,1}^{-1}\frac{\mathfrak{t}}{\mathfrak{q}})\times\Bigg(\mathcal{M}(Q_{\tau}^{n-1}Q_{7,1}^{\frac13}Q_{7,2}^{-\frac13}Q_{2,1}^{\frac12}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\mathcal{M}(Q_{\tau}^{n-1}Q_{7,1}^{\frac23}Q_{7,2}^{\frac13}Q_{2,1}^{-\frac12}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\nonumber\\ \times&\mathcal{M}(Q_{\tau}^{n-1}Q_{2,1}^{\frac12}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})^2\mathcal{M}(Q_{\tau}^{n-1}Q_{7,1}^{\frac{1}{3}}Q_{7,2}^{\frac{2}{3}}Q_{2,1}^{-\frac12}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\mathcal{M}(Q_{\tau}^{n-1}Q_{7,1}^{-\frac{1}{3}}Q_{7,2}^{\frac{1}{3}}Q_{2,1}^{\frac12}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\nonumber\\ \times&\mathcal{M}(Q_{\tau}^{n-1}Q_{7,1}^{\frac{2}{3}}Q_{7,2}^{\frac{1}{3}}Q_{2,1}^{\frac12}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\mathcal{M}(Q_{\tau}^{n-1}Q_{7,1}^{\frac13}Q_{7,2}^{\frac23}Q_{2,1}^{\frac12}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\mathcal{M}(Q_{\tau}^nQ_{7,1}^{-\frac13}Q_{7,2}^{\frac13}Q_{2,1}^{-\frac12}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\nonumber\\ \times&\mathcal{M}(Q_{\tau}^nQ_{7,1}^{-\frac23}Q_{7,2}^{-\frac13}Q_{2,1}^{\frac12}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\mathcal{M}(Q_{\tau}^nQ_{7,1}^{-\frac13}Q_{7,2}^{-\frac23}Q_{2,1}^{-\frac12}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\mathcal{M}(Q_{\tau}^nQ_{7,1}^{-\frac{2}{3}}Q_{7,2}^{-\frac{1}{3}}Q_{2,1}^{-\frac12}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\nonumber\\ \times&\mathcal{M}(Q_{\tau}^nQ_{7,1}^{\frac{1}{3}}Q_{7,2}^{-\frac{1}{3}}Q_{2,1}^{-\frac12}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\mathcal{M}(Q_{\tau}^nQ_{7,1}^{-\frac{1}{3}}Q_{7,2}^{-\frac{2}{3}}Q_{2,1}^{\frac12}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\mathcal{M}(Q_{\tau}^nQ_{2,1}^{-\frac12}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})^2\Bigg)^{-1}\nonumber\\ \times&\hat{Z}_{\mu_{7,1}\,\mu_{7,2}\,\mu_{7,3}\,\mu_{2,1}\,\mu_{2,2}\,\mu_{1,1}}(Q_{7,1},Q_{7,2},Q_{2,1},Q_{1},Q_{2},Q_{\tau}), \label{eq:Zoft3} \end{align} where \begin{align} &\hat{Z}_{\mu_{7,1}\, \mu_{7,2}\,\mu_{7,3}\,\mu_{2,1}\,\mu_{2,2}\,\mu_{1,1}}(Q_{7,1},Q_{7,2},Q_{2,1},Q_{1},Q_{2},Q_{\tau})\nonumber\\ =&\mathfrak{q}^{\frac{||\mu_{2,1}||^2+||\mu_{2,2}||^2+||\mu_{1,1}||^2}{2}}\mathfrak{t}^{\frac{||\mu_{2,1}^t||^2+||\mu_{2,2}^t||^2+||\mu_{1,1}^t||^2}{2}}(-Q_{7,1}^{-\frac23}Q_{7,2}^{-\frac13}Q_{2,1}^{\frac12})^{|\mu_{2,1}|}(-Q_{2,1}^{-\frac12}Q_{1})^{|\mu_{1,1}|}\nonumber\\ \times&\left(-Q_{7,1}^{-\frac{1}{3}}Q_{7,2}^{-\frac{2}{3}}Q_{2,1}^{\frac12}Q_{2}\right)^{|\mu_{2,2}|}\prod_{i=1}^2\tilde{Z}_{\mu_i}(\mathfrak{t},\mathfrak{q})\tilde{Z}_{\mu_i^t}(\mathfrak{q},\mathfrak{t})\times\tilde{Z}_{\mu_{1,1}}(\mathfrak{t},\mathfrak{q})\tilde{Z}_{\mu_{1,1}^t}(\mathfrak{q},\mathfrak{t})\nonumber\\ \times&\prod_{n=1}^{\infty}\mathcal{N}_{\mu_{2,1}\mu_{7,1}}(Q_{\tau}^nQ_{7,1}^{-\frac23}Q_{7,2}^{-\frac13}Q_{2,1}^{\frac12}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\mathcal{N}_{\mu_{7,1}\mu_{2,1}}(Q_{\tau}^{n-1}Q_{7,1}^{\frac23}Q_{7,2}^{\frac13}Q_{2,1}^{-\frac12}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\nonumber\\ \times&\mathcal{N}_{\mu_{2,2}\mu_{7,1}}(Q_{\tau}^nQ_{7,1}^{-\frac{2}{3}}Q_{7,2}^{-\frac{1}{3}}Q_{2,1}^{-\frac12}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\mathcal{N}_{\mu_{7,1}\mu_{2,2}}(Q_{\tau}^{n-1}Q_{7,1}^{\frac{2}{3}}Q_{7,2}^{\frac{1}{3}}Q_{2,1}^{\frac12}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\nonumber\\ \times&\mathcal{N}_{\mu_{7,2}\mu_{2,1}}(Q_{\tau}^nQ_{7,1}^{-\frac13}Q_{7,2}^{\frac13}Q_{2,1}^{-\frac12}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\mathcal{N}_{\mu_{2,1}\mu_{7,2}}(Q_{\tau}^{n-1}Q_{7,1}^{\frac13}Q_{7,2}^{-\frac13}Q_{2,1}^{\frac12}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\nonumber\\ \times&\mathcal{N}_{\mu_{2,2}\mu_{7,2}}(Q_{\tau}^nQ_{7,1}^{\frac{1}{3}}Q_{7,2}^{-\frac{1}{3}}Q_{2,1}^{-\frac12}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\mathcal{N}_{\mu_{7,2}\mu_{2,2}}(Q_{\tau}^{n-1}Q_{7,1}^{-\frac{1}{3}}Q_{7,2}^{\frac{1}{3}}Q_{2,1}^{\frac12}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\nonumber\\ \times&\mathcal{N}_{\mu_{7,3}\mu_{2,1}}(Q_{\tau}^nQ_{7,1}^{-\frac13}Q_{7,2}^{-\frac23}Q_{2,1}^{-\frac12}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\mathcal{N}_{\mu_{2,1}\mu_{7,3}}(Q_{\tau}^{n-1}Q_{7,1}^{\frac13}Q_{7,2}^{\frac23}Q_{2,1}^{\frac12}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\nonumber\\ \times&\mathcal{N}_{\mu_{7,3}\mu_{2,2}}(Q_{\tau}^nQ_{7,1}^{-\frac{1}{3}}Q_{7,2}^{-\frac{2}{3}}Q_{2,1}^{\frac12}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\mathcal{N}_{\mu_{2,2}\mu_{7,3}}(Q_{\tau}^{n-1}Q_{7,1}^{\frac{1}{3}}Q_{7,2}^{\frac{2}{3}}Q_{2,1}^{-\frac12}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\nonumber\\ \times&\mathcal{N}_{\mu_{1,1}\mu_{2,1}}(Q_{\tau}^nQ_{2,1}^{-\frac12}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\mathcal{N}_{\mu_{2,1}\mu_{1,1}}(Q_{\tau}^{n-1}Q_{2,1}^{\frac12}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\mathcal{N}_{\mu_{2,2}\mu_{1,1}}(Q_{\tau}^nQ_{2,1}^{-\frac12}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\nonumber\\ \times&\mathcal{N}_{\mu_{1,1}\mu_{2,2}}(Q_{\tau}^{n-1}Q_{2,1}^{\frac12}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}})\Bigg(\mathcal{N}_{\mu_{2,1}\mu_{2,1}}(Q_{\tau}^n)\mathcal{N}_{\mu_{2,1}\mu_{2,1}}(Q_{\tau}^n\frac{\mathfrak{t}}{\mathfrak{q}})\mathcal{N}_{\mu_{2,2}\mu_{2,2}}(Q_{\tau}^n)\nonumber\\ \times&\mathcal{N}_{\mu_{2,2}\mu_{2,2}}(Q_{\tau}^n\frac{\mathfrak{t}}{\mathfrak{q}})\mathcal{N}_{\mu_{1,1}\mu_{1,1}}(Q_{\tau}^n)\mathcal{N}_{\mu_{1,1}\mu_{1,1}}(Q_{\tau}^n\frac{\mathfrak{t}}{\mathfrak{q}})\mathcal{N}_{\mu_{2,2}\mu_{2,1}}(Q_{\tau}^nQ_{2,1}^{-1})\nonumber\\ \times&\mathcal{N}_{\mu_{2,1}\mu_{2,2}}(Q_{\tau}^{n-1}Q_{2,1}\frac{\mathfrak{t}}{\mathfrak{q}})\mathcal{N}_{\mu_{2,2}\mu_{2,1}}(Q_{\tau}^nQ_{2,1}^{-1}\frac{\mathfrak{t}}{\mathfrak{q}})\mathcal{N}_{\mu_{2,1}\mu_{2,2}}(Q_{\tau}^{n-1}Q_{2,1})\Bigg)^{-1}\ . \label{eq:NZoft3} \end{align} \paragraph{Expression of $Z^{E_6}$.} Using the $y$ parameters defined in \eqref{eq:defofy}, the periodic condition in \eqref{eq:t3sub2}, \eqref{eq:t3sub1}, and \eqref{eq:t3sub3} for the $E_6$ LST become \begin{align} &y_{1,1}=1,\quad y_{2,1}y_{2,2}=1,\quad y_{3,1}=1,\quad y_{4,1}y_{4,2}=1,\ \nonumber\\ &y_{5,1}=1,\quad y_{6,1}y_{6,2}=1,\quad y_{7,1}y_{7,2}y_{7,3}=1, \end{align} where we have set $a_{1,1}=0$. Substituting \eqref{eq:Zoft3}, \eqref{eq:NZoft3}, \eqref{eq:ZofE6mid}, and \eqref{eq:NZofE6mid} into \eqref{eq:factorsofE6}, and transforming the $\mathcal{N}$ functions into the $\varTheta$ functions, we find \begin{equation} Z^{E_6}=Z^{E_6}_{\text{pert}}\cdot Z^{E_6}_{\text{inst}}\ , \end{equation} with \begin{align}\label{eq:E6pert} Z^{E_6}_{\text{pert}}=&\prod_{l=1}^{\infty}\frac{1}{(1-Q_{\tau}^l)^8}\prod_{n=1}^{\infty}\prod_{I=1,3,5}\frac{\mathcal{M}(\frac{\mathfrak{t}}{\mathfrak{q}}Q_{\tau}^{{\textit{\textbf{n}}}_{I,1;I,1}})\mathcal{M}(Q_{\tau}^{{\textit{\textbf{n}}}_{I,1;I,1}})}{\prod_{l=1}^2\mathcal{M}(\frac{y_{I,1}}{y_{I+1,l}}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}}Q_{\tau}^{{\textit{\textbf{n}}}_{I,1;I+1,l}})}\nonumber\\ \times&\prod_{J=2,4,6}\prod_{p=1}^2\frac{\prod_{s=1}^2\mathcal{M}(\frac{y_{J,p}}{y_{J,s}}\frac{\mathfrak{t}}{\mathfrak{q}}Q_{\tau}^{{\textit{\textbf{n}}}_{J,p;J,s}})\mathcal{M}(\frac{y_{J,p}}{y_{J,s}}Q_{\tau}^{{\textit{\textbf{n}}}_{J,p;J,s}})}{\mathcal{M}(\frac{y_{J,p}}{y_{J-1,1}}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}}Q_{\tau}^{{\textit{\textbf{n}}}_{J,p;J-1,1}})\prod_{r=1}^3\mathcal{M}(\frac{y_{J,p}}{y_{7,r}}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}}Q_{\tau}^{{\textit{\textbf{n}}}_{J,p;7,r}})}\nonumber\\ \times&\prod_{c=1}^3\frac{\prod_{e=1}^3\mathcal{M}(\frac{y_{7,c}}{y_{7,e}}\frac{\mathfrak{t}}{\mathfrak{q}}Q_{\tau}^{{\textit{\textbf{n}}}_{7,c;7,e}})\mathcal{M}(\frac{y_{7,c}}{y_{7,e}}Q_{\tau}^{{\textit{\textbf{n}}}_{7,c;7,e}})}{\prod_{L=2,4,6}\prod_{d=1}^2\mathcal{M}(\frac{y_{7,c}}{y_{L,d}}\sqrt{\frac{\mathfrak{t}}{\mathfrak{q}}}Q_{\tau}^{{\textit{\textbf{n}}}_{7,c;L,d}})}\ , \\ \label{eq:E6inst} Z^{E_6}_{\text{inst}}=&\sum_{\boldsymbol{\mu}}\prod_{I=1,3,5}\bigg(Q_{I}^{|\mu_{I,1}|}\frac{\prod_{l=1}^{2}\varTheta_{\mu_{I,1}\mu_{I+1,l}}(\frac{y_{I,1}}{y_{I+1,l}}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}}|Q_{\tau})}{\varTheta_{\mu_{I,1}\mu_{I,1}}(\frac{y_{I,1}}{y_{I,1}}|Q_{\tau})\varTheta_{\mu_{I,1}\mu_{I,1}}(\frac{y_{I,1}}{y_{I,1}}\tfrac{\mathfrak{t}}{\mathfrak{q}}|Q_{\tau})}\bigg)\nonumber\\ \times&\prod_{J=2,4,6}\prod_{p=1}^2\bigg(Q_{J}^{|\mu_{J,p}|}\frac{\varTheta_{\mu_{J,p}\mu_{J-1,1}}(\frac{y_{J,p}}{y_{J-1,1}}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}}|Q_{\tau})\prod_{r=1}^3\varTheta_{\mu_{J,p}\mu_{7,r}}(\frac{y_{J,p}}{y_{7,r}}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}}|Q_{\tau})}{\prod_{s=1}^2\varTheta_{\mu_{J,p}\mu_{J,s}}(\frac{y_{J,p}}{y_{J,s}}|Q_{\tau})\varTheta_{\mu_{J,p}\mu_{J,s}}(\frac{y_{J,p}}{y_{J,s}}\tfrac{\mathfrak{t}}{\mathfrak{q}}|Q_{\tau})}\bigg)\nonumber\\ \times&\prod_{c=1}^3\bigg(Q_{7}^{|\mu_{7,c}|}\frac{\prod_{L=2,4,6}\prod_{d=1}^{2}\varTheta_{\mu_{7,c}\mu_{L,d}}(\frac{y_{7,c}}{y_{L,d}}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}}|Q_{\tau})}{\prod_{e=1}^3\varTheta_{\mu_{7,c}\mu_{7,e}}(\frac{y_{7,c}}{y_{7,e}}|Q_{\tau})\varTheta_{\mu_{7,c}\mu_{7,e}}(\frac{y_{7,c}}{y_{7,e}}\tfrac{\mathfrak{t}}{\mathfrak{q}}|Q_{\tau})}\bigg)\ . \end{align} \bigskip \section{Higher ranks and general expression of partition functions} \label{sec:higherRanks} In previous sections, we obtained the partition functions of the $D_4$, $D_5$ and $E_6$ LSTs by direct use of the method of trivalent gluing from \cite{Hayashi:2017jze,Hayashi:2021pcj} together with our proposal, the bivalent self-gluings. The partition functions turn out to have similar simple forms after being simplified and expressed in terms of the $\varTheta$ functions. In this section, we give a more systematic way of obtaining the partition function expressed by the $\varTheta$ functions for the LSTs with a general $D$-type or $E$-type quiver structure and higher ranks\footnote{Higher rank means multiple number of color branes in each node compared with examples in previous sections which are rank 1 cases.}. To explain how to generalize, let us first recall the procedure of obtaining the partition function of $E_6$ LST in the previous section. First, we draw the subdiagrams in the trivalent gluing method as shown in figure \ref{fig:E6tri}. Then we compute the partition function of each subdiagram by the topological vertex formalism. At this step further corrections to the partition function of each subdiagrams are needed: \begin{enumerate} \item [(1)] For the three SU(2)-SU(1) subdiagrams, we need to divide them by additional factors as shown in \eqref{eq:Zt3sub1} where we remove the vector contributions of SU$(3)$ from the upper right SU(2)-SU(1) subdiagram. \item [(2)] For the middle subdiagram whose computation is shown in \eqref{eq:ZE6mid}, only the SU$(3)$ vector contributions are counted while the bifundamental contributions of SU$(3)$-SU$(2)$ and vector contributions of SU$(2)$ are not counted as they are already counted in the partition functions of three SU(2)-SU(1) subdiagrams. \end{enumerate} There is no bifundamental contributions between two different SU$(2)$'s as they are not connected in the quiver, so there is no string connecting color branes of different SU$(2)$'s in the middle subdiagram of figure \ref{fig:E6tri}. However, such unphysical bifundamental contributions would appear if the middle subdiagram was used directly for computation. So these further corrections to the partition function of each subdiagram ensure that no redundant factors and unphysical factors are counted when we multiply partition function of each subdiagram together to get the full partition function. The vector and bifundamental contributions come from summations of non-preferred direction Young diagrams along each vertical strips. From the description in Appendix \ref{app:formulas}, it is easy to see what the $\mathcal{R}$ or $\mathcal{N}$ factors can be generated from the web diagram, and for each subdiagram we only need to take care of which the $\mathcal{R}$ or $\mathcal{N}$ factor we should include or exclude for the partition function of this subdiagram. Once we understand this point, we can further simplify the method of obtaining the full partition function of the LST. \begin{figure}[htbp] \centering \includegraphics[scale=0.5]{fig-decomposeE6.pdf} \caption{Schematic picture of a decomposition of trivalent gluing subdiagrams of $E_6$ LST into smaller subdiagrams, where each subdiagram corresponds to a single gauge node.} \label{fig:decomposeE6} \end{figure} \subsection{Introduction of general node}\label{sec:introGN} We further decompose the subdiagrams in figure \ref{fig:E6tri} into smaller subdiagrams that correspond to each single node of the affine $E_6$ quiver as is shown in figure \ref{fig:decomposeE6}. Each subdiagram in figure \ref{fig:decomposeE6} now has similar web structure, and they only vary by the different number of color branes in the left, middle, and right of the diagram. Therefore, once we find a unified formula for the partition function of a general node diagram, we can easily obtain the full partition function of the LST. To find the general formula, we consider a general single node whose diagram is illustrated in figure \ref{fig:gaugenode}. Our strategy of obtaining the partition function of this general node is to first compute the contribution to the partition function from one of the color branes of this node. Then we multiply contributions from all the color branes of this node to get the full partition function of this general node. We pick one of the color branes of the node and label it by Young diagram $\alpha$ in figure \ref{fig:gaugenode}, and consider only the bifundamental and vector contributions that involve $\alpha$. For convenience and clarity, we use uppercase Greek letter to denote the name of a color brane whose Young diagram is denoted by the corresponding lowercase Greek letter. For example, we call the color brane labelled by Young diagram $\alpha$ as $A$. In figure \ref{fig:gaugenode}, there are $r_1$ color branes $M_1,\cdots,M_{r_1}$ above $A$ in the same node which we label by Young diagrams $\mu_1,\cdots,\mu_{r_1}$. There are $l_1$ color branes $N_{l_1},\cdots,N_1$ below $A$ in the same node which we label by Young diagrams $\nu_{l_1},\cdots,\nu_1$. On the right side of the node, there are $r_2$ color branes $P_1,\cdots,P_{r_2}$ above $A$ which we label by Young diagrams $\rho_1,\cdots,\rho_{r_2}$. There are $l_2$ color branes $\Gamma_{l_2},\cdots,\Gamma_1$ below $A$ which we label by Young diagrams $\gamma_{l_2},\cdots,\gamma_1$. On the left side of the node, there are $r_3$ color branes $\Lambda_1,\cdots,\Lambda_{r_3}$ above $A$ which we label by Young diagrams $\lambda_1,\cdots,\lambda_{r_3}$. There are $l_3$ color branes $\Xi_{l_3},\cdots,\Xi_1$ below $A$ which we label by Young diagrams $\xi_{l_3},\cdots,\xi_1$. If this node is at the junction of the quiver, then there could be more than one adjacent gauge node on the left or right of this node, and correspondingly the color branes on the left or right of the node may belong to different gauge nodes. \begin{figure}[htbp] \centering \includegraphics[scale=0.6]{fig-general-node.pdf} \caption{A general subdiagram corresponding to a single gauge node of a $D$-type or $E$-type quiver.} \label{fig:gaugenode} \end{figure} In figure \ref{fig:gaugenode}, in order to make this gauge node to be vertically periodic, the top two NS charged branes have to be parallel to each other and the bottom two NS charged branes also have to be parallel to each other. We label the corresponding brane charges as $(x_1,1)$ and $(x_2,-1)$. Also, the distance between the top two parallel NS charged branes has to be equal to the distance between the bottom two parallel NS charged branes, we denote it as $Q_b$. Following the assignment of the charges of the top and bottom NS charged branes, we can label all the charges of the remaining NS charged branes. The charge conservation at two vertices of $A$ gives the constraints: \begin{equation} \left\{\begin{array}{l} x_1+x_2=r_3-r_1+l_3-l_1-1 \\ x_1+x_2=r_1-r_2+l_1-l_2+1 \end{array}\right.\ , \label{eq:x1x2} \end{equation} from which we find that \begin{equation} r_2+r_3+l_2+l_3=2(r_1+l_1+1)\ , \label{eq:paracondi} \end{equation} which ensures the simultaneous parallelism of the top two and bottom two NS charged branes. From the charge distributions of the branes in figure \ref{fig:gaugenode} with the labellings of K\"ahler parameters, we can find the relations between the K\"ahler parameter $Q_A$ of the brane $A$ and the K\"ahler parameter $Q_{M_1}$ of the brane $M_1$ \begin{align}\label{eq:Qup} Q_{M_1}=&~Q_{A}Q_1^{x_1-1}\cdots Q_{r_1-1}^{x_1-(r_1-1)}Q_{r_1}^{x_1-r_1}Q_{r_1+1}^{x_1-r_1+1}\cdots Q_{r_1+r_2}^{x_1-r_1+r_2}\nonumber\\ &\times Q_1^{-x_1-1}\cdots Q_{r_1-1}^{-x_1-(r_1-1)}{Q'_{\frac{1}{2}}}^{-x_1-r_1}{Q'_1}^{-x_1-r_1+1}\cdots {Q'_{r_3}}^{-x_1-r_1+r_3}\nonumber\\ =&~Q_{A}Q_1^{-1}\cdots Q_{r_1-1}^{-(r_1-1)}Q_{r_1}^{-r_1}Q_{r_1+1}^{-r_1+1}\cdots Q_{r_1+r_2}^{-r_1+r_2}\nonumber\\ &\times Q_1^{-1}\cdots Q_{r_1-1}^{-(r_1-1)}{Q'_{\frac{1}{2}}}^{-r_1}{Q'_1}^{-r_1+1}\cdots {Q'_{r_3}}^{-r_1+r_3}\nonumber\\ =&~Q_{A}\frac{Q_{P_{r_2}A}Q_{P_{r_2-1}A}\cdots Q_{P_{1}A}Q_{\Lambda_{r_3}A}Q_{\Lambda_{r_3-1}A}\cdots Q_{\Lambda_{1}A}}{Q_{M_{r_1}A}^2Q_{M_{r_1-1}A}^2\cdots Q_{M_{1}A}^2}, \end{align} where we have defined, for example, $Q_{\Lambda_1A}=\frac{y_{\Lambda_1}}{y_A}$ and so on. By the same reasoning, for the K\"ahler parameter $Q_{N_1}$ of the brane $N_1$, \begin{align}\label{eq:Qdown} Q_{N_1}=&~Q_{A}Q_{-l_1-l_2}^{x_2-l_1+l_2}\cdots Q_{-l_1-1}^{x_2-l_1+1}Q_{-l_1}^{x_2-l_1}Q_{-l_1+1}^{x_2-l_1+1}\cdots Q_{-1}^{x_2-1}\nonumber\\ &\times {Q'_{-l_3}}^{l_3-x_2-l_1}\cdots {Q'_{-1}}^{1-x_2-l_1}{Q'_{-\frac{1}{2}}}^{-x_2-l_1}Q_{-l_1+1}^{-x_2-l_1+1}\cdots Q_{-1}^{-x_2-1}\nonumber\\ =&~Q_{A}\frac{Q_{A\Gamma_{l_2}}Q_{A\Gamma_{l_2-1}}\cdots Q_{A\Gamma_{1}}Q_{A\Xi_{l_3}}Q_{A\Xi_{l_3-1}}\cdots Q_{A\Xi_{1}}}{Q_{AN_{l_1}}^2Q_{AN_{l_1-1}}^2\cdots Q_{AN_{1}}^2}. \end{align} In order to be the compactification along vertical direction, we should have \begin{equation}\label{eq:MNb} Q_{M_1}=Q_{N_1}=Q_b\ , \end{equation} so \begin{equation}\label{eq:constraint} Q_{\textbf{m}}^{2(r_1+l_1+1)}=Q_{\textbf{r}}^{r_2+l_2}Q_{\textbf{l}}^{r_3+l_3}\ , \end{equation} where \begin{align} Q_{\textbf{m}}\equiv&\left(Q_{M_{1}A}\cdots Q_{M_{r_1}A}Q_{N_{l_1}A}\cdots Q_{N_{1}A}\right)^{\frac{1}{r_1+l_1+1}},\\ Q_{\textbf{r}}\equiv&\left(Q_{P_{1}A}\cdots Q_{P_{r_2}A}Q_{\Gamma_{l_2}A}\cdots Q_{\Gamma_{1}A}\right)^{\frac{1}{r_2+l_2}},\\ Q_{\textbf{l}}\equiv&\left(Q_{\Lambda_{1}A}\cdots Q_{\Lambda_{r_3}A}Q_{\Xi_{l_3}A}\cdots Q_{\Xi_{1}A}\right)^{\frac{1}{r_3+l_3}}\ . \end{align} $Q_{\textbf{m}}$, $Q_{\textbf{r}}$ and $Q_{\textbf{l}}$ are the relative vertical positions of the centers of color branes in the middle, right, and left of figure \ref{fig:gaugenode} to the color brane $A$. For a node at the end of the quiver structure, its adjacent node can only appear on its one side, so the adjacent color branes can only appear either on its right side or its left side. For example, $r_2=l_2=0$ for a situation where there is no color branes on its right side. Then, from \cref{eq:constraint,eq:paracondi}, we have \begin{equation} Q_{\textbf{m}}=Q_{\textbf{l}}\ . \end{equation} So the positions of centers of color branes for this node and its adjacent node are the same. Consequently, we find that the vertical positions of the centers of color branes of every node are the same by using \cref{eq:paracondi,eq:constraint} repeatedly for every node of the quiver, which means the bifundamental masses are all zero and we can choose a common center of Coulomb branch for all the gauge nodes. From now on, we will choose this common center as the zero point of the vertical direction. \subsection{Partition function of general node} In figure \ref{fig:gaugenode}, we have a color brane $A$ in the middle of the central gauge node. Consider another color brane $B$ which may or may not lie in the same gauge node. Let us denote the vertical positions of the color branes $A$ and $B$ by $a_A$ and $a_B$, then their K\"ahler parameters are given by $y_A=e^{-\boldsymbol{\beta} a_A}$ and $y_B=e^{-\boldsymbol{\beta} a_B}$, respectively. By considering whether the color branes $A$ and $B$ are in the same gauge node or not as well as their relative vertical positions, we discuss and compute vector or bifundamental contribution arising from these color branes. \paragraph{Bifundamental contributions.} When the color branes $A$ and $B$ are not in the same gauge node, the fundamental string connecting them leads to the bifundamental contributions. Let us first consider their relative vertical position is $a_B>a_A$. Following Appendix \ref{app:formulas}, one readily finds that the corresponding $\mathcal{R}$ factors are given by \begin{equation}\label{eq:bifdR} \prod_{n=1}^{\infty}\mathcal{R}_{\alpha^t\beta}(Q_{\tau}^{n-1}\frac{Q_{\tau}}{Q_{BA}};\mathfrak{t},\mathfrak{q})\mathcal{R}_{\beta^t\alpha}(Q_{\tau}^{n-1}Q_{BA};\mathfrak{t},\mathfrak{q}). \end{equation} These $\mathcal{R}$ factors are further factorized into $\mathcal{M}$ factors and $\mathcal{N}$ factors by the definition in \eqref{eq:RMN}. The $\mathcal{M}$ factors from \eqref{eq:bifdR} contribute to the perturbative part of the partition function, \begin{align}\label{eq:bifdM1} &\prod_{n=1}^{\infty}\left(\mathcal{M}(Q_{\tau}^{n-1}Q_{\tau}Q_{AB}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}};\mathfrak{t},\mathfrak{q})\mathcal{M}(Q_{\tau}^{n-1}Q_{BA}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}};\mathfrak{t},\mathfrak{q})\right)^{-1}\nonumber\\ &=\,\prod_{n=1}^{\infty}\text{PE}\left[-\frac{Q_{\tau}^{n-1}Q_{\tau}Q_{AB}\sqrt{\mathfrak{t}\,\mathfrak{q}}}{(1-\mathfrak{t})(1-\mathfrak{q})}\right]\text{PE}\left[-\frac{Q_{\tau}^{n-1}Q_{BA}\sqrt{\mathfrak{t}\,\mathfrak{q}}}{(1-\mathfrak{t})(1-\mathfrak{q})}\right]\nonumber\\ &=\,\text{PE}\left[-\frac{(\sum_{n=1}^{\infty}Q_{\tau}^{n-1})Q_{\tau}Q_{AB}\sqrt{\mathfrak{t}\,\mathfrak{q}}}{(1-\mathfrak{t})(1-\mathfrak{q})}\right]\text{PE}\left[-\frac{(\sum_{n=1}^{\infty}Q_{\tau}^{n-1})Q_{BA}\sqrt{\mathfrak{t}\,\mathfrak{q}}}{(1-\mathfrak{t})(1-\mathfrak{q})}\right]\nonumber\\ &=\, \text{PE}\left[-\frac{\sqrt{\mathfrak{t}\,\mathfrak{q}}}{(1-\mathfrak{t})(1-\mathfrak{q})}\frac{1}{1-Q_{\tau}}(Q_{\tau}Q_{AB}+Q_{BA})\right], \end{align} where we have assumed $0<Q_{\tau}<1$ and $|\mathfrak{t}|,|\mathfrak{q}|\ll 1$ in order for convergence of the Plethystic exponential and we will insist this assumption throughout the rest of this section. On the other hand, these $\mathcal{M}$ factors can also be written as \begin{align}\label{eq:bifdM2} &\prod_{n=1}^{\infty}\mathcal{M}(Q_{\tau}^{n-1}Q_{\tau}Q_{AB}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}};\mathfrak{t},\mathfrak{q})^{-1}\cdot\mathcal{M}(Q_{BA}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}};\mathfrak{t},\mathfrak{q})^{-1}\prod_{n=1}^{\infty}\mathcal{M}(Q_{\tau}^{n-1}Q_{\tau}Q_{BA}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}};\mathfrak{t},\mathfrak{q})^{-1}\nonumber\\ \rightarrow &\prod_{n=1}^{\infty}\mathcal{M}(Q_{\tau}^{n-1}Q_{\tau}Q_{AB}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}};\mathfrak{t},\mathfrak{q})^{-1}\cdot\mathcal{M}(Q_{AB}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}};\mathfrak{t},\mathfrak{q})^{-1}\prod_{n=1}^{\infty}\mathcal{M}(Q_{\tau}^{n-1}Q_{\tau}Q_{BA}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}};\mathfrak{t},\mathfrak{q})^{-1}\nonumber\\ =&\prod_{n=1}^{\infty}\mathcal{M}(Q_{\tau}^{n-1}Q_{AB}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}};\mathfrak{t},\mathfrak{q})^{-1}\prod_{n=1}^{\infty}\mathcal{M}(Q_{\tau}^{n-1}Q_{\tau}Q_{BA}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}};\mathfrak{t},\mathfrak{q})^{-1}\nonumber\\ =&\text{PE}\left[-\frac{\sqrt{\mathfrak{t}\,\mathfrak{q}}}{(1-\mathfrak{t})(1-\mathfrak{q})}\frac{1}{1-Q_{\tau}}(Q_{\tau}Q_{BA}+Q_{AB})\right], \end{align} where the arrow means that we have flopped the middle $\mathcal{M}$ by using the formula, \begin{align}\label{eq:flop} \mathcal{M}(Q;\mathfrak{t},\mathfrak{q})=\text{PE}\left[\frac{Q\mathfrak{q}}{(1-\mathfrak{q})(1-\mathfrak{t})}\right]\rightarrow\mathcal{M}(Q^{-1}\tfrac{\mathfrak{t}}{\mathfrak{q}};\mathfrak{t},\mathfrak{q})=\text{PE}\left[\frac{Q^{-1}\mathfrak{t}}{(1-\mathfrak{q})(1-\mathfrak{t})}\right]. \end{align} It follows from \eqref{eq:bifdM1} and \eqref{eq:bifdM2} that the product of $\mathcal{M}$ factors is expressed as \begin{align} &\prod_{n=1}^{\infty}\left(\mathcal{M}(Q_{\tau}^{n-1}Q_{\tau}Q_{AB}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}};\mathfrak{t},\mathfrak{q})\mathcal{M}(Q_{\tau}^{n-1}Q_{BA}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}};\mathfrak{t},\mathfrak{q})\right)^{-1}\nonumber\\ & \rightarrow \text{PE}\left[-\frac{\sqrt{\mathfrak{t}\,\mathfrak{q}}}{(1-\mathfrak{t})(1-\mathfrak{q})}\frac{1+Q_{\tau}}{1-Q_{\tau}}\frac{Q_{AB}}{2}\right]\text{PE}\left[-\frac{\sqrt{\mathfrak{t}\,\mathfrak{q}}}{(1-\mathfrak{t})(1-\mathfrak{q})}\frac{1+Q_{\tau}}{1-Q_{\tau}}\frac{Q_{BA}}{2}\right]\ , \label{eq:prodMfactors} \end{align} where we have separated the result into two factors, the first PE factor is assigned to the brane $B$ and the second PE factor is assigned to the brane $A$. Since \eqref{eq:prodMfactors} is true also for $a_B<a_A$, we can assign the factors in the same way. So, the factor that is assigned to $A$ is \begin{align}\label{eq:Msource1} \text{PE}\left[-\frac{\sqrt{\mathfrak{t}\,\mathfrak{q}}}{(1-\mathfrak{t})(1-\mathfrak{q})}\frac{1+Q_{\tau}}{1-Q_{\tau}}\frac{Q_{BA}}{2}\right] \quad\text{for both }a_B>a_A\text{ and }a_B<a_A. \end{align} The $\mathcal{N}$ factors contribute to the instanton part of the partition function which are \begin{align}\label{eq:bifund} &\prod_{n=1}^{\infty}\mathcal{N}_{\alpha\beta}(Q_{\tau}^{n-1}\frac{Q_{\tau}}{Q_{BA}}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}};\mathfrak{t},\mathfrak{q})\mathcal{N}_{\beta\alpha}(Q_{\tau}^{n-1}Q_{BA}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}};\mathfrak{t},\mathfrak{q})\\ &=\frac{(Q_{BA})^{\frac{|\beta|}{2}}{\hat{f}_{\beta}(\mathfrak{t},\mathfrak{q})}^{-\frac12}}{W^{|\beta|}}\varTheta_{\beta\alpha}(\tfrac{y_B}{y_A}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}}|Q_{\tau})\times\frac{(-1)^{|\alpha|}(Q_{BA})^{\frac{|\alpha|}{2}}{\hat{f}_{\alpha}(\mathfrak{t},\mathfrak{q})}^{\frac12}}{W^{|\alpha|}}\varTheta_{\alpha\beta}(\tfrac{y_A}{y_B}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}}|Q_{\tau})\ ,\nonumber \end{align} with $\alpha, \beta$ are the Young diagrams associated the color branes $A, B$, respectively, and $\hat{f}_{\alpha}$ and $W$ are defined as \begin{align} &\hat{f}_{\alpha}(\mathfrak{t},\mathfrak{q})\equiv\mathfrak{t}^{\frac{||\alpha^t||^2}{2}}\mathfrak{q}^{-\frac{||\alpha||^2}{2}}\ ,\\ &W\equiv\prod_{n=1}^{\infty}(1-Q_{\tau}^n)\ . \end{align} In \eqref{eq:bifund}, we have separated the result into two parts: the first part is before the multiplication sign which is assigned to $\beta$, and the second part is after the multiplication sign which is assigned to $\alpha$. If $a_B<a_A$, then the factors that should be assigned to $\alpha$ is just the first part in the second line of the above equation with $\alpha,\beta$ exchanged. So in summary, the factors that should be given to $\alpha$ are \begin{equation} \left\{\begin{array}{ll} \frac{(-1)^{|\alpha|}(Q_{BA})^{\frac{|\alpha|}{2}}{\hat{f}_{\alpha}(\mathfrak{t},\mathfrak{q})}^{\frac{1}{2}}}{W^{|\alpha|}}\varTheta_{\alpha\beta}(\frac{y_A}{y_B}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}}|Q_{\tau}),&\quad\text{if}\ a_{B}>a_{A}\ ,\\ \frac{(Q_{AB})^{\frac{|\alpha|}{2}}{\hat{f}_{\alpha}(\mathfrak{t},\mathfrak{q})}^{-\frac{1}{2}}}{W^{|\alpha|}}\varTheta_{\alpha\beta}(\frac{y_A}{y_B}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}}|Q_{\tau}),&\quad\text{if}\ a_{B}<a_{A}\ . \end{array}\right. \label{eq:sources1} \end{equation} \bigskip \paragraph{Vector contribution I.} For vector contributions between $A$ and $B$($B$ is not $A$), if $a_B>a_A$, we can also obtain the corresponding $\mathcal{R}$ factors based on Appendix \ref{app:formulas} which are \begin{align}\label{eq:vecR} \prod_{n=1}^{\infty}&\mathcal{R}_{\alpha^t\beta}(Q_{\tau}^{n-1}\tfrac{Q_{\tau}}{Q_{BA}}\sqrt{\tfrac{\mathfrak{q}}{\mathfrak{t}}};\mathfrak{t},\mathfrak{q})\mathcal{R}_{\beta^t\alpha}(Q_{\tau}^{n-1}Q_{BA}\sqrt{\tfrac{\mathfrak{q}}{\mathfrak{t}}};\mathfrak{t},\mathfrak{q})\mathcal{R}_{\alpha^t\beta}(Q_{\tau}^{n-1}\tfrac{Q_{\tau}}{Q_{BA}}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}};\mathfrak{t},\mathfrak{q})\nonumber\\ &\times\mathcal{R}_{\beta^t\alpha}(Q_{\tau}^{n-1}Q_{BA}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}};\mathfrak{t},\mathfrak{q}). \end{align} The $\mathcal{M}$ factors from \eqref{eq:vecR} contribute to the perturbative part of the partition function, \begin{align}\label{eq:vecM1} &\prod_{n=1}^{\infty}\mathcal{M}(Q_{\tau}^{n-1}\tfrac{Q_{\tau}}{Q_{BA}};\mathfrak{t},\mathfrak{q})\mathcal{M}(Q_{\tau}^{n-1}Q_{BA};\mathfrak{t},\mathfrak{q})\mathcal{M}(Q_{\tau}^{n-1}\tfrac{Q_{\tau}}{Q_{BA}}\tfrac{\mathfrak{t}}{\mathfrak{q}};\mathfrak{t},\mathfrak{q})\mathcal{M}(Q_{\tau}^{n-1}Q_{BA}\tfrac{\mathfrak{t}}{\mathfrak{q}};\mathfrak{t},\mathfrak{q})\nonumber\\ &=\text{PE}\left[\frac{\mathfrak{q}+\mathfrak{t}}{(1-\mathfrak{t})(1-\mathfrak{q})}\frac{1}{1-Q_{\tau}}(Q_{\tau}Q_{AB}+Q_{BA})\right]\ . \end{align} These $\mathcal{M}$ factors can also be written as \begin{align}\label{eq:vecM2} &\prod_{n=1}^{\infty}\mathcal{M}(Q_{\tau}^{n-1}Q_{\tau}Q_{AB};\mathfrak{t},\mathfrak{q})\cdot\mathcal{M}(Q_{BA};\mathfrak{t},\mathfrak{q})\prod_{n=1}^{\infty}\mathcal{M}(Q_{\tau}^nQ_{BA};\mathfrak{t},\mathfrak{q})\prod_{n=1}^{\infty}\mathcal{M}(Q_{\tau}^{n-1}Q_{\tau}Q_{AB}\tfrac{\mathfrak{t}}{\mathfrak{q}};\mathfrak{t},\mathfrak{q})\nonumber\\ &\times\mathcal{M}(Q_{BA}\tfrac{\mathfrak{t}}{\mathfrak{q}};\mathfrak{t},\mathfrak{q})\prod_{n=1}^{\infty}\mathcal{M}(Q_{\tau}^nQ_{BA}\tfrac{\mathfrak{t}}{\mathfrak{q}};\mathfrak{t},\mathfrak{q})\nonumber\\ \rightarrow &\prod_{n=1}^{\infty}\mathcal{M}(Q_{\tau}^{n-1}Q_{\tau}Q_{AB};\mathfrak{t},\mathfrak{q})\cdot\mathcal{M}(Q_{AB}\tfrac{\mathfrak{t}}{\mathfrak{q}};\mathfrak{t},\mathfrak{q})\prod_{n=1}^{\infty}\mathcal{M}(Q_{\tau}^nQ_{BA};\mathfrak{t},\mathfrak{q})\prod_{n=1}^{\infty}\mathcal{M}(Q_{\tau}^{n-1}Q_{\tau}Q_{AB}\tfrac{\mathfrak{t}}{\mathfrak{q}};\mathfrak{t},\mathfrak{q})\nonumber\\ &\times\mathcal{M}(Q_{AB};\mathfrak{t},\mathfrak{q})\prod_{n=1}^{\infty}\mathcal{M}(Q_{\tau}^nQ_{BA}\tfrac{\mathfrak{t}}{\mathfrak{q}};\mathfrak{t},\mathfrak{q})\nonumber\\ =&\prod_{n=1}^{\infty}\mathcal{M}(Q_{\tau}^{n-1}Q_{AB};\mathfrak{t},\mathfrak{q})\prod_{n=1}^{\infty}\mathcal{M}(Q_{\tau}^nQ_{BA};\mathfrak{t},\mathfrak{q})\prod_{n=1}^{\infty}\mathcal{M}(Q_{\tau}^{n-1}Q_{AB}\tfrac{\mathfrak{t}}{\mathfrak{q}};\mathfrak{t},\mathfrak{q})\prod_{n=1}^{\infty}\mathcal{M}(Q_{\tau}^nQ_{BA}\tfrac{\mathfrak{t}}{\mathfrak{q}};\mathfrak{t},\mathfrak{q})\nonumber\\ =&\text{PE}\left[\frac{\mathfrak{q}+\mathfrak{t}}{(1-\mathfrak{t})(1-\mathfrak{q})}\frac{1}{1-Q_{\tau}}(Q_{\tau}Q_{BA}+Q_{AB})\right]\ . \end{align} where \eqref{eq:flop} is used when deriving the formula on the right side of the arrow. It follows from \cref{eq:vecM1,eq:vecM2} that the product of $\mathcal{M}$ factors is equal to the following up to a flop: \begin{align} &\prod_{n=1}^{\infty}\mathcal{M}(Q_{\tau}^{n-1}\tfrac{Q_{\tau}}{Q_{BA}};\mathfrak{t},\mathfrak{q})\mathcal{M}(Q_{\tau}^{n-1}Q_{BA};\mathfrak{t},\mathfrak{q})\mathcal{M}(Q_{\tau}^{n-1}\tfrac{Q_{\tau}}{Q_{BA}}\tfrac{\mathfrak{t}}{\mathfrak{q}};\mathfrak{t},\mathfrak{q})\mathcal{M}(Q_{\tau}^{n-1}Q_{BA}\tfrac{\mathfrak{t}}{\mathfrak{q}};\mathfrak{t},\mathfrak{q})\nonumber\\ & \rightarrow \text{PE}\left[\frac{\mathfrak{q}+\mathfrak{t}}{(1-\mathfrak{t})(1-\mathfrak{q})}\frac{1+Q_{\tau}}{1-Q_{\tau}}\frac{Q_{AB}}{2}\right]\text{PE}\left[\frac{\mathfrak{q}+\mathfrak{t}}{(1-\mathfrak{t})(1-\mathfrak{q})}\frac{1+Q_{\tau}}{1-Q_{\tau}}\frac{Q_{BA}}{2}\right]\ , \label{eq:MMMM2} \end{align} where we have separated the result into two factors, the first PE factor is assigned to the brane $B$ and the second PE factor is assigned to the brane $A$. Since \eqref{eq:MMMM2} is true also for $a_B<a_A$, we can assign the factors in the same way. So, the factor that is assigned to $A$ is \begin{align}\label{eq:Msource2} \text{PE}\left[\frac{\mathfrak{q}+\mathfrak{t}}{(1-\mathfrak{t})(1-\mathfrak{q})}\frac{1+Q_{\tau}}{1-Q_{\tau}}\frac{Q_{BA}}{2}\right],\quad\text{for both }a_B>a_A\text{ and }a_B<a_A\ . \end{align} The $\mathcal{N}$ factors from \eqref{eq:vecR} contribute to the instanton part of the partition function, \begin{align} \prod_{n=1}^{\infty}\mathcal{N}_{\alpha\beta}(Q_{\tau}^{n-1}\tfrac{Q_{\tau}}{Q_{BA}};\mathfrak{t},\mathfrak{q})\mathcal{N}_{\beta\alpha}(Q_{\tau}^{n-1}Q_{BA};\mathfrak{t},\mathfrak{q})\mathcal{N}_{\alpha\beta}(Q_{\tau}^{n-1}\tfrac{Q_{\tau}}{Q_{BA}}\tfrac{\mathfrak{t}}{\mathfrak{q}};\mathfrak{t},\mathfrak{q})\mathcal{N}_{\beta\alpha}(Q_{\tau}^{n-1}Q_{BA}\tfrac{\mathfrak{t}}{\mathfrak{q}};\mathfrak{t},\mathfrak{q}). \end{align} After rewriting the above contributions with the help of \eqref{eq:bifund}, we find \begin{align} &\frac{(Q_{BA})^{|\beta|}{\hat{f}_{\beta}(\mathfrak{t},\mathfrak{q})}^{-1}}{W^{2|\beta|}}\varTheta_{\beta\alpha}(\tfrac{y_B}{y_A}|Q_{\tau})\varTheta_{\beta\alpha}(\tfrac{y_B}{y_A}\tfrac{\mathfrak{t}}{\mathfrak{q}}|Q_{\tau})\nonumber\\ &\times\frac{(Q_{BA})^{|\alpha|}\hat{f}_{\alpha}(\mathfrak{t},\mathfrak{q})}{W^{2|\alpha|}}\varTheta_{\alpha\beta}(\tfrac{y_A}{y_B}|Q_{\tau})\varTheta_{\alpha\beta}(\tfrac{y_A}{y_B}\tfrac{\mathfrak{t}}{\mathfrak{q}}|Q_{\tau}). \end{align} If $a_B<a_A$, then we can also get the result by just exchanging $\alpha,\beta$ in the above equation. So in summary, the factors that should be given to $\alpha$ are \begin{equation} \left\{ \begin{array}{ll} \left(\frac{(Q_{BA})^{|\alpha|}\hat{f}_{\alpha}(\mathfrak{t},\mathfrak{q})}{W^{2|\alpha|}}\varTheta_{\alpha\beta}(\tfrac{y_A}{y_B}|Q_{\tau})\varTheta_{\alpha\beta}(\tfrac{y_A}{y_B}\tfrac{\mathfrak{t}}{\mathfrak{q}}|Q_{\tau})\right)^{-1}&\quad\text{if}\ a_{B}>a_{A}\,,\\ \left(\frac{(Q_{AB})^{|\alpha|}{\hat{f}_{\alpha}(\mathfrak{t},\mathfrak{q})}^{-1}}{W^{2|\alpha|}}\varTheta_{\alpha\beta}(\tfrac{y_A}{y_B}|Q_{\tau})\varTheta_{\alpha\beta}(\tfrac{y_A}{y_B}\tfrac{\mathfrak{t}}{\mathfrak{q}}|Q_{\tau})\right)^{-1}&\quad\text{if}\ a_{B}<a_{A}\,. \end{array} \right. \label{eq:sources2} \end{equation} \bigskip \paragraph{Vector contribution II.} For vector contribution between $A$ and itself which is $B=A$ compared with the previous paragraph, based on Appendix \ref{app:formulas}, we always have a pair of $\mathcal{R}$ functions \begin{align}\label{eq:vec2R} \prod_{n=1}^{\infty}\mathcal{R}_{\alpha^t\alpha}(Q_{\tau}^n\sqrt{\tfrac{\mathfrak{q}}{\mathfrak{t}}};\mathfrak{t},\mathfrak{q})\mathcal{R}_{\alpha^t\alpha}(Q_{\tau}^n\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}};\mathfrak{t},\mathfrak{q})\ . \end{align} The $\mathcal{M}$ factors of \eqref{eq:vec2R} contribute to the perturbative part of the partition function: \begin{align}\label{eq:vec2M1} &\prod_{n=1}^{\infty}\mathcal{M}(Q_{\tau}^n;\mathfrak{t},\mathfrak{q})\mathcal{M}(Q_{\tau}^n\tfrac{\mathfrak{t}}{\mathfrak{q}};\mathfrak{t},\mathfrak{q}) \rightarrow &&\prod_{n=1}^{\infty}\mathcal{M}(Q_{\tau}^{n-1};\mathfrak{t},\mathfrak{q})\mathcal{M}(Q_{\tau}^n\tfrac{\mathfrak{t}}{\mathfrak{q}};\mathfrak{t},\mathfrak{q})\nonumber\\ & &&=\text{PE}\left[\frac{1}{(1-\mathfrak{t})(1-\mathfrak{q})}\frac{1}{1-Q_{\tau}}(\mathfrak{q}+\mathfrak{t}\,Q_{\tau})\right]\ , \end{align} where we have included an extra factor $\mathcal{M}(1;\mathfrak{t},\mathfrak{q})$ when getting the right side of the arrow. We can also get another expression by including an extra factor $\mathcal{M}(\tfrac{\mathfrak{t}}{\mathfrak{q}};\mathfrak{t},\mathfrak{q})$ instead: \begin{align}\label{eq:vec2M2} &\prod_{n=1}^{\infty}\mathcal{M}(Q_{\tau}^n;\mathfrak{t},\mathfrak{q})\mathcal{M}(Q_{\tau}^n\tfrac{\mathfrak{t}}{\mathfrak{q}};\mathfrak{t},\mathfrak{q}) \rightarrow &&\prod_{n=1}^{\infty}\mathcal{M}(Q_{\tau}^{n};\mathfrak{t},\mathfrak{q})\mathcal{M}(Q_{\tau}^{n-1}\tfrac{\mathfrak{t}}{\mathfrak{q}};\mathfrak{t},\mathfrak{q})\nonumber\\ &&&=\text{PE}\left[\frac{1}{(1-\mathfrak{t})(1-\mathfrak{q})}\frac{1}{1-Q_{\tau}}(\mathfrak{q}\,Q_{\tau}+\mathfrak{t})\right] \ . \end{align} So from \cref{eq:vec2M1,eq:vec2M2}, the product of $\mathcal{M}$ factors of \eqref{eq:vec2R} is equal to the following up to extra factors: \begin{align}\label{eq:Msource3} \text{PE}\left[\frac{\mathfrak{q}+\mathfrak{t}}{(1-\mathfrak{t})(1-\mathfrak{q})}\frac{1+Q_{\tau}}{1-Q_{\tau}}\frac12\right]\ . \end{align} Apart from the contributions from \cref{eq:sources1,eq:sources2,eq:sources3}, the following factors which come from the left over factors of the two vertices of $A$ and the edge factor of $A$ also contribute to the partition function of the single node: \begin{align} &\mathfrak{t}^{\frac{||\alpha^t||^2}{2}}\mathfrak{q}^{\frac{||\alpha||^2}{2}}{f_{\alpha}(\mathfrak{t},\mathfrak{q})}^{h}(-Q_{A})^{|\alpha| = \mathfrak{t}^{\frac{||\alpha^t||^2}{2}}\mathfrak{q}^{\frac{||\alpha||^2}{2}}(-1)^{(h+1)|\alpha|}{\hat{f}_{\alpha}(\mathfrak{t},\mathfrak{q})}^{h}Q_{A}^{|\alpha|}\ , \label{eq:sources4} \end{align} with \begin{equation} h = x_1+x_2+r_1-r_3-l_1+l_2\ . \label{eq:eta} \end{equation} Combined with two $\tilde Z$ factors coming from the two vertices at the ends of $A$, the $\mathcal{N}$ factors from \eqref{eq:vec2R} can be transformed into $\varTheta$ functions by \eqref{eq:Ntotheta2} which contribute to the instanton part of the partition function: \begin{equation} \left(\frac{\mathfrak{t}^{\frac{||\alpha^t||^2}{2}}\mathfrak{q}^{\frac{||\alpha||^2}{2}}}{W^{2|\alpha|}}\varTheta_{\alpha\alpha}(1|Q_{\tau})\varTheta_{\alpha\alpha}(\tfrac{\mathfrak{t}}{\mathfrak{q}}|Q_{\tau})\right)^{-1}\ . \label{eq:sources3} \end{equation} \bigskip \paragraph{Computation of perturbative part.} From the brane A, there are three types of sources, \eqref{eq:Msource1}, \eqref{eq:Msource2}, and \eqref{eq:Msource3} that contribute to the perturbative partition function. We multiply all these contributions together and obtain: \begin{align} \text{PE}\left[\frac{1}{2(1-\mathfrak{t})(1-\mathfrak{q})}\frac{1+Q_{\tau}}{1-Q_{\tau}}\bigg(-\sqrt{\mathfrak{t}\,\mathfrak{q}}\sum_{i=n_1+1}^{n_1+n_2}Q_{B_iA}+(\mathfrak{q}+\mathfrak{t})\sum_{i=1}^{n_1}Q_{B_iA}\bigg)\right] \ . \end{align} The contributions to the perturbative partition function coming from the other color branes of the gauge node can also be obtained from the above formula by just replacing $A$ by the corresponding color brane. Multiplying all the contributions from all the color branes together, we get the perturbative partition function of the single node \begin{align}\label{eq:Zpertofgeneral} Z^{\text{node,pert}}=\text{PE}\Bigg[&\frac{1}{2(1-\mathfrak{t})(1-\mathfrak{q})}\frac{1+Q_{\tau}}{1-Q_{\tau}} \cr &\times\sum_{j=1}^{n_1}\bigg(-\sqrt{\mathfrak{t}\,\mathfrak{q}}\sum_{i=n_1+1}^{n_1+n_2}Q_{B_iB_j}+(\mathfrak{q}+\mathfrak{t})\sum_{i=1}^{n_1}Q_{B_iB_j}\bigg)\Bigg]\ . \end{align} \bigskip \paragraph{Computation of instanton part.} In total, the contributions to the instanton part of the partition function of the single node involving the particular color brane $A$ consist of four types of sources from \eqref{eq:sources1}, \eqref{eq:sources2}, \eqref{eq:sources3}, and \eqref{eq:sources4}. Then we multiply all the contributions to simplify the result. The remaining $W$, $\hat{f}$, and $-1$ factors in the result are \begin{align} W^{-(r_2+r_3+l_2+l_3-2(r_1+l_1+1))}&=1, \\ \left(\hat{f}_{\alpha}(\mathfrak{t},\mathfrak{q})\right)^{h+\frac{1}{2}(r_2+r_3-2r_1+2l_1-l_2-l_3)}&=1, \\ (-1)^{(h+1+r_2+r_3-2r_1)|\alpha|}=(-1)^{2|\alpha|}&=1, \end{align} where we used \eqref{eq:x1x2}, \eqref{eq:paracondi} and \eqref{eq:eta}. On the other hand, by using \cref{eq:Qup,eq:Qdown,eq:MNb}, the net $Q$ factors in the result are \begin{equation} Q_b^{|\alpha|}. \end{equation} For simplicity, we define \begin{align} n_1\equiv r_1+l_1+1,\qquad n_2\equiv r_2+l_2+r_3+l_3, \end{align} and we also relabel the Young diagrams in figure \ref{fig:gaugenode} as \begin{align} &\{{\beta_1,\cdots,\beta_{n_1}}\}\equiv\{\mu_1,\cdots,\mu_{r_1},\alpha,\nu_{l_1},\cdots,\nu_1\}, \\ &\{\beta_{n_1+1},\cdots,\beta_{n_1+n_2}\}\equiv\{\rho_1,\cdots,\rho_{r_2},\gamma_{l_2},\cdots,\gamma_1,\lambda_1,\cdots,\lambda_{r_3},\xi_{l_3},\cdots,\xi_1\}\ . \end{align} Then the contribution to the single node partition function that involve $\alpha$ can be written as \begin{align} Q_b^{|\alpha|}\frac{\prod_{k=n_1+1}^{n_1+n_2}\varTheta_{\alpha\beta_k}(\tfrac{y_A}{y_{B_k}}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}}|Q_{\tau})}{\prod_{k=1}^{n_1}\varTheta_{\alpha\beta_k}(\tfrac{y_A}{y_{B_k}}|Q_{\tau})\varTheta_{\alpha\beta_k}(\tfrac{y_A}{y_{B_k}}\tfrac{\mathfrak{t}}{\mathfrak{q}}|Q_{\tau})} \ . \end{align} The contribution of the other color branes of the single node can also be obtained from the above equation by replacing $\alpha$ by the corresponding Young diagram of the color brane. Multiplying all the contributions from all the color branes of the single gauge node, we get the instanton partition function of the single node \begin{align}\label{eq:Zinstofgeneral} Z_{\beta_1,\cdots,\beta_{n_1+n_2}}^{\text{node,inst}}=Q_b^{\sum_{\ell=1}^{n_1}|\beta_{\ell}|}\prod_{\ell=1}^{n_1}\frac{\prod_{k=n_1+1}^{n_1+n_2}\varTheta_{\beta_{\ell}\beta_k}(\tfrac{y_{B_{\ell}}}{y_{B_k}}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}}|Q_{\tau})}{\prod_{k=1}^{n_1}\varTheta_{\beta_{\ell}\beta_k}(\tfrac{y_{B_{\ell}}}{y_{B_k}}|Q_{\tau})\varTheta_{\beta_{\ell}\beta_k}(\tfrac{y_{B_{\ell}}}{y_{B_k}}\tfrac{\mathfrak{t}}{\mathfrak{q}}|Q_{\tau})} \ , \end{align} which is the basic unit that appears in the instanton partition functions of rank 1 $D_4$,$D_5$ and $E_6$ in \cref{eq:D4inst,eq:D5inst,eq:E6inst}. \bigskip \subsection{Full partition function}\label{sec:generalformula} We have obtained the partition function of a general single gauge node in the previous subsection. Now we can easily obtain the full partition function of a general $DE$-type LST by multiplying the partition functions of each gauge node together. But before that, there is still one more kind of factor that is missing in the perturbative part. We further need to include the factor \begin{align}\label{eq:stripfactor} \prod_{l=1}^{\infty}\frac{1}{1-Q_{\tau}^l}, \end{align} that comes from a single periodic vertical strip in \eqref{eq:Zofgeneralstrip} into the perturbative part. This factor can be rewritten\footnote{The two formulae are used: $\log(1-Q)=-\sum_{n=1}^\infty\frac{Q^n}{n}$, $\sum_{l=1}^\infty Q^l=\frac{Q}{1-Q}$. } in terms of PE: \begin{align}\label{eq:PEstripfactor} \prod_{l=1}^{\infty}\frac{1}{1-Q_{\tau}^l}=\exp\left[-\sum_{l=1}^{\infty}\log(1-Q_{\tau}^l)\right]=\exp\left[\sum_{n=1}^\infty\frac{1}{n}\frac{Q_{\tau}^n}{1-Q_{\tau}^n}\right]=\text{PE}\left[\frac{Q_{\tau}}{1-Q_{\tau}}\right]. \end{align} For $D,E$-type LST which has $N$ gauge nodes, in its trivalent gluing brane webs, a single vertical strip might be shared by more than one gauge node, but we should not double count the strip. One can show that the total number of independent vertical strips is $N+1$, so that we should include $N+1$ copies of \eqref{eq:stripfactor} into the perturbative part. This is consistent with the corresponding factors in \eqref{eq:D4pert}, \eqref{eq:D5pert} and \eqref{eq:E6pert}. Including this factor, now we can finally obtain the full partition function. Before providing the explicit form of the partition function, we summarize the notation and convention for the expression of the full partition function: we use the capital indices $I,J$ to label the nodes in the affine $D$- or $E$-type Dynkin diagram. The total number of gauge nodes is $N$, so $I,J\in\{1,2,\cdots,N\}$. The Cartan matrix is denoted as $C_{IJ}$, where $C_{IJ}=+2$ for $I=J$, $C_{IJ}=-1$ if $I$-th node and $J$-th node are connected with each other by a single line, and $C_{IJ}=0$ if $I$-th node and $J$-th node are not connected. Also, we denote the instanton factor of each gauge node as $Q_{I}$. Moreover, in order to label the color branes, we use the combination of the capital indices $I,J$ and the small indices $k, \ell$. For example, the combination of the indices $I$ and $k$ indicates the $k$-th color brane inside the $I$-th gauge node. And we use $n(I)$ to denote the total number of color branes in the $I$-th gauge node, so $k\in\{1,2,\cdots,n(I)\}$. We denote the exponential of the height of the color brane as $y_{I,k}$ and the Young diagram assigned to it as $\mu_{I,k}$. It then follows from \eqref{eq:Zpertofgeneral} and \eqref{eq:PEstripfactor} that the perturbative part of the full partition function is given by up to flop, \begin{align}\label{eq:unifiedpert} Z_{\text{pert}} =\text{PE}\left[\frac{\sqrt{\mathfrak{t}\mathfrak{q}}}{(1-\mathfrak{t})(1-\mathfrak{q})}\frac{1+Q_{\tau}}{1-Q_{\tau}}\sum_{I,J}\sum_{k,\ell}\sum_{s=\pm 1}\frac{1}{4}C_{IJ}\frac{y_{J,\ell}}{y_{I,k}}\left(\frac{\mathfrak{t}}{\mathfrak{q}}\right)^{\frac{1}{2}s\,\delta_{IJ}}+(N+1)\frac{Q_{\tau}}{1-Q_{\tau}}\right]\ . \end{align} In a similar, from \eqref{eq:Zinstofgeneral}, one fines that the instanton part of the full partition function is given by \begin{align}\label{eq:unifiedinst} Z_{\text{inst}} = &\sum_{ \{ \mu \} } \left( \prod_{I} Q_{I}^{\sum_{k} |\mu_{I,k}|}\right) \prod_{I,J} \prod_{k,\ell} \prod_{s=\pm 1} \varTheta_{\mu_{I,k}\mu_{J,\ell}} \left( \tfrac{y_{I,k}}{y_{J,\ell}} \left(\tfrac{\mathfrak{t}}{\mathfrak{q}}\right)^{\frac12-\frac12 s \,\delta_{IJ}} \Big| Q_{\tau} \right)^{-\frac{1}{2}C_{IJ}}. \end{align} Note that the indices $I$ and $J$ both run all the gauge nodes, the indices $k$ and $\ell$ run all the color branes in the $I$-th and $J$-th gauge nodes respectively. However, due to the power $-\frac{1}{2}C_{IJ}$, there is no contribution unless $I=J$ or $I$-th node and $J$-th node are connected with each other. Also remember that the centers of Coulomb branch of each gauge node have the same vertical position that is set to be zero point which is concluded at the end of section \ref{sec:introGN}, so the $y$ parameters have to satisfy the constraints \begin{align}\label{eq:yconstraint} \prod_{k=1}^{n(I)} y_{I,k}=1,\quad\forall I\in\{1,2,\cdots,N\}. \end{align} If we define the distance between $y_{I,j}$ and $y_{I,j+1}$ as \begin{align} Q_{I,j}\equiv \frac{y_{I,j}}{y_{I,j+1}}, \end{align} then $Q_{I,j}$'s are independent K\"ahler parameters that solve the constraints \eqref{eq:yconstraint} \begin{align} y_{I,k}=\frac{\prod_{i=k}^{n(I)-1}Q_{I,i}}{\left(\prod_{i=1}^{n(I)-1}Q_{I,i}^i\right)^{\frac{1}{n(I)}}}\ . \end{align} We have confirmed that our formula reproduces all the results discussed in section \ref{sec:LSTandselfGluing}. As discussed in Appendix \ref{app:AtypeLittleString}, we find that it also reproduces the $A_{M-1}$-type little string theory considered in, e.g., \cite{Hohenegger:2013ala} when we tune one of the mass parameters. Also, note that we need to assume $|Q_{\tau}| \ll |y_{I,k}|, |t|, |q|$ in order to reproduce the perturbative part in the previous sections. We can interpret our proposal as Nekrasov partition function for the 6d $ADE$-type quiver gauge theories discussed in \cite{Nekrasov:2012xe, Nekrasov:2013xda}. In our proposal, the contribution from the vector fields and from the bi-fundamental fields are given in a unified manner. For example, the contribution from the vector multiplets of the $I_0$-the gauge node, \begin{align} \prod_{k,\ell} \left[ \varTheta_{\mu_{I_0,k}\mu_{I_0,\ell}} \left( \tfrac{y_{I_0,k}}{y_{I_0,\ell}} \Big| Q_{\tau} \right) \varTheta_{\mu_{I_0,k}\mu_{I_0,\ell}} \left( \tfrac{y_{I_0,k}}{y_{I_0,\ell}} \left(\tfrac{\mathfrak{t}}{\mathfrak{q}}\right) \Big| Q_{\tau} \right) \right]^{-1} \end{align} is obtained from $I=J=I_0$ in \eqref{eq:unifiedinst}, where the first factor comes from $s=+1$ while the second factor comes from $s=-1$. Also, the contribution from the bifundamental multiplets on the $I_0$-th gauge node and the $J_0$-th gauge node, \begin{align} \prod_{k,\ell} \left[ \varTheta_{\mu_{I_0,k}\mu_{J_0,\ell}} \left( \tfrac{y_{I_0,k}}{y_{J_0,\ell}} \left(\tfrac{\mathfrak{t}}{\mathfrak{q}}\right)^{\frac{1}{2}} \Big| Q_{\tau} \right) \varTheta_{\mu_{J_0,\ell}\mu_{I_0,k}} \left( \tfrac{y_{J_0,\ell}}{y_{I_0,k}} \left(\tfrac{\mathfrak{t}}{\mathfrak{q}}\right)^{\frac{1}{2}} \Big| Q_{\tau} \right) \right] \end{align} is obtained from $I=I_0, J=J_0$, which gives the first factor, and from $I=J_0, J=I_0$, which gives the second factor. The product for $s$ is performed trivially and the dummy indices $k$ and $\ell$ are exchanged for the second factor. Finally, we comment on the 5d and 4d limit. By taking the limit $Q_{\tau} \to 0$, we obtain the partition function for 5d Dynkin quiver gauge theories. The perturbative part of the partition function is given by \begin{align} Z_{\text{pert}} =\text{PE}\left[\frac{\sqrt{\mathfrak{t}\mathfrak{q}}}{(1-\mathfrak{t})(1-\mathfrak{q})}\sum_{I,J}\sum_{k,\ell}\sum_{s=\pm 1}\frac{1}{4}C_{IJ}\frac{y_{J,\ell}}{y_{I,k}}\left(\frac{\mathfrak{t}}{\mathfrak{q}}\right)^{\frac{1}{2}s\,\delta_{IJ}}\right]\ . \end{align} up to flop and the instanton part is given by \begin{align} Z_{\text{inst}} = &\sum_{ \{ \mu \} } \left( \prod_{I} Q_{I}^{\sum_{k} |\mu_{I,k}|}\right) \prod_{I,J} \prod_{k,\ell} \prod_{s=\pm 1} \prod_{(i,j) \in \mu_{I,k}} \cr & \qquad \left[ \left( \frac{y_{J,\ell}}{y_{I,k}} t^{-\left( \mu^T_{J,\ell} \right)_j + i - \frac{1}{2} + \frac{1}{2} s \delta_{IJ}} q^{-\left( \mu_{I,k} \right)_i+j-\frac{1}{2}-\frac{1}{2} s \delta_{IJ}} \right)^{\frac{1}{2}} \right. \cr & \qquad \left. - \left( \frac{y_{J,\ell}}{y_{I,k}} t^{-\left( \mu^T_{J,\ell} \right)_j + i - \frac{1}{2} + \frac{1}{2} s \delta_{IJ}} q^{-\left( \mu_{I,k} \right)_i+j-\frac{1}{2}-\frac{1}{2} s \delta_{IJ}} \right)^{-\frac{1}{2}} \right]^{-\frac{1}{2}C_{IJ}} \cr = &\sum_{ \{ \mu \} } \left( \prod_{I} Q_{I}^{\sum_{k} |\mu_{I,k}|}\right) \prod_{I,J} \prod_{k,\ell} \prod_{s=\pm 1} \prod_{(i,j) \in \mu_{I,k}} \cr & \qquad \left[ \sinh {\boldsymbol{\beta}} \left( a_{J,\ell}-a_{I,k} + \Big( -( \mu^T_{J,\ell} )_j + i - \frac{1}{2} + \frac{1}{2} s \delta_{IJ} \Big) \epsilon_1 \right. \right. \cr & \left. \left. \qquad \qquad \qquad \qquad \qquad + \Big( (\mu_{I,k})_i-j+\frac{1}{2}+\frac{1}{2} s \delta_{IJ} \Big) \epsilon_2 \right) \right]^{-\frac{1}{2}C_{IJ}}. \end{align} By taking the limit ${\boldsymbol{\beta}} \to 0$ while keeping $Q_{I}$ as they are, we obtain the partition function for 4d Dynkin quiver gauge theories. The perturbative part of the partition function is given by \begin{align} Z_{\text{pert}} = & \prod_{I,J} \prod_{k,\ell} \prod_{s=\pm 1} \Gamma_{\epsilon_1, \epsilon_2}\left( a_{J,\ell}-a_{I,k} + \Big( - \frac{1}{2} + \frac{1}{2} s \delta_{IJ} \Big) \epsilon_1 + \Big( \frac{1}{2}+\frac{1}{2} s \delta_{IJ} \Big) \epsilon_2 \right)^{-\frac{1}{2}C_{IJ}}\ , \end{align} up to regularization, where $\Gamma_{\epsilon_1, \epsilon_2}$ is the Barnes’ double-Gamma function. The instanton part is given by \begin{align} Z_{\text{inst}} = &\sum_{ \{ \mu \} } \left( \prod_{I} Q_{I}^{\sum_{k} |\mu_{I,k}|}\right) \prod_{I,J} \prod_{k,\ell} \prod_{s=\pm 1} \prod_{(i,j) \in \mu_{I,k}} \cr & \quad \times\left[ a_{J,\ell}-a_{I,k} + \Big( -( \mu^T_{J,\ell} )_j + i - \frac{1}{2} + \frac{1}{2} s \delta_{IJ} \Big) \epsilon_1 \right. \cr & \left. \qquad \qquad \qquad \qquad \qquad + \Big( (\mu_{I,k})_i-j+\frac{1}{2}+\frac{1}{2} s \delta_{IJ} \Big) \epsilon_2 \right]^{-\frac{1}{2}C_{IJ}}. \end{align} \section{Partition function and symmetry}\label{sec:Symmetry} In this section, we will see their symmetries in the form of characters by expanding the partition functions of $D$-type and $E$-type LSTs which are obtained in the previous section. Although we have constructed the general brane web realizations of the $D$-type and $E$-type LSTs, we still need to determine the appropriate parameters to expand the partition function correctly and to represent the fugacities of the symmetry group. Surprisingly, we find that the brane web has all the information of the Weyl symmetry that the LSTs should have. Then, from the brane web structure, we can determine the appropriate parameters for the fugacities of the symmetry group as well as the appropriate expansion parameters. Moreover, the Weyl symmetry is also helpful in determining the coefficients of the expansion of the partition function. In the following, we will first give a brief introduction about Weyl symmetry related to brane web, and then we will derive the expansion form of the partition functions of $D_4$, $D_5$ and $E_6$ LSTs by using the Weyl invariance. \subsection{Weyl symmetry and brane web} One of the way to see the (global) symmetry of a gauge theory explicitly is to expand its partition function with the expansion parameters being the Coulomb branch parameters, and then the coefficients of the Coulomb branch parameters will turn out to be expressed by the characters of the symmetry group. In this process, we have to make sure that the Coulomb branch parameters are not affected by the Weyl reflections of the symmetry group when we act the Weyl reflections, so we have to properly choose the so called invariant Coulomb branch parameters \cite{Mitev:2014jza, Hayashi:2019jvx} as the expansion parameters which are Weyl invariant. Thus the partition function has Weyl invariance as we expect. We will see such Weyl symmetry after we obtain the expansion of partition function. However, the Weyl symmetry can be seen from the brane web without computing the partition functions. For example, a part of the Weyl reflections can be identified as the fiber-base duality \cite{Katz:1997eq, Aharony:1997bh, Bao:2011rc} in the case of 5d rank 1 gauge theories \cite{Mitev:2014jza}. Another simpler example is exchanging parallel flavor branes on the same side, which corresponds to the Weyl symmetry of exchanging mass parameters. These examples illustrate that the Weyl reflections of the symmetry group can be seen from the brane web. In this paper, we are dealing with the affine $D$-type and $E$-type quiver gauge theories, and we will find that all the independent Weyl reflections of the symmetry groups of the quiver theories can be identified with certain symmetries of the corresponding brane webs. In the following subsections, we will show that, the partition functions have the same symmetry as the web diagrams. \subsection{\texorpdfstring{$D_4$}{D4} LST} \begin{figure}[htbp] \centering \includegraphics[scale=0.5]{D4-quad-Dynkin.pdf} \caption{(a) A quadrivalent gluing brane web of $D_4$ LST. (b) An affine Dynkin diagram of affine $D_4$. } \label{fig:D4Dynkin} \end{figure} For the brane web of $D_4$ LST, as shown in figure \ref{fig:D4Dynkin}(a), each gauge node has two parallel external NS charged branes\footnote{Note that we have identified the top and bottom NS charged branes, so they are just counted as a single brane. }, so the configuration of the brane web is invariant if we switch the two NS charged branes. In this switching, the K\"ahler parameters will accordingly be transformed. For the $D_4$ LST, we have five gauge nodes, and we will have five K\"ahler parameter transformations that correspond to the switching of external NS charged branes for each of the five nodes. The five transformations are as follows: \begin{equation}\label{eq:D4WeylinQaff} \left\{\begin{array}{l} Q_1\rightarrow Q_1^{-1},\ Q_5\rightarrow Q_5Q_1.\\ Q_2\rightarrow Q_2^{-1},\ Q_5\rightarrow Q_5Q_2.\\ Q_3\rightarrow Q_3^{-1},\ Q_5\rightarrow Q_5Q_3.\\ Q_4\rightarrow Q_4^{-1},\ Q_5\rightarrow Q_5Q_4.\\ Q_5\rightarrow Q_5^{-1},\ Q_1\rightarrow Q_1Q_5,\ Q_2\rightarrow Q_2Q_5,\ Q_3\rightarrow Q_3Q_5,\ Q_4\rightarrow Q_4Q_5. \end{array}\right. \end{equation} Due to the structure of the brane web in figure \ref{fig:D4Dynkin}(a), $Q_1$ is only connected to $Q_5$. Then, when $Q_1$ is transformed to $Q_1^{-1}$, only $Q_5$ is affected. However, $Q_5$ is connected to $Q_1,Q_2,Q_3,Q_4$, so when $Q_5$ is transformed to $Q_5^{-1}$, $Q_1,Q_2,Q_3,Q_4$ are all affected. On the other hand, when we consider the affine $D_4$ given in figure \ref{fig:D4Dynkin}(b), where we have labelled the five affine simple roots, the indices of these roots are in accord with the $Q$'s in figure \ref{fig:D4Dynkin}(a). Via the following formula for (affine) Weyl reflection \begin{align}\label{eq:affineWeylref} r_{\alpha_i}\cdot \alpha_j=\alpha_j-\frac{2(\alpha_j,\alpha_i)}{(\alpha_i,\alpha_i)}\alpha_i, \end{align} where $r_{\alpha_i}$ is the (affine) Weyl reflection corresponding to the simple root $\alpha_i$ and it acts on the simple root $\alpha_j$, we can easily obtain the five affine Weyl reflections that correspond to the five simple roots: \begin{equation}\label{eq:D4Weylinalpha} \left\{\begin{array}{l} r_{\alpha_1}:\ \ \alpha_1\rightarrow -\alpha_1,\ \alpha_5\rightarrow \alpha_5+\alpha_1.\\ r_{\alpha_2}:\ \ \alpha_2\rightarrow -\alpha_2,\ \alpha_5\rightarrow \alpha_5+\alpha_2.\\ r_{\alpha_3}:\ \ \alpha_3\rightarrow -\alpha_3,\ \alpha_5\rightarrow \alpha_5+\alpha_3.\\ r_{\alpha_4}:\ \ \alpha_4\rightarrow -\alpha_4,\ \alpha_5\rightarrow \alpha_5+\alpha_4.\\ r_{\alpha_5}:\ \ \alpha_5\rightarrow -\alpha_5,\ \alpha_1\rightarrow \alpha_1+\alpha_5,\ \alpha_2\rightarrow \alpha_2+\alpha_5,\ \alpha_3\rightarrow \alpha_3+\alpha_5,\ \alpha_4\rightarrow \alpha_4+\alpha_5 . \end{array}\right. \end{equation} Here, we omit the trivial transformations such as $\alpha_2\rightarrow \alpha_2$. By comparing \eqref{eq:D4WeylinQaff} with \eqref{eq:D4Weylinalpha}, we realize that the $Q$'s are just the fugacities of affine $D_4$ in $\alpha$-basis and \eqref{eq:D4WeylinQaff} are actually the five Weyl reflections in \eqref{eq:D4Weylinalpha}. For usual brane web which is just a single web diagram, we know that its partition function computed by topological vertex formalism is flop invariant up to possible analytical continuation, where the ``flop" includes flop transitions which change the configuration of the brane web as well as only switchings of parallel branes which do not change the brane web configuration. Although we use trivalent and quadrivalent gluing of brane webs in this paper, we will still assume that its partition function is flop invariant up to possible analytical continuation. Now if we start with the brane web in figure \ref{fig:D4Dynkin}(a) and switch the external NS-charged branes, the partition function of the switched brane web will be the same as the partition function of the original brane web up to possible analytical continuation. On the other hand, the partition function of the switched brane web can also be obtained by just replacing the K\"ahler parameters in the partition function of the original brane web by the transformed K\"ahler parameters via \eqref{eq:D4WeylinQaff} due to the invariance of the configuration of the brane web under switching external NS-charged branes. Thus we conclude that: The partition function of $D_4$ LST is invariant up to possible analytical continuation under the transformations in \eqref{eq:D4WeylinQaff} which are all the independent affine Weyl reflections of affine $D_4$, so \textit{the partition function for $D_4$ LST has affine $D_4$ symmetry.} Note that we focus on $Q_1,\cdots,Q_5$ which are the simple roots, aside from that we have to choose the other parameters of the theory to be not affected by Weyl reflections. Then when we expand the partition function with respect to these Weyl invariant parameters, their coefficients will be functions of the characters of affine $D_4$ composed of $Q_1,\cdots,Q_5$. In principle, if we could sum over all the horizontal Young diagrams in the brane web, we could see the affine $D_4$ characters, but the computation will be very demanding, so instead we try to see the $D_4$ characters by using four of the five affine Weyl reflections in \eqref{eq:D4WeylinQaff}. There are two kinds of choices when selecting four Weyl reflections out of the five. \paragraph{Choice I.} One choice is to choose the Weyl reflections corresponding to $Q_1,Q_2,Q_3,Q_4$. The remaining parameter $Q_5$ can not be used as expansion parameter since it transforms under these four Weyl reflections non-trivially, so we replace $Q_5$ by the horizontal period $u$ of the $D_4$ LST, \begin{align} u=Q_1Q_2Q_3Q_4Q_5^2\ , \end{align} which is invariant under all the five affine Weyl reflections in \eqref{eq:D4WeylinQaff}. Now the four chosen affine Weyl reflections reduce to the following transformations: \begin{equation}\label{eq:D4Weylun} \left\{\begin{array}{l} Q_1\rightarrow Q_1^{-1}\\ Q_2\rightarrow Q_2^{-1}\\ Q_3\rightarrow Q_3^{-1}\\ Q_4\rightarrow Q_4^{-1} \ . \end{array}\right. \end{equation} They are the Weyl reflections of SU(2) for each corner gauge node, but they do not form the Weyl reflections of $D_4$. By looking at the brane web in figure \ref{fig:D4Dynkin}(a), we can see that there is a permutation symmetry among $Q_1,Q_2,Q_3,Q_4$, \begin{equation}\label{eq:permute} \left\{\begin{array}{l} Q_1\rightarrow Q_2,\ Q_2\rightarrow Q_1\\ Q_2\rightarrow Q_3,\ Q_3\rightarrow Q_2\\ Q_3\rightarrow Q_4,\ Q_4\rightarrow Q_3 \end{array}\right. \end{equation} because four sub web diagrams share the same Coulomb branch parameter with the middle SU(2) web, and they only differ by their instanton factors $Q_1,Q_2,Q_3,Q_4$. If we pick only one of the transformations in \eqref{eq:D4Weylun}, we can use the permutation symmetry to obtain the other three transformations in \eqref{eq:D4Weylun} by using \eqref{eq:permute}. So the SU(2) Weyl symmetry and the permutation symmetry form the fundamental Weyl-like symmetry of the theory: \begin{equation}\label{eq:fundsymofD4rk1} \left\{\begin{array}{l} Q_1\rightarrow Q_1^{-1}\ \\ Q_1\rightarrow Q_2,\ Q_2\rightarrow Q_1\ \\ Q_2\rightarrow Q_3,\ Q_3\rightarrow Q_2\ \\ Q_3\rightarrow Q_4,\ Q_4\rightarrow Q_3\ . \end{array}\right. \end{equation} From this symmetry, we can obtain the following transformations: \begin{equation}\label{eq:D4Weylrefl} \left\{\begin{array}{l} Q_1\rightarrow Q_2,\ Q_2\rightarrow Q_1\ \\ Q_2\rightarrow Q_3,\ Q_3\rightarrow Q_2\ \\ Q_3\rightarrow Q_4,\ Q_4\rightarrow Q_3\ \\ Q_3\rightarrow Q_4^{-1},\ Q_4\rightarrow Q_3^{-1} . \end{array}\right. \end{equation} They are the Weyl reflections of $D_4$ in orthonormal basis, although $Q_1,\cdots,Q_4$ are the fugacities of affine $D_4$ in $\alpha$-basis. Note that this method of obtaining the $D_4$ symmetry is applicable only for the rank 1 $D_4$ LST. If we consider higher rank $D_4$ LST, there is no permutation symmetry that only involves $Q_1,Q_2,Q_3,Q_4$ because each one of the four corner gauge nodes will have different Coulomb branch parameters in the higher rank case, and the permutation symmetry will involve both instanton factors and Coulomb branch parameters of the corner gauge nodes. For convenience in computations, we define the new Coulomb branch parameter \begin{align} w_5\equiv Q_{5,1}^{1/2}\ , \end{align} which is invariant under the Weyl reflections in \eqref{eq:D4Weylrefl}, so that it is invariant Coulomb branch parameter and can be used as expansion parameter. Note that $w_5$ is not affected by the four SU(2) Weyl reflections in \eqref{eq:D4Weylun} either, so the coefficients of $w_5$ in the expansion of the partition function will also have SU(2) Weyl symmetries. $Q_{\tau}$ is Weyl invariant, so it is also an expansion parameter. \bigskip \paragraph{Choice II.} The other choice is to choose the Weyl reflections\footnote{Of course we can also choose $Q_2,Q_5,Q_3,Q_4$ and so on. They are equivalent choices. } correspond to $Q_3,Q_5,Q_1,Q_2$ so $Q_4$ will be replaced by $u$ as expansion parameter. Four chosen affine Weyl reflections reduce to following: \begin{equation}\label{eq:unaffD4WeylinQ} \left\{\begin{array}{l} Q_3\rightarrow Q_3^{-1},\ Q_5\rightarrow Q_5Q_3\\ Q_5\rightarrow Q_5^{-1},\ Q_1\rightarrow Q_1Q_5,\ Q_2\rightarrow Q_2Q_5,\ Q_3\rightarrow Q_3Q_5\\ Q_1\rightarrow Q_1^{-1},\ Q_5\rightarrow Q_5Q_1\\ Q_2\rightarrow Q_2^{-1},\ Q_5\rightarrow Q_5Q_2 . \end{array}\right. \end{equation} They are the $D_4$ Weyl reflections in the basis $\{\alpha_3,\alpha_5,\alpha_1,\alpha_2\}$. \begin{figure}[htbp] \centering \includegraphics[scale=0.6]{D4-quad-Coulomb.pdf} \caption{Transformation of Coulomb branch parameter in gauge node 5.} \label{fig:D4Coulomb} \end{figure} The Coulomb branch parameter $w_5$ does not change under the Weyl reflections of $Q_3,Q_1,Q_2$ , but it changes under the Weyl reflection of $Q_5$ due to the invariance of $\tilde{Q}$, as shown in figure \ref{fig:D4Coulomb}. Including Coulomb branch parameter, the Weyl reflections become as follows: \begin{equation}\label{eq:unaffD4WeylinQwithw} \left\{\begin{array}{l} Q_3\rightarrow Q_3^{-1},\ Q_5\rightarrow Q_5Q_3\\ Q_5\rightarrow Q_5^{-1},\ Q_1\rightarrow Q_1Q_5,\ Q_2\rightarrow Q_2Q_5,\ Q_3\rightarrow Q_3Q_5,\ w_5\rightarrow Q_5 w_5\\ Q_1\rightarrow Q_1^{-1},\ Q_5\rightarrow Q_5Q_1\\ Q_2\rightarrow Q_2^{-1},\ Q_5\rightarrow Q_5Q_2 . \end{array}\right. \end{equation} The invariant Coulomb branch parameter will take the general form of $Q_1^a Q_2^b Q_3^c Q_5^d w_5$. Then, by substituting the four Weyl reflections in \eqref{eq:unaffD4WeylinQwithw} into the general form respectively and requiring the invariance under these transformations, we can get four linear equations of $a,b,c,d$, and obtain one solution. We find the invariant Coulomb branch parameter $A$ to be \begin{align} A=Q_1Q_2Q_3Q_5^2w_5\ . \end{align} If we switch from the $\alpha$-basis fugacities $Q_i$ to the orthonormal basis fugacities $B_i$, we have \begin{align}\label{eq:D4orthonormal} Q_3=\frac{B_1}{B_2},~ Q_5=\frac{B_2}{B_3},~ Q_1=\frac{B_3}{B_4},~ Q_2=B_3 B_4\ . \end{align} Then, in the orthonormal basis, the Weyl reflections in \eqref{eq:unaffD4WeylinQ} become as follows: \begin{equation}\label{eq:D4WeylinB} \left\{\begin{array}{l} B_1\rightarrow B_2,\ B_2\rightarrow B_1\\ B_2\rightarrow B_3,\ B_3\rightarrow B_2\\ B_3\rightarrow B_4,\ B_4\rightarrow B_3\\ B_3\rightarrow B_4^{-1},\ B_4\rightarrow B_3^{-1} . \end{array}\right. \end{equation} \bigskip In the following part of this subsection, we will compute the partition function of the $D_4$ LST, and show the $D_4$ character expression of the partition function in two different ways according to the above two different choices of the Weyl reflections. From \eqref{eq:D4inst}, we have \begin{align}\label{eq:oldD4inst} Z^{D_4}_{\text{inst}}=\sum_{\mu_{5,1},\mu_{5,2}}\bar{Z}_{\mu_{5,1}\mu_{5,2}}^{\text{SU(2)}}(w_5,Q_5)&\sum_{\mu_{1,1}}\bar{Z}_{\mu_{5,1}\mu_{5,2}\mu_{1,1}}(w_5,Q_1)\sum_{\mu_{2,1}}\bar{Z}_{\mu_{5,1}\mu_{5,2}\mu_{2,1}}(w_5,Q_2)\nonumber\\ \times &\sum_{\mu_{3,1}}\bar{Z}_{\mu_{5,1}\mu_{5,2}\mu_{3,1}}(w_6,Q_3)\sum_{\mu_{4,1}}\bar{Z}_{\mu_{5,1}\mu_{5,2}\mu_{4,1}}(w_6,Q_4), \end{align} where \begin{align} &\bar{Z}_{\mu_{5,1}\mu_{5,2}}^{\text{SU(2)}}(w_5,Q_5)=\frac{Q_5^{|\mu_{5,1}|+|\mu_{5,2}|}}{\prod_{p=1}^{2}\prod_{r=1}^{2}\varTheta_{\mu_{5,p}\mu_{5,r}}(\frac{y_{5,p}}{y_{5,r}}|Q_{\tau})\varTheta_{\mu_{5,p}\mu_{5,r}}(\frac{y_{5,p}}{y_{5,r}}\tfrac{\mathfrak{t}}{\mathfrak{q}}|Q_{\tau})},\label{eq:zsu2ofD4}\\ &\bar{Z}_{\mu_{5,1}\mu_{5,2}\mu_{1,1}}(w_5,Q_1)=Q_{1}^{|\mu_{1,1}|} \frac{\prod_{l=1}^{2}\varTheta_{\mu_{1,1}\mu_{5,l}}(\frac{y_{1,1}}{y_{5,l}}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}}|Q_{\tau})\prod_{p=1}^2\varTheta_{\mu_{5,p}\mu_{1,1}}(\frac{y_{5,p}}{y_{1,1}}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}}|Q_{\tau})}{\varTheta_{\mu_{1,1}\mu_{1,1}}(1|Q_{\tau})\varTheta_{\mu_{1,1}\mu_{1,1}}(\tfrac{\mathfrak{t}}{\mathfrak{q}}|Q_{\tau})}.\label{eq:zsu1ofD4} \end{align} We can observe from \eqref{eq:zsu2ofD4} and \eqref{eq:zsu1ofD4} that \begin{align} \bar{Z}_{\mu_{5,1}\mu_{5,2}}^{\text{SU(2)}}(w_5,Q_5)=&\bar{Z}_{\mu_{5,2}\mu_{5,1}}^{\text{SU(2)}}(w_5^{-1},Q_5)\ , \\ \bar{Z}_{\mu_{5,1}\mu_{5,2}\mu_{1,1}}(w_5,Q_1)=&\bar{Z}_{\mu_{5,2}\mu_{5,1}\mu_{1,1}}(w_5^{-1},Q_1)\ , \end{align} which is due to the flop invariance of partition function combined with the invariance of the brane web configuration under the Weyl reflection of the Coulomb branch $w_5\rightarrow w_5^{-1}$. In order to compute \eqref{eq:oldD4inst}, we choose $Q_5$ as the expansion parameter although $Q_5$ will not be the final expansion parameter for seeing the $D_4$ characters. We extract the zeroth order term of $Q_5$ from \eqref{eq:oldD4inst} and combine it with $Z^{D_4}_{\text{pert}}$ to form the zeroth order of $Q_5$ for the full partition function. So the full partition function of the $D_4$ LST can now be rewritten as \begin{equation} Z^{D_4}=Z^{D_4}_{Q_5^{\bf 0}}\cdot Z^{D_4}_{Q_5} \ , \end{equation} where \begin{align}\label{eq:nZ_D4pert} Z^{D_4}_{Q_5^{\bf 0}}=Z^{D_4}_{\text{pert}}\cdot &\sum_{\mu_{1,1}}\bar{Z}_{\text{\o}\oo\mu_{1,1}}(w_5,Q_1) \sum_{\mu_{2,1}}\bar{Z}_{\text{\o}\oo\mu_{2,1}}(w_5,Q_2)\nonumber\\ \times &\sum_{\mu_{3,1}}\bar{Z}_{\text{\o}\oo\mu_{3,1}}(w_5,Q_3)\sum_{\mu_{4,1}}\bar{Z}_{\text{\o}\oo\mu_{4,1}}(w_5,Q_4)\ , \end{align} \begin{align} Z^{D_4}_{Q_5} =&\sum_{\mu_{5,1}\mu_{5,2}}\bar{Z}_{\mu_{5,1}\mu_{5,2}}^{\text{SU(2)}}(w_5,Q_5)\frac{\sum_{\mu_{1,1}}\bar{Z}_{\mu_{5,1}\mu_{5,2}\mu_{1,1}}(w_5,Q_{1})}{\sum_{\mu_{1,1}}\bar{Z}_{\text{\o}\oo\mu_{1,1}}(w_5,Q_1)}\frac{\sum_{\mu_{2,1}}\bar{Z}_{\mu_{5,1}\mu_{5,2}\mu_{2,1}}(w_5,Q_{2})}{\sum_{\mu_{2,1}}\bar{Z}_{\text{\o}\oo\mu_{2,1}}(w_5,Q_2)}\nonumber\\ &\times\frac{\sum_{\mu_{3,1}}\bar{Z}_{\mu_{5,1}\mu_{5,2}\mu_{3,1}}(w_5,Q_{3})}{\sum_{\mu_{3,1}}\bar{Z}_{\text{\o}\oo\mu_{3,1}}(w_5,Q_3)}\frac{\sum_{\mu_{4,1}}\bar{Z}_{\mu_{5,1}\mu_{5,2}\mu_{4,1}}(w_5,Q_{4})}{\sum_{\mu_{4,1}}\bar{Z}_{\text{\o}\oo\mu_{4,1}}(w_5,Q_4)}\quad. \label{eq:nZ_D4inst} \end{align} \subsubsection{\texorpdfstring{$D_4$}{D4} symmetry from expansion I}\label{sec:choice1} If we now choose the Weyl reflections from choice I, $Q_5$ will be replaced by $u=Q_1Q_2Q_3Q_4Q_5^2$ as the expansion parameter. Then $Z^{D_4}_{Q_5^{\bf 0}}$ is the zeroth order $Z^{D_4}_{u^{\bf 0}}$ of $u$, and $Z^{D_4}_{Q_5}$ is the $u$-dependent part $Z^{D_4}_{u}$, \begin{align} &Z^{D_4}_{u^{\bf 0}}=Z^{D_4}_{Q_5^{\bf 0}},\qquad Z^{D_4}_{u}=Z^{D_4}_{Q_5}\ ,\label{eq:ZuD4}\\ &Z^{D_4}=Z^{D_4}_{u^{\bf 0}}\cdot Z^{D_4}_u\ . \end{align} \bigskip \paragraph{$Z^{D_4}_{u^{\bf 0}}$ part.} From the general formula in \eqref{eq:unifiedpert}, we can obtain the perturbative part of the partition function of $D_4$ LST, \begin{align}\label{eq:D4pertPE} Z^{D_4}_{\text{pert}}\nonumber\\ =\text{PE}&\bigg[\frac{1}{(1-\mathfrak{t})(1-\mathfrak{q})}\frac{1+Q_{\tau}}{1-Q_{\tau}}\Big(3(\mathfrak{t}+\mathfrak{q})-4\sqrt{\mathfrak{t}\mathfrak{q}}(Q_{5,1}^{\frac12}+Q_{5,1}^{-\frac12})+\frac{1}{2}(\mathfrak{t}+\mathfrak{q})(Q_{5,1}+Q_{5,1}^{-1})\Big)\nonumber\\ &+6\frac{Q_{\tau}}{1-Q_{\tau}}\bigg]. \end{align} We expand \eqref{eq:D4pertPE} up to first order of $Q_{\tau}$ and get \begin{align}\label{eq:zoldpertd4} Z^{D_4}_{\text{pert}} =~\text{PE}\bigg[&\frac{1}{(1-\mathfrak{t})(1-\mathfrak{q})}\bigg(-8\sqrt{\mathfrak{t}\mathfrak{q}}w_5+(\mathfrak{t}+\mathfrak{q})(3+w_5^2)+Q_{\tau}\Big(6(1+\mathfrak{t}\mathfrak{q})\nonumber\\ &-8\sqrt{\mathfrak{t}\mathfrak{q}}(w_5+w_5^{-1}) +(\mathfrak{t}+\mathfrak{q})(w_5^2+w_5^{-2})\Big)+\mathcal{O}(Q_{\tau}^2)\bigg)\bigg], \end{align} where we have flipped the negative power of $w_5$ by \eqref{eq:flop} in the zeroth order of $Q_{\tau}$. The function $\bar{Z}_{\text{\o}\oo\mu_{1,1}}$ is proportional to $Q_1^{|\mu_{1,1}|}$, so $\sum_{\mu_{1,1}}\bar{Z}_{\text{\o}\oo\mu_{1,1}}$ is an infinite polynomial of $Q_1$. Then we expand up to $Q_{\tau}Q_1^4$ and express as the PE, \begin{align} &\sum_{\mu_{1,1}}\bar{Z}_{\text{\o}\oo\mu_{1,1}}(w_5,Q_1)\\ =&~\text{PE}\bigg[\frac{Q_1\big(\mathfrak{q}+\mathfrak{t}-\sqrt{\mathfrak{q}\mathfrak{t}}(w_5+w_5^{-1})\big)}{(1-\mathfrak{q})(1-\mathfrak{t})}+\frac{Q_{\tau}}{(1-\mathfrak{q})(1-\mathfrak{t})}\bigg(\frac{Q_1}{\mathfrak{q}\mathfrak{t}}(\mathfrak{q}+\mathfrak{t})P_0(w_5) \cr & +\frac{Q_1^2}{\mathfrak{q}^2\mathfrak{t}^2}(\mathfrak{q}^3+\mathfrak{q}^2\mathfrak{t}+\mathfrak{q}\mathfrak{t}^2+\mathfrak{t}^3)P_0(w_5)+\frac{Q_1^3}{\mathfrak{q}^3\mathfrak{t}^3}(\mathfrak{q}^5+\mathfrak{q}^4\mathfrak{t}+\mathfrak{q}^3\mathfrak{t}^2+\mathfrak{q}^2\mathfrak{t}^3+\mathfrak{q}\mathfrak{t}^4+\mathfrak{t}^5)P_0(w_5) \cr &+\frac{Q_1^4}{\mathfrak{q}^4\mathfrak{t}^4}(\mathfrak{q}^7+\mathfrak{q}^6\mathfrak{t}+\mathfrak{q}^5\mathfrak{t}^2+\mathfrak{q}^4\mathfrak{t}^3+\mathfrak{q}^3\mathfrak{t}^4+\mathfrak{q}^2\mathfrak{t}^5+\mathfrak{q}\mathfrak{t}^6+\mathfrak{t}^7)P_0(w_5)+\mathcal{O}(Q_1^5)\bigg)+\mathcal{O}(Q_{\tau}^2)\bigg],\nonumber \end{align} where \begin{equation} P_0(w_5)=w_5^{-2}(\sqrt{\mathfrak{q}}w_5-\sqrt{\mathfrak{t}})(\sqrt{\mathfrak{t}}w_5-\sqrt{\mathfrak{q}})(w_5-\sqrt{\mathfrak{q}\mathfrak{t}})(\sqrt{\mathfrak{q}\mathfrak{t}}w_5-1). \end{equation} We find that the coefficient of $Q_{\tau}$ is an infinite polynomial which has a pattern of a geometric series and can be analytically summed: \begin{align} &\frac{Q_1}{\mathfrak{q}\mathfrak{t}}(\mathfrak{q}+\mathfrak{t})P_0(w_5)+\frac{Q_1^2}{\mathfrak{q}^2\mathfrak{t}^2}(\mathfrak{q}^3+\mathfrak{q}^2\mathfrak{t}+\mathfrak{q}\mathfrak{t}^2+\mathfrak{t}^3)P_0(w_5)\nonumber\\ &+\frac{Q_1^3}{\mathfrak{q}^3\mathfrak{t}^3}(\mathfrak{q}^5+\mathfrak{q}^4\mathfrak{t}+\mathfrak{q}^3\mathfrak{t}^2+\mathfrak{q}^2\mathfrak{t}^3+\mathfrak{q}\mathfrak{t}^4+\mathfrak{t}^5)P_0(w_5)\nonumber\\ &+\frac{Q_1^4}{\mathfrak{q}^4\mathfrak{t}^4}(\mathfrak{q}^7+\mathfrak{q}^6\mathfrak{t}+\mathfrak{q}^5\mathfrak{t}^2+\mathfrak{q}^4\mathfrak{t}^3+\mathfrak{q}^3\mathfrak{t}^4+\mathfrak{q}^2\mathfrak{t}^5+\mathfrak{q}\mathfrak{t}^6+\mathfrak{t}^7)P_0(w_5)+\mathcal{O}(Q_1^5)\nonumber\\ &=\sum_{n=1}^{\infty}\left(\frac{Q_1^n}{\mathfrak{q}^n\mathfrak{t}^n}\sum_{i=0}^{2n-1}\mathfrak{q}^{2n-1-i}\mathfrak{t}^i\right)P_0(w_5)=\frac{Q_1(\mathfrak{q}+\mathfrak{t})}{(Q_1\mathfrak{q}-\mathfrak{t})(Q_1\mathfrak{t}-\mathfrak{q})}P_0(w_5), \end{align} so \begin{align}\label{eq:zsubu1} \sum_{\mu_{1,1}}\bar{Z}_{\text{\o}\oo\mu_{1,1}}(w_5,Q_1)=\text{PE}&\Bigg[\frac{\frac12(\mathfrak{q}+\mathfrak{t})(Q_1+Q_1^{-1})-\sqrt{\mathfrak{q}\mathfrak{t}}(Q_1+Q_1^{-1})w_5}{(1-\mathfrak{q})(1-\mathfrak{t})}\nonumber\\ & +\frac{Q_{\tau}P_0(w_5)}{(1-\mathfrak{q})(1-\mathfrak{t})}\frac{Q_1(\mathfrak{q}+\mathfrak{t})}{(Q_1\mathfrak{q}-\mathfrak{t})(Q_1\mathfrak{t}-\mathfrak{q})}+\mathcal{O}(Q_{\tau}^2)\Bigg]\ , \end{align} where we have used \eqref{eq:flop} in the zeroth order term of $Q_{\tau}$. From \eqref{eq:zsubu1}, we can see that $\sum_{\mu_{1,1}}\bar{Z}_{\text{\o}\oo\mu_{1,1}}$ is invariant under $Q_1\rightarrow Q_1^{-1}$ at zeroth order and first order of $Q_{\tau}$ since it has the Weyl symmetry of SU(2) in \eqref{eq:D4Weylun}. Substituting \eqref{eq:zoldpertd4} and \eqref{eq:zsubu1} into \eqref{eq:nZ_D4pert}, we obtain the zeroth order of $u$ in terms of $\chi_{\bf 1}, \chi_{\bf 2}, \chi_{\bf s}$ and $\chi_{\bf c}$ which are characters of fundamental weights of $D_4$ whose expressions are in \eqref{eq:D4fundamentals} but with the orthonormal basis being $\{Q_1,Q_2,Q_3,Q_4\}$ : \begin{align} Z^{D_4}_{u^{\bf 0}}=&~\text{PE}\bigg[\Big(\frac12\chi_{\bf 1}+3\Big)\left[0,\frac12\right]+(\chi_{\bf 1}+8)[0,0]w_5+\left[0,\frac12\right]w_5^2+Q_{\tau}\Big(c_0+6\left[\frac12,0\right]\nonumber\\ &+(c_1+8[0,0])\big(w_5^{-1}+w_5\big)+(c_2+\left[0,\frac12\right])\big(w_5^{-2}+w_5^2\big)\Big)+\mathcal{O}(Q_{\tau}^2)\bigg], \end{align} with \begin{align} c_0=&\bigg((-2\chi_{\bf 1}+2\chi_{\bf c}\chi_{\bf s})\bigg[0,\frac12\bigg]-4\chi_{\bf 2}\bigg[0,\frac32\bigg]+6\chi_{\bf 1}\bigg[0,\frac52\bigg]-8\bigg[0,\frac72\bigg]\nonumber\\ &+(-\chi_{\bf 1}+\chi_{\bf c}\chi_{\bf s})\bigg[\frac12,0\bigg]+(-\chi_{\bf 1}-2\chi_{\bf 2}+\chi_{\bf c}\chi_{\bf s})\bigg[\frac12,1\bigg]+(3\chi_{\bf 1}-2\chi_{\bf 2})\bigg[\frac12,2\bigg]\nonumber\\ &+(-4+3\chi_{\bf 1})\bigg[\frac12,3\bigg]-4\bigg[\frac12,4\bigg]\bigg)\bigg/D,\label{eq:c0}\\ c_1=&\bigg((-\chi_{\bf 1}+\chi_{\bf c}\chi_{\bf s})[0,0]+(-\chi_{\bf 1}-2\chi_{\bf 2}+\chi_{\bf c}\chi_{\bf s})[0,1]+(3\chi_{\bf 1}-2\chi_{\bf 2})[0,2]\nonumber\\ &+(-4+3\chi_{\bf 1})[0,3]-4[0,4]+(-\chi_{\bf 1}+\chi_{\bf c}\chi_{\bf s})\left[\frac12,\frac12\right]-2\chi_{\bf 2}\bigg[\frac12,\frac32\bigg]\nonumber\\ &+3\chi_{\bf 1}\bigg[\frac12,\frac52\bigg]-4\bigg[\frac12,\frac72\bigg]\bigg)\bigg/D,\label{eq:c1}\\ c_2=&\bigg((-\chi_{\bf 1}+\chi_{\bf c}\chi_{\bf s})\bigg[0,\frac12\bigg]-2\chi_{\bf 2}\bigg[0,\frac32\bigg]+3\chi_{\bf 1}\bigg[0,\frac52\bigg]-4\bigg[0,\frac72\bigg]\bigg)\bigg/D, \label{eq:c2}\\ D=&\prod_{i=1}^4\frac{(Q_i\mathfrak{q}-\mathfrak{t})(Q_i\mathfrak{t}-\mathfrak{q})}{Q_i\mathfrak{q}\mathfrak{t}}\nonumber\\ =&-\frac{1}{[0,0]}\bigg((2+\chi_{\bf1}+2\chi_{\bf2}-\chi_{\bf c}^2-\chi_{\bf c}\chi_{\bf s}-\chi_{\bf s}^2)\left[0,0\right]+(-\chi_{\bf 1}+\chi_{\bf 2}+\chi_{\bf c}\chi_{\bf s})\left[0,1\right]\nonumber\\ &+(-\chi_{\bf 1}-\chi_{\bf 2})\left[0,2\right]+(1+\chi_{\bf 1})\left[0,3\right]-\left[0,4\right]\bigg),\label{eq:DofD4} \end{align} where \begin{equation}\label{eq:spincontent} \left[j_l,j_r\right]\equiv\frac{(-1)^{2j_l+2j_r+1}\left[(\mathfrak{t}\mathfrak{q})^{-j_l}+\cdots+(\mathfrak{t}\mathfrak{q})^{j_l}\right]\left[\left(\frac{\mathfrak{t}}{\mathfrak{q}}\right)^{-j_r}+\cdots+\left(\frac{\mathfrak{t}}{\mathfrak{q}}\right)^{j_r}\right]}{(\mathfrak{t}^{1/2}-\mathfrak{t}^{-1/2})(\mathfrak{q}^{1/2}-\mathfrak{q}^{-1/2})}\ . \end{equation} We note that $\chi_{\bf 1},\chi_{\bf 2}$ respect the SU(2) Weyl symmetries in \eqref{eq:D4Weylun}, but $\chi_{\bf s},\chi_{\bf c}$ do not. However the combination such as $\chi_{\bf s}\chi_{\bf c},\chi_{\bf s}^2+\chi_{\bf c}^2,\chi_{\bf s}+\chi_{\bf c}$ respect the SU(2) Weyl symmetries. That is why $\chi_{\bf s},\chi_{\bf c}$ always appear as such combined form in \eqref{eq:c0}, \eqref{eq:c1}, \eqref{eq:c2}, and \eqref{eq:DofD4}. \bigskip \paragraph{$Z^{D_4}_u$ part.} Firstly we define \begin{equation}\label{eq:defZQ1} \mathcal{Z}_{\mu_{5,1}\mu_{5,2}}(w_5,Q_1)\equiv\frac{\sum_{\mu_{1,1}}\bar{Z}_{\mu_{5,1}\mu_{5,2}\mu_{1,1}}(w_5,Q_{1})}{\sum_{\mu_{1,1}}\bar{Z}_{\text{\o}\oo\mu_{1,1}}(w_5,Q_1)}\quad. \end{equation} Combining \eqref{eq:nZ_D4inst} with \eqref{eq:ZuD4} and change the parameter $Q_5$ to $u$, we get \begin{align}\label{eq:zD4instp} &Z^{D_4}_{u}\nonumber\\ =&\sum_{\mu_{5,1}\mu_{5,2}}\bar{Z}_{\mu_{5,1}\mu_{5,2}}^{\text{SU(2)}}(w_5,u^{\frac12})\frac{\mathcal{Z}_{\mu_{5,1}\mu_{5,2}}(w_5,Q_1)}{Q_1^{\frac12(|\mu_{5,1}|+|\mu_{5,2}|)}}\frac{\mathcal{Z}_{\mu_{5,1}\mu_{5,2}}(w_5,Q_2)}{Q_2^{\frac12(|\mu_{5,1}|+|\mu_{5,2}|)}}\frac{\mathcal{Z}_{\mu_{5,1}\mu_{5,2}}(w_5,Q_3)}{Q_3^{\frac12(|\mu_{5,1}|+|\mu_{5,2}|)}}\frac{\mathcal{Z}_{\mu_{5,1}\mu_{5,2}}(w_5,Q_4)}{Q_4^{\frac12(|\mu_{5,1}|+|\mu_{5,2}|)}}\, . \end{align} By the definition \eqref{eq:defZQ1}, we need to sum over the Young diagrams $\mu_{1,1}$ to infinity. Because both the functions $\bar{Z}$ in the numerator and denominator are proportional to $Q_1^{|\mu_{1,1}|}$, the numerator and denominator will both be infinite polynomials of $Q_1$ with the leading order being zeroth order. As an example, we compute $\mathcal{Z}_{\text{\o},\{1\}}$ expanded up to $Q_{\tau}Q_1^4$: \begin{align}\label{eq:Z01} \mathcal{Z}_{\text{\o},\{1\}}(w_5,Q_1)=&\frac{(\sqrt{\mathfrak{t}}w_5-\sqrt{\mathfrak{q}})(1+Q_1)}{(\mathfrak{q}\mathfrak{t})^{1/4}\sqrt{w_5}}+Q_{\tau}\bigg[\nonumber\\ &-\frac{\mathfrak{t}^{3/2}w_5^3-\mathfrak{q}^{3/2}}{(\mathfrak{q}\mathfrak{t})^{3/4}w_5^{3/2}}(1+Q_1)+\frac{Q_1}{(\mathfrak{q}\mathfrak{t})^{5/4}}P_1(w_5)+\frac{Q_1^2}{(\mathfrak{q}\mathfrak{t})^{9/4}}(\mathfrak{q}^2+\mathfrak{q}\mathfrak{t}+\mathfrak{t}^2)P_1(w_5)\nonumber\\ &+\frac{Q_1^3}{(\mathfrak{q}\mathfrak{t})^{13/4}}(\mathfrak{q}^4+\mathfrak{q}^3\mathfrak{t}+\mathfrak{q}^2\mathfrak{t}^2+\mathfrak{q}\mathfrak{t}^3+\mathfrak{t}^4)P_1(w_5)+\frac{Q_1^4}{(\mathfrak{q}\mathfrak{t})^{17/4}}(\mathfrak{q}^6+\mathfrak{q}^5\mathfrak{t}+\mathfrak{q}^4\mathfrak{t}^2\nonumber\\ &+\mathfrak{q}^3\mathfrak{t}^3+\mathfrak{q}^2\mathfrak{t}^4+\mathfrak{q}\mathfrak{t}^5+\mathfrak{t}^6)P_1(w_5)+\mathcal{O}(Q_1^5)\bigg]+\mathcal{O}(Q_{\tau}^2)\, , \end{align} where \begin{align} P_1(w_5)=w_5^{-5/2}(\sqrt{\mathfrak{t}}w_5-\sqrt{\mathfrak{q}})^2(\sqrt{\mathfrak{q}}w_5-\sqrt{\mathfrak{t}})(w_5-\sqrt{\mathfrak{q}\mathfrak{t}})(\sqrt{\mathfrak{q}\mathfrak{t}}w_5-1)\, . \end{align} From \eqref{eq:Z01}, we see that the zeroth order coefficient of $Q_{\tau}$ is a finite polynomial of $Q_1$ while the first order coefficient of $Q_{\tau}$ is not finite. By looking at the polynomial of $Q_1$ in the coefficient of $Q_{\tau}$, we find that it also has a pattern of a geometric series starting from the second term in the square bracket which can be analytically summed: \begin{align} &\frac{Q_1}{(\mathfrak{q}\mathfrak{t})^{5/4}}P_1(w_5)+\frac{Q_1^2}{(\mathfrak{q}\mathfrak{t})^{9/4}}(\mathfrak{q}^2+\mathfrak{q}\mathfrak{t}+\mathfrak{t}^2)P_1(w_5) +\frac{Q_1^3}{(\mathfrak{q}\mathfrak{t})^{13/4}}(\mathfrak{q}^4+\mathfrak{q}^3\mathfrak{t}+\mathfrak{q}^2\mathfrak{t}^2+\mathfrak{q}\mathfrak{t}^3+\mathfrak{t}^4)P_1(w_5)\nonumber\\ &+\frac{Q_1^4}{(\mathfrak{q}\mathfrak{t})^{17/4}}(\mathfrak{q}^6+\mathfrak{q}^5\mathfrak{t}+\mathfrak{q}^4\mathfrak{t}^2 +\mathfrak{q}^3\mathfrak{t}^3+\mathfrak{q}^2\mathfrak{t}^4+\mathfrak{q}\mathfrak{t}^5+\mathfrak{t}^6)P_1(w_5)+\mathcal{O}(Q_1^5)\nonumber\\ =&\sum_{n=1}^{\infty}\left(\frac{Q_1^{n}}{(\mathfrak{q}\mathfrak{t})^{n+\frac14}}\sum_{i=0}^{2n-2}\mathfrak{q}^{2n-2-i}\mathfrak{t}^i\right)P_1(w_5)=\frac{Q_1(1+Q_1)}{(\mathfrak{q}\mathfrak{t})^{1/4}(Q_1\mathfrak{q}-\mathfrak{t})(Q_1\mathfrak{t}-\mathfrak{q})}P_1(w_5), \end{align} so \begin{align}\label{eq:calZ01} \mathcal{Z}_{\text{\o},\{1\}}(w_5,Q_1)=&\frac{(\sqrt{\mathfrak{t}}w_5-\sqrt{\mathfrak{q}})(1+Q_1)}{(\mathfrak{q}\mathfrak{t})^{1/4}\sqrt{w_5}}+Q_{\tau}\bigg[\nonumber\\ &-\frac{\mathfrak{t}^{3/2}w_5^3-\mathfrak{q}^{3/2}}{(\mathfrak{q}\mathfrak{t})^{3/4}w_5^{3/2}}(1+Q_1)+\frac{Q_1(1+Q_1)}{(\mathfrak{q}\mathfrak{t})^{1/4}(Q_1\mathfrak{q}-\mathfrak{t})(Q_1\mathfrak{t}-\mathfrak{q})}P_1(w_5)\bigg]+\mathcal{O}(Q_{\tau}^2). \end{align} We can easily check that $Q_1^{-1/2}\mathcal{Z}_{\text{\o},\{1\}}(w_5,Q_1)$ is invariant under $Q_1\rightarrow Q_1^{-1}$ at the zeroth order and the first order of $Q_{\tau}$, which is also due to the SU(2) Weyl symmetry in \eqref{eq:D4Weylun}. In this way, we also compute other $\mathcal{Z}$ functions up to $|\mu_{5,1}|+|\mu_{5,2}|\leq 4$. As an example, we list $\mathcal{Z}_{\{1\},\text{\o}}$ below, \begin{align}\label{eq:calZ10} \mathcal{Z}_{\{1\},\text{\o}}(w_5,Q_1)=&-\frac{(\sqrt{\mathfrak{q}}w_5-\sqrt{\mathfrak{t}})(1+Q_1)}{(\mathfrak{q}\mathfrak{t})^{1/4}\sqrt{w_5}}+Q_{\tau}\bigg[\nonumber\\ &\frac{(\mathfrak{q}^{3/2}w_5^3-\mathfrak{t}^{3/2})(1+Q_1)}{(\mathfrak{q}\mathfrak{t})^{3/4}w_5^{3/2}}-\frac{Q_1(1+Q_1)}{(\mathfrak{q}\mathfrak{t})^{1/4}(Q_1\mathfrak{q}-\mathfrak{t})(Q_1\mathfrak{t}-\mathfrak{q})}P_2(w_5)\bigg]+\mathcal{O}(Q_{\tau}^2). \end{align} where \begin{align} P_2(w_5)=&w_5^{-5/2}(\sqrt{\mathfrak{q}}w_5-\sqrt{\mathfrak{t}})^2(\sqrt{\mathfrak{t}}w_5-\sqrt{\mathfrak{q}})(w_5-\sqrt{\mathfrak{q}\mathfrak{t}})(\sqrt{\mathfrak{q}\mathfrak{t}}w_5-1). \end{align} Then we can plug these $\mathcal{Z}$ functions into \eqref{eq:zD4instp} to obtain the $u$-dependent part. We express the partition function in terms of PE \begin{equation} Z^{D_4}_{u}=\text{PE}\left[\sum_{\ell,m,n}d_{\ell,m,n}w_5^{\ell}Q_{\tau}^{m}u^{n/2}\right], \end{equation} and compute the expansion up to $n\leq1,m\leq1,\ell\leq 1$. The nonzero coefficients are listed below \begin{align} d_{0,0,1}=&(\chi_{\bf c}+\chi_{\bf s})\left[0,\frac{1}{2}\right],\\ d_{1,0,1}=&(8\chi_{\bf c}+8\chi_{\bf s})\left[0,0\right],\\ d_{-2,1,1}=&\bigg((\chi_{\bf1}\chi_{\bf c}+\chi_{\bf1}\chi_{\bf s})\left[0,\frac{1}{2}\right]+(-3\chi_{\bf c}-4\chi_{\bf 2}\chi_{\bf c}+\chi_{\bf c}^3-3\chi_{\bf s}-4\chi_{\bf 2}\chi_{\bf s}+\chi_{\bf c}^2\chi_{\bf s}\nonumber\\ &+\chi_{\bf c}\chi_{\bf s}^2+\chi_{\bf s}^3)\left[0,\frac{3}{2}\right]+(4\chi_{\bf 1}\chi_{\bf c}+4\chi_{\bf 1}\chi_{\bf s}-\chi_{\bf c}^2\chi_{\bf s}-\chi_{\bf c}\chi_{\bf s}^2)\left[0,\frac{5}{2}\right]\nonumber\\ &+(-4\chi_{\bf c}+\chi_{\bf 2}\chi_{\bf c}-4\chi_{\bf s}+\chi_{\bf 2}\chi_{\bf s})\left[0,\frac{7}{2}\right]+(-\chi_{\bf 1}\chi_{\bf c}-\chi_{\bf 1}\chi_{\bf s})\left[0,\frac{9}{2}\right]\nonumber\\ &+(\chi_{\bf c}+\chi_{\bf s})\left[0,\frac{11}{2}\right]\bigg)\bigg/D,\\ d_{-1,1,1}=&\bigg(-(32\chi_{\bf c}+23\chi_{\bf 1}\chi_{\bf c}+8\chi_{\bf 2}\chi_{\bf c}+32\chi_{\bf s}+23\chi_{\bf 1}\chi_{\bf s}+8\chi_{\bf 2}\chi_{\bf s}+\chi_{\bf c}^2\chi_{\bf s}\nonumber\\ &+\chi_{\bf c}\chi_{\bf s}^2)\left[0,0\right]+(48\chi_{\bf c}+17\chi_{\bf 1}\chi_{\bf c}+34\chi_{\bf 2}\chi_{\bf c}-8\chi_{\bf c}^3+48\chi_{\bf s}+17\chi_{\bf 1}\chi_{\bf s}\nonumber\\ &+34\chi_{\bf 2}\chi_{\bf s}-9\chi_{\bf c}^2\chi_{\bf s}-9\chi_{\bf c}\chi_{\bf s}^2-8\chi_{\bf s}^3)[0,1]+(-24\chi_{\bf c}-35\chi_{\bf 1}\chi_{\bf c}+2\chi_{\bf 2}\chi_{\bf c}\nonumber\\ &-24\chi_{\bf s}-35\chi_{\bf 1}\chi_{\bf s}+2\chi_{\bf 2}\chi_{\bf s}+8\chi_{\bf c}^2\chi_{\bf s}+8\chi_{\bf c}\chi_{\bf s}^2)[0,2]+(36\chi_{\bf c}-3\chi_{\bf 1}\chi_{\bf c}\nonumber\\ &-8\chi_{\bf 2}\chi_{\bf c}+36\chi_{\bf s}-3\chi_{\bf 1}\chi_{\bf s}-8\chi_{\bf 2}\chi_{\bf s})[0,3]+(4\chi_{\bf c}+8\chi_{\bf 1}\chi_{\bf c}+4\chi_{\bf s}\nonumber\\ &+8\chi_{\bf 1}\chi_{\bf s})[0,4]-(8\chi_{\bf c}+8\chi_{\bf s})[0,5]+(\chi_{\bf 1}\chi_{\bf c}+\chi_{\bf 1}\chi_{\bf s}-\chi_{\bf c}^2\chi_{\bf s}-\chi_{\bf c}\chi_{\bf s}^2)\left[\frac{1}{2},\frac{1}{2}\right]\nonumber\\ &+(2\chi_{\bf 2}\chi_{\bf c}+2\chi_{\bf 2}\chi_{\bf s})\left[\frac{1}{2},\frac{3}{2}\right]-(3\chi_{\bf 1}\chi_{\bf c}+3\chi_{\bf 1}\chi_{\bf s})\left[\frac{1}{2},\frac{5}{2}\right]\nonumber\\ &+(4\chi_{\bf c}+4\chi_{\bf s})\left[\frac{1}{2},\frac{7}{2}\right]\bigg)\bigg/D,\\ d_{0,1,1}=&\bigg((-60\chi_{\bf c}-16\chi_{\bf 1}\chi_{\bf c}-90\chi_{\bf 2}\chi_{\bf c}+30\chi_{\bf c}^3-60\chi_{\bf s}-16\chi_{\bf 1}\chi_{\bf s}-90\chi_{\bf 2}\chi_{\bf s}+47\chi_{\bf c}^2\chi_{\bf s}\nonumber\\ &+47\chi_{\bf c}\chi_{\bf s}^2+30\chi_{\bf s}^3)\left[0,\frac{1}{2}\right]+(-3\chi_{\bf c}+60\chi_{\bf 1}\chi_{\bf c}-38\chi_{\bf 2}\chi_{\bf c}+\chi_{\bf c}^3-3\chi_{\bf s}\nonumber\\ &+60\chi_{\bf 1}\chi_{\bf s}-38\chi_{\bf 2}\chi_{\bf s}-29\chi_{\bf c}^2\chi_{\bf s}-29\chi_{\bf c}\chi_{\bf s}^2+\chi_{\bf s}^3)\left[0,\frac{3}{2}\right]+(-30\chi_{\bf c}+55\chi_{\bf 1}\chi_{\bf c}\nonumber\\ &+30\chi_{\bf 2}\chi_{\bf c}-30\chi_{\bf s}+55\chi_{\bf 1}\chi_{\bf s}+30\chi_{\bf 2}\chi_{\bf s}-\chi_{\bf c}^2\chi_{\bf s}-\chi_{\bf c}\chi_{\bf s}^2)\left[0,\frac{5}{2}\right]+(-72\chi_{\bf c}\nonumber\\ &-30\chi_{\bf 1}\chi_{\bf c}+\chi_{\bf 2}\chi_{\bf c}-72\chi_{\bf s}-30\chi_{\bf 1}\chi_{\bf s}+\chi_{\bf 2}\chi_{\bf s})\left[0,\frac{7}{2}\right]+(30\chi_{\bf c}-\chi_{\bf 1}\chi_{\bf c}+30\chi_{\bf s}\nonumber\\ &-\chi_{\bf 1}\chi_{\bf s})\left[0,\frac{9}{2}\right]+(\chi_{\bf c}+\chi_{\bf s})\left[0,\frac{11}{2}\right]+(30\chi_{\bf c}+15\chi_{\bf 1}\chi_{\bf c}+13\chi_{\bf 2}\chi_{\bf c}+\chi_{\bf c}^3\nonumber\\ &+30\chi_{\bf s}+15\chi_{\bf 1}\chi_{\bf s}+13\chi_{\bf 2}\chi_{\bf s}+10\chi_{\bf c}^2\chi_{\bf s}+10\chi_{\bf c}\chi_{\bf s}^2+\chi_{\bf s}^3)\left[\frac{1}{2},0\right]+(-34\chi_{\bf c}\nonumber\\ &-23\chi_{\bf 1}\chi_{\bf c}-21\chi_{\bf 2}\chi_{\bf c}+\chi_{\bf c}^3-34\chi_{\bf s}-23\chi_{\bf 1}\chi_{\bf s}-21\chi_{\bf 2}\chi_{\bf s}+\chi_{\bf c}^2\chi_{\bf s}+\chi_{\bf c}\chi_{\bf s}^2\nonumber\\ &+\chi_{\bf s}^3)\left[\frac{1}{2},1\right]+(31\chi_{\bf c}+29\chi_{\bf 1}\chi_{\bf c}-\chi_{\bf 2}\chi_{\bf c}+31\chi_{\bf s}+29\chi_{\bf 1}\chi_{\bf s}-\chi_{\bf 2}\chi_{\bf s}-\chi_{\bf c}^2\chi_{\bf s}\nonumber\\ &-\chi_{\bf c}\chi_{\bf s}^2)\left[\frac{1}{2},2\right]+(-37\chi_{\bf c}+2\chi_{\bf 1}\chi_{\bf c}+\chi_{\bf 2}\chi_{\bf c}-37\chi_{\bf s}+2\chi_{\bf 1}\chi_{\bf s}+\chi_{\bf 2}\chi_{\bf s})\left[\frac{1}{2},3\right]\nonumber\\ &-(3\chi_{\bf c}+3\chi_{\bf s}+\chi_{\bf 1}\chi_{\bf c}+\chi_{\bf 1}\chi_{\bf s})\left[\frac{1}{2},4\right]+(\chi_{\bf c}+\chi_{\bf s})\left[\frac{1}{2},5\right]\bigg)\bigg/D,\\ d_{1,1,1}=&\bigg((153\chi _{\bf c}^2\chi _{\bf s} + 153\chi _{\bf c}\chi _{\bf s}^2 + 72\chi _{\bf c}^3 - 57\chi _ {\bf 1}\chi _{\bf c} - 144\chi _ {\bf 2}\chi _{\bf c} - 112\chi _{\bf c} + 72\chi _{\bf s}^3 - 57\chi _ {\bf 1}\chi _{\bf s} \nonumber\\ &- 144\chi _ {\bf 2}\chi _{\bf s} - 112\chi _{\bf s})[0, 0]+ (-39\chi _{\bf c}^2\chi _{\bf s} - 39\chi _{\bf c}\chi _{\bf s}^2 + 16\chi _{\bf c}^3 + 47\chi _ {\bf 1}\chi _{\bf c} - 154\chi _ {\bf 2}\chi _{\bf c} \nonumber\\ &- 64\chi _{\bf c} + 16\chi _{\bf s}^3 + 47\chi _ {\bf 1}\chi _{\bf s} - 154\chi _ {\bf 2}\chi _{\bf s} - 64\chi _{\bf s} )[0,1]+ (-16\chi _{\bf c}^2\chi _{\bf s} - 16\chi _{\bf c}\chi _{\bf s}^2\nonumber\\ & + 163\chi _ {\bf 1}\chi _{\bf c} + 38\chi _ {\bf 2}\chi _{\bf c} + 16\chi _{\bf c} + 163\chi _ {\bf 1}\chi _{\bf s} + 38\chi _ {\bf 2}\chi _{\bf s} + 16\chi _{\bf s} )[0,2]+ (-21\chi _{\bf 1}\chi _{\bf c} \nonumber\\ &+ 16\chi _ {\bf 2}\chi _{\bf c} - 172\chi _{\bf c} - 21\chi _ {\bf 1}\chi _{\bf s} + 16\chi _ {\bf 2}\chi _{\bf s} - 172\chi _{\bf s} )[0,3]+ (-16\chi _ {\bf 1}\chi _{\bf c} + 4\chi _{\bf c} \nonumber\\ &- 16\chi _ {\bf 1}\chi _{\bf s} + 4\chi _{\bf s} )[0,4]+ (16\chi _{\bf c} + 16\chi _{\bf s} )[0,5]+ (25\chi _{\bf c}^2\chi _{\bf s} + 25\chi _{\bf c}\chi _{\bf s}^2 + 8\chi _{\bf c}^3 \nonumber\\ &- 17\chi _ {\bf 1}\chi _{\bf c} - 24\chi _ {\bf 2}\chi _{\bf c} - 16\chi _{\bf c} + 8\chi _{\bf s}^3 - 17\chi _ {\bf 1}\chi _{\bf s} - 24\chi _ {\bf 2}\chi _{\bf s} - 16\chi _{\bf s} )\left[\frac {1} {2}, \frac {1} {2}\right]\nonumber\\ &+(-8\chi _{\bf c}^2\chi _{\bf s} - 8\chi _{\bf c}\chi _{\bf s}^2 + 16\chi _ {\bf 1}\chi _{\bf c} - 34\chi _ {\bf 2}\chi _{\bf c} + 16\chi _ {\bf 1}\chi _{\bf s} - 34\chi _ {\bf 2}\chi _{\bf s} )\left[\frac {1} {2}, \frac {3} {2}\right]\nonumber\\ &+ (51\chi _ {\bf 1}\chi _{\bf c} + 8\chi _ {\bf 2}\chi _{\bf c} - 8\chi _{\bf c} + 51\chi _ {\bf 1}\chi _{\bf s} + 8\chi _ {\bf 2}\chi _{\bf s} - 8\chi _{\bf s} )\left[\frac {1} {2}, \frac {5} {2}\right]+ (-8\chi _ {\bf 1}\chi _{\bf c} \nonumber\\ &- 68\chi _{\bf c} - 8\chi _ {\bf 1}\chi _{\bf s} - 68\chi _{\bf s} )\left[\frac {1} {2}, \frac {7} {2}\right]+ (8\chi _{\bf c} + 8\chi _{\bf s} )\left[\frac {1} {2}, \frac {9} {2}\right]\bigg)\bigg/D, \end{align} where $\chi_{\bf 1}, \chi_{\bf 2}, \chi_{\bf s}$ and $\chi_{\bf c}$ are the characters of fundamental weights of $D_4$ whose expressions are in \eqref{eq:D4fundamentals} but with the orthonormal basis being $\{Q_1,Q_2,Q_3,Q_4\}$. From the above listed expressions for $d_{\ell,m,n}$, we see that the form of $d_{\ell,m,n}$ with $m=1$ are quite different from those with $m=0$, and there is a common denominator $D$ that appears in $d_{\ell,m,n}$ with $m=1$ which are the coefficients of $Q_{\tau}^1$ order terms. The coefficients of the $Q_{\tau}^0$ order terms can be understood as Gopakumar-Vafa invariants, but the $Q_{\tau}^1$ order terms do not look like Gopakumar-Vafa invariants at first sight because of the denominator. This is because we are dealing with $D_4$ LST whose tensor branch parameters $Q_1,Q_2,Q_3,Q_4$ are not parameters for global symmetry but parameters for local symmetry. In the limit $Q_{\tau}\rightarrow 0$, the vertical direction of the $D_4$ LST is decompactified, and theory reduces to E-string theory, so the $Q_{\tau}^0$ terms also coincide with the corresponding terms in the partition function of E-string theory \cite{Kim:2022dbr}. But the $Q_{\tau}^1$ order terms contain the information of LST at nonzero $Q_{\tau}$, so $Q_1,Q_2,Q_3,Q_4$ appear as parameters for local symmetry in the $Q_{\tau}^1$ terms. In order to see the Gopakumar-Vafa invariants at the $Q_{\tau}^1$ order, we have to further expand the $Q_{\tau}^1$ terms with respect to $Q_1,Q_2,Q_3,Q_4$. We expand $d_{-2,1,1},d_{-1,1,1},d_{0,1,1},d_{1,1,1}$ which are all the $Q_{\tau}^1$ order coefficients we have obtained with respect to $Q_1,Q_2,Q_3,Q_4$ and arrange $\mathfrak{t},\mathfrak{q}$ in the form of spin content in \eqref{eq:spincontent}, and find that the coefficients of the expansion terms are all positive integers, so it is consistent with the fact that the Gopakumar-Vafa invariants should be positive integers. With the expansion parameters to be chosen in accord with the ones used in \cite{Kim:2017xan}, we compared our result of the partition function $Z^{D_4}$ of $D_4$ LST with the one in \cite{Kim:2017xan}, and they are consistent. \subsubsection{\texorpdfstring{$D_4$}{D4} symmetry from expansion II}\label{sec:choice2} If we choose the Weyl reflections from choice II, $Q_4$ will be replaced by $u=Q_1Q_2Q_3Q_4Q_5^2$ as the expansion parameter. Then, both $Z^{D_4}_{Q_5^{\bf 0}}$ and $Z^{D_4}_{Q_5}$ will be $u$-dependent. \paragraph{$Z^{D_4}_{Q_5^{\bf 0}}$ part.} We rewrite \eqref{eq:zsubu1} by \eqref{eq:flop} as \begin{align}\label{eq:zsubu1rev} &\sum_{\mu_{1,1}}\bar{Z}_{\text{\o}\oo\mu_{1,1}}(w_5,Q_1)\nonumber\\ =&\text{PE}\left[\frac{Q_1(\mathfrak{q}+\mathfrak{t})-\sqrt{\mathfrak{q}\mathfrak{t}}(Q_1+Q_1^{-1})w_5}{(1-\mathfrak{q})(1-\mathfrak{t})}+Q_{\tau}P_0(w_5)\frac{Q_1(\mathfrak{q}+\mathfrak{t})}{(Q_1\mathfrak{q}-\mathfrak{t})(Q_1\mathfrak{t}-\mathfrak{q})}+\mathcal{O}(Q_{\tau}^2)\right]. \end{align} By substituting \eqref{eq:zsubu1rev} and \eqref{eq:zoldpertd4} back to \eqref{eq:nZ_D4pert}, and expanding up to $Q_{\tau} Q_4$ order\footnote{At this step, we are still using $Q_4$ as independent parameter rather than $u$. }, we get \begin{align} Z^{D_4}_{Q_5^{\bf 0}}=&\text{PE}\bigg[\frac{1}{(1-\mathfrak{q})(1-\mathfrak{t})}\bigg((\mathfrak{q}+\mathfrak{t})(3+Q_1+Q_2+Q_3)-\sqrt{\mathfrak{q}\mathfrak{t}}w_5\big(8+Q_1+\frac{1}{Q_1}+Q_2\nonumber\\ &+\frac{1}{Q_2}+Q_3+\frac{1}{Q_3}\big)+(\mathfrak{q}+\mathfrak{t})w_5^2+Q_4\big(\mathfrak{q}+\mathfrak{t}-\sqrt{\mathfrak{q}\mathfrak{t}}(w_5+\frac{1}{w_5})\big)+\mathcal{O}(Q_4^2)\bigg)\nonumber\\ &+\frac{Q_{\tau}}{(1-\mathfrak{q})(1-\mathfrak{t})}\bigg(6(1+\mathfrak{q}\mathfrak{t})+\big(\mathfrak{t}+\mathfrak{q}^2\mathfrak{t}+\mathfrak{q}(1+\mathfrak{t})^2\big)(\mathfrak{q}+\mathfrak{t})\Big(\frac{Q_1}{(Q_1\mathfrak{q}-\mathfrak{t})(Q_1\mathfrak{t}-\mathfrak{q})}\nonumber\\ &+\frac{Q_2}{(Q_2\mathfrak{q}-\mathfrak{t})(Q_2\mathfrak{t}-\mathfrak{q})}+\frac{Q_3}{(Q_3\mathfrak{q}-\mathfrak{t})(Q_3\mathfrak{t}-\mathfrak{q})}\Big)-\sqrt{\mathfrak{q}\mathfrak{t}}\big(w_5+\frac{1}{w_5}\big)\Big(8\nonumber\\ &+\frac{Q_1(\mathfrak{q}+\mathfrak{t})(1+\mathfrak{q})(1+\mathfrak{t})}{(Q_1\mathfrak{q}-\mathfrak{t})(Q_1\mathfrak{t}-\mathfrak{q})}+\frac{Q_2(\mathfrak{q}+\mathfrak{t})(1+\mathfrak{q})(1+\mathfrak{t})}{(Q_2\mathfrak{q}-\mathfrak{t})(Q_2\mathfrak{t}-\mathfrak{q})}+\frac{Q_3(\mathfrak{q}+\mathfrak{t})(1+\mathfrak{q})(1+\mathfrak{t})}{(Q_3\mathfrak{q}-\mathfrak{t})(Q_3\mathfrak{t}-\mathfrak{q})}\Big)\nonumber\\ &+(\mathfrak{q}+\mathfrak{t})\big(w_5^2+\frac{1}{w_5^2}\big)\Big(1+\frac{Q_1\mathfrak{q}\mathfrak{t}}{(Q_1\mathfrak{q}-\mathfrak{t})(Q_1\mathfrak{t}-\mathfrak{q})}+\frac{Q_2\mathfrak{q}\mathfrak{t}}{(Q_2\mathfrak{q}-\mathfrak{t})(Q_2\mathfrak{t}-\mathfrak{q})}\nonumber\\ &+\frac{Q_3\mathfrak{q}\mathfrak{t}}{(Q_3\mathfrak{q}-\mathfrak{t})(Q_3\mathfrak{t}-\mathfrak{q})}\Big)+Q_4\Big(\frac{(\mathfrak{q}+\mathfrak{t})\big(\mathfrak{t}+\mathfrak{q}^2\mathfrak{t}+\mathfrak{q}(1+\mathfrak{t})^2\big)}{\mathfrak{q}\mathfrak{t}}-\frac{(\mathfrak{q}+\mathfrak{t})(1+\mathfrak{q})(1+\mathfrak{t})}{\sqrt{\mathfrak{q}\mathfrak{t}}}\nonumber\\ &\times\big(w_5+\frac{1}{w_5}\big)+(\mathfrak{q}+\mathfrak{t})\big(w_5^2+\frac{1}{w_5^2}\big)\Big)+\mathcal{O}(Q_4^2)\bigg)+\mathcal{O}(Q_{\tau}^2)\bigg]\ . \end{align} \paragraph{$Z^{D_4}_{Q_5}$ part and rescaling.} From \eqref{eq:nZ_D4inst} and \eqref{eq:defZQ1}, we have \begin{align}\label{eq:zD4Q5} &Z^{D_4}_{Q_5}\nonumber\\ =&\sum_{\mu_{5,1},\mu_{5,2}}\bar{Z}_{\mu_{5,1}\mu_{5,2}}^{\text{SU(2)}}(w_5,Q_5)\mathcal{Z}_{\mu_{5,1}\mu_{5,2}}(w_5,Q_1)\mathcal{Z}_{\mu_{5,1}\mu_{5,2}}(w_5,Q_2)\mathcal{Z}_{\mu_{5,1}\mu_{5,2}}(w_5,Q_3)\mathcal{Z}_{\mu_{5,1}\mu_{5,2}}(w_5,Q_4)\, . \end{align} Now $Q_4$ is proportional to $u$, so we will expand $Z^{D_4}_{Q_5}$ with respect to $Q_4$ up to $Q_4^1$ order to obtain the expansion of partition function up to $u^1$ order. But in order to obtain the exact coefficients of $Q_4$ up to $Q_4^1$ order which are polynomials of $Q_5$, we have to sum over $\mu_{5,1},\mu_{5,2}$ up to infinity which is difficult as the computation will be more and more time consuming when the upper bound of the total Young diagram box number increases. Even if we just compute up to small finite total Young diagram box number, the computation is still time consuming because $w_5$ is exact in the coefficients. Then, we need to further expand the coefficients with respect to $w_5$. However, unlike $Q_1,Q_2,Q_3,Q_4,Q_5$ and $Q_{\tau}$ which all behave as non-negative power expansions for each of the five factors of the summand in \eqref{eq:zD4Q5}, there are some negative powers appearing in the expansions in $w_5$ for these five factors which will make the total expansion in $w_5$ for $Z^{D_4}_{Q_5}$ difficult. So we also need to rescale parameters and the five factors in order to have non-negative power expansions with $w_5$. We find that the following rescalings, \begin{align}\label{eq:D4rescalingrules} &\mathcal{Z}_{\mu_{5,1}\mu_{5,2}}\rightarrow w_5^{\frac12(|\mu_{5,1}|+|\mu_{5,2}|)}\mathcal{Z}_{\mu_{5,1}\mu_{5,2}},\nonumber\\ &\bar{Z}^{\text{SU(2)}}_{\mu_{5,1}\mu_{5,2}}\rightarrow w_5^{-2(|\mu_{5,1}|+|\mu_{5,2}|)}\bar{Z}^{\text{SU(2)}}_{\mu_{5,1}\mu_{5,2}},\nonumber\\ &Q_{\tau}\rightarrow w_5^2 Q_{\tau}, \end{align} make $\bar{Z}^{\text{SU(2)}}$ and $\mathcal{Z}$ functions have non-negative power expansion with respect to $w_5$. After obtaining $Z^{D_4}_{Q_5}$ in an expansion form in $w_5$ under the rescalings \eqref{eq:D4rescalingrules}, we switch back to the unrescaled parameter. Back to the original formula \eqref{eq:zD4Q5}, instead of computing $Z^{D_4}_{Q_5}$ exactly, we expand it up to finite order of $Q_5$. As $\bar{Z}^{\text{SU(2)}}_{\mu_{5,1}\mu_{5,2}}(w_5,Q_5)\propto Q_5^{|\mu_{5,1}|+|\mu_{5,2}|}$, if we want to compute up to $Q_5^k$ order, then the Young diagram sum has to be taken up to $|\mu_{5,1}|+|\mu_{5,2}|\leq k$, and also we just compute $Z^{D_4}_{Q_5}$ transformed as PE up to finite order of $w_5,Q_4$ and $Q_{\tau}$, say $w_5^\ell Q_4^m Q_{\tau}^n$ order. Inside PE, the highest order term $w_5^\ell Q_4^m Q_{\tau}^n$ will be like the following form, \begin{align}\label{eq:Q5expand} (``Q_5+Q_5^2+\cdots+Q_5^k+\cdots")w_5^\ell Q_4^m Q_{\tau}^n\ . \end{align} Here we introduced a notation ``\hspace{5mm}" which means that we ignore the coefficients of the polynomial of $Q_5$ which should be functions of $Q_1,Q_2,Q_3$. If some of the coefficients are zero, the corresponding terms should disappear from \eqref{eq:Q5expand}. In the remaining part of this section, we will use this notation to ignore such coefficients in order to avoid complicated expressions. In terms of the variable $Q_5,w_5,Q_4,Q_{\tau}'$, the term $w_5^\ell Q_4^m Q_{\tau}^n$ will become the following \begin{align} (``Q_5+Q_5^2+\cdots+Q_5^k+\cdots")w_5^{\ell+2n} Q_4^m Q_{\tau}'^n\ . \end{align} In summary, if we want to compute $Z^{D_4}_{Q_5}$ inside PE up to $w_5^\ell Q_4^m Q_{\tau}^n$ order with $Q_5$ up to $Q_5^k$ order, we have to expand $Z^{D_4}_{Q_5}$ up to $w_5^{\ell+2n}Q_4^m Q_{\tau}'^n$ order with $Q_5$ up to $Q_5^k$ order, and transform into PE and switch back to the variables $Q_{\tau}$. \paragraph{Evaluation of the partition function by Weyl symmetry.} Before we move to the computation of $Z^{D_4}_{Q_5}$, we would like to discuss about the general problems that we would encounter when doing the computation. If we finally obtain the expansion of $Z^{D_4}$ inside PE with the expansion parameters $A,u$ and $Q_{\tau}$ which are Weyl invariant parameters, the term $A^\ell u^m Q_{\tau}^n$ will be the following form, \begin{align} b_{\ell,m,n}(Q_1,Q_2,Q_3,Q_5)A^\ell u^m Q_{\tau}^n. \end{align} From the choice I in the section \ref{sec:choice1}, we learnt that the coefficients $d_{\ell,m,n}$ are composed of finite polynomials of $D_4$ characters for $Q_{\tau}$ zeroth order, whereas the coefficients $d_{\ell,m,n}$ are in fraction forms with both numerators and denominators being composed of $D_4$ characters for $Q_{\tau}$ non-zeroth order. We also expect this to happen for $b_{\ell,m,n}$. \paragraph{(1)} For $n=0$, we define $b_{\ell,m}\equiv b_{\ell,m,0}$. We expect $b_{\ell,m}$ to be finite polynomials of $D_4$ characters with $Q_1,Q_2,Q_3,Q_5$ as the fugacities. If we focus on $Q_5$, $b_{\ell,m}$ can be regarded as finite polynomials of $Q_5$ with both positive and negative powers. Since \begin{align} \quad A=Q_1Q_2Q_3Q_5^2 w_5,\quad u=Q_1Q_2Q_3Q_4Q_5^2, \end{align} the $A^{\ell}u^m$ term will be the following form, \begin{align}\label{eq:Auterm} b_{\ell,m}(Q_1,Q_2,Q_3,Q_5)A^{\ell}u^m=b_{\ell,m}(Q_1,Q_2,Q_3,Q_5)(Q_1Q_2Q_3)^{\ell+m}Q_5^{2\ell+2m}w_5^{\ell}Q_4^m. \end{align} We know that the contribution to $w_5^{\ell}Q_4^m$ term inside PE from the $Z^{D_4}_{Q_5}$ part with $Q_5$-expansion up to $Q_5^k$ order takes the following form, \begin{align} (``Q_5+Q_5^2+\cdots+Q_5^k+\cdots")w_5^\ell Q_4^m\ . \end{align} For $m=0$, we also need to flop $w_5^\ell$ terms with $\ell\leq 0$ by \eqref{eq:flop} and combine them with $\ell\geq 0$ terms just like what we have done in section \ref{sec:choice1}. These will give negative power terms of $Q_5$ contributions to the $w_5^\ell$ terms with $\ell\geq 0$. There are also possible $Q_5^0$ order contributions to the $w_5^{\ell}Q_4^m$ term from the $Z^{D_4}_{Q_5^{\bf 0}}$ part. In total, the $w_5^{\ell}Q_4^m$ term inside the PE of $Z^{D_4}$ will be the following form, \begin{align}\label{eq:w5Q4term} (``\cdots+1+Q_5+Q_5^2+\cdots+Q_5^k+\cdots")w_5^\ell Q_4^m\ , \end{align} where the first $\cdots$ means possible negative orders of $Q_5$ because of flop. Because the right hand side of \eqref{eq:Auterm} is the general form of $w_5^\ell Q_4^m$ term that we expect, it should equal to \eqref{eq:w5Q4term}, thus we have \begin{align}\label{eq:compare} b_{\ell,m}(Q_1,Q_2,Q_3,Q_5)(Q_1Q_2Q_3)^{\ell+m}Q_5^{2\ell+2m}=``\cdots+1+Q_5+Q_5^2+\cdots+Q_5^k+\cdots"\ . \end{align} As $b_{\ell,m}$ is finite polynomial of $Q_5$, the right hand side of \eqref{eq:compare} should also be finite. So the coefficient of $w_5^\ell Q_4^m$ does not go up to infinite power of $Q_5$, and it stops at some finite order of $Q_5$. If the highest order of $Q_5$ in $b_{\ell,m}$ is $Q_5^j$, then we just need to expand $Q_5$ up to $Q_5^{j+2\ell+2m}$ on the right hand side and the result will be exact, and from the right hand side result we can then determine $b_{\ell,m}$ on the left hand side. So the issue is how we know the highest order $j$ of $Q_5$ in $b_{\ell,m}$. Instead of considering about the number $j$, we consider how to determine $b_{\ell,m}$ without expanding $Q_5$ up to the highest order on the right hand side. As we explained, $b_{\ell,m}$ is a finite polynomial of $D_4$ characters, which can be rearranged as products or sums of the characters of the fundamental weights. In terms of the fugacities $Q_3,Q_5,Q_1,Q_2$ which correspond to the $\alpha$-basis $\{\alpha_3,\alpha_5,\alpha_1,\alpha_2\}$, the fundamental representations $\chi_{\bf 1},\chi_{\bf 2},\chi_{\bf s},\chi_{\bf c}$ can all be considered as finite polynomials of $Q_5$ with both positive and negative powers, and the lowest order and the highest order have the same absolute values. Now we consider $b_{\ell,m}$ as the sum of those polynomials whose monomials belongs to the same Weyl group orbit. Then we expect the polynomial to be a polynomial of $Q_5$ whose highest order and lowest order have the same absolute value. Among these Weyl group orbit polynomials, the shortest one is the one which does not depend on $Q_5$ which means that it only has $Q_5^0$ order. All these polynomials have the same $Q_5$ order which is $Q_5^0$ order. So if we have all the $Q_5^0$ order of these polynomials, we can use Weyl reflections to generate all the other elements of the Weyl group orbits. Because of the factor $Q_5^{2\ell+2m}$ on the left hand side of \eqref{eq:compare}, the $Q_5^0$ order is shifted to $Q_5^{2\ell+2m}$ order on the right hand side. So we compute up to $Q_5^{2\ell+2m}$ order on the right hand side and use the $Q_5^{2\ell+2m}$ order term to determine the $Q_5^0$ order term of $b_{\ell,m}$. Then we use Weyl reflections to generate all the terms of $b_{\ell,m}$. After that we will know what is the highest order $j$ of $Q_5$ in $b_{\ell,m}$, and we can compute $Q_5$ up to $Q_5^{j+2\ell+2m}$ order on the right hand side to confirm whether the $b_{\ell,m}$ which is obtained by Weyl reflections is really correct or not. \paragraph{(2)} For $n>0$, $b_{\ell,m,n}$ will be in a fraction form \begin{align} b_{\ell,m,n}(Q_1,Q_2,Q_3,Q_5)=\frac{\tilde{b}_{\ell,m,n}(Q_1,Q_2,Q_3,Q_5)}{\tilde{D}}, \end{align} where both $\tilde{b}_{\ell,m,n}$ and $\tilde{D}$ are finite polynomials of $D_4$ characters. We need to determine the form of $\tilde{D}$. Let us first write down the denominator $D$ that we found in choice I case, \begin{align}\label{eq:denominatorC1} D=&\prod_{i=1}^4\frac{(Q_i\mathfrak{q}-\mathfrak{t})(Q_i\mathfrak{t}-\mathfrak{q})}{Q_i\mathfrak{q}\mathfrak{t}}\ . \end{align} Actually it is not difficult to explain why it should be in the above form. First, it has to respect the SU(2) Weyl symmetry in \eqref{eq:D4Weylun} and the $D_4$ Weyl symmetry in \eqref{eq:D4Weylrefl}. Second, the $\mathfrak{t},\mathfrak{q}$ in the expression after the expansion should have appropriate powers so that the expression can be written as the numerators of the spin contents in \eqref{eq:spincontent}. The sources of $D$ come from the denominators that appear in the $\mathcal{Z}$ functions in \eqref{eq:calZ01} and \eqref{eq:calZ10}. Although all the $\mathcal{Z}_{\mu_{5,1}\mu_{5,2}}(w_5,Q_i)$ functions with $i=1,2,3,4$ have the similar denominators, we only pick the denominator of $\mathcal{Z}_{\mu_{5,1}\mu_{5,2}}(w_5,Q_1)$ as the starting point, \begin{align}\label{eq:denoQ1} (Q_1\mathfrak{q}-\mathfrak{t})(Q_1\mathfrak{t}-\mathfrak{q})\ . \end{align} By requiring the SU(2) symmetry $Q_1\rightarrow Q_1^{-1}$, we can obtain \begin{align}\label{eq:denoQ1inv} (Q_1^{-1}\mathfrak{q}-\mathfrak{t})(Q_1^{-1}\mathfrak{t}-\mathfrak{q})\ . \end{align} By multiplying \eqref{eq:denoQ1} and \eqref{eq:denoQ1inv} together, we obtain \begin{align}\label{eq:denosq} \frac{(Q_1\mathfrak{q}-\mathfrak{t})^2(Q_1\mathfrak{t}-\mathfrak{q})^2}{Q_1^2}. \end{align} However, by looking at \eqref{eq:denominatorC1}, we know that we should take the square root of \eqref{eq:denosq}. Then, we get \begin{align}\label{eq:denosqrt} \frac{(Q_1\mathfrak{q}-\mathfrak{t})(Q_1\mathfrak{t}-\mathfrak{q})}{Q_1}. \end{align} Now, by requiring the highest orders and lowest orders of $\mathfrak{t},\mathfrak{q}$ to have the same absolute values, we need to divide \eqref{eq:denosqrt} by $\mathfrak{q}\mathfrak{t}$, so we get \begin{align}\label{eq:denofactor} \frac{(Q_1\mathfrak{q}-\mathfrak{t})(Q_1\mathfrak{t}-\mathfrak{q})}{Q_1\mathfrak{q}\mathfrak{t}}. \end{align} By further requiring the permutation symmetry among $Q_1,\cdots,Q_4$, we can finally reproduce \eqref{eq:denominatorC1}. The lesson that we learnt is that the SU(2) symmetry of $Q_1$ together with the permutation symmetry among $Q_1,\cdots,Q_4$ generate the group orbit of $Q_1$, \begin{align} \text{orbit}(Q_1)=\{Q_1,Q_1^{-1},Q_2,Q_2^{-1},Q_3,Q_3^{-1},Q_4,Q_4^{-1}\}, \end{align} for each pair of elements $\{x,x^{-1}\}\subseteq \text{orbit}(Q_1)$. It corresponds to a factor whose form is like \eqref{eq:denofactor} with $Q_1$ been replaced by $x$, and the denominator $D$ is the product of all these factors. By the similar procedure, now we try to obtain $\tilde{D}$. First, we have the same factor \eqref{eq:denoQ1} that comes from $\mathcal{Z}_{\mu_{5,1}\mu_{5,2}}(w_5,Q_1)$ in \eqref{eq:zD4Q5}. Then, by the Weyl symmetry from \eqref{eq:unaffD4WeylinQ}, the group orbit of $Q_1$ is \begin{align} \text{orbit}(Q_1)=&\{Q_1,Q_1^{-1},Q_2,Q_2^{-1},Q_3,Q_3^{-1},Q_5,Q_5^{-1},Q_1Q_5,(Q_1Q_5)^{-1},Q_2Q_5,(Q_2Q_5)^{-1},\nonumber\\ &Q_3Q_5,(Q_3Q_5)^{-1},Q_1Q_2Q_5,(Q_1Q_2Q_5)^{-1},Q_1Q_3Q_5,(Q_1Q_3Q_5)^{-1},Q_2Q_3Q_5,\nonumber\\ &(Q_2Q_3Q_5)^{-1},Q_1Q_2Q_3Q_5,(Q_1Q_2Q_3Q_5)^{-1},Q_1Q_2Q_3Q_5^2,(Q_1Q_2Q_3Q_5^2)^{-1}\}, \end{align} so we have \begin{align} \tilde{D}=&\frac{1}{\mathfrak{q}^{12}\mathfrak{t}^{12}Q_1^6Q_2^6Q_3^6Q_5^{10}}(Q_1\mathfrak{q}-\mathfrak{t})(Q_1\mathfrak{t}-\mathfrak{q})(Q_2\mathfrak{q}-\mathfrak{t})(Q_2\mathfrak{t}-\mathfrak{q})(Q_3\mathfrak{q}-\mathfrak{t})(Q_3\mathfrak{t}-\mathfrak{q})\nonumber\\ &\times(Q_5\mathfrak{q}-\mathfrak{t})(Q_5\mathfrak{t}-\mathfrak{q})(Q_1Q_5\mathfrak{q}-\mathfrak{t})(Q_1Q_5\mathfrak{t}-\mathfrak{q})(Q_2Q_5\mathfrak{q}-\mathfrak{t})(Q_2Q_5\mathfrak{t}-\mathfrak{q})\nonumber\\ &\times(Q_3Q_5\mathfrak{q}-\mathfrak{t})(Q_3Q_5\mathfrak{t}-\mathfrak{q})(Q_1Q_2Q_5\mathfrak{q}-\mathfrak{t})(Q_1Q_2Q_5\mathfrak{t}-\mathfrak{q})(Q_1Q_3Q_5\mathfrak{q}-\mathfrak{t})\nonumber\\ &\times(Q_1Q_3Q_5\mathfrak{t}-\mathfrak{q})(Q_2Q_3Q_5\mathfrak{q}-\mathfrak{t})(Q_2Q_3Q_5\mathfrak{t}-\mathfrak{q})(Q_1Q_2Q_3Q_5\mathfrak{q}-\mathfrak{t})\nonumber\\ &\times(Q_1Q_2Q_3Q_5\mathfrak{t}-\mathfrak{q})(Q_1Q_2Q_3Q_5^2\mathfrak{q}-\mathfrak{t})(Q_1Q_2Q_3Q_5^2\mathfrak{t}-\mathfrak{q}). \end{align} Transforming to orthonormal basis by \eqref{eq:D4orthonormal}, we find \begin{align} \tilde{D}=\prod_{i=1}^4\prod_{j>i}^4\frac{(B_iB_j\mathfrak{q}-\mathfrak{t})(B_iB_j\mathfrak{t}-\mathfrak{q})(B_i\mathfrak{q}-\mathfrak{t})(B_i\mathfrak{t}-\mathfrak{q})}{(B_iB_j\mathfrak{q}\mathfrak{t})^2}. \end{align} Now for $A^{\ell}u^mQ_{\tau}^n$ term, we have \begin{align}\label{eq:D4AuQtauterm2} b_{\ell,m,n}(Q_1,Q_2,Q_3,Q_5)A^{\ell}u^mQ_{\tau}^n=\frac{\tilde{b}_{\ell,m,n}(Q_1,Q_2,Q_3,Q_5)}{\tilde{D}}(Q_1Q_2Q_3)^{\ell+m}Q_5^{2\ell+2m}w_5^{\ell}Q_4^mQ_{\tau}^n, \end{align} and also like \eqref{eq:w5Q4term}, the $w_5^{\ell}Q_4^mQ_{\tau}^n$ term should be \begin{align}\label{eq:D4w5Q4Qtauterm2} (``1+Q_5+Q_5^2+\cdots+Q_5^k+\cdots")w_5^{\ell}Q_4^mQ_{\tau}^n. \end{align} Note that there is no negative order of $Q_5$ in the above polynomial of $Q_5$ because the power $n$ of $Q_{\tau}$ is now positive and we do not flop the $\ell\leq0$ power of $w_5$. By equating the right hand side of \eqref{eq:D4AuQtauterm2} with \eqref{eq:D4w5Q4Qtauterm2}, we have \begin{align}\label{eq:D4Qtauorder} &\tilde{b}_{\ell,m,n}(Q_1,Q_2,Q_3,Q_5)\mathfrak{q}^{12}\mathfrak{t}^{12}(Q_1Q_2Q_3)^{6+\ell+m}Q_5^{10+2\ell+2m}\nonumber\\ =&(``1+Q_5+Q_5^2+\cdots+Q_5^k+\cdots")(Q_1\mathfrak{q}-\mathfrak{t})(Q_1\mathfrak{t}-\mathfrak{q})(Q_2\mathfrak{q}-\mathfrak{t})(Q_2\mathfrak{t}-\mathfrak{q})(Q_3\mathfrak{q}-\mathfrak{t})\nonumber\\ &\times(Q_3\mathfrak{t}-\mathfrak{q})(Q_5\mathfrak{q}-\mathfrak{t})(Q_5\mathfrak{t}-\mathfrak{q})(Q_1Q_5\mathfrak{q}-\mathfrak{t})(Q_1Q_5\mathfrak{t}-\mathfrak{q})(Q_2Q_5\mathfrak{q}-\mathfrak{t})(Q_2Q_5\mathfrak{t}-\mathfrak{q})\nonumber\\ &\times(Q_3Q_5\mathfrak{q}-\mathfrak{t})(Q_3Q_5\mathfrak{t}-\mathfrak{q})(Q_1Q_2Q_5\mathfrak{q}-\mathfrak{t})(Q_1Q_2Q_5\mathfrak{t}-\mathfrak{q})(Q_1Q_3Q_5\mathfrak{q}-\mathfrak{t})\nonumber\\ &\times(Q_1Q_3Q_5\mathfrak{t}-\mathfrak{q})(Q_2Q_3Q_5\mathfrak{q}-\mathfrak{t})(Q_2Q_3Q_5\mathfrak{t}-\mathfrak{q})(Q_1Q_2Q_3Q_5\mathfrak{q}-\mathfrak{t})\nonumber\\ &\times(Q_1Q_2Q_3Q_5\mathfrak{t}-\mathfrak{q})(Q_1Q_2Q_3Q_5^2\mathfrak{q}-\mathfrak{t})(Q_1Q_2Q_3Q_5^2\mathfrak{t}-\mathfrak{q}). \end{align} In order to obtain the $Q_5^0$ order term of $\tilde{b}_{\ell,m,n}$, the expansion of $Q_5$ has to be taken up to $k=10+2\ell+2m$. After that, we can determine the complete form of $\tilde{b}_{\ell,m,n}$ by computing the Weyl group orbit of the $Q_5^0$ order of $\tilde{b}_{\ell,m,n}$. Then we can further determine the highest order of $Q_5$ in $\tilde{b}_{\ell,m,n}$ by increasing the expansion of $Q_5$ to higher orders and reproduce all the terms of $\tilde{b}_{\ell,m,n}$ to confirm the correctness of the Weyl group orbit method. But due to the difficulty of computation up to higher order of $Q_5$, obtaining exact $\tilde{b}_{\ell,m,n}$ is difficult, and we will only compute $Q_{\tau}^0$ order for the partition function. \paragraph{Final result of $Z^{D_4}$.} Combining $Z^{D_4}_{Q_5^{\bf 0}}$ with $Z^{D_4}_{Q_5}$, we obtain the full partition function $Z^{D_4}$. We express $Z^{D_4}$ as PE form, \begin{align} Z^{D_4}=Z^{D_4}_{Q_5^{\bf 0}}Z^{D_4}_{Q_5}=\text{PE}\bigg[\sum_{\ell,m,n}b_{\ell,m,n}A^\ell u^m Q_{\tau}^n\bigg]\ , \end{align} and compute up to $A^1u^1Q_{\tau}^0$ order with the expansion of $Q_5$ up to $Q_5^4$ order, the coefficients are listed in the following, \begin{align} &b_{0,0,0}=\frac12(2+\chi_{\bf 2})\left[0,\frac12\right],\\ &b_{1,0,0}=(\chi_{\bf 1}^2+2\chi_{\bf 2}+\chi_{\bf s}^2+\chi_{\bf c}^2)[0,0]+\bigg[\frac12,\frac12\bigg],\\ &b_{-1,1,0}=[0,0],\\ &b_{0,1,0}=\chi_{\bf 2}\bigg[0,\frac12\bigg]+2\bigg[\frac12,0\bigg],\\ &b_{1,1,0}=(-3+\textcolor{red}{2\chi_{\bf 1}^2-4\chi_{\bf 2}+\chi_{\bf 2}^2+6\chi_{\bf 1}\chi_{\bf s}\chi_{\bf c}+2\chi_{\bf s}^2+2\chi_{\bf c}^2})[0,0]\nonumber\\ &\qquad\quad+(1+\textcolor{red}{\chi_{\bf 1}^2+2\chi_{\bf 2}+\chi_{\bf s}^2+\chi_{\bf c}^2})\bigg[\frac12,\frac12\bigg]+[1,1],\label{eq:coefofAu} \end{align} where $\chi_{\bf 1},\chi_{\bf 2},\chi_{\bf s},\chi_{\bf c}$ are the characters of fundamental weights of $D_4$ which will be in the form of \eqref{eq:D4fundamentals} if we switch to the orthonormal basis by \eqref{eq:D4orthonormal}. In \eqref{eq:coefofAu} we write the fundamental characters in red which means that these characters are obtained by Weyl symmetry but not yet confirmed by direct computation, because we only computed the expansion of $Q_5$ up to $Q_5^4$ order which is just enough to determine the $Q_5^0$ order of these characters in $b_{1,1,0}$. The highest order among these characters is $Q_5^4$, so by \eqref{eq:compare} we have to compute the $Q_5$ expansion up to $Q_5^8$ to confirm these characters in red which is demanding. \bigskip \subsection{Expansion of \texorpdfstring{$D_5$}{D5} LST} Just like $D_4$ LST, switching the external NS-charged branes of each gauge node of the brane web of $D_5$ LST corresponds to the Weyl reflection of the simple root in the affine $D_5$ Dynkin diagram. The Weyl reflections from the brane web of $D_5$ LST are as follows: \begin{equation}\label{eq:D5WeylinQaff} \left\{\begin{array}{l} Q_1\rightarrow Q_1^{-1},\ Q_5\rightarrow Q_5Q_1\\ Q_2\rightarrow Q_2^{-1},\ Q_5\rightarrow Q_5Q_2\\ Q_3\rightarrow Q_3^{-1},\ Q_6\rightarrow Q_6Q_3\\ Q_4\rightarrow Q_4^{-1},\ Q_6\rightarrow Q_6Q_4\\ Q_5\rightarrow Q_5^{-1},\ Q_1\rightarrow Q_1Q_5,\ Q_2\rightarrow Q_2Q_5,\ Q_6\rightarrow Q_6Q_5\\ Q_6\rightarrow Q_6^{-1},\ Q_3\rightarrow Q_3Q_6,\ Q_4\rightarrow Q_4Q_6,\ Q_5\rightarrow Q_5Q_6 \end{array}\right. \end{equation} \begin{figure}[htbp] \centering \includegraphics[scale=0.5]{D5wQuadra-Dynkin.pdf} \caption{(a)Quadrivalent gluing brane web of $D_5$ LST. (b)Affine Dynkin diagram of affine $D_5$. } \label{fig:D5Dynkin} \end{figure} By the same argument in the $D_4$ LST case, we claim that \textit{the partition function of $D_5$ LST has affine $D_5$ symmetry}. Again, in order to see the affine $D_5$ characters in the expansion of the partition function, we have to sum over all the Young diagrams of all the color branes which is very difficult. So instead, we try to see the $D_5$ characters by using five of the six independent affine Weyl reflections. But unlike the rank 1 $D_4$ LST case, here there is only one choice to reduce affine $D_5$ Weyl reflections to $D_5$ Weyl reflections. We pick the affine Weyl reflections\footnote{Of course you can also pick $Q_4,Q_6,Q_5,Q_1,Q_2$ and so on which are equivalent choices. } of $Q_3,Q_6,Q_5,Q_1,Q_2$, and then $Q_4$ will be replaced by \begin{align}\label{eq:uofD5} u=Q_1Q_2Q_3Q_4Q_5^2Q_6^2 \end{align} as Weyl reflection invariant parameter. The five chosen affine $D_5$ Weyl reflections reduce to following forms: \begin{equation}\label{eq:D5WeylinQunaff} \left\{\begin{array}{l} Q_3\rightarrow Q_3^{-1},\ Q_6\rightarrow Q_6Q_3\\ Q_6\rightarrow Q_6^{-1},\ Q_3\rightarrow Q_3Q_6,\ Q_5\rightarrow Q_5Q_6\\ Q_5\rightarrow Q_5^{-1},\ Q_1\rightarrow Q_1Q_5,\ Q_2\rightarrow Q_2Q_5,\ Q_6\rightarrow Q_6Q_5\\ Q_1\rightarrow Q_1^{-1},\ Q_5\rightarrow Q_5Q_1\\ Q_2\rightarrow Q_2^{-1},\ Q_5\rightarrow Q_5Q_2 \end{array}\right. \end{equation} They are the $D_5$ Weyl reflections in the basis $\{\alpha_3,\alpha_6,\alpha_5,\alpha_1,\alpha_2\}$. For $D_5$ LST, we have two Coulomb branch parameters $w_5\equiv Q_{5,1}^{1/2}$ and $w_6\equiv Q_{6,1}^{1/2}$ as shown in figure \ref{fig:D5wQuadra}. $w_5$ does not change under the Weyl reflections of $Q_1,Q_2,Q_3,Q_6$ but it changes under the Weyl reflection of $Q_5$ due to the invariance of $\tilde{Q}$ and $Q_{6,1}$ as shown in figure \ref{fig:Q5transf}, whereas $w_6$ does not change under the Weyl reflections of $Q_1,Q_2,Q_3,Q_5$ but it changes under the Weyl reflection of $Q_6$ due to the invariance of $\bar{Q}$ and $Q_{5,1}$ as shown in figure \ref{fig:Q6transf}. \begin{figure}[htbp] \centering \includegraphics[scale=0.5]{Q5trans.pdf} \caption{Transformation of gauge node 5} \label{fig:Q5transf} \end{figure} \begin{figure}[htbp] \centering \includegraphics[scale=0.5]{Q6trans.pdf} \caption{Transformation of gauge node 6} \label{fig:Q6transf} \end{figure} Including the Coulomb branch parameters $w_5$ and $w_6$, the Weyl reflections become as follows: \begin{equation} \left\{\begin{array}{l} Q_3\rightarrow Q_3^{-1},\ Q_6\rightarrow Q_6Q_3\\ Q_6\rightarrow Q_6^{-1},\ Q_3\rightarrow Q_3Q_6,\ Q_5\rightarrow Q_5Q_6,\ w_6\rightarrow Q_6w_6\\ Q_5\rightarrow Q_5^{-1},\ Q_1\rightarrow Q_1Q_5,\ Q_2\rightarrow Q_2Q_5,\ Q_6\rightarrow Q_6Q_5,\ w_5\rightarrow Q_5w_5\\ Q_1\rightarrow Q_1^{-1},\ Q_5\rightarrow Q_5Q_1\\ Q_2\rightarrow Q_2^{-1},\ Q_5\rightarrow Q_5Q_2 \end{array}\right. \end{equation} The above transformations involve $Q_1,Q_2,Q_3,Q_5,Q_6,w_5,w_6$, so the invariant Coulomb branch parameters should be a combination of these parameters which take the form $Q_1^aQ_2^bQ_3^cQ_5^dQ_6^ew_5^fw_6^g$. By requiring this ansatz to be invariant under the above five transformations, we obtain five linear equations about $a,b,c,d,e,f,g$. There are two independent invariant Coulomb branch parameters which are proportional to $w_5$(i.e. $f=1,g=0$) and $w_6$(i.e. $f=0,g=1$) respectively, for each case we can solve the five linear equations and obtain one solution. So we get the following solutions which are the invariant Coulomb branch parameters \begin{align}\label{eq:invariantCBofD5} A_1=Q_1^{\frac32}Q_2^{\frac32}Q_3Q_5^3Q_6^2w_5,\quad A_2=Q_1Q_2Q_3Q_5^2Q_6^2w_6\ . \end{align} Switch from $\alpha$-basis to orthonormal basis, we have \begin{align}\label{eq:D5orthonormaltran} Q_3=\frac{B_1}{B_2},\ Q_6=\frac{B_2}{B_3},\ Q_5=\frac{B_3}{B_4},\ Q_1=\frac{B_4}{B_5},\ Q_2=B_4B_5, \end{align} where $B_i$ are the fugacities of $D_5$ in orthonormal basis. In order to compute the partition function efficiently, it is most convenient to still keep using the old parameters $Q_1,Q_2,Q_3,Q_4,Q_5,Q_6,w_5,w_6$ and choose $Q_5,Q_6$ as the main expansion parameters. We separate the partition function into $Z^{D_5}_{Q_5^{\bf 0}Q_6^{\bf 0}}$ part which is the $Q_5^0 Q_6^0$ order term in the full partition function and $Z^{D_5}_{Q_5Q_6}$ part which is the remaining part that depends on $Q_5,Q_6$ after extracting out $Z^{D_5}_{Q_5^{\bf 0}Q_6^{\bf 0}}$, \begin{align} Z^{D_5}=Z^{D_5}_{Q_5^{\bf 0}Q_6^{\bf 0}}Z^{D_5}_{Q_5Q_6}\ . \end{align} After we obtain the PE form of the full partition function, we will switch to the new parameters, $B_i$ $A_1,A_2$, and $u$ to see the $D_5$ characters. From \eqref{eq:D5pertPE} and \eqref{eq:D5inst}, the $Z^{D_5}_{Q_5^{\bf 0}Q_6^{\bf 0}}$ part that does not depend on $Q_5,Q_6$ is \begin{align}\label{eq:nZ_D5pert} Z^{D_5}_{Q_5^{\bf 0}Q_6^{\bf 0}}=Z^{D_5}_{\text{pert}}\cdot &\sum_{\mu_{1,1}}\bar{Z}_{\text{\o}\oo\mu_{1,1}}(w_5,Q_1) \sum_{\mu_{2,1}}\bar{Z}_{\text{\o}\oo\mu_{2,1}}(w_5,Q_2)\nonumber\\ \times &\sum_{\mu_{3,1}}\bar{Z}_{\text{\o}\oo\mu_{3,1}}(w_6,Q_3)\sum_{\mu_{4,1}}\bar{Z}_{\text{\o}\oo\mu_{4,1}}(w_6,Q_4)\, , \end{align} whereas the $Z^{D_5}_{Q_5Q_6}$ part that depend on $Q_5,Q_6$ is \begin{align}\label{eq:ZD5Q5Q6} Z^{D_5}_{Q_5Q_6}=\sum_{\mu_{5,1},\mu_{5,2},\mu_{6,1},\mu_{6,2}}&\bar{Z}^{\text{SU(2)-SU(2)}}_{\mu_{5,1}\mu_{5,2}\mu_{6,1}\mu_{6,2}}(w_5,w_6,Q_5,Q_6)\mathcal{Z}_{\mu_{5,1}\mu_{5,2}}(w_5,Q_1)\mathcal{Z}_{\mu_{5,1}\mu_{5,2}}(w_5,Q_2)\nonumber\\ &\times\mathcal{Z}_{\mu_{6,1}\mu_{6,2}}(w_6,Q_3)\mathcal{Z}_{\mu_{6,1}\mu_{6,2}}(w_6,Q_4), \end{align} where \begin{align} &\bar{Z}^{\text{SU(2)-SU(2)}}_{\mu_{5,1}\mu_{5,2}\mu_{6,1}\mu_{6,2}}(w_5,w_6,Q_5,Q_6)\nonumber\\ &=Q_{5}^{|\mu_{5,1}|+|\mu_{5,2}|}\prod_{p=1}^{2}\bigg(\frac{\prod_{r=1}^{2}\varTheta_{\mu_{5,p}\mu_{6,r}}(\frac{y_{5,p}}{y_{6,r}}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}}|Q_{\tau})}{\prod_{c=1}^{2}\varTheta_{\mu_{5,p}\mu_{5,c}}(\frac{y_{5,p}}{y_{5,c}}|Q_{\tau})\varTheta_{\mu_{5,p}\mu_{5,c}}(\frac{y_{5,p}}{y_{5,c}}\tfrac{\mathfrak{t}}{\mathfrak{q}}|Q_{\tau})}\bigg)\nonumber\\ &~\times Q_{6}^{|\mu_{6,1}|+|\mu_{6,2}|}\prod_{s=1}^{2}\bigg(\frac{\prod_{d=1}^{2}\varTheta_{\mu_{6,s}\mu_{5,d}}(\frac{y_{6,s}}{y_{5,d}}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}}|Q_{\tau})}{\prod_{e=1}^{2}\varTheta_{\mu_{6,s}\mu_{6,e}}(\frac{y_{6,s}}{y_{6,e}}|Q_{\tau})\varTheta_{\mu_{6,s}\mu_{6,e}}(\frac{\mu_{6,s}}{\mu_{6,e}}\tfrac{\mathfrak{t}}{\mathfrak{q}}|Q_{\tau})}\bigg)\ , \end{align} and other $\mathcal{Z}$'s are the same functions that is defined in \eqref{eq:defZQ1}. \paragraph{$Z^{D_5}_{Q_5^{\bf 0}Q_6^{\bf 0}}$ part.} From the general formula in \eqref{eq:unifiedpert}, we find the perturbative part of the partition function of $D_5$ LST, \begin{align}\label{eq:D5pertPE} Z^{D_5}_{\text{pert}}=&~\text{PE}\bigg[\frac{1}{(1-\mathfrak{t})(1-\mathfrak{q})}\frac{1+Q_{\tau}}{1-Q_{\tau}}\Big((\mathfrak{q}+\mathfrak{t})\big(4+\frac12(w_5^2+\frac{1}{w_5^2})+\frac12(w_6^2+\frac{1}{w_6^2})\big) \nonumber\\ &-\sqrt{\mathfrak{t}\mathfrak{q}}\big(2(w_5+\frac{1}{w_5})+2(w_6+\frac{1}{w_6})+w_5w_6+\frac{1}{w_5w_6}+\frac{w_5}{w_6}+\frac{w_6}{w_5}\big)\Big)\nonumber\\ &+7\frac{Q_{\tau}}{1-Q_{\tau}}\bigg]\ . \end{align} Substituting \eqref{eq:D5pertPE} and \eqref{eq:zsubu1rev} into \eqref{eq:nZ_D5pert} and expanding up to $Q_{\tau}Q_4$ order, we get \begin{align} Z^{D_5}_{Q_5^{\bf 0}Q_6^{\bf 0}}=&~\text{PE}\bigg[\frac{1}{(1-\mathfrak{t})(1-\mathfrak{q})}\bigg((\mathfrak{q}+\mathfrak{t})(Q_1+Q_2+Q_3+4)-\sqrt{\mathfrak{t} \mathfrak{q}}\Big((Q_1+\frac{1}{Q_1}+Q_2\nonumber\\ &+\frac{1}{Q_2}+4)w_5+(Q_3+\frac{1}{Q_3}+4)w_6+2 w_5w_6+2\frac{w_5}{w_6}\Big)+Q_4\Big((\mathfrak{q}+\mathfrak{t})\nonumber\\ &-\sqrt{\mathfrak{q}\mathfrak{t}}(w_6+\frac{1}{w_6})\Big)+\mathcal{O}(Q_4^2)\bigg)+\frac{Q_{\tau}}{(1-\mathfrak{t})(1-\mathfrak{q})}\bigg(7(\mathfrak{q}\mathfrak{t}+1)+\mathfrak{q}+\mathfrak{t}\nonumber\\ &+(\mathfrak{q}+\mathfrak{t})\big(\mathfrak{t}+\mathfrak{q}^2\mathfrak{t}+\mathfrak{q}(1+\mathfrak{t})^2\big)\Big(\frac{Q_1}{(Q_1\mathfrak{q}-\mathfrak{t})(Q_1\mathfrak{t}-\mathfrak{q})}+\frac{Q_2}{(Q_2\mathfrak{q}-\mathfrak{t})(Q_2\mathfrak{t}-\mathfrak{q})}\nonumber\\ &+\frac{Q_3}{(Q_3\mathfrak{q}-\mathfrak{t})(Q_3\mathfrak{t}-\mathfrak{q})}\Big)-\sqrt{\mathfrak{q}\mathfrak{t}}\Big((w_5+\frac{1}{w_5})\big(4+\frac{Q_1(1+\mathfrak{q})(1+\mathfrak{t})(\mathfrak{q}+\mathfrak{t})}{(Q_1\mathfrak{q}-\mathfrak{t})(Q_1\mathfrak{t}-\mathfrak{q})}\nonumber\\ &+\frac{Q_2(1+\mathfrak{q})(1+\mathfrak{t})(\mathfrak{q}+\mathfrak{t})}{(Q_2\mathfrak{q}-\mathfrak{t})(Q_2\mathfrak{t}-\mathfrak{q})}\big)+(w_6+\frac{1}{w_6})\big(4+\frac{Q_3(1+\mathfrak{q})(1+\mathfrak{t})(\mathfrak{q}+\mathfrak{t})}{(Q_3\mathfrak{q}-\mathfrak{t})(Q_3\mathfrak{t}-\mathfrak{q})}\big)\nonumber\\ &+2(w_5w_6+\frac{1}{w_5w_6}+\frac{w_5}{w_6}+\frac{w_6}{w_5})\Big)+(\mathfrak{q}+\mathfrak{t})\Big((w_5^2+\frac{1}{w_5^2})\big(\frac{Q_1\mathfrak{q}\mathfrak{t}}{(Q_1\mathfrak{q}-\mathfrak{t})(Q_1\mathfrak{t}-\mathfrak{q})}\nonumber\\ &+\frac{Q_2\mathfrak{q}\mathfrak{t}}{(Q_2\mathfrak{q}-\mathfrak{t})(Q_2\mathfrak{t}-\mathfrak{q})}+1\big)+(w_6^2+\frac{1}{w_6^2})\big(\frac{Q_3\mathfrak{q}\mathfrak{t}}{(Q_3\mathfrak{q}-\mathfrak{t})(Q_3\mathfrak{t}-\mathfrak{q})}+1\big)\Big)\nonumber\\ &+Q_4\Big(\frac{(\mathfrak{q}+\mathfrak{t})\big(\mathfrak{t}+\mathfrak{q}^2\mathfrak{t}+\mathfrak{q}(1+\mathfrak{t})^2\big)}{\mathfrak{q}\mathfrak{t}}-\frac{(1+\mathfrak{q})(1+\mathfrak{t})(\mathfrak{q}+\mathfrak{t})}{\sqrt{\mathfrak{q}\mathfrak{t}}}(w_6+\frac{1}{w_6})\nonumber\\ &+(\mathfrak{q}+\mathfrak{t})(w_6^2+\frac{1}{w_6^2})\Big)+\mathcal{O}(Q_4^2)\bigg)+\mathcal{O}(Q_{\tau}^2)\bigg]. \end{align} \paragraph{$Z^{D_5}_{Q_5Q_6}$ part and rescaling.} Just like in the $D_4$ LST case, we expand $Q_5,Q_6,w_5$, and $w_6$ up to finite order. In order to make the expansion of $w_5,w_6$ have all non-negative orders, we need to rescale $\bar{Z}^{\text{SU(2)-SU(2)}}$, $\mathcal{Z}$ functions, and parameters in \eqref{eq:ZD5Q5Q6}. We find that the following rescalings, \begin{align}\label{eq:calZD5rescaling} &\mathcal{Z}_{\mu_{5,1}\mu_{5,2}}\rightarrow w_5^{\frac12(|\mu_{5,1}|+|\mu_{5,2}|)}\mathcal{Z}_{\mu_{5,1}\mu_{5,2}},\ \mathcal{Z}_{\mu_{6,1}\mu_{6,2}}\rightarrow w_6^{\frac12(|\mu_{6,1}|+|\mu_{6,2}|)}\mathcal{Z}_{\mu_{6,1}\mu_{6,2}},\nonumber\\ &\bar{Z}^{\text{SU(2)-SU(2)}}_{\mu_{5,1}\mu_{5,2}\mu_{6,1}\mu_{6,2}}\rightarrow w_5^{-(|\mu_{5,1}|+|\mu_{5,2}|)}w_6^{-(|\mu_{6,1}|+|\mu_{6,2}|)}\bar{Z}^{\text{SU(2)-SU(2)}}_{\mu_{5,1}\mu_{5,2}\mu_{6,1}\mu_{6,2}},\nonumber\\ &Q_5\rightarrow w_6Q_5,\quad Q_6\rightarrow w_5Q_6,\quad Q_{\tau}\rightarrow w_5^2 w_6^2 Q_{\tau}, \end{align} make $\bar{Z}^{\text{SU(2)-SU(2)}}$ and $\mathcal{Z}$ functions have non-negative power expansion with respect to $w_5,w_6$. After obtaining $Z^{D_5}_{Q_5Q_6}$ in an expansion form in $w_5,w_6$ under the rescalings \eqref{eq:calZD5rescaling}, we switch back to the unrescaled parameters. \paragraph{Evaluation of the partition function by Weyl symmetry.} For the $A_1^\ell A_2^m u^n Q_{\tau}^r$ term in the PE of $Z^{D_5}$, it will have the following general form, \begin{align} b_{\ell,m,n,r}(Q_1,Q_2,Q_3,Q_5,Q_6)A_1^\ell A_2^m u^n Q_{\tau}^r. \end{align} \paragraph{(1)} For $r=0$ and $b_{\ell,m,n}\equiv b_{\ell,m,n,0}$, we expect $b_{\ell,m,n}$ to be finite polynomials of $D_5$ characters with $Q_1,Q_2,Q_3,Q_5,Q_6$ as the fugacities in the $\alpha$-basis. Like the analysis in $D_4$ case, we can treat $b_{\ell,m,n}$ as finite polynomials of $Q_5,Q_6$ because $Q_5,Q_6$ is now the expansion parameters when we do the actual computation of the partition function. After switching to the parameters $w_5,w_6,Q_4$ by \eqref{eq:invariantCBofD5} and \eqref{eq:uofD5}, we have \begin{align}\label{eq:blmnofD5} &b_{\ell,m,n}(Q_1,Q_2,Q_3,Q_5,Q_6)A_1^\ell A_2^m u^n\nonumber\\ =&b_{\ell,m,n}(Q_1,Q_2,Q_3,Q_5,Q_6)(Q_1Q_2)^{\frac32\ell+m+n}Q_3^{\ell+m+n}Q_5^{3\ell+2m+2n}Q_6^{2\ell+2m+2n}w_5^{\ell}w_6^m Q_4^n \end{align} On the other side, from the actual computation, we would get \begin{align}\label{eq:D5expansioncf} (``\cdots+1+Q_5+Q_6+\cdots+Q_5^{k_1} Q_6^{k_2}+\cdots")w_5^{\ell}w_6^m Q_4^n, \end{align} if we sum over the Young diagrams up to $|\mu_{5,1}|+|\mu_{5,2}|\leq k_1,|\mu_{6,1}|+|\mu_{6,2}|\leq k_2$. By equating the right hand side of \eqref{eq:blmnofD5} with \eqref{eq:D5expansioncf}, we have \begin{align}\label{eq:D5judge} &b_{\ell,m,n}(Q_1,Q_2,Q_3,Q_5,Q_6)(Q_1Q_2)^{\frac32\ell+m+n}Q_3^{\ell+m+n}Q_5^{3\ell+2m+2n}Q_6^{2\ell+2m+2n}\nonumber\\ =&``\cdots+1+Q_5+Q_6+\cdots+Q_5^{k_1} Q_6^{k_2}+\cdots" \, . \end{align} In order to obtain up to $Q_5^0 Q_6^0$ order of $b_{\ell,m,n}$, we need to expand $Q_5,Q_6$ on the right hand side of \eqref{eq:D5judge} up to $k_1=3\ell+2m+2n,k_2=2\ell+2m+2n$. Then we can use Weyl symmetry to obtain the full terms of $b_{\ell,m,n}$ from its partial terms and determine the highest order of $Q_5,Q_6$ on the right hand side of \eqref{eq:D5judge} that is needed to confirm the correctness of the result that is obtained by Weyl symmetry. \paragraph{(2)} For $r>0$, like the $D_4$ LST case, we expect that there will be a common denominator $D$ appearing in the $Q_{\tau}^1$ order, and $b_{\ell,m,n,r}$ will be in the form of a finite polynomial $\tilde{b}_{\ell,m,n,r}$ divided by $D$, \begin{align} b_{\ell,m,n,r}=\frac{\tilde{b}_{\ell,m,n,r}}{D}. \end{align} We still have \eqref{eq:denoQ1} which comes from $\mathcal{Z}_{\mu_{5,1}\mu_{5,2}}(w_5,Q_1)$ that contributes to $D$, so we can start from it and use Weyl symmetry to generate all the factors of $D$. The Weyl group orbit of $Q_1$ is \begin{align} &\text{orbit}(Q_1)\nonumber\\ =&\{Q_1,Q_1^{-1},Q_2,Q_2^{-1},Q_3,Q_3^{-1},Q_5,Q_5^{-1},Q_6,Q_6^{-1},Q_1Q_5,(Q_1Q_5)^{-1},Q_2Q_5,(Q_2Q_5)^{-1},\nonumber\\ &Q_3Q_6,(Q_3Q_6)^{-1},Q_5Q_6,(Q_5Q_6)^{-1},Q_1Q_2Q_5,(Q_1Q_2Q_5)^{-1},Q_1Q_5Q_6,(Q_1Q_5Q_6)^{-1},\nonumber\\ &Q_2Q_5Q_6,(Q_2Q_5Q_6)^{-1},Q_3Q_5Q_6,(Q_3Q_5Q_6)^{-1},Q_1Q_2Q_5Q_6,(Q_1Q_2Q_5Q_6)^{-1},\nonumber\\ &Q_1Q_3Q_5Q_6,(Q_1Q_3Q_5Q_6)^{-1},Q_2Q_3Q_5Q_6,(Q_2Q_3Q_5Q_6)^{-1},Q_1Q_2Q_5^2Q_6,(Q_1Q_2Q_5^2Q_6)^{-1},\nonumber\\ &Q_1Q_2Q_3Q_5Q_6,(Q_1Q_2Q_3Q_5Q_6)^{-1},Q_1Q_2Q_3Q_5^2Q_6,(Q_1Q_2Q_3Q_5^2Q_6)^{-1},Q_1Q_2Q_3Q_5^2Q_6^2,\nonumber\\ &(Q_1Q_2Q_3Q_5^2Q_6^2)^{-1}\}, \end{align} so we find \begin{align} D=&\frac{1}{\mathfrak{q}^{20}\mathfrak{t}^{20}Q_1^{10}Q_2^{10}Q_3^8Q_5^{18}Q_6^{14}}(Q_1\mathfrak{q}-\mathfrak{t})(Q_1\mathfrak{t}-\mathfrak{q})(Q_2\mathfrak{q}-\mathfrak{t})(Q_2\mathfrak{t}-\mathfrak{q})(Q_3\mathfrak{q}-\mathfrak{t})(Q_3\mathfrak{t}-\mathfrak{q})\nonumber\\ &\times(Q_5\mathfrak{q}-\mathfrak{t})(Q_5\mathfrak{t}-\mathfrak{q})(Q_1Q_5\mathfrak{q}-\mathfrak{t})(Q_1Q_5\mathfrak{t}-\mathfrak{q})(Q_2Q_5\mathfrak{q}-\mathfrak{t})(Q_2Q_5\mathfrak{t}-\mathfrak{q})\nonumber\\ &\times(Q_1Q_2Q_5\mathfrak{q}-\mathfrak{t})(Q_1Q_2Q_5\mathfrak{t}-\mathfrak{q})(Q_6\mathfrak{q}-\mathfrak{t})(Q_6\mathfrak{t}-\mathfrak{q})(Q_3Q_6\mathfrak{q}-\mathfrak{t})(Q_3Q_6\mathfrak{t}-\mathfrak{q})\nonumber\\ &\times(Q_5Q_6\mathfrak{q}-\mathfrak{t})(Q_5Q_6\mathfrak{t}-\mathfrak{q})(Q_1Q_5Q_6\mathfrak{q}-\mathfrak{t})(Q_1Q_5Q_6\mathfrak{t}-\mathfrak{q})(Q_2Q_5Q_6\mathfrak{q}-\mathfrak{t})\nonumber\\ &\times(Q_2Q_5Q_6\mathfrak{t}-\mathfrak{q})(Q_1Q_2Q_5Q_6\mathfrak{q}-\mathfrak{t})(Q_1Q_2Q_5Q_6\mathfrak{t}-\mathfrak{q})(Q_3Q_5Q_6\mathfrak{q}-\mathfrak{t})\nonumber\\ &\times(Q_3Q_5Q_6\mathfrak{t}-\mathfrak{q})(Q_1Q_3Q_5Q_6\mathfrak{q}-\mathfrak{t})(Q_1Q_3Q_5Q_6\mathfrak{t}-\mathfrak{q})(Q_2Q_3Q_5Q_6\mathfrak{q}-\mathfrak{t})\nonumber\\ &\times(Q_2Q_3Q_5Q_6\mathfrak{t}-\mathfrak{q})(Q_1Q_2Q_3Q_5Q_6\mathfrak{q}-\mathfrak{t})(Q_1Q_2Q_3Q_5Q_6\mathfrak{t}-\mathfrak{q})(Q_1Q_2Q_5^2Q_6\mathfrak{q}-\mathfrak{t})\nonumber\\ &\times(Q_1Q_2Q_5^2Q_6\mathfrak{t}-\mathfrak{q})(Q_1Q_2Q_3Q_5^2Q_6\mathfrak{q}-\mathfrak{t})(Q_1Q_2Q_3Q_5^2Q_6\mathfrak{t}-\mathfrak{q})\nonumber\\ &\times(Q_1Q_2Q_3Q_5^2Q_6^2\mathfrak{q}-\mathfrak{t})(Q_1Q_2Q_3Q_5^2Q_6^2\mathfrak{t}-\mathfrak{q}). \end{align} Transforming into the orthonormal basis, $D$ takes the following form, \begin{align} D=\prod_{i=1}^5\prod_{j>i}^5\frac{(B_iB_j\mathfrak{q}-\mathfrak{t})(B_iB_j\mathfrak{t}-\mathfrak{q})(B_i\mathfrak{q}-B_j\mathfrak{t})(B_i\mathfrak{t}-B_j\mathfrak{q})}{(B_iB_j\mathfrak{q}\mathfrak{t})^2}. \end{align} Like the $D_4$ case, in order to obtain the coefficients of $Q_{\tau}^1$ order, the expansion of $Q_5,Q_6$ has to be taken up to very high order which is difficult, so we will only compute up to $Q_{\tau}^0$ order for $Z^{D_5}$. \paragraph{Final result of $Z^{D_5}$.} Combining $Z^{D_5}_{Q_5^{\bf 0}Q_6^{\bf 0}}$ with $Z^{D_5}_{Q_5Q_6}$, we obtain the full partition function $Z^{D_5}$. We express $Z^{D_5}$ as a PE form, \begin{align} Z^{D_5}=Z^{D_5}_{Q_5^{\bf 0}Q_6^{\bf 0}}\cdot Z^{D_5}_{Q_5Q_6}=\text{PE}\bigg[\sum_{\ell,m,n,r}b_{\ell,m,n,r}A_1^\ell A_2^m u^n Q_{\tau}^r\bigg]\ , \end{align} and list a few $b_{\ell,m,n,r}$ that we could determine in the expansion of $Q_5,Q_6$ up to $Q_5^3 Q_6^2$ order, \begin{align} &b_{0,0,0,0}=\frac12(3+\chi_{\bf 2})\left[0,\frac12\right],\nonumber\\ &b_{1,-1,0,0}=2\chi_{\bf 1}[0,0],\nonumber\\ &b_{1,0,0,0}=(\textcolor{red}{\chi_{\bf s}^2+\chi_{\bf c}^2})[0,0]+\textcolor{red}{2\chi_{\bf 1}}\bigg[0,\frac12\bigg],\nonumber\\ &b_{0,1,0,0}=(1+\textcolor{red}{\chi_{\bf 1}^2+2\chi_{\bf 2}})[0,0]+[0,1]+\bigg[\frac12,\frac12\bigg],\nonumber\\ &b_{0,0,1,0}=(1+\textcolor{red}{\chi_{\bf 2}})\bigg[0,\frac12\bigg]+2\bigg[\frac12,0\bigg],\nonumber\\ &b_{1,-1,1,0}=\textcolor{red}{2\chi_{\bf 1}}[0,0],\nonumber\\ &b_{-1,1,1,0}=2\chi_{\bf 1}[0,0], \end{align} where $\chi_{\bf 1}, \chi_{\bf 2}, \chi_{\bf 3}, \chi_{\bf s}$ and $\chi_{\bf c}$ are characters of fundamental weights of $D_5$ whose expressions are in \eqref{eq:D5fundamentals} when transformed to orthonormal basis by \eqref{eq:D5orthonormaltran}. For $b_{1,0,0,0}, b_{0,1,0,0}, b_{0,0,1,0}$, and $b_{1,-1,1,0}$, we also type the characters in red which means that these characters are obtained by Weyl symmetry but not yet confirmed by direct computation, because we only compute the expansion of $Q_5, Q_6$ up to $Q_5^3Q_6^2$ order which is just enough to determine the $Q_5^0Q_6^0$ order of these characters. The highest order among these characters is $Q_5^3Q_6^2$, so by \eqref{eq:D5judge} we have to compute the $Q_5, Q_6$ expansion up to $Q_5^6Q_6^4$ to confirm these characters in red, but it is difficult. With the expansion parameters to be chosen in accord with the ones used in \cite{Kim:2017xan}, we also compared our result of the partition function $Z^{D_5}$ of $D_5$ LST with the one in \cite{Kim:2017xan}, and they are consistent. \bigskip \subsection{Expansion of \texorpdfstring{$E_6$}{E6} LST} For $E_6$ LST, it is also easy to show that the switching of external NS-charged branes of each gauge node of $Q_i$ in the trivalent gluing brane web in figure \ref{fig:E6Dynkin}(a) corresponds to the affine Weyl reflection of each affine simple root $\alpha_i$ in the affine $E_6$ Dynkin diagram in figure \ref{fig:E6Dynkin}(b). So by the same argument in the $D_4$ LST case, we claim that \textit{the partition function of $E_6$ LST has affine $E_6$ symmetry}. \begin{figure}[htbp] \centering \includegraphics[scale=0.45]{E6tri-Dynkin.pdf} \caption{(a)Trivalent gluing brane web of $E_6$ LST. (b)Affine Dynkin diagram of affine $E_6$. } \label{fig:E6Dynkin} \end{figure} The affine $E_6$ Weyl reflections from the brane web in figure \ref{fig:E6Dynkin}(a) are as following forms: \begin{equation} \left\{\begin{array}{l} Q_1\rightarrow Q_1^{-1},\ Q_2\rightarrow Q_2Q_1\\ Q_2\rightarrow Q_2^{-1},\ Q_1\rightarrow Q_1Q_2,\ Q_7\rightarrow Q_7Q_2\\ Q_3\rightarrow Q_3^{-1},\ Q_4\rightarrow Q_4Q_3\\ Q_4\rightarrow Q_4^{-1},\ Q_3\rightarrow Q_3Q_4,\ Q_7\rightarrow Q_7Q_4\\ Q_5\rightarrow Q_5^{-1},\ Q_6\rightarrow Q_6Q_5\\ Q_6\rightarrow Q_6^{-1},\ Q_5\rightarrow Q_5Q_6,\ Q_7\rightarrow Q_7Q_6\\ Q_7\rightarrow Q_7^{-1},\ Q_2\rightarrow Q_2Q_7,\ Q_4\rightarrow Q_4Q_7,\ Q_6\rightarrow Q_6Q_7 \end{array}\right. \end{equation} Again seeing the affine $E_6$ characters in the expansion of partition function is difficult, so we try to reduce to $E_6$ characters by using six of the seven affine Weyl reflections. We pick the affine Weyl reflections of $Q_3,Q_4,Q_7,Q_6,Q_5,Q_2$, and then $Q_1$ will be replaced by \begin{align} u=Q_1Q_2^2Q_3Q_4^2Q_5Q_6^2Q_7^3 \end{align} as Weyl reflection invariant parameter. The six chosen affine $E_6$ Weyl reflections reduce to following forms: \begin{equation} \left\{\begin{array}{l} Q_3\rightarrow Q_3^{-1},\ Q_4\rightarrow Q_4Q_3\\ Q_4\rightarrow Q_4^{-1},\ Q_3\rightarrow Q_3Q_4,\ Q_7\rightarrow Q_7Q_4\\ Q_7\rightarrow Q_7^{-1},\ Q_2\rightarrow Q_2Q_7,\ Q_4\rightarrow Q_4Q_7,\ Q_6\rightarrow Q_6Q_7\\ Q_6\rightarrow Q_6^{-1},\ Q_5\rightarrow Q_5Q_6,\ Q_7\rightarrow Q_7Q_6,\\ Q_5\rightarrow Q_5^{-1},\ Q_6\rightarrow Q_6Q_5\\ Q_2\rightarrow Q_2^{-1},\ Q_7\rightarrow Q_7Q_2 \end{array}\right. \end{equation} They are the $E_6$ Weyl reflections in the basis $\{\alpha_3,\alpha_4,\alpha_7,\alpha_6,\alpha_5,\alpha_2\}$. \begin{figure}[htbp] \centering \includegraphics[scale=0.5]{E6tri-Q6trans.pdf} \caption{Transformation of node 6, node 2 and 4 also transform similarly. } \label{fig:E6Q6trans} \end{figure} \begin{figure}[htbp] \centering \includegraphics[scale=0.5]{E6tri-Q7trans.pdf} \caption{Transformation of node 7} \label{fig:E6Q7trans} \end{figure} For the $E_6$ LST, we have five Coulomb branch parameters $Q_{7,1},Q_{7,2},Q_{2,1},Q_{4,1}$, and $Q_{6,1}$ as shown in figure \ref{fig:E6tri}, and these Coulomb branch parameters also change under the $E_6$ Weyl reflections as shown in figure \ref{fig:E6Q6trans} and figure \ref{fig:E6Q7trans}. For convenience in the later computation, we transform to the following new Coulomb branch parameters $v_1,v_2,w_2,w_4,w_6$ \begin{align} Q_{7,1}=v_1^3,\ Q_{7,2}=v_2^3,\ Q_{2,1}=w_2^2,\ Q_{4,1}=w_4^2,\ Q_{6,1}=w_6^2. \end{align} The $E_6$ Weyl reflections including Coulomb branch parameters now take the following forms: \begin{equation}\label{eq:E6WeylwithCB} \left\{\begin{array}{l} Q_3\rightarrow Q_3^{-1},\ Q_4\rightarrow Q_4Q_3\\ Q_4\rightarrow Q_4^{-1},\ Q_3\rightarrow Q_3Q_4,\ Q_7\rightarrow Q_7Q_4,\ w_4\rightarrow Q_4 w_4\\ Q_7\rightarrow Q_7^{-1},\ Q_2\rightarrow Q_2Q_7,\ Q_4\rightarrow Q_4Q_7,\ Q_6\rightarrow Q_6Q_7,\ v_1\rightarrow Q_7^{\frac13}v_1,\ v_2\rightarrow Q_7^{\frac13}v_2\\ Q_6\rightarrow Q_6^{-1},\ Q_5\rightarrow Q_5Q_6,\ Q_7\rightarrow Q_7Q_6,\ w_6\rightarrow Q_6w_6\\ Q_5\rightarrow Q_5^{-1},\ Q_6\rightarrow Q_6Q_5\\ Q_2\rightarrow Q_2^{-1},\ Q_7\rightarrow Q_7Q_2,\ w_2\rightarrow Q_2 w_2 \end{array}\right. \end{equation} The invariant Coulomb branch parameters should take the general form of \begin{align} Q_2^aQ_3^bQ_4^cQ_5^dQ_6^eQ_7^fv_1^gv_2^hw_2^iw_4^jw_6^k\ . \end{align} By requiring this general form to be invariant under all the Weyl reflections \eqref{eq:E6WeylwithCB}, we obtain six linear equations about $a,b,c,d,e,f,g,h,i,j,k$. There are five independent invariant Coulomb branch parameters which are proportional to $v_1$(i.e. $g=1,h=i=j=k=0$), $v_2$(i.e. $h=1,g=i=j=k=0$), $w_2$(i.e. $i=1,g=h=j=k=0$), $w_4$(i.e. $j=1,g=h=i=k=0$) and $w_6$(i.e. $k=1,g=h=i=j=0$) respectively. For each case, we can solve the six linear equations and obtain one solution. Totally, we get the following five invariant Coulomb branch parameters, \begin{align}\label{eq:E6invCB} &A_1=Q_2Q_3^{\frac23}Q_4^{\frac43}Q_5^{\frac23}Q_6^{\frac43}Q_7^{2}v_1,\ A_2=Q_2Q_3^{\frac23}Q_4^{\frac43}Q_5^{\frac23}Q_6^{\frac43}Q_7^2v_2,\ A_3=Q_2^2Q_3Q_4^2Q_5Q_6^2Q_7^3w_2,\nonumber\\ &A_4=Q_2^2Q_3^{\frac53}Q_4^{\frac{10}{3}}Q_5^{\frac43}Q_6^{\frac83}Q_7^4w_4,\ A_5=Q_2^2Q_3^{\frac43}Q_4^{\frac83}Q_5^{\frac53}Q_6^{\frac{10}{3}}Q_7^4w_6\ . \end{align} We choose the following parameterization for the tensor branch parameters $B_i$ which corresponds to the $E_6$ simple roots in orthonormal basis, \begin{align}\label{eq:E6embed} Q_3=\frac{\sqrt{B_1}}{\sqrt{B_2 B_3 B_4 B_5 B_6}}, Q_4=\frac{B_2}{B_1}, Q_7=\frac{B_3}{B_2}, Q_6=\frac{B_4}{B_3}, Q_5=\frac{B_5}{B_4}, Q_2=B_2 B_1. \end{align} The above parameterization corresponds to the embedding $E_6\supset \text{ SO}(10)\times \text{U}(1)$. Like the previous sections, we still use the old parameters $Q_2,Q_3,Q_4,Q_5,Q_6,Q_7$, $v_1,v_2,w_2,w_4,w_6$ when we do the actual computation and expansion. We will separate the partition function $Z^{E_6}$ into $Z^{E_6}_{Q_7^{\bf 0}}$ part which is the $Q_7^0$ order term in the full partition function and $Z^{E_6}_{Q_7}$ part which is the remaining part that depend on $Q_7$ after extracting out $Z^{E_6}_{Q_7^{\bf 0}}$, \begin{align} Z^{E_6}=Z^{E_6}_{Q_7^{\bf 0}}\cdot Z^{E_6}_{Q_7}, \end{align} where \begin{align}\label{eq:ZofE6Q70} Z^{E_6}_{Q_7^{\bf 0}}=Z^{E_6}_{\text{pert}}&\sum_{\mu_{1,1}}\bar{Z}_{\text{\o}\oo\mu_{1,1}}(w_2,Q_1)\sum_{\mu_{2,1},\mu_{2,2}}\bar{Z}^{\text{SU(2)}}_{\text{\o}\oo\text{\o}\mu_{2,1}\mu_{2,2}}(v_1,v_2,w_2,Q_2)\mathcal{Z}_{\mu_{2,1}\mu_{2,2}}(w_2,Q_1)\nonumber\\ \times & \sum_{\mu_{3,1}}\bar{Z}_{\text{\o}\oo\mu_{3,1}}(w_4,Q_3)\sum_{\mu_{4,1},\mu_{4,2}}\bar{Z}^{\text{SU(2)}}_{\text{\o}\oo\text{\o}\mu_{4,1}\mu_{4,2}}(v_1,v_2,w_4,Q_4)\mathcal{Z}_{\mu_{4,1}\mu_{4,2}}(w_4,Q_3)\nonumber\\ \times & \sum_{\mu_{5,1}}\bar{Z}_{\text{\o}\oo\mu_{5,1}}(w_6,Q_5)\sum_{\mu_{6,1},\mu_{6,2}}\bar{Z}^{\text{SU(2)}}_{\text{\o}\oo\text{\o}\mu_{6,1}\mu_{6,2}}(v_1,v_2,w_6,Q_6)\mathcal{Z}_{\mu_{6,1}\mu_{6,2}}(w_6,Q_5), \end{align} \begin{align}\label{eq:ZE6Q7} Z^{E_6}_{Q_7}=&\sum_{\mu_{7,1},\mu_{7,2},\mu_{7,3}}\bar{Z}^{\text{SU(3)}}_{\mu_{7,1}\mu_{7,2}\mu_{7,3}}(v_1,v_2,Q_7)\nonumber\\ &\times\frac{\sum_{\mu_{2,1},\mu_{2,2}}\bar{Z}^{\text{SU(2)}}_{\mu_{7,1}\mu_{7,2}\mu_{7,3}\mu_{2,1}\mu_{2,2}}(v_1,v_2,w_2,Q_2)\mathcal{Z}_{\mu_{2,1}\mu_{2,2}}(w_2,Q_1)}{\sum_{\mu_{2,1},\mu_{2,2}}\bar{Z}^{\text{SU(2)}}_{\text{\o}\oo\text{\o}\mu_{2,1}\mu_{2,2}}(v_1,v_2,w_2,Q_2)\mathcal{Z}_{\mu_{2,1}\mu_{2,2}}(w_2,Q_1)}\nonumber\\ &\times\frac{\sum_{\mu_{4,1},\mu_{4,2}}\bar{Z}^{\text{SU(2)}}_{\mu_{7,1}\mu_{7,2}\mu_{7,3}\mu_{4,1}\mu_{4,2}}(v_1,v_2,w_4,Q_4)\mathcal{Z}_{\mu_{4,1}\mu_{4,2}}(w_4,Q_3)}{\sum_{\mu_{4,1},\mu_{4,2}}\bar{Z}^{\text{SU(2)}}_{\text{\o}\oo\text{\o}\mu_{4,1}\mu_{4,2}}(v_1,v_2,w_4,Q_4)\mathcal{Z}_{\mu_{4,1}\mu_{4,2}}(w_4,Q_3)}\nonumber\\ &\times\frac{\sum_{\mu_{6,1},\mu_{6,2}}\bar{Z}^{\text{SU(2)}}_{\mu_{7,1}\mu_{7,2}\mu_{7,3}\mu_{6,1}\mu_{6,2}}(v_1,v_2,w_6,Q_6)\mathcal{Z}_{\mu_{6,1}\mu_{6,2}}(w_6,Q_5)}{\sum_{\mu_{6,1},\mu_{6,2}}\bar{Z}^{\text{SU(2)}}_{\text{\o}\oo\text{\o}\mu_{6,1}\mu_{6,2}}(v_1,v_2,w_6,Q_6)\mathcal{Z}_{\mu_{6,1}\mu_{6,2}}(w_6,Q_5)}. \end{align} with \begin{align} \bar{Z}^{\text{SU(3)}}_{\mu_{7,1}\mu_{7,2}\mu_{7,3}}(v_1,v_2,Q_7)=\frac{Q_{7}^{|\mu_{7,1}|+|\mu_{7,2}|+|\mu_{7,3}|}}{\prod_{c=1}^3\prod_{e=1}^3\varTheta_{\mu_{7,c}\mu_{7,e}}(\frac{y_{7,c}}{y_{7,e}}|Q_{\tau})\varTheta_{\mu_{7,c}\mu_{7,e}}(\frac{y_{7,c}}{y_{7,e}}\tfrac{\mathfrak{t}}{\mathfrak{q}}|Q_{\tau})}, \end{align} \begin{align}\label{eq:E6ZSU2def} &\bar{Z}^{\text{SU(2)}}_{\mu_{7,1}\mu_{7,2}\mu_{7,3}\mu_{2,1}\mu_{2,2}}(v_1,v_2,w_2,Q_2)\nonumber\\ =&Q_{2}^{|\mu_{2,1}|+|\mu_{2,2}|}\prod_{p=1}^2\bigg(\frac{\prod_{r=1}^3\varTheta_{\mu_{2,p}\mu_{7,r}}(\frac{y_{2,p}}{y_{7,r}}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}}|Q_{\tau})\varTheta_{\mu_{7,r}\mu_{2,p}}(\frac{y_{7,r}}{y_{2,p}}\sqrt{\tfrac{\mathfrak{t}}{\mathfrak{q}}}|Q_{\tau})}{\prod_{s=1}^2\varTheta_{\mu_{2,p}\mu_{2,s}}(\frac{y_{2,p}}{y_{2,s}}|Q_{\tau})\varTheta_{\mu_{2,p}\mu_{2,s}}(\frac{y_{2,p}}{y_{2,s}}\tfrac{\mathfrak{t}}{\mathfrak{q}}|Q_{\tau})}\bigg). \end{align} Defining \begin{align} \mathcal{Z}_{\mu_{7,1}\mu_{7,2}\mu_{7,3}}(v_1,v_2,w_2,Q_2,Q_1)=\frac{\sum_{\mu_{2,1},\mu_{2,2}}\bar{Z}^{\text{SU(2)}}_{\mu_{7,1}\mu_{7,2}\mu_{7,3}\mu_{2,1}\mu_{2,2}}(v_1,v_2,w_2,Q_2)\mathcal{Z}_{\mu_{2,1}\mu_{2,2}}(w_2,Q_1)}{\sum_{\mu_{2,1},\mu_{2,2}}\bar{Z}^{\text{SU(2)}}_{\text{\o}\oo\text{\o}\mu_{2,1}\mu_{2,2}}(v_1,v_2,w_2,Q_2)\mathcal{Z}_{\mu_{2,1}\mu_{2,2}}(w_2,Q_1)}, \end{align} we can rewrite \eqref{eq:ZE6Q7} as \begin{align}\label{eq:ZofE6Q7new} Z^{E_6}_{Q_7}=&\sum_{\mu_{7,1},\mu_{7,2},\mu_{7,3}}\bar{Z}^{\text{SU(3)}}_{\mu_{7,1}\mu_{7,2}\mu_{7,3}}(v_1,v_2,Q_7)\mathcal{Z}_{\mu_{7,1}\mu_{7,2}\mu_{7,3}}(v_1,v_2,w_2,Q_2,Q_1)\nonumber\\ &\times \mathcal{Z}_{\mu_{7,1}\mu_{7,2}\mu_{7,3}}(v_1,v_2,w_4,Q_4,Q_3) \mathcal{Z}_{\mu_{7,1}\mu_{7,2}\mu_{7,3}}(v_1,v_2,w_6,Q_6,Q_5). \end{align} \paragraph{Evaluation of the partition function by Weyl symmetry.} Among all the terms of a character of $E_6$ in an arbitrary representation in the $\alpha$-basis, the terms $Q_7^0Q_2^0Q_3^i Q_4^j Q_5^k Q_6^\ell$ with $i,j,k,\ell\leq 0$ include at least one element of each Weyl orbit in the character, so these terms are enough to determine all the terms of the character by Weyl symmetry. We can utilize this to determine the coefficients of the expansion of partition function. In the computation of $Z^{E_6}_{Q_7^{\bf 0}}$ and $Z^{E_6}_{Q_7}$, we need to sum over enough Young diagrams in order to go up to higher orders of $Q_2,Q_4,Q_6,Q_7$. As we go up to higher orders, it becomes more time consuming. Combining a lower order computation with the Weyl symmetry analysis, we find that up to $Q_2^2Q_4^2Q_6^2Q_7^3$ order, the coefficients of the following terms inside PE of $Z^{E_6}$ can be determined by Weyl symmetry \begin{align}\label{eq:E6terms} 1,\ \frac{A_3^2}{A_1A_2^2},\ \frac{A_3^2}{A_1^2A_2},\ \frac{A_4^3}{A_1^3A_2^3},\ \frac{A_5^3}{A_1^3A_2^3},\ A_3,\ \frac{A_1A_3}{A_2},\ \frac{A_2A_3}{A_1},\ u, \end{align} where $1$ means zeroth order of all the expansion parameters. Note that there might be more terms whose coefficients can also be determined by Weyl symmetry when the expansion is taken up to $Q_2^2Q_4^2Q_6^2Q_7^3$ order, we did not try to exhaust all such possible terms. In the following computation of $Z^{E_6}_{Q_7^{\bf 0}}$ and $Z^{E_6}_{Q_7}$, we will only consider these terms in \eqref{eq:E6terms}, and all the other terms in the PE will be ignored and just put into ``$\cdots$". Switching to $v_1,v_2,w_2,w_4,w_6,Q_1$, these terms are \begin{align}\label{eq:E6termsold} 1,\ \frac{w_2^2}{v_1v_2^2},\ \frac{w_2^2}{v_1^2v_2},\ \frac{w_4^3}{v_1^3v_2^3},\ \frac{w_6^3}{v_1^3v_2^3},\ w_2,\ \frac{v_1w_2}{v_2},\ \frac{v_2w_2}{v_1},\ Q_1. \end{align} \bigskip \paragraph{$Z^{E_6}_{Q_7^{\bf 0}}$ part.} We first compute the summation over $\mu_{2,1},\mu_{2,2}$ in \eqref{eq:ZofE6Q70} by the definition in \eqref{eq:E6ZSU2def} and \eqref{eq:defZQ1}. In order to obtain the exact form, we have to sum over $\mu_{2,1},\mu_{2,2}$ up to infinity, but if we further expand with respect to $v_1,v_2,w_2$ up to small finite orders, its expansion coefficients turn out to be finite polynomials of $Q_2$ which only depend on lower Young diagram box numbers. We obtain the following, \begin{align}\label{eq:ZbarSU21} &\sum_{\mu_{2,1},\mu_{2,2}}\bar{Z}^{\text{SU(2)}}_{\text{\o}\oo\text{\o}\mu_{2,1}\mu_{2,2}}(v_1,v_2,w_2,Q_2)\mathcal{Z}_{\mu_{2,1}\mu_{2,2}}(w_2,Q_1)\nonumber\\ =&\text{PE}\bigg[\frac{(\mathfrak{q}+\mathfrak{t})Q_2}{(1-\mathfrak{q})(1-\mathfrak{t})}+\frac{(\mathfrak{q}+\mathfrak{t})Q_2}{(1-\mathfrak{q})(1-\mathfrak{t})}\frac{w_2^2}{v_1v_2^2}+\frac{(\mathfrak{q}+\mathfrak{t})Q_2}{(1-\mathfrak{q})(1-\mathfrak{t})}\frac{w_2^2}{v_1^2v_2}\nonumber\\ &-\frac{2\sqrt{\mathfrak{q}\mathfrak{t}}Q_2}{(1-\mathfrak{q})(1-\mathfrak{t})} w_2-\frac{\sqrt{\mathfrak{q}\mathfrak{t}}Q_2}{(1-\mathfrak{q})(1-\mathfrak{t})}\frac{v_1w_2}{v_2}-\frac{\sqrt{\mathfrak{q}\mathfrak{t}}Q_2}{(1-\mathfrak{q})(1-\mathfrak{t})}\frac{v_2w_2}{v_1}\nonumber\\ &+\frac{(\mathfrak{q}+\mathfrak{t})Q_2}{(1-\mathfrak{q})(1-\mathfrak{t})}Q_1+\cdots\bigg]. \end{align} In this way, we also compute the summation over $\mu_{4,1},\mu_{4,2}$ and $\mu_{6,1},\mu_{6,2}$ in \eqref{eq:ZofE6Q70} and obtain, \begin{align}\label{eq:ZbarSU22} &\sum_{\mu_{4,1},\mu_{4,2}}\bar{Z}^{\text{SU(2)}}_{\text{\o}\oo\text{\o}\mu_{4,1}\mu_{4,2}}(v_1,v_2,w_4,Q_4)\mathcal{Z}_{\mu_{4,1}\mu_{4,2}}(w_4,Q_3)\nonumber\\ =&\text{PE}\bigg[\frac{(\mathfrak{q}+\mathfrak{t})(1+Q_3)Q_4}{(1-\mathfrak{q})(1-\mathfrak{t})}-\frac{(\mathfrak{q}^2+\mathfrak{q}\mathfrak{t}+\mathfrak{t}^2)Q_3Q_4^2}{(1-\mathfrak{q})(1-\mathfrak{t})\sqrt{\mathfrak{q}\mathfrak{t}}}\frac{w_4^3}{v_1^3v_2^3}+\cdots\bigg], \end{align} \begin{align}\label{eq:ZbarSU23} &\sum_{\mu_{6,1},\mu_{6,2}}\bar{Z}^{\text{SU(2)}}_{\text{\o}\oo\text{\o}\mu_{6,1}\mu_{6,2}}(v_1,v_2,w_6,Q_6)\mathcal{Z}_{\mu_{6,1}\mu_{6,2}}(w_6,Q_5)\nonumber\\ =&\text{PE}\bigg[\frac{(\mathfrak{q}+\mathfrak{t})(1+Q_5)Q_6}{(1-\mathfrak{q})(1-\mathfrak{t})}-\frac{(\mathfrak{q}^2+\mathfrak{q}\mathfrak{t}+\mathfrak{t}^2)Q_5Q_6^2}{(1-\mathfrak{q})(1-\mathfrak{t})\sqrt{\mathfrak{q}\mathfrak{t}}}\frac{w_6^3}{v_1^3v_2^3}+\cdots\bigg]. \end{align} Substituting \eqref{eq:ZbarSU21}, \eqref{eq:ZbarSU22}, \eqref{eq:ZbarSU23}, \eqref{eq:zsubu1rev} and \eqref{eq:unifiedpert} into \eqref{eq:ZofE6Q70}, we get \begin{align}\label{eq:ZE6Q7zero} Z^{E_6}_{Q_7^{\bf 0}}=&\text{PE}\bigg[\frac{\mathfrak{q}+\mathfrak{t}}{(1-\mathfrak{q})(1-\mathfrak{t})}\Big(6+Q_2+Q_3+Q_4+Q_5+Q_6+Q_3Q_4+Q_5Q_6\Big)\nonumber\\&+\frac{\mathfrak{q}+\mathfrak{t}}{(1-\mathfrak{q})(1-\mathfrak{t})}Q_2\frac{w_2^2}{v_1v_2^2}+\frac{\mathfrak{q}+\mathfrak{t}}{(1-\mathfrak{q})(1-\mathfrak{t})}Q_2\frac{w_2^2}{v_1^2v_2}-\frac{(\mathfrak{q}^2+\mathfrak{q}\mathfrak{t}+\mathfrak{t}^2)Q_3Q_4^2}{(1-\mathfrak{q})(1-\mathfrak{t})\sqrt{\mathfrak{q}\mathfrak{t}}}\frac{w_4^3}{v_1^3v_2^3}\nonumber\\&-\frac{(\mathfrak{q}^2+\mathfrak{q}\mathfrak{t}+\mathfrak{t}^2)Q_5Q_6^2}{(1-\mathfrak{q})(1-\mathfrak{t})\sqrt{\mathfrak{q}\mathfrak{t}}}\frac{w_6^3}{v_1^3v_2^3}-\frac{2\sqrt{\mathfrak{q}\mathfrak{t}}(1+Q_2)}{(1-\mathfrak{q})(1-\mathfrak{t})} w_2-\frac{\sqrt{\mathfrak{q}\mathfrak{t}}(1+Q_2)}{(1-\mathfrak{q})(1-\mathfrak{t})}\frac{v_1w_2}{v_2}\nonumber\\ &-\frac{\sqrt{\mathfrak{q}\mathfrak{t}}(1+Q_2)}{(1-\mathfrak{q})(1-\mathfrak{t})}\frac{v_2w_2}{v_1}+\frac{(\mathfrak{q}+\mathfrak{t})(1+Q_2)}{(1-\mathfrak{q})(1-\mathfrak{t})}Q_1+\cdots\bigg], \end{align} where terms contain $w_2^{-1}$ are flopped. \paragraph{$Z^{E_6}_{Q_7}$ part and rescaling.} Like in the $D_4$ and $D_5$ case, we only compute the expansion of $Q_7,Q_2,Q_4,Q_6$ up to finite order, and we also expand with $v_1,v_2,w_2,w_4,w_6$ up to finite order. In order to make the expansion of $v_1,v_2,w_2,w_4,w_6$ have all non-negative orders, we need to rescale $\bar{Z}^{\text{SU(3)}}$, $\mathcal{Z}$ functions and parameters in \eqref{eq:ZofE6Q7new}. We find the following rescalings: \begin{align} &\mathcal{Z}_{\mu_{7,1}\mu_{7,2}\mu_{7,3}}(w_2)\rightarrow (v_1^2v_2^2w_2)^{|\mu_{7,1}|+|\mu_{7,2}|+|\mu_{7,3}|}\mathcal{Z}_{\mu_{7,1}\mu_{7,2}\mu_{7,3}}(w_2)\nonumber\\ &\mathcal{Z}_{\mu_{7,1}\mu_{7,2}\mu_{7,3}}(w_4)\rightarrow (v_1^2v_2^2w_4)^{|\mu_{7,1}|+|\mu_{7,2}|+|\mu_{7,3}|}\mathcal{Z}_{\mu_{7,1}\mu_{7,2}\mu_{7,3}}(w_4)\nonumber\\ &\mathcal{Z}_{\mu_{7,1}\mu_{7,2}\mu_{7,3}}(w_6)\rightarrow (v_1^2v_2^2w_6)^{|\mu_{7,1}|+|\mu_{7,2}|+|\mu_{7,3}|}\mathcal{Z}_{\mu_{7,1}\mu_{7,2}\mu_{7,3}}(w_6)\nonumber\\ &\bar{Z}^{\text{SU(3)}}_{\mu_{7,1}\mu_{7,2}\mu_{7,3}}\rightarrow (v_1^6 v_2^6 w_2w_4w_6)^{-(|\mu_{7,1}|+|\mu_{7,2}|+|\mu_{7,3}|)}\bar{Z}^{\text{SU(3)}}_{\mu_{7,1}\mu_{7,2}\mu_{7,3}} \nonumber\\ &Q_2\rightarrow v_1v_2Q_2,\ Q_4\rightarrow v_1v_2Q_4,\ Q_6\rightarrow v_1v_2Q_6,\ Q_7\rightarrow v_1^6 v_2^6 w_2w_4w_6 Q_7\ . \end{align} They make $\bar{Z}^{\text{SU(3)}}$ and $\mathcal{Z}$ functions have non-negative power expansion with respect to $v_1,v_2,w_2,w_4,w_6$. After obtaining $Z^{E_6}_{Q_7}$ expanded with $v_1,v_2,w_2,w_4,w_6$ by the rescaling, we switch back to the unrescaled parameters. \paragraph{Final result of $Z^{E_6}$.} We compute the terms \eqref{eq:E6termsold} in the PE of $Z^{E_6}_{Q_7}$ and then combine it with \eqref{eq:ZE6Q7zero} to obtain the full partition function $Z^{E_6}$. We express $Z^{E_6}$ as PE form, \begin{align} Z^{E_6}=Z^{E_6}_{Q_7^{\bf 0}}\cdot Z^{E_6}_{Q_7}=\text{PE}\left[\sum_{i,j,k,\ell,m,n,r}b_{i,j,k,\ell,m,n,r}A_1^i A_2^j A_3^k A_4^\ell A_5^m u^n Q_{\tau}^r\right], \end{align} and list the coefficients of the terms \eqref{eq:E6terms} which we could determine from the expansion of $Q_2,Q_4,Q_6,Q_7$ up to $Q_2^2Q_4^2Q_6^2Q_7^3$ order, \begin{align} &b_{0,0,0,0,0,0,0}=\frac12(6+\chi_{\bf 6})\bigg[0,\frac12\bigg],\nonumber\\ &b_{-1,-2,2,0,0,0,0}=b_{-2,-1,2,0,0,0,0}=\bigg[0,\frac12\bigg],\nonumber\\ &b_{-3,-3,0,3,0,0,0}=b_{-3,-3,0,0,3,0,0}=[0,1],\nonumber\\ &b_{0,0,1,0,0,0,0}=(6+\textcolor{red}{2\chi_{\bf 6}})[0,0]+2[0,1]+3\bigg[\frac12,\frac12\bigg],\nonumber\\ &b_{1,-1,1,0,0,0,0}=b_{-1,1,1,0,0,0,0}=(2+\textcolor{red}{\chi_{\bf 6}})[0,0]+\bigg[\frac12,\frac12\bigg],\nonumber\\ &b_{0,0,0,0,0,1,0}=(2+\textcolor{red}{\chi_{\bf 6}})\bigg[0,\frac12\bigg]+4\bigg[\frac12,0\bigg], \end{align} where $\chi_{\bf 6}$ is for short the character $\chi_{\bf 6}^{E_6}$ of the adjoint representation of $E_6$ in \eqref{eq:E6fundamentals}. Note that for $b_{0,0,1,0,0,0,0}$, $b_{1,-1,1,0,0,0,0}$, $b_{-1,1,1,0,0,0,0}$ and $b_{0,0,0,0,0,1,0}$ we also type the characters in red which means the characters are obtained by Weyl symmetry but not yet confirmed by direct computation of higher orders. \bigskip \subsection{\texorpdfstring{$E_7$}{E7} and \texorpdfstring{$E_8$}{E8} LST} Due to the quiver structure of the brane web of $E_7$ and $E_8$ LSTs, it is also easy to figure out the affine Weyl symmetry in the brane webs which can confirm that the partition functions of these theories also have affine $E_7$ and affine $E_8$ symmetries. We can also use the general formulae \eqref{eq:unifiedpert} and \eqref{eq:unifiedinst} to expand their partition functions and see the $E_7$ and $E_8$ characters in the expansion coefficients. But as we have experienced long time consuming in computation of $E_6$ LST, we expect that it will be more time consuming in computation of $E_7$ and $E_8$ LSTs, so we do not compute $E_7$ and $E_8$ cases, but the computation is essentially straightforward. \bigskip \section{Conclusion}\label{sec:conclusion} In this paper, we proposed a novel way of computing the supersymmetric partition function for 6d $\mathcal{N}=(1,0)$ little string theories (LSTs) engineered from type IIB NS5-branes probing $D_n$ or $E_n$ singularity. The effective gauge theory description of these LSTs on tensor branch is affine $D_n$ or $E_n$ quiver gauge theories and we propose a 5-brane configuration realizing these quiver gauge theories based on tri-/quadri-valent gluings of 5-brane webs \cite{Hayashi:2017jze,Hayashi:2021pcj}, by identifying external 5-branes which give rise to a compact direction. This can be summarized as follows. We first utilized 5-brane configurations of the tri-/quadri-valent gluings so that the resulting configuration describes 6d theories on a circle, and then we further introduce the bivalent self-gluing of the external 5-branes in such a way that all external 5-branes are glued which makes another compact direction. 5-brane configurations are known for little string theories of $A$-type or those engineered from IIA NS5-brane probing $D$-type singularities. These 5-brane webs consist of a circular quiver. Our brane construction is, however, different from such conventional configurations, as we enclose the external 5-branes of Type IIB configuration that arise from trivalent (or quadrivalent) gluings for 6d $D$- and $E$-type conformal matters. Our construction is therefore a natural generalization making those little string theories whose conformal theory limit gives rise to a $D$- and $E$-type conformal matter. With these glued 5-brane webs, we computed the supersymmetric partition function of these LSTs, using topological vertex. For $D$-type LSTs, it is well-known that one can realize the LSTs using type IIA brane configurations with to $ON^0$-planes as they give rise to an affine $D_n$-type quiver theories \cite{Hanany:1999sj}. Upon T-duality of this IIA configuration, one can find a type IIB description for this $D_n$-type LSTs with 5-brane webs with two $ON^0$-plane where NS5-branes are compacted along the T-dual circle. We showed that such 5-brane description with two $ON^0$-plane can be consistently mapped to a trivalent ($n=4$) or quadrivalent ($n\ge 5$) gluings of 5-brane webs and hence they are equivalent and we also checked the equivalence of the partition functions for these two brane descriptions. Unlike $D$-type LSTs, there are no known brane descriptions for $E$-type LSTs. Our proposal gives a 5-brane configuration for $E$-type LSTs. We also performed the computation of the partition function for $E$-type LSTs. Due to many demanding Young diagram sums, we are not able to compute higher orders of parameters of LSTs which include Coulomb branch moduli and instanton factors of the corresponding affine quiver gauge theory, but we do propose the expected terms based on their affine $E_n$ Weyl symmetries (affine $D_n$ Weyl symmetries for $D$-type LSTs). We discussed that these Weyl symmetries of the partition functions can be seen as exchange symmetries of external NS-charged branes of the affine quiver. K\"ahler parameters associated with the separations of external NS-charged branes can be thought of as simple roots of the corresponding Dynkin diagram. The Weyl reflections then can be understood as a particular series of exchanges of external NS-charged branes which leave the partition functions invariant. Our computation is for rank-1 LSTs engineered from one NS5-brane probing $D,E$-type singularities. The partition functions for rank-$N$ LSTs engineered from $N$ NS5-branes probing $D,E$-type singularities can be generalized in a straightforward manner in our setup, though the computation itself would be demanding. We discussed structures of the partition functions for such higher rank LSTs. There are various directions to pursue. One of them would be T-duality of $E$-LSTs. The T-duality of LSTs can be realized as an S-duality in the corresponding type IIB 5-brane configurations. As discussed, $D$-type LSTs, engineered from IIB NS5-brane probing $D$-type singularity, have 5-brane description with two $ON$-planes and then taking the S-duality leads another 5-brane configuration with two $O5$-planes which give rise to a circular quiver. This correspond to IIA NS5-brane probing the same $D$-type singularity. For $E$-type LSTs, in particular, no 5-brane webs are known. Checking T-duality for $E$-type LSTs would be very challenging. As we proposed a new 5-brane configuration for $D, E$-type LSTs as a tri-/quadri-valent gluing, it would be interesting to study the T-duality with the framework of glued branes. For instance, corresponding brane configurations for this S-duality would be interesting. Also, once we have them, we can take the decompactification limit which yields a 6d SCFT, which would give a new 5-brane realization of the corresponding SCFT. \bigskip \acknowledgments We thank Joonho Kim, Hee-Cheol Kim, and Kimyeong Lee for useful discussions. We acknowledge the hospitality at APCTP, Fudan university, USTC, YMSC Tsinghua university where part of this work was done. SK is supported by the NSFC grant No. 12250610188 and also partially supported by the Fundamental Research Funds for the Central Universities 2682021ZTPY043. FY is supported by the NSFC grant No. 11950410490, by Start-up research grant YH1199911312101, and in part by Fundamental Research Funds for the Central Universities 2682021ZTPY043. The research of YS is supported by Samsung Science and Technology Foundation under Project Number SSTF-BA2002-05 and by the National Research Foundation of Korea (NRF) grant funded by the Korea government (MSIT) (No. 2018R1D1A1B07042934). \bigskip
\section{Introduction} The search for potentially habitable Earth-like planets is one of the most exciting endeavours in the field of exoplanets. Thanks to radial-velocity (RV) and transit surveys, over 5000 exoplanets have been discovered\footnote{https://exoplanetarchive.ipac.caltech.edu; October 2022}. The first exoplanets detected were, for the most part, giant planets \citep{Mayor1995, Noyes1997}, as was predicted to happen \citep{Struve1952}. Then, our technical capabilities rapidly expanded, allowing us to reach increasingly lower mass and smaller radius planets \citep{Santos2004,Bonfils2005, Udry2006} and eventually enter the realm of Earth-mass planets \citep{Pepe2011, AngladaEscude2016, Masca2017c, Faria2022}, but only at short orbital periods. Ninety-five percent of the planets with measured masses < 2 M$_{\oplus}$ orbit with periods shorter than 25 days$^{1}$. All but one of the planets detected via RV, with masses < 2 M$_{\oplus}$, orbit with periods shorter than 20 days$^{1}$. Currently we know a few tens of exoplanets with masses similar to that of the Earth (67 planets with mass or $m_p \sin i $ < 2 M$\oplus$$^{1}$), and hundreds with radii comparable to that of the Earth (855 planets with radius < 1.5 R$\oplus$$^{1}$). However, the number of known exoplanets in the habitable zones (HZs) of their parent stars (i.e. the region in which liquid water can exist in the surface of the planet) with prospects for atmospheric characterisation remains very small. The TRAPPIST-1 system \citep{Gillon2016} is currently the best candidate for atmospheric characterisation via transmission spectroscopy. Another possible path for atmospheric characterisation is high dispersion coronagraphy (HDC) spectroscopy \citep{SparksFord2002, Lovis2017, Blind2022}. This technique allows to combine high-contrast imaging and high-resolution spectroscopy to study the reflected light of the planet. Nearby planets, such as Proxima~b \citep{AngladaEscude2016} or GJ~514~b \citep{Damasso2022}, are ideal candidates for this approach. Nearby low-mass M-dwarfs offer a unique opportunity in the search of characterisable exoplanets in their HZs. Their low masses allow for the detection of planets of masses similar to that of the Earth without the need of a RV precision as extreme as that required to detect these planets orbiting solar-type stars. Their low luminosity moves the HZ closer to the star, making it possible to sample several orbits within the HZ in modest baselines. The slow rotation of the oldest of those stars creates activity signals of low amplitude and at much longer periods than the orbital periods of potential planets in the HZ, an ideal case for modern techniques of stellar activity mitigation \citep{Masca2020}. Furthermore, their large planet-star contrast makes them easier targets for atmospheric characterisation \citep{Lovis2017}. Lastly, their large number compared to other spectral types means that there are enough potentially habitable planets located at large angular separations. These large angular separations allow for atmospheric characterisation using high-contrast imaging coupled with high-resolution spectroscopy with next generation giant telescopes, such as the Extremely Large Telescope (ELT; \citealt{Gilmozzi2007}) or the Thirty Meter Telescope (TMT; \citealt{Sanders2013}) \citep{Lovis2017}, or using nulling interferometry with space missions such as Large Interferometer For Exoplanets (LIFE) \citep{Quanz2022}. Here we report the discovery of two Earth-mass planets orbiting the nearby M5.5V star GJ~1002 \citep{Walker1983}, located at just 4.84 pc from the Sun \citep{GaiaEDR3}. The two planets are located within the HZ of the star. Both planets orbit at angular separations large enough to make them potential candidates for atmospheric characterisation via HDC spectroscopy with ANDES at the ELT \citep{Marconi2021}. \section{Observations \& data} GJ~1002 is part of the ESPRESSO and CARMENES GTO programmes \citep{Hojjatpanah2019, Quirrenbach2014}. It has been intensively monitored from 2017 to 2019 by the CARMENES consortium, and independently from 2019 to 2021 by the ESPRESSO consortium, with some months of overlap. The ESPRESSO consortium is a collaborative effort between Spanish, Swiss, Portuguese and Italian institutions. It is mainly focused on the search and characterisation of exoplanets \citep{GonzalezHernandez2018, Ehrenreich2020, Pepe2021}, while dedicating a fraction of its observing time to the measurement of fundamental constants of the universe \citep{Schmidt2021, Murphy2022}. The CARMENES consortium is a collaboration of 11 German and Spanish institutions. It is focused on the search and characterisation of exoplanets orbiting M-type stars \citep{Quirrenbach2014, Reiners2018, Zechmeister2019}. \subsection{ESPRESSO} The Echelle SPectrograph for Rocky Exoplanets and Stable Spectroscopic Observations (ESPRESSO) \citep{Pepe2021} is a fibre-fed high-resolution \'Echelle spectrograph installed at the 8.2m ESO Very Large Telescope array, at the Paranal Observatory (Chile). It has a resolving power of R$\sim$140 000 over a spectral range from $\sim$380 to $\sim$780 nm and has been designed to attain extremely high long-term radial-velocity precision. It is contained in a temperature- and pressure-controlled vacuum vessel to avoid spectral drifts due to temperature and air pressure variations. Observations are carried out with simultaneous calibration, using a Fabry-P\'erot etalon. The use of the FP enables correcting any remaining instrumental drift up to a precision of 10 cm~s$^{-1}$ \citep{Wildi2010}. ESPRESSO is equipped with its own pipeline, providing extracted and wavelength-calibrated spectra, as well as RV measurements, other data products such as cross-correlation functions (CCF) and telemetry data. We obtained 53 ESPRESSO observations between January 2019 and December 2021. The observations were obtained with a typical exposure time of 900s. In June 2019, ESPRESSO underwent an intervention to update the fibre link, improving the instrument’s efficiency by up to 50\% \citep{Pepe2021}. This intervention introduced an RV offset, leading us to consider separate ESPRESSO18 and ESPRESSO19 datasets. More recently, operations at Paranal were interrupted due to the COVID-19 pandemic and ESPRESSO was taken out of operations between 24 March 2020 and 24 December 2020. This led to a large gap in the observations after the initial campaign. Moreover, a change in one of the calibration lamps after the ramp-up of the instrument is likely to have introduced another RV offset. Therefore, we consider an independent ESPRESSO21 dataset for data obtained after the ramp-up. In summary, we have 53 available RVs, divided between ESPRESSO18 (3 points), ESPRESSO19 (12 points) and ESPRESSO21 (38 points) subsets. \subsection{CARMENES} The Calar Alto high-Resolution search for M-dwarfs with Exoearths with Near-infrared and optical Échelle Spectrographs (CARMENES) \citep{Quirrenbach2014} consists of visual (VIS) and near-infrared (NIR) vacuum-stabilised spectrographs covering 520 -- 960 nm and 960 -- 1710 nm with a spectral resolution of 94~600 and 80~400, respectively. It is located at the 3.5~m Zeiss telescope at the Centro Astronómico Hispano Alemán (Almería, Spain). We extracted the spectra with the \texttt{CARACAL} pipeline, based on flat-relative optimal extraction \citep{Zechmeister2014}. The wavelength calibration that was performed by combining hollow cathode (U-Ar, U-Ne, and Th-Ne) and Fabry-P\'erot etalons exposures. The instrument drift during the nights is tracked with the Fabry-P\'erot in the simultaneous calibration fibre. We obtained 86 observations between 2017 and 2019, using only the data obtained with the CARMENES visual arm. A combination of low RV content in the NIR \citep{Reiners2018} and the more complicated NIR RV extraction \citep{Zechmeister2019} makes it difficult to derive high precision RVs using the CARMENES NIR arm. The instrumental limit of the CARMENES NIR arm in the years 2017 to 2019 was $\sim$ 3.7 m~s$^{-1}$ \citep{Bauer2020}, which makes it unfeasible using them to study the presence of $\sim$ 1 m~s$^{-1}$ signals. \subsection{Radial velocities} The radial velocity measurements were obtained using the \texttt{SERVAL} algorithm \citep{Zechmeister2018} for both instruments. This software builds a high signal-to-noise template by co-adding all the existing observations, and performs a least-squares minimisation of each observed spectrum against the template, yielding a measure of the Doppler shift and its uncertainty. We obtained typical RV internal errors of 0.3 and 1.5 m~s$^{-1}$ for ESPRESSO and CARMENES VIS measurements, respectively. We measured an RMS of the RVs of 1.7 m~s$^{-1}$ and 2.5 m~s$^{-1}$ for the ESPRESSO and CARMENES VIS, respectively. Figure~\ref{gj1002_data} shows the RV time series obtained for GJ~1002. \subsection{Full-width half maximum of the CCF} Stellar activity is one of the most important sources of false positive detections when searching for the presence of exoplanets in RV time series. In most stars, the presence of long-lived large spots (or spot groups) on the stellar surface often creates periodic signals in the data that can easily be mistaken for planetary signals \citep{QuelozHenry2001, Robertson2014}. To monitor the star’s behaviour, we constructed time series of the full-width half maximum (FWHM) of the CCF of the spectra with a binary mask computed from a stellar template \citep{Baranne1996, PepeMayor2000}. The mask was created using an ESPRESSO spectrum of Proxima as template (same spectral type as GJ~1002, but much higher signal-to-noise). Lines were identified through an automatic line-searching algorithm based on the spectrum derivative. The FWHM of the CCF has been successfully used to model the activity of stars of similar spectral type (e.g. \citealt{Masca2020,Lillo-Box2020} or \citealt{Faria2022}). In the case of some low-mass stars it accurately tracks brightness changes of the star in a similar way as high precision photometry does \citep{Masca2020}. This change in FWHM is usually related to the RV trough its gradient, same as the photometry \citep{Aigrain2012}. The FWHM of the CCF in ESPRESSO is automatically provided by the ESPRESSO Data Reduction Software (DRS). The FWHM of the CCF in the CARMENES VIS data were calculated from a CCF built using the same binary mask as used by the ESPRESSO DRS. Figure~\ref{gj1002_data} shows the resulting CCF time series. The ESPRESSO data provided a much cleaner FWHM time series, with an RMS of 2.8 m~s$^{-1}$ and a typical uncertainty of 1.4 m~s$^{-1}$, while also showing some structure recognisable by eye. The CARMENES FWHM time series show an RMS of 12 m~s$^{-1}$ with a typical uncertainty of 12 m~s$^{-1}$. We studied the behaviour of several other activity indicators, which were not included in the global analysis. Most of them show no significant periodicities, or do not provide information in addition to that contained in the FWHM data. Their description and periodograms can be found in Appendix~\ref{append_activity}. \begin{figure} \includegraphics[width=9cm]{IMG_DATA_OBS/RV_DATA_2PC.pdf} \includegraphics[width=9cm]{IMG_DATA_OBS/SNO_DATA.pdf} \caption{Scientific data used in the subsequent analysis. \textit{Top panel}: RV data of GJ~1002. The purple filled circles show the CARMENES data. The teal symbols show the ESPRESSO data. \textit{Middle panel}: FWHM time series of GJ~1002. \textit{Bottom panel}: SNO V-band photometry of GJ~1002.} \label{gj1002_data} \end{figure} \subsection{Sierra Nevada Observatory photometry} As part of the follow-up during the CARMENES observations, a short photometric time series was obtained using the telescopes at the Sierra Nevada Observatory (SNO). The T150 telescope is a 1.5 m Ritchey-Chrétien telescope equipped with a CCD camera VersArray 2k×2k, with a field of view of 7.9×7.9 arcmin$^{2}$ \citep{RodriguezSNO2010}. A set of observations was collected in Johnson $V$, $R$, and $I$ filters, consisting in of 19 epochs obtained during the period July 2017 to August 2017. While the baseline is very short, the cadence is dense enough to show clear variations that might be related to one rotation. Each epoch is an average of $\sim$ 19 individual sub-exposures. Figure~\ref{gj1002_data} (bottom panel) shows the V-band photometric time series. The V-band data show the highest dispersion among all filters, with an RMS of 6 ppt and a typical precision of 0.8 ppt. http://cdsweb.u-strasbg.fr/cgi-bin/qcat?J/A+A/ \subsection{TESS photometry} GJ~1002 (TIC 176287658) was observed by the Transiting Exoplanet Survey Satellite (\textit{TESS}) \citep{Ricker2015} with the 2\,min cadence in sector 42. The data were processed by the Science Processing Operations centre (SPOC) pipeline \citep{Jenkins2016} and searched for transiting planet signatures with an adaptive, wavelet-based transit detection algorithm \citep{Jenkins2002, Jenkins2010}. We verified that the \textit{TESS} fluxes automatically computed by the pipeline are useful for scientific studies by confirming that no additional bright source contaminates the aperture photometry. Figure~\ref{tess_data} displays the target pixel file (TPF) of GJ~1002 using the publicly available \texttt{tpfplotter} code \citep{Aller2020}. This code overplots all sources from the \textit{Gaia} Data Release 3 (DR3) catalogue \citep{GaiaEDR3} with a magnitude contrast up to $\Delta m$=8\,mag on top of the \textit{TESS} TPFs. There are two very faint ($\Delta m$=8\,mag) \textit{Gaia} sources within the photometric aperture around GJ~1002 automatically selected by the pipeline. Therefore, we considered the extracted \textit{TESS} light curve to be free of significant contamination from nearby stars. The TESS 2-minute cadence data showed a dispersion of 1.25 parts per thousand (ppt), with a median uncertainty per observation of 1.26 ppt. The binned light curve, with 30-minute cadence, showed a dispersion of 0.37 ppt with a typical uncertainty of 0.45 ppt. We applied the box least squares (BLS) periodogram \citep{Kovacs2002, Hartman2016} to the \textit{TESS} time series data to search for transit features. No transits have been found in the BLS periodogram. We did not observe any significant stellar variability in the \textit{TESS} light curve, or the presence of flares. \begin{figure} \includegraphics[width=9cm]{IMG_DATA_OBS/TPF_Gaia_TIC176287658_S42.pdf} \includegraphics[width=8.5cm]{IMG_DATA_OBS/TESS_DATA.pdf} \caption{\textit{TESS} data. \textit{Top panel}: TPF file of GJ1002 (cross symbol) for \textit{TESS} sector 42. The electron counts are colour-coded. The \textit{TESS} optimal photometric aperture used to obtain the SAP fluxes is marked with white squares. The \textit{Gaia} DR2 objects with $G$-band magnitudes down to 8\,mag fainter than GJ1002 are labelled with numbers, and their scaled brightness, based on \textit{Gaia} magnitudes, is shown by red circles of different sizes (see figure inset). The pixel scale is 21\,arcsec\,pixel$^{-1}$. \textit{Bottom panel}: TESS light curve. Blue symbols show the 2-minute cadence data. The red symbols represent 30-minute bins.} \label{tess_data} \end{figure} \section{Stellar characteristics} \label{stellar_params} GJ~1002 is a faint ($V\sim$13.8~mag) nearby M5.5V star located at 4.84 pc from the Sun (calculated using the parallax from \citet{GaiaEDR3}). It has a mass of 0.12 M$_{\odot}$ and colours $B-V$ $\sim$ 1.8, and $V-J$ $\sim$ 5.5, very similar to Proxima. Following \citet{Masca2015}, we measure a log$_{10}$ R$_{HK}^{'}$ = --5.7 $\pm$ 0.2, which corresponds to a rotation period of $\sim$ 130 days \citep{Masca2018}, suggesting that it is older than Proxima. Another characteristic pointing to its old age is its X-ray emission (log $L_{X}$ < 25.54). GJ~1002 is the star with the lowest $L_{X}$ in the NEXXUS survey \citep{SchmittLiefke2004}, pointing once more to an old age. Table ~\ref{tab:parameters} shows the full set of parameters of GJ~1002. We calculated the mass by using the effective temperature ($T_{\rm eff}$; \citealt{Passegger2022}) together with the luminosity \citep{Cifuentes2020} by following \citet{Schweitzer2019}. Using the stellar mass and luminosity, we estimate the optimistic HZ for moist worlds to extend from 0.033 to 0.82 au \citep{Kopparapu2014, Kopparapu2017}, which corresponds to orbital periods of 6.6 to 24.8 days. The inner edge of the HZ for worlds with very little water content could extend inwards to 0.023 au \citep{Zsom2013}, or 0.017 au in the case of high albedo, which corresponds to orbital periods of 3.7 and 2.33 days, respectively. \begin{table} \begin{center} \caption{Stellar properties of GJ~1002 \label{tab:parameters}} \begin{tabular}[centre]{l l l} \hline \hline Parameter & GJ~1002 & Ref. \\ \hline $\alpha$ (J2000) & 00:06:43.197 & 1 \\ $\delta$ (J2000) & --07:32:17.019 & 1\\ $\mu_{\alpha}$ (mas yr$^{-1}$)& --811.566 & 1 \\ $\mu_{\delta}$ cos $\alpha$ (mas yr$^{-1}$)& --1893.251 & 1 \\ $\varpi$ ($mas$) & 206.350 $\pm$ 0.047 & 1\\ d (pc) & 4.8461 $\pm$ 0.0011 & 0 \\ $V$ (mag) & 13.837 $\pm$ 0.003 & 2 \\ $J$ (mag) & 8.323 $\pm$ 0.019 & 3 \\ Spectral Type & M5.5~V & 4\\ $L_{*}$ ($L_{\odot}$) & 0.001406 $\pm$ 0.000019 & 5 \\ $T_{\rm eff}$ (K) & 3024 $\pm$ 52 & 6 \\ $[\rm Fe/H]$ (dex) & -0.25 $\pm$ 0.19 & 6 \\ log $g$ (cgs) & 5.10 $\pm$ 0.06 & 6\\ $R_{*}$ (R$_{\odot}$) & 0.137 $\pm$ 0.005 & 0 \\ $M_{*}$ (M$_{\odot}$) & 0.120 $\pm$ 0.010 & 0 \\ log $L_{X}$ (erg~s$^{-1}$) & < 25.54 & 8 \\ log$_{10}$ R$_{HK}^{'}$ & -- 5.7 $\pm$ 0.2 & 0 \\ $P_{rot}$ (days) & 126 $\pm$ 15 & 0$^{*}$ \\ \hline \end{tabular} \end{center} \textbf{References:} 0 - This work, 1 - \citet{GaiaEDR3}, 2 - \citet{Zacharias2013}, 3 - \citet{Cutri2003}, 4 - \citet{Walker1983}, 5 - \citet{Cifuentes2020}, 6 - \citet{Passegger2022}, 7 - \citet{Schweitzer2019}, 8 - \citet{SchmittLiefke2004}, $^{*}$Rotation period obtained from the global analysis of the FWHM and RV data. \end{table} \section{Analysis} Using the data described above, we constructed a dataset that consists of radial velocities and several activity proxies. Figure~\ref{gj1002_data} shows the data that will later be used for the modelling after selecting the most favourable activity indicator (FWHM). Appendix~\ref{append_activity} shows the data of the other activity indicators. \subsection{Telemetry data} Modern RV spectrographs are designed to minimise instrumental effects caused by the changes in their environments. However, we attempt to measure very low amplitude radial velocity signals. Small effects either linked to the stability of both instruments or the extraction of the velocities (e.g trends with airmass) can be present in the data, potentially biasing some of the results. We studied possible correlations between the measured quantities (RV, activity indicators) and all the telemetry data stored in the headers of the reduced ESPRESSO and CARMENES spectra, as well as the periodicities present in the time series of the telemetry data. As both instruments save different data, we performed the analysis independently on both datasets. We find a correlation between the FWHM of the CCFs and the temperature of some of the optical elements. Figure~\ref{fwhm_echelle} shows the FWHM measurements compared to the variations in the temperature of the \'Echelle gratings, with respect to the median value for each instrument. We selected this specific measurement as it is one of the common sensors between the two spectrographs in which the effect is present. We used a third-order polynomial to model the correlation between the variations in FWHM and in temperature, as it gives the minimum $\chi^{2}_{\nu}$ of the tested polynomial models. Figure~\ref{temp_echelle} shows the variations of temperature in the \'Echelle grating for ESPRESSO and CARMENES, and their Generalised Lomb Scargle (GLS; \citealt{Zechmeister2009}) periodogram. The data show a periodicity of $\sim$ 1 year, which is also present in the individual datasets. The temperature of the ESPRESSO \'Echelle grating shows an RMS of 11 mK across the whole dataset, reduced to 8 mK after the first intervention in 2019. The temperature of the CARMENES \'Echelle grating shows an RMS of 45 mK. The higher precision of the FWHM measurements in the ESPRESSO data makes it easier to see its effect in the measurements. The effect of detrending against this quantity appear clearly in the combined dataset. Figure~\ref{fwhm_det} shows the FWHM data, and their periodograms, before and after detrending them using the third order polynomials shown in Fig.~\ref{fwhm_echelle}, and the estimated effect in FWHM created by the temperature changes. The raw measurements show power at periods of around 400-600 days and half a year. The detrended data show a much cleaner periodogram with a peak at 102 days, with some peaks at one half and one third of that period, which is consistent with the predicted period derived from rotation-activity relationships. We estimate that the temperature variations introduce an RMS of 0.78 m~s$^{-1}$ in the ESPRESSO FWHM data and of 6 m~s$^{-1}$ in the CARMENES FWHM data, with periodicities around one year and its second harmonic (See. Fig.~\ref{fwhm_det}, bottom panels). \begin{figure}[ht] \includegraphics[width=9cm]{ANALYSIS/TELEMETRY/TEL_DATA_1.pdf} \caption{FWHM data of ESPRESSO (left) and CARMENES (right) against temperature change of the \'Echelle grating of each instrument.} \label{fwhm_echelle} \end{figure} \begin{figure}[ht] \includegraphics[width=9cm]{ANALYSIS/TELEMETRY/TEMP_ECHELLE.pdf} \caption{Temperature of the \'Echelle gratings of ESPRESSO (top) and CARMENES (bottom), with their periodogram.} \label{temp_echelle} \end{figure} \begin{figure*}[ht] \includegraphics[width=18cm]{ANALYSIS/TELEMETRY/FWHM_DATA_2PC_2.pdf} \caption{Effect of the changes of the temperature of the \'Echelle grating in the FWHM. \textit{Top panels}: Combined FWHM time series of ESPRESSO and CARMENES, a zoom into the latest ESPRESSO campaign and the periodogram of the data. \textit{Middle panels}: Same plot for the combined FWHM time series of ESPRESSO and CARMENES after detrending with respect to the temperature variations of the \'Echelle grating. \textit{Bottom panels}: Same plot for the estimated effect in FWHM due to temperature changes.} \label{fwhm_det} \end{figure*} We see similar effects in some other activity indicators, and with respect to the telemetry obtained trough other temperature sensors. We opted for using a third order polynomial relationship between the affected activity indicators and the \'Echelle grating temperature in all subsequent analyses. The parameters of the polynomial are always fitted simultaneously with the rest of the parameters of the model, using normal priors for the polynomial parameters, centred around zero and with a sigma equal to or larger than the peak-to-peak variation over the baseline to the power of $i$, for each order $i$ of the polynomial. The models computed in sections~\ref{analysis_stellar} and~\ref{analysis_planets} provide slopes different from zero for the dependence between FWHM and temperature. We find no significant correlations between the RV and the telemetry data. There is some apparent, but not significant, slope between the RV and temperature data. We repeated all the analysis of sections~\ref{analysis_stellar} and~\ref{analysis_planets} including a linear term relating the RV and temperature of the \'Echelle grating. We recover null results for all stages of the modelling process. Within the precision of the data and the modelling scheme, we cannot detect RV drifts caused by instrumental temperature drifts for ESPRESSO or CARMENES. These variations, if present in the raw data, are likely successfully corrected by the simultaneous calibration. \subsection{Stellar activity}\label{analysis_stellar} Stellar activity is one of the biggest causes of false positive detections of exoplanets when using RVs. Therefore we performed the analysis of stellar activity before we search for candidate planetary signals. Based on the $\log_{10}\rm R'_{HK}$ vs P$_{Rot}$ relationship of \citet{Masca2018}, we predict a rotation period of 130 $\pm$ 30 days. The GLS periodogram of FWHM and SNO V-band photometry time series shows an indication of periodicity at a period consistent with the suspected rotation period (Fig.~\ref{fwhm_det} and ~\ref{sno_fwhm_gp}). Using this information, we analysed our activity indicators using the Gaussian processes framework (GP; see \citealt{Rasmussen2006} and \citealt{Roberts2012}). The GP framework has become one of the most successful methods in the analysis of stellar activity in RV time series (e.g. \citealt{Haywood2014}). The stellar noise is described by a covariance with a prescribed functional form and the parameters attempt to describe the physical phenomena to be modelled. The GP framework can be used to characterise the activity signal without requiring a detailed knowledge of the distribution of active regions on the stellar surface, their lifetime, or their temperature contrast. One of the biggest advantage of GPs is that they are flexible enough to effortlessly model quasi-periodic signals, and account for changes in the amplitude, phase, or even small changes in the period of the signal. This flexibility is also one of their biggest drawbacks, as they can easily overfit the data, suppressing potential planetary signals. There have been significant efforts in recent years to better constrain the GP models to the measurements of the variability seen in the activity indicators. Simple approaches include training them with photometric data or activity indicators (e.g. \citealt{Haywood2014}) or simultaneous modelling of the activity proxies and the radial velocity with shared hyper parameters (e.g. \citealt{Masca2020} or \citealt{Faria2022}). These approaches constrain the covariance matrix used for the RV by using the activity indicators, but still lead to an `independent' fit of the RV data. A more sophisticated approach is the use of multi-dimensional GPs, which join the fit of all time series under a single covariance matrix (e.g. \citealt{Rajpaul2015}, \citealt{Barragan2022} or \citealt{Delisle2022}), better linking them to each other. The usual assumption is that there exists an underlying function governing the behaviour of the stellar activity, $G(t)$, that manifests in each time series as a linear combination of itself and its gradient, $G'(t)$, with a set of amplitudes for each time series (TS), following the idea of the $FF'$ formalism \citep{Aigrain2012}, as described in equation~\ref{eq_gp_grad}). \begin{equation} \label{eq_gp_grad} \begin{split} &\Delta ~TS_{1} = A_{1} \cdot G(t) + B_{1} \cdot G'(t)~, \\ &\Delta ~TS_{2} = A_{2} \cdot G(t) + B_{2} \cdot G'(t)~, \\ &... \end{split} \end{equation} \noindent \citet{Masca2020} showed that in the case of Proxima there was a very good correlation between the FWHM of the CCF and the activity-induced RV signal, making these approach very compelling to study the activity signal of other mid- to late-type M-dwarfs, such as GJ~1002. We used the newly presented \texttt{S+LEAF} code \citep{Delisle2022}, which extends the formalism of semi-separable matrices introduced with \texttt{celerite} \citep{Foreman-Mackey2017} to allow for fast evaluation of GP models even in the case of large datasets. The \texttt{S+LEAF} code allows to fit simultaneously a GP to several time series, based on a linear combination of the GP and its derivative, with different amplitudes for each time series (see equation~\ref{eq_gp_grad}). The \texttt{S+LEAF} code supports a wide variety of GP kernels with fairly different properties. After testing several options we opted for using a combination of two simple harmonic oscillators (SHO) at the rotation period and its second harmonic. See section~\ref{testing} for more details on the alternatives tested. The selected Kernel is defined as: \begin{equation} \label{act_model} \begin{split} \fontsize{8}{11}\selectfont k(\tau) = k_{\rm SHO ~\rm 1}(\tau, P_{1}, S_{1}, Q_{1}) + k_{\rm SHO ~\rm 2}(\tau, P_{2}, S_{2}, Q_{2}) ~, \end{split} \end{equation} \noindent with $\tau = t - t'$, representing the time-lag between measurements. Following equation~\ref{eq_gp_grad}, the activity induced signal in every specific time series is: \begin{equation} \label{full_gp_model} \begin{split} \Delta ~TS = A_{11} \cdot G_{\rm SHO ~\rm 1} + A_{12} \cdot G'_{\rm SHO ~\rm 1} \\ + A_{21} \cdot G_{\rm SHO ~\rm 2} + A_{22} \cdot G'_{\rm SHO ~\rm 2} ~, \end{split} \end{equation} \noindent where $G_{SHO}$ is the realisation of a GP with kernel $k_{SHO}$ and $G'$ is its first derivative. Following \citet{Foreman-Mackey2017}, the $k_{SHO}$ kernel is defined as: \begin{equation} \label{eq_sho} \fontsize{8}{11}\selectfont k_{i}(\tau) = {C_{i}^{2}} e^{-\tau/L} \left\{\begin{array}{cc}\cosh(\eta {2 \pi \tau}/P_{i})+{{P_{i}}\over{2 \pi \eta L }}\sinh(\eta {2 \pi \tau}/P_{i}) ; ~\rm if ~P_{i} > 2 \pi L\\2 (1 + {{2 \pi \tau}\over{P_{i}}}) ; ~\rm if ~P_{i} = 2\pi L\\ \cos(\eta {2 \pi \tau}/P_{i}) + {{P_{i}}\over{2 \pi \eta L}} \sin(\eta {2 \pi \tau}/P_{i}); ~\rm if ~P_{i} < 2 \pi L\end{array}\right\}~, \end{equation} \noindent with $\eta = (1 - (2L/P_{i})^{-2})^{1/2}$, controlling the damping of the oscillator. This Kernel has a power spectrum density: \begin{equation} \label{psd_kernel} S(\omega) = \sqrt {{2} \over {\pi}} {{S_{i} ~\omega_{i}^{4}} \over {(\omega^{2} - \omega_{i}^{2})^2 + \omega_{i}^{2}~\omega^{2} / Q^{2}}}~, \end{equation} \noindent where $\omega$ is the angular frequency, $\omega_{i}$ is the undamped angular frequency for each component ($\omega_{i}$ = 2 $\pi$ / $P_{i}$), $S_{i}$ is the power at $\omega$ = $\omega_{i}$ for each component, and $Q_{i}$ is the quality factor. $S_{i}$, $P_{i}$ and $Q_{i}$ are the parameters sampled in the covariance matrix, which are related to the amplitude ($C_{i}$), rotation period ($P_{rot}$) and timescale of evolution ($L$) in the following way: \begin{equation} \label{eq_params} \begin{split} &P_{1} = P_{rot} ~,~ S_{1} = {{C_{1}} \over {2 \cdot L}} \left( {{P_{1}} \over {\pi}} \right)^{2} ~,~ Q_{1} = {\pi {L}\over{P_{1}}}~,~ \\ &P_{2} = {{P_{rot}}\over{2}} ~,~ S_{2} = {{C_{2}} \over {2 \cdot L}} \left( {{P_{2}} \over {\pi}} \right)^{2} ~,~ Q_{2} = {\pi {L}\over{P_{2}}}~. \end{split} \end{equation} \noindent The covariance matrix also includes a term of uncorrelated noise ($\sigma$), independent for every instrument, added in quadrature to the diagonal of the covariance matrix to account for all unmodelled noise components, such as uncorrected activity or instrumental instabilities. The amplitudes $C_{i}$ in equations~\ref{eq_sho} and \ref{eq_params} are related to the amplitude of the underlying function, not to any of the specific time series. These amplitudes are degenerate with the amplitudes of each time series. We opted to fix S$_{1}$ and S$_{2}$ to 1, which fixes their power at $\omega$ = 0. The amplitudes of every component will be governed by the parameters A$_{ij}$ shown in equation~\ref{full_gp_model}. We performed the analysis of the FWHM and SNO V-band photometry using the suspected rotation period as prior information. \citet{Giles2017} showed that the timescale of evolution of signals in Kepler stars is typically between one and two rotations, sometimes longer for M-dwarfs. We also include this knowledge as prior information, using a log-scale to allow for a long tail to long timescales of persistence of the signals. We use log-normal priors for the amplitudes and jitter terms, centred on $\sim$ln(RMS) of the data and with a sigma of $\sim$ln(RMS) of the data. When using a GP with a completely free amplitude and jitter parameters, on data that includes multiple signals, there is a large risk of the GP absorbing all variations present in the data. Constraining the parameters in this way ensures a smooth GP model, preventing it from overfitting variations at short timescales without fully excluding any region of the parameter space. We modelled the data using Bayesian inference via nested sampling \citep{Skilling2004}. This allows for an efficient exploration of large parameter spaces, as well as to obtain the Bayesian evidence of the model (i.e. marginal likelihood, lnZ). We used the code \texttt{Dynesty}~\citep{Speagle2020}. \texttt{Dynesty} employs multi-ellipsoidal decomposition \citep{Feroz2009} to more efficiently sample large prior volumes. We used the default configuration, which uses a random walk or random slice \citep{Handley2015a,Handley2015b} sampling strategy depending on the number of free parameters. We set the number of live points equal to $N_{\rm Par}$~$\cdot$~($N_{\rm Par}$+1)/2, and the number of slices equal to 3~$\cdot$~$N_{\rm Par}$ , with $N_{\rm Par}$ being the number of free parameters of the model. We find a good solution for the FWHM and SNO data, with a rotation period of 103$^{+30}_{-9}$ and 128$^{+22}_{-19}$ days, respectively. The measured timescales of evolution are 350$^{+400}_{-190}$ and 185$^{+340}_{-108}$ days, respectively. Both indicators seem to have trouble properly constraining the timescale of evolution. In the case of the FWHM, the low precision of the CARMENES FWHM limits the amount of information that can be extracted. The SNO data do not have the baseline to properly constrain the activity timescales. However, it shows that it has to be longer than $\sim$ 90 days. Figure~\ref{sno_fwhm_gp} shows the best fits to the FWHM and SNO data. The analysis supports a rotation period longer than 100 days. We did not find indications of stellar activity variations at different timescales other than the suspected rotation period or its second harmonic. \begin{figure*}[ht] \includegraphics[width=18cm]{ANALYSIS/ACTIVITY/SNO_DATA_MODEL.pdf} \includegraphics[width=18.5cm]{ANALYSIS/ACTIVITY/FWHM_DATA_MODEL_0P.pdf} \caption{Data for the star GJ~1002, combining ESPRESSO and CARMENES spectroscopy, and SNO V-band photometry. The four upper panels include the V-band photometry data with the best model fit (top left), the periodogram of the data (top right), the residuals after the fit (bottom left) and the periodogram of the residuals. The four lower panels include the FWHM data of ESPRESSO (teal symbols) and CARMENES (purple symbols) with the best model fit (top left), a zoom to the last ESPRESSO campaign (top right), the residuals after the fit (bottom left) and the periodogram of the residuals. The computation of the periodogram uses the offsets and the jitters estimated for model 0-Planets in table~\ref{parameters_1}.} \label{sno_fwhm_gp} \end{figure*} We tested a model including FWHM and RV simultaneously, using the same GP model described before. The combined model converges to a rotation period of 120 $\pm$ 12 days with a timescale of evolution of 81$^{+47}_{-32}$ days, consistent with one rotation. The activity parameters are much better constrained after including the RV in the analysis. The models has a measured lnZ of --784.3 $\pm$ 0.4. The residuals after the fit of the RV show an RMS of 1.7 m~s$^{-1}$ (0.9 m~s$^{-1}$ for ESPRESSO), which in principle cannot be accounted for by the uncertainties of the data, and their periodogram shows the presence of 2 periodic signals with false alarm probabilities lower than 1\%, at periods of 10.4 and 21.2 days. As we do not have hints of activity at these timescales, we consider these two signals to be candidate planetary signals. Figure~\ref{model_rv_0p} shows the model in FWHM and RV, the residuals after the fit for the RV, and their GLS periodogram. Table~\ref{parameters_1} shows the priors used and the parameters measured (column labelled as `0 Planets'). \begin{figure*}[ht] \includegraphics[width=18cm]{ANALYSIS/RV/RV_DATA_MODEL_0P.pdf} \caption{Activity-only model. \textit{Top panels}: Combined FWHM time series of ESPRESSO and CARMENES with the best fit model. The right panel shows a zoom to the latest ESPRESSO campaign. \textit{Middle panels}: Combined RV time series of ESPRESSO and CARMENES with the best fit activity-only model. \textit{Bottom panels}: Residuals after the activity-only fit of the RV time series of ESPRESSO and CARMENES. The right panel shows the GLS periodogram of the residuals. The computation of the periodogram uses the offsets and the jitters estimated for model 0-Planets in table~\ref{parameters_1}.} \label{model_rv_0p} \end{figure*} \subsection{Candidate planetary signals}\label{analysis_planets} Following the information given by the periodogram of the residuals in Figure~\ref{model_rv_0p}, we included a sinusoidal signal at a period of 21.2 days. We used a normal prior at 21.2 $\pm$ 4.2 days for the period (20\% of the period for the 1-sigma range), with the time of conjunction parameterised as a phase centred around the mid-point of the observational baseline ($\phi$, $\mathcal{U}$ [0,1]; $T_{0}$ = 8590.096 + $P_{orb} \cdot \phi$), and a uniform prior for the amplitude in the range of 0 -- 10 m~s$^{-1}$. We obtain a fit for a signal with an amplitude of 1.2 $\pm$ 0.2 m~s$^{-1}$. The model has a measured lnZ of --776.9 $\pm$ 0.4. This corresponds to a $\Delta$ lnZ of +7.4 with respect to the 'activity-only' model, which corresponds to a 0.05\% false alarm probability for the more complex model. The activity model in RV changes from the previous iteration, with some of the variations previously attributed to the GP-model being now attributed to the sinusoidal motion. The model of the FWHM does not significantly change by including the sinusoidal signal in the RV. The residuals after the fit in the RV still show an RMS of 1.7 m~s$^{-1}$ (0.9 m~s$^{-1}$ for ESPRESSO), and their periodogram shows a signal at a period of 10.4 days. Figure~\ref{model_rv_1p} shows the best fit to the data along with the residuals and their periodogram. Table~\ref{parameters_1} shows the priors used and the parameters measured (column `1 Planet (Circ)'). We tested for the possibility of the signal being eccentric by including a Keplerian model instead of the sinusoid (eq.~\ref{eq_kepler}). \begin{equation} \label{eq_kepler} y(t)=K \left(\cos(\eta+\omega) + e \ \cos(\omega)\right) \end{equation} \noindent where the true anomaly $\eta$ is related to the solution of the Kepler equation that depends on the orbital period of the planet $P_{\rm orb}$ and the orbital phase $\phi$. This phase corresponds to the periastron time, which depends on the mid-point transit time $T_{0}$, the argument of periastron $\omega$, and the eccentricity of the orbit $e$. We parameterise the eccentricity as $e = (\sqrt{e} ~\cos(\omega))^{2} + (\sqrt{e} ~\sin(\omega))^{2}$ and $\omega = \arctan2(\sqrt{e} ~sin(\omega),\sqrt{e} ~\cos(\omega))$. We then sample $\sqrt{e} ~cos(\omega)$ and $\sqrt{e} ~\sin(\omega)$ with normal priors of 0 $\pm$ 0.3. Eccentricity is typically overestimated in noisy data and datasets with unmodelled sources of variability \citep{Hara2019}. The parametrisation described above favours low eccentricities, expected for the periods of the planets. We measure a lnZ of --777.4 $\pm$ 0.4. This corresponds to a $\Delta$ lnZ of --0.5 with respect to the model using a sinusoidal functions, which favours the circular model. Table~\ref{parameters_1} shows the priors used and the parameters measured (column `1 Planet (Kep)). \begin{figure*}[ht] \includegraphics[width=18cm]{ANALYSIS/RV/RV_DATA_MODEL_1PC.pdf} \caption{One-planet model. \textit{Top panels}: Combined FWHM time series of ESPRESSO and CARMENES with the best fit model. The right panel shows a zoom to the latest ESPRESSO campaign. \textit{Middle panels}: Combined RV time series of ESPRESSO and CARMENES with the best fit of the GP+1p model. The red line shows the best combined model, while the grey line shows the stellar activity component. \textit{Bottom panels}: Residuals after the fit of the RV time series of ESPRESSO and CARMENES. The right panel shows the GLS periodogram of the residuals. The computation of the periodogram uses the offsets and the jitters estimated for model 1-Planet (Circ) in table~\ref{parameters_1}.} \label{model_rv_1p} \end{figure*} We included a second sinusoidal signal using a normal prior at 10.4 $\pm$ 2.1 days for the period, with the time of conjunction parameterised as a phase centred around the mid-point of the observational baseline ($\phi$, $\mathcal{U}$ [0,1]; $T_{0}$ = 8590.096 + $P_{orb} \cdot \phi$), and a uniform prior for the amplitude in the range of 0 -- 10 m~s$^{-1}$. We obtain now amplitudes of 1.32 $\pm$ 0.13 m~s$^{-1}$ for the signal at 10.35 days and 1.30 $\pm$ 0.13 m~s$^{-1}$ for the signal at 21.2 days, with well defined phases. The phase of the sinusoidal signal at 21.20 days remains unchanged. The shorter period signal converges to a period of 10.35 days. The model has a measured lnZ of --764.1 $\pm$ 0.4. This corresponds to a $\Delta$ lnZ of +12.8 with respect to the model using the GP and 1 sinusoid, which corresponds to a 0.0003\% false alarm probability for the more complex model, and a $\Delta$ lnZ of +20.2 against the activity-only model. The GP component remains very similar to the one obtained for the case with 1 sinusoidal, both in RV and FWHM. We measure a rotation period of 127 $\pm$ 15 days, which we adopt as final result. The residuals after the fit in the RV show an RMS of 1.3 m~s$^{-1}$ (0.4 m~s$^{-1}$ for ESPRESSO, 1.6 m~s$^{-1}$ for CARMENES), with no significant signals in their periodogram. Figure~\ref{model_rv_2p} shows the best fit to the data along with the residuals and their periodogram. Table~\ref{parameters_1} shows the priors used and the parameters measured (column `2 Planets (Circ)'). \begin{figure*} \includegraphics[width=18cm]{ANALYSIS/RV/RV_DATA_MODEL_2PC.pdf} \caption{Two-planet model. \textit{Top panels}: Combined FWHM time series of ESPRESSO and CARMENES with the best fit model. The right panel shows a zoom to the latest ESPRESSO campaign. \textit{Middle panels}: Combined RV time series of ESPRESSO and CARMENES with the best fit of the GP+2p model. The red line shows the best combined model, while the grey line shows the stellar activity component. \textit{Bottom panels}: Residuals after the fit of the RV time series of ESPRESSO and CARMENES. The right panel shows the GLS periodogram of the residuals. The computation of the periodogram uses the offsets and the jitters estimated for model 2-Planets (Circ) in table~\ref{parameters_1}.} \label{model_rv_2p} \end{figure*} We explored the possibility of additional signals being present in the data. Gaussian processes can in many situations suppress signals, in particular at low frequencies. We tested for the presence of a third sinusoidal signal, this time without prior information extracted from the periodograms. We perform two independent tests, one for periods between 22 and 100 days (between the outer sinusoidal and the rotation), and a second one for periods between 100 and 1000 days (longer than the rotation period). In both cases we defined log-uniform priors for the periods and uniform priors between 0 and 1 for the phase of the signal. We do not find any significant signal in the data. Every power excess in the posterior can be explained as artefacts of the sampling. We settled for two signals, with periods of 21.20 and 10.35 days. Finally, we tested for the possibility of the signals being eccentric by including two Keplerian models (eq.~\ref{eq_kepler}). We measure a lnZ of --764.5 $\pm$ 0.4. This corresponds to a $\Delta$ lnZ of --0.3 with respect to the model using sinusoidal functions, which favours the circular model. We measure eccentricities of 0.064$^{0.096}_{-0.047}$ for the 21.2-day signal and 0.046$^{0.078}_{-0.035}$ for the 10.35-day signal, consistent with circular in both cases. The periods, amplitudes and times of conjunction of both planets remain consistent with the circular solution. Table~\ref{parameters_1} shows the priors used and the parameters measured (column `2 Planets (Kep)'). Given the low eccentricities measured (consistent with zero in both cases) we adopted the model with two circular orbits as our definitive model. We significantly detect the presence of two signals, one with a period of 10.3461$^{ 0.0027}_{-0.0025}$ days, a semi-amplitude of 1.30 $\pm$ 0.14 m~s$^{-1}$ and a $T_{0}$ of 2459566.17 $\pm$ 0.15 d, the other with a period of 21.202$\pm$ 0.013 days, a semi-amplitude of 1.30 $\pm$ 0.14 m~s$^{-1}$ and a $T_{0}$ of 2459560.78 $\pm$ 0.43 d. Figure~\ref{phase_fold} shows the phase folded plots of the two signals, after subtracting the activity model and the other signals, along with the phase folded residuals. We do not identify any structure in the residuals. Figure~\ref{posterior_2pc} shows the posterior distribution of all the parameters sampled in our favoured model. \begin{figure*}[ht] \includegraphics[width=18cm]{ANALYSIS/RV/RV_DATA_PHASE_2PC.pdf} \caption{Planetary signals. \textit{Top left panel}: RVs of GJ~1002 b phase folded with a period of 10.35 days, after subtracting the activity model and the signal at 21.2 days. \textit{Top right panel}: RVs of GJ~1002 b phase folded with a period of 21.2 days, after subtracting the activity model and the signal at 10.335 days. \textit{Bottom panels}: Corresponding phase folded residuals.} \label{phase_fold} \end{figure*} Additionally, we performed a blind fit in which we used log-uniform priors for the planetary periods, with a range between 2 and 100 days. We recovered consistent results for all parameters, and a $\Delta$ lnZ of +18 with respect to the activity-only model. The larger prior volume required a 4 times larger number of live points for a complete exploration of the parameter space and a much longer computing time. Taking advantage of the results of the blind fit, and to further test the presence of the planets, we assessed their significance with their False inclusion probability (FIP) \citep{hara2022a}, which has been shown to be an optimal exoplanet detection criterion \citep{hara2022b}. We consider a grid of frequency intervals, The element $k$ of the grid is defined as $[\omega_k - \Delta \omega/2, \omega_k + \Delta \omega/2]$, where $ \Delta \omega = 2\pi/T_\mathrm{obs}$, $T_\mathrm{obs}$ is the total observation time span, and $ \omega_k = k\Delta \omega / N_\mathrm{oversampling}$. We take $N_\mathrm{oversampling} = 5$. For each index $k$, we compute the posterior probability to have a planet with an orbital frequency in the interval $[\omega_k - \Delta \omega/2, \omega_k + \Delta \omega/2]$, or true inclusion probability (TIP), and compute FIP = 1-TIP. In Fig.~\ref{fip_tip}, we represent $-\log_{10} \rm FIP$ as a function of the interval centre. The data show two peaks corresponding to the probability of presence of a planet in the intervals $[2\pi / 10.341, 2\pi / 10.356]$ and $[2\pi / 21.187, 2\pi / 21.236]$ with probabilities $\textgreater$ 99.99\% and $\textgreater$ 99.7\% respectively. \begin{figure}[ht] \includegraphics[width=9cm]{ANALYSIS/RV/FIP_TIP.pdf} \caption{FIP periodogram of the data of GJ~1002. The periods of the peaks are indicated in red points, the $- \rm log_{10} FIP$ and $\rm log_{10} TIP$ are represented as a function of the centre of the period interval considered, in blue and orange respectively. The green dashed line shows the 1\% FIP threshold.} \label{fip_tip} \end{figure} \subsection{ESPRESSO and CARMENES} The ESPRESSO and CARMENES data were taken over significantly different periods. Most of the CARMENES data were taken during 2017 and 2018, while most of the ESPRESSO data were taken during 2020 and 2021. If the signals were due to activity, these datasets could show different amplitudes and/or phases. We repeated the analysis by splitting the data in two subsets, one with only ESPRESSO RVs and FWHMs and one with only CARMENES RVs and FWHMs. The lower information content of the independent datasets forced us to consider narrower priors for the periods, of 21.2 $\pm$ 2.1 and 10.4 $\pm$ 1.0. We obtained very similar results with both instruments as with the combined dataset, although with less significant detections. Figure~\ref{esp_car0} shows a summary of the periodogram analysis performed on the dataset of each instrument. In both cases we obtain strong hints of the presence of the planets. When performing the Bayesian analysis we find that, for both subsets of data, the 2-planet model is significantly favoured over their respective activity-only model. The parameters obtained for the 2-planet model show good consistency between the combined model, the ESPRESSO-only model and the CARMENES-only model. Figure~\ref{esp_car} shows the amplitude versus phase plots of both sinusoidal signals for the ESPRESSO and CARMENES datasets, and for the combined dataset. Additionally we extracted the ESPRESSO RVs using the \texttt{S-BART} algorithm \citep{Silva2022} and repeated the ESPRESSO-only analysis. The results were consistent with those of the \texttt{SERVAL} RVs. The parameters obtained in the three datasets are consistent within their error bars. The parameters obtained with the ESPRESSO data are much more precise, dominating the combined fit, but are in all cases within 1$\sigma$ of the parameters derived from the CARMENES data. In spite of the higher quality of the ESPRESSO data, the signals are easier to detect in the periodograms of the CARMENES dataset. The signal caused by the stellar rotation shows a smaller amplitude in the CARMENES data, as expected because of its redder spectral range, making it less prominent with respect to the planetary signals. The global analysis partially circumvents this problem by including a simultaneous fit of the stellar activity component. The observation cadence of the CARMENES campaign is also more appropriate for the detection of short period signals, with a typical spacing between observations (within a campaign) of 2 days, compared to 5 days for the ESPRESSO campaigns. On average, the CARMENES observations sample the shortest planetary signals 5 times per orbit, while the ESPRESSO data sample it 2 times per orbit. The effect of the lower cadence can be seen in Figure~\ref{phase_fold}, where there ESPRESSO data still show some gaps in their phase coverage. \begin{figure*}[ht] \includegraphics[width=18cm]{ANALYSIS/ORIGIN/RV_DATA_PL_2PC_ESP.pdf} \caption{Summary of the periodogram analysis of the independent ESPRESSO and CARMENES datasets. \textit{Top panels}: Raw RVs with the best fit activity model (red line) for ESPRESSO (left) and CARMENES (right), and their respective periodograms. The shaded red region highlights the period interval of the measured stellar rotation. \textit{Middle panels}: RVs, after subtracting the activity model, with the best fit planetary model (red line) for ESPRESSO (left) and CARMENES (right), and their respective periodograms. The shaded green lines highlight the position of the planetary signals identified in the combined analysis. \textit{Bottom panels}: Residual RVs after the best fit (red line) for ESPRESSO (left) and CARMENES (right), and their respective periodograms.} \label{esp_car0} \end{figure*} \begin{figure}[ht] \includegraphics[width=9cm]{ANALYSIS/ORIGIN/ESP_CAR.pdf} \caption{Amplitude versus phase of the two candidate planetary signals for the ESPRESSO, CARMENES and combined dataset.} \label{esp_car} \end{figure} \subsection{Alternative activity models} We significantly detected the presence of two planetary signals. Since no activity signals are detected at their periods, and considering the low activity of the star, it seems unlikely that the signals are due to stellar activity. However, it is possible that an incorrect activity model could leave some of the harmonic components of the activity signal unmodelled, or could create artefacts at periods shorter than the stellar rotation. To double-check whether or not the detected signals could be caused by the activity modelling, we repeated the process with several other GP kernels. We tested the Mat\'ern 3/2 exponential periodic (MEP) and exponential-sine periodic (ESP) kernels, provided by the \texttt{S+LEAF} package. These two kernels are approximations of the classical quasi-periodic GP Kernel \citep{Haywood2014}. This approach, as our main one, works on a multi-series GP building an activity model as a linear combination of the GP and its derivative. We also analysed the data using a GP modelling without the derivative. We used the double SHO and the pseudo quasi-periodic kernel with a component at half the rotation period (PQP2) \citep{Masca2021}, built using the \texttt{celerite2} package, and the quasi-periodic Kernel, built using the \texttt{GEORGE} package \citep{Foreman-Mackey2014}. In all cases we analysed the data with and without simultaneous modelling of the FWHM. Lastly, we re-analysed the data using a simpler model for the stellar activity, based on two sinusouds at the rotation period and its second harmonic. We did not obtain significantly different results with any of the algorithms tested. All the models provided significant detections and consistent parameters for the two candidate planetary signals, although with different noise levels and uncertainties. After all our tests we find it unlikely that the detected signals are unmodelled harmonics of the rotation or artefacts of the modelling process. \subsection{Stability of the signals} \label{testing} Keplerian signals are expected to be stable in RV datasets, while activity signals are not, due to their lack of long-term coherency, \citep{Mortier2017, Masca2018a}. We study the behaviour of our two detected signals as a function of the number of measurements and follow the evolution of their significance and measured parameters. If the signals correspond to planets, we expect a steady increase in the significance of the detection ($\Delta$ lnZ of the 2-planet model vs an activity-only model), and their parameters to converge towards the final value and remain stable once we reach sufficiently high signal to noise ratio. While this method is based on the intrinsic differences between planetary signals and stellar activity, it has to be noted that the evolution of all the measured parameters is also affected by extrinsic phenomena such as observation cadence and by the quality of the data. Stellar activity can also have a non-negligible effect on the parameters of planetary signals, by increasing the noise levels or affecting the fit if the activity and planetary amplitudes are similar. Adding new instruments can also reduce the significance when needing to fit for the offset and jitter values with very few points. Figure~\ref{signals_evol}, top panel, shows the evolution of the Bayesian evidence of the two-planet model against an activity-only model, as we include more data in order of time. Once the signals are detected (at $\sim$ 80 measurements), the evolution of the significance of the model is very steady, suggesting that the two sinusoidal signals do not have their origin in stellar activity. On a similar note, their parameters (semi-amplitude, period and phase; Fig~\ref{signals_evol}, bottom panels) evolve smoothly towards their final value, showing very little variation after $\sim$ 100 measurements. There are some anti-correlated variations between both amplitudes (within the 1$\sigma$ range) that are most likely caused by the coupling of their near-resonance periods and the observational cadence. It is important to note that the only campaign with sufficiently high cadence to separate both signals in a straightforward way was the latest 2021 ESPRESSO campaign. The steady evolution of the significance and the stability of the recovered parameters support a planetary origin for the two signals. \begin{figure}[ht] \includegraphics[width=9cm]{ANALYSIS/ORIGIN/PLANET_PARAMS_EVOL.pdf} \caption{Signal stability test. \textit{Top panel}: Evolution of the difference in Bayesian evidence ($\Delta$ lnZ) of the 2-planet model against an activity-only model. \textit{Bottom panels}: Evolution of the parameters of the two sinusoids. The colours of the points show which data are added at each step.} \label{signals_evol} \end{figure} Our tests show the two signals to be stable over long periods of time and to be independent of the analysis procedure. Our previous analysis of stellar activity provided a good characterisation of the stellar signals present in the data, which was perfectly consistent with typical activity-rotation relationships, and showed no short period activity signals close to the planetary signals. With this information, we conclude that the signals at 10.35 and 21.2 days are indeed most likely induced by low-mass planets orbiting the star. \section{Discussion} \subsection{Planetary system} We detected the significant presence of two planetary signals. GJ~1002 b has an orbital period of 10.3461$^{ 0.0027}_{-0.0025}$ and its RV signal has a semi amplitude of 1.32 $\pm$ 0.13 m~s$^{-1}$. These values correspond to a planet with a minimum mass of 1.09 $\pm$ 0.13 M$_{\oplus}$ orbiting at a distance of 0.0457 $\pm$ 0.0013 au of its parent star. GJ~1002 c has an orbital period of 21.202$\pm$ 0.013 days and its RV signal has a semi amplitude of 1.30 $\pm$ 0.13 m~s$^{-1}$. These values correspond to a planet with a minimum mass of 1.36 $\pm$ 0.16 M$_{\oplus}$ orbiting at a distance of 0.0738 $\pm$ 0.0021 au of its parent star. Using the ephemeris derived from the RV analysis, we performed an informed transit search in the \textit{TESS} light curve. Our results predict two potential transit events of GJ~1002 b and no transit for GJ~1002 c. We did not detect any transit event in the TESS data. Assuming a planet radius of $\sim$ 1.1 R$_{\oplus}$ for GJ~1002 b, the expected transit depth would be of $\sim$ 5 ppt. The dispersion of the light curve excludes a transit event. We cannot derive strong limits for the inclination of the system with respect to the line of sight, as only planets orbiting with an inclination $i$ > 89.2$^\circ$ are expected to transit at the orbital distance of GJ~1002 b. Following \citet{Kopparapu2017} we estimate that both planets lie within the HZ of the star (see Sect.~\ref{stellar_params}). GJ~1002 b receives an incident flux S $\sim$ 0.67 $F_{\oplus}$ and GJ~1002 c receives S $\sim$ 0.26 $F_{\oplus}$. With these values of incident flux, both planets are comfortably within the conservative HZ for their star \citep{Kopparapu2017}. We also estimate their equilibrium temperature, assuming an albedo of 0.3. We calculate equilibrium temperatures of 230.9 K for GJ~1002 b and 181.7 K for GJ~1002 c, slightly cooler than Earth and Mars, respectively. Table~\ref{param_planets} summarises the parameters of both planets and Fig.~\ref{posterior_2pc} shows the posterior distribution obtained for the planet parameters in the model with two circular orbits. With GJ~1002 located at just 4.84 pc from the Sun, it is one of the closest known multi-planetary systems hosting temperate Earth-mass exoplanets. GJ~1002 joins Proxima \citep{AngladaEscude2016}, Ross 128 \citep{Bonfils2018}, GJ 1061 \citep{Dreizler2020} and Teegarden's star \citep{Zechmeister2019} as systems with planets that could potentially host habitable environments within 5 pc. Figure~\ref{habit} shows the configuration of the system, with respect to the limits of the HZ. It should be noted that it is not fully clear whether low-mass M-dwarfs can host habitable planets. They produce frequent and intense flares during their pre-main sequence evolution and well into their journey through the main sequence (e.g \citealt{Davenport2016}), and have very low quiescent stellar fluxes. It has been suggested that the intense flare activity could strip the planets from their atmosphere, preventing the development of life (e.g \citealt{Howard2018}). It is also possible that planets in their habitable zone do not receive enough ultra-violet radiation to start life via photochemistry. However, the energy received via strong flaring during the early age of the star might be sufficient to build up the prebiotic inventory. It might also not be too much of a problem for the continuation of life if the energy of those flares decreases significantly with age \citep{Rimmer2018}. Given its mass, it is expected that GJ~1002 showed an intense flaring activity during its youth and rotational breaking phase \citep{Mondrik2019}, but that activity seems to have ceased long ago, as \textit{TESS} observed no flares. GJ~1002 also shows very weak X-ray emission, compared to other low-mass M-dwarfs \citep{SchmittLiefke2004}. If its presumed past activity was strong enough to trigger photochemistry on the surface of its planets, its current gentle activity could be low enough to not threaten the stability of RNA strands. \begin{table} \begin{center} \caption{Parameters of the two planets detected orbiting GJ~1002 using under the assumption of circular orbits \label{param_planets}} \begin{tabular}[centre]{l c c} \hline Parameter & GJ~1002 b & GJ~1002 c \\ \hline $T_{0}$ -- 2450000 [d] & 8583.27 $\pm$ 0.22 & 8585.54 $\pm$ 0.50 \\ $P_{\rm orb}$ [d] & 10.3465 $\pm$ 0.027 & 21.202 $\pm$ 0.013 \\ $K_p$ [m~s$^{-1}$] & 1.31 $\pm$ 0.14 & 1.30 $\pm$ 0.14\\ $m_p \sin i $ [M$\oplus$] & 1.08 $\pm$ 0.13 & 1.36 $\pm$ 0.17\\ $a$ [au] & 0.0457 $\pm$ 0.0013 & 0.0738 $\pm$ 0.0021\\ Incident flux [$F_{\oplus}$] & 0.670 $\pm$ 0.039 & 0.257 $\pm$ 0.015 \\ Eq. Temp.$_{A = 0.3}$ [K] & 230.9 $\pm$ 6.7 & 181.7 $\pm$ 5.2 \\ \hline \end{tabular} \end{center} \end{table} \begin{figure*}[ht] \includegraphics[width=18cm]{DISCUSSION/POSTERIOR_2PC_PL.pdf} \caption{Posterior distribution (green line) of the planetary parameters sampled in the favoured model in section~\ref{analysis_planets}, along with their derived parameters. The red line shows the distribution of priors.} \label{posterior_pl} \end{figure*} \begin{figure*}[ht] \includegraphics[width=18cm]{DISCUSSION/HAB.pdf} \caption{Position of the planets detected orbiting GJ~1002, with respect of the limits of the HZ. The orange and yellow region show the HZ for dry worlds \citep{Zsom2013}, while the green region shows the HZ for wet worlds \citep{Kopparapu2017}. The red and blue regions show the regions in which it would be too hot or two cold.} \label{habit} \end{figure*} \subsection{Prospects for atmospheric characterisation} Atmospheric characterisation of exoplanets is typically performed via transmission spectroscopy, which requires the planets to transit. However, that is not the only possibility to study the atmospheres of exoplanets. In recent years it has been proposed that coupling high-resolution spectrographs with high angular resolution imaging could open an alternative path to studying the atmospheres of the planets in the solar neighbourhood \citep{Lovis2017}. In the coming years, RISTRETTO, a proposed visitor instrument for the VLT, will enable the possibility of performing high dispersion coronagraphy (HDC) spectroscopy of exoplanets, which is expected to allow the study of exoplanet atmospheres at contrasts of 10$^{-7}$ at angular distances of 2 times wavelength over telescope diameter ($2~\lambda/D$) \citep{Blind2022}. The aim is to detect the oxygen band at 760 nm, where the VLT angular distance $2~\lambda/D$ is 37 mas. RISTRETTO will serve as a proof of concept for ANDES \citep{Marconi2021}, the high-resolution spectograph for the ELT. ANDES will be a R$\sim$ 100~000 stabilised \'Echelle spectrograph with a wavelength coverage of at least 400 -- 1800 nm. It will include an integral field unit fed by a single-conjugate adaptive optics (SCAO) module in the NIR part of the spectrograph (950 -- 1800 nm) to correct for the blurring effect of turbulence in the atmosphere\footnote{https://elt.eso.org/instrument/ANDES/}. It is expected to perform HDC spectroscopy of exoplanets, as RISTRETTO, with the goal of detecting biomarkers. An examples of those biomarkers is the oxygen band at 1300 nm. The angular separation of the orbits of GJ~1002 b and c are $\sim$ 9.7 mas and $\sim$ 15.7 mas, respectively. Following \citet{Lovis2017} we estimate the planet-star flux ratio to be 10$^{-7}$ and 7 $\cdot$ 10$^{-8}$, respectively. The distance $2~\lambda/D$ for the ELT at 1300 nm is $\sim$ 13.7 mas (GJ~1002 c within reach). Using ANDES, it should be possible to probe the presence an atmosphere on the outer planet and test the presence of oxygen in its atmospheres. Another possible path to study their atmospheres is the measurement of their thermal emission. LIFE \citep{Quanz2022} is a proposed mid-infrared nulling interferometry space mission designed to measure the thermal emission of exoplanets. It is expected to consist in four 2-metre apertures working in the 4--15.5~$\mu$ wavelength range. With incident fluxes of 0.67 and 0.257 $F_{\oplus}$, and expected radii of 1--1.5~$R_{\oplus}$, both planets of GJ~1002 fall within the range the mission expects to study \citep{Quanz2022}. \subsection{Detection limits for additional companions} We detected the presence of two Earth-mass planets orbiting GJ~1002. However, that does not mean there are no other planets orbiting GJ~1002. The quality of the data, observation strategy, activity of the star and activity modelling all affect our detection sensitivity. We estimate our detection limits for additional companions by performing a simple injection-recovery test. We construct activity-only RVs by subtracting the two planetary signals from figure~\ref{phase_fold}. We then inject 100,000 random sinusoidal signals with periods between 1 and 1000 days, amplitudes between 1 cm~s$^{-1}$ and 10 m~s$^{-1}$, and random phases. We reject those combinations that would create an RMS of the data higher than the real RMS of our data. Then we subtract the stellar activity using the same GP hyper-parameters as measured for our 2-planet model, but recomputing the activity model for each specific dataset. Then we generate the periodogram of the residuals and check the false alarm probability of the highest peak at the injected period, in the same way we did for our original activity-only model (Fig.~\ref{model_rv_0p}). Figure~\ref{det_lims} show the result of this exercise. With our current dataset and activity model, we are sensitive to signals of $\sim$ 0.5 m~s$^{-1}$ for periods from 1.2 days up to $\sim$ 15 days. Our sensitivity drops to $\sim$ 1 m~s$^{-1}$ at $\sim$ 35 days and then quickly plummets to $\sim$ 2 m~s$^{-1}$ at periods longer than $\sim$ 40 days. These values correspond to masses of $\sim$0.5 M$_{\oplus}$ at 15 days, $\sim$1 M$_{\oplus}$ at 35 days and > 3 M$_{\oplus}$ at periods longer than 40 days. This is a typical effect of GP-only models, which try to account for all variations at low frequencies up to the characteristic value specified by the kernel. To extract possible low-amplitude signals at longer periods we would need either a very significant amount of new data or a different strategy to mitigate stellar activity. This also shows that finding the signals of GJ~1002 b and c in the periodogram of the residuals is within expectations. With these results, we do not expect to have missed any Earth-like planets in the HZ. The sensitivity that we achieve in our exercise is, for short periods, very close to the RV precision. To explore the region of lower mass planets at short orbits we anticipate a change in strategy would be necessary, very likely increasing the exposure time of the observations to reduce the photon noise uncertainty of the RV measurements, for what might be marginal gains. Exploring the range between 40-130 days would be a more interesting, and maybe less time-consuming, prospect. There is still plenty of room around GJ~1002 for additional Earth-like planets (or super-Earths). If they exist, these planets would also be prime targets for characterisation with future instruments, as GJ~1002 c. The \textit{Gaia} DR3 archive reports astrometric excess noise of 0.36 mas and a Renormalised Unit Weight Error (RUWE) of 1.33. The RUWE is expected to be around 1.0 for sources where the single-star model provides a good fit to the astrometric observations\footnote{https://gea.esac.esa.int/archive/documentation/}. The RUWE value, just below the threshold of 1.4 used by \citet{Arenou2022} for processing sources as non-single stars, could be due to an additional companion, unseen in the RV data. We calculated the sensitivity limits of the \textit{Gaia} DR3 astrometry for GJ~1002. Planetary companions in the range 1--10 M$_{\rm JUP}$ would produce a RUWE in excess of the measured value for periods in the range 0.5--10 yr (Figure~\ref{det_lims_gaia}). For edge-on orbits, and periods up to 8 years, this would correspond to RV signals significantly larger than what we expect to have missed (see. Fig~\ref{det_lims}), possibly pointing to a quasi-face-on orbital configuration for the companion, or an orbital period much larger than our baseline of observations. To characterise the full architecture of the planetary system of GJ~1002 it will be necessary to perform additional RV campaigns, with instruments such as ESPRESSO, Maroon-X \citep{Seifahrt2018}. These campaigns need to have their observing strategy tailored to better characterising the activity signal. Another option is to attempt them with NIR spectrographs such as NIRPS \citep{Bouchy2017, Wildi2017}, taking advantage of the expected chromatic behaviour of activity signals. Future astrometric measurements are necessary to establish the origin of the detected astrometric excess noise. \begin{figure}[ht] \includegraphics[width=9cm]{DISCUSSION/DET_LIMS_MS.pdf} \caption{Detection limits. \textit{Top panel}: Amplitude versus period diagram for our detection limits based on injection and recovery tests. The white region shows the signals that we would detect in a periodogram with 1$\%$ FAP. The blue region shows signals we would detect with a FAP lower than 1$\%$ FAP. With the current dataset and activity model, we would miss the red region signals. The top grey dashed line shows the maximum amplitudes that would still be compatible with the data. The bottom grey dashed line shows the minimum amplitude that we expect to detect with ESPRESSO data and the current exposure times. The orange circles show the position of the detected planets. \textit{Bottom panel}: Same as top panel but in mass versus period. } \label{det_lims} \end{figure} \begin{figure}[ht] \includegraphics[width=9cm]{DISCUSSION/GJ1002_Gaia_limits.png} \caption{Gaia DR3 sensitivity curves for the star. The curves correspond to a probability of 50\%, 95\% and 99\% of a companion of given mass and period to produce a RUWE larger than the observed one.} \label{det_lims_gaia} \end{figure} \subsection{Activity of GJ 1002} GJ~1002 is a low-activity M5.5V dwarf. We measure a rotation period of 126 $\pm$ 15 days, which is consistent with the typical rotation-activity relationships for M-dwarfs \citep{Masca2016, Masca2018}. The amplitude of the activity signal, as measured using a double-sinusoidal model (from Sect.~\ref{testing}) is $\sim$ 0.7 m~s$^{-1}$, which is also consistent with the amplitude-activity relationship of \citet{Masca2018}. We did not find evidence for the presence of a long-term cycle in our data. However, our dataset is not optimal for the detection of long-term cycles. Overall, GJ~1002 is a fairly typical low-activity fully convective M-dwarf. Its behaviour over a few years fits within the expectations based on its typical level of chromospheric activity and is not very different from other old M-dwarfs such as Barnard's star \citep{Toledo-Padron2019}. \subsection{Temperature of the optical elements and instrumental telemetry} Most spectrographs designed to obtain precise RVs are thermally and pressure stabilised. This stabilisation ensures that there are no large variations in the internal conditions of the spectrograph, which would otherwise create variations in the RV measurements. On top of that, most modern RV spectrographs use some form of simultaneous calibration which helps correcting the remaining RV variations due to remaining temperature changes. However, we have seen that even very small temperature changes of the optical elements can affect the instrumental profile and induce changes in some of the metrics typically used as activity indicators. We modelled the temperature effect by relating the FWHM and \'Echelle temperatures using a third order polynomial. We recovered parameters different from zero at a 1-4 $\sigma$ level, depending on the parameter and the instrument (See table~\ref{parameters_1} and figure~\ref{posterior_2pc}). We conclude that there is indeed a low-amplitude temperature effect that can easily pass unnoticed. These variations can then introduce parasitic signals in the time series that can be easily mistaken for stellar effects. We did not find similar variations in the RV time series of GJ~1002. We attempted to link the RV and \'Echelle temperatures in a similar way, but all parameters were consistent with zero for both instruments. However, it is not guaranteed that they will not be present in higher signal-to-noise datasets (brighter stars) or datasets showing a lower RV RMS. Most observatories and instruments save enough telemetry data to track these changes in the conditions of the instruments, but these data are rarely analysed (or at the very least this analysis is rarely reported). As we progress towards the detection of very low-mass planets, such as sub-Earths orbiting M-dwarfs, or the detection of Earth-mass planets orbiting solar-type stars, it is important to remember that ultra-stabilised spectrographs are not perfect spectrographs. To detect these planets, it is important to understand better the behaviour of the instrumentation. When the exoplanet community started to detect planets at 1 m~s$^{-1}$ amplitudes, some form of stellar activity analysis became a necessary step. If we aim to detect planets at 10 cm~s$^{-1}$, some form of instrumental telemetry analysis will very likely become unavoidable. \section{Conclusions} We studied the nearby M-dwarf GJ~1002 using RVs and activity indicators from ESPRESSO and CARMENES. Using a joint model that combined information from the FWHM of the CCF and RVs into a multi-series Gaussian process, we detected the presence of two planetary signals. GJ~1002 b has an orbital period of 10.3465$\pm$0.0027 days and a minimum mass of 1.08 $\pm$ 0.13 M$_{\oplus}$. GJ~1002 c has an orbital period of 21.202$\pm$ 0.013 days and a minimum mass of 1.36 $\pm$ 0.17 M$_{\oplus}$. With both planets orbiting within the HZ of their star, GJ~1002 becomes one of the nearby systems with planets that could potentially host habitable environments. We find a rotational modulation of 126 $\pm$ 15 days, consistent with the expectations from rotation-activity relationships, and no clear evidence for a long period modulation present in the FWHM or the RV time series. As with the case of other M-dwarfs, the FWHM seems to be a good activity indicator for tracking the rotational modulation of the star. We found that the multi-series GP approach provides good results at modelling the data, although the results were not easily distinguishable from a more typical GP modelling. We rule out the presence of additional companions with masses larger than 0.5 M$_{\oplus}$ at periods shorter than $\sim$ 20 days, and of companions with masses larger than 3 M$_{\oplus}$ at periods up to $\sim$ 50 days. It is still possible that there are additional Earth-mass planets in the outer half of the HZ. The \textit{Gaia} DR3 data show an excess astrometric noise, that could point to a massive companion at large orbital separation. GJ~1002 c is a good candidate for atmospheric characterisation via High Dispersion Coronagraphy spectroscopy with the future ANDES spectrograph for the ELT. The atmospheres of that planet should be observable around the oxygen absorption at 1300 nm. We found that long period variations in the temperature of the optical elements of ESPRESSO and CARMENES affect the measurements of the FWHM of the CCF, most likely by changing the instrumental profile. We do not find evidence that these temperature variations affect the RV measurements in our dataset. However, it is not guaranteed that this would be the case for all RV datasets. \section*{Acknowledgements} We want to thank the anonymous referee for their insightful comments, which helped improve the manuscript. We want to thank Ravi Kopparapu and Emily Gilbert for reaching out and highlighting an error in the limits of the habitable zone. ASM acknowledges financial support from the Spanish Ministry of Science and Innovation (MICINN) under 2018 Juan de la Cierva program IJC2018-035229-I. ASM, VMP, JIGH, CAP and RR acknowledge financial support from the Spanish MICINN project PID2020-117493GB-I00. ASM, VMP, JIGH and RR acknowledge financial support from the Government of the Canary Islands project ProID2020010129. J. P. F. is supported in the form of a work contract funded by national funds through FCT with reference DL 57/2016/CP1364/CT0005. CJM acknowledges FCT and POCH/FSE (EC) support through Investigador FCT Contract 2021.01214.CEECIND/CP1658/CT0001. This work was supported by FCT - Fundação para a Ciência e a Tecnologia through national funds and by FEDER through COMPETE2020 - Programa Operacional Competitividade e Internacionalização by these grants: UIDB/04434/2020; UIDP/04434/2020. A.M.S acknowledges support from the Fundação para a Ciência e a Tecnologia (FCT) through the Fellowship 2020.05387.BD. and POCH/FSE (EC). This work was supported by FCT - Fundação para a Ciência e a Tecnologia through national funds and by FEDER through COMPETE2020 - Programa Operacional Competitividade e Inter-nacionalização by these grants: UIDB/04434/2020; UIDP/04434/2020; PTDC/FIS-AST/32113/2017 \& POCI-01-0145-FEDER-032113; PTDC/FIS-AST/28953/2017 \& POCI-01-0145-FEDER-028953. The INAF authors acknowledge financial support of the Italian Ministry of Education, University, and Research with PRIN 201278X4FL and the "Progetti Premiali" funding scheme. JBD acknowledges financial support from the Swiss National Science Foundation (SNSF). This work has, in part, been carried out within the framework of the National Centre for Competence in Research PlanetS supported by SNSF. CARMENES is an instrument for the Centro Astronómico Hispano en Andaluc\'ia (CAHA) at Calar Alto (Almería, Spain), operated jointly by the Junta de Andaluc\'ia and the Instituto de Astrofísica de Andaluc\'ia (CSIC). CARMENES was funded by the Max-Planck-Gesellschaft (MPG), the Consejo Superior de Investigaciones Científicas (CSIC), the Ministerio de Economía y Competitividad (MINECO) and the European Regional Development Fund (ERDF) through projects FICTS-2011-02, ICTS-2017-07-CAHA-4, and CAHA16-CE-3978, and the members of the CARMENES Consortium (Max-Planck-Institut für Astronomie, Instituto de Astrofísica de Andaluc\'ia, Landessternwarte Königstuhl, Institut de Ciències de l’Espai, Institut für Astrophysik Göttingen, Universidad Complutense de Madrid, Thüringer Landessternwarte Tautenburg, Instituto de Astrofísica de Canarias, Hamburger Sternwarte, Centro de Astrobiología and Centro Astronómico Hispano en Andaluc\'ia), with additional contributions by the MINECO, the Deutsche Forschungsgemeinschaft through the Major Research Instrumentation Programme and Research Unit FOR2544 “Blue Planets around Red Stars”, the Klaus Tschira Stiftung, the states of Baden-Württemberg and Niedersachsen, and by the Junta de Andaluc\'ia. This work has made use of data from the European Space Agency (ESA) mission {\it Gaia} (\url{https://www.cosmos.esa.int/gaia}), processed by the {\it Gaia} Data Processing and Analysis Consortium (DPAC, \url{https://www.cosmos.esa.int/web/gaia/dpac/consortium}). Funding for the DPAC has been provided by national institutions, in particular the institutions participating in the {\it Gaia} Multilateral Agreement. Manuscript written using \texttt{Overleaf}. Main analysis performed in \texttt{Python3} \citep{Python3} running on \texttt{Ubuntu} \citep{Ubuntu} systems and \texttt{MS. Windows} running the \texttt{Windows subsystem for Linux (WLS)}. Radial velocities and selected activity indicators extracted with \texttt{SERVAL} \citep{Zechmeister2018}. Second RV extraction with \texttt{S-BART} \citep{Silva2022}. Extensive use of the DACE platform \footnote{https://dace.unige.ch/} Extensive usage of \texttt{Numpy} \citep{Numpy}. Extensive usage of \texttt{Scipy} \citep{Scipy}. All figures built with \texttt{Matplotlib} \citep{Matplotlib}. Periodograms and phase folded curves built using \texttt{Pyastronomy} \citep{pyastronomy}. Gaussian processes modelled with \texttt{S+LEAF} \citep{Delisle2022}, \texttt{Celerite2} \citep{Foreman-Mackey2017} and \texttt{George} \citep{Foreman-Mackey2013}. Nested sampling with \texttt{Dynesty} \citep{Speagle2020}. Selected operations accelerated with \texttt{Numba} \citep{Numba}. Keplerian function adapted from \texttt{Pytransit} \citep{Parviainen2015}. Selected calculations made in \texttt{Excel} \citep{Excel}. \textit{TESS} target pixel file plot done with \texttt{tpfplotter} \citep{Aller2020}. Aperture photometry performed with \texttt{AstroImageJ} \citep{Collins2017}. The bulk of the analysis was performed on desktop PC with an AMD Ryzen$^{\rm TM}$ 9 3950X (16 cores, 2 threads per core, 3.5--4.7 GHz) and a server hosting 2x Intel$^{\rm (R)}$ Xeon$^{\rm (R)}$ Gold 5218 (2x16 cores, 2 threads per core, 2.3--3.9 GHz).
\section{Introduction} A typical collective system comprises of agents that interact with each other through simple rules which lead to interesting, emergent group-level phenomena~\cite{Vicsek1995a, Reynolds1987, Couzin2002, Theraulaz2003}. Generally, these phenomena can be classified as complex, since the features of the emergent behaviour are not explicitly encoded in the rules at the level of the agent and the observed behaviour is a result of the complex many-body interactions in the system~\cite{Sumpter2006}. Examples include, the emergence of order from the inherent noise in collectives with small number of agents~\cite{Jhawar2020, Yates2009}; cohesion arising out of the choice of neighbours to interact with~\cite{Lei2020, Jadhav2022}; self assembly of pedestrian crowds into lanes following the steric interactions between agents in the system~\cite{Isobe2004, Kretz2006}; reaching a consensus via stigmergic interactions mediated through pheromones in an army of ants~\cite{Schmidt1992, Moussaid2009a}. While the group-level behaviour is non-trivially connected to the agents and their interactions, it is also very interesting to note that these phenomena offer significant advantages to the agents when they are in a collective than when they are isolated. For instance, the coordinated motion in social animals helps the collective evade a predator better and also have an increased foraging efficiency~\cite{Romanczuk2009,Papadopoulou2022, Ioannou2012}; the formation of lanes in crowds eases the motion of pedestrians~\cite{Kretz2006, Feliciani2016}; ants optimise their travel times, and resource allocation via stigmergic interactions~\cite{Reid2015, Detrain2006}. So it has always been of interest to understand how useful (intelligent) collective behaviours emerge from simple interactions at the level of the agents. Agents that produce these intelligent group-level outcomes need not necessarily be intelligent, to begin with~\cite{Reid2016}. Even those agents with limited cognition, access to information and ability to process can collectively produce intelligent behaviour. However, let us focus our attention on human collectives where the individual agents are intelligent and capable of sophisticated cognitive functions. Here, one could then ask: does the intelligence of human agents always guarantee intelligent collective outcomes? We know the answer to this question is a `no', just from our daily experience with vehicular traffic and pedestrian movement. Human collectives are capable of exhibiting both intelligent manoeuvres that increase throughput, and unintelligent collective behaviour like jamming~\cite{Tsuboi2020, Chauhan2021a}. The question then becomes: when do intelligent group-level behaviours emerge in a collective system? What aids or prevents this emergence? To answer these questions, we explore the dynamics---more specifically the motion---of a collective composed of intelligent agents and study how their interactions lead to group level phenomena. By investigating the phenomenology underlying this emergence, we identify when the group-level behaviour exhibited is intelligent and when it is not. To model intelligence, one may have to simulate the cognitive process through which intelligent agents reach their decisions that affect the dynamics. Writing down a model for a brain is no simple task and will make interpreting the results extremely hard. Even an artificial neural network model would result in a large number of parameters that have to be tuned and explained. Another way to the model would be, to use principles that agents broadly follow to make decisions, as a proxy for a model of the process of thinking. For example, one could use the principle of causal entropy or future state maximisation, where agents strive for states that offer better future possibilities~\cite{Hornischer2019,Charlesworth2019}. However, current formulations of these models do not incorporate the `goal' of the agents and the competition between achieving the goal vs maximising the causal entropy~\cite{Wissner-Gross2013, Mann2015}. Hence, we resort to the classic social force-based framework to model the interactions and movement of the agents. The agents have the desired goal defined by a desired speed and direction of motion. Agents always try to restore their state to the desired state. Agent intelligence is modelled as a force affecting agent dynamics based on collected neighbourhood information. Here, we take a minimalist approach in modelling a single aspect of intelligence, namely \textit{memory}. Agents in our study remember their past, they collect information on how well they were able to achieve their goals. The force arising due to the memory of the agent tries to restore the agent to its desired, making up for failed attempts in the past. If the memory of the agents helps the collective achieve a state where the agents' individual goals are achieved swiftly, then we call the collective-state as `intelligent'. In this article, we first present the model for agents with memory. We demonstrate the dynamics using a bidisperse collective where there are two groups of agents with opposing desired directions of motion, meeting head-on. We explore the effect of memory on the dynamics of just a pair of agents and then proceed to investigate the effect on the collective. In some regions of the parameter space, we observe the emergence of collective-level intelligence and in some cases where the intelligence of the agents has a negative effect on the collective dynamics. We probe into the phenomenology of agent dynamics to understand the origins of the observed collective phenomena. We then make connections to lane-less traffic flow conditions, which is often the case in densely populated countries. \section{Model collective and the study} In this study, we consider a bidisperse collective where there are two types of agents: one group desires to move in the positive x direction while the other in the negative x direction. We use a social force model, similar to refs~\cite{Helbing2000a, Reichhardt2018, Nabeel2022}, to simulate the motion of these agents on a two dimensional domain, with periodic boundary conditions in the x direction and bounded by walls in the y direction. When the velocity is scaled with the desired speed of motion ($s_0$), time by the inertia ($\tau$), memory force by $s_0 \times \tau$, we can write down the equations governing the dynamics of the agents as shown in Eq~\ref{eqn:socialforce} and \ref{eqn:memoryforce}. \begin{eqnarray} \label{eqn:socialforce} \frac{d\mathbf{v}_i}{dt} = (\mathbf{v}_{0, i} - \mathbf{v}_i) + \beta \mathbf{M}_i + \sum_{\forall j \neq i} \mathbf{F}_{ij} + \mathbf{F}_{i,w}\\ \nonumber \\ \label{eqn:memoryforce} \frac{d\mathbf{M}_i}{dt} = - \frac{\mathbf{M}_i}{\alpha} + (\mathbf{v}_{0, i} - \mathbf{v}_i) \end{eqnarray} The first two terms in the RHS of Eq \ref{eqn:socialforce} are the restitution and the memory forces, respectively. The restitution force drives an agent to its desired direction and speed at a rate proportional to the deviation of the agent's instantaneous velocity $\mathbf{v}_i$ from the desired $\mathbf{v}_{0,i}$. The memory force is an additional social force, coming from the agent's movement history, with its own time dynamics (see Eq~\ref{eqn:memoryforce}). The origins of this force is due to the cognitive faculties intrinsic to the `intelligent' agent. The deviations from the desired velocity acts as the source for $\mathbf{M}_i$ while at a rate proportional to $\frac{\mathbf{M}_i}{\alpha}$, memory also decays. Here, $\alpha$ is the time scale corresponding to how far past the agent remembers. The more the agent has slowed down or is pushed in a direction different from its desired, \textit{i.e.}, $\mathbf{v}_i \neq \mathbf{v}_0$, the more is the memory-force that makes the agent make up for its non-optimal history. This feedback mechanism that the agent exhibits through memory is similar to how control architectures are implemented, where the control action depends on the deviation(s) from set point. More information on the memory model and its connection with control theory can be found in an upcoming article as part of the Traffic and Granular flow 2022 conference proceedings. Depending on whether an agent belongs to groups 1 or 2, it will have an appropriate $\mathbf{v}_0$, as given by Eq~\ref{eqn:Desdir}. \begin{equation} \label{eqn:Desdir} \mathbf{v}_{0, i} =\left\{\begin{matrix} + \mathbf{e}_x & i \in \text{Group 1}\\ - \mathbf{e}_{x} & i \in \text{Group 2} \end{matrix}\right. \end{equation} Short-ranged repulsive forces (with cutoff distance of $l_{cr}$) are used to model both the inter-agent and the agent-wall interactions (see Eqs~\ref{eqn:interagforce}, \ref{eqn:wallforce}). \begin{eqnarray} \label{eqn:interagforce} \mathbf{F}_{ij} =\left\{ \begin{matrix} -\gamma (d_{ij}-2)^{-3} \hat{\mathbf{d}}_{ij} & d_{ij}<l_{cr} \\ 0 & \text{\textit{otherwise}} \end{matrix} \right. \\ \nonumber \\ \label{eqn:wallforce} \mathbf{F}_{iw} =\left\{ \begin{matrix} -\gamma (\|\text{wall} - y_i\|-1)^{-3} \hat{\mathbf{d}}_{ij} & d_{ij}<l_{cr} \\ 0 & \text{\textit{otherwise}} \end{matrix} \right. \end{eqnarray} These make sure that the agents compete for space as they move past each other. The dynamics observed does not sensitively dependent on the choice of the interaction model employed. \paragraph*{The study:} The agents from the two groups are placed on two sides of the domain and are allowed to meet head-on (as shown in the schematics of figures~\ref{fig:twoagentdynamics} A and \ref{fig:crowddynheadon} A). These agents, as they are driven in their desired directions, will collide with agents from the other group and slow down. This deviation from the desired velocity will cause an increase in the memory force which will help the agent force its way through, even more. The agents will form a temporarily jammed state which will eventually unjam to give rise to a laned configuration that allows for free motion of the agents. The objective here is to understand how memory---specifically the strength of the social force $\beta$ and the time scale $\alpha$---affects the crowding dynamics. When $\beta = 0$, memory has no effect on the motion of the agents. When $\alpha$ is low, the agent dynamics is affected only by the information from its recent past and similarly when $\alpha$ is high the agent dynamics is affected by a longer history. First, we explore the dynamics of two agents meeting head-on, as a function of $\beta$ and $\alpha$. Then, we study the dynamics of the collective (40 agents; 20 in each group) as a function of the memory parameters. \section{Results and Discussion} \subsection{Effect of memory on the head-on collision of two agents.} \begin{figure*} \centering \includegraphics[width=\linewidth]{TwoAgentDynamics.pdf} \caption{\textbf{Dynamics of two agents meeting head-on}. \textbf{A} - Schematic of the two agents meeting head-on with arrows marking their velocities in both x and y directions separately. Agents slide past each other to a final configuration where agents are displaced vertically $d_v$ from their original $y$-positions. \textbf{B (i - iv)} - Time evolution of velocity and memory in both x and y directions for a single agent. The time of crossing ($t_c$) is marked in (iii), since it is based on the condition: $v_y>10^{-3}$. \textbf{C} - Time of crossing ($t_c$) heat map as a function of the memory parameters $\alpha$ and $\beta$. \textbf{D} - Vertical displacement ($d_v$) heat map as a function of $\alpha$ and $\beta$.} \label{fig:twoagentdynamics} \end{figure*} To understand how memory affects the crowding dynamics we begin our analysis by looking at the dynamics of two agents: one from each group, meeting head-on (schematic in figure~\ref{fig:twoagentdynamics} A). The agents are far away from the walls and the only interaction they experience is the inter-agent force. This is directed along the line joining the centres of the agents which slows the agents down when they approach each other. Since, agents are not present along the same horizontal axis (perturbed in the vertical direction), they experience a small y-component force that pushes them in the vertical direction. The agents eventually slide past each other occupying separate lanes. In the presence of memory, this slowing down results in the increase of the memory force which in turn affects the motion of the agents and speeds up the dynamics (see figure~\ref{fig:twoagentdynamics} B (i, ii) and (iii, iv)). The memory force plays two roles. Firstly, as $M_x$ increases, it quickens the time taken for the agent to begin sliding over the other agent. Now, as the agent slides over, it moves in the y direction which is not desired (as far as the goal of the agent is considered). Hence, $M_y$ starts to increase in a negative direction. However, since the inter-agent force dominates the sliding process, $M_y$ does not have a role in the motion of the agent during that time. But once, the sliding is over, the inter-agent force begins to reduce in magnitude and now the memory force in y, $M_y$, gives rise to a negative $v_y$ which attempts to make up for the vertical displacement experienced by the agent during the sliding process. Hence, to characterise the dynamics we compute two parameters: \begin{enumerate} \item \textit{Time of crossing} $t_c$, which is the time taken by the agents to complete the sliding process. We define this based on the total time $v_y$ was greater than $10^{-3}$ (marked in figure~\ref{fig:twoagentdynamics}B (iii)) and, \item \textit{Vertical displacement} $d_v$ which is the displacement of the agent in the y direction from its initial y position (marked in figure~\ref{fig:twoagentdynamics}A). \end{enumerate} Figures~\ref{fig:twoagentdynamics} C and D show the heat maps of $t_c$ and $d_v$ for the memory parameters $\alpha$ and $\beta$. We observe that, in this simple two-agent case, memory has a monotonic effect on the dynamics. The higher the effect of memory, either through a longer time scale $\alpha$ or by a larger force strength $\beta$, the quicker the sliding and lower the displacement. In fact, when $\alpha$ is very high $(>20)$, we see that the agent positions are almost fully restored in the y-direction. \subsection{Effect of memory on the dynamics of the collective.} Next, we simulate a collective of 40 agents, with 20 in each group. Agents of group 1 are placed on the left-hand side of the domain and group 2 on the right (as shown in schematic figure~\ref{fig:crowddynheadon} A). As the system evolves in time, agents meet head-on near the centre of the domain where they form a compact arrangement,a jammed configuration. A variety of different scenarios are possible here, from a few agents in a jammed configuration to the entire collective at a standstill. Following this, the agents unjam dynamically leading to the formation of lanes that ease the movement of the agents thereafter. \begin{figure*} \centering \includegraphics[width=\linewidth]{Colldynamics_headon.pdf} \caption{\textbf{Dynamics of a bidisperse collective meeting head-on}. \textbf{A} - Schematic of the dynamics of the agents in a 1D periodic domain in x and bounded by walls in y. \textbf{B} - Probability of finding an agent of a given speed, plotted for three cases: $\alpha = 0.3, \beta = 4$, $\alpha = 5, \beta = 4$ and $\alpha = 21, \beta = 4$. \textbf{C} - The order parameter $\mathcal{J}$ heat map as a function of the memory parameters $\alpha$ and $\beta$.} \label{fig:crowddynheadon} \end{figure*} To understand how memory impacts the movement of agents in the crowd, we use a jamming order parameter $\mathcal{J}$ which is defined as the probability of finding a slowly moving agent. If many agents move slow most of the time, $\mathcal{J}$ will take a large value and it would mean that collisions and local jamming are slowing down these agents considerably. At the same time, if $\mathcal{J}$ is small, it would mean that the agents were able to escape getting jammed and were able to move as desired. Here in our study, we call an agent slow if it moves with a speed less than $15\%$ of the desired speed $\|\mathbf{v}_0\|$. Figure~\ref{fig:crowddynheadon} B shows the histograms of the speeds for a few realisations for different values of memory. The boxed region identifies the probability of finding an agent moving with a speed $<0.15$. We compute $\mathcal{J}$ for different values of the memory time scale $\alpha$ and strength of force $\beta$ (see figure~\ref{fig:crowddynheadon} C). Interestingly, we find that memory has a non-monotonic effect on crowd dynamics. When the agent remembers only its recent past, \textit{i.e.} the memory is short-term $0< \alpha < 8$ (and with sufficiently large $\beta$), we find that agents have a large propensity to form jammed configurations that take much longer to unjam giving rise to large values for the order parameter $\mathcal{J}$. At the same time, we also find that for large enough $\alpha$, the movement dynamics become very efficient taking very low values of $\mathcal{J}$. \begin{figure} \centering \includegraphics[width=1\linewidth]{ShortTermMemory_configurations.pdf} \caption{\textbf{A} - Jammed configurations formed for the same initial conditions for when memory is very small ($\alpha = 0.3$ and $\beta = 4$), and when memory is short term ($\alpha = 5$ and $\beta = 4$). \textbf{B} - Jamming order parameter $\mathcal{J}$, plotted as a function of the symmetry order parameter, which is the fraction of layers that were symmetric. $(\Box)$: corresponds to $\alpha=0.3$, $(\bigcirc)$: $\alpha=5$ and $(\times)$: $\alpha=21$ (only found at the origin). \textbf{C} - Symmetry order parameter plotted for both $\alpha = 0.3$ and $\alpha = 5$. The dotted line is the $45^{\circ}$ line. Every point in the plots shown in B and C corresponds to a single realisation of the agent dynamics, which corresponds to one set of initial positions and velocities of agents.} \label{fig:configs_shorttermmemory} \end{figure} \subsubsection{Short-term memory causes the self-assembly of symmetric interlocks.} To understand why short-term memory gives rise to a high $\mathcal{J}$, we look into the structure of the jammed configurations formed when agents meet head-on, for different values of the memory parameters. We find that short-term memory gives rise to jammed configurations that are symmetric,\textit{i.e.}, there are an equal number of agents from either group in a single lane (as shown in figure~\ref{fig:configs_shorttermmemory} A). Since the forces are more or less balanced for such assemblies, it takes much longer to unjam giving rise to a high value for $\mathcal{J}$. Figure~\ref{fig:configs_shorttermmemory} B shows that $\mathcal{J}$ increases with the symmetry of the jammed configuration. Here, symmetry is simply a measure of the fraction of layers in the jammed configuration that have the same number of agents from groups 1 and 2. Interestingly, we find that even when the initial conditions (x and y positions at $t=0$ for all agents) are the same, short-term memory aids in the formation of symmetric assemblies when those formed with very low levels of memory are asymmetric. Figure~\ref{fig:configs_shorttermmemory} C shows the scatter plot of the symmetry measure for the $\alpha=5$ (short-term) and $\alpha=0.3$ cases. Most points lie above the diagonal line, which clearly indicates that the rearrangements facilitated by the memory force term gave rise to more symmetric arrangements. When agents meet head-on, they have to slide past each other. Now, when the effect of memory is low, the time taken to cross each other is high. We know this from the $t_c$ computed from our two-agent simulations (figure~\ref{fig:twoagentdynamics} C). As the agents in the collective begin to crowd near the centre of the domain to form a compact arrangement, very soon the space needed for crossing is no longer available. Hence, significant rearrangements seldom happen in the absence of memory. However, as $\alpha$ increases, the time for crossing $t_c$ reduces. This results in possible rearrangements as the agents form the jammed configuration, to yield symmetric interlocks. \begin{figure} \centering \includegraphics[width = 1 \linewidth]{Origin_of_asymmetry.pdf} \caption{\textbf{A} - The mean layering order parameter that quantifies the symmetry is plotted against the number of holes formed in the front of the assembly. The bar plots in the background (with the axis in the right) represent the probability of occurrence of these holes the different realisations of the agent dynamics. INSET: schematic of assemblies with and without a hole. \textbf{B} - The difference in the average speeds between the bulk of the assembly and the agents near the boundary is plotted for $\alpha = {0.3, 5}$. INSET: schematic showing the bulk and the boundary.} \label{fig:originofasymmetry} \end{figure} \paragraph{Origins of symmetry through the formation of holes.} To understand the phenomenology behind the assembly of compact jammed structures, we investigate the dynamics near the interacting fronts of the two groups. As the fronts come into contact, agents of one group have to slide past those in the other in front of it, in order to move in their desired directions. This gives rise to interesting features in the self-assembly of agents in that region which we believe dictates the dynamics and eventually the final state of the compact jammed arrangement. When agents approach each other, their relative positions would result in the pair sliding either in a clockwise or an anticlockwise fashion. If two adjacent pairs slide in the same manner, both of them clockwise or anticlockwise, the agents rearrange in a rather symmetric fashion. The agents behind these fronts also follow this reorganisation giving rise to symmetric jammed configurations, esp. when memory is short-term. At the same time, when adjacent pairs of agents slide in opposite directions, one anticlockwise and the other clockwise, the agents open up as they move away from each other creating a \textit{hole}. Now the nearby agents compete for the space created. When memory is short-term, all agents in the interacting front reorganise in a similar fashion which essentially amounts to crowding. This leads to the emergence of local asymmetry in the assembly of agents. The inset in figure~\ref{fig:originofasymmetry} A shows the schematic of the local movement of agents that may or may not give rise to a hole. As expected, we find the symmetry of the jammed configuration to decrease as the number of holes in the assembly increases (as shown in figure~\ref{fig:originofasymmetry} A). Here, the formation of holes can be predicted from the y positions of the agents at $t=0$. The number of holes formed in any given realisation depends on the different ways in which agents at the interacting front move. Only when all the interacting pairs move in a similar fashion we get 0 number of holes. However, even if a single pair moves in another direction, in the bulk, it would result in 2 holes and if that is in the boundary, 1 hole and so on. Hence, the probability of the occurrence of a hole depends on the number of ways in which one can achieve them. The bar plot in the background of figure~\ref{fig:originofasymmetry} A shows the propensity to get a certain number of holes in the assembly. \paragraph{Origins of asymmetry through boundary effects.} In addition to the dynamics dictated by the formation of holes, we also observe the boundary playing a role in the origin of asymmetry in the jammed configuration. Agents in the boundary have to slide past those on the one side while on the other, they are constrained by the immovable boundary. When the effect of memory is very low, we find that agents near the boundary are unable to participate in the dynamics which results in the reorganisation in the bulk. They begin to participate later and when they do so, they result in asymmetric arrangements. The inset of figure~\ref{fig:originofasymmetry} B shows schematic of the agents in the boundary and the bulk. We compute the difference in the speeds of agents in these two regions (during the initial transients) and we find that $\alpha = 0.3$ has a higher difference than when the memory is short-term, $\alpha = 5$. \begin{figure} \centering \includegraphics[width = 0.7 \linewidth]{HeterogeneousSpeeds.pdf} \caption{Box plots of the standard deviation of speeds evaluated around the neighbourhood of every agent for three cases: $\alpha = 0.3$, $\alpha = 5$ and $\alpha = 21$ and $\beta = 4$. INSET: shows how the neighbours are computed around every agent.} \label{fig:highalpha_heterogeneity} \end{figure} \subsubsection{Long-term memory leads to the heterogeneity in movement that aids in unjamming.} We observe that when the memory is long-term, \textit{i.e.} $\alpha$ is large, agents form lanes very effectively and rapidly giving rise to small values of $\mathcal{J}$. To form lanes, the agents have to slide past each other quickly before the other agents crowd the area. We know from our two-agent study that $t_c$ is reduced considerably when $\alpha$ is high. In addition, we also know that agents restore the vertical displacement $d_v$, which results in the effective utilisation of space as agents form lanes. When holes are present, we find that it facilitates the assembly of multiple layers of agents from the same group. To understand how agents efficiently layer at the level of the collective, we look at the distribution of agent speeds in the neighbourhood of every agent. We compute the standard deviation of the speeds of those neighbouring agents that are within 3 times the radius of the focal agent (as shown in the inset of figure~\ref{fig:highalpha_heterogeneity}). We find that there is a large variation in the speeds of the agents when $\alpha$ is high. Since, the memory parameters are the same for all the agents, the general expectation is that they will experience similar amounts of the memory force as they crowd and slow down. However, when $\alpha$ is large, we find that memory of an agent is sensitive to the velocity changes it experiences. Hence, small differences in the history of the agent movements give rise to large differences in the memory forces giving rise to heterogeneous movement locally and a corresponding large variation in the speeds of the agents. Therefore, when a couple of agents slide past each other, the neighbouring agents do not make appreciable movement allowing them to layer efficiently. \section{Conclusion} \paragraph*{Summary:} In this article, we explore how and when agent-level intelligence translates to intelligent group-level behaviour in collective systems. Using a bidisperse group of agents (with two opposing desired directions) that possess some facet of intelligence, \textit{viz.} memory, we study the emergence of intelligence at the level of the collective. Although memory guarantees efficient movement of the agents when there are only two of them, we find that it can give rise to both efficient movement and in some cases sub-optimal jamming behaviour, when there are enough agents to span the width of the domain. We show that the cause for the diverse behaviours is due to: \begin{inlineenum} \item the time scales involved in crowding as agents approach each other to form compact arrangements, \item the time-scales associated with the rearrangement processes that lead to agents of one group sliding past another to escape a local jamming event and \item the presence of the boundary. \end{inlineenum} In the absence of memory, agents do not have the time required to move past other agents, esp. near the boundary, and they end up in jammed configurations. However, these configurations are highly asymmetric and eventually unjam. However, if the agents possess some memory, \textit{viz.} short-term, they have a large propensity to form symmetric interlocks. The memory facilitates the rearrangement of all the agents in a similar fashion, which result in crowding and assembly into symmetric arrangements. Now, when the effect of memory is large, \textit{i.e.}, agents remember over longer time scales, we find that small differences in the movement between agents result in large differences in the memory force that gives rise to locally heterogeneous motion of the agents which facilitates the formation of lanes. \paragraph*{Connections to dense, lane-less traffic:} These results are particularly interesting from the context of dense, lane-less traffic flows like that in countries like India, where we find intelligent agents as the cause for both unintelligent interlocks that reduce the efficiency of the collective and complex manoeuvres that increase the throughput of traffic in dense flow conditions. Each vehicle on the road can be thought of as a selfish agent that is optimising or adjusting its motion to achieve its objective better. The agents used in this study too behave as controllers, specifically of the Proportional-Integral type, which uses information pertaining to its own past movement (memory) along with its current state (restitution), to achieve its set-point (\textit{i.e.} its desired velocity) effectively. This similarity allows us to derive some general insights into the traffic flow problem from our study. We show that when all the agents selfishly adjust to achieve their own objective, they can form symmetric interlocks that bring the movement to a standstill. Here, symmetry is crucial as agents are of the same type and size and they exhibit an inter-agent social force. However, in real traffic the interlock need not be symmetric; as long as the agents form arrangements where they oppose the motion of the other and prevent sliding past one another, jammed configurations will be formed. This phenomenon is also similar to the faster-is-slower effect observed in pedestrian systems where throughput decreases when all agents trying to exit a room do so aggressively~\cite{Helbing2000,Garcimartin2014}. At the same time, when conditions favour heterogeneous movement of agents, \textit{i.e.}, some agents move faster in comparison to others, we show that it is possible for agents to achieve effective movement. This translates to an efficient use of the available space in a limited time, which is often the mechanism behind efficient manoeuvring seen in real traffic, where some agents might move faster than others resulting in a rather asynchronous use of space that might bypass a jamming event. We show that both these types of movements emerge in a collective of agents with intelligence in the form of memory. \begin{acknowledgments} DRM thanks Prof Kumaran, IISc for the discussions during the initial stages of the project. The authors thank Arshed Nabeel for the careful reading of the manuscript. The authors thank DST INSPIRE faculty award (grant number: DST/INSPIRE/04/ 2017/002985) for the funding. \end{acknowledgments} \section*{References}
\section{Introduction} \label{sec:intro} The central emission core of active galaxies is powered by accretion onto a supermassive black hole (SMBH). This leads to the formation of a collimated jet of outflow, along the angular momentum direction, that outshines the entire galaxy \citep{Urry_1995}. Active Galactic Nuclei (AGNs) are one of the most prominent sources of high energy $\gamma$-rays. The jet transports energy and momentum over large distances. In the case of blazars, the jet points along the observer's line of sight and provides a unique testbed to study the acceleration of cosmic rays \citep[see][for a recent review]{Blandford:2018iot}. Blazars show high flux variability; their emission is highly polarised and the emission is of non-thermal origin. They are broadly classified into flat spectrum radio quasars (FSRQs) having broad emission lines, and BL Lac objects showing a featureless continuum spectra. The broadband SED of a blazar covers the entire electromagnetic spectrum, ranging from radio to very high-energy (VHE, $E\gtrsim 30$ GeV) $\gamma$-rays. It exhibits two peak emission frequencies. The low-energy peak occurs between radio to soft X-ray energies and can be attributed to synchrotron radiation of relativistic electron and positron population. The high-energy peak between X-ray to VHE $\gamma$-ray energies can arise from various processes. The most prevalent explanation is the inverse-Compton scattering of synchrotron photons (synchrotron self-Compton, SSC) or external photons (EC) originating from the broad-line region (BLR), dusty torus (DT), or the accretion disk (AD). In addition, the VHE $\gamma$-rays can also come from photohadronic ($p\gamma$) or hadronuclear ($pp$) interactions of accelerated cosmic rays with the ambient radiation or matter in the emission region of the jet or proton synchrotron radiation \citep{2014NIMPA.742..191T}. Mrk 180 was discovered by Swiss-origin astronomer Fritz Zwicky, and later identified as a BL Lac object in 1976 by spectral analysis. It is a high-synchrotron peaked BL Lac (HBL) object embedded at the center of an elliptical galaxy \citep{1981ApJ...248L..61M}, located at redshift, z=0.0458 \citep{1978ApJ...222L...3U} with R.A.= 174.11008 deg, Decl.= 70.1575 deg. This source was detected for the first time in X-rays by HEAO-1 \citep{1981AJ.....86.1585H}, since then it has been monitored by several telescopes e.g. \textit{Fermi}-LAT, Swift, Major Atmospheric Gamma Imaging Cherenkov Telescope (MAGIC), XMM-Newton, Monitoring of jets in Active Galactic Nuclei with VLBA Experiments (MOJAVE), KVA, ASM. In March 2006, VHE $\gamma$-ray emission was detected for the first time \citep{Albert_2006} from this source, triggered by an optical burst. \cite{https://doi.org/10.48550/arxiv.1110.6341} and \cite{https://doi.org/10.48550/arxiv.1109.6808} did multi-wavelength study on this source. Mrk 180 was also monitored for a long period (2002- 2012) in the optical waveband and its light curve was analyzed \citep{Nilsson_2018}. The Telescope Array experiment, located in Utah, United States, is a state-of-the-art detector observing UHECRs in the northern hemisphere. Based on an intermediate-scale anisotropy search, using 5 years of data, the TA collaboration had earlier reported a cluster of events at RA=146$^\circ$.7 and Dec=43$^\circ$.2, found by oversampling in 20$^\circ$ radius circles \citep{TelescopeArray:2014tsd}. 72 UHECR events were detected in this direction at $E>57$ EeV, where TA has 100\% detection efficiency. The hotspot had a Li-Ma significance of 5.1$\sigma$. \cite{PhysRevD.93.043011} identified Mrk 180 as a possible source of UHECRs in the context of explaining the origin of the TA hotspot \citep{TelescopeArray:2014tsd, 2015ICRC...34..276K, 2019ICRC...36..310K}. Motivated by the earlier studies, we carry out a comprehensive study of Mrk 180 to ascertain the underlying mechanism of high-energy $\gamma$-ray emission and whether it can be the source of ultrahigh-energy cosmic rays beyond 57 EeV contributing to the TA hotspot. We have analyzed the \textit{Fermi}-LAT data collected over a period of 12.8 years, the Swift XRT and UVOT data, and in addition to these the XMM-Newton X-ray data to construct the broadband SED of this source. Section~\ref{sec:data} is dedicated to the discussions on the methods followed to analyze the data. We have also searched for fluctuations in the $\gamma$-ray flux in the \textit{Fermi}-LAT light curve, as discussed in Sec.~\ref{subsec:light_curve}. Subsequently, we build the long-term multi-wavelength SED. We discuss the theoretical framework for SED modeling in Sec.~\ref{sec:sed_model}. We present our results in Sec.~\ref{sec:results} and discuss them in Sec.~\ref{sec:discussion}. Finally, we draw our conclusions in Sec.~\ref{sec:conclusion}. \section{ \label{sec:data}Data Analysis} \subsection{\label{subsec:fermi}Fermi-LAT Data Analysis} The \textit{Fermi}-LAT is an imaging, pair-conversion, wide-field-of-view, high-energy $\gamma$-ray telescope that can detect photons of energy 20 MeV to more than 300 GeV, whose field of view is 2.4 sr \citep{Atwood_2009}. Fermi carries two instruments, one is the LAT and the other one is the Gamma-ray Burst Monitor (GBM). The LAT is Fermi's primary instrument. Fermi scans the whole sky every three hours. It was launched in June 2008 in the near-earth orbit and still in operation. The Pass 8 \textit{Fermi}-LAT $\gamma$-ray data of Mrk 180 was extracted from Fermi Science Support Center (FSSC) data server \citep{Fermi_Data_Download} for a period of more than 12.8 years (August 2008 to May 2021). We have used Fermipy v1.0.1 \citep{2017ICRC...35..824W}, an open-source python package to analyze \textit{Fermi}-LAT $\gamma$-ray data. Moreover, we have used \textit{Fermi}-LAT Fourth Source Catalog Data Release 2 (4FGL-DR2; gll\_psc\_v27.fits) \citep{https://doi.org/10.48550/arxiv.2005.11208}. We have modeled the Galactic diffuse emission by the latest model template (gll\_iem\_v07; \cite{Acero_2016}) and for the extra-galactic isotropic diffuse emission model, we have considered iso\_P8R3\_SOURCE\_V2\_v1.txt. We have followed Fermipy's documentation for further analysis \citep{fermipy_doc} and extracted the light curve and SED of Mrk 180. The photon-like events are classified as evclass=128. As the \textit{Fermi}-LAT collaboration recommended to use the ‘SOURCE’ event class for relatively small regions of interest ($<25^\circ$) \citep{bruel2018fermilat} and we have used the ‘P8R3 SOURCE’ event class for which ‘evclass’ has to be set to a value 128 \citep{Fermi-LAT_Ciceron} and evtype=3; each event class includes different event types which allows us to select events based on different criteria. The standard value of ‘evtype’ is 3 which includes all types of events i.e. front and back sections of the tracker (denoted by FRONT+BACK), for a given class. We have extracted the \textit{Fermi}-LAT $\gamma$-Ray data from FSSC data server considering a search radius of 30$^\circ$ around the source Mrk 180. During the data preparation, we have selected a ‘Region of Interest (ROI)’ of 10$^\circ,$ as suggested in Fermi’s Data Preparation page \footnote{\url{https://fermi.gsfc.nasa.gov/ssc/data/analysis/documentation/Cicerone/Cicerone_Data_Exploration/Data_preparation.html}} and the maximum zenith angle of 90$^\circ$ was chosen to avoid earth limb contamination in our analysis. We restricted our analysis to an energy range of 100 MeV to 500 GeV. We have obtained the $\gamma$-ray light curve shown in Fig.~\ref{fig:Mrk180_LC} and the SED, which is used to construct the multi-wavelength SED shown in Fig.~\ref{fig:Mrk180_SED}. \subsection{\label{subsec:swift}SWIFT XRT and UVOT Data Analysis} Neil Gehrels Swift observatory is a multi-wavelength space-based observatory with three instruments onboard: Burst Alert Telescope (BAT; 15.0- 150.0 keV), X-Ray Telescope (XRT; 0.3- 10.0 keV) and Ultraviolet and Optical Telescope (UVOT; 170- 600 nm) \citep{Burrows_2005}. It observes the sky in hard X-ray, soft X-ray, ultraviolet, and optical wavebands. Swift provides simultaneous data of any transient activity in all wavebands ranging from X-ray to optical. We collected all the XRT and UVOT data over the period August 2008 to May 2021, available for Mrk 180. We have analyzed 44 observations. The standard data reduction procedure\footnote{\url{https://www.swift.ac.uk/analysis/index.php}} has been followed to extract the source and background region. \par In Swift-XRT data, we have used clean event files corresponding to Photon-Count mode (PC mode), which we have obtained using a task ‘xrtpipeline’ version 0.13.5. The calibration file (CALDB), version 20190910, and other standard screening criteria have been applied to the cleaned data. A radius of interest of 20-30 pixels has been considered to mark the source region, the radius of the background region is also the same, but it is far away from the source region. With the help of ‘xselect’ tool, we have selected the source region and background region and saved the spectrum files of the corresponding regions. Then ‘xrtmkarf’ and ‘grppha’ tools have been used to generate ancillary response files (arfs) and group the spectrum files with the corresponding response matrix file (rmf); thereafter ‘addspec’ and ‘mathpha’ have been used. Thus we have obtained the spectrum. Thereafter, the spectrum has been modeled with xspec \citep{1996ASPC..101...17A} (Version 12.11.0) tools. We have included the absorption by neutral hydrogen having column density, N$_{\rm H}$= 1.37$\times10^{20}$ cm$^{-2}$ \footnote{\url{https://heasarc.gsfc.nasa.gov/cgi-bin/Tools/w3nh/w3nh.pl}} \citep{Bekhti_2016}. The final X-ray SED obtained in this way has been shown in Fig.~\ref{fig:Mrk180_SED}. Mrk 180 was also monitored by Swift UVOT in all six filters: U(3465 \AA), V (5468 \AA), B (4392 \AA), UVW1 (2600 \AA), UVM2 (2246 \AA) and UVW2 (1928 \AA). The source region has been extracted from a region of 5" around the source, keeping the source at the center of the circle. The background region has been taken $\sim$3 times larger than the source region and it is far away from the source region. Using ‘uvotsource’ tool, we have extracted the source magnitude. This magnitude does not include the galactic absorption, so it has been corrected. A python module ‘extinction’ \citep{Extinction} has been used to get the extinction values corresponding to all the Swift-UVOT filters. We have considered Fitzpatrick (1999) (Fitzpatrick 1999) dust extinction function for R$_{\rm V}$=3.1, where R$_{\rm V}$ is a dimensionless quantity, which is the slope of the extinction curve. For diffused interstellar medium (ISM) the mean value of R$_{\rm V}$ is 3.1 \citep{1975A&A....43..133S, 1985ApJ...288..618R, 1980MNRAS.192..467W}. Following are the values of the extinction coefficients of different Swift-UVOT wavebands which we have used in this work; U: 0.05584, V: 0.03460, B: 0.04603, UVW1: 0.07462, UVM2: 0.10383, UVW2: 0.09176. \subsection{\label{subsec:xmm}XMM-Newton X-ray Data Analysis} XMM-Newton is a space-borne X-ray observatory, consisting of three imaging X-ray cameras (European Photon Imaging Camera or EPIC), two grating X-ray spectrometers (Reflection Grating Spectrometer or RGS) and one optical monitor (OM). It was launched on December 10, 1999. Because of its great capacity to detect X-rays, it was formally known as the High Throughput X-ray Spectroscopy Mission. Now it is called XMM because of its multi-mirror design. The three EPIC cameras are the primary instrument aboard XMM-Newton; out of the three, two of them are MOS-CCD cameras and the remaining one is pn-CCD camera. The energy range of EPIC is about 0.15 keV- 15.0 keV. The MOS-CCD cameras are used to detect low-energy X-rays, whereas pn-CCD camera is used to detect high-energy X-rays. RGS operates from 0.35 keV to 2.1 keV. OM covers from 170 nm to 650 nm. From the data archive of XMM-Newton \footnote{\url{http://nxsa.esac.esa.int/nxsa-web/##search}}, we found two observations for Mrk 180: 0094170101 and 0094170301 of 20 ks and 8 ks respectively. We have followed standard data reduction procedure \footnote{\url{https://www.cosmos.esa.int/web/xmm-newton/sas-threads}} to extract the SED. We have extracted SED points from MOS1 and MOS2; combined them and finally, we got SED points from MOS. Also, we extracted SED points from pn detector. Thereafter, we used xspec \citep{1996ASPC..101...17A} (Version 12.11.0) to model these spectra. Other than X-ray data, we have also analyzed OM image mode data. Following the same data reduction procedure, we prepared the data; then we used `omichain' for further analysis. We followed \cite{OMICHAIN} instruction for the last step. By the `om2pha' \citep{om2pha} command, we extracted the spectrum file to analyze in xspec. For this step, the required OM response files have been copied from \cite{OMResponseFile}. The first observation 0094170101, contains single data corresponding to the u-band, which is insufficient for further analysis whereas, the second observation 0094170301 does not contain any image file for further study. So, our multi-wavelength data does not contain any XMM-Newton OM data. \subsection{\label{subsec:mojave}MOJAVE Data} MOJAVE is a long-term program to monitor radio brightness and polarization variation in jets associated with active galaxies visible in the northern sky \citep{MOJAVEWebpage}. MOJAVE observes at three wavelengths 7 mm, 1.3 cm, and 2 cm, to obtain a full polarization image with an angular resolution better than 1 millisecond. We have collected MOJAVE data for Mrk 180 from the MOJAVE/2cm Survey Data Archive \citep{MOJAVESourcePage}. There are seven observations in the archive and used those data to construct the multi-wavelength SED. \subsection{\label{subsec:magic}MAGIC Data} MAGIC is a system of two Imaging Atmospheric Cherenkov Telescopes (IACT), situated on the Canary Island of La Palma. VHE $\gamma$-rays impinging the earth's upper atmosphere, initiate cascade interactions; leading to the production of a shower of secondary particles, mainly electrons and positrons. Electrons and positrons moving faster than the phase velocity of light in the atmosphere emit Cherenkov radiation mainly in the UV-blue band for a duration of a few nanoseconds. MAGIC collects the Cherenkov light and focuses it onto a pixelized camera, composed of 576 photomultipliers (PMTs). Using dedicated image reconstruction algorithms, the energy and incoming direction of the primary $\gamma$-ray are calculated \citep{Doro2008}. This telescope can detect $\gamma$-rays of energy between 30 GeV to 100 TeV. VHE $\gamma$-rays from Mrk 180 were detected during an optical outburst in 2006 \citep{2006ApJ...648L.105A}. We have used that data from \citet{MAGIC} for our study. \subsection{\label{subsec:archival}Archival Data} We have collected the archival data from SSDC SED builder \citep{SSDC} and shown it with grey squares in the multi-wavelength SED (Fig.~\ref{fig:Mrk180_SED}). \section{\label{subsec:light_curve}Fermi-LAT gamma-Ray Light curve Analysis} We analyzed 12.8 years (MJD 54682.65-59355.67) of \textit{Fermi}-LAT $\gamma$-ray data. Fig.~\ref{fig:Mrk180_LC} is the 30-day binned \textit{Fermi}-LAT $\gamma$-ray light curve. We have used the Bayesian Block method \citep{scargle2013bayesian} to detect any fluctuations. We have not found any significant variation in the $\gamma$-ray flux. Though there are a few data points with high $\gamma$-ray flux, those points have large error bars, so further analysis with a smaller bin size is not feasible in this case. We proceed to build up the SED with the long-term data, as this source does not have any obvious temporal features. \begin{figure}[h] \includegraphics[width=0.48\textwidth]{Figure/Bayesian_Block_Final.pdf} \caption{Application of Bayesian Block Method on \textit{Fermi}-LAT $\gamma$-Ray Data of Mrk 180 (MJD 54682.65- 59355.67)} \label{fig:Mrk180_LC} \end{figure} \section{\label{sec:sed_model}Multi-Wavelength SED Modeling} \textit{Fermi}-LAT $\gamma$-ray, Swift X-ray, ultraviolet \& optical data and XMM-Newton X-ray data have been analyzed and archival data from MOJAVE, MAGIC and SSDC have been compiled to plot the SED covering radio to VHE $\gamma$-ray frequencies. As discussed previously, Fig.~\ref{fig:Mrk180_SED} shows the double hump structure of the blazar SEDs. We have modeled the SED using pure leptonic and lepto-hadronic scenarios. For the latter, we consider the the line of sight component of the electromagnetic cascade, initiated by UHECR interactions \citep{Essey_10a, Essey_10b}, and also $pp$ interaction as the origin of VHE $\gamma$-rays. An external radiation field is required to produce a significant flux of secondary $\gamma$-rays in p$\gamma$ interactions, hence we do not include this scenario in this work. In the following subsections, we discuss about the models used in this work to explain the multi-wavelength SED of Mrk 180. \subsection{\label{subsec:leptonic}Leptonic Modeling} We have considered a spherical emission region of radius $R$ within the jet, moving with a Doppler factor $\delta_D$, where relativistic electrons and positrons, accelerated in the jet lose energy through synchrotron radiation in a steady and uniform magnetic field $B$, and also by SSC emission. From the maximum likelihood analysis of \textit{Fermi}-LAT data, a log-parabola injection was found to best fit the data. \cite{Massaro_2003} showed that a log-parabolic photon spectrum can be produced from the radiative loss of a log-parabolic electron spectrum. So, we have used the log-parabolic spectrum of the injected electrons in the blob to explain the multi-wavelength SED of Mrk 180, given by the following expression, \begin{equation} Q(E)=L_0(E/E_0)^{-(\alpha+\beta \log_{10}(E/E_0))} \label{eqn:leptonic_injection} \end{equation} where $Q(E)$ is the log-parabolic distribution, $L_0$ is the normalization constant, $E_0$ is the scaling factor or pivot energy which is set to 97 MeV in our modeling and kept fixed, $\alpha$ is the spectral index and $\beta$ is the curvature index.\\ We have used the open-source code \cite{libgamera} \citep{Hahn:2015hhw} to model the multi-wavelength leptonic emission. It solves the time-dependent transport equation and propagates the particle spectrum $N(E,t)$ for an injected spectrum $Q(E)$ to calculate the synchrotron and SSC emissions including the Klein-Nishina effect. GAMERA solves the following transport equation, \begin{equation} \dfrac{\partial N(E,t)}{\partial t}= Q(E)-\dfrac{\partial}{\partial E}(b(E,t)N(E,t))-\dfrac{N(E,t)}{\tau_{\rm esc}} \end{equation} where, $Q(E)$ is the input particle spectrum, $b(E,t)$ corresponds to the energy loss rate by synchrotron and SSC emission. The term $\tau_{\rm esc}(E,t)$ denotes the escape time of particles from the emission region. We consider a constant escape of the electrons from the emission region over the dynamical timescale, $\tau_{\rm esc}\sim R/c$, where $c$ is the speed of light. We find that the time-evolved electron spectrum reaches the steady state after nearly 100 days, and this spectrum has been used in this work. \subsection{\label{subsec:los_uhecr}UHECR interactions} We have assumed a power-law injection of the protons into the interstellar medium (ISM) of the following form \begin{equation} N_p(E_p)=\frac{dN}{dE_p}=A_p E_p^{-\alpha_p} \label{eqn:UHECR_injection} \end{equation} where $A_p$ is the normalization constant of the injected proton spectrum, $\alpha_p$ is the spectral index, which is the same for electrons and protons as they are accelerated in the same region. We have taken the minimum energy of protons E$_{\rm p, min}$= 0.1 EeV, and the maximum energy of protons E$_{\rm p, max}$= 100 EeV. The ultra-high energy protons escape from the emission region and propagate through the extra-galactic medium interacting with CMB and EBL photons. In this process, electrons, positrons, $\gamma$-rays, and neutrinos are produced through $\Delta$-resonance and Bethe-Heitler pair production. Protons interact with the CMB and EBL photons in the following way, \begin{equation} p+ \gamma_{bg}= p+ e^+ + e^- \end{equation} \begin{equation} p+ \gamma_{bg}\rightarrow \Delta^+ \rightarrow \begin{cases} n+ \pi^+ \\ p+ \pi^\circ \end{cases} \end{equation} The neutral pions decay to gamma photons ($\pi^\circ \rightarrow \gamma \gamma$) and the charged pions decay to neutrino ($\pi^+ \rightarrow \mu^+ + \nu_\mu \rightarrow e^+ + \nu_e + \bar{\nu}_\mu + \nu_\mu $). The resulting cosmogenic neutrinos propagate undeflected by magnetic fields and unattenuated by interaction with other particles. The secondary $e^\pm$, $\gamma$-rays initiate electromagnetic (EM) cascade by undergoing pair production, inverse-Compton upscattering of the background photons, and synchrotron radiation in the extragalactic magnetic field (EGMF). The resulting spectrum extends down to GeV energies and depends more on the propagation distance and background photon model than the injection parameters. We use the semi-analytical EBL model given in \cite{Gilmore:2011ks} for the propagation of UHECR and the attenuation of secondary EM particles, and also the primary $\gamma$-rays coming from leptonic emission inside the source. UHECRs also interact with the universal radio background \citep{Protheroe:1996si} which is important at energies higher than the Greisen-Zatsepin-Kuzmin (GZK) cutoff energy for $\Delta$-resonance with the CMB photons. The EGMF causes a spreading of the UHECR beam and also the EM particles. We consider the contribution from the line of sight resolved component of the cascade spectrum to the observed SED (cf. Sec.~\ref{sec:results}). We have used the publicly available simulation framework, \textsc{CRPropa 3} \citep{AlvesBatista:2016vpy, AlvesBatista:2022vem, Heiter_18} to propagate UHECR protons from their source to the observer. The secondary EM particles are propagated in the CRPropa simulation chain, using a value of EM thinning $\eta=0.6$. \subsection{\label{subsec:pp} pp interactions} An alternative scenario is when the relativistic protons have much lower energy than UHECRs and they interact with the cold protons within the emission region as they are trapped in the magnetic field of the emission region. The proton-proton interactions result in the production of neutral and charged pions. These pions decay into secondary particles e.g. electrons/ positrons, neutrinos and $\gamma$-rays. The proton-proton interaction channels can be shown in the following manner: \begin{align} p+p\rightarrow \begin{cases} \pi^\circ \rightarrow \gamma+\gamma\\ \pi^+ \rightarrow \nu_\mu + \mu^+ \rightarrow \nu_\mu + e^+ + \nu_e + \bar{\nu_\mu} \\ \pi^- \rightarrow \bar{\nu_\mu} + \mu^- \rightarrow \bar{\nu_\mu} + e^- + \bar{\nu_e} + \nu_\mu \end{cases} \end{align} We have considered a power-law proton injection spectrum within the emission region, with a spectral index $\alpha_p$ and minimum E$_{\rm p, min}$ and maximum energy E$_{\rm p, max}$. We have used the publicly available code \textsc{Gamera} for the time-independent $pp$ modeling. It uses the formalism given in \citet{2014PhRvD..90l3014K}. There are four hadronic interaction models that are included in this code, and for our work, we have used the one given by \textsc{Pythia 8.18} \citep{Sj_strand_2008}. We have balanced the total charge in the emission region to determine the total number of protons. The $\gamma$-ray spectrum produced in $pp$ interactions has been corrected for internal absorption by the lower energy photons inside the blob, and also for absorption by the EBL. \subsection{\label{subsec:power}Jet Power} In the pure leptonic model, we have calculated the total jet power using the following equation \begin{equation} P_{\rm tot}= P_e+ P_B + P_p =\pi R^2 \Gamma^2 c (u'_e+u'_B+u'_p) \label{eqn:JetPow} \end{equation} where P$_{\rm tot}$ is the total jet power, $\Gamma$ is the bulk Lorentz factor; $u'_e$, $u'_B$ and $u'_p$ are the energy densities of the electrons (and positrons), magnetic field and cold protons, respectively, in the comoving jet frame. The primed and unprimed notations denote quantities in the comoving jet frame and the AGN frame, respectively. The energy density of the cold protons( $u_p^\prime$) is calculated assuming the number ratio of electron-positron pairs to protons is 10:1. We have maintained the charge neutrality condition in the jet. In the leptohadronic models, we have added up the additional power carried by the relativistic protons in Eqn. \ref{eqn:JetPow} e.g. in the case of UHECR interactions, we have added P$_{\rm UHECR}$ in Eqn. \ref{eqn:JetPow} and in the case of proton-proton interaction we have added the power of the relativistic protons. Here, we have considered, the bulk lorentz factor ($\Gamma$) and doppler factor ($\delta_D$) are equal. We have tabulated the jet power carried by individual components and the total jet power in Table \ref{tab:GAMERA_Fitting_param}. The mass of the black hole of Mrk 180 as reported in earlier papers has been used to calculate the Eddington luminosity. According to \cite{2003ASPC..290..621T}, the value of $\log_{10}(M_{\rm BH}/M_\odot)$ is 8.59 and according to \cite{2003mglh.conf..109F}, the value of $\log_{10}(M_{\rm BH}/M_\odot)$ is 8.70; where $M_{\rm BH}$ is the mass of the black hole and $M_\odot$ is the solar mass. Using these values, we calculated the Eddington luminosity (L$_{\rm Edd}$) of Mrk 180 which are 5.06$\times10^{46}$ erg/s and 6.51$\times10^{46}$ erg/s respectively. The total jet powers obtained in our models are much smaller than the Eddington luminosity of Mrk 180. \section{\label{sec:results}Results} \begin{figure*} \centering \includegraphics[width=0.48\textwidth]{Figure/Pure_Leptonic_SED_Residual.pdf}% \includegraphics[width=0.48\textwidth]{Figure/Lepto_UHECR_SED_Residual.pdf} \includegraphics[width=0.48\textwidth]{Figure/Leptonic_pp_SED_Residual.pdf} \caption{Multi-wavelength SED of Mrk 180 and residual plots of respective SEDs; (a) pure-leptonic model (top left) (b) leptonic+ hadronic (UHECR) model (top right) (c) leptonic+ hadronic ($pp$) model (bottom). In the multi-wavelength SED of plot (c), the grey-shaded region denotes the difference between the attenuated and unattenuated regions of the total SED. The data color codes are:`Magenta Inverted Triangle'= MOJAVE, `Red Solid Circle'= Swift Optical, `Cyan Triangle'= Swift UV, `Green Inverted-Triangle'= Swift XRT, `Blue Triangle'= XMM-Newton MOS, `Red +'= XMM-Newton pn, `Magenta Solid Circle'= \textit{Fermi}-LAT, `Cyan Solid Circle'= MAGIC, `Grey Square'= Archival Data.} \label{fig:Mrk180_SED} \end{figure*} Mrk 180/ Mkn 180/ TeV J1136+701 or 4FGL J1136.4+7009 is an HBL type blazar at a redshift of 0.045. This source is monitored by several telescopes viz. \textit{Fermi}-LAT, Swift, XMM-Newton, MOJAVE, MAGIC, KVA, ASM, RATAN-600, Mets\"{a}hovi, Effelsberg, IRAM throughout the year, and it was closely monitored during the high state in optical waveband in 2006. 12.8 years (MJD 54682.65- 59335.67) of \textit{Fermi}-LAT $\gamma$-ray data of Mrk 180 has been analyzed in this work. Besides \textit{Fermi}-LAT $\gamma$-ray data, we also collected data in other wavebands e.g. Swift, XMM-Newton, MOJAVE, and MAGIC. Fig.~\ref{fig:Mrk180_LC} is the long-term \textit{Fermi}-LAT $\gamma$-ray light curve in 30-day binning. As can be seen from Sec.~\ref{subsec:light_curve}, this long-term light curve does not show any significant flaring throughout this time, also the error bars of the high-energy $\gamma$-ray data points are large, hence a more detailed analysis of the light curve cannot give us any useful information. To know about the physical processes which can explain the observed spectrum, we studied the long-term SED of Mrk 180; where we have used multi-wavelength data from different telescopes. The multi-wavelength SED shows the double hump structure, which has been modeled with GAMERA; considering a simple one-zone spherical emission region within the jet. In Fig.~\ref{fig:Mrk180_SED}, we have shown the multi-wavelength SEDs fitted with different models e.g. pure leptonic, lepto-hadronic. Also, we have shown the residual (Data-Model/error) plot corresponding to the fit to each model in Fig.~\ref{fig:Mrk180_SED}. First, we consider a pure leptonic model (plot (a) of Fig.~\ref{fig:Mrk180_SED}), where the first hump is produced due to the synchrotron radiation of the relativistic electrons, and the second hump is produced due to the up-scattering of the synchrotron photons by the relativistic electrons. As discussed in Sec.~\ref{subsec:leptonic}, we consider a spherical emission region or blob of radius R within the blazar jet. Leptons are injected within the blob following an injection spectrum (Eqn. \ref{eqn:leptonic_injection}). The best-fitted parameter values corresponding to this modeling e.g. spectral index ($\alpha$), curvature index ($\beta$) are listed in the first column of Table~\ref{tab:GAMERA_Fitting_param}. Also, we have mentioned the jet power carried by different components e.g. leptons (P$_e$), magnetic field (P$_B$), and cold protons (P$_p$) in the Table~\ref{tab:GAMERA_Fitting_param} and the total jet power (P$_{\rm tot}$) which is the sum of the jet power of all the components of a model. \begin{figure} \includegraphics[width=0.48\textwidth]{def_E22.pdf} \caption{Distribution of propagated UHECRs as a function of deflection angle in a random turbulent magnetic field.} \label{fig:UHECR_Distribution} \end{figure} \begin{figure*} \centering \includegraphics[width=0.32\textwidth]{scatter1.pdf}% \includegraphics[width=0.32\textwidth]{scatter2.pdf}% \includegraphics[width=0.32\textwidth]{scatter3.pdf} \caption{Arrival direction of UHECRs at $E>57$ EeV from Mrk 180 to Earth. The blue line shows the Galactic plane. The purple point and the purple dotted curve show the TA hotspot center and the 20$^\circ$ region around it. Similarly, the green dotted curve shows the $20^\circ$ region around Mrk 180. The color bar indicates the energy per nucleon (E/z) of the observed events. From left, the figures correspond to (a) pure proton injection and B$_{\rm rms }\approx10^{-3}$ nG; (b) pure proton injection and B$_{\rm rms}\approx10^{-5}$ nG; (c) Fe injection and B$_{\rm rms}\approx10^{-5}$ nG}. \label{fig:aniso} \end{figure*} The pure leptonic model is found to be insufficient to explain the multi-wavelength SED, as the highest energy $\gamma$-ray data point cannot be fitted with this model. Moreover, the slope of the observed X-ray spectrum does not match the slope of the synchrotron spectrum obtained in our model. To improve the fit to the multi-wavelength SED, particularly at the VHE $\gamma$-ray regime, we check the fit with lepto-hadronic models. As discussed earlier, we have considered two kinds of hadronic processes, viz., the UHECR interaction with the background photons and the $pp$ interaction within the blob. In the case of UHECRs (for simplicity we consider only protons), the escape of protons from the blazar jet can dominate over the energy loss inside the blazar jet. We consider a power-law injection of protons into the interstellar medium (ISM) following Eqn.~\ref{eqn:UHECR_injection}. We have considered proton injection into ISM between E$_{p, \rm min}$= 0.1 EeV and E$_{p, \rm max}=100$ EeV. The injection spectral index $\alpha_p=2.2$ is the same as for leptons. In the UHECR interaction model, we consider the three-dimensional propagation of UHECRs to calculate the fraction of them that survives within $0.1^\circ$ degrees of initial emission direction and denote it by $\xi_B$. Protons are propagated from the source at a comoving distance $\sim200$ Mpc and collected over a spherical region of radius 1 Mpc. We consider a random turbulent EGMF given by a Kolmogorov power spectrum and an RMS field strength of B$_{\rm rms}\approx10^{-5}$ nG and a coherence length of 0.5 Mpc using wave modes between 80 kpc and 2.25 Mpc. The distribution of survival fraction with deflection angle is shown in Fig.~\ref{fig:UHECR_Distribution}. We multiply the flux of cosmogenic $\gamma$-ray spectrum by $\xi_B$ to take into account the $\gamma$-rays reaching the observer from the direction of the blazar. The \textit{Fermi}-LAT resolution to a single photon above 10 GeV is $\sim 0.15^\circ$. Plot (b) of Fig.~\ref{fig:Mrk180_SED} is the resulting fit corresponding to this model. The green curve indicates the spectrum of cosmogenic photons. The required power in UHECR protons is calculated in the following manner \citep{Das_2020}, \begin{equation} P_{\rm UHECR} = \dfrac{2\pi d_L^2(1-\cos\theta_{\rm jet})}{\xi_B f_{\rm CR}} \int_{\epsilon_{\gamma,\rm min}}^{\epsilon_{\gamma,\rm max}} \epsilon_\gamma\dfrac{dN}{d\epsilon_\gamma dAdt}d\epsilon_\gamma \label{eqn:UHECR_Luminosity} \end{equation} where d$_L$ is the luminosity distance of Mrk 180, $\theta_{\rm jet}$ is jet opening angle, $\xi_B$ is the the survival rate of UHECR within 0.1$^\circ$ of the direction of propagation to the observer. The quantity $f_{\rm CR}$ is the fraction of UHECR luminosity that goes into cosmogenic $\gamma$-rays and depends on the propagation distance. The integration is done over the cosmogenic photon spectrum allowed by the observed SED. d$_L$ is 207 Mpc, $\theta_{\rm jet}$ is 0.1 radians (we have considered typical value of $\theta_{\rm jet}$ or jet opening angle) \citep{Finke_2019, refId0} and $\Gamma$=20. For the chosen parameters, $\xi_B=$ 0.85 and $f_{\rm CR}=0.03$. Putting these values in Eqn. \ref{eqn:UHECR_Luminosity}, P$_{\rm UHECR}$ has been calculated. Finally, we add up the total power carried by the leptons and P$_{\rm UHECR}$ and get the total jet power for this model to be 2.9$\times10^{43}$ erg/s, which is less than the Eddington luminosity of Mrk 180 by several orders of magnitude. The best-fitted values of this model are tabulated in the second column of Table~\ref{tab:GAMERA_Fitting_param}. In this case, the highest energy MAGIC data point can be fitted, but the fit to the X-ray data points has not improved. \par We subsequently consider the $pp$ interactions within the jet. As explained in sec. \ref{subsec:pp}, the relativistically accelerated protons interact with cold protons and produced neutral and charged pions which decay into photons, leptons, and neutrinos. A power-law proton spectrum is injected within the blob with a spectral index $\alpha_p$=2.2, minimum (E$_{\rm p,min}$) and maximum energy (E$_{\rm p,max}$) 10 GeV and 10$^4$ GeV respectively and the cold proton density is assumed to be n$_{\rm H}$=1.2$\times10^6$ cm$^{-3}$. These parameter values have been presented in the third column of Table~\ref{tab:GAMERA_Fitting_param}. Previously, \citet{PhysRevD.99.103006} showed $pp$ interaction model can explain the observed high-energy $\gamma$-rays from the blazar TXS 0506+056 for n$_{\rm H}=1.68\times10^6$ cm$^{-3}$. \cite{AHARONIAN2000377} showed that high-energy $\gamma$-ray production in an AGN jet via $pp$ interaction demands high cold proton density. To interpret the reported TeV flares of Markarian 501 by $pp$ interactions, they showed n$_{\rm H}$ should exceed $10^6$ cm$^{-3}$. In our work, we have optimized the values of the injection luminosity and the cold proton density (n$_{\rm H}$) in such a way that the total jet power is less than the Eddington luminosity of Mrk 180. From plot (a) of Fig~\ref{fig:Mrk180_SED} we can see that the SED from the pure leptonic model cannot fit the Swift UV data points. The slope of the observed X-ray and the $\gamma$-ray data points cannot be explained with the slope of the theoretical SED, also it poorly fits the $\gamma$-ray data points. The residual plot corresponding to the pure leptonic model shows this model poorly fits the Swift UV data, X-ray, and MAGIC data. From plot (b) in Fig \ref{fig:Mrk180_SED} it can be seen that UHECR interactions make the fit better for the MAGIC data points but the slope of the SED from this model does not match the slope of the X-ray data. Moreover, the Swift UV data cannot be fitted well with this model. The residual plot corresponding to this model looks almost the same as that of the pure leptonic model between 10$^{-5}$- 10$^{11}$ eV, except for the MAGIC data (cyan solid circular) points. Plot (c) in Fig \ref{fig:Mrk180_SED} shows improvement in both SED and the residuals. The SED fits the Swift UV data points, and matches the slope of the X-ray data and the $\gamma$-ray data. The residual plot corresponding to this model shows that the residuals for the Swift UV data points lie in between $\sim\pm10$, whereas they lie in between +10 to +20 in plot (a) and plot (b). In plot (c), the residuals for the Swift XRT \& XMM-Newton MOS data lie within $\pm10$ and the XMM-Newton pn data lie out of +10. In the previous two plots i.e. plot (a) and plot (b), all the residuals for the X-ray data points lie within +10 to -20. It is clear from the residual plot that the SED is not very well fitted which is why we are getting large values of the residuals. We have not shown the residuals for the Swift Optical data points, as they cannot be fitted with any of these models. Most of the $\gamma$-ray data points can be fitted in this model. The total jet power corresponding to each model is less than the Eddington luminosity of Mrk 180, which has been mentioned in Table \ref{tab:GAMERA_Fitting_param}.\\ \subsection{UHECRs from Mrk 180} It has been proposed earlier \citep{PhysRevD.93.043011} that Mrk 180 may be a source contributing to the UHECR hotspot observed by the Telescope Array (TA) collaboration above 57 EeV. We propagate UHECRs from the source to the Earth in a random turbulent magnetic field given by the Kolmogorov power spectrum. We consider three different combinations of the RMS value of the EGMF and composition at the source as shown in Fig.~\ref{fig:aniso}. The turbulence correlation length of the EGMF is taken to be ~0.5 Mpc. The Galactic magnetic field model (GMF) is considered to be the one given in \cite{Jansson:2012pc}. We inject cosmic rays with a generic power-law spectrum given by $dN/dE\sim E^{-2}$ and perform three-dimensional simulations including both GMF and EGMF in \textsc{CRPropa 3} \citep{AlvesBatista:2016vpy, AlvesBatista:2022vem}. We consider two cases of composition with extreme masses, viz., $^1$H and $^{56}$Fe. For pure proton injection, the magnetic rigidity is higher and the resulting deflection is low. We show the case of B$_{\rm rms}\sim 10^{-3}$ nG and $10^{-5}$ nG in the left and middle panel of Fig.~\ref{fig:aniso} for proton injection. For the same injected luminosity, the number of detected events in the former case is 35, while that for the latter increases by almost three orders of magnitude. It can be seen that even with Fe injection (cf. right panel in Fig.~4), the angular width of the source observed through UHECRs doesn't show a significant change; although, the observed energy spectrum is different. Due to the photo-disintegration of the nuclei traversing a comoving distance of $\sim200$ Mpc, the observed events at Earth for the energy range considered are all protons. Thus, it can be seen that for optimistic magnetic field values considered, the contribution of this source to the TA hotspot is disfavored, unless, very high magnetic fields $\mathcal{O}\sim1$ nG or higher are considered. Although a higher spread in the arrival direction is expected if the detection threshold is lowered, the Galactic magnetic field shadows the directional signatures. Thus, Mrk 180 may not be a plausible UHECR source for explaining the TA hotspot. \section{\label{sec:discussion}Discussions} Being at a redshift of 0.045, Mrk 180 is an interesting source to study the radiative mechanisms producing TeV $\gamma$-rays. VHE $\gamma$-ray emission from this source was detected by MAGIC in 2006 \citep{Albert_2006} followed by an enhanced optical state. This source has been monitored by several telescopes viz. \textit{Fermi}-LAT, Swift, XMM-Newton, MOJAVE, MAGIC, KVA, ASM, RATAN-600, Mets\"{a}hovi, Effelsberg, IRAM throughout the year. Previously, \cite{https://doi.org/10.48550/arxiv.1110.6341} and \cite{https://doi.org/10.48550/arxiv.1109.6808} studied this source using multi-wavelength data. They have discussed about the results of the multi-wavelength campaign in 2008 covering radio to TeV $\gamma$-ray observations. At that time Mrk 180 was known to be a TeV $\gamma$-ray source detected by MAGIC only a couple of years back. Their study reported the first multi-wavelength campaign on Mrk 180. Optical observation was carried out by KVA telescope simultaneously with TeV $\gamma$-ray observation with MAGIC. The radio observation was carried out with RATAN-600, Mets\"{a}hovi, Effelsburg and IRAM. Swift XRT detected flux variability in X-rays. In the same observation window of Swift XRT, Mets\"{a}hovi and AGILE could not detect this source. \textit{Fermi}-LAT light curve showed enhancement in $\gamma$-ray flux during the second flare. \par They tried to explain the simultaneous multi-wavelength SED of Mrk 180 by two models: (1) a one-zone SSC model (2) a self-consistent two-zone SSC model; they considered the injected electron spectrum as a broken power-law distribution. It can be seen in \cite{https://doi.org/10.48550/arxiv.1110.6341} that during the high state both the models cannot explain the multi-wavelength data properly. The steep X-ray spectrum and high optical flux could not be explained simultaneously assuming they were produced in the same zone. Moreover, in the two-zone SSC model the required value of the Doppler factor $\delta$ is very high. During the low X-ray state both the models can explain the SED for moderate values of parameters. \cite{Nilsson_2018} studied R-band long-term optical data (over a span of $\sim$10 years) of 31 northern blazars and Mrk 180 is one of them. They could not find any significant periodicity for this source. The earlier multi-wavelength studies on Mrk 180 have been complemented in this work with more data analysis and theoretical modeling of the SED over a long period of observations. For the temporal study, we analyzed 12.8 years (MJD 54682.65- 59355.67) of \textit{Fermi}-LAT $\gamma$-ray data. Fig.~\ref{fig:Mrk180_LC} is the long-term \textit{Fermi}-LAT $\gamma$-ray light curve in 30-day bin. No $\gamma$-ray flux enhancement has been found from this long-term light curve, also the error bars of the high-energy $\gamma$-ray data points are large to carry on a detailed temporal study on this source. To know about the physical processes we studied the long-term SED of Mrk 180. For this study, we have used multi-wavelength data from MOJAVE, MAGIC, Swift, XMM-Newton, and \textit{Fermi}-LAT. The SED shows typically the double hump structure. We have modeled this multi-wavelength SED with GAMERA. We have considered a simple one-zone spherical emission region within the jet. In Fig.~\ref{fig:Mrk180_SED}, we have shown the modeled multi-wavelength SEDs with different models e.g. pure leptonic, lepto-hadronic. Also, we have shown the residual plots of each model, attached just below that particular SED. The results of the multi-wavelength SED modeling with different models have already been discussed in Sec.~\ref{sec:results}. The leptonic modeling is not sufficient to explain the multi-wavelength SED of Mrk 180. We have considered two lepto-hadronic models to improve the fit to the observed data points. The first model involves interactions of UHECRs injected by Mrk 180 with the radiation backgrounds, and in the second model, we have considered interactions of relativistic protons in the jet with the cold protons. The latter gives a slightly better fit to the data, however, more observational data is necessary to explain the radiation mechanisms in Mrk 180, as our results show large values of residuals in all the cases. We look forward to future multi-wavelength campaigns to cover all the frequencies over a long time period to monitor this source more closely. \par \cite{PhysRevD.93.043011} calculated the probability associated with some sources to be the contributors to the TA hotspot, Mrk 180 is one of them. It is important to know the role of Mrk 180 as a UHECR accelerator, and whether it can generate events above 57 EeV. In our study for conservative values of EGMF, Mrk 180 is disfavoured as a source of the UHECR events contributing to the TA hotspot. \section{\label{sec:conclusion}Conclusion} The HBL Mrk 180, at a redshift of 0.045, is an interesting source to study the emission covering radio to VHE $\gamma$-ray frequency. We have analyzed the \textit{Fermi}-LAT $\gamma$-ray data detected from this source over a period of 12.8 years. The light curve analysis does not show any significant variation in flux. We have studied the long-term multi-wavelength SED of this source to understand the physical processes which can explain the HBL nature of this source. We modeled the multi-wavelength SED with a time-dependent code `GAMERA'. It is found that a single-zone pure leptonic model cannot explain the multi-wavelength spectrum of Mrk 180 properly. We considered single-zone lepto-hadronic models to obtain better fits to the data. The residuals of the three models are compared and the $pp$ interaction model is found to give a better fit to the multi-wavelength data compared to the other two models. More observational data covering the radio to VHE $\gamma$-ray frequency would be useful to explore the emission mechanisms of Mrk 180. The possible association of Mrk 180 with the TA hotspot events above 57 EeV has also been examined using the simulation framework \textsc{CRPropa 3} \citep{AlvesBatista:2016vpy, AlvesBatista:2022vem}. We conclude that for conservative values of EGMF, Mrk 180 is disfavoured as a source of the UHECR events contributing to the TA hotspot. \section{Software and third party data repository citations} \label{sec:cite} The \textit{Fermi}-LAT $\gamma$-ray data analysis was done with `Fermipy' \citep{2017ICRC...35..824W}. Swift X-ray, Ultraviolet \& Optical data have been analyzed with `Heasoft'. To analyze XMM-Newton data, we have used Science Analysis System (SAS). \begin{acknowledgments} S.K.M. thanks T. Ghosh, Hemanth M., A. D. Sarkar for useful discussions. This research has made use of data from the MOJAVE database that is maintained by the MOJAVE team \citep{2018ApJS..234...12L}. \end{acknowledgments} \facilities{Swift(XRT and UVOT), XMM-Newton, \textit{Fermi}-LAT, MAGIC.} \software{Fermipy (\url{https://fermipy.readthedocs.io/en/latest/}), Heasoft (\url{https://heasarc.gsfc.nasa.gov/docs/software/lheasoft/}), SAS (\url{https://www.cosmos.esa.int/web/xmm-newton/sas-threads}), GAMERA (\url{http://libgamera.github.io/GAMERA/docs/main_page.html}), CRPropa 3 (\url{https://crpropa.github.io/CRPropa3/})}.
\subsection{Learning Formulation} We formulate the learning problem as predicting whether a map is stale by fusing local HD map representations and incoming sensor data. We assume accurate pose is known. At training time, we assume access to training examples in the form of triplets $(x,x^*, y)$, where $x$ is a local region of the map, $x^*$ is an online sensor sweep, and $y$ is a binary label suggesting whether a ``significant'' map change occurred. $(x,x^*)$ should be captured in the same location. We explore a number of architectures to learn a shared map-sensor representation, including early fusion and late fusion (see Figure \ref{fig:learningarchitectures}). The late fusion model uses a siamese network architecture with two input towers, and then a sequence of fully connected layers. We utilize a two-stream architecture \cite{Han15cvpr_MatchNet, Zbontar15cvpr_matchingcost} with shared parameters, which has been shown to still be effective even for multi-modal input \cite{Lambert18cvpr_DLUPI}. We also explore an early-fusion architecture, where the map, sensor, and/or semantic segmentation data are immediately concatenated along the channel dimension before being fed to the network. We take no credit for these convnet architectures, which are well studied. \begin{figure}[] \centering \vspace{-2em} \subfloat[Early Fusion (Sensor + Map)]{ \includegraphics[width=0.20\columnwidth]{latex/figs/arch_figs/early_fusion_arch_v2_sensor_map_colored_bold.png} } \hspace{3mm} \subfloat[Early Fusion (Sensor + Semantics + Map)]{ \includegraphics[width=0.20\columnwidth]{latex/figs/arch_figs/early_fusion_arch_v2_sensor_map_labelmap_colored_bold.png} } \hspace{3mm} \subfloat[Late Fusion (Siamese)]{ \includegraphics[width=0.20\columnwidth]{latex/figs/arch_figs/late_fusion_siamese_arch_colored_bold.png} } \hspace{3mm} \subfloat[Map-Only Input]{ \includegraphics[width=0.20\columnwidth]{latex/figs/arch_figs/map_only_arch_colored_bold.png} } \caption{Learning architectures we explore for the map change detection problem.} \label{fig:learningarchitectures} \end{figure} \begin{figure*} \vspace{-1em} \centering \subfloat[Lane marking color is changed from solid white to implicit (see bottom-center of image)]{ \includegraphics[width=0.47\columnwidth]{latex/figs/synthetic_change_examples/change_lane_marking_color_triplets_L7mPbb4aHvRTJyGfFbjWzC9aQPKr4nmP__2020-09-30-Z1F0094_315967212959984000_rgb_interpTruelinear_projmethodray_tracing.jpg} } \vspace{-2mm} \hspace{2mm} \subfloat[A crosswalk is deleted from the map. Reflections off of windows create illumination variation on the road surface.]{ \includegraphics[width=0.47\columnwidth]{latex/figs/synthetic_change_examples/delete_crosswalk_F6ZWoR9kHt0hZNpl957LNoL5X4zXxU4T__2020-09-09-Z1F0016_315969995859970000_rgb_interpTruelinear_projmethodray_tracing.jpg} } \hspace{2mm} \subfloat[A bike lane is added to the map (see center-right of image)]{ \includegraphics[width=0.47\columnwidth]{latex/figs/synthetic_change_examples/add_bike_lane_gbHGOET1HbVZJdx3yqOOTDM2WqpekPjN__2020-09-15-Z1F0035_315978679660935000_rgb_interpTruelinear_projmethodray_tracing.jpg} } \vspace{-2mm} \hspace{2mm} \subfloat[The structure of a lane boundary marking is changed, from double-solid yellow to single-solid yellow (see bottom-center of image). Its color is preserved.]{ \includegraphics[width=0.47\columnwidth]{latex/figs/synthetic_change_examples/change_lane_boundary_dash_solid_P4qIURJEN8793diggvoNdfPI3PzfjbCz__2020-09-02-Z1F0094_315973176360204000_rgb_interpTruelinear_projmethodray_tracing.jpg} } \hspace{2mm} \subfloat[A crosswalk is synthetically inserted into the map.]{ \includegraphics[width=0.47\columnwidth]{latex/figs/synthetic_change_examples/insert_crosswalk_H91EeVeJLXXBJJ1ZD2IcyLd6KLs3xZLO__2020-09-09-Z1F0091_315975263159624000_rgb_interpTruelinear_projmethodray_tracing.jpg} } \hspace{2mm} \subfloat[A solid white lane boundary marking is deleted (see top-center of image).]{ \includegraphics[width=0.47\columnwidth]{latex/figs/synthetic_change_examples/delete_lane_marking_PjpQcKDtMpCzt9VMGAUFxwKouYBjf4d1__2020-09-21-Z1F0074_315973886159906000_rgb_interpTruelinear_projmethodray_tracing.jpg} } \caption{Examples of our 6 types of synthetic map changes (zoom in for detail). Each row represents a single scene. \emph{Left:} bird's eye view (BEV) sensor data representation. \emph{Center:} rasterized onboard map representation (positive). \emph{Right:} synthetic perturbation of onboard map (negative). We use red to denote implicit lane boundaries. } \label{fig:6-types-synthetic-changes} \vspace{-1em} \end{figure*} \subsection{Synthesis of Mismatched Data} \label{sec:tbv-synthesis-mismatched-data} Real negatives are difficult to obtain; because their location is difficult to predict a priori, they cannot be captured in a deterministic way by driving around an urban area on any particular day. Therefore, rather than using real negatives for training, we synthesize fake negatives. While sensor data is difficult to simulate, requiring synthesis of sensor measurements from the natural image manifold \cite{Yang20cvpr_SurfelGAN,Chen21cvpr_GeoSim}, manipulating vector maps is relatively straightforward.\\ Synthetic data generation via randomized rendering pipelines can be highly effective for synthetic-to-real transfer \cite{Shotton11cvpr_RealtimePose}. In order to synthesize fake negatives from true positives, one must be able to trust the fidelity of labeled true positives. In other words, one must trust that for true positive logs, the map is completely accurate for the corresponding sensor data. We perturb the data in a number of ways (See Appendix). Once such fidelity is confirmed and assured, vector map manipulation is trivial because map elements are vector entities which can be perturbed, deleted, or added. \\ While synthesizing random vector elements is trivial, sampling from a realistic distribution requires conformance to priors, including the lane graph, drivable area, and intersection. We aim for synthetic map/sensor deviations to resemble real world deviations, and real world deviations tend to be subtle, e.g. a single lane is removed or painted a different color, or a single crosswalk is added, while 90\% of the scene is still a match. In order to generate realistic-appearing synthetic map objects, we hand-design a number of priors that must be respected for a perturbed example to enter our training set as a valid training example (see Appendix). Figure \ref{fig:6-types-synthetic-changes} and Table \ref{tab:perturbationstatistics} of the Appendix enumerate a full list of the 6 types of synthetic changes we employ. \subsection{Sensor Data Representation} \label{sec:tbv-sensor-data-repr} We experiment with two sensor data representations -- \emph{ego-view} (the front center camera image) and \emph{bird's eye view} (BEV). Rather than using Inverse Perspective Mapping (IPM) \cite{Geiger09ivs_MonocularRoadMosaicing,Zhang14icrb_LaneLevelOrthophoto,Rapo18thesis_orthoimagery}, we generate the BEV representation (i.e. orthoimagery) by ray-casting image pixels to a ground surface triangle mesh. For ray-casting, we use a set of camera sensors with a panoramic field of view, mounted onboard an autonomous vehicle. The temporal nature of the data is exploited as pixel values from 7 streams of ego-view images are aggregated to render each BEV image in order to reduce sparsity (see Appendix). 70 images, capturing 10 timesteps from each of 7 frustums, are used to create each rendering. \subsection{Map Data Learning Representation} We render our map inputs as rasterized images; Entities are layered from the back of the raster to the front in the following order: driveable area, lane segment polygons, lane boundaries, pedestrian crossings (i.e. crosswalks). We release the API to generate and render these map images. Vector map entities are synthetically perturbed before rasterization for synthetic negative examples. \section*{Appendix} In this appendix, we provide additional details about our dataset and experiments. In Section (A), we provide an ablation study on the influence of input crop size on model performance. In Section (B), we discuss additional implementation details about our training, data augmentation, and occlusion-based map rendering process. In Section (C), we discuss the paired positive-negative logs we include. In Section (D), we describe our evaluation metric. In Section (E), we provide additional experimental analysis of different models and rendering viewpoints. In Section (F), we provide additional details about how we generate orthoimagery. In Section (G), we offer additional examples from our test set. In Section (H), we give examples of other types of temporary map changes which we do not annotate or evaluate within our dataset. In Section (I) we provide further analysis of the frequency of map changes. In Section (J), we give additional details about our synthetic map perturbation protocol. In Section (K), we provide a datasheet for the dataset. \section*{Appendix A: Influence of Input Crop Size} In this section, we perform an ablation on input crop size, as discussed in Section \ref{sec:impl-details} of the main text. In the main paper, we set our input crop size to $224 \times 224$ px for all experiments mentioned therein. In this section, we present an ablation to measure the influence of input crop size. Again, we find the ego-view model is the best-performing model, as measured on its own field of view. Perhaps surprisingly, we find that an RGB image at $234 \times 234$ px resolution ($\sim$ 164K pixel values/image) is sufficient to capture significant detail. In Table \ref{tab:resolutionablation}, we present an ablation where we find that for BEV models, higher resolution (i.e. $468 \times 468$ px) does improve mAcc by $2\%$ mAcc, although requiring almost 4x the GPU memory during training and significantly longer training times. However, for ego-view models, a higher crop size is quite detrimental, reducing visibility-based mAcc by around 7\%. \begin{table*}[h] \caption{Controlled evaluation of the influence of input crop size (for ego-view and BEV), on \emph{TbV-Beta}.} \centering \begin{adjustbox}{max width=\columnwidth} \begingroup \begin{tabular}{c llc ccc c ccc ccc} \toprule & & & & \multicolumn{3}{|c|}{\textsc{Modalities}} & \textsc{Visibility-based} & \multicolumn{3}{|c|}{\textsc{BEV proximity}} & \multicolumn{3}{|c}{\textsc{Visibility-based}} \\ & & & & \multicolumn{3}{|c|}{} & \textsc{Eval. @ 20m} & \multicolumn{3}{|c|}{\textsc{Eval. @20m}} & \multicolumn{3}{|c}{\textsc{Eval. @20m}} \\ \textsc{Resolution} &\textsc{Backbone} & \textsc{Arch.} & \textsc{Viewpoint} & \multicolumn{1}{|c}{\textsc{RGB}} & \textsc{Semantics} & \multicolumn{1}{c|}{\textsc{Map}} & \textsc{val} & \multicolumn{1}{|c}{\textsc{test}} & \textsc{Is Changed} & \textsc{No Change} & \multicolumn{1}{|c}{\textsc{test}} & \textsc{Is Changed} & \textsc{No Change} \\ & & & & \multicolumn{1}{|c}{ } & & \multicolumn{1}{c|}{ } & \textsc{mAcc} & \multicolumn{1}{|c}{\textsc{mAcc}} & \textsc{Acc} & \textsc{Acc} & \multicolumn{1}{|c}{\textsc{mAcc}} & \textsc{Acc} & \textsc{Acc} \\ \midrule 224x224 & ResNet-18 & Early Fusion & Ego-View & \checkmark & dropout & dropout & 0.8384 & \textbf{0.6850} & \textbf{0.63} & 0.74 & \textbf{0.7342} & \textbf{0.72} & 0.74 \\ 448x448 & ResNet-18 & Early Fusion & Ego-View & \checkmark & dropout & dropout & 0.8713 & 0.6331 & 0.38 & \textbf{0.88} & 0.6644 & 0.45 & \textbf{0.88} \\ \hline 224x224 & ResNet-50 & Early Fusion & BEV & \checkmark & no & \checkmark & 0.9007 & 0.6543 & 0.57 & 0.74 & & & \\ 448x448 & ResNet-50 & Early Fusion & BEV & \checkmark & no & \checkmark & \textbf{0.9072} & 0.6749 & \textbf{0.63} & 0.72 & & & \\ \bottomrule \end{tabular} \endgroup \end{adjustbox} \label{tab:resolutionablation} \end{table*} \section*{Appendix B: Additional Implementation Details} \subsection*{B.1. Training} We train our models for 90 epochs with the Adam \cite{Kingma14arxiv_Adam} optimizer. We use a polynomial learning rate decay strategy, starting at $1 \times 10^{-3}$. We use a batch size of 1024 examples. We start with pretrained ImageNet weights for ResNet-18 or ResNet-50 \cite{He16cvpr_ResNet}. We train with multiple negative examples per sensor image, which we found to be more beneficial than randomly sampling a single negative example (i.e. a synthetically perturbed map). In other words, we perform multiple types of perturbations for a given scene, and feed them to the network as separate negative examples (not necessarily in the same mini-batch). \subsection*{B.2. Data Augmentation} We employ a number of data augmentation techniques to improve the generalization of our models and prevent overfitting. Input images are of dimension $2048 \times 1550$ for the front-center camera, and $1550 \times 2048$ for all other 6 cameras. For the ego-view models, we first take a square crop from the bottom $1550 \times 1550$ of an ego-view image. Afterwards, we resize to $234 \times 234$, perform a random horizontal flip with 50\% probability, take a random $224 \times 224$ crop, divide pixel intensities by 255, and then normalize both sensor and map RGB channels by the ImageNet mean $(\mu_r,\mu_g,\mu_b) = (0.485, 0.456, 0.406)$ and standard deviation $(\sigma_r,\sigma_g,\sigma_b)=(0.229, 0.224, 0.225)$ For BEV models, we resize input images from $2000 \times 2000$ px to $234 \times 234$ px, perform a random horizontal and/or vertical flip with 50\% probability each (independently), choose a random $224 \times 224$ crop, and normalize as described above. We find other traditional data augmentation techniques from the semantic segmentation literature \cite{Zhao17cvpr_PSPNet}, such as applying a random rotation to the input or randomly blurring the input with a small kernel, to be ineffective. \subsection*{B.3. Occlusion Reasoning} As discussed in Section \ref{sec:impl-details} of the main text, we use map occlusion reasoning when generating the input for our ego-view models. Occluded map elements and map elements that have been removed in the real world (``deleted'') are both not visible in camera imagery. While the former is an expected everyday occurrence, and the latter is of interest to us, we use occlusion reasoning in order to separate the two phenomena. We generate a dense depth map from sparse LiDAR returns (see Figure \ref{fig:depth-map}) and the depth of map entities is compared against the corresponding depth of its projection in the depth map. \begin{figure}[htb] \vspace{-2mm} \centering \subfloat[RGB Image]{ \includegraphics[width=0.25\columnwidth]{latex/figs/depth_map/tbv_depth_map_example_rgb.jpg} } \subfloat[Interpolated Depth Map]{ \includegraphics[width=0.25\columnwidth]{latex/figs/depth_map/tbv_depth_map_example_depth.jpg} } \caption{Example of a dense depth map interpolated from sparse LiDAR returns. } \label{fig:depth-map} \end{figure} \subsection*{B.4. Details about Semantic Label Map Input} As discussed in Section \ref{sec:impl-details} of the main text, we use semantic label maps generated from the semantic head of a publicly-available seamseg ResNet-50 panoptic segmentation model \cite{Porzi19cvpr_Seamseg} \footnote{Available at \url{https://github.com/mapillary/seamseg}.}. We create 5 binary mask channels from the semantic label map, for the `road', `bike-lane', `marking-crosswalk-zebra', `lane-marking-general', and `crosswalk-plain' classes. These are optionally provided as additional channels to the 3 RGB sensor channels and 3 RGB map channels via early fusion. Seamseg's semantic label maps on their own do not capture sufficient granularity for the map change detection task we define, since the Mapillary Vistas public dataset's taxonomy does not differentiate between lane color and or different marking types (e.g. double-solid, solid, dashed-solid), which are of interest to autonomous vehicle operation. \noindent\textbf{Unsuitability of Per-Pixel Semantic Comparison.} Directly comparing rendered map and semantic label maps at a \emph{per-pixel} level is not always useful since our HD map representation does not provide paint annotation for every single dashed longitudinal lane marking, but rather provides a description lane marking pattern, polyline boundary, and other corresponding attributes (See Table \ref{tab:mapattributes} of the main text). Thus, we can simulate the pattern of dashed lane markings, but not their exact, pixel-perfect location. As the main text shows, the network can abstract away the per-pixel details to provide more meaningful features. \section*{Appendix C: Data Selection} For a subset of the `negative' logs in our TbV dataset, we provide a corresponding `positive' log captured before the change occurred. Example images from pair positive-negative logs are provided in Figure \ref{fig:before-and-after}. This allows for non-learning based approaches (e.g. based upon comparison of 3d reconstructed world models) for a limited amount of the test set. \begin{figure*} \centering \subfloat[Before (WDC)]{ \includegraphics[width=0.21\columnwidth]{latex/figs/before_after_figs_2021_08_28/YEDRWy1MYuf5IONz4gQmQwAVuVQzkovm__2020-07-02-Z1F0055} } \subfloat[After (WDC)]{ \includegraphics[width=0.21\columnwidth]{latex/figs/before_after_figs_2021_08_28/YEDRWy1MYuf5IONz4gQmQwAVuVQzkovm__2020-11-10-Z1F0014} }\hspace{10mm} \subfloat[Before (PIT)]{ \includegraphics[width=0.21\columnwidth]{latex/figs/before_after_figs_2021_08_28/pbADFDy5ElABBs4vTFGnGtkQjTqIDKyD__2020-06-10-Z1F0049} } \subfloat[After (PIT)]{ \includegraphics[width=0.226\columnwidth]{latex/figs/before_after_figs_2021_08_28/pbADFDy5ElABBs4vTFGnGtkQjTqIDKyD__2020-07-23-Z1F0012____v2} } \hspace{2mm} \subfloat[Before (MIA)]{ \includegraphics[width=0.202\columnwidth]{latex/figs/before_after_figs_2021_08_28/bjalGQhAZWMLh50K0poYHX6GcXxnJPom__2020-06-23-Z1F0042} } \subfloat[After (MIA)]{ \includegraphics[width=0.21\columnwidth]{latex/figs/before_after_figs_2021_08_28/9nS3_LogId79188___2020_10_22} }\hspace{10mm} \subfloat[Before (PIT)]{ \includegraphics[width=0.21\columnwidth]{latex/figs/before_after_figs_2021_08_28/M1i5AzP87MCdHfNnEMRS3RmqgMIaEKwv__2020-07-13-Z1F0035_anon} } \subfloat[After (PIT)]{ \includegraphics[width=0.205\columnwidth]{latex/figs/before_after_figs_2021_08_28/M1i5AzP87MCdHfNnEMRS3RmqgMIaEKwv__2020-09-14-Z1F0018} } \hspace{2mm} \subfloat[Before (PAO)]{ \includegraphics[width=0.21\columnwidth]{latex/figs/before_after_figs_2021_08_28/Nr6t0auYyTEC42fJNIqhkaSasyGjfV6E__2020-10-12-Z1F0052} } \subfloat[After (PAO)]{ \includegraphics[width=0.21\columnwidth]{latex/figs/before_after_figs_2021_08_28/Nr6t0auYyTEC42fJNIqhkaSasyGjfV6E__2020-06-22-Z1F0064} }\hspace{10mm} \subfloat[Before (PIT)]{ \includegraphics[width=0.21\columnwidth]{latex/figs/before_and_after_figs/HPd_before.jpeg} } \subfloat[After (PIT)]{ \includegraphics[width=0.21\columnwidth]{latex/figs/before_and_after_figs/HPd_after.jpeg} } \hspace{2mm} \subfloat[Before (PIT)]{ \includegraphics[trim=0 0 0 500,clip,width=0.16\columnwidth]{latex/figs/before_after_figs_2021_08_28/0WHfUzbQi8mopDFgQ7BH7lGjgCEygaoN__2020-07-17-Z1F0025} } \subfloat[After (PIT)]{ \includegraphics[width=0.28\columnwidth]{latex/figs/before_after_figs_2021_08_28/0WHfUz___LogID71022___2020_02_14_anon} }\hspace{10mm} \subfloat[Before (MIA)]{ \includegraphics[width=0.28\columnwidth]{latex/figs/before_after_figs_2021_08_28/SP1_screenshot_feb2020} } \subfloat[After (MIA)]{ \includegraphics[trim=0 0 0 500,clip,width=0.13\columnwidth]{latex/figs/before_after_figs_2021_08_28/SP1puuZR5pn6JY3eT7qIU9XQbw3qh2iK__2020-07-29-Z1F0017} } \hspace{2mm} \subfloat[Before (WDC)]{ \includegraphics[trim=0 0 0 500,clip,width=0.16\columnwidth]{latex/figs/before_after_figs_2021_08_28/X1yjCkSira47fXPmQVIANIrJ85YWLTUo__2020-09-29-Z1F0069} } \subfloat[After (WDC)]{ \includegraphics[width=0.28\columnwidth]{latex/figs/before_after_figs_2021_08_28/X1yjCkSira___LogId64135___2019_09_13_anon} } \hspace{10mm} \subfloat[Before (MIA)]{ \includegraphics[trim=0 0 0 300,clip,width=0.2\columnwidth]{latex/figs/before_and_after_figs/9nS3Y_before.jpeg} } \subfloat[After (MIA)]{ \includegraphics[width=0.22\columnwidth]{latex/figs/before_and_after_figs/9nS3Y_after.jpeg} } \caption{For a number of `negative' logs, our TbV dataset includes corresponding logs captured before the map change was implemented, such that we obtain ``before and after'' imagery. We use the following abbreviations for city names: Washington, DC (WDC), Miami, FL (MIA), Pittsburgh, PA (PIT), Palo Alto, CA (PAO), Austin, TX (ATX), Detroit, MI (DTW).} \label{fig:before-and-after} \end{figure*} \section*{Appendix D: Evaluation} As our primary accuracy metric, we use a mean of class accuracies over two classes. This accounts for both precision and recall. If a confusion matrix is computed with predicted entries on the rows and actual classes as the columns, and normalized by dividing by the sum of each column, 2-class accuracy can be simply calculated as the mean of the diagonal of the confusion matrix. More formally, let $n_{cl}=2$ be the number of classes, $\hat{y}_i$ be the prediction for the $i$'th test example, and $y_i$ be the ground truth label for the $i$'th test example. We define per-class accuracy ($\text{Acc}_c$) and mean accuracy (mAcc) as: \footnotesize \begin{equation} \text{mAcc} = \nicefrac{1}{n_{cl}} \sum\limits_{c=0}^{n_{cl}} Acc_{c}, \hspace{3mm} \text{Acc}_c = \frac{\sum\limits_{i=0}^N \mathbbm{1}\{ \hat{y}_i = y_i\} \cdot \mathbbm{1}\{ y_i = c \} }{\sum\limits_{i=0}^N \mathbbm{1}\{y_i = c \} } \end{equation} \normalsize \section*{Appendix E: Additional Experimental Analysis} \paragraph{Advantages of BEV.} In principle, the bird's eye view (BEV) representation (orthoimagery) offers two main advantages: a single, dense, accumulated metrically-accurate representation for a single pass through a network, rather than passing in 7 images through 7 separate networks, trained on each frustum, in order to detect changes to the sides and rear of the vehicle. This approach can be costly at inference time given the number of camera frustums required to achieve a panoramic view with traditional cameras. Second, the BEV is generally free of distortion, compared to the ego-view. The ego-view can be seen as ``spoiling'' the map data's metric nature. \paragraph{Advantages of Ego-view.} However, an ego-view perspective also presents clear advantages over the BEV. Rendering data in the BEV can be seen as ``spoiling'' the sensor data's texture. Importantly, there is less distraction and less overall content to reason about in the egoview. Therefore, the ego-view task is arguably easier than the BEV task, needing only to detect changes in a $85^{\circ}$ f.o.v. instead of $360^{\circ}$ f.o.v. \paragraph{Analysis of Map-Only Baseline.} The map-only baseline performs quite poorly when predicting real-world lane geometry changes, slightly over random chance (2\% or 3\% over random chance in the ego-view and 7\% over random change in the BEV). While the map-only stream may seem doomed to fail without access to real-world sensor information, we observe that a certain number of map changes exist to bring the real world into compliance with certain priors, which are already encapsulated in the map. For example, we find that upgrading a 4-way intersection from a single crosswalk to 4 crosswalks, or from a single crosswalk to 0 crosswalks (after repaving) is a common map change, which would agree with priors. Indeed, our experimental results suggest that the map-only baseline, which is completely blind to the real-world, can occasionally succeed at predicting real-world crosswalk changes by learning powerful priors. Inspection via Guided GradCAM demonstrates that the map-only models attends to asymmetric paint patterns along the left and right boundaries of a road, or asymmetric lane subdivisions along two sides of a road; modifications to such map asymmetry which are common real-world map updates. \paragraph{Analysis of Sensor-Only Baseline.} The sensor-only model (see Table \ref{tab:results-modalities} of the main paper) sees randomly perturbed labels, with only ``positive'' training data, and therefore is not a meaningful baseline. \section*{Appendix F: Orthoimagery Generation Implementation Details} In this section, we provide additional details about the orthoimagery generation process described in Sections \ref{sec:tbv-sensor-data-repr} and \ref{sec:impl-details} of the main text. In order to create a metrically-accurate sensor data representation that is free of perspective distortion, we generate orthoimagery using ray-casting. Orthoimagery from LiDAR suffers from extreme sparsity, leading to an impoverished representation. To generate dense panoramic orthoimagery, we use a set of high-definition camera sensors with a panoramic field of view, mounted onboard an autonomous vehicle. We generate the BEV representation (i.e. orthoimagery) by ray-casting image pixels to a ground surface triangle mesh. Our ground height maps exploit LiDAR offline, and in this way our ego-view method incorporates the strengths of LiDAR. \paragraph{CUDA Ray-Casting Routine.} We tesselate quads from a ground surface mesh with 1 meter resolution to triangles; rays are cast to triangles up to 25 m away from the egovehicle. For acceleration, we cull triangles outside of the left and right cutting planes of each camera's view frustum. We implement the Moller-Trombore ray-triangle intersection routine \cite{Moller97jgt_FastRayTriangle} in CUDA. \paragraph{Density.} Ray-casting yields a vastly more dense set of image rays than LiDAR, on the order of 2 orders of magnitude greater density; for a $1550 \times 2048$ image, one can obtain $\sim 3.17$ million rays per image, and across 7 camera frustums, this translates to over 22.19 million rays with available RGB values per second. With 20 fps imagery per camera frustum, this amounts to 440 million rays per second. Most conventional 10 Hz LiDAR sensors can provide little more than 100k returns per sweep, and thus at most 1 million rays per second. \paragraph{Aggregation.} In order to prevent holes in the orthoimagery in the area underneath the egovehicle, we aggregate pixels in ring buffer of length 10 sweeps, and wait 10 sweeps before starting rendering. Future sensor data is not used to render the sensor data representation. We use linear interpolation to account for sparsity at range. \paragraph{Comparison with IPM.} While Inverse Perspective Mapping (IPM) is the dominant approach in the literature, it is inaccurate as it cannot account for ground surface variation. Geiger \cite{Geiger09ivs_MonocularRoadMosaicing} model the image-to-ground plane mapping as a homography (IPM) and mosaics together monocular images, but requires scenes with an approximately-planar ground surface. Zhang \emph{et al.}\cite{Zhang14icrb_LaneLevelOrthophoto} generate orthophoto ground imagery using fisheye cameras and IPM. Rapo \cite{Rapo18thesis_orthoimagery} explored the use of dashboard-mounted cell phones without access to LiDAR or known calibration, instead relying upon SfM, optical flow, and vanishing point estimation for online calibration and also use IPM for pixel-to-world correspondence. \section*{Appendix G: Additional Examples from Test Set} In Figure \ref{fig:additionaltestsetexamples}, we show additional examples from our test set, as seen from a bird's eye view. \begin{figure} \vspace{-2mm} \centering \subfloat[]{ \includegraphics[width=0.47\columnwidth]{latex/figs/histmatch_sem_testtriplets/_gs1B8ZCv7DMi8cMt5aN5rSYjQidJXvGP__2020-07-21-Z1F0076_315965601159942000_rgb_interpTruelinear_projmethodray_tracing.jpg} } \hspace{2mm} \subfloat[]{ \includegraphics[width=0.47\columnwidth]{latex/figs/histmatch_sem_testtriplets/_2p9Pwfm1KbMltk4vpv6ZWlJmZAXi5pvh__2020-08-06-Z1F0093_315972897759928000_rgb_interpTruelinear_projmethodray_tracing.jpg} } \hspace{0mm} \subfloat[]{ \includegraphics[width=0.47\columnwidth]{latex/figs/histmatch_sem_testtriplets/_FJVcWS3nQWkh9XU4TJzmCvaOXlByM947__2020-08-20-Z1F0094_315974352659825000_rgb_interpTruelinear_projmethodray_tracing.jpg} } \hspace{2mm} \subfloat[]{ \includegraphics[width=0.47\columnwidth]{latex/figs/histmatch_sem_testtriplets/_McHe1Ns3x3zlrt3SoYFup2QU4X3fgUyT__2020-08-05-Z1F0082_315977525259844000_rgb_interpTruelinear_projmethodray_tracing.jpg} } \hspace{0mm} \subfloat[]{ \includegraphics[width=0.47\columnwidth]{latex/figs/histmatch_sem_testtriplets/_PRRmJxg1eSDS95RprHX0M1Ord3OCMcsg__2020-08-21-Z1F0067_315977136060078000_rgb_interpTruelinear_projmethodray_tracing.jpg} } \hspace{2mm} \subfloat[]{ \includegraphics[width=0.47\columnwidth]{latex/figs/histmatch_sem_testtriplets/_gs1B8ZCv7DMi8cMt5aN5rSYjQidJXvGP__2020-07-21-Z1F0076_315965606960675000_rgb_interpTruelinear_projmethodray_tracing.jpg} } \hspace{0mm} \subfloat[]{ \includegraphics[width=0.47\columnwidth]{latex/figs/histmatch_sem_testtriplets/_lLnldXKakQk3B27i01yaeaW8Fq3AOzBz__2020-06-26-Z1F0018_315968629959146000_rgb_interpTruelinear_projmethodray_tracing.jpg} } \hspace{2mm} \subfloat[]{ \includegraphics[width=0.47\columnwidth]{latex/figs/histmatch_sem_testtriplets/_uAWyh9vy6ABsSiN5LmAMgX4V0koRNEaW__2020-08-05-Z1F0082_315969648260011000_rgb_interpTruelinear_projmethodray_tracing.jpg} } \caption{Examples from the test split of our TbV dataset. Left to right: BEV sensor representation, onboard map representation, blended map and sensor representations. Inset (A) depicts inserted crosswalks, while insets (B-H) represent painted lane geometry changes. } \label{fig:additionaltestsetexamples} \end{figure} \section*{Appendix H: Map Changes from Construction} In Figure \ref{fig:dynamicobjs}, we show examples of object-centric map changes inside our TbV dataset, which we do not annotate and are not the focus of our work. \begin{figure*} \centering \subfloat[Traffic Cones]{ \includegraphics[height=2.5cm]{latex/figs/dynamic_obj_examples/dynamic_obj_example_cones_0egN9fNsO7S0nmtGV4ZLg74Bs51m6XNK__2020-06-05-Z1F0057.jpeg} } \subfloat[Jersey Barriers]{ \includegraphics[height=2.5cm]{latex/figs/dynamic_obj_examples/dynamic_obj_example_jerseybarrier_auhemZoPgbv5FVGOrm26qydoXs0I9934__2020-06-17-Z1F0045.jpeg} } \subfloat[Type III Traffic Barricades]{ \includegraphics[height=2.5cm]{latex/figs/dynamic_obj_examples/dynamic_obj_example_road_barricade_v2_79ApelcEgWdX7Rklwq5zJ3pZhBZX7Agj__2020-08-31-Z1F0069.jpeg} } \subfloat[Fallen Trees]{ \includegraphics[height=2.5cm]{latex/figs/dynamic_obj_examples/dynamic_obj_example_tree_YGGlY1eGed7FHz3aDmlfFSEGfSmE2IlE__2020-06-22-Z1F0039.jpeg} } \hspace{0mm} \subfloat[Construction Signs]{ \includegraphics[height=2.5cm]{latex/figs/dynamic_obj_examples/dynamic_obj_L1HyTdXsGpuaJ5yGiBimdHLmDjeCopBO__2020-07-29-Z1F0035.jpeg} } \subfloat[Traffic Barrels / Drums]{ \includegraphics[height=2.5cm]{latex/figs/dynamic_obj_examples/dynamic_obj_447TcW935SlbxJgQm2BWT6EcG95V55B1__2020-07-15-Z1F0015.jpeg} } \subfloat[Arrowboard Trailers]{ \includegraphics[height=2.5cm]{latex/figs/dynamic_obj_examples/dynamic_obj_IOC5RBf3oX6Yd1KUJj2TU7O6DzuJyct7__2020-07-23-Z1F0054_anon.jpg} } \caption{Scenes with temporary object-related map changes collected in our fleet data. Such scenes are not the focus of our work; rather, we believe such changes should be addressed by onboard object recognition systems.} \label{fig:dynamicobjs} \end{figure*} \section*{Appendix I: Additional Analysis of Map Change Frequency} \begin{table}[] \centering \vspace{-1em} \caption{Entities included in our HD map representation.} \begin{adjustbox}{max width=0.7\columnwidth} \begingroup \renewcommand{\arraystretch}{1.2} \begin{tabular}{cl} \toprule \textsc{\textbf{HD Map Entity}} & \textsc{\textbf{Corresponding attributes}} \\ \midrule \textsc{Pedestrian Crossings} & \textsc{2 edges oriented along its principal axis} \\ \hline \multirow{5}{*}{\textsc{Lanes}} & \textsc{Boundaries: 3d left and right polylines} \\ & \textsc{Color: yellow, white, or implicit} \\ & \textsc{Boundary marking type} \\ & \textsc{Connectivity} \\ & \textsc{Lane type: bike or vehicle lane} \\ & \textsc{In intersection: true or false} \\ \hline \textsc{Driveable area} & \textsc{polygons} \\ \hline \textsc{Ground surface height} & \textsc{floating point height values at 30 centimeter resolution} \\ \bottomrule \end{tabular} \endgroup \end{adjustbox} \label{tab:mapattributes} \end{table} In Section \ref{sec:annotation-and-change-freq} and Table \ref{tab:city-tile-spatialchange-prob} of the main paper, we present an analysis of map change frequency. In this section, we provide additional analysis, an extended table, and derivations of our estimates. Map changes occur at random as part of a stochastic process. While some changes are coordinated at a city-administration level, it is still difficult to predict to a specific date or time when construction crews will complete changes. As discussed in the main text, we reason about square spatial areas of size $30 \mbox{ m} \times 30 \mbox{ m} $, which we refer to as tiles, which cover $900 \mbox{ m}^2$ each. \paragraph{Derivation: Probability of an Encounter} We consider the probability of entering a spatial area that has undergone a crosswalk or lane geometry within it. In other words, it is the probability of encountering a changed area, and thus we name it $p_{eca}$. In order to estimate the probability of encountering a changed area, rather than computing the ratio $\Big(\frac{\text{num. change-discovery miles}}{\text{num. fleet miles}}\Big)$, we compute the ratio $\Big(\frac{\text{num. tiles where change is observed}}{\text{num. tiles entered by fleet}}\Big)$. We do not require that the autonomous vehicle directly drove over the changed tile, as an observed change can very well still affect driving behavior. We model the probability as a Bernoulli($p$) r.v., with $p \approx 5.517 \times 10^{-5} $ across the more than 5 North American cities we analyze. A visit would occur once per every 18,124 times a vehicle enters such areas. While the change percentage may seem inconsequential, one must consider that drivers in the United States are estimated to drive 3.225 trillion miles per year, according to the U.S. Department of Transportation \cite{UsDot19pr_DrivingMoreThanEverBefore}. If one were to consider our rate of change equal to the rate of change of any stretch of road within the United States, this would amount to an \emph{upper bound} of 9B encounters of spatial areas with changed lane geometry or crosswalks, per year: \begin{equation} \hspace{-3mm} \frac{ 3.225 \cdot 10^{12} \text{miles} } {\text{1 year}} \cdot \frac{\text{1609 m }}{\text{1 mile}} \cdot \frac{\text{1 tile}}{\text{30 m}} \cdot \frac{ 5.517 \cdot 10^{-5} \text{ changes} }{\text{ 1 tile}} \approx 9.5 B \end{equation} This derivation assumes that all roads (including highways) are changed as often as urban roads (a generous estimate). \input{latex/tex/map_change_stats_table.tex} \noindent \textbf{Derivation: Probability per Spatial Area} We next estimate the probability of each unique tile in a city seeing a crosswalk or lane geometry change, which we also model as a Bernoulli($p$) random variable, with $p$ estimated as: \begin{equation} p = \frac{\text{\# unique changed tiles in city}}{\text{\# unique tiles in city visited at least n times by fleet}} \end{equation} where the numerator and denominator are both measured over $k$ months. In Table \ref{tab:full-map-change-stats-table}, we analyze the probability of change for a $30 m \times 30 m$ spatial area across six particular cities. Since we can likely only catch changes for spatial areas that are somewhat frequently visited, we require that an area is visited by fleet at least $n=5$ times over $k=5$ months. \section*{Appendix J: Synthetic Map Perturbation Technique} \begin{table}[h] \centering \caption{Training dataset statistics and types of synthetic changes generated from a small subset of logs from \emph{TbV-Beta}. The map rendering counts enumerated below correspond to 25,393 BEV sensor data renderings. Note that a single BEV sensor data rendering and its associated vector map data can often support multiple types of synthetic changes. However, not all scenes can support all synthetic change types. For example, in order to delete a crosswalk from a local map, a crosswalk must be present in the local vicinity of the egovehicle. Significantly more training data can be generated from both \textit{TbV-Beta} and \textit{TbV-1.0} compared to what is shown here (See Table \ref{tab:testsetstatistics}). } \begin{adjustbox}{max width=0.8\columnwidth} \begingroup \renewcommand{\arraystretch}{1.2} \begin{tabular}{clc} \toprule \textsc{\textbf{Change Category}} & \textsc{\textbf{Description of Change}} & \textsc{\textbf{\# Training }} \\ & & \textsc{\textbf{Examples Used}} \\ \midrule \textsc{No change} & \textsc{None} & \textsc{25,263} \\ \midrule \multirow{4}{*}{\textsc{Lane Geometry Changes}} & \textsc{Delete Lane Marking} & 19,870 \\ & \textsc{Change Lane Marking Color} & 25,098 \\ & \textsc{Change Lane Boundary Dash-Solid} & 19,875 \\ & \textsc{Add Bike Lane} & 21,529 \\ \midrule \multirow{2}{*}{\textsc{Crosswalk Changes}} & \textsc{Delete Crosswalk} & 9,627 \\ & \textsc{Insert Crosswalk} & 23,166 \\ \bottomrule \end{tabular} \endgroup \end{adjustbox} \label{tab:perturbationstatistics} \end{table} In Section \ref{sec:tbv-synthesis-mismatched-data}, Table \ref{tab:perturbationstatistics}, and Figure \ref{fig:6-types-synthetic-changes} of the main text, we enumerate a number of hand-designed priors we use to generate realistic-appearing synthetic maps. In this section, we provide detailed descriptions of the generation process. \subsection*{J.1. Priors on the Crosswalk Perturbation Procedure} Our main observations from studying mapped data are that crosswalks are generally located near intersections, are orthogonal to lane segment tangents, and have little to no area overlap with other crosswalks. Accordingly, we first sample a random lane segment which will be spanned by the generated, synthetic crosswalk. We perform this random sampling from a biased but normalized probability distribution; lane segments within intersections achieve 4.5x the weight of non-intersection lane segments. In order to determine the orientation of the synthesized crosswalk's principal axis, we compute the normal to the centerline of the sampled lane segment at a randomly sampled waypoint. This waypoint is sampled from 50 waypoints that we interpolate along the centerline. We ensure that the sampled waypoint is not within the outermost 1/8 of pixels along any border of the rendered map image (i.e. within 15 m according to $\ell_\infty$ norm from the egovehicle). This measure is to allow some perturbation of the random crop for data augmentation, without losing visibility of the changed entity. Next, in order to determine how many total lane segments the crosswalk must cross in order to span the entire road, we must determine the road extent. We approximate it as the union of all nearby lane segment polygons. The line representing the principal axis of the crosswalk may intersect with this road polygon in more than two locations, since it is often non-convex. We choose the shortest possible length segment that spans the road polygon to be valid, and thus find the closest two intersections to the sampled centerline waypoint. We randomly sample a crosswalk width $w$ in meters from a normal distribution $w \sim \mathcal{N}(\mu=3.5,\sigma=1)$, but clip to the range $w \in [2,4]$ meters afterwards, in accordance to our empirical observations of the real-world distribution. If the rendered synthetic crosswalk has overlap with any other real crosswalk above a threshold of $\text{IoU}=0.05$, we continue to sample until we succeed. The crosswalk is rendered as a rectangle, bounded between two long edges both extending along the principal axis of the crosswalk. We use alternating parallel strips of white and gray to color the object. Crosswalks are deleted by simply not rendering them in the rasterized image. \subsection*{J.2. Lane Geometry Perturbation Procedure} Our main observations from studying real-world map changes are that lane changes generally occur over a chain of lane segments, with combined length often over tens or hundreds of meters, although at times the combined length is far shorter. Accordingly, we use the directed lane graph to sample random connected sequences of lane segments, respecting valid successors. We then manipulate either the left or the right boundary only (not both) of this lane sequence. Our general procedure is to start this sequence at a random lane well-within the field of view of the BEV image. As before, we ensure that the sampled marking is not entirely contained within the outermost 1/8 of pixels along any border of the rendered map image (i.e. within 15 m according to $\ell_\infty$ norm from the egovehicle). When deleting lane boundaries, we sample only painted yellow or white lane boundary markings. When changing the color or structure of lane boundaries, we sample lane boundary markings of any color (including those that are implicit). When adding a bike lane, we sample a sequence of 5 lane segments. For marking deletion and changes to lane marking color and structure, we sample a sequence of length 3. We render these boundaries as colored polylines; we use red for implicit boundaries, and yellow and white for lane markings of their respective color. Lane boundary markings are deleted by simply not rendering them in the rasterized image. Bike lanes generally represent the rightmost lane in the United States. Accordingly, we synthesize a valid location for a new bike lane by iterating through the lane graph until there is no right neighbor; by dividing this rightmost lane into half, we can create two half-width lanes in place of one. We use solid white lines to represent their boundaries. \subsection{Temporal Analysis of Changes} \begin{table}[!b] \centering \caption{Probability of a 30m $\times$ 30m region that has been visited at least 5 times in 5 months undergoing a lane geometry or crosswalk change within the same time period. These statistics apply only to surface-level urban streets, not highways.} \begin{adjustbox}{max width=\columnwidth} \begingroup \begin{tabular}{l ccc ccc} \toprule & \multicolumn{6}{c}{\textsc{\textbf{City Name}}} \\ & \textsc{Pittsburgh} & \textsc{Detroit} & \textsc{Washington, D.C.} & \textsc{Miami} & \textsc{Austin} & \textsc{Palo Alto} \\ \midrule \textsc{Probability of Change} & 0.0068 & 0.0056 & 0.0046 & 0.0038 & 0.0009 & 0.0007 \\ \arrayrulecolor{LightGrayForTableRule} \hline \arrayrulecolor{Black} Up to \textsc{T / 1000 tiles} & \multirow{2}{*}{7} & \multirow{2}{*}{6} & \multirow{2}{*}{5} & \multirow{2}{*}{4} & \multirow{2}{*}{0.9} & \multirow{2}{*}{0.7} \\ \textsc{will change in 5 mo.} & & & & & & \\ \bottomrule \end{tabular} \endgroup \end{adjustbox} \vspace{-1.5em} \label{tab:city-tile-spatialchange-prob} \end{table} \begin{figure}[htb] \vspace{-2mm} \centering \subfloat[crosswalk is removed]{ \includegraphics[width=0.45\linewidth]{latex/figs/nohistmatch_nosem_testtriplets/79TuaBnpYGOFKZAT1ZcmkUNEjHJtiiup__2020-10-07-Z1F0018_315969356659816000_rgb_interpTruelinear_projmethodray_tracing.jpg} } \hspace{5mm} \subfloat[dashed white repainted as double solid white ]{ \includegraphics[width=0.45\linewidth]{latex/figs/nohistmatch_nosem_testtriplets/aEEUxFn6Gm6XeqV4rLA9esoNpYUhs2Ql__2020-09-21-Z1F0070_315989034959829000_rgb_interpTruelinear_projmethodray_tracing.jpg} } \hspace{0mm} \subfloat[solid yellow paint marking is added]{ \includegraphics[width=0.45\linewidth]{latex/figs/nohistmatch_nosem_testtriplets/qT9M5446NgGW5izOozHsSM9gLGyGkD1u__2020-09-17-Z1F0055_315973824960164000_rgb_interpTruelinear_projmethodray_tracing.jpg} } \hspace{5mm} \subfloat[double-solid yellow paint marking is removed]{ \includegraphics[width=0.45\linewidth]{latex/figs/nohistmatch_nosem_testtriplets/vrh2qhEhbgS1diwdmnsUBwQggBAVLIjg__2020-08-26-Z1F0001_315969167659820000_rgb_interpTruelinear_projmethodray_tracing.jpg} } \caption{Examples from the validation and test splits of our TbV dataset. Left to right: BEV sensor representation, onboard map representation, blended map and sensor representations. Rows, from top to bottom: deleted crosswalk (top row), and painted lane geometry changes (bottom three rows). } \vspace{-4mm} \label{fig:testsetexamples} \end{figure} \subsection{Annotation} \label{sec:annotation-and-change-freq} In order to label map changes, we use three rounds of human filtering, where changes are identified, confirmed, and characterized by three independent reviewing panels. We assign spatial coordinates to each changed object within a city coordinate system. Crosswalk changes are denoted by a polygon, and lane geometry changes by polylines. We use egovehicle-to-changed-map-entity distance (point-to-polygon or point-to-line) to determine whether or not a sensor and map rendering should be classified as a map-sensor match or mismatch. \paragraph{Analysis of Map Change Frequency} We use our annotated map changes, along with 5 months of fleet data, to analyze the frequency of map changes on a city-scale across several cities. Two particular questions are of interest: (1) \emph{how often will an autonomous vehicle encounter a map change as part of its day-to-day operation?} and (2) \emph{what percentage of map elements in a city will change each month or each year}? For our analysis, we subdivide a city's map into square spatial units of dimension 30 meters $\times$ 30 meters, often referred to as ``tiles'' in the mapping community. We find the probability $p$ of an encounter at any given time with a tile with changed lane geometry or crosswalk to be $p \approx 5.5174 \times 10^{-5}$. Although the probability of a single event is low, we cannot ignore rare events, as doing so would be reckless. Given the 3.225 trillion miles driven in the U.S. per year \cite{UsDot19pr_DrivingMoreThanEverBefore}, this could amount to \emph{billions} of such encounters per year. We determine that up to 7 of every 1000 map tiles may change in a 5-month span (see Table \ref{tab:city-tile-spatialchange-prob}), a significant number. More details are provided in the Appendix. \subsection{Sensor Data} Our TbV dataset includes LiDAR sweeps collected at 10 Hz, along with 20 fps imagery from 7 cameras positioned to provide a fully panoramic field of view. In addition, camera intrinsics, extrinsics and 6 d.o.f. AV pose in a global coordinate system are provided. LiDAR returns are captured by two 32-beam LiDARs, spinning at 10 Hz in the same direction (``in phase''), but separated in time by $180^\circ$. The cameras trigger in-sync with both of them, leading to a 20 Hz framerate. The 7 global shutter cameras are synchronized to the LiDAR to have their exposure centered on when the LiDAR sweeps through the middle of their fields of view. The top LiDAR spins clockwise in its frame, while the bottom LiDAR spins counter-clockwise in its frame; in the ego-vehicle frame, they both spin clockwise. \subsection{Map Data} In the Appendix, we list the semantic map entities we include in the TbV dataset. Previous AV datasets have released sensor data localized within a single map per city \cite{Chang19cvpr_Argoverse,Caesar20cvpr_nuscenes,Houston20_LyftLevel5}. This is not a viable solution for TbV, since the maps change over our long period of data gathering. We instead release local maps with all semantic entities within 100 meters of the egovehicle featured. Accordingly, single, incremental changes can be identified and tested. We release many maps, one per vehicle log; the corresponding map is the map used on-board at time of capture. Lane segments within our map are annotated with boundary annotations for both the right and left marking (including against curbs) and are marked as implicit if there is no corresponding paint. We use the same release format for our maps as Argoverse 2.0 \cite{Wilson21neurips_Argoverse2} uses. \subsection{Dataset Taxonomy} Our dataset's taxonomy is intentionally oriented towards lane geometry and crosswalk changes. In general, we focus on permanent changes, which are far less frequent in urban areas than temporary map changes. Temporary map changes often arise due to construction and road blockades. We postulate that temporary map changes -- temporarily closed lanes or roads, or temporary lanes indicated by barriers or cones, should be relegated to onboard object recognition and detection systems. Indeed, recent datasets such as nuScenes \cite{Caesar20cvpr_nuscenes} include 3d labeling for traffic cones and movable road barriers, such as Jersey barriers (see Appendix for examples). Even certain types of permanent changes are object-centered (e.g. changes to traffic signs). Accordingly, a natural division arises between ``things'' and ``stuff' in map change detection, just as in general scene understanding \cite{Adelson91book_PlenopticFn,Caesar18cvpr_COCOStuff}. We focus on the ``stuff'' aspect, corresponding to entities which are often spatially distributed in the BEV; we find lane geometry and crosswalk changes to be more frequent than other ``stuff''-related changes. \subsection{Implementation Details} \label{sec:impl-details} \paragraph{Ego-view Models.} Our ego-view models that operate on front-center camera images leverage both LiDAR and RGB sensor imagery. We use LiDAR information to filter out occluded map elements from the rendering. We linearly interpolate a dense depth map from sparse LiDAR measurements, and then compare the depth of individual map elements against the interpolated depth map; elements found behind the depth map are not rendered. In our early fusion architecture, we experiment with models that also have access to semantic label masks from the semantic head of a publicly-available \emph{seamseg} ResNet-50 panoptic segmentation model \cite{Porzi19cvpr_Seamseg}. For those models with access to the semantic label map modality, we append $224 \times 224$ binary masks for 5 semantic classes (`road', `bike- lane', `marking-crosswalk-zebra', `lane-marking-general', and `crosswalk-plain') as additional channels in early fusion. \paragraph{Bird's Eye View Models.} We also implement camera-based models that accept orthoimagery as input, relying only upon RGB imagery and a pre-generated ground height field, without utilizing online LiDAR. We generate new orthoimagery each time the ego-vehicle moves at least 5 meters, and use each orthoimagery example as a training or test example. We use 2 cm per pixel resolution for orthoimagery; all pixels corresponding to 3d points up to 20 meters in $\ell_{\infty}$-norm from the ego-vehicle are included, generating a $2000 \times 2000$ px image. \paragraph{Training.} We use a ResNet-18 or ResNet-50 \cite{He16cvpr_ResNet} backbone, with ImageNet-pretrained weights, where a corresponding weight parameter's size is applicable. We use a crop size of $224 \times 224$ from images resized to $234 \times 234$ px. Please refer to the Appendix for additional implementation details and an ablation experiment on the influence of input crop size on performance. \subsection{Evaluation} We report results on an earlier, beta version of TbV, which we call \emph{TbV-Beta}, which includes slightly fewer logs. The publicly released version of TbV is \emph{TbV-1.0}.\\ Comparable evaluation of the ego-view and bird's eye view models is challenging since they operate on different portions of the scene. The ego-view model should not be penalized for ignoring changes outside of its field of view, especially those located behind the ego-vehicle. Thus, we provide results for visibility-based evaluation (when the change is visible in the ego-view), and a purely proximity-based comparison (when it is within 20 m. by $\ell_\infty$ norm). The area about which a model should reason is somewhat arbitrary; changes behind and to the side may matter for fleet operation, but changes directly ahead of the AV are arguably most important for path-planning \cite{Philion20cvpr_PlannerCentric}. In addition, changes visible to the rear at some timestamp are often visible directly in front of the AV at a prior timestamp. We consider the visibility-based evaluation to be most fair for ego-view models.\\ We use a mean of per-class accuracies to measure performance on a two-class problem: predicting whether the real world is changed (i.e. map and sensor data are mismatched), or unchanged (i.e. a valid match). This accounts for both precision and recall. If a confusion matrix is computed with predicted entries on the rows and actual classes as the columns, and normalized by dividing by the sum of each column, 2-class accuracy can be simply calculated as the mean of the diagonal of the confusion matrix. More formally, let $n_{cl}=2$ be the number of classes, $\hat{y}_i$ be the prediction for the $i$'th test example, and $y_i$ be the ground truth label for the $i$'th test example. We define per-class accuracy ($\text{Acc}_c$) and mean accuracy (mAcc) as: \vspace{-4mm} \footnotesize \begin{equation} \text{mAcc} = \nicefrac{1}{n_{cl}} \sum\limits_{c=0}^{n_{cl}} Acc_{c}, \hspace{3mm} \text{Acc}_c = \frac{\sum\limits_{i=0}^N \mathbbm{1}\{ \hat{y}_i = y_i\} \cdot \mathbbm{1}\{ y_i = c \} }{\sum\limits_{i=0}^N \mathbbm{1}\{y_i = c \} } \end{equation} \normalsize \vspace{-4mm} \input{latex/tex/fusion_type_and_viewpoint_ablation_table.tex} \input{latex/tex/data_modality_ablation_table.tex} \input{latex/tex/dropout_influence_table.tex} \paragraph{Which data viewpoint is most effective?} Models that operate on an ego-view scene perspective are more effective than those operating in the bird's eye view (5\% more effective over their own respective field of view), achieving 72.3\% mAcc (see Table \ref{tab:renderingviewpoint}). We found a simpler architecture (ResNet-18) to outperform ResNet-50 in the ego-view. \paragraph{Which modality fusion method is most effective?} Early fusion. For both BEV and ego-view, the early fusion models significantly outperform the late fusion models (+22.8\% mAcc in the ego-view and +9.7\% mAcc in BEV). This may be surprising, but we attribute this to the benefit of early alignment of map and sensor image channels for the early fusion models. Instead, the late-fusion model performs alignment with greatly reduced spatial resolution in a higher-dimensional space, and is forced to make decisions about both data streams \emph{independently}, which may be suboptimal. While the map and sensor images represent different modalities, a shared feature extractor is useful for both. \paragraph{Which input modalities are most effective?} A combination of RGB sensor data, semantics, and the map. We compare validation and test set performance of various input modalities in Table \ref{tab:results-modalities}. Early fusion of map and sensor data is compared with models that have access to only sensor or map data, or a combination of the two, with or without semantics. All models suffer a significant performance drop on the test set compared to the validation set. While a gap between validation and test performance is undesirable, better synthesis heuristics and better machine learning models can close that gap. We find semantic segmentation label map input to be quite helpful, although it places a dependency upon a separate model at inference time, increasing latency for a real-time system. Mean accuracy improves by 4\% in the ego-view and 2\% in the BEV when sensor and map data is augmented with semantic information in early fusion. In fact, early fusion of the map with the semantic stream alone (without sensor data) is 1\% more effective than using corresponding sensor data for the BEV. \paragraph{Is sensor data necessary?} Yes. The ``map-only'' model we trained couldn’t meaningfully identify map changes over random chance, achieving mean accuracies on the test set of just 0.5754 in the BEV and 0.533 in an ego-view (see Table \ref{tab:results-modalities}). This model can also be thought of as a binary classifier which is trained to identify whether the HD map is real or synthetically manipulated (i.e. classify the source domain). Inspection via Guided GradCAM demonstrates that the map-only baseline attends to onboard map areas that are not in compliance with real-world priors, such as identifying asymmetry in crosswalk layout, paint patterns, and lane subdivisions. \paragraph{Ablation on Modality Dropout.} We find random drop-out of certain combinations of modalities to regularize the training in a beneficial way, improving accuracy by more than 1\% of our best model (See Table \ref{tab:effectdropout}). Given the wide array of modalities available to solve the task, from RGB sensor data, semantic label maps, rendered maps, and LiDAR reflectance data, we experiment with methods to force the network to learn to extract useful information from multiple modalities. Specifically, we perform random dropout of modalities, an approach developed in the self-supervised learning literature \cite{Vincent08icml_DenoisingAutoencoders,Doersch15iccv_ContextPrediction,Zhang17cvpr_SplitBrainAutoencoder}.\\ Perhaps the most intuitive approach would be to apply modality dropout to one of the sensor or semantic streams, forcing the network to extract useful features from both modalities during training. However, we find this is in fact detrimental. More effective, we discover, is to randomly drop out either the map or semantic streams. In theory, meaningful learning should be impossible without access to the map; however, since we drop-out each example in a batch with 50\% probability, in expectation 50\% of the examples should yield useful gradients in each batch. This approach improves accuracy by more than 1\% of our best model. We zero out all data from a specific modality as our drop out technique. \input{latex/tex/gradcam_qual_examples.tex} \paragraph{Interpretability and Localizing Changes.} While accurately perceiving changes is important, the ability to localize them would also be helpful. Bounding boxes are often unsuitable for a compact localization of a map change because most changed map regions in TbV relate to ``stuff'' classes, for example, linear, extended lane boundary markings. Instead, pixelwise localization is often more appropriate. We use Guided Grad-CAM \cite{Selvaraju17iccv_GradCAM} to identify which regions of the sensor, map, and semantic input are most relevant to the prediction of the `is-changed' class. In Figure \ref{fig:gradcamexamples}, we show qualitative results on frames for which our best model predicts real-world map changes have occurred. \input{latex/tex/runtime_table.tex} \paragraph{Computational Runtime.} In order to demonstrate that our models can be used in practice without introducing a heavy computational burden, we report the time to complete a feedforward pass through a network, for our various models (see Table \ref{tab:computationalruntime}). The network architectures we employ are computationally lightweight, using ResNet-18 or ResNet-50 backbones. We report feedforward runtime (in milliseconds) for each network, averaged over 100 forward passes, after a warm-up period of 20 forward passes. The hardware used for the analysis is a Quadro P5000 GPU and Intel(R) Xeon(R) W-2145 CPU @ 3.70GHz processor, running the Ubuntu 20.04 operating system. Our best performing map change model (operating in the ego-view) requires just 2.24 milliseconds to complete a forward pass. However, this model does assume access to a readily-available semantic labelmap produced by a semantic segmentation network, which would increase the system latency. In Table \ref{tab:results-modalities}, we show that for a 4\% drop in accuracy for the ego-view models, the semantic labelmap can be excluded from the inputs, in which case the total runtime is just 2.19 milliseconds, well within real-time performance, introducing minimal latency for perception or planning modules which might utilize this information. \section{Introduction} \input{latex/tex/introduction.tex} \section{Related Work} \input{latex/tex/related_work.tex} \section{The TbV Dataset} \input{latex/tex/dataset.tex} \section{Approach} \input{latex/tex/approach.tex} \section{Experimental Results} \input{latex/tex/experiments.tex} \section{Conclusion} \input{latex/tex/conclusion.tex} \medskip \small { \bibliographystyle{plain} \section{Introduction}
\section{\@startsection{section}{1}% \renewcommand{\emph}[1]{\textsf{\textit{#1}}} \pagestyle{plain} \addtolength{\footskip}{2\baselineskip} \usepackage[width=.9\textwidth]{caption} \let\oldtocsection=\tocsection \let\oldtocsubsection=\tocsubsection \renewcommand{\tocsection}[2]{\hspace{0em}\oldtocsection{#1}{#2}} \renewcommand{\tocsubsection}[2]{\hspace{2em}\oldtocsubsection{#1}{#2}} \begin{document} \fontdimen8\textfont3=0.5pt \def {\rm Ai} {{\rm Ai}} \def {\rm Pf} {{\rm Pf}} \def {\rm sgn} {{\rm sgn}} \def \mathcal{S} {\mathcal{S}} \newcommand{\ensuremath{\mathbb{E}}}{\ensuremath{\mathbb{E}}} \newcommand{\mathrm{Var}}{\mathrm{Var}} \newcommand{\ensuremath{\mathbb{P}}}{\ensuremath{\mathbb{P}}} \newcommand{\ensuremath{\mathbb{R}}}{\ensuremath{\mathbb{R}}} \newcommand{\ensuremath{\mathbb{C}}}{\ensuremath{\mathbb{C}}} \newcommand{\ensuremath{\mathbb{Z}}}{\ensuremath{\mathbb{Z}}} \newcommand{\ensuremath{\mathbb{N}}}{\ensuremath{\mathbb{N}}} \newcommand{\ensuremath{\mathbb{Q}}}{\ensuremath{\mathbb{Q}}} \newcommand{\ensuremath{\mathbb{T}}}{\ensuremath{\mathbb{T}}} \newcommand{\ensuremath{\mathbf{i}}}{\ensuremath{\mathbf{i}}} \newcommand{\ensuremath{\mathfrak{Re}}}{\ensuremath{\mathfrak{Re}}} \newcommand{\ensuremath{\mathfrak{Im}}}{\ensuremath{\mathfrak{Im}}} \newcommand{\ensuremath{\mathbf{Subs}}}{\ensuremath{\mathbf{Subs}}} \newcommand{\textrm{dist}}{\textrm{dist}} \newcommand{\Res}[1]{\underset{{#1}}{\mathbf{Res}}} \newcommand{\Resfrac}[1]{\mathbf{Res}_{{#1}}} \newcommand{\Sub}[1]{\underset{{#1}}{\mathbf{Sub}}} \newcommand{\lambda}{\lambda} \newcommand{\theta}{\theta} \newcommand{\boldsymbol{\uplambda}}{\boldsymbol{\uplambda}} \def\note#1{\textup{\textsf{\color{blue}(#1)}}} \newcommand{\rho}{\rho} \renewcommand{\rho}{\varrho} \newcommand{\epsilon}{\epsilon} \newcommand{\varepsilon}{\varepsilon} \renewcommand{\geq}{\geqslant} \renewcommand{\leq}{\leqslant} \renewcommand{\ge}{\geqslant} \renewcommand{\le}{\leqslant} \newcommand{\qq}[1]{(q;q)_{#1}} \newcommand{\bel}[1]{b_{#1}^{\mathrm{el}}} \newcommand{\mathcal{E}}{\mathcal{E}} \newcommand{\ensuremath{\mathbb{Y}}}{\ensuremath{\mathbb{Y}}} \newcommand{\ensuremath{\mathbf{Sym}}}{\ensuremath{\mathbf{Sym}}} \newcommand{\mathsf{K}}{\mathsf{K}} \newcommand{\mathsf{f}}{\mathsf{f}} \newcommand{\mathsf{g}}{\mathsf{g}} \newcommand{\mathsf{h}}{\mathsf{h}} \newcommand{\scaling}[1]{ \mathfrak{s}(#1)} \def {\rm Pf} {{\rm Pf}} \newcommand{\mathsf{p}}{\mathsf{p}} \newcommand{\mathsf{q}}{\mathsf{q}} \newcommand{\upalpha}{\upalpha} \newcommand{\upgamma}{\upgamma} \newcommand{\upbeta}{\upbeta} \newcommand{\updelta}{\updelta} \newcommand{\ensuremath{\mathrm{gap}}}{\ensuremath{\mathrm{gap}}} \newcommand{\Weyl}[1]{\mathbb{W}^{#1}} \newcommand{\overset{+}{\longrightarrow}}{\overset{+}{\longrightarrow}} \newcommand{\overset{+}{\longleftarrow}}{\overset{+}{\longleftarrow}} \newcommand{\overset{-}{\longrightarrow}}{\overset{-}{\longrightarrow}} \newcommand{\overset{-}{\longleftarrow}}{\overset{-}{\longleftarrow}} \newcommand{\mathscr{L}^{\mathbb Z_{>0}}}{\mathscr{L}^{\mathbb Z_{>0}}} \newcommand{\mathscr{L}^{\mathbb Z}}{\mathscr{L}^{\mathbb Z}} \newcommand{\mathscr{L}^{\llbracket 1,L-1\rrbracket}}{\mathscr{L}^{\llbracket 1,L-1\rrbracket}} \newcommand{\mathscr{D}}{\mathscr{D}} \newcommand{\mathscr{L}^{\circ}}{\mathscr{L}^{\circ}} \newcommand{\mathscr{L}^{\circ\circ}}{\mathscr{L}^{\circ\circ}} \usetikzlibrary{patterns} \usetikzlibrary{shapes.multipart} \usetikzlibrary{arrows} \tikzstyle{axis}=[->, >=stealth', thick, gray] \tikzstyle{grille}=[dotted, gray] \tikzstyle{path}=[->, >=stealth', thick] \newtheorem{theorem}{Theorem}[section] \newtheorem{conjecture}[theorem]{Conjecture} \newtheorem{lemma}[theorem]{Lemma} \newtheorem{proposition}[theorem]{Proposition} \newtheorem{corollary}[theorem]{Corollary} \newtheorem{theoremintro}{Theorem} \renewcommand*{\thetheoremintro}{\Alph{theoremintro}} \theoremstyle{definition} \newtheorem{remark}[theorem]{Remark} \theoremstyle{definition} \newtheorem{example}[theorem]{Example} \theoremstyle{definition} \newtheorem{definition}[theorem]{Definition} \theoremstyle{definition} \newtheorem{definitions}[theorem]{Definitions} \title{\large Markov duality and Bethe ansatz formula for half-line open ASEP} \author[G. Barraquand]{Guillaume Barraquand} \address{G. Barraquand, Laboratoire de Physique de l'Ecole Normale Supérieure, ENS, Université PSL, CNRS, Sorbonne Université, Université Paris Cité, F-75005 Paris, France} \email{<EMAIL>} \author[I. Corwin]{Ivan Corwin} \address{I. Corwin, Columbia University, Department of Mathematics, 2990 Broadway, New York, NY 10027, USA.} \email{<EMAIL>} \begin{abstract} Using a Markov duality satisfied by ASEP on the integer line, we deduce a similar Markov duality for half-line open ASEP and open ASEP on a segment. This leads to closed systems of ODEs characterizing observables of the models. In the half-line case, we solve the system of ODEs using Bethe ansatz and prove an integral formula for $q$-moments of the current at $n$ distinct spatial locations. We then use this formula to confirm predictions for the moments of the multiplicative noise stochastic heat equation on $\mathbb R_{>0}$ with Robin type boundary condition and we obtain new formulas in the case of a Dirichlet boundary condition. \end{abstract} \maketitle \section{Introduction} The asymmetric simple exclusion process (ASEP) on the one-dimensional lattice is an exactly solvable model, in the sense that the distribution of the system -- and other observables -- can be computed exactly using coordinate Bethe ansatz. This was first discovered in the totally asymmetric case \cite{schutz1997exact} (see also \cite{johansson2000shape} for exact formulas of a different flavour). The partially asymmetric case was then treated in \cite{tracy2008integral, tracy2008fredholm, tracy2011erratum} and led to important progress on the asymptotic behaviour of ASEP \cite{tracy2009asymptotics} and the KPZ equation \cite{amir2011probability, sasamoto2010exact}. Quite often, exactly solvable probabilistic models admit half-space variants that are also exactly-solvable and can be analyzed asymptotically \cite{baik2001algebraic, baik2001asymptotics,sasamoto2004fluctuations, gueudre2012directed, o2014geometric,baik2018pfaffian, betea2018free, barraquand2018stochastic, barraquand2018half, Krajenbrink2020, barraquand2022random, imamura2022solvable, he2022shift}. More generally, in the context of quantum integrable systems -- where the coordinate Bethe ansatz method originally comes from \cite{bethe1931theorie} -- there exists a huge literature studying how to impose boundary conditions that preserve integrability. For the half-line open ASEP, however, exact computations of the distribution of the current and its asymptotic analysis have remained mostly out of reach. There are two notable exceptions. In the special case of the ASEP on $\ensuremath{\mathbb{Z}}_{>0}$ with closed boundary conditions (no particles injected or ejected at the boundary), \cite{tracy2013bose} computed the transition probabilities of the system via coordinate Bethe ansatz. An application to open ASEP was discussed in \cite{tracy2013asymmetric}, but the resulting formulas are fully explicit only in the special cases of the totally asymmetric (TASEP) and symmetric (SSEP) exclusion processes. For special values of the boundary parameters (imposing a density $\rho=1/2$, according to the notations used below), one exact formula was also obtained via the framework of half-space Macdonald processes in \cite{barraquand2018stochastic}, and allows to analyze the system asymptotically. However, that formula characterizes only the distribution of the current at the origin, and for a special value of boundary parameters. An immediate difficulty that arises with open systems to apply coordinate Bethe ansatz is that the number of particles is not conserved. However, for the ASEP on $\ensuremath{\mathbb{Z}}$, in order to avoid difficulties related to the possibly infinite number of particles, \cite{imamura2011current, borodin2012duality} used a Markov duality, originally discovered in \cite{schutz1997duality}. We review this notion in Section \ref{sec:duality}. This approach through duality allows to study particle systems with infinitely many or a non-constant number of particles by reducing the problem to diagonalizing a dual Markov process which has finitely many particles. In the case of the full-line ASEP, the dual system is the ASEP with finitely many particles and is thus Bethe ansatz solvable. In this paper, we adapt this approach to the half-line open ASEP. We do not solve the most general case but impose a condition on the boundary injection/ejection rate that was already used in \cite{liggett1975ergodic}. We show that this condition allows to deduce a Markov duality for half-line open ASEP from the full-space duality. Despite the restriction on boundary parameters, we can still study the system with an arbitrary boundary density parameter. Our main result, Theorem \ref{theo:momentformula}, is an exact integral formula for the $q$-moments of the current at $n$ distinct spatial locations (the parameter $q$ denotes the asymmetry, see Definition \ref{def:halflineASEP} below). It is obtained by explicitly solving a system of ODEs coming from the Markov duality (Proposition \ref{prop:freeevolutionu}) which characterizes these $q$-moments. Our solution takes the form of a sum over partitions of integrals having a structure similar with solutions of the half-space delta Bose gas from \cite{borodin2016directed}. Markov dualities for open ASEP have been investigated in the literature \cite{ohkubo2017dualities, kuan2021algebraic, kuan2022two, schutz2022reverse} (see Remark \ref{rem:dualityopenasep}) using different duality functionals. Our duality (Theorem \ref{theo:dualityhalf-space}), which seems to be new, is a Markov duality between half-line open ASEP and the half-line ASEP with a constant number $n$ of particles elastically reflected at the boundary. As a side result, we also explain in Section \ref{sec:segment} that in the case of open ASEP on a segment $\lbrace 1, \dots, \ell\rbrace$, our approach also yields a Markov duality (Theorem \ref{theo:dualitysegment}). This allows as well to deduce a closed system of ODEs characterizing the $q$-moments of the current, but so far we do not know how to explicitly solve it. Since ASEP converges in the weakly asymmetry limit to the Kardar-Parisi-Zhang (KPZ) equation \cite{bertini1997stochastic, corwin2016open, parekh2017kpz, gonccalves2020derivation, yang2020kardar}, our formula also sheds light on the half-line KPZ equation. In particular, we prove moment formulas for the KPZ equation with Neumann type boundary (Theorem \ref{theo:momentsKPZ}). Although it seems to us that Theorem \ref{theo:momentsKPZ} has not been proved in the literature, the result was anticipated in \cite{borodin2016directed} and could be proved alternatively using other discrete models (see Remark \ref{rem:otherapproach}). However, we also obtain new results that are related to the half-line KPZ equation with Dirichlet boundary condition (in the sense that the exponential of the solution satisfies a Dirichlet boundary condition). These results are used in the forthcoming paper \cite{barraquand2022weakly} to prove the convergence of half-line ASEP with high boundary density to the half-line KPZ equation with Dirichlet boundary condition. \subsection*{Acknowledgments} We thank Oriane Blondel, Chiara Franceschini, Jeffrey Kuan, Yier Lin, Tomohiro Sasamoto and Marielle Simon for useful conversations related to the results in this paper. I.C. was partially supported by the NSF through grants DMS:1937254, DMS:1811143, DMS:1664650, as well as through a Packard Fellowship in Science and Engineering, a Simons Fellowship, a Miller Visiting Professorship from the Miller Institute for Basic Research in Science, and a W.M. Keck Foundation Science and Engineering Grant. G.B. was partially supported by NSF through grant DMS:1664650 and by the ANR grants ANR-19-CE40-0012 and ANR-21-CE40-0019. Both G.B. and I.C. also wish to acknowledge the NSF grant DMS:1928930 which supported their participation in a fall 2021 semester program at MSRI in Berkeley, California. \section{An exact formula for the currents in half-line open ASEP} \label{sec:halfline} We start with some definitions and notations. \begin{definition} The \emph{half-line (open) ASEP} is a continuous time Markov process on the state-space $\lbrace 0,1\rbrace^{\ensuremath{\mathbb{Z}}_{>0}}$. It describes the stochastic evolution of a system of particles on $\ensuremath{\mathbb{Z}}_{>0}$ satisfying the exclusion rule -- each site is occupied by at most one particle. The particle configurations can be described by occupation variables $\big\lbrace \eta = \big(\eta_x\big)_{x\in\ensuremath{\mathbb{Z}}_{>0}}\in \lbrace 0,1\rbrace^{\ensuremath{\mathbb{Z}}_{>0}} \big\rbrace$. The state $\eta(t)$ at time $t$ evolves according to the following dynamics, depicted in Fig. \ref{fig:generalASEP}: at any given time $t\in [0,\infty)$ and for any $x\in \ensuremath{\mathbb{Z}}_{>0}$, a particle jumps from site $x$ to $x+1$ at exponential rate \begin{equation*}\mathsf{p}\ \eta_x(t)(1-\eta_{x+1}(t)) \in \lbrace 0,\mathsf{p}\rbrace, \end{equation*} and from site $x+1$ to $x$ at exponential rate \begin{equation*}\mathsf{q}\ \eta_{x+1}(t)(1-\eta_x(t))\in\lbrace 0,\mathsf{q}\rbrace.\end{equation*} Further, a particle is created or annihilated at the site $1$ at exponential rates \begin{equation*} \upalpha\ (1-\eta_1(t)) \ \ \text{and}\ \ \upgamma\ \eta_1(t).\end{equation*} All these events are independent. We will restrict our attention to the empty initial condition where there are no particles in the system at time $0$. We define the current at site $x$ by \begin{equation} N_x(\eta) = \sum_{i=x}^{+\infty} \eta_i. \label{eq:defNx} \end{equation} We denote by $\mathscr{L}^{\mathbb Z_{>0}}$ the generator associated to this Markov process, that is the operator acting on local functions $f: \lbrace 0,1\rbrace^{\ensuremath{\mathbb{Z}}_{>0}} \to \ensuremath{\mathbb{R}}$ by \begin{multline} \mathscr{L}^{\mathbb Z_{>0}} f(\eta) = \upalpha (1-\eta_1) \left( f(\eta^+)-f(\eta)\right) + \upgamma \eta_1 \left( f(\eta^-)-f(\eta)\right) \\ + \sum_{x=1}^{\infty} \left( \mathsf{p}\eta_x(1-\eta_{x+1}) + \mathsf{q}\eta_{x+1}(1-\eta_{x}) \right) \left( f(\eta^{x,x+1})-f(\eta)\right), \label{eq:defLeta} \end{multline} where $\eta^{x,x+1}$ is the configuration obtained from $\eta$ by exchanging the values of $\eta_x$ and $\eta_{x+1}$, and $\eta^+$ (resp. $\eta^-$) is obtained from $\eta$ by setting $\eta_1=1$ (resp. $\eta_1=0$). \label{def:halflineASEP} \end{definition} \begin{figure} \vspace{-0.3cm} \begin{tikzpicture}[scale=0.7] \draw[thick] (-1, 0) circle(1); \draw (-1,0) node{\footnotesize reservoir}; \draw[thick] (0, 0) -- (12.5, 0); \foreach \x in {1, ..., 12} { \draw[gray] (\x, 0.15) -- (\x, -0.15) node[anchor=north]{\footnotesize $\x$}; } \fill[thick] (3, 0) circle(0.2); \fill[thick] (6, 0) circle(0.2); \fill[thick] (7, 0) circle(0.2); \fill[thick] (10, 0) circle(0.2); \draw[thick, -stealth] (3, 0.3) to[bend left] node[midway, above]{$\mathsf{p}$} (4, 0.3); \draw[thick, -stealth] (6, 0.3) to[bend right] node[midway, above]{$\mathsf{q}$} (5, 0.3); \draw[thick, -stealth] (7, 0.3) to[bend left] node[midway, above]{$\mathsf{p}$} (8, 0.3); \draw[thick, -stealth] (10, 0.3) to[bend left] node[midway, above]{$\mathsf{p}$} (11, 0.3); \draw[thick, -stealth] (10, 0.3) to[bend right] node[midway, above]{$\mathsf{q}$} (9, 0.3); \draw[thick, -stealth] (-0.1, 0.5) to[bend left] node[midway, above]{$\upalpha$} (0.9, 0.4); \draw[thick, stealth-] (0, -0.5) to[bend right] node[midway, below]{$\upgamma$} (0.9, -0.4); \end{tikzpicture} \vspace{-0.3cm} \caption{Jump rates in the half-line ASEP.} \label{fig:generalASEP} \end{figure} We will denote the ratio of jump rates by $q:= \mathsf{q}/\mathsf{p}$ and assume that $q\in (0,1)$. We define the functions \begin{equation} Q_x(\eta) := q^{N_x(\eta)}. \label{eq:defQx} \end{equation} In order to define the dual process, it is convenient to introduce, for $y\in \ensuremath{\mathbb{Z}}$, the sets \begin{equation*} \Weyl{n}_{\geqslant y} :=\left\lbrace \vec x\in \ensuremath{\mathbb{Z}}^n : y\leqslant x_1<\dots < x_n \right\rbrace, \;\;\;\;\Weyl{n} :=\left\lbrace \vec x\in \ensuremath{\mathbb{Z}}^n : x_1<\dots < x_n \right\rbrace.\end{equation*} Finally, most of our results hold under a condition on the boundary parameters, \begin{equation} \frac{\upalpha}{\mathsf{p}}+\frac{\upgamma}{\mathsf{q}} = 1. \label{eq:Liggettcondition} \end{equation} This condition comes from the work \cite{liggett1975ergodic}. It ensures that the injection rate is $\mathsf{p} \rho$ and the ejection rate is $\mathsf{q}(1-\rho)$, where $\rho=\upalpha/\mathsf{p}$, as if the injection and ejection rates resulted from a fictitious site occupied with probability $\rho$ and the particles were traveling between this fictitious site and the site $1$ with the same rates $\mathsf{p}, \mathsf{q}$ as in the bulk. We will make this interpretation more precise in Section \ref{sec:dualityhalfline}. \subsection{Background on Markov duality} \label{sec:duality} We say that two Markov processes $X(t)$ and $Y(t)$, defined respectively on state-spaces $\mathbb X$ and $\mathbb Y$, are dual with respect to a function $H:\mathbb X\times \mathbb Y\to \ensuremath{\mathbb{R}}$, if for all $x\in\mathbb X, y\in\mathbb Y$, and all $t\geq 0$, \begin{equation} \mathbb E^x\left[H(X(t),y ) \right] = \mathbb E^y\left[H(x, Y(t) ) \right], \label{eq:defduality} \end{equation} where in the L.H.S., $\mathbb E^x$ denotes the expectation with respect to the Markov process $X(t)$ started from $X(0)=x$, and in the R.H.S., $\mathbb E^y$ denotes the expectation with respect to the Markov process $Y(t)$ started from $Y(0)=y$. Taking derivatives in \eqref{eq:defduality} with respect to $t$, and assuming the existence of generators of these processes, Markov duality implies that \begin{equation} \mathscr L^X H(x,y)=\mathscr L^Y H(x,y), \label{eq:dualitygenerator} \end{equation} where $\mathscr L^X$ (resp. $\mathscr L^Y$) acts on functions from $\mathbb X$ to $\ensuremath{\mathbb{R}}$ (resp. from $\mathbb Y$ to $\ensuremath{\mathbb{R}}$) and denotes the generator of the Markov process $X(t)$ (resp. $Y(t)$). When $H$ is uniformly bounded and belongs to the domain of $L^X$ for any $y$ (resp. to the domain of $L^Y$ for any $x$), then \eqref{eq:dualitygenerator} also implies \eqref{eq:defduality} (see \cite[Prop. 1.2]{jansen2014}). The full-space ASEP is the Markov process on $\lbrace 0,1\rbrace^{\mathbb Z}$ with generator $\mathscr{L}^{\mathbb Z}$, acting on local functions $f:\lbrace 0,1\rbrace^{\ensuremath{\mathbb{Z}}}\to\ensuremath{\mathbb{R}}$ by \begin{equation} \mathscr{L}^{\mathbb Z} f(\eta) = \sum_{x\in \mathbb Z} \left( \mathsf{p}\eta_x(1-\eta_{x+1}) + \mathsf{q}\eta_{x+1}(1-\eta_{x}) \right) \left( f(\eta^{x,x+1})-f(\eta)\right). \label{eq:defgeneratorfullspace} \end{equation} In order to state ASEP's self-duality, it is convenient to introduce another operator $\mathscr{D}^{(n)}$ acting on functions $f:\Weyl{n}\to \ensuremath{\mathbb{R}}$ by \begin{equation} \mathscr{D}^{(n)} f(\vec x) = \sum_{\underset{x_i-x_{i-1}>1}{1\leqslant i\leqslant n} } \mathsf{p}\left( f(\vec x_i^-) -f(\vec x)\right) + \sum_{ \underset{x_{i+1}-x_{i}>1}{1\leqslant i\leqslant n}} \mathsf{q}\left( f(\vec x_i^+) -f(\vec x)\right), \label{eq:defLpart} \end{equation} where we use the convention that $x_0=-\infty$ and $x_{n+1}=+\infty$. The operator $ \mathscr{D}^{(n)} $ may be seen as the generator of full-space ASEP with $n$ particles, where the $x_i$ denote the positions of the particles. Note that in \eqref{eq:defgeneratorfullspace}, $\mathsf{p}$ and $\mathsf{q}$ are the jump rates associated to right and left, while in \eqref{eq:defLpart}, we have chosen the opposite orientation. We will use the following Markov duality. \begin{proposition}[{\cite[Theorem 4.2, Proposition 4.7]{borodin2012duality}}] Fix $n\geqslant 1$. The full-space ASEP with right and left jump rates $\mathsf{p}$ and $\mathsf{q}$ (i.e. the Markov process with generator \eqref{eq:defgeneratorfullspace}) and the $n$-particle ASEP with right and left jump rates $\mathsf{q}$ and $\mathsf{p}$ (i.e. the Markov process with generator \eqref{eq:defLpart}) are dual with respect to \begin{equation} H(\eta,\vec x) := \prod_{i=1}^n Q_{x_i}(\eta), \label{eq:defH} \end{equation} where we have extended the definitions of $Q_x(\eta)$ and $N_x(\eta)$ in \eqref{eq:defQx} and \eqref{eq:defNx} to negative values of $x$ and $\eta\in \lbrace 0,1\rbrace^{\ensuremath{\mathbb{Z}}}$. In particular, for any $\eta\in \lbrace 0,1\rbrace^{\ensuremath{\mathbb{Z}}}$ and $\vec x\in \Weyl{n}$, \begin{equation*} \mathscr{L}^{\mathbb Z} H(\eta, \vec x) = \mathscr{D}^{(n)} H(\eta, \vec x). \label{eq:dualityfullspace} \end{equation*} \label{prop:dualityfull-space} \end{proposition} A Markov (self-)duality for ASEP was first obtained by \cite{schutz1997duality} with respect to a different function, the function $\widetilde H(\eta, \vec x):= \prod_{i=1}^n\widetilde Q_{x_i}(\eta)$ where $\widetilde Q_{x}(\eta)=\eta_xq^{N_{x+1}(\eta)}$. It was inspired by the analysis of the XXZ spin chain and proved by writing ASEP generator as a tensor product of Pauli matrices and expressing symmetries in terms of the $U_q(\mathfrak{sl}_2)$ algebra. Another proof was provided in \cite{borodin2012duality} by writing out explicitly $\mathscr{L}^{\mathbb Z} \widetilde H$ and $\mathscr{D}^{(n)} \widetilde H$ and comparing the two expressions. Proposition \ref{prop:dualityfull-space} states a Markov duality with respect to the function $H$, and it is proved in \cite{borodin2012duality}, also using an explicit computation of how generators act on $H$. We refer to \cite{kuan2018multi} for yet another Markov duality for ASEP. \subsection{Duality for half-line ASEP under Liggett's condition} \label{sec:dualityhalfline} In this Section we will use the full-space ASEP duality from Proposition \ref{prop:dualityfull-space} to establish a Markov duality for the half-line open ASEP under Liggett's condition \ref{eq:Liggettcondition}. Define a sub-Markov process on $\Weyl{n}_{\geqslant 1}$ with generator $\mathscr{D}^{(n, \rho)}$ acting on functions $f:\Weyl{n}_{\geqslant 1}\to \ensuremath{\mathbb{R}}$ by \begin{multline} \mathscr{D}^{(n, \rho)} f(\vec x) = \sum_{\underset{x_i-x_{i-1}>1}{2\leqslant i\leqslant n} } \mathsf{p}\left( f(\vec x_i^-) -f(\vec x)\right) + \sum_{ \underset{x_{i+1}-x_{i}>1}{1\leqslant i\leqslant n}} \mathsf{q}\left( f(\vec x_i^+) -f(\vec x)\right)\\ +\mathds{1}_{x_1>1}\mathsf{p}\left( f(\vec x_1^-) -f(\vec x)\right) -\mathds{1}_{x_1=1} (\mathsf{p}-\mathsf{q})\rho f(\vec x), \label{eq:defLpartboundary} \end{multline} with the convention that $x_{n+1}=+\infty$. This corresponds to a system of $n$ particles on $\ensuremath{\mathbb{Z}}_{\geqslant 1}$ performing continuous time simple random walks with jump rates $\mathsf{p}$ and $\mathsf{q}$, under the exclusion constraint, with killing at the boundary. More precisely, when the first particle is on site $1$, it cannot jump left and it is killed with rate $(\mathsf{p}-\mathsf{q})\rho$. We will call this sub-Markov process the \emph{killed $n$-particle half-line ASEP}. \begin{theorem} Fix $n\geqslant 1$ and assume that \eqref{eq:Liggettcondition} holds. The half-line open ASEP with right and left jump rates $\mathsf{p}$ and $\mathsf{q}$ (i.e. the Markov process with generator \eqref{eq:defLeta}) and the killed $n$-particle half-line ASEP with right and left jump rates $\mathsf{q}$ and $\mathsf{p}$ (i.e. the Markov process with generator \eqref{eq:defLpartboundary}) are dual with respect to \begin{equation*} H(\eta,\vec x) := \prod_{i=1}^n Q_{x_i}(\eta). \end{equation*} Equivalently, for any $\eta\in \lbrace 0,1\rbrace^{\ensuremath{\mathbb{Z}}\geqslant 1}$ and $\vec x\in \Weyl{n}_{\geqslant 1}$, \begin{equation*} \mathscr{L}^{\mathbb Z_{>0}} H(\eta, \vec x) = \mathscr{D}^{(n, \rho)} H(\eta, \vec x). \label{eq:dualityhalfspace} \end{equation*} \label{theo:dualityhalf-space} \end{theorem} The special case of Theorem \ref{theo:dualityhalf-space} for $n=1$ was discovered in \cite{corwin2016open} and can be interpreted as a microscopic Hopf-Cole transform. It was used in \cite{corwin2016open} to prove the convergence of half-line ASEP (as well as open ASEP on the segment) to the KPZ equation with appropriate boundary conditions. \begin{proof} Liggett's condition \eqref{eq:Liggettcondition} allows to rewrite the generator $\mathscr{L}^{\mathbb Z_{>0}}$ by making use of some fictitious occupation variable $\eta_0$ at site $0$, where the occupation variable $\eta_0$ should be thought of as a Bernoulli random variable with parameter $\rho$ (recall that $\rho=\upalpha/\mathsf{p}$), independent from all other random variables. More precisely, let us first define, for any local function $f:\lbrace 0,1\rbrace^{\ensuremath{\mathbb{Z}}_{\geq 0}}$, \begin{equation} \mathscr{L}^{\circ} f(\eta) = \sum_{x=0}^{\infty} \left( \mathsf{p}\eta_x(1-\eta_{x+1}) + \mathsf{q}\eta_{x+1}(1-\eta_{x}) \right) \left( f(\eta^{x,x+1})-f(\eta)\right), \label{eq:defLeta0} \end{equation} that is the generator of half-line ASEP on $\mathbb Z_{\geq 0}$ (instead of $\mathbb Z_{>0}$ as above), with no injection nor ejection of particles at site $0$. Let $E$ denote the expectation with respect to the probability distribution on $\eta_0$ such that $\eta_0=1$ with probability $\rho$, and $0$ with probability $1-\rho$. The variable $\eta_0$ arises in \eqref{eq:defLeta0} only in the term $x=0$, and under \eqref{eq:Liggettcondition}, we have $E[\mathsf{p}\eta_0]=\upalpha$ and $E[\mathsf{q}(1-\eta_0)=\upgamma]$. Hence for any local function $f:\lbrace 0,1\rbrace^{\mathbb Z_{>0}}\to \ensuremath{\mathbb{R}}$, \begin{equation} \mathscr{L}^{\mathbb Z_{>0}} f(\eta)=E\left[\mathscr{L}^{\circ} f (\eta)\right]. \label{eq:Liggetttrick} \end{equation} Now, we may use the duality for full-space ASEP. First, we remark that the function ${H}(\eta,\vec x)$ was defined for $\eta\in \lbrace 0,1\rbrace^{\mathbb Z}$ in \eqref{eq:defH}, but when $x_1\geq 1$, it depends only on the projection of $\eta$ to the positive occupation variables, that is, it depends only on $(\eta_1,\eta_2,\dots)\in \lbrace 0,1 \rbrace^{\mathbb Z_{>0}}$. Moreover, for $x_1\geqslant 1$, when computing $\mathscr{L}^{\mathbb Z} {H}(\eta,\vec x)$, the summation over all $x\in \mathbb Z$ in \eqref{eq:defgeneratorfullspace} can be restricted to a summation over $x\geq 0$ (because for $x< 0$ and $x_1\geq 1$, ${H}(\eta^{x,x+1},\vec x)={H}(\eta,\vec x)$). This implies that for any $\vec x\in \Weyl{n}_{\geq 1}$ and $\eta\in \lbrace 0,1\rbrace^{\mathbb Z_{>0}}$, we have $\mathscr{L}^{\mathbb Z} {H}(\eta,\vec x)=\mathscr{L}^{\circ} {H}(\eta,\vec x)$. Thus, using \eqref{eq:Liggetttrick}, for all $\vec x\in \Weyl{n}_{\geq 1}$, \begin{equation} \mathscr{L}^{\mathbb Z_{>0}} H(\eta, \vec x)=E\left[\mathscr{L}^{\circ} H(\eta; \vec x)\right]= E\left[\mathscr{L}^{\mathbb Z} H(\eta; \vec x)\right]. \label{eq:Liggetttrickapplied} \end{equation} Using now Proposition \ref{prop:dualityfull-space}, \begin{equation} \mathscr{L}^{\mathbb Z_{>0}} H(\eta, \vec x)= E\left[\mathscr{D}^{(n)} H(\eta; \vec x)\right], \label{eq:Liggetttrickduality} \end{equation} where the expectation $E$ simply means that we average over $\eta_0$, which arises in $Q_0(\eta)=q^{\eta_0}Q_1(\eta)$. The right-hand-side of \eqref{eq:Liggetttrickduality} can be seen as a polynomial in $Q_0(\eta),Q_1(\eta),Q_2(\eta),\dots$ which is linear in $Q_0(\eta)$. Since only $Q_0(\eta)$ depends on $\eta_0$, the expectation $E$ can be computed by replacing each occurrence of $Q_0(\eta)$ by $(\rho q+1-\rho)Q_1(\eta)$. There is actually at most one term involving $Q_0(\eta)$ in $\mathscr{D}^{(n)} H(\eta; \vec x)$, arising in the term $i=1$ in \eqref{eq:defLpart} when $x_i=1$, and since \begin{equation*} \mathsf{p}\Big((\rho q+1-\rho)-1\Big) = \rho(\mathsf{q}-\mathsf{p}), \end{equation*} we obtain that for any $\eta\in \lbrace 0,1\rbrace^{\ensuremath{\mathbb{Z}}\geqslant 1}$ and $\vec x\in \Weyl{n}_{\geqslant 1}$, \begin{equation*}\mathscr{L}^{\mathbb Z_{>0}} H(\eta, \vec x)= \mathscr{D}^{(n, \rho)} H(\eta; \vec x). \end{equation*} \end{proof} \begin{remark} Markov dualities for half-line ASEP or open ASEP have been investigated in \cite{ohkubo2017dualities, kuan2021algebraic, kuan2019stochastic, kuan2022two, schutz2022reverse} and involve different (and often more complicated) observables than the function $H(\eta, \vec x)$. However, for different models, Markov dualities between open particle systems and systems with absorbing sites have been previously obtained in the literature \cite{giardina2009duality, giardina2007duality}. \label{rem:dualityopenasep} \end{remark} \begin{remark} The fact that the full-line ASEP also satisfies a duality with respect to the function $\widetilde H(\eta, \vec x)$ might be used to show some analogue of Theorem \ref{theo:dualityhalf-space} involving the functional $\widetilde H(\eta(t), \vec x)$. However, the boundary condition in that case would take a significantly more complicated form, so we chose not to pursue further this direction. More generally, Markov dualities have been proved in the last few years for a number of other Markov processes \cite{corwin2015stochastic, carinci2016generalized, carinci2016asymmetric, kuan2018multi, carinci2019orthogonal, carinci2019consistent, kuan2021short, chen2020integrable, kuan2020interacting, carinci2021q, franceschini2022orthogonal}. It would be interesting if our method using fictitious sites applies to some of these other systems as well. \end{remark} \begin{remark} If we do not assume condition \eqref{eq:Liggettcondition}, it does not seem that one can prove a duality with respect to the function $H(\eta, \vec x)$. More precisely, it can be shown that for all $\vec x\in \Weyl{n}_{\geqslant 2}$ and $\eta\in \lbrace 0,1\rbrace^{\mathbb Z_{>0}}$, \begin{equation*} \mathscr{L}^{\mathbb Z_{>0}} {H}(\eta,\vec x) = \mathscr{D}^{(n)}H(\eta,\vec x), \end{equation*} while if $x_1=1$, \begin{equation*} \mathscr{L}^{\mathbb Z_{>0}} {H}(\eta,\vec x) = (\upalpha q+\upgamma)H(\eta, 2,x_2, \dots, x_n) -(\upalpha+\upgamma)H(\eta, 1, x_2, \dots, x_n) + \mathscr{D}^{(n-1)}H(\eta,1, x_2, \dots, x_n) \end{equation*} where $\mathscr{D}^{(n-1)}$ is understood as acting on functions of $(x_2< \dots< x_n)$. Hence, $\mathscr{L}^{\mathbb Z_{>0}} {H}(\eta,\vec x)$ involves the values of $H(\eta, \vec y)$ for some $\vec y\not\in \Weyl{n}_{\geq 1}$ (when $x_1=1$ and $x_2=2$). \label{rem:withoutLiggett} \end{remark} \subsection{A system of ODEs for half-line ASEP} \label{sec:ODE} In this section, we show how the Markov duality from Theorem \ref{theo:dualityhalf-space} can be used to find a closed system of ODEs that characterize the function of $(t,\vec x)\mapsto \mathbb E[\prod_{i=1}^n Q_{x_i}(\eta(t))]$. \begin{proposition} Assume that \eqref{eq:Liggettcondition} holds and fix some initial state $\eta\in \lbrace 0,1\rbrace^{\ensuremath{\mathbb{Z}}_{>0}}$ with finitely many particles. There exists a unique function $ u : \ensuremath{\mathbb{R}}_{+} \times \Weyl{n}_{\geq 1} \to \ensuremath{\mathbb{R}}$ which satisfies \begin{enumerate} \item For all $\vec x \in \Weyl{n}_{\geq 1}$ and $t\in \ensuremath{\mathbb{R}}_+$, \begin{equation} \frac{d}{dt} u(t;\vec x) = \mathscr{D}^{(n, \rho)} u(t;\vec x), \label{eq:cond1} \end{equation} where we recall that $\mathscr{D}^{(n, \rho)}$ is defined in \eqref{eq:defLpartboundary}; \item For any $T>0$, there exist constants $c,C>0$ such that for all $t\in [0,T]$ and $\vec x \in \Weyl{n}_{\geq 1}$, \begin{equation} \vert u(t; \vec x) \vert \leqslant C \prod_{i=1}^n e^{c\vert x_i\vert}. \label{eq:boundedgrowth} \end{equation} \item For any $\vec x\in \Weyl{n}_{\geqslant 1}$, $u(0; \vec x)=H(\eta,\vec x)$. \end{enumerate} The solution to (1),(2) and (3) above is such that for all $\vec x \in \Weyl{n}_{\geqslant 1}$ and $t\in \ensuremath{\mathbb{R}}_+$, $u(t,\vec x) = \ensuremath{\mathbb{E}}^{\eta}[H(\eta(t),\vec x))]$, where $\mathbb E^{\eta}$ denotes the expectation with respect to half-line ASEP with initial condition $\eta$. \label{prop:trueevolution} \end{proposition} \begin{proof} We will show that the function $(t,\vec x)\mapsto \ensuremath{\mathbb{E}}^{\eta}[H(\eta(t),\vec x))]$ is the unique solution to (1), (2) and (3). We have that \begin{align*} \frac{d}{dt} \mathbb E^{\eta} \left[H(\eta(t), \vec x) \right] &= \mathscr{L}^{\mathbb Z_{>0}} \mathbb E^{\eta} \left[H(\eta(t), \vec x) \right] \\ &= \mathbb E^{\eta} \left[\mathscr{L}^{\mathbb Z_{>0}} H(\eta(t), \vec x) \right]\\ &= \mathbb E^{\eta} \left[ \mathscr{D}^{(n, \rho)} H(\eta(t), \vec x)\right]\\ &= \mathscr{D}^{(n, \rho)} \mathbb E^{\eta} \left[ H(\eta(t), \vec x) \right]. \end{align*} The first equality holds by definition of the generator, the second uses the commutation between generator and semi-group, the third uses Theorem \ref{theo:dualityhalf-space} and the last equality holds by linearity of the expectation and the fact that $\mathscr{D}^{(n, \rho)} H(\eta(t), \vec x)$ is simply a finite sum. This implies that $\mathbb E^{\eta} \left[H(\eta(t), \vec x) \right]$ must satisfy conditions (1) of the statement of the Proposition. The condition (2) is obviously satisfied because $H(\eta, \vec x)<1$. The condition (3) is satisfied by definition (the initial condition of the process $\eta(t)$ is $\eta$). Let us now turn to the uniqueness. Assume that we have two solutions $u_1$ and $u_2$ with the same initial data and let $g=u_1-u_2$. Let $\mathbb E^{\vec x}$ denote the expectation with respect to the (sub-)Markov process $\vec x(t)$ with initial condition $\vec x$ and generator $\mathscr{D}^{(n, \rho)}$. Using \eqref{eq:cond1} and Kolmogorov's backward equation, for all $\vec x \in \Weyl{n}_{\geq 1}$, \begin{equation} \frac{d}{dt} \mathbb E^{\vec x}\left[ g(t,\vec x(T-t)) \right] = 0. \label{eq:derivative0} \end{equation} Thus, the function is constant, and comparing the values at $t=0$ and $t=T$, we obtain that $g(t,\vec x)=0$ for all $\vec x \in \Weyl{n}_{\geq 1}$, hence the uniqueness. We refer to \cite[Appendix C]{borodin2012duality} and \cite[Proposition 3.6]{barraquand2016q} for details about why $\mathbb E^{\vec x}\left[ g(t,\vec x (T-t)) \right]$ is well-defined, continuous and differentiable and how the growth hypothesis \eqref{eq:boundedgrowth} is used in proving so. \end{proof} It is not a priori clear how to find an explicit formula solving the system of equations from Proposition \ref{prop:trueevolution}. We now use a reformulation of ASEP's Kolmogorov equation as a system of ODEs on a larger space subject to boundary conditions. This was already used in solving full-line ASEP via Bethe ansatz in \cite{schutz1997exact, tracy2008integral, borodin2012duality} and half-line ASEP with closed boundary conditions \cite{tracy2013bose}. \begin{proposition} Assume that \eqref{eq:Liggettcondition} holds and fix some initial state $\eta\in \lbrace 0,1\rbrace^{\ensuremath{\mathbb{Z}}_{>0}}$ with finitely many particles. . If $ u : \ensuremath{\mathbb{R}}_{+} \times \ensuremath{\mathbb{Z}}_{\geqslant 0}^n \to \ensuremath{\mathbb{R}}$ solves \begin{enumerate} \item For all $\vec x \in \ensuremath{\mathbb{Z}}_{\geqslant 1}^n$ and $t\in \ensuremath{\mathbb{R}}_+$, \begin{equation*} \frac{d}{dt} u(t;\vec x) = \Delta^{\mathsf{p}, \mathsf{q}} u(t;\vec x), \end{equation*} where \begin{equation}\Delta^{\mathsf{p},\mathsf{q}} f(\vec x) = \sum_{i=1}^n \mathsf{p} f(\vec x_i^-) +\mathsf{q} f(\vec x_i^+) -(\mathsf{p} + \mathsf{q})f(\vec x); \label{eq:defDelta} \end{equation} \item For all $\vec x \in \ensuremath{\mathbb{Z}}_{\geqslant 1}^n$ such that for some $i\in \lbrace 1, \dots, n-1\rbrace $, $ x_{i+1}=x_i+1$, we have \begin{equation*} \mathsf{p} u(t; \vec x_{i+1}^-) + \mathsf{q} u(t; \vec x_i^+) = (\mathsf{p}+\mathsf{q}) u(t; \vec x);\end{equation*} \item For all $t\in \ensuremath{\mathbb{R}}_+$ and $(x_2, \dots, x_n)\in \Weyl{n-1}_{\geqslant 2}$, \begin{equation} u(t;0,x_2,\dots) = (\rho q+1-\rho)u(t;1,x_2,\dots); \label{eq:boundaryconditionforu} \end{equation} \item For any $T>0$, there exist constants $c,C>0$ such that for all $t\in [0,T]$ and $\vec x \in \Weyl{n}_{\geqslant 1}$, \begin{equation*} \vert u(t; \vec x) \vert \leqslant C\prod_{i=1}^ne^{c\vert x_i\vert};\end{equation*} \item For any $\vec x\in \Weyl{k}_{\geqslant 1}$, $u(0; \vec x)=H(\eta,\vec x)$. \end{enumerate} Then for all $\vec x \in \Weyl{n}_{\geqslant 1}$ and $t\in \ensuremath{\mathbb{R}}_+$, $u(t,\vec x) = \ensuremath{\mathbb{E}}^{\eta}[H(\eta(t),\vec x))]$, where $\mathbb E^{\eta}$ denotes the expectation with respect to half-line ASEP with initial condition $\eta$. \label{prop:freeevolutionu} \end{proposition} \begin{proof} Assume that $u$ satisfies conditions (1) to (5). The conditions (1) and (2) are a well-known reformulation of ASEP's generator, see \cite[Section 2]{schutz1997exact} (see also \cite[Eq. (2.2)]{tracy2008integral} or \cite[Proposition 4.10]{borodin2012duality} for instance). It ensures that for all $\vec x\in \Weyl{n}_{\geq 1}$, \begin{equation*} \frac{d}{dt} u(t;\vec x) = \mathscr{D}^{(n)} u(t;\vec x). \end{equation*} Then, the boundary condition \eqref{eq:boundaryconditionforu} when $x_1=1$ ensures that for all $\vec x\in \Weyl{n}_{\geq 1}$, $\mathscr{D}^{(n)} u(t;\vec x)=\mathscr{D}^{(n, \rho)} u(t;\vec x)$. Thus condition (1) of Proposition \ref{prop:trueevolution} is satisfied. The conditions (4) and (5) above are the same as the conditions (2) and (3) from Proposition \ref{prop:trueevolution}. Hence we may apply Proposition \ref{prop:trueevolution} to conclude the proof. \end{proof} \subsection{Exact integral formulas} In this section, we provide an integral formula for the function $v_n(t;\vec x) = \ensuremath{\mathbb{E}}\left[ Q_{x_1}(\eta(t))\dots Q_{x_n}(\eta(t)) \right]$ for half-line ASEP with empty initial condition. To do that, our goal is to find a function that satisfies the conditions of Proposition \ref{prop:freeevolutionu} with $v_n(0;\vec x)=1$, corresponding to the empty initial condition. \label{sec:formula} \subsubsection{Comparison with earlier work} For the full space ASEP, an analogue of Proposition \ref{prop:freeevolutionu} was proved in \cite{borodin2012duality} and involves the same conditions except condition (3). Inspired by the coordinate Bethe ansatz \cite{imamura2011current} and by the theory of Macdonald processes \cite{borodin2014macdonald}, an ansatz was proposed in \cite{borodin2012duality} to find solutions of the conditions (1) (2) (4) and (5) of Proposition \ref{prop:freeevolutionu}. The idea is to look for functions $v_n(t; \vec x)$ that take the form of a function of $n$ complex variables with some specific structure, integrated over contours in the complex plane that are nested into each other. This nested contour integral ansatz was later shown to apply to a variety of other models \cite{corwin2013q, corwin2014q, borodin2016stochasticsix, barraquand2016q, barraquand2017random}. For half-space models, a variant of the nested contour integral ansatz was suggested in \cite{borodin2016directed} to solve the half-line delta Bose gas, and formulas with a similar structure were proved for a model of random walks in random environment in a half-space \cite{barraquand2022random}. The formulas in these two works take the same form as moments of half-space Macdonald processes \cite{barraquand2018half}. In particular, the $q$-moments of the height function of the half-space stochastic six vertex model can be computed as reasonably simple nested contour integral formulas \cite[Section 5]{barraquand2018half}. Since the half-space stochastic six vertex model considered in \cite{barraquand2018half} converges to the half-line open ASEP with $\rho=1/2$ (as shown in \cite{barraquand2018stochastic}), it is reasonable to expect that $q$-moments of the half-line open ASEP can also be written as nested contour integrals, at least when $\rho=1/2$. Unfortunately, this is not the case, the nested contour integral ansatz does not work for the half-line open ASEP, even for $\rho=1/2$. This issue was already anticipated in \cite{barraquand2018half}, which suggested that after expanding the moment formulas for the half-space six vertex model as a sum over certain residues, the formulas might have a meaningful ASEP limit. Thus, partly inspired by the formulas from \cite[Section 5]{barraquand2018half}, and partly inspired by residue expansions arising in \cite[Section 7.3]{borodin2016directed}, we will define the function $v_n(t;\vec x)$ as a sum over residues instead of a simple nested contour integral, and check that it satisfies the conditions of Proposition \ref{prop:freeevolutionu}. The structure of the residue expansion is quite intricate, but we will see that in the KPZ equation limit in Section \ref{sec:KPZ}, the sum over residues can be rewritten as a relatively simple contour integral, as predicted in \cite{borodin2016directed}. \subsubsection{Residue subspaces} Before stating our formula for $v_n(t;\vec x)$ we need to introduce some notations to define the residues that arise in the formula. The residues will be indexed by integer partitions and diagrams that we define below. We recall that an integer partition is a non-increasing finite sequence of positive integers. We say that the partition $\lambda=(\lambda_1, \lambda_2, \dots, \lambda_{\ell(\lambda)})$ is a partition of $n$, denoted $\lambda \vdash n$, if $\sum_{i=1}^{\ell(\lambda)}\lambda_i =n$. The number $\ell(\lambda)$ is called the length of the partition $\lambda$. For a given partition $\lambda\vdash n$, we consider diagrams formed by $\ell(\lambda)$ lines of numbers separated by arrows, of the following form: \begin{eqnarray*} i_1 &\overset{+}{\longrightarrow} i_2\overset{+}{\longrightarrow} \dots \overset{+}{\longrightarrow} i_{\mu_1-1} \overset{+}{\longrightarrow} &i_{\mu_1}\overset{-}{\longleftarrow} i_{\mu_1+1} \overset{+}{\longleftarrow} \dots\overset{+}{\longleftarrow} i_{\lambda_1}\\ j_1 &\overset{+}{\longrightarrow} j_2\overset{+}{\longrightarrow} \dots \overset{+}{\longrightarrow} j_{\mu_2-1} \overset{+}{\longrightarrow} &j_{\mu_2}\overset{-}{\longleftarrow} j_{\mu_2+1} \overset{+}{\longleftarrow} \dots\overset{+}{\longleftarrow} j_{\lambda_2} \\ && \vdots \end{eqnarray*} The diagrams are such that \begin{itemize} \item all numbers $i_1,i_2,\dots, j_1,j_2,\dots$ are pairwise disjoint and their union is $\lbrace 1, \dots,n\rbrace$; \item all directed arrows go from a larger integer to a smaller one. \item on each line, arrows change from pointing right to pointing left at most once, i.e., the sequence of numbers is decreasing, until a certain minimum, and then it is increasing. We denote by $\mu_i$ the index of the minimal number on the $i$th line, around which arrows change orientation. Note that when $\mu_i=1$, all arrows are pointing left, and when $\mu_i=\lambda_i$, all arrows are pointing right. \item all arrows bear a plus sign, except for the first arrow pointing left in each row (when there is one such arrow) which bears a minus sign. \end{itemize} \begin{example} For the partition $\lambda=(4,3,1,1)$, there exists many possible diagrams, such as the following three diagrams: \begin{minipage}[center]{5cm} \begin{align*} & 7 \overset{+}{\longrightarrow} 5 \overset{+}{\longrightarrow} 1\overset{-}{\longleftarrow} 3\\ & 2\overset{-}{\longleftarrow} 4\overset{+}{\longleftarrow} 9\\ & 6\\ & 7 \end{align*} \end{minipage} \begin{minipage}{5cm} \begin{align*} & 7 \overset{+}{\longrightarrow} 5 \overset{+}{\longrightarrow} 1\overset{-}{\longleftarrow} 3\\ & 2\overset{-}{\longleftarrow} 4\overset{+}{\longleftarrow} 9\\ & 7\\ & 6 \end{align*} \end{minipage} \begin{minipage}{5cm} \begin{align*} & 7 \overset{+}{\longrightarrow} 1 \overset{-}{\longleftarrow} 3\overset{+}{\longleftarrow} 5\\ & 9\overset{+}{\longrightarrow} 4\overset{+}{\longrightarrow} 2\\ & 6\\ & 7 \end{align*} \end{minipage} \noindent Note that the left and middle diagrams, which differ only by a permutation of the last two lines, are considered as different diagrams. \end{example} We denote by $S(\lambda)$ the set of all such diagrams and we will generally denote by the letter $I$ one such diagram. Now, we will define a procedure to associate to any diagram $I\in S(\lambda)$ a certain residue subspace as follows. Recall that for a meromorphic function $f$ with a simple rational pole at $a$, its residue at $a$, denoted $\Res{z\to a}\lbrace f(z) \rbrace$, is simply given by \begin{equation*} \Res{z\to a}\lbrace f(z) \rbrace = (z-a)f(z)\Big\vert_{z=a}. \end{equation*} For a function $f(\vec z)$ of $n$ complex variables that is meromorphic in each variable, we can similarly consider its residue in the variable $z_1$ at $r(\vec z)$, where $r(\vec z)$ does not depend on $z_1$ and is a rational function of the remaining variables $z_2, \dots, z_n$ that we treat as constants. Again, assuming the pole is a simple rational pole, the residue is given by \begin{equation*} \Res{z_1\to r(\vec z)}\lbrace f(\vec z) \rbrace = f(\vec z) (z_1-r(z_2,\dots,z_n))\Big\vert_{z_1=r(\vec z)}, \end{equation*} and can be seen as a function of variables $z_2, \dots, z_n$. More generally, for indices $i_1, \dots, i_k\in \lbrace 1, \dots, n\rbrace$, we may compute successively the residue in $z_{i_1}$ at $r_1(\vec z)$ (where $r_1(\vec z)$ is a rational function of the variables $z_j$ for $j\neq i_1$), the residue in $z_{i_2}$ at $r_2(\vec z)$ (where $r_1(\vec z)$ is a rational function of the variables $z_j$ for $j\neq i_1, i_2$), etc. until the residue in the variable $z_{i_k}$ at $r_k(\vec z)$ (where $r_k(\vec z)$ is a rational function of the variables $z_j$ for $j\neq i_1, \dots, i_k$). Assuming the poles are simple rational poles, which will be the case below, this multi-residue is given by \begin{equation} \Res{\substack{z_{i_1}\to r_1(\vec z) \\ \dots \\ z_{i_k}\to r_k(\vec z)}}\lbrace f(\vec z) \rbrace = f(\vec z)\prod_{j=1}^k(z_{i_j}-r_i(\vec z))\Bigg\vert_{\substack{z_{i_1}= r_1(\vec z) \\ \dots \\ z_{i_k}= r_k(\vec z)}}. \label{eq:residuesubspace} \end{equation} Now, for a diagram $I\in S(\lambda)$ with $\lambda\vdash n$, we will define a multi-residue of the form \eqref{eq:residuesubspace} with $k=n-\ell(\lambda)$, that is, we will compute residues in as many variables as the number of arrows in the diagram $I$, according to the following rules: \begin{itemize} \item for each any arrow of the form $a\overset{+}{\longrightarrow} b$ or $b\overset{+}{\longleftarrow} a$ we compute the residue in the variable $z_a$ at $qz_b$; \item for each arrow of the form $a\overset{-}{\longleftarrow} b$ we compute the residue in the variable $z_b$ at $1/z_a$. \end{itemize} We will denote this multi-residue by $\Res{I} \left\lbrace f(\vec z)\right\rbrace$. We may compute the residues associated to different lines in $I$ in any order. However, within a line, the residues must be computed in an appropriate order so that \eqref{eq:residuesubspace} can be applied. Such an order can always be found, it suffices to start from the extremities of the line and follow the arrows. After computing all the residues, $\Res{I} \left\lbrace f(\vec z)\right\rbrace$ only depends on the variables $z_j$ for each $j$ being the minimal number on one of the lines of the diagram $I$. In other terms, $\Res{I} \left\lbrace f(\vec z)\right\rbrace$ is a function of the variables $z_{i_{\mu_1}}, z_{j_{\mu_2}}, \dots$ There are as many variables as the length of the partition $\lambda$. \begin{example}For the partition $(1,1,\dots)$, there is only one possible diagram where each line has a unique number and no arrow. In that case, $\Res{I} \left\lbrace f(\vec z) \right\rbrace=f(\vec z)$. \end{example} \begin{example}For $n=7$, $\lambda=(4,2,1)$ and \begin{eqnarray*} && 6 \overset{+}{\longrightarrow} 1 \overset{-}{\longleftarrow} 2\overset{+}{\longleftarrow} 3\\ I= && 5\overset{+}{\longrightarrow} 4\\ && 7 \end{eqnarray*} To determine $\Res{I} \left\lbrace f(\vec z)\right\rbrace$ one can compute successively the residue in $z_6$ at $qz_1$ , the residue in $z_3$ at $qz_2$, the residue in $z_2$ at $1/z_1$ and finally the residue in $z_5$ at $qz_4$, and one obtains \begin{equation*} \Res{I} \left\lbrace f(\vec z)\right\rbrace = (z_6-qz_1)(z_2-1/z_1)(z_3-qz_2)(z_5-qz_4)f(z_1, z_2, z_3, z_4, z_5, z_6, z_7)\Bigg\vert_{\substack{z_{6}= q z_1 \\ z_2= 1/z_1 \\ z_3 = q/z_1 \\ z_5= qz_4}}.\end{equation*} \end{example} \begin{remark} The diagrams defined in \cite{borodin2016directed} are slightly more general, allowing the arrows surrounding $i_{\mu_1}, j_{\mu_2},\dots$ to be of the form $\overset{+}{\longrightarrow} i_{\mu_1} \overset{-}{\longleftarrow}$ or $\overset{-}{\longrightarrow} i_{\mu_1} \overset{+}{\longleftarrow}$, but the residual subspaces associated to the latter arrows can be obtained from the former arrows after reflecting the numbers around $i_{\mu_1}$. This double counting is the reason why a factor $2^{m_2+m_3+\dots}$ is present in \cite[Eq. (45)]{borodin2016directed} but not in our equation \eqref{eq:deffunctionv} below. Note also that arrows in \cite{borodin2016directed} go from smaller to larger integers, while our arrows go from larger to smaller integers, but this is inconsequential up to reordering variables. \label{rem:doublecounting} \end{remark} \subsubsection{Formula for $\ensuremath{\mathbb{E}}\left[ Q_{x_1}(\eta(t))\dots Q_{x_n}(\eta(t)) \right]$} Let us first define a function of $n$ complex variables $\vec z=(z_1, \dots, z_n)\in \ensuremath{\mathbb{C}}^n$ by \begin{equation} \phi_{\vec x}(\vec z) = q^{\frac{n(n-1)}{2}} \prod_{i<j} \frac{z_i-z_j}{qz_i-z_j} \frac{1-q z_iz_j}{1-z_iz_j}\prod_{j=1}^n\frac{F_{x_j}(z_j)}{z_j}, \label{eq:defphi} \end{equation} where \begin{equation} F_x(z) = \frac{1-qz^2}{1-z} \exp\left( \frac{(1-q)^2 z\mathsf{p} t}{(1-z)(1-qz)}\right) \left( \frac{1-z}{1-q z} \right)^{x}\frac{\rho}{\rho + (1-\rho)z}. \label{eq:defF} \end{equation} We denote by $\mathcal C$ the positively oriented circle of radius $1/\sqrt{q}$ around $0$. Using these definitions, we are now able to define a function $v_n(t;\vec x)$ as \begin{equation} v_n(t;\vec x) := \sum_{\lambda \vdash n} \frac{(-1)^{n-\ell(\lambda)}}{m_1!m_2!\dots}\sum_{I\in S(\lambda)} \oint_{\mathcal C} \frac{dz_{i_{\mu_1}}}{2\ensuremath{\mathbf{i}}\pi} \oint_{\mathcal C} \frac{dz_{j_{\mu_2}}}{2\ensuremath{\mathbf{i}}\pi} \dots \; \Res{I} \left\lbrace \phi_{\vec x}(\vec z)\right\rbrace, \label{eq:deffunctionv} \end{equation} where $m_1, m_2, \dots $ denotes the respective multiplicities of $1,2,\dots$ in the partition $\lambda$. \begin{theorem}Assume \eqref{eq:Liggettcondition}, let $\rho=\upalpha/\mathsf{p}$ and assume that $\rho\in \left(\frac{1}{1+\sqrt{q}},1 \right]$ so that $\frac{\rho}{1-\rho}>\frac{1}{\sqrt{q}}$. For any $n\in \ensuremath{\mathbb{Z}}_{\geq 1}$, $t\geqslant 0$ and $x\in \Weyl{n}_{\geqslant 1}$, \begin{equation} \ensuremath{\mathbb{E}}\left[ Q_{x_1}(\eta(t))\dots Q_{x_n}(\eta(t)) \right] = v_n(t;\vec x), \label{eq:mixedmomentsQ} \end{equation} where $v_n$ is defined by \eqref{eq:deffunctionv}. In particular, for any $x\geq 1$, \begin{equation} \ensuremath{\mathbb{E}}[q^{N_x(t)}] = \oint_{\mathcal C} \frac{dz}{2\ensuremath{\mathbf{i}}\pi} \frac{F_x(z)}{z}, \label{eq:firstmoment} \end{equation} and for any $1\leq x_1<x_2$, \begin{multline} \ensuremath{\mathbb{E}}[q^{N_{x_1}(t)+N_{x_2}(t)}] = \oint_{\mathcal C} \frac{dz_1}{2\ensuremath{\mathbf{i}}\pi}\oint_{\mathcal C} \frac{dz_2}{2\ensuremath{\mathbf{i}}\pi} \phi_{\vec x}(z_1,z_2) + \\ (1-q)\oint_{\mathcal C} \frac{dz}{2\ensuremath{\mathbf{i}}\pi} \frac{1-q^2 z^2}{1-q z^2}\frac{F_{x_1}(z)F_{x_2}(qz)}{qz} +(1-q) \oint_{\mathcal C} \frac{dz}{2\ensuremath{\mathbf{i}}\pi} \frac{1-z^2}{1-q z^2}\frac{F_{x_1}(z)F_{x_2}(1/z)}{z}. \label{eq:explicitsecondmoment} \end{multline} \label{theo:momentformula} \end{theorem} The condition $\frac{\rho}{1-\rho}>\frac{1}{\sqrt{q}}$ ensures that the only singularity of the function $F_x(\vec z)$, defined in \eqref{eq:defF}, inside the contour $\mathcal C$ is at $z=1$. We expect that for values of $\rho$ that do not satisfy this restriction, $v_n(t; \vec x)$ should be given by the analytic continuation in $\rho$ of \eqref{eq:deffunctionv}, but it would be quite cumbersome to write it explicitly, so we do not pursue this. \begin{remark} The specific form of the function $\phi_{\vec x}(\vec z)$ is inspired from several recent works on integrable half-space probabilistic systems, namely half-line ASEP with closed boundary \cite{tracy2013bose} and the stochastic six-vertex model in a half-quadrant \cite[section 5]{barraquand2018half} (see also \cite{borodin2016directed} and \cite{barraquand2022random} for integral formulas with a similar structure). \end{remark} \subsection{Proof of Theorem \ref{theo:momentformula}} To prove Theorem \ref{theo:momentformula}, we will check below that the function $v_n(t; \vec x)$ defined in \eqref{eq:deffunctionv} satisfies the conditions from Proposition \ref{prop:freeevolutionu}. \subsubsection{Condition (1)} We have \begin{equation*} \Delta^{\mathsf{p},\mathsf{q}}\left( \frac{1-z}{1-q z} \right)^{x} = \frac{(1-q)^2 z \mathsf{p}}{(1-z)(1-qz)} \left( \frac{1-z}{1-q z} \right)^{x}, \end{equation*} where $\Delta^{\mathsf{p},\mathsf{q}}$ was defined in \eqref{eq:defDelta} and acts on functions of the variable $x$. Hence, we have that $\frac{d}{dt} \phi_{\vec x}(\vec z) = \Delta^{\mathsf{p},\mathsf{q}}\phi_{\vec x}(\vec z)$, and by linearity of the integral and residues, we conclude that \begin{equation*}\frac{d}{dt} v_n(t; \vec x) = \Delta^{\mathsf{p},\mathsf{q}}v_n(t; \vec x).\end{equation*} \subsubsection{Condition (2)} When $x_i+1=x_{i+1}$, \begin{equation*} \mathsf{p} v_n(t; \vec x_{i+1}^-) + \mathsf{q} v_n(t; \vec x_i^+) - (\mathsf{p}+\mathsf{q}) v_n(t; \vec x) \end{equation*} has the same expression as $v_n(t; \vec x_{i+1}^-)$ in \eqref{eq:deffunctionv}, with an extra factor \begin{equation*} \mathsf{p} + \mathsf{q} \left( \frac{1-z_{i}}{1-qz_{i}}\right)\left(\frac{1-z_{i+1}}{1-qz_{i+1}}\right)-(\mathsf{p}+\mathsf{q})\left(\frac{1-z_{i+1}}{1-qz_{i+1}}\right) =\frac{(\mathsf{p}-\mathsf{q})(qz_i-z_{i+1})}{(1-qz_{i})(1-qz_{i+1})} \end{equation*} in the function $\phi$. This extra factor brings poles at $z_i=1/q$ and $z_{i+1}=1/q$ located outside the contour $\mathcal C$, and it brings a factor $(qz_i-z_{i+1})$ which cancel the one present in the denominator. More precisely, we write \begin{equation} \mathsf{p} v_n(t; \vec x_{i+1}^-) + \mathsf{q} v_n(t; \vec x_i^+) - (\mathsf{p}+\mathsf{q}) v_n(t; \vec x) = \sum_{\lambda \vdash n} \frac{(-1)^{n-\ell(\lambda)}}{m_1!m_2!\dots}\sum_{I\in S(\lambda)} \oint_{\mathcal C} \frac{dz_{i_{\mu_1}}}{2\ensuremath{\mathbf{i}}\pi} \oint_{\mathcal C} \frac{dz_{j_{\mu_2}}}{2\ensuremath{\mathbf{i}}\pi} \dots \; \Res{I} \left\lbrace \widetilde \phi(\vec z)\right\rbrace, \label{eq:sumphitilde} \end{equation} where \begin{equation} \widetilde \phi(\vec z) =\frac{(\mathsf{p}-\mathsf{q})(qz_i-z_{i+1})}{(1-qz_{i})(1-qz_{i+1})} \phi_{\vec x_{i+1}^-} (\vec z). \label{eq:defphitilde} \end{equation} Our goal is to show that \eqref{eq:sumphitilde} equals $0$. We will show that for each $\lambda$, the term indexed by $\lambda$ in \eqref{eq:sumphitilde} vanishes. For each $\lambda$, we will show that for some diagrams $I\in S(\lambda)$, the term indexed by $I$ in \eqref{eq:sumphitilde} equals $0$, while for other diagrams, we will show that their contribution exactly cancels that of another diagram. More precisely, we will use several times the following argument. For a certain subset of diagrams $\mathcal I \subset S(\lambda)$, we will introduce an involution $\sigma :\mathcal I\to\mathcal I$ on diagrams such that \begin{equation} \oint_{\mathcal C} \frac{dz_{i_{\mu_1}}}{2\ensuremath{\mathbf{i}}\pi} \oint_{\mathcal C} \frac{dz_{j_{\mu_2}}}{2\ensuremath{\mathbf{i}}\pi} \dots \; \Res{I} \left\lbrace \widetilde \phi(\vec z)\right\rbrace = - \oint_{\mathcal C} \frac{dz_{i_{\mu_1}}}{2\ensuremath{\mathbf{i}}\pi} \oint_{\mathcal C} \frac{dz_{j_{\mu_2}}}{2\ensuremath{\mathbf{i}}\pi} \dots \;\Res{\sigma(I)} \left\lbrace \widetilde \phi(\vec z)\right\rbrace. \label{eq:involutioneffect} \end{equation} Since an involution is in particular a bijection, we may write that \begin{equation*} \sum_{I\in \mathcal I} \oint_{\mathcal C} \frac{dz_{i_{\mu_1}}}{2\ensuremath{\mathbf{i}}\pi} \oint_{\mathcal C} \frac{dz_{j_{\mu_2}}}{2\ensuremath{\mathbf{i}}\pi} \dots \; \Res{I} \left\lbrace \widetilde \phi(\vec z)\right\rbrace = \sum_{I\in \mathcal I} \oint_{\mathcal C} \frac{dz_{i_{\mu_1}}}{2\ensuremath{\mathbf{i}}\pi} \oint_{\mathcal C} \frac{dz_{j_{\mu_2}}}{2\ensuremath{\mathbf{i}}\pi} \dots \; \Res{\sigma(I)} \left\lbrace \widetilde \phi(\vec z)\right\rbrace, \end{equation*} so that using \eqref{eq:involutioneffect}, \begin{equation} \sum_{I\in \mathcal I} \oint_{\mathcal C} \frac{dz_{i_{\mu_1}}}{2\ensuremath{\mathbf{i}}\pi} \oint_{\mathcal C} \frac{dz_{j_{\mu_2}}}{2\ensuremath{\mathbf{i}}\pi} \dots \; \Res{I} \left\lbrace \widetilde \phi(\vec z)\right\rbrace = -\sum_{I\in \mathcal I} \oint_{\mathcal C} \frac{dz_{i_{\mu_1}}}{2\ensuremath{\mathbf{i}}\pi} \oint_{\mathcal C} \frac{dz_{j_{\mu_2}}}{2\ensuremath{\mathbf{i}}\pi} \dots \; \Res{I} \left\lbrace \widetilde \phi(\vec z)\right\rbrace=0. \label{eq:conclusioninvolution} \end{equation} Another way to interpret \eqref{eq:involutioneffect} is that in the sum \eqref{eq:conclusioninvolution}, the terms corresponding to a diagram $I$ and its image $\sigma(I)$ exactly cancel each other, and when $I=\sigma(I)$, \eqref{eq:involutioneffect} shows that the corresponding term is the opposite of itself, hence equal to zero. Fix some partition $\lambda\vdash n$. It is convenient to partition the set of diagrams $S(\lambda)$ into the following four cases: \begin{enumerate} \item The number $i$ and $i+1$ occur in the diagram $I$ in neighbouring positions on the same line, separated by an arrow bearing a plus sign, that is, the diagram $I$ contains $ i+1 \overset{+}{\longrightarrow} i $ or $i\overset{+}{\longleftarrow} i+1$. \item The number $i$ and $i+1$ occur in the diagram $I$ in neighbouring positions on the same line, separated by an arrow bearing a minus sign, that is, the diagram $I$ contains $i\overset{-}{\longleftarrow} i+1$. \item The numbers $i$ and $i+1$ occur in the diagram $I$ in the same line but not in neighbouring positions, in which case they are necessarily separated by an arrow bearing a minus sign. \item The numbers $i$ and $i+1$ belong to two different lines in the diagram $I$. \end{enumerate} We treat these four cases separately below. \textbf{Case (1):} By \eqref{eq:defphitilde}, the function $\widetilde\phi$ has no singularity when $z_{i+1}=qz_i$, so that for any diagram $I$ containing $ i+1 \overset{+}{\longrightarrow} i $ or $i\overset{+}{\longleftarrow} i+1$, then $\Res{I} \left\lbrace \widetilde \phi(\vec z)\right\rbrace=0$. \textbf{Case (2):} Any diagram $I$ in that case contains $i\overset{-}{\longleftarrow} i+1$. For such a diagram $I$, the line in the diagram $I$ containing the arrow $i\overset{-}{\longleftarrow} i+1$ takes the form \begin{equation} A\overset{+}{\longrightarrow} i\overset{-}{\longleftarrow} i+1 \overset{+}{\longleftarrow} B, \label{eq:snippet3} \end{equation} where $A$ and $B$ are (possibly empty) sequences of numbers separated by arrows that we call snippets. To this diagram $I$, we associate the diagram $\sigma(I)$ obtained from $I$ by changing the line \eqref{eq:snippet3} to \begin{equation*} B'\overset{+}{\longrightarrow} i\overset{-}{\longleftarrow} i+1 \overset{+}{\longleftarrow} A', \label{eq:snippet4} \end{equation*} where $A'$ (resp $B'$) is obtained from $A$ (resp. B) by reversing the direction of arrows and reordering the numbers between them. \begin{example}Assume that $i=1$ and consider the diagram \begin{eqnarray*} I= && 8\overset{+}{\longrightarrow} 6 \overset{+}{\longrightarrow} 1 \overset{-}{\longleftarrow} 2\overset{+}{\longleftarrow} 3 \overset{+}{\longleftarrow} 7\\ && 5\overset{+}{\longrightarrow} 4 \end{eqnarray*} In this case, the snippets $A$ and $B$ in \eqref{eq:snippet3} are $A = 8\overset{+}{\longrightarrow} 6 $ and $B= 3 \overset{+}{\longleftarrow} 7$, so that $A' = 6\overset{+}{\longleftarrow} 8 $, $B'= 7 \overset{+}{\longrightarrow} 3$ and \begin{eqnarray*} \sigma(I)= && 7\overset{+}{\longrightarrow} 3 \overset{+}{\longrightarrow} 1 \overset{-}{\longleftarrow} 2\overset{+}{\longleftarrow} 6 \overset{+}{\longleftarrow} 8\\ && 5\overset{+}{\longrightarrow} 4 \end{eqnarray*} \end{example} It is clear that $\sigma$ is an involution of the set of diagrams belonging to case (2). Consider then the expression $\Res{I} \left\lbrace \widetilde \phi(\vec z) \right\rbrace$, as a function of the variable $z_i$. Due to the form of the function $\widetilde\phi$ in \eqref{eq:formofphitilde}, we see that by the change of variables $z_i\to 1/z_i$, \begin{equation} \oint_{\mathcal C} \frac{dz_i}{2\ensuremath{\mathbf{i}}\pi} \Res{I} \left\lbrace \widetilde \phi(\vec z) \right\rbrace = - \oint_{\mathcal C'} \frac{dz_i}{2\ensuremath{\mathbf{i}}\pi} \Res{\sigma(I)} \left\lbrace \widetilde \phi(\vec z) \right\rbrace, \label{eq:equalityofresidues} \end{equation} where the contour $\mathcal C'$ is a positively oriented circle of radius $\sqrt{q}$, and recall that in the right-hand-side, $\Res{\sigma(I)} \left\lbrace \widetilde \phi(\vec z) \right\rbrace$ is as a function of the variable $z_{i}$. We will now show that we can deform the contour $\mathcal C'$ to $\mathcal C$, so that \begin{equation} \oint_{\mathcal C} \frac{dz_i}{2\ensuremath{\mathbf{i}}\pi} \Res{I} \left\lbrace \widetilde \phi(\vec z) \right\rbrace = - \oint_{\mathcal C} \frac{dz_i}{2\ensuremath{\mathbf{i}}\pi} \Res{\sigma(I)} \left\lbrace \widetilde \phi(\vec z) \right\rbrace. \label{eq:equalityofresidues2} \end{equation} Before proving that this deformation of contours is valid, let us illustrate how \eqref{eq:equalityofresidues} works through the following example. \begin{example} \label{ex:invarianceinversion} Let us consider the minimal example of the case $n=2$, $\lambda=(2)$, and $I=1\overset{-}{\longleftarrow} 2$. In this case, $\sigma(I)=I$. We have, letting $x=x_1=x_2-1$, \begin{equation} \widetilde \phi(z_1,z_2) =q\frac{(\mathsf{p}-\mathsf{q})(qz_1-z_{2})}{(1-qz_{1})(1-qz_{2})} \frac{z_1-z_2}{qz_1-z_2} \frac{1-q z_1z_2}{1-z_1z_2}\frac{F_{x}(z_1)}{z_1}\frac{F_{x}(z_2)}{z_2}, \label{eq:specialphitilde} \end{equation} so that \begin{equation*} \Res{z_{2}\to 1/z_1} \lbrace \widetilde \phi(\vec z)\rbrace = \frac{-q(\mathsf{p}-\mathsf{q})(1-q)(z_1-1/z_1)}{(1-qz_{1})(1-q/z_{1})} \frac{F_{x}(z_1)F_{x}(1/z_1)}{z_1}. \label{eq:specialresiduephitilde} \end{equation*} Due to the factor $(z_1-1/z_1)$, we see that under the change of variables $z_1\to 1/z_1$, \begin{equation} \oint_{\mathcal C} \frac{dz_1}{2\ensuremath{\mathbf{i}}\pi} \Res{z_{2}\to 1/z_1} \lbrace \widetilde \phi(\vec z)\rbrace = - \oint_{\mathcal C'} \frac{dz_1}{2\ensuremath{\mathbf{i}}\pi} \Res{z_{2}\to 1/z_1} \lbrace \widetilde \phi(\vec z)\rbrace, \label{eq:specialequalityresidue} \end{equation} which is a special case of \eqref{eq:equalityofresidues}. Furthermore, we notice that \begin{multline} F_{x}(z) F_{x}(1/z) = \\ \frac{1-qz^2}{1-z}\frac{1-q/z^2}{1-1/z} \exp\left( \frac{(1-q)^2 \mathsf{p} t(1+q)z}{(1-qz)(q-z)}\right) \left( \frac{1-z}{1-q z} \right)^{x}\left( \frac{1-1/z}{1-q /z} \right)^{x}\frac{\rho}{\rho + (1-\rho)z}\frac{\rho}{\rho + (1-\rho)/z}. \label{eq:simplification} \end{multline} While both $F_{x}(z)$ and $ F_{x}(1/z)$ have an essential singularity at $z=1$, in \eqref{eq:simplification}, the exponential term in the product no longer has a singularity at $z=1$. Moreover, the denominators $(1-z)$ and $(1-1/z)$ in \eqref{eq:simplification} are canceled by the factors $\left( \frac{1-z}{1-q z} \right)^{x}\left( \frac{1-1/z}{1-q /z} \right)^{x}$ since $x\geq 1$. Thus, \eqref{eq:specialresiduephitilde} has no singularity at $z=1$, so that one may deform the contour $\mathcal C'$ to $\mathcal C$ in \eqref{eq:specialequalityresidue}, and conclude that \begin{equation*} \oint_{\mathcal C} \frac{dz_1}{2\ensuremath{\mathbf{i}}\pi} \Res{z_{2}\to 1/z_1} \lbrace \widetilde \phi(\vec z)\rbrace = - \oint_{\mathcal C} \frac{dz_1}{2\ensuremath{\mathbf{i}}\pi} \Res{z_{2}\to 1/z_1} \lbrace \widetilde \phi(\vec z)\rbrace= 0 \end{equation*} \end{example} Going back to the general case, since the function $F_x(z)$ has singularities at $z=1$, $z=1/q$ and $z=-\rho/(1-\rho)$, \eqref{eq:simplification} implies that for any nonnegative integers $r,s$, the function \begin{equation} F_x(q^rz)\dots F_x(qz)F_{x}(z) F_{x}(1/z)F_x(q/z)\dots F_x(q^s/z) \label{eq:nosingularitiesannulus} \end{equation} has no singularities at $z=1$. Letting $\omega=-\rho/(1-\rho)$, we see that \eqref{eq:nosingularitiesannulus} has singularities only at the points \begin{equation*} q^{s+1}, q^s, \dots , q^2, q, q^{-1}, q^{-2} \dots, q^{-r-1} \text{ and } \omega q^{-r}, \dots, \omega, 1/\omega, \dots, q^s/\omega.\end{equation*} In particular, since $\vert \omega\vert >1/\sqrt{q}$ by hypothesis, \eqref{eq:nosingularitiesannulus} has no singularities in the annulus formed by complex numbers with radius in $[\sqrt{q},1/\sqrt{q}]$). This implies that in \eqref{eq:equalityofresidues}, the contour $\mathcal C'$ can be deformed to become $\mathcal C$ without encountering any singularities, so that \eqref{eq:equalityofresidues2} holds. Using \eqref{eq:conclusioninvolution}, we have proven that the sum of terms in \eqref{eq:sumphitilde} over all diagrams $I$ corresponding to case (2) is zero. \textbf{Case (3):} For any diagram $I$ belonging to that case, there exist a number $k<i$ such that the diagram $I$ contains the snippet \begin{equation} i \overset{+}{\longrightarrow} A \overset{+}{\longrightarrow} k \overset{-}{\longleftarrow} B \overset{+}{\longleftarrow} i+1 , \label{eq:snippet1} \end{equation} or \begin{equation} i+1 \overset{+}{\longrightarrow} A \overset{+}{\longrightarrow} k \overset{-}{\longleftarrow} B \overset{+}{\longleftarrow} i, \label{eq:snippet2} \end{equation} where $A$ and $B$ are (possibly empty) sequences of numbers separated by arrows. Here we do not mean that one line of $I$ has the form of \eqref{eq:snippet1} or \eqref{eq:snippet2}, but rather that one line of the diagram $I$ contains one of those snippets. There may be more arows on the left/right of the numbers $i$ and $i+1$. Since the function $\widetilde\phi$ can be written as \begin{equation} \widetilde \phi(\vec z) = (z_i-z_{i+1})\frac{1-qz_{i}z_{i+1}}{1-z_iz_{i+1}} f\left(z_i; \lbrace z_j\rbrace_{j\neq i,i+1}\right)f\left(z_{i+1}; \lbrace z_j\rbrace_{j\neq i,i+1}\right), \label{eq:formofphitilde} \end{equation} for some function $f$, the contribution of a diagram $I$ containing \eqref{eq:snippet1} exactly cancels the contribution of the diagram $\sigma(I)$ where $\sigma(I)$ is exactly the same as $I$ up to the replacement of \eqref{eq:snippet1} by \eqref{eq:snippet2} and vice-versa. Again, it is clear that $\sigma$ defined an involution. Due to the prefactor $(z_i-z_{i+1})$ in \eqref{eq:formofphitilde}, we find that $\Res{I} \left\lbrace \widetilde \phi(\vec z) \right\rbrace=-\Res{\sigma(I)} \left\lbrace \widetilde \phi(\vec z) \right\rbrace$, so that we may apply \eqref{eq:conclusioninvolution} to the set of diagrams in case (3). \textbf{Case (4):} Now we consider the case when the diagram $I$ contains snippets of the form \begin{eqnarray} A \longleftrightarrow& i &\longleftrightarrow B \label{eq:snippet5}\\ C \longleftrightarrow& i+1&\longleftrightarrow D, \nonumber \end{eqnarray} where the arrows $\longleftrightarrow$ may be any type of arrow among $\overset{+}{\longrightarrow}, \overset{+}{\longleftarrow}$ and $\overset{-}{\longleftarrow}$. Consider the diagram $\sigma(I)$ obtained from $I$ by replacing the snippet \eqref{eq:snippet5} by \begin{eqnarray} A \longleftrightarrow& i+1 &\longleftrightarrow B \label{eq:snippet6}\\ C \longleftrightarrow& i&\longleftrightarrow D,\nonumber \end{eqnarray} assuming that the arrows in \eqref{eq:snippet5} and the corresponding ones in \eqref{eq:snippet6} are of the same type. Let us call $a$ the minimal number in the first line of \eqref{eq:snippet5} and $b$ the minimal number in the second line of \eqref{eq:snippet5}, and let us call $a', b'$ the minimal numbers in the lines of \eqref{eq:snippet6} ($(a,b)$ and $(a',b')$ are not necessarily the same). By the change of variables $(z_a,z_b)\to (z_{b'},z_{a'})$, we have that by \eqref{eq:formofphitilde}, \begin{equation} \oint_{\mathcal C} \frac{dz_a}{2\ensuremath{\mathbf{i}}\pi} \oint_{\mathcal C} \frac{dz_b}{2\ensuremath{\mathbf{i}}\pi} \Res{I} \left\lbrace \widetilde \phi(\vec z) \right\rbrace = - \oint_{\mathcal C} \frac{dz_a}{2\ensuremath{\mathbf{i}}\pi} \oint_{\mathcal C} \frac{dz_b}{2\ensuremath{\mathbf{i}}\pi} \Res{\sigma(I)} \left\lbrace \widetilde \phi(\vec z) \right\rbrace. \label{eq:symmetrytwovariables} \end{equation} The minus term comes from the factor $z_a-z_b$ in $\widetilde \phi(\vec z)$. Again, we may apply \eqref{eq:conclusioninvolution} to the set of diagrams in case (4). \begin{example} To illustrate how \eqref{eq:symmetrytwovariables} works, let us consider the minimal example of the case $n=2$, $\lambda=(1,1)$, in which case the only possible diagram is a diagram without any arrows. The function $\widetilde\phi$ already calculated in \eqref{eq:specialphitilde} simplifies to \begin{equation*} \widetilde \phi(z_1,z_2) =\frac{q(\mathsf{p}-\mathsf{q})(z_1-z_2)}{(1-qz_{1})(1-qz_{2})} \frac{1-q z_1z_2}{1-z_1z_2}\frac{F_{x}(z_1)}{z_1}\frac{F_{x}(z_2)}{z_2}, \end{equation*} so that it satisfies $\widetilde\phi(z_1,z_2)=-\widetilde \phi(z_2,z_1)$. Since variables are integrated along the same contour, the change of variables $(z_1,z_2)\to(z_1,z_2)$ yields \begin{equation*} \oint_{\mathcal C} \frac{dz_1}{2\ensuremath{\mathbf{i}}\pi} \oint_{\mathcal C} \frac{dz_2}{2\ensuremath{\mathbf{i}}\pi} \widetilde\phi(z_1,z_2) = - \oint_{\mathcal C} \frac{dz_1}{2\ensuremath{\mathbf{i}}\pi} \oint_{\mathcal C} \frac{dz_2}{2\ensuremath{\mathbf{i}}\pi} \widetilde\phi(z_1,z_2), \end{equation*} so that the integral must equal $0$. This is a special case of \eqref{eq:symmetrytwovariables} where the diagram $I$ has no arrows. \end{example} Finally, having treated the four cases above, we have shown that when $x_{i+1}=x_i+1$, the sum over all the terms in \eqref{eq:sumphitilde} vanishes, so that Condition (2) is satisfied. \subsubsection{Condition (3)} We need to check that \begin{equation}(\rho -\rho q-1)v_n(t;1,x_2,\dots) + v_n(t;0,x_2,\dots) = 0.\label{eq:BCtocheck}\end{equation} The left-hand-side of \eqref{eq:BCtocheck} can be written as \begin{equation} \sum_{\lambda \vdash n} \frac{(-1)^{n-\ell(\lambda)}}{m_1!m_2!\dots}\sum_{I\in S(\lambda)} \oint_{\mathcal C} \frac{dz_{i_{\mu_1}}}{2\ensuremath{\mathbf{i}}\pi} \oint_{\mathcal C} \frac{dz_{j_{\mu_2}}}{2\ensuremath{\mathbf{i}}\pi} \dots \; \Res{I} \left\lbrace \widehat \phi(\vec z)\right\rbrace, \label{eq:sumphitilde2} \end{equation} where the function $\widehat\phi$ is now defined by \begin{equation} \widehat \phi(\vec z) = \frac{(1-q)(\rho + (1-\rho)z_1)}{1-qz_1} \phi_{0, x_2, \dots, x_n} (\vec z). \label{eq:defphitildebis} \end{equation} Since $1$ is the minimum of the set $\lbrace 1,\dots, n\rbrace$, any diagram $I$ in the sum \eqref{eq:sumphitilde2} must contain a line of the form \begin{equation} A\overset{+}{\longrightarrow} 1\overset{-}{\longleftarrow} B, \label{eq:linecontaining1} \end{equation} where $A$ and $B$ are possibly empty snippets. Let us also consider the diagram $\sigma(I) $ obtained from $I$ by changing the line \eqref{eq:linecontaining1} to \begin{equation*} B'\overset{+}{\longrightarrow} 1\overset{-}{\longleftarrow} A', \label{eq:linecontaining1bis} \end{equation*} where $A',B'$ are obtained from $A,B$ by reversing the direction of arrows. Again, $\sigma$ is an involution on the set of all diagrams appearing in \eqref{eq:sumphitilde2}. Using the explicit expression for $\widehat\phi$ in \eqref{eq:defphitildebis}, we notice that \begin{equation*} \widehat\phi(z_1,z_2,\dots, z_n) dz_1 = \widehat\phi\Big(1/(qz_1),z_2,\dots, z_n\Big) d(1/(qz_1)).\end{equation*} Hence, by the change of variables $z_1\to 1/(qz_1)$ (the contour $\mathcal C$ remains unchanged under this change of variables, up to the orientation of the contour), we have that \begin{equation*} \oint_{\mathcal C} \frac{dz_1}{2\ensuremath{\mathbf{i}}\pi} \Res{I} \left\lbrace \widehat \phi(\vec z)\right\rbrace = -\oint_{\mathcal C} \frac{dz_1}{2\ensuremath{\mathbf{i}}\pi} \Res{\sigma(I)} \left\lbrace \widehat \phi(\vec z)\right\rbrace.\end{equation*} Again, using \eqref{eq:conclusioninvolution}, this shows that \eqref{eq:sumphitilde2} equals zero. \subsubsection{Condition (4)} The modulus of the integral is smaller than the integral of the modulus. Thus, inspecting the dependence in $x_1$ in the integral formula \eqref{eq:deffunctionv}, and since we are integrating over a finite contour $\mathcal C$, we may find constants $c,C>0$ such that \begin{equation*} \vert v_k(t; \vec x) \vert \leqslant Ce^{c\vert x_1\vert} \vert v_{k-1}(t; x_2, \dots, x_n)\vert.\end{equation*} By recurrence, it implies that Condition (4) is satisfied. \subsubsection{Condition (5)} When $t=0$, the function $\phi_{\vec x}(\vec z)$ defined in \eqref{eq:defphi} has no singularity at $z_i=1$ anymore, for all $1\leq i\leq n$. We will show that in that case, we can evaluate the integrals in \eqref{eq:deffunctionv} by residues. It will turn out that almost all residues will cancel each other, except for the residue at $z_n=0, z_{n-1}=0, \dots, z_1=0$, arising only for the diagram $I$ without any arrow, in which case the residue equals $1$. To formalize this idea, we will proceed by recurrence. We will show that for all $n\geq 2$, \begin{equation} v_n(0;\vec x) = v_{n-1}(0,x_1, \dots, x_n). \label{eq:recurrencetoshow} \end{equation} Hence, by recurrence, it suffices to compute \begin{equation*} v_1(0; x) = \oint_{\mathcal C} \frac{dz_1}{2\ensuremath{\mathbf{i}}\pi} \frac{1-qz_1^2}{1-z_1}\left( \frac{1-z_1}{1-q z_1} \right)^{x_1}\frac{\rho}{\rho + (1-\rho)z_1} \frac{1}{z_1}. \end{equation*} The pole at $z_1=\frac{-\rho}{1-\rho}$ is outside the contours, there is no residue at $z_1=1$ since $x_1\geq 1$, and the residue at $z_1=0$ is readily evaluated to be $1$. This shows that for all $n\geq 1$ and for all $\vec x\in \Weyl{n}_{\geq 1}$, \begin{equation} v_n(0;\vec x) = 1, \end{equation} so that Condition (5) is satisfied for the empty initial condition. In order to prove \eqref{eq:recurrencetoshow}, let us consider \eqref{eq:deffunctionv} and perform the integrations over the variable $z_n$. The variable $z_n$ only arises in terms corresponding to diagrams $I$ where the number $n$ belongs to a line without arrow. This occurs only for partitions $\lambda$ such that $\lambda_{\ell(\lambda)}=1$. In that case, the function $\phi_{\vec x}(\vec z)$ has simple poles at $z_n=0$, $z_n=qz_i$ for $i<n$, and $z_n=1/z_i$ for $i<n$. Let us denote by $\Lambda_n$ the set of partitions of $n$. We may decompose \begin{equation*} \Lambda_n=\Lambda_n^{(1)}\sqcup \Lambda_n^{(>1)}, \end{equation*} where $\Lambda_n^{(1)}=\lbrace \lambda\vdash n: \lambda_{\ell(\lambda)}=1\rbrace $ and $\Lambda_n^{(>1)}=\lbrace \lambda\vdash n: \lambda_{\ell(\lambda)}>1\rbrace$. There is a natural bijection between the set $\Lambda_n^{(1)}$ and the set $\Lambda_{n-1}$ (this bijection consists in removing the last part of the partition $\lambda\in \Lambda_n^{(1)}$). For a partition $\lambda\in \Lambda_n$, let us decompose $S(\lambda)$ as \begin{equation*}S(\lambda) = S^{\rm linked}(\lambda)\sqcup S^{\rm free}(\lambda)\end{equation*} where $S^{\rm free}(\lambda)$ is the set of diagrams $I\in S(\lambda)$ such that the number $n$ belongs to a line without arrows. This set is nonempty only when $\lambda\in \Lambda_n^{(1)}$. Let us first consider the sum \begin{equation} \sum_{\lambda \in \Lambda_n^{(1)}} \frac{(-1)^{n-\ell(\lambda)}}{m_1!m_2!\dots}\sum_{I\in S^{\rm free}(\lambda)} \oint_{\mathcal C} \frac{dz_{i_{\mu_1}}}{2\ensuremath{\mathbf{i}}\pi} \oint_{\mathcal C} \frac{dz_{j_{\mu_2}}}{2\ensuremath{\mathbf{i}}\pi} \dots \; \Res{I} \left\lbrace \oint_{\mathcal C}\frac{dz_n}{2\ensuremath{\mathbf{i}}\pi} \phi_{\vec x}(\vec z)\right\rbrace, \label{eq:initialconditiontoevaluate} \end{equation} Evaluating the integral over $z_n$ by residues, we have \begin{multline} \eqref{eq:initialconditiontoevaluate} = \underbrace{\sum_{\lambda \in \Lambda_n^{(1)}} \frac{(-1)^{n-\ell(\lambda)}}{m_1!m_2!\dots}\sum_{I\in S^{\rm free}(\lambda)} \oint_{\mathcal C} \frac{dz_{i_{\mu_1}}}{2\ensuremath{\mathbf{i}}\pi} \oint_{\mathcal C} \frac{dz_{j_{\mu_2}}}{2\ensuremath{\mathbf{i}}\pi} \dots \Res{I} \left\lbrace \Res{z_n=0} \;\phi_{\vec x}(\vec z)\right\rbrace}_{:=R_0}\\ + \sum_{i=1}^{n-1} \underbrace{\sum_{\lambda \in \Lambda_n^{(1)}} \frac{(-1)^{n-\ell(\lambda)}}{m_1!m_2!\dots}\sum_{I\in S^{\rm free}(\lambda)} \oint_{\mathcal C} \frac{dz_{i_{\mu_1}}}{2\ensuremath{\mathbf{i}}\pi} \oint_{\mathcal C} \frac{dz_{j_{\mu_2}}}{2\ensuremath{\mathbf{i}}\pi} \dots \Res{I} \left\lbrace \Res{z_n=qz_i} \;\phi_{\vec x}(\vec z)\right\rbrace}_{:=R_i}\\ +\sum_{i=1}^{n-1} \underbrace{ \sum_{\lambda \in \Lambda_n^{(1)}} \frac{(-1)^{n-\ell(\lambda)}}{m_1!m_2!\dots}\sum_{I\in S^{\rm free}(\lambda)} \oint_{\mathcal C} \frac{dz_{i_{\mu_1}}}{2\ensuremath{\mathbf{i}}\pi} \oint_{\mathcal C} \frac{dz_{j_{\mu_2}}}{2\ensuremath{\mathbf{i}}\pi} \dots \Res{I} \left\lbrace \Res{z_n=1/z_i} \;\phi_{\vec x}(\vec z)\right\rbrace}_{:=R_{-i}}. \label{eq:defRi} \end{multline} We have that \begin{equation*} \Res{z_n=0} \left\lbrace \phi_{\vec x}(\vec z) \right\rbrace= \phi_{x_1, \dots, x_{n-1}}(z_1, \dots, z_{n-1}). \end{equation*} Using the bijection between $\Lambda_n^{(1)}$ and $\Lambda_n$, and taking into account that there are $m_1(\lambda)$ ways to place the letter $n$ in a line of length $1$ in $I\in S^{\rm free}(\lambda)$, the term $R_0$ in \eqref{eq:initialconditiontoevaluate} can be rewritten as \begin{equation} R_0 = \sum_{\tilde\lambda \in \Lambda_{n-1}} \frac{(-1)^{n-1-\ell(\tilde\lambda)}}{m_1(\tilde\lambda)!m_2(\tilde\lambda)!\dots}\sum_{I\in S(\tilde\lambda)} \oint_{\mathcal C} \frac{dz_{i_{\mu_1}}}{2\ensuremath{\mathbf{i}}\pi} \oint_{\mathcal C} \frac{dz_{j_{\mu_2}}}{2\ensuremath{\mathbf{i}}\pi} \dots \; \Res{\sigma(I)} \left\lbrace \phi_{x_1, \dots, x_{n-1}}(z_1, \dots, z_{n-1})\right\rbrace, \label{eq:initialevaluated} \end{equation} where the partition $\tilde\lambda$ in \eqref{eq:initialevaluated} correspond to the partition $\lambda$ in \eqref{eq:initialconditiontoevaluate} with the last part removed (so that $\ell(\tilde\lambda)=\ell(\lambda)-1$), and the diagram $\sigma(I)$ is obtained from the diagram $I$ by removing the letter $n$. There are $m_1(\lambda)$ diagrams $I$ corresponding to a diagram $\sigma(I)$, all giving the same contribution, and this is consistent with the fact that $m_1(\lambda)=m_1(\tilde\lambda)+1$ so that $m_1(\lambda)! = m_1(\lambda) \times m_1(\tilde\lambda)!$. Hence, we have shown that \begin{equation*} R_0 = v_{n-1}(0,x_1, \dots, x_n).\end{equation*} Now we need to explain why all other residues will cancel out. Recall that the quantity that we have to compute, $v_n(0;\vec x)$, is not exactly given by \eqref{eq:initialconditiontoevaluate} but contains additional terms corresponding to partitions $\lambda\in \Lambda_n^{(>1)}$ or $\lambda\in \Lambda_n^{1)}$ and $I\in S^{\rm linked}(\lambda)$. When $\lambda\in \Lambda_n^{(>1)}$, $S^{\rm free}(\lambda)=\emptyset$, so that we may write that \begin{equation} v_n(0;\vec x) -\eqref{eq:initialconditiontoevaluate} = \sum_{\lambda \in \Lambda_n} \frac{(-1)^{n-\ell(\lambda)}}{m_1!m_2!\dots}\sum_{I\in S^{\rm linked}(\lambda)} \oint_{\mathcal C} \frac{dz_{i_{\mu_1}}}{2\ensuremath{\mathbf{i}}\pi} \oint_{\mathcal C} \frac{dz_{j_{\mu_2}}}{2\ensuremath{\mathbf{i}}\pi} \dots \; \Res{I} \left\lbrace \oint_{\mathcal C}\frac{dz_n}{2\ensuremath{\mathbf{i}}\pi} \phi_{\vec x}(\vec z)\right\rbrace. \label{eq:remainingresidues} \end{equation} We will show that all terms in the right-hand-side of \eqref{eq:remainingresidues} are exactly cancelled by terms in the sum $\sum_{i=1}^n R_i+R_{-i}$. In order to prove that, we will match all non trivial terms in $\sum_{i=1}^n R_i+R_{-i}$ indexed by $\lambda\in \Lambda_n^{(1)}$ and $I\in S^{\rm free}(\lambda)$ to some term indexed by $\tilde \lambda \in \Lambda_n, \tilde I \in S^{\rm linked}(\lambda)$ in \eqref{eq:remainingresidues}. The matching is quite natural but will require some notation to be formalized. Let us first explain the idea. In the terms $R_i$ and $R_{-i}$ in \eqref{eq:defRi}, we are summing over diagrams $I$ where the number $n$ is alone on its line, i.e. no residue is taken in the variable $z_n$, and we take extra residues at $z_n=qz_i$ or $z_n=1/z_i$. All those residues should match with residues associated to the diagrams in \eqref{eq:remainingresidues} where now the number $n$ is not alone, i.e. a residue is taken at $z_n=qz_i$ or $z_n=1/z_i$ for some $i$. To prove this, we need to argue that terms in \eqref{eq:defRi} and terms in \eqref{eq:remainingresidues} can be matched bijectively. It will be convenient to write the terms $R_i$ and $R_{-i}$ in \eqref{eq:defRi} as \begin{equation*} R_i = \sum_{\lambda\in\Lambda_n^{(1)}}\sum_{I\in S^{\rm free}(\lambda)} R_i(\lambda,I), \;\;\; R_{-i} = \sum_{\lambda\in\Lambda_n^{(1)}}\sum_{I\in S^{\rm free}(\lambda)} R_{-i}(\lambda,I) \end{equation*} and to write \eqref{eq:remainingresidues} as \begin{equation*} \eqref{eq:remainingresidues} =\sum_{\lambda \in \Lambda_n} \sum_{I\in S^{\rm linked}(\lambda)} T(\lambda,I). \end{equation*} Let us first fix some $i$, $\lambda\in\Lambda_n^{(1)}$ and $I\in S^{\rm free}(\lambda)$, and consider the term $R_i(\lambda, I)$, that is the term indexed by $\lambda$ and $I$ in the sum of residues defining $R_i$ in \eqref{eq:defRi}. If there is an arrow bearing a plus sign leading to $i$ in the diagram $I$, that is, if the diagram $I$ contains a snippet of the form $j\overset{+}{\longrightarrow} i$ or $i\overset{+}{\longleftarrow} j$ for some $j$, then $R_i(\lambda, I)=0$, because it involves the residue at $z_n=qz_i$ and $z_j=qz_i$, which vanishes due to the factor $z_j-z_n$ in $\phi_{\vec x}(\vec z)$. Thus, the term $R_i(\lambda,I)$ vanishes, unless the number $i$ appears in $I$ at the beginning or the end of a line. We will denote $B_i$ the set of diagrams such that $i$ appears at the beginning of a line and $E_i$ the set of diagrams such that $i$ appears at the end of a line. We have just shown that \begin{equation} \sum_{\lambda\in\Lambda_n^{(1)}}\sum_{I\in S^{\rm free}(\lambda), I\not\in B_i, I\not\in E_i} R_i(\lambda,I) = 0. \label{eq:firstvanishing} \end{equation} Consider now $\lambda\in \Lambda_n^{(1)}$, and $I\in S^{\rm free}(\lambda)\cap(B_i\cup E_i)$, that is a diagram $I$ such that the number $i$ appears at the beginning or the end of a line. We may associate to such $(\lambda,I)$ a new diagram $\tilde I$ (see Example \ref{ex:tildeI} below) obtained from $I$ by removing the line containing the number $n$ (recall that $I\in S^{\rm linked}(\lambda)$, so that there is a line containing the number $n$ and no arrow) and adding the snippet $n\overset{+}{\longrightarrow} i$ or $i\overset{+}{\longleftarrow} n$ to the line containing $i$. We define $\tilde\lambda$ as the partition of $n$ corresponding to the shape of the diagram $\tilde I$. \begin{example} Consider the partition $\lambda=(3,2,1)$, and the diagram \begin{eqnarray*} && 5 \overset{+}{\longrightarrow} 1\overset{-}{\longleftarrow} 3\\ I= && 2\overset{-}{\longleftarrow} 4\\ && 6 \end{eqnarray*} If $i=2$, the diagram $\tilde I$ is obtained by removing the third line and adding the snippet $6\overset{+}{\longrightarrow} 2$ to the beginning of the second line, that is \begin{eqnarray*} \tilde I= && 5 \overset{+}{\longrightarrow} 1\overset{-}{\longleftarrow} 3\\ && 6 \overset{+}{\longrightarrow} 2\overset{-}{\longleftarrow} 4 \end{eqnarray*} so that $\tilde\lambda=(3,3)$. \label{ex:tildeI} \end{example} Notice that in general, $\ell(\lambda)=\ell(\tilde\lambda)+1$, so that comparing \eqref{eq:remainingresidues} and \eqref{eq:defRi}, we have \begin{equation} R_i(\lambda,I) = - T(\tilde\lambda,\tilde I). \label{eq:equalityterm1} \end{equation} Let us now consider the term $R_{-i}(\lambda, I)$, that is the term indexed by $\lambda$ and $I$ in the sum of residues defining $R_{-i}$ in \eqref{eq:defRi}. If the number $i$ in $I$ is already connected to an arrow bearing a minus sign, that is, if $I$ contains $i\overset{-}{\longleftarrow} j$ for some $j$, the associated residue will vanish for the same reason as above. Furthermore, if the line containing $i$ includes a snippet of the form $j\overset{+}{\longleftarrow} i$ or $i\overset{+}{\longrightarrow} j$, the associated residue will vanish due to the factor $(1-qz_nz_i)$ in $\phi_{\vec x}(\vec z)$. Otherwise, the line containing $i$ must be of the form $A\overset{+}{\longrightarrow} i$ for some possibly empty snippet $A$, that is $i$ must occur at the end of a line and is connected to an arrow bearing a plus sign. We denote by $E_i^+$ the set of such diagrams. We have just shown that \begin{equation} \sum_{\lambda\in\Lambda_n^{(1)}}\sum_{I\in S^{\rm free}(\lambda), I\not\in E_i^+} R_{-i}(\lambda,I) = 0 \label{eq:secondvanishing} \end{equation} Assuming $\lambda$ and $I$ are such that $i$ occurs at the end of a line and is connected to an arrow bearing a plus sign, we associate to $(\lambda,I)$ new partitions and diagrams $(\tilde\lambda, \tilde I)$ where the new diagram $\tilde I$ is obtained from $I$ by removing the line containing the number $n$ alone, and adding the snippet $i\overset{-}{\longleftarrow} n$ to the line containing $i$. The partition $\tilde \lambda$ is the shape of $\tilde I$ as above. Again, $\ell(\lambda)=\ell(\tilde\lambda)+1$, so that comparing \eqref{eq:remainingresidues} and \eqref{eq:defRi}, we have \begin{equation} R_{-i}(\lambda,I) = - T(\tilde\lambda,\tilde I). \label{eq:equalityterms2} \end{equation} From \eqref{eq:equalityterm1} and \eqref{eq:equalityterms2}, we deduce \begin{equation} \sum_{i=1}^{n-1} \left(\sum_{\lambda\in\Lambda_n^{(1)}}\sum_{I\in S^{\rm free}(\lambda)\cap(B_i\cup E_i)} R_i(\lambda,I) + \sum_{\lambda\in\Lambda_n^{(1)}}\sum_{I\in S^{\rm free}(\lambda)\cap E_i^+} R_{-i}(\lambda,I) \right) =  -\sum_{\tilde\lambda \in \Lambda_n} \sum_{\tilde I\in S^{\rm linked}(\tilde\lambda)} T(\tilde\lambda,\tilde I). \label{eq:matchingterms} \end{equation} In \eqref{eq:matchingterms}, we have use implicitly that the map $(\lambda,I)\to (\tilde\lambda, \tilde I)$ that matches terms on both sides is a bijection. To check this, it is enough to exhibit the inverse map. For $\tilde \lambda\in \Lambda_n$ and a diagram $\tilde I\in S^{\rm linked}(\tilde\lambda)$, one needs to look at which number $i<n$ the number $n$ is connected by an arrow. Such a number $i$ must exist because $\tilde I\in S^{\rm linked}(\lambda)$. If $i$ and $n$ are connected in $\tilde I$ by an arrow bearing a plus sign, the term $T(\tilde\lambda,\tilde I)$ is matched with $-R_i(\lambda, I)$, where the diagram $I$ is obtained from $\tilde I$ by removing the arrow $n\overset{+}{\longrightarrow} i$ or $i\overset{+}{\longleftarrow} n$ and placing $n$ on an extra line alone (it is easy to check that $I\in B_i\cup E_i$, i.e. $i$ occurs in the beginning or end of a line in $I$). If $i$ and $n$ are connected in $\tilde I$ by an arrow bearing a minus sign, the term $T(\tilde\lambda,\tilde I)$ is matched with $-R_{-i}(\lambda, I)$, where the diagram $I$ is obtained from $I$ by removing the arrow $i\overset{-}{\longleftarrow} n$ and adding the number $n$ to an extra line with no arrow (again, it can be easily checked that $I\in E_i^+$, i.e. the number $i$ occurs in $I$ at the end of a line and is connected to an arrow bearing a plus sign). Thus, combining \eqref{eq:firstvanishing}, \eqref{eq:secondvanishing} and \eqref{eq:matchingterms}, we have shown that \begin{equation*}-\sum_{i=1}^{n-1}( R_i+R_{-i}) = \sum_{\tilde\lambda \in \Lambda_n} \sum_{\tilde I\in S^{\rm linked}(\tilde\lambda)} T(\tilde\lambda,\tilde I) = \eqref{eq:remainingresidues}, \end{equation*} so that \begin{equation*}v_n(0;\vec x) = \eqref{eq:initialconditiontoevaluate}+\eqref{eq:remainingresidues} = R_0=v_{n-1}(0,x_1, \dots, x_n).\end{equation*} Hence, we have proved \eqref{eq:recurrencetoshow} and this concludes the proof of Condition (5). \subsubsection{Conclusion} We have shown that the function $v_n(t;\vec x)$ defined in \eqref{eq:deffunctionv} satisfies all the conditions in Proposition \ref{prop:freeevolutionu}. By Proposition \ref{prop:freeevolutionu}, we conclude that \eqref{eq:mixedmomentsQ} holds for any $\vec x\in \Weyl{n}_{\geq 1}$. When $n=1$, the formula reduces to \eqref{eq:firstmoment}, and when $n=2$, the formula reduces to \begin{equation*} \ensuremath{\mathbb{E}}\left[q^{N_{x_1}(t)+N_{x_2}(t)}\right] = \oint_{\mathcal C} \frac{dz_1}{2\ensuremath{\mathbf{i}}\pi}\oint_{\mathcal C} \frac{dz_2}{2\ensuremath{\mathbf{i}}\pi} \phi_{\vec x}(z_1,z_2) - \oint_{\mathcal C} \frac{dz_1}{2\ensuremath{\mathbf{i}}\pi} \Res{z_2=qz_1} \left\lbrace \phi_{\vec x}(z_1,z_2) \right\rbrace - \oint_{\mathcal C} \frac{dz_1}{2\ensuremath{\mathbf{i}}\pi} \Res{z_2=1/z_1} \left\lbrace \phi_{\vec x}(z_1,z_2) \right\rbrace. \end{equation*} Explicitly evaluating the residues yields \eqref{eq:explicitsecondmoment}. This concludes the proof of Theorem \ref{theo:momentformula}. \section{Markov duality for open ASEP on a segment} \label{sec:segment} The arguments in Section \ref{sec:dualityhalfline} and \ref{sec:ODE} can be adapted to the case of open ASEP on a segment with two boundaries. Although we cannot solve explicitly the system of ODEs in this case, we explain in this section how to obtain a closed system of ODEs for observables of the current in open ASEP. \begin{definition} We define the open ASEP on a segment as a Markov process on the state-space $\lbrace 0,1\rbrace^{\llbracket 1, \ell-1\rrbracket}\times \ensuremath{\mathbb{Z}}_{\geq 0}$ describing the dynamics of particles between two reservoirs, according to the jump rates depicted in Figure \ref{fig:openASEP}. Configurations are described by occupation variables $\eta\in \lbrace 0,1\rbrace^{\llbracket 1, \ell-1\rrbracket}$ together with the number $N=N_\ell\in \ensuremath{\mathbb{Z}}$ of particles that have gone through the system (see below for details). For any $x\in \llbracket 1, \ell-1\rrbracket$, a particle jumps from site $x$ to $x+1$ or from site $x+1$ to $x$ at the same rates $\mathsf{p}$ and $\mathsf{q}$ as in half-line ASEP (or full-line ASEP). As on the half-line, a particle is created or annihilated at the site $1$ at exponential rates \begin{equation*} \upalpha\ (1-\eta_1) \ \ \text{and}\ \ \upgamma\ \eta_1.\end{equation*} Further, a particle is created or annihilated at the site $\ell-1$ at exponential rates \begin{equation*} \updelta\ (1-\eta_1) \ \ \text{and}\ \ \upbeta\ \eta_1.\end{equation*} All these events are independent. We define the current at site $x$ by \begin{equation*} N_x(\eta, N_\ell) = \sum_{i=x}^{\ell-1} \eta_i+ N_\ell,\end{equation*} where $N_\ell(t)$ denotes the number of particles that have been annihilated at site $\ell-1$, minus the number of particles that have been created at site $\ell-1$ (this corresponds to the total number of particles that have traveled through the system). We denote by $\mathscr{L}^{\llbracket 1,L-1\rrbracket}$ the generator associated to this Markov process, that is the operator acting on functions $f: \lbrace 0,1\rbrace^{\llbracket 1,\ell-1\rrbracket}\times \ensuremath{\mathbb{Z}} \to \ensuremath{\mathbb{R}}$ by \begin{multline} \mathscr{L}^{\llbracket 1,L-1\rrbracket} f(\eta,N) = \upalpha (1-\eta_1) \left( f(\eta_1^+,N)-f(\eta,N)\right) + \upgamma \eta_1 \left( f(\eta_1^-,N)-f(\eta,N)\right) \\ +\updelta (1-\eta_{\ell-1}) \left( f(\eta_{\ell-1}^+,N-1)-f(\eta,N)\right) + \upbeta \eta_{\ell-1} \left( f(\eta_{\ell-1}^-,N+1)-f(\eta,N)\right) \\ + \sum_{x=1}^{\ell-1} \left( \mathsf{p}\eta_x(1-\eta_{x+1}) + \mathsf{q}\eta_{x+1}(1-\eta_{x}) \right) \left( f(\eta^{x,x+1}, N)-f(\eta,N)\right), \label{eq:defLetasegment} \end{multline} where for $i=1$ or $i=\ell-1$, $\eta_i^+$ (resp. $\eta_i^-$) is obtained from $\eta$ by setting $\eta_i=1$ (resp. $\eta_i=0$). \end{definition} \begin{figure} \begin{center} \vspace{-0.3cm} \begin{tikzpicture}[xscale=0.7, yscale=0.7, every text node part/.style={align=center}] \draw[thick] (0,0) -- (10,0); \foreach \x in {1,...,9} \draw[thick] (\x,-0.15)--(\x,0.15); \foreach \x in {1, ..., 5} { \draw (\x, 0.15) -- (\x, -0.15) node[anchor=north]{\footnotesize $\x$};} \draw (9, 0.1) -- (9, -0.05) node[anchor=north]{\tiny $\ell-1$}; \draw[thick] (-1,0) circle(1); \draw[thick] (11,0) circle(1); \fill (3,0) circle(0.2); \fill (4,0) circle(0.2); \fill (5,0) circle(0.2); \fill (7,0) circle(0.2); \draw[-stealth, thick] (3,0.3) to[bend right] (2,0.3); \draw[-stealth, thick] (5,0.3) to[bend left] (6,0.3); \draw[-stealth, thick] (7,0.3) to[bend right] (6,0.3); \draw[-stealth, thick] (7,0.3) to[bend left] (8,0.3); \draw (2.5,0.7) node{$\mathsf{q}$}; \draw (5.5,0.7) node{$\mathsf{p}$}; \draw (6.5,0.7) node{$\mathsf{q}$}; \draw (7.5,0.7) node{$\mathsf{p}$}; \draw (-1,0) node{\footnotesize reservoir}; \draw (11,0) node{\footnotesize reservoir}; \draw[-stealth, thick] (-0.1,0.5) to[bend left] (0.9,0.4); \draw[stealth-, thick] (-0.1,-0.5) to[bend right] (0.9,-0.4); \draw[stealth-, thick] (10.1,0.5) to[bend right] (9.1,0.4); \draw[-stealth, thick] (10.1,-0.6) to[bend left] (9.1,-0.5); \draw (0.5,1) node{$\upalpha$}; \draw (0.5,-1) node{$\upgamma$}; \draw (9.5,1) node{$\upbeta$}; \draw (9.5,-1) node{$\updelta$}; \end{tikzpicture} \vspace{-0.3cm} \end{center} \caption{Jump rates of Open ASEP on $\ell-1$ sites. \label{fig:openASEP}} \end{figure} We now assume that the boundary parameters $\upalpha, \upgamma, \upbeta, \updelta$ satisfy Liggett's condition \eqref{eq:Liggettcondition} on both sides, that is we assume that \begin{equation} \frac{\upalpha}{\mathsf{p}}+\frac{\upgamma}{\mathsf{q}} = 1, \;\;\; \frac{\upbeta}{\mathsf{p}}+\frac{\updelta}{\mathsf{q}} = 1, \label{eq:Liggettcondition2} \end{equation} and set $\rho_0=\upalpha/\mathsf{p}$ and $\rho_\ell=\updelta/\mathsf{q}$. We will use the notation \begin{equation*} \Weyl{n}_{\llbracket a, b\rrbracket} :=\left\lbrace \vec x\in \ensuremath{\mathbb{Z}}^n : a\leq x_1<\dots < x_n\leq b \right\rbrace.\end{equation*} In order to state a Markov duality, let us define the operator $\mathscr{D}^{(n, \rho_0, \rho_\ell)}$ acting on functions $f:\Weyl{n}_{\llbracket 1,\ell\rrbracket}\to \ensuremath{\mathbb{R}}$ by \begin{multline} \mathscr{D}^{(n, \rho_0, \rho_\ell)} f(\vec x) = \sum_{\underset{x_i-x_{i-1}>1}{2\leqslant i\leqslant n} } \mathsf{p}\left( f(\vec x_i^-) -f(\vec x)\right) + \sum_{ \underset{x_{i+1}-x_{i}>1}{1\leqslant i\leqslant n-1}} \mathsf{q}\left( f(\vec x_i^+) -f(\vec x)\right)\\ +\mathds{1}_{x_1>1}\mathsf{p}\left( f(\vec x_1^-) -f(\vec x)\right) -\mathds{1}_{x_1=1} (\mathsf{p}-\mathsf{q})\rho_0 f(\vec x)\\ +\mathds{1}_{x_n<\ell}\mathsf{q}\left( f(\vec x_1^+) -f(\vec x)\right) +\mathds{1}_{x_n=\ell} (\mathsf{p}-\mathsf{q})\rho_\ell f(\vec x). \label{eq:defLpartsegment} \end{multline} This operator corresponds to the generator of a non Markovian system of $n$ particles on $\Weyl{n}_{\llbracket 1,\ell\rrbracket}$ performing continuous time simple random walks with jump rates $\mathsf{p}$ and $\mathsf{q}$, under the exclusion constraint, with killing/duplication at the boundaries. We will call this process the \emph{mixed Robin boundary $n$-particle ASEP on a segment} (the term ``Robin'' comes from the form of the boundary condition \eqref{eq:boundaryconditionforu} in Proposition \ref{prop:freeevolutionu} below, which is a discrete analogue of the Robin type boundary condition in PDE theory). \begin{remark} At the left boundary, the reflection mechanism can be interpreted as a killing, while at the right boundary the probability of configurations is increased when $x_n=\ell$. More precisely, the (non-stochastic) distribution of the process corresponding to $\mathscr{D}^{(n, \rho_0, \rho_\ell)}$, at time $t$, is absolutely continuous with respect to the distribution of the $n$-particle exclusion process with closed boundaries $\lbrace \vec x(s)\rbrace_{0\leq s\leq t}$, with Radon-Nikodym derivative equal to \begin{equation} e^{-(\mathsf{p}-\mathsf{q})\rho_0\int_0^t \mathds{1}_{x_1(s)=1}ds + (\mathsf{p}-\mathsf{q})\rho_\ell\int_0^t \mathds{1}_{x_n(s)=\ell}ds}.\label{eq:elasticreweighting} \end{equation} The first exponential term in \eqref{eq:elasticreweighting} can be interpreted as the probability that an exponential random variable with parameter $(\mathsf{p}-\mathsf{q})\rho_0$, the killing time, exceeds the total amount of time spent by the first particle $x_1$ at the boundary. \end{remark} \begin{theorem} Fix $n\geqslant 1$ and assume that \eqref{eq:Liggettcondition2} holds. The open ASEP on a segment with right and left jump rates $\mathsf{p}$ and $\mathsf{q}$ (i.e. the Markov process with generator \eqref{eq:defLetasegment}) and the mixed Robin boundary $n$-particle ASEP on a segment with right and left jump rates $\mathsf{q}$ and $\mathsf{p}$ are dual with respect to \begin{equation*} H(\eta,N_\ell;\vec x) := \prod_{i=1}^n Q_{x_i}(\eta, N_\ell) \;\;\;\text{ where }\;\;Q_x(\eta, N_\ell)=q^{N_x(\eta, N_\ell)}, \label{eq:newdefH} \end{equation*} in the sense that for any $(\eta,N_\ell)\in \lbrace 0,1\rbrace^{\llbracket 1,\ell-1\rrbracket}\times \ensuremath{\mathbb{Z}}$ and $\vec x\in \Weyl{n}_{\llbracket 1,\ell\rrbracket}$, \begin{equation*} \mathscr{L}^{\llbracket 1,L-1\rrbracket} H(\eta, N_\ell; \vec x) = \mathscr{D}^{(n, \rho_0, \rho_\ell)} H(\eta, N_\ell; \vec x), \label{eq:dualitysegment} \end{equation*} where we recall that $\mathscr{L}^{\llbracket 1,L-1\rrbracket}$ acts on functions of $\eta,N_\ell$ and $\mathscr{D}^{(n, \rho_0, \rho_\ell)}$ acts on functions of $\vec x$. \label{theo:dualitysegment} \end{theorem} \begin{remark} In the case of the symmetric simple exclusion process on a segment, a similar Markov duality was proved in \cite[Th. 4.5]{giardina2007duality} (see also \cite[Section 5]{spohn1983long} and \cite{schutz1994non}) with respect to another duality functional. In the case of ASEP, (reverse) Markov dualities are proved in the recent preprint \cite{schutz2022reverse}, but the dual process is different from Theorem \ref{theo:dualitysegment}, and it is not clear whether the results from \cite{schutz2022reverse} are related to our Theorem \ref{theo:dualitysegment}. \end{remark} \begin{proof} As in Section \ref{sec:dualityhalfline}, Liggett's condition \eqref{eq:Liggettcondition2} allows to rewrite the generator $\mathscr{L}^{\llbracket 1,L-1\rrbracket}$ as the expectation of a simpler generator on $\ell+1$ sites. More precisely, let us first define \begin{multline} \mathscr{L}^{\circ\circ} f(\eta, N) = \sum_{x=0}^{\ell-2} \left( \mathsf{p}\eta_x(1-\eta_{x+1}) + \mathsf{q}\eta_{x+1}(1-\eta_{x}) \right) \left( f(\eta^{x,x+1}, N)-f(\eta, N)\right), \\ + \mathsf{p}\eta_{\ell-1}(1-\eta_{\ell}) \left( f(\eta^{\ell-1,\ell}, N+1)-f(\eta, N)\right) + \mathsf{q}\eta_{\ell}(1-\eta_{\ell-1})\left( f(\eta^{\ell-1,\ell}, N-1)-f(\eta, N)\right), \label{eq:defLeta00} \end{multline} that is the generator of half-line ASEP on $\llbracket 0,\ell\rrbracket$ with no injection nor ejection of particles (i.e. with reflecting boundaries), where the integer $N$ keeps track of the number of particles that have traveled between sites $\ell-1$ and $\ell$. Then, for any function $f:\lbrace 0,1\rbrace^{\llbracket 1,\ell-1\rrbracket}\times \mathbb Z_{\geq 0}\to \ensuremath{\mathbb{R}}$, \begin{equation} \mathscr{L}^{\llbracket 1,L-1\rrbracket} f(\eta, N)=E\left[\mathscr{L}^{\circ\circ} f (\eta, N)\right], \label{eq:Liggetttricksegment} \end{equation} where $E$ denotes the expectation with respect to $\eta_0$ and $\eta_\ell$, where $\eta_0=1$ with probability $\rho_0$, and $\eta_\ell=1$ with probability $\rho_\ell$. As in the proof of Theorem \ref{theo:dualityhalf-space}, this is due to the fact that under \eqref{eq:Liggettcondition2}, $E[\mathsf{p}\eta_0]=\upalpha$, $E[\mathsf{q}(1-\eta_0)]=\upgamma$, $E[\mathsf{p}(1-\eta_\ell)] =\upbeta$ and $E[\mathsf{q} \eta_\ell]=\updelta$. As we have already noted, the function ${H}(\eta,\vec x)$ was originally defined for $\eta\in \lbrace 0,1\rbrace^{\mathbb Z}$ in \eqref{eq:defH}, but for $\vec x\in \Weyl{n}_{\llbracket 1,\ell\rrbracket }$, it depends only on $(\eta_1, \dots, \eta_{\ell-1}, N_\ell) \in \lbrace 0,1 \rbrace^{\llbracket 1,\ell-1\rrbracket}\times \ensuremath{\mathbb{Z}}_{\geq 0}$. Indeed, the value of $H(\eta, \vec x)$ does not depend on the $\eta_i$ for $i\leq 0$ and it depends only on the $\eta_i$ for $i\geq \ell$ through $N_\ell$. To be consistent with both \eqref{eq:newdefH} and the definitions from Section \ref{sec:halfline}, we denote this function by $H(\eta,N_\ell,\vec x)$. Moreover, for $\vec x\in \Weyl{n}_{\llbracket 1,\ell\rrbracket }$, when computing $\mathscr{L}^{\mathbb Z} {H}(\eta,\vec x)$, the summation over all $x\in \mathbb Z$ in \eqref{eq:defgeneratorfullspace} can be restricted to a summation over $x\in \llbracket 0,\ell-1\rrbracket$. This implies that for any $\vec x\in \Weyl{n}_{\llbracket 1,\ell\rrbracket }$ and $(\eta, N_\ell)\in \lbrace 0,1\rbrace^{\llbracket 1,\ell-1\rrbracket}\times \ensuremath{\mathbb{Z}}_{\geq 0}$, we have $\mathscr{L}^{\mathbb Z} {H}(\eta,\vec x)=\mathscr{L}^{\circ\circ} {H}(\eta,N_\ell; \vec x)$. Thus, using \eqref{eq:Liggetttricksegment}, for all $\vec x\in \Weyl{n}_{\llbracket 1,\ell\rrbracket }$, \begin{equation} \mathscr{L}^{\llbracket 1,L-1\rrbracket} H(\eta, N_\ell; \vec x)=E\left[\mathscr{L}^{\circ\circ} H(\eta, N_\ell;\vec x)\right]= E\left[\mathscr{L}^{\mathbb Z} H(\eta; \vec x)\right]. \label{eq:Liggetttrickapplied2} \end{equation} and using Proposition \ref{prop:dualityfull-space}, \begin{equation} \mathscr{L}^{\llbracket 1,L-1\rrbracket} H(\eta, N_\ell;\vec x)= E\left[\mathscr{D}^{(n)} H(\eta,N_\ell; \vec x)\right], \label{eq:Liggetttrickdualitysegment} \end{equation} where the expectation $E$ simply means that we average over the Bernoulli variables $\eta_0, \eta_\ell$. As in the proof of Theorem \ref{theo:dualityhalf-space}, $\mathscr{D}^{(n)} H(\eta,\vec x)$ is a polynomial in the $Q_0, Q_1, \dots, Q_{\ell+1}$ which is linear in $Q_0$ and $Q_{\ell+1}$. Since $Q_0(\eta, N_\ell)=q^{\eta_0}Q_1(\eta, N_\ell)$ and $Q_{\ell+1}(\eta, N_\ell)=q^{N_\ell-\eta_\ell}$ the expectation $E$ has the effect of replacing $Q_0$ by $(\rho_0 q+1-\rho_0)Q_1$ and replacing $Q_{\ell+1}$ by $(\rho_\ell/q+1-\rho_\ell)Q_\ell$. Since \begin{equation*} \mathsf{p}\Big((\rho_0 q+1-\rho_0)-1\Big)=\rho_0(\mathsf{q}-\mathsf{p}),\;\;\; \mathsf{q}\Big((\rho_\ell/q+1-\rho_\ell)-1\Big) = \rho_\ell(\mathsf{p}-\mathsf{q}),\end{equation*} we obtain that for any $(\eta,N_\ell)\in \lbrace 0,1\rbrace^{\llbracket 1,\ell-1\rrbracket}\times \ensuremath{\mathbb{Z}}$ and $\vec x\in \Weyl{n}_{\llbracket 1,\ell\rrbracket}$, \begin{equation*} \mathscr{L}^{\llbracket 1,L-1\rrbracket} H(\eta, N_\ell; \vec x) = \mathscr{D}^{(n, \rho_0, \rho_\ell)} H(\eta, N_\ell; \vec x),\end{equation*} which concludes the proof. \end{proof} As in Section \ref{sec:dualityhalfline}, the duality from Theorem \ref{theo:dualitysegment} yields a closed system of ODEs characterizing the function $(t,\vec x)\mapsto \mathbb E[\prod_{i=1}^n Q_{x_i}(\eta(t), N_\ell(t))]$. \begin{proposition} Assume that \eqref{eq:Liggettcondition2} holds and fix some initial state $(\eta,N)\in \lbrace 0,1\rbrace^{\llbracket 1,\ell-1\rrbracket}\times \ensuremath{\mathbb{Z}}_{\geq 0}$. There exists a unique function $ u : \ensuremath{\mathbb{R}}_{+} \times \Weyl{n}_{\llbracket 1,\ell\rrbracket} \to \ensuremath{\mathbb{R}}$ which satisfies \begin{enumerate} \item For all $\vec x \in \Weyl{n}_{\llbracket 1,\ell\rrbracket}$ and $t\in \ensuremath{\mathbb{R}}_+$, \begin{equation*} \frac{d}{dt} u(t;\vec x) = \mathscr{D}^{(n, \rho_0, \rho_\ell)} u(t;\vec x); \label{eq:evolutionsegment} \end{equation*} \item For any $\vec x\in \Weyl{n}_{\llbracket 1,\ell\rrbracket}$, $u(0; \vec x)=H(\eta,N;\vec x)$. \end{enumerate} The solution is such that for all $\vec x \in \Weyl{k}_{\llbracket 1,\ell\rrbracket}$ and $t\in \ensuremath{\mathbb{R}}_+$, $u(t,\vec x) = \ensuremath{\mathbb{E}}^{\eta,N}[H(\eta(t),N_\ell(t);\vec x))]$. \label{prop:trueevolutionsegment} \end{proposition} \begin{proof} This is a direct consequence of the duality from Theorem \ref{theo:dualitysegment}, as in the proof of Proposition \ref{prop:trueevolution}. Here, the uniqueness of the system of equations is simply due to the fact that the system of ODEs above is finite-dimensional, hence there is no need to impose a condition such as \eqref{eq:boundedgrowth}. \end{proof} As in Section \ref{sec:ODE}, Condition (1) of Proposition \ref{prop:trueevolutionsegment} can be rewritten as Conditions (1) and (2) in Proposition \ref{prop:freeevolutionu} with some boundary conditions when $x_1=1$ or $x_n=\ell$. We obtain the following characterization. \begin{proposition} Assume that \eqref{eq:Liggettcondition2} holds and fix some initial state $(\eta,N)\in \lbrace 0,1\rbrace^{\llbracket 1,\ell-1\rrbracket}\times \ensuremath{\mathbb{Z}}_{\geq 0}$. If the function $ u : \ensuremath{\mathbb{R}}_{+} \times \llbracket 0,\ell\rrbracket^n \to \ensuremath{\mathbb{R}}$ solves \begin{enumerate} \item For all $\vec x \in \llbracket 1,\ell-1\rrbracket^n$ and $t\in \ensuremath{\mathbb{R}}_+$, \begin{equation*} \frac{d}{dt} u(t;\vec x) = \Delta^{\mathsf{p}, \mathsf{q}} u(t;\vec x); \end{equation*} \item For all $\vec x \in \llbracket 1,\ell-1\rrbracket^n$ such that for some $i\in \lbrace 1, \dots, n-1\rbrace $, $x_{i+1}=x_i+1$, we have \begin{equation*} \mathsf{p} u(t; \vec x_{i+1}^-) + \mathsf{q} u(t; \vec x_i^+) = (\mathsf{p}+\mathsf{q}) u(t; \vec x); \end{equation*} \item For all $t\in \ensuremath{\mathbb{R}}_+$ and $(x_2, \dots, x_n)\in \Weyl{n-1}_{\llbracket 2,\ell\rrbracket}$, \begin{equation} (\rho_0-\rho_0 q-1) u(t;0,x_2,\dots)=(\rho_0 q +1-\rho_0) u(t;1,x_2,\dots) ; \label{eq:boundaryconditionforuleft} \end{equation} \item For all $t\in \ensuremath{\mathbb{R}}_+$ and $(x_1, \dots, x_{n-1})\in \Weyl{n-1}_{\llbracket 1,\ell-1\rrbracket}$, \begin{equation} u(t;x_1, \dots, x_{n-1}, \ell+1) = (\rho_\ell/q+1-\rho_\ell) u(t;x_1, \dots, x_{n-1}, \ell); \label{eq:boundaryconditionforuright} \end{equation} \item For any $\vec x\in \Weyl{n}_{\llbracket 1,\ell\rrbracket}$, $u(0; \vec x)=H(\eta,N;\vec x)$. \end{enumerate} Then for all $\vec x \in \Weyl{n}_{\llbracket 1,\ell\rrbracket}$ and $t\in \ensuremath{\mathbb{R}}_+$, $u(t,\vec x) = \ensuremath{\mathbb{E}}^{\eta,N}[H(\eta(t),N_\ell(t);\vec x))]$. \label{prop:freeevolutionsegment} \end{proposition} \begin{proof}As in the proof of Proposition \ref{prop:freeevolutionu}, the conditions (1) (2) (3) and (4) imply Condition (1) of Proposition \ref{prop:trueevolutionsegment}, so that it suffices to apply Proposition \ref{prop:trueevolutionsegment}. \end{proof} \begin{remark} The system of ODEs from Proposition \ref{prop:freeevolutionsegment} is a priori amenable for Bethe ansatz, though the hypothetical Bethe ansatz solution would involve the roots of some Bethe equations (needed to enforce the boundary condition at $x=\ell$). It is not presently clear whether there exist simple contour integral formulas for $\ensuremath{\mathbb{E}}^{\eta,N}[H(\eta(t),N_\ell(t);\vec x))]$ and we leave this for future consideration. For ASEP on a ring, Bethe ansatz solutions also involve Bethe roots and it is possible to write down explicit integral formulas \cite{liu2020integral}. \end{remark} \section{KPZ equation limit} \label{sec:KPZ} In this Section, we provide an application of the formula from Theorem \ref{theo:momentformula}, using the convergence of the half-line ASEP to the KPZ equation in the weakly asymmetric scaling. The KPZ equation, introduced in \cite{kardar1986dynamic}, is the nonlinear stochastic PDE \begin{equation} \partial_t h(t,x) = \frac{1}{2} \partial_{xx}h(t,x) +\frac 1 2 \left( \partial_x h(t,x)\right)^2+\xi(t,x), \label{eq:KPZ} \end{equation} where $\xi$ is a space-time white noise. For the equation on $\ensuremath{\mathbb{R}}$, we say that $h(t,x)$, is a solution if for all $t>0, x\in \ensuremath{\mathbb{R}}$ , $h(t,x)=\log Z(t,x)$ where $Z(t,x)$ is a solution of the multiplicative noise stochastic heat equation (SHE) \begin{equation} \partial_t Z(t,x) = \frac{1}{2} \partial_{xx} Z(t,x) +Z(t,x)\xi(t,x), \label{eq:SHE} \end{equation} for which solutions can be defined using stochastic calculus \cite{bertini1995stochastic}. Using Proposition \ref{prop:dualityfull-space} for $n=1$, letting $\mathcal Z(t,x)=q^{N_x(t)}$, one can show that $\mathcal Z(t,x)$ satisfies some discrete approximation of \eqref{eq:SHE}. This was originally observed in \cite{gartner1987convergence}, and then used in \cite{bertini1997stochastic} to prove that, after appropriate scaling (see Section \ref{sec:convASEPKPZ}), $\mathcal Z(t,x)$ weakly converges to a solution of \eqref{eq:SHE} as a function of space and time. \subsection{Convergence of half-line ASEP to the KPZ equation on $\ensuremath{\mathbb{R}}_{>0}$} \label{sec:convASEPKPZ} In this section, we are mostly interested in the KPZ equation on $\ensuremath{\mathbb{R}}_{>0}$. To ensure uniqueness of solutions, one needs to impose a Neumann type boundary condition at $x=0$. As for the KPZ equation on $\ensuremath{\mathbb{R}}$, we define a solution to the KPZ equation on $\ensuremath{\mathbb{R}}_{>0}$ through the SHE on $\mathbb R_{>0}$. \begin{definition}[\cite{corwin2016open, parekh2017kpz}] We say that $h(t,x)\in C(\mathbb R_{>0}\times C( \mathbb R_{>0}))$ solves the KPZ equation on $\mathbb R_{>0}$ with boundary parameter $A\in \mathbb R$ and narrow wedge initial data if for all $(t,x)\in \mathbb R_{>0}^2$, $h(t,x)=\log Z(t,x)$ where $Z(t,x)$ solves the SHE on $\ensuremath{\mathbb{R}}_{>0}$ with Robin boundary parameter $A$ and delta initial data, that is \begin{equation} \begin{cases} \partial_t Z(t,x) = \frac{1}{2} \partial_{xx} Z(t,x) +Z(t,x)\xi(t,x),\\ \partial_x Z(t,x) \vert_{x=0} = A Z(t,0) \text{ for all } t>0, \\ \lim_{t\to 0} Z(t,x) =\updelta_0(x), \end{cases} \label{eq:SHEhalfspace} \end{equation} where $\updelta_0$ is a Dirac mass at zero. This equation can be made sense of in terms of the heat kernel on $\mathbb R_{>0}$ that satisfies the same boundary condition at $x=0$, we refer to \cite[Definition 2.5]{corwin2016open} and \cite[Proposition 4.3]{parekh2017kpz} for details. \label{def:KPZequationhalf-space} \end{definition} The convergence of ASEP to the KPZ equation from \cite{bertini1997stochastic} was extended to half-line ASEP and open ASEP on a segment in \cite{corwin2016open}. The result was restricted there to a certain class of initial data and $A\geq 0$, but the convergence result was extended in \cite{parekh2017kpz} to the narrow wedge initial data and arbitrary $A\in \ensuremath{\mathbb{R}}$. Consider half-line ASEP from Definition \ref{def:halflineASEP} with empty initial data and, following \cite{corwin2016open}, let us scale \begin{equation} \mathsf{p}=\frac{1}{2}e^{\sqrt{\varepsilon}},\;\;\; \mathsf{q}=\frac{1}{2}e^{-\sqrt{\varepsilon}},\;\;\; \rho=\frac{1}{2}+\sqrt{\varepsilon}\left(\frac{1}{4}+\frac{A}{2} \right). \label{eq:scalings} \end{equation} We further define the functions \begin{equation} \mathcal Z_t(x) = q^{N_{x+1}(t)+x/2}e^{(\mathsf{p}+\mathsf{q}-1)t}, \;\;\;Z^{\varepsilon}(t,x) = \varepsilon^{-1/2} \mathcal Z_{\varepsilon^{-2}t}(\varepsilon^{-1}x). \label{eq:defZepsilon} \end{equation} Then, \cite[Theorem 1.4]{parekh2017kpz} (see also \cite[Theorem 2.17]{corwin2016open} for another type of initial data) proved that, as $\varepsilon\to 0$, $Z^{\varepsilon}$ weakly converges as a space-time process to the unique mild solution to the SHE on $\ensuremath{\mathbb{R}}_{>0}$ with boundary parameter $A$ and delta initial data (Definition \ref{def:KPZequationhalf-space}). \begin{remark} The boundary condition \eqref{eq:boundaryconditionforu}, when $n=1$, can be rewritten as a discrete Robin type boundary condition $ \rho u(t;1) = \frac{u(t;1) - u(t;0)}{1-q}.$ One may check that formally plugging the scalings \eqref{eq:scalings}, we obtain the boundary condition $\partial_x \mathbb E\left[ Z(t,x)\right]\vert_{x=0}=A\ \mathbb E[Z(t,0)]$. \end{remark} \subsection{Moment formulas} In this section, we use Theorem \ref{theo:momentformula} and the convergence recalled in Section \ref{sec:convASEPKPZ} to prove a formula for the moments of the SHE on $\mathbb R_{>0}$. \begin{theorem} Fix $A>0$, $n\geq 1$, and let $Z(t,x)$ denote the solution of the SHE on $\mathbb R_{>0}$ with Robin boundary parameter $A$ and delta initial data (Definition \ref{def:KPZequationhalf-space}). For any $0\leqslant x_1 \leq \dots\leq x_n $, \begin{equation} \mathbb E\left[ \prod_{i=1}^n Z(t,x_i) \right] = 2^n\int_{r_1+\ensuremath{\mathbf{i}}\ensuremath{\mathbb{R}}} \frac{dw_1}{2\ensuremath{\mathbf{i}}\pi} \dots \int_{r_n+\ensuremath{\mathbf{i}}\ensuremath{\mathbb{R}}} \frac{dw_w}{2\ensuremath{\mathbf{i}}\pi} \prod_{i<j}\frac{w_i-w_j}{w_i-w_j+1}\frac{w_i+w_j}{w_i+w_j-1} \prod_{i=1}^n e^{\frac{t w_i^2}{2}-xw_i}\frac{w_i}{A+w_i} \label{eq:momentKPZhalfspace} \end{equation} where $0=r_1<r_2-1<\dots <r_n-n+1$. \label{theo:momentsKPZ} \end{theorem} \begin{remark}The formula \eqref{eq:momentKPZhalfspace} has been anticipated in \cite{borodin2016directed} using the replica method, although it is not clear that the arguments presented in \cite{borodin2016directed} can be turned into a fully rigorous proof. However, one can approximate the SHE by the partition function of directed polymer models in a half-space. The convergence of directed polymer partition functions to the SHE with Robin boundary was studied in \cite{wu2018intermediate, parekh2019positive, barraquand2022stationaryloggamma}. Exact moment formulas for the log-gamma polymer in a half-quadrant are established in \cite{barraquand2018half}, see in particular \cite[Proposition 7.1]{barraquand2018half}. Taking a scaling limit of that formula should yield another proof of Theorem \ref{theo:momentsKPZ}. \label{rem:otherapproach} \end{remark} \begin{remark} Although the moments of $Z(t,x)$ grow too fast to determine its distribution, the exact probability distribution of $Z(t,0)$ was (non-rigorously) computed from the moments in \cite{borodin2016directed} for $A=0$ and in \cite{Krajenbrink2020} for arbitrary $A$, using conjectural combinatorial simplifications or not fully rigorous methods. In the special case $A=-1/2$ however, the distribution was rigorously computed in \cite{barraquand2018stochastic}, through the stochastic six-vertex model and using a symmetric functions identity that reduces the problem to the asymptotic analysis of Pfaffian Schur measures \cite{borodin2005eynard}, in the spirit of \cite{borodin2016asep}. More recently, in the general case, i.e. for arbitrary $A\in \ensuremath{\mathbb{R}}$, a Fredholm Pfaffian formula (equivalent to \cite{Krajenbrink2020}) was finally established in \cite{imamura2022solvable} through the log-gamma polymer and $q$-Whittaker measures, using a symmetric functions identity from \cite{imamura2021skew} that reduces the problem to the asymptotic analysis of free boundary Schur measures \cite{betea2018free}. \end{remark} \begin{proof} Using the definition of $Z^{\varepsilon}(t,x)$ in \eqref{eq:defZepsilon} and the formula from Theorem \ref{theo:momentformula}, we obtain that for $0< x_1 <\dots <x_k$, \begin{multline} \mathbb E\left[\prod_{i=1}^n Z^{\varepsilon}(t,x_i) \right]=\varepsilon^{-k/2}\left(\frac{\mathsf{q}}{\mathsf{p}} \right)^{\frac{n(n-1)}{2}} \\ \sum_{\lambda \vdash n} \frac{(-1)^{n-\ell(\lambda)}}{m_1!m_2!\dots}\sum_{I\in S(\lambda)} \oint_{\mathcal C} \frac{dz_{i_{\mu_1}}}{2\ensuremath{\mathbf{i}}\pi} \oint_{\mathcal C} \frac{dz_{j_{\mu_2}}}{2\ensuremath{\mathbf{i}}\pi} \dots \; \Res{I} \left\lbrace \prod_{i<j} \frac{z_i-z_j}{qz_i-z_j} \frac{q^{-1}-z_iz_j}{1-z_iz_j}\prod_{j=1}^n\frac{G_{x_j}(z_j)}{z_j}\right\rbrace, \label{eq:momentZepsilon} \end{multline} where \begin{equation*} G_x(z) = \frac{\mathsf{p}-\mathsf{q} z^2}{\mathsf{p}-\mathsf{p} z} \exp\left( \frac{(\sqrt{\mathsf{p}}-\sqrt{\mathsf{q}})^2(\sqrt{\mathsf{p}}+\sqrt{\mathsf{q}} z)^2 \varepsilon^{-2}t}{(1-z)(\mathsf{p}-\mathsf{q} z)}\right) \left( \frac{\sqrt{\mathsf{p}\mathsf{q}}(1-z)}{\mathsf{p}-\mathsf{q} z} \right)^{\varepsilon^{-1}x+1}\frac{\rho}{\rho + (1-\rho)z}.\end{equation*} The residues appearing in \eqref{eq:momentZepsilon} all corresponds to simple poles and are easy to compute, so that the formula is perfectly explicit. Indeed, for a meromorphic function $f$ of $z_i$ and $z_j$ with a simple pole of order $1$ at $z_j=qz_i$, $\Res{z_j\to qz_i}f(z_i, z_j)$ can be simply computed by replacing $z_j$ by $qz_i$ in $(z_j-qz_i)f(z_i,z_j)$. Residues of the form $\Res{z_i\to 1/z_j}$ are similarly easily computed. Under the change of variables $z=-1/\sqrt{q}q^{w}$ (recall that $-1/\sqrt{q}q^{w}= -\sqrt{\mathsf{p}/\mathsf{q}}(\mathsf{q}/\mathsf{p})^{w}=-e^{\sqrt{\varepsilon}(1-2w)}$), \begin{equation*} \frac{G_x(z)dz}{z} = e^{\frac{t w^2}{2}-xw}\frac{wdw}{A+w}+ O(\sqrt{\varepsilon}).\end{equation*} Further, under the change of variables $z_i=-1/\sqrt{q}q^{w_i}$, \begin{equation} \frac{z_i-z_j}{qz_i-z_j} \frac{q^{-1}-z_iz_j}{1-z_iz_j}\xrightarrow[\varepsilon\to 0]{} \frac{w_i-w_j}{w_i-w_j+1}\frac{w_i+w_j}{w_i+w_j-1}. \label{eq:limitrationalfactors} \end{equation} In order to ensure that the condition $\rho>\frac{1}{1+\sqrt{q}}$ in Theorem \ref{theo:momentformula} is satisfied for $\varepsilon$ in a neighborhood of $0$ under the scalings \eqref{eq:scalings}, it is necessary and sufficient to impose $A>0$. Under the change of variables, the contour $ \mathcal C$ become the vertical segment $\ensuremath{\mathbf{i}}[\frac{-\pi}{2} \varepsilon^{-1/2}, \frac{\pi}{2} \varepsilon^{-1/2}]$. Taking into account the Jacobian of the change of variables and the orientation of contours, this suggests the following. \begin{proposition} For any $A>0$, under the scalings \eqref{eq:scalings}, we have \begin{multline} \lim_{\varepsilon\to 0} \mathbb E\left[\prod_{i=1}^n Z^{\varepsilon}(t,x_i) \right] = 2^n\sum_{\lambda \vdash n} \frac{1}{m_1!m_2!\dots}\sum_{I\in S(\lambda)} \int_{\ensuremath{\mathbf{i}}\ensuremath{\mathbb{R}}} \frac{dw_{i_{\mu_1}}}{2\ensuremath{\mathbf{i}}\pi} \int_{\ensuremath{\mathbf{i}}\ensuremath{\mathbb{R}}} \frac{dw_{j_{\mu_2}}}{2\ensuremath{\mathbf{i}}\pi} \dots \\ \Res{I} \left\lbrace \prod_{i<j}\frac{w_i-w_j}{w_i-w_j+1}\frac{w_i+w_j}{w_i+w_j-1} \prod_{i=1}^n e^{\frac{t w_i^2}{2}-xw_i}\frac{w_i}{A+w_i}\right\rbrace, \label{eq:limitmoments} \end{multline} where the vertical line $\ensuremath{\mathbf{i}}\ensuremath{\mathbb{R}}$ is oriented from bottom to top and $\Res{I}$ now means that we take residues at $w_j=w_i+1$ whenever the arrows $i\overset{+}{\longleftarrow} j$ or $j\overset{+}{\longrightarrow} i$ are present in the diagram $I$, and we take a residue at $w_j=-w_i+1$ whenever the arrow $i\overset{-}{\longleftarrow} j$ is present in the diagram $I$. Furthermore, for any fixed integer $n$, there exist $\varepsilon_0>0$ and a constant $C=C(n,t)$ such that for any $\varepsilon\in (0,\varepsilon_0)$, \begin{equation} \left\vert \mathbb E\left[\prod_{i=1}^n Z^{\varepsilon}(t,x_i) \right]\right\vert \leq C. \label{eq:uniformbound} \end{equation} \label{prop:limit} \end{proposition} We prove this proposition below. Assuming that it holds, let us proceed with the proof of Theorem \ref{theo:momentsKPZ}. The structure of the sum over residues appearing in \eqref{eq:limitmoments} is exactly the same as \cite[Section 7.3]{borodin2016directed}, up to the slight difference of conventions explained in Remark \ref{rem:doublecounting}. In particular, using \cite[Eq. (45)]{borodin2016directed} with $p=0$, we obtain that \eqref{eq:limitmoments} can be rewritten as \begin{equation} \lim_{\varepsilon\to 0} \mathbb E\left[\prod_{i=1}^n Z^{\varepsilon}(t,x_i) \right] = 2^n\int_{r_1+\ensuremath{\mathbf{i}}\ensuremath{\mathbb{R}}} \frac{dw_1}{2\ensuremath{\mathbf{i}}\pi} \dots \int_{r_n+\ensuremath{\mathbf{i}}\ensuremath{\mathbb{R}}} \frac{dw_w}{2\ensuremath{\mathbf{i}}\pi} \prod_{i<j}\frac{w_i-w_j}{w_i-w_j+1}\frac{w_i+w_j}{w_i+w_j-1} \prod_{i=1}^n e^{\frac{t w_i^2}{2}-xw_i}\frac{w_i}{A+w_i} \label{eq:limitmomentsnested} \end{equation} where $0=r_1<r_2-1<\dots <r_n-n+1$, as in the statement of the Theorem. We will not recall here the arguments from \cite{borodin2016directed} that lead to the equality between \eqref{eq:limitmoments} and \eqref{eq:limitmomentsnested}. The details can be found in \cite[Section 7.3, Step 1]{borodin2016directed}. Let us simply point out that the purpose of \cite[Section 7.3, Step 1]{borodin2016directed} was to show that after moving all contours in \eqref{eq:limitmomentsnested} to $\ensuremath{\mathbf{i}}\ensuremath{\mathbb{R}}$, one obtains a complicated sums over residues, and that the non-trivial residues are exactly those in the right-hand-side of \eqref{eq:limitmoments}. Let us also stress that the step 2 in \cite[Section 7.3]{borodin2016directed} relies on some unproven conjectural claim, but the arguments in step 1, that we are using here, are complete and do not rely on any unproven claim. To finish the proof, we need to relax the strict monotonicity condition on the $x_i$ and prove that the right-hand-side of \eqref{eq:limitmomentsnested} indeed corresponds to the mixed moments of the SHE. We observe that by definition, $\vert Z_t(x)/Z_t(x+1)\vert \leq (\mathsf{p}/\mathsf{q})^{3/2}$ so that for any $0\leqslant x_1 \leq \dots\leq x_n $ \begin{equation*} \lim_{\varepsilon\to 0} \mathbb E\left[\prod_{i=1}^n Z^{\varepsilon}(t,x_i) \right] =\lim_{\varepsilon\to 0} \mathbb E\left[\prod_{i=1}^n Z^{\varepsilon}(t,x_i+\varepsilon i) \right],\end{equation*} which is also given by the expression in the right-hand-side of \eqref{eq:limitmomentsnested}. Hence, we now have a formula for the limit of all mixed moments of $Z^{\varepsilon}(t,x)$. Furthermore, the bound \eqref{eq:uniformbound} from Proposition \ref{prop:limit} shows that the sequence of random variables $\prod_{i=1}^n Z^{\varepsilon}(t,x_i)$ is uniformly integrable, and since it converges weakly to $\prod_{i=1}^n Z(t,x_i)$ by \cite[Theorem 1.4]{parekh2017kpz}, we deduce that \begin{equation*}\lim_{\varepsilon\to 0} \mathbb E\left[\prod_{i=1}^n Z^{\varepsilon}(t,x_i)\right]=\mathbb E\left[\prod_{i=1}^n Z(t,x_i)\right]=\eqref{eq:momentKPZhalfspace}.\end{equation*} We refer to \cite{ghosal2018moments} for a very similar argument related to the moments of the full-space SHE. This concludes the proof of Theorem \ref{theo:momentsKPZ}. \end{proof} \begin{proof}[Proof of Proposition \ref{prop:limit}] We have already seen that under the scalings \ref{eq:scalings}, taking the pointwise limit of integrands in \eqref{eq:momentZepsilon} leads to \eqref{eq:limitmoments}. In order to prove that the limit holds, we will apply the dominated convergence theorem. Let us estimate each of the factors appearing in \eqref{eq:momentZepsilon} under the change of variables $z=-1/\sqrt{q}q^{w}$ considered above. We observe that when $z$ varies over a circle around $0$, $\left\vert \frac{\sqrt{\mathsf{p}\mathsf{q}}(1-z)}{\mathsf{p}-\mathsf{q} z} \right\vert$ is maximized when $z$ has minimal real part. In particular, if $z$ varies over a circle of radius comprised between $q^c$ and $q^{-c}$ for some constant $c$, then there exists a constant $C$ such that uniformly in $\varepsilon$, \begin{equation}\left\vert \left( \frac{\sqrt{\mathsf{p}\mathsf{q}}(1-z)}{\mathsf{p}-\mathsf{q} z} \right)^{\varepsilon^{-1}x+1}\right\vert \leqslant \left( \frac{\sqrt{q}(1+q^{-c})}{1+q^{1-c}} \right)^{\varepsilon^{-1}x+1} \leqslant C. \label{eq:boundx} \end{equation} The rational factors \eqref{eq:limitrationalfactors} are also easily bounded by a constant so that \begin{equation} \left\vert \Res{I} \left\lbrace \prod_{i<j} \frac{z_i-z_j}{qz_i-z_j} \frac{q^{-1}-z_iz_j}{1-z_iz_j}\right\rbrace \right\vert <C. \label{eq:boundRes} \end{equation} Then, to estimate the exponential factor, we need to control the real part of the function \begin{equation} \frac{(\sqrt{\mathsf{p}}+\sqrt{\mathsf{q}} z)^2 \varepsilon^{-1}}{(1-z)(\mathsf{p}-\mathsf{q} z)} = \frac{(1-e^{-2\varepsilon^{1/2}w})^2\varepsilon^{-1}}{(1+e^{-\varepsilon^{1/2}(2w-1)})(1+e^{-\varepsilon^{1/2}(2w+1)})}=:H(w). \label{eq:defh} \end{equation} Under the change of variables that we are considering, the contour $\mathcal C$ for $z$ becomes $\ensuremath{\mathbf{i}}[\frac{-\pi}{2} \varepsilon^{-1/2}, \frac{\pi}{2} \varepsilon^{-1/2}]$ for $w$. However, since we are taking residues in \eqref{eq:momentZepsilon} we not only need to estimate $\ensuremath{\mathfrak{Re}}[H(w)]$ along the contour, but also expressions of the form $\ensuremath{\mathfrak{Re}}[H(w_1)]+\dots+ \ensuremath{\mathfrak{Re}}[H(w_k)]$, where $\vec w$ is of the form $(w+k-1, w+k-2, \dots, w)$ or of the form $(w+k-1, \dots, w, 1-w, 2-w, \dots, \ell-w)$ for some integers $k,\ell\geq 0$ such that $k+\ell\leq n$, and $w\in \ensuremath{\mathbf{i}}\ensuremath{\mathbb{R}}$. This is the purpose of the following lemma. \begin{lemma}Fix positive integers $k,\ell\leq n$ such that $k+\ell\leq n$. There exist a constant $C$ so that uniformly for $\varepsilon$ in a neighborhood of $0$, for all $y\in [\frac{-\pi}{2} \varepsilon^{-1/2}, \frac{\pi}{2} \varepsilon^{-1/2}]$, \begin{equation} \sum_{i=0}^{k-1}\ensuremath{\mathfrak{Re}}[H(\ensuremath{\mathbf{i}} y+i)]\leq C (C-y^2); \label{eq:lemma} \end{equation} and for a sequence $(w_1, \dots, w_{k+\ell})$ of the form $(w+k-1, \dots, w, 1-w, 2-w, \dots, \ell-w)$ with $w=\ensuremath{\mathbf{i}} y$, \begin{equation} \sum_{i=1}^{k+\ell}\ensuremath{\mathfrak{Re}}[H(w_i)]\leq C (C-y^2). \label{eq:lemma2} \end{equation} \label{lem:quadraticdecay} \end{lemma} \begin{proof} Let us consider first the case $k=1$ for simplicity. The real part of $H[\ensuremath{\mathbf{i}} y]$ can be computed explicitly as \begin{equation*} \ensuremath{\mathfrak{Re}}[H(\ensuremath{\mathbf{i}} y)] = \frac{-2 \sin(\varepsilon^{1/2}y)^2\varepsilon^{-1}}{\cos(2\sqrt\varepsilon y )+\cosh(\sqrt\varepsilon)},\end{equation*} so that, using $\sin(x)\geq x/2$ for $x\in [0, \pi/2]$ and the fact that the denominator can be bounded by a constant, we obtain that $\ensuremath{\mathfrak{Re}}[H(\ensuremath{\mathbf{i}} y)] \leq - y^2/2$. To prove the more general estimates \eqref{eq:lemma} and \eqref{eq:lemma2}, it is useful to observe that, letting $h(z)=\frac{(1+\sqrt{q}z)^2}{(1-z)(1-q z)}$, we have \begin{equation} h(z)-1 = \frac{(1+\sqrt{q})^2}{1-q}\left( \frac{1}{1-z}- \frac{1}{1-qz}\right). \label{eq:structureofh} \end{equation} Hence, we have the following telescopic sum simplification: \begin{equation*} \sum_{i=0}^{k-1} h(q^iz)-1 = \frac{(1+\sqrt{q})^2}{1-q}\left( \frac{1}{1-z}- \frac{1}{1-q^kz}\right). \end{equation*} Using the change of variables $z=-1/\sqrt{q}q^{\ensuremath{\mathbf{i}} y}$, $q=e^{-2\sqrt\varepsilon}$, we obtain that \eqref{eq:lemma} can be explicitly computed as \begin{equation*} \sum_{i=0}^{k-1}\ensuremath{\mathfrak{Re}}[H(Iy+i)] = k\varepsilon^{-1}+\ensuremath{\mathfrak{Re}}\left[ \varepsilon^{-1}\frac{(1+e^{-\sqrt\varepsilon})^2}{1-e^{-2\sqrt\varepsilon}} \frac{-(1-e^{-2\sqrt\varepsilon k})e^{\sqrt\varepsilon(1-2\ensuremath{\mathbf{i}} y)}}{(1+e^{\sqrt\varepsilon(1-2\ensuremath{\mathbf{i}} y)})(1+e^{\sqrt\varepsilon(1-2k-2\ensuremath{\mathbf{i}} y)})}\right].\end{equation*} Using Mathematica, we find that the real part can be computed as \begin{equation*} k\varepsilon^{-1} -\varepsilon^{-1} \frac{\cosh(\sqrt\varepsilon/2)\sinh(\sqrt\varepsilon k)(\cosh(\sqrt\varepsilon k)+\cosh(\sqrt\varepsilon(k-1)\cos(2\sqrt\varepsilon y))}{\sinh(\sqrt\varepsilon/2)(\cos(2\sqrt\varepsilon y)+\cosh(\varepsilon))(\cos(2\sqrt\varepsilon y)+\cosh(\varepsilon(1-2k)))}.\end{equation*} This quantity behaves at first order when $\varepsilon\to 0$ as $k\left( \frac{(k-1)(2k-1)}{6}-y^2\right)$, which is consistent with the right-hand-side of \eqref{eq:lemma}. To obtain an estimate uniformly in $\varepsilon$, we use the bounds $e^x\leq 1+x+x^2$, $\sinh(x)\leq x+x^3$ and $1+x^2/2\leq \cosh(x)\leq 1+x^2$ valid on some interval $(0,c)$ for some fixed constant $c>0$, and the bounds $1-x^2\leq \cos(x)\leq 1-x^2/2+x^4$, valid for all $x\in (-\pi, \pi)$. After simplifications, we obtain that there exists a constant $C$ so that \eqref{eq:lemma} is satisfied for all $y\in [\frac{-\pi}{2} \varepsilon^{-1/2}, \frac{\pi}{2} \varepsilon^{-1/2}]$, as long as $\varepsilon$ is small enough so that $2\varepsilon^{1/2}k\leq c$ (the condition $2\varepsilon^{1/2}k\leq c$ is necessary to apply the bounds above). This concludes the proof of \eqref{eq:lemma}. Now, for a vector $(z_1, \dots, z_{k+\ell})$ of the form $(q^{k-1}z, \dots,qz , z, 1/z, q/z, \dots,q^{\ell-1}z),$ we have \begin{equation*} \sum_{i=1}^{k+\ell} h(z_i)-1 = \frac{(1+\sqrt{q})^2}{1-q}\left(1- \frac{1}{1-q^{\ell}/z}- \frac{1}{1-q^kz}\right). \end{equation*} Using the change of variables $z=-1/\sqrt{q}q^{\ensuremath{\mathbf{i}} y}$, $q=e^{-2\sqrt\varepsilon}$, we obtain that \eqref{eq:lemma2} can be explicitly computed as \begin{multline} \sum_{i=0}^{k+\ell}\ensuremath{\mathfrak{Re}}[H(w_i)] = (k+\ell)\varepsilon^{-1} - \ensuremath{\mathfrak{Re}}\left[\varepsilon^{-1} \frac{(1+e^{-\sqrt\varepsilon})^2}{1-e^{-2\sqrt\varepsilon}} \right. \\ \left. \times \frac{(1-e^{-2\varepsilon^{1/2}(k+\ell)})\left(1+e^{2\varepsilon^{1/2}(k+\ell)}+\left( e^{(2k-1)\varepsilon^{1/2}}+e^{(2\ell+1)\varepsilon^{1/2}}\right) \cos(2\varepsilon^{1/2}y)\right)}{4(\cos(2\varepsilon^{1/2}y)+\cosh(\varepsilon^{1/2}(2k-1)) )(\cos(2\varepsilon^{1/2}y)+\cosh(\varepsilon^{1/2}(2\ell+1)) )} \right]. \end{multline} Again, using the same bounds as above on the functions $\cos(x)$ and $\cosh(x)$ and $e^x$, we obtain that there exists a constant $C$ so that \eqref{eq:lemma2} is satisfied for all $y\in [\frac{-\pi}{2} \varepsilon^{-1/2}, \frac{\pi}{2} \varepsilon^{-1/2}]$. This concludes the proof of the Lemma \ref{lem:quadraticdecay}. \end{proof} At this point, using Lemma \ref{lem:quadraticdecay} and the bounds \eqref{eq:boundx} and \eqref{eq:boundRes} above, the integrand of each term in the sum \eqref{eq:momentZepsilon} can be dominated by a function of the form $Ce^{tC(C-y^2)}$. Hence, by the dominated convergence theorem, we conclude that \eqref{eq:limitmoments} holds. The same bound leads to \eqref{eq:uniformbound}, which concludes the proof of Proposition \ref{prop:limit}. \end{proof} \subsection{KPZ equation on $\ensuremath{\mathbb{R}}_{>0}$ with Dirichlet initial data} Another case of interest is when $\rho$ is not scaled close to $1/2$ but fixed, for instance $\rho=1$. This corresponds to sending $A\to +\infty$, so it is natural to expect that one obtains a SHE with Dirichlet boundary condition in the limit. Such boundary condition was considered in \cite{parekh2019positive} in the context of directed polymer models, for Brownian initial data. However, when the half-line ASEP is started from the empty initial condition, it is not entirely clear a priori what should be the initial condition for the KPZ equation in the limit. In the paper \cite{barraquand2022weakly}, to appear, it will be shown that when $\rho=1$, the correct scaling to consider is \begin{equation} Z_{Dir}^{\varepsilon}(t,x) = \varepsilon^{-1} \mathcal Z_{\varepsilon^{-2}t}(\varepsilon^{-1}x), \label{eq:defZDir} \end{equation} where $Z_t(x)$ is still defined as in \eqref{eq:defZepsilon}. In order to rigorously identify the initial data, a sharp estimate on the second moment of $Z_{Dir}^{\varepsilon}(t,x)$ as $\varepsilon \to 0$ is needed. It turns out that usual techniques, based on the fact that $Z_t(x)$ satisfies a discrete variant of the SHE, does not seem to adapt easily to this case where the initial condition is very singular. Theorem \ref{theo:momentformula} however, allows to prove such an estimate. In particular, we obtain the following result which is used in \cite{barraquand2022weakly} to obtain second moment bounds. \begin{proposition} Scaling $\mathsf{p}=\frac{1}{2}e^{\sqrt{\varepsilon}}$ and $\mathsf{q}=\frac{1}{2}e^{-\sqrt{\varepsilon}}$ and letting $\rho=1$, we have for any $0\leq x_1\leq \dots \leq x_n$, \begin{equation} \lim_{\varepsilon\to 0} \mathbb E\left[\prod_{i=1}^n Z_{Dir}^{\varepsilon}(t,x_i)\right]= 4^n\int_{r_1+\ensuremath{\mathbf{i}}\ensuremath{\mathbb{R}}} \frac{dw_1}{2\ensuremath{\mathbf{i}}\pi} \dots \int_{r_n+\ensuremath{\mathbf{i}}\ensuremath{\mathbb{R}}} \frac{dw_w}{2\ensuremath{\mathbf{i}}\pi} \prod_{i<j}\frac{w_i-w_j}{w_i-w_j+1}\frac{w_i+w_j}{w_i+w_j-1} \prod_{i=1}^n w_i e^{\frac{t w_i^2}{2}-xw_i}, \label{eq:momentKPZDirichlet} \end{equation} where $0=r_1<r_2-1<\dots <r_n-n+1$. \end{proposition} \begin{proof} The proof is the same as the proof of Theorem \ref{theo:momentsKPZ}, except that in the proof of Theorem \ref{theo:momentsKPZ}, when scaling $\rho=1/2+\sqrt{\varepsilon}(1/4+A/2)$, we had that under the change of variables $z= -e^{\varepsilon^{1/2}(1-2w)}$, \begin{equation*} \frac{\rho dz}{\rho+(1-\rho)z}= \frac{dw}{A+w}+ O(\varepsilon^{1/2}), \end{equation*} while for $\rho=1$, we have \begin{equation*} \frac{\rho dz}{\rho+(1-\rho)z}= 2\varepsilon^{1/2}+ O(\varepsilon). \end{equation*} This explains the prefactor $\varepsilon^{-1}$ in \eqref{eq:defZDir} instead of $\varepsilon^{-1/2}$ and the prefactor $4^n$ instead of $2^n$ in front of the integrals in \eqref{eq:momentKPZDirichlet}. \end{proof} \begin{remark} Moment formulas for the SHE on $\ensuremath{\mathbb{R}}_{>0}$ with Dirichlet boundary condition, were obtained in \cite{gueudre2012directed} using the Bethe ansatz. Although the derivation in \cite{gueudre2012directed} is not mathematically rigorous, it seems that the formula \cite[Eq. (11)]{gueudre2012directed} matches with \eqref{eq:momentKPZDirichlet} modulo the use of \cite[Conjecture 5.2]{borodin2016directed}. The existence and uniqueness of solutions to the SHE with Dirichlet initial data was shown for Brownian type initial data in \cite{parekh2019positive} and the result is extended in the upcoming paper \cite{barraquand2022weakly} to cover the limit of the empty initial data, that is the initial condition considered in \cite{gueudre2012directed}. \end{remark} \renewcommand{\emph}[1]{\textit{#1}}
\section{Introduction} While it is a consensus among the particle physics community that the next big collider should be an e$^+$e$^-$ Higgs factory, there are a number of competing proposals for colliders and detectors to realise such a Future Higgs Factory (FHF). In the current phase of optimising the detector layouts and comparing potentially competing concepts, it is vital to inform the detector development by making the connection between subdetector and system performance and physics observables. Recently, new methods and algorithms have been developed and implemented in order to exploit the clean conditions at a lepton collider and the advances in hardware development which have been achieved or are foreseen for the next collider. This work shows the impact of these methods and their requirements, describing three examples: Error Flow, neutrino correction and strange tagging. They apply (mostly) to jets originating from b, c and s quarks. These are particularly interesting decay modes of the Higgs itself, but also a considerable background from Z decays. The reconstruction of the invariant mass of the mother boson and the ability to tag jet flavour are important ingredients in many analyses such as measuring the Higgs self coupling in the most common decay mode $\textrm{HH} \rightarrow \textrm{b}\bar{\textrm{b}}\textrm{b}\bar{\textrm{b}}$ and setting limits on the Higgs-strange coupling, with the leading Feynman diagrams shown in \autoref{fig:feyn}. \begin{figure}[!hbt] \centering \includegraphics[width=.48\textwidth,keepaspectratio=true]{DoubleHiggs.png} \includegraphics[width=.48\textwidth,keepaspectratio=true]{Higgs_ssbar.png} \centering \caption{Example Feynman diagrams of particularly interesting channels: Higgs self-coupling and Higgs to strange decay.} \label{fig:feyn} \end{figure} \section{Error Flow} Kinematic fitting \cite{KinFit09} can be used to refine the measured observables of an event, taking into account external constraints. Lepton colliders provide particularly strong general constraints such as the fixed center-of-mass energy or momentum conservation in each direction, but constraints can also be specific to an analysis. The properties of measured particles, usually Particle Flow Objects (PFOs), or combined objects, like reconstructed jets, are then varied within their uncertainties until the constraints are met and the resulting $\upchi^2$ is minimised. In the classical approach, the general detector resolutions, e.g.\ momentum or jet energy resolution, are used as uncertainties, but the fit result can be much improved by using individual errors for each property of each individual PFO. This approach is called Error Flow \cite{ErrorFlow21a,ErrorFlow21b} and requires an accurate assessment of these individual uncertainties. Recent improvement to the implementation of Error Flow included usage of a full covariance matrix for the uncertainties, i.e.\ taking into account correlations between different measurement dimensions, as well as a rescaling of the errors assigned to each measurement dimension in order for the resulting pulls to have a unity width. This leads to a uniform distribution of the $\chi^2$ probability shown in \autoref{fig:ErrorFlowChi2}. The resulting improvement in reconstruction is shown in \autoref{fig:HZComp}: The reconstructed invariant 2-jet mass is shown for the channels $\textrm{e}^+\textrm{e}^- \rightarrow \textrm{ZH/ZZ} \rightarrow \upmu\bar{\upmu}\textrm{b}\bar{\textrm{b}}$ for events with at least one semi-leptonic decay in the $\textrm{b}\bar{\textrm{b}}$ system. Here, the generally much more abundant Z decays create a substantial background for Higgs decays, which one usually aims to isolate. The black curves show the situation before the kinematic fit: The missing neutrino energy widens the invariant mass peaks and creates long tails to low energies, with a large overlap between the Z and H peaks. The kinematic fit applied here re-fits the properties of the two muons, the two jets and allows for an initial-state-radiation (ISR) photon. The constraints are three momentum conservations, energy conservation and the invariant mass of the $\upmu\bar{\upmu}$ within the width of the Z boson. Ater the kinematic fit with Error Flow (green curves) the peaks are much narrower and easier to separate. In order to utilise Error Flow, it is crucial to not only minimise measurement uncertainties but to have \textit{correct} uncertainties for each PFO. This is naturally provided by Particle Flow, which in turn needs a very low mass tracker and a high granularity calorimeter. \begin{figure}[!hbt] \centering \begin{minipage}{.42\textwidth} \centering \includegraphics[width=\textwidth,keepaspectratio=true]{SLD_3b.png} \captionof{figure}{$\upchi^2$ probability distribution of a kinematic fit before and after the implementation of a full covariance matrix and rescaling of underlying measurement uncertainties. The theoretically optimal curve is a constant line. \cite{ErrorFlow21a}} \label{fig:ErrorFlowChi2} \end{minipage}% \hspace{.3cm} \begin{minipage}{.54\textwidth} \centering \includegraphics[width=\textwidth,keepaspectratio=true]{Higgs-Z-Comp_all_b.png} \captionof{figure}{Reconstructed invariant masses of 2 jets from hadronic Z or H decays which include at least one semi-leptonic decay. \cite{ErrorFlow21b}} \label{fig:HZComp} \vspace{1cm} \end{minipage} \end{figure} \section{Neutrino Correction} While the missing neutrino energy in semileptonic decays of heavy flavour hadrons can be compensated to some degree already with a kinematic fit, it is in principle possible to calculate the momentum of a neutrino from the observed particles and missing momentum at an identified secondary vertex, as shown in \cite{ErrorFlow21a}. This works up to a final sign ambiguity, which can be resolved within a kinematic fit again. This neutrino correction allows to fully mitigate the effect of the energy loss on the reconstructed invariant mass reflected in the blue curves in \autoref{fig:HZComp}. When the effects of both the Error Flow kinematic fit and the neutrino correction are combined, they result in the red curves. Here, the width of the reconstructed Z peak is limited by the natural width of the Z and the reconstructed Higgs peak width is limited by the detector resolution, crucially not anymore by the reconstruction algorithm. The neutrino correction capability requires to find all visible particles coming from the semi-leptonic decay, i.e.\ 4$\uppi$ hermiticity and high efficiency tracking down to very low momenta, identification of the B/C-meson decay via a secondary vertex, i.e.\ excellent vertexing capability, as well as identification (ID) of the charged lepton from the leptonic decay, i.e.\ e/$\upmu$-ID including in the few-GeV range. \section{Strange Tagging} Second-generation fermion-Higgs couplings are of particular interest to test the universality of the Higgs mechanism. A FHF will not only be able to measure the Higgs-charm coupling to the per-cent level, but also to set limits on the Higgs-strange coupling, as has been recently shown \cite{Hssbar}, provided detector requirements are met. Here, for a partial data set of \SI{900}{fb^{-1}} of the International Linear Collider (ILC) at \SI{250}{GeV}, a cut-based analysis was performed to select Higgs decays to $\textrm{s}\bar{\textrm{s}}$. The final cut in this analysis is an optimised cut on the score of a newly developed strange tagger to further reduce background. This tagger, which is based on a Boosted Decision Tree (BDT), uses the properties of the 2 jets including secondary vertex information, as well as the properties of the 10 leading particles in each of the two reconstructed jets, crucially including charged hadron ID information. In \autoref{fig:Hssbar_cut} the effect of the tagger is shown: while the (stacked) backgrounds peak to low strange scores, the (unstacked) green signal curve peaks to higher values. The optimal signal/background ratio was achieved to a cut at a strange score of 0.35 in this analysis, indicated by the orange arrow. This reduced the background by a factor of 3 while leaving the signal largely intact. The signal is still very small compared to the background, but it is possible to calculate an upper limit on the Higgs-strange coupling expressed as $\upkappa_\textrm{s}$ in the $\upkappa$-framework \cite{kappa_framework}. With a reduced dataset of about half of the ILC data at \SI{250}{GeV} and a cheated (i.e.\ perfect) charged hadron ID, the upper limit is $\upkappa_\textrm{s} \leq 7.14$ for a 95\% confidence level, shown in \autoref{fig:Hssbar_result}. The implementation of the full dataset and realistic particle identification (PID) are ongoing, and it is expected that the doubling in statistics will out-weigh the degradation due to realistic PID performance, and thus that the limit should improve. The requirements for successful strange-tagging are excellent vertexing, in order to veto b and c jets, as well as identification of strange hadrons, which contain a large fraction of the momentum in an s jet. Most strange hadrons in s-quark iniated jets are charged kaons, K$^\pm$, but notable contributions come also from K$^0_\textrm{S}$ and $\upLambda^0$. \begin{figure}[!hbt] \centering \begin{minipage}{.55\textwidth} \centering \includegraphics[width=\textwidth,keepaspectratio=true]{Hssbar_flavour_cut.png} \captionof{figure}{Last step of an analysis looking for H$\rightarrow \textrm{s}\bar{\textrm{s}}$ events: application of the cut on the BDT output strange score. \cite{Hssbar}} \label{fig:Hssbar_cut} \end{minipage}% \hspace{.3cm} \begin{minipage}{.4\textwidth} \centering \includegraphics[width=\textwidth,keepaspectratio=true]{Hssbar_Result.png} \captionof{figure}{Result of the H$\rightarrow \textrm{s}\bar{\textrm{s}}$ analysis: upper limit on $\upkappa_\textrm{s}$. \cite{Hssbar}} \label{fig:Hssbar_result} \end{minipage} \end{figure} \section{Detector Requirements} In summary, the detector requirements to allow for the newly developed methods presented in this work are partly `standard' for a FHF detector, such as the usage of Partice Flow with a correspondingly low material tracker, hermiticity and excellent vertexing capability. The other aspects, however, deserve dedicated attention: high tracking efficiency at very low momenta puts an additional emphasis on the material budget of the inner tracking system, in particular considering that the momentum resolution of the different proposed FHF detectors will be limited by multiple scattering, rather than by the asymptotic term, up to several \SI{10}{GeV}, which contains the vast majority of all tracks. Furthermore, PID recently has received increased attention, especially in view of flavour physics studies at the Z pole and the WW threshold. Electron/muon ID is largely covered by most detector concepts through the use of cluster shapes in sufficiently segmented calorimeters as well as muon systems. However, at energies below a few GeV the e/$\upmu$-ID efficiency via these systems tends to drop and a dedicated PID measurement is advised. Even more crucial are PID systems for charged hadron ID. This can be achieved via dE/dx or dN/dx (cluster counting) in gaseous trackers, time-of-flight (TOF) measurements at the transition of outer tracker to ECal, or a dedicated incorporation of a Ring Imaging Cherenkov (RICH) system. Example performance curves for a combined TPC-dE/dx and TOF are shown in \autoref{fig:dEdxTOF} for the International Large Detecor (ILD) concept \cite{ILD_IDR}. The identification of neutral strange hadrons, K$^0_\textrm{S}$ and $\upLambda^0$, gives additional information for tagging. Since they are semi-stable they mostly decay inside the tracking volume and can be identified via their oppositely charged decay products, which create a V shape in the tracker. For their reconstruction, the so-called V0 finding sketched in \autoref{fig:v0vis}, a continuous tracking, i.e. gaseous tracking, is beneficial. \begin{figure} \centering \begin{minipage}{.46\textwidth} \centering \includegraphics[width=\textwidth,keepaspectratio=true]{Combined_dEdx_TOF100_HiStat.png} \captionof{figure}{Combination of PID performance via dE/dx and TOF at the ILD. \cite{ILD_IDR}} \label{fig:dEdxTOF} \end{minipage}% \hspace{.3cm} \begin{minipage}{.46\textwidth} \vspace{1.4cm} \centering \includegraphics[width=\textwidth,keepaspectratio=true]{V0_Visualisation.png} \captionof{figure}{Scheme of V0 finding.} \label{fig:v0vis} \end{minipage} \end{figure} \section{Conclusion} The development of algorithms to exploit the precious collisions at FHFs in order to measure the Higgs to the best of our abilities not only increases the utilisation of current detector concepts but also informs which aspects are of particular interest. These conclusions are summarised in \autoref{tab:fazit}. Not only the well-established characteristics are crucial, but an increasing stress is put on particle identification, which calls for the development of new and improvement of existing dedicated PID systems. \begin{table}[h!] \begin{center} \begin{tabular}{c} \includegraphics[width=.8\textwidth,keepaspectratio=true]{Fazit_Table3.png} \end{tabular} \caption{Conlusion table.} \label{tab:fazit} \end{center} \end{table} \section{Acknowledgements} We thankfully acknowledge the support by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) under Germany’s Excellence Strategy EXC 2121 "Quantum Universe" 390833306. \bibliographystyle{JHEP}
\section{0pt}{12pt plus 3pt minus 3pt}{1pt plus 1pt minus 1pt} \titlespacing\subsection{0pt}{10pt plus 3pt minus 3pt}{1pt plus 1pt minus 1pt} \titlespacing\subsubsection{0pt}{8pt plus 3pt minus 3pt}{1pt plus 1pt minus 1pt} \usepackage{tikz,xcolor,hyperref} \definecolor{lime}{HTML}{A6CE39} \DeclareRobustCommand{\orcidicon}{ \begin{tikzpicture} \draw[lime, fill=lime] (0,0) circle [radius=0.16] node[white] {{\fontfamily{qag}\selectfont \tiny ID}}; \draw[white, fill=white] (-0.0625,0.095) circle [radius=0.007]; \end{tikzpicture} \hspace{-2mm} } \foreach \x in {A, ..., Z}{\expandafter\xdef\csname orcid\x\endcsname{\noexpand\href{https://orcid.org/\csname orcidauthor\x\endcsname} {\noexpand\orcidicon}} } \newcommand{0000-0002-4387-3819}{0000-0002-4387-3819} \newcommand{0000-0002-7860-3560}{0000-0002-7860-3560} \newcommand{0000-0003-0939-3173}{0000-0003-0939-3173} \newcommand{0000-0002-7429-1846}{0000-0002-7429-1846} \newcommand{0000-0003-2787-5299}{0000-0003-2787-5299} \title{Automated Cache for Container Executables} \usepackage{xwatermark} \newwatermark[firstpage,color=gray!60,angle=90,scale=0.32, xpos=-4.05in,ypos=0]{\href{https://doi.org/}{\color{gray}{}}} \newwatermark[firstpage,color=gray!60,angle=90,scale=0.32, xpos=3.9in,ypos=0]{\href{https://doi.org/}{\color{gray}{Preprint doi}}} \newwatermark[firstpage,color=gray!90,angle=0,scale=0.28, xpos=0in,ypos=-5in]{*correspondence: \texttt{<EMAIL>}} \usepackage{authblk} \renewcommand*{\Authfont}{\bfseries} \author[1]{Vanessa Sochat\orcidA{}} \author[2]{Matthieu Muffato\orcidB{}} \author[3]{Audrey Stott\orcidC{}} \author[3]{Marco {De La Pierre\orcidD{}}} \author[4]{Georgia Stuart\orcidE{}} \affil[1]{Computer Scientist, Lawrence Livermore National Lab, USA} \affil[2]{Tree of Life, Wellcome Sanger Institute, Cambridge, UK} \affil[3]{Pawsey Supercomputing Research Institute, Kensington, WA, Australia} \affil[4]{UT Dallas, Richardson, TX, USA} \usepackage{listings} \usepackage{color} \definecolor{dkgreen}{rgb}{0,0.6,0} \definecolor{gray}{rgb}{0.5,0.5,0.5} \definecolor{mauve}{rgb}{0.58,0,0.82} \lstset{frame=tb, language=Java, aboveskip=3mm, belowskip=3mm, showstringspaces=false, columns=flexible, basicstyle={\small\ttfamily}, numbers=none, numberstyle=\tiny\color{gray}, keywordstyle=\color{blue}, commentstyle=\color{dkgreen}, stringstyle=\color{mauve}, breaklines=true, breakatwhitespace=true, tabsize=3 } \begin{document} \twocolumn[ \begin{@twocolumnfalse} \maketitle \begin{abstract} Linux container technologies such as Docker \cite{docker} and Singularity \cite{singularity} offer encapsulated environments for easy execution of software. In high performance computing, this is especially important for evolving and complex software stacks with conflicting dependencies that must co-exist. Singularity Registry HPC (``shpc'') \cite{shpc} was created as an effort to install containers in this environment as modules \cite{modules}, seamlessly allowing for typically hidden executables inside containers to be presented to the user as commands, and as such significantly simplifying the user experience. A remaining challenge, however, is deriving the list of important executables in the container. In this work, we present new automation and methods that allow for not only discovering new containers in large community sets, but also deriving container entries with important executables. With this work we have added over 8,000 containers from the BioContainers \cite{biocontainers} community that can be maintained and updated by the software automation over time. All software is publicly available on the GitHub platform, and can be beneficial to container registries and infrastructure providers for automatically generating container modules to lower the usage entry barrier and improve user experience. \end{abstract} \keywords{containers, container modules, registry, automation, shpc} \vspace{0.35cm} \end{@twocolumnfalse} ] \section*{(1) Overview} \label{sec:overview} \section{Introduction} \label{sec:introduction} Containerization technologies \cite{docker,singularity} have been a game-changer for reproducible research, allowing users to not only build and use reproducible environments on high performance computing (HPC) systems, but also allowing for saving the container binaries in a registry for others in the future to do the same. As HPC has matured over the decades, tools have been created that make it easier to install software to this environment, whether that be in the form of a package manager \cite{spack,easybuild} or module software \cite{modules,lmod}, which allow a user to load a namespace of commands to use. As most package managers and modules typically install software from source, the Singularity Registry HPC (shpc) \cite{shpc} software was created as a marriage between the two - allowing HPC administrators and users to install containers as modules. \subsection{The Design of Singularity Registry HPC} Singularity Registry HPC provides a manager for registry entries that can seamlessly install to module software and then render itself no longer needed. At its initial creation, each registry entry was only allowed to be a YAML file \cite{yaml} in a local filesystem folder organized by the container unique resource identifier namespace. An example with the unique resource identifier ``quay.io/biocontainers/samtools'' is shown below. \begin{lstlisting} $ tree quay.io/biocontainers/samtools/ quay.io/biocontainers/samtools/ > container.yaml \end{lstlisting} The entry provides a main ``container.yaml'' file with an installation source (e.g., a container registry), a maintainer and description, along with container tags and digests \cite{tag-vs-digest}, and aliases or named paths \cite{shpc}. An example alias - a mapping of a term ``samtools'' to a path is shown below: \begin{lstlisting} aliases: samtools: /usr/local/bin/samtools \end{lstlisting} This named path makes it easy to find useful executables within a container. The shpc software is able to provide a set of aliases that are made available to users as shell commands. This significantly lowers the barrier to container adoption in HPC, as users need to know almost nothing about container usage and syntax. For the example above, loading the container as a module would expose multiple aliases, the main one of interest likely the ``samtools'' alias for the user to interact with. An example of the underlying command that the user would need to know without the shpc software is shown below using the Singularity \cite{singularity} container technology. \begin{lstlisting} $ singularity <singularity-options> exec <options> -B <bind> <container> /usr/local/bin/samtools "$@" \end{lstlisting} The shpc software provides equivalent aliases for singularity shell, run and various inspection commands, and also supports custom container options and binds. The original set of approximately 200 entries was derived manually by the creator and contributors, and recognizing the constant change of container tags, a GitHub action was quickly developed to retrieve updated tags via the container registry API endpoint \cite{shpc}. As the design evolved, there was desire for more automation and separation of responsibility between the manager software and the registry entries. As a result, the software was updated to support local or remote registries, and the main registry, along with the monthly automation to update tags, moved into a remote version-controlled repository \cite{shpc-registry}. This decoupling of the manager software from the underlying registry presented a new opportunity to extend automation. Previously, updating the entries of a registry required pulling the updated software along with the container entries from the version-control source. With a remote endpoint that serves a static application programming interface (API), this is no longer required -- the user's local registry can retrieve the latest registry entries without updating the software, and the entries can be updated separately with tagged releases provided monthly. However, while updating tags in registry entries was automated, creating an entirely new registry entry was not. This presented a new challenge for automation, not only for the manual addition of a new container entry requested by a user, but also for the addition of potentially thousands of containers from an external source. Complete automation would not only require deriving container tags and digests, but also the executable paths. In this work, we walk through the steps and methodology used to first semi\-automate addition of a single entry, and then to automate adding thousands of containers from the BioContainers set \cite{biocontainers}. The newly added 8,000+ containers are available for install using the shpc software, and all work is publicly available with active automation to keep the registry updated. \section{Implementation and architecture} \label{sec:methods} \subsection{Automated Recipe Generation} A semi-automated solution to generate a container entry to the online registry was introduced \cite{shpc} as a workflow. It takes a container unique resource identifier, description, and website reference, and generates a pull request to the repository to add the container. To support this workflow, we developed the ``guts'' software \cite{guts} that knows how to pull a container, retrieve and parse the ``PATH'' from the image manifest \cite{oci-manifest}, and then dump the container filesystem to a temporary location to search those locations statically and clean up. This procedure makes the assumption that the developer of the container has added locations of important executables to the ``PATH'' variable. An additional filtering step is needed to discover important executables (and not those found in the operating system provided by the container). We do an additional ``diff'' \cite{diff} with known executables from the most common base containers, which are provided via another automated workflow that is updated nightly \cite{shpc-guts}. The final set of executables represents a set that is unique to the changes developers made from the base containers. To retrieve updated tags, we make a request to the Docker API \cite{dockerapi} to retrieve a list of image tags, and retrieve associated digests via image manifests \cite{oci-manifest}. The ``pipelib'' software \cite{pipelib} is then used to sort tags by semantic versions, allowing us to filter tags and identify the ``latest,'' a special tag provided by the shpc software as the default version to install. With this workflow to automatically derive tags and executables given any container identifier, it became possible to request a recipe for a specific container directly on the remote registry repository, and then receive a pull request with a prepared registry entry. Without any further filtering of the executables (e.g., installed dependencies unique to the container that are not of interest), the entry typically requires additional curation to filter down the discovered executables to those that are the most important. This semi-automated workflow allows for easy addition of hand-picked containers, but would be substantial work to add tens to thousands more. \subsection{Container Executable Frequency} With a request to make available more BioContainers \cite{biocontainers}, a next logical step was to figure out how to combine the semi-automated generation with a means not only to add an individual container, but also to add potentially thousands of containers from an external source. At this scale, manual edits could not be required -- it would need to be possible to identify the most important executables without human curation. Addressing this challenge would require better understanding of the distribution of executables across containers, and then determining a strategy to identify the most unique to a container. Toward this aim, we first developed a cache -- the Singularity Registry HPC cache -- to store a complete list of executables on the ``PATH'' across all BioContainers \cite{shpc-registry-cache}. The cache is enabled by a generalized container binary discovery workflow designed to work on GitHub \cite{container-discovery-action}, called an action. First, the action is provided with an updated list of container binaries provided by the Galaxy Project \cite{afgan2018galaxy}. For each container identifier, we then again use the guts software to discover all binaries on the ``PATH,'' and save a JSON data file of the binaries to the repository, organized again by the container identifier. As a final step, we derive a second JSON data file with counts of executable names across containers. This counts data file can next be used alongside the shpc remote registry to intelligently filter down an entire set of executables in one container to a more relevant set. This entire set of actions is enabled by a few lines added to a workflow file, as shown in the shpc remote registry workflow \cite{shpc-registry-workflow}. \subsection{Automated Scaled Recipe Generation} Given the availability of summary counts for over 8,000 BioContainers, we can deploy the following algorithm to generate a list of meaningful executables per container. This assumes that we have a regularly updated executable count cache derived from the Galaxy Project listing. \begin{enumerate} \item{Identify a new container, C, not in the registry from the executable cache} \item{Create a set of global executable counts, G} \item{Define a set of counts from G in C as S} \item{Rank order S from least to greatest} \item{Include any entries in S that have a frequency < 10} \item{Include any entries in S that have any portion of the name matching the container identifier} \item{Above that, add the next 25 executables with the lowest frequencies, and < 1,000} \end{enumerate} The algorithm above assumes that the most unique executables in a container are less likely to appear in other containers, represented by a lower frequency. Always including executables that appear fewer than 10 times across the entire dataset allows for a container to have many unique commands. We chose these thresholds based on manual testing and visualization of the final list of executables, and found that these steps produced the set of binaries that we would expect or want for manual curation. We can combine programmatically derived tags and digests with these container aliases and other automated metadata to generate a final ``container.yaml''. From this YAML file, the shpc software can install the module to an HPC system and generate the respective executables as module commands. \subsection{Automated Recipe Updates} The original workflow to automatically update container tags and digests uses a native ``update'' command provided by the Singularity Registry HPC client, and this was run once a month across all containers in the current registry directly before a monthly release. However, with the addition of 8,000+ containers this monthly update would no longer be feasible within the 6 hour limit of a GitHub action runner \cite{runner}. To address this challenge, we developed a simple strategy to break up an entire list of container identifiers into equal groups, and have those groups remain consistent even given new additions to the registry. To do this, we first generate hashes for each of our container identifiers, and then generate hexdigests \cite{hashlib} that we convert into integer numbers. Then we take the modulus of the minimum number of days that can possibly appear in any month (N=28) to assign each number into a specific group in the range 0-27. We add 1 to this number for a range that matches with days of the month, 1-28. On a high level, this means that we can reliably split our container identifiers into equal groups, each of which is matched to a specific day of the month. In our workflow, we can then derive the groups, take the subset for the day the workflow is running, and update that set. This algorithm is represented and provided in a GitHub action \cite{split-list-action} for the interested reader. \section{Applications} \label{sec:applications} We took this work to the Pawsey Supercomputing Research Centre (Pawsey) \cite{pawsey}, a tier-1 Australian national high performance computing facility, where having these BioContainers made available as modules is perceived to vastly improve the accessibility and usage of containers in the life sciences. Through their involvement in the Australian BioCommons \cite{biocommons} Bring-Your-Own-Device Expansion Project, earlier phase discussions and surveys have highlighted repeatedly that containers are an integral part of life science research, but uptake is impeded by the lack of knowledge, confusion and time in learning about containers. Pawsey role was to provide technical and compute expertise for user access to the Galaxy Project’s repository of Singularity images of BioContainers through a read-only filesystem called CernVM-FS \cite{cvmfs}. While this filesystem cache significantly reduces duplication of images and time for building, researchers still face the hurdle of container syntax. Our automation of shpc recipes for BioContainers means that Pawsey, as well as other tier-1 and tier-2 partners of the Australian BioCommons, can easily install and have the same list of over 8,000 BioContainers loaded as shpc modules. With a simple script to match a discovered container in the filesystem to an shpc container entry \cite{biocontainers-match-script}, these compute facilities can utilize the existing library of Singularity images through their CernVM-FS filesystem. Recipe updates provided by shpc also ensure that all new versions of BioContainers, while being added to the CernVM-FS repository, are simultaneously made available to their researchers as shpc modules. \section{Quality control} \label{sec:quality} For Singularity Registry HPC, tests are run via continuous integration for each pull request into the main branch by means of GitHub Actions. Tests span all functionality of the software across several versions of module software and container technologies. The container registry updates and additions are done via an automated workflow, and manually checked by the main developer, author VS, for any changes. Lists of executables provided in the cache are spot checked by developers to ensure what is expected is there (e.g., a samtools container should minimally have the executable for samtools). Feedback comes in from the user base about executables that might be removed or added to further tweak added container recipes. \section*{(2) Availability} \label{sec:availability} \setcounter{section}{0} \section*{Operating system} Singularity Registry HPC and associated tooling should work on most Unix and Linux flavored distributions. The software was developed on Ubuntu 22.04. \section*{Programming language} This set of tools is developed to support Python 3.7 and higher. Python 2.x is not supported. \section*{Dependencies} The newly released cache and automation can run on GitHub actions with the environment encapsulated by the runner. The shpc set of tools requires the requests library, jsonschema, and generally expects module software to be installed \cite{lmod, modules}. See the ``version.py'' in each project for details. Naturally, shpc also requires a container execution runtime, such as Singularity \cite{singularity}, Podman \cite{podman} or Docker \cite{docker}. \section*{List of contributors} Authors VS, MM, AS, MDLP, and GS have all contributed directly to the software. \section*{Software location: Archive} \begin{itemize} \item Name: singularity-hpc \begin{itemize} \item Persistent Identifier:\newline \href{https://github.com/singularityhub/singularity-hpc/archive/refs/tags/0.1.16.tar.gz}{singularityhub/singularity-hpc} \item License: MPL-2.0 \item Publisher: Vanessa Sochat \item Version published: 0.1.16 \item Date published: 5 November 2022 \end{itemize} \end{itemize} \begin{itemize} \item Name: shpc-registry \begin{itemize} \item Persistent Identifier: \newline \href{https://github.com/singularityhub/shpc-registry/archive/refs/tags/2022-11.tar.gz}{singularityhub/shpc-registry} \item License: MPL-2.0 \item Publisher: Vanessa Sochat \item Version published: 2022-11 \item Date published: 2 November 2022 \end{itemize} \end{itemize} \begin{itemize} \item Name: shpc-registry-cache \begin{itemize} \item Persistent Identifier: \newline \href{https://github.com/singularityhub/shpc-registry-cache/archive/refs/tags/2022-10.tar.gz}{singularityhub/singularity-hpc} \item License: MPL-2.0 \item Publisher: Vanessa Sochat \item Version published: 2022-10 \item Date published: 21 November 2022 \end{itemize} \end{itemize} \section*{Software location: Code repository} \begin{itemize} \item Name: singularity-hpc \begin{itemize} \item Persistent Identifier: \newline \href{https://github.com/singularityhub/singularity-hpc}{singularityhub/singularity-hpc} \item License: MPL-2.0 \item Date published: 3 April 2021 \end{itemize} \end{itemize} \begin{itemize} \item Name: shpc-registry \begin{itemize} \item Persistent Identifier: \newline \href{https://github.com/singularityhub/shpc-registry}{singularityhub/shpc-registry} \item License: MPL-2.0 \item Date published: 31 July 2022 \end{itemize} \end{itemize} \begin{itemize} \item Name: shpc-registry-cache \begin{itemize} \item Persistent Identifier: \newline \href{https://github.com/singularityhub/shpc-registry-cache}{singularityhub/shpc-registry-cache} \item License: MPL-2.0 \item Date published: 18 October 2022 \end{itemize} \end{itemize} \section*{Software location: Language} English. \section*{(3) Reuse potential} \label{sec:reuse} \setcounter{section}{0} The documentation pages \cite{shpc-docs} for Singularity Registry HPC have been updated to include a developer tutorial \cite{shpc-dev-tutorial} that guides through the steps to setup and deploy a registry of container modules based on automatic recipe generation and executable lookup. Separate automated workflows exist for cache generation \cite{container-discovery-cache-creation-action} and for using a cache to update a registry \cite{shpc-registry-cache, container-discovery-action}. In this way, container registries and infrastructures providers can reuse the software presented in this manuscript to automatically generate a registry for a custom collection of containers, which is of relevance for their operations and activities. Some parameters of the protocol can be modified to tune the resulting registry; for instance, this flexibility applies to the filtering of container tags/digest, and to the selection of container executable based on executable frequencies. Two package modules that constitute part of the presented toolkit, pipelib and guts, can be reused independently for purposes that go beyond the generation of container registries. The former offers functionalities to filter containers tags and digests, whereas the latter allows to extract information on available executables in a container. Finally, it is also worth mentioning the usability impact of the real use case presented as application for the presented software. The collection of 8,000 recipes to generate container modules for the whole collection of BioContainers represents a valuable, impactful resource for the community of life scientists, as well as that of infrastructure providers and support staff that offer services to the former. All packages are open source on GitHub, and contributions and ideas are welcome. \section*{(4) Conclusion} \label{sec:conclusion} \setcounter{section}{4} \subsection{Summary} In this work, we present complete automation to support and continually update a set of over 8,000 containers to install to an HPC system using the Singularity Registry HPC software. Our interesting contributions that we desire to share with the community include: \begin{itemize} \item{Singularity Registry HPC, with support for remote registries and automated updates \cite{shpc}} \item{A self-updating, version-controlled static container registry and API of container metadata \cite{shpc-registry}} \item{A self-updating, version-controlled database of executable frequencies \cite{shpc-registry-cache}} \item{The guts software to extract container executables on the ``PATH'' \cite{guts}} \item{The pipelib software to intelligently filter and sort container tags \cite{pipelib}} \item{A library of over 8,000 containers to install to an HPC system with Singularity Registry HPC \cite{shpc}} \end{itemize} This manuscript presents as a strong example of a research software paper, as the primary focus is on the development of workflows, interfaces, and software to support installing software to complex environments. We hope that any of the automation, data, or software presented is of use or interest to the larger community. \subsection{Discussion} The algorithm presented in this paper is a necessity caused by the lack of standard metadata for describing the content of a package or container. Ideally, there should be a machine-readable manifest that would list the primary content (installed by ``make install'' or equivalent), the dependencies, and the base image. This could be tackled first within the Conda \cite{conda} system. The Conda build system knows which binaries are installed by a given package and what its dependencies are. The listing could be exposed at the package level. Such metadata would take research software closer to the ``FAIR principles for research software'' \cite{fair4rs} (FAIR stands for Findable, Accessible, Interoperable, Reusable). All BioConda packages (and many from other channels) are automatically turned into Docker images by automation at BioContainers. The build could load those manifests into standard container labels that shpc could then use to derive the commands to expose. It is expected that some recipes created by the algorithm have too few or too many aliases. Being the official shpc registry openly hosted on GitHub, contributions are welcome in the form of pull requests to modify the list of aliases, and we invite the research community to report any error they find. This curation process will happen concurrently to the regular update of tags and digests. \section*{Contributions} Author VS designed and created the Singularity Registry HPC software, pipelib, and guts, and the automation detailed in this work. MM, AS, MDLP, and GS contributed to the codebase and design of the Singularity Registry HPC software and the automation. \section*{Acknowledgements} We are grateful to the larger HPC community for bug reports, feature requests, and helping to strengthen our community! As this resource has grown out of community need, the authors encourage interaction via issues or discussion on the respective repository, and requests for additions or features. MM is funded by the Wellcome Trust Grant 218328. AS and MDLP acknowledge support from the Australian BioCommons BYOD Expansion Project, which is funded through NCRIS investments from Bioplatforms Australia and the Australian Research Data Commons (https://doi.org/10.47486/PL105). \bibliographystyle{ieeetr}
\section{\label{I}INTRODUCTION} Magnetic skyrmions (MSk´s) are chiral spin textures with vortex configuration, the existence of which was predicted earlier \cite{Bog}, are of potential interest in the field of information storage, processing devices, and neuromorphic computing \cite{rev1,rev2,rev3,rev4}. As well known, such topologically protected structures result from Dzyaloshinskii–Moriya interaction (DMI) which causes noncollinear ordering of magnetic moments in media without an inversion center \cite{Dz,Mor}. An example of a medium with stable MSk´s, in which the inversion symmetry is broken by the interface, is a ferromagnet (FM)/heavy metal (HM) bilayer, where the HM provides the DMI in the system of FM magnetic moments \cite{DMI1,DMI2,DMI3,DMI4,DMI5}. This DMI removes the chiral degeneracy, thus mediating nonreciprocal spin-wave propagation \cite{DMISW1,DMISW2} and formation of chiral domain walls \cite{Bog,DMI2,DW}. It is also of interest that the chiral symmetry can be broken by magnetostatic interaction between the FM film and polarizable substrate (paramagnet (PM) \cite{MS1,MS2,MS3} or a superconductor (SC) \cite{MS2,MS3,MS4,MS5}). One consequence of this coupling is spin-wave nonreciprocity \cite{MS3,MSSW1,MSSW2,MSSW3,MSSW4,MSSW5,MSSW6,MSSW7,MSSW8} in FM/PM \cite{MS3,MSSW3,MSSW4,MSSW5,MSSW6,MSSW7,MSSW8} and FM/SC \cite{MS3,MSSW1,MSSW2} systems. Apart of these studies it was found that the magnetostatic interaction in similar systems contributes to the stabilization of chiral magnetic textures \cite{stab1,stab2,stab3,stab4}. It has also been shown that the SC has a significant effect on the MSk \cite{SC1,SC2,SC3,SC4,SC5,SC6,SC7}. The latter studies point out that MSk´s can be stabilized in an FM film on a polarized substrate due to magnetostatic interaction. In this paper, we theoretically study FM/PM and FM/SC hybrid systems, where the PM is an FM above $T_c$ and SC in FM/SC is considered in the London limit below $T_c$, where $T_c$ is the Curie temperature in PM or the critical temperature for the normal metal-SC phase transition. We show that the effective DMI in the systems under study arises as an additional term in the energy of the FM film, \begin{equation} F_\text{DMI}^\text{eff}\propto\int_{-\infty}^{+\infty} D_\text{eff}(q)(\mathbf{n}\times\mathbf{q})\cdot[\mathbf{M(-q)}\times\mathbf{M(q)}]\,d\mathbf{q} \label{eq:1}, \end{equation} where $D_\text{eff}$ is the effective DMI constant, whose sign depends on the type of substrate ($D_\text{eff}<0$ and $D_\text{eff}>0$ for PM and SC, respectively), $\mathbf{n}$ is normal to the interface (Fig.~\ref{fig:1}), $\mathbf{M(q)}$ is Fourier transform of the FM film magnetization $\mathbf{M}(\bm{\rho}=x,y)$, and $\mathbf{q}=(q_x,q_y,0)$ is two-dimensional wave vector. In a frame of our model, this effective DMI depends on the system temperature $T$ through the susceptibility in PM, $\chi(T)=C/(T-T_c)$, or the London penetration depth in SC, $\lambda(T)={\lambda_0/[(1-T/T_c)]^{1/2}}$, which are contained in $D_\text{eff}$. Here $C$ and $\lambda_0$ are the PM Curie constant and the SC London penetration depth at zero temperature, respectively. The contribution (\ref{eq:1}) results from magnetostatic interaction between the film and substrate. We find that only in the case of a PM substrate, the effective DMI leads to stabilization of the Néel-type chiral magnetic textures, such as a magnetic spiral (MSp) and MSk. The strong temperature sensitivity of $D_\text{eff}$ near $T_c$ allows for tuning the effective DMI and thus controlling the MSk radius, which can be useful for the applications. The article is organized as follows. In Section~\ref{II}, we describe the model used and derive an analytical expression for the magnetic energy of the systems under consideration. Section~\ref{III} presents conditions for stability of one-dimensional magnetic textures of the Néel-type, namely, a (1) domain wall and (2) MSp. In Section~\ref{IV}, we consider how the MSk can be stabilized. Section~\ref{V} contains a brief description of the obtained results. In Appendices~\ref{A} and \ref{B}, we calculate the magnetostatic energy in the systems under consideration and consider the case of MSp with the Bloch component. \begin{figure}[h!!] \includegraphics{fig_1 \caption{\label{fig:1} Schematic for a magnetic spiral (skyrmion) of the Néel-type (solid arrows) and its images (dashed arrows) in FM/PM (a, b) and FM/SC (c, d). The right ($\psi=0$, $\sigma=1$) (a, c) and left ($\psi=\pi$, $\sigma=-1$) (b, d) rotations of the solid arrows lead to the left and right rotations of the dashed ones, respectively.} \end{figure} \section{\label{II}FREE ENERGY OF THE FM/PM AND FM/SC SYSTEMS} As for the exact geometry of our system, we place the FM film is at $0<z<h$, while a PM or SC substrate is at $z<0$ (Fig.~\ref{fig:1}). It is assumed that $h\ll L_0$, where $L_0=(2A_\text{ex}/M_0^2)^{1/2}$ is the exchange length with $A_\text{ex}$ and $M_0$ being the exchange stiffness and saturation magnetization in the FM film. As a result, the dependence of $\mathbf{M}$ on $z$ can be neglected. The nonuniform magnetization $\mathbf{M}$ induces magnetization $\mathbf{m}(\bm{\rho},z)$ or a supercurrent $\mathbf{j}_s(\bm{\rho},z)$ in the PM and SC substrates, respectively, which produce stray fields in the FM region ($z>0$). In this Section, we consider the free energy of an FM film on PM (Subsection A) and SC (Subsection B) substrates. Obtained results are generalized in Subsection C --- with distinguishing the effective DMI term. \subsection{\label{IIA}FM/PM} The total free energy of the FM/PM system can be written as the sum of three contributions --- $F_0$, $F_-$, and $F_+$ --- to the total free energy of the system, which are free energies within the regions $0<z<h$, $z<0$, and $z>h$, respectively, i.e., \begin{subequations} \begin{equation} F=F_0+F_-+F_+ \label{eq:2a}, \end{equation} \begin{eqnarray} F_0&=&\int_{-\infty}^{+\infty}\int_{0}^{h}\left[\frac{L_0^2}{2}\sum_{\alpha=1}^2\left(\frac{\partial\mathbf{M}}{\partial x_\alpha}\right)^2-\frac{1}{2}K_aM_z^2 \right. \nonumber\\ & &\left.-\left(\mathbf{M}\cdot \mathbf{H}_\text{ext}\right)-\left(\mathbf{M}\cdot \mathbf{H}_0\right)-\frac{\mathbf{H}_0^2}{8\pi}\right]d\bm{\rho}\,dz \label{eq:2b}, \end{eqnarray} \begin{equation} F_-=\int_{-\infty}^{+\infty}\int_{-\infty}^{0}\left[\frac{1}{2\chi}\mathbf{m}^2-\left(\mathbf{m}\cdot\mathbf{H}_-\right)- \frac{\mathbf{H}_-^2}{8\pi}\right]d\bm{\rho}\,dz \label{eq:2c}, \end{equation} \begin{equation} F_+=-\int_{-\infty}^{+\infty}\int_{h}^{+\infty}\frac{\mathbf{H}_+^2}{8\pi}\,d\bm{\rho}\,dz \label{eq:2d}. \end{equation} \end{subequations} \noindent In Eq.~(\ref{eq:2b}), the first term is nonuniform exchange, the second term is the magnetic anisotropy with $K_a>4\pi$ being the magnetic anisotropy constant, the third term is the Zeeman energy in external magnetic field $\mathbf{H}_\text{ext}$, and the fourth term relates to the magnetostatic energy. The last terms in Eqs.~(\ref{eq:2b}), (\ref{eq:2c}), and Eq.~(\ref{eq:2d}) represent the energies of the magnetic (magnetostatic) fields $\mathbf{H}_0 (0<z<h)$, $\mathbf{H}_-(z<0)$, and $\mathbf{H}_+(z>h)$ jointly produced by magnetizations $\mathbf{M}$ and $\mathbf{m}$. We assume that $\mathbf{m}=\chi\mathbf{H}_-$, which is valid under the condition that the spatial scale of $\mathbf{M}$ inhomogeneity is much larger than the exchange length in PM. Otherwise, $\mathbf{m}$ is determined by convolution of $\mathbf{H}_-$ with the integral kernel \cite{MS3}. With taking into account the electromagnetic boundary conditions \cite{Landau} and that $\mathbf{m}=\chi\mathbf{H}_-$, the total free energy reads as \noindent \begin{eqnarray} F&=&\int_{-\infty}^{+\infty}\int_{0}^{h}\left[\frac{L_0^2}{2}\sum_{\alpha=1}^2\left(\frac{\partial\mathbf{M}}{\partial x_\alpha}\right)^2-\frac{1}{2}K_a M_z^2 \right. \nonumber\\ & &\left.-\left(\mathbf{M}\cdot \mathbf{H}_\text{ext}\right)-\frac{1}{2}\left(\mathbf{M}\cdot \mathbf{H}_0\right)\right]d\bm{\rho}\,dz \label{eq:3}. \end{eqnarray} It can be seen that $F_-$ and the energies of the magnetostatic fields cancel each other. \subsection{\label{IIB}FM/SC} As for the FM/SC system, we consider its free energy as a function of magnetic induction. Excluding such a modification, equations for the free energy of the FM/SC system are similar to those for the FM/PM one [Eqs.~(\ref{eq:2b})--(\ref{eq:2d})]: \begin{subequations} \begin{eqnarray} F_0&=&\int_{-\infty}^{+\infty}\int_{0}^{h}\left[\frac{L_0^2}{2}\sum_{\alpha=1}^2\left(\frac{\partial\mathbf{M}}{\partial x_\alpha}\right)^2-\frac{1}{2}K_aM_z^2 \right. \nonumber\\ & &\left.-\left(\mathbf{M}\cdot \mathbf{H}_\text{ext}\right)-\left(\mathbf{M}\cdot \mathbf{B}_0\right)+\frac{\mathbf{B}_0^2}{8\pi}\right]d\bm{\rho}\,dz \label{eq:4a}, \end{eqnarray} \begin{equation} F_-=\frac{1}{8\pi}\int_{-\infty}^{+\infty}\int_{-\infty}^{0}\left[\mathbf{B}_-^2+\lambda^2(\text{rot}\mathbf{B}_-)^2\right]d\bm{\rho}\,dz \label{eq:4b}, \end{equation} \begin{equation} F_+=\int_{-\infty}^{+\infty}\int_{h}^{+\infty}\frac{\mathbf{B}_+^2}{8\pi}\,d\bm{\rho}\,dz \label{eq:4c}. \end{equation} \end{subequations} \noindent The first and second terms in Eq.~(\ref{eq:4b}) are the energies of the magnetostatic field and the superconducting current, respectively. Similarly, the magnetostatic fields $\mathbf{B}_0 (0<z<h)$, $\mathbf{B}_-(z<0)$, and $\mathbf{B}_+(z>h)$ are generated jointly by magnetization $\mathbf{M}$ and supercurrent $\mathbf{j}_s$. We assume that $\mathbf{j}_s$ obeys the London equation, i.e., $\mathbf{j}_s=-c\mathbf{A}_-/(4\pi\lambda^2)$, where $\mathbf{B}_-=\text{rot}\mathbf{A}_-$. Using this equation along with the electromagnetic boundary conditions \cite{Landau}, we can reduce the free energy (\ref{eq:2a}) for the FM/SC system \begin{eqnarray} F&=&\int_{-\infty}^{+\infty}\int_{0}^{h}\left[\frac{L_0^2}{2}\sum_{\alpha=1}^2\left(\frac{\partial\mathbf{M}}{\partial x_\alpha}\right)^2-\frac{1}{2}K_a M_z^2 \right. \nonumber\\ & & \left.-\left(\mathbf{M}\cdot \mathbf{H}_\text{ext}\right)-\frac{1}{2}\left(\mathbf{M}\cdot \mathbf{B}_0\right)\right]d\bm{\rho}\,dz \label{eq:5}. \end{eqnarray} We see again that $F_-$ and the energies of the magnetostatic fields cancel each other. \subsection{\label{IIC}Magnetostatic energy and effective DMI} The last terms in Eqs.~(\ref{eq:3}) and (\ref{eq:5}) are the magnetostatic energy, $F_\text{MS}=F_\text{MS}^\text{intra}+F_\text{MS}^\text{inter}$, which consists of two contributions. One of them, $F_\text{MS}^\text{intra}$, is the interaction between magnetic moments inside the FM film (intralayer contribution), while another one, $F_\text{MS}^\text{inter}$, is the interaction between $\mathbf{M}$ and $\mathbf{m}$ or $\mathbf{j}_s$ (interlayer contribution). The terms above can be written as follows (see Appendix~\ref{A} for their derivation): \begin{subequations} \begin{eqnarray} F_\text{MS}^\text{intra(inter)}&=&\frac{S^2}{(2\pi)^2}\int_{-\infty}^{+\infty}D_{\alpha\beta}^\text{intra(inter)}(\mathbf{q}) \nonumber\\ & &\times M_\alpha(-\mathbf{q})M_\beta(\mathbf{q})\,d\mathbf{q} \label{eq:6a}, \end{eqnarray} \begin{eqnarray} D_{\alpha\beta}^\text{intra}(\mathbf{q})&=&\frac{2\pi}{q}\left\{\left[qh-\left(1-e^{-qh}\right)\right]\frac{q_\alpha q_\beta}{q^2} \right. \nonumber \\ & &+\left(1-e^{-qh}\right)\delta_{\alpha z}\delta_{\beta z} \biggl \} \label{eq:6b}, \end{eqnarray} \begin{eqnarray} D_{\alpha\beta}^\text{inter}(\mathbf{q})&=&qhD_\text{eff}(q)\left(\frac{q_\alpha q_\beta}{q^2}-\frac{iq_\alpha}{q}\delta_{\beta z}+ \right. \nonumber \\ & &\left.+\frac{iq_\beta}{q}\delta_{\alpha z}+\delta_{\alpha z}\delta_{\beta z}\right) \label{eq:6c}, \end{eqnarray} \end{subequations} \noindent where $S$ is the area of the system, $i$ is the imaginary unit, $\delta_{\alpha\beta}$ is the Kronecker symbol, and the effective DMI constant $D_\text{eff}$ has the form \begin{equation} D_\text{eff}(q)=-\frac{\pi\kappa(q)}{q^2h}\left(1-e^{-qh}\right)^2 \label{eq:7}, \end{equation} where $\kappa(q)$ is the parameter which describes the substrate properties and depends on $T$, \begin{equation} \kappa(q)=\left\{ \begin{array}{rcl} &\frac{2\pi\chi}{1+2\pi\chi}&\text{ for FM/PM,}\\ &-\frac{\sqrt{q^2\lambda^2+1}-q\lambda}{\sqrt{q^2\lambda^2+1}+q\lambda}&\text{ for FM/SC,}\\ \end{array} \right. \label{eq:8} \end{equation} which lies in the ranges of $[0,1]$ and $[-1,0]$ in FM/PM and FM/SC, respectively. Note that the sign of $\kappa$ (and hence the sign of $F_\text{MS}^\text{inter}$) depends on the substrate type and that $|\kappa|\rightarrow1$ if $T=T_c$ (FM/PM case, $\chi\rightarrow\infty$) and $T=0$ (FM/SC case, $\lambda=\lambda_0\rightarrow0$). As the form of $F_\text{MS}^\text{intra}$ is similar to that of $F_\text{MS}^\text{inter}$, one can introduce the tensor $D_{\alpha\beta}=D_{\alpha\beta}^\text{intra}+D_{\alpha\beta}^\text{inter}$, which describes the total magnetostatic energy $F_\text{MS}$. This tensor can be represented as the sum of two terms, i.e., $D_{\alpha\beta}=D_{\alpha\beta}^s+D_{\alpha\beta}^a$, where $D_{\alpha\beta}^s=D_{\beta\alpha}^s$ is a symmetric tensor and $D_{\alpha\beta}^a=-D_{\beta\alpha}^a$ is an antisymmetric tensor whose components are nonzero only in the presence of a substrate. The $D_{\alpha\beta}^a$ tensor can be represented as $D_{\alpha\beta}^a=ihD_\text{eff}(q)\varepsilon_{\alpha\beta\gamma}{(\mathbf{n}\times\mathbf{q})}_\gamma$, where $\varepsilon_{\alpha\beta\gamma}$ is the Levi-Civita tensor. Substituting $D_{\alpha\beta}^a$ into Eq.~(\ref{eq:6a}), we obtain the expression for the effective DMI energy (\ref{eq:1}), where the coefficient of proportionality is $ihS^2/(2\pi)^2$. The interfacial DMI energy arising in the FM/HM system can also be reduced to the form given by Eq.~(\ref{eq:1}) after replacing $D_\text{eff}$ with a DMI constant independent of $q$. If the spatial scale of $\mathbf{M}(\bm{\rho})$ is much larger than the film thickness $h$, one can assume that $qh\ll1$. So, expanding $D_{\alpha\beta}$ into a series up to terms linear in $qh$, one obtains that \begin{eqnarray} D_{\alpha\beta}&\approx&\pi h\left\{qh\left[1-\kappa(q)\right]\frac{q_\alpha q_\beta}{q^2}+2\left[1-\frac{1}{2}\kappa(q)qh\right]\delta_{\alpha z}\delta_{\beta z} \right. \nonumber \\ & &\left.+\kappa(q)qh\left(\frac{iq_\alpha}{q}\delta_{\beta z}-\frac{iq_\beta}{q}\delta_{\alpha z}\right)\right\} \label{eq:9}. \end{eqnarray} If $1-\kappa\ll1$ (FM/PM case, $T\sim T_c$) one can neglect the first term in Eq.~(\ref{eq:9}). One can also neglect $\kappa qh/2$ due to $qh\ll1$ in the second term of Eq.~(\ref{eq:9}) \footnote{In fact, it is incorrect to neglect the term linear in $qh$. However, next we will make sure that neglecting this term will not lead to significant mistakes.}. As a result, the total free energy (\ref{eq:3}) can be rewritten as \begin{eqnarray} F&=&h\int_{-\infty}^{+\infty}\left[\frac{L_0^2}{2}\sum_{\alpha=1}^{2}{\left(\frac{\partial\mathbf{M}}{\partial x_\alpha}\right)^2-\frac{1}{2}}K_a^\text{eff}M_z^2 \right. \nonumber \\ & &\left. -\left(\mathbf{M}\cdot\mathbf{H}_\text{ext}\right)+f_\text{DMI}^\text{eff}\right]\,d\bm{\rho} \label{eq:10}, \end{eqnarray} where $K_a^\text{eff}=K_a-4\pi$, and \begin{eqnarray} f_\text{DMI}^\text{eff}&=&-\pi\kappa h\left(M_z\frac{\partial M_x}{\partial x}-M_x\frac{\partial M_z}{\partial x}\right.\nonumber \\ & &\left. +M_z\frac{\partial M_y}{\partial y}-M_y\frac{\partial M_z}{\partial y}\right) \label{eq:11}. \end{eqnarray} It can be seen that, in this approximation, taking into account the magnetostatic energy leads to renormalization of the anisotropy constant and the appearance of the term $f_\text{DMI}^\text{eff}$, which has the conventional form for the DMI contribution \cite{Bog}. This energy can be evaluated as $\pi\kappa hM_0^2\sim1\text{ erg/cm}^2$ at $\pi h\sim10\text{ nm}$, $M_0\sim10^3\text{ erg/(Gs}\cdot\text{cm}^3)$, which is comparable to the DMI energy in the FM/HM system \cite{DMISW2}. \section{\label{III}ONE-DIMENSIONAL CASE} When FM magnetization $\mathbf{M}$ depends on a one coordinate ($x$) only, it can be represented as \begin{eqnarray} \mathbf{M}(x)&=&M_0\left[\text{sin}\Theta(x)\,\text{cos}\psi\,{\hat{\mathbf{e}}}_x+\text{sin}\Theta(x)\,\text{sin}\psi\,{\hat{\mathbf{e}}}_y \nonumber \right. \\ & &\left. +\text{cos}\Theta(x)\,{\hat{\mathbf{e}}}_z\right] \label{eq:12}, \end{eqnarray} where ${\hat{\mathbf{e}}}_i$ is the $i$-th unit vector of the Cartesian coordinate system, $\psi$ is the constant, and $\Theta(x)$ is a function of $x$. At $\psi=\pm\pi/2$ and $\psi=0$ or $\pi$, configuration of $\mathbf{M}$ is of the Bloch- and Néel-type, respectively. We study the stabilization problem of both localized (domain wall) and delocalized (MSp) magnetic textures. Although calculations of the MSp energy in an FM film on PM and SC substrates were already reported \cite{MS1,MS5}, stabilizing such a texture has not been discussed so far. Moreover, the case of the PM substrate is considered only in the linear approximation in $\chi$. \subsection{\label{IIIA}Domain wall} If the boundary conditions are $\Theta(-\infty)=0$ and $\Theta(\infty)=\pi$, then Eq.~(\ref{eq:12}) describes the Néel- ($\psi=0$, $\pi$) or Bloch-type ($\psi=\pm\pi/2$) domain wall. We restrict ourselves to considering the case of a PM substrate only. After substituting Eq.~(\ref{eq:12}) into Eqs.~(\ref{eq:10}), (\ref{eq:11}) and varying it with respect to $\Theta$, one obtains at $H_\text{ext}=0$ that \cite{DMI2} \begin{equation} \frac{d^2\Theta}{dx^2}-\frac{K_a^\text{eff}}{L_0^2}\,\text{sin}\Theta\,\text{cos}\Theta=0 \label{eq:13}, \end{equation} whose solution for the these boundary conditions is $\Theta(x)=\pi-\text{arccos}{\left(\text{tanh}\sqrt{K_a^\text{eff}}x/L_0\right)}$. For the free energy of a film with domain wall, we have that \begin{equation} \Delta F=F-F_0\propto2\eta\sqrt{K_a^\text{eff}}-\pi^2\kappa\,\text{cos}\psi \label{eq:14}, \end{equation} where $\eta=L_0/h$, and $F_0$ is the energy of a film uniformly magnetized along the normal, i.e., $F_0=-K_a^\text{eff}M_0^2hS/2$. The obtained magnetic state exists if $\kappa$ is small enough not to perturb too much the system ($\Delta F>0$) \cite{DMI2,Bog2,Bog3}. This condition can be rewritten as $\kappa<\kappa_c^\text{DW}$ and $\psi=0$, where $\kappa_c^\text{DW}=2\eta\sqrt{K_a^\text{eff}}/\pi^2$. For a certain set of parameters, there is the interval of $\kappa$ in which ${\Delta F>0}$. For example, $\kappa_c^\text{DW}\approx0.7$ ($\chi\approx0.4$) at $\eta\sim3$ and $K_a/(4\pi)\sim1.1$. \subsection{\label{IIIB}MSp} Under the condition that $\Theta(x)=kx$, Eq.~(\ref{eq:12}) describes the MSp (Fig.~\ref{fig:1}). Such a trial function $\Theta(x)$ allows for calculation of the exact magnetostatic energy (\ref{eq:6a}). Having calculated $\mathbf{M}(\mathbf{q})$, one obtains the free energy, $\Delta F(k,\sigma)=F(k,\sigma)-F_0$, at $H_\text{ext}=0$ and $\psi=0$, $\pi$, i.e., \begin{eqnarray} \Delta F(k,\sigma)&=&\frac{1}{2}M_0^2hS\left[L_0^2k^2+\frac{1}{2}K_a^\text{eff} \right. \nonumber \\ & &\left. -\frac{\pi\kappa(k)}{kh}(1-e^{-kh})^2(1+\sigma)^2\right] \label{eq:15}, \end{eqnarray} if $k\neq0$ and $\Delta F(k,\sigma)=0$ if $k=0$. Here $\sigma=1$ ($-1$) corresponds to $\psi=0$ ($\pi$); see Appendix B for arbitrary $\psi$. Equation~(\ref{eq:15}) is consistent with results of the calculations performed in Refs.~\cite{MS1,MS5} and shows that the PM (SC) substrate decreases (increases) the energy of the system. The last statement is valid in the case of an arbitrary distribution of $\mathbf{M}$ (see Appendix~\ref{A}). From Eq.~(\ref{eq:15}) we can also see that only the interlayer magnetostatic energy, which is proportional to $\kappa$, depends on the direction of MSp rotation. In the case of FM/PM(SC), the rotation corresponding to $\sigma=1$ ($-1$) is energetically favorable, which is a result of removing the chiral degeneracy of the system. All these features can be understood using the method of images \cite{Landau} (Fig.~\ref{fig:1}). In Fig.~\ref{fig:1} the solid and dashed arrows show, respectively, the magnetic moments and their images for the cases of PM ($\kappa=1$) and SC ($\kappa=-1$) substrates. The boundary condition is vanishing of the tangential [for FM/PM, (Fig.~\ref{fig:1}a,b)] and normal [FM/SC, (Fig.~\ref{fig:1}c,d)] components of the magnetostatic field, which determine the mutual orientation of the magnetic moments and their images. The difference between the free energy in the cases of $\sigma=1$ (Fig.~\ref{fig:1}a,c) and $\sigma=-1$ (Fig.~\ref{fig:1}b,d) results from different configurations of the arrows. Assuming that the period of the MSp is much larger than the film thickness $h$, i.e., $kh\ll1$, we can obtain expressions for the equilibrium $k^\ast$ and corresponding minimum of the free energy at $\sigma=1$, \begin{equation} k^\ast h\approx\frac{2\pi\kappa}{\eta^2},\ \Delta F(k^\ast,1)=\frac{1}{4}M_0^2hS\left(K_a^\text{eff}-\frac{8\pi^2\kappa^2}{\eta^2}\right) \label{eq:16}, \end{equation} where it was taken into account that $\eta\gg1$. Equation~(\ref{eq:16}) are valid under the condition that $\kappa>1/2$, which can only be satisfied for the FM/PM system and provides the stability of the state with respect to deviation of $\psi$ from zero (see Appendix B). From the condition that $\Delta F(k^\ast,1)=0$, one can determine the critical $\kappa$, i.e., $\kappa_c^\text{MSp}\approx\eta\sqrt{K_a^\text{eff}}/(2\sqrt2\pi)$. For $\kappa>\kappa_c^\text{MSp}$ the formation of MSp is energetically favorable. Since $\kappa\le1$, it is necessary to require the fulfillment of the relation $\kappa_c^\text{MSp}<1$. As a result, $\kappa_c^\text{MSp}\approx0.6$ ($\chi\approx0.2$) at $\eta\sim5$ and $K_a/(4\pi)\sim1.1$. As for the FM/SC, the case of $\sigma=-1$ corresponds to $k^\ast=0$ [see Eq.~(\ref{eq:15})]. Thus, only the PM substrate stabilizes the Néel-type MSp with $\sigma=1$. \section{\label{IV}MS\lowercase{k} STABILIZATION} Now we consider the magnetization distribution with cylindrical symmetry (MSk) in the FM/PM case. As for the SC substrate, it increases the system energy, and so, MSk cannot be energetically favorable (see Appendix~A). The existence of a metastable MSk in the FM/SC is beyond the scope of this paper and requires additional research. We represent $\mathbf{M}$ as \begin{equation} \mathbf{M}(\rho)=M_0\left[\text{sin}\Theta(\rho)\,\hat{\mathbf{e}}_\rho+\text{cos}\Theta(\rho)\,\hat{\mathbf{e}}_z\right] \label{eq:17}, \end{equation} where $\hat{\mathbf{e}}_\rho=\bm{\rho}/\rho$. Equation~(\ref{eq:17}) corresponds to the configuration shown in Fig.~\ref{fig:1}a. Let the external magnetic field $\mathbf{H}_\text{ext}$ be directed against the $z$-axis, so that $\Theta(0)=0$ and $\Theta(\infty)=\pi$. As a trial function, we take the simplest linear ansatz~\cite{Bog}, \begin{equation} \Theta(\rho)=\frac{\pi\rho}{R}\theta(R-\rho)+\pi\theta(\rho-R) \label{eq:18}, \end{equation} where $R$ is the MSk radius and $\theta(t)$ is the Heaviside step function. Taking into account Eqs.~(\ref{eq:17}) and (\ref{eq:18}), the approximate free energy~(\ref{eq:10}), $\Delta F(\xi)=F(\xi)-F_0$, takes the form \begin{eqnarray} \Delta F(\xi)&=&\pi M_0^2h^3\left\{6.15\,\eta^2+\frac{1}{16}\left[K_a^\text{eff} \right. \right. \nonumber \\ & &\left. \left.+4\left(1-\frac{4}{\pi^2}\right)\frac{H_\text{ext}}{M_0}\right]\xi^2-\frac{\pi^2\kappa}{2}\xi\right\} \label{eq:19}, \end{eqnarray} where $\xi=2R/h$, $F_0=-M_0^2hS(K_a^\text{eff}/2+H_\text{ext}/M_0)$. The minimum of $\Delta F(\xi)$ is provided by the competition between the anisotropy energy with $K_a^\text{eff}$ and the effective DMI energy. Note that for trial function~(\ref{eq:18}) the exchange energy does not depend on $\xi$. As a result of free energy minimization, we obtain the equilibrium parameter $\xi^\ast$ and the corresponding energy $\Delta F(\xi^\ast)$ in the form \begin{subequations} \begin{equation} \xi^\ast=\frac{16\pi^2\kappa}{K_a^\text{eff}+4\left(1-4/\pi^2\right)H_\text{ext}/M_0} \label{eq:20a}, \end{equation} \begin{eqnarray} \Delta F(\xi^\ast)&=&\pi M_0^2h^3\left[6.15\,\eta^2- \right. \nonumber \\ & & \left. \frac{16\pi^4\kappa^2}{K_a^\text{eff}+4\left(1-4/\pi^2\right)H_\text{ext}/M_0}\right] \label{eq:20b}. \end{eqnarray} \end{subequations} The obtained magnetic state is energetically favorable fore $\kappa>\kappa_c^\text{MSk}$, where $\kappa_c^\text{MSk}\approx0.06\,\eta\left(K_a^\text{eff}+2.4\,H_\text{ext}/M_0\right)^{1/2}$. So, $\kappa_c^\text{MSk}\approx0.3$ ($\chi\approx0.07$) at $\eta\sim5$, $K_a/(4\pi)\sim1.1$ and $H_\text{ext}=0$. We also present numerical calculations based on the exact magnetostatic energy $F_\text{MS}$. Then $F_\text{MS}^\text{intra}$ and $F_\text{MS}^\text{inter}$ are described by Eqs.~(\ref{eq:A18}) and (\ref{eq:A19}), where \begin{subequations} \begin{equation} M_z(\mathbf{q})=\Delta M_z(q)-\frac{(2\pi)^2}{S}M_0\,\delta(\textbf{q}) \label{eq:21a}, \end{equation} \begin{equation} \Delta M_z(q)=\frac{2\pi M_0}{S}\int_{0}^{\infty}\rho\left[\text{cos}\Theta(\rho)+1\right]J_0(q\rho)\,d\rho \label{eq:21b}, \end{equation} \begin{eqnarray} \text{div}\textbf{M}(q)&=&\frac{2\pi M_0\sigma}{S}\int_{0}^{\infty}\left[\rho\frac{d\Theta(\rho)}{d\rho}\text{cos}\Theta(\rho) \right. \nonumber \\ & & \left. +\text{sin}\Theta(\rho)\right]J_0(q\rho)\,d\rho \label{eq:21c}. \end{eqnarray} \end{subequations} Here $\text{div}\mathbf{M}(\mathbf{q})=\text{div}\mathbf{M}(q)$ is the Fourier transform of $\text{div}\mathbf{M}(\bm{\rho})$; $\delta(\mathbf{q})$ and $J_n(t)$ are the Dirac delta function and cylindrical Bessel function of order $n$. Figure~2 shows the parameter $\xi^\ast$ versus $\kappa$ for various $K_a$ (Fig.~\ref{fig:2}a) and $H_\text{ext}$ (Fig.~\ref{fig:2}b). In Fig.~\ref{fig:2}a,b the solid lines correspond to approximate Eq.~(\ref{eq:20a}), while the dots correspond to numerical calculations based on exact Eqs.~(\ref{eq:A18})--(\ref{eq:A19}), (\ref{eq:21a})--(\ref{eq:21c}). It can be seen that the Eq.~(\ref{eq:20a}) agrees with the exact calculation. The difference in the results seems to be due to the neglect of $\kappa qh/2$ in the second term of Eq.~(\ref{eq:9}). Nevertheless, the obtained approximate results are quite suitable for our evaluations. \begin{figure}[h!!] \includegraphics{fig_2 \caption{\label{fig:2}Equilibrium parameter $\xi^\ast$ vs. $\kappa$ in FM/PM for different (a) $K_a$ and (b) $H_\text{ext}$. The solid lines show the calculations using the approximate Eq.~(\ref{eq:20a}), the dots show the numerical calculations based on the exact Eqs. (\ref{eq:A18})--(\ref{eq:A19}), (\ref{eq:21a})--(\ref{eq:21c}).} \end{figure} Thus, MSk can be energetically favorable in FM/PM, which is in contrast to that in the FM/SC. \section{\label{V}SUMMARY} In conclusion, we have shown that the effective DMI term having a purely magnetostatic origin contributes to the free energy of the FM/PM and FM/SC hybrid systems. The value of this term can be evaluated as $\pi\kappa hM_0^2\sim1\text{ erg/cm}^2$ at $\pi h\sim10$ nm, $M_0\sim10^3 \text{erg}/(\text{Gs}\cdot\text{cm}^3)$, which is comparable to the conventional DMI energy in the FM/HM system. We have shown that the sign of the effective DMI constant is different for PM and SC substrates, i.e., $D_\text{eff}<0$ ($D_\text{eff}>0$) for FM/PM(SC). The value of $D_\text{eff}$ strongly depends on the system temperature near $T_c$, which allows for tuning the interaction between the film and substrate. Note that $D_\text{eff}$ can be measured experimentally by Brillouin spectroscopy \cite{DMISW2}. We have also shown that the effective DMI leads to stabilizing chiral magnetic textures (including MSk) only in the case of a PM substrate. This feature is explicable by decreasing the free energy of FM film in the FM/PM system owing to the effect of PM substrate, while it only increases in the FM/SC system. The difference between FM/PM and FM/SC systems is related to the difference in the formation of image dipoles in the PM and SC substrates (Fig.~\ref{fig:1}). To stabilize the MSk at $H_\text{ext}=0$, the condition that $\kappa>0.3$ ($\chi>0.07$) at $\eta\sim5$ and $K_a/(4\pi)\sim1.1$ should be fullfilled. If, for example, gadolinium ($C\approx0.4$ K, $T_c\approx294$ K \cite{Gd}) is taken as PM in the FM/PM system, the condition above will be effective in the temperature range $T-T_c<6$ K. \begin{acknowledgments} We acknowledge very useful discussions with M.V.~Sapozhnikov, A.S.~Mel’nikov, and I.S.~Burmistrov. The work was supported by the State Contract No.~0030-2021-0021 and Russian Foundation for Basic Research (Grant No.~20-02-00356). One of us (M.A.~K.) thanks to the Foundation for the Advancement of Theoretical Physics and Mathematics “BASIS”. \end{acknowledgments}
\section{Introduction} From flow through porous media \citep{Lee2020} to passive microfluidics \citep{Stone2009}, interaction of two-phase viscous flows with soft deformable components (low-Re FSI) is a staple of many natural and industrial settings. For example, in the pulmonary airway tree under pathological conditions, air entering the compliant lungs encounters plugs of mucus that occlude its passageways \citep{Heil2015}. Other types of low-Re FSI have recently been exploited for technological progress, for example, in improving the manufacturing quality of products \citep{Chong2007}, personalising diagnostic tools \citep{Lin2020} and developing soft robotics \citep{Jones2021}. Fundamental understanding of such complex flows can be gained by studying much simpler model problems. In this paper, we study gas--liquid displacement in a soft Hele-Shaw cell. Its rigid counterpart, which consists of a narrow gap between two parallel plates, is a classical model system for studying fluid--fluid displacement. At low flow rates, the interface between the two fluids is always circular (i.e. stable). However, if a less viscous fluid (e.g.~an air bubble) displaces a more viscous fluid (e.g.~glycerol) at a sufficiently high rate, the interface becomes unstable and develops distinct fingers that subsequently compete, split, and branch, forming a complex interfacial pattern \citep{Saffman58}. This fingering instability can be suppressed to higher flow rates if one of the walls of the Hele-Shaw cell is replaced by a thin, unconfined elastic membrane, which allows the injected volume to be accommodated in large part by inflation rather than viscous displacement \citep{PihlerPuzovic12, Juel18}. Interestingly, the deformation of the flow cell remains roughly axisymmetric and independent of the morphology of the displacement front~\citep{PihlerPuzovic2018}, unless the elastic membrane is very compliant \citep{PihlerPuzovic2014}. \begin{figure} \includegraphics[width=\linewidth]{fig_setup.pdf} \caption{Schematic of radially outward gas--liquid displacement in a Hele-Shaw cell bounded by a confined elastic solid. \label{fig:setup}} \end{figure} The soft Hele-Shaw cells considered here contain a volumetrically confined slab of elastomer, as shown schematically in \figref{fig:setup}. Fluid--structure interaction (FSI) between a viscous pressure gradient and the confined elastomer in such cells leads to the accumulation of soft material near the cell rim, which constricts the gap \citep{Box2020, Peng2022}. The elastomer can even make contact with the opposite rigid wall and choke the flow entirely, as in \figref{fig:exp}. In the absence of a gas-liquid interface, choking occurs systematically above a critical injection flow rate \citep{Box2020}. However, injection of gas into the soft cell brings a number of key differences. Firstly, gas is compressible, so the rate of change of gas volume in the cell varies in time. Secondly, its viscosity is negligible, so the region over which the viscous pressure gradient acts reduces over time as the liquid gets displaced. Capillarity is also important at the interface between two fluids, and, as discussed above, the interface is prone to viscous fingering, though choking has been observed even when the interface remained approximately axisymmetric throughout the experiment~\figrefp{fig:exp}. The role of viscous fingering onto choking has been studied recently in gas--liquid displacement experiments by~\citet{Peng2022}. Unlike in the inflatable Hele-Shaw cells, non-axisymmetry of the fingered interface in the soft cell studied here directly affects the deformation of the confined soft wall, which results in a complex choking threshold. We depart from the previous study of \citet{Peng2022}, and focus instead on the role of gas compressibility and viscous pressure gradients on choking in an axisymmetric geometry by exploring a mathematical model of an axisymmetric two-phase lubrication flow under a confined elastic slab. Thus, we decouple the influence of the two-phase displacement from that of the viscous fingering in experiments by \citet{Peng2022}. In existing literature, gas compression is often neglected or carefully avoided, e.g.~by extracting liquids rather than injecting gas \citep{Park1984}. However, compressibility effects are unavoidable in many practical settings, e.g. during the gas-driven displacement of granular suspensions \citep{Sandnes11}, during gas invasion into liquid-saturated porous media \citep{Lee19}, during foam-driven hydraulic fracturing \citep{Lai2018}, or in soft microfluidics carrying a viscous flow with a small amount of air trapped in the system \citep{Guyard2022}. Few studies have addressed the role of gas compressibility in the dynamics of a gas-liquid displacement flow, but it is known to be strongly coupled to viscous displacement in, e.g., frictional flows \citep{Sandnes11}, capillary tubes \citep{Cuttle2021} and rigid Hele-Shaw cells \citep{Cuttle2022}. Here we go a step further and additionally consider the coupling of gas compression with both liquid displacement and elastic deformation of the flow cell. \begin{figure} \includegraphics[width=\linewidth]{figure_exp.png} \caption{Top view images from preliminary experiments with an approximately circular interface at various times $t$ from the start of the experiment. The injected gas bubble displaces glycerol (dyed blue) in the narrow gap of a soft Hele-Shaw cell. Flow-induced deformation of the elastomer eventually leads to contact between the soft slab and the glass plate in the vicinity of the cell rim (visible as a white band encircling the cell), trapping the interface within the cell. The experimental parameters are: cell radius $R_{\subtext{out}} = 60$~mm and initial gap $b_0 = 2$~mm; elastomer thickness $d = 15$~mm, shear modulus $G = 1.36$~kPa and Poisson's ratio $\nu = 0.495$; liquid viscosity $\mu=0.72$~Pa.s and surface tension $\gamma = 63$~mN/m, imposed flow rate $Q_0= 450$~ml/min.\label{fig:exp}} \end{figure} This paper is laid out as follows. We present the axisymmetric governing equations and non-dimensionalisation in \secref{sec:model}, followed by a description of the gas--liquid displacement flow at low injection rates in \secref{sec:num}. For higher flow rates, we study the impact of gas--liquid displacement on choking in \secref{sec:choke}, by relating the deformation of the elastomer to the proximity of the bubble to the cell rim (\secref{sec:proximity}) and identifying a near-choking regime when the compressibility of the gas is significant (\secref{sec:nearchoke}). We investigate the dynamics of the advancing bubble front in \secref{sec:tw}. We summarise and discuss the results in \secref{sec:summ}. \section{Theoretical model \label{sec:model}} \subsection{Governing equations \label{subsec:gov}} The setup is shown in \figref{fig:setup}. We consider a Hele-Shaw cell of initial (relaxed) gap thickness $b_0$, bounded by a rigid wall below and by an elastic slab above. The elastic slab is a cylinder of radius $R_{\subtext{out}}$, thickness $d \lesssim R_{\subtext{out}}$, and shear modulus $G$ that is confined both around the outer rim and from above within a rigid mould. The cell is initially filled with liquid of viscosity $\mu$. A gas bubble is injected at the nominal volumetric flow rate $Q_0$ at the centre of the cell, displacing the liquid and also deforming the elastomer. We neglect inertia and gravity, as well as the compressibility of the solid and of the liquid. We employ cylindrical polar coordinates $(r,\theta,z)$ with the surface of the undeformed elastic solid located at $z=0$, and the centre of the cell at $r=0$. We assume axisymmetry, as discussed above, so that there is no explicit dependence on the azimuthal angle $\theta$. One key assumption in our analysis is that the initial cell gap $b_0$ and the vertical deformation $w$ are small compared with the initial slab thickness $d$, i.e.\ that $b_0,w \ll d$. As a result, the gap thickness can change significantly from its initial value, while the strains in the elastic solid remain small, allowing us to adopt linear elasticity. For a deformation characterised by displacement $\v{u}^s$, stress tensor $\vv\sigma^s$ and pressure $p^s = -(\mathop{\mathrm{Tr}} \vv\sigma^s)/3$, the equations for linear elasticity, incompressibility and mechanical equilibrium in the solid take the form \begin{subequations}\label{eq:elastic} \begin{gather} \vv\sigma^s = -p^s\vv{I} + G(\boldsymbol{\nabla} \v{u}^s + (\boldsymbol{\nabla}\v{u}^s)^\transpose), \qquad \div \v{u}^s = 0, \\ \v{0} = \div\vv\sigma^s = -\boldsymbol{\nabla} p^s + G\nabla^2 \v{u}^s, \end{gather} \end{subequations} in the solid domain $0 \leq r \leq R_{\subtext{out}}$, $0 \leq z \leq d$. Here, $\mathop{\mathrm{Tr}}$ denotes the trace, $\boldsymbol{\nabla} = \v{e}_r \partial_r + \v{e}_\theta (1/r) \partial_\theta + \v{e}_z \partial_z$ is the gradient operator with $\v{e}_r$, $\v{e}_\theta$ and $\v{e}_z$ the coordinate unit vectors, $\vv{I}$ is the identity tensor, and superscript $\transpose$ denotes transpose. We impose that the solid is adhered to the mould and that there is no singularity at the centre, \begin{equation} \v{u}^s = \v{0} \text{ at } r = R_{\subtext{out}} \text{ and at } z = d, \qquad u_r^s = \partial_r u_z^s = 0 \text{ at } r = 0. \end{equation} The solid is coupled to the flow in the gap via the vertical displacement $w(r,t)$ of the surface and the gauge pressure $p(r,t)$ on the surface (measured relative to atmospheric pressure), while the viscous shear stress from the flow on the surface can be neglected due to the assumption that $b_0,w \ll d$, \begin{equation} u_z^s|_{z=0} = w, \qquad \sigma_{zz}^s|_{z=0} = -p, \qquad \sigma_{rz}^s|_{z=0} = 0. \end{equation} The local gap $b(r,t)$ is related to the vertical deformation $w(r,t)$ of the solid surface by \begin{equation} b(r,t) = b_0+w(r,t). \end{equation} For the flow, we split the domain into two parts. In the bubble region $r < R(t)$, the pressure is spatially uniform: \begin{equation}\label{eq:bub} p(r,t) = p_b(t) \quad \text{ in } r < R(t). \end{equation} In the liquid region $r > R(t)$, we adopt the standard Hele-Shaw assumption that the pressure is vertically uniform and equal to $p(r,t)$ to leading order in $b_0/R_{\subtext{out}}$, satisfying the lubrication equation \begin{equation}\label{eq:lub} \dot b = \boldsymbol{\nabla}_H \bcdot \left(\frac{b^3}{12\mu} \boldsymbol{\nabla}_H p\right) \quad \text{ in } r > R(t). \end{equation} Here, the over-dot is the partial derivative with respect to time and $\boldsymbol{\nabla}_H = \v{e}_r \partial_r + \v{e}_\theta (1/r)\partial_\theta$ is the horizontal gradient operator. (Note that we neglect any horizontal velocity from the solid onto the fluid, due to $b_0 \ll d$). We do not model the advancing gas--liquid interface at the displacement front $r = R(t)$ in detail. Instead, following \citet{Peng2015}, we employ approximate kinematic and dynamic boundary conditions appropriate for a growing bubble in a Hele-Shaw cell with rigid and parallel walls, \begin{subequations} \begin{equation}\label{eq:front} (1 - f_1)\dot R = -\frac{b^2}{12\mu}\frac{\partial p}{\partial r}, \qquad p - p_b = -\frac{2\gamma}{b}(1 + f_2) - \frac{\pi}{4} \frac{\gamma}{R} \qquad \text{ at } r = R^+. \end{equation} These conditions depend on the instantaneous capillary number $Ca = \mu \dot{R}/\gamma$ via two fitting functions, \begin{equation} f_1(Ca)=\frac{Ca^{2/3}}{0.76+2.16\,Ca^{2/3}}, \qquad f_2(Ca)=\frac{Ca^{2/3}}{0.26+1.48\,Ca^{2/3}}+1.59\,Ca, \end{equation} \end{subequations} which, respectively, describe the thickness of the residual liquid films on the cell walls behind the front and the additional pressure drop due to viscous resistance near the front. Initially, the cell is undeformed and contains a small bubble of radius $R_{\subtext{init}}$ (which we take to be $R_{\subtext{init}} = d/2$ unless otherwise specified), \begin{equation} w|_{t=0} = 0, \qquad R|_{t=0} = R_{\subtext{init}}. \end{equation} At the cell outlet $r = R_{\subtext{out}}$, we impose atmospheric pressure (i.e.~zero gauge pressure) and let $Q(t)$ denote the flow rate of liquid leaving the cell, \begin{equation}\label{eq:injection} p|_{r=R_{\subtext{out}}} = 0, \qquad Q(t) = -2\piR_{\subtext{out}} \left.\frac{b^3}{12\mu}\frac{\partial p}{\partial r}\right|_{r = R_{\subtext{out}}}. \end{equation} Here, we have neglected the contribution to the viscous pressure drop from the thickness $\ell_{\subtext{rim}}$ of the rim of the mould: Past the edge of the elastic solid, the rim creates a region of constant cell gap $b = b_0$, which could be accounted for by solving the lubrication equation \eqref{eq:lub} with the given flow rate $Q(t)$, resulting in the alternative pressure condition $p = (Q/2\pi)\ln (1 + \ell_{\subtext{rim}}/R_{\subtext{out}})$ at $r = R_{\subtext{out}}$, but we neglect this effect as $\ell_{\subtext{rim}}/R_{\subtext{out}}\ll1$, and use \eqreft{eq:injection} instead. \subsection{Gas injection models} Due to incompressibility of the liquid and solid, the outlet flow rate $Q(t)$ is also the rate of change of gas volume in the cell. We assume in all cases that gas is injected at a constant nominal flow rate $Q_0$. If the compression of the gas is negligible, we simply have \begin{equation}\label{eq:flowrate_incomp} Q(t) = Q_0. \end{equation} However, the elevated pressure $p_b(t)$ in the bubble compresses the gas, which may lead to a significant deviation between $Q(t)$ and $Q_0$. We assume that the heat generated by compression is rapidly lost to the environment, so that the gas can be approximated as isothermal. If the mass of gas in the system has volume $V_u(t)$ under atmospheric pressure $p_a$, then, after compression to an absolute pressure $p_a + p_b(t)$ its volume is $V_b = V_u/(1 + p_b/p_a)$. The compression of the injected gas proceeds differently depending on the method of its injection, and we consider two different methods that have been used in experiments \citep{Peng2022}. For injection using a syringe pump at a nominal rate $Q_0$, the pump chamber, tubing and bubble together form a sealed mass of gas with original volume $V_u = V_{\subtext{init}}$, so the flow rate is \begin{subequations}\label{eq:flowrate_comp} \begin{equation}\label{eq:flowrate_syringe} Q(t) = Q_0 + \dot V_b = Q_0 + \frac{\mathrm{d}}{\mathrm{d}t}\left[\frac{V_{\subtext{init}}}{(1 + p_b(t)/p_a)}\right] \qquad \text{(syringe pump)}. \end{equation} For injection from a pressurized gas bottle with pressure $\gg p_a$ via a needle resistor tuned to result in a fixed volume flow rate $Q_0$ of atmospheric-pressure gas downstream, the total uncompressed volume of air in the system increases as $V_u = V_{\subtext{init}} + Q_0 t$, where $V_{\subtext{init}}$ is the initial volume of air in the cell and the tubing downstream of the resistor, so the flow rate is \begin{equation}\label{eq:flowrate_bottle} Q(t) = \dot V_b = \frac{\mathrm{d}}{\mathrm{d}t} \left[\frac{V_{\subtext{init}} + Q_0 t}{(1 + p_b(t)/p_a)}\right] \qquad \text{(pressurised bottle)}. \end{equation} \end{subequations} Although the two expressions \eqref{eq:flowrate_comp} are similar, and approximately equal when $V_{\subtext{init}}$ is sufficiently large \citep{Cuttle2021}, an important difference between the two injection methods is how small $V_{\subtext{init}}$ could reasonably be in practice. For injection using a syringe pump, the initial gas volume must be at least as large as the volume of the flow cell, so as to allow the injection to proceed until the bubble reaches the rim of the cell. For injection using a pressurised bottle, however, the initial gas volume can be much lower, just equal to the volume of the initial bubble in the cell, assuming that the tubing volume can be neglected. As we do not seek to investigate the effects of varying $V_{\subtext{init}}$ in detail, we simply choose to use \begin{gather}\label{eq:vinit} V_{\subtext{init}} = \pi b_0 \Rout^2 \ \text{(syringe pump)}, \qquad V_{\subtext{init}} = \pi b_0 R_{\subtext{init}}^2 \ \text{(pressurised bottle)}, \end{gather} which are representative of typical experimental conditions for each injection method. We note that the difference in results between the two cases is due to both the difference between the methods \eqref{eq:flowrate_comp} and the different choices of initial gas volume \eqref{eq:vinit}. The role of these differences and their effect on the two-phase displacement in a rigid cell are investigated in detail in \citet{Cuttle2022}. \subsection{Non-dimensionalisation} We non-dimensionalise the governing equations by scaling lengths with the solid thickness $d$, scaling deflections with the initial gap $b_o$, and seeking a balance between all terms in the lubrication equation \eqref{eq:lub}. Thus, the non-dimensional quantities are given by \begin{equation}\label{eq:nondim} \begin{gathered} (\v{x}^*,R^*) = \frac{(\v{x},R)}{d}, \qquad (\v{u}^{s*},w^*, b^*) = \frac{(\v{u}^{s},w, b)}{b_0}, \qquad (p^*,p_b^*, p^{s*},\vv{\sigma}^{s*}) = \frac{(p,p_b,p^s,\vv{\sigma}^s)}{Gb_0/d}, \\ t^* = \frac{t}{12\mu d^3/(G b_0^3)}, \qquad Q^* = \frac{Q}{2\pi Gb_0^4/12\mu d}, \end{gathered} \end{equation} and the resulting non-dimensional parameters are \begin{equation}\label{eq:params} \begin{gathered} \Rout^* = \frac{R_{\subtext{out}}}{d}, \qquad Q_0^* = \frac{12\mu Q_0 d}{2\pi G b_0^4}, \qquad \Gamma^* = \frac{d\gamma}{G b_0^2}, \qquad \mathcal{C}^* = \frac{Gb_0^3}{12d^2\gamma}, \qquad \mathcal{H}^* = \frac{\pi}{4} \frac{b_0}{d} \Gamma^*, \\ R_{\subtext{init}}^* = \frac{R_{\subtext{init}}}{d}, \qquad p_a^* = \frac{p_a}{Gb_0/d}, \qquad V_{\subtext{init}}^* = \frac{V_{\subtext{init}}}{2\pi b_0 d^2}. \end{gathered} \end{equation} Here, $\Rout^*$ is the non-dimensional radius of the elastic slab, or equivalently its aspect ratio, and is assumed to be moderately large, while $Q_0^*$ is a non-dimensional flow rate and measures the strength of the fluid--structure interaction in the cell. These two are the main parameters, and also apply to single-phase flow. The three parameters $\Gamma^*$, $\mathcal{C}^*$ and $\mathcal{H}^*$ are related to the role of surface tension, and are in fact related by $\Gamma^* = (b_0/d)/(12\mathcal{C}^*) = (d/b_0)(4/\pi)\mathcal{H}^*$, so only two out of the three are independent. From here on, we use only non-dimensional quantities, dropping the asterisks for simplicity. The resulting non-dimensional forms of most of the governing equations \eqref{eq:elastic}--\eqref{eq:vinit} are then obtained by simply setting $12\mu = G = b_0 = d = 1$ and replacing $\pi$ in \eqrefsst{eq:injection}{ and }{eq:vinit} by $1/2$. The exceptions are the bubble front conditions \eqref{eq:front}, which become \begin{equation} (1 - f_1)\dot R = -b^2\frac{\partial p}{\partial r}, \quad p - p_b = -\frac{2\Gamma}{b}(1 + f_2) - \frac{\mathcal{H}}{R} \qquad \text{ at } r = R^+, \end{equation} with $f_1$ and $f_2$ functions of $\Ca = \mathcal{C} \dot R$. We solve this system numerically using first-order implicit integration in time (backward Euler) and second-order finite differences in space; see \appref{app:num} for details. We typically terminate the simulation when the distance $\Rout - R$ from the bubble to the rim decreases below $0.1$, in which case we deem the bubble to be escaping the cell, or when the minimum cell gap \begin{gather} b_{\subtext{min}}(t) = \min_r b(r,t), \end{gather} which typically occurs at a well-defined bulge near the rim, decreases below $0.05$, in which case we deem the cell to be choking, as increasingly fine numerical resolution in space and time would be required to resolve the flow past these thresholds. When the cell is deemed to be choking, increasing the resolution of the simulations indicates that $b_{\subtext{min}}$ continues to decrease, and would reach zero in finite time which traps the bubble in the cell, rather than taking infinite time to decay to zero which might allow the bubble to escape. However, the model becomes invalid when the gap is too small; we discuss this issue further in \secref{sec:summ}. \section{Expansion of the bubble below the choking threshold \label{sec:num}} Throughout this section, we focus on the specific value $\Rout = 20$ for the cell radius and $Q_0 = 20$ for the non-dimensional injection flow rate, which is below $Q_0 \approx 1.4\Rout$ at which the single-phase system is expected to choke \citep{Box2020}. \subsection{Review of single-phase flow (no gas)}\label{sec:singlephase} \begin{figure} \includegraphics[width=\linewidth]{fig_snapshots.pdf} \caption{Numerical results for incompressible flow with $Q_0 = \Rout = 20$. Top: Snapshots of channel height/deformation profiles (left) and pressure profiles (right) at various times for \figa{a,b} single-phase flow, \figa{c,d} two-phase flow without surface-tension (ST) effects ($\Gamma = \mathcal{H} = \mathcal{C} = 0$), \figa{e,f} two-phase flow with surface-tension effects ($\Gamma = 1$, $\mathcal{H} = 0.1\pi/4$, $\mathcal{C} = 0.1/12$). In \figa{b}, the pressure profile in a rigid cell (dotted curve) is shown for comparison. In \figa{c}, the vertical dotted lines indicates the position of the displacement front. In \figa{e}, the dotted curves correspond to the bubble boundary, indicating both the position of the displacement front and the thickness of the residual films. Bottom: Time evolution of \figa{g} the bubble radius $R$, \figa{h} the bubble pressure $p_b$ and \figa{i} the minimum cell gap $b_{\subtext{min}}$, as well as \figa{j} $b_{\subtext{min}}$ plotted against $R$, from \figa{c--f}. In \figa{g,h}, results from a rigid cell with no surface tension are shown for comparison. In \figa{i}, single-phase results from \figa{a,b} are also shown. \label{fig:snapshots}} \end{figure} We first briefly review the single-phase case, in which there is no gas in the system and flow in the liquid-filled cell is driven by injection of more of the same liquid (so that the lubrication equation \eqref{eq:lub} holds throughout the domain). \Figref[a,b]{fig:snapshots} shows the cell deformation and pressure at various times from a simulation with $Q_0 = \Rout = 20$. We observe that the solid deformation and flow are initially localised near the cell centre (inlet) $r=0$ and the rim (outlet) $r=\Rout$. The injected fluid expands the gap near $r=0$ and pushes the solid outward, which in turn bulges near the outlet and squeezes fluid out of the cell at the injection rate. As time passes, the deformation of the solid reaches a steady state, with the pressure profile driving a steady flow through the cell. For a rigid cell, the steady-state pressure profile $p = Q_0 \ln(\Rout/R)$ would be reached instantaneously \figparen{dotted curve in \figref[b]{fig:snapshots}}. As explained by \citet{Box2020}, the slab deformation is driven by the gradient in normal stress (i.e.~pressure) squeezing the solid towards the rim (rather than by the shear stress from the fluid, which is neglected in this model). Away from the injection point and the rim (i.e.~at distances larger than the solid thickness, $r \gg 1$ and $\Rout - r \gg 1$), the solid can be modelled using a long-wave approximation (analogous to fluid lubrication theory) \cite{Box2020, Chandler2021}, which yields the horizontal displacement profile and the surface deflection \begin{gather}\label{eq:longwave} \v{u}_H^s \approx -\frac{1 - z^2}{2}\boldsymbol{\nabla}_H p, \qquad w \approx -\boldsymbol{\nabla}_H \bcdot \left(\frac{1}{3}\boldsymbol{\nabla}_H p\right). \end{gather} This explains the somewhat surprising result that there is negligible vertical deflection, $w \ll 1$, for intermediate values of $r$ in \figref[a]{fig:snapshots}, as the harmonic pressure field results in zero vertical deflection and a steady flow. As a result, the steady-state pressure profile in the approximately flat part of the elastic cell differs from that in a rigid cell by an additive constant, corresponding to the additional pressure drop due to the constriction near the rim. \subsection{Two-phase flow with incompressible gas}\label{sec:incomp} We now consider the injection of gas. We first neglect any effects of compressibility by imposing the incompressible injection law \eqref{eq:flowrate_incomp}, and compare the single-phase case discussed previously with a two-phase simulation without surface-tension effects ($\Gamma = \mathcal{H} = \mathcal{C} = 0$) and a two-phase simulation with surface-tension effects ($\Gamma = 1$, $\mathcal{H} = 0.1\pi/4$ and $\mathcal{C} = 0.1/12$ corresponding to a dimensional ratio $b_0/d = 0.1$). With no surface tension \figrefp[c,d]{fig:snapshots}, the gap initially expands near the centre and constricts near the rim, as in the single-phase case, and the pressure profiles are similar outside of the bubble region. As the bubble grows outward, the cell relaxes towards its undeformed state behind the advancing bubble front \eqparen{the long-wave approximation \eqref{eq:longwave} for the solid yields $w \approx 0$ for a spatially uniform pressure $p = p_b$}. A localised region of expansion travels with the bubble front, with the solid being squeezed toward the rim on the liquid side while not being squeezed in either direction on the gas side. Near the rim, the bulge initially grows (or equivalently the minimum cell gap $b_{\subtext{min}}$ decreases) and then approaches a steady state \figrefp[i]{fig:snapshots}, just like for single-phase flow. However, as the bubble approaches (i.e.~$R \to \Rout$), the size of the liquid region (over which the solid is being squeezed towards the rim by the viscous pressure gradient) reduces, and hence the solid starts to relax \figrefp[j]{fig:snapshots}. This is the key mechanism by which the inviscid bubble, due to its proximity to the rim, mitigates the tendency of the system to choke. We will revisit it later in \secref{sec:proximity}. The time evolution of the bubble radius $R$ \figrefp[g]{fig:snapshots} closely follows the prediction from a rigid cell, in which conservation of volume yields $R^2 = R_{\subtext{init}}^2 + 2 Q_0 t$. This is because the deformation of the soft cell has a relatively small effect on the distribution of the fluids. The bubble pressure $p_b$ \figrefp[h]{fig:snapshots} initially increases as the bulge gap constricts near the rim, but eventually decreases as more and more viscous liquid is replaced by inviscid gas. Due to the constricting bulge near the rim, the pressure remains slightly above the value $p_b = Q_0 \ln(\Rout/R)$ it would have in a corresponding rigid-walled cell. When we include surface tension in the model \figrefp[e,f]{fig:snapshots}, the pressure has a capillary jump at the bubble front (controlled by $\Gamma$ and $\mathcal{H}$), which changes the deformation profile in its vicinity. The pressure jumping from a higher value in the bubble to a lower value in the liquid causes the gap to expand immediately behind the bubble front and contract immediately ahead of it \figrefp[e]{fig:snapshots}, as compared with the profile near the interface without surface tension \figrefp[c]{fig:snapshots}. When the bubble approaches the rim, the bulge initially grows slightly due to the pressure jump, before it relaxes due to the reduction in size of the liquid region \figrefp[i,j]{fig:snapshots}. The evolution of the bubble radius \figrefp[g]{fig:snapshots} changes slightly due to the change in the cell deformation, and also because of the thin residual liquid films being deposited on the cell walls \figrefp[e]{fig:snapshots}, controlled by the parameter $\mathcal{C}$. Finally, the bubble pressure \figrefp[h]{fig:snapshots} is larger compared with the simulation without surface tension because of the capillary pressure jump. \subsection{Two-phase flow with compressible gas}\label{sec:comp} Next we turn our attention to the effects of the gas compressibility. As can be seen from equations \eqref{eq:flowrate_comp}, compression of the gas simply alters the rate of change of the bubble volume, $Q(t)$, so that it deviates from the nominal value $Q_0$ that is imposed by injection. As a result, the mechanisms for the deformation of the cell, discussed above, remain largely unchanged, but the dynamics of the system may be affected by the varying flow rate $Q(t)$. For simplicity, we neglect the effects of surface tension (i.e.~set $\Gamma = \mathcal{H} = \mathcal{C} = 0$), and consider a few different values of the atmospheric pressure $p_a$. The results of our numerical simulations are shown in \figref{fig:compress}, in which we plot the time-evolution of the bubble radius $R(t)$, the rate of change $Q(t)$ of the bubble volume in the cell, the bubble pressure $p_b(t)$ and the minimum cell gap $b_{\subtext{min}}(t)$, for injection using either a syringe pump (left column) or a pressurised bottle (right column). We note that, despite the different governing equations \eqref{eq:flowrate_comp} and intial gas volumes \eqref{eq:vinit}, the two injection methods produce qualitatively similar results. \begin{figure} \centering \includegraphics[width=\linewidth]{fig_compress.pdf} \caption{Numerical simulations with gas compressibility using the two injection models \eqref{eq:flowrate_comp}, for nominal flow rate $Q_0 = \Rout = 20$ and four values of the atmospheric pressure parameter $p_a$, without surface tension. Time evolution of \figa{a,b} the bubble radius $R$, \figa{c,d} the liquid flow rate $Q$ exiting the cell, \figa{e,f} the bubble pressure $p_b$, and \figa{g,h} the minimum cell gap $b_{\subtext{min}}$. Results from an incompressible simulation \eqref{eq:flowrate_incomp}, which corresponds to $p_a \to \infty$, are shown for comparison. \label{fig:compress}} \end{figure} For large $p_a$, which corresponds to the typical gauge pressure in the cell being small compared with atmospheric pressure, the effect of gas compression is negligible: The flow rate $Q(t)$ is approximately equal to the nominal value $Q_0$, and the evolution of the bubble radius $R$, bubble pressure $p_b$ and minimum cell gap $b_{\subtext{min}}$ follow the results from the incompressible model. As $p_a$ is reduced, the effect of compression becomes significant: The injection initially drives only a small fluid flow $Q(t)$, while the bubble pressure rises and the gas compresses. As the bubble expands and the amount of viscous fluid in the cell reduces, the resistance to flow in the cell decreases, and the bubble attains a maximal pressure before starting to depressurise. However, if there is any remaining overpressure when the bubble reaches the rim, then the flow rate diverges. Also, for larger compressibility, the bubble reaches the rim later. These results are qualitatively similar to those in a rigid cell \citep{Cuttle2022} or a rigid capillary tube \citep{Cuttle2021}. In particular, for a rigid cell with large $V_{\subtext{init}} \gtrsim R_{\subtext{out}}^2/2$, the compressibility number defined by \citet{Cuttle2022} is, after the non-dimensionalisation in \eqreft{eq:params}, $C = 4 Q_0 V_{\subtext{init}}/(\Rout^2 p_a)$, and is the main parameter that predicts whether the flow rate diverges ($C > 1$) or not ($C \lesssim 1$) as $R \to \Rout$ in \figref[c]{fig:compress}. The reduction in flow rate due to gas compression initially is the second key mechanism by which the bubble can mitigate the tendency of the system to choke. This will be explored further in \secref{sec:nearchoke}. \section{The effects of the bubble on choking \label{sec:choke}} \subsection{The proximity of the bubble to the rim \label{sec:proximity}} We assess how choking is influenced by the proximity of the inviscid gas bubble to the cell rim by studying the system at a larger flow rate, $Q_0 = 29 = 1.45\Rout$, that is slightly above the single-phase choking threshold of $Q_0 \approx1.4R_{\subtext{out}} $ \citep{Box2020}. For simplicity, we once again neglect gas compressibility and surface tension. The evolution of the gap profile near the rim is plotted in \figref[a]{fig:choke}: the bulge grows in amplitude and approaches the opposite wall as the minimum gap $b_{\subtext{min}}$ shrinks toward zero. In this case, for which the bubble has initial radius $R_{\subtext{init}} = 0.5$, the bulge develops and the cell chokes before the displacement front is near enough to the rim to have any mitigating effect. Indeed, the profiles agree closely with analogous ones from a single-phase simulation (dashed curves). \begin{figure} \centering \includegraphics[width=\linewidth]{fig_choke.pdf} \caption{Numerical results for incompressible flow with flow rate $Q_0 = 29 = 1.45\Rout$, which is slightly above the single-phase choking threshold. Top: Snapshots of the channel gap profile $b=b(r, t)$ near the cell rim, in non-dimensional time increments of $0.2$ with first and last times as indicated, without surface tension (ST) and for initial radius \figa{a} $R_{\subtext{init}} = 0.5$ and \figa{b,c} $R_{\subtext{init}} = 11$, split between \figa{b} the constricting phase and \figa{c} the relaxing phase. In \figa{a}, single-phase results are shown for comparison. In \figa{c}, quasi-steady profiles with the same radius and pressure drop are shown for comparison. Bottom: Evolution of the minimum cell gap $b_{\subtext{min}}$ as a function of \figa{d,f} time $t$ and of \figa{e,g} the bubble radius $R$ for the two-phase case \figa{d,e} without surface tension and \figa{f,g} with surface tension ($\Gamma = 1$, $\mathcal{H} = 0.1 \pi/4$, $\mathcal{C} = 0.1/12$). Different colours correspond to different initial values $R_{\subtext{init}} = 8,10,11,12,14,16,17,18$, as indicated by the circles in \figa{e,g}, and the curve corresponding to \figa{b,c} is labelled as $R_{\subtext{init}}=11$ in \figa{d}. The single-phase result is also shown in \figa{d,f} for comparison. In \figa{e}, the vertical dash-dotted line shows the choking boundary predicted by the quasi-steady analysis \eqrefp{eq:quasisteady}. \label{fig:choke}} \end{figure} Profiles from a simulation with larger initial bubble radius, $R_{\subtext{init}} = 11$, are shown in \figref[b,c]{fig:choke}. The bulge initially grows \figrefp[b]{fig:choke} and the channel nearly chokes. However, as the bubble grows, it reduces the amount of liquid that is squeezing the solid towards the rim. This reopens the channel \figrefp[c]{fig:choke} and choking is averted. To illustrate how the presence of the bubble near the rim helps the bulge to relax and therefore reduces the tendency of the system to choke, we consider how the bulging changes for different values of the initial bubble radius $R_{\subtext{init}}$. \Figref[d]{fig:choke} shows the time evolution of the minimum cell gap $b_{\subtext{min}}$, and the same data is plotted in \Figref[e]{fig:choke} as a function of the interface position $R$. For $R_{\subtext{init}} \lesssim 10$, the bubble does not arrive at the rim early enough to mitigate choking, so $b_{\subtext{min}}$ shrinks steadily to zero, reaching it at a finite value of $R<R_{\subtext{out}}$. As a result, the system chokes around $t \approx 1.5$, just like in the single-phase case \figparen{dotted curve in \figref[d]{fig:choke}}. For $R_{\subtext{init}} \gtrsim 11$, $b_{\subtext{min}}$ initially shrinks, but does not vanish before the bubble is close enough to mitigate the bulge; thereafter, $b_{\subtext{min}}$ returns to one instead of decaying to zero. \Figref[f,g]{fig:choke} show analogous simulations with surface-tension effects. The capillary pressure drop across the bubble front constricts the gap in front of the bubble (and expands it behind) \figparen{see~\figref[e]{fig:snapshots}} which partly offsets the relaxing effect of the bubble on choking. Hence, the bubble needs to be closer to the rim in order to prevent $b_{\subtext{min}}$ decreasing to zero. In these simulations, the system chokes for $R_{\subtext{init}} \lesssim 16$ and only avoids choking for $R_{\subtext{init}} \gtrsim 17$. We do not study the effects of surface tension further. A further observation that can be made in \figref[e]{fig:choke} is that when the bubble approaches the rim, the curves from different simulations collapse onto a universal curve, indicating that the deformation profile becomes approximately independent of the initial conditions, and instead only depends on the current bubble front position $R$ (as well as the flow rate and the material parameters). We calculate an ad-hoc approximation of this profile by seeking quasi-steady solutions of the governing equations: we neglect the time derivative $\dot{h}$ in the lubrication equation \eqref{eq:lub} and fix the position of the bubble front $R$ instead of evolving it using \eqreft{eq:front}. Thus, we solve the remaining governing equations from \eqrefsst{eq:elastic}{--}{eq:injection} together with \begin{gather}\label{eq:quasisteady} 0 = \div \left(b^3\boldsymbol{\nabla} p\right) \quad \text{ in } r > R, \quad \text{where $R$ is fixed}. \end{gather} The resulting deformation profiles at given values of $R$ \figparen{dotted curves in \figref[c]{fig:choke}} are in excellent agreement with those obtained from the time-evolving simulation, provided that we impose the same bubble pressure $p_b$, rather than the same flow rate $Q$. \begin{figure} \centering \includegraphics[width=\linewidth]{fig_chokesteady.pdf} \caption{Numerical results from the quasi-steady approximation \eqref{eq:quasisteady}, for $\Rout = 20$ and without surface tension. The scaled flow rate $Q/R_{\subtext{out}}$ is plotted as a function of \figa{a} bubble pressure $p_b$, and \figa{b} minimum cell gap $b_{\subtext{min}}$, for various values of the bubble distance from the rim $\Rout - R$. The colour-coding is explained with the legend in \figa{c}. \figa{c} The maximal $Q/R_{\subtext{out}}$ plotted as a function of $\Rout - R$. In all panels, analogous results for a two-dimensional cell are plotted with dash-dotted curves. In \figa{a}, crosses indicate the values of $p_b$ and $Q/R_{\subtext{out}}$ at the various distances in the time-evolving simulation from \figref[b,c]{fig:choke}. \label{fig:chokesteady}} \end{figure} In this quasi-steady model, any one of $Q$, $p_b$ and $b_{\subtext{min}}$ can be treated as the control parameter. We have chosen to performed the quasi-steady calculations for a range of values of the bubble front position $R$ and total pressure drop across the liquid region (or, equivalently, the bubble pressure $p_b$) rather than $Q$ in order to avoid the issue of multiple solution branches existing for $Q$ just below the maximum value. \Figref{fig:chokesteady} shows how the scaled flow rate $Q/R_{\subtext{out}}$ in the quasi-steady solutions depends on $p_b$, $b_{\subtext{min}}$ and $R$. For each value of $R$, we see in \figref[a]{fig:chokesteady} that increasing $p_b$ initially drives more flow $Q$, but due to the bulge constricting the channel, $Q$ reaches a maximum and then remains near the maximum as $p_b$ increases further. We also plot the relationship between $b_{\subtext{min}}$ and $Q$ \figrefp[b]{fig:chokesteady}, and find similarly that a decrease in $b_{\subtext{min}}$ from $1$ initially corresponds to an increase in $Q$, but once the same maximum in $Q$ is reached, the flow rate remains near it as $b_{\subtext{min}}$ decreases further. We can compare these computations to the results shown in \figref[c]{fig:choke}, in which the flow rate is $Q_0 = 1.45\Rout$. For each value of $R$ plotted in \figref[a]{fig:chokesteady}, we extract the corresponding values of $p_b$ from the time-evolving simulation in \figref[c]{fig:choke} and mark them with crosses in \figref[a]{fig:chokesteady}. This comparison reveals a small but noticeable difference between the flow rate predicted by the quasi-steady solution and the flow rate obtained in the time-evolving simulations, despite the excellent agreement in deformation profile observed in \figref[c]{fig:choke}. As described by \citet{Box2020}, in the single-phase case, the occurrence of choking in time-evolving simulations with an imposed flow rate $Q_0$ is linked to the lack of existence of a steady state with flow rate $Q = Q_0$. Analogously, for each value of $R$ we can identify the largest flow rate $Q$ for which a quasi-steady solution exists. The resulting curve \figrefp[c]{fig:chokesteady} represents an approximate boundary, beyond which the large flow rate in the channel is unsustainable and the system is expected to choke. When evolving from an initially undeformed state, which corresponds to $R_{\subtext{out}} -R$ decreasing as the bubble grows, the system thus avoids choking if the bubble manages to cross the boundary shown in \figref[c]{fig:chokesteady} before the bulge has had time to grow and make contact with the opposite wall. For example, the boundary for $Q = 1.45$ is at $R_{\subtext{out}} - R \approx 6$, i.e.~$R \approx 14$, and indeed as seen in \figref[e]{fig:choke} where this boundary is indicated by the vertical dash-dotted line, in the cases where the cell choked, it did so before the bubble reached $R \approx 14$, while if the bubble did reach $R \approx 14$ then it went on to escape without the cell choking. The dash-dotted curves in \figref{fig:chokesteady} show the results of the quasi-steady calculations for a two-dimensional cell, in which $Q/\Rout$ corresponds to the flow rate per unit length in the third, Cartesian, dimension. The two-dimensional results agree well with the radial results, especially for small $\Rout - R$, since the dynamics are limited to the region near the rim where the difference between radial and two-dimensional geometry is small. Hence, the results in \figref{fig:chokesteady} are expected to apply for other cell sizes $R_{\subtext{out}} \gg 1$, not just the value $R_{\subtext{out}} = 20$ considered here. \subsection{The near-choking regime for compressible gas \label{sec:nearchoke}} We now investigate the impact of gas compression on choking, by considering injection with nominal flow rates $Q_0/\Rout = 1.5, 2, 3$ and an atmospheric pressure parameter of $p_a = 1000$. To aid the discussion, we plot the flow rate $Q$, bubble pressure $p_b$ and minimum cell gap $b_{\subtext{min}}$ as functions of the interface position $R$ in \figref[a--c]{fig:nearchoke}. \begin{figure} \centering \includegraphics[width=\linewidth]{fig_nearchoke.pdf} \caption{Simulations in the near-choking regime, for $\Rout = 20$ and three values of the nominal injection flow rate $Q_0$ above the single-phase choking threshold: Evolution of the \figa{a} resulting flow rate $Q$, \figa{b} bubble pressure $p_b$ and \figa{c} minimum cell gap $b_{\subtext{min}}$ as functions of the bubble radius $R$, and \figa{d} of $R$ as function of $t$. The simulations assume gas compressibility ($p_a = 1000$) and two injection methods (syringe pump with $\Rout^2/2$ or pressurised bottle with $V_{\subtext{init}} = R_{\subtext{init}}^2/2$, shown with solid and dashed curves, respectively), but no surface-tension effects ($\Gamma = \mathcal{H} = \mathcal{C} = 0$). In \figa{a}, the choking threshold for the single-phase flow and results from the quasi-steady analysis \figrefp[c]{fig:chokesteady} are shown for comparison. \label{fig:nearchoke}} \end{figure} As evident from \figref[a]{fig:nearchoke}, the flow rate can transiently exceed the critical value for the single-phase flow $Q(t) \approx 1.4\Rout$ [horizontal dotted line in \figref[a]{fig:nearchoke}] at early times. However, once the bulge has grown large enough to significantly constrict the gap \figparen{see also \figref[c]{fig:nearchoke}}, the flow rate rapidly drops to this critical value. The mismatch between the larger flow rate $Q_0$ of gas injection and the smaller flow rate $Q(t)$ of liquid exiting the cell is accommodated by volumetric compression of the gas, which causes the gas pressure to increase continually. This in turn reduces the cell gap further \figrefp[b,c]{fig:nearchoke}. Nevertheless, the flow rate does not change significantly, consistent with $Q$ reaching a plateau as $p_b \to \infty$ or $b_{\subtext{min}} \to 0$ in the quasi-steady solutions in \figref[a,b]{fig:chokesteady}. As the bubble approaches the rim, the maximum sustainable flow rate increases \figrefp[c]{fig:chokesteady} and the flow rate follows this increase \figparen{dash-dotted curve in \figref[a]{fig:nearchoke}}. \figparen{For $Q_0$ just above the single-phase choking threshold, such as $Q_0=30$ in \figref[a]{fig:nearchoke}, the flow rate stops increasing as the bubble decompresses before escaping the cell, but for larger $Q_0$ the pent up pressure allows the flow rate $Q(t)$, and the bubble velocity $\dot{R}(t)$, to diverge in this model as $R \to \Rout$, as discussed at the end of \secref{sec:comp}.} We conclude that for nominal flow rates above the choking threshold, gas compression enables the system to enter a ``near-choking'' regime after the initial transient. In this regime, the flow rate follows the threshold curve in \figref[c]{fig:chokesteady}, which is a function of the bubble front position $R$, but does not depend on the injection flow rate. A consequence of this is that the simulations with different $Q_0$ and different injection mechanisms all have approximately the same flow rate $Q(t)$ during the main part of the simulation, and hence the time evolution of the bubble radius $R(t)$ is approximately the same between all of them \figrefp[d]{fig:nearchoke}. We note that compression plays an important role despite the large value of $p_a=1000$ (for which compressive effects were weak in \figref{fig:compress}). Indeed, in the absence of compression, the flow rate $Q(t) = Q_0$ would be sufficiently large for the cell to choke; the minimum cell gap would decrease from its initial value $b_{\subtext{min}} = 1$ towards zero, becoming arbitrarily small in finite time \figrefp[d]{fig:choke}. However, as the minimum gap narrows, the viscous resistance (both to flow through the narrow gap and to further reduction of the gap) requires the pressure in the bubble to increase without bound if the flow rate $Q_0$ is to be sustained. As a consequence, no matter how small the compressibility of the gas is, it must compress, which reduces the flow rate $Q(t)$, so that the cell does not choke. Therefore, given that a real gas is never perfectly incompressible, one would expect no choking to occur in experiments. We discuss this apparent contradiction further in \secref{sec:summ}. \section{The dynamics of the advancing bubble front\label{sec:tw}} It is possible to elaborate on the dynamics of the advancing bubble front under the assumption that $R \gg 1$ and $\Rout - R \gg 1$, i.e.~the bubble and liquid regions have horizontal extents that are large compared with the solid thickness. The elastic equations for the solid in those regions can then be approximated by the long-wave result \eqref{eq:longwave} which yields $w \approx 0$ in both the liquid region \citep{Box2020} and the bubble region. However, the approximation does not apply near the cell rim or near the bubble front, where the horizontal length scale of variation becomes comparable to the solid thickness. Since in this asymptotic regime the bubble is far away from the rim, the deformation near the rim is well described by the single-phase local boundary-layer solution calculated by \citet{Box2020}. Here we study the local behaviour near the bubble front using a travelling-wave approximation. \subsection{Travelling-wave equations} We define a local co-moving coordinate $x = r - R(t)$ which is assumed to be $O(1)$. Substituting into the elastic equations \eqref{eq:elastic} and neglecting quantities of order $R^{-1} \ll 1$, we obtain the two-dimensional equations \begin{subequations} \begin{gather} \sigma_{xx}^s = -p^s + 2 \partial_x u_x^s, \qquad \sigma_{zz}^s = -p^s + 2 \partial_z u_z^s, \qquad \sigma_{xz}^s = \sigma_{zx}^s = \partial_z u_x^s + \partial_x u_z^s, \\ \partial_x u_x^s + \partial_z u_z^s = 0, \qquad 0 = \partial_x \sigma_{xx}^s + \partial_z \sigma_{zx}^s = \partial_x \sigma_{xz}^s + \partial_z \sigma_{zz}^s. \end{gather} \end{subequations} Under the travelling-wave approximation that the deformation profile is steadily translating with the bubble front $R(t)$, i.e.~$\dot w \approx - \dot{R} w'$, where prime denotes a derivative with respect to $x$, the lubrication equation \eqref{eq:lub} can be integrated to \begin{gather}\label{eq:tw_lub} -\dot R\,w = (1+w)^3 p' + q \quad \text{ in } x > 0, \end{gather} where $q$ is a constant of integration. \Eqreft{eq:bub} for the bubble pressure remains as $p = p_b(t)$ in $x < 0$, and the bubble-front conditions \eqref{eq:front} become \begin{gather}\label{eq:tw_front} (1 - f_1(\mathcal{C} \dot{R}))\dot{R} = -b^2 p', \qquad p - p_b = -\frac{2\Gamma}{b}(1 + f_2(\mathcal{C} \dot{R})) \qquad \text{ at } x = 0^+, \end{gather} while the conditions on the top and bottom surface of the elastic solid remain as \begin{gather} \v{u}^s|_{z=1} = \v{0}, \qquad w = u_z^s|_{z=0}, \qquad p = -\sigma_{zz}^s|_{z=0}, \qquad 0 = \sigma_{xz}^s|_{z=0}. \end{gather} This is a local analysis near $r=R$, so the injection and rim conditions \eqref{eq:injection}--\eqref{eq:flowrate_comp} are irrelevant. Instead we match to the long-wave structure \eqref{eq:longwave} at large $\pm x$, by imposing \begin{gather} w,\ u_z^s \to 0 \text{ as } x \to \pm \infty, \qquad u_x^s \to 0 \text{ as } x \to -\infty, \qquad u_x^s \to \frac{1-z^2}{2} q \text{ as } x \to \infty, \end{gather} where we identify $q = -\lim_{x \to \infty} p'$ to be the far-field flux or negative pressure gradient. Since the value of $p_b$ simply changes $p$ by a constant, we only need to solve the equations above for $p_b = 0$. Solving these equations determines the unknown advancement velocity $\dot{R}$ of the bubble, which depends on the non-dimensional surface-tension parameters $\Gamma$ and $\mathcal{C}$ and the far-field flux $q$. However, for convenience, we instead proceed by imposing the value of $\dot{R}$ and solving the equations numerically (using Newton iteration) to obtain $q$ as a function of $\dot{R}$. Another important quantity is the effective additional pressure drop in the local region (as compared with an undeformed cell, in which the pressure gradient would be a constant $q$, with no capillary pressure drop), \begin{equation} \Delta p = p_b - \lim_{x\to\infty} \left(p + q\,x\right). \end{equation} This is also calculated numerically as a function of $\dot{R}$. \subsection{No residual films} We first consider the case when no residual films are deposited on the walls behind the advancing bubble front, which corresponds to $\mathcal{C} = 0$. In this case, combining the travelling-wave lubrication equation \eqref{eq:tw_lub} with the kinematic boundary condition \eqref{eq:tw_front} yields the relationship \begin{gather}\label{eq:twcons_nofilm} q = \dot{R}, \end{gather} meaning that the steady advancement velocity of the bubble must be equal to the depth-averaged lubrication velocity far ahead of the bubble, since liquid volume is conserved. Channel height profiles for various values of $\dot{R}$ are plotted in \figref[a]{fig:tw} for the case of no surface tension. As was discussed in \secref{sec:incomp}, an advancing bubble is associated with a liquid pressure gradient in $x > 0$ that squeezes the solid away from the bubble and dilates the gap. Results are also included for retreating bubbles ($\dot{R} < 0$), in which case the elastic solid conversely is squeezed towards the bubble and constricts the gap. As $\dot{R}$ decreases towards a critical value just below $-5$, the minimum cell gap shrinks towards zero, and no solutions are found for lower values of $\dot{R}$, indicating an alternative mechanism for choking, in which liquid displacing gas at sufficiently large flow rate causes the elastic solid to make contact with the opposite wall near the moving interface (rather than near the rim of the cell). Adding in a static capillary pressure drop $\Gamma = 1$ across the bubble front \figrefp[b]{fig:tw} results in a relative constriction of the gap ahead of the bubble front and a dilation behind the bubble front, as discussed in \secref{sec:incomp} The local additional pressure drop in the travelling-wave region is plotted in \figref[c]{fig:tw} as a function of the bubble front velocity $\dot{R}$ for various values of the surface-tension parameter $\Gamma$. (It is possible to generalise the definition of $\Gamma$ to include cases of partial wetting with a contact angle $\theta_c$, for which $\Gamma$ is modified by a factor $\cos\theta_c$ and can therefore be negative.) For the static case $\dot{R} = 0$, the additional pressure drop is simply given by the static formula $\Delta p = 2\Gamma$ (the static deformation profile is an odd function of $x$, so $b=1$ at the bubble front). For $\dot{R} > 0$, the gap expands and the viscous pressure drop reduces, resulting in a smaller $\Delta p$. Similarly, for $\dot{R} < 0$, the gap constricts and the viscous pressure drop increases, but due to the reversed flow direction we again obtain a smaller $\Delta p$. \begin{figure} \includegraphics[width=\linewidth]{fig_tw.pdf} \caption{Numerically calculated travelling-wave solutions with no residual films ($\mathcal{C} = 0$). \figa{a,b} Cell gap profiles for various bubble advancement velocities $\dot{R}$ and two values of the surface-tension parameter $\Gamma$. The location $x=0$ of the bubble front is indicated with a vertical dotted line. \figa{c} The local additional pressure drop as a function of velocity $\dot{R}$ for three values of $\Gamma$. \label{fig:tw}} \end{figure} \subsection{With residual films} We now consider the case of non-zero $\mathcal{C}$, representing the deposition of thin liquid films on the cell walls behind the advancing bubble front. Combining \eqreft{eq:tw_lub} with \eqreft{eq:tw_front} now yields a more complicated relationship between the far-field flux $q$ and the advancement velocity $\dot{R}$, which we can express in terms of the total thickness $m$ of films deposited on the walls as \begin{gather}\label{eq:twcons_film} q = (1-m)\dot{R}, \qquad m = f_1(\mathcal{C} \dot{R}) b|_{x=0}. \end{gather} \begin{figure} \includegraphics[width=\linewidth]{fig_twfilms.pdf} \caption{Numerically calculated travelling-wave solutions for an advancing bubble front that leaves behind liquid films on the cell walls. Top row: Deformation profiles (thick lines) and residual film thicknesses (thin lines) for $\mathcal{C} = 1$, $\Gamma = 0.01$, and three values of the front velocity: \figa{a} $\dot{R}=1$, \figa{b} $\dot{R}=10$ and \figa{c} $\dot{R}=100$. Bottom row: The \figa{d,e} far-field flux $q$ and \figa{f} local additional pressure drop $\Delta p$ as functions of $\dot{R}$ for three different values of $(\mathcal{C},\Gamma)$ corresponding to a dimensional ratio $b_0/d = 0.12$. In \figa{d,e}, the result \eqref{eq:twcons_nofilm} for $\mathcal{C} = 0$ (and any value of $\Gamma$) is shown (dashed line) for reference. \label{fig:twfilms}} \end{figure} Examples of resulting channel height profiles are plotted in \figref[a--c]{fig:twfilms}, with the thin curves in the bubble region $x < 0$ showing the residual liquid films of thickness $m/2$ coating each wall. As $\dot{R}$ increases, both the film correction factor $f_1(\mathcal{C} \dot{R})$ and the cell gap $b|_{x=0}$ increase, which results in the residual film thickness $m$ increasing and the ratio $q/\dot{R}$ decreasing. For small and moderately large $\dot{R}$, for which $m$ is not too close to $1$, the bubble continues to push a significant amount of liquid ahead of it, with the far-field flux being $q = O(\dot{R})$ \figrefp[d]{fig:twfilms}. However, as $m$ approaches $1$, the bubble transitions to ``peeling'' the two walls apart while leaving the fluid mostly in place as two thick films coating the walls \figrefp[c]{fig:twfilms}. This allows the advancement velocity to become much larger than the far-field flux \figrefp[e]{fig:twfilms}. (In practice, for large $\dot{R}$, rather than settling into a steadily translating state, the system might exhibit unsteady dynamics such as repeated pinch-off of bubbles as the residual films make contact and reconnect, and become more susceptible to instability in the third dimension.) In \figref[f]{fig:twfilms} we plot the local additional pressure drop as a function of $\dot{R}$. For the same value of $\dot{R}$, the flow rate $q$ is lower \eqrefp{eq:twcons_film} compared with the case without films \eqrefp{eq:twcons_nofilm}, and hence the effect of the deformation of the cell on the pressure drop is also reduced. Therefore, for the same value of $\dot{R}$, the magnitude of the local additional pressure drop can be significantly smaller in the case with films compared to the case without films \figparen{compare \figref[f]{fig:twfilms} with \figref[c]{fig:tw} at, e.g., $\dot{R}=10$}. \subsection{Comparison with numerical simulations} In order to apply the travelling-wave analysis to the time-evolving problem, we combine it with the long-wave approximation in the liquid region and the local single-phase bulge solution near the rim. In the long-wave liquid region, we have $w=0$ and hence, by conservation of volume, $\nabla_H^2 p = 0$. This results in \begin{gather} p = Q \ln \frac{\Rout}{r} + \Delta p_{\subtext{bulge}}(Q/\Rout), \end{gather} where the additional pressure drop $\Delta p_{\subtext{bulge}}$ near the rim due to the bulging is a function of the local flux $Q/\Rout$ and can be extracted from the local two-dimensional solutions of \citet{Box2020}. From this, we can deduce the value of the matching quantity $q = q_{\subtext{front}}(\dot R)$, and express the bubble pressure in terms of the matching quantity $\Delta p = \Delta p_{\subtext{front}}(\dot R)$, \begin{gather}\label{eq:tw_app} q_{\subtext{front}}(\dot R) = \frac{Q}{R}, \qquad p_b = Q \ln \left(\frac{\Rout}{R} \right) + \Delta p_{\subtext{bulge}}(Q/\Rout) + \Delta p_{\subtext{front}}(\dot R). \end{gather} For imposed $Q = Q_0$ and a known initial value of $R$, the first equation in \eqreft{eq:tw_app} can be integrated numerically to yield the evolution of $R$. For the case of compressible gas injection \eqrefsp{eq:flowrate_comp}, or other methods of injection that depend on $p_b$, the evolution of $R$ is obtained by solving \eqreft{eq:tw_app} coupled to the injection condition. \begin{figure} \includegraphics[width=\linewidth]{fig_twapp.pdf} \caption{Application of travelling-wave results to the time-evolving problem, with three values of $Q_0 = \Rout$, no gas compression and $\Gamma = 0.1$, $\mathcal{H} = 0.01\pi/4$, $\mathcal{C} = 1/12$. The evolution of the bubble \figa{a} front velocity $\dot{R}$ and \figa{b} pressure $p_b$, as a function of its position $R$, obtained in the simulations and using the travelling-wave approximation \eqref{eq:tw_app}. The results $\dot{R} = Q_0/R$ and $p_b = Q_0 \ln(R_{\subtext{out}}/R)$ for a bubble without surface tension in a rigid cell are also shown. \figa{c} The imposed flow rate of liquid exiting the cell and the flow rate inferred by applying the travelling-wave analysis to the $R=R(t)$ data from the simulations. \label{fig:twapp}} \end{figure} We compare results from the travelling-wave analysis with results from a time-evolving simulation, focusing on a case with no gas compression, moderate effects of surface tension and thin films ($\Gamma = 0.1$, $\mathcal{H} = 0.01 \pi/4$ and $\mathcal{C} = 1/12$, corresponding to a dimensional ratio $b_0/d = 0.1$), and three different values of the cell radius, $\Rout = 5,10,20$ \figrefp{fig:twapp}{}. \Figref[a]{fig:twapp} shows the velocity $\dot{R}$ of the bubble front, as a function of its position $R$, comparing the values obtained in the simulations (solid curves) to the predictions from the travelling-wave analysis (dashed curves). As expected, there is good agreement between the two for $\Rout = 20$ and intermediate values of $R$, when the bubble front is far away from the centre and the rim of the cell so that the long-wave approximation holds. For the smaller values of $\Rout$, the bubble cannot be as far away from both regions of the cell, so the agreement is worse. For comparison, the dotted curves show the prediction without residual films \eqrefp{eq:twcons_nofilm}, i.e.~$q_{\subtext{front}}(\dot{R}) = \dot{R}$, which is noticeably different. \Figref[b]{fig:twapp} shows the bubble pressure $p_b$ as a function of $R$. Once again, the agreement between simulations and predictions is the best for large $\Rout$. The travelling-wave results can also be used to infer the flow rate $Q = q_{\subtext{front}}(\dot R)\,R$ from the evolution of $R(t)$. \Figref[c]{fig:twapp} shows the results (dashed curves) when applied to the data from the simulations in \figref[a,b]{fig:twapp}. The best agreement with the true value of $Q$ (solid lines) is obtained for large $\Rout$, as expected. \section{Discussion \label{sec:summ}} We have presented and analysed an axisymmetric model for injection of a gas bubble into a liquid-filled elastic-walled Hele-Shaw cell bounded by a confined incompressible elastic solid \figrefp{fig:setup}{}. For injection of the same viscous liquid rather than gas, the cell is known to choke for flow rates exceeding a critical value. This choking occurs because the pressure gradient of the viscous flow squeezes the elastic solid towards the rim, where it bulges into the channel and makes contact with the opposite wall \citep{Box2020}. We have identified two mechanisms by which injection of a gas bubble instead of viscous liquid reduces the tendency of the cell to choke. Firstly, for a given flow rate, the proximity of the inviscid bubble to the cell rim reduces the size of the liquid region over which the cell is being squeezed towards the rim by the viscous pressure gradient. Using a quasi-steady analysis, we have obtained an approximation for the increased choking threshold as a function of the distance from the bubble to the rim \figrefp[c]{fig:chokesteady}. (The surface tension of the bubble can counteract this effect slightly, due to the capillary pressure drop causing a constriction of the cell ahead of the bubble, which warrants further investigation.) Secondly, compression of the gas reduces the flow rate of the liquid, and since choking requires the pressure to diverge, choking with a compressible gas is not possible. Instead, the gas compresses to keep the flow rate below the choking threshold, resulting in a near-choking behaviour in which the liquid flow rate closely follows the bubble-position-dependent theoretical threshold regardless of the nominal injection rate of the gas \figrefp[a]{fig:nearchoke}. The near-choking regime is similar to phenomena observed in other fluid--structure interaction (FSI) problems. For example, when a fluid is driven through a confined, deformable porous medium, the imposed pressure gradient squashes the medium against the outlet, which reduces the permeability and ultimately restricts the outflow, i.e.~the fluid flux reaches an upper bound and becomes insensitive to further changes of the pressure head~\citep{Hewitt16}. Flow saturation also occurs for inertial flow of a viscous fluid in finite-length elastic tubes: the increasing pressure head reduces the cross-sectional area of the tube leading to increase in the local fluid velocity, which in turn reduces the internal fluid pressure via the Bernoulli effect and causes further constriction of the tube ~\citep{Heil03}. Inherently, all of these mechanisms rely on interactions between a flow and an elastic structure, though the details of the FSI are different to the ones considered here. The study of choking involves the cell gap shrinking to zero. However, our model is formally not valid once the gap becomes too small, as other effects become important, such as adhesion forces between the walls, small-scale roughness of the surfaces, deviations from perfect axisymmetry, and (eventually) the breakdown of the continuum approximation. All of these effects are likely to promote choking by locally enabling initial contact between the walls in isolated azimuthal regions without incurring a divergent pressure. Hence, for example in the near-choking regime, although our model always predicts a very small but non-zero cell gap, in actuality the walls can make contact with each other and choke the flow. This presumably also explains why choking is readily observed in the experiments of \citet{Box2020} and \citet{Peng2022}. When the radius of the elastic solid is very large compared with its thickness, long-wave approximations can be applied in the bubble and liquid regions. We have shown that in this regime the elastic cell behaves like a rigid cell, but with modified kinematic and dynamic conditions at the advancing bubble front due to the deformation near the front, and a modified outlet pressure condition due to the bulging near the rim (\secref{sec:tw}). Although we have assumed axisymmetry in the present study, these approximations readily extend to non-axisymmetric flows. As a result, the viscous-fingering instability in the elastic-walled cell can be simulated using a standard Hele-Shaw solver for a rigid cell but with modified boundary conditions. Another application for the modified kinematic conditions at the bubble front is to infer the local flux, and hence the global flow rate, from non-axisymmetric experimental data for the position of the bubble front, as was done by \citet{Peng2022}. In their experiments performed at larger values of $Q_0$, \citet{Peng2022} suggested that compressibility of the elastic solid will begin to play a role in the problem as the injection pressure approaches a non-negligible fraction of the bulk modulus of the elastomer. It is straightforward to adapt the present model to account for solid compression, which introduces another non-dimensional parameter in the form of Poisson's ratio $\nu$. However, analysis of the model becomes more difficult, as the long-wave approximation is significantly more complicated \citep{Chandler2021} and the travelling-wave solutions depend on both $\nu$ and the bubble pressure $p_b$. \begin{acknowledgments} The authors thank F.~Box and A.~Juel for discussions. The work of the group from Manchester was funded by the EPSRC [Grant No.~EP/R045364/1]. The work of the group from Oxford was funded by the ERC under the European Union's Horizon 2020 Programme [Grant No.~805469] and by the EPSRC [Grant No.~EP/P009751/1]. \end{acknowledgments}
\section{Introduction} Developments in x-ray optics and synchrotron sources have opened up new investigation pathways into structural microscopy techniques capable of sub-micron resolution. Of particular interest recently is dark field x-ray microscopy (DFXM)~\cite{Simons2015} which provides a full-field, non-destructive glimpse into deep embedded grain structures with resolutions on the order of 100 nm. To achieve such a feat, x-ray optics placed in the diffracted beam provide a reciprocal space-sensitive spatial mapping of the diffracting grain (Fig \ref{fig:dfxm}). However, this presents challenges due to the relatively low efficiency of many x-ray optics \cite{pCRL,QiaoDFXM}. This becomes even more troubling when working with 2D systems, such as thin film geometries, drastically reducing scattering volume and thus the diffraction intensity. For such systems, higher collection times result in lower resolution due to mechanical instabilities present in instruments, reducing many of the advantages of the technique. Extensions of this technique to low-intensity systems open up a plethora of new investigation pathways. In most DFXM experiments up to now, large grains in polycrystalline samples have been used for investigation of their structural properties \cite{AHL2020142, BUCSEK2019273,Dresselhaus2021,Daniels2016,Yildirim2020}. There has been a push to extend this technique to more exotic cases such as pulsed-laser dynamics, thin films and non-structural Bragg peaks. Even with state-of-art light sources, all these instances typically produce signals that are significantly lower in intensity to those of large grains or single-crystal samples. To address this problem, we require either introducing a higher photon flux at the sample, achievable with a condenser lens, or improving the overall measurement efficiency. The first option reduces the field of view on the sample and effectively limits the full-field capabilities of this method. Improving optics efficiencies is difficult due to the limited number of materials that can be used for x-rays optics. This leaves improvements at the detector in the form of direct x-ray detection methods. Current detection methods for DFXM use indirect detection approaches where x-ray photons are converted to optical photons using a scintillator in combination with a high-resolution optical sensor. A primary advantage of this is an additional magnification arising from a lens placed between the scintillator and the camera. A shortcoming with using this detection method, however, is a reduction by several orders of magnitude in intensity at the optical sensor requiring longer collection times. This results in lower resolution and limits the timescales of dynamics which can be explored. Moreover, these scintillation-based detection systems become increasingly challenging at higher energies. These complications can be addressed by utilizing a detector meant for direct detection of hard x-rays at the cost of the additional optical magnification present in the scintillation-based system. One current problem with direct detection x-ray systems is their large pixel size (50 - 200 \textmu m) which are incompatible with full-field, microscopy applications. We present the first implementation of a novel 8 \textmu m pixel pitch direct detector for hard x-ray DFXM. \section{Methods and Materials} Dark-field x-ray microscopy (DFXM) operates in a normal diffraction setup with the only exception being the introduction of an x-ray objective lens post-diffraction to spatially resolve the illuminated portion \cite{Simons2015,QiaoDFXM}. The typical setup for such a technique is shown in Fig. \ref{fig:dfxm} where the lens is placed into the path of the diffracted beam. We leveraged the 6-ID-C station at the Advanced Photon Source (APS) which is equipped with a high-resolution diffractometer. A 1D condenser lens was placed into the path of the incident beam to increase the flux on the sample and reduce the footprint on the sample. The resulting approximate beam size is 70 \textmu m vertically and 10 \textmu m horizontally with a footprint of 70 \textmu m $\times$ 65 \textmu m at the Bragg angle of the sample, well matched to the field of view of the objective. For the objective lens, we used a polymeric compound refractive lens (pCRL) optimized for 20 keV~\cite{QiaoDFXM}. This particular lens focuses in 2D, with a focal length of 131~mm and an effective aperture of 68 \textmu m $\times$ 68 \textmu m. The scintillator used is 20 \textmu m thick LuAG:Ce; the effective pixel size at the scintillator is 1.3 \textmu m. Finally, the optical camera in this setup is an Andor Zyla sCMOS camera with a pixel pitch of 6.5~\textmu m and an optical magnification of a factor of 5. While the maxiumum frame rate for the Andor Zyla system is 100 fps, the low measurement efficiency of the scintillation-based system requires longer exposures dropping the effective frame rate to 1 - 0.1 fps We compare this optical setup, hereafter indirect detection (ID), against a 16-megapixel ($4096 \times 4096$) KAImaging BrillianSe amorphous selenium (a-Se) detector, hereafter referred to as direct detection (DD)~\cite{Scott:gy5022}. This detector has a pixel pitch of 8 $\mu$m, a nominal thickness of 100 \textmu m, and is capable of capturing x-ray images directly. For the current setup, we utilize 20~keV x-ray energy which results in a quantum efficiency of roughly 90\% making the BrillianSe detector ideal for low intensity signals coming from thin film samples. The BrillianSe detector has an operating frame rate of 2 Hz in a split rolling shutter architecture. This frame rate is limited by the readout times of 1865 ns per pixel with each column of 128x2048 pixels requiring at minimum 489 ms to read. However, our DFXM images typically only occupies 200 $\times$ 250 pixels. Future firmware upgrades will enable increased frame rate for a select region-of-interest. As this detector also operates in a rolling shutter architecture, each column begins its exposure at its bottom row of pixels and overlaps the next row's exposure with the reading of the current rows exposure. a-Se is optimal for use as a photoconductor due to its large bandgap energy (2.3 eV) leading to no free carriers at room temperature, high avalanche gain and low quantum noise when used for high-energy photons. This however requires high voltages to operate (10 kV/mm) and requires that the detector remain below the glass transition temperature of a-Se of 30~$^{\circ}$C \cite{SelenGlass,HuangSelenium}. Comparing two different detectors is a challenging prospect due to variations between sensors, materials and other variables. To rectify this, we opted to examine experimental performances using three metrics as our comparison: exposure times, resolution and feature detection. To compare the required exposure times between the two different detectors, we settled on exposure times that provided the same signal to noise ratio between the peak signal and the background. Comparing the two exposure times in this situation gives a rough estimate of the measurement efficiency between the two detector systems. For the resolution, we used a sample which has periodic spatial modulation with bright and dark fringes neighboring each other to act as a line pair. Finally, for feature detection, we used a weakly damaged sample to compared detectable features and as a secondary measure for resolution. The sample we are using as a test is epitaxially grown 40 nm thick YBa$_2$Cu$_3$O$_{7-x}$ (YBCO) thin film on a c-cut sapphire substrate with a CeO$_2$ buffer layer roughly 50 nm thick. This sample shows distinct periodic lines (Fig \ref{fig:binning}) which can be resolved in both DD and ID allowing for comparison of size and resolution. The sample was irradiated with a He$^+$ beam with a fluence of $2x10^{15}$ ions/cm$^2$ irradiated at 90 keV to determine defect feature sizes that are visible and their resolutions. \section{Results and Discussion} To compare these two detection methods, we assess adequate exposure times, resolution, and feature identification and size. We aligned our diffracted beam on the (006) YBCO Bragg peak and the (002) peak for the CeO$_2$ in the same sample position for a direct comparison of images. Images of the CeO$_2$ layer were taken at 1 s exposure lengths for the ID image and 10 ms exposures for DD. As for the YBCO layer, ID images were taken at 10 s exposures and DD images were taken at 100 ms exposures. These times were chosen to match relative grey values in the unprocessed images with respect to the background to have an appropriate comparison across both detectors. In terms of exposure time, a normalization across the two detectors by using the ratio of the peak to background gives an appropriate metric for comparison. By reducing the necessary exposure time, we are able to perform post-processing to remove inherent mechanical vibration effects in our experimental setup. Some fluctuations can be seen in the intensity profiles at faster exposure times (< 100 ms) coming from a combination of the rolling shutter architecture and cryogenically cooled monochormator (Fig. \ref{fig:binning}c). One additional advantage to these fast collection times is the ability to observe dynamics on the millisecond timescale. Dynamics faster than 1 ms will not necessarily be observable due to hardware limitations keeping the fastest exposure time at 1 ms. One consideration for the faster exposure time is the larger effective size of the pixels in the direct detection system in comparison to the scintillation. As previously mentioned, the effective pixel size of the scintillator is 1.3 \textmu m while the pixel size of the direct detection system is 8 \textmu m. The factor of 36 increase in area of the pixels between the two systems results in more x-ray flux per pixel. However, when binning the ID image into $6\times6$ summed pixels, we can see from Fig. \ref{fig:binning} that the overall intensity increases but some features become less resolved. The resolution also drops to 3-4 pixels in the ID image as compared with the 2 pixels picked up by the direct detection image. Finally, the comparison of the binned ID image with the direct detection image, shows a much sharper contrast between bright and dark fringes. In terms of resolution, we first determine that the magnification due to the x-ray objective lens to be $\sim 15\times $ with an additional $5\times$ from optical magnification. The line profile and the corresponding image (Fig. \ref{fig:lineProfileCeO2ResOptical}) allow us to determine the resolution, giving between 1.2-1.4 \textmu m transverse resolution for a line pair. Performing a similar process on the direct detection method (Fig. \ref{fig:lineProfileCeO2ResDirect}), we obtain the transverse resolution to 2 \textmu m resolution for a line pair. As expected, due to the higher acquisition time on the ID method, the resolution is lower than the optimal resolution of 480 nm \cite{QiaoDFXM} but still outperforms the direct detection method. While the resolution on the direct detection method is still relatively large, it still provides the ability to perform structural investigations at the mesoscopic scale. For the resolvable features, we utilized a weakly damaged sample with varying size and random defect locations to study. The ID image of these defects can be seen in Fig. \ref{fig:defectsCeO2Optical} which are circled. The size of these defects ranges from 1 \textmu m to 5 \textmu m in extent, providing a good range to determine visibility. A comparison of the YBCO layer defects can be seen in Fig. \ref{fig:defectsYBCOComp} which has a large gap matching in both the ID and DD images with a size of 11 \textmu m $\times$ 4 \textmu m. While the larger (>3 \textmu m) features are visible on the DD sensor, smaller features becoming increasingly hard to clearly separate from noise. \section{Conclusion} We presented a novel high efficiency direct detection method for use in DFXM to expand its applicability to systems with weaker diffraction signals. While the trade off for this detection method is a loss of resolution and small feature detection, the advantages for larger features far out ways the resolution compromise. While the scintillation plus optical detection allow for a smaller effective pixel size, the time required to observe systems that produce low-intensity diffracted beams reduces the resolution quite significantly due to ever-present mechanical instability. Faster collection rates when combined with vibrational corrections and discrete wavelet analysis feature tracking \cite{wavelet} may allow for observation of millisecond dynamics in low-intensity cases. This type of detector allows DFXM to be extended to a plethora of new materials and regimes previously unexplored using a full-field structural microscopy technique. Current physical limitations at the 6-ID-C beamline, prevent distances further than 2.4 m from being achieved. However, proposed upgrades at APS to improve coherent flux, along with larger sample to detector positions~(~$\sim$~5~m) and shorter focal length lenses, resolution with DD is expected to improve by more than double~\cite{APS-U_upgrade}. Past 30 keV, scintillation efficiency decreases rapidly and results in lower resolution and poorer image quality. This direct detection system will extend DFXM to higher energies and techniques requiring high resolution and high-energy such as Bragg coherent diffraction imaging~\cite{Bertaux:21}. Overall, access to a direct detection method with small pixel pitch that is optimized for hard x-rays in a DFXM setting opens up opportunities to new science previously inaccessible to ID methods. \section{Acknowledgments} This material is based upon work supported by the U.S. Department of Energy, Office of Science, Office of Workforce Development for Teachers and Scientists, Office of Science Graduate Student Research (SCGSR) program. The SCGSR program is administered by the Oak Ridge Institute for Science and Education for the DOE under contract number DE-SC0014664. This research used resources of the Advanced Photon Source, a U.S. Department of Energy (DOE) Office of Science user facility operated for the DOE Office of Science by Argonne National Laboratory under Contract No. DE-AC02-06CH11357. Materials and samples used in this work were supported as part of the "Quantum Materials for Energy Efficient Neuromorphic Computing" (Q-MEEN-C), an Energy Frontier Research Center funded by the U.S. Department of Energy, Office of Science, Basic Energy Sciences under the Award No. DESC0019273. The authors would like to thank the Karlsruhe Nano Micro Facility (KNMF) for the fabrication of the polymer x-ray optics and the invaluable help from KA Imaging Inc. regarding the BrillianSe detector.
\section{INTRODUCTION} Maps are often applied to help an autonomous system, such as a robot or automated vehicle, to understand unknown complex scenes, and therefore, locate and navigate itself accurately and safely. However, the uncertainties of the maps greatly affect the performance of localization, navigation security and collision avoidance for the autonomous system. The environment information can be represented in a straightforward way like point clouds, structured maps, or abstract surface models \cite{abstract_map}. The common maps are, e.g., the high-definition (HD) vector maps \cite{hd-map_localization}, acquired with high geometric and semantic accuracy, 2D or 3D-grids with occupancy probabilities, such as Octomaps \cite{octomap}, or 3D-City models with various level of details. Uncertainty sources in the environment map are inevitable due to, e.g. ambiguous environment information, sparsity, occlusions and noise in point clouds \cite{review}. Hence, when the map is treated as an ideal perfect reference in localization and path-planning tasks without considering its quality, it can result in severe errors, e.g., the wrongly modelled occluded building façades might cause the deviation in pose estimation. Additionally, one may use multiple sensors to perceive the environment or has the demand of updating the existing maps with new data. In those scenarios, a good uncertainty measure of the maps created by different sensors and agents is essential for data fusion and motion planning purposes \cite{slam-uncertainty}. Although many existing studies about uncertainty models are found in automated driving related fields, they are mostly for pose estimation. There is a lack of sufficient research about describing the accuracy and precision of maps. In the field of simultaneous localization and mapping (SLAM), the uncertainty-aware tasks require a reasonable expression of map uncertainty. There are some existing methods estimating the uncertainty of maps to improve the localization accuracy or make the results more robust\cite{ndt,interval_localization, abstract_map}. For example, Biber and Straber \cite{ndt} proposed to represent the environment using normal distribution transform (NDT) maps, where the map uncertainty is represented by the distribution in each cell. However, it assumes independent discontinuous distributions of the neighboring cells and has been found to result in higher uncertainty at cell boundaries \cite{gmm3}. Javanmardi et al. \cite{abstract_map} introduced the idea to build abstract vectors and planar surface maps of buildings and grounds, where the uncertainty is given by the normal distribution generated from vectors and planes. Building maps with fixed interval uncertainties are used in hybrid interval-probabilistic localization \cite{interval_localization}. Occupancy maps with uncertain occupied cells are also widely used in localization, whose uncertainties are represented by the occupancy probabilities. All these existing studies prove the importance of quantifying the uncertainty of maps. However, it remains challenging to map the continuous space from noisy sparse point clouds and assign reasonable uncertainties to it. There is still a research gap for measuring the spatial uncertainty of maps in urban areas. There are many man-made structures with relative regular geometrical shapes, where buildings are often the most important ones for localization, e.g. as used in \cite{abstract_map, interval_localization}. A detailed spatial uncertainty representation of building models in urban scenes is of great interest to explore. The choice of an adequate uncertainty measure in environment mapping is critical. To tackle this problem, the uncertainty and completeness of a map can be described in a probabilistic fashion. GP with its data-driven and probabilistic nature has proven to be a powerful tool for the quantification of uncertainty in various research fields. Dragiev et al. \cite{gp-implicit-map} proposes the GP implicit surfaces for the object in the environment for efficient robot manipulation. Mouhyemen et al. \cite{{multi-sparse-gp}} combines a parametric model of the system with sparse GPs to capture unmodeled dynamics. The posterior mean and covariance kernel of a GP serve as the best estimation of the object and the uncertainty measure, respectively. GP Occupancy Mapping (GPOM)\cite{gpom} demonstrates how to predict a continuous occupancy map from the sparse noisy point clouds with the non-parametric GP inference. The occupancy probability of unexplored space with no rays passing through or hitting are regressed by spatial neighbors in GP including well-calibrated uncertainties. It provides the possibility to capture the underlying correlation between spatially neighboring cells. The continuous inference gives the generalizability to building a map of desired resolutions in diverse applications. However, the drawback of GP lies in the expensive computational cost due to matrix inversion operations and this drawback limits the applicability of GP for large datasets. In order to achieve an acceptable computational efficiency, many approximation approaches such like the partition of spatial world into subsets, fusion of local GPs with Bayesian Committee Machine (BCM) or an sparse approximation of GPs have been proposed \cite{gpom, gpmap, gpom_fast,sparsekernel,multi-sparse-gp}. To avoid the unreliable prediction from successive BCM updates, Bayesian generalized kernel Octomap (BGKOctomap) \cite{bgk} leverages Bayesian kernel inference and sparse kernels to perform a stable inference-based occupancy mapping. Jadidi et al. \cite{gp_frontier} expanded the occupancy mapping to probabilistic geometric frontiers computed efficiently using the gradient of the GP occupancy map. Except for the efficiency, the occasional discontinuities in the environment can cause some troubles while the GP is often used for continuous targets. This effect is not well-studied in the current GP-based mapping. There is another group of research learning structural surface models from measurements to probabilistically represent the perceived space. Thrun et al. \cite{{multiplane}} fitted a set of rectangular flat surfaces to compose three dimensional (3D) maps, with a group of parameters optimized by Expectation Maximization (EM) and the number of planes estimated by a Bayesian prior. With similar spirit but higher fidelity in approximating diverse arbitrary environments, Gaussian Mixture Models (GMMs) are employed as a semi-parametric tool with large numbers of components to extract the planar models \cite{gmm1} or obtain a high-fidelity representation of sensor observations\cite{gmm2, gmm3}, estimating Gaussian mixtures instead of 3D planes. Nevertheless, the number of components has a great impact on the performance of GMM-based approaches and it is a non-trivial task to choose a proper number. In this work, GP is used to obtain an inference-based surface model of structured buildings with GMM priors, leveraging the flexibility of non-parametric methods in arbitrary structures as well as the scalability of parametric approaches in large environments. When exploring large urban scenes, buildings are one of the most important structures for localization, which have relatively simple geometry and are easy to extract. GMM are first applied to extract the main planar surfaces with a few components, while GPs are used to carve the irregular parts. In GP inference, the sets of local GPs corresponding to the certain planar objects are applied to adapt the discontinuities and reduce redundant computation, while the sparse kernel and data block partitioning techniques similar to the prior work \cite{gpmap, gpom_fast} are utilized to further improve the computational efficiency. The contributions of this work are the following: \begin{itemize} \item We mapped uncertain building models in a probabilistic manner, which can be used in many down-stream tasks and updated probabilistically. This method aims to solve the problem of a lack of the uncertainty quantification for reference maps. The value of the uncertainty representation is revealed in the experiments when better results are obtained with only the accurate inference. \item GMM planes and local GP blocks are combined to yield a map with efficient surface prediction and maintain a good accuracy. Both GMM planes and GP function give a statistical uncertainty to the mapping process. \item We evaluate the mapping performance and the rightness of uncertainty description with real-world LiDAR point clouds of buildings, collected by a mobile mapping system (MMS). The Precision-Recall (PR) curve and areas under curve (AUC) are used as the metric to evaluate the mapping results of Octomap, fast GPOM, BGKOctomap and our method. A comparison to the ROC AUC metric is also discussed. \end{itemize} The rest of the paper is structured as follows. Section II defines the problem we aim to solve as well as the representation of building maps with uncertainty measures. In Section III, a brief introduction of the GMM and GP are presented. We explain how GPs are used to model non-planar surface with GMM prior to represent the uncertain building façade surface. The strategies for parameterizing the discontinuities, reducing computational efforts and outlier filtering are explained in detail. In Section IV, experiments using real LiDAR data collected by MMS are presented, where the qualitative results and quantitative evaluation with the state-of-the-art benchmarks are shown. Finally, we provide our conclusions and outlook for future work in Section V. \section{PROBLEM STATEMENT} Concerning the problem of mapping uncertain building models as the premade map for an automotive robot in outdoor scenarios, we aim at offering a quantitative uncertainty measure for building models, as illustrated in Figure \ref{fig:b15}. Considering that sensors provide uncertain positions of points with noise and errors, this measure properly describes the quality of the map and is able to be refined or integrated with new data from subsequent measurement campaigns or from different sensors. As pre-processing work, classification of the raw measurements is performed to extract the building points for modelling. \begin{figure}[thpb] \centering \includegraphics[width=1\linewidth]{figures/b15_w.png} \caption{ Depiction of a building model where for each location an uncertainty can be queried (indicated as color using the shown scale). } \label{fig:b15} \end{figure} Buildings consist of façades, with planar protrusions, extrusions, slopes (non-vertical planes, where the depth changes) and non-planar shapes. In the local frame of a façade, we consider the depth value over the façade plane as a continuous representation of the building surface. It is modelled with two parts: (1) regular planar parts are segmented by GMM; (2) each local GP is modelled in a planar segment to capture the arbitrary shapes. The planar parts can be modelled with a few plane parameters and boundary points indicating the location and the shape of a local planar facet. Main façade plane, protrusions and extrusions can be specified with the corresponding plane layers resulting from a GMM. The remaining non-planar parts are represented as an implicit surface via non-parametric approaches. The local facet provides the prior information for modelling the non-planar points that fall into it. The parameters and boundary points of an extracted façade plane are given as prior; the non-planar surface on this plane can be represented with the GP function. In this case, a GP surface is a function telling the depth value of each location in space. A point $x$ over a plane has a distance $s$ to the prior mean of: \begin{equation} s = f(x) \left\{ \begin{array}{cl} = 0 & : \ \text{ on the mean surface}, \\ <0 & : \ \text{ on an extrusion}, \\ >0 & : \ \text{ on a protrusion}. \end{array} \right. \end{equation} This GP surface representation will provide an estimate of depth regarding the local planar segment at any location on the surface as well as the corresponding uncertainty of the estimation. When counting all components, the surface depth is given by $d$: \begin{equation} \label{eq:statement} d = g(x) + f(x|x\in G), \end{equation} where $g(x)$ is the expected plane depth from GMM results and $f(x|x\in G)$ denoting the local implicit representation with regard to the planar component G. \section{UNCERTAIN BUILDING SURFACE MODEL} In the following, we illustrate how the uncertain building models are represented probabilistically using GMM and GP. To generate uncertain building models, the building points are firstly extracted by the semantic classification from calibrated MMS point clouds. For each individual building, each façade plane is extracted by using the Random Sample Consensus (RANSAC) approach \cite{ransac}, where points are allocated to the corresponding façades. Then an uncertain model of façades can be explored. \subsection{Gaussian Mixture Model for planar surfaces} A façade is mainly composed of planar objects, which can be modelled by the plane normal, location, and the boundary of the facets. The plane normal, i.e. the orientation of the building façade, is determined by the principle component analysis (PCA), using the eigenvector belonging to the smallest component. It serves as the depth direction, which decides the local frame of the façade used in the following modelling. Many map representations such like 3D CityLoD2 models only map the building façade with one plane and ignore the extrusions and protrusions. Often, the uncertainty is not specified at all, or if it is, is given in terms of a single, global standard deviation only. This is not sufficient for many tasks requiring high accuracy. In this paper, GMM is applied to cluster the points with different depth values to certain depth layers. Each depth layer is described by one Gaussian component in the GMM: \begin{equation} p(d)=\sum_{k=1}^{K}{\pi_k \mathcal{N}(d|\mu_k,\sigma^2_k )}, \end{equation} where $d$ is the surface depth of a point, $K$ being the number of Gaussian components; $(\pi_k, \mu_k,\sigma_k)$ are the GMM parameters for the $k$-th depth layer, $\pi_k$ being the prior probability or weight, meaning the importance of the component, and $\mu_k$ and $\sigma_k$ being the mean and standard deviation of the Gaussian distribution. The parameters $\{(\pi_k, \mu_k,\sigma_k)\}_{k=1}^K$ are optimized by maximizing the log likelihood using the EM algorithm. Figure \ref{fig:gmm} shows an example of the GMM results. The Gaussian component with the highest prior probability is the main façade plane. Nevertheless, the limits of GMM are: 1) Non-planar surfaces cannot be modelled. 2) If the numbers of points on different layers have large disparities, meaning the training for different components is not balanced, the model might fail to model the small protrusions and extrusions. 3) Slopes might be simply modelled as a vertical plane. The non-parametric approach GP, on the other hand, is capable to model them with a data-driven nature. It is, therefore, introduced here to solve these problems mentioned above. \begin{figure}[ht!] \centering \includegraphics[width=1\linewidth]{figures/GMM.png} \caption{GMM for plane modelling: the left picture shows a façade profile, i.e., all scanned points of a façade in a top view; The Gaussian components (right) with different colors represent each depth layer. The one with highest peak is the main façade plane.} \label{fig:gmm} \end{figure} \subsection{Gaussian Process} A GP $f(x) \sim GP(\mu(x),k(x,{x}^{'}))$ is a popular Bayesian nonlinear regression method in machine learning. It can be seen as a multivariate normal distribution with infinite variables in a continuous domain, e.g. a continuous space. The distribution of any finite subset of those variables is still a joint Gaussian distribution. It is characterized by a mean function $\mu(x)$ and a covariance function $k(x,{x}^{'})$, which is also called kernel function. The prior GP mean function is often set to zero. There are many possible choices for the kernel function and in this paper, automatic relevance determination (ARD) is used as the prior GP kernel function: \begin{equation} \label{eq:kernel} k_0(\boldsymbol{x},\boldsymbol{x}^{'})= \sigma_p^2 \exp\left(-\frac{1}{2}\sum_{m=1}^{2}b_m(x_m-x_m^{'})^{2}\right), \end{equation} where $\bm{\uptheta}=(\sigma_p,b_1,b_2)$ are the hyper-parameters for the kernel function, which are optimized by maximum likelihood given a measured dataset. Provided a measurement dataset $\bm{D}=(\bf{X},\bm{y})$, where ${\bf{X}}=\{{\bm{x}}_i\}_{i=1}^N$ are $N$ input vectors and $\bm{y}=\{y_i \}_{i=1}^N$ are the corresponding target values measured with additive noise $\eta_i \sim \mathcal{N}(0,\sigma_\eta^2)$, we have the following likelihood: \begin{equation} p(\bm{y}|{\bf{X}}, \bm{\uptheta})=\mathcal{N} (y|{\bf K}_N+\sigma_\eta^2 {\bf I} ), \end{equation} where ${\bf K}_N= k_0 ({\bf{X}}, {\bf{X}})$ is the covariance matrix of the input points with $N\times N$ entries calculated by the prior kernel function. The rest of the space $\bf{X}_*$ can be predicted with a multivariate Gaussian distribution conditioned on the observations $\bm{D}$. The posterior GP mean and kernel are calculated by \cite{gp-book}: \begin{equation} \mu(\boldsymbol{x}_*)=\mu_0(\boldsymbol{x}_*)+ {\bf k}_*^T ({\bf K}_N+\sigma_\eta^2 {\bf I} )^{-1} (\boldsymbol{ y}-\mu_0 ({\bf X})), \end{equation} \begin{equation} k(\boldsymbol{x}_*,\boldsymbol{x}_*^{'})=k_0 (\boldsymbol{x}_*,\boldsymbol{x}_*^{'}) - {\bf k}_*^T ({\bf K}_N+\sigma_\eta^2 {\bf I} )^{-1} {\bf k}_*^{'}+\sigma_\eta^2, \end{equation} where the prior mean $\mu_0 (\boldsymbol{x})$ is set to zero, $[{\bf k}_*]_N= k_0 ({\bf X}, x_* )$ and $[{\bf k}_*^{'} ]_N= k_0 ({\bf X}, x_*^{'} )$ are the prior covariance between the $N$ input training points and the predicting points. To utilize GP in generating an uncertain building model with dense point clouds, there are mainly two problems. First, mapping methods using GP have to consider the discontinuity of the environment while the GP often encodes the continuity and smoothness assumptions on targets. It is hard to model functions, which exhibit arbitrarily large derivatives, with a GP. Unfortunately, the large derivatives often appear in environment mapping. This issue is also addressed in \cite{gpom, gpom_fast}, where they tried special kernels to adapt the discontinuities, e.g. the Mat\'ern covariance functions. However, the improvement is limited. Second, with large training datasets, the GP regression faces the computational problem due to the inversion matrix calculation having time complexity $O(N^3)$. To capture the discontinuity and reduce the computational cost of GP in the case of a building model, two strategies applied here are: 1) using the GMM results as prior and 2) partitioning data into blocks. These strategies are explained in detail in the following sections. \subsection{GMM as Prior} Since buildings have relatively simple shapes with many planar objects, these planar parts can be modelled by a GMM as introduced in Subsection III.A. The estimated $\mu$ are used as local prior GP means for modelling the remaining surface with non-planar points, points of non-horizontal normals and abnormal points too far away from the mean. In this way, the GMM information reduces the number of training points for the GP, as only the latter are used for GP training. Additionally, the entire continuous space is divided into multiple local areas of GMM facets, modelled with GP-based approaches individually. This reduces the size of the kernel matrix. On the other hand, the planar segments with sharp depth variance compared to the neighboring regions cause the discontinuity on building surfaces. Another advantage of using GMM results as prior is to capture and parameterise the discontinuities on the façade surface. The independence can be introduced in different mean and covariance functions that are applied in different areas of the input locations. The mean value of each Gaussian denotes the prior surface depth expectation of each planar layer, with standard deviation quantifying how precise and trustful the estimation is. The non-planar points which fall into a local facet on a certain layer are modelled by a local GP with this prior mean. The $g(x)$ in Equation \eqref{eq:statement} is substituted by the mean $\mu_k$ of a GMM component. The whole dataset is divided into subsets according to the results of GMM. Each local GP model has its own hyper-parameters and estimates the predictions only for the corresponding area. Initially, we had considered the weighted averaging operation for the small intersection area and the neighborhood of adjacent local segments, using BCM \cite{grbcm} or Product of Expert (PoE) \cite{poe}. However, there is no obvious improvement from the fusion and the decreased uncertainty after the mixture is not desired in our case. The efficiency is affected too. Thus, the mixtures of local GPs are not applied in this paper. We categorize the points that cannot be well modelled by the GMM into: (1)~non-planar points, (2)~non-vertical slopes and (3)~the points which are significantly excluded from their Gaussian distributions, i.e. not within the 95\% confidence interval of the certain component. These points will be selected as training points and model the GP implicit surface as a function telling the continuous surface depth estimate. The points are selected according to the rules regarding the depth value $d$ and the normal ${\bf{n}}=\{n_x,n_y,n_d\}$: \begin{equation} \label{eq:condition1} |d-\mu_k |>1.96 \sigma_k, \end{equation} \begin{equation} \label{eq:condition2} n_d ({\bm{x}})<0.9, \end{equation} where $\mu_k$ and $\sigma_k$ are the parameters of the $k$-th Gaussian layer, $n_d ({\bm{x}})$ is the component of the normal $\bf{n}$, which is perpendicular to the main façade plane. Optimization of the parameters involves a reasonable choice of the initial estimates. To speed up the learning process, these initial values are decided according to the following rules: \begin{itemize} \item The initial estimate for $\sigma_p$ in the kernel of a local GP is set as the standard deviation of the corresponding planar patch $\sigma_k$; \item The initial $\{b_1,b_2\}$ are set to the same value, i.e. isotropic. We set $\frac{1}{b_1}=\frac{1}{b_2}=0.05m$, observed from the investigation of the impact of the length-scale $l=\frac{1}{b_1}=\frac{1}{b_2}$ on kernels and the learning samples; \item $\sigma_\eta$ reflects the precision of the sensors, point cloud alignment noise and random environmental noise. It is set based on the data situation. In this case, $\sigma_\eta = 0.02m$. \end{itemize} \subsection{GP-block} Although we reduced the training points in the last section, the computational efficiency can be further improved by the data partitioning and GP-block techniques, which are inspired by \cite{gpmap}. In practice, the spatial correlation between two points decreases with their distance. This property is naturally captured by the length-scale hyper-parameter $\bm{b} = (b_1, b_2)$ in the covariance functions of the GPs. As the points far from each other have negligible influence that can be ignored in the covariance matrix, only close points have significant covariance and need to be considered in GP. An idea to exploit this property is to apply a sparse covariance function \cite{sparsekernel}, by setting the covariance to zero when the distance is larger than a threshold. It also indicates the possible data partition of the training data. The entire training samples can be divided into some local blocks within a certain range, as employed in some GP mapping research\cite{gpmap,gpom_fast}. In those methods, the block size is set as the predefined scale value of the sparse kernel while in our case, the block size is determined by the distance corresponding to the threshold $c_{min}$ of covariance values, calculated by Equation \eqref{eq:kernel}, when $\sigma_p$ is temporarily set as 1 and $b_1=b_2=b$: \begin{equation} \exp\left(-\frac{1}{2}\sum_{m=1}^{2}b(x_m-x_m^{'})^{2}\right) \geq c_{min}, \end{equation} where $c_{min}=0.0001$ in this case. The block size is equal to $|\bm{x}-\bm{x}^{'}|$ when it makes both sides equal. The extended block of a given block is defined as the central block with its neighboring blocks. In GP regression, the points from the extended block are the training data for the central block being under consideration. \subsection{Outlier filtering} To generate a GP inference robust to outliers, a model is required for outlier processing. There might be some outliers in the training samples due to false classifications (e.g. points of road signs in the vicinity of a building) or other unexpected reasons. In existing research\cite{outlier1,outlier2,outlier3_studentt}, robust variants of GP regression have been proposed with long-tail distributions as the likelihood function instead of Gaussian noise, e.g. Student's~$t$ distribution. However, Student's~$t$ likelihood can not be calculated in closed form in inference of the posterior \cite{outlier1, outlier3_studentt}. The alternative approach is to directly have a statistical test on a GP with Gaussian likelihood to check the probabilistic significance and identify the outliers, e.g. a Chi-squared test. In this work, the Chi-squared test with one degree of freedom is applied to remove outliers. The procedure of outlier filtering is as follows. \begin{enumerate} \item The GP is trained normally with all training data and infers the mean and variance of each training point, \item The Chi-squared test-statistic is calculated using $v_i^{2} = (d_i - \mu_i)^{2} / \sigma_i^{2}$, \item The test-statistics are compared to the $\chi^{2}$ value given a certain $\alpha$-quantile level and the points with test-statistic values larger than $\chi^{2}$ value will be removed as outliers, \item The GP is trained again with the filtered training data and the test points are predicted with mean and variance. \end{enumerate} The above process may as well be repeated to iteratively trim the outliers, which, however, will lead to an increased computation time. Therefore, in this case we only perform the test once in our experiment. The $\alpha$-percentile level in the test serves as a threshold to filter outliers, indicating the strictness of outlier detection. High values of $\alpha$ will see many points as outliers, while a small $\alpha$ gives more tolerance to the points deviating from the mean and might miss the outliers. \section{EXPERIMENTS AND EVALUATION} \subsection{Dataset} The GP-based implicit representation of a building surface is evaluated by the real-world LiDAR point clouds collected by a Riegl VMX-250 mobile mapping system for the urban environment, in Hanover, Germany. The scanner measurements of the system are specified as 5-mm precision, 10-mm accuracy. However, the accuracy of the GPS sensor in the system is much worse than the laser scanners. Point cloud alignment is thus used to correct the GPS trajectories in preprocessing and the data noise is given by a 2-cm standard deviation, resulting from the alignment \cite{alignment}. In the experiments, only building points are of interests, which were extracted using the deep learning based method provided in \cite{classification}. In total, we used six measurement campaigns for the same urban areas collected at different dates to obtain very dense point clouds. Point clouds from one measurement campaign are used for modelling the uncertain map and the rest of data is used for testing and evaluation. In one single measurement campaign, the number of points for one building façade depends on the building size and the measurement density. It is often larger than 10,000, and can reach up to 450,000 in our dataset. \subsection{Experiments} The building façades are firstly transformed individually to the local frame of their main planes, where a map point is a 2.5-dimensional point $\mathcal{P}=\{\bm{x} ,d\}$, with the location $\bm{x} \in \bm{R}^2$ on the plane and the depth value $d$ in the direction of the plane normal. The normal of the plane is derived by the PCA of all façade points. In the local façade frame, the planar points inside the 95\% confidence interval are used as i.i.d. samples to optimize the parameters of GMM. Other points selected according to Equation \eqref{eq:condition1} and \eqref{eq:condition2} are used to derive the posterior GP-based inference models. The initial hyper-parameters are given based on the rules in Section III.C. Initial $\sigma_\eta$ is 2-cm for this dataset. Figure \ref{fig:qualitative} is the qualitative result of modelled buildings with corresponding uncertainties. There are some occlusions in the original point cloud measurements, where the occluded surface is also inferred by the GP with high uncertainty (red). In the practical applications, users are able to select only the accurate part of maps or use the entire reference map with weights indicating the uncertainty. \begin{figure}[ht!] \centering \includegraphics[width=1\linewidth]{figures/qualitative_localgp.png} \caption{Qualitative results of the uncertain building models: uncertainties of the modelling are denoted by colors. Redder colors indicate higher uncertainties while blue colors denote low uncertainties.} \label{fig:qualitative} \end{figure} \subsection{Evaluation} To evaluate the proposed method, the existing state-of-the-art approaches are used as benchmarks, i.e. Octomap \cite{octomap}, GPOM \cite{gpom_fast}, and BGKOctomap \cite{bgk}. Making the comparison possible, we first transform our abstract surface map to the 3D occupancy map, where probabilistic least-squares classification is applied, inspired by the previous research \cite{gpom,gpmap}. The metrics used for evaluation are: 1) Precision-Recall (PR) curves and 2) Areas under the curve (AUC). Note that some previous work used the receiver operation curve (ROC) and the corresponding AUC as the metrics. However, it is not proper to use ROC in highly-skewed data, where a large change in the number of false positives can only lead to a small change in the false positive rate used in ROC \cite{rocpr}. This occurs in our case, when the number of free samples is much larger than the number of occupied ones in outdoor scenarios. This issue is also addressed by the previous research \cite{metric}. Alternatively, PR-curve is more suitable for the highly imbalanced data \cite{rocpr} especially when the positive (occupied) case is of more concern. Precision compares the false positives with true positives, and therefore, captures the detection errors of a large number of false positives. The goal of PR curves is to achieve the right-up corner instead of the left-up corner in ROC. \begin{figure}[ht!] \begin{subfigure}{.5\textwidth} \centering \includegraphics[width=.9\linewidth]{figures/resolution_0.1_scan_num_10_0.png} \caption{Resolution: 0.1m} \label{fig:pr0.1} \end{subfigure} \begin{subfigure}{.5\textwidth} \centering \includegraphics[width=.9\linewidth]{figures/resolution_0.05_scan_num_10_0.png} \caption{Resolution: 0.05m} \label{fig:pr0.05} \end{subfigure} \caption{PR curves and AUC comparison: the AUC value of each curve is given in the legend.} \label{fig:pr_curve} \end{figure} Figure \ref{fig:pr_curve} compares the AUC of different approaches modelling the space occupancy in two resolutions (0.1m and 0.05m). In general, GP inference-based maps have better performance, among which, our proposed method (green and orange curves) achieves the highest AUC values and is more robust to the small resolution. The green curves denote the case when we only consider the accurate inference of the map, i.e. areas with small uncertainty. The variance threshold is selected as 0.01 in this case. Areas with inference variance larger than 0.01 are seen as unknown. The figure shows that improvement is obtained by using only the accurate parts and the corresponding maps (green curves) give the best performance. This shows the value of the uncertainty representation of maps and indicate the potential application of this uncertain model in the down-stream uncertainty-aware tasks. \section{CONCLUSIONS} In summary, this paper proposed a method to generate building models as reference maps with associated uncertainty measures. The GMM and GP approaches are combined to map the planar parts and non-planar surface together. Local GP and data partition techniques are introduced in GP to reduce the computational cost and parameterizing the discontinuity of the building surface. In the experiments, the abstract surface map is transformed to an occupancy map representation using probabilistic least-squares classification, and then is compared using the benchmarks. The result evaluation shows that our local GP with GMM prior yields the highest AUC values, and with the variance threshold, the accurate inference gives even better performance. It shows the potential to work with uncertainty in the future applications. The generated map will be applied in the localization tasks in the future and the positioning results will be compared with other methods, such as NDT-based localization. The approach also has large potential to be used for incrementally updating and refining existing models from new data or other sensors; this will also be studied in future work. \addtolength{\textheight}{-12cm} \section*{ACKNOWLEDGMENT} This work was funded by the German Research Foundation (DFG) as a part of the Research Training Group GRK2159, “Integrity and collaboration in dynamic sensor networks” (i.c.sens).
\section{Introduction} The goal of this paper is to prove the following Skoda-type theorem. \begin{theorem}\label{thm:SkodaBL} Let $X$ be a Stein manifold and let $E,G \rightarrow X$ be holomorphic line bundles with (singular) hermitian metrics $\e^{-\varphi}$ and $\e^{-\psi}$, respectively. Fix $h = (h_1, \dots, h_r) \in H^0(X, (E^* \otimes G)^{\oplus r})$ and $1 < \alpha < \frac{r+1}{r-1}$. Assume that \[ \I \ddbar \varphi \geq \frac{\alpha(r-1)}{\alpha(r-1)+1} \I \ddbar \psi. \] Then, for any $g \in H^0(X,G \otimes K_X)$ such that \[ \norm{g}_G^2 := \int_X \frac{|g|^2 \e^{-\psi}}{(|h|^2 \e^{-\psi+\varphi})^{\alpha(r-1)+1}} < +\infty, \] there is $f = (f_1, \dots, f_r) \in H^0(X, E^{\oplus r} \otimes K_X)$ such that \[ g = h \dototimes f := h_1 \otimes f_1 + \dots + h_r \otimes f_r \] and \[ \begin{split} \norm{f}_{E^{\oplus r}}^2 &:= \int_X \frac{|f|^2 \e^{-\varphi}}{(|h|^2 \e^{-\psi+\varphi})^{\alpha(r-1)}} \\ &\leq r \frac{\alpha}{\alpha-1} \int_X \frac{|g|^2 \e^{-\psi}}{(|h|^2 \e^{-\psi+\varphi})^{\alpha(r-1)+1}} = r \frac{\alpha}{\alpha-1} \norm{g}_G^2. \end{split} \] \end{theorem} If the number of generators $r$ is at most $\dim X + 1$, Theorem \ref{thm:SkodaBL} almost recovers the line bundle version of Skoda's Theorem \cite[Theorem 2.1]{Varolin2008}. We say ``almost'' because in Theorem \ref{thm:SkodaBL} we have $\norm{f}_{E^{\oplus r}}^2 \leq \frac{r\alpha}{\alpha-1} \norm{g}_G^2$ rather than $\norm{f}_{E^{\oplus r}}^2 \leq \frac{\alpha}{\alpha-1} \norm{g}_G^2$. Still, even though stronger results are known, the main contribution lies in the technique used to prove Theorem \ref{thm:SkodaBL}. Both the original proof of Skoda \cite{Skoda1972} and more recent generalizations \cite{Varolin2008} are based on functional analysis and the Bochner formula, plus some very careful linear algebra estimates. Here instead we present a deformation argument based on Berndtsson's Theorem on the positivity of direct image bundles \cite{Berndtsson2009}. The general philosophy is inspired by Berndtsson and Lempert's proof of the $L^2$ Extension Theorem \cite{BerndtssonLempert2016, Lempert2017} and by Ohsawa's proof of a Skoda--type division theorem as a corollary of the Ohsawa-Takegoshi $L^2$ Extension Theorem \cite[Section 3.2]{Ohsawa2015}. Ohsawa indeed remarks that the division problem can be reformulated as an extension problem on the projectivizations of the dual bundles. It is thus natural to wonder whether a Skoda--type theorem could be proved directly using techniques akin to \cite{BerndtssonLempert2016}. The main idea is to look at all possible linear combinations $v_1 \otimes f_1(x) + \dots + v_r \otimes f_r(x)$. Then one constructs a positively curved family of metrics that at one extreme ``localizes'' the problem at the point of interest $v = h(x)$ and at the other extreme retrieves the usual $L^2$ norm for $f$. Near $h(x)$ the optimal extension is somehow ``trivial''; for instance, if $h(x) = (h_1(x), 0, \dots, 0)$, one takes $f(x) = (h_1(x)^{-1}, 0, \dots, 0)$. The positivity of the direct image bundle \cite{Berndtsson2009} will then imply that one can control $\norm{f}_{E^{\oplus r}}$ by the norm of the trivial extension near $h(x)$. This last step is an instance of a more general extrapolation technique for estimating operator norms under suitable curvature conditions \cite{Lempert2017}. The outline of the paper is as follows. In Section \ref{sec:reductions} we reduce to the case in which $h_1, \dots, h_r$ have no common zeros and $X$ is a relatively compact domain in some Stein manifold. Section \ref{sec:dual-formulation} reformulates the problem as an estimate on the dual norm of some special functionals on $H^0(X, E^{\oplus r} \otimes K_X)$, and a calculus lemma is proved in Section \ref{sec:calculus-lemma}. The main argument is in Section \ref{sec:main-argument}: after defining the deformation in \ref{subsec:setup}, we compute the extrema of the family of metrics in \ref{subsec:extrema} and we apply Berndtsson's Theorem in \ref{subsec:convexity} to conclude the proof. \vspace*{10pt} \paragraph*{\textbf{Acknowledgements}} I am grateful to Dror Varolin for bringing this problem to my attention, for many helpful discussions and a lot of encouragement. I also thank Bo Berndtsson and L\'{a}szl\'{o} Lempert for providing useful comments and suggestions. \section{Preliminary reductions}\label{sec:reductions} \paragraph{\textbf{No base locus}} We can assume that the sections $h_1, \dots, h_r$ have no common zeros. Indeed, let $D$ be the zero-set of $h_r$. Then $X \setminus D$ is again Stein and $h|_{X \setminus D}$ has no zeros. Assuming that Theorem \ref{thm:SkodaBL} holds for $\{h_1 = \dots = h_r = 0\} = \emptyset$, we obtain $\tilde{f} \in H^0(X \setminus D, (E^{\oplus r} \otimes K_X)|_{X \setminus D})$ such that \[ g|_{X \setminus D} = h|_{X \setminus D} \dototimes \tilde{f} \] and \[ \int_{X \setminus D} \frac{|\tilde{f}|^2 \e^{-\varphi}}{(|h|^2 \e^{-\psi+\varphi})^{\alpha (r-1)}} \leq r \frac{\alpha}{\alpha-1} \norm{g}^2_G < +\infty. \] As $h$ is bounded on any bounded chart $U \subset\subset X$, \[ \int_{U \setminus D} |\tilde{f}|^2 \e^{-\varphi} \leq C \int_{U \setminus D} \frac{|\tilde{f}|^2 \e^{-\varphi}}{(|h|^2 \e^{-\psi+\varphi})^{\alpha(r-1)}} \leq C r \frac{\alpha}{\alpha-1} \norm{g}^2_G < +\infty, \] where $C > 0$ depends on $U$, $h$ and $\alpha(r-1)$. Hence, by Riemann's Removable Singularities Theorem, $\tilde{f}$ extends to $f \in H^0(X, E^{\oplus r} \otimes K_X)$. As $D$ has measure 0, \[ \int_{X} \frac{|f|^2 \e^{-\varphi}}{(|h|^2 \e^{-\psi+\varphi})^{\alpha(r-1)}} = \int_{X \setminus D} \frac{|\tilde{f}|^2 \e^{-\varphi}}{(|h|^2 \e^{-\psi+\varphi})^{\alpha(r-1)}} \leq r \frac{\alpha}{\alpha-1} \norm{g}^2_G < +\infty, \] and, because $h \dototimes f$ and $g$ coincide on the open set $X \setminus D$, we have $h \dototimes f = g$ everywhere on $X$, solving the division problem. \begin{remark} The same argument proves Theorem \ref{thm:SkodaBL} when $X$ is essentially Stein, given that it has been proved for Stein manifolds. Recall that a manifold $X$ is \emph{essentially Stein} if there is a divisor $D$ such that $X \setminus D$ is Stein. For instance, projective manifolds are essentially Stein. \end{remark} \paragraph{\textbf{$X$ bounded pseudoconvex}} We can reduce $X$ to a relatively compact domain in some larger Stein manifold, and say that sections extend up to the boundary of $X$ (or are defined on $\bar{X}$) if they extend to a neighborhood of $X$ in the ambient Stein manifold. We can also assume that $\omega$ and $E,G$ extend to the ambient manifold ($E,G$ holomorphically) and that the metrics $\e^{-\varphi}$ and $\e^{-\psi}$ are smooth. If the result is proved under these assumptions, then the universality of the bounds yields the general case by standard weak-$*$ compactness theorems, Lebesgue-type limit theorems and approximation results for singular hermitian metrics on Stein manifolds. \section{Dual formulation of the division problem}\label{sec:dual-formulation} Fix a section $g \in H^0(X,G \otimes K_X)$ to be divided. We may assume, after possibly shrinking $X$, that $g$ is holomorphic up to the boundary of $X$. Let $\gamma: E^{\oplus r} \otimes K_X \rightarrow G \otimes K_X$ be defined by \[ \gamma(e_1,\dots,e_r) := h_1 \otimes e_1 + \dots + h_r \otimes e_r. \] \begin{proposition}\label{prop:solExistence} There exists $f = (f_1, \dots, f_r) \in H^0(X, E^{\oplus r} \otimes K_X)$ such that \[ g = h_1 \otimes f_1 + \dots + h_r \otimes f_r =: h \dototimes f \] and \[ \norm{f}^2_{E^{\oplus r}} < +\infty. \] \end{proposition} \begin{proof} Since $X$ is a relatively compact domain in a Stein manifold, any solution $f$ in the ambient manifold will restrict to a solution on $X$ with bounded $L^2$ norm. Hence, it suffices to show that for a Stein manifold $X$ there is a not necessarily $L^2$ solution of the division problem. As the $h_1, \dots, h_r$ have no common zeros, the map $\gamma$ is a surjective morphism of vector bundles and thus we have the short exact sequence of vector bundles \[ 0 \longrightarrow \ker \gamma \longrightarrow E^{\oplus r} \otimes K_X \longrightarrow G \otimes K_X \longrightarrow 0. \] The induced sequence in cohomology then yields \[ 0 \rightarrow H^0(X, \ker \gamma) \rightarrow H^0(X, E^{\oplus r} \otimes K_X) \rightarrow H^0(X,G \otimes K_X) \rightarrow H^1(X,\ker \gamma) = 0, \] where the last term on the right vanishes by Cartan's Theorem B. Hence, the map induced by $\gamma$ in cohomology is surjective, meaning that for any $g \in H^0(X,G \otimes K_X)$ we can find \[ f = (f_1, \dots, f_r) \in H^0(X, E^{\oplus r} \otimes K_X) \] such that \[ g = \gamma \circ f = h_1 \otimes f_1 + \dots + h_r \otimes f_r, \] proving the statement. \end{proof} Since there is a solution $f$ with finite $L^2$ norm, there is a (unique) solution $\tilde{f}$ with minimal $L^2$ norm. To prove Theorem \ref{thm:SkodaBL}, we thus need to estimate $\norm{\tilde{f}}_{E^{\oplus r}}$. \begin{lemma}\label{lemma:minimalNorm} Let $f \in H^0(X,E^{\oplus r} \otimes K_X)$ be any solution to the division problem with finite $L^2$ norm. Then the solution $\tilde{f}$ with minimal $L^2$ norm has norm \[ \norm{\tilde{f}}_{E^{\oplus r}}^2 = \sup_{\xi \in \ann H^0(X,\ker\gamma)} \frac{|\xi(f)|^2}{\norm{\xi}_*^2}, \] where $\norm{\cdot}_*$ is the norm for the dual Hilbert space $H^0(X, E^{\oplus r} \otimes K_X)^*$ and \[\ann H^0(X,\ker\gamma)\] is the annihilator of $H^0(X,\ker\gamma)$, i.e.~all functionals that vanish on $H^0(X,\ker\gamma) \subseteq H^0(X, E^{\oplus r} \otimes K_X)$. Moreover, one can restrict the supremum to functionals $\xi_\eta \in H^0(X, E^{\oplus r} \otimes K_X)^*$ of the form \[ \xi_\eta(f) := (\gamma \circ f, \eta)_G = \int_X \frac{(h \dototimes f) \bar{\eta} \e^{-\psi}}{(|h|^2 \e^{-\psi+\varphi})^{\alpha(r-1)+1}}, \] for $\eta \in C^\infty_c(X,G \otimes K_X)$ (smooth compactly supported sections of $G \otimes K_X$). \end{lemma} \begin{proof} Note first that the supremum is independent of the choice of the arbitrary $L^2$ solution $f$. Indeed, if $\xi \in \ann H^0(X,\ker\gamma)$ and $\gamma \circ f = \gamma \circ f' = g$, then by linearity $f - f' \in H^0(X,\ker\gamma)$, so that $\xi(f) = \xi(f')$. Next, we claim that $\tilde{f} \perp H^0(X,\ker\gamma)$. Indeed, if $k \in H^0(X,\ker\gamma)$, then $\gamma \circ (\tilde{f} + \varepsilon k) = g$ for all $\varepsilon \in \mathbb{C}$. As $\tilde{f}$ is the minimal norm solution, we have that \[ \mathbb{C} \ni \varepsilon \longmapsto \norm{\tilde{f} + \varepsilon k}_{E^{\oplus r}}^2 = \norm{\tilde{f}}_{E^{\oplus r}}^2 + 2 \Re [(\tilde{f},k)_{E^{\oplus r}} \varepsilon] + O(|\varepsilon|^2) \] has minimum at $\varepsilon = 0$ (here $(\cdot,\cdot)_{E^{\oplus r}}$ denotes the $L^2$ inner product on $E^{\oplus r} \otimes K_X$). Hence $(\tilde{f}, k)_{E^{\oplus r}} = 0$. Finally, notice that if $k \in H^0(X,\ker \gamma)$ then \[ \xi_\eta(k) = (\gamma \circ k, \eta)_G = 0, \] i.e.~$\xi_\eta \in \ann H^0(X,\ker \gamma)$. Conversely, if \[ 0 = \xi_\eta(f) = (\gamma \circ f, \eta)_G \] for all $\eta \in C^0_c(X,G \otimes K_X)$, then $\gamma \circ f = 0$. Hence \[ \left\{ \xi_\eta \mid \eta \in C^\infty_c(X,G \otimes K_X) \right\} \subseteq \ann H^0(X, \ker\gamma) \] is dense and we may restrict to elements $\xi_\eta$ when computing the supremum. \end{proof} By Lemma \ref{lemma:minimalNorm} \begin{equation}\label{eq:dualFormulation} \begin{split} \norm{\tilde{f}}_{E^{\oplus r}}^2 &= \sup_{\eta \in C^0_c(X,G \otimes K_X)} \frac{|(\gamma \circ f,\eta)|^2}{\norm{\xi_\eta}_*^2} \\ &= \sup_{\eta \in C^0_c(X,G \otimes K_X)} \frac{|(g,\mathcal{P}\eta)|^2}{\norm{\xi_\eta}_*^2} \leq \norm{g}_G^2 \sup_{\eta \in C^0_c(X,G \otimes K_X)} \frac{\norm{\mathcal{P} \eta}_G^2}{\norm{\xi_\eta}_*^2}, \end{split} \end{equation} where \[ \mathcal{P}: L^2(X,G \otimes K_X) \longrightarrow H^0(X,G \otimes K_X) \cap L^2(X, G \otimes K_X) \] denotes the Bergman projection. Therefore, to prove Theorem \ref{thm:SkodaBL} it suffices to prove \[ \norm{\mathcal{P}\eta}_G^2 \leq r \frac{\alpha}{\alpha-1} \norm{\xi_\eta}_*^2 \] for all $\eta \in C^\infty_c(X,G \otimes K_X)$. \section{A calculus lemma}\label{sec:calculus-lemma} We establish the following lemma, which we use in the proof of Theorem \ref{thm:SkodaBL}. The result and its proof are slight modifications of \cite[Lemma 3.4]{BerndtssonLempert2016}. \begin{lemma}\label{lemma:calculusEstimate} Let $\nu: (-\infty,0) \rightarrow \mathbb{R}_+$ be an increasing function such that \[ \lim_{t \rightarrow -\infty} \e^{-Bt} \nu(t) \leq A < +\infty \] for some $A,B > 0$. Then, for all $p>B$, \[ \liminf_{t \rightarrow -\infty} \e^{-Bt} \int_t^0 \e^{-p(s-t)} \dif \nu(s) \leq \frac{AB}{p-B}. \] \end{lemma} \begin{remark} In contrast to Lemma 3.4 in \cite{BerndtssonLempert2016}, we do not require $\nu$ to be bounded above by $A \e^{Bt}$ for \emph{all} $t < 0$. This weakened hypothesis is useful in our approach. \end{remark} \begin{proof} Set \[ f(t) := \e^{-B t} \int_t^0 \e^{-p(s-t)} \dif \nu(s). \] Then, for $R>0$, \[ \begin{split} \frac{1}{R} \int_{-R}^0 f(t) \dif t &= \frac{1}{R} \int_{-R}^0 \left( \int_t^0 \e^{(p-B)t} \e^{-ps} \dif \nu(s) \right) \dif t \\ &= \frac{1}{R} \int_{-R}^0 \left( \int_{-R}^s \e^{(p-B)t} \dif t \right) \e^{-ps} \dif \nu(s) \\ &= \frac{1}{R(p-B)} \int_{-R}^0 \left( \e^{-Bs} - \e^{-R(p-B) - ps} \right) \dif \nu(s) \\ &\leq \frac{1}{R(p-B)} \int_{-R}^0 \e^{-Bs} \dif \nu(s) \\ &= \frac{1}{R(p-B)} \left[ \nu(0) - \e^{BR} \nu(-R) + B \int_{-R}^0 \e^{-Bs} \nu(s) \dif s \right]. \end{split} \] Fix now $\varepsilon>0$, then there exists $t_\varepsilon < 0$ such that \[ \nu(t) \leq (A+\varepsilon) \e^{Bt} \quad \text{ for all } t < t_\varepsilon. \] Hence \[ \begin{split} \int_{-R}^0 \e^{-Bs} \nu(s) \dif s &\leq \int_{-R}^{t_\varepsilon} \e^{-Bs} (A+\varepsilon) \e^{Bs} \dif s + \nu(0) \int_{t_\varepsilon}^0 \e^{-Bs} \dif s \\ &= (A + \varepsilon) (R + t_\varepsilon) + \frac{\nu(0)}{B} (\e^{-Bt_\varepsilon} - 1), \end{split} \] so that \[ \frac{1}{R} \int_{-R}^0 f(t) \dif t \leq \frac{ - \e^{BR} \nu(-R) + B (A + \varepsilon) (R + t_\varepsilon) + \nu(0) \e^{-Bt_\varepsilon}}{R(p-B)} \overset{R \rightarrow +\infty}{\longrightarrow} \frac{B(A+\varepsilon)}{p-B}. \] Since this holds for all $\varepsilon > 0$, we conclude that \[ \lim_{R \rightarrow +\infty} \frac{1}{R} \int_{-R}^0 f(t) \dif t \leq \frac{AB}{p-B}. \] If the statement of Lemma \ref{lemma:calculusEstimate} failed, there would be $R_0 > 0$ and $\delta>0$ such that \[ f(t) \geq \frac{AB}{p-B} + \delta \quad \text{for all } t < -R_0. \] But then \[ \frac{1}{R} \int_{-R}^0 f(t) \dif t \geq \frac{R-R_0}{R} \left( \frac{AB}{p-B} + \delta \right) \overset{R \rightarrow +\infty}{\longrightarrow} \frac{AB}{p-B} + \delta, \] a contradiction. \end{proof} \section{Proof of Theorem \ref{thm:SkodaBL}}\label{sec:main-argument} \subsection{Setup}\label{subsec:setup} Instead of working directly on the vector bundle $E^{\oplus r} \otimes K_X \rightarrow X$, we are going to lift everything to the line bundle \[ L := \pr_X^* (E^{\oplus r} \otimes K_X) \otimes \pr_{\mathbb{P}_{r-1}}^* \mathcal{O}_{\mathbb{P}_{r-1}}(1) \longrightarrow X \times \mathbb{P}_{r-1}, \] where $\mathcal{O}_{\mathbb{P}_{r-1}}(1)$ is the hyperplane bundle of $\mathbb{P}_{r-1}$ and $\pr_X$, $\pr_{\mathbb{P}_{r-1}}$ are the projections of $X \times \mathbb{P}_{r-1}$ on $X$ and $\mathbb{P}_{r-1}$, respectively. Explicitly, fix once for all coordinates $v_1, \dots, v_r$ for $\mathbb{C}^r$ (descending to the homogeneous coordinates $[v_1:\dots:v_r]$ for $\mathbb{P}_{r-1}$) and declare the lift of a section $s \in H^0(X, E^{\oplus r} \otimes K_X)$ to be the section $\hat{s} \in H^0(X \times \mathbb{P}_{r-1}, L)$ defined by \begin{equation}\label{eq:lift} \hat{s}(x,[v]) := v^* \cdot s(x) = v_1^* s_1(x) + \dots + v_r^* s_r(x) \in H^0(X \times \mathbb{P}_{r-1}, L), \end{equation} where $v_1^*, \dots, v_r^*$ are the dual coordinates of $v_1, \dots, v_r$ of $\mathbb{C}^r$. Notice that the lift is a bijective map, since all sections of $L$ are of the form \eqref{eq:lift}. We can then lift the functionals $\xi_\eta \in H^0(X, E^{\oplus r} \otimes K_X)^*$ of Lemma \ref{lemma:minimalNorm} to functionals $\hat{\xi}_\eta \in H^0(X \times \mathbb{P}_{r-1}, L)^*$ defined as $\hat{\xi}_\eta(\hat{s}) := \xi_\eta(s)$ for all $\hat{s} \in H^0(X \times \mathbb{P}_{r-1}, L)$. \begin{remark} One can interpret the lifted section $\hat{s}$ by thinking that the projective space $\mathbb{P}_{r-1}$ parametrizes all possible choices of linear combinations (up to scaling). Hence, the value of the section $\hat{s}$ at $(x,[v])$ can be thought (tautologically) as the linear combination parametrized by $v$ of the entries of the vector $s(x)$. What follows is essentially a procedure to ``single out'' the linear combination given by $[h(x)]$ (the equivalence class of $h(x)$ in $\mathbb{P}_{r-1}$). \end{remark} Next, we define a family of metrics for $L \rightarrow X \times \mathbb{P}_{r-1}$, parametrized by \[ \tau \in \mathbb{L} := \{ z \in \mathbb{C} \mid \Re z < 0\}. \] Toward this end, let \[ \chi_\tau(x,v) := \max \left( \log(|v|^2 |h(x)|^2 - |v \cdot h(x)|^2) \e^{-\psi+\varphi} - \Re \tau, \, \log |v|^2 |h(x)|^2 \e^{-\psi+\varphi} \right). \] Then, for $\sigma \in L_{(x,[v])}$, set \[ \mathfrak{h}_\tau(\sigma, \bar{\sigma})_{(x,[v])} := \frac{r!}{\pi^{r-1}} \e^{-(r-1) \Re \tau} \frac{|\sigma|^2 \e^{-\varphi}}{|v|^2} \left( |v|^2 \e^{-\chi_\tau} \right)^{\alpha(r-1)}. \] Notice that whether the maximum defining $\chi_\tau$ is attained by the first or the second entry is independent of the choice of the representative $v$ of $[v] \in \mathbb{P}_{r-1}$, and that $|v|^2 \e^{-\chi_\tau}$ is a well-defined function on $X \times \mathbb{P}_{r-1}$. Notice also that $\chi_\tau$ depends only on $t := \Re \tau$ (as does $\mathfrak{h}_\tau$), so in the following we will write $\chi_t$ (and $\mathfrak{h}_t$) instead. \begin{remark} As we shall soon see, the choice of $\chi_t$ is motivated as follows. For $t=0$, the maximum is realized by the second entry, so that \[ (|v|^2 \e^{-\chi_t})^{\alpha(r-1)} = \frac{1}{(|h(x)|^2 \e^{-\psi+\varphi})^{\alpha(r-1)}}, \] providing the weighting by the norm of $h$ in $\norm{\cdot}_{E^{\oplus r}}$. On the other hand, as $t \rightarrow -\infty$, the function $|v|^2 \e^{-\chi_t}$ is very small at all $v \in \mathbb{P}_{r-1}$ that are not ``sufficiently aligned'' with $h(x)$. The precise sense of this statement will be more evident in Subsection \ref{subsec:extrema}, but for the moment note that $1 - \frac{|v \cdot h(x)|^2}{|v|^2 |h(x)|^2}$ constitutes a measurement of the angle between $v$ and $h(x)$. \end{remark} The family of metrics $\mathfrak{h}_\tau$ induces the family of $L^2$ norms \[ \norm{\sigma}_\tau^2 = \frac{r!}{\pi^{r-1}} \e^{-(r-1) \Re \tau} \int_{X \times \mathbb{P}_{r-1}} \frac{|\sigma|^2 \e^{-\varphi}}{|v|^2} \left( |v|^2 \e^{-\chi_\tau} \right)^{\alpha(r-1)} \wedge \dVFS, \] where $\dVFS$ is the (fixed) Fubini--Study volume form of $\mathbb{P}_{r-1}$. Looking at the curvature of (the pull-back of) $\mathfrak{h}$ on $X \times \mathbb{P}_{r-1} \times \mathbb{L}$, notice that $\e^{-\varphi - \alpha(r-1)\chi}$ contributes semipositively. Indeed $\e^{-\varphi - \alpha(r-1)(-\psi+\varphi)}$ contributes semipositively by the hypothesis on curvature of Theorem \ref{thm:SkodaBL}, and by Lagrange's identity we have \[ \log\left( |v|^2|h(x)|^2 - |v \cdot h(x)|^2 \right) = \log \sum_{1 \leq i < j \leq r} |h_i(x) v_j - h_j(x) v_j|^2, \] which is plurisubharmonic being the logarithm of a sum of norms squared of (locally) holomorphic functions (likewise for the right-hand side of the maximum). This leaves us to check that the negativity coming from the factor $(|v|^2)^{\alpha(r-1) - 1}$ is compensated by the Ricci curvature coming from the Fubini--Study volume form. This is the case since in local coordinates we can write $\frac{1}{|v|^2} |v|^{\alpha(r-1)} \dVFS$ as $\frac{\dif V(z)}{(1 + |z|^2) ^{r+1 - \alpha(r-1)}}$ (where $\dif V(z)$ is the standard Euclidean volume form), which is positively curved for $\alpha < \frac{r+1}{r-1}$. \subsection{Extrema of the family of norms}\label{subsec:extrema} We now investigate the behavior of the family of norms $\norm{\cdot}_t$ near $t=0$ and as $t \rightarrow -\infty$. At the $t=0$ extreme we have $\chi_0(x,v) = \log\left(|v|^2 |h(x)|^2 \e^{-\psi+\varphi}\right)$, so that \begin{equation}\label{eq:norm0} \begin{split} \norm{\hat{s}}_0^2 &= \frac{r!}{\pi^{r-1}} \int_{X \times \mathbb{P}_{r-1}} \frac{|v \cdot s|^2 \e^{-\varphi}}{|v|^2} \wedge \frac{\dVFS}{(|h|^2 \e^{-\psi+\varphi})^{\alpha(r-1)}} \\ &= \int_X \frac{|s|^2 \e^{-\varphi}}{(|h|^2 \e^{-\psi+\varphi})^{\alpha(r-1)}} = \norm{s}_{E^{\oplus r}}^2, \end{split} \end{equation} retrieving the norm squared of $s$ before the lifting. Consequently, for $t=0$, lifting functionals also preserves norms: \[ \norm{\hat{\xi}_\eta}_{0,*} = \sup_{\hat{s} \in H^0(X \times \mathbb{P}_{r-1}, L)} \frac{|\hat{\xi}_\eta(\sigma)|}{\norm{\hat{s}}_0} = \sup_{s \in H^0(X,E^{\oplus r} \otimes K_X)} \frac{|\xi_\eta(s)|}{\norm{s}_{E^{\oplus r}}} = \norm{\xi_\eta}_*. \] We now turn to the other extreme of the family, i.e.~$t \rightarrow -\infty$. Fix $x \in X$ and let $A_{t,x}$ be the set of $v \in \mathbb{P}_{r-1}$ such that the maximum in $\chi_t$ is achieved by the second entry, i.e. \[ A_{t,x} = \left\{ v \in \mathbb{P}_{r-1} \, \middle| \, 1 - \frac{|v \cdot h(x)|^2}{|v|^2 |h(x)|^2} < \e^t \right\}. \] By choosing homogeneous coordinates so that $v_1$ is parallel to $h(x)$ (which is not 0 since we are assuming that the $h_i$'s have no common zeros), and by choosing local coordinates so that $v_1=1$, one sees that $A_{t,x}$ is a ball of real dimension $2r-2$, centered at $[h(x)]$ (the origin, in local coordinates) and of radius $\sqrt{\frac{\e^t}{1-\e^t}} \underset{t \rightarrow -\infty}{\sim} \e^{t/2}$. We can then split $\norm{\hat{s}}_t^2$ into two summands: \[ \norm{\hat{s}}_t^2 = \int_X I_{t,s}(x) + \int_X I\!I_{t,s}(x), \] where \[ I_{t,s}(x) := \frac{r!}{\pi^{r-1}} \frac{\e^{-(r-1)t}}{(|h|^2 \e^{-\psi+\varphi})^{\alpha(r-1)}} \int_{A_{t,x}} \frac{|v \cdot s(x)|^2 \e^{-\varphi}}{|v|^2} \wedge \dVFS \] and \[ I\!I_{t,s}(x) := \frac{r!}{\pi^{r-1}} \frac{\e^{-(r-1)t}}{(|h|^2 \e^{-\psi+\varphi})^{\alpha(r-1)}} \int\displaylimits_{\mathbb{P}_{r-1} \setminus A_{t,x}} \frac{|v \cdot s(x)|^2 \e^{-\varphi} \e^{\alpha(r-1)t}}{|v|^2 \left( 1 - \frac{|v \cdot h|^2}{|v|^2|h|^2} \right)^{\alpha(r-1)}} \wedge \dVFS. \] For the first term we get \begin{equation}\label{eq:It} \lim_{t \rightarrow -\infty} I_{t,s}(x) = r \frac{|h \dototimes s|^2 \e^{-\psi}}{(|h|^2 \e^{-\psi+\varphi})^{\alpha(r-1) + 1}}, \end{equation} since asymptotically \[ \int_{A_{t,x}} \frac{|v \cdot s(x)|^2 \e^{-\varphi}}{|v|^2} \wedge \dVFS \underset{t \rightarrow -\infty}{\sim} \frac{\pi^{r-1}}{(r-1)!} \e^{(r-1)t} \frac{|h \dototimes s|^2 \e^{-\varphi}}{|h|^2}. \] For the second \[ I\!I_{t,s}(x) = \e^{-(r-1)t} \int_t^0 \e^{-\alpha(r-1)(\tilde{t} - t)} \dif \nu_{x,s}(\tilde{t}), \] with \[ \nu_{x,s}(t) := \frac{r!}{\pi^{r-1}} \frac{1}{(|h|^2 \e^{-\psi+\varphi})^{\alpha(r-1)}} \int_{A_{t,x}} \frac{|v \cdot s|^2 \e^{-\varphi}}{|v|^2} \wedge \dVFS = \e^{(r-1)t} I_{t,s}(x). \] Clearly $\nu_{x,s}$ is increasing and positive. Moreover, by \eqref{eq:It}, \[ \lim_{t \rightarrow -\infty} \e^{-(r-1)t} \nu_{x,s}(t) = r \frac{|h \dototimes s|^2 \e^{-\psi}}{(|h|^2 \e^{-\psi+\varphi})^{\alpha(r-1) + 1}}. \] Hence, by Lemma \ref{lemma:calculusEstimate}, \begin{equation}\label{eq:IIt} \liminf_{t \rightarrow -\infty} I\!I_{t,s}(x) \leq r \frac{|h \dototimes s|^2 \e^{-\psi}}{(|h|^2 \e^{-\psi+\varphi})^{\alpha(r-1) + 1}} \frac{r-1}{\alpha(r-1) - (r-1)}. \end{equation} All in all \begin{equation}\label{eq:infinity-extremum} \liminf_{t \rightarrow -\infty} \norm{\hat{s}}_t^2 \leq r \frac{\alpha}{\alpha-1} \int_X \frac{|h \dototimes s|^2 \e^{-\psi}}{(|h|^2 \e^{-\psi+\varphi})^{\alpha(r-1) + 1}} = r \frac{\alpha}{\alpha - 1} \norm{h \dototimes s}_G^2, \end{equation} retrieving (a multiple of) the norm squared of the image $h \dototimes s$ of $s$. \subsection{Convexity of the family of dual norms}\label{subsec:convexity} Now that we have a metric $\mathfrak{h}$ for (the pull-back of) $L$ on $X \times \mathbb{P}_{r-1} \times \mathbb{L}$ with positive enough curvature, Berndtsson's Theorem gives the core step of the argument. \begin{lemma}\label{lemma:convexity} Fix $\eta \in C^0_c(X,G \otimes K_X)$. Then the function \[ \begin{matrix} (-\infty,0] & \longrightarrow & \mathbb{R} \\ t & \longmapsto & \log \norm{\hat{\xi}_\eta}_{t,*}^2 \end{matrix} \] is non-decreasing. In particular, \[ \norm{\xi_\eta}_*^2 = \norm{\hat{\xi}_\eta}_{0,*}^2 \geq \norm{\xi_\eta}_{t,*}^2 \quad \text{for all } t \leq 0. \] \end{lemma} \begin{proof} \textbf{Step 1.} We first prove that $\sup_{\tau \in \mathbb{L}} \norm{\hat{\xi}_\eta}_{\tau,*}^2 < +\infty$. Once more, $\norm{\hat{\xi}_\eta}^2_{\tau,*}$ only depends on $\Re \tau =: t$, so it suffices to prove that $\norm{\hat{\xi}_\eta}^2_{t,*}$ is uniformly bounded for all $t$ sufficiently negative (the other $t$'s are in a compact interval, so the corresponding norms are automatically uniformly bounded). Let \[ C_\eta := \int_X \frac{|\eta|^2 \e^{-\psi}}{(|h|^2 \e^{-\psi+\varphi})^{\alpha(r-1)+1}} < +\infty, \] then \[ \norm{\hat{\xi}_\eta}_{t,*}^2 = \sup_{\norm{\hat{s}}_t^2 = 1} \left| \int_X \frac{(h \dototimes s) \bar{\eta} \e^{-\psi}}{(|h|^2 \e^{-\psi+\varphi})^{\alpha(r-1)+1}} \right| \leq C_\eta \sup_{\norm{\hat{s}}_t^2 = 1} \int_X \frac{|h \dototimes s|^2 \e^{-\psi}}{(|h|^2 \e^{-\psi+\varphi})^{\alpha(r-1)+1}}. \] By \eqref{eq:It}, if $t$ is sufficiently negative, \[ \frac{|h \dototimes s|^2 \e^{-\psi}}{(|h|^2 \e^{-\psi+\varphi})^{\alpha(r-1)+1}} \leq \frac{2}{r} I_{t,s}(x) \] (in the sense of top forms), so that \[ \norm{\hat{\xi}_\eta}_{t,*}^2 \leq \frac{2 C_\eta}{r} \sup_{\norm{\hat{s}}_t^2=1} \int_X I_{t,s}(x) \leq \frac{2 C_\eta}{r} < +\infty, \] as wanted. \textbf{Step 2.} Consider now the trivial fibration $(X \times \mathbb{P}_{r-1}) \times \mathbb{L} \overset{\pr_\mathbb{L}}{\longrightarrow} \mathbb{L}$. We have already checked at the end of Subsection \ref{subsec:setup} that the curvature of $\mathfrak{h}$, seen as a metric for $\pr_{X \times \mathbb{P}_{r-1}}^* L \rightarrow (X \times \mathbb{P}_{r-1}) \times \mathbb{L}$, plus the Ricci curvature coming from the Fubini--Study volume form is non-negative on the total space $X \times \mathbb{P}_{r-1} \times \mathbb{L}$. Then, up to a smooth approximation of $\chi$, Berndtsson's Theorem \cite{Berndtsson2009} implies that $\tau \mapsto \log\norm{\hat{\xi}_\eta}_{\tau,*}^2$ is subharmonic in $\mathbb{L}$. Since $\norm{\hat{\xi}_\eta}_{\tau,*}$ only depends on $t = \Re \tau$, it follows that $t \mapsto \log\norm{\hat{\xi}_\eta}_{t,*}^2$ is convex on $(-\infty,0)$. If this map decreased anywhere on $(-\infty,0)$, then by convexity we would have $\lim_{t \rightarrow -\infty} \log\norm{\hat{\xi}_\eta}_{t,*}^2 = +\infty$, contradicting the uniform boundedness of $\norm{\hat{\xi}_\eta}_{t,*}^2$ obtained in Step 1. Hence the statement follows. \end{proof} To finish the proof, we just need to show the following inequality. \begin{lemma}\label{lemma:lowerBound} Let $\eta \in C^0_c(X,G \otimes K_X)$. Then \[ \lim_{t \rightarrow -\infty} \norm{\hat{\xi}_\eta}_{t,*}^2 \geq \frac{\alpha-1}{\alpha r} \norm{\mathcal{P}\eta}_G^2. \] \end{lemma} \begin{proof} First notice that the limit in the statement exists by Lemma \ref{lemma:convexity}. Fix $\varepsilon>0$ and let $s \in H^0(X, (E \otimes K_X)^{\oplus r})$ be any solution of $h \dototimes s = \mathcal{P} \eta$ (such $s$ exists with bounded $L^2$ norm by the same argument of Proposition \ref{prop:solExistence}). Then \[ \norm{\hat{\xi}_\eta}_{t,*}^2 \geq \frac{1}{\norm{\hat{s}}_t^2} \left| \int_X \frac{(h \dototimes s) \overline{\mathcal{P}\eta}\e^{-\psi}}{(|h|^2 \e^{-\psi+\varphi})^{\alpha(r-1)+1}} \right|^2 = \frac{\norm{\mathcal{P}\eta}_G^4}{\norm{\hat{s}}_t^2}. \] At the same time, \eqref{eq:infinity-extremum} gives \[ \liminf_{t \rightarrow -\infty} \norm{\hat{s}}_t^2 \leq r \frac{\alpha}{\alpha-1} \norm{h \dototimes s}_G^2 = r \frac{\alpha}{\alpha-1} \norm{\mathcal{P} \eta}_G^2, \] which means that there is a sequence $t_j \overset{j \rightarrow +\infty}{\longrightarrow} -\infty$ for which \[ \lim_{j \rightarrow +\infty} \norm{\hat{s}}_{t_j}^2 \leq r \frac{\alpha}{\alpha-1} \norm{\mathcal{P} \eta}_G^2. \] Thus \[ \lim_{t \rightarrow -\infty} \norm{\hat{\xi}_\eta}_{t,*}^2 = \lim_{j \rightarrow +\infty} \norm{\hat{\xi}_\eta}_{t_j,*}^2 \geq \frac{\alpha-1}{\alpha r} \norm{\mathcal{P}\eta}_G^2, \] proving the statement. \end{proof} Wrapping up, by Lemmas \ref{lemma:convexity} and \ref{lemma:lowerBound}, \[ \norm{\xi_\eta}_*^2 = \norm{\hat{\xi}_\eta}_{0,*}^2 \geq \lim_{t \rightarrow -\infty} \norm{\hat{\xi}_\eta}_{t,*}^2 \geq \frac{\alpha-1}{\alpha r} \norm{\mathcal{P}\eta}_G^2 \] for all $\eta \in C^0_c(X,G \otimes K_X)$. Hence, by \eqref{eq:dualFormulation}, we conclude that the minimal-norm solution $\tilde{f}$ to the division problem $h \dototimes f = g$ has norm \[ \norm{\tilde{f}}_{E^{\oplus r}}^2 \leq \norm{g}_G^2 \sup_{\eta \in C^0_c(X,G \otimes K_X)} \frac{\norm{\mathcal{P} \eta}^2_G}{\norm{\xi_\eta}_*^2} \leq r \frac{\alpha}{\alpha-1} \norm{g}_G^2, \] proving Theorem \ref{thm:SkodaBL}. \bibliographystyle{alpha}
\section{Introduction} Koopman operator theory considers an alternate representation of a dynamic system where the state evolution of a nonlinear system is linear. In this representation, the concepts of vibrational, growth, and decay modes in linear systems can be directly extended to nonlinear systems \cite{mezic2005spectral}. These modes address problems in the field of fluid mechanics \cite{rowley2009spectral, schmid2010dynamic, mezic2013analysis} and disease modeling \cite{proctor2018generalizing}, attack identification in the power grid \cite{nandanoori2020model}, as well as programming the steady state of biological systems \cite{hasnaindata} or extracting new biosensors \cite{hasnain2022learning}. The spectral properties of the linear Koopman operator in this function space connects to classical methods for model reduction, validation, identification and control \cite{mauroy2020Koopman}. Since Mezić's first paper on the spectral properties of the Koopman operator, computing Koopman modes has become a major research focus \cite{budivsic2012applied, williams2014kernel}. The central algorithm for computing these modes is dynamic mode decomposition (DMD). Extensions of DMD, such as extended dynamic mode decomposition (EDMD) \cite{williams2015data} enable the expression of strong nonlinearities in the model. Others, such as the robust approximation algorithm presented in \cite{sinha2018robust}, enable high fidelity modeling in the presence of both process and measurement noise. DMD-based methods, such as EDMD are a useful set of tools to model nonlinear dynamics from data. In EDMD, one chooses a nonlinear function space implicitly defined by the span of a predefined, homogeneous function dictionary and then, individual modes are learned to compute a low-rank approximation to a linear operator that evolves the function space forward in time. Because a human typically specifies the dictionary functions in EDMD, the resulting models tend to be high dimensional. One approach to learning lower dimensional models is through the SINDy algorithm. This algorithm uses sparse regression to project to a lower dimensional subspace of the nonlinear function space initially chosen \cite{brunton2016discovering}. Another, Symmetric Subspace Decomposition, approximates the maximal Koopman-invariant subspace in an iterative fashion \cite{haseli2021learning}. A second approach we have explored is to use deep learning to learn a function dictionary or a set of observables during training \cite{yeung2019learning}. The deepDMD algorithm uses a form of stochastic gradient descent (SGD) to train a deep artificial neural network to select observables. Because the neural network is a universal function approximator \cite{hornik1991approximation}, it can learn a large class of continuous observables on a compact set and parameterize the approximate Koopman operator. The deepDMD algorithm has been generally successful at learning both small and large scale nonlinear systems \cite{yeung2019learning}. Other approaches leverage deep learning to build efficiently parameterized Koopman models with high fidelity. Methods using linear recurrent autoencoders build effective, low-dimensional Koopman models that are not measurement-inclusive \cite{wehmeyer2018time, lusch2018deep, otto2019linearly}. To do this, they pass observables from the learned function space, via the decoder, back to the original model's state-space. Other work has, under the assumption of ergodicity, delegated the process of choosing a dictionary for EDMD to deep learning \cite{takeishi2017learning}. Neural networks are typically black box models. We use dictionaries of functions inspired from deep learning to build Koopman models which both capture the system dynamics and approximate the dynamics of the nonlinear dictionary functions. The success of these models provides insight into why deep learning models have the capacity to approximate Koopman operators well. We explain this success by demonstrating that these dictionaries satisfy uniform finite approximate closure, a property tied to the subspace invariance of these dictionaries. In Section \ref{sec:KLP}, we introduce the Koopman generator learning problem and define terms relevant to the subspace invariance of a Koopman dictionary. In Section \ref{sec:AppendixNotation}, we introduce notation. In Section \ref{sec:SILL}, we introduce a dictionary inspired by the dictionary functions of deepDMD, the SILL dictionary. In Sections \ref{sec:SILLclosure} and \ref{sec:averageErrorSILL}, we demonstrate the SILL dictionary's approximate subspace invariance. We draw our conclusions in Section \ref{sec:conclusion}. \section{The Koopman Generator Learning Problem}\label{sec:KLP} In this section we introduce the problem of choosing a function space and approximate Koopman generator to model a dynamic system. This problem is not convex, but, when approximated well, it gives an accurate, data-driven, linear model of a nonlinear system. Consider a nonlinear, time-invariant, autonomous system with dynamics \begin{equation}\label{eq:nonlinear_system} \dot{x} = f(x) \end{equation} where $x \in M \subset \mathbb{R}^n$, $f:\mathbb{R}^n \rightarrow \mathbb{R}^n$ is analytic. The manifold, $M$, is the state-space of the dynamical system. We introduce the concepts of a Koopman generator and its associated multi-variate Koopman semigroup, following the exposition of \cite{budivsic2012applied}. For continuous nonlinear systems, the Koopman semigroup is a semigroup, a set with an associative binary operation, $\mathcal{K}_{t\in \mathbb{R}}$ of linear but infinite dimensional operators, $\mathcal{K}_t$, that acts on a space of functions, $\Psi$, with elements $y: M \rightarrow \mathbb{R}^m$. We assume that each $y\in\Psi$ is differentiable with a bounded derivative. Our function, $y$, is an observable because it is a function of the state, $x$. We say $\mathcal{K}_t:\Psi \rightarrow \Psi$ is an operator for each $t\geq 0$. The Koopman operator applies the transformation, \begin{equation}\label{eq:koopman_def} \mathcal{K}_t \circ y(x_0) = y \circ \Phi_t(x_0),\end{equation} where $\Phi_t(x)$ is the flow map of the dynamical system (\ref{eq:nonlinear_system}) evolved forward up to time $t$, given the initial state $x_0$. Instead of examining the evolution of the state, the Koopman semigroup allows us to study the forward evolution of functions of state, $y(x)$ \cite{williams2015data}. The action of the generator, $\mathcal{K_G}$, on the observables, $y$, for the Koopman semigroup is defined as \begin{equation} \mathcal{K_G} \circ y \triangleq \lim_{t\rightarrow 0} \frac{ \mathcal{K}_t \circ y - y }{t}. \end{equation} When $y$ and $t$ are fixed, we see from Eq. (\ref{eq:koopman_def}) that $\mathcal{K}_t$ is a function of the state, $x$. Similarly, $\mathcal{K_G}$ may be understood as a function of $x$. The Koopman generator is a state-dependant derivative operator, see Section 7.6 of \cite{lasota1998chaos}. It satisfies \begin{equation}\begin{aligned}\label{eq:dyn_sys_in_data} \frac{d}{dt}y(x)=\mathcal{K_G}(x)\circ y(x). \end{aligned}\end{equation} In rare cases the Koopman generator will not have a dependence on $x$, see Eq. (24) and the surrounding section in \cite{brunton2016koopman}. \subsection{Learning Koopman operators from data} In discrete-time, data-driven Koopman operator learning, we have $r$ pairs of measurements of observables, \[(y(x_i), y(f(x_i))),\mbox{ for }i=1,2,...,r.\] In continuous-time (CT), data-driven Koopman generator learning, our pairs are measurements of observables and their derivatives \begin{equation}\begin{aligned}(y(x_i), d(y(x_i))/dt),\mbox{ for }i=1,2,...,r.\end{aligned}\end{equation} We briefly remark that, there are techniques that a CT data-driven Koopman generator learning problem working with discrete measurements as opposed to measurements paired with their derivatives. For example, see \cite{mauroy2019koopman}. Because we are working with numerical computation, these measurements (and their derivatives, if applicable) are finite dimensional, call the dimension $m<\infty$. We assume that our measurements are higher dimensional than the underlying dynamic system, $m\geq n$, and that $y(x)$ is injective. We assume all measurements are noise-free. The Koopman generator (for CT) $\mathcal{K_G}(x)$ is unknown, however, we assume it exists and satisfies \begin{equation}\begin{aligned} \frac{d(y(x_i))}{dt} = \mathcal{K_G}(x_i)\circ y(x_i)\mbox{ for }i=1,2,...,r.\end{aligned}\end{equation} While we do not know the values of $x$ from our data we can write down our derivative function as an implicit function of $x$, this function is, $F:\mathbb{R}^m\rightarrow \mathbb{R}^m$. To describe $F$ we define, $y=h(x)$. The function $h$ is invertible as we assume that $y$ is injective. Now we write $F$ as \begin{equation}\begin{aligned}\label{eq:implicit} F(y) = \mathcal{K_G}(h^{-1}(y))\circ y.\end{aligned}\end{equation} The implicit function, $F$, simply is Eq. (\ref{eq:dyn_sys_in_data}) rewritten in terms of $y(x)$ instead of $x$. This is an important distinction as the true system state $x$ is not necessarily known. We are working from measurements (observables) of the system in Eq. (\ref{eq:nonlinear_system}). We label these measurements $y$. Given such measurements, it is customary to choose a finite set of $N$ {\em dictionary functions}, $\psi(y):\mathbb{R}^m\rightarrow \mathbb{R}^N$, and a constant matrix, $K\in\mathbb{R}^{N\times N}$ to model $F$. Note that we choose $\psi$ without knowing the equation for $y(x)$. The function $y(x)$ is an observable function, as it is a measured function of the state of the system given in Eq. (\ref{eq:nonlinear_system}). Likewise, as $\psi$ is a function of $y(x)$, $\psi$ is a function of $x$ as well. Therefore, in a data-driven setting, dictionary functions of $y(x)$, $\psi(y)$, are also observables of some Koopman generator. Typically, we choose $N$ such that $N>m$, and so $\psi(y)$ is a ``lifting'' of our data (see the use of ``lifting'' in \cite{korda2018convergence}). In numeric methods for Koopman modeling, we approximate $F$ with the matrix-vector product, $K\psi(y)$. Effectively, in a data-driven setting, this amounts to projecting the action of an infinite dimensional Koopman operator as matrix multiplication on sampled data space. For example, when $N>m$, we can define a projection function $\mathtt{P}:\mathbb{R}^N\rightarrow \mathbb{R}^m$ that maps the matrix-vector product of the approximate Koopman operator $K$ multiplying the dictionary function $\psi(y)$ to the vector field $F(y)$ from Eq. (\ref{eq:implicit}), such that \begin{equation}\begin{aligned} \mathtt{P}\circ K \circ \psi \circ y \approxeq F \circ y .\end{aligned}\end{equation} This, in summary, yields the following finite approximation to the Koopman generator equation \begin{equation}\begin{aligned}\frac{dy(x)}{dt}=\mathcal{K_G}(x)y(x) \triangleq F(y(x)) \approxeq \mathtt{P}(K\psi(y)).\end{aligned}\end{equation} The matrix, $K$, is a linear operator, to ensure that it behaves like a true Koopman generator we choose it, in conjunction with $\psi$, to satisfy \begin{equation}\begin{aligned}\label{eq:koop_approx_behavior}\frac{d\psi(y)}{dt}\approx K\psi(y).\end{aligned}\end{equation} We are tasked to learn a numerical, finite-dimensional approximation $K$ of the Koopman generator, $\mathcal{K_G}$ and the set of dictionary functions, $\psi$. This matrix $K$ is the Koopman generator approximation that acts specifically on data-centered evaluations of dictionary functions $\psi(y)$ rather than the observable function $y(x).$ \subsection{Problem Statement} Finding the Koopman generator $\mathcal{K_G}$ from data is difficult, due to the lack of knowledge about the true Koopman generator and the parametric form of the measurements. So, we instead solve the following optimization problem in its place. \begin{equation}\label{eq:objective} \min_{K, \psi \in \Psi} \sum_{i=1}^{r} \left\Vert \frac{d\psi(y(x_i))}{dt} - K \psi(y(x_i)) \right\Vert. \end{equation} This is an abstraction of the discrete-time problem statement. In practice, derivatives are difficult to numerically compute and measure. In this optimization we need to select dictionary functions, as well as a real-valued matrix, $K$. This optimization problem is non-convex, since the form of $\psi(y)$ is unknown or parametrically undefined. The model dimension, $N$, is a hyperparameter of Eq. (\ref{eq:objective}). In EDMD the dictionary functions $\psi(y)$ are predefined, drawn from a class of nonlinear functions, and assumed to be known. Under these assumptions, Eq. (\ref{eq:objective}) is a convex optimization problem with a closed-form solution. By contrast, in deepDMD, the dictionary functions and $K$ are learned simultaneously during iterative training. This is, of course, a nonlinear, non-convex optimization problem, for which we employ variants of the stochastic gradient descent algorithm, such as adaptive gradient descent (AdaGrad) \cite{duchi2011adaptive} or adaptive momentum (ADAM) \cite{kingma2014adam}. \subsection{Finite Closure}\label{sec:error} Previous work characterizes the closure and convergence of Koopman models as additional dictionary functions are appended to the model for the DMD and EDMD algorithms \cite{arbabi2017ergodic, korda2018convergence}. We explore closure as an inherent property of a dictionary. We begin by understanding the property of subspace invariance, which corresponds to finite exact closure. Closure, in this context, refers to how the action of the Koopman generator on the dictionary functions does not give any function outside of the dictionary functions' span. This span is the subspace that we refer to. Let $S$, be the span of our dictionary functions. The set $S$ is a subspace of the set of all analytic functions, including $y$, that map $x$ to $\mathbb{R}$. \begin{definition} We say that our dictionary, $\psi(y)$, satisfies Koopman \textit{subspace invariance} when $\mathcal{K_G}\cdot \psi(y)\in S$. A \textit{Koopman subspace invariant} dictionary is said to satisfy \textit{finite exact closure}. \end{definition} If some element in a dictionary does not satisfy Koopman subspace invariance, then there exists some element in the dictionary that, when acted on by the Koopman operator, cannot be represented as a linear combination of dictionary functions. In the context of data-driven Koopman learning this means that when our dictionary contains $N$ functions, no $N$ by $N$ matrix captures the precise action of the Koopman generator. Finite exact closure (Koopman subspace invariance) is unlikely to be achieved, as (1) the Koopman generator may need to be infinite dimensional and (2) in the case that it does not, it is difficult to engineer models with exact closure even with an explicit knowledge of Eq. (\ref{eq:nonlinear_system}). So, we also consider an approximate notion of closure relevant to building models from data. \begin{definition}\label{def:uniform} We say $\psi(y):\mathbb{R}^m \rightarrow \mathbb{R}^{N}$ achieves finite $\epsilon$-closure or finite closure with $O(\epsilon)$ error when there exists a $K\in \mathbb{R}^{N\times N}$ and an $\epsilon > 0$ such that \begin{equation} \frac{d(\psi(y))}{dt} = K \psi(y) + \epsilon(y), \end{equation} for the vector field $F$. Our dictionary $\psi(y)$ achieves \textit{finite approximate closure} when, for the vector field, $F$, and every $y$, the function $\epsilon(y)$ is a bounded for every $K$ such that $||K||<\infty$. We say that $\psi(y)$ achieves {\em uniform finite approximate closure} for some set $\mathcal{R}$ when it achieves finite closure with $|\epsilon(y)| < B \in \mathbb{R}$ for all $y \in \mathcal{R}.$ \end{definition} We are most interested by the property of uniform finite approximate closure, especially when we can bound the constant, $B$, to be arbitrarily low. When $B$ can be bound in such a manner we have an accurate, data-driven model. \begin{example}\label{example} Unfortunately, closure does not come with every dictionary of observables, even if that dictionary spans the function space of the dynamic system. For example, a canonical polynomial basis, $\{1, y, y^2,...,y^n\}$, used to approximate the one-dimensional system $f(y)=y^2$, spans the dynamic system, but no model using this basis will be closed. In fact, none will achieve uniform finite approximate closure. We illustrate what this lack of closure means when $y>>1$. In that case, the Lie derivative of $y^n$ is \begin{equation}\begin{aligned}\frac{d(y^n)}{dt} = \frac{d(y^n)}{dy}\frac{dy}{dt} = ny^{n-1}y^2 = ny^{n+1}.\end{aligned}\end{equation} Approximating this derivative when $y>>1$ as an $n^{th}$ degree polynomial will dramatically fail as the error will be of order $O(y^{n+1})$. This failure will cascade back through approximations of all the other dictionary functions. Closure is a crucial property of these models! \end{example} We want models with uniform finite approximate closure because, as the bounding constant goes to zero, $B \rightarrow 0$, we may use $K$ to perform stability, observability and spectral analysis. We see this is true as, in the discrete-time formulation, as $B\rightarrow 0$, $K$ approaches a projection of the action of the Koopman operator \cite{korda2018convergence}. When our dictionary is state-inclusive, it is trivial to project from $\psi$ to $y$ and its trajectory may yield stability insights. To keep our models meaningful in this way, all the dictionaries in this article are state-inclusive. \section{Notation}\label{sec:AppendixNotation} Our models, throughout this article, will have two classes of parameters. Each class refers to the distinct geometric properties of center and steepness. To create a clearer separation of function variables and parameters we will use the following notation \[\Tilde{\eta}(y;\mu_l,\alpha_l).\] In this notation, $\Tilde{\eta}$ is a function whose variable is the vector $y$ and whose parameters are vectors $\mu_l$ and $\alpha_l$. The vectors $\mu_l$ and $\alpha_l$ refer to the geometrically distinct classes of parameters, $\mu$ for center and $\alpha$ for steepness. A second example would be \[\eta(y_i;\mu_{li}, \alpha_{li}).\] In this notation, $\eta$ is a function whose variable is the scalar $y_i$, and whose parameters are the scalars $\mu_{li}$ and $\alpha_{li}$. To make our equations less cumbersome we summarize all the distinct parameters with the label $\theta$. For example, \[\Tilde{\eta}(y;\mu_l,\alpha_l)\triangleq \Tilde{\eta}(y;\theta_l),\] and \[\eta(y_i;\mu_{li}, \alpha_{li})\triangleq \eta(x_i;\theta_{li}).\] In general, our notation uses the following conventions. \begin{enumerate} \item Integer $i$ will be an index of measurement dimension. \item Integer $j$ will be an index of the first group of added dimensions. \item Integer $k$ will be an index of the second group of added dimensions. \item Integer $l$ will be an additional added dimension index. \item Integer $n$ will be the state dimension. \item Integer $m$ will be the number of measurements. \item Integer $N_L$ will be the added dimensions. We subscript with $L$ in this paper as the added dimensions will correspond to conjunctive \textit{logistic} dictionary functions. \item The $m\times N_L$ real-valued matrix, $w$, will be a matrix of weights. In our analysis it corresponds to a block of the Koopman Operator approximation matrix, $K$, which describes the flow of the state variables as a linear combination of nonlinear observables. \end{enumerate} \section{The SILL Dictionary: A Model of deepDMD's Learned Dictionary}\label{sec:SILL} In this section, we define a new class of dictionary functions, $\psi(y)$, identified from deepDMD's solution to Eq. (\ref{eq:objective}). We will call this class \textit{State-Inclusive Logistic Liftings} (SILLs). We call them this because \begin{enumerate} \item they contain the state of the vector field $F(y)$, the dynamics of the governing equations (as we have measured them) are directly included in the dictionary, so they are state-inclusive\footnote{Note that the functions that we define technically are measurement-lifting, not state-lifting. This is a consequence of how we cast our problem formulation.}, \item the dictionaries in this class also contain nonlinear functions, all of which are conjunctive logistic functions, so these dictionaries are logistic in nature, and \item because each has at least one nonlinear dictionary function, the dictionary size, $N=1+m+N_L$, is greater than the number of measurements, $m$. Since $N>m$, the model using this dictionary is ``lifted'' to a higher dimension than the original measurements. \end{enumerate} We previously showed that Koopman models chosen from SILL dictionaries have successfully learned global nonlinear phase-space behavior of several simple, nonlinear systems \cite{johnson2018class}. In Section \ref{sec:SILLclosure}, we show, for the first time, that SILL dictionaries satisfy uniform finite approximate closure. \subsection{The SILL Lifting Functions and deepDMD} We define a multivariate conjunctive logistic function, $\Lambda:\mathbb{R}^m\rightarrow\mathbb{R}$, for a given center parameter vector $\mu_j \in \mathbb{R}^m$ and steepness parameter vector $\alpha_j \in \mathbb{R}^m$ as follows \begin{equation} \Lambda(y; \mu_j, \alpha_j) \triangleq \prod_{i=1}^{m}\lambda(y_i; \theta_{ji}), \end{equation} where the measurements are $y \in \mathbb{R}^m$ and the scalar logistic function, $\lambda:\mathbb{R}\rightarrow\mathbb{R}$, is defined as \begin{equation}\label{logistic} \lambda(y_i; \mu_{ji}, \alpha_{ji}) \triangleq \frac{1}{1+e^{-\alpha_{ji} (y_i-\mu_{ji})}}. \end{equation} The parameters $\mu_{ji}$ define the centers or the point of activation for $\Lambda(x;\theta_j)$ along dimension $y_i$. The parameter $\alpha_{ji}$ is a steepness or sensitivity parameter, and determines the steepness of the logistic curve in the $i^{th}$ dimension for $\Lambda(y;\theta_j)$. Conjunctive logistic functions map orthants of $R^m$ to be nearly 1 and the rest of the space to be nearly 0 To illustrate how this conjunctive logistic function works, consider what happens if you set the vector $y$ to be constant in all but the $l^{th}$ dimension. Then \begin{equation}\begin{aligned}\Lambda(y;\mu_j,\alpha_j) = (\prod_{i\neq l}c_i)\lambda(y_l;\mu_{jl}, \alpha_{jl}).\end{aligned}\end{equation} This is a constant times the logistic function in the $l^{th}$ dimension. When we project dictionary functions learned by deepDMD to a single dimension we observe that they likewise approximate a scaled logistic function. Given $N$ multivariate logistic functions, we define a SILL dictionary as $\psi : \mathbb{R}^m\rightarrow \mathbb{R}^{N}$, so that: \begin{equation} \psi(y) \triangleq \begin{bmatrix} 1& y^T& \bar\Lambda(y)^T \end{bmatrix}^T \end{equation} where $\bar\Lambda(y) = [\Lambda(y;\theta_1), \hdots,\Lambda(y;\theta_N) ]^T$ is a vector of conjunctive logistic functions and $N=1+m+N_L$. We then have that $K\in\mathbb{R}^{N\times N}$. This basis is measurement-inclusive. Ideally $\bar\Lambda(y)$, the measurements themselves and a constant spans each dimension of the vector field over the region of interest. \begin{figure*}[ht] \centering \includegraphics[width=450pt]{PaperSummary.png} \caption{A visual outline of the (commutative) steps taken to prove uniform finite approximate closure of SILL dictionaries in Section \ref{sec:SILLclosure}. These same steps are applied in Part II of this paper to the heterogeneous augSILL dictionary, see \cite{johnson2022augSILL}.} \label{fig:paper_summary} \end{figure*} \section{Uniform Finite Approximate Closure of the SILL Dictionary: Step 1}\label{sec:SILLclosure} We showed in \cite{johnson2018class} that a pure, measurement-inclusive, SILL dictionary can make effective low-dimensional Koopman models. We demonstrate that the SILL dictionary satisfies uniform finite approximate closure (see Definition \ref{def:uniform} in Section \ref{sec:error}). In essence, uniform finite approximate closure guarantees that the dimensionality of the dictionary space does not need to diverge to infinity, while simultaneously approximating the vector field $F(y)$ sufficiently well. This property is what makes numerical approximation of the Koopman generator equation possible. Recall from Example \ref{example} that when considering a new set of dictionary functions, we also have to consider the effects of dictionary explosion. In Example \ref{example}, we computed the Lie derivatives of each dictionary function, which in turn generated new product terms that were not in the span of the existing dictionary. Thus, for any new class of dictionary functions, a key property requisite to uniform approximate finite closure is the ability to approximate products of dictionary functions as elements of the span of the dictionary. In the context of the SILL dictionary, we show how approximate products of dictionary functions are elements in the span of our dictionary by showing convergence in steepness of \textit{products} of conjunctive logistic functions to a \textit{single} conjunctive logistic function. To show these bilinear terms are approximately in the span of our dictionary, we need to show that the product of two conjunctive logistic functions may be approximated as a single conjunctive logistic function as follows: \begin{equation}\label{eq:approx1} \Lambda(y;\theta_l)\Lambda(y;\theta_j) \approx \Lambda(y;\theta^*) \end{equation} where $\theta^* = (\mu_{max}(l,j), \alpha_{max}(l,j))$ and \[ \mu_{max}(l,j) = \left( \max\{\mu_{l1},\mu_{j1}\}, ..., \max\{\mu_{lm},\mu_{jm}\} \right), \] and $\alpha_{max}(l,j)$ are the $\alpha$ (steepness) values that correspond to the indices of the $\mu$'s. Theorem \ref{thm:SILLconv} demonstrates that Eq. (\ref{eq:approx1}) is a good approximation in the limit of increasing steepness parameter $\alpha$. Specifically, it says that a bilinear combination of conjunctive logistic functions can be approximated by a single conjunctive logistic function. This is important to show the uniform finite approximate closure of the SILL dictionary as it paves the way for Corollaries \ref{cor:logSILLApprox1} and \ref{cor:logSILLApprox2}. These corollaries are key steps in understanding the error between the Koopman model using the SILL dictionary and the true Lie derivatives of these dictionary functions (see \textbf{Step 1} in Fig. \ref{fig:paper_summary}). The proofs of Theorem \ref{thm:SILLconv} and Corollary \ref{cor:logSILLApprox1} are in Section \ref{sec:AppendixProofs} of the Appendix. To characterize the value of our approximation we need to define the regions where our approximation's efficacy is capped. Theorem \ref{thm:SILLconv} will demonstrate that the approximation in Eq. (\ref{eq:approx1}) can be arbitrarily good outside of a special set of hyperplanes. Given a SILL dictionary, $\psi(y)$, we define a set of $mN_L$, $m-1$ dimensional hyperplanes in $\mathbb{R}^m$ corresponding to the centers of each $M_{\bar\Lambda} \triangleq \{ y:\mbox{there exists } i\in\{1,2,...,m\} \mbox{ and } j\in \{1,2,...,N_L\} \mbox{ so that } y_i=\mu_{ji} \}.$ This defines specific measurements where the approximation in Eq. (\ref{eq:approx1}) has maximal error and the error cannot be reduced. In practice, this does not stop the SILL dictionary from achieving high levels of performance for system identification \cite{johnson2022augSILL}. This makes sense as the set $M_{\bar\Lambda}$ is a finite collection of $m-1$ dimensional sets in $\mathbb{R}^m$, and is therefore of Lebesgue measure zero. \begin{theorem}\label{thm:SILLconv} Under Assumption \ref{assump:order}, if the measurements, $y$, do not exactly match the SILL dictionary functions corresponding center parameters, $y\not\in M_{\bar\Lambda}$, then, as the steepness parameters go to infinity, the product of two conjunctive logistic function will exponentially approach a single conjunctive logistic function in the dictionary, specifically, $\alpha\rightarrow\infty$, \[\Lambda(y;\theta_l) \Lambda(y;\theta_j) - \Lambda(y;\theta^*)\rightarrow 0\] at a rate of $e^{-c\alpha}$, for some positive constant $c$. \end{theorem} Theorem \ref{thm:SILLconv} implies an intermediate result to demonstrating uniform finite approximate closure of the SILL basis in approximating a Koopman generator. This result is given in Corollary \ref{cor:logSILLApprox1} and it connects Theorem \ref{thm:SILLconv} to the Lie derivative of a SILL dictionary function. Since our Koopman models are linear in nature, each Lie derivative will need to be approximated as a linear combination, or weighted sum, of dictionary functions. However, the Lie derivative of each dictionary function is a nonlinear weighted sum of bilinear terms. Corollary \ref{cor:logSILLApprox1} replaces all of the bilinear terms in this nonlinear weighted sum with individual dictionary functions. This gives us an intermediate approximation that is nearly the linear combination of dictionary functions that we need for a Koopman model. \begin{corollary}\label{cor:logSILLApprox1} Under the assumptions of Theorem \ref{thm:SILLconv}, when $F$ is spanned by a SILL dictionary, the Lie derivative of a conjunctive logistic function exponentially approaches a finite weighted sum of conjunctive logistic functions as the steepnesses of the functions goes to infinity. Specifically, \begin{equation}\begin{aligned}\label{eq:nonlinearCombforSILL}\dot\Lambda(y;\theta_l)\rightarrow \sum_{i=1}^{n}\sum_{j=1}^{N_L}\alpha_{li}w_{ij}(1-\lambda(y_i;\theta_{li}))\Lambda(y;\theta^*)\end{aligned}\end{equation} exponentially as $\alpha\rightarrow\infty$. \end{corollary} The intermediate approximation to the Lie derivative of a conjunctive logistic function given in Corollary \ref{cor:logSILLApprox1} will be further approximated as a Koopman model in Section \ref{sec:averageErrorSILL}. This intermediate approximation is not a linear combination of dictionary functions like a Koopman model would be. However, the error between this intermediate approximation and the true Lie derivative is uniformly bounded by the intermediate bounding constant \begin{equation}\begin{aligned} \bar B_1 = \max_{y\in M} \sum_{i=1}^{n}\sum_{j=1}^{N_L}\alpha_{li}w_{ij}(1-\lambda(y_i;\theta_{li}))\varepsilon_{\Lambda_l\Lambda_j}(y, i,j),\end{aligned}\end{equation} where $\varepsilon_{\Lambda_l\Lambda_j}(y,i,j) \triangleq \Lambda(y;\theta_l) \Lambda(y;\theta_j) - \Lambda(y;\theta^*)$ and $M$ is the set of possible measurement values. When $M=\mathbb{R}^m$ the intermediate bound $\bar B_1$ is finite as it is a sum and product of finite-valued functions. When $M=\mathbb{R}^m - M_{\bar\Lambda}$ the bound decreases exponentially as $\alpha$ becomes increasingly positive because $\varepsilon_{\Lambda_l\Lambda_j}(y,i,j)$ does so as well. This error bound for the intermediate approximation will be used in Section \ref{sec:VC} to bound the overall error of a Koopman model using the SILL dictionary. We now show the second step in an alternate path to characterizing the finite closure properties of the SILL dictionary. This is to approximate the SILL observables' Lie derivative as a linear combination of SILL basis functions, \begin{equation}\begin{aligned}\label{eq:SILL_finalApprox}\sum_{i=1}^{m}\sum_{j=1}^{N_L}\alpha_{li}w_{ij}\Lambda(y;\theta^*), \end{aligned}\end{equation} where $l\in\{1,2,...,N_L\}$. This step corresponds to the lower right arrow in the right side of Fig. \ref{fig:paper_summary} and is given in Corollary \ref{cor:logSILLApprox2}. \begin{corollary}\label{cor:logSILLApprox2} Under the assumptions of Theorem \ref{thm:SILLconv}, the error between \begin{equation}\begin{aligned}\label{eq:SILL_linearLie} \sum_{i=1}^{m}\sum_{j=1}^{N_L}\alpha_{li}w_{ij}\Lambda(y;\theta_l)\Lambda(y;\theta_j) \end{aligned}\end{equation} and Eq. (\ref{eq:SILL_finalApprox}) goes to zero exponentially as $\alpha\rightarrow \infty$. \end{corollary} \begin{proof} The proof follows from a direct application of Theorem \ref{thm:SILLconv}. $\blacksquare$\end{proof} The error described for the approximation in Corollary \ref{cor:logSILLApprox2} is uniformly bounded by \begin{equation}\begin{aligned} \tilde B_2 = \max_{y} \sum_{i=1}^{m}\sum_{j=1}^{N_L}\alpha_{li}w_{ij}\varepsilon_{\Lambda_l\Lambda_j}(y,i,j), \end{aligned}\end{equation} where $\varepsilon_{\Lambda_l\Lambda_j}$ is defined as above, and this bound likewise goes to zero exponentially as $\alpha$ increases. The bounding constant $B$ which we will use to demonstrate uniform finite closure will be a function of $\bar B_1$, $\tilde B_2$ as well as two other bounds. This relationship is in Section \ref{sec:VC}. The end result of Eq. (\ref{eq:nonlinearCombforSILL}) is a nonlinear combination of dictionary functions and Eq. (\ref{eq:SILL_linearLie}) is an approximation of the Lie derivative, $\dot\Lambda$. We explore the approximation quality in Section \ref{sec:averageErrorSILL}. Section \ref{sec:averageErrorSILL} also ties these results to conclude that the SILL dictionary satisfies uniform finite approximate closure and that the bounding constant goes to zero, $B\rightarrow 0$, exponentially as steepness of the dictionary functions increases and the number of measurements increase. Thus, SILL dictionary functions define a spanning set for Koopman observables. \begin{table*}[ht] \centering \begin{tabular}{|p{16mm}|p{44mm}|p{54mm}|p{28.5mm}|} \hline \textbf{Reference} & \textbf{Approximation} & \textbf{Difference (Error)} & \textbf{Error Bound} \\ \hline (\ref{eq:nonlinearCombforSILL}) & \(\begin{aligned} &\sum_{i=1}^{m}\sum_{j=1}^{N_L} \alpha_{li}w_{ij} \Lambda(y;\theta^*) \end{aligned}\) & \(\begin{aligned} &\sum_{i=1}^{m}\sum_{j=1}^{N_L} \alpha_{li}w_{ij} \lambda(y_i;\theta_{li}) \Lambda(y;\theta^*) \end{aligned}\) & \(\begin{aligned}&\sum_{i=1}^{m}\sum_{j=1}^{N_L}\frac{\nu_{ij}}{2^{m+1}} \end{aligned}\) \\ \hline (\ref{eq:SILL_lie_derivative}) & \(\begin{aligned} &\sum_{i=1}^{m}\sum_{j=1}^{N_L} \alpha_{li}w_{ij} \Lambda(y;\theta_l)\Lambda(y;\theta_j) \end{aligned}\) & \(\begin{aligned} &\sum_{i=1}^{m}\sum_{j=1}^{N_L} \alpha_{li}w_{ij} \lambda(y_i;\theta_{li})\Lambda(y;\theta_l)\Lambda(y;\theta_j) \end{aligned}\) & \(\begin{aligned}&\sum_{i=1}^{m}\sum_{j=1}^{N_L}\frac{\nu_{ij}}{2^{2m+1}} \end{aligned}\) \\ \hline \end{tabular} \caption{Approximations to and properties of error bounds for the equations referred to in the \textbf{Reference} column. The reference equation is approximated as the corresponding equation in the \textbf{Approximation} column. We give the error of this approximation in the \textbf{Difference (Error)} column. The \textbf{Error Bound} column gives a bound on this error.} \label{tab:linearityErrorAugSILL} \end{table*} \section{Uniform Finite Approximate Closure of the SILL Dictionary: Step 2}\label{sec:averageErrorSILL} This section simultaneously addresses the approximation of two related mathematical objects. \begin{enumerate} \item The nonlinear combination of SILL dictionaries in Equation (\ref{eq:nonlinearCombforSILL}) with a linear combination. \item The bilinear combination in Equation (\ref{eq:SILL_linearLie}) with the Lie derivatives of a conjunctive logistic function. \end{enumerate} So, there are two distinct approximations, one for Corollary \ref{cor:logSILLApprox1} and one for Corollary \ref{cor:logSILLApprox2}. The explicit approximations are given in Table \ref{tab:linearityErrorAugSILL}. In the sense of the steps shown in Fig. \ref{fig:paper_summary}, each of these approximations is a step closer to the Koopman model. The relationship between these approximations, Corollaries \ref{cor:logSILLApprox1} and \ref{cor:logSILLApprox2}, and the uniform finite approximate closure of the SILL dictionary is schematically depicted in Fig. \ref{fig:paper_summary}. To show uniform finite approximate closure, we need to characterize the error, \begin{equation}\begin{aligned}\label{eq:overallError} \epsilon(y) = \frac{d\psi(y)}{dt} - K\psi(y).\end{aligned}\end{equation} We do so by choosing a specific approximation for the time derivative of each nonlinear dictionary function in the SILL basis. Characterizing the closure of a dictionary means understanding the error between the Koopman model built with that dictionary and the true Lie derivative of each dictionary function. In Section \ref{sec:SILLclosure} we used mathematical analysis to show that the approximation error of some models will go to zero in the limit of high steepness. These models do not fully bridge the gap between our Koopman model and the true Lie derivative. This section characterizes additional approximation errors to fully connect our Koopman model to the true Lie derivative. Then, we uniformly bound those errors to show the uniform finite approximate closure of the SILL dictionary. For all $l\in\{1,2,...,N_L\}$, the error of approximating Eq. (\ref{eq:SILL_nonlinComb}) with Eq. (\ref{eq:SILL_finalApprox}) is: \begin{equation}\begin{aligned}\label{eq:SILL_lin_error} \sum_{i=1}^{m}\sum_{j=1}^{N_L}\alpha_{li}w_{ij}\lambda(y_i;\theta_{li})\Lambda(y;\theta^*), \end{aligned}\end{equation} and the error of approximating Eq. (\ref{eq:SILL_lie_derivative}) with Eq. (\ref{eq:SILL_linearLie}) is: \begin{equation}\begin{aligned}\label{eq:SILL_linProd_error} \sum_{i=1}^{m}\sum_{j=1}^{N_L}\alpha_{li}w_{ij}\lambda(y_i;\theta_{li})\Lambda(y;\theta_l)\Lambda(y;\theta_j). \end{aligned}\end{equation} To get a grasp on the kind of errors we can expect when modeling with the SILL basis we need to get a grasp on the magnitude of Eq. (\ref{eq:SILL_lin_error}) and Eq. (\ref{eq:SILL_linProd_error}). We do so by sampling possible parameter and state values from uniform distributions over a symmetric interval and then computing distributions of one dimensional logistic functions. We then do the same for terms in the sums in Equations (\ref{eq:SILL_lin_error}) and (\ref{eq:SILL_linProd_error}), under the assumption that $w_{ij}=1$. In doing so, we notice an exponential decrease in expected error as the number of measurements increases. \subsection{Expectation of Approximation Error Vanishes}\label{sec:augSILL_error} To understand the exponential decrease in expected approximation error we start with the expected values of a single dimensional logistic function. We do so with parameters and measurement values sampled from uniform distributions defined on the interval $[-a,a]$. We choose this statistical model for how our data and parameters are sampled, because 1) the data and parameters are assumed to belong to a bounded continuum, and 2) the uniform distribution is the maximum entropy distribution for a continuous random variable on a finite interval. Since our error terms are weighted sums of products of logistic functions we, under the assumption of independence, can compute the expected value of our error terms as a weighted sum of the distinct expected values of logistic functions. This is justified by the linearity of and product rule of expectation under independence. We cannot explicitly compute the probability density function (PDF) of our logistic functions, so, we compute the values of these integrals numerically. Intermediate steps and details of this approximation are in Section \ref{sec:AppendixPDF} of the Appendix. In Fig. \ref{fig:expectedVals} we show their calculated expected values and variances for symmetric uniform distributions with different values of $a$. We find that the expected value of a logistic function will be $1/2$ regardless of the sampling interval (see Fig. \ref{fig:expectedVals}). Its variance, as we sample in a wider interval, tends to the functional extremes of zero and one. This is favorable for the linearity of our approximation since, for all $\varepsilon\in (0, 0.5]$, $(0.5-\varepsilon)(0.5+\varepsilon) = 0.25 - \varepsilon^2 < 0.25 = (0.5)^2$. So, products of more extreme samples are lower in value than products of samples near the expected value. This demonstrates that our bound, and the error bounds that follow, computed using the expected value of $1/2$, are conservative. \begin{figure}[ht] \includegraphics[width=\linewidth ]{Screen_Shot.png} \caption{Expected values and variances of a logistic function with parameters and measurement values sampled from symmetric uniform distributions of various interval radii. Note that the expected value is always $1/2$.} \label{fig:expectedVals} \end{figure} We approximate a single term in the sum of the error function and extrapolate via the sum and product rule of expectation under the assumption of independence to see how nearly linear our approximation is (see Section \ref{sec:AppendixPDF} of the Appendix). We can conservatively bound the expectation of the approximation error as a product that decreases exponentially with the number of measurements. The expected value of a conjunctive logistic function is \begin{equation}\begin{aligned}\label{eq:CEBlogRBF} E[\Lambda]<\frac{1}{2^m}.\end{aligned}\end{equation} We now compute the expected error given the expected value of the logistic and conjunctive logistic functions. The end result is that, applying the independence assumption, one can conservatively expect the error of each summation term in Eq. (\ref{eq:SILL_lin_error}) to decrease in the numbers of measurements, $m$, at a rate bound above by $\frac{1}{2^{m+1}}$ and the error of each summation term in Eq. (\ref{eq:SILL_linProd_error}) to decrease in $m$ at a rate bound above by $\frac{1}{2^{2m+1}}$. In each case, these error bounds are exponentially decaying in $m$, the dimension of the measurements. Explicitly, these intermediate error bounds are \begin{equation}\begin{aligned}\label{eq:SILLerrorBounds} \bar B_2 = \sum_{i=1}^{m}\sum_{j=1}^{N_L}\frac{\nu_{ij}}{2^{m+1}} \mbox{ and }\tilde B_1=\sum_{i=1}^{m}\sum_{j=1}^{N_L}\frac{\nu_{ij}}{2^{2m+1}}, \end{aligned}\end{equation} where $\nu_{ij}\in\mathbb{R}$, where each $\nu_{ij}<a^2$ as each $\alpha_{li}$ and $w_{ij}$ is sampled from the interval $[-a, a]$. A summary is given in Table \ref{tab:linearityErrorAugSILL}. \subsection{Error of the final model}\label{sec:VC} Theorem \ref{thm:SILLconv} shows that in the limit of infinitely steep dictionary functions, the error of approximating the product of two conjunctive logistic functions with a single one goes to zero exponentially. This gave us two approximation corollaries that share exponentially decreasing error. Likewise, our probabilistic bound demonstrated that the error in approximating the Lie derivative of SILL functions as a Koopman model goes to zero exponentially, on average, as the number of measurements increases. This means that the error, $\epsilon_l(y)$, of the approximation \begin{equation}\begin{aligned} \label{eq:SILLapproximation} \dot{\Lambda}(y;\theta_l)& = \sum_{i=1}^{m}\sum_{j=1}^{N_L}\alpha_{li}w_{ij}(1-\lambda(y_i;\theta_{li}))\Lambda(y;\theta_l)\Lambda(y;\theta_j)\\& \approx \sum_{i=1}^{m}\sum_{j=1}^{N_L}\alpha_{li}w_{ij}\Lambda(y;\theta^*) \end{aligned}\end{equation} will be bound by the sum $\bar B_1 + \bar B_2$, as well as the sum $\tilde B_1 + \tilde B_2$\footnote{If $|\dot\Lambda-A_1|<\bar B_1$ and $|A_1 - A_2|<\bar B_2$, where $A_1$ is the limiting approximation in Eq. \ref{eq:nonlinearCombforSILL} and $A_2$ is the approximation on row 1 of Table \ref{tab:linearityErrorAugSILL}. Then $|\dot\Lambda-A_2|< \bar B_1 + \bar B_2$ by the triangle inequality. This argument applies to $\tilde B_1$ and $\tilde B_2$ without loss of generality where $A_1$ is the approximation on row 2 of Table \ref{tab:linearityErrorAugSILL} and $A_2$ is Eq. (\ref{eq:SILL_finalApprox}).}. This means that the error will be uniformly bounded by the constant \begin{equation}\begin{aligned}\min\{\bar B_1 + \bar B_2, \tilde B_1 + \tilde B_2\} \triangleq B>0.\end{aligned}\end{equation} The error will also exponentially go to zero with increasingly steep logistic functions and an increasingly large number of measurements. The error bounds tied to the number of measurements can be used to choose the number of observables to measure to build a good Koopman model. The bound, $B$, on our closure error, $\epsilon(y)$, goes to zero, $B\rightarrow 0$ at the extremes of large measurements and steep dictionary functions. This bound shows that the SILL dictionary satisfies uniform finite approximate closure. \begin{equation}\begin{aligned} |\dot\Lambda_l - A_2| < B(\alpha, m)\leq \bar B_1(\alpha, m) + \bar B_2(\alpha, m) \rightarrow 0 \end{aligned}\end{equation} exponentially as $\alpha$ and $m$ increase when $y\in\mathbb{R}^m-M_{\bar\Lambda}$ and $|\theta|$, $|K|$ are bounded. These are reasonable assumptions as the set $M_{\bar\Lambda}$ is of measure zero in $\mathbb{R}^m$ and that $|\theta|$, $|K|$ being bounded is required for any numerical application. Note that $B(\alpha, m)$ is constant given a set of possible measurements and a bound on the model parameters. It only varies in model parameters and hyperparameters. In practice, these limiting conditions of extreme steepness and measurement dimension are not required. This constant in measurements, $B$, appears to be a wide upper bound. One captures strong nonlinear system features using the SILL basis for a low dimensional dictionary and few measurements with no restrictions on the steepness parameter \cite{johnson2018class}. \section{Conclusion}\label{sec:conclusion} Learning models in a data-driven setting using human-defined dictionaries results in high-dimensional, over-parameterized representations of what could be simple physical phenomena. DeepDMD and other ANN learning techniques address these issues but at the cost of extensive computational time. Moreover, the dictionaries learned by deepDMD are ad hoc, randomly constructed, and difficult to interpret. To investigate how deepDMD finds successful Koopman invariant subspaces, we extracted simple features of the dictionary functions learned by deepDMD and looked for properties to explain their success. We discovered a Koopman dictionary which we call the State-Inclusive Logistic Lifting (SILL) dictionary. We showed, in Section \ref{sec:SILLclosure}, that SILL model error drops exponentially when steepness parameters increase and more measurements are included in the data. This suggests that SILL dictionaries can be used to construct high-fidelity, low-dimensional, structured, and interpretable Koopman models. Quantifying how many measurements should be taken to build an accurate Koopman model is an intriguing future research direction. The success of any measurement-inclusive Koopman dictionary depends on more than how the dictionary approximates the evolution of the measurements in time. It also depends on how well linear combinations of the dictionary functions approximate the dictionary function's Lie derivatives. The SILL dictionary is fully specified with closed-form analytical expressions (unlike deepDMD) and as a consequence of the theoretical results in this paper, satisfies a unique numerical property of uniform approximate finite closure. Our methodology provides a template for understanding how deep neural networks successfully approximate governing equations \cite{brunton2016discovering}, the action of operators and their spectra \cite{mezic2005spectral}, and dynamical systems \cite{mezic2013analysis}. Further, these results provide a pattern for improving scalability and interpretability of dictionary-based learning models for dynamical system identification. More can be done to improve dimensional scalability of dictionary models. The deepDMD algorithm suggests further innovations to improve dictionary learning. One such innovation that we see in the dictionaries learned by deepDMD is the use of heterogeneous dictionaries. This fruitful research direction will be given in part 2 of this paper \cite{johnson2022augSILL}. \begin{ack} Any opinions, findings and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the Defense Advanced Research Projects Agency (DARPA), the Department of Defense, or the United States Government. This work was supported partially by a Defense Advanced Research Projects Agency (DARPA) Grant No. FA8750-19-2-0502, PNNL Grant No. 528678, ICB Grant No. W911NF-19-D-0001 and No. W911NF-19-F-0037, and ARO Young Investigator Grant No. W911NF-20-1-0165. \end{ack} \bibliographystyle{plain}
\section{Introduction} \label{Introduction} \section*{Quantum light and electron scattering} \label{sec:Introduction} The energy levels of atoms and molecules change dramatically in confined spaces like that inside a cavity due to the coupling of matter excitations with the quantized radiation field. By this coupling hybrid light-matter states are formed opening up new pathways to manipulate and even control static and dynamic properties of the matter. Much work has been published reporting many possibilities to amplify or suppress available mechanisms and even to induce new ones by the presence of the quantized radiation field. Among the many examples reported, we mention here the possibilities to enhance energy transfer \cite{Cavity_ET_1,Cavity_CT_3} and charge transfer \cite{Cavity_CT_1,Cavity_CT_2,Cavity_CT_3,Cavity_CT_4}, to strongly vary the rate of spontaneous emission \cite{Cavity_Varying_Spontaneous_Emission}, to enhance or to completely suppress interatomic Coulombic decay \cite{Cavity_ICD}, to control photochemical reactivity \cite{Cavity_Chem_Reac_1,Cavity_Chem_Reac_2,Cavity_Suppressing_Reactions_Feist}, to control chemical reactions by varying the quantized field \cite{Cavity_Chem_Reac_3,Cavity_Chem_Reac_4,Cavity_Chem_Reac_5,Cavity_Chem_Reac_6,Cavity_GS_Reactivity}, and to induce new molecular non-adiabatic processes not available in free space \cite{Cavity_Chem_Reac_5,Cavity_Non_Adiab_1,Cavity_Non_Adiab_2,Cavity_LICI_1,Cavity_LICI_3,Cavity_LICI_4,LICI_LiF_Huo,Cavity_Coll_CI}. Incoming electrons are known to interact strongly with atoms and molecules in particular at kinetic energies at which the electrons temporarily attach to them forming so called resonances or metastable states \cite{Resonances_Atoms_Schulz,Resonances_Molecules_Schulz,Resonances_Review_Domcke}. The palette of phenomena due to resonances is very large, has been widely studied and is still an active field of research. The resonances show up in electron scattering experiments as enhancements of the scattering cross section at characteristic energies with widths typical for the lifetime of the resonance in question. In the case of molecules, many kinds of reactions take place of which we would like to mention only a few. May be the most important reaction is by a process called dissociative electron attachment \cite{Resonances_ACS_Symposium,Resonances_Review_Domcke,Resonances_DEA_Simons}, where an incoming electron first forms a resonance state with the molecule leading to the fragmentation of the molecule and the production of an anion as one of the fragments. This mechanism has been shown to play an important role in the atmosphere and in strand breaking of DNA in radiation damage \cite{Resonances_DEA_Sanche_1,Resonances_DEA_Sanche_2}. A recent example is the production of molecular oxygen from carbon dioxide \cite{Resonances_DEA_CO2}. In another kind of reactions involving an electron and a molecule in a metastable compound, called bond breaking by a catalytic electron, the formed resonance dissociates into nonradical neutral molecular subunits and a free electron, which plays the role of a catalyst \cite{Catalytic_electron_1,Catalytic_electron_2,Catalytic_electron_3}. In the resonance, the activation energy of a chemical reaction can be lowered enabling new reactions. An example is the barrierless path for the cis–trans isomerization of maleonitrile formed on the resonance surface where the electron leaves the system after yielding the desired isomer \cite{Resonance_Barrierless_Isomerization}. We shall demonstrate that the two areas of research, matter in quantum light and resonant electron scattering, can be merged and unified giving rise to new fundamental and intriguing phenomena. As one may anticipate that the resonance phenomena known in the absence of quantum light will be modified by the presence of this light, we concentrate in this first work on the appearance of a new type of resonances which is only present in quantum light. To easily distinguish between atomic and molecular resonances known in the absence of quantum light and resonances which may appear due to the presence of the quantum light, we would like to call the former {\it{natural resonances}} and the latter {\it{quantum light-induced resonances}}. Whenever unambiguous, the name {\it{light-induced resonances}} is used for brevity. \section*{Setup and application} \label{sec:Results_and_Discussion} We consider an incoming electron of kinetic energy $\epsilon_p$ impinging on a target atom or molecule. If this target system does not possess a natural resonance in the vicinity of $\epsilon_p$, the central question arises of how the quantum light can at all induce a resonance. For the ease of discussion we assume, without loss of generality, that the target system is neutral. The scenario we address is depicted schematically in Fig.~\ref{fig:system}. We shall show below that the hybrid state formed by the anion of the target system and a cavity photon becomes a resonance and mention that nearly all atoms \cite{Negative_Ions_Atoms_1} and the bulk of molecules \cite{Negative_Ions_Book_Herzberg,Multiply_Charged_Anions_1} possess a stable negative ion. We shall see that impinging electrons of suitable kinetic energy populate this resonance and thus activate the cavity, i.e., induce a cavity photon. \begin{figure}[H] \begin{center} \includegraphics[width=10cm]{System.eps} \caption{Schematic picture of the scenario investigated. An impinging electron of kinetic energy $\epsilon_p$ can scatter off a target atom or molecule which is in its ground state of energy $E^{N}_0$ and possesses $N$ electrons. As is the case for most atoms and molecules, the target can bind an electron and become a negative ion (anion) of energy $E^{N+1}_0$. We shall show that in a cavity of frequency $\omega_c$, the hybrid state formed by the anion and a cavity photon becomes a resonance leading to dramatic features in the scattering cross section of the impinging electron. Moreover, due to the cavity the impinging electron can be captured by the target.} \label{fig:system} \end{center} \end{figure} We consider an electronic system of $N+1$ electrons in a cavity with a quantized light mode (cavity mode) of frequency $\omega_c$ and polarization direction $\vec{e}_c$. The matter-cavity Hamiltonian reads \cite{Cohen_Tannoudji_Book,Feist_PhysRevX}: \begin{align}\label{Matter-Cavity-Hamiltonian} H = H_e + \hbar\omega_c\hat{a}^\dagger \hat{a} + g_0 \vec{e}_c\cdot \vec{d}(\hat{a}^\dagger + \hat{a}), \end{align} where $H_e$ is the electronic Hamiltonian of the system, $\vec{d}$ is the dipole operator of the system and $g_0$ is the coupling strength of the cavity. The quadratic dipole self-energy term is neglected as it is only of relevance for very strong coupling. One should be aware that the eigenstates of $H_e$ include both bound and electron scattering states. Initially, the target atom or molecule is in its ground state $\Phi^{N}_{0}$ of energy $E^{N}_0$, the incoming electron of momentum $p$ has the kinetic energy $\epsilon_p=p^2/2m$, and the cavity is at rest, i.e., it has zero photons. We shall denote this initial state as $|I,p,0_c\rangle = |\Phi^{N+1}(p),0_c\rangle$ and its energy is $E_I = E^{N}_0 + \epsilon_p$. The situation is schematically depicted on the left hand side of Fig.\ref{fig:system}. Other scattering states are analogously denoted by $|\Phi^{N+1}(k),0_c\rangle$. In the above Hamiltonian, the matter-cavity interaction term $H_{mc} = g_0 \vec{e}_c\cdot \vec{d}(\hat{a}^\dagger + \hat{a})$ couples states of the same total number of electrons, but with a different number of cavity photons. As a result, a scattering state $|\Phi^{N+1}(k),0_c\rangle$ can couple to a completely different type of state where the $N+1$ electrons form a bound state $\Phi^{N+1}_{0}$ of energy $E^{N+1}_0$ and the cavity has one photon. This state is denoted by $|\Phi^{N+1}_{0},1_c\rangle$ and its energy is $E^{N+1}_0 + \hbar\omega_c$. The quantity $E^{N}_0-E^{N+1}_0$ is the electron affinity of the target. See the right hand side of Fig.~\ref{fig:system}. To describe the scattering process and the formation of the matter-cavity hybrid resonance, it is convenient to compute the matrix elements of the so-called T-matrix \cite{Davydov_Book}. In our situation the T-matrix reads \begin{align}\label{T_Matrix} T = H_{mc} + H_{mc}(E_I - H_e - \hbar\omega_c\hat{a}^\dagger \hat{a} +i0^+)^{-1}T, \end{align} where $0^+$ is a positive infinitesimal. In the space of the scattering states $|\Phi^{N+1}(k),0_c\rangle$ and the bound hybrid state $|\Phi^{N+1}_{0},1_c\rangle$, the T-matrix for the resonant scattering can be computed in closed form as shown in the Supplementary Materials. Relevant are two kinds of matrix elements of the T-matrix. The first is between the initial state $|I,p,0_c\rangle$ introduced above and the final state $|F,p',0_c\rangle = |\Phi^{N+1}(p'),0_c\rangle$ of the scattering process and determines the resonant scattering cross section for an incoming electron of momentum $p$ and an outgoing electron of momentum $p'$. The second is between the initial state $|I,p,0_c\rangle$ and the hybrid state $|\Phi^{N+1}_{0},1_c\rangle$ and is related to the processes of capturing the electron by the target. We first concentrate on the scattering and return later to the capture. The relevant result for resonant scattering takes on the appearance: \begin{align}\label{Scattering_T_Matrix_Element} |\langle F,p',0_c|T|I,p,0_c\rangle|^2 = |\gamma_{p'0}|^2 \bigg|\frac{1}{\epsilon_p - \epsilon_c - F(\epsilon_p)}\bigg|^2|\gamma_{p0}|^2. \end{align} This appearance reminds of that of a discrete electronic state of energy $\epsilon_c$ embedded in the continuum and interacting with it \cite{Resonances_Review_Domcke}. In a cavity, the discrete state's energy is explicitly $\epsilon_c=E^{N+1}_0-E^{N}_0+\hbar\omega_c$ and describes the electron affinity of the target shifted into the continuum by a $\hbar\omega_c$ photon of the cavity, see Fig.~\ref{fig:system}. The interaction with the continuum is via the the matter-cavity interaction term $H_{mc}$ and turns the discrete state into a hybrid matter-cavity resonance with a finite lifetime. This interaction gives rise to a complex and energy dependent level shift \begin{align}\label{Complex_Level_Shift} F(\epsilon_p) = \Delta(\epsilon_p) - \frac{i}{2}\Gamma(\epsilon_p) = \sum_{k} \frac{|\gamma_{k0}|^2}{\epsilon_p - \epsilon_k +i0^+}. \end{align} The quantity $\Delta$ quantifies the energy shift caused by the interaction matrix elements $\gamma_{k0}=\langle\Phi^{N+1}(k),0_c|H_{mc}|\Phi^{N+1}_{0},1_c\rangle $ and $\Gamma$ determines the lifetime $\tau=\hbar/\Gamma$ of the created resonance. We mention that the real shift function $\Delta$ follows from the knowledge of the width function $\Gamma$, see Ref.~\cite{Resonances_Review_Domcke} and Supplementary Materials. If the dependence of $\Gamma$ on the energy can be neglected, the above expression (\ref{Scattering_T_Matrix_Element}) takes on the well known form of a Breit-Wigner cross section \cite{Davydov_Book,Taylor_Book}. \subsection*{Show-case example} \label{sec:Show_case_example} Although the true potential of the new idea proposed here is for molecules, we would like in this first work to accompany the general theory by an explicit and transparent show-case example to illustrate and quantify the findings. We chose the H atom as the target. One-electron potentials are often used to describe the electron attaching to it and forming the H$^-$ anion, see Ref.~\cite{Model_Potential_H_anion} and references therein. We adopt here the three dimensional potential (in atomic units) employed to compute the photodetachment of H$^-$ by strong high-frequency linearly polarized laser pulses \cite{Model_Potential_H_anion} \begin{align}\label{Model_Potential} V(r) = -V_0 e^{-r^2/r_0^2}, \end{align} where $V_0= 0.3831087$ and $r_0=2.5026$. This potential supports a single bound state and reproduces its energy and s-wave scattering length in full agreement with accurate variational results. Using this potential, the bound state of s symmetry and continuum states of p symmetry have been computed numerically within radial boxes of varying size $L$, and with them the coupling elements $\gamma_{k0}=\langle\Phi^{N+1}(k),0_c|H_{mc}|\Phi^{N+1}_{0},1_c\rangle $ have been determined. These elements then served to calculate the shift and width functions $\Delta$ and $\Gamma$. The convergence with respect to the size of the box has been checked. The calculations are described in the Supplementary Materials. \begin{figure}[H] \begin{center} \includegraphics[width=10cm]{decay_width_delta.eps} \caption{The shift and width functions $\Delta$ and $\Gamma$ for resonant electron scattering from the H atom in a cavity. The model potential in Eq.~(\ref{Model_Potential}) has been applied. $\epsilon_p$ is the kinetic energy of the impinging electron. $\Delta$ and $\Gamma$ account for the energy shift and decay rate the discrete state depicted on the r.h.s. of Fig.~\ref{fig:system} experiences due to its interaction with the continuum. Note that the plots show the quantities $\Delta/g^2_0$ and $\Gamma/g^2_0$ which are independent of the coupling strength $g_0$ of the cavity.} \label{fig:decay_width_delta} \end{center} \end{figure} The computed shift and width functions $\Delta$ and $\Gamma$ are shown in Fig.~\ref{fig:decay_width_delta}. Inspection of Eq.~(\ref{Complex_Level_Shift}) shows that these quantities characterizing the impact of the continuum on the discrete state, depend quadratically on the coupling strength $g_0$ of the cavity. While $\Gamma$ is, except at threshold $\epsilon_p=0$, a positive function, $\Delta$ can take on positive as well as negative values. This implies that the energy $\epsilon_c$ of the discrete state can be shifted to higher or lower energies by its interaction with the continuum depending on the value of the photon energy $\hbar\omega_c$, see the denominator in Eq.~(\ref{Scattering_T_Matrix_Element}) and text below. It is common to define the energy of the resonance, $E_{res}$, at the energetic position where the real part of the denominator of the T-matrix vanishes \cite{Resonances_Review_Domcke}. In our case of a quantum light-induced resonance, this definition leads to finding the kinetic energy where $\epsilon_p = \epsilon_c + \Delta(\epsilon_p)$ is fulfilled. In the specific example of the H atom, $\Delta(\epsilon_p)$ is seen in Fig.~\ref{fig:decay_width_delta} to vanish at about $\epsilon_p=0.73$~eV where it changes its sign from being negative at lower and positive at higher values of the energy. Accordingly, the resonance is shifted to lower energies than $\epsilon_c$ if $\hbar\omega_c$ is chosen to be smaller than $(0.75 + 0.73)=1.48$~eV and to higher energies otherwise. An interesting situation arises if $\hbar\omega_c<1.48$~eV and the cavity coupling constant $g_0$ is large. Then, the discrete state can be shifted by the continuum below threshold and become a bound state of an anion and a cavity photon. For more details, see Supplementary Materials, in particular Fig.~S5. We remind that all of these is controlled by the cavity in contrast to the situation in natural resonances where the resonance is an entity given by nature. \subsection*{Cross sections} \label{sec:cross_sections} To obtain the integral cross section for resonant scattering, one has to integrate the expression (\ref{Scattering_T_Matrix_Element}) over the final angles of the outgoing electron and average over the molecular orientations. In case a single outgoing wave dominates the scattering, the cross section takes on the simple appearance \cite{Resonance_SCattering_N2_1} \begin{align}\label{Scattering_Cross-Section} \sigma = \frac{2\pi}{\epsilon_p} \Gamma(\epsilon_{p'})\bigg|\frac{1}{\epsilon_p - \epsilon_c - F(\epsilon_p)}\bigg|^2 \Gamma(\epsilon_{p}). \end{align} In our explicit example of resonant scattering from H, the scattering is elastic, i.e., $\epsilon_{p'} = \epsilon_{p}$. We have kept $\Gamma(\epsilon_{p'})$ for later purposes. Using the shift and width functions shown in Fig.~\ref{fig:decay_width_delta}, the respective resonant cross sections are depicted in Fig.~\ref{fig:cross_section} for three values of the cavity coupling strength $g_0$ and two values of the cavity frequency. Due to the dependence of the shift and width functions on the energy, the cross sections are seen to strongly differ from the typical Lorentzian Breit-Wigner form. The cross sections are sensitive to the cavity coupling strength as well as to the cavity frequency. Even for the weakest coupling strength, the structure of the cross section is asymmetric for $\hbar\omega_c=1.5$~eV, and becomes Breit-Wigner-like only at higher cavity frequency. For the intermediate and larger values of the coupling strength, it is eye catching that the cross section is not localized energetically around a specific energy, but is rather spread over a broad energy interval. For $\hbar\omega_c=1.5$~eV, at which the shift function nearly vanishes (see text above and Fig.~\ref{fig:decay_width_delta}), the cross sections are seen to peak close to threshold and much less at the energy of the expected resonance at which the cross section for the weakest coupling strength peaks. The situation is even more pronounced for the larger cavity frequency $\hbar\omega_c=2.5$~eV, where a clear double-peaked cross section is found, one peak at the energy expected for the resonance on the ground of the weak coupling case, and one peak closer to threshold making the cross section to extend over a large energy range. \begin{figure}[H] \begin{center} \includegraphics[width=10cm]{cross_section.eps} \caption{Illustrative examples of the electron scattering cross section for H atom in a cavity. The employed width and shift functions are depicted in Fig.~\ref{fig:decay_width_delta}. Shown are cross sections for several values of the coupling strength $g_0$ and photon energy $\hbar\omega_c$ of the cavity. The cross sections are seen to strongly depend on these quantities. $\epsilon_c=E^{N+1}_0-E^{N}_0+\hbar\omega_c$ is the energy of the discrete state above the threshold of the continuum, see Fig.~\ref{fig:system}. This energy is indicated by a broken vertical line and allows one to better see the impact of the interaction of the discrete state with the continuum turning it into a resonance. The electron affinity of the H atom is 0.754 eV.} \label{fig:cross_section} \end{center} \end{figure} The found peculiar behavior of the cross section can be understood by examining expression (\ref{Scattering_Cross-Section}) for resonant scattering. The denominator is $[(\epsilon_p - \epsilon_c - \Delta(\epsilon_p)]^2 + [\Gamma(\epsilon_p)/2]^2$. For small coupling strength $g_0$, the cross section is seen to peak around the resonance position $E_{res}$, i.e., where $E_{res} = \epsilon_c + \Delta(E_{res})$ is fulfilled. The shift and width functions grow quadratically with $g_0$ and, therefore, as the coupling strength grows $[(\epsilon_p - \epsilon_c - \Delta(\epsilon_p)]^2$ can become small at several and even for a range of values of kinetic energies $\epsilon_p$. See Figs.~S3 and S4 and the accompanying text in the Supplementary Materials. Depending on the structure of the width function, the resonant cross section can become substantial also at these values of kinetic energies. \subsection*{Electron capture probabilities} \label{sec:electron_capture} We now turn to electron capture. Without a cavity an isolated atom can only capture an electron by emitting the excess energy as a photon, a process called photo-recombination widely studied in media with low atomic densities \cite{Sobelman,Photorecombination_Review_Mueller}. The capture cross section by photo-recombination is rather small. The capture cross section has been shown to be substantially enhanced by the presence of neighboring atoms and molecules via a process called interatomic Coulombic electron capture \cite{ICEC_JPB,ICEC_First_ab_initio}. Can the presence of a cavity make electron capture by a single isolated atom or molecule an efficient process? To answer this basic question we turn to the total scattering state $|\Psi^+_p\rangle$. This state fulfills the well known Lippmann-Schwinger equation \cite{Gottfried_Book,Taylor_Book} which is closely related to the T-matrix equation (\ref{T_Matrix}). When calculating the T-matrix, one also obtains the total scattering state. While the projection of the final scattering states $|F,p',0_c\rangle$ introduced above on the total scattering state $|\Psi^+_p\rangle$, i.e., $|\langle F,p',0_c|\Psi^+_p\rangle|^2$, describes the scattering process, the projection of the discrete state $|\Phi^{N+1}_{0},1_c\rangle$ on the total scattering state, i.e., $|\langle \Phi^{N+1}_{0},1_c |\Psi^+_p\rangle|^2$, describes the capture of the impinging electron by the target. This quantity is calculated in the Supplementary Materials. To assess the importance of the capture and its dependence on the energy, we consider the probability to capture an electron with kinetic energies in a small energy interval $\delta_{\epsilon_p}$ around $\epsilon_p$. As shown in the Supplementary Materials, the capture probability takes on the appearance \begin{align}\label{Capture_Probability} P_{capture} = \dfrac{1}{2 \pi} \dfrac{\Gamma(\epsilon_p) \delta_{\epsilon_p}}{(\epsilon_p - \epsilon_c - \Delta(\varepsilon_p))^2 + (\Gamma(\epsilon_p) + \Gamma_{phot})^2/4}. \end{align} \noindent The new quantity $\Gamma_{phot}$ will be discussed below. \begin{figure}[H] \begin{center} \includegraphics[width=10cm]{capture_probability.eps} \caption{Illustrative examples of the electron capture probability by the H atom in a cavity. Shown are capture probabilities for several values of the coupling strength $g_0$ and photon energy $\hbar\omega_c$ of the cavity. The corresponding scattering cross sections are depicted in Fig.~\ref{fig:cross_section}. The lifetime of the cavity has been assumed to be 20 fs, i.e., $\Gamma_{photon}=33$~meV, and the probability relates to electrons in a kinetic energy interval of $\delta_{\epsilon_p}=0.01$~eV. The energetic position of the discrete state embedded in and interacting with the continuum is drawn as a broken vertical line.} \label{fig:capture_probability} \end{center} \end{figure} The capture process needs some further discussion. The discrete state is, of course, not an eigenstate of the Hamiltonian and it decays into the continuum as discussed above. However, its projection on the total scattering state $|\Psi^+_p\rangle$ has to be understood as an average value of the occupation of this discrete state and will be found if measurements are made. But there is more to it. The discrete state is a hybrid cavity-matter state and it can also decay by emitting the cavity photon and become a truly bound anion which cannot decay anymore. Indeed, quantum light as realized in nowadays cavities is subject to the finite lifetime of the cavity photon, see, e.g., Ref.~\cite{Cavity_Dynamics_Polaritons_Sfeir}. This decay of the cavity photon can be taken into account \cite{Cavity_Losses_Feist} by employing Lindblad master equations or, equivalently, by solving the Schr\"odinger equation for the non-Hermitian Hamiltonian obtained by augmenting the cavity Hamiltonian $\hbar\omega_c\hat{a}^\dagger \hat{a} \rightarrow \hbar\omega_c\hat{a}^\dagger \hat{a} -i\Gamma_{phot}/2$. Inspection of the T-matrix (\ref{T_Matrix}), shows how the cavity photon decay rate $\Gamma_{phot}$ enters the denominator, giving rise to the overall width $(\Gamma(\epsilon_p) + \Gamma_{phot})$ of the resonance. To illustrate the capture of the impinging electron by the H atom, the capture probability $P_{capture}$ is shown in Fig.~\ref{fig:capture_probability} as a function of energy for the same values of the cavity frequencies and cavity coupling strengths as used for the scattering cross sections in Fig.~\ref{fig:cross_section}. The photon decay rate $\Gamma_{phot} = 33$~meV used corresponds to a cavity photon lifetime of $20$~fs discussed for a nano cavity \cite{Cavity_Dynamics_Polaritons_Sfeir}. The capture probability is seen to vary strongly with the cavity frequency and with the coupling strength. Interestingly, the capture is most efficient for the weaker coupling strength. This is related to the fact that the decay width of the resonance $\Gamma(\epsilon_p)$ scales quadratically with the coupling strength, see also Fig.~\ref{fig:decay_width_delta}. Consequently, the decay of the discrete state into the electron continuum can be made slow for weak coupling and this, in turn, gives rise to a longer lifetime of the resonance and with it to a higher capture probability. \section*{Future prospects} \label{sec:Conclusions_and-Outlook} Normally, hybrid states are populated by external light by addressing a polariton. Recently, the possibility to pump the cavity mode with a laser pulse has also been explored computationally \cite{Cavity_Mode_Pumped_Feist,Cavity_Mode_Pumped_Agnes}. In this work we have shown that the cavity can be activated by electrons. This opens the door to a completely new kind of physics and chemistry. A hybrid resonance state consisting of an electron attached to the target and a cavity photon is formed and its decaying properties are discussed. This light-induced resonance can decay into the electron continuum and also by loss of a cavity photon thus creating a stable atom or molecule with an extra electron. As the cavity frequency and coupling strength determine the energetic position and decay properties of the light-induced resonance, one can have full control of the resonance and its properties in stark contrast to free atoms and molecules where the resonances and their properties are given by nature. There is a vast number of applications and phenomena to be expected. A few directions are briefly discussed in the following. Cavities of different kinds are available, like optical and plasmonic nanocavities, and over the last decade, there has been a tremendous progress of quantum cavity technologies, for a review, see, e.g., Ref.~\cite{Cavity_Review_Technology}. Depending on the properties of the cavities one can choose suitable scenarios to investigate. For instance, if the cavity frequency available is small, systems with small electron affinities in combination with low electron kinetic energies can be investigated. In general, there are highly interesting phenomena near threshold if a low lying resonance is encountered \cite{Resonances_Review_Domcke}, and in cavity we are rather flexible to place the resonance at will. Let us return to the example of the H atom and choose the cavity frequency such that for a given coupling strength the position of the emerging resonance is close to threshold. The calculated cross sections are collected in Fig.~\ref{fig:cross_section_threshold} for three values of the coupling strength. A resonance close to threshold leads to a high and peaked cross section. In the upper panel the photon energy $\hbar\omega_c=0.9$~eV creates a light-induced resonance close to threshold for the weakest coupling strength. As seen in the figure, the respective cross section strongly dominates those for the stronger coupling values. It is illuminating to notice that the resonance position follows from the equation $E_{res}=\epsilon_c + \Delta(E_{res})$ which for $\hbar\omega_c=0.9$~eV has solutions at negative energies for the stronger coupling strengths, i.e., instead of a resonance, a bound hybrid state appears below threshold. The impact of these bound states on the respective cross sections is much weaker than that of a resonance close to threshold in spite of the larger coupling strengths. The other panels of Fig.~\ref{fig:cross_section_threshold} demonstrate that one can selectively enhance the cross section for a desired coupling strength. The visualization of the latter equation, a figure showing the respective capture probabilities and additional cross sections are collected in the Supplementary Materials. A comparison of Fig.~\ref{fig:cross_section_threshold} which is in the absence of cavity losses and of Fig.~S6 in the Supplementary Materials which takes account of losses, strikingly underline that the measured cross sections sensitively reflect the cavity photon lifetime for resonances at threshold. This important observation may provide a tool to investigate details of cavity losses. \begin{figure}[H] \begin{center} \includegraphics[width=9cm]{cross_section_threshold.eps} \caption{Illustrative examples of cross sections peaking close to threshold by controlling the cavity frequency for different coupling strengths. The energetic position of the discrete state embedded in and interacting with the continuum is drawn as a broken vertical line. Its energy depends linearly on the cavity frequency. This discrete state is shifted downwards in energy due to its interaction with the continuum and becomes a resonance due to its coupling to the continuum. As the shift depends quadratically on the coupling strength $g_0$, one can by choosing the photon energy $\hbar\omega_c$ control the location of the resonance. A resonance close to threshold leads to a high and peaked cross section. The photon energy $\hbar\omega_c=0.9$~eV brings the resonance for $g_0=0.001$~au close to threshold where it dominates the cross sections of the larger coupling strengths. In analogy, the other values of the photon energy shown are chosen to bring the resonance close to threshold for the other values of the coupling strength. See also Fig.~S6 in Supplementary Materials, demonstrating the sensitivity to the cavity photon lifetime for resonances at threshold.} \label{fig:cross_section_threshold} \end{center} \end{figure} Anions of most atoms and of many molecules exist only in their electronic ground state, but there are interesting systems, like fullerenes, which possess several excited bound anionic states, see, e.g., Ref.~\cite{Anions_C20_YiFan}. Accordingly, there can be several light-induced hybrid resonances when in cavity. These resonances may be close by each other and even overlap within their decay width functions giving rise to interference effects in the cross sections and in the capture probabilities. If they do not overlap, one can in principle populate only one of them selectively and when the cavity photon decays, one is left in a single selected excited state of the anion. Of course, the atom or molecule in the cavity can also be a positive ion which is neutralized by the electron capture in the cavity. As the neutral system possess infinitely many Rydberg states close to the ionization threshold, there is an infinite manifold of discrete hybrid states in quantum light made of a Rydberg state and a cavity photon. All these states interact with the electron continuum giving rise to a complex light-induced resonance structure which makes its calculation rather intricate. The resulting electron capture process should take place already at very small cavity photon energies as the Rydberg series converges towards the ionization threshold. Due to the dense Rydberg manifold, we expect the capture to be efficient. An important issue is the interplay of natural and light-induced resonances. If the energies of these two kinds of resonances are within their width functions, they will interact and severe interference effects are to be expected. As one can vary the photon energy, it is possible in many cases to bring the light-induced resonance to the energetic vicinity of the natural resonance and in this way have an impact on the effect of the latter. For example, as discussed in the introduction, molecular resonances can lead to the dissociation of the molecule by dissociative electron attachment, which is a highly important process triggered by a resonance. By creating a light-induced resonance in the vicinity of the natural resonance, one can, in principle, impede the dissociation. The interplay between the resonances will depend on the cavity photon energy and the cavity coupling strength which can be varied to better control the outcome. Molecules possess internal degrees of freedom, in particular vibrations. The resonant scattering in free molecules leads to severe vibrational excitations and this is expected to also be the case in cavity with the light-induced resonance. The formalism employed here for cavity can be extended to take account of vibrations following the same line as done for free molecules by replacing $\epsilon_p$ in the complex shift function $F(\epsilon_p)$ by $\epsilon_p - H_v$, where $H_v$ is the vibrational Hamiltonian of the target \cite{Resonances_Review_Domcke,Local_vs_Nonlocal_1981}. As a consequence, this basic function becomes an operator in nuclear coordinate space playing the role of an energy dependent and nonlocal potential for the nuclear motion in the resonance which has an impact on observations even far from threshold \cite{Resonance_SCattering_N2_1}. Close to threshold there is a plethora of strong effects due to the nonadiabaticity imposed by this operator in particular for molecules with a permanent dipole moment \cite{Resonances_Review_Domcke,Local_vs_Nonlocal_1981,DEA_HNCO_Dipole_Cizek,Star_Formation_H2_Cizek}. We expect that similar findings will be present for the light-induced resonances, but in contrast to the situation found for the natural resonances, the findings for the latter are controllable. Last but not least, we mention the arising overwhelming possibilities due to several atoms or molecules in the cavity. \section*{Acknowledgments} \noindent The authors thank A. I. Kuleff and H.-D. Meyer for valuable contributions. Financial support by the European Research Council (ERC) (Advanced Investigator Grant No. 692657) is gratefully acknowledged. \bibliographystyle{apsrev} \section*{Contents} {\bf I. The resonant T-matrix and the total scattering state II. The computational model III. Resonance energies IV. Results for resonances close to threshold} \newpage \section{The resonant T-matrix and the total scattering state} \label{The resonant T-matrix and the total scattering state} The T-matrix describes a scattering process and can be used to calculate the respective cross section as well as the total scattering state \cite{Davydov_Book,Gottfried_Book,Lippmann_Schwinger_Weinberg_Book}. For Hamiltonians which can be written as $H=H_0+H_1$, where $H_0$ describes the incoming and outgoing scattering states and $H_1$ the interaction which gives rise to the scattering process, the T-matrix satisfies the following equation \begin{align}\label{T-matrix} T = H_1 + H_1(E_I - H_0 +i0^+)^{-1}T, \end{align} where $E_I$ is the initial energy of the scattering process and $0^+$ is a positive infinitesimal. The T-matrix can be expressed via the expansion \begin{align}\label{T-matrix-expansion} T = H_1 + H_1(E_I - H_0 +i0^+)^{-1}H_1 + ... , \end{align} which can be utilized to compute its elements. In our case of an atom or molecule exposed to quantum light, the Hamiltonian reads \cite{Cohen_Tannoudji_Book,Feist_PhysRevX,Oriol_Cavity_CP} \begin{align}\label{Matter-Cavity-Hamiltonian} H = H_e + \hbar\omega_c\hat{a}^\dagger \hat{a} + g_0 \vec{e}_c\cdot \vec{d}(\hat{a}^\dagger + \hat{a}), \end{align} where the various terms are defined in the main text. Identifying the unperturbed Hamiltonian as the electronic part and the cavity photons of the set up with $H_0=H_e + \hbar\omega_c\hat{a}^\dagger \hat{a}$, and the interaction between them with $H_1=H_{mc}=g_0 \vec{e}_c\cdot \vec{d}(\hat{a}^\dagger + \hat{a})$, leads to \begin{align}\label{T_Matrix} T = H_{mc} + H_{mc}(E_I - H_e - \hbar\omega_c\hat{a}^\dagger \hat{a} +i0^+)^{-1}T. \end{align} As discussed in the main text, initially, the target atom or molecule is in its ground electronic state $\Phi^{N}_{0}$ of energy $E^{N}_0$, the incoming electron of momentum $p$ has the kinetic energy $\epsilon_p=p^2/2m$, and the cavity is at rest and has zero photons. This initial state is denoted as $|I,p,0_c\rangle = |\Phi^{N+1}(p),0_c\rangle$ and its energy is $E_I = E^{N}_0 + \epsilon_p$. Other scattering states, where the electron has the energy $\epsilon_k$ are analogously denoted by $|\Phi^{N+1}(k),0_c\rangle$. The matter-cavity interaction $H_{mc}$ couples states of the same total number of electrons, but with a different number of cavity photons. As a result, a scattering state $|\Phi^{N+1}(k),0_c\rangle$ can couple to a completely different type of state where the $N+1$ electrons form a bound state $\Phi^{N+1}_{0}$ of energy $E^{N+1}_0$ and the cavity has one photon. This state is denoted by $|\Phi^{N+1}_{0},1_c\rangle$ and its energy is $E^{N+1}_0 + \hbar\omega_c$. The quantity $E^{N}_0-E^{N+1}_0$ is nothing but the electron affinity of the target. As discussed in the main text, the coupling between the two kinds of states, the scattering states $|\Phi^{N+1}(k),0_c\rangle$ and the bound state $|\Phi^{N+1}_{0},1_c\rangle$, can turn the latter state into a resonance which has a finite lifetime and decays into the electronic continuum. This resonance is a hybrid matter-light resonance and can be born only due to the presence of the quantum light. In the main text it has been called quantum light-induced resonance or briefly light-induced resonance and as nowadays quantum light is realized in a cavity, we may also call it cavity-induced resonance. In this work we are interested in the impact of this new kind of resonances on scattering and electron capture process and investigate the T-matrix for resonant scattering. We assume that the target atom or molecule itself does not possess intrinsic resonances (called natural resonances) in the relevant energy range in order to demonstrate this impact clearly. If the target does have natural resonances in the energy range investigated, the situation is extremely striking as there is a controlled interplay or competition between the induced and natural resonance. Controlled, because in contrast to the natural resonance whose properties are given by nature, we can change the properties of the induced resonance by varying the quantum light frequency $\omega_c$ and coupling strength $g_0$. The interplay between the induced and natural resonance is addressed in the main text but goes beyond the present context. To calculate the resonant scattering process, we utilize the expansion (\ref{T-matrix-expansion}) in the space of $|\Phi^{N+1}(k),0_c\rangle$ and $|\Phi^{N+1}_{0},1_c\rangle$ which are eigenstates of the unperturbed Hamiltonian $H_0$. We introduce the interaction matrix elements \begin{align}\label{interaction-matrix-elements} \gamma_{k0} &=\langle\Phi^{N+1}(k),0_c|H_{mc}|\Phi^{N+1}_{0},1_c\rangle, \nonumber \\ &= g_0 d_{k0}, \end{align} and mention that they are linear functions of the coupling strength and the dipole transition moment $d_{k0}$ between the anionic state $\Phi^{N+1}_{0}$ and a continuum state $\Phi^{N+1}(k)$ with $k$ being parallel to the polarization direction $\vec{e}_c$ of the cavity mode. Applying the T-matrix to the initial state $|I,p,0_c\rangle = |\Phi^{N+1}(p),0_c\rangle$ also provides the total scattering state $|\Psi^+_p\rangle$ which is given by \begin{align}\label{total-scattering-state} |\Psi^+_p\rangle &=|I,p,0_c\rangle + (E_I - H_e - \hbar\omega_c\hat{a}^\dagger \hat{a} +i0^+)^{-1}H_{mc}|\Psi^+_p\rangle, \nonumber \\ &= |I,p,0_c\rangle + (E_I - H_e - \hbar\omega_c\hat{a}^\dagger \hat{a} +i0^+)^{-1}T|I,p,0_c\rangle, \end{align} and note that the expansion (\ref{T-matrix-expansion}) actually also provides the total scattering state. Employing the expansion one finds \begin{align}\label{expansion-terms} T|I,p,0_c\rangle = & |\Phi^{N+1}_{0},1_c\rangle\gamma_{0p} + \sum_{k}|\Phi^{N+1}(k),0_c\rangle\gamma_{k0}(\epsilon_p - \epsilon_c +i0^+)^{-1}\gamma_{0p} + ..., \nonumber \\ |\Psi^+_p\rangle =& |I,p,0_c\rangle + |\Phi^{N+1}_{0},1_c\rangle(\epsilon_p - \epsilon_c +i0^+)^{-1}\gamma_{0p} \hspace{0.2cm} + \nonumber \\ + & \sum_{k}|\Phi^{N+1}(k),0_c\rangle(\epsilon_p - \epsilon_k +i0^+)^{-1}\gamma_{k0}(\epsilon_p - \epsilon_c +i0^+)^{-1}\gamma_{0p} + ..., \end{align} where $\epsilon_c=E^{N+1}_0-E^{N}_0+\hbar\omega_c$ and $E^{N}_0-E^{N+1}_0$ is the electron affinity of the target. As shown in Refs.(\cite{Resonance_Vibrational_Structure_1977,Resonances_Review_Domcke}), these series can be summed up exactly. The result reads \begin{align}\label{expansion-summed-up} T|I,p,0_c\rangle = & \sum_{k}|\Phi^{N+1}(k),0_c\rangle\gamma_{k0}(\epsilon_p - \epsilon_c - F(\epsilon_p))^{-1}\gamma_{0p} + \nonumber \\ + & |\Phi^{N+1}_{0},1_c\rangle F(\epsilon_p)(\epsilon_p - \epsilon_c - F(\epsilon_p))^{-1}\gamma_{0p} \nonumber \\ |\Psi^+_p\rangle - |I,p,0_c\rangle = & |\Phi^{N+1}_{0},1_c\rangle(\epsilon_p - \epsilon_c - F(\epsilon_p))^{-1}\gamma_{0p} \hspace{0.2cm} + \nonumber \\ + & \sum_{k}|\Phi^{N+1}(k),0_c\rangle(\epsilon_p - \epsilon_k +i0^+)^{-1}\gamma_{k0}(\epsilon_p - \epsilon_c - F(\epsilon_p))^{-1}\gamma_{0p}, \end{align} where the complex shift function reads \begin{align}\label{Complex_Level_Shift} F(\epsilon_p) = \Delta(\epsilon_p) - \frac{i}{2}\Gamma(\epsilon_p) = \sum_{k} \frac{|\gamma_{k0}|^2}{\epsilon_p - \epsilon_k +i0^+}, \end{align} and will be evaluated numerically for an example in the next section where also the general relationship between the real and imaginary parts of the complex shift function is given. \section{The computational model} \label{The computational model} In the illustrative example chosen in the man text, the Hydrogen atom is the target for the impinging electron. We adopt the three dimensional potential (in atomic units) employed to compute the photodetachment of H$^-$ by strong high-frequency linearly polarized laser pulses \cite{Model_Potential_H_anion} \begin{align}\label{Model_Potential} V(r) = -V_0 e^{-r^2/r_0^2}, \end{align} where $V_0= 0.3831087$ and $r_0=2.5026$. The anion possesses a single bound state. The radial Schr\"odinger equation is solved numerically for both the angular momenta $l=0$ and $l=1$ in a radial box of length $L$ for a number of box radii by diagonalizing the Hamiltonian of the radial Schrödinger equation numerically to get the corresponding eigenvalues and eigenvectors. The Hamiltonian matrix is written in a discrete variable representation (DVR), which is a pseudo-spectral method \cite{DVR_1}. As basis functions we choose the eigenfunctions of the quantum mechanical 1D “Particle in a box” problem, which are sine functions. Their boundary conditions define the behavior of our computed eigenvectors, which are consequently zero at the boundaries. In the sine-DVR, the grid points, the weights, the matrix of the unitary transformation between the sine function basis and the grid basis, as well as the grid basis can be calculated analytically. This allows one to directly built the potential energy matrix. The evaluation of the effective potential at the calculated grid points, provides the elements of the diagonal matrix. Getting the kinetic energy matrix is more tricky. After computing the matrix in the basis of the sine functions, the before analytically calculated unitary transformation matrix is applied to finally get the kinetic energy matrix in the grid basis. \subsection{Complex level shift function} To determine the complex level shift function $F(\epsilon_p)$, we first calculate the transition dipoles between the ground state $\psi_0(l=0)=\sqrt{\dfrac{1}{4 \pi}} R(r)$ and all the computed states $\psi_k(l=1)= \sqrt{\dfrac{3}{4 \pi}} \cos(\vartheta) R_k(r)$ in the radial box, which we enumerate by $k$, along the polarization direction which is chosen to be the $z$ axis \begin{align}\label{Transition_Dipoles} \braket{\psi_0(l=0)|z|\psi_k(l=1)} = d_{0k}, \end{align} and \begin{align} d_{k0}^* = d_{0k}. \end{align} We remind that the coupling elements are provided by $\gamma_{0k} = d_{0k}g_0$, where $g_0$ is the coupling strength of the cavity. To evaluate the complex level shift function in Eq.(\ref{Complex_Level_Shift}), we first make use of the relation \cite{Math_Phys_Book} \begin{align} \frac{1}{\epsilon_p - \epsilon_k +i0^+} = P\frac{1}{\epsilon_p - \epsilon_k} -i\pi\delta(\epsilon_p - \epsilon_k), \end{align} where P stands for the Cauchy principal value, and transform the sum into an integral \cite{Correlation_Effecs_Atoms_Kelly} \begin{align}\label{sum_integral} \sum_k \rightarrow \dfrac{L}{\pi} \int_0^{\infty} dk \end{align} for the radial momenta. Due to the appearance of the $\delta$-function, the integration to obtain the imaginary level shift can be made explicitly, giving \begin{align}\label{Gamma} \Gamma(\epsilon_p) = \pi \, \dfrac{8}{\sqrt{2}} \, L \, \dfrac{|\gamma_{p0}|^2}{\sqrt{\epsilon_p}} \, . \end{align} The real level shift function can be obtained from the imaginary one, by employing the relationship \cite{Resonances_Review_Domcke} \begin{align}\label{Delta} \Delta(\epsilon_p) = \dfrac{1}{2\pi}\, P \, \int_0^{\infty} d\epsilon_k \, \dfrac{\Gamma(\epsilon_k)}{\epsilon_p - \epsilon_k}, \end{align} and has to be evaluated numerically. To demonstrate the convergence achieved with respect to the box size $L$ used, we show in Fig. (\ref{fig:Transition_Dipoles_Convergence}) the distribution of the absolute squares of the dipole transition moments computed for several box sizes. When multiplied by $L$, these distributions converge with growing box size to within the line width used to draw the curves. In all the results shown in the main text and below, the largest box size $L=80\,au$ is used. \begin{figure}[H] \begin{center} \includegraphics[width=10cm]{SM_transition_dipole_moments.eps} \caption{Demonstration of convergence achieved with respect to the box size $L$ used. The complex level shift function explicitly depends on the distribution of the absolute squares of the dipole transition moments multiplied by $L$, see Eqs. (\ref{Gamma},\ref{Delta},\ref{interaction-matrix-elements}). Shown are these distributions computed for several values of $L$.} \label{fig:Transition_Dipoles_Convergence} \end{center} \end{figure} \subsection{Electron scattering cross section and electron capture probability} Once the complex level shift function is calculated, the total resonant electron scattering cross section $\sigma (\epsilon_p)$ can be computed using \cite{Resonance_SCattering_N2_1} \begin{align}\label{cross_section} \sigma (\epsilon_p) = \dfrac{2 \pi}{\epsilon_p} \, \dfrac{\Gamma^2(\epsilon_p)}{(\epsilon_p - \epsilon_c - \Delta(\epsilon_p))^2 + (\Gamma(\epsilon_p)/2)^2}, \end{align} where the energy of the discrete state interacting with the continuum to become a resonance is, for electron-H scattering: \begin{align} \epsilon_c = E_0^{N+1} - E_0^N + \hbar\omega_c = -0.754\,eV + \hbar\omega_c . \end{align} We now turn to the probability to capture an electron due to the presence of the cavity. For that purpose we inspect the weight of the hybrid captured electron state $|\Phi^{N+1}_{0},1_c\rangle$ in the total scattering state $|\Psi^+_p\rangle$. Using the exact expression for the latter in Eq.(\ref{expansion-summed-up}), one immediately finds \begin{align} |\langle \Phi^{N+1}_{0},1_c|\Psi^+_p\rangle|^2 = \dfrac{|\gamma_{p0}|^2}{(\epsilon_p - \epsilon_c - \Delta(\epsilon_p))^2 + (\Gamma(\epsilon_p))^2/4}. \end{align} There is no meaning to probability at a point, and we have to sum over the states in a small energy interval $\delta_{\epsilon_p}$ around $\epsilon_p$. Within this interval the value of the complex level shift function does not change significantly, and we are left with a sum over $|\gamma_{p0}|^2$ only. Using the mapping (\ref{sum_integral}) and the relation (\ref{Gamma}) between the coupling elements and the width function $\Gamma(\epsilon_p)$, we find \begin{align} \sum_p |\gamma_{p0}|^2 \rightarrow \dfrac{1}{2\pi}\Gamma(\epsilon_p) \delta_{\epsilon_p}, \end{align} where the sum is over states in the small energy interval $\delta_{\epsilon_p}$. The capture probability is finally given by \begin{align}\label{capture_probability} P_{capture} = \dfrac{1}{2 \pi} \dfrac{\Gamma(\epsilon_p) \delta_{\epsilon_p}}{(\epsilon_p - \epsilon_c - \Delta(\epsilon_p))^2 + (\Gamma(\epsilon_p))^2/4}. \end{align} It accounts for the probability to capture an electron impinging within a small energy interval $\delta_{\epsilon_p}$ around $\epsilon_p$. As discussed in the main text, cavities are subject to losses which lead to a finite lifetime of the cavity photon, see, e.g., Ref.~\cite{Cavity_Dynamics_Polaritons_Sfeir}. This decay of the cavity photon can be taken into account \cite{Cavity_Losses_Feist} by augmenting the cavity Hamiltonian $\hbar\omega_c\hat{a}^\dagger \hat{a} \rightarrow \hbar\omega_c\hat{a}^\dagger \hat{a} -i\Gamma_{phot}/2$. Inspection of the T-matrix and total scattering state (\ref{expansion-summed-up}), shows how the cavity photon decay rate $\Gamma_{phot}$ enters the denominator in the cross section and in the capture probability, giving rise to the overall width $(\Gamma(\epsilon_p) + \Gamma_{phot})$ of the resonance. \section{Resonance energies } \label{Resonance_energies} The structure of the T-Matrix, Eq. (\ref{expansion-summed-up}) is that of a discrete electronic state of energy $\epsilon_c$ embedded in the continuum and interacting with it \cite{Resonances_Review_Domcke}. In a cavity, the discrete state's energy is explicitly $\epsilon_c=E^{N+1}_0-E^{N}_0+\hbar\omega_c$ and describes the energy of the hybrid anion-light state $|\Phi^{N+1}_{0},1_c\rangle$ relative to the energy of the target. The energy of the discrete state is shifted by $\Delta(\epsilon_p)$ and the discrete state acquires a finite lifetime by $\Gamma(\epsilon_p)$ via its interaction with the continuum. It is common to define the resonance energy as the solution of \cite{Resonances_Review_Domcke} \begin{align}\label{Resonance-energy} E_{res} = \epsilon_c + \Delta(E_{res}). \end{align} I.e., where for $\epsilon_p=E_{res}$ the real part of the denominator of the T-matrix vanishes. Assuming that the imaginary part $\Gamma(\epsilon_p)/2$ varies smoothly with energy, the scattering cross section peaks at the resonance energy $\epsilon_p=E_{res}$. While the width function $\Gamma(\epsilon_p)$ vanishes for negative argument, the shift function $\Delta(\epsilon_p)$ does not, see Eq. (\ref{Delta}). To have a complete picture of the situation of the resonance energy resulting from Eq. (\ref{Resonance-energy}), we depict the shift function in Fig. (\ref{fig:Delta_all_range}) also for negative energy values. We stress that solutions of Eq. (\ref{Resonance-energy}) at negative energies are meaningful and correspond to bound states. The coupling with the continuum of a discrete state lying in the continuum can give rise to a bound state below the threshold of the continuum if this coupling is sufficiently strong. Since the shift function $\Delta(\epsilon_p)$ depends quadratically on the cavity coupling strength $g_0$, one can control the strength of the coupling and thus the appearance of the structure of the cross section and capture probability, see also Section (\ref{Capture_probability_for_resonances_close_to_threshold}). \begin{figure}[H] \begin{center} \includegraphics[width=10cm]{SM_delta_all_range.eps} \caption{The entire level shift function $\Delta$. Note that while the width function $\Gamma$ vanishes for negative argument, this is not the case for $\Delta$. As a consequence, solutions of equation (\ref{Resonance-energy}) at negative energies are possible and give rise to bound states below the threshold of the continuum.} \label{fig:Delta_all_range} \end{center} \end{figure} The solutions of Eq. (\ref{Resonance-energy}) for the scattering cross sections addressed in Fig. (3) of the main text are depicted in Figs. (\ref{fig:Resonance_energy_crossing_hw_c_1_5}) and (\ref{fig:Resonance_energy_crossing_hw_c_2_5}). Each of these figures is for a given value of $\hbar\omega_c$ and shows three panels related to the different cavity coupling values of $g_0$ treated in the main text. Shown are the curves $E=\epsilon_p$ and $E=\epsilon_c + \Delta(\epsilon_p)$, the crossing points of which are solutions of Eq.~(\ref{Resonance-energy}). For the weak coupling case, the energy area around the crossing is smooth and one can anticipate a peaked structure of the cross sections at the energy of the resonance, symmetric for $\hbar\omega_c=2.5$~eV and less symmetric for $\hbar\omega_c=1.5$~eV due to the wiggle $\Delta(\epsilon_p)$ makes at low energy. For the other coupling strengths the situation is more interesting. For $\hbar\omega_c=2.5$~eV, the resonance energy is rather high and a peak can be seen in the cross section close to this energy, and due to the now more pronounced wiggle of $\Delta(\epsilon_p)$ and remembering that $\Gamma(\epsilon_p)$ is larger at lower energies, a second peak emerges in the cross sections at low energy (see Fig.~(3) of the main text). This lower lying peak is relatively more dominant for the strongest coupling strength, because the energy difference there between the two curves in the lower panel of Fig.~(\ref{fig:Resonance_energy_crossing_hw_c_2_5}) is clearly smaller than that in the middle panel. See Eq.~(\ref{cross_section}). A rather unusual situation occurs for the stronger couplings at $\hbar\omega_c=1.5$~eV. One can see in the middle panel of Fig. (\ref{fig:Resonance_energy_crossing_hw_c_1_5}) that the two curves $E=\epsilon_p$ and $E=\epsilon_c + \Delta(\epsilon_p)$ are very close to each other from about threshold to their crossing point. This explains the rather spread out structure of the cross section avoiding a two peak structure like that seen for $\hbar\omega_c=2.5$~eV in Fig.~(3) of the main text and discussed above. The situation is similar for the strongest studied coupling. Here, however, as seen in the lowest panel of Fig.~(\ref{fig:Resonance_energy_crossing_hw_c_1_5}), the two curves are not just close to each other over an extended energy range, but even exhibit more than a single crossing point. We may conclude that the cross sections, as well as the resonances can change substantially by varying the parameters of the quantum light used. \begin{figure}[H] \begin{center} \includegraphics[width=10cm]{SM_Resonance_energy_crossing_hw_c_1_5.eps} \caption{On the energy of the resonance for the H atom and $\hbar\omega_c=1.5$~eV. Shown are the two curves $E=\epsilon_p$ and $E=\epsilon_c + \Delta(\epsilon_p)$ as a function of energy $\epsilon_p$ for three values of the cavity coupling strength $g_0$. At their crossing point(s), the equation (\ref{Resonance-energy}) defining the resonance energy is fulfilled. See the text explaining the appearance of the respective scattering cross sections in the light of these curves.} \label{fig:Resonance_energy_crossing_hw_c_1_5} \end{center} \end{figure} \begin{figure}[H] \begin{center} \includegraphics[width=10cm]{SM_Resonance_energy_crossing_hw_c_2_5.eps} \caption{On the energy of the resonance for the H atom and $\hbar\omega_c=2.5$~eV. Shown are the two curves $E=\epsilon_p$ and $E=\epsilon_c + \Delta(\epsilon_p)$ as a function of energy $\epsilon_p$ for three values of the cavity coupling strength $g_0$. At their crossing point(s), the equation (\ref{Resonance-energy}) defining the resonance energy is fulfilled. See the text explaining the appearance of the respective scattering cross sections in the light of these curves.} \label{fig:Resonance_energy_crossing_hw_c_2_5} \end{center} \end{figure} \newpage \section{Results for resonances close to threshold} \label{Capture_probability_for_resonances_close_to_threshold} In general, one can expect strong effects on the cross section if the resonance is close to threshold \cite{Resonances_Review_Domcke}. Whether a resonance of a free atom or molecule is close to threshold, is dictated by nature. In cavity, one can, in principle, tune the cavity such that the resonance gets close to threshold. Indeed, as the shift function varies substantially close to threshold, see Fig. (\ref{fig:Delta_all_range}), one may anticipate strong threshold effects as demonstrated in the main text. Let us return to the example of the H atom and choose the cavity frequency such that for a given coupling strength the position of the emerging resonance is close to threshold. The calculated cross sections are collected in Fig. (5) of the main text for three values of the coupling strength. A resonance close to threshold has been shown there to lead to a high and peaked cross section close to threshold. In the upper panel, the photon energy $\hbar\omega_c=0.9$~eV creates a light-induced resonance close to threshold for the weakest coupling strength. As seen in the figure, the respective cross section strongly dominates those for the stronger coupling values. To better understand the finding that the weak coupling peak strongly dominates those for the stronger couplings, we compute the resonance positions for $\hbar\omega_c=0.9$~eV and all the three coupling strengths employed. Similarly as done above in Figs.~(\ref{fig:Resonance_energy_crossing_hw_c_1_5}) and (\ref{fig:Resonance_energy_crossing_hw_c_2_5}) for other values of $\hbar\omega_c$, we plot the two curves the two curves $E=\epsilon_p$ and $E=\epsilon_c + \Delta(\epsilon_p)$ and look for their crossing points which define the resonance energy position. The results for all three values of the cavity coupling strength are drawn in Fig.~(\ref{fig:Resonances_at_threshold}) for $\hbar\omega_c=0.9$~eV. It is seen in the upper panel that as expected, the resonance for the weakest coupling is close to threshold. Because the shift function $\Delta$ grows quadratically with the coupling strength, the respective solutions the equation $E_{res}=\epsilon_c + \Delta(E_{res})$ drop below the threshold and instead of a resonance, a bound hybrid state appears below threshold. The impact of these bound states on the respective cross sections is much weaker than that of a resonance close to threshold in spite of the larger coupling strengths. The other panels of Fig.~(5) in the main text demonstrate that one can selectively enhance the cross section for a desired coupling strength. For any value of $g_0$, there is a value $\hbar\omega_c$ which creates a resonance close to threshold. At the same $\hbar\omega_c$, the resonance is pushed below the threshold and becomes a bound state for larger values of $g_0$, and pushed away from threshold and has thus typically less impact on the cross section for smaller values of $g_0$. \begin{figure}[H] \begin{center} \includegraphics[width=10cm]{SM_crossing_at_threshold.eps} \caption{On the energy of the resonance for the H atom and $\hbar\omega_c=0.9$~eV. Shown are the two curves $E=\epsilon_p$ and $E=\epsilon_c + \Delta(\epsilon_p)$ as a function of energy $\epsilon_p$ for three values of the cavity coupling strength $g_0$. At their crossing point, the equation (\ref{Resonance-energy}) defining the resonance energy is fulfilled. For $\hbar\omega_c=0.9$~eV, the hybrid resonance for the smallest cavity coupling strength is close to threshold and for the stronger couplings it is pushed below threshold and becomes a hybrid bound state.} \label{fig:Resonances_at_threshold} \end{center} \end{figure} \newpage Since nowadays cavities are lossy and the cavity photon has a finite lifetime, we have redone the calculations of the cross section with $\Gamma_{phot}=33$~meV, i.e., the lifetime of the cavity has been assumed to be $20$~fs. The results are collected in Fig.~(\ref{fig:cross_section_threshold_with_gamma_phot}). It is seen that as found for the situation without cavity losses, the cross section of the resonance near threshold strongly dominates the cross sections for the other coupling strengths at the same cavity frequency. However, comparing with the results without losses shown in Fig.~(5) of the main text, one finds that there is a strong impact of the cavity lifetime on the cross sections of the resonances close to threshold! This is of particular interest. For many targets the electron affinity can be rather small compared to that of the H atom. Being close to threshold implies that one can use low frequency cavities for which there are cavities of longer lifetime \cite{Cavity_Review_Technology}. The measured cross sections reflect sensitively the cavity photon lifetime for resonances at threshold. To complement the discussion of the cross section of resonances close to threshold, we briefly discuss also the capture probability of the same resonances. The respective data is shown in Fig.~(\ref{fig:Capture_probability_at_threshold}) for the same conditions as for the cross sections shown in Fig.~(\ref{fig:cross_section_threshold_with_gamma_phot}). For completeness we would like to show the impact of the finite lifetime on the cross sections for resonances far from threshold depicted in Fig.~(3) of the main text for the situation without losses, and, on the capture probability depicted in Fig.~(4) of the main text with losses. The cross sections computed including the losses can be seen in Fig.~(\ref{fig:cross_section_with_gamma_phot}). Comparing with Fig.~(3) of the main text shows some small impact of the losses, very negligible compared to the impact the losses have for resonances close threshold. The capture probabilities computed without taking losses into account are collected in Fig.~(\ref{fig:Capture_Probability_No_Photon}). \newpage \begin{figure}[H] \begin{center} \includegraphics[width=8.5cm]{SM_cross_section_threshold_with_gamma_phot.eps} \caption{Illustrative examples of cross sections peaking close to threshold by controlling the cavity frequency for different coupling strengths. In contrast to the ideal cavity in the respective figure (5) of the main text, the present cavity is lossy. The lifetime of the cavity has been assumed to be $20$~fs, i.e., $\Gamma_{phot}=33$~meV. The energetic position of the discrete state embedded in and interacting with the continuum is drawn as a broken vertical line. Its energy depends linearly on the cavity frequency. This discrete state is shifted downwards in energy due to its interaction with the continuum and becomes a resonance due to its coupling to the continuum. As the shift depends quadratically on the coupling strength $g_0$, one can by choosing the photon energy $\hbar\omega_c$ control the location of the resonance. A resonance close to threshold leads to a high and peaked cross section. The photon energy $\hbar\omega_c=0.9$~eV brings the resonance for $g_0=0.001$~au close to threshold where it dominates the cross sections of the larger coupling strengths. In analogy, the other values of the photon energy shown are chosen to bring the resonance close to threshold for the other values of the coupling strength. Comparison with Fig.~(5) of the main text demonstrates that the measured cross sections reflect sensitively the cavity photon lifetime for resonances at threshold.} \label{fig:cross_section_threshold_with_gamma_phot} \end{center} \end{figure} \begin{figure}[H] \begin{center} \includegraphics[width=10cm]{SM_capture_probability_threshold.eps} \caption{Capture probability for resonance close to threshold. Shown are the capture probabilities corresponding to the cross sections depicted in Fig. (\ref{fig:cross_section_threshold_with_gamma_phot}).} \label{fig:Capture_probability_at_threshold} \end{center} \end{figure} \begin{figure}[H] \begin{center} \includegraphics[width=10cm]{SM_cross_section_with_gamma_phot.eps} \caption{Illustrative examples of the electron scattering cross section for H atom in a cavity. Shown are cross sections for several values of the coupling strength $g_0$ and photon energy $\hbar\omega_c$ of the cavity. The energetic position of the discrete state embedded in and interacting with the continuum is drawn as a broken vertical line. Cavity losses (lifetime of the cavity of $20$~fs, i.e., $\Gamma_{photon}=33$~meV) have been taken into account. The results are to be compared with those shown in Fig.~(3) of the main text, where cavity losses have not been considered.} \label{fig:cross_section_with_gamma_phot} \end{center} \end{figure} \begin{figure}[H] \begin{center} \includegraphics[width=10cm]{SM_capture_probability_0.eps} \caption{Illustrative examples of the electron capture probability by the H atom in a cavity. Shown are capture probabilities for several values of the coupling strength $g_0$ and photon energy $\hbar\omega_c$ of the cavity. No cavity losses are included. The results are to be compared with those shown in Fig. (4) of the main text, where cavity losses are taken into account leading to a lifetime of the cavity of $20$~fs, i.e., $\Gamma_{photon}=33$~meV. The probability relates to electrons in a kinetic energy interval of $\delta_{\epsilon_p}=0.01$~eV. The energetic position of the discrete state embedded in and interacting with the continuum is drawn as a broken vertical line.} \label{fig:Capture_Probability_No_Photon} \end{center} \end{figure} \newpage \bibliographystyle{apsrev}
\section{Introduction} \label{sec:intro} Particle identification (PID) plays a crucial part in many high-energy physics analysis. A higher performance PID algorithm leads to a better background rejection and thus more precise results. In addition, the algorithm is required to work with high efficiency in the entire available wide range of signal topologies and kinematics and provide good discrimination for various analyses. Machine learning (ML) algorithms have gradually become the baseline approach for this task~\cite{ml_pid}. One large family of such algorithms is neural networks. The PID algorithms of the LHCb experiment relies on several sub-detector systems~\cite{LHCb}. Compared to other LHC experiments, LHCb has more information for hadron identification, particularly the separation between charged hadrons, provided by the Ring Imaging Cherenkov (RICH) subdetector. The muon identification is provided by the muon chambers, while the responsibility of calorimeters is mainly leptons and photons. The LHCb experiment employs several machine learning solutions~\cite{ml_pid} to aggregate the information for the PID. These solutions proved to have overall high efficiency over a large volume of the phase space. In this paper, we address one of the outstanding issues that can occur during the application of machine learning algorithms in the real-life scenario: algorithm's efficiency degradation in case the testing scenario is significantly different from training. The paper is organized as follows. The problem formulation and description of current LHCb PID algorithms are given in Section~\ref{sec:problem}. Section~\ref{sec:csd} provides a description of the Common Specific Decomposition algorithm used for the robust PID models. Finally, the list of training and testing samples, and the results for the different PID models are presented in Section~\ref{sec:data}. \section{Problem statement} \label{sec:problem} The LHCb detector is a single-arm forward spectrometer covering the pseudorapidity range $2 < \eta < 5$, described in detail in Ref.~\cite{LHCb}. Identification of various final state particles is performed by combining together the information from the LHCb subdetectors, namely from ring-imaging Cherenkov detectors~(RICH), the electromagnetic and hadronic calorimeters, muon chambers and tracking system, as demonstrated in Fig.~\ref{fig:pid_det}. Apart from the physics motivated likelihood observables based on observable subdetector responses~\cite{likelihood_subd}, track geometry variables and different detector flags are also used. In addition, the muon identification~\cite{muon_id} and calorimeter information about neutral clusters~\cite{neutral_clusters} are also used. \begin{figure}[h] \centering \includegraphics[width=0.7\textwidth]{img/pid_det.pdf} \caption{Illustration of different particle type responses in the LHCb systems. Figure from~\cite{2019EPJWC.21406011D}} \label{fig:pid_det} \end{figure} The objective of the PID algorithm is to identify the charged particle type associated with a given track. In the LHCb experiment, there are five relevant particle species: electron, muon, pion, kaon, and proton. A sixth hypothesis corresponds to ghost tracks, which do not correspond to a real particle that passed through the detector. \begin{figure}[h] \centering \includegraphics[width=1\textwidth]{distr.png} \caption{Distributions of transverse momentum for different decays in the simulated samples (left) and performance of the PID models on $D^{0} \to K^-\pi^+$ decay for the pion-vs-all task (right).} \label{fig:dist} \end{figure} The classification models for this task are trained on simulated events generated for the LHCb data taking condition for 2015-2018 data taking period with minimum bias trigger selection. In this study, we also use dedicated simulated samples of correctly reconstructed decays as a source of correctly reconstructed particles of a certain type. Particles in these decays might have distribution different from the training sample as demonstrated in Fig.~\ref{fig:dist}. Such differences may cause a quality reduction of the classification models in this regions. The aim of this research is to make PID algorithms~\cite{ml_pid} robust to differences in the kinematic distributions between the events used for training and events the algorithm faces in real use. The research is focused on neural networks only. In this work, we compare our PID algorithm with the following three models: \textbf{ProbNN}, \textbf{CombDLL}, and \textbf{DLRun2}. ProbNN is a neural network with a single hidden layer. CombDLL is a combination of differential log-likelihoods from the detector's subsytems. DLRun2 is a deep neural network with 3 wide hidden layers. Neural-based models are trained on minimum bias sample. The performance of the neural-based solutions is approximately the same when tested on the minimum bias sample. We notice that quality of the algorithms might deteriorate in some regions. The performance of the classifiers is tested with a sample of $D^{0} \to K^-\pi^+$ signal candidates (Fig~\ref{fig:dist}). As can be seen from the Figure, DLRun2 algorithm's quality is lower than its counterparts. \section{CSD algorithm} \label{sec:csd} To address the quality degradation, we use domain adaptation techniques~\cite{Vihari_CSD}. The idea laying behind the method is as follows: assume that there exist common features, whose correlation with the target is preserved in all decays, and decay-specific features, whose correlation differs from decays to decay (Fig~\ref{fig:assumption}). A classifier that relies solely on common features is robust to domain shifts. To achieve that, CSD algorithm use a weighted combination of these three terms in training objective: orthonormality regularizes and two cross-entropy losses between labels and distributions computed from the common and domain-specific features. This approach allows to compute low-rank decomposition along with a training networks parameters in a single layer. Hence, we replace final classification layer of DLRun2 model by CSD layer~\cite{Vihari_CSD} as shown in Fig.~\ref{fig:assumption}. \begin{figure}[!htb] \centering \includegraphics[width=0.4\textwidth]{csd_assumption.png} \caption{The CSD assumption.} \label{fig:assumption} \end{figure} \section{Data and results} \label{sec:data} For the experiment we use simulated minimum bias sample and pions from several decay channels: $D^{0} \to K^-\pi^+$, $D^* \to ({D^{0} \to K^-\pi^+})\pi^-$, $\Lambda_c \to p^+K^-\pi^-$, and $\Lambda_b^0 \to p^+\pi^-$. We train CSD model similarly to DLRun2 model on minimum bias sample. Then, we test every model on simulated run2 sample and each decay channel. For the CSD model an additional round of training with mixture of minimum bias sample and subset of listed above decays has been done in order to teach model to generalize in pion domain. In addition, we design a nearest neighbors test in the following way. For a correctly reconstructed particle in the decay chain we choose the kinematically closest particle of minimum bias sample for the different species. We thus mimic the misreconstruction real-life scenario. Table~\ref{tab:mcrun2} contains ROC AOC (i.e. Area over ROC curve) increment with respect to DLRun2 (uncertainty does not exceed 0.0008 as obtained by a bootstrap procedure). The result for nearest neighbors test is shown in Fig.~\ref{fig:csd_rocs}. \begin{table}[!htb] \centering \begin{tabular}[c]{|c| c | c | c | c | c | c|} \hline Model & Ghost & Electron & Muon & Pion & Kaon & Proton \\ [0.5ex] \hline DLRun2 & 100\% & 100\%& 100\% & 100\% & 100\% & 100\% \\ \hline ProbNN & $+41\% $ & $+14\% $ & $+418\% $ & $+51\% $ & $20\% $ & $+21\% $ \\ \hline CombDLL & -- & $+71\%$ & $+389\%$ & $+979\%$ & $+89\% $ & $+98\% $ \\ \hline \textbf{CSD} & $\textbf{-11\%}$ & $\textbf{-42\%} $ & $\textbf{-47\%}$ & $\textbf{-0.21\%}$ & $\textbf{-10\%}$ & $\textbf{-11\%}$ \\ \hline \end{tabular} \caption{\label{tab:mcrun2}ROC AOCs change for different PID models for paricle-vs-all task. DLRun2 AOC is taken as 100\%.} \end{table} \begin{figure}[!htb] \centering \includegraphics[width=0.9\textwidth]{nn.jpg} \caption{ROC AUCs for nearest neighbours test, the background sample is constructed of the best matching candidates as described in the text.} \label{fig:csd_rocs} \end{figure} The quality on those 4 decays itself rises significantly, as it demonstrated in Table ~\ref{tab:pion}. \begin{table}[!htb] \centering \begin{tabular}[c]{|c| c | c | c | c|} \hline Model & $D^* \to ({D^{0} \to K^-\pi^+})\pi^-$ & $\Lambda_c \to p^+K^-\pi^-$ & $\Lambda_b^0 \to p^+\pi^-$ & $D^{0} \to K^-\pi^+$ \\ [0.5ex] \hline DLRun2 & 100\% & 100\% & 100\% & 100\% \\ \hline \textbf{CSD} & $\textbf{-38\%} $ & $\textbf{-71\%} $ & $\textbf{-50\%} $ & $\textbf{-15\%} $ \\ \hline \end{tabular} \caption{\label{tab:pion}ROC AOC for the pionic decays unseen by the CSD algorithm during training. DLRun2 AOC is taken as 100\%.} \end{table} In addition to previous tests, we cross-check that the obtained solution has some generalization power. In order to prove this, we take two decays containing muons: $B^+ \to {K^+(J/\psi\to{\mu^+\mu^-})}$ and $B^+ \to {\mu^+\mu^-(K^*\to{K^+\pi_0)}}$ and compare CSD and DLRun2 quality. ROC AUC error rate for proposed method almost halved. Note, that models has never seen muon decays outside a minimum bias sample before. Table ~\ref{tab:muon} illustrates that model can generalize well over different domains. \begin{table}[!htb] \centering \begin{tabular}[c]{|c| c | c |} \hline Model & $B^+ \to {K^+(J/\psi\to{\mu^+\mu^-})}$ & $B^+ \to {\mu^+\mu^-(K^*\to{K^+\pi_0)}}$ \\ [0.5ex] \hline DLRun2 & 100\% & 100\% \\ \hline \textbf{CSD} & $\textbf{-97\%} $ & $\textbf{-98\%} $ \\ \hline \end{tabular} \caption{\label{tab:muon}ROC AOC on muonic decays. DLRun2 AOC is taken as 100\%.} \end{table} \section{Conclusion} \label{sec:conclusion} The degradation of machine learning solutions quality for the PID problem in the specific parts of the phase space is addressed. The CSD algorithm based on the separation of common and domain-specific features has shown promising results. The algorithm is able to select common features even for the decays that are not present in the original domains. The obtained algorithm shows higher stability with respect to previously presented thus giving substantial increase of solution's quality for particular case. The method thus can be used in many high-energy physics applications. \section*{Acknowledgement} The research leading to these results has received funding from Russian Science Foundation under grant agreement n° 17-72-20127. This research was supported in part through computational resources of HPC facilities at HSE University~\cite{HSE_HPC}. \nocite{python} \nocite{pytorch} \printbibliography \end{document}
\section{Introduction} \IEEEPARstart{I}{n} 2020, 22\% of the world's children were physically stunted due to malnourishment and lack of adequate medication\footnote{https://www.who.int/data/gho/data/themes/topics/joint-child-malnutrition-estimates-unicef-who-wb}. A majority of these children live in developing countries where healthcare facilities and other resources are not readily available. Furthermore, these countries do not have any secure government-issued identification documents to verify the recipient of the services and curtail the occurrence of fraud. To solve this problem, many international organizations such as the World Health Organization, Bill and Melinda Gates Foundation and the World Food Programme have made substantial efforts to reduce the rate of malnourishment as well as improve vaccination coverage among the more vulnerable population of the least developed countries. \par One initiative that has received significant attention is the use of biometrics (e.g., fingerprints and palmprints) for large-scale and accurate identification of children. However, biometrics-based identification solutions for children have yet to meet the field operation deployment criteria in many ways, including low cost biometric acquisition, high longitudinal recognition accuracy and robustness to imaging environment. Indeed, large-scale biometric identification systems in use today fail to account for children, arguably the most vulnerable population. The largest civil biometric database in the world, Aadhaar, only enrolls subjects over the age of 5 \cite{uidai}. This leaves a population of almost 118 million children unaccounted for in India alone . Further, India alone accounts for 25 million newborns every year. \par It is important to keep in mind that a biometric trait must meet the \textit{persistence} and \textit{individuality} requirements for the population under consideration \cite{jainbiometrics2011}. In our application, this means that the recognition accuracy of the biometric trait should not change over time and the biometric trait is different for different children. This rules out face biometrics since the face of a child dramatically changes during the first few years of their life. Footprints (friction ridge pattern at the bottom of the feet) do not satisfy the real-time acquisition requirement; the child's socks and footwear would need to be removed, or in cases where the child is barefooted, it may need to be cleaned to capture good quality footprints. Iris images are difficult to capture if the child is sleeping or crying. Further, capturing iris is akin to an ophthalmic exam which may make the parents uneasy. These limitations, paired with the rise of infectious diseases in the world, has motivated a push to develop biomteric systems that do not require physical contact with any surface\footnote{https://one.amazon.com/}. Toward this end, while contactless palmprint recognition has been studied primarily for adults, we propose it as a cost effective solution for large-scale child identification. Indeed, there is no requirement of custom sensors since smartphone cameras have sufficient resolution to capture contactless palmprint images. \begin{figure}[t] \begin{center} \includegraphics[width=\linewidth]{images/toddlers.png} \caption{Faces of infants, toddlers and preschoolers (0-5 years of age) in our database.} \label{fig:toddlers} \end{center} \end{figure} \begin{figure}[t] \begin{center} \includegraphics[width=\linewidth]{images/vaccine_clinic.png} \caption{Vaccination clinic organized by Gavi, The Vaccine Alliance, in Africa \cite{gavi}} \label{fig:vaccine_drives} \end{center} \end{figure} \begin{figure}[t] \begin{center} \includegraphics[width=\linewidth]{images/wfp.jpg} \caption{WFP biometric enrollment of children at food distribution center in South Sudan \cite{programme_2018}.} \label{fig:wfp} \end{center} \end{figure} \par Of the prominent biometric traits, we believe that friction ridge patterns (fingerprint, palmprint and footprint) are the most promising for child recognition. Friction ridge patterns are considered to be (i) unique, (ii) present at birth, and (iii) stable over time in terms of recognition accuracy. Footprint recognition is inconvenient due to the reasons aforementioned and fingerprint recognition has not yet been able to deliver the required recognition accuracy levels \cite{engelsma2021infant}. Palmprints, on the other hand, have the advantages of a larger surface area compared to fingerprints. \par Table \ref{table:previous_work} shows some of the studies conducted in the field of biometric recognition for children using different modalities. The fingerprint modality has been the popular choice thus far but recent studies have shown a trend towards contactless palmprints. The primary obstacle in contactless palmprint recognition for children is that of data. \par Prior attempts at palmprint-based recognition for children focused on newborns and infants (less than 12-months old). These attempts were largely unsuccessful because of the challenges in capturing palmprints of such young children who are not “cooperative” in terms of understanding instructions for placing their hand over palmprint readers \cite{lemes2011biometric}. To keep the child recognition problem tractable, we focus on children between 1 to 5 years. Child development studies report that starting at the age of one, a child can follow instructions and be considered as a “cooperative” subject in terms of opening the fist and placing the palm over the palmprint reader (in our case a mobile phone camera). This age group is also of interest to Aadhaar 2.0 \cite{press_info}, where one of the objectives is to lower the enrolment age which has been set at 5 since the inception of the program in 2009. \section{Contactless Palmprint Recognition} \begin{table*}[] \caption{Summary of biometrics-based literature on child (infants and toddlers) identification} \centering \begin{threeparttable} \begin{tabular}{|C{0.1\linewidth}|C{0.25\linewidth}|C{0.1\linewidth}|C{0.2\linewidth}|C{0.2\linewidth}|} \noalign{\hrule height 1.0pt} \specialcell{\textbf{Authors}} & \specialcell{\textbf{Database collection medium}} & \specialcell{\textbf{Modality}} & \specialcell{\textbf{Age Group (\# of subjects)}} & \specialcell{\textbf{Conclusion}} \\ \noalign{\hrule height 1.0pt} Jain et al., 2016 \cite{jain2016fingerprint} & Contact-based commercial and custom fingerprint sensors & Fingerprint & 0-5 years (309) & High accuracy shown by commercial matchers \\ \noalign{\hrule height 0.5pt} Liu, 2017 \cite{liu2017infant} & Contact-based commercial fingerprint sensor & Footprint & 1-9 months (60) & Footprint recognition is feasible as a biometric for children\\ \noalign{\hrule height 0.5pt} Ramachandra et al., 2018 \cite{ramachandra2018verifying} & Smartphone & Palm & 6-36 hours (50) & Strong recognition results using transfer learning \\ \noalign{\hrule height 0.5pt} Yambay et al., 2018 \cite{yambay2019feasibility} & Commercial contact-based footprint sensor & Toe print & 4-13 years (177) & Strong recognition performance using commercial matchers \\ \noalign{\hrule height 0.5pt} Saggese et al., 2019 \cite{saggese2019biometric} & Custom contactless fingerprint sensor & Fingerprint & 0-18 months (504) & Competitive performance using hand-crafted features \\ \noalign{\hrule height 0.5pt} Engelsma et al., 2021 \cite{engelsma2021infant} & Custom contactless fingerprint sensor & Fingerprint & 8-16 weeks (315) & High recognition accuracy using fingerprints \\ \noalign{\hrule height 0.5pt} \end{tabular} \end{threeparttable} \label{table:previous_work} \end{table*} \begin{figure}[t] \begin{center} \includegraphics[width=\linewidth]{images/data_collection.png} \caption{Contactless palmprint capture process of five different subjects using PalmMobile SDK at Saran Ashram Hospital, Dayalbagh, Agra, India. The trained volunteer kept an open communication with the child while collecting the data to make them feel comfortable. In some cases, the parent of the child also assisted in keeping the hand of the child steady. The orientation of the phone had to be adjusted based on the placement of the palm that the child is comfortable with.} \label{fig:data_collection} \end{center} \end{figure} \par Palmprint recognition broadly consists of two stages: (i) finding a "region of interest (ROI)", the central part of the palm and (ii) finding the similarity between two ROIs extracted from two different palm images. Current deployments of contactless palmprint recognition systems \cite{arcieri_2021, publisher_2022, matrix_access_control_2022} are predominantly geared towards adults \cite{dian2016contactless, zhang2017towards, liu2020contactless, morales2011towards, wu2014sift, leng2017dual, mascellino_2021}. In constrast, there are an extremely limited number of studies done for young children under the age of 5 \cite{rajaram2022palmnet}. There are no contactless palmprint datasets for children available in the public domain, nor any other known sources. Additionally, due to stringent privacy laws surrounding children, it is difficult to obtain such a database. This makes it extremely challenging to train a deep-network based system that relies on large amounts of data to achieve a competitive accuracy. \par \subsection{ROI Extraction:} \par ROI extraction is a critical part of palmprint recognition. There have been many studies focused on solely extracting a robust region of interest from a palmprint image. These methods range from using handcrafted features to using deep networks. \par The main drawback of handcrafted features is the constraints within which the input image must be captured. For instance, in \cite{zhang2017towards}, the palmprint is first binarized and the contours corresponding to the finger valleys are extracted. Using these points, geometrical operations are performed that yield a consistent ROI. The drawback of this approach is that it is assumed that the fingers will have a great deal of separation between them to facilitate a robust binary mask. So, if the user does not stretch the fingers of their hand wide apart, the ROI extracted will not be of a good quality. \par Another approach is using a state of the art CNN architecture (e.g. ResNet, VGG, Inception, etc.) that can learn to extract a robust region of interest. It is typically carried out by annotating a training dataset for landmark points and training a network that can generalize to as many orientations of the palm as possible. The main benefit of this method is that the fast extraction of features and matching compared to handcrafted features. However, handcrafted features may generalize better than deep networks on other datasets. \subsection{ROI matching:} \par Traditional methods of matching extracted ROIs rely on handcrafted image processing features such as SIFT descriptors and CompCode maps using Gabor filters. \par Once the ROI is extracted, the matching system is developed by fine-tuning a pre-existing deep network on the extracted ROIs \cite{zhang2017towards, liu2020contactless}. Once trained, the embeddings from these networks are used as feature sets for matching - providing speed and security. This task is dependent on the robustness of the ROI extraction module. Using a deep network embedding, obtaining a similarity score becomes as simple as computing a scalar product between two features which facilitates a large throughput of the system. \begin{figure*}[t] \begin{center} \includegraphics[scale=0.4]{images/collage.png} \caption{Sample images in Child PalmDB. The image quality and palm orientation vary depending on the level of cooperation of the child. In some cases, either the operator or the parent assisted the child in opening their hand so that the palmprint is clearly visible.} \label{fig:collage} \end{center} \end{figure*} \begin{figure}[t] \begin{center} \includegraphics[scale=0.45]{images/pie.png} \caption{Distribution of (a) gender and (b) age of subjects in the contactless palm image dataset, Child PalmDB. These attributes are available for 444 subjects out of a total of 515 subjects.} \label{fig:demographics} \end{center} \end{figure} \begin{figure}[t] \begin{center} \includegraphics[scale=0.3,angle=270,origin=c]{images/consent_form_process.jpg} \caption{Parents signing the consent form after they were explained the objective of the research study, how the data would be collected, and their rights to opt out of the study and have their child palmprint images and biographic information purged from the database.} \label{fig:consent_form} \end{center} \end{figure} \vspace{-1em} \section{Database} \par As mentioned, there is a shortage of palmprint databases of children in the public domain. The authors of this paper organized a data collection camp to collect palmprint data of children between the ages of 9 months to 5 years of age in collaboration with the Dayalbagh Education Institute in Agra, India. Over the course of 5 days starting August 23, 2022, roughly 19,000 palmprint images were collected from 1,027 palms (515 children), out of which demographic labels were collected for 444 subjects. After cleaning the raw images manually and with the aid of PalmMobile SDK by removing blurry images, accidental captures, failure-to-enroll cases, etc, the cleaned dataset consists of 18,036 images. \subsection{Data collection protocol} \par Each subject that agreed to have their data collected were required to sign a consent form approved by the ethics board of the authors' institutional board as well as that of the Saran Ashram Hospital. A volunteer explained the purpose of this project and the data collection protocol itself to the parents or legal guardians of the young subjects (fig. \ref{fig:consent_form}) after which another trained volunteer, capable of communicating in the local language, proceeded to capture the data of the child under the strict supervision of the authors of this study. To collect the data, we use the PalmMobile SDK developed by Armatura. It is a mobile application that is capable of enrolling palms as well as matching them. Figure \ref{fig:collage} shows images captured using this mobile application. \begin{figure}[t] \begin{center} \includegraphics[scale=0.5]{images/lines.png} \caption{Parents with their children lining up outside the data collection site in Dayalbagh, Agra, India.} \label{fig:lines} \end{center} \end{figure} \begin{figure}[t] \begin{center} \includegraphics[scale=0.5]{images/pruned.png} \caption{Examples of palmprint images that were deleted from our database. These include blurred images, images captured when the child moved their palm unexpectedly or was uncooperative. Out of a total of 19,139 images from 1,027 unique palms, 1,103 images were removed leaving a total of 18,036 images in the cleaned dataset comprising of 1,018 unique palms.} \label{fig:pruned} \end{center} \end{figure} \par Collecting data at this scale of young children is a challenge since children may be uncooperative while collecting the data or may not have developed the muscles in their hands to fully open their palms. In these cases, we requested the parents of the children to help hold their hand open so that acceptable quality images may be captured of the palms. Additionally, the trained operators were able to communicate with the child better than the authors of the paper which increased the cooperation of the child in many instances. The operator had to constantly communicate with the child to help calm them down so that the palms would be steady for capture (Figure \ref{fig:data_collection}). \par The authors of this paper had arranged for incentives for the family of each child whose data was collected. A majority of the subjects that participated in the data collection were from underprivileged communities and these incentives provided support for their daily household needs. \subsection{Data cleaning} \par Since there was some level of uncooperation from the young children involved in the data collection process, it is essential to clean up the data set to remove any images that are severely blurred, do not have a palm in them, accidentally captured while the child is being assisted to hold the palm steady etc. Fig \ref{fig:pruned} shows examples of such images that are not included in the cleaned dataset. \begin{figure}[t] \begin{center} \includegraphics[scale=0.55]{images/demo.png} \caption{User interface of PalmMobile SDK \cite{armatura}.} \label{fig:demo} \end{center} \end{figure} \section{Experimental Results} \begin{figure}[t] \begin{center} \includegraphics[scale=0.6]{images/cum_roc.png} \caption{Receiver Operating Characteristic Curves partitioned by age group. There are 322 unique palms above the age of 2 years, 566 unique palms below the age of 2 years and 1,018 unique palms overall. For 2 years and under, there are 107,796 genuine comparisons and 93,779,038 impostor comparisons. For ages above 2, there are 29,216 genuine comparisons and 27,054,995 impostor scores. Overall, there are 170,481 genuine comparisons and 171,723,130 impostor scores.} \label{fig:age_group_roc} \end{center} \end{figure} \par In this report, we evaluated PalmMobile SDK provided by Armatura. This is the same application used for the collection of Child PalmDB. Additionally, we also report results on the Tongji adult palmprint database \cite{zhang2017towards}. This database consists of 12,000 contactless palm images from 600 unique adult palms. Figure \ref{fig:demo} shows the user interface of the PalmMobile SDK mobile app. It has integrated capabilities for user enrolment and palmprint identification, which is extremely convenient for on-site data collection. \par We evaluate PalmMobile SDK in verification, closed-set identification and open-set identification modes on our Child PalmDB. For each evaluation, we report results on the entire dataset as well as subsets split by age and gender. \subsection{Verification} \par Figure \ref{fig:age_group_roc} shows that the algorithm performs better on children older than 2 years of age than those below 2 years. This is mainly due to the higher cooperation of older children during the collection of the data and possibly due to a larger number of children below the age of 2 years. Table \ref{tab:eval} summarizes the results for verification. It should be noted that since demographic labels were available for 444 subjects out of 515, the data subsets used in rows 2 and 3 are from 444 subjects. We can see the discrepancy in performance between adult palmprints and child palmprints which is a function of the difficulty in collecting the data for children. Figure \ref{fig:misclassified} shows that the cases in which the matcher fails are those when the two images of the palm are captured at a wide range of angles and when the palm of the child is not stationary and not fully open. \begin{figure*}[t] \begin{center} \includegraphics[scale=0.6]{images/misclassified.png} \caption{Misclassified genuine pairs with the corresponding similarity scores. The similarity score threshold at FAR = 0.01\% is 62.22. The range of scores is [0,100].} \label{fig:misclassified} \end{center} \end{figure*} \begin{figure*}[t] \begin{center} \includegraphics[scale=0.55]{images/correctly_classified.png} \caption{Correctly classified genuine pairs with the corresponding similarity scores. The similarity score threshold at FAR = 0.01\% is 62.22. The range of scores is [0,100].} \label{fig:correctly_classified} \end{center} \end{figure*} \begin{figure*}[t] \begin{center} \includegraphics[scale=0.43]{images/retrievals.png} \caption{Retrievals along with the similarity scores from the closed-set search using one mate per probe in the gallery. Gallery size is 26,636 images.} \label{fig:retrievals} \end{center} \end{figure*} \subsection{Identification} \par Since PalmMobile SDK and subsequent palmprint recognition systems will provide the most benefit in an identification setting, it is important to focus on the closed and open-set identification accuracy of the system. Improving the performance in these modes of operation is of primary importance. \par We report closed set identification results (rank 1) by randomly selecting 200 probe images of unique palms from Child PalmDB. Each of these probes has a single mated identity in the gallery. The gallery comprises of Child PalmDB and Tongji adult palmprints and consists of 26,636 images for Child PalmDB and 26,236 images for Tongji. We employ the same procedure for the Tongji dataset using 200 probes. A similar trend as the verification experiments was observed where the performance was better on older subjects compared to younger subjects. We see better performance in identification compared to verification due to the relatively small gallery size. Table \ref{tab:closed_set} shows that the identification accuracy on adult palmprints is much higher than child palmrpints. We anticipate that this discrepancy will amplify as the gallery size increases. Figure \ref{fig:retrievals} shows the top 5 retrievals for two queries. It is interesting to note that in the case of the first query (top row), the similarity score is below the verification threshold (for FAR = 0.01\%) but the mate was retrieved at rank-1. \par Additionally, we report the open-set identification results using 100 non-mated and 100 mated probes for Child PalmDB and Tongji adult palmprint dataset. This time, since the probes are non-mated, the gallery size is 26,536 images for Child PalmDB and 26,136 for Tongji. We report the False Positive Identification Rate (FPIR) at a fixed False Negative Identification Rate (FNIR) of 0.3 (30 mated probes out of 200 outside top 5 ranks) in table \ref{tab:open_set}. The performance on adult palmprints was better compared to Child PalmDB. Within Child PalmDB, the performance was better on older subjects compared to younger subjects. \begin{table}[h] \centering \caption{TAR(\%) @ FAR = 0.1\% and FAR = 0.01\% using PalmMobile SDK \cite{armatura}} \begin{tabular}{|C{0.4\linewidth} | C{0.2\linewidth}|C{0.2\linewidth}|} \hline \textbf{Evaluation dataset (\# of subjects)} & \textbf{TAR(\%) \@ FAR = 0.1\%} & \textbf{TAR(\%) \@ FAR = 0.01\%}\\ [1.0ex] \noalign{\hrule height 1.2pt} Child PalmDB (515)& 92.72 & 90.85\\ \hline Child PalmDB - $\leq$ 2 yrs (283)& 91.99 & 89.88\\ \hline Child PalmDB - $>$ 2 yrs (161)& 96.32 & 95.96\\ \noalign{\hrule height 1.2pt} Tongji adult palmprints (300)& 100 & 100 \\ \hline \end{tabular} \label{tab:eval} \end{table} \begin{table}[h] \centering \caption{Rank-1 Accuracy for PalmMobile SDK on Child PalmDB and Tongji adult palmprint dataset. Number of mated probes is 200 for Child PalmDB and Tongji database. Gallery size is 26,636 images for Child PalmDB and 26,236 images for Tongji database.} \begin{tabular}{|C{0.4\linewidth} | C{0.2\linewidth}|} \hline \textbf{Evaluation dataset} & \textbf{Rank-1 Accuracy(\%)}\\ [1.0ex] \noalign{\hrule height 1.2pt} Child PalmDB & 99.0\\ \hline Child PalmDB - Under 2 years & 98.5\\ \hline Child PalmDB - Over 2 years & 100.0\\ \noalign{\hrule height 1.2pt} Tongji adult palmprints & 100.0 \\ \hline \end{tabular} \label{tab:closed_set} \end{table} \begin{table}[h] \centering \caption{Open-set identification accuracy for PalmMobile SDK on Child PalmDB and Tongji datasets. Reported as FPIR at FNIR=0.3. Number of mated and non-mated probes is 100 for both Child PalmDB and Tongji database. Gallery size is 26,536 images for Child PalmDB and 26,136 for Tongji.} \begin{tabular}{|C{0.4\linewidth} | C{0.2\linewidth}|} \hline \textbf{Evaluation dataset} & \textbf{FPIR}\\ [1.0ex] \noalign{\hrule height 1.2pt} Child PalmDB & 0.01\\ \hline Child PalmDB - Under 2 years & 0.02\\ \hline Child PalmDB - Over 2 years & 0.0\\ \noalign{\hrule height 1.2pt} Tongji adult palmprints & 0.0 \\ \hline \end{tabular} \label{tab:open_set} \end{table} \section{Conclusion and Future Work} \par A plethora of children around the world continue to suffer and die from vaccine related diseases and malnutrition. A major obstacle standing in the way of delivering the vaccinations and nutrition needed to the children most in need is the means to quickly and accurately identify or authenticate a child at the point of care. To address this challenge, we evaluate a low-cost contactless child Palm-ID, an end-to-end child palmprint recognition system for the age group 1-5 years. It is our hope that this report will motivate a strong push for biometric recognition systems which can be used to alleviate child suffering around the world. In doing so, we believe that this work will make a major dent in Goal \#3 of the United Nations Sustainable Development Goals, namely, “Ensuring healthy lives and promoting well-being for all, at all ages.” \section{Acknowledgements} \par We thank Armatura for providing us with the mobile application that was used to collect the data as well as the PalmMobile SDK that was used to perform the evaluations on the Child PalmDB database. \ifCLASSOPTIONcaptionsoff \newpage \fi
\section{Introduction} The training of machine learning (ML) models usually requires a massive amount of data. Nowadays, the ever-increasing number of connected user devices has benefited the development of ML algorithms by providing large sets of data that can be utilized for model training. As privacy concerns become vital in our society, using private data from user devices for training ML models becomes tricky. Therefore, federated learning (FL) with on-device information processing has been proposed for its advantages in preserving data privacy. FL is a collaborative ML framework where multiple devices participate in training a common global model based on locally available data \cite{konevcny2016federated}. Unlike centralized ML architecture wherein the entire set of training data need to be centrally stored, in an FL system, only model parameters are shared between user devices and a parameter server. Due to the heterogeneity of participating devices, local training data might be unbalanced and not independent and identically distributed (i.i.d.), which deviates FL from conventional distributed optimization frameworks where homogeneous and evenly distributed data are assumed. Federated Averaging (FedAvg) is one of the most representative and baseline FL algorithms \cite{mcmahan2017communication}, with an iterative process of model broadcasting, local training, and model aggregation. In every iteration, the model aggregation process can start only when all the devices have finished local training. Thus, the duration of one iteration is seriously limited by the slowest device \cite{chen2016revisiting}. This phenomenon, commonly observed in synchronous FL methods, is known as the straggler issue. One approach to this issue is altering the synchronous procedure to an asynchronous one, i.e., the server does not need to wait for all the devices to finish local training before conducting updates aggregation. In the literature, such an asynchronous FL framework has been adopted in many deep-learning settings \cite{xie2019asynchronous,chen2020asynchronous}. However, fully asynchronous FL with sequential updating \cite{xie2019asynchronous,chen2020asynchronous} can lead to high communication costs due to frequent model exchanges. Hence, we propose an asynchronous FL framework with periodic aggregation, which eliminates the straggler effect without excessive model updating and information exchange between the server and participating devices. As compared to other existing works on FL with asynchronous updates \cite{wang2021resource,Nguyen2022Fed,zhou2021TeaFed}, our proposed design is easy to implement and requires a small amount of side information. Communication resource limitation is another critical issue in wireless FL systems. As model exchanges take place over wireless channels, the system performance (communication costs and latency) naturally suffers from the limitation of frequency/time resources, especially when the number of participating devices is large. One possible solution to reduce the communication load is to allow a fraction of participating devices to upload their local updates for model aggregation. Then, depending on the allocated communication resources and wireless link quality, each device compresses its model updates accordingly such that the compressed updates can be transmitted reliably given the allocated resources. Device scheduling and communication resource allocation are critical for achieving communication-efficient FL over wireless networks \cite{gafni2021federated, Yang2020scheduling}. Intuitively, devices with a higher impact on the learning performance should be prioritized in scheduling. This learning-oriented communication objective stands in contrast to the conventional rate-oriented design adopted in cellular networks, where the aim is to achieve higher spectral efficiency or network throughput. Several existing works consider different metrics to indicate the significance of local updates, such as norm of model updates \cite{amiriconvergence, luo2022tackling} and Age-of-Update (AoU) \cite{yang2019agebased}. Under the motivation of receiving model updates with less compression loss, some works consider wireless link quality in scheduling design \cite{salehi2021federated, importance-aware, Ozfatura2021fastF,chen2022federated, luo2022tackling}. On the other hand, to take into account the non-i.i.d. data distribution, uncertainty of data distribution is considered in \cite{importance-aware}, and in \cite{taik2021data, shen2022variance} the scheduling design follows the principle of giving higher priority to devices with larger diversity in their local data. Some works consider joint optimization of device scheduling and resource allocation towards minimal latency \cite{shi2021jointD} or empirical loss \cite{wadu2021jointC,chen2020aJoint}. Nevertheless, all of them consider synchronous FL systems. Few existing works have considered the design in an asynchronous setting. In \cite{Lee2021adaptive}, scheduling in asynchronous FL is considered based on maximizing the expected sum of training data subject to the uncertainty of channel conditions, data arrivals, and limited communication resources. However, the effect of non-i.i.d. data distribution is not considered in the scheduling design. Compared to the synchronous setting, asynchronous FL needs to deal with the asynchrony of local model updates since different devices may perform local training based on different versions of the global model. Some heuristic aggregation designs are explored in the literature. In \cite{Lee2021adaptive}, devices with more frequent transmission failures from past iterations will transmit enlarged gradient updates. In \cite{chai2020fedat}, larger weights are given to slower tiers in the aggregation process because slower tiers contribute less frequently to the global model. Both approaches aim at equalizing the contributions from different devices, though with i.i.d. data, it might slow down the convergence since model updates obtained from older global models might contain little useful information to the current version. We summarize the main contributions of this work: \begin{itemize} \item We propose an asynchronous FL framework with periodic aggregation that achieves fast convergence in the presence of stragglers, and avoids excessive model updating as in fully asynchronous FL settings. \item We propose a scheduling policy that jointly considers the channel quality and the training data distribution, aiming at reducing the variance and bias of the aggregated model updates. The effectiveness of the proposed method is supported both by theoretical convergence analysis and simulation results. \item We propose an age-aware weighting design for model aggregation to mitigate the effects of update asynchrony. \item We highlight the impact of update compression, data heterogeneity, and intra-iteration asynchrony in the convergence analysis, which also provides a theoretical motivation for our scheduling design. \end{itemize} \section{System Model} \label{sec:system_model} We consider an FL system with $N$ devices participating in training a shared global learning model, parameterized by a $d$-dimensional parameter vector $\boldsymbol{\theta}\in\mathbb{R}^d$. Denote $\mathcal{N}=\{1,...,N\}$ as the device set in the system. Each device $k\in\mathcal{N}$ holds a set of local training data $\mathcal{S}_k$ with size $|\mathcal{S}_k|$. Let $\mathcal{S}=\cup_{k\in\mathcal{N}}\mathcal{S}_k$ represent the entire data set in the system with size $|\mathcal{S}|$, where $\mathcal{S}_i\cap \mathcal{S}_j=\emptyset$, $\forall i\neq j$. The objective of the system is to find the optimal parameter vector $\boldsymbol{\theta}^*$ that minimizes an empirical loss function defined by \begin{equation} F(\boldsymbol{\theta})=\frac{1}{|\mathcal{S}|}\sum_{x\in\mathcal{S}}l(\boldsymbol{\theta},x), \label{eq:globalLoss} \end{equation} where $l(\boldsymbol{\theta},x)$ is a sample-wise loss function computed based on the data sample $x$. Similarly, a local loss function of device $k$ is defined as \begin{equation*} F_k(\boldsymbol{\theta})=\frac{1}{|\mathcal{S}_k|}\sum_{x\in\mathcal{S}_k}l(\boldsymbol{\theta},x). \end{equation*} Then, we can rewrite $\eqref{eq:globalLoss}$ as \begin{equation} F(\boldsymbol{\theta})=\sum_{k\in\mathcal{N}}\frac{|\mathcal{S}_k|}{|\mathcal{S}|}F_k(\boldsymbol{\theta}). \label{eq:globalLoss_f} \end{equation} To characterize the heterogeneity of data distribution in $\mathcal{N}$, we define a metric \cite{li2019convergence} \begin{equation} \Gamma=F^*-\sum_{k\in\mathcal{N}}\frac{|\mathcal{S}_k|}{|\mathcal{S}|}F_k^*, \label{def:Gamma} \end{equation} where $F^*=\underset{\boldsymbol{\theta}}{\mbox{min}}\,F(\boldsymbol{\theta})$ and $F_k^*=\underset{\boldsymbol{\theta}}{\mbox{min}}\,F_k(\boldsymbol{\theta})$ are the minimal global and local loss, respectively. With i.i.d. data distribution over devices, $\Gamma$ asymptotically approaches $0$ when $|\mathcal{S}|$ increases, while in non-i.i.d. scenario we expect $\Gamma\neq0$, which reflects the data heterogeneity level among devices. \subsection{FedAvg with Synchronous Training and Aggregation} \begin{figure}[t!] \centering \includegraphics[width=\columnwidth]{FL-information-exchange} \caption{The FL process and information exchange between the server and the participating devices.} \label{fig:FL} \end{figure} FedAvg is one representative FL algorithm with synchronous procedure of local training and global aggregation. The entire training process is divided into many global iterations (communication rounds), where during each iteration, the server aggregates the model updates from the participating devices computed over their locally available data. We consider a modified version of FedAvg, where an extra step of device scheduling is added after local training, as illustrated in Fig.~\ref{fig:FL}. The main motivation behind this is to reduce the communication costs and delay, especially in a wireless network with limited communication resources. In the $t$-th global iteration, $t=1,2,\ldots$, the following steps are executed: \begin{enumerate} \item The server broadcasts the current global model $\boldsymbol{\theta}(t)$ to the device set $\mathcal{N}$. \item Each device $k\in \mathcal{N}$ runs $E$ steps of stochastic gradient descent (SGD). The corresponding update rule follows \begin{equation*} \boldsymbol{\theta}_{k}(t,\tau+1)=\boldsymbol{\theta}_{k}(t,\tau)-\alpha(t,\tau)\nabla F_k(\boldsymbol{\theta}_{k}(t,\tau);\mathcal{B}_k(t,\tau)), \end{equation*} where $\tau=0,...,E-1$ indicates the local iteration index, $\boldsymbol{\theta}_{k}(t,0)=\boldsymbol{\theta}(t)$, $\alpha(t,\tau)$ represents the learning rate and $\nabla F_k(\boldsymbol{\theta}_{k}(t,\tau);\mathcal{B}_k(t,\tau))$ denotes the gradient computed based on a randomly selected mini-batch $\mathcal{B}_k(t,\tau)\subseteq\mathcal{S}_k$. After completing the local training, each device obtains the model update as the difference between the model parameter vector before and after training, i.e., \begin{equation} \boldsymbol{u}_k(t)=\boldsymbol{\theta}_{k}(t,E)-\boldsymbol{\theta}_{k}(t,0) \label{eq:local_update} \end{equation} \item After local training, a subset of devices $\Pi(t)\subseteq\mathcal{N}$ are scheduled for uploading their model updates to the server.\footnote{This uplink scheduling step is particularly important for FL over wireless networks as communication resources need to be shared among devices.} \item After receiving the local updates from the scheduled devices, the server aggregates the received information and updates the global model according to \begin{equation} \boldsymbol{\theta}(t+1)=\boldsymbol{\theta}(t)+\sum_{k\in\Pi(t)}\frac{|\mathcal{S}_k|}{\sum_{j\in\Pi(t)}|\mathcal{S}_j|}\boldsymbol{u}_k(t). \label{eq:syncFlAggregation} \end{equation} \end{enumerate} This iterative procedure continues until convergence. \label{sec:fedavg} \subsection{Asynchronous FL with Periodic Aggregation} To address the straggler issue in synchronous FL without generating excessive communication load, we propose an asynchronous FL framework with periodic aggregation. The general idea is to allow asynchronous training at different devices, with the server periodically collecting updates from those devices that have completed their computation, while the rest continue their local training without being interrupted or dropped. Fig.~$\ref{fig:FL-syn-asyn}$ shows an example of the training and updating timeline of the original synchronous FL, fully asynchronous FL \cite{xie2019asynchronous,chen2020asynchronous}, and our proposed scheme. \begin{figure} \centering \includegraphics[width=\columnwidth]{FL-SYN-ASYN} \caption{Conceptional difference between synchronous FL, fully asynchronous FL, and our proposed asynchronous FL with periodic aggregation. $\boldsymbol{\theta}(t)$ represents the model parameter vector in the $t$-th global iteration.} \label{fig:FL-syn-asyn} \vspace{-.2cm} \end{figure} Since different devices have different computing capabilities, whenever a device finishes its local training it sends a signal to the server indicating its readiness for update reporting. At every time duration $\tilde{T}$, the server schedules a subset of ready-to-update devices. We define $\mathcal{K}(t)$ as the set of ready-to-update devices in the $t$-th global iteration. Let $\Pi(t)\subseteq \mathcal{K}(t)$ be the set of scheduled devices, with $|\Pi(t)|=\min\{R,|\mathcal{K}(t)|\}$, where $R$ is the maximal number of devices that can be scheduled. We adopt a regularization term in the loss function to alleviate potential model imbalance caused by asynchronous training. The regularized local loss at device $k$ in the $t$-th global iteration and $\tau$-th local iteration is defined by \begin{equation*} H_k(t,\tau) = F_k\left(\boldsymbol{\theta}_{k}(t,\tau)\right)+\frac{\lambda}{2}\|\boldsymbol{\theta}_{k}(t,\tau)-\boldsymbol{\theta}_{k}(t,0)\|_2^2, \end{equation*} where $\lambda>0$ is the regularization coefficient. For any device $k\in \Pi(t)$, its local update is thus computed as \begin{equation} \boldsymbol{\theta}_{k}(t,\tau+1)=\boldsymbol{\theta}_{k}(t,\tau)-\alpha(t,\tau)\nabla H_k(t,\tau), \label{eq:localItUpdate_async} \end{equation} with $\tau=0,...,E-1$ and $\nabla H_k(t,\tau)$ evaluated on a randomly selected mini-batch $\mathcal{B}_k(t,\tau)\subseteq\mathcal{S}_k$. Due to the asynchronous setup, the initial model in the first local iteration is \begin{equation*} \boldsymbol{\theta}_{k}(t,0)=\boldsymbol{\theta}(s_k(t)), \end{equation*} where \begin{equation*} s_k(t)=\underset{t'<t}{\mbox{max}}\{t'|k\in \mathcal{K}(t')\}+1 \end{equation*} indicates the latest global iteration in which device $k$ received an updated global model. After receiving the updates from all devices in $\Pi(t)$, the server conducts model aggregation as \begin{equation*} \boldsymbol{\theta}(t+1)=\sum_{k\in\Pi(t)}w_k(t)\left[\boldsymbol{\theta}_k(t,0)+\boldsymbol{u}_{k}(t)\right], \end{equation*} where $\boldsymbol{u}_{k}(t)$ is defined in \eqref{eq:local_update}, and $w_k(t)$ denotes the weight coefficient, with $\sum_{k\in\Pi(t)}w_k(t)=1$. The updated model is then broadcast to all the devices in $\mathcal{K}(t)$ as the new global model to continue local training. Inspired by the concept of Age of Information (AoI) \cite{kosta2017age}, we define the Age of Local Update (ALU) as \begin{equation} a_k(t)=t-s_k(t), \label{eq:definition-alu} \end{equation} which represents the elapsed time since the last reception of an updated global model.\footnote{Note that this age-based definition is different from the Age of Update (AoU) proposed in \cite{yang2019agebased}, which measures the elapsed time at each device since its last participation in model aggregation.} The weight $w_k(t)$ can be related to the training data size $|\mathcal{S}_k|$, or the ALU $a_k(t)$, or combination of the both. Since the transmission of the model updates $\boldsymbol{u}_{k}(t), \forall k\in\Pi(t)$ is subject to communication resource constraints, a compressed version of $\boldsymbol{u}_{k}(t)$, denoted as $\hat{\boldsymbol{u}}_{k}(t)$, will be transmitted over the wireless channels. The compression scheme will be elaborated in the next sub-section. \label{sec:ayncFL} \subsection{Physical Layer (PHY) Model} In an FL process, the communication part takes place in two phases, the server broadcasting global model to the devices (downlink transmission) and the devices reporting model updates to the server (uplink transmission). In general, the server has much higher transmit power than the devices, and the downlink transmission does not require dividing communication resources due to the broadcast channel. Therefore, we assume no compression errors in the downlink. However, uplink transmission suffers from the communication bottleneck, which makes the scheduling and resource allocation design particularly important. We consider that at any global iteration $t$ the model updates from all devices are transmitted over a block fading channel with $n$-symbol coherence block. We assume orthogonal resource allocation among devices, i.e., $n_k(t)$ symbols are exclusively allocated to the device $k$ and $\sum_{k=1}^{|\Pi(t)|}n_k(t)=n$. Therefore, the transmissions from multiple devices are interference-free. Let $\beta_k$ and $h_k(t)$ denote the large-scale and small-scale fading of the channel from the $k$-th device to the server, respectively. Assuming that the $k$-th device has transmit power $P_{k}(t)\leq P_{k}^{\max}$ and the additive noise in the channel follows $CN(0,\sigma_w^2)$, the channel capacity of the $k$-th link is \begin{equation} C_k(t)=\log_2\left(1+\frac{P_{k}(t)\beta_k|h_k(t)|^2}{\sigma_w^2}\right). \label{eq:cpct} \end{equation} We consider that the devices apply appropriate data compression and channel coding scheme according to the channel capacity in \eqref{eq:cpct} such that the transmissions of the model updates are error-free. Consequently, the server can reliably receive up to $n_k(t)C_k(t)$ bits from device $k$. The symbol allocation, $n_k(t),\forall k$, and data compression scheme are specified below. \subsubsection{Communication resource allocation} To achieve the same level of compression loss in model updates from each device, we allocate the symbol resources in a way that \begin{equation} n_1(t)C_1(t)=...=n_{|\Pi(t)|}(t)C_{|\Pi(t)|}(t), \label{eq:nc} \end{equation} which implies that the devices with better channels are allocated with less symbols. Similar design is considered in \cite{amiriconvergence}. \subsubsection{Sparsification and Quantization} Each device needs to compress $\boldsymbol{u}_k(t)$ according to the budget $n_k(t)C_k(t)$ bits. We utilize random sparsification followed by low-precision random quantization for model compression. Specifically, we define a sparsified model update $\tilde{\boldsymbol{u}}_k(t)\in\mathbb{R}^d$, where the $i$-th component $\tilde{u}_{k,i}(t), \forall i=1,...,d$ is defined by \begin{equation*} \tilde{u}_{k,i}(t)=\begin{cases} u_{k,i}(t), & i\in\mathcal{V}_k(t)\\ 0, & \text{otherwise.} \end{cases} \end{equation*} Here, $u_{k,i}(t)$ is the $i$-th component of $\boldsymbol{u}_k(t)$, and $\mathcal{V}_k(t)$ denotes the set of reserved elements with $|\mathcal{V}_k(t)|=r_k(t)$. Then, each element $\tilde{u}_{k,i}(t), \forall i\in\mathcal{V}_k(t)$ is processed with $\nu$-level random quantizer $\mathcal{Q}_\nu:\mathbb{R}\rightarrow\mathbb{R}$ such that \cite{Alistarh2017QSGDCS} \begin{equation*} \mathcal{Q}_\nu(\tilde{u}_{k,i}(t))=||\tilde{\boldsymbol{u}}_k(t)||_2\cdot \text{sign}(\tilde{u}_{k,i}(t))\cdot\mathcal{Z}_{\nu}(\tilde{u}_{k,i}(t),||\tilde{\boldsymbol{u}}_k(t)||_2), \end{equation*} where \begin{equation*} \mathcal{Z}_{\nu}(u,||\boldsymbol{u}||_2)=\begin{cases} \frac{z+1}{\nu}, & \text{with probability $\frac{\nu|u|}{||\boldsymbol{u}||_2}-z$}\\ \frac{z}{\nu}, & \text{otherwise}\\ \end{cases} \end{equation*} is a random variable, $z=\lfloor\frac{\nu|u|}{||\boldsymbol{u}||_2}\rfloor$, and $\nu$ is the quantization level.\footnote{If $\boldsymbol{u}$ is a zero vector, all the quantized elements are zero.} The resulted compressed vector $\hat{\boldsymbol{u}}_k(t)$ has the components $\hat{u}_{k,i}(t)=\boldsymbol{1}\{i\in \mathcal{V}_k(t)\}\cdot \mathcal{Q}_\nu(\tilde{u}_{k,i}(t)), \forall i$. This random quantizer is unbiased, i.e., $\mathbb{E}[\hat{\boldsymbol{u}}_k(t)]=\tilde{\boldsymbol{u}}_k(t)$, and has quantitative bounded variance $\mathbb{E}[||\hat{\boldsymbol{u}}_k(t)-\tilde{\boldsymbol{u}}_k(t)||_2^2]\leq\frac{r_k(t)||\tilde{\boldsymbol{u}}_k(t)||_2^2}{4\nu^2}$. Under a fixed quantization level, we find the maximal $r_k(t)$ that satisfies the transmission constraint \begin{equation} \log_2{d\choose r_k(t)}+32+r_k(t)\left(\left\lceil \log_2(\nu+1)\right\rceil+1\right)\leq n_k(t)C_k(t). \label{eq:bitQuota} \end{equation} Here, the first term $\log_2{d\choose r_k(t)}$ bits are used for sending the indexes $\mathcal{V}_k(t)$, the second term $32$ bits are for the vector norm value, and the third term means that $\left\lceil \log_2(\nu+1)\right\rceil+1$ bits are needed for transmitting each non-zero element of $\hat{\boldsymbol{u}}_k(t)$. \subsection{Motivation of Scheduling and Aggregation Design} \label{subsec:prob_form} Under the proposed asynchronous FL setup, the key design questions are: \begin{enumerate} \item Given the communication resource constraints, how should we schedule a subset of $\mathcal{K}(t)$ for model aggregation under the scenario of heterogeneous training data distribution and wireless link quality? \item Different devices might have different ALUs, either more recent or more outdated. How to design an appropriate weighting policy taking into account the freshness of model updates? \end{enumerate} Recall that the goal is to minimize the global empirical loss $F(\boldsymbol{\theta})$ given in \eqref{eq:globalLoss_f}. We define the optimal model as $\boldsymbol{\theta}^*=\mbox{argmin}_{\boldsymbol{\theta}}\,F(\boldsymbol{\theta})$. Assuming $F(\boldsymbol{\theta})$ is strongly convex, implying $\nabla F\left(\boldsymbol{\theta}^*\right)=\boldsymbol{0}$, and $L$-smooth, i.e., for any $\boldsymbol{\theta}_1,\boldsymbol{\theta}_2\in\mathbb{R}^d$, \begin{equation} F(\boldsymbol{\theta}_1)-F(\boldsymbol{\theta}_2)\leq\nabla F(\boldsymbol{\theta}_2)^T(\boldsymbol{\theta}_1-\boldsymbol{\theta}_2)+\frac{L}{2}||\boldsymbol{\theta}_1-\boldsymbol{\theta}_2||_2^2, \label{asumpt:L-smooth} \end{equation} at the $(t+1)$-th iteration we have \begin{equation} \mathbb{E}\left[F\left(\boldsymbol{\theta}\left(t+1\right)\right)\right]-F^*\leq \frac{L}{2}\mathbb{E}\left[||\boldsymbol{\theta}\left(t+1\right)-\boldsymbol{\theta}^*||_2^2\right], \label{eq:opt_localSGD} \end{equation} where $\mathbb{E}\left[\cdot\right]$ denotes the expectation over all the randomness in the past iterations $1,...,t$. Note that \eqref{eq:opt_localSGD} quantifies the effectiveness of model training by examining the gap between $\mathbb{E}\left[F\left(\boldsymbol{\theta}\left(t+1\right)\right)\right]$ and $F^*$. A smaller upper bound would potentially narrow the gap. Particularly, $\mathbb{E}\left[||\boldsymbol{\theta}\left(t+1\right)-\boldsymbol{\theta}^*||_2^2\right]$ in \eqref{eq:opt_localSGD} can be interpreted as variance of the aggregated model produced from the model updates of the scheduled devices. We list some system factors that affect it as follows. \subsubsection{Training data distribution} If all the devices have i.i.d. training data, we expect that $\Gamma\rightarrow0$, as discussed in Sec. \ref{sec:system_model}. It directly follows that \begin{equation*} F^*\rightarrow\sum_{k\in\mathcal{N}}\frac{|\mathcal{S}_k|}{|\mathcal{S}|}F_k^*, \end{equation*} which implies a small $\mathbb{E}\left[||\boldsymbol{\theta}\left(t+1\right)-\boldsymbol{\theta}^*||_2^2\right]$ since $\boldsymbol{\theta}^*_k\simeq \boldsymbol{\theta}^*$, $\forall k\in\mathcal{N}$. However, with non-i.i.d. training data, $\boldsymbol{\theta}^*_k$ may vary a lot across different devices, which leads to a large variance of the aggregated model. \subsubsection{Data compression} As the model updates are transmitted through rate-limited wireless channels, the server only receives noisy information due to data compression. Larger compression loss will give a larger variance of the aggregated model. \subsubsection{Asynchronous model updates} As shown in Sec. $\ref{sec:ayncFL}$, the received updates $\boldsymbol{u}_{k}(t), \forall k$ might have different ALUs, which will be an extra source of variation in $||\boldsymbol{\theta}\left(t+1\right)-\boldsymbol{\theta}^*||_2^2$. From the perspective of device scheduling, we can achieve smaller $\mathbb{E}\left[||\boldsymbol{\theta}\left(t+1\right)-\boldsymbol{\theta}^*||_2^2\right]$ by considering the following aspects: \begin{itemize} \item The scheduled devices should construct a homogeneous representation of the entire training data set $\mathcal{S}$. \item Compression loss needs to be kept low, which motivates us to prioritize devices with better channel conditions. \end{itemize} From the perspective of model aggregation, we can alleviate the adverse impact of asynchronous updates by considering age-aware weighting design in the aggregation process. \section{Scheduling and Aggregation Design for Asynchronous FL} We propose a scheduling policy that aims at achieving a smaller optimality gap, by considering the training data distribution and the channel conditions of ready-to-update devices.\footnote{Our scheduling design is applicable to any distributed ML setting with heterogeneous and unbalanced data, not only in the considered asynchronous FL setting.} Then, the aggregation weights are adjusted accordingly to alleviate the harmful impact from asynchronous training. \subsection{Channel-aware Data-importance-based Scheduling} To illustrate the idea, we consider a classification problem with labeled data. The training data set is represented by $\mathcal{S}=\{(x,y)|y\in\mathcal{L}\}$, where $\mathcal{L}=\{y_1,...,y_\omega\}$ is a finite set that contains all labels and $|\mathcal{L}|=\omega$. For any device $k$, $\boldsymbol{b}_k=[b_k^{1},...,b_k^{\omega}]$ is defined as the label distribution in $\mathcal{S}_k$, where $b_k^{j}$ is the number of $y_j$-labeled samples and $\sum_{j=1}^{\omega}b_k^{j}=|\mathcal{S}_k|$. To construct a homogeneous data distribution, we may select $\Pi(t)$ to achieve the minimal label variance \begin{equation*} \Omega\left(\Pi(t)\right)=\sum_{j=1}^{\omega}\Big|\sum_{k\in\Pi(t)}b_k^{j}-\bar{b}\Big|^2, \end{equation*} where $\bar{b}=\frac{1}{\omega}\sum_{j=1}^{\omega}\sum_{k\in\Pi(t)}b_k^{j}$. Additionally, scheduling devices with better channel quality leads to smaller compression loss per device. Combine these two selection criteria, we first pick a subset $\Pi'(t)\subseteq\mathcal{K}(t)$ comprising of devices with $\mbox{min}(0.5N, |\mathcal{K}(t)|)$ highest channel capacity $C_k(t)$. Next, we find $\Pi(t) =\underset{\Pi\subseteq\Pi'(t)}{\mbox{argmin}} \,\Omega\left(\Pi\right)$. \subsection{Age-aware Model Aggregation} To tackle the asynchrony in model aggregation, we assign the weights not only based on the data proportion as in \eqref{eq:syncFlAggregation}, but also on its ALU. The age-aware weighting design follows \begin{equation} w_k(t)=\frac{|\mathcal{S}_k|{\gamma}^{a_k(t)}}{\sum_{i\in\Pi(t)}|\mathcal{S}_i|{\gamma}^{a_i(t)}}, \forall k\in\Pi(t). \label{eq:wk_t_age} \end{equation} Here, $\gamma$ is a real-valued constant, and the choice of its value can be divided into three cases: \begin{itemize} \item $\gamma>1$, of which the system favors older local updates. \item $\gamma<1$, of which the system favors fresher local updates. \item $\gamma=1$, which is equivalent to the baseline design in \eqref{eq:syncFlAggregation}. \end{itemize} Favoring older updates could potentially balance the participation frequency among the devices and reduce the risk of model training biased towards those with stronger computing capability. This design performs well when data distribution is highly non-i.i.d. and some devices with inferior computing capability possess unique training data. However, it also creates the problem of applying outdated updates on the already-evolved model. On the other hand, favoring fresher local updates would help the model to converge fast and smoothly with time, at the risk of converging to an imbalanced model biased towards devices with superior computing power. Since the proposed scheduling policy is conducted in a way that improves the homogeneity of data distribution, the advantage of ``favoring fresher models'' strategy becomes more convincing. To summarize, the channel-aware data-importance-based scheduling design with favoring-fresh aggregation policy would lead to fast and smooth convergence performance. To verify the effectiveness of our design, we provide convergence analysis in Sec. \ref{sec:conv_analysis} and simulation results in \ref{sec:simulation_results}, respectively. \section{Convergence Analysis} \label{sec:conv_analysis} We introduce some notations and definitions for the convergence analysis of the proposed system. \begin{definition}(\emph{Aggregation asynchrony}): \begin{itemize} \item Let $M(t)$ be the number of different versions of receive global model in the $t$-th model aggregation, i.e., the number of unique elements in the set $\{a_k(t)|k\in\Pi(t)\}$. \item Let $\mathcal{M}_i(t)\subseteq\Pi(t), i=1,...,M(t)$ be a device subset with the same ALU, i.e., $\forall k,j\in\mathcal{M}_i(t)$, $a_k(t)=a_j(t)$. \end{itemize} \end{definition} As in the proposed system, device scheduling is subject to the ready-to-update set $\mathcal{K}(t)$ instead of the full device set $\mathcal{N}$, we introduce the following metrics to quantify the data heterogeneity level for any device subset $\mathcal{M}$. \begin{definition}(\emph{Data heterogeneity level}): For a device subset $\mathcal{M}\subseteq\mathcal{N}$ and $\sum_{k\in\mathcal{M}}w_k=1$\footnote{Note that $\Gamma_1(\mathcal{N})=\Gamma$ if $w_k=\frac{|\mathcal{S}_k|}{|\mathcal{S}|}, \forall k\in\mathcal{N}$. Besides, devices in any $\mathcal{M}_i(t)$ have the same ALU, so $w_k(t)$ are simplified to the case with $\gamma=1$.}, we define \begin{equation*} \Gamma_1(\mathcal{M})=F^*-\sum_{k\in\mathcal{M}}w_kF_k^*, \end{equation*} \begin{equation*} \Gamma_2(\mathcal{M})=F\left(\boldsymbol{\theta}^*\right)-\sum_{k\in\mathcal{M}}w_kF_k\left(\boldsymbol{\theta}^*\right). \end{equation*} \end{definition} \subsection{Assumptions} To facilitate analysis, we make the following baseline assumptions. \begin{assumption} (Smoothness): The local loss function $F_k(\boldsymbol{\theta}),\forall k$ is $L$-smooth, as specified in \eqref{asumpt:L-smooth}, which is equivalent to Lipschitz continuous condition \cite{bottou2018ML}, i.e., $\forall \boldsymbol{\theta}_1,\boldsymbol{\theta}_2\in\mathbb{R}^d$, \begin{equation*} ||\nabla F_k\left(\boldsymbol{\theta}_1\right)-\nabla F_k\left(\boldsymbol{\theta}_2\right)||\leq{L}||\boldsymbol{\theta}_1-\boldsymbol{\theta}_2||_2; \end{equation*} \end{assumption} \begin{assumption} (Strong convexity): The local loss function $F_k(\boldsymbol{\theta}),\forall k$ is $\mu$-strongly-convex, i.e., $\forall \boldsymbol{\theta}_1, \boldsymbol{\theta}_2\in\mathbb{R}^d$, \begin{equation*} F_k\left(\boldsymbol{\theta}_1\right)-F_k\left(\boldsymbol{\theta}_2\right)\geq\nabla F_k\left(\boldsymbol{\theta}_2\right)^T\left(\boldsymbol{\theta}_1-\boldsymbol{\theta}_2\right)+\frac{\mu}{2}||\boldsymbol{\theta}_1-\boldsymbol{\theta}_2||_2^2; \end{equation*} \end{assumption} \noindent followed by assumptions for stochastic gradient evaluation, \begin{assumption} (Second moment constraint): $\forall \boldsymbol{\theta}\in\mathbb{R}^d$, the stochastic gradient $\nabla F_k(\boldsymbol{\theta};\mathcal{B}_k),\forall k$ satisfy \begin{equation} \mathbb{E}_{\mathcal{B}_k}\left[||\nabla F_k\left(\boldsymbol{\theta};\mathcal{B}_k\right)||_2^2\right]\leq C_1+C_2||\nabla F_k\left(\boldsymbol{\theta}\right)||_2^2, \label{eq:asmp3_2} \end{equation} for some positive constant $C_1$ and $C_2$. \end{assumption} \noindent Note that it appears to be common in the literature to assume uniformly bounded gradient, i.e., $C_2=0$ in \eqref{eq:asmp3_2}, and a strongly convex function over an unbounded space, e.g. \cite{chen2020asynchronous,wang2021resource,amiriconvergence,salehi2021federated,chen2020aJoint,chai2020fedat,li2019convergence,stich2018local}. These assumptions, however, are fundamentally incompatible as there exists no strongly convex function whose gradient is uniformly bounded over $\mathbb{R}^d$, which is also pointed out in \cite{Lam2019NewConv}. Working with a strongly convex function and uniformly bounded gradients requires a bounded parameter space, which yields a different (constrained) optimization problem, for which a solution algorithm would have to incorporate a projection step. We thus assume that the ``noise'' in the gradients is uniformly bounded (in expectation), also adopted in \cite{bottou2018ML}, which allows us to work with a strongly convex objective over an unbounded space. \begin{remark} \label{rmk:M} With $\tilde{T}$-periodic aggregation, the ALU of any device with training time bounded by $T_{max}$ satisfies $0\leq a_k(t)\leq\lceil T_{max}/\tilde{T}\rceil$. Then, from \textbf{Definition 1} we have \begin{equation} M(t)\leq\lceil\frac{T_{max}}{\tilde{T}}\rceil+1\triangleq M. \label{ieq:M_bound} \end{equation} \end{remark} \begin{remark} Let $\mathcal{M}$ be a subset of $\mathcal{N}$. Since $\mathcal{N}$ is a finite set, there exist non-negative $\zeta_1$ and $\zeta_2$ such that \begin{equation} |\Gamma_1(\mathcal{M})|\leq\zeta_1, \label{eq:noniid_b1} \end{equation} \begin{equation} |\Gamma_2(\mathcal{M})|\leq\zeta_2, \label{eq:noniid_b2} \end{equation} i.e., the metrics of heterogeneity level are uniformly bounded. \end{remark} Additionally, for the reserved number $r_k(t)$, we assume that there exists a minimum $r_{\min}>0$ such that \begin{equation} \mathbb{E}[r_k(t)]\geq r_{\min}, \label{ieq:rmin} \end{equation} where the expectation is with respect to the randomness in wireless channels. \subsection{Convergence Study} In the following theorem, we provide the main convergence result of our system model in a special case with one local iteration per communication round, i.e., $E=1$. \begin{theorem} Under Assumptions 1-3, equations \eqref{ieq:M_bound}-\eqref{ieq:rmin}, $E=1$, diminishing learning rate $\alpha(t,0)=\frac{\beta}{t+\kappa}$ with $\beta>\frac{d}{\mu r_{min}}>0$ and $\kappa=\mbox{max}\{\frac{dL^2C_2C_3\beta^2}{\beta\mu r_{min}-d},4L\beta-1,1\}>0$, and partial device participation such that $\Pi(\rho)=\cup_{j=1,...,M(\rho)}\mathcal{M}_j(\rho)\subseteq\mathcal{N}, \rho=1,...,t$, the proposed scheme satisfies \begin{align*} &\mathbb{E}\left[F\left(\boldsymbol{\theta}\left(t+1\right)\right)\right]-F^*\nonumber\\ &\leq\frac{LM}{2\left(t+\kappa+1\right)}\left[J(\beta,\kappa)+\left(\kappa+1\right)||\boldsymbol{\theta}\left(1\right)-\boldsymbol{\theta}^*||_2^2\right]+\frac{LM}{2}\beta A \end{align*} where $A=2\left(\zeta_1+\zeta_2\right)$, $C_3=4(1+\frac{d}{4\nu^2})$, and \begin{equation*} J(\beta,\kappa)=\frac{\beta^2C_3(\frac{C_1}{2}+\frac{AL^2C_2}{\mu})+L^2C_2C_3\beta^3A}{(\frac{\mu\beta r_{min}}{d}-1)-\frac{L^2C_2C_3\beta^2}{\kappa}}. \end{equation*} The expectation is taken over the randomness of stochastic gradient, channel gain and model compression, and device scheduling of all the past iterations. \end{theorem} \noindent\emph{Proof.} See Section \ref{proofThm1}. \hfill$\qed$ \begin{remark} The impact of multiple local iterations, i.e., $E>1$, on the convergence analysis has been already established and exploited in existing literature on FL (see, e.g., \cite{stich2018local}). The focus of our analysis is the impact of update compression, training data heterogeneity, and intra-iteration asynchrony on the convergence result. Extending the analysis to the case with $E>1$ is possible by additionally quantifying local model divergence from \eqref{eq:localItUpdate_async} in the optimality gap.\footnote{An extra term $||\boldsymbol{\theta}_k(t,\tau)-\boldsymbol{\theta}_k(t,0)||_2^2$ will be introduced and can be bounded by its gradient $||\nabla F_k(\boldsymbol{\theta}_k(t,\tau))||_2^2$ through \eqref{eq:asmp3_2}. Then, by redesigning the learning rate, the convergence can be proved (see, e.g., how $||\nabla F_k(\boldsymbol{\theta}_k(t,\tau))||_2^2$ is bounded in Sec. \ref{sec:pf_lemma1}, or \cite{bottou2018ML}).} For analytical clarity and simplicity, we consider the case with $E=1$. \end{remark} \begin{remark} \label{rmk:conv_asymp} Based on \textbf{Theorem 1}, the optimality gap asymptotically converges to a constant, i.e., \begin{equation*} \mathbb{E}\left[F\left(\boldsymbol{\theta}\left(t+1\right)\right)\right]-F^*\rightarrow\frac{LM}{2}\beta A \end{equation*} when $t\rightarrow\infty$, where $M$, $A$, and $\beta$ are defined in \eqref{ieq:M_bound} and in the theorem. This constant can be seen as an optimality gap, which increases with $A$, $M$ and $\beta$. In an i.i.d. data scenario where $\zeta_1=\zeta_2=0$ and thus $A=0$, the system converges to the optimum even with intra-iteration asynchrony, i.e., $M>1$, and update compression, i.e., $\beta>\frac{1}{\mu}$. However, in a non-i.i.d. scenario where $A>0$, a higher level of data heterogeneity leads to a larger optimality gap. The presence of $M$ implies that intra-iteration asynchrony makes the optimality gap larger. Moreover, the presence of $\beta$ reflects that scheduling devices with better channel quality improves the performance, since a larger $r_{min}$ allows a lower $\beta$, given $\beta>\frac{d}{\mu r_{min}}$ specified in the theorem and $r_{min}$ defined in \eqref{ieq:rmin}. \end{remark} \begin{remark} \label{rmk:conv_perIter} Apart from the asymptotic behavior, compression level of model updates also affects the per-iteration performance. With better link quality, the sparsification can be less aggressive, and/or with a higher quantization level $\nu$. As the result, the term $J(\beta,\kappa)$ can be smaller and thus the optimality gap in each iteration decreases. Moreover, as $J(\beta,\kappa)$ grows with $A$, lower data heterogeneity also improves the per-iteration performance. \end{remark} These two remarks confirm the importance of considering both training data distribution and channel quality in our device scheduling design. \section{Simulation Results} \label{sec:simulation_results} We perform simulations using the MNIST \cite{lecun-mnisthandwrittendigit-2010} data set for solving the hand-written digit classification problem by adopting a convolutional neural network with model dimension $d=21840$. The block fading channel spans $n$ symbols for uplink transmissions. We consider Rayleigh fading $h_k(t)\sim \mathcal{CN}(0,1)$ and uplink power control such that the received signal-to-noise ratio is $13$dB. The system parameters are specified as follows. \begin{itemize} \item (Training data distribution) $|\mathcal{S}|=60000$ samples are distributed evenly to all the devices. Both i.i.d. and non-i.i.d. data distribution scenarios are considered. For the i.i.d. case, $|\mathcal{S}|/N$ samples are randomly allocated to each device without replacement. For the non-i.i.d. case, the data allocation follows the setup in \cite{mcmahan2017communication}, where each device contains up to $\mbox{min}(\lfloor200/N\rfloor,10)$ different digits. \item (Heterogeneous computing capability) We use $T_k$ as the local training duration of device $k$, generated from uniform distribution $T_k\sim\mathcal{U}(T_{\min},T_{\max})$, where $T_{\min}$ is the least possible device training time. \item (Compression) $4$-level random quantizer, $\mathcal{Q}_4$, is adopted. \item (Diminishing learning rate) $\alpha(1,0)=0.01$ is initially adopted, together with regularization coefficient $\lambda=0.02$. \end{itemize} Since the communication resources are shared by maximally $R$ devices, more scheduled devices means less communication resources per device, leading to a higher compression loss. The test accuracy results with various choices of $R$ are shown in Fig.~\ref{fig:diffR}. As we can see, in the i.i.d. scenario, a smaller $R$ is preferable since it gives received model updates with better precision as the result of more allocated bits per user. On the other hand, in the non-i.i.d. scenario, there exists a trade-off between compression loss and model bias, which makes the choice of $R$ important. In this work, we focus on the impact of the scheduling design for a fixed $R$. The optimal value of $R$ depends on many system parameters; its optimization could be studied in future work. \begin{figure}[t!] \centering \includegraphics[width=.8\columnwidth]{J_DiffR-eps-converted-to} \caption{Test accuracy of the proposed scheme under different partial scheduling ratio, where $N=40$ and $n=50000$.} \label{fig:diffR} \hfill \end{figure} Finding the optimal value of $\tilde{T}$ analytically is highly non-trivial as we are short of a tractable expression that characterizes the relation between the optimality gap and the value of $\tilde{T}$. For the numerical results reported herein, we choose $\tilde{T}=T_\text{max}/4$ as this gives the best results in the simulations (see below for the comparisons between different $\tilde{T}$). \subsection{Comparison of FL frameworks} First, in Fig. \ref{fig:diffT}, we present the performance of our proposed design (with random scheduling and baseline aggregation, i.e., $\gamma=1$ in \eqref{eq:wk_t_age}) obtained with different values of $T_\text{max}/\tilde{T}$, to demonstrate the effect of the aggregation time period on the convergence performance. The performance of synchronous FedAvg is also presented for comparison. Then, in Fig. \ref{fig:diffFed}, we show the performance comparison between FedAvg, our proposed asynchronous FL, and FedAsync \cite{xie2019asynchronous}. Note that to make a fair comparison between different schemes, we fix the average amount of communication resources allocated over a certain time period $T'$. For example, if we assume there are $n$ symbols per communication round when $\tilde{T}=T_{\max}/4$ is adopted, then $4n$ symbols per round will be available for FedAvg. If FedAsync executes $N_{\text{FA}}$ iterations over time duration $T'$, the available number of symbols per round would be $4nT'/(T_{\max}N_{\text{FA}})$. As shown in Fig. \ref{fig:diffT}, $\tilde{T}=T_{\max}/4$ gives the best performance. However, this conclusion cannot be generalized since the result depends on many other system parameters. The comparison between our proposed design, FedAvg, and FedAsync\footnote{An $\alpha$-filtering mechanism is applied on device updates, specifically, $\boldsymbol{\theta}(t+1)=(1-\alpha)\boldsymbol{\theta}(t)+\alpha\boldsymbol{u}_k(t)$.} (with $\alpha=0.4$ and $\alpha=0.8$) is shown in Fig. \ref{fig:diffFed}. We observe that although FedAsync can help reduce the straggler effect, the test accuracy result shows strong fluctuation, especially with non-i.i.d. training data. For both i.i.d. and non-i.i.d. scenarios, our proposed asynchronous FL design outperforms FedAsync and FedAvg, which shows its effectiveness in eliminating the straggler effect and achieving better convergence performance. \begin{figure}[t!] \centering \begin{subfigure}[b]{0.49\columnwidth} \centering \includegraphics[width=\columnwidth]{J_DiffT_iid-eps-converted-to} \caption{i.i.d. data} \label{fig:diffT_iid} \end{subfigure} \begin{subfigure}[b]{0.49\columnwidth} \centering \includegraphics[width=\columnwidth]{J_DiffT_niid-eps-converted-to} \caption{non-i.i.d. data} \label{fig:diffT_niid} \end{subfigure} \caption{Impact of $\tilde{T}$ on test accuracy of the proposed asynchronous FL with periodic aggregation in i.i.d. and non-i.i.d. scenarios, where $N=40$, $R=0.2N$ and $n=300000$.} \label{fig:diffT} \hfill \end{figure} \begin{figure}[t!] \centering \begin{subfigure}[b]{0.49\columnwidth} \centering \includegraphics[width=\columnwidth]{J_DiffFed_iid-eps-converted-to} \caption{i.i.d. data} \label{fig:diffFed_iid} \end{subfigure} \begin{subfigure}[b]{0.49\columnwidth} \centering \includegraphics[width=\columnwidth]{J_DiffFed_niid-eps-converted-to} \caption{non-i.i.d. data} \label{fig:diffFed_niid} \end{subfigure} \caption{Test accuracy of FedAvg, the proposed asynchronous FL with periodic aggregation, and FedAsync \cite{xie2019asynchronous} in i.i.d. and non-i.i.d. scenarios, where $N=40$, $R=0.2N$ and $n=300000$.} \label{fig:diffFed} \hfill \end{figure} \subsection{Validation of convergence analysis} We provide training loss comparison in Figure \ref{fig:trainLoss} to validate the conclusions drawn in Remarks \ref{rmk:conv_asymp} and \ref{rmk:conv_perIter}. We observe the following: \begin{itemize} \item With the random and proposed scheduling methods, the training loss is lower in the i.i.d. scenario than in the non-i.i.d. scenario, which shows that a smaller $A$ leads to a lower training loss. \item For both the i.i.d. and non-i.i.d. scenarios, our proposed scheduling design outperforms random scheduling, which validates the advantage of selecting devices with better link qualities and, collectively, a more homogeneous data representation. \item To show the impact of intra-iteration asynchrony, we present the result for synchronous updates with random scheduling for i.i.d. data (the green curve). As compared to the asynchronous case (blue curve), the synchronous case has lower training loss, which shows that intra-iteration asynchrony is harmful for the convergence performance. \end{itemize} \begin{figure}[t!] \centering \includegraphics[width=.8\columnwidth]{trainingLoss-eps-converted-to} \caption{Training loss for random and the proposed scheduling methods in i.i.d. and non-i.i.d. scenarios, where $N=40$, $R=0.2N$ and $n=300000$.} \label{fig:trainLoss} \hfill \end{figure} Moreover, as shown in Fig. \ref{fig:diffT_niid} with non-i.i.d. data, we see that with smaller $\tilde{T}$, which implies larger $M(t)$ and a higher feasible $\beta$, the curves for the test accuracy result are less smooth than the ones with larger $\tilde{T}$. This validates the insights in Remark \ref{rmk:conv_asymp} that in non-i.i.d. data scenarios, a higher degree of intra-iteration asynchrony and update compression leads to further degradation of the learning performance. \subsection{Comparison of scheduling policies} First, the aggregation weights are set with $\gamma=1$ in \eqref{eq:wk_t_age}. In Fig. \ref{fig:diffSch}, we show the test accuracy of the proposed scheduling design with some alternative reference methods. \begin{itemize} \item rdm: we select up to $R$ devices uniformly at random. \item BC \cite{amiriconvergence}: We select up to $R$ devices with highest $C_k(t)$. \item BCBN2 \cite{amiriconvergence}\footnote{For a fair comparison, symbol resource allocation follows \eqref{eq:nc}, differing from the design in \cite{amiriconvergence}.}: We first find a device subset $\mathcal{C}\subseteq\mathcal{K}(t)$ with $|\mathcal{C}|$ up to $0.5N$ that has highest $C_k(t)$. Then, among $\mathcal{C}$ we schedule devices with up to $R$ highest $||\boldsymbol{u}_k(t)||_2^2$. \item Age-based \cite{yang2019agebased}\footnote{This is a tweaked version of the method in \cite{yang2019agebased}, which likewise finds devices with better channel quality and minimizes the overall device staleness.}: We first find $\mathcal{C}$ using the same way as in BCBN2, then among $\mathcal{C}$ we schedule up to $R$ devices with highest staleness metric \begin{equation*} c_k(t)= \begin{cases} 0, & t=0 \\ \sum_{t'=0}^{t-1}\boldsymbol{1}(k\notin\Pi(t')), & \text{otherwise} \end{cases} \end{equation*} \end{itemize} \begin{figure}[t!] \centering \begin{subfigure}[b]{0.9\columnwidth} \centering \includegraphics[width=\columnwidth]{J_DiffSch_iid-eps-converted-to} \caption{i.i.d. data} \label{fig:diffSch_iid} \end{subfigure} \begin{subfigure}[b]{0.9\columnwidth} \centering \includegraphics[width=\columnwidth]{J_DiffSch_niid-eps-converted-to} \caption{non-i.i.d. data} \label{fig:diffSch_niid} \end{subfigure} \caption{Test accuracy of different scheduling policies, where $N=40$, $R=0.2N$ and $n=300000$.} \label{fig:diffSch} \hfill \end{figure} We see that the proposed scheduling policy outperforms the baseline random scheduling and the reference methods in both i.i.d. and non-i.i.d. scenarios. Besides, in non-i.i.d. scenario, we observe that the data-awareness in the proposed method further achieves a higher test accuracy than the pure channel-aware methods BC and BCBN2 \cite{amiriconvergence}. \subsection{Comparison of aggregation policies} In Fig.~\ref{fig:diffAggr}, we show the performance of different aggregation policies under the proposed channel-aware data-importance-based scheduling and random scheduling methods. We see that the age-aware design outperforms the baseline with $\gamma=1$ in both i.i.d. and non-i.i.d. scenarios. For i.i.d. case, the favoring-fresh weighting strategy has an outstanding performance gain. For non-i.i.d. case, performance gain of the proposed aggregation design is more obvious when random scheduling is adopted. \begin{figure}[ht!] \centering \begin{subfigure}[b]{0.9\columnwidth} \centering \includegraphics[width=\columnwidth]{J_DiffAggr_iid-eps-converted-to} \caption{i.i.d. data} \label{fig:diffAggr_iid} \end{subfigure} \begin{subfigure}[b]{0.9\columnwidth} \centering \includegraphics[width=\columnwidth]{J_DiffAggr_niid-eps-converted-to} \caption{non-i.i.d. data} \label{fig:diffAggr_niid} \end{subfigure} \caption{Test accuracy of proposed aggregation policies, where $N=100$, $R=0.3N$ and $n=380000$.} \label{fig:diffAggr} \hfill \end{figure} \section{Conclusions} In this work, we proposed an asynchronous FL framework with periodic aggregation that combines the advantages of asynchronous training and synchronous model aggregation. For the proposed design, we further developed a channel-aware data-importance-based scheduling policy and age-based aggregation design for FL under wireless resource constraints. Our proposed scheduling and aggregation design was shown to outperform existing methods, especially with heterogeneous training data among different devices. The main takeaway message is that the design principle of scheduling and resource allocation in wireless FL should be based on reducing the bias and variance of aggregated local updates. For asynchronous FL settings, balancing the freshness and usefulness of local model updates and adjusting their contributions in the new global model is also an important design aspect. \section{Acknowledgement} We thank Fredrik Jansson for his contribution to the idea of scheduling policy during his Master thesis project at the Division of Communication Systems, Linköping University. \section{Appendix} \subsection{Proof of \textbf{Theorem 1}} \label{proofThm1} We conduct the proof with a similar approach as in \cite{li2019convergence} and \cite{stich2018local} except for some additional manipulations to handle the effect of asynchronous training. As briefly demonstrated in Section \ref{subsec:prob_form}, we begin the optimality gap analysis from \eqref{eq:opt_localSGD}. We define \begin{equation*} c_m(t)=\sum_{k\in\mathcal{M}_m\left(t\right)}w_k\left(t\right) \end{equation*} as the weighting sum in $\mathcal{M}_m$ in $t$-th global iteration and \begin{equation*} \bar{\boldsymbol{\theta}}^{\left(m\right)}\left(t+1\right)=\sum_{k\in\mathcal{M}_m\left(t\right)}\frac{w_k\left(t\right)}{c_m(t)}\boldsymbol{\theta}_k\left(t,1\right), \end{equation*} and then \eqref{eq:opt_localSGD} can be rearranged as \begin{align} &\mathbb{E}\left[F\left(\boldsymbol{\theta}\left(t+1\right)\right)\right]-F^*\leq\frac{L}{2}\mathbb{E}\left[||\sum_{m=1}^{M\left(t\right)}c_m\left(t\right)\bar{\boldsymbol{\theta}}^{\left(m\right)}\left(t+1\right)-\boldsymbol{\theta}^*||_2^2\right]\nonumber\\ &\leq\frac{L}{2}\mathbb{E}\left[M\left(t\right)\sum_{m=1}^{M\left(t\right)}c_m^2\left(t\right)||\bar{\boldsymbol{\theta}}^{\left(m\right)}\left(t+1\right)-\boldsymbol{\theta}^*||_2^2\right]. \label{ieq:optimalityGap1} \end{align} To facilitate analysis, we first evaluate $||\bar{\boldsymbol{\theta}}^{\left(m\right)}\left(t+1\right)-\boldsymbol{\theta}^*||_2^2$ for any ($m$,$t$) and simplify the notation of existing variables. \begin{itemize} \item $\mathcal{M}_m(t)$, $\bar{\boldsymbol{\theta}}^{\left(m\right)}\left(t+1\right)$, $\bar{\boldsymbol{\theta}}^{\left(m\right)}\left(t\right)$, $w_k(t)$, $r_k(t)$, and $c_m(t)$ are simplified as $\mathcal{M}$, $\bar{\boldsymbol{\theta}}\left(t+1\right)$, $\bar{\boldsymbol{\theta}}\left(t\right)$, $w_k$, $r_k$, and $c$. \item Since $E=1$, for $\alpha(t,0)$ and $\mathcal{B}_k(t,0)$ we omit index $\tau=0$ for simplicity and rewrite them as $\alpha(t)$ and $\mathcal{B}_k(t)$, respectively. Moreover, $H_k\left(t,0\right)=F_k\left(\boldsymbol{\theta}_{k}(t,0)\right)$ and \begin{equation*} \nabla H_k\left(t,0\right)=\nabla F_k\left(\boldsymbol{\theta}_{k}(t,0);\mathcal{B}_k(t)\right). \end{equation*} \item Resource allocation in \eqref{eq:nc} and transmission constraint in \eqref{eq:bitQuota} lead to equivalent $r_k, \forall k$. Hence, $r_k=r, \forall k$. \end{itemize} In addition, we introduce some variables and lemmas, \begin{equation} \boldsymbol{g}\left(t\right)=\sum_{k\in\mathcal{M}}\frac{w_k}{c}\mathcal{Q}_\nu\left(\nabla \tilde{F}_k\left(\boldsymbol{\theta}_k(t,0);\mathcal{B}_k(t)\right)\right), \label{def:g} \end{equation} where $-\alpha(t)\nabla \tilde{F}_k\left(\boldsymbol{\theta}_k(t,0);\mathcal{B}_k(t)\right)=\tilde{\boldsymbol{u}}_k(t)$, and \begin{equation} \bar{\boldsymbol{g}}\left(t\right)=\mathbb{E}_{\mathcal{B}_k(t)}\mathbb{E}_{\mathcal{Q}_\nu}\mathbb{E}_{\mathcal{V}_k(t)}\left[\boldsymbol{g}\left(t\right)\right]=\frac{r}{d}\sum_{k\in\mathcal{M}}\frac{w_k}{c}\nabla F_k\left(\boldsymbol{\theta}_k(t,0)\right). \label{def:g_bar} \end{equation} \begin{lemma} Let $\alpha(t)\leq\frac{1}{4L}$ and $A$ defined in \textbf{Theorem 1}, then \begin{equation*} ||\bar{\boldsymbol{\theta}}\left(t\right)-\boldsymbol{\theta}^*-\alpha(t)\bar{\boldsymbol{g}}\left(t\right)||_2^2\leq\left(1-\frac{\mu\alpha(t)r}{d}\right)||\bar{\boldsymbol{\theta}}\left(t\right)-\boldsymbol{\theta}^*||_2^2+\frac{\alpha(t)rA}{d}. \end{equation*} \label{lm:rearrange} \end{lemma} \begin{lemma} \label{lm:var_g} Let $C_3$ and $A$ defined in \textbf{Theorem 1}, then the variance of $\boldsymbol{g}\left(t\right)$ fulfills \begin{equation*} \mathbb{E}\left[||\boldsymbol{g}\left(t\right)-\bar{\boldsymbol{g}}\left(t\right)||_2^2\right]\leq C_3\mathbb{E}\left[L^2C_2||\bar{\boldsymbol{\theta}}(t)-\boldsymbol{\theta}^*||^2_2+\frac{C_1}{2}+\frac{AL^2C_2}{\mu}\right] \end{equation*} \end{lemma} \noindent\emph{Proof.} See Sections \ref{sec:pf_lemma1}, \ref{sec:pf_lemma2}.\\ Based on \eqref{def:g}-\eqref{def:g_bar}, $||\bar{\boldsymbol{\theta}}\left(t+1\right)-\boldsymbol{\theta}^*||_2^2$ can be rewritten as \begin{align} &||\bar{\boldsymbol{\theta}}\left(t+1\right)-\boldsymbol{\theta}^*||_2^2=||\sum_{k\in\mathcal{M}}\frac{w_k}{c}\boldsymbol{\theta}_k\left(t,0\right)-\alpha(t)\boldsymbol{g}\left(t\right)-\boldsymbol{\theta}^*||_2^2\nonumber\\ &=||\bar{\boldsymbol{\theta}}\left(t\right)-\alpha(t)\boldsymbol{g}\left(t\right)-\boldsymbol{\theta}^*-\alpha(t)\bar{\boldsymbol{g}}\left(t\right)+\alpha(t)\bar{\boldsymbol{g}}\left(t\right)||_2^2\label{eq:weighted_tk}\\ &=||\bar{\boldsymbol{\theta}}\left(t\right)-\boldsymbol{\theta}^*-\alpha(t)\bar{\boldsymbol{g}}\left(t\right)||_2^2+\alpha(t)^2||\boldsymbol{g}\left(t\right)-\bar{\boldsymbol{g}}\left(t\right)||_2^2\nonumber\\ &\quad-2\alpha(t)\left[\left(\bar{\boldsymbol{\theta}}\left(t\right)-\boldsymbol{\theta}^*-\alpha(t)\bar{\boldsymbol{g}}\left(t\right)\right)^T\left(\boldsymbol{g}\left(t\right)-\bar{\boldsymbol{g}}\left(t\right)\right)\right], \label{eq:theta_diff} \end{align} where \eqref{eq:weighted_tk} is due to $\boldsymbol{\theta}_k\left(t,0\right)=\boldsymbol{\theta}\left(t\right), \forall k$. With \textbf{Lemma \ref{lm:rearrange}} and \eqref{ieq:rmin}, the total expectation of \eqref{eq:theta_diff} fulfills \begin{align} &\mathbb{E}\left[||\bar{\boldsymbol{\theta}}\left(t+1\right)-\boldsymbol{\theta}^*||_2^2\right]\leq\left(1-\frac{\mu\alpha(t)r_{min}}{d}\right)\mathbb{E}\left[||\bar{\boldsymbol{\theta}}\left(t\right)-\boldsymbol{\theta}^*||_2^2\right]\nonumber\\ &\quad+\alpha(t)A+\alpha^2(t)\mathbb{E}\left[||\boldsymbol{g}\left(t\right)-\bar{\boldsymbol{g}}\left(t\right)||_2^2\right]\nonumber\\ &\quad-2\alpha(t)\mathbb{E}\left[\left(\bar{\boldsymbol{\theta}}\left(t\right)-\boldsymbol{\theta}^*-\alpha(t)\bar{\boldsymbol{g}}\left(t\right)\right)^T\left(\boldsymbol{g}\left(t\right)-\bar{\boldsymbol{g}}\left(t\right)\right)\right]. \label{eq:theta_diff_2} \end{align} By definition of $\boldsymbol{g}\left(t\right)$ and $\bar{\boldsymbol{g}}(t)$, $\mathbb{E}\left[\boldsymbol{g}\left(t\right)-\bar{\boldsymbol{g}}(t)\right]=0$. Together with \textbf{Lemma \ref{lm:var_g}}, \eqref{eq:theta_diff_2} can be rearranged as \begin{align*} &\mathbb{E}\left[||\bar{\boldsymbol{\theta}}\left(t+1\right)-\boldsymbol{\theta}^*||_2^2\right]\leq\left(1-\frac{\mu\alpha(t)r_{min}}{d}\right)\mathbb{E}\left[||\bar{\boldsymbol{\theta}}\left(t\right)-\boldsymbol{\theta}^*||_2^2\right]\nonumber\\ &+\alpha(t)A+C_3\alpha^2(t)\left[L^2C_2\mathbb{E}\left[||\bar{\boldsymbol{\theta}}(t)-\boldsymbol{\theta}^*||^2_2\right]+\frac{C_1}{2}+\frac{AL^2C_2}{\mu}\right]. \end{align*} With diminishing learning rate $\alpha(t)=\frac{\beta}{t+\kappa}$, of which $\alpha(1)=\beta/(1+\kappa)\leq 1/(4L)$ satisfying the sufficient condition in \textbf{Lemma \ref{lm:rearrange}}, we claim that \begin{equation} \mathbb{E}\left[||\bar{\boldsymbol{\theta}}\left(t\right)-\boldsymbol{\theta}^*||_2^2\right]\leq\frac{v}{\kappa+t}+\beta A, \label{eq:localSGD_final_async} \end{equation} where $v=\max\left[(\kappa+1)||\boldsymbol{\theta}\left(1\right)-\boldsymbol{\theta}^*||_2^2,C_4\right]$ and \begin{equation*} C_4=\frac{\beta^2C_3(\frac{C_1}{2}+\frac{AL^2C_2}{\mu})+L^2C_2C_3\beta^3A}{(\frac{\mu\beta r_{min}}{d}-1)-\frac{L^2C_2C_3\beta^2}{\kappa}}. \end{equation*} We prove \eqref{eq:localSGD_final_async} by induction. For $t=1$, \begin{equation*} ||\bar{\boldsymbol{\theta}}\left(1\right)-\boldsymbol{\theta}^*||_2^2=\frac{\left(\kappa+1\right)||\bar{\boldsymbol{\theta}}\left(1\right)-\boldsymbol{\theta}^*||_2^2}{\kappa+1}\leq\frac{v}{\kappa+1}+\beta A, \end{equation*} where $\bar{\boldsymbol{\theta}}\left(1\right)=\boldsymbol{\theta}\left(1\right)$ is the initial global model. We assume \eqref{eq:localSGD_final_async} holds and proceed with the case of $t+1$, \begin{align} &\mathbb{E}\left[||\bar{\boldsymbol{\theta}}\left(t+1\right)-\boldsymbol{\theta}^*||_2^2\right]\leq\left(1-\frac{\mu\beta r_{min}}{\left(t+\kappa\right)d}\right)\left(\frac{v}{t+\kappa}+\beta A\right)\nonumber\\ &+\frac{\beta A}{t+\kappa}+\frac{C_3\beta^2}{\left(t+\kappa\right)^2}\left[L^2C_2\left(\frac{v}{t+\kappa}+\beta A\right)+\frac{C_1}{2}+\frac{AL^2C_2}{\mu}\right]\nonumber\\ &=\frac{t+\kappa-1}{\left(t+\kappa\right)^2}v+\bigg[\frac{[(t+\kappa)(1-\frac{\mu\beta r_{min}}{d})+L^2C_2C_3\beta^2]v}{(t+\kappa)^3}\nonumber\\ &\quad+\frac{(t+\kappa)\left[\beta^2C_3\left(\frac{C_1}{2}+\frac{AL^2C_2}{\mu}\right)+L^2C_2C_3\beta^3A\right]}{(t+\kappa)^3}\bigg]\nonumber\\ &\quad+\frac{\beta A}{t+\kappa}+\left(1-\frac{\mu\beta r_{min}}{\left(t+\kappa\right)d}\right)\beta A \label{eq:localSGD_final_1_async}\\ &\leq\frac{t+\kappa-1}{\left(t+\kappa\right)^2}v+\beta A\left[\frac{1}{t+\kappa}+1-\frac{\mu\beta r_{min}}{\left(t+\kappa\right)d}\right]\label{eq:localSGD_final_2_async}\\ &\leq\frac{t+\kappa-1}{\left(t+\kappa\right)^2-1}v+\beta A=\frac{v}{t+\kappa+1}+\beta A,\nonumbe \end{align} where \eqref{eq:localSGD_final_2_async} is due to the second term in \eqref{eq:localSGD_final_1_async} being negative. Hence, \eqref{eq:localSGD_final_async} holds for all $t$. Recovering the indices $m$ and $t$ and plugging the result into \eqref{ieq:optimalityGap1}, \begin{align*} &\mathbb{E}\left[F\left(\boldsymbol{\theta}\left(t+1\right)\right)\right]-F^*\nonumber\\ &\leq\frac{L}{2}\mathbb{E}_{\mathcal{X}}\left[ M\left(t\right)\sum_{m=1}^{M\left(t\right)}c_m^2\left(t\right)\left(\frac{v}{t+\kappa+1}+\beta A\right)\right]\nonumber\\ &\leq\mathbb{E}_{\mathcal{X}}\left[M\left(t\right)\right]\frac{L}{2}\left(\frac{v}{t+\kappa+1}+\beta A\right)\nonumber\\ &\leq\frac{LM}{2}\beta A+\frac{LM}{2\left(t+\kappa+1\right)}\Big[\left(\kappa+1\right)||\boldsymbol{\theta}\left(1\right)-\boldsymbol{\theta}^*||_2^2\nonumber\\ &\quad+\frac{\beta^2C_3(\frac{C_1}{2}+\frac{AL^2C_2}{\mu})+L^2C_2C_3\beta^3A}{(\frac{\mu\beta r_{min}}{d}-1)-\frac{L^2C_2C_3\beta^2}{\kappa}}\Big], \end{align*} where $\mathbb{E}_{\mathcal{X}}[\cdot]$ is the expectation over all the past scheduling decision, i.e., $\mathcal{X}=\{\mathcal{M}_m(t)|m=1,...,M(t),\forall t\}$, and $\mathbb{E}_{\mathcal{X}}\left[M\left(t\right)\right]\leq M$ because of \eqref{ieq:M_bound}. \subsection{Proof of \textbf{Lemma 1}} \label{sec:pf_lemma1} \vspace{-.4cm} \begin{align} &||\bar{\boldsymbol{\theta}}\left(t\right)-\boldsymbol{\theta}^*-\alpha(t)\bar{\boldsymbol{g}}\left(t\right)||_2^2=||\bar{\boldsymbol{\theta}}\left(t\right)-\boldsymbol{\theta}^*||_2^2+\alpha^2(t)||\bar{\boldsymbol{g}}\left(t\right)||_2^2\nonumber\\ &\quad-\frac{2\alpha(t)r}{cd}\sum_{k\in\mathcal{M}}w_k\left(\bar{\boldsymbol{\theta}}\left(t\right)-\boldsymbol{\theta}^*\right)^T\nabla F_k\left(\boldsymbol{\theta}_k\left(t,0\right)\right)\nonumber\\ &\leq||\bar{\boldsymbol{\theta}}\left(t\right)-\boldsymbol{\theta}^*||_2^2+\frac{r^2\alpha^2(t)}{cd^2}\sum_{k\in\mathcal{M}}w_k||\nabla F_k\left(\boldsymbol{\theta}_k\left(t\right)\right)||_2^2\nonumber\\ &\quad-\frac{2\alpha(t)r}{cd}\sum_{k\in\mathcal{M}}w_k\left(\bar{\boldsymbol{\theta}}\left(t\right)-\boldsymbol{\theta}_k\left(t,0\right)\right)^T\nabla F_k\left(\boldsymbol{\theta}_k\left(t,0\right)\right)\nonumber\\ &\quad-\frac{2\alpha(t)r}{cd}\sum_{k\in\mathcal{M}}w_k\left(\boldsymbol{\theta}_k\left(t,0\right)-\boldsymbol{\theta}^*\right)^T\nabla F_k\left(\boldsymbol{\theta}_k\left(t,0\right)\right)\label{eq:A_3_async}\\ &=||\bar{\boldsymbol{\theta}}\left(t\right)-\boldsymbol{\theta}^*||_2^2+\frac{r^2\alpha^2(t)}{cd^2}\sum_{k\in\mathcal{M}}w_k||\nabla F_k\left(\boldsymbol{\theta}_k\left(t\right)\right)||_2^2\nonumber\\ &\quad-\frac{2\alpha(t)r}{cd}\sum_{k\in\mathcal{M}}w_k\left(\boldsymbol{\theta}_k\left(t,0\right)-\boldsymbol{\theta}^*\right)^T\nabla F_k\left(\boldsymbol{\theta}_k\left(t,0\right)\right)\label{eq:A_3_async_1} \end{align} where \eqref{eq:A_3_async} and \eqref{eq:A_3_async_1} are due to the convexity of $||\cdot||_2^2$ and $\bar{\boldsymbol{\theta}}\left(t\right)=\boldsymbol{\theta}_k\left(t,0\right), \forall k$, respectively. The third term of \eqref{eq:A_3_async_1} is constrained by the convexity of $F_k\left(\boldsymbol{\theta}\right)$, \begin{align} &-\left(\boldsymbol{\theta}_k\left(t,0\right)-\boldsymbol{\theta}^*\right)^T\nabla F_k\left(\boldsymbol{\theta}_k\left(t,0\right)\right)\nonumber\\ &\leq-\left(F_k\left(\boldsymbol{\theta}_k\left(t,0\right)\right)-F_k\left(\boldsymbol{\theta}^*\right)\right)-\frac{\mu}{2}||\boldsymbol{\theta}_k\left(t,0\right)-\boldsymbol{\theta}^*||_2^2. \label{eq:A_3_2_async} \end{align} By applying \eqref{eq:A_3_2_async}, and \eqref{ieq:smoothMdf} in Section \ref{apdx:remaining_3}, \eqref{eq:A_3_async_1} is rearranged as\footnote{See Section \ref{apdx:remaining_3} for details.} \begin{align*} &||\bar{\boldsymbol{\theta}}\left(t\right)-\boldsymbol{\theta}^*-\alpha(t)\bar{\boldsymbol{g}}\left(t\right)||_2^2\nonumber\\ &\leq||\bar{\boldsymbol{\theta}}\left(t\right)-\boldsymbol{\theta}^*||_2^2+\frac{r^2\alpha^2(t)}{cd^2}\sum_{k\in\mathcal{M}}w_k2L\left(F_k\left(\boldsymbol{\theta}_k\left(t,0\right)\right)-F_k^*\right)\nonumber\\ &-\frac{2\alpha(t)r}{cd}\sum_{k\in\mathcal{M}}w_k\Big[F_k\left(\boldsymbol{\theta}_k\left(t,0\right)\right)-F_k\left(\boldsymbol{\theta}^*\right)+\frac{\mu}{2}||\boldsymbol{\theta}_k\left(t,0\right)-\boldsymbol{\theta}^*||_2^2\Big]. \end{align*} Based on the convexity of $||\cdot||_2^2$ and some manipulations, \begin{align*} &||\bar{\boldsymbol{\theta}}\left(t\right)-\boldsymbol{\theta}^*-\alpha(t)\bar{\boldsymbol{g}}\left(t\right)||_2^2\leq\left(1-\frac{\mu\alpha(t)r}{d}\right)||\bar{\boldsymbol{\theta}}\left(t\right)-\boldsymbol{\theta}^*||_2^2\nonumber\\ &-\frac{2\alpha(t)r}{cd}\left[1-\frac{Lr\alpha(t)}{d}\right]\sum_{k\in\mathcal{M}}w_k\left[F_k\left(\boldsymbol{\theta}_k\left(t,0\right)\right)-F^*\right]\nonumber\\ &+\frac{2Lr^2\alpha^2(t)}{cd^2}\sum_{k\in\mathcal{M}}w_k\left(F^*-F_k^*\right)-\frac{2\alpha(t)r}{cd}\sum_{k\in\mathcal{M}}w_k\left(F^*-F_k\left(\boldsymbol{\theta}^*\right)\right).\nonumber\\ \end{align*} Then, based on \eqref{eq:noniid_b1} and \eqref{eq:noniid_b2}, we have \begin{align} &||\bar{\boldsymbol{\theta}}\left(t\right)-\boldsymbol{\theta}^*-\alpha(t)\bar{\boldsymbol{g}}\left(t\right)||_2^2\leq\left(1-\frac{\mu\alpha(t)r}{d}\right)||\bar{\boldsymbol{\theta}}\left(t\right)-\boldsymbol{\theta}^*||_2^2\nonumber\\ &-\frac{2\alpha(t)r}{cd}\left[1-\frac{Lr\alpha(t)}{d}\right]\sum_{k\in\mathcal{M}}w_k\left[F_k\left(\boldsymbol{\theta}_k\left(t,0\right)\right)-F^*\right]\nonumber\\ &+\frac{2Lr^2\alpha^2(t)}{d^2}\zeta_1+\frac{2\alpha(t)r}{d}\zeta_2. \label{eq:A_3_4_async} \end{align} Note that \begin{equation*} \sum_{k\in\mathcal{M}}\frac{w_k}{c}\left(F_k\left(\boldsymbol{\theta}_k\left(t,0\right)\right)-F^*\right)=\sum_{k\in\mathcal{M}}\frac{w_k}{c}\left(F_k\left(\bar{\boldsymbol{\theta}}\left(t\right)\right)-F^*\right) \end{equation*} \begin{equation*} \geq \sum_{k\in\mathcal{M}}\frac{w_k}{c}\left(F_k^*-F^*\right)\geq -\zeta_1 \end{equation*} Since $\alpha(t)\leq 1/(4L)$, we have $-\frac{2\alpha(t)r}{d}\left[1-\frac{Lr\alpha(t)}{d}\right]<0$. Then, \begin{align} &-\frac{2\alpha(t)r}{d}\left[1-\frac{Lr\alpha(t)}{d}\right]\sum_{k\in\mathcal{M}}\frac{w_k}{c}\left(F_k\left(\boldsymbol{\theta}_k\left(t,0\right)\right)-F^*\right)\nonumber\\ &\leq\frac{2\alpha(t)r}{d}\left[1-\frac{Lr\alpha(t)}{d}\right]\zeta_1. \label{eq:A_3_10_async_final} \end{align} By plugging \eqref{eq:A_3_10_async_final} into \eqref{eq:A_3_4_async}, we have \begin{equation*} ||\bar{\boldsymbol{\theta}}\left(t\right)-\boldsymbol{\theta}^*-\alpha(t)\bar{\boldsymbol{g}}\left(t\right)||_2^2\leq\left(1-\frac{\mu\alpha(t)r}{d}\right)||\bar{\boldsymbol{\theta}}\left(t\right)-\boldsymbol{\theta}^*||_2^2+\frac{\alpha(t)rA}{d}. \end{equation*} \subsection{Proof of \textbf{Lemma 2}} \label{sec:pf_lemma2} \begin{align} &\mathbb{E}_{\mathcal{B}_k(t)}\mathbb{E}_{\mathcal{Q}_\nu}\mathbb{E}_{\mathcal{V}_k(t)}\left[||\boldsymbol{g}\left(t\right)-\bar{\boldsymbol{g}}\left(t\right)||_2^2\right] \nonumber\\ &=\mathbb{E}_{\mathcal{B}_k(t)}\mathbb{E}_{\mathcal{Q}_\nu}\mathbb{E}_{\mathcal{V}_k(t)}\Big[||\sum_{k\in\mathcal{M}}\frac{w_k}{c}\mathcal{Q}_\nu\left(\nabla \tilde{F}_k\left(\boldsymbol{\theta}_k(t,0);\mathcal{B}_k(t)\right)\right)\nonumber\\ &\quad\quad\quad\quad\quad\quad\quad\quad\quad-\frac{r}{d}\sum_{k\in\mathcal{M}}\frac{w_k}{c}\nabla F_k\left(\boldsymbol{\theta}_k(t,0)\right)||_2^2\Big]\nonumber\\ &\leq\mathbb{E}_{\mathcal{B}_k(t)}\mathbb{E}_{\mathcal{Q}_\nu}\mathbb{E}_{\mathcal{V}_k(t)}\Big[\sum_{k\in\mathcal{M}}\frac{w_k}{c}||\mathcal{Q}_\nu\left(\nabla \tilde{F}_k\left(\boldsymbol{\theta}_k(t,0);\mathcal{B}_k(t)\right)\right)\nonumber\\ &\quad\quad\quad\quad\quad\quad\quad\quad\quad-\frac{r}{d}\nabla F_k\left(\boldsymbol{\theta}_k(t,0)\right)||_2^2\Big]\nonumber\\ &=\mathbb{E}_{\mathcal{B}_k(t)}\mathbb{E}_{\mathcal{Q}_\nu}\Big[\sum_{k\in\mathcal{M}}\frac{w_k}{c}\frac{r}{d}||\mathcal{Q}_\nu\left(\nabla F_k\left(\boldsymbol{\theta}_k(t,0);\mathcal{B}_k(t)\right)\right)\nonumber\\ &\quad\quad\quad\quad\quad\quad\quad\quad\quad-\nabla F_k\left(\boldsymbol{\theta}_k(t,0)\right)||_2^2\Big]\nonumber\\ &\leq\frac{2r}{d}\mathbb{E}_{\mathcal{B}_k(t)}\mathbb{E}_{\mathcal{Q}_\nu}\Big[\sum_{k\in\mathcal{M}}\frac{w_k}{c}\Big(||\mathcal{Q}_\nu\left(\nabla F_k\left(\boldsymbol{\theta}_k(t,0);\mathcal{B}_k(t)\right)\right)\nonumber\\ &\quad-\nabla F_k\left(\boldsymbol{\theta}_k(t,0);\mathcal{B}_k(t)\right)||_2^2+||\nabla F_k\left(\boldsymbol{\theta}_k(t,0);\mathcal{B}_k(t)\right)\nonumber\\ &\quad-\nabla F_k\left(\boldsymbol{\theta}_k(t,0)\right)||_2^2\Big)\Big]\nonumber\\ &\leq\frac{2r}{d}\mathbb{E}_{\mathcal{B}_k(t)}\Big[\sum_{k\in\mathcal{M}}\frac{w_k}{c}\Big(\frac{d||\nabla F_k\left(\boldsymbol{\theta}_k(t,0);\mathcal{B}_k(t)\right)||_2^2}{4\nu^2}\nonumber\\ &\quad+||\nabla F_k\left(\boldsymbol{\theta}_k(t,0);\mathcal{B}_k(t)\right)-\nabla F_k\left(\boldsymbol{\theta}_k(t,0)\right)||_2^2\Big)\Big]\nonumber\\ &\leq\frac{2r}{d}(1+\frac{d}{4\nu^2})\left(C_1+C_2\sum_{k\in\mathcal{M}}\frac{w_k}{c}||\nabla F_k(\boldsymbol{\theta}_k(t,0))||_2^2\right)\nonumber\\ &\leq\frac{2r}{d}(1+\frac{d}{4\nu^2})\left[C_1+L^2C_2\sum_{k\in\mathcal{M}}\frac{w_k}{c}\left(||\boldsymbol{\theta}_k(t,0)-\boldsymbol{\theta}_k^*||^2_2\right)\right]. \label{eq:proofLm2} \end{align} Note that \begin{align} &\sum_{k\in\mathcal{M}}\frac{w_k}{c}||\boldsymbol{\theta}_k(t,0)-\boldsymbol{\theta}_k^*||^2_2\nonumber\\ &\leq2\sum_{k\in\mathcal{M}}\frac{w_k}{c}\left(||\boldsymbol{\theta}_k(t,0)-\boldsymbol{\theta}^*||^2_2+|| \boldsymbol{\theta}^*-\boldsymbol{\theta}_k^*||^2_2\right)\nonumber\\ &\leq2\sum_{k\in\mathcal{M}}\frac{w_k}{c}\left[||\boldsymbol{\theta}_k(t,0)-\boldsymbol{\theta}^*||^2_2+\frac{2}{\mu}\left(F_k\left(\boldsymbol{\theta}^*\right)-F_k\left(\boldsymbol{\theta}_k^*\right)\right)\right]\nonumber\\ &\leq2||\bar{\boldsymbol{\theta}}(t)-\boldsymbol{\theta}^*||^2_2+\frac{2}{\mu}A. \label{eq:proofLm2_1} \end{align} Plugging \eqref{eq:proofLm2_1} into \eqref{eq:proofLm2}, we have \begin{align} &\mathbb{E}_{\mathcal{B}_k(t)}\mathbb{E}_{\mathcal{Q}_\nu}\mathbb{E}_{\mathcal{V}_k(t)}\left[||\boldsymbol{g}\left(t\right)-\bar{\boldsymbol{g}}\left(t\right)||_2^2\right]\nonumber\\ &\leq\frac{2r}{d}(1+\frac{d}{4\nu^2})\left[C_1+2L^2C_2\left(||\bar{\boldsymbol{\theta}}(t)-\boldsymbol{\theta}^*||^2_2+\frac{A}{\mu}\right)\right]\nonumber\\ &\leq C_3L^2C_2||\bar{\boldsymbol{\theta}}(t)-\boldsymbol{\theta}^*||^2_2+C_3\left(\frac{C_1}{2}+\frac{AL^2C_2}{\mu}\right).\label{ieq:lemma2} \end{align} As the bound in \eqref{ieq:lemma2} does not depend on current scheduling policy $\mathcal{M}$, the proof is completed. \subsection{Proof of $ 2L\left[F_k\left(\boldsymbol{\theta}\right)-F_k^*\right]\geq||\nabla F_k\left(\boldsymbol{\theta}\right)||_2^2$} \label{apdx:remaining_3} Let $\boldsymbol{\theta}_1,\boldsymbol{\theta}_2\in\mathbb{R}^d$. Since $F_k\left(\boldsymbol{\theta}\right)$ is $L$-smooth, \begin{equation} \label{eq:pf_A_3_1} F_k\left(\boldsymbol{\theta}_1\right)\leq F_k\left(\boldsymbol{\theta}_2\right)+\nabla F_k\left(\boldsymbol{\theta}_2\right)^T\left(\boldsymbol{\theta}_1-\boldsymbol{\theta}_2\right)+\frac{L}{2}||\boldsymbol{\theta}_1-\boldsymbol{\theta}_2||_2^2. \end{equation} Define the right-hand side of \eqref{eq:pf_A_3_1} as a new function \begin{equation*} g\left(\boldsymbol{\theta}_1\right)=F_k\left(\boldsymbol{\theta}_2\right)+\nabla F_k\left(\boldsymbol{\theta}_2\right)^T\left(\boldsymbol{\theta}_1-\boldsymbol{\theta}_2\right)+\frac{L}{2}||\boldsymbol{\theta}_1-\boldsymbol{\theta}_2||_2^2. \end{equation*} Since $g\left(\boldsymbol{\theta}_1\right)$ is a quadratic function with global minimum $g\left(\boldsymbol{\theta}^*\right)$ and $\nabla g\left(\boldsymbol{\theta}^*\right)=\boldsymbol{0}$, it follows that \begin{equation*} \nabla F_k\left(\boldsymbol{\theta}_2\right)+L\left(\boldsymbol{\theta}^*-\boldsymbol{\theta}_2\right)=\boldsymbol{0}\text{, and }\boldsymbol{\theta}^*=\frac{-\nabla F_k\left(\boldsymbol{\theta}_2\right)}{L}+\boldsymbol{\theta}_2. \end{equation*} Then, the global minimum is \begin{equation} g\left(\boldsymbol{\theta}^*\right)=F_k\left(\boldsymbol{\theta}_2\right)-\frac{1}{2L}||\nabla F_k\left(\boldsymbol{\theta}_2\right)||_2^2. \label{eq:pf_A_3_2} \end{equation} Combining \eqref{eq:pf_A_3_2} and \eqref{eq:pf_A_3_1}, \begin{equation*} \mbox{min}_{\boldsymbol{\theta}}F_k\left(\boldsymbol{\theta}\right)\leq F_k\left(\boldsymbol{\theta}_2\right)-\frac{1}{2L}||\nabla F_k\left(\boldsymbol{\theta}_2\right)||_2^2 \end{equation*} and hence \begin{equation} 2L\left[F_k\left(\boldsymbol{\theta}_2\right)-F_k^*\right]\geq||\nabla F_k\left(\boldsymbol{\theta}_2\right)||_2^2. \label{ieq:smoothMdf} \end{equation} \bibliographystyle{IEEEtran}
\section{Introduction} Petri nets are widely used to describe distributed systems capable of expanding their resources indefinitely~\cite{Reisig2013}. A \emph{Petri net} describes passive and active components of a system, modeled as places and transitions, respectively. The active components of a Petri net communicate asynchronously with each other via local interfaces. Thus, state changes in a Petri net system have local causes and effects and are modeled as tokens consumed, produced, or transferred by the transitions of the system. A \emph{token} is often used to denote an \emph{object} in the physical world the system manipulates or a \emph{condition} that can cause a state change in the system. Petri nets with identifiers~\cite{HSVW09} extend classical Petri nets to provide formal means to relate tokens to objects. Every token in such a Petri net is associated with a vector of identifiers, where each identifier uniquely identifies a data object. Consequently, active components of a Petri net with identifiers model how groups of objects, either envisioned or those existing in the physical world, can be consumed, produced, or transferred by the system. It is often desirable that modeled systems are correct. Many criteria have been devised for assessing the correctness of systems captured as Petri nets. Those criteria target models of systems that use tokens to represent conditions that control their state changes. In other words, they can be used to verify the correctness of processes the systems can support and not of the object manipulations carried out within those processes. Such widely-used criteria include boundedness~\cite{Karp1969}, liveness~\cite{Hack1974}, and soundness~\cite{Aalst1997}. The latter one, for instance, ensures that a system modeled as a \emph{workflow net}, a special type of a Petri net used to encode workflow at an organization, has a terminal state that can be distinguished from other states of the modeled system, the system can always reach the terminal state, and every transition of the system can in principle be enabled and, thus, used by the system. Real-world systems, such as information systems~\cite{PolyvyanyyWOB19}, are characterized by processes that manipulate objects. For instance, an online retailer system manipulates products, invoices, and customer records. However, although tool support allowed to design such models~\cite{WerfP20}, initial use showed that correctness criteria addressing both aspects, that is, the processes and data, are understood less well~\cite{WerfP18}. Hence, the paper at hand to close the gap. In this paper, we propose a correctness criterion for Petri nets with identifiers that combines the checks of the soundness of the system's processes with the soundness of object manipulations within those processes. Intuitively, objects of a specific type are correctly manipulated by the system if every object instance of that type, characterized by a unique identifier, can ``leave'' the system, that is, a dedicated transition of the system can consume it, and once that happens, no references to that object instance remain in the system. When a system achieves this harmony for its processes and all data object types, we say that the system is \emph{identifier sound}, or, alternatively, that the data and processes of the system are in \emph{resonance}. Specifically, this paper makes these contributions: \smallskip \begin{compactitem} \item It motivates and defines the notion of \emph{identifier soundness} for checking correctness of data object manipulations in processes of a system; \item It proposes a resource-aware extension for such systems and defines a suitable correctness criterion building on top of the one of identifier soundness and requiring that system resources are managed \emph{conservatively}; \item It discusses aspects related to \emph{decidability of identifier soundness} in the general case, and for certain restricted, but still useful, classes of systems; \item It establishes connections with existing results on verification of data-aware processes and shows which verification tasks are decidable for object-aware systems. \end{compactitem} \smallskip The paper proceeds as follows. The next section introduces concepts and notions required to support subsequent discussions. Section~\ref{sec:pnids} introduces typed Petri nets with identifiers, a model for modeling distributed systems whose state is defined by objects the system manipulates. Section~\ref{sec:soundness} presents various correctness notions for typed Petri nets with identifiers, including the one of identifier soundness, and demonstrates a proof that the notion is in general undecidable. Moreover, the section discusses connection to existing verification results and show which verification tasks are decidable for typed Petri nets with identifiers. Section~\ref{sec:soundness:by:construction} discusses several classes of systems for which identifier soundness is guaranteed by construction. Section~\ref{sec:soundness:with:resources} presents the formalism extension with resource management capabilities and discusses a series of results, including the one on resource-aware soundness, that is deemed to be undecidable. Finally, the paper concludes with a discussion on related work (Section~\ref{sec:relatedwork}) and future work. \section{Preliminaries} Let $S$ and $T$ be sets. The powerset of $S$ is denoted by $\powerset{S} = \{ S' \mid S' \subseteq S\}$ and $|S|$ denotes the cardinality of $S$. Given a relation $R \subseteq S \times T$, its range is defined by $\rng{R} = \{y \in T \mid \exists x \in S : (x,y)\in R\}$. A \emph{multiset} $m$ over $S$ is a mapping of the form $m:S\rightarrow \mathbb{N}$, where $\mathbb{N} = \{0, 1, 2, \ldots\}$ denotes the set of natural numbers. For $s \in S$, $m(s) \in \mathbb{N}$ denotes the number of times $s$ appears in the multiset. We write $s^n$ if $m(s)=n$. For $x \not\in S$, $m(x) = 0$. We use $\mult S$ to denote the set of all finite multisets over $S$ and $\emptyset$ to denote the \emph{empty multiset}. The support of $m\in\mult S$ is the set of elements that appear in $m$ at least once: $\supp{m} = \set{s\in S\mid m(s) > 0}$. Given two multisets $m_1$ and $m_2$ over $S$: \begin{inparaenum}[\it (i)] \item $m_1 \subseteq m_2$ (resp., $m_1 \subset m_2$) iff $m_1(s) \leq m_2(s)$ (resp., $m_1(s) < m_2(s)$) for each $s \in S$; \item $m_1 + m_2 = \set{s^n\mid s\in S, n =m_1(s) + m_2(s)}$; \item if $m_1 \subseteq m_2$, $m_2 - m_1 = \set{s^n \mid s\in S, n=m_2(s) - m_1(s)}$; and \item $|m|=\sum_{s\in S}m(s)$. \end{inparaenum} A \emph{sequence} over $S$ of length $n \in \mathbb{N}$ is a function $\sigma : \{1,\ldots,n\} \to S$. If $n > 0$ and $\sigma(i) = a_i$, for $1\leq i \leq n$, we write $\sigma = \sequence{a_1, \ldots, a_n}$. The length of a sequence $\sigma$ is denoted by $|\sigma|$. The sequence of length $0$ is called the \emph{empty sequence}, and is denoted by $\ensuremath \epsilon$. The set of all finite sequences over $S$ is denoted by $S^*$. We write $a \in \sigma$ if there is $1 \leq i \leq |\sigma|$ such that $\sigma(i) = a$. Projection of sequences on a set $T$ is defined inductively by $\proj{\ensuremath \epsilon}{T} = \ensuremath \epsilon$, $\proj{(\sequence{a}\cdot \sigma)}{T} = \sequence{a}\cdot \proj{\sigma}{T}$ if $a \in T$ and $\proj{\sequence{a}\cdot \sigma}{T} = \proj{\sigma}{T}$ otherwise, where $\cdot $ is the sequence concatenation operator. Renaming a sequence with an injective function $r : S \rightarrow T$ is defined inductively by $\rho_r(\ensuremath \epsilon) = \ensuremath \epsilon$, and $\rho_r(\sequence{a}\cdot \sigma) = \sequence{r(a)}\cdot \rho_r(\sigma)$. Renaming is extended to multisets of sequences as follows: given a multiset $m \in \mult{(S^*)}$, we define $\rho_r(m) = \sum_{\sigma\in\supp{m}} \sigma(m)\cdot\rho_r(\sigma)$. For example, $\rho_{\{x\mapsto a, y \mapsto b\}}(\sequence{x,y}^3) = \sequence{a,b}^3$. \medskip\noindent \textbf{Labeled Transition Systems.}\quad To model the behavior of a system, we use \emph{labeled transition systems}. Given a finite set $A$ of (action) labels, a \emph{(labeled) transition system} (LTS) over $A$ is a tuple $\tsys{}{} = (S,A,s_0, \to)$, where $S$ is the (possibly infinite) set of \emph{states}, $s_0$ is the \emph{initial state} and $\to\ \subset (S\times (A \cup \{\tau\}) \times S)$ is the \emph{transition relation}, where $\tau\not\in A$ denotes the silent action~\cite{glabbeekoverviewii}. In what follows, we write $s \xrightarrow{a} s'$ for $(s,a,s') \in \to$. Let $r : A \to (A' \cup \{\tau\})$ be an injective, total function. Renaming $\tsys{}{}$ with $r$ is defined as $\rho_{r}(\Gamma) = (S, A \setminus A', s_0, \to')$ with $(s,r(a),s') \in \to'$ iff $(s,a,s') \in \to$. Given a set $T$, hiding is defined as $\hide{T}(\Gamma) = \rho_{h}(\Gamma)$ with $h : A \rightarrow A \cup \{\tau\}$ such that $h(t) = \tau$ if $t \in T$ and $h(t)=t$ otherwise. Given $a\in A$, $p \xdasharrow{~a~} q$ denotes a \emph{weak transition relation} that is defined as follows: \begin{inparaenum}[\it (i)] \item $p \xdasharrow[->]{~a~} q$ iff $p (\xrightarrow{\tau})^* q_1\xrightarrow{a}q_2 (\xrightarrow{\tau})^* q$; \item $p \xdasharrow[->]{\ensuremath{~\tau~}} q$ iff $p (\xrightarrow{\tau})^* q$. \end{inparaenum} Here, $(\xrightarrow{\tau})^*$ denotes the reflexive and transitive closure of $\xrightarrow{\tau}$. \begin{definition}[Strong and weak bisimulation] \label{def:bisimulation}\label{def:strong-bisimulation} Let $\tsys{1} = (S_1,A,s_{01},\to_1)$ and $\tsys{2} = (S_2,A,s_{02},\to_2)$ be two LTSs. A relation $R\subseteq(S_1 \times S_2)$ is called a \emph{strong simulation}, denoted as $\tsys{1} \prec_R \tsys{2}$, if for every pair $(p,q)\in R$ and $a\in A \cup \{\tau\}$, it holds that if $p\xrightarrow{a}_1 p'$, then there exists $q'\inS_2$ such that $q \xrightarrow{a}_2 q'$ and $(p',q')\in R$. Relation $R$ is a \emph{weak simulation}, denoted by $\tsys{1} \preccurlyeq_R \tsys{2}$, iff for every pair $(p,q)\in R$ and $a\in A \cup \{\tau\}$ it holds that if $p\xrightarrow{a}_1 p'$, then either $a = \tau$ and $(p', q) \in R$, or there exists $q'\inS_2$ such that $q \xdasharrow{~a~}_{\hspace{-.5ex} 2} ~q'$ and $(p',q')\in R$. $R$ is called a strong (weak) \emph{bisimulation}, denoted by $\tsys{1} \sim_R \tsys{2}$ ($\tsys{1} \approx_R \tsys{2}$) if both $\tsys{1} \prec \tsys{2}$ ($\tsys{1} \preccurlyeq_R \tsys{2}$) and $\tsys{2} \prec_{R^{-1}} \tsys{1}$ ($\tsys{2} \preccurlyeq_{R^{-1}} \tsys{1}$). The relation is called \emph{rooted} iff $(s_{01}, s_{02}) \in R$. A rooted relation is indicated with a superscript ${}^r$. \end{definition} \medskip\noindent \textbf{Petri nets.}\quad A weighted Petri net is a 4-tuple $(P,T,F,W)$ where $P$ and $T$ are two disjoint sets of \emph{places} and \emph{transitions}, respectively, $F \subseteq ((P \times T) \cup (T\times P))$ is the \emph{flow relation}, and $W : F \rightarrow \mathbb{N}^+$ is a \emph{weight function}. For $x\inP\cupT$, we write $\pre{x}=\set{y\mid (y,x)\inF}$ to denote the \emph{preset} of $x$ and $\post{x}=\set{y\mid (x,y)\inF}$ to denote the \emph{postset} of $x$. We lift the notation of preset and postset to sets element-wise. If for a Petri net no weight function is defined, we assume $W(f) = 1$ for all $f \in F$. A \emph{marking} of $N$ is a multiset $m \in \mult P$, where $m(p)$ denotes the number of \emph{tokens} in place $p \in P$. If $m(p) > 0$, place $p$ is called \emph{marked} in marking $m$. A \emph{marked Petri net} is a tuple $(N, m)$ with $N$ a weighted Petri net with marking $m$. A transition $t\in T$ is enabled in $(N,m)$, denoted by $\enabled{(N,m)}{t}$ iff $W((p,t)) \leq m(p)$ for all $p \in \pre{t}$. An enabled transition can \emph{fire}, resulting in marking $m'$ iff $m'(p) + W((p,t)) = m(p) + W((t,p))$, for all $p \in P$, and is denoted by $\fire{(N,m)}{t}{(N,m')}$. We lift the notation of firings to sequences. A sequence $\sigma \in T^*$ is a \emph{firing sequence} iff $\sigma = \ensuremath \epsilon$, or markings $m_0, \ldots, m_n$ exist such that $\fire{(N,m_{i-1})}{\sigma(i)}{(N,m_{i})}$ for $1 \leq i \leq |\sigma| = n$, and is denoted by $\fire{(N,m_0)}{\sigma}{(N,m_n)}$. If the context is clear, we omit the weighted Petri net $N$. The set of reachable markings of $(N,m)$ is defined by $\reachable{N}{m} = \{ m' \mid \exists \sigma \in T^* : \fire{m}{\sigma}{m'} \}$. The semantics of a marked Petri net $(N,m)$ with $N = (P, T, F, W)$ is defined by the LTS $\Gamma_{N,m} = (\mult P, T, m_0, \to)$ with $(m,t,m') \in \to$ iff $\fire{m}{t}{m'}$. \medskip \noindent \textbf{Workflow Nets.}\quad A \emph{workflow net} (WF-net for short) is a tuple $N=(P, T, F,W,\mathit{in},\mathit{out})$ such that: \begin{inparaenum}[\it (i)] \item $(P, T, F, W)$ is a weighted Petri net; \item $\mathit{in},\mathit{out}\inP$ are the source and sink place, respectively, with $\pre{\mathit{in}} =\post{\mathit{out}}= \emptyset$; \item every node in $P \cup T$ is on a directed path from $\mathit{in}$ to $\mathit{out}$. \end{inparaenum} $N$ is called \emph{$k$-sound} for some $k \in \mathbb{N}$ iff \begin{inparaenum}[\it (i)] \item it is proper completing, i.e., for all reachable markings $m \in \reachable{N}{[\mathit{in}^k]}$, if $[\mathit{out}^k]\subseteq m$, then $m = [\mathit{out}^k]$; \item it is weakly terminating, i.e., for any reachable marking $m \in \reachable{N}{[\mathit{in}^k]}$, the final marking is reachable, i.e., $[\mathit{out}^k] \in \reachable{N}{m}$; and \item it is quasi-live, i.e., for all transitions $t\inT$, there is a marking $m\in\reachable{N}{[\mathit{in}]}$ such that $\enabled{m}{t}$. \end{inparaenum} The net is called \emph{sound} if it is $1$-sound. If it is $k$-sound for all $k\in\mathbb{N}$, it is called \emph{generalized sound}~\cite{HeeSV03}. \section{Typed Petri nets with Identifiers} \label{sec:pnids} Processes and data are highly intertwined: processes manipulate data objects while objects govern processes. These processes can perform complex manipulations over multiple objects. For example, consider a retailer shop with three types of objects: \emph{products} sold through the shop, \emph{customers} that can order these products, and \emph{orders} that track products bought by customers. This example already involves many-to-many relations between objects, e.g., a product can be ordered by many customers, while a customer can order many products. Relations between objects can also be one-to-many, e.g., an order is always for a single customer, but a customer can have many orders. In addition, objects may have life cycles, which can be considered as processes themselves. Figure~\ref{fig:lifecycles} shows three life cycles of objects in the retailer shop. A product may be temporarily unavailable, while customers may be blocked by the shop, disallowing them to order products. These life cycles are inherently intertwined. For instance, customers should not be allowed to order products that are unavailable. Similarly, blocked customers should not be able to create new orders. \begin{figure} \centering \includegraphics[width=\textwidth]{figures/lifecycles} \caption{The life cycles of products, customers and orders in the retailer shop.}\label{fig:lifecycles} \end{figure} Several approaches have been studied to model and analyze models that combine objects and processes. For example, data-aware Proclets~\cite{Fahland19} allow describing the behavior of individual artifacts and their interactions. Another approach is followed in $\nu$-PN~\cite{RVFE11}, in which a token can carry a single identifier~\cite{RosaMF06}. In this formalism, markings map each place to a bag of identifiers, indicating how many tokens in each place carry the same identifier. These identifiers can be used to reference entities in an information model. However, referencing a fact composed of multiple entities is not possible in $\nu$-PNs. In this paper, we study \emph{typed Petri nets with identifiers} (t-PNIDs\xspace), which build upon $\nu$-PNs~\cite{RVFE11} by extending tokens to carry vectors of identifiers~\cite{PolyvyanyyWOB19,WerfP20}. Vectors, represented by sequences, have the advantage that a single token can refer to multiple objects or entities that compose (a part of) a \emph{fact}, such as an order is for a specific customer. Identifiers are typed, i.e., the countable, infinite set of identifiers is partitioned into a set of types, such that each type contains a countable, infinite set of identifiers. Identifier types should not overlap, i.e., each identifier has a unique type. Variables can take values of identifiers, and are, thus, are typed as well and can only refer to identifiers of the associated type. For example, the product, customer and order objects from the retailer shop make us three object types. \begin{definition}[Identifier Types] \label{def:id-types} Let $\ensuremath{\mathcal{I}}$, $\Lambda$, and $\ensuremath{\mathcal{V}}$ denote countable, infinite sets of identifiers, type labels, and variables, respectively. We define: \begin{itemize} \item the \emph{domain assignment} function $I : \Lambda \rightarrow \powerset{\ensuremath{\mathcal{I}}}$, such that $I(\lambda_1)$ is an infinite set, and $I(\lambda_1) \cap I(\lambda_2) \neq \emptyset$ implies $\lambda_1 = \lambda_2$ for all $\lambda_1, \lambda_2 \in \Lambda$; \item the \emph{id typing} function $\ensuremath {type}_{I}:\ensuremath{\mathcal{I}}\to\Lambda$ s.t. if $\ensuremath {type}_{I}(\cname{id})=\lambda$, then $\cname{id}\in I(\lambda)$; \item a \emph{variable typing} function $\ensuremath {type}_{\ensuremath{\mathcal{V}}}:\ensuremath{\mathcal{V}}\to\Lambda$, prescribing that $x\in\ensuremath{\mathcal{V}}$ can be substituted only by values from $I(\ensuremath {type}_{\ensuremath{\mathcal{V}}}(x))$. \end{itemize} When clear from the context, we omit the subscripts of $type$. \end{definition} In a t-PNID\xspace, each place is annotated with a label, called the \emph{place type}. A place type is a vector of types, indicating types of identifier tokens at the place can carry. A place with the empty place type, represented by the empty vector, is a classical Petri net place carrying indistinguishable (black) tokens. Each arc of a t-PNID\xspace is inscribed with a multiset of vectors of identifiers, such that the types of the variables in the vector coincide with the place types. This allows modeling situations where a transition may require multiple tokens with different identifiers from the same place. \begin{figure}[t] \centering \includegraphics[scale=.8]{figures/overallModel} \caption{t-PNID\xspace $N_{\mathit{rs}}$ for the retailer shop with types of products, customers and orders. Each place is colored according to its type. Place $p$ carries pairs of identifiers: an order and a customer. The net intertwines the life cycles of Figure~\ref{fig:lifecycles} and weakly simulates each of these life cycles. }\label{fig:overallModel} \end{figure} \begin{definition}[Typed Petri nets with identifiers] \label{def:tpnid} A \emph{Typed Petri net with identifiers} (t-PNID\xspace) $N$ is a tuple $(P,T,F,\alpha,\beta)$, where: \begin{itemize} \item $(P,T,F)$ is a Petri net; \item $\alpha:P\to\Lambda^*$ is the \emph{place typing function} \item $\beta : F\to \mult{(\ensuremath{\mathcal{V}}^*)}$ defines for each flow a multiset of \emph{variable vectors} such that $\alpha(p) = \ensuremath {type}(x)$ for any $x \in \supp{\beta((p,t))}$ and $\ensuremath {type}(y)=\alpha(p')$ for any $y \in \supp{\beta((t,p'))}$ where $t\inT$, $p\in\pre{t}$, $p'\in\post{t}$; \end{itemize} \end{definition} Figure~\ref{fig:overallModel} shows a t-PNID\xspace, $N_{\mathit{rs}}$, of the retailer shop. Each place is colored according to its identifier type. In $N_{\mathit{rs}}$, places \emph{product} and \emph{unavailable product} are annotated with a vector $\langle\mathit{product}\rangle$, i.e., these places contain tokens that carry only a single identifier of type $\mathit{product}$. Places \emph{customer} and \emph{blocked customer} have type $\langle\mathit{customer}\rangle$. All other places, except for place $p$, are labeled with type $\langle\mathit{order}\rangle$. Place $p$ maintains the relation between orders and customers, and is typed $\langle\mathit{order},\mathit{customer}\rangle$, i.e., tokens in this place are identifier vectors of size 2. $N_{\mathit{rs}}$ uses three variables: $x$ for $\mathit{product}$, $y$ for $\mathit{order}$ and $z$ for $\mathit{customer}$. A marking of a t-PNID\xspace $N$ is a configuration of tokens over its places. The set of all possible markings of $N$ is denoted by $\mathbb{M}(N)$. Each token in a place should be of the correct type, i.e., the vector of identifiers carried by a token in a place should match the corresponding place type. All possible vectors of identifiers a place $q$ may carry is defined by the set $\funsym{C}(q)$. \begin{definition}[Marking] Given a t-PNID\xspace $N = (P, T, F, \alpha, \beta)$, and place $p \in P$, its \emph{id set} is $\funsym{C}(p) = \prod_{1 \leq i \leq |\alpha(p)|} I(\alpha(p)(i))$. A \emph{marking} is a function $m \in \mathbb{M}(N)$, with $\mathbb{M}(N) = P \to \mult{(\ensuremath{\mathcal{I}}^*)}$, such that $m(p) \in \mult {\funsym{C}(p)}$, for each place $p \in P$. The set of identifiers used in $m$ is denoted by $\smash{\id{m} = \bigcup_{p \in P} \rng{\supp{m(p)}}}$. The pair $(N, m)$ is called a \emph{marked t-PNID\xspace}. \end{definition} To define the semantics of a t-PNID\xspace, the variables need to be valuated with identifiers. Variables may be used differently by transitions. In Fig.~\ref{fig:overallModel}, transition $G$ uses variable $y$ to create an identifier of type $\mathit{order}$, whereas transition $K$ uses the same variable to remove an identifier from the marking. We therefore first introduce some notation to work with variables and types in a t-PNID\xspace. Variables that are used on the input arcs, i.e., variables on arcs from a place to a transition $t$ are called the input variables of $t$. Similarly, variables on arcs from transition $t$ to a place are called the output variables of $t$. A variable that only occur in the set of output variables of a transition and not in the set of input variables, is an \emph{emitting variable}. Similarly, if a variable only appears as an input variable of a transition, it is called a \emph{collecting variable}. As variables are typed, an emitting variable creates a new identifier of a given type upon transition firing, whereas a collecting variable removes an identifier of that type. \begin{definition}[Variable sets, emitter and collector transitions, object types] Given a t-PNID\xspace $N=(P,T,F,\alpha,\beta)$, $t\in T$ and $\lambda \in \Lambda$, we define the following sets of variables: \begin{itemize} \item \emph{input variables} as $\smash{\invar{t} = \bigcup_{x \in \beta((p,t)), p\in\pre{t}} \rng{\supp{x}}}$; \item \emph{output variables} as $\smash{\outvar{t} = \bigcup_{x \in \beta((t,p)),p \in\post{t}} \rng{\supp{x}}}$; \item \emph{variables} as $\var{t} = \invar{t} \cup \outvar{t}$; \item \emph{emitting variables} as $\newvar{t} = \outvar{t}\setminus\invar{t}$; \item \emph{collecting variables} as $\delvar{t} = \invar{t} \setminus \outvar{t}$. \end{itemize} Using the above notions, we introduce the sets of: \begin{itemize} \item \emph{emitting transitions} as $E_N(\lambda) = \{ t \mid \exists x \in \newvar{t} \wedge \ensuremath {type}(x) = \lambda \}$; \item \emph{collecting transitions} as $C_N(\lambda) = \{ t \mid \exists x \in \delvar{t} \wedge \ensuremath {type}(x) = \lambda \}$. \end{itemize} To properly account for \emph{types of places used in $N$}, we introduce $\ensuremath {type}_P(N) = \{ \vec\lambda \mid \exists p \in P : \vec\lambda\in\alpha(p)\}$. Similarly, for objects, we introduce the set of \emph{object types in $N$} $\ensuremath {type}_\Lambda(N) = \{ \lambda \mid \lambda\in \vec\lambda, \vec\lambda\in\ensuremath {type}_P(N)\}$. \end{definition} The firing of a transition requires a \emph{binding} that valuates variables to identifiers. The binding is used to inject new fresh data into the net via variables that emit identifiers, i.e., via variables that appear only on the output arcs of that transition. We require bindings to be an injection, i.e., no two variables within a binding may refer to the same identifier. Note that in this definition, the freshness of identifiers is local to the marking, i.e., disappeared identifiers may be reused, as it does not hamper the semantics of the t-PNID\xspace. Our semantics allow the use of well-ordered sets of identifiers, such as the natural numbers, as used in~\cite{PolyvyanyyWOB19,RosaMF06} to ensure that identifiers are globally new. Here we assume local freshness over global freshness. \begin{definition}[Firing rule] Given a marked t-PNID\xspace $(N,m)$ with $N=(P,T,F,\alpha,\beta)$, a \emph{binding} for transition $t\in T$ is an injective function $\psi:\ensuremath{\mathcal{V}}\rightarrow \ensuremath{\mathcal{I}}$ such that $\ensuremath {type}(v) =\ensuremath {type}(\psi(v))$ and $\psi(v)\not\in \id{m}$ iff $v\in\newvar{t}$. Transition $t$ is \emph{enabled} in $(N,m)$ under binding $\psi$, denoted by $\enabled{(N,m)}{t,\psi}$ iff $\rho_\psi(\beta(p,t)) \leq m(p)$ for all $p\in\pre{t}$. Its firing results in marking $m'$, denoted by $\fire{(N,m)}{t,\psi}{(N, m')}$, such that $m'(p) + \rho_\psi(\beta(p,t)) = m(p) + \rho_\psi(\beta(t,p))$. \end{definition} Again, the firing rule is inductively extended to sequences $\eta\in (T\times(\ensuremath{\mathcal{V}}\rightarrow \ensuremath{\mathcal{I}}))^*$. A marking $m'$ is \emph{reachable} from $m$ if there exists $\eta\in (T\times(\ensuremath{\mathcal{V}}\rightarrow \ensuremath{\mathcal{I}}))^*$ s.t. $\fire{(N,m)}{\eta}{(N,m')}$. We denote with $\reachable{N}{m}$ the set of all markings reachable from $M$ for $(N,m)$. The execution semantics of a t-PNID\xspace is defined as an LTS that accounts for all possible executions starting from a given initial marking. \begin{definition}[Induced transition system] \label{def:induced-ts} Given a marked t-PNID\xspace $(N,m_0)$ with $N=(P,T,F,\alpha,\beta)$, its \emph{induced transition system} is $\tsys{N,m_0} = (\mathbb{M}(N),(T\times(\ensuremath{\mathcal{V}}\to\ensuremath{\mathcal{I}})),m_0, \to)$ with $m\xrightarrow{(t,\psi)} m^\prime$ iff $\fire{(N,m)}{t,\psi}{(N,m^\prime)}$. \end{definition} t-PNIDs\xspace are a vector-based extension of $\nu$-PNs. In other words, a $\nu$-PN can be translated into a strongly bisimilar t-PNID\xspace with a single type, and all place types are of length of at most $1$, which follows directly from the definition of the firing rule. \begin{corollary} \label{lemma:nupn} For any $\nu$-PN there exists a single-typed t-PNID\xspace such that the two nets are strongly rooted bisimilar. \end{corollary} As a result, the decidability of reachability for $\nu$-PNs transfers to t-PNIDs\xspace~\cite{RVFE11}. \begin{proposition}\label{prop:reachabilityundecidable} Reachability is undecidable for t-PNIDs\xspace. \end{proposition} \section{Identifier soundness} \section{Correctness Criteria for t-PNIDs\xspace} \label{sec:soundness} Many criteria have been devised for assessing the correctness of systems captured as Petri nets. Traditionally, Petri net-based criteria focus on the correctness of processes the systems can support. Enriching the formalism with ability to capture object manipulation while keeping analyzability is a delicate balancing act. For t-PNIDs\xspace, correctness criteria can be categorized as system-level and object-level. Criteria at the system-level (Section~\ref{sec:systemlevel}) focus on traditional Petri net-based criteria to assess the system as a whole, whereas criteria at the object-level (Section~\ref{sec:objectlevel}) address the correctness of individual objects represented by identifiers. \subsection{Correctness Criteria on System-Level}\label{sec:systemlevel} Liveness is an example of a system-level correctness property. It expresses that any transition is always eventually enabled again. As such, a live system guarantees that its activities cannot eventually become unavailable. \begin{definition}[Liveness] A marked t-PNID\xspace $((P, T,F,\alpha,\beta),M_0)$ is \emph{live} iff for every marking $M\in\reachable{N}{M_0}$ and every transition $t \in T$, there exists a marking $M'\in\reachable{N}{M}$ and a binding $\psi:\ensuremath{\mathcal{V}}\rightarrow \ensuremath{\mathcal{I}}$ such that $\enabled{M'}{t,\psi}$. \end{definition} Boundedness expresses that the reachability graph of a system is finite, i.e., that the system has finitely possible states and state transitions. Hence, boundedness is another example of a system-level correctness property. Many systems can support an arbitrary number of simultaneously active objects; they are unbounded by design. Similar to $\nu$-PN, we differentiate between various types of boundedness~\cite{RosaF10}. Specifically, \emph{boundedness} expresses that the number of tokens in any reachable place does not exceed a given bound. \emph{Width-boundedness} expresses that the modeled system has a bound on the number of simultaneously active objects. \begin{definition}[Bounded, width-bounded] Let $(N,m_0)$ be a marked t-PNID\xspace with $N=(P, T,F,\alpha,\beta)$. A place $p \in P$ is called: \begin{itemize} \item \emph{bounded} if there is $k \in \mathbb{N}$ such that $|m(p)| \leq k$ for all $M \in \reachable{N}{m_0}$; \item \emph{width-bounded} if there is $k \in \mathbb{N}$ such that $|\id{m}|\! \leq\! k$ for all $m \in \reachable{N}{m_0}$; \end{itemize} If all places in $(N,m_0)$ are (width-) bounded, $(N,m_0)$ is called (width-) bounded. \end{definition} As transitions $A$ and $T$ in Fig.~\ref{fig:overallModel} have no input places, these transitions are always enabled. Consequently, places \emph{product} and \emph{customer} are not bounded, and thus no place in $N_{\mathit{rs}}$ is bounded. Upon each firing of transition $A$ or $T$, a new identifier is created. Hence, these places are also not \emph{width-bounded}. In other words, the number of objects in the system represented by $N_{\mathit{rs}}$ is dynamic, without an upper bound. \subsection{Correctness Criteria on Object-Level}\label{sec:objectlevel} An object-level property assesses the correctness of individual objects. In t-PNIDs\xspace, identifiers can be seen as references to objects: if two tokens carry the same identifier, they refer to the same object. The projection of an identifier on the reachability graph of a marked t-PNID\xspace represents the life-cycle of an identifier. Boundedness of a system implies that the number of states of the reachability graph is finite. \emph{Depth-boundedness} captures this idea for identifiers: in any marking, the number of tokens that refer to a single identifier is bounded. In other words, if a marked t-PNID\xspace is depth-bounded, the complete system may still be unbounded, but the life-cycle of each identifier is finite. \begin{definition}[Depth-boundedness] Let $(N,m_0)$ be a marked t-PNID\xspace with $N=(P, T,F,\alpha,\beta)$. A place $p \in P$ is called \emph{depth-bounded} if there is $k\in\mathbb{N}$ such that $m(p)(\vec{\cname{id}}) \leq k$ for all $\vec{\cname{id}} \in \ensuremath{\mathcal{I}}^*$, $m \in \reachable{N}{m_0}$, and $\vec{\cname{id}}\in \funsym{C}(p)$ with $\cname{id}\in\vec{\cname{id}}$. If all places are depth-bounded, $(N,m_0)$ is called depth-bounded. \end{definition} Depth-boundedness is undecidable for $\nu$-PNs~\cite{RVFE11} and thus also for t-PNIDs\xspace. \begin{proposition} Depth-boundedness is undecidable for t-PNIDs\xspace. \end{proposition} The idea of depth-boundedness, is to consider a single identifier in isolation, and study its reachability graph. Intuitively, an object of a given type ``enters'' the system via an emitter that creates a unique identifier that refers to the object. The identifier remains in the system, until the object ``leaves'' the system by firing a collecting transition (that binds to the identifier and consumes the last token in the net that refers to it). In other words, if a type has emitters and collectors, it has a life-cycle, which can be represented as a process. The process of a type is the model describing all possible paths for the type. It can be derived by taking the projection of the t-PNID\xspace on all transitions and places that are ``involved'' in the type. \begin{definition}[Type projection] Let $\lambda \in \Lambda$ be a type. Given a t-PNID\xspace $N = (P_N, T_N, F_N, \alpha_N, \beta_N)$, its $\lambda$-projection $\pi_\lambda(N) = (P, T, F, W)$ is a Petri net defined by: \begin{itemize} \item $P = \{ p \in P_N \mid \lambda \in \alpha_N(p) \}$; \item $T = \{ t \in T_N \mid \exists p \in P_N : \lambda \in \ensuremath {type}_{\ensuremath{\mathcal{V}}}(\beta_N((p,t))) \vee \lambda \in \ensuremath {type}_{\ensuremath{\mathcal{V}}}(\beta_N((t,p))) \}$ \item $F = F_N \cap ((P \times T) \cup (T \times P))$; \item $W(f) = |\beta_N(f)|$ for all $f \in F$. \end{itemize} \end{definition} \begin{figure}[t] \centering \begin{subfigure}{.48\textwidth} \centering \includegraphics[scale=.66]{figures/projectionProduct.pdf} \caption{Product projection} \end{subfigure}\hfill \begin{subfigure}{.48\textwidth} \centering \includegraphics[scale=.66]{figures/projectionCustomer.pdf} \caption{Customer projection} \end{subfigure} \begin{subfigure}{\textwidth} \centering \includegraphics[scale=.66]{figures/projectionOrder.pdf} \caption{Order projection} \end{subfigure} \caption{Type projections of Fig.~\ref{fig:overallModel}. The customer projection is not sound, as place $p$ is not bounded.}\label{fig:projections} \end{figure} Figure~\ref{fig:projections} shows the three type projections of $N_{\mathit{rs}}$. As an emitter of a type creates a new identifier, and a collector removes the created identifier, each type with emitters and collectors can be represented as a transition-bordered WF-net~\cite{HeeSW13}. Instead of a source and a sink place, a transition-bordered WF-net has dedicated transitions that represent the start and finish of a process. A transition-bordered WF-net is sound, if its closure is sound~\cite{HeeSW13}. As shown in Fig.~\ref{fig:tBorderedNet}, the closure is constructed by creating a new source place $i$ so that each emitting transition consumes from $i$, and a new sink place $f$ so that each collecting transition produces in $f$. In the remainder of this section, we develop this intuition of soundness of type projections into the concept of identifier soundness of t-PNID\xspace{}s. \begin{figure}[t] \centering \begin{subfigure}{.4\textwidth} \centering \includegraphics[scale=.5]{figures/transitionBorderedNet} \caption{} \end{subfigure} \begin{subfigure}{.4\textwidth} \centering \includegraphics[scale=.5]{figures/transitionBorderedNetClosure} \caption{} \end{subfigure} \caption{A transition-bordered WF-Net (a) and its closure (b)~\cite{HeeSW13}.}\label{fig:tBorderedNet} \end{figure} Without loss of generality, given a marked t-PNID\xspace $(N,m)$, the $\lambda$-projection of its marking is the marking $\pi_\lambda^N(m)\in\mult{P}$ such that for every place $p\in\rng{\pi_\lambda^N(m)}$ it holds that $\lambda \in \alpha_(p)$. Many soundness definitions constitute of two properties: proper completion and weak termination. \emph{Proper completion} states that once a marking is reached that has a token in the final marking, it is the final marking. In other words, as soon as a token is produced in the final place, all other places should be empty. Following the idea of transition-bordered WF-nets, identifiers should have a similar property: once a collector consumes one or more identifiers, then no further tokens carrying those identifiers should persist in the marking obtained after the consumption. \begin{definition}[Proper type completion] \label{def:completion} Given a type $\lambda\in\Lambda$, a marked t-PNID\xspace $(N, m_0)$ is called \emph{properly $\lambda$-completing} iff for all $t \in C_N(\lambda)$, bindings $\psi : \ensuremath{\mathcal{V}}\to\ensuremath{\mathcal{I}}$ and markings $m, m'\in\reachable{N}{m_0}$, if $\fire{m}{t,\psi}{m'}$, then for all identifiers $\cname{id} \in \rng{\restr{\psi}{\delvar{t}}} \cap \id{m}$ and $\ensuremath {type}(\cname{id})=\lambda$, it holds that $\cname{id}\not\in\id{m'}$.\footnote{Here, we constrain $\psi$ only to objects of type $\lambda$ that are only consumed.} \end{definition} Intuitively, from the perspective of a single identifier of type $\lambda$, if a t-PNID\xspace $N$ that generated it is properly $\lambda$-completing, then the points of consumption for this identifier are mutually exclusive (that is, it can be consumed from the net only by one of the collectors from $C_N(\lambda)$). As an example, consider t-PNID\xspace $N_{\mathit{rs}}$ in Fig.~\ref{fig:overallModel}. For type $\mathit{customer}$, we have $C_{N_{\mathit{rs}}}(\mathit{customer}) = \{K, V\}$. In the current -- empty -- marking, transition $T$ is enabled with binding $\psi = \{y\mapsto \cname{o}, z\mapsto \cname{c}\}$, which results in marking $m$ with $m(\textit{customer}) = [\cname{c}]$. Next, transitions $G$, $H$, $J$, $L$ and $N$ can fire, all using the same binding, producing marking $m'$ with $m'(p) = [\cname{o},\cname{c}]$, $m'(\mathit{customer}) =[\cname{c}]$ and $m'(q) = M'(r) = [\cname{c}]$. Hence, transition $K$ is enabled with binding $\psi$. However, firing $K$ with $\psi$ results in marking $m''$ with $m''(\mathit{customer}) = [\cname{c}]$, while $\psi(z) = \cname{c}$. Hence, $N_{\mathit{rs}}$ is not properly $\mathit{customer}$-completing. \emph{Weak termination} signifies that from any reachable marking, the final marking can be reached. Translated to identifiers, removing an identifier from a marking should always eventually be possible. \begin{definition}[Weak type termination] \label{def:termination} Given a type $\lambda\in\Lambda$, a marked t-PNID\xspace $(N, m_0)$ is called \emph{weakly $\lambda$-terminating} iff for every $m \in \reachable{N}{m_0}$ and identifier $\cname{id} \in I(\lambda)$ such that $\cname{id} \in \id{m}$, there exists a marking $m' \in \reachable{N}{m}$ with $\cname{id} \not\in \id{m'}$. \end{definition} \emph{Identifier soundness} combines the properties of proper type completion and weak type termination: the former ensures that as soon a collector fires for an identifier, the identifier is removed, whereas the latter ensures that it is always eventually possible to remove that identifier. \begin{definition} \label{def:soundness} A marked t-PNID\xspace $(N,m_0)$ is \emph{$\lambda$-sound} iff it is properly $\lambda$-completing and weakly $\lambda$-terminating. It is \emph{identifier sound} iff it is $\lambda$-sound for every $\lambda\in \ensuremath {type}(N)$. \end{definition} Two interesting observations can be made about the identifier soundness property. First, identifier soundness does not imply soundness in the classical sense: any classical net $N$ without types, i.e., $\ensuremath {type}(N) = \emptyset$, is identifier sound, independently of the properties of $N$. Second, identifier soundness implies depth-boundedness. In other words, if a marked t-PNID\xspace is identifier sound for all types, it cannot accumulate infinitely many tokens carrying the same identifier. \begin{lemma}\label{lemma:depth} If a t-PNID\xspace $(N, m_0)$ is identifier sound, then it is depth-bounded. \end{lemma} \begin{proof} Suppose that $(N,m_0)$ is identifier sound, but not depth-bounded. Then, at least for one place $p\in P$ and identifier $\cname{id}\in\funsym{C} (p)$ of type $\vec\lambda$ there exists an infinite sequence of increasing markings $m_i$, all reachable in $(N,m_0)$, such that $m_i(p)(\cname{id})<m_{i+1}(p)(\cname{id})$. Assume $\lambda\in\vec\lambda$. As $(N,m_0)$ weakly $\lambda$-terminates, there exists $m' \in \reachable{N}{m}$ such that $\cname{u} \not\in \id{m'}$, where $\ensuremath {type}(\cname{u})=\lambda$. This means that the above sequence cannot exist as all constituents of $\cname{id}$ must be eventually removed. Hence, $(N,m_0)$ is depth-bounded. \end{proof} As identifier soundness relies on reachability, it is undecidable. This also naturally follows from the fact that all non-trivial decision problems are undecidable for Petri nets in which tokens carry pairs of data values (taken from unordered domains) and in which element-wise equality comparisons are allowed over such pairs in transition guards~\cite{Lasota16}. \begin{theorem} Identifier soundness is undecidable for t-PNIDs\xspace. \end{theorem} \begin{proof} Let $(N,m_0)$ be a marked t-PNID\xspace. By Definition~\ref{def:soundness}, it needs to be properly completing and weakly terminating. As the latter requires a reachability test, it is undecidable by Prop.~\ref{prop:reachabilityundecidable}. \end{proof} \begin{figure}[t] \centering \begin{subfigure}{0.4\textwidth} \includegraphics[scale=.66]{figures/SoundnessProjectionDoesNotImplyIdentifierSoundnessN1} \caption{$N_1$}\label{fig:projectionNotSufficientN1} \end{subfigure} \begin{subfigure}{0.4\textwidth} \includegraphics[scale=.66]{figures/SoundnessProjectionDoesNotImplyIdentifierSoundnessN2} \caption{$N_2$}\label{fig:projectionNotSufficientN2} \end{subfigure} \caption{Two t-PNID\xspace{}s. Net $N_1$ is identifier sound, whereas net $N_2$ is not identifier sound.}\label{fig:projectionNotSufficient} \end{figure} The underlying idea of identifier soundness is that each type projection should behave well, i.e., each type projection should be sound. Consider in t-PNID\xspace $N_{\mathit{rs}}$ of Fig~\ref{fig:overallModel}, identifier type $\mathit{customer}$. The life cycle starts with transition $T$. Transitions $K$ and~$V$ are two transitions that may remove the last reference to a $\mathit{customer}$. Soundness of a transition-bordered WF-net would require that firing transition $K$ or transition $V$ would result in the final marking. However, this is not necessarily the case. Consider the firing of transitions $T$, $G$ and $K$. Then, the token in place \emph{customer} remains, while the final transition $K$ already fired. Hence, the \emph{customer} life cycle is not sound. This raises the question whether we may conclude from this observation that $N_{\mathit{rs}}$ is not identifier sound. Unfortunately, identifier soundness is not compositional, i.e., identifier soundness does not imply soundness of the type projections, and vice versa. Consider the example t-PNID\xspace{}s in Fig.~\ref{fig:projectionNotSufficient}. The first net, $N_1$, is identifier sound. Places $p$ and $q$ ensure that transitions $B$ and $D$ are executed once. Taking the $\ensuremath {type}_{\ensuremath{\mathcal{V}}}(y)$ projection of $N_1$ results in a bordered transition WF net that is unsound: if transition $D$ fires fewer times than transition $B$, tokens will remain in place $p$. The reverse is false as well. Consider net $N_2$ in Fig.~\ref{fig:projectionNotSufficient}. Each of the two projections are sound. However, the resulting net reaches a deadlock after firing transitions $A$ and $C$: a token remains in place $p$. Hence, $N_2$ is not weakly $\ensuremath {type}_{\ensuremath{\mathcal{V}}}(x)$-completing. \begin{theorem} Let $\lambda\in \Lambda$ be a type, and let $(N, m_0)$ be a marked t-PNID\xspace. Then: \begin{enumerate} \item identifier soundness of $(N,m_0)$ does not imply soundness of $(\pi_\lambda(N),\pi_\lambda^N(m))$, and \item soundness of $(\pi_\lambda(N), \pi_\lambda^N(m))$ does not imply that $(N,m_0)$ is identifier sound. \end{enumerate} \end{theorem} Consequently, compositional verification of soundness of each of the projections is not sufficient to conclude anything about identifier soundness of the complete net, and vice versa. \subsection{Towards Verification of Logical Criteria}% \label{sec:verification} We now describe how existing results on the verification of safety and temporal properties over variants of Petri nets \cite{MontaliR16,GGMR22} and transition systems operating over relational structures \cite{CalvaneseGMP18,CalvaneseGMP22} can be lifted to the case of \emph{bounded} t-PNIDs\xspace. Boundedness is a sufficient requirement to make the verification of such properties decidable. We start by considering safety checking of t-PNIDs\xspace, considering the recent results presented in~\cite{GGMR22}. A safety property is a property that must hold globally, that is, in every marking of the net. Such a property is usually checked by formulating its unsafety dual and verifying whether a marking satisfying that unsafety property is reachable. \begin{definition}[Unsafety property] \label{def:property} An \emph{unsafety property} over a t-PNID\xspace $N$ is a formula $\exists y_1,\ldots, y_k. \psi(y_1,\ldots, y_k)$, where $\psi$ is defined as follows: \[\psi::=p(x_1\cdots x_n)\geq c\,|\,x=y\,| x\neq y\,|\,p\geq c\,|\,\psi\land\psi,\] Here: \begin{inparaenum}[\it (i)] \item $p$ is a place name from $N$, \item $x_i\in \ensuremath{\mathcal{V}}$ (for every $1\leq i\leq n$), \item $x,y\in \ensuremath{\mathcal{V}}\cup\ensuremath{\mathcal{I}}$, \item $p\geq c$ and $p(x_1\cdots x_n)\geq c$ are atomic predicates defined over place markings with $c\in\mathbb{N}$. \end{inparaenum} \end{definition} Given a marked t-PNID\xspace $(N,m_0)$, each atomic predicate is interpreted on all possible markings covering those from $\reachable{N}{m_0}$. Like that, $p\geq c$ specifies that in place $p$ there are at least $c$ tokens, whereas $p(x_1\cdots x_n)\geq c$ indicates that in place $p$ there are at least $c$ tokens carrying the identifier $x_1 \cdots x_n$. We use elements from $x_1,\ldots, x_n$ as a filter selecting matching tokens in $p$, and use the variables from the same sequence to inspect different places by creating implicit joins between tokens stored therein. As it has been established in~\cite{GGMR22}, such unsafety properties can be used for expressing object-aware \emph{coverability} properties of t-PNIDs\xspace. For example, as a property we may write that $\exists x,y. \mathit{created\_offer}(x,y)\geq 1 \land \mathit{customer}(y)\ge 1$ captures the (undesired) situation in which an offer has been made to customer $x$, but that customer is still available for receiving other offers. The verification problem for checking unsafety properties is specified as follows: given an unsafety property $\psi$, a marked t-PNID\xspace $(N,m_0)$ is \emph{unsafe} w.r.t. $\psi$ if $(N,m_0)$ can reach a marking in which $\psi$ holds. If this is not the case, then we say that $(N, m_0)$ is \emph{safe} w.r.t.~$\psi$. We show below that such verification problem is actually decidable. \begin{proposition} Verification of unsafety properties over bounded, marked t-PNIDs\xspace is decidable. \end{proposition} \begin{proof} The proof immediately follows from the decidability results for OA-nets described in~\cite{GGMR22}. \end{proof} One may wonder whether it is possible to go beyond safety and check other properties expressible on top of t-PNIDs\xspace using more sophisticated temporal logics. We answer to this question affirmatively, by proving that bounded t-PNIDs\xspace induce transitions systems that enjoy the so-called \emph{genericity} property~\cite{CalvaneseGMP18}. Such property, combined with t-PNID\xspace boundedness (which corresponds to the notion of state-boundedness used in~\cite{CalvaneseGMP18}) guarantees decidability of model checking for sophisticated variants of first-order temporal logics~\cite{HaririCGDM13,CalvaneseGMP18,CalvaneseGMP22}. In generic transition systems, the behaviour does not depend on the actual data present in the states, but only on how they relate to each other. This essentially reconstructs the well-known notion of genericity in databases, which expresses that isomorphic databases return the same answers to the same query, modulo renaming of individuals~\cite{AbiteboulHV95}. We lift the notion of genericity to the case of transition systems induced by t-PNIDs\xspace. To proceed, we first need to define a suitable notion of isomorphism between two markings of a net. \begin{definition}[Marking isomorphism] \label{def:marking-isomorphism} Given a t-PNID\xspace $N$ and two markings $m_1,m_2 \in \mathbb{M}(N)$, we say that $m_1$ and $m_2$ are \emph{isomorphic}, written $m_1\sim_h m_2$, if there exits a bijection (called \emph{isomorphism}) $h:Id(m_1)\to Id(m_2)$ such that for every $p\in P$, it holds that $(\cname{id_1}\cdots\cname{id_n})^k\in m_1$ iff $(h(\cname{id_1})\cdots h(\cname{id_n}))^k\in m_2$, for every $k \in \mathbb{N}$. \end{definition} Intuitively, two markings are called isomorphic if they have the same amount of tokens and tokens correspond to each other modulo consistent renaming of identifiers. \begin{definition}[Generic transition system] \label{def:generic-ts} Let $\tsys{} = (S,A,s_0, \to)$ be the transition system induced by some t-PNID\xspace. Then $\tsys{}$ is \emph{generic} if for every markings $m_1,m_1',m_2\in S$ and every bijection $h:\ensuremath{\mathcal{I}}\to \ensuremath{\mathcal{I}}$, if $m_1\sim_h m_2$ and $\fire{m_1}{t,\psi}{m_1'}$ (for some $t\inT$ and binding $\psi:\ensuremath{\mathcal{V}}\to\ensuremath{\mathcal{I}}$), then there exists $m_2'\in S$ and $\psi':\ensuremath{\mathcal{V}}\to\ensuremath{\mathcal{I}}$ such that $\fire{m_2}{t,\psi'}{m_2'}$, $m_1'\sim_h m_2'$ and $\psi(v)=h(\psi'(v))$, for every $v\in\ensuremath{\mathcal{V}}$. \end{definition} As one can see from the definition, genericity requires that if two marking are isomorphic, then they induce the same transitions modulo isomorphism (i.e., the transition names are the same, and the variable assignments are equivalent modulo renaming). This implies that they induce isomorphic successors. \begin{remark} Let $(N,m_0)$ be a marked t-PNID\xspace. Then its induced transition system $\tsys{N,m_0}$ is generic. \end{remark} The above result can be easily shown by considering the transition system construction descried in Definition~\ref{def:induced-ts}, by defining isomorphism between its markings by using a simple renaming function and checking the conditions of Definition~\ref{def:generic-ts}. As it has been demonstrated in \cite{CalvaneseGMP18,CalvaneseGMP22}, model checking of sophisticated first-order variants of $\mu$-calculus and LTL becomes decidable for so-called state-bounded generic transition systems. Since the transition systems induced by t-PNIDs\xspace are also generic, and boundedness of a t-PNID\xspace correspond to state-boundedness of its induced transition system, we directly obtain decidability of model checking for the same logics considered there, extended in our case over atomic predicates of the form $p\odot c$ and $p(x_1\cdots x_n)\odot c$, where $\odot\in\set{<,>,=,\leq,\geq}$, in the style of similar logics introduced in~\cite{MontaliR16}. We shall refer to such logics as $\mu\L{\text{-FO}}^{\text{PNID}}$ and $LTL\text{-}FO_p^{\text{PNID}}$, but in this work we omit their definition. \begin{theorem} \label{thm:model-checking} Model checking of $\mu\L{\text{-FO}}^{\text{PNID}}$ and $LTL\text{-}FO_p^{\text{PNID}}$ formulae is decidable for bounded, marked t-PNIDs\xspace. \end{theorem} \section{Correctness by Construction} \label{sec:soundness:by:construction} As shown in the previous section, identifier soundness is undecidable. However, we are still interested in ensuring correctness criteria over the modeled system. In this section, we propose a structural approach to taming the undecidability and study sub-classes of t-PNIDs\xspace that are identifier sound by construction. \subsection{EC-Closed Workflow Nets} \label{sec:ec-wf-closure} \begin{figure}[t] \centering \includegraphics[scale=.8]{figures/EC-closure} \caption{EC-closure of a WF-net $N$.}\label{fig:EC-closure} \end{figure} WF-nets are widely used to model business processes. The initial place of the WF-net signifies the start of a \emph{case}, the final place represents the goal state, i.e., the process case completion. A firing sequence from initial state to final state represents the activities that are performed for a single case. Thus, a WF-net describes all possible sequences of a single case. Process engines, like Yasper~\cite{HeeOPSW06} simulate the execution of multiple cases in parallel by coloring the tokens with the case identifier (a similar idea is used for resource-constrained WF-net variants of $\nu$-PNs in~\cite{MonR16}). In other words, they label each place with a case type, and inscribe each arc with a variable. To execute it, the WF-net is closed with an emitter and a collector, as shown in Figure~\ref{fig:EC-closure}. We generalize this idea to any place label, i.e., any finite sequence of types may be used to represent a case. \begin{definition}[EC-Closure] \label{def:ec-closure} Given a WF-net $N$, place type $\vec{\lambda} \in \Lambda^*$ and a variable vector $\vec{v}\in\ensuremath{\mathcal{V}}^*$ such that $\ensuremath {type}_{\ensuremath{\mathcal{V}}}(\vec{v}) = \vec{\lambda}$, its \emph{EC-closure} is a t-PNID\xspace $\mathcal{W}(N, \vec{\lambda}, \vec v) = (P_N, T_N \cup \{t_E, t_C\}, F_N \cup \{(t_E, \mathit{in}), (\mathit{out}, t_C)\}, \alpha, \beta)$, with: \begin{itemize} \item $\alpha(p) =\vec{\lambda}$ for all places $p \in P_N$; \item $\beta(f) = \vec{v}\,{}^{W(f)}$ for all flows $f \in F_N$, and $\beta((t_e,\mathit{in}))=\beta((\mathit{out}, t_c)) = [\,\vec{v}\,]$. \end{itemize} \end{definition} The EC-closure of a WF-net describes all cases that run simultaneously at any given time. In other words, any reachable marking of the EC-closure is the ``sum'' of all simultaneous cases. Lemma~\ref{lemma:weak-bisim-wrappednet} formalizes this idea by establishing weak bisimulation between the projection on a single case and the original net. \begin{lemma}[Weak bisimulation for each identifier]\label{lemma:weak-bisim-wrappednet} Let $N$ be a WF-net, $\vec\lambda \in \Lambda^*$ be a place type and $\vec{v} \in \ensuremath{\mathcal{V}}^*$ be a variable vector s.t. $\ensuremath {type}_{\ensuremath{\mathcal{V}}}(\vec{v}) = \vec\lambda$. Then, for any $\cname{id} \in \ensuremath{\mathcal{I}}^{|\vec\lambda|}$, $\rho_{r}(\Gamma_{\mathcal{W}(N,\vec\lambda,\vec{v}),\emptyset}) \approx \Gamma_{N,[\mathit{in}]}$ with $r(t,\psi) = r(t)$, if $\psi(\vec{v}) = \cname{id}$, and $r((t,\psi))=\tau$, otherwise. \end{lemma} \begin{proof} Define $R = \{(M, m) \mid \forall p \in P : M(p)(a) = m(p) \}$. We need to show that $R$ is a weak bisimulation. \noindent ($\Rightarrow$) Let $M, M'$ and $m$ be such markings that $(M,m) \in R$ and $\fire{(N,M)}{t,\psi}{(N,M')}$, with $t \in T$ and $\psi : \ensuremath{\mathcal{V}} \to \ensuremath{\mathcal{I}}$. By Definition~\ref{def:ec-closure}, $\psi(\vec{v}) = u$, for some $u\in\ensuremath{\mathcal{I}}^{|\vec\lambda|}$. From the firing rule, we obtain $M'(p) + [u^{W((p,t))}] = M(p) + [u^{W((t,p))}]$, for any $p \in P$. If $u \neq \cname {id}$, then $r(t,\psi) = \tau$, and $(M', m) \in R$. If $u = \cname {id}$, there exists such marking $m'$ that $\fire{m}{t}{m'}$ (since $m(p) = M(p)( \cname {id})$ and thus $m(p)\geq W((p,t))$) and $m'(p) + W((p,t))= M(p)( \cname {id}) + W((t,p))$. Then, by construction, $m'(p)=M'(p)(id)$ and $(M',m') \in R$. \noindent ($\Leftarrow$) By analogy with the previous argument. \end{proof} A natural consequence of this weak bisimulation result is that any EC-closure of a WF-net is identifier sound if and only if the underlying WF-net is sound. \begin{theorem} Given a WF-Net $N$, if $N$ is sound, then $\mathcal{W}(N, \vec \lambda, \vec v)$ is identifier sound and live, for any place type $\vec \lambda \in \Lambda^*$ and variable vector $\vec{v} \in \ensuremath{\mathcal{V}}^*$ with $type(\vec{v}) = \vec \lambda$. \end{theorem} \begin{proof} Let $\ensuremath{\mathcal{W}} = \mathcal{W}(N, \vec\lambda, \vec v) = (P, T, F, \alpha, \beta)$. By definition of $\mathcal{W}$, $\delvar{t} = \emptyset$ for any transition $t \in T\setminus\set{t_C}$. Hence, only transition $t_C$ can remove identifiers, and thus, by construction, $\ensuremath{\mathcal{W}}$ is properly type completing on all $\lambda \in \vec\lambda$. Next, we need to show that $\ensuremath{\mathcal{W}}$ is weakly type terminating for all types $\lambda \in \vec\lambda$. Let $M \in \reachable{\ensuremath{\mathcal{W}}}{\emptyset}$, with firing sequence $\eta \in (T \times (\ensuremath{\mathcal{V}}\to\ensuremath{\mathcal{I}}))^*$, i.e., $\fire{(\ensuremath{\mathcal{W}},\emptyset)}{\eta}{(\ensuremath{\mathcal{W}},m)}$. Let $\cname{id} \in \funsym{C}(p)$ such that $M(p)(\cname{id}) > 0$ for some $p \in P$. We then construct a sequence $\omega$ by stripping the bindings from $\eta$ s.t. it contains only transitions of $T$. Using Lemma~\ref{lemma:weak-bisim-wrappednet}, we obtain a marking $m \in \reachable{N}{[in]}$ such that $\fire{[\mathit{in}]}{\psi}{m}$ and $m(p) = M(p)(\cname{id})$. Since $N$ is sound, there exists a firing sequence $\omega'$ such that $\fire{m}{\omega'}{[\mathit{out}]}$. Again by Lemma~\ref{lemma:weak-bisim-wrappednet}, a firing sequence $\eta'$ exists such that $\fire{M}{\eta'}{M'}$ and $(M', [\mathit{out}]) \in \restr{\reachable{\ensuremath{\mathcal{W}}}{\emptyset}}{\cname{id}}$, where $\restr{\reachable{\ensuremath{\mathcal{W}}}{\emptyset}}{\cname{id}}$ is the set of all reachable markings containing $\cname{id}$. Hence, if $M'(p)(\cname{id}) > 0$, then $p = \mathit{out}$. Thus, transition $t_C$ is enabled with some binding $\psi$ such that $\psi(\vec{v}) = \cname{id}$, and a marking $M''$ exists such that $\fire{M'}{t_c,\psi}{M''}$, which removes all identifiers in $\cname{id}$ from $M'$. Hence, $\ensuremath{\mathcal{W}}$ is identifier sound. As transition $t_e$ is always enabled and $N$ is quasi live, $\mathcal{W}(N,\vec{\lambda},\vec{v})$ is live. \end{proof} \subsection{Typed Jackson Nets}\label{sec:typedJN} A well-studied class of processes that guarantee soundness are block-structured nets. Examples include Process Trees~\cite{Leemans13}, Refined Process Structure Trees~\cite{Weidlich11} and Jackson Nets~\cite{HeeHHPT09}. Each of the techniques have a set of rules in common from which a class of nets can be constructed that guarantees properties like soundness. In this section, we introduce Typed Jackson Nets (t-JNs), extending the ideas of Jackson Nets~\cite{HeeHHPT09,HeeSW13} to t-PNIDs\xspace, that guarantee both identifier soundness and liveness. The six reduction rules presented by Murata in~\cite{Murata89} form the basis of this class of nets. The rules for t-JNs are depicted in Figure~\ref{fig:constructionrulestJN}. \begin{figure}[t] \centering \begin{subfigure}{.3\textwidth} \centering \includegraphics[width=\textwidth]{figures/PlaceExpansion} \caption{Place Expansion\label{fig:placeExpansion}} \end{subfigure} \begin{subfigure}{.3\textwidth} \centering \includegraphics[width=\textwidth]{figures/TransitionExpansion} \caption{Transition Expansion\label{fig:transitionExpansion}} \end{subfigure} \begin{subfigure}{.3\textwidth} \centering \includegraphics[width=\textwidth]{figures/PlaceDuplication} \caption{Place Duplication\label{fig:placeDuplication}} \end{subfigure} \begin{subfigure}{.3\textwidth} \centering \includegraphics[width=\textwidth]{figures/TransitionDuplication} \caption{Transition Duplication\label{fig:transitionDuplication}} \end{subfigure} \begin{subfigure}{.3\textwidth} \centering \includegraphics[width=\textwidth]{figures/SelfLoopAddition} \caption{Self-loop Addition\label{fig:selfLoopAddition}} \end{subfigure} \begin{subfigure}{.3\textwidth} \centering \includegraphics[width=\textwidth]{figures/IdentifierCreation} \caption{Identifier Creation\label{fig:identifierCreation}} \end{subfigure} \caption{Construction rules of the typed Jackson Nets.}\label{fig:constructionrulestJN} \end{figure} \newcounter{tjncount} \newcommand{\ruletitle}[1]{\medskip \noindent\textbf{\fbox{Rule \addtocounter{tjncount}{1}\thetjncount:} #1}} \subsubsection{Place Expansion} The first rule is based on \emph{fusion of a series of places}. As shown in Figure~\ref{fig:placeExpansion}, a single place $p$ is replaced by two places $p_i$ and $p_f$ that are connected via transition $t$. All transitions that originally produced in $p$, produce in $p_i$ in the place expansion, and similarly, the transitions that consumed from place $p$, now consume from place $p_f$. In fact, transition $t$ can be seen as a transfer transition: it needs to move tokens from place $p_i$ to place $p_f$, before the original process can continue. This is also reflected in the labeling of the places: both places have the same place type, and the input and output arc of transition $t$ are inscribed with the same variable vector $[ \,\vec\mu\,]$ that matches the type of place $p$. \begin{definition}[Place expansion] \label{def:place-expansion} Let $(N,m)$ be a marked t-PNID\xspace with $N = (P, T, F, \alpha, \beta)$, $p \in P$ be a place and $\vec\mu \in \ensuremath{\mathcal{V}}^*$ be a variable vector s.t. $\ensuremath {type}_{\ensuremath{\mathcal{V}}}(\vec\mu) = \alpha(p)$. The \emph{place expanded t-PNID\xspace} is defined by the relation $R_{p,\vec\mu}(N,m) = ((P', T',F', \alpha',\beta'),m')$, where: \begin{itemize} \item $P' = (P \setminus \{p\}) \cup \{p_i, p_f\}$ with $p_i, p_f \not\in P$; and $T' = T \cup \{t\}$ with $t \not\in T$; \item $F' = (F \setminus ((\{p\} \times \post{p})\cup (\pre{t} \times \{p\}) ) \cup (\pre{p} \times \{p_i\}) \cup \{(p_i,t),(t,p_f)\} \cup (\{p_f\} \times \post{p})$; \item $\alpha'(q) = \alpha(p)$, if $q \in \{p_i, p_f\}$, and $\alpha'(q) = \alpha(q)$, otherwise. \item $\beta'(f) = [\vec\mu]$, if $f \in \{(p_i,t),(t,p_f)\}$, $\beta'((u,p_i))=\beta((u,p))$, if $u \in \pre{p}$, $\beta'((p_f,u))=\beta((p,u))$, if $u \in \post{p}$, and $\beta'(f) = \beta(f)$, otherwise. \item $m'(q) = m(q)$ for all $q \in P\setminus\{p\}$, $m'(p_f) = 0$, and $m'(p_i) = m(p)$. \end{itemize} \end{definition} Inscription $\vec\mu$ cannot alter the vector identifier on the tokens, as the type of $\vec\mu$ should correspond to both place types $\alpha(p)$ and $\alpha(q)$. Hence, the transition is enabled with the same bindings as any other transition that consumes a token from place $p$, modulo variable renaming. As such, transition $t$ only ``transfers'' tokens from place $p_i$ to place $p_f$. Hence, as the next lemma shows, place expansion yields a weakly bisimilar t-PNID\xspace. \begin{lemma}\label{lm:bisimplaceexpansion} Let $(N,m_0)$ be a marked t-PNID\xspace with $N = (P, T, F, \alpha, \beta)$, $p\in P$ be a place to expand and $\vec\mu \in \ensuremath{\mathcal{V}}^*$ be a variable vector. Then $\tsys{N,m_0} {\approx^{r}} \hide{\{t\}}(\tsys{R_{p,\vec\mu}(N,m_0)})$, with transition $t$ added by $R_{p,\vec\mu}$. \end{lemma} \begin{proof} Let $(N',m_0') = R_{p,\mu}(N, m_0)$. We define $Q \subseteq \mathbb{M}(N) \times \mathbb{M}(N')$ such that $(m,m') \in Q$ iff $m(q) = m'(q)$ for all places $q \in P\setminus\{p\}$ and $m'(p_i) + m'(p_f) = m(p)$. Then $(m_0,m_0') \in Q$, hence the relation is rooted. \noindent ($\Rightarrow$) Let $(m,m') \in Q$ and $\fire{(N,m)}{u,\psi}{(N,\bar{m}}$. We need to show that there exists marking $\bar{M}'$ such that $\smash{m' \xdasharrow{~(u,\psi)~} \bar{m}'}$ and $(\bar{m},\bar{m}') \in Q$. Suppose $p \not\in\pre{u}$. Then $m'(q) = m(q)$ and $m(q)\geq \rho_\psi(\beta((p,u)))$ (note that $\rho_\psi(\beta((p,u))) = \rho_\psi(\beta'((p,u)))$). By the firing rule, a marking $\bar{m}'$ exists with $\fire{(N,m')}{u,\psi}{(N',\bar{m}')}$, $\bar{m}(q) = \bar{m}'(q)$ for all $q \in P'$. Thus, $(\bar{m},\bar{m}')\in Q$. Suppose $p \in\pre{u}$. Then $\rho_{\psi}(\beta((p_f,u))) \leq m(p) = m'(p_i) + m'(p_f)$. If $\rho_\psi(\beta(p_f, u))) \leq m'(p_f)$, then transition $u$ is enabled, and a marking $\bar{m}'$ exists with $\fire{(N,m')}{u,\psi}{(N,\bar{M}')}$ and $(m',\bar{m}') \in Q$. Otherwise, $\rho_\psi(\beta(p_f, u))) \leq m'(p_i)$. Construct a binding $\psi'$ by letting $\psi'(\mu(i)) = \psi(\beta(p,u)(i))$, for all $1 \leq i \leq |\mu|$. Then, $\rho_{\psi'}(\mu) = \rho_{\psi}(\beta(p,u))$, and transition $t$ is enabled with binding $\psi'$. Hence, a marking $m''$ exists with $\fire{(N,m')}{t,\psi'}{(N,m'')}$ and $\rho_{\psi}(\beta((p',u))) \leq m''(p')$. Then $(m,m'') \in Q$ and $t$ is labeled $\tau$ in $\hide{\{t\}}(R_{(p,\vec\mu)}(N))$, and the first case applies on $m''$. In all cases, $\smash{m' \xdasharrow{~(t,\psi)~} \bar{m}'}$ and $(m', \bar{m}') \in Q$. \noindent ($\Leftarrow$) By analogy with the previous argument. \end{proof} \subsubsection{Transition Expansion} The second rule is transition expansion, which corresponds to Murata's \emph{fusion of series transitions}. As shown in Fig.~\ref{fig:transitionExpansion}, transition $t$ is divided into two transitions, $t_e$ that consumes the tokens, and a second transition $t_c$ that produces the tokens. The two transitions are connected with a single, fresh place $p$. Place $p$ should ensure that all variables consumed by the original transition $t$, are passed to transition $t_c$, to ensure that the $t_c$ can produce the same tokens as transition $t$ in the original net. In other words, the type of each input place of $t$ is included in the type of the newly added place $p$. Transition $t_e$ is allowed to emit new identifiers, as long as these are not already produced by $t_c$. \begin{definition}[Transition expansion] Let $(N,m)$ be a marked t-PNID\xspace with $N = (P, T, F, \alpha, \beta)$, let $t \in T$, and let $\vec{\lambda} \subseteq \Lambda^*$ and $\vec{\mu} \in (\ensuremath{\mathcal{V}}\setminus \newvar{t})^*$ such that $\ensuremath {type}_\ensuremath{\mathcal{V}}(x) \in \vec\lambda$ and $x\in\vec{\mu}$, for all $x\in \invar{t}$, and $\ensuremath {type}_{\ensuremath{\mathcal{V}}}(\vec{\mu}) = \vec{\lambda}$. The \emph{transition expanded t-PNID\xspace} is defined by $R_{t,\vec{\lambda},\vec{\mu}}(N,m) = ((P', T',F', \alpha',\beta'),m)$, where: \begin{itemize} \item $P' = P \cup \{p\}$ with $p \not\in P$; and $T' = (T \setminus \{t\}) \cup \{t_e, t_c\}$ with $t_e, t_c \not\in T$; \item $F' = (F \setminus ((\pre{t} \times \{t\}) \cup (\{t\}\times\post{t}) )) \cup (\pre{t} \times \{t_e\}) \cup \{(t_e,p),(p,t_c)\} \cup (\{t_c\} \times \post{t})$; \item $\alpha'(p) = \vec{\lambda}$ and $\alpha'(q) = \alpha(q)$ for all $q \in P$; \item $\beta'(f) = [\,\vec{\mu}\,]$ if $f \in \{(t_e,p),(p,t_c)\}$, $\beta'((q,t_e))=\beta((q,t))$ for $q \in \pre{t}$, $\beta'((t_c,q))=\beta((t,q))$ for $q \in \post{t}$, and $ \beta'(f) = \beta(f)$ otherwise. \end{itemize} \end{definition} Transition $t_e$ is allowed to introduce new variables, but key is that inscription $\vec{\mu}$ contains all input variables of transition $t$. Consequently, $\vec{\mu}$ encodes the binding of transition $t$. We use this to prove weak bisimulation between a t-PNID\xspace and it transition expanded net. The idea behind the simulation relation $Q$ is that the firing of $t_e$ is postponed until $t_c$ fires. In other words, $Q$ encodes that tokens remain in place $q$ until transition $t_c$ fires. \begin{lemma}\label{lm:bisimtransexpansion} Given marked t-PNID\xspace $(N,m_0)$ with $N = (P, T, F, \alpha, \beta)$, transition $t\in T$, $\lambda\in\Lambda^*$ and $\mu \in \ensuremath{\mathcal{V}}^*$. Let $t_e, t_c$ be the transitions added by the expansion.\\ Then $\tsys{N,m_0} \approx^{r} \rho_{r}(\tsys{R_{t,\lambda,\mu}(N,m_0)})$ with $r = \{(t_e, \tau), (t_c,t) \}$. \end{lemma} \begin{proof} Let $(N',m_0') = R_{t,\lambda,\mu}(N,m_0)$. Then $m_0' = m_0$. Define relation $Q \subseteq \mathbb{M}(N) \times \mathbb{M}(N')$ such that $(m,m') \in Q$ iff $m(q) = m'(q)$ for all places $q \in P\setminus \pre{t}$ and $m(q) = m'(q) + \sum_{b \in \supp{M'(p)}} M'(p)(b)\cdot \rho_{\mu(b)}\beta((q,t))$, where $\mu(b)$ is a shorthand for the binding $\psi : \ensuremath{\mathcal{V}}\to\ensuremath{\mathcal{I}}$ with $\psi(x) = b(i)$ iff $\mu(i) = x$ for all $1 \leq i \leq |\mu|$. Then $(m_0,m_0') \in Q$. \noindent ($\Rightarrow$) Follows directly from the firing rule, and the construction of $\mu$. \noindent($\Leftarrow$) Let $(m,m') \in Q$ and $\fire{(N',m'}{u,\psi}{(N',\bar{M}')}$. We need to show a marking $\bar{m}$ exists such that $m \xdasharrow{~(t,\psi)~} \bar{m}$ and $(\bar{m},\bar{m}') \in Q$. If $t_e \neq u \neq t_c$, the statement holds by definition of the firing rule. Suppose $u = t_e$, i.e., $r(u) = \tau$. Hence, we need to show that $(m, \bar{m}') \in Q$. Let $q \in \pre{t}$. Since $(m,m') \in Q$, we have $m(q) = m'(q) + \sum_{b \in \supp{M'(p)}} M'(p)(b)\cdot \rho_{\mu(b)}\beta((q,t))$. By the firing rule, we have $\bar{m}'(p) = m'(p) + [\rho_\psi(\mu)]$ and $m'(q) = \bar{m}'(q) + \rho_{\psi}(\beta((q,t)))$. By construction, $\rho_{\psi}$ and $\rho_{\mu([\rho_\psi(\mu)])}$ are identical functions. Rewriting gives $m(q) = \bar{m}'(q) + \sum_{b \in \supp{\bar{m}'(p)}} m'(p)(b)\cdot \rho_{\mu(b)}\beta((q,t))$, and thus $(m,\bar{m}') \in Q$. Suppose $u = t_c$, i.e., $r(u) = t$ and $[\rho_\psi(\mu)]\leq M'(p)$. Let $q \in \pre{t}$. Then $m(q) = m'(q) + \sum_{b \in \supp{m'(p)}} m'(p)(b)\cdot \rho_{\mu(b)}\beta((q,t))$. Since $\bar{m}'(p) + [\rho_{\psi}(\mu)] = m'(p)$ and $\rho_{\psi}(\beta((q,u))) = \rho_{\mu([\rho_\psi(\mu)])}(\beta((q,u)))$, we obtain $m(q) = m'(q) + \left(\sum_{b \in \supp{\bar{m}'(p)}} \bar{m}'(p)(b)\cdot \rho_{\mu(b)}\beta((q,t))\right) + \rho_{\psi}\beta((q,t))$. Hence, a marking $\bar{m}$ exists such that $\fire{(N,m)}{t,\psi}{(N,\bar{m})}$ and $(\bar{m},\bar{m}') \in Q$. \end{proof} \subsubsection{Place Duplication} Whereas the previous two rules introduced ways to extend sequences, the third rule introduces parallelism by duplicating a place, as shown in Figure~\ref{fig:placeDuplication}. It is based on the \emph{fusion of parallel transitions} reduction rule of Murata. For t-PNIDs\xspace, duplicating a place has an additional advantage: as all information required for passing the identifiers is already guaranteed, the duplicated place can have any place type. Transition $t$ can emit new identifiers, provided that transition $u$ does not already emit these. \begin{definition}[Duplicate place] Let $(N,m)$ be a marked t-PNID\xspace with $N = (P, T, F, \alpha, \beta)$, let $p \in P$, such that $m(p) = \emptyset$, and some transitions $t, u\in T$ exist with $\pre{p} =\{t\}$ and $\post{p} = \{u\}$. Let $\vec{\lambda} \in \Lambda^*$ and $\vec{\mu} \in (\ensuremath{\mathcal{V}}\setminus \newvar{u})^*$ such that $\ensuremath {type}_\ensuremath{\mathcal{V}}(\mu) = \lambda$. % Its \emph{duplicated place t-PNID\xspace} is defined by $D_{p,\lambda,\mu}(N,m) = ((P', T,F', \alpha',\beta'),m)$, where: \begin{itemize} \item $P' = P \cup \{ q \}$, with $q\not\in P$, and $F' = F \cup \{ (t, q), (q, u) \}$; \item $\alpha' = \alpha\cup \{ q \mapsto \lambda \}$ and $\beta' = \beta \cup \{ (t,q) \mapsto [\mu], (q,u) \mapsto [\mu] \}$. \end{itemize} \end{definition} As the duplicated place cannot hamper the firing of any transition, all behavior is preserved by a strong bisimulation on the identity mapping. \begin{lemma}\label{lm:bisimplaceduplication} Given a marked t-PNID\xspace $(N,m_0)$ with $N = (P, T, F, \alpha, \beta)$, place $p\in P$, $\lambda\in\Lambda^*$ and $\mu \in \ensuremath{\mathcal{V}}^*$. Then $\tsys{N,m_0} \sim^r \tsys{D_{p,\lambda,\mu}(N,m_0)}$. \end{lemma} \begin{proof} Let $(N',m'_0) = D_{p,\lambda,\mu}(N,m_0)$. Define relation $Q \subseteq \mathbb{M}(N) \times \mathbb{M}(N')$ such that $(m, m') \in Q$ iff $m(p) = m'(p)$ for all places $p \in P$. The bisimulation relation trivially follows from the firing rule. \end{proof} \subsubsection{Transition Duplication} As already recognized by Berthelot~\cite{Berthelot78}, if two transitions have an identical preset and postset, one of these transitions can be removed while preserving liveness and boundedness. Murata's fusion of parallel places is a special case of this rule, requiring that the preset and postset are singletons. For t-JNs, this results in the duplicate transition rule: any transition may be duplicated, as shown in Figure~\ref{fig:transitionDuplication}. As duplication should not hamper the behavior of the original net, we require that the inscriptions of the duplicated transition are identical to the original transition. \begin{definition}[Duplicate place] Let $(N,m)$ be a marked t-PNID\xspace with $N = (P, T, F, \alpha, \beta)$, and let $t \in T$ such that some places $p, q\in P$ exist with $\pre{t} =\{p\}$ and $\post{t} = \{q\}$. % Its \emph{duplicated transition t-PNID\xspace} is defined by $D_{t}(N,m) = ((P, T',F', \alpha,\beta'),M)$, where: \begin{itemize} \item $T' = T \cup \{u \}$, with $t'\not\in T$, and $F' = F \cup \{ (p, u), (u, q) \}$; \item $\beta'((p,u)) = \beta((p,t))$, $\beta((u,q)) = \beta((t,q))$ and $\beta'(f) = \beta(f)$ for all $f\in F$. \end{itemize} \end{definition} As the above rule only duplicates $t\inT$, the identity relation on markings is a strong rooted bisimulation. The proof is straightforward from the definition. \begin{lemma}\label{lm:bisimtransduplication} Given a marked t-PNID\xspace $(N,m_0)$ with $N = (P, T, F, \alpha, \beta)$, and transition $t\inT$. Then $\tsys{N,m_0} \sim^r \rho_{\{(u,t)\}}(\tsys{D_{t}(N,m_0)})$. \end{lemma} \begin{proof} Let $(N',m'_0) = D_{t}(N,m_0)$. Define relation $Q \subseteq \mathbb{M}(N) \times \mathbb{M}(N')$ such that $(m, m') \in Q$ iff $m(p) = m'(p)$ for all places $p \in P$. The bisimulation relation trivially follows from the firing rule. \end{proof} \subsubsection{Adding Identity Transitions} In \cite{Berthelot78}, Berthelot classified a transition $t$ with an identical preset and postset, i.e., $\pre{t} = \post{t}$ as irrelevant, as its firing does not change the marking. The reduction rule \emph{elimination of self-loop transitions} is a special case, as Murata required these sets to be singletons. For t-JNs, adding a self-loop transition is the fifth rule, as shown in Figure~\ref{fig:selfLoopAddition}. \begin{definition}[Self-loop addition] Let $(N,m)$ be a marked t-PNID\xspace with $N = (P, T, F, \alpha, \beta)$, and let $p \in P$. % Its \emph{Self-loop Added t-PNID\xspace} is defined by $A_{p}(N,m) = ((P, T',F', \alpha,\beta'), m)$, where: \begin{itemize} \item $T' = T \cup \{ t \}$, with $t\not\in T$, and $F' = F \cup \{ (p, t), (t, p) \}$; \item $\beta'((p,t')) = \beta'((p,t')) = [\,\vec\mu\,]$ with $\vec\mu \in \ensuremath{\mathcal{V}}^*$ such that $\ensuremath {type}_\ensuremath{\mathcal{V}}(\mu) = \alpha(p)$, and $\beta'(f) = \beta(f)$ otherwise. \end{itemize} \end{definition} Similar to the duplicate transition rule, the self-loop addition rule does not introduce new behavior, except for silent self-loops. Hence, the identity relation on markings is a weak rooted bisimulation. \begin{lemma}\label{lm:selflooptrans} Given a marked t-PNID\xspace $(N,m_0)$ with $N = (P, T, F, \alpha, \beta)$, and place $p\inP$. Then $\tsys{N,m_0} \approx^r \hide{\{t\}}(\tsys{A_{p}(N,m_0)})$ with $t$ the added self-loop transition. \end{lemma} \begin{proof} Let $(N',m'_0) = A_{p}(N,m_0)$. Define relation $Q \subseteq \mathbb{M}(N) \times \mathbb{M}(N')$ such that $(M, m') \in Q$ iff $m(p) = m'(p)$ for all places $p \in P$. The bisimulation relation trivially follows from the firing rule. \end{proof} \subsubsection{Identifier Introduction} The first five rules preserve the criteria of block-structured WF-nets. Murata's \emph{elimination of self-loop places} states that adding or removing a marked place with identical preset and postset does preserve liveness and boundedness. This rule is often used to introduce a fixed resource to a net, i.e., the number of resources is determined in the initial marking. Instead, identifier introduction adds dynamic resources, as shown in Figure~\ref{fig:identifierCreation}: transition $t_e$ emits new identifiers as its inscription uses only ``new'' variables (i.e., those that have not been used in the net), and place $p$ works like a storage of the available resources, which can be removed by firing transition $t_c$. \begin{definition}[Identifier Introduction] Let $(N,m)$ be a marked t-PNID\xspace with $N = (P, T, F, \alpha, \beta)$, let $t \in T$, let $\vec\lambda \in (\Lambda\setminus \ensuremath {type}_P(N))^*$ and $\vec\mu \in \ensuremath{\mathcal{V}}^*$ such that $\ensuremath {type}_{\ensuremath{\mathcal{V}}}(\vec\mu) = \vec\lambda$. % The \emph{Identifier introducing t-PNID\xspace} is defined by $A_{t,\vec\lambda,\vec\mu}(N,m) = ((P', T',F', \alpha',\beta'), m)$, where: \begin{itemize} \item $P' = P' \cup \{ p \}$ and $T' = T \cup \{ t_e, t_c \}$, for $p \not\in P$ and $t_e, t_c \not\in T$, and $F' = F \cup \{ (p, t), (t, p), (t_e,p), (p, t_c) \}$; \item $\alpha' = \alpha \cup \{ p \mapsto \vec\lambda \}$ and $\beta' = \beta \cup \{ (p,t) \mapsto [\vec\mu], (t,p) \mapsto [\vec\mu], (t_e, p) \mapsto [\vec\mu], (p, t_c) \mapsto [\vec\mu] \}$; \end{itemize} \end{definition} \begin{lemma}\label{lm:selfloopplace} Given a marked t-PNID\xspace $(N,m_0)$ with $N = (P, T, F, \alpha, \beta)$, transition $t\inT$, $\vec\lambda \in \Lambda^*$ and $\vec\mu \in (\ensuremath{\mathcal{V}} \setminus \var{t})^*$. Then $\tsys{N,m_0} \approx^r \hide{\{t_e,t_c\}}(\tsys{A_{(p)}(N,m_0)})$ with $t_e, t_c$ the added transitions. \end{lemma} \begin{proof} Let $N' = (P',T',F',\alpha',\beta')$. Define $Q \subseteq \mathbb{M}(N) \times \mathbb{M}(N')$ such that $(m,m') \in Q$ iff $m(q) = m'(q)$ for all $q \in P$. \noindent($\Rightarrow$) Suppose $\fire{(N,m)}{u,\psi}{(N,\bar{m}')}$. If $t \neq u$, the statement directly follows from the firing rule. If $t = u$, then a marking $m''$ and binding $\psi'$ exists such that $\fire{(N',m')}{t_e,\psi'}{(N,m'')}$. Then $m'(p) > \emptyset$, $(m,m'')\in Q$, and $\enabled{(N',m'')}{t,\psi}$. Hence, markings $\bar{m}''$ and $\bar{m}'$ exist such that $\enabled{(N',m'')}{t,\psi}\fire{(N',\bar{m}'')}{t_c,\psi'}{(N,\bar{m}')}$, and $(m',\bar{m}''), (m',\bar{m}') \in Q$. \noindent($\Leftarrow$) Follows directly from the firing rule. \end{proof} As shown in~\cite{RVFE11}, unbounded places are width-bounded, i.e., can contain an infinite number of identifiers, or depth-bounded, i.e., for each identifier, the number of tokens carrying that identifier is bounded, or both. The place added by the identifier creation rule is by definition width-unbounded, as it has an empty preset. However, it is identifier sound, and thus depth-bounded, as shown in the next lemma. \begin{lemma}\label{lm:identplaceidentsound} Given a marked t-PNID\xspace $(N,m)$ with $N = (P,T,F,\alpha,\beta)$. Then $A_{t,\vec\lambda,\vec\mu}(N,M)$ is identifier sound iff $(N,m)$ is identifier sound. \end{lemma} \begin{proof} Let $(N',m') = A_{t,\vec\lambda,\vec\mu}(N,m)$, and let $p \in P'\setminus P$. Let $\vec\lambda \in \ensuremath {type}(N')$. If $\vec\lambda \in \ensuremath {type}_P(N)$, it is $\vec\lambda$-sound by Lemma~\ref{lm:selfloopplace}. Suppose $\vec\lambda \not\in\ensuremath {type}(N)$. Then $E_{N'}(\lambda) = \{t_e\}$ and $C_{N'}(\lambda) = \{t_c\}$. Let $\cname{a} \in \id{M}$ such that $\ensuremath {type}(\cname{a}) = \vec\lambda$. Then an $\vec{id} \in \funsym{C}(p)$ exists with $\cname{a} \in \vec{id}$ and $M(p)(\vec{id}) = 1$. Hence, a binding $\psi$ exists such that $\psi(\vec\mu) = \vec{id}$, and transition $t_c$ is enabled with $\psi$. Let $M'$ be a marking such that $\fire{(N,m)}{t_c,\psi}{(N,m')}$. Then $\cname{a} \not\in\id{M'}$, which proves the statement. \end{proof} \subsubsection{Soundness for Typed Jackson Nets} Any net that can be reduced to a net with a single transition using these rules is called a typed Jackson Net (t-JN). \begin{definition} The class of \emph{typed Jackson Nets} $\mathcal{T}$ is inductively defined by: \begin{itemize} \item $((\emptyset,\{t\},\emptyset,\emptyset,\emptyset),\emptyset) \in \mathcal{T}$; \item if $(N,M) \in \mathcal{T}$, then $R_{p,\vec\mu}(N,M) \in \mathcal{T}$; \item if $(N,M) \in \mathcal{T}$, then $R_{t,\vec\lambda,\vec\mu}(N,M) \in \mathcal{T}$; \item if $(N,M) \in \mathcal{T}$, then $D_{p,\vec\lambda,\vec\mu}(N,M_0) \in \mathcal{T}$; \item if $(N,M) \in \mathcal{T}$, then $D_{t}(N,M) \in \mathcal{T}$; \item if $(N,M) \in \mathcal{T}$, then $A_{p}(N,M) \in \mathcal{T}$; \item if $(N,M) \in \mathcal{T}$, then $A_{t,\vec\lambda,\vec\mu}(N,M) \in \mathcal{T}$. \end{itemize} \end{definition} As any t-JN reduces to a single transition, and each construction rule goes hand in hand with a bisimulation relation, any liveness property is preserved. Consequently, any t-JN is identifier sound and live. \begin{theorem}\label{thm:tJNisSound} Any typed Jackson Net is identifier sound and live. \end{theorem} \begin{proof} We prove the statement by induction on the structure of t-JNs. The statement holds trivially for the initial net, $((\emptyset,\{t\},\emptyset,\emptyset,\emptyset),\emptyset)$. Suppose $(N,M) \in \mathcal{T}$. Then for each of the rules, the statement follows directly from the respective bisimulation relations of Lemma~\ref{lm:bisimplaceexpansion}~--~\ref{lm:selfloopplace}, and the result of Lemma~\ref{lm:identplaceidentsound}. \end{proof} \begin{figure}[t] \centering \includegraphics[scale=.8]{figures/overallModelRepaired} \caption{The example of the retailer shop as a typed Jackson Net.}\label{fig:overallModelRepaired} \end{figure} To solve the problem of the running example, several solutions exist. One solution is shown in Figure~\ref{fig:overallModelRepaired}. In this example, the net is a t-JN: starting from transition $G$, a self loop is added (transition $G$). The transition is then expanded with transition $Z$. Place $p$ is then duplicated to create the subnet $R$. In this way, subnet $R$ only knows of type $\mathit{offer}$, as the connection with $\mathit{customer}$ is stored in place $p$. Consequently, the net is identifier sound, and live. \subsection{Workflow Refinement} A well-known refinement rule is workflow refinement~\cite{HeeSV03}. In a WF-net, any place may be refined with a generalized sound WF-net. If the original net is sound, then the refined net is sound as well. In this section, we present a similar refinement rule. Given a t-PNID\xspace, any place may be refined by a generalized sound WF-net. In the refinement, each place is labeled with the place type of the refined place, and all arcs in the WF-net are inscribed with the same variable vector. \begin{definition}[Workflow refinement] Let $L = (P_L,T_L,F_L,\alpha_L,\beta_L)$, be a t-PNID\xspace, $p \in P_L$ a place, and $N = (P_N, T_N,F_N, W_N,\mathit{in}, \mathit{out})$ be a WF-net. \emph{Workflow refinement} is defined by $L \oplus_{p} N = (P,T,F,\alpha,\beta)$, where: \begin{compactitem} \item $P = (P_L \setminus \{p\}) \cup P_N$ and $T = T_L \cup T_N$; \item $F = (F_N \cap ( ( P \times T ) \cup ( T \times P ) )) \cup F_L \cup \{(t,\mathit{in})\mid t \in \pre{p} \} \cup \{(\mathit{out}, t) \mid t\in\post{p}\}$; \item $\alpha(q) = \alpha_N(q)$ for $q \in P_L\setminus\{p\}$, and $\alpha(q) = \alpha(p)$ for $q \in P_N$; \item $\beta(f) = \beta_L(f)$ for $f\in F_L$, $\beta(f) = [\vec\mu]^{(W(f))}$for $f \in F_N$ and $\ensuremath {type}_\ensuremath{\mathcal{V}}(\vec\mu)=\alpha(p)$, $\beta((t,\mathit{in})) = \beta((t,p))$ for $t \in \pre{t}$ and $\beta((\mathit{out},t)) = \beta((p,t))$ for $t \in \post{t}$. \end{compactitem} \end{definition} Generalized soundness of a WF-Net ensures that any number of tokens in the initial place are ``transferred'' to the final place. As shown in Section~\ref{sec:ec-wf-closure}, the EC-closure of a sound WF-net is identifier sound and live. A similar approach is taken to show that the refinement is weakly bisimilar to the original net. Analogously to~\cite{HeeSV03}, the bisimulation relation is the identity relation, except for place $p$. The relation maps all possible token configurations of place $p$ to any reachable marking in the WF-net, given $p$'s token configuration. \begin{lemma} Let $L = (P_L,T_L,F_L,\alpha_L,\beta_L)$ be a t-PNID\xspace with initial marking $m_0$, let $p \in P_L$ be a place s.t. $m_0(p)=\emptyset$, and let $N = (P_N, T_N,F_N, W_N,\mathit{in}_N, \mathit{out}_N)$ be a WF-net. If $N$ is generalized sound, then $\tsys{L,m_0} \approx^{r} \hide{T_N}(\tsys{L\oplus_p N,m_0})$. \end{lemma} \begin{proof} For simplicity, we start by defining a type extension of $N$ as a t-PNID\xspace $N'= (P_N, T_N, F_N, \alpha, \beta)$, where $\ensuremath {type}(\vec{v})=\vec\lambda$, $\alpha(p) =\vec{\lambda}$ for all places $p \in P_N$, and $\beta(f) = \vec{v}^{W(f)}$ for all $f \in F_N$, and $\beta((t_e,\mathit{in}))=\beta((\mathit{out}, t_c)) = [\vec{v}]$. To prove bisimilarity, we define $R = \set{ (M, M'+m) \mid M \in \reachable{L}{M_0}, M'\in\ensuremath{\mathcal{A}}, m\in\ensuremath{\mathcal{B}}}$ where $\ensuremath{\mathcal{A}}=\set{M' \mid M',M\in\reachable{L}{M_0}, M'(p)=\emptyset,\forall q\in P_L\setminus\set{p}: M'(q)=M(q) }$ and $\ensuremath{\mathcal{B}}=\set{m\mid m\in\reachable{N'}{[\mathit{in}]},[\mathit{in}]=M(p), \forall M\in\reachable{L}{M_0}}$. \noindent($\Rightarrow$) Let $(M,M'+m)\in R$ and $\fire{M}{t,\psi}{\bar M}$. We need to show that exists $\bar{M}'$ and $\bar{m}$ s.t. $(M'+m) \xdasharrow{~(t,\psi)~} (\bar{M}'+\bar{m})$ and $(\bar{M},\bar{M}'+\bar{m})\in R$. If $t\not\in\pre{p}$ (or $p\not\in\pre{t}$), then $M'(q)=M(q)$ for all $q\in P_L\setminus{p}$. Thus $t$ is also enabled in $M'(q)$ and $M(q)\geq \beta((q,t))$. Then by the firing rule there exists $\bar{M}'$ s.t. $\fire{(M'+m)}{t,\psi}{(\bar{M}'+m)}$ and $\bar{M}(q)=\bar{M}'(q)$ for all $q\inP_L$. Thus, $(M',\bar{M}'+m)\in R$. If $t\in\pre{p}$, then, by construction, $M'(q)=M(q)$ for all $q\in P_L\setminus{p}$. Thus, using the same reasoning as above, $\fire{(M'+m)}{t,\psi}{(\bar{M}'+\bar{m})}$ for all $q\inP_L\setminus{p}$ and $\bar{m}(in)=M'(p)$. Thus, $(M',\bar{M}'+\bar{m})\in R$. Now, assume that $p\in \pre t$ and $\rho_\psi(\beta((p,t)))=\cname{id}$. Given that $N$ is generalized sound and by applying Lemma~\ref{lemma:weak-bisim-wrappednet}, there exists a firing sequence $\eta$ for $N'$ that carries identifier $\cname{id}$ to $\mathit{out}$. This means that, by construction, $M'(q)=M(q)$, for all $q\inP_L$, and $m(\mathit{out})(\cname{id})=M(p)(\cname{id})$. Hence, $t$ is enabled in $(M'+m)$ under binding $\psi'$ that differs from $\psi$ everywhere but on place $\mathit{out}$. By the firing rule, there exists $(\bar{M}'+\bar{m})$ s.t. $\fire{(M'+m)}{t,\psi'}{(\bar{M}'+\bar{m})}$ and $(M,(\bar{M}'+\bar{m}))\in R$. \noindent($\Leftarrow$) By analogy with the previous argument. \end{proof} As a consequence of the bisimulation relation, the refinement is identifier sound and live if the original net is identifier sound. \begin{theorem} Let $(L,M)$ be a marked t-PNID\xspace and $N$ be a generalized sound WF net. Then $(L, M)$ is identifier sound and live iff $(L\oplus N, M)$ is identifier sound and live. \end{theorem} The refinement rule allows to combine the approaches discussed in this section. For example, a designer can first design a net using the construction rules of Section~\ref{sec:typedJN}, and then design generalized WF-nets for specific places. In this way, the construction rules and refinement rules ensure that the designer can model systems where data and processes are in resonance. \section{Enriching PNIDs with Resources} \label{sec:soundness:with:resources} In the previous section we discussed pattern-based correctness criteria, which allow to construct PNID models that are sound by design. We now consider arbitrary PNIDs, and study how they can be enriched with \emph{resources}, introducing a dedicated property, called \emph{conservative resource management}, which captures that the net suitably employs resources. Following a similar approach, in spirit, to that of Section~\ref{sec:soundness:by:construction}, we define a modelling guideline, called \emph{resource closure}, which takes as input a PNID and indicates how to enrich it with resources through a well-principled approach. We then show that, by construction, if the input PNID is sound, then all its possible resource closures do not only maintain soundness, but they also guarantee that resources are conservatively managed. In addition, we prove that such resource closures are also bounded, and discuss the implications on the analysis of this class of PNIDs. \subsection{Resource-Aware PNIDs} As customary for Petri nets, we model resource types as (special) places. However, differently from typical approaches like \cite{HSV06,LoBJ22,MontaliR16}, where resources are represented as indistinguishable (black) tokens populating such places, we assign identifiers to resources. This allows one to explicitly track how resources participate to the execution, and in particular how they relate to the different objects. At the same time, this poses a conceptual question: are different copies of the same identifier in distinct tokens representing different actual resources, or distinct references to the same resource? We opt for the latter approach, as it is the one that fully complies with this \emph{named approach} to resource management. As a consequence of this choice, we blur in the section the distinction between resource and resource identifier, using the two terms interchangeably. Technically, from now on we assume that $\Lambda$ is partitioned into two sets: $\obj{\Lambda}$ for object types, and $\res{\Lambda}$ for resource types. Given a resource type $\eta \in \res{\Lambda}$, we call its identifiers \emph{($\eta$-)resources}. We then simply define a \emph{resource-aware} t-PNID\xspace as a t-PNID\xspace with some distinguished places, each being of a certain resource type. \begin{definition}[Resource-aware t-PNID\xspace] A t-PNID\xspace $N=(P,T,F,\alpha,\beta)$ is \emph{resource-aware} if there exists at least one place $p \in P$ such that $\alpha(p) \in \res{\Lambda}$. We call the non-empty subset $\res{P} = \set{p \in P \mid \alpha(p) \in \res{\Lambda}}$ of $P$ as the set of \emph{resource places} of $N$. \end{definition} The initial marking of a resource-aware t-PNID\xspace hence identifies which resources are available per resource type. Consistently with the named approach to resources, every resource should be present at most once in the initial marking. Places typed by the combination of one or more object types and one resource type are used to establish relations between (tuples of) objects and corresponding resources, which we can interpret as \emph{resource assignments}. For example, given an object type $\mathit{Order}$ and a resource type $\mathit{Clerk}$, a token carrying pair $\tup{o,c}$ with $o \in \mathit{Order}$ and $c \in \mathit{Clerk}$ represents that order $o$ is assigned to clerk $c$. In an unrestricted t-PNID\xspace, resources and resource assignments can be freely manipulated, generating new resources along the execution, assigning the same resource to multiple objects, and establishing arbitrary relations between resources and objects/other resources. To determine whether a t-PNID\xspace employs resources property, we hence introduce a dedicated property that, intuitively, combines two requirements: \begin{compactitem} \item \emph{Resource preservation} - only resources present in the initial marking can be used throughout the execution; \item \emph{Resource exclusive assignment} - in a given marking, each resource can be assigned to at most an object/tuple of objects. \end{compactitem} The first requirement dictates that no resource can be newly generated during the execution; the second one stipulates that at every step, a resource can be responsible for at most one object or combination of objects, possibly being present in multiple tokens that all carry the same assignment. We formalize these two requirements as follows. \begin{definition}[Conservative resource management] \label{def:conservative-resource-management} A resource-aware marked t-PNID\xspace $(N,m_0)$ with $N=(P,T,F,\alpha,\beta)$ is \emph{managing resources conservatively} if the following two conditions hold. \begin{compactitem} \item \emph{Resource preservation}: for every marking $m\in\reachable{N}{m_0}$, resource type $\eta \in \res{\Lambda}$, and resource $r \in I(\eta) \cap \id{m}$, we have that $r \in I(\eta) \cap \id{m_0}$. \item \emph{Resource exclusive assignment}: for every marking $m\in\reachable{N}{m_0}$, resource type $\eta \in \res{\Lambda}$, and resource $r \in I(\eta) \cap \id{m}$, there is exactly one token $\vec{r_1},\vec{r_2}\in \supp{m}$ s.t. $r\in\vec{r_1}$ and $r\in\vec{r_2}$. \end{compactitem} \end{definition} \begin{figure}[t] \centering \begin{subfigure}{.32\textwidth} \centering \includegraphics[width=\textwidth]{figures/resource-not-pres} \caption{Resource not preserved\label{fig:resource-not-preserved}} \end{subfigure} \begin{subfigure}{.32\textwidth} \centering \includegraphics[width=\textwidth]{figures/resource-not-exclusive} \caption{Resource not exclusive\label{fig:resource-not-exclusive}} \end{subfigure} \begin{subfigure}{.32\textwidth} \centering \includegraphics[width=\textwidth]{figures/resource-conservative} \caption{Conservative resource\label{fig:resource-conservative}} \end{subfigure} \caption{Three examples of resource-aware t-PNID\xspace{s}. Nets (a) and (b) are not managing resources conservatively, as they respective violate the property of resource preservation and that of resource exclusive assignment. Net (c) is instead a positive example that satisfies both properties.}\label{fig:resource-management} \end{figure} \begin{example} \label{ex:resource-management} Figure \ref{fig:resource-management} shows three examples of resource-aware t-PNID\xspace{s}, where place order is of an object type and place clerk is of a resource type. The t-PNID\xspace in Figure \eqref{fig:resource-not-preserved} attempts to model a setting where every order is managed by a clerk. The main issue here is that there is no information stored in the net about which clerk handles which order. In fact, starting from a marking that indicates which clerks are available, the net violates the property of resource preservation, as when \emph{send order} fires, it brings into the \emph{clerk} place a freshly generated resource (not matching the one previously consumed in \emph{create order} - recall, in fact, that the scope of variables is that of a single transition). The t-PNID\xspace in Figure \eqref{fig:resource-not-exclusive} explicitly keeps track of the assignments of clerks to orders in a dedicated ``synchronization'' place. Starting from a marking that indicates which clerks are available, it satisfies resource preservation, as no new clerk identifier is generated, but it violates the property of resource exclusive assignment, since two different order creations may lead to select the same resource twice, assigning it to two different orders. The t-PNID\xspace in Figure \eqref{fig:resource-conservative} properly handles the assignment of clerks to orders. Starting from a marking that indicates which clerks are available, every time a new order is created, an existing clerk is exclusively assigned to that order. The fact that the same clerk is not reassigned is guaranteed by the fact that the clerk is consumed upon creating the order, and recalled in the assignment place. When the order is sent, its exclusively assigned clerk is released back into the place of (available) clerks, and can be later exclusively assigned to a different order. \end{example} By recalling that t-PNID\xspace{s} evolving tokens that carry pairs of identifiers are Turing-powerful \cite{GGMR22}, and hence every non-trivial property defined over them is undecidable to check, we obtain the following. \begin{remark} Verifying whether a marked t-PNID\xspace manages resources conservatively is in general undecidable. \end{remark} To mitigate this negative result, we introduce an approach that drives the modeller in enriching an input t-PNID\xspace via resources following a well-principled approach. The approach generalizes the idea introduced in \cite{MontaliR16} to the more sophisticated case of t-PNID\xspace{s}, and does so by following the modelling strategy used in Figure~\ref{fig:resource-conservative}. In particular, it aims at capturing the following modelling principles: \begin{compactenum} \item every object type $\lambda$ is associated to a dedicated resource type $\eta_\lambda$; \item each such resource type is used in two places - one just typed with $\eta_\lambda$, to indicate which resources of that type are currently available, the other typed by $\lambda \cdot restype_\lambda$, to keep track of which resources are currently assigned to which objects; \item every object of type $\lambda$ gets assigned a resource of type $\eta_\lambda$ upon creation, and until the consumption of the object, its resource cannot be assigned to any other object; \item transitions applied to an object may (or may not) require its resource in isolation from the others (if so, implicitly introducing serialization); \item upon consumption of an object, its resource may either be permanently consumed as well, or freed and become again available to further assignments. \end{compactenum} Technically, we substantiate these intuitive principles through the notion of resource closure. \begin{definition}[Resource closure] \label{def:closure} Let $N=(P,T,F,\alpha,\beta)$ and $N'=(P',T',F',\alpha',\beta')$ be two t-PNID\xspace{s}, and $\lambda\in\ensuremath {type}_\Lambda(N)$ be an object type. We say that $N'$ is a \emph{$\lambda$-resource closure} of $N$ if the following conditions hold: \begin{compactenum} \item $P' = P\cup\set{p_r,p_s}$, where and $p_r$ and $p_s$ are respectively called the \emph{resource} and \emph{assignment} places, and $p_r,p_s\not\inP$. \item $ \alpha'= \alpha \cup \set{p_r\mapsto \eta \mid \eta \in \res{\Lambda} \setminus \ensuremath {type}(N)} \cup \set{p_s\mapsto \lambda\cdot \alpha'(p_r)}$ extends $\alpha$ by typing $p_r$ with a resource type $\eta$ not already used in $N$, and $p_s$ with the combination of the object type $\lambda$ and the resource type $\eta$ of $p_r$. \item $F' = F \cup F_r^{out} \cup F_r^{in} \cup F_s^{in} \cup F_s^{syn} \cup F_s^{out}$, where: \begin{compactenum} \item $F_r^{out} = \set{(p_r,t)\mid t\in E_N(\lambda)}$, the \emph{output resource flow relation}, indicates that every emitter transition for $\lambda$ consumes a resource from $p_r$; \item $F_r^{in} \subseteq \set{(t,p_r)\mid t\in C_N(\lambda)}$, the \emph{input resource flow relation}, indicates that every consumer transition for $\lambda$ \emph{may} return a resource to $p_r$; \item $F_s^{in} = \set{(t,p_s)\mid t\in E_N(\lambda)}$, the \emph{input assignment flow relation}, indicates that every emitter transition generates an assignment in $p_s$; \item $F_s^{out} = \set{(p_s,t)\mid t\in C_N(\lambda)}$, the \emph{output assignment flow relation}, indicates that every emitter transition consumes an assignment from $p_s$; \item $F_s^{syn} \subseteq\set{(p_s,t),(t,p_s)\mid t\in T\setminus (E_N(\lambda)\cup C_N(\lambda))}$, the \emph{synchronization assignment flow relation}, indicates that every ``internal'' (i.e., non-emitting and non-consuming) transition for $\lambda$ \emph{may} check for the presence of an assignment in $p_s$. \end{compactenum} \item $\beta'$ is the extension of $\beta$ satisfying the following conditions: \begin{compactenum} \item $\beta'(a,b)=\beta(a,b)$, if $(a,b)\inF$. \item For every $\lambda$-emitter $t \in E_N(\lambda)$, we define $\beta'(p_r,t)$ and $\beta'(t,p_s)$ as described next. Let $X = \set{x_1,\ldots,x_n}$ be the set distinct variables of type $\lambda$ mentioned in the inscriptions of outgoing arcs of $t$, that is, $X = \set{x | x \in \beta(t,p) \text{ for some } p \in P}$. These variables denote the $n$ distinct objects of type $\lambda$ created upon firing $t$. We then need to consume $n$ distinct resources of type $\eta$ and establish the corresponding assignments: $\beta(p_r,t) = (r_1)\cdots(r_n)$ and $\beta(t,p_s) = (x_1,r_1) \cdots (x_n,r_n)$, where $r_1,\ldots,r_n$ are $n$ distinct (resource) variables of type $\eta$. \item A symmetric approach is used to define $\beta'(p_s,t)$ and (in case $(t,p_r) \in F_r^{in}$ is defined) $\beta'(t,p_r)$ for every $\lambda$-consumer $t \in C_N(\lambda)$ (based on the incoming arcs of $t$). \item For every (internal) transition $t\in T\setminus (E_N(\lambda)\cup C_N(\lambda))$ such that $\set{(p_s,t),(t,p_s)} \subseteq F_s^{syn}$, we define $\beta'(p_s,t)$ and $\beta'(t,p_s)$ as described next. Let $X = \set{x_1,\ldots,x_n}$ be the set distinct variables of type $\lambda$ mentioned in the inscriptions of incoming arcs of $t$, that is, $X = \set{x | x \in \beta(p,t) \text{ for some } p \in P}$. These variables denote the $n$ distinct objects of type $\lambda$ accessed upon firing $t$. We then need to check for the presence of the $n$ distinct assigned resources to this objects, by defining $\beta'(p_s,t) = \beta'(t,p_s) = (x_1,r_1) \cdots (x_n,r_n)$, where $r_1,\ldots,r_n$ are $n$ distinct (resource) variables of type $\eta$. \end{compactenum} \end{compactenum} A t-PNID\xspace is called a \emph{(full) resource closure of $N$} if it is obtained by recursively constructing, starting from $N$, $\lambda_i$-resource closures for every $\lambda_i\in\ensuremath {type}_\Lambda(N)$. \end{definition} The closure(s) of a marked t-PNID\xspace is defined by closing the t-PNID\xspace as per Definition~\ref{def:closure}, and enriching the initial marking by populating the resource places with some resources. \begin{definition} \label{def:marked-closure} Let $(N,m_0)$ and $(N',m'_0)$ be two marked t-PNID\xspace{s}, and $\lambda\in\ensuremath {type}_\Lambda(N)$ be an object type. We say that $(N',m'_0)$ is a \emph{$\lambda$-marked resource closure} of $N$ if the following conditions hold: \begin{enumerate} \item $N'$ is a $\lambda$-resource closure of $N$; \item $m'_0$ extends $m_0$ by assigning to the resource place $p_r$ introduced in $N'$ a \emph{finite subset} of identifiers of type $\ensuremath {type}(p_r)$. \end{enumerate} A marked t-PNID\xspace is called a \emph{(full) marked resource closure of $(N,m_0)$} if it is obtained by recursively constructing, starting from $(N,m_0)$, $\lambda_i$-marked resource closures for every $\lambda_i\in\ensuremath {type}_\Lambda(N)$. \end{definition} Notice that, in Definition~\ref{def:marked-closure}, we obey to the named approach described in the opening of this section by assigning to the resource place a set (and not a multi-set) of resources. It is easy to see that, for a t-PNID\xspace $N$ and a type $\lambda$, there are only finitely many distinct $\lambda$-closures of $N$, obtained by choosing which $\lambda$-consumers actually return resources in the resource place of the closure, and which internal $\lambda$-transitions access the assignment place of the closure. Marked t-PNID\xspace{s} defined on these finitely many distinct closures only differ by the set of identifiers they initially assign to each resource place. \begin{example} \label{ex:simple-resource-closure} Figure~\eqref{fig:resource-conservative} shows the only possible (order-)resource closure for the t-PNID\xspace manipulating orders via the \emph{create order} and \emph{send order} transitions, and the orange place in between. In particular, the resource type of clerk is chosen for the closure. The green place (in fact, typed \emph{clerk}) at the bottom of the picture is the resource place of the closure, while the mixed-colored place (in fact, typed \emph{order$\cdot$clerk}) is the assignment place of the closure. The inscriptions attached to the input/output arcs connecting these two places to the emitter and consumer transitions for orders indicate how identifiers are being matched when consuming/returning resources, while recalling the objects they get assigned to. \end{example} \begin{figure}[t] \centering \begin{subfigure}{.6\textwidth} \centering \includegraphics[width=\textwidth]{figures/sound-net} \caption{A sound t-PNID\xspace manipulating an object type $O \in \obj{\Lambda}$\label{fig:sound-net}} \end{subfigure} \begin{subfigure}{.6\textwidth} \centering \includegraphics[width=\textwidth]{figures/sound-net-closure-1} \caption{An $O$-resource closure of the t-PNID\xspace (a) \label{fig:sound-net-closure-1}} \end{subfigure} \begin{subfigure}{.6\textwidth} \centering \includegraphics[width=\textwidth]{figures/sound-net-closure-2} \caption{Another $O$-resource closure of the t-PNID\xspace (a) \label{fig:sound-net-closure-2}} \end{subfigure} \caption{An identifier-sound t-PNID\xspace and two alternative resource closures}\label{fig:resource-closures} \end{figure} \begin{example} \label{ex:resource-closures} Figure~\eqref{fig:sound-net} illustrates a t-PNID\xspace with a single object type $O$, manipulated using sequential and concurrent transitions, and finally consumed through one of two (mutually exclusive) consumers. resource closures. Two resource closures of this net are shown in Figures~\eqref{fig:sound-net-closure-1} and~\eqref{fig:sound-net-closure-2}, using $R$ as resource type. The closure in Figure~\eqref{fig:sound-net-closure-1} shows that for an object $o$ that is consumed by transition $f$, its assigned resource is returned to the resource place, becoming again available for a further assignment. If $o$ is instead consumed by transition $g$, the resource is also consumed (fetching it from the assignment place without returning it to the resource place). In addition, the two transitions $c$ and $d$, which are concurrent in the original t-PNID\xspace of Figure~\eqref{fig:sound-net}, are now declared to require the resource \emph{in isolation}, therefore implicitly requiring serialization (in whatever order). The closure in Figure~\eqref{fig:sound-net-closure-1} depicts a slightly different scenario. On the one hand, both consumers now return the assigned resource upon consuming an object. On the other hand, no internal transition of the original t-PNID\xspace are linked to the assignment place, hence transitions $c$ and $d$ continue to be truly concurrent even after the application of the resource closure. \end{example} Examples~\ref{ex:simple-resource-closure} and~\ref{ex:resource-closures} show different examples of well-behaved resource closures, which indeed technically substantiate the informal modelling principles listed above and, even more, actually satisfy the property of conservative resource management, as per Definition~\ref{def:conservative-resource-management}. A natural question is whether this holds when resource closure is applied to an arbitrary input t-PNID\xspace. It is easy to show on even very minimalistic examples that provide a negative answer to this question. \begin{figure}[t] \centering \begin{subfigure}{.49\textwidth} \centering \includegraphics[width=\textwidth]{figures/unsound-net} \vspace*{2.3cm} \caption{An unsound t-PNID\xspace with an object type $O \in \obj{\Lambda}$\label{fig:unsound-net}} \end{subfigure} \begin{subfigure}{.49\textwidth} \centering \includegraphics[width=\textwidth]{figures/unsound-net-closure} \caption{An $O$-resource closure of the t-PNID\xspace (a) \label{fig:unsound-net-closure}} \end{subfigure} \caption{An identifier-unsound t-PNID\xspace and one of its resource closures}\label{fig:resource-unwanted-closure} \end{figure} \begin{example} \label{ex:resource-unwanted-closure} Figure~\ref{fig:resource-unwanted-closure} illustrates a t-PNID\xspace and one of its resource closures. One can immediately see that the resource closure does not behave as expected. Upon creation of a new object of type $O$, say, $o_1$, a resource, say, $r_5$ of type $R$ is taken from the resource place and assigned to $o_1$, keeping track of the assignment $(o_1,r_5)$ in the assignment place. Object $o_1$ then flows through the t-PNID\xspace, leading to the generation of two tokens carrying $o_1$, concurrently enabling the consumer transitions $c$ and $d$. Upon the consumption of the first of such two tokens, the assignment token $(o_1,r_5)$ is removed from the assignment place and used to return $r_5$ to the resource place. This means that the second token carrying $o_1$ stays forever stuck, and cannot be consumed, as there is no assignment token matching $o_1$ that can be used to fire the consumer transition. \end{example} By more closely inspecting the negative example of resource closures discussed in Example~\ref{ex:resource-unwanted-closure}, one can notice that the modelling glitch is not natively caused by the resource closure itself, but actually originates from the fact that the input t-PNID\xspace of Figure~\eqref{fig:unsound-net} is not identifier-sound. In particular, considering this t-PNID\xspace, initially marked by the empty marking (or, equivalently, the t-PNID\xspace of Figure~\eqref{fig:unsound-net-closure}, initially marked by a marking that inserts some resources in the resource place), the violated property is the one of proper completion: once one of the two concurrent consumer transitions $c$ and $d$ is fired to consume a previously created object, the identifier of the object still persists in the token enabling the other consumer transition. The resource closure actually inherits the lack of proper completion, but also suffers of lack of weak termination. This leads to the following, natural follow-up question: how does identifier-soundness of an arbitrary input t-PNID\xspace impact on the properties of the t-PNID\xspace{s} resulting from the application of resource closure? We answer by showing three key properties: \begin{compactenum} \item \emph{Soundness induces conservative resource management} - the application of resource closure to an identifier-sound t-PNID\xspace leads to t-PNIDs\xspace that indeed satisfy the modelling principles listed above, and in particular the property of conservative resource management. \item \emph{Soundness is preserved} - Every resource closure of an identifier-sound t-PNID\xspace is an identifier-sound t-PNID\xspace. \item \emph{Soundness induces boundedness} - Every resource closure of an identifier-sound t-PNID\xspace is a bounded t-PNID\xspace. \end{compactenum} We start with conservative resource management. This is proved by showing that proper completion and weak termination combine well with resource closures. \begin{theorem} \label{thm:conservative-closure} Let $(N,m_0)$ be a marked t-PNID\xspace, and $(N',m'_0)$ one of its marked resource closures. If $(N,m_0)$ is identifier-sound, then $(N',m'_0)$ manages resources conservatively, in the sense of Definition~\ref{def:conservative-resource-management}. \end{theorem} \begin{proof} By definition of resource closure, every marking $m \in \reachable{N'}{m'_0}$ mentions only resources contained in $m'_0$, as no resource type has an emitter. This immediately proves resource preservation. In addition, by construction every resource closure is so that in every marking $m \in \reachable{N'}{m'_0}$, there can be at most one single token in the assignment place per resource. The only way of breaking exclusive resource assignment is to allow for markings where an object is not associated to any resource (i.e., the assignment place associated to the type of that object does not contain a token whose first component matches the object). This can only occur if an object identifier is fed into a collector transition, and its value still persists in the consequently obtained marking (attached to some other token). This is however impossible, as, by hypothesis, the original t-PNID\xspace is identifier-sound and, hence, properly completes, which contradicts this scenario. \end{proof} We continue with soundness preservation. The crux here is that the enrichment with a t-PNID\xspace with resources through resource closure does not alter the evolution of emitted objects, but only constrains \emph{when} new objects can be created. \begin{theorem} \label{thm:soundness-preservation} Let $(N,m_0)$ be a marked t-PNID\xspace, and $(N',m'_0)$ one of its marked resource closures. If $(N,m_0)$ is identifier-sound, then $(N',m'_0)$ is identifier-sound as well. \end{theorem} \begin{proof} By definition of resource closure, the reachability graph $\reachable{N'}{m'_0}$, projected on the original places of $N$, is a subset of $\reachable{N}{m_0}$. In fact, the only effect of resource closure on the original marked net is to prevent the possibility of creating new objects if the resource place attached to the corresponding emitter is empty. Since proper termination is a universal property over markings, it is preserved by subsets of $\reachable{N}{m_0}$ and, noticing that resource and assignment places do not affect the status of proper completion, hence also by $\reachable{N'}{m'_0}$. This proves that $(N',m'_0)$ properly completes. As for weak termination of $\reachable{N'}{m'_0}$, assume by absurdum that one object $o$ of type $\lambda$ cannot progress to consumption. Since the original t-PNID\xspace is weakly terminating, this can only happen due to the absence of (the only) assignment token referencing $o$ and being present in the assignment place associated to $\lambda$. Such a token was by construction generated upon the creation of $o$, and consequently its absence can be only due to a previous firing of some collector transition that consumed a token referencing $o$. This would however mean that $\reachable{N'}{m'_0}$ is not properly completing, which contradicts what was proven before. \end{proof} Finally, we turn to boundedness of resource closures of sound t-PNID\xspace{s}. Intuitively, this is due to the good interaction between resources and objects: \begin{compactitem} \item there are boundedly many resources available; \item new objects can be created as long as there are still available resources; \item when no resource is available, a new object can be created only upon destruction of a currently existing one. \end{compactitem} This reconstructs, in the more sophisticated case of t-PNID\xspace{s}, the boundedness result for resource and instance-aware workflow nets, at the core of \cite{MontaliR16}. \begin{theorem} \label{thm:closure-boundedness} Let $(N,m_0)$ be a marked t-PNID\xspace, and $(N',m'_0)$ one of its marked resource closures. If $(N,m_0)$ is identifier-sound, then $(N',m'_0)$ is bounded. \end{theorem} \begin{proof} Boundedness immediately holds for resource identifiers in $\reachable{N'}{m'_0}$, thanks to Theorem~\ref{thm:conservative-closure} and the fact that $(N',m'_0)$ manages resources conservatively, and to the fact that, by construction of resource closure, every resource originally present in $m'_0$ is either carried by one token present in its corresponding resource place, or by one token present in its corresponding assignment place. We then prove the theorem by showing that $(N',m'_0)$ is width- and depth-bounded when considering object identifiers. Depth boundedness is immediately obtained by recalling that, by Theorem~\ref{thm:soundness-preservation}, identifier-soundness of $(N,m_0)$ implies identifier-soundness of $(N',m'_0)$, which is consequently depth-bounded by Lemma~\ref{lemma:depth}. Width-boundedness instead follows from the observation, already used in the proof of Theorem~\ref{thm:conservative-closure}, that for every marking $m \in \reachable{N'}{m'_0}$, if $o \in \id(m)$, then there is exactly one token referencing $o$ in the assignment place associated to the type of $o$. Hence the maximum number of object identifiers is bounded by the number of resources present in $m'_0$. \end{proof} By combining Theorems~\ref{thm:conservative-closure} and~\ref{thm:model-checking}, we thus obtain the following conclusive result, that relates to the verification results discussed in Section~\ref{sec:verification}. \begin{corollary} \label{cor:model-checking-closure} Model checking of $\mu\L{\text{-FO}}^{\text{PNID}}$ and $LTL\text{-}FO_p^{\text{PNID}}$ is decidable for marked resource closures of identifier-sound t-PNIDs\xspace. \end{corollary} \endinput \todo[inline]{ANDY, HERE I HAVE CLOSED!} Without loss of generality, given a full resource closure of $N$, where $P_r$ is the set of resource places, we call a \emph{resource marking} a function $R: P_r \to \mult{\Lambda}$, such that $R(p) \in \mult {\funsym{C}(p_r)}$, for each place $p \in P_r$. In what follows, given $(\overline{N},m_0+R)$ with initial marking $m_0+R$, we denote with $\restr{\reachable{\overline N}{m_0+R}}{P}$ to denote the reachability set of $\overline{N}$ s.t. for every $m\in \restr{\reachable{\overline N}{m_0+R}}{P}$ it holds that $\dom{m}=P$.\footnote{Here $\dom{f}$ is used to define the domain of function $f$.} In other words, such reachability set carries only markings that do not feature resource and synchronization places. It is easy to see that $\restr{\reachable{\overline N}{m_0+R}}{P}\subseteq \reachable{N}{m_0}$ as the former contains only markings that can be produced by taking into account the resource acquisition and (potential) release cycle. The above definition demonstrates a necessary syntactic condition that has to be satisfied by every object type that is constrained by a bounded number of resources. Specifically, every resource place $r$ must be connected to all emitter transitions that generate identifiers of type $\alpha(r)$ as well as all collecting transitions that consume identifiers of the same type. he same must happen with synchronization places: upon firing of an emitter and consequent production of an identifier, one resource gets reserved and its ``binding'' to the generated identifier gets recorded (as a pair in the dedicated synchronization place). At the end of this identifier's lifecycle, the resource is either sent back to the resource place or simply consumed. The same happens with the token carrying the aforementioned identifier-resource pair: it gets removed from the associated synchronization place. \andy{here we should give a couple of examples of resource closures, one with XOR and one with AND split, highlighting also the need of synchronization places } We now present a soundness criterion, akin to the one presented in Section~\ref{sec:soundness}, that also accounts for net resources provided with the net's initial marking. This definition, apart from the proper type completion and weak termination, guarantees that resource tokens are always either consumed or back to their places whenever the execution of related active objects is over, and that at any moment in time the number of resources available in the net does not exceed the number that was originally provided by the initial resource marking. It is easy to see that the last condition also guarantees that no resources can be created during the process execution. \begin{definition}[Resource soundness]\label{def:rc-soundness} Given a marked t-PNID\xspace $(N, m_0)$ and a type $\lambda\in\ensuremath {type}_\Lambda(N)$, its marked $\lambda$-resource closure $(\overline{N_\lambda},m_0+R)$ is called \emph{$(\lambda, R)$-sound} iff \begin{enumerate} \item $(\overline{N_\lambda},m_0+R)$ is proper $\lambda$-completing and is weakly $\lambda$-terminating; \item for any $m\in\reachable{\overline{N_\lambda}}{m_0+R}$, it holds that $m(p_r)\subseteq R(p_r)$, where $p_r$ is the resource place of $\overline{N_\lambda}$. \end{enumerate} A full resource-closure $(\overline{N_\lambda},m_0+R)$ of $N$ is called \emph{$R$-sound} iff $(\overline{N_\lambda},m_0+R)$ is $(\lambda, R)$-sound, for every $\lambda\in \ensuremath {type}_\Lambda(N)$. \end{definition} The rationale behind introducing the resource-constrained soundness property is twofold. First, resources are intrinsic components of modern information systems and considering their presence in mathematical models of such systems is crucial in order to correctly represent all possible behaviors of the former. Second, constraining the production and consumption cycle of identifiers may seem beneficial from the technical perspective. \andy{\textbf{Marco}, you have the lock until here} Let us first mention an interesting and natural property that almost immediately follows from Definition~\ref{def:rc-soundness}. \begin{proposition} \label{lemma:rc-boundedness} Let $(N, m_0)$ be a marked t-PNID\xspace. If $(\overline{N}, m_0+R)$ is $R$-sound for any $R: P_r \to \mult{\Lambda}$, then $(\overline{N}, m_0+R)$ is bounded. \end{proposition} \begin{proof} Suppose that $(\overline{N}, m_0+R)$ is properly $\lambda$-completing for every $\lambda\in\ensuremath {type}_\Lambda(N)$ but it is not bounded. This means that there is at least one place $p\inP$ of $\overline N$ such that there exists an infinite sequence of growing markings s.t. for every $i\in\mathbb{N}$ in that sequence it holds that $m_i(p)<m_{i+1}(p)$, for $m_i,m_{i+1}\in\reachable{\overline{N}}{m_0+R}$. By the definition of $R$-soundness, the net weakly terminates and thus every identifier value must be eventually removed by one of the consumers, which also means that such sequence cannot exist. This ensures that the net is depth-bounded (similarly to Lemma~\ref{lemma:depth}). Notice also that, according to the same $R$-soundness definition, the number of resource tokens in each $m\in\reachable{\overline{N}}{m_0+R}$ does not go beyond their original number assigned by $R$. Moreover, by the construction of resource closure from Definition~\ref{def:closure}, whenever a new identifier is produced, it has to be associated to a resource from one of the resource places. Since the number of such resources is always bounded by $R$, the net is also width-bounded. Hence, $(\overline{N}, m_0+R)$ is bounded. \end{proof} As the lemma demonstrates, adding resources by following the construction described in Definition~\ref{def:closure} ensures that the sound net is also bounded. This is different from t-PNIDs\xspace without resources as identifier soundness guarantees only depth-boundedness (as it has been demonstrated in Lemma~\ref{lemma:depth}. One may also wonder whether resource closure is actually a soundness preserving transformation. We next answer positively this question. \begin{proposition} \label{prop:soundness-preservation} Let $(N, m_0)$ be a marked t-PNID\xspace. If $(N, m_0)$ is identifier sound, then $(\overline{N}, m_0+R)$ is $R$-sound for any $R: P_r \to \mult{\Lambda}$. \end{proposition} \begin{proof} \end{proof} \andy{bounded nets are generic (i.e., induce generic transition systems)} \andy{Jackson nets + resource closure allow to check sophisticated properties specified in a FO-variant of $\mu$-calculus (this is provided by the boundedness)} \andy{do we want to talk about safety for coa-nets?} \begin{theorem} $R$-soundness is undecidable for resource-closed t-PNIDs\xspace. \end{theorem} \begin{proof} \andy{are we sure about that?} \end{proof} \andy{At the fist glance, resource closed nets may seem bounded. This is not true as, strictly speaking, we may construct a t-PNID\xspace whose closure does not control ``copying'' of already created identifiers (each of which, upon construction, must be assigned to a resource). This case is demonstrated in Figure~\ref{add a figure of such an example}. To ensure the boundedness in the presence of resources, we have to require that, in the original net, identifier production and consumption is done correctly (that is, and that all the produced identifiers are consumed whenever one of the consumer transitions fires, which also results in releasing the resources assigned to these identifiers. } \andy{comment on the fact why we don't add more resource places. indeed, this is possible and would allow to see resource lifecycles (again, see our paper with Lomazova, we use a very similar machinery there)} Although resource soundness is undecidable in general, we saw from Proposition~\ref{prop:soundness-preservation}, that resource closure is the soundness preserving transformation. As we demonstrated in Section~\ref{sec:soundness:by:construction}, there are classes of t-PNIDs\xspace for which soundness can be shown by construction. Providing a resource closure for such nets does not alter their soundness and, moreover, makes them bounded (see Lemma~\ref{lemma:rc-boundedness}). As we have shown in Section~\ref{sec:verification}, boundedness is a necessary criterion to make t-PNIDs\xspace amenable for first-order $\mu$-calculus verification. Like that, for example, one may construct a resource closure for a t-JN (remember that t-JNs are identifier sound by construction which only ensures depth-boundedness of t-JNs) and verify more sophisticated properties on it using the verification machinery described in Section~\ref{sec:verification}. \section{Related Work}\label{sec:relatedwork} This work belongs to the line of research that aims at augmenting pure control-flow description of processes with data, and study formal properties of the resulting, integrated models. When doing so, it becomes natural to move from case-centric process models whose analysis focuses on the evolution of a single instance in isolation, to so-called \emph{object-centric process models} where multiple related instances of the same or different processes co-evolve. This is relevant for process modeling, analysis, and mining~\cite{Aalst19}. Different approaches to capture the control-flow backbone of object-oriented processes have been studied in literature, including declarative \cite{ArtaleKMA19} and database-centric models \cite{MonC16}. In this work, we follow the Petri net tradition, which comes with three different strategies to tackle object-centric processes. A first strategy is to represent objects implicitly. The most prominent example in this vein is constituted by proclets \cite{Fahland19}. Here, each object type comes with a Petri net specifying its life cycle. Special ports, annotated with multiplicity constraints, are used to express generation and synchronization points in the process, operating over tokens that are implicitly related to co-referring objects. Correctness analysis of proclets is an open research topic. A second strategy is to represent objects explicitly. Models adopting this strategy are typically extensions of $\nu$-PNs \cite{RVFE11}, building on their ability to generate (fresh) object identifiers and express guarded transitions relating multiple objects at once. While $\nu$-PNs attach a single object to each token, Petri nets with identifiers (PNIDs)~\cite{HSVW09} use vectors of identifiers on tokens, representing database transactions. representing and evolving relationships between objects call for extending this to tuples of objects, in the style of~\cite{HSVW09}. For such Petri nets with identifiers (PNIDs),~\cite{HSVW09} provides patterns capturing different types of database transactions. The ISML approach \cite{PolyvyanyyWOB19} equips Petri nets with identifiers (PNIDs)~\cite{HSVW09} with the ability of manipulating populations of objects defining the extensional level of an ORM data model. Transitions can be executed if they do not lead to violating the constraints captured in the data model. For such models, correctness properties are assessed by imposing that the overall set of object identifiers is finite, and fixed a-priori. This ensures that the overall state space is indeed finite, and can be analyzed using conventional methods. Catalog-nets~\cite{GhilardiGMR20} extend PNIDs with the ability of querying a read-only database containing background information. Correctness properties are checked parametrically to the content of read-only database. Decidability and other meta-properties, as well as actual algorithms for verification based on SMT model-checking, are given for safety properties, whereas (data-aware) soundness can only be assessed for state-bounded system \cite{BCMD14,MonC16}. The third, final strategy for modeling object-centric processes with Petri nets is to rely on models that highlight how multiple objects of different types may flow through shared transitions, without considering object identifier values. This approach is followed in \cite{AalstB20}, where object-centric nets are extracted from event logs, where logged events might come with sets of object identifiers. Soundness for this model is studied in \cite{LoMR21}, where the authors propose to check related correctness criteria for object types, without considering concrete object identifiers, or for single objects in isolation that are still allowed to interact with the system environment along their life-cycles. Similarly to the approach studied in this paper, the authors in~\cite{LoMR21} assume that the system model can have any number of objects being simultaneously active. The approach studied in this paper focuses on the essence of Petri net-based object-centric processes adopting the explicit approach, that is, grounded on PNIDs. We provide, for the first time, a notion of \emph{identifier soundness} that conceptually captures the intended evolution of objects within a net, show that such a property is undecidable to check in general, and provide a pattern-based construction technique that guarantees to produce identifier-sound models. Other works that propose more high-level extensions of classical WF-nets as well as the related notion(s) of soundness. In~\cite{LeoniFM18,FelliLM19,LeoniFM20}, the authors investigated data-aware soundness for data Petri nets, in which a net is extended with guards manipulating a finite set of variables associated with the net. That type of soundness was shown to be decidable. In~\cite{MontaliR16}, the authors proposed both a workflow variant of $\nu$-Petri nets as well as its resource-aware extension. The authors also defined a suitable notion of soundness for such nets and demonstrated that it is decidable by reducing the soundness checking problem to a verification task over another first order logic-based formalism. \cite{HaarmannW20,CaseModels2020} considered the soundness property for BPMN process models with data objects that can be related to multiple cases. The approach consists of several transformation steps: from BPMN to a colored Petri net and then to a resource-constrained workflow net. The authors then check k-soundness against the latter. Resource-constrained workflow nets pose different requirements on soundness. In \cite{BBS07} the authors studied a specific class of WFR-nets for which soundness was shown to be decidable. In \cite{HeeSSV05,SidorovaS13} a more general class of Resource-Constrained Workflow Nets (RCWF-nets) was defined. The constraints are imposed on resources and require that all resources that are initially available are present again after all cases terminate, and that for any reachable marking, the number of available resources does not override the number of initially available resources. In \cite{HeeSSV05} it was proven that for RCWF-nets with a single resource type generalized soundness can be effectively checked in polynomial time. Decidability of generalized soundness for RCWF-nets with an arbitrary number of resource places was shown in~\cite{SidorovaS13}. \endinput \subsection{Modeling Object-centric and Data-aware Processes using Petri nets} Multiple Petri net-based approaches have been used for modeling data- and object-aware processes. Here we briefly cover only the most recent ones. The formalism of Petri nets with identifiers (PNIDs) was studied in~\cite{HSVW09}. In such nets, tokens carry tuples of object identifiers (or references). Moreover, transitions can produce globally new data values that are different from those in a current marking. PNIDs have been also used as the process modeling language in the Information Systems Modeling Language (ISML) presented in~\cite{PolyvyanyyWOB19}. In ISML, PNIDs are paired with special CRUD operations defining operations over relevant data. Such data are structured according to an ORM model. A viewpoint on multi-case and data-aware process models is covered by works on so-called \emph{Proclets}. This concept was first proposed in~\cite{AalstBEW00}. Proclets are essentially quasi-workflows representing lifecycles of particular objects and allowing for different types of communication between such lifecycles via dedicated channels. The Proclet notation was applied to model processes with complex interactions between process objects \cite{Fahland19} as well as artifact-centric processes \cite{Fahland193}. Process artifacts here are documents, orders, deliveries, and other types of data objects which are manipulated within the process. Artifact-centric process models consider these objects as first-class citizens. Note that in such models process cases are often related to object types that leads to inter-case dependencies when more complicated communication patterns are involved. In~\cite{GhilardiGMR20} the authors introduced catalog-nets (CLog-nets). Conceptually, the formalism marries read-only relational databases with a variant of colored Petri nets~\cite{JeK09} which allows for generation of globally fresh data values upon transition firing. In CLog-nets, transitions are equipped with guards that simultaneously inspect the content of tokens and query facts stored in the database. \subsection{Soundness for Workflow Nets and their Extensions} The notion of soundness for classical WF-nets was initially discussed in~\cite{Aalst98}.\footnote{This notion coincides with the one presented in the beginning of Section~\ref{sec:soundness}.} Since then, many different variants of soundness have been proposed for WF-nets and their non-high-level extensions. An extensive study on such variants as well as related decidability results can be found in~\cite{AHHS11}. In the following, we briefly touch upon some of the soundness notions. Perhaps one of the most important generalizations of classical soundness are $k$-soundness and generalized soundness \cite{HeeSV04}. A WF-net is $k$- sound if, starting with $k$ tokens in its source place, it always properly terminates with $k$ tokens in its sink place. Hence this notion allows handling multiple individual processes (cases) in a WF-net. The classical soundness then coincides with 1-soundness. Generalized soundness is $k$-soundness for all $k$. It was proved in \cite{HeeSV04} that both $k$-soundness and generalized soundness are decidable. One of the important aspects of workflow development concerns resource management. In classical Petri nets, one can distinguish places, corresponding to control flow states, and places, representing different kinds of resources. There are various works that study different resource-aware extensions of WF-nets together with related notions of soundness. In \cite{BBS07} the authors studied a specific class of WFR-nets for which soundness was shown to be decidable. In \cite{HeeSSV05,SidorovaS13} a more general class of Resource-Constrained Workflow Nets (RCWF-nets) was defined. The constraints are imposed on resources and require that all resources that are initially available are present again after all cases terminate, and that for any reachable marking, the number of available resources does not override the number of initially available resources. In \cite{HeeSSV05} it was proven that for RCWF-nets with a single resource type generalized soundness can be effectively checked in polynomial time. Decidability of generalized soundness for RCWF-nets with an arbitrary number of resource places was shown in~\cite{SidorovaS13} All the above mentioned works assume resources to be permanent, i.e., they are acquired and released later at the end of a (sub-)process. Since resources are never created, nor destroyed, the process state space is explicitly bounded. To study a more general case of arbitrary resource transformations (that can arise, for example, in open and/or adaptive workflow systems), in \cite{Bashkin2014} WF-nets with resources (RWF-nets) were defined. RWF-nets extended RCWF-nets from \cite{HeeSSV05} in such a way that resources can be generated or consumed during a process execution without any restrictions. Unfortunately, even 1-sound RWF-nets are not bounded in general, hence existing soundness checking algorithms are no applicable in that case. The decidability of soundness for RFW-nets was shown for a restricted case, in which a RWF-net has a single unbounded resource place There are also other works that propose more high-level extensions of classical WF-nets as well as the related notion(s) of soundness. In~\cite{LeoniFM18,FelliLM19,LeoniFM20}, the authors investigated data-aware soundness for data Petri nets, in which a net is extended with guards manipulating a finite set of variables associated with the net. That type of soundness was shown to be decidable. In~\cite{MontaliR16}, the authors proposed both a workflow variant of $\nu$-Petri nets as well as its resource-aware extension. The authors also defined a suitable notion of soundness for such nets and demonstrated that it is decidable by reducing the soundness checking problem to a verification task over another first order logic-based formalism. \cite{HaarmannW20,CaseModels2020} considered the soundness property for BPMN process models with data objects that can be related to multiple cases. The approach consists of several transformation steps: from BPMN to a colored Petri net and then to a resource-constrained workflow net. The authors then check k-soundness against the latter. \section{Conclusions} \label{sec:conclusions} Achieving harmony in models that describe how processes data objects manipulate is challenging. In this paper, we use typed Petri nets with Identifiers (t-PNIDs\xspace) to model these complex interactions of multiple objects, referred through their identifiers. We propose identifier soundness as a correctness criterion that conceptually captures the expected evolution of each object. Identifier soundness consists of two conditions: weak termination, i.e., that any identifier that is created is eventually removed, and proper type completion, i.e., when a collecting transition fires for an identifier of a type, the type should be removed from the resulting marking. Identifier soundness is in general undecidable for t-PNIDs\xspace. For two subclasses we show that identifier soundness is guaranteed, and that the overall model remains live. On top of that, we propose a resource-aware extension of t-PNIDs\xspace, in which all object manipulations are systematically guarded by a finite number of typed resources. For this class of t-PNIDs\xspace we propose a correctness criterion similar to identifier soundness, which also takes into account conditions for correct resource management. The resource soundness is deemed to be undecidable as well. Many systems allow for a dynamic number of simultaneously active objects. In theory, this number can be infinite, and thus such models become width-unbounded. However, for many systems there is a natural upper bound, which can be either assumed or guaranteed with different modeling techniques (such as multiplicity upper bounds on objects \cite{MonC16} or resources \cite{MonR16,SidorovaS13}. This gives potential for different directions for new analysis techniques. As an example, some models may have a minimum bound such that its correct behavior is guaranteed above this bound, in a similar way as 1-soundness of WF-nets guarantees correctness of its EC-closure. One can extend t-PNIDs\xspace by enriching objects with attributes over different datatypes, in the style of what done in data modeling and knowledge graphs. This calls for combining the techniques studied in this paper with data abstraction techniques used to deal with numerical datatypes, possibly equipped with arithmetics \cite{FelliLM19,FeMW22}. We plan to provide tool support for the designer of such systems. Although many correctness criteria are undecidable, this does not mean designers should be left in the dark. Since the ISM-suite~\cite{WerfP20} already allows to model t-PNIDs\xspace, we intend to work on extending it with verification techniques to support the modeler in designing systems where processes and data are in resonance. \section{Identifier soundness} \section{Correctness Criteria for t-PNIDs\xspace} \label{sec:soundness} Many criteria have been devised for assessing the correctness of systems captured as Petri nets. Traditionally, Petri net-based criteria focus on the correctness of processes the systems can support. Enriching the formalism with ability to capture object manipulation while keeping analyzability is a delicate balancing act. For t-PNIDs\xspace, correctness criteria can be categorized as system-level and object-level. Criteria at the system-level (Section~\ref{sec:systemlevel}) focus on traditional Petri net-based criteria to assess the system as a whole, whereas criteria at the object-level (Section~\ref{sec:objectlevel}) address the correctness of individual objects represented by identifiers. \subsection{Correctness Criteria on System-Level}\label{sec:systemlevel} Liveness is an example of a system-level correctness property. It expresses that any transition is always eventually enabled again. As such, a live system guarantees that its activities cannot eventually become unavailable. \begin{definition}[Liveness] A marked t-PNID\xspace $((P, T,F,\alpha,\beta),M_0)$ is \emph{live} iff for every marking $M\in\reachable{N}{M_0}$ and every transition $t \in T$, there exists a marking $M'\in\reachable{N}{M}$ and a binding $\psi:\ensuremath{\mathcal{V}}\rightarrow \ensuremath{\mathcal{I}}$ such that $\enabled{M'}{t,\psi}$. \end{definition} Boundedness expresses that the reachability graph of a system is finite, i.e., that the system has finitely possible states and state transitions. Hence, boundedness is another example of a system-level correctness property. Many systems can support an arbitrary number of simultaneously active objects; they are unbounded by design. Similar to $\nu$-PN, we differentiate between various types of boundedness~\cite{RosaF10}. Specifically, \emph{boundedness} expresses that the number of tokens in any reachable place does not exceed a given bound. \emph{Width-boundedness} expresses that the modeled system has a bound on the number of simultaneously active objects. \begin{definition}[Bounded, width-bounded] Let $(N,m_0)$ be a marked t-PNID\xspace with $N=(P, T,F,\alpha,\beta)$. A place $p \in P$ is called: \begin{itemize} \item \emph{bounded} if there is $k \in \mathbb{N}$ such that $|m(p)| \leq k$ for all $M \in \reachable{N}{m_0}$; \item \emph{width-bounded} if there is $k \in \mathbb{N}$ such that $|\id{m}|\! \leq\! k$ for all $m \in \reachable{N}{m_0}$; \end{itemize} If all places in $(N,m_0)$ are (width-) bounded, $(N,m_0)$ is called (width-) bounded. \end{definition} As transitions $A$ and $T$ in Fig.~\ref{fig:overallModel} have no input places, these transitions are always enabled. Consequently, places \emph{product} and \emph{customer} are not bounded, and thus no place in $N_{\mathit{rs}}$ is bounded. Upon each firing of transition $A$ or $T$, a new identifier is created. Hence, these places are also not \emph{width-bounded}. In other words, the number of objects in the system represented by $N_{\mathit{rs}}$ is dynamic, without an upper bound. \subsection{Correctness Criteria on Object-Level}\label{sec:objectlevel} An object-level property assesses the correctness of individual objects. In t-PNIDs\xspace, identifiers can be seen as references to objects: if two tokens carry the same identifier, they refer to the same object. The projection of an identifier on the reachability graph of a marked t-PNID\xspace represents the life-cycle of an identifier. Boundedness of a system implies that the number of states of the reachability graph is finite. \emph{Depth-boundedness} captures this idea for identifiers: in any marking, the number of tokens that refer to a single identifier is bounded. In other words, if a marked t-PNID\xspace is depth-bounded, the complete system may still be unbounded, but the life-cycle of each identifier is finite. \begin{definition}[Depth-boundedness] Let $(N,m_0)$ be a marked t-PNID\xspace with $N=(P, T,F,\alpha,\beta)$. A place $p \in P$ is called \emph{depth-bounded} if there is $k\in\mathbb{N}$ such that $m(p)(\vec{\cname{id}}) \leq k$ for all $\vec{\cname{id}} \in \ensuremath{\mathcal{I}}^*$, $m \in \reachable{N}{m_0}$, and $\vec{\cname{id}}\in \funsym{C}(p)$ with $\cname{id}\in\vec{\cname{id}}$. If all places are depth-bounded, $(N,m_0)$ is called depth-bounded. \end{definition} Depth-boundedness is undecidable for $\nu$-PNs~\cite{RVFE11} and thus also for t-PNIDs\xspace. \begin{proposition} Depth-boundedness is undecidable for t-PNIDs\xspace. \end{proposition} The idea of depth-boundedness, is to consider a single identifier in isolation, and study its reachability graph. Intuitively, an object of a given type ``enters'' the system via an emitter that creates a unique identifier that refers to the object. The identifier remains in the system, until the object ``leaves'' the system by firing a collecting transition (that binds to the identifier and consumes the last token in the net that refers to it). In other words, if a type has emitters and collectors, it has a life-cycle, which can be represented as a process. The process of a type is the model describing all possible paths for the type. It can be derived by taking the projection of the t-PNID\xspace on all transitions and places that are ``involved'' in the type. \begin{definition}[Type projection] Let $\lambda \in \Lambda$ be a type. Given a t-PNID\xspace $N = (P_N, T_N, F_N, \alpha_N, \beta_N)$, its $\lambda$-projection $\pi_\lambda(N) = (P, T, F, W)$ is a Petri net defined by: \begin{itemize} \item $P = \{ p \in P_N \mid \lambda \in \alpha_N(p) \}$; \item $T = \{ t \in T_N \mid \exists p \in P_N : \lambda \in \ensuremath {type}_{\ensuremath{\mathcal{V}}}(\beta_N((p,t))) \vee \lambda \in \ensuremath {type}_{\ensuremath{\mathcal{V}}}(\beta_N((t,p))) \}$ \item $F = F_N \cap ((P \times T) \cup (T \times P))$; \item $W(f) = |\beta_N(f)|$ for all $f \in F$. \end{itemize} \end{definition} \begin{figure}[t] \centering \begin{subfigure}{.48\textwidth} \centering \includegraphics[scale=.66]{figures/projectionProduct.pdf} \caption{Product projection} \end{subfigure}\hfill \begin{subfigure}{.48\textwidth} \centering \includegraphics[scale=.66]{figures/projectionCustomer.pdf} \caption{Customer projection} \end{subfigure} \begin{subfigure}{\textwidth} \centering \includegraphics[scale=.66]{figures/projectionOrder.pdf} \caption{Order projection} \end{subfigure} \caption{Type projections of Fig.~\ref{fig:overallModel}. The customer projection is not sound, as place $p$ is not bounded.}\label{fig:projections} \end{figure} Figure~\ref{fig:projections} shows the three type projections of $N_{\mathit{rs}}$. As an emitter of a type creates a new identifier, and a collector removes the created identifier, each type with emitters and collectors can be represented as a transition-bordered WF-net~\cite{HeeSW13}. Instead of a source and a sink place, a transition-bordered WF-net has dedicated transitions that represent the start and finish of a process. A transition-bordered WF-net is sound, if its closure is sound~\cite{HeeSW13}. As shown in Fig.~\ref{fig:tBorderedNet}, the closure is constructed by creating a new source place $i$ so that each emitting transition consumes from $i$, and a new sink place $f$ so that each collecting transition produces in $f$. In the remainder of this section, we develop this intuition of soundness of type projections into the concept of identifier soundness of t-PNID\xspace{}s. \begin{figure}[t] \centering \begin{subfigure}{.4\textwidth} \centering \includegraphics[scale=.5]{figures/transitionBorderedNet} \caption{} \end{subfigure} \begin{subfigure}{.4\textwidth} \centering \includegraphics[scale=.5]{figures/transitionBorderedNetClosure} \caption{} \end{subfigure} \caption{A transition-bordered WF-Net (a) and its closure (b)~\cite{HeeSW13}.}\label{fig:tBorderedNet} \end{figure} Without loss of generality, given a marked t-PNID\xspace $(N,m)$, the $\lambda$-projection of its marking is the marking $\pi_\lambda^N(m)\in\mult{P}$ such that for every place $p\in\rng{\pi_\lambda^N(m)}$ it holds that $\lambda \in \alpha_(p)$. Many soundness definitions constitute of two properties: proper completion and weak termination. \emph{Proper completion} states that once a marking is reached that has a token in the final marking, it is the final marking. In other words, as soon as a token is produced in the final place, all other places should be empty. Following the idea of transition-bordered WF-nets, identifiers should have a similar property: once a collector consumes one or more identifiers, then no further tokens carrying those identifiers should persist in the marking obtained after the consumption. \begin{definition}[Proper type completion] \label{def:completion} Given a type $\lambda\in\Lambda$, a marked t-PNID\xspace $(N, m_0)$ is called \emph{properly $\lambda$-completing} iff for all $t \in C_N(\lambda)$, bindings $\psi : \ensuremath{\mathcal{V}}\to\ensuremath{\mathcal{I}}$ and markings $m, m'\in\reachable{N}{m_0}$, if $\fire{m}{t,\psi}{m'}$, then for all identifiers $\cname{id} \in \rng{\restr{\psi}{\delvar{t}}} \cap \id{m}$ and $\ensuremath {type}(\cname{id})=\lambda$, it holds that $\cname{id}\not\in\id{m'}$.\footnote{Here, we constrain $\psi$ only to objects of type $\lambda$ that are only consumed.} \end{definition} Intuitively, from the perspective of a single identifier of type $\lambda$, if a t-PNID\xspace $N$ that generated it is properly $\lambda$-completing, then the points of consumption for this identifier are mutually exclusive (that is, it can be consumed from the net only by one of the collectors from $C_N(\lambda)$). As an example, consider t-PNID\xspace $N_{\mathit{rs}}$ in Fig.~\ref{fig:overallModel}. For type $\mathit{customer}$, we have $C_{N_{\mathit{rs}}}(\mathit{customer}) = \{K, V\}$. In the current -- empty -- marking, transition $T$ is enabled with binding $\psi = \{y\mapsto \cname{o}, z\mapsto \cname{c}\}$, which results in marking $m$ with $m(\textit{customer}) = [\cname{c}]$. Next, transitions $G$, $H$, $J$, $L$ and $N$ can fire, all using the same binding, producing marking $m'$ with $m'(p) = [\cname{o},\cname{c}]$, $m'(\mathit{customer}) =[\cname{c}]$ and $m'(q) = M'(r) = [\cname{c}]$. Hence, transition $K$ is enabled with binding $\psi$. However, firing $K$ with $\psi$ results in marking $m''$ with $m''(\mathit{customer}) = [\cname{c}]$, while $\psi(z) = \cname{c}$. Hence, $N_{\mathit{rs}}$ is not properly $\mathit{customer}$-completing. \emph{Weak termination} signifies that from any reachable marking, the final marking can be reached. Translated to identifiers, removing an identifier from a marking should always eventually be possible. \begin{definition}[Weak type termination] \label{def:termination} Given a type $\lambda\in\Lambda$, a marked t-PNID\xspace $(N, m_0)$ is called \emph{weakly $\lambda$-terminating} iff for every $m \in \reachable{N}{m_0}$ and identifier $\cname{id} \in I(\lambda)$ such that $\cname{id} \in \id{m}$, there exists a marking $m' \in \reachable{N}{m}$ with $\cname{id} \not\in \id{m'}$. \end{definition} \emph{Identifier soundness} combines the properties of proper type completion and weak type termination: the former ensures that as soon a collector fires for an identifier, the identifier is removed, whereas the latter ensures that it is always eventually possible to remove that identifier. \begin{definition} \label{def:soundness} A marked t-PNID\xspace $(N,m_0)$ is \emph{$\lambda$-sound} iff it is properly $\lambda$-completing and weakly $\lambda$-terminating. It is \emph{identifier sound} iff it is $\lambda$-sound for every $\lambda\in \ensuremath {type}(N)$. \end{definition} Two interesting observations can be made about the identifier soundness property. First, identifier soundness does not imply soundness in the classical sense: any classical net $N$ without types, i.e., $\ensuremath {type}(N) = \emptyset$, is identifier sound, independently of the properties of $N$. Second, identifier soundness implies depth-boundedness. In other words, if a marked t-PNID\xspace is identifier sound for all types, it cannot accumulate infinitely many tokens carrying the same identifier. \begin{lemma}\label{lemma:depth} If a t-PNID\xspace $(N, m_0)$ is identifier sound, then it is depth-bounded. \end{lemma} \begin{proof} Suppose that $(N,m_0)$ is identifier sound, but not depth-bounded. Then, at least for one place $p\in P$ and identifier $\cname{id}\in\funsym{C} (p)$ of type $\vec\lambda$ there exists an infinite sequence of increasing markings $m_i$, all reachable in $(N,m_0)$, such that $m_i(p)(\cname{id})<m_{i+1}(p)(\cname{id})$. Assume $\lambda\in\vec\lambda$. As $(N,m_0)$ weakly $\lambda$-terminates, there exists $m' \in \reachable{N}{m}$ such that $\cname{u} \not\in \id{m'}$, where $\ensuremath {type}(\cname{u})=\lambda$. This means that the above sequence cannot exist as all constituents of $\cname{id}$ must be eventually removed. Hence, $(N,m_0)$ is depth-bounded. \end{proof} As identifier soundness relies on reachability, it is undecidable. This also naturally follows from the fact that all non-trivial decision problems are undecidable for Petri nets in which tokens carry pairs of data values (taken from unordered domains) and in which element-wise equality comparisons are allowed over such pairs in transition guards~\cite{Lasota16}. \begin{theorem} Identifier soundness is undecidable for t-PNIDs\xspace. \end{theorem} \begin{proof} Let $(N,m_0)$ be a marked t-PNID\xspace. By Definition~\ref{def:soundness}, it needs to be properly completing and weakly terminating. As the latter requires a reachability test, it is undecidable by Prop.~\ref{prop:reachabilityundecidable}. \end{proof} \begin{figure}[t] \centering \begin{subfigure}{0.4\textwidth} \includegraphics[scale=.66]{figures/SoundnessProjectionDoesNotImplyIdentifierSoundnessN1} \caption{$N_1$}\label{fig:projectionNotSufficientN1} \end{subfigure} \begin{subfigure}{0.4\textwidth} \includegraphics[scale=.66]{figures/SoundnessProjectionDoesNotImplyIdentifierSoundnessN2} \caption{$N_2$}\label{fig:projectionNotSufficientN2} \end{subfigure} \caption{Two t-PNID\xspace{}s. Net $N_1$ is identifier sound, whereas net $N_2$ is not identifier sound.}\label{fig:projectionNotSufficient} \end{figure} The underlying idea of identifier soundness is that each type projection should behave well, i.e., each type projection should be sound. Consider in t-PNID\xspace $N_{\mathit{rs}}$ of Fig~\ref{fig:overallModel}, identifier type $\mathit{customer}$. The life cycle starts with transition $T$. Transitions $K$ and~$V$ are two transitions that may remove the last reference to a $\mathit{customer}$. Soundness of a transition-bordered WF-net would require that firing transition $K$ or transition $V$ would result in the final marking. However, this is not necessarily the case. Consider the firing of transitions $T$, $G$ and $K$. Then, the token in place \emph{customer} remains, while the final transition $K$ already fired. Hence, the \emph{customer} life cycle is not sound. This raises the question whether we may conclude from this observation that $N_{\mathit{rs}}$ is not identifier sound. Unfortunately, identifier soundness is not compositional, i.e., identifier soundness does not imply soundness of the type projections, and vice versa. Consider the example t-PNID\xspace{}s in Fig.~\ref{fig:projectionNotSufficient}. The first net, $N_1$, is identifier sound. Places $p$ and $q$ ensure that transitions $B$ and $D$ are executed once. Taking the $\ensuremath {type}_{\ensuremath{\mathcal{V}}}(y)$ projection of $N_1$ results in a bordered transition WF net that is unsound: if transition $D$ fires fewer times than transition $B$, tokens will remain in place $p$. The reverse is false as well. Consider net $N_2$ in Fig.~\ref{fig:projectionNotSufficient}. Each of the two projections are sound. However, the resulting net reaches a deadlock after firing transitions $A$ and $C$: a token remains in place $p$. Hence, $N_2$ is not weakly $\ensuremath {type}_{\ensuremath{\mathcal{V}}}(x)$-completing. \begin{theorem} Let $\lambda\in \Lambda$ be a type, and let $(N, m_0)$ be a marked t-PNID\xspace. Then: \begin{enumerate} \item identifier soundness of $(N,m_0)$ does not imply soundness of $(\pi_\lambda(N),\pi_\lambda^N(m))$, and \item soundness of $(\pi_\lambda(N), \pi_\lambda^N(m))$ does not imply that $(N,m_0)$ is identifier sound. \end{enumerate} \end{theorem} Consequently, compositional verification of soundness of each of the projections is not sufficient to conclude anything about identifier soundness of the complete net, and vice versa. \subsection{Towards Verification of Logical Criteria}% \label{sec:verification} We now describe how existing results on the verification of safety and temporal properties over variants of Petri nets \cite{MontaliR16,GGMR22} and transition systems operating over relational structures \cite{CalvaneseGMP18,CalvaneseGMP22} can be lifted to the case of \emph{bounded} t-PNIDs\xspace. Boundedness is a sufficient requirement to make the verification of such properties decidable. We start by considering safety checking of t-PNIDs\xspace, considering the recent results presented in~\cite{GGMR22}. A safety property is a property that must hold globally, that is, in every marking of the net. Such a property is usually checked by formulating its unsafety dual and verifying whether a marking satisfying that unsafety property is reachable. \begin{definition}[Unsafety property] \label{def:property} An \emph{unsafety property} over a t-PNID\xspace $N$ is a formula $\exists y_1,\ldots, y_k. \psi(y_1,\ldots, y_k)$, where $\psi$ is defined as follows: \[\psi::=p(x_1\cdots x_n)\geq c\,|\,x=y\,| x\neq y\,|\,p\geq c\,|\,\psi\land\psi,\] Here: \begin{inparaenum}[\it (i)] \item $p$ is a place name from $N$, \item $x_i\in \ensuremath{\mathcal{V}}$ (for every $1\leq i\leq n$), \item $x,y\in \ensuremath{\mathcal{V}}\cup\ensuremath{\mathcal{I}}$, \item $p\geq c$ and $p(x_1\cdots x_n)\geq c$ are atomic predicates defined over place markings with $c\in\mathbb{N}$. \end{inparaenum} \end{definition} Given a marked t-PNID\xspace $(N,m_0)$, each atomic predicate is interpreted on all possible markings covering those from $\reachable{N}{m_0}$. Like that, $p\geq c$ specifies that in place $p$ there are at least $c$ tokens, whereas $p(x_1\cdots x_n)\geq c$ indicates that in place $p$ there are at least $c$ tokens carrying the identifier $x_1 \cdots x_n$. We use elements from $x_1,\ldots, x_n$ as a filter selecting matching tokens in $p$, and use the variables from the same sequence to inspect different places by creating implicit joins between tokens stored therein. As it has been established in~\cite{GGMR22}, such unsafety properties can be used for expressing object-aware \emph{coverability} properties of t-PNIDs\xspace. For example, as a property we may write that $\exists x,y. \mathit{created\_offer}(x,y)\geq 1 \land \mathit{customer}(y)\ge 1$ captures the (undesired) situation in which an offer has been made to customer $x$, but that customer is still available for receiving other offers. The verification problem for checking unsafety properties is specified as follows: given an unsafety property $\psi$, a marked t-PNID\xspace $(N,m_0)$ is \emph{unsafe} w.r.t. $\psi$ if $(N,m_0)$ can reach a marking in which $\psi$ holds. If this is not the case, then we say that $(N, m_0)$ is \emph{safe} w.r.t.~$\psi$. We show below that such verification problem is actually decidable. \begin{proposition} Verification of unsafety properties over bounded, marked t-PNIDs\xspace is decidable. \end{proposition} \begin{proof} The proof immediately follows from the decidability results for OA-nets described in~\cite{GGMR22}. \end{proof} One may wonder whether it is possible to go beyond safety and check other properties expressible on top of t-PNIDs\xspace using more sophisticated temporal logics. We answer to this question affirmatively, by proving that bounded t-PNIDs\xspace induce transitions systems that enjoy the so-called \emph{genericity} property~\cite{CalvaneseGMP18}. Such property, combined with t-PNID\xspace boundedness (which corresponds to the notion of state-boundedness used in~\cite{CalvaneseGMP18}) guarantees decidability of model checking for sophisticated variants of first-order temporal logics~\cite{HaririCGDM13,CalvaneseGMP18,CalvaneseGMP22}. In generic transition systems, the behaviour does not depend on the actual data present in the states, but only on how they relate to each other. This essentially reconstructs the well-known notion of genericity in databases, which expresses that isomorphic databases return the same answers to the same query, modulo renaming of individuals~\cite{AbiteboulHV95}. We lift the notion of genericity to the case of transition systems induced by t-PNIDs\xspace. To proceed, we first need to define a suitable notion of isomorphism between two markings of a net. \begin{definition}[Marking isomorphism] \label{def:marking-isomorphism} Given a t-PNID\xspace $N$ and two markings $m_1,m_2 \in \mathbb{M}(N)$, we say that $m_1$ and $m_2$ are \emph{isomorphic}, written $m_1\sim_h m_2$, if there exits a bijection (called \emph{isomorphism}) $h:Id(m_1)\to Id(m_2)$ such that for every $p\in P$, it holds that $(\cname{id_1}\cdots\cname{id_n})^k\in m_1$ iff $(h(\cname{id_1})\cdots h(\cname{id_n}))^k\in m_2$, for every $k \in \mathbb{N}$. \end{definition} Intuitively, two markings are called isomorphic if they have the same amount of tokens and tokens correspond to each other modulo consistent renaming of identifiers. \begin{definition}[Generic transition system] \label{def:generic-ts} Let $\tsys{} = (S,A,s_0, \to)$ be the transition system induced by some t-PNID\xspace. Then $\tsys{}$ is \emph{generic} if for every markings $m_1,m_1',m_2\in S$ and every bijection $h:\ensuremath{\mathcal{I}}\to \ensuremath{\mathcal{I}}$, if $m_1\sim_h m_2$ and $\fire{m_1}{t,\psi}{m_1'}$ (for some $t\inT$ and binding $\psi:\ensuremath{\mathcal{V}}\to\ensuremath{\mathcal{I}}$), then there exists $m_2'\in S$ and $\psi':\ensuremath{\mathcal{V}}\to\ensuremath{\mathcal{I}}$ such that $\fire{m_2}{t,\psi'}{m_2'}$, $m_1'\sim_h m_2'$ and $\psi(v)=h(\psi'(v))$, for every $v\in\ensuremath{\mathcal{V}}$. \end{definition} As one can see from the definition, genericity requires that if two marking are isomorphic, then they induce the same transitions modulo isomorphism (i.e., the transition names are the same, and the variable assignments are equivalent modulo renaming). This implies that they induce isomorphic successors. \begin{remark} Let $(N,m_0)$ be a marked t-PNID\xspace. Then its induced transition system $\tsys{N,m_0}$ is generic. \end{remark} The above result can be easily shown by considering the transition system construction descried in Definition~\ref{def:induced-ts}, by defining isomorphism between its markings by using a simple renaming function and checking the conditions of Definition~\ref{def:generic-ts}. As it has been demonstrated in \cite{CalvaneseGMP18,CalvaneseGMP22}, model checking of sophisticated first-order variants of $\mu$-calculus and LTL becomes decidable for so-called state-bounded generic transition systems. Since the transition systems induced by t-PNIDs\xspace are also generic, and boundedness of a t-PNID\xspace correspond to state-boundedness of its induced transition system, we directly obtain decidability of model checking for the same logics considered there, extended in our case over atomic predicates of the form $p\odot c$ and $p(x_1\cdots x_n)\odot c$, where $\odot\in\set{<,>,=,\leq,\geq}$, in the style of similar logics introduced in~\cite{MontaliR16}. We shall refer to such logics as $\mu\L{\text{-FO}}^{\text{PNID}}$ and $LTL\text{-}FO_p^{\text{PNID}}$, but in this work we omit their definition. \begin{theorem} \label{thm:model-checking} Model checking of $\mu\L{\text{-FO}}^{\text{PNID}}$ and $LTL\text{-}FO_p^{\text{PNID}}$ formulae is decidable for bounded, marked t-PNIDs\xspace. \end{theorem} \section{Preliminaries} Let $S$ and $T$ be sets. The powerset of $S$ is denoted by $\powerset{S} = \{ S' \mid S' \subseteq S\}$ and $|S|$ denotes the cardinality of $S$. Given a relation $R \subseteq S \times T$, its range is defined by $\rng{R} = \{y \in T \mid \exists x \in S : (x,y)\in R\}$. A \emph{multiset} $m$ over $S$ is a mapping of the form $m:S\rightarrow \mathbb{N}$, where $\mathbb{N} = \{0, 1, 2, \ldots\}$ denotes the set of natural numbers. For $s \in S$, $m(s) \in \mathbb{N}$ denotes the number of times $s$ appears in the multiset. We write $s^n$ if $m(s)=n$. For $x \not\in S$, $m(x) = 0$. We use $\mult S$ to denote the set of all finite multisets over $S$ and $\emptyset$ to denote the \emph{empty multiset}. The support of $m\in\mult S$ is the set of elements that appear in $m$ at least once: $\supp{m} = \set{s\in S\mid m(s) > 0}$. Given two multisets $m_1$ and $m_2$ over $S$: \begin{inparaenum}[\it (i)] \item $m_1 \subseteq m_2$ (resp., $m_1 \subset m_2$) iff $m_1(s) \leq m_2(s)$ (resp., $m_1(s) < m_2(s)$) for each $s \in S$; \item $m_1 + m_2 = \set{s^n\mid s\in S, n =m_1(s) + m_2(s)}$; \item if $m_1 \subseteq m_2$, $m_2 - m_1 = \set{s^n \mid s\in S, n=m_2(s) - m_1(s)}$; and \item $|m|=\sum_{s\in S}m(s)$. \end{inparaenum} A \emph{sequence} over $S$ of length $n \in \mathbb{N}$ is a function $\sigma : \{1,\ldots,n\} \to S$. If $n > 0$ and $\sigma(i) = a_i$, for $1\leq i \leq n$, we write $\sigma = \sequence{a_1, \ldots, a_n}$. The length of a sequence $\sigma$ is denoted by $|\sigma|$. The sequence of length $0$ is called the \emph{empty sequence}, and is denoted by $\ensuremath \epsilon$. The set of all finite sequences over $S$ is denoted by $S^*$. We write $a \in \sigma$ if there is $1 \leq i \leq |\sigma|$ such that $\sigma(i) = a$. Projection of sequences on a set $T$ is defined inductively by $\proj{\ensuremath \epsilon}{T} = \ensuremath \epsilon$, $\proj{(\sequence{a}\cdot \sigma)}{T} = \sequence{a}\cdot \proj{\sigma}{T}$ if $a \in T$ and $\proj{\sequence{a}\cdot \sigma}{T} = \proj{\sigma}{T}$ otherwise, where $\cdot $ is the sequence concatenation operator. Renaming a sequence with an injective function $r : S \rightarrow T$ is defined inductively by $\rho_r(\ensuremath \epsilon) = \ensuremath \epsilon$, and $\rho_r(\sequence{a}\cdot \sigma) = \sequence{r(a)}\cdot \rho_r(\sigma)$. Renaming is extended to multisets of sequences as follows: given a multiset $m \in \mult{(S^*)}$, we define $\rho_r(m) = \sum_{\sigma\in\supp{m}} \sigma(m)\cdot\rho_r(\sigma)$. For example, $\rho_{\{x\mapsto a, y \mapsto b\}}(\sequence{x,y}^3) = \sequence{a,b}^3$. \medskip\noindent \textbf{Labeled Transition Systems.}\quad To model the behavior of a system, we use \emph{labeled transition systems}. Given a finite set $A$ of (action) labels, a \emph{(labeled) transition system} (LTS) over $A$ is a tuple $\tsys{}{} = (S,A,s_0, \to)$, where $S$ is the (possibly infinite) set of \emph{states}, $s_0$ is the \emph{initial state} and $\to\ \subset (S\times (A \cup \{\tau\}) \times S)$ is the \emph{transition relation}, where $\tau\not\in A$ denotes the silent action~\cite{glabbeekoverviewii}. In what follows, we write $s \xrightarrow{a} s'$ for $(s,a,s') \in \to$. Let $r : A \to (A' \cup \{\tau\})$ be an injective, total function. Renaming $\tsys{}{}$ with $r$ is defined as $\rho_{r}(\Gamma) = (S, A \setminus A', s_0, \to')$ with $(s,r(a),s') \in \to'$ iff $(s,a,s') \in \to$. Given a set $T$, hiding is defined as $\hide{T}(\Gamma) = \rho_{h}(\Gamma)$ with $h : A \rightarrow A \cup \{\tau\}$ such that $h(t) = \tau$ if $t \in T$ and $h(t)=t$ otherwise. Given $a\in A$, $p \xdasharrow{~a~} q$ denotes a \emph{weak transition relation} that is defined as follows: \begin{inparaenum}[\it (i)] \item $p \xdasharrow[->]{~a~} q$ iff $p (\xrightarrow{\tau})^* q_1\xrightarrow{a}q_2 (\xrightarrow{\tau})^* q$; \item $p \xdasharrow[->]{\ensuremath{~\tau~}} q$ iff $p (\xrightarrow{\tau})^* q$. \end{inparaenum} Here, $(\xrightarrow{\tau})^*$ denotes the reflexive and transitive closure of $\xrightarrow{\tau}$. \begin{definition}[Strong and weak bisimulation] \label{def:bisimulation}\label{def:strong-bisimulation} Let $\tsys{1} = (S_1,A,s_{01},\to_1)$ and $\tsys{2} = (S_2,A,s_{02},\to_2)$ be two LTSs. A relation $R\subseteq(S_1 \times S_2)$ is called a \emph{strong simulation}, denoted as $\tsys{1} \prec_R \tsys{2}$, if for every pair $(p,q)\in R$ and $a\in A \cup \{\tau\}$, it holds that if $p\xrightarrow{a}_1 p'$, then there exists $q'\inS_2$ such that $q \xrightarrow{a}_2 q'$ and $(p',q')\in R$. Relation $R$ is a \emph{weak simulation}, denoted by $\tsys{1} \preccurlyeq_R \tsys{2}$, iff for every pair $(p,q)\in R$ and $a\in A \cup \{\tau\}$ it holds that if $p\xrightarrow{a}_1 p'$, then either $a = \tau$ and $(p', q) \in R$, or there exists $q'\inS_2$ such that $q \xdasharrow{~a~}_{\hspace{-.5ex} 2} ~q'$ and $(p',q')\in R$. $R$ is called a strong (weak) \emph{bisimulation}, denoted by $\tsys{1} \sim_R \tsys{2}$ ($\tsys{1} \approx_R \tsys{2}$) if both $\tsys{1} \prec \tsys{2}$ ($\tsys{1} \preccurlyeq_R \tsys{2}$) and $\tsys{2} \prec_{R^{-1}} \tsys{1}$ ($\tsys{2} \preccurlyeq_{R^{-1}} \tsys{1}$). The relation is called \emph{rooted} iff $(s_{01}, s_{02}) \in R$. A rooted relation is indicated with a superscript ${}^r$. \end{definition} \medskip\noindent \textbf{Petri nets.}\quad A weighted Petri net is a 4-tuple $(P,T,F,W)$ where $P$ and $T$ are two disjoint sets of \emph{places} and \emph{transitions}, respectively, $F \subseteq ((P \times T) \cup (T\times P))$ is the \emph{flow relation}, and $W : F \rightarrow \mathbb{N}^+$ is a \emph{weight function}. For $x\inP\cupT$, we write $\pre{x}=\set{y\mid (y,x)\inF}$ to denote the \emph{preset} of $x$ and $\post{x}=\set{y\mid (x,y)\inF}$ to denote the \emph{postset} of $x$. We lift the notation of preset and postset to sets element-wise. If for a Petri net no weight function is defined, we assume $W(f) = 1$ for all $f \in F$. A \emph{marking} of $N$ is a multiset $m \in \mult P$, where $m(p)$ denotes the number of \emph{tokens} in place $p \in P$. If $m(p) > 0$, place $p$ is called \emph{marked} in marking $m$. A \emph{marked Petri net} is a tuple $(N, m)$ with $N$ a weighted Petri net with marking $m$. A transition $t\in T$ is enabled in $(N,m)$, denoted by $\enabled{(N,m)}{t}$ iff $W((p,t)) \leq m(p)$ for all $p \in \pre{t}$. An enabled transition can \emph{fire}, resulting in marking $m'$ iff $m'(p) + W((p,t)) = m(p) + W((t,p))$, for all $p \in P$, and is denoted by $\fire{(N,m)}{t}{(N,m')}$. We lift the notation of firings to sequences. A sequence $\sigma \in T^*$ is a \emph{firing sequence} iff $\sigma = \ensuremath \epsilon$, or markings $m_0, \ldots, m_n$ exist such that $\fire{(N,m_{i-1})}{\sigma(i)}{(N,m_{i})}$ for $1 \leq i \leq |\sigma| = n$, and is denoted by $\fire{(N,m_0)}{\sigma}{(N,m_n)}$. If the context is clear, we omit the weighted Petri net $N$. The set of reachable markings of $(N,m)$ is defined by $\reachable{N}{m} = \{ m' \mid \exists \sigma \in T^* : \fire{m}{\sigma}{m'} \}$. The semantics of a marked Petri net $(N,m)$ with $N = (P, T, F, W)$ is defined by the LTS $\Gamma_{N,m} = (\mult P, T, m_0, \to)$ with $(m,t,m') \in \to$ iff $\fire{m}{t}{m'}$. \medskip \noindent \textbf{Workflow Nets.}\quad A \emph{workflow net} (WF-net for short) is a tuple $N=(P, T, F,W,\mathit{in},\mathit{out})$ such that: \begin{inparaenum}[\it (i)] \item $(P, T, F, W)$ is a weighted Petri net; \item $\mathit{in},\mathit{out}\inP$ are the source and sink place, respectively, with $\pre{\mathit{in}} =\post{\mathit{out}}= \emptyset$; \item every node in $P \cup T$ is on a directed path from $\mathit{in}$ to $\mathit{out}$. \end{inparaenum} $N$ is called \emph{$k$-sound} for some $k \in \mathbb{N}$ iff \begin{inparaenum}[\it (i)] \item it is proper completing, i.e., for all reachable markings $m \in \reachable{N}{[\mathit{in}^k]}$, if $[\mathit{out}^k]\subseteq m$, then $m = [\mathit{out}^k]$; \item it is weakly terminating, i.e., for any reachable marking $m \in \reachable{N}{[\mathit{in}^k]}$, the final marking is reachable, i.e., $[\mathit{out}^k] \in \reachable{N}{m}$; and \item it is quasi-live, i.e., for all transitions $t\inT$, there is a marking $m\in\reachable{N}{[\mathit{in}]}$ such that $\enabled{m}{t}$. \end{inparaenum} The net is called \emph{sound} if it is $1$-sound. If it is $k$-sound for all $k\in\mathbb{N}$, it is called \emph{generalized sound}~\cite{HeeSV03}. \section{Related Work}\label{sec:relatedwork} This work belongs to the line of research that aims at augmenting pure control-flow description of processes with data, and study formal properties of the resulting, integrated models. When doing so, it becomes natural to move from case-centric process models whose analysis focuses on the evolution of a single instance in isolation, to so-called \emph{object-centric process models} where multiple related instances of the same or different processes co-evolve. This is relevant for process modeling, analysis, and mining~\cite{Aalst19}. Different approaches to capture the control-flow backbone of object-oriented processes have been studied in literature, including declarative \cite{ArtaleKMA19} and database-centric models \cite{MonC16}. In this work, we follow the Petri net tradition, which comes with three different strategies to tackle object-centric processes. A first strategy is to represent objects implicitly. The most prominent example in this vein is constituted by proclets \cite{Fahland19}. Here, each object type comes with a Petri net specifying its life cycle. Special ports, annotated with multiplicity constraints, are used to express generation and synchronization points in the process, operating over tokens that are implicitly related to co-referring objects. Correctness analysis of proclets is an open research topic. A second strategy is to represent objects explicitly. Models adopting this strategy are typically extensions of $\nu$-PNs \cite{RVFE11}, building on their ability to generate (fresh) object identifiers and express guarded transitions relating multiple objects at once. While $\nu$-PNs attach a single object to each token, Petri nets with identifiers (PNIDs)~\cite{HSVW09} use vectors of identifiers on tokens, representing database transactions. representing and evolving relationships between objects call for extending this to tuples of objects, in the style of~\cite{HSVW09}. For such Petri nets with identifiers (PNIDs),~\cite{HSVW09} provides patterns capturing different types of database transactions. The ISML approach \cite{PolyvyanyyWOB19} equips Petri nets with identifiers (PNIDs)~\cite{HSVW09} with the ability of manipulating populations of objects defining the extensional level of an ORM data model. Transitions can be executed if they do not lead to violating the constraints captured in the data model. For such models, correctness properties are assessed by imposing that the overall set of object identifiers is finite, and fixed a-priori. This ensures that the overall state space is indeed finite, and can be analyzed using conventional methods. Catalog-nets~\cite{GhilardiGMR20} extend PNIDs with the ability of querying a read-only database containing background information. Correctness properties are checked parametrically to the content of read-only database. Decidability and other meta-properties, as well as actual algorithms for verification based on SMT model-checking, are given for safety properties, whereas (data-aware) soundness can only be assessed for state-bounded system \cite{BCMD14,MonC16}. The third, final strategy for modeling object-centric processes with Petri nets is to rely on models that highlight how multiple objects of different types may flow through shared transitions, without considering object identifier values. This approach is followed in \cite{AalstB20}, where object-centric nets are extracted from event logs, where logged events might come with sets of object identifiers. Soundness for this model is studied in \cite{LoMR21}, where the authors propose to check related correctness criteria for object types, without considering concrete object identifiers, or for single objects in isolation that are still allowed to interact with the system environment along their life-cycles. Similarly to the approach studied in this paper, the authors in~\cite{LoMR21} assume that the system model can have any number of objects being simultaneously active. The approach studied in this paper focuses on the essence of Petri net-based object-centric processes adopting the explicit approach, that is, grounded on PNIDs. We provide, for the first time, a notion of \emph{identifier soundness} that conceptually captures the intended evolution of objects within a net, show that such a property is undecidable to check in general, and provide a pattern-based construction technique that guarantees to produce identifier-sound models. Other works that propose more high-level extensions of classical WF-nets as well as the related notion(s) of soundness. In~\cite{LeoniFM18,FelliLM19,LeoniFM20}, the authors investigated data-aware soundness for data Petri nets, in which a net is extended with guards manipulating a finite set of variables associated with the net. That type of soundness was shown to be decidable. In~\cite{MontaliR16}, the authors proposed both a workflow variant of $\nu$-Petri nets as well as its resource-aware extension. The authors also defined a suitable notion of soundness for such nets and demonstrated that it is decidable by reducing the soundness checking problem to a verification task over another first order logic-based formalism. \cite{HaarmannW20,CaseModels2020} considered the soundness property for BPMN process models with data objects that can be related to multiple cases. The approach consists of several transformation steps: from BPMN to a colored Petri net and then to a resource-constrained workflow net. The authors then check k-soundness against the latter. Resource-constrained workflow nets pose different requirements on soundness. In \cite{BBS07} the authors studied a specific class of WFR-nets for which soundness was shown to be decidable. In \cite{HeeSSV05,SidorovaS13} a more general class of Resource-Constrained Workflow Nets (RCWF-nets) was defined. The constraints are imposed on resources and require that all resources that are initially available are present again after all cases terminate, and that for any reachable marking, the number of available resources does not override the number of initially available resources. In \cite{HeeSSV05} it was proven that for RCWF-nets with a single resource type generalized soundness can be effectively checked in polynomial time. Decidability of generalized soundness for RCWF-nets with an arbitrary number of resource places was shown in~\cite{SidorovaS13}. \endinput \subsection{Modeling Object-centric and Data-aware Processes using Petri nets} Multiple Petri net-based approaches have been used for modeling data- and object-aware processes. Here we briefly cover only the most recent ones. The formalism of Petri nets with identifiers (PNIDs) was studied in~\cite{HSVW09}. In such nets, tokens carry tuples of object identifiers (or references). Moreover, transitions can produce globally new data values that are different from those in a current marking. PNIDs have been also used as the process modeling language in the Information Systems Modeling Language (ISML) presented in~\cite{PolyvyanyyWOB19}. In ISML, PNIDs are paired with special CRUD operations defining operations over relevant data. Such data are structured according to an ORM model. A viewpoint on multi-case and data-aware process models is covered by works on so-called \emph{Proclets}. This concept was first proposed in~\cite{AalstBEW00}. Proclets are essentially quasi-workflows representing lifecycles of particular objects and allowing for different types of communication between such lifecycles via dedicated channels. The Proclet notation was applied to model processes with complex interactions between process objects \cite{Fahland19} as well as artifact-centric processes \cite{Fahland193}. Process artifacts here are documents, orders, deliveries, and other types of data objects which are manipulated within the process. Artifact-centric process models consider these objects as first-class citizens. Note that in such models process cases are often related to object types that leads to inter-case dependencies when more complicated communication patterns are involved. In~\cite{GhilardiGMR20} the authors introduced catalog-nets (CLog-nets). Conceptually, the formalism marries read-only relational databases with a variant of colored Petri nets~\cite{JeK09} which allows for generation of globally fresh data values upon transition firing. In CLog-nets, transitions are equipped with guards that simultaneously inspect the content of tokens and query facts stored in the database. \subsection{Soundness for Workflow Nets and their Extensions} The notion of soundness for classical WF-nets was initially discussed in~\cite{Aalst98}.\footnote{This notion coincides with the one presented in the beginning of Section~\ref{sec:soundness}.} Since then, many different variants of soundness have been proposed for WF-nets and their non-high-level extensions. An extensive study on such variants as well as related decidability results can be found in~\cite{AHHS11}. In the following, we briefly touch upon some of the soundness notions. Perhaps one of the most important generalizations of classical soundness are $k$-soundness and generalized soundness \cite{HeeSV04}. A WF-net is $k$- sound if, starting with $k$ tokens in its source place, it always properly terminates with $k$ tokens in its sink place. Hence this notion allows handling multiple individual processes (cases) in a WF-net. The classical soundness then coincides with 1-soundness. Generalized soundness is $k$-soundness for all $k$. It was proved in \cite{HeeSV04} that both $k$-soundness and generalized soundness are decidable. One of the important aspects of workflow development concerns resource management. In classical Petri nets, one can distinguish places, corresponding to control flow states, and places, representing different kinds of resources. There are various works that study different resource-aware extensions of WF-nets together with related notions of soundness. In \cite{BBS07} the authors studied a specific class of WFR-nets for which soundness was shown to be decidable. In \cite{HeeSSV05,SidorovaS13} a more general class of Resource-Constrained Workflow Nets (RCWF-nets) was defined. The constraints are imposed on resources and require that all resources that are initially available are present again after all cases terminate, and that for any reachable marking, the number of available resources does not override the number of initially available resources. In \cite{HeeSSV05} it was proven that for RCWF-nets with a single resource type generalized soundness can be effectively checked in polynomial time. Decidability of generalized soundness for RCWF-nets with an arbitrary number of resource places was shown in~\cite{SidorovaS13} All the above mentioned works assume resources to be permanent, i.e., they are acquired and released later at the end of a (sub-)process. Since resources are never created, nor destroyed, the process state space is explicitly bounded. To study a more general case of arbitrary resource transformations (that can arise, for example, in open and/or adaptive workflow systems), in \cite{Bashkin2014} WF-nets with resources (RWF-nets) were defined. RWF-nets extended RCWF-nets from \cite{HeeSSV05} in such a way that resources can be generated or consumed during a process execution without any restrictions. Unfortunately, even 1-sound RWF-nets are not bounded in general, hence existing soundness checking algorithms are no applicable in that case. The decidability of soundness for RFW-nets was shown for a restricted case, in which a RWF-net has a single unbounded resource place There are also other works that propose more high-level extensions of classical WF-nets as well as the related notion(s) of soundness. In~\cite{LeoniFM18,FelliLM19,LeoniFM20}, the authors investigated data-aware soundness for data Petri nets, in which a net is extended with guards manipulating a finite set of variables associated with the net. That type of soundness was shown to be decidable. In~\cite{MontaliR16}, the authors proposed both a workflow variant of $\nu$-Petri nets as well as its resource-aware extension. The authors also defined a suitable notion of soundness for such nets and demonstrated that it is decidable by reducing the soundness checking problem to a verification task over another first order logic-based formalism. \cite{HaarmannW20,CaseModels2020} considered the soundness property for BPMN process models with data objects that can be related to multiple cases. The approach consists of several transformation steps: from BPMN to a colored Petri net and then to a resource-constrained workflow net. The authors then check k-soundness against the latter. \section{Conclusions} \label{sec:conclusions} Achieving harmony in models that describe how processes data objects manipulate is challenging. In this paper, we use typed Petri nets with Identifiers (t-PNIDs\xspace) to model these complex interactions of multiple objects, referred through their identifiers. We propose identifier soundness as a correctness criterion that conceptually captures the expected evolution of each object. Identifier soundness consists of two conditions: weak termination, i.e., that any identifier that is created is eventually removed, and proper type completion, i.e., when a collecting transition fires for an identifier of a type, the type should be removed from the resulting marking. Identifier soundness is in general undecidable for t-PNIDs\xspace. For two subclasses we show that identifier soundness is guaranteed, and that the overall model remains live. On top of that, we propose a resource-aware extension of t-PNIDs\xspace, in which all object manipulations are systematically guarded by a finite number of typed resources. For this class of t-PNIDs\xspace we propose a correctness criterion similar to identifier soundness, which also takes into account conditions for correct resource management. The resource soundness is deemed to be undecidable as well. Many systems allow for a dynamic number of simultaneously active objects. In theory, this number can be infinite, and thus such models become width-unbounded. However, for many systems there is a natural upper bound, which can be either assumed or guaranteed with different modeling techniques (such as multiplicity upper bounds on objects \cite{MonC16} or resources \cite{MonR16,SidorovaS13}. This gives potential for different directions for new analysis techniques. As an example, some models may have a minimum bound such that its correct behavior is guaranteed above this bound, in a similar way as 1-soundness of WF-nets guarantees correctness of its EC-closure. One can extend t-PNIDs\xspace by enriching objects with attributes over different datatypes, in the style of what done in data modeling and knowledge graphs. This calls for combining the techniques studied in this paper with data abstraction techniques used to deal with numerical datatypes, possibly equipped with arithmetics \cite{FelliLM19,FeMW22}. We plan to provide tool support for the designer of such systems. Although many correctness criteria are undecidable, this does not mean designers should be left in the dark. Since the ISM-suite~\cite{WerfP20} already allows to model t-PNIDs\xspace, we intend to work on extending it with verification techniques to support the modeler in designing systems where processes and data are in resonance. \section{Correctness by Construction} \label{sec:soundness:by:construction} As shown in the previous section, identifier soundness is undecidable. However, we are still interested in ensuring correctness criteria over the modeled system. In this section, we propose a structural approach to taming the undecidability and study sub-classes of t-PNIDs\xspace that are identifier sound by construction. \subsection{EC-Closed Workflow Nets} \label{sec:ec-wf-closure} \begin{figure}[t] \centering \includegraphics[scale=.8]{figures/EC-closure} \caption{EC-closure of a WF-net $N$.}\label{fig:EC-closure} \end{figure} WF-nets are widely used to model business processes. The initial place of the WF-net signifies the start of a \emph{case}, the final place represents the goal state, i.e., the process case completion. A firing sequence from initial state to final state represents the activities that are performed for a single case. Thus, a WF-net describes all possible sequences of a single case. Process engines, like Yasper~\cite{HeeOPSW06} simulate the execution of multiple cases in parallel by coloring the tokens with the case identifier (a similar idea is used for resource-constrained WF-net variants of $\nu$-PNs in~\cite{MonR16}). In other words, they label each place with a case type, and inscribe each arc with a variable. To execute it, the WF-net is closed with an emitter and a collector, as shown in Figure~\ref{fig:EC-closure}. We generalize this idea to any place label, i.e., any finite sequence of types may be used to represent a case. \begin{definition}[EC-Closure] \label{def:ec-closure} Given a WF-net $N$, place type $\vec{\lambda} \in \Lambda^*$ and a variable vector $\vec{v}\in\ensuremath{\mathcal{V}}^*$ such that $\ensuremath {type}_{\ensuremath{\mathcal{V}}}(\vec{v}) = \vec{\lambda}$, its \emph{EC-closure} is a t-PNID\xspace $\mathcal{W}(N, \vec{\lambda}, \vec v) = (P_N, T_N \cup \{t_E, t_C\}, F_N \cup \{(t_E, \mathit{in}), (\mathit{out}, t_C)\}, \alpha, \beta)$, with: \begin{itemize} \item $\alpha(p) =\vec{\lambda}$ for all places $p \in P_N$; \item $\beta(f) = \vec{v}\,{}^{W(f)}$ for all flows $f \in F_N$, and $\beta((t_e,\mathit{in}))=\beta((\mathit{out}, t_c)) = [\,\vec{v}\,]$. \end{itemize} \end{definition} The EC-closure of a WF-net describes all cases that run simultaneously at any given time. In other words, any reachable marking of the EC-closure is the ``sum'' of all simultaneous cases. Lemma~\ref{lemma:weak-bisim-wrappednet} formalizes this idea by establishing weak bisimulation between the projection on a single case and the original net. \begin{lemma}[Weak bisimulation for each identifier]\label{lemma:weak-bisim-wrappednet} Let $N$ be a WF-net, $\vec\lambda \in \Lambda^*$ be a place type and $\vec{v} \in \ensuremath{\mathcal{V}}^*$ be a variable vector s.t. $\ensuremath {type}_{\ensuremath{\mathcal{V}}}(\vec{v}) = \vec\lambda$. Then, for any $\cname{id} \in \ensuremath{\mathcal{I}}^{|\vec\lambda|}$, $\rho_{r}(\Gamma_{\mathcal{W}(N,\vec\lambda,\vec{v}),\emptyset}) \approx \Gamma_{N,[\mathit{in}]}$ with $r(t,\psi) = r(t)$, if $\psi(\vec{v}) = \cname{id}$, and $r((t,\psi))=\tau$, otherwise. \end{lemma} \begin{proof} Define $R = \{(M, m) \mid \forall p \in P : M(p)(a) = m(p) \}$. We need to show that $R$ is a weak bisimulation. \noindent ($\Rightarrow$) Let $M, M'$ and $m$ be such markings that $(M,m) \in R$ and $\fire{(N,M)}{t,\psi}{(N,M')}$, with $t \in T$ and $\psi : \ensuremath{\mathcal{V}} \to \ensuremath{\mathcal{I}}$. By Definition~\ref{def:ec-closure}, $\psi(\vec{v}) = u$, for some $u\in\ensuremath{\mathcal{I}}^{|\vec\lambda|}$. From the firing rule, we obtain $M'(p) + [u^{W((p,t))}] = M(p) + [u^{W((t,p))}]$, for any $p \in P$. If $u \neq \cname {id}$, then $r(t,\psi) = \tau$, and $(M', m) \in R$. If $u = \cname {id}$, there exists such marking $m'$ that $\fire{m}{t}{m'}$ (since $m(p) = M(p)( \cname {id})$ and thus $m(p)\geq W((p,t))$) and $m'(p) + W((p,t))= M(p)( \cname {id}) + W((t,p))$. Then, by construction, $m'(p)=M'(p)(id)$ and $(M',m') \in R$. \noindent ($\Leftarrow$) By analogy with the previous argument. \end{proof} A natural consequence of this weak bisimulation result is that any EC-closure of a WF-net is identifier sound if and only if the underlying WF-net is sound. \begin{theorem} Given a WF-Net $N$, if $N$ is sound, then $\mathcal{W}(N, \vec \lambda, \vec v)$ is identifier sound and live, for any place type $\vec \lambda \in \Lambda^*$ and variable vector $\vec{v} \in \ensuremath{\mathcal{V}}^*$ with $type(\vec{v}) = \vec \lambda$. \end{theorem} \begin{proof} Let $\ensuremath{\mathcal{W}} = \mathcal{W}(N, \vec\lambda, \vec v) = (P, T, F, \alpha, \beta)$. By definition of $\mathcal{W}$, $\delvar{t} = \emptyset$ for any transition $t \in T\setminus\set{t_C}$. Hence, only transition $t_C$ can remove identifiers, and thus, by construction, $\ensuremath{\mathcal{W}}$ is properly type completing on all $\lambda \in \vec\lambda$. Next, we need to show that $\ensuremath{\mathcal{W}}$ is weakly type terminating for all types $\lambda \in \vec\lambda$. Let $M \in \reachable{\ensuremath{\mathcal{W}}}{\emptyset}$, with firing sequence $\eta \in (T \times (\ensuremath{\mathcal{V}}\to\ensuremath{\mathcal{I}}))^*$, i.e., $\fire{(\ensuremath{\mathcal{W}},\emptyset)}{\eta}{(\ensuremath{\mathcal{W}},m)}$. Let $\cname{id} \in \funsym{C}(p)$ such that $M(p)(\cname{id}) > 0$ for some $p \in P$. We then construct a sequence $\omega$ by stripping the bindings from $\eta$ s.t. it contains only transitions of $T$. Using Lemma~\ref{lemma:weak-bisim-wrappednet}, we obtain a marking $m \in \reachable{N}{[in]}$ such that $\fire{[\mathit{in}]}{\psi}{m}$ and $m(p) = M(p)(\cname{id})$. Since $N$ is sound, there exists a firing sequence $\omega'$ such that $\fire{m}{\omega'}{[\mathit{out}]}$. Again by Lemma~\ref{lemma:weak-bisim-wrappednet}, a firing sequence $\eta'$ exists such that $\fire{M}{\eta'}{M'}$ and $(M', [\mathit{out}]) \in \restr{\reachable{\ensuremath{\mathcal{W}}}{\emptyset}}{\cname{id}}$, where $\restr{\reachable{\ensuremath{\mathcal{W}}}{\emptyset}}{\cname{id}}$ is the set of all reachable markings containing $\cname{id}$. Hence, if $M'(p)(\cname{id}) > 0$, then $p = \mathit{out}$. Thus, transition $t_C$ is enabled with some binding $\psi$ such that $\psi(\vec{v}) = \cname{id}$, and a marking $M''$ exists such that $\fire{M'}{t_c,\psi}{M''}$, which removes all identifiers in $\cname{id}$ from $M'$. Hence, $\ensuremath{\mathcal{W}}$ is identifier sound. As transition $t_e$ is always enabled and $N$ is quasi live, $\mathcal{W}(N,\vec{\lambda},\vec{v})$ is live. \end{proof} \subsection{Typed Jackson Nets}\label{sec:typedJN} A well-studied class of processes that guarantee soundness are block-structured nets. Examples include Process Trees~\cite{Leemans13}, Refined Process Structure Trees~\cite{Weidlich11} and Jackson Nets~\cite{HeeHHPT09}. Each of the techniques have a set of rules in common from which a class of nets can be constructed that guarantees properties like soundness. In this section, we introduce Typed Jackson Nets (t-JNs), extending the ideas of Jackson Nets~\cite{HeeHHPT09,HeeSW13} to t-PNIDs\xspace, that guarantee both identifier soundness and liveness. The six reduction rules presented by Murata in~\cite{Murata89} form the basis of this class of nets. The rules for t-JNs are depicted in Figure~\ref{fig:constructionrulestJN}. \begin{figure}[t] \centering \begin{subfigure}{.3\textwidth} \centering \includegraphics[width=\textwidth]{figures/PlaceExpansion} \caption{Place Expansion\label{fig:placeExpansion}} \end{subfigure} \begin{subfigure}{.3\textwidth} \centering \includegraphics[width=\textwidth]{figures/TransitionExpansion} \caption{Transition Expansion\label{fig:transitionExpansion}} \end{subfigure} \begin{subfigure}{.3\textwidth} \centering \includegraphics[width=\textwidth]{figures/PlaceDuplication} \caption{Place Duplication\label{fig:placeDuplication}} \end{subfigure} \begin{subfigure}{.3\textwidth} \centering \includegraphics[width=\textwidth]{figures/TransitionDuplication} \caption{Transition Duplication\label{fig:transitionDuplication}} \end{subfigure} \begin{subfigure}{.3\textwidth} \centering \includegraphics[width=\textwidth]{figures/SelfLoopAddition} \caption{Self-loop Addition\label{fig:selfLoopAddition}} \end{subfigure} \begin{subfigure}{.3\textwidth} \centering \includegraphics[width=\textwidth]{figures/IdentifierCreation} \caption{Identifier Creation\label{fig:identifierCreation}} \end{subfigure} \caption{Construction rules of the typed Jackson Nets.}\label{fig:constructionrulestJN} \end{figure} \newcounter{tjncount} \newcommand{\ruletitle}[1]{\medskip \noindent\textbf{\fbox{Rule \addtocounter{tjncount}{1}\thetjncount:} #1}} \subsubsection{Place Expansion} The first rule is based on \emph{fusion of a series of places}. As shown in Figure~\ref{fig:placeExpansion}, a single place $p$ is replaced by two places $p_i$ and $p_f$ that are connected via transition $t$. All transitions that originally produced in $p$, produce in $p_i$ in the place expansion, and similarly, the transitions that consumed from place $p$, now consume from place $p_f$. In fact, transition $t$ can be seen as a transfer transition: it needs to move tokens from place $p_i$ to place $p_f$, before the original process can continue. This is also reflected in the labeling of the places: both places have the same place type, and the input and output arc of transition $t$ are inscribed with the same variable vector $[ \,\vec\mu\,]$ that matches the type of place $p$. \begin{definition}[Place expansion] \label{def:place-expansion} Let $(N,m)$ be a marked t-PNID\xspace with $N = (P, T, F, \alpha, \beta)$, $p \in P$ be a place and $\vec\mu \in \ensuremath{\mathcal{V}}^*$ be a variable vector s.t. $\ensuremath {type}_{\ensuremath{\mathcal{V}}}(\vec\mu) = \alpha(p)$. The \emph{place expanded t-PNID\xspace} is defined by the relation $R_{p,\vec\mu}(N,m) = ((P', T',F', \alpha',\beta'),m')$, where: \begin{itemize} \item $P' = (P \setminus \{p\}) \cup \{p_i, p_f\}$ with $p_i, p_f \not\in P$; and $T' = T \cup \{t\}$ with $t \not\in T$; \item $F' = (F \setminus ((\{p\} \times \post{p})\cup (\pre{t} \times \{p\}) ) \cup (\pre{p} \times \{p_i\}) \cup \{(p_i,t),(t,p_f)\} \cup (\{p_f\} \times \post{p})$; \item $\alpha'(q) = \alpha(p)$, if $q \in \{p_i, p_f\}$, and $\alpha'(q) = \alpha(q)$, otherwise. \item $\beta'(f) = [\vec\mu]$, if $f \in \{(p_i,t),(t,p_f)\}$, $\beta'((u,p_i))=\beta((u,p))$, if $u \in \pre{p}$, $\beta'((p_f,u))=\beta((p,u))$, if $u \in \post{p}$, and $\beta'(f) = \beta(f)$, otherwise. \item $m'(q) = m(q)$ for all $q \in P\setminus\{p\}$, $m'(p_f) = 0$, and $m'(p_i) = m(p)$. \end{itemize} \end{definition} Inscription $\vec\mu$ cannot alter the vector identifier on the tokens, as the type of $\vec\mu$ should correspond to both place types $\alpha(p)$ and $\alpha(q)$. Hence, the transition is enabled with the same bindings as any other transition that consumes a token from place $p$, modulo variable renaming. As such, transition $t$ only ``transfers'' tokens from place $p_i$ to place $p_f$. Hence, as the next lemma shows, place expansion yields a weakly bisimilar t-PNID\xspace. \begin{lemma}\label{lm:bisimplaceexpansion} Let $(N,m_0)$ be a marked t-PNID\xspace with $N = (P, T, F, \alpha, \beta)$, $p\in P$ be a place to expand and $\vec\mu \in \ensuremath{\mathcal{V}}^*$ be a variable vector. Then $\tsys{N,m_0} {\approx^{r}} \hide{\{t\}}(\tsys{R_{p,\vec\mu}(N,m_0)})$, with transition $t$ added by $R_{p,\vec\mu}$. \end{lemma} \begin{proof} Let $(N',m_0') = R_{p,\mu}(N, m_0)$. We define $Q \subseteq \mathbb{M}(N) \times \mathbb{M}(N')$ such that $(m,m') \in Q$ iff $m(q) = m'(q)$ for all places $q \in P\setminus\{p\}$ and $m'(p_i) + m'(p_f) = m(p)$. Then $(m_0,m_0') \in Q$, hence the relation is rooted. \noindent ($\Rightarrow$) Let $(m,m') \in Q$ and $\fire{(N,m)}{u,\psi}{(N,\bar{m}}$. We need to show that there exists marking $\bar{M}'$ such that $\smash{m' \xdasharrow{~(u,\psi)~} \bar{m}'}$ and $(\bar{m},\bar{m}') \in Q$. Suppose $p \not\in\pre{u}$. Then $m'(q) = m(q)$ and $m(q)\geq \rho_\psi(\beta((p,u)))$ (note that $\rho_\psi(\beta((p,u))) = \rho_\psi(\beta'((p,u)))$). By the firing rule, a marking $\bar{m}'$ exists with $\fire{(N,m')}{u,\psi}{(N',\bar{m}')}$, $\bar{m}(q) = \bar{m}'(q)$ for all $q \in P'$. Thus, $(\bar{m},\bar{m}')\in Q$. Suppose $p \in\pre{u}$. Then $\rho_{\psi}(\beta((p_f,u))) \leq m(p) = m'(p_i) + m'(p_f)$. If $\rho_\psi(\beta(p_f, u))) \leq m'(p_f)$, then transition $u$ is enabled, and a marking $\bar{m}'$ exists with $\fire{(N,m')}{u,\psi}{(N,\bar{M}')}$ and $(m',\bar{m}') \in Q$. Otherwise, $\rho_\psi(\beta(p_f, u))) \leq m'(p_i)$. Construct a binding $\psi'$ by letting $\psi'(\mu(i)) = \psi(\beta(p,u)(i))$, for all $1 \leq i \leq |\mu|$. Then, $\rho_{\psi'}(\mu) = \rho_{\psi}(\beta(p,u))$, and transition $t$ is enabled with binding $\psi'$. Hence, a marking $m''$ exists with $\fire{(N,m')}{t,\psi'}{(N,m'')}$ and $\rho_{\psi}(\beta((p',u))) \leq m''(p')$. Then $(m,m'') \in Q$ and $t$ is labeled $\tau$ in $\hide{\{t\}}(R_{(p,\vec\mu)}(N))$, and the first case applies on $m''$. In all cases, $\smash{m' \xdasharrow{~(t,\psi)~} \bar{m}'}$ and $(m', \bar{m}') \in Q$. \noindent ($\Leftarrow$) By analogy with the previous argument. \end{proof} \subsubsection{Transition Expansion} The second rule is transition expansion, which corresponds to Murata's \emph{fusion of series transitions}. As shown in Fig.~\ref{fig:transitionExpansion}, transition $t$ is divided into two transitions, $t_e$ that consumes the tokens, and a second transition $t_c$ that produces the tokens. The two transitions are connected with a single, fresh place $p$. Place $p$ should ensure that all variables consumed by the original transition $t$, are passed to transition $t_c$, to ensure that the $t_c$ can produce the same tokens as transition $t$ in the original net. In other words, the type of each input place of $t$ is included in the type of the newly added place $p$. Transition $t_e$ is allowed to emit new identifiers, as long as these are not already produced by $t_c$. \begin{definition}[Transition expansion] Let $(N,m)$ be a marked t-PNID\xspace with $N = (P, T, F, \alpha, \beta)$, let $t \in T$, and let $\vec{\lambda} \subseteq \Lambda^*$ and $\vec{\mu} \in (\ensuremath{\mathcal{V}}\setminus \newvar{t})^*$ such that $\ensuremath {type}_\ensuremath{\mathcal{V}}(x) \in \vec\lambda$ and $x\in\vec{\mu}$, for all $x\in \invar{t}$, and $\ensuremath {type}_{\ensuremath{\mathcal{V}}}(\vec{\mu}) = \vec{\lambda}$. The \emph{transition expanded t-PNID\xspace} is defined by $R_{t,\vec{\lambda},\vec{\mu}}(N,m) = ((P', T',F', \alpha',\beta'),m)$, where: \begin{itemize} \item $P' = P \cup \{p\}$ with $p \not\in P$; and $T' = (T \setminus \{t\}) \cup \{t_e, t_c\}$ with $t_e, t_c \not\in T$; \item $F' = (F \setminus ((\pre{t} \times \{t\}) \cup (\{t\}\times\post{t}) )) \cup (\pre{t} \times \{t_e\}) \cup \{(t_e,p),(p,t_c)\} \cup (\{t_c\} \times \post{t})$; \item $\alpha'(p) = \vec{\lambda}$ and $\alpha'(q) = \alpha(q)$ for all $q \in P$; \item $\beta'(f) = [\,\vec{\mu}\,]$ if $f \in \{(t_e,p),(p,t_c)\}$, $\beta'((q,t_e))=\beta((q,t))$ for $q \in \pre{t}$, $\beta'((t_c,q))=\beta((t,q))$ for $q \in \post{t}$, and $ \beta'(f) = \beta(f)$ otherwise. \end{itemize} \end{definition} Transition $t_e$ is allowed to introduce new variables, but key is that inscription $\vec{\mu}$ contains all input variables of transition $t$. Consequently, $\vec{\mu}$ encodes the binding of transition $t$. We use this to prove weak bisimulation between a t-PNID\xspace and it transition expanded net. The idea behind the simulation relation $Q$ is that the firing of $t_e$ is postponed until $t_c$ fires. In other words, $Q$ encodes that tokens remain in place $q$ until transition $t_c$ fires. \begin{lemma}\label{lm:bisimtransexpansion} Given marked t-PNID\xspace $(N,m_0)$ with $N = (P, T, F, \alpha, \beta)$, transition $t\in T$, $\lambda\in\Lambda^*$ and $\mu \in \ensuremath{\mathcal{V}}^*$. Let $t_e, t_c$ be the transitions added by the expansion.\\ Then $\tsys{N,m_0} \approx^{r} \rho_{r}(\tsys{R_{t,\lambda,\mu}(N,m_0)})$ with $r = \{(t_e, \tau), (t_c,t) \}$. \end{lemma} \begin{proof} Let $(N',m_0') = R_{t,\lambda,\mu}(N,m_0)$. Then $m_0' = m_0$. Define relation $Q \subseteq \mathbb{M}(N) \times \mathbb{M}(N')$ such that $(m,m') \in Q$ iff $m(q) = m'(q)$ for all places $q \in P\setminus \pre{t}$ and $m(q) = m'(q) + \sum_{b \in \supp{M'(p)}} M'(p)(b)\cdot \rho_{\mu(b)}\beta((q,t))$, where $\mu(b)$ is a shorthand for the binding $\psi : \ensuremath{\mathcal{V}}\to\ensuremath{\mathcal{I}}$ with $\psi(x) = b(i)$ iff $\mu(i) = x$ for all $1 \leq i \leq |\mu|$. Then $(m_0,m_0') \in Q$. \noindent ($\Rightarrow$) Follows directly from the firing rule, and the construction of $\mu$. \noindent($\Leftarrow$) Let $(m,m') \in Q$ and $\fire{(N',m'}{u,\psi}{(N',\bar{M}')}$. We need to show a marking $\bar{m}$ exists such that $m \xdasharrow{~(t,\psi)~} \bar{m}$ and $(\bar{m},\bar{m}') \in Q$. If $t_e \neq u \neq t_c$, the statement holds by definition of the firing rule. Suppose $u = t_e$, i.e., $r(u) = \tau$. Hence, we need to show that $(m, \bar{m}') \in Q$. Let $q \in \pre{t}$. Since $(m,m') \in Q$, we have $m(q) = m'(q) + \sum_{b \in \supp{M'(p)}} M'(p)(b)\cdot \rho_{\mu(b)}\beta((q,t))$. By the firing rule, we have $\bar{m}'(p) = m'(p) + [\rho_\psi(\mu)]$ and $m'(q) = \bar{m}'(q) + \rho_{\psi}(\beta((q,t)))$. By construction, $\rho_{\psi}$ and $\rho_{\mu([\rho_\psi(\mu)])}$ are identical functions. Rewriting gives $m(q) = \bar{m}'(q) + \sum_{b \in \supp{\bar{m}'(p)}} m'(p)(b)\cdot \rho_{\mu(b)}\beta((q,t))$, and thus $(m,\bar{m}') \in Q$. Suppose $u = t_c$, i.e., $r(u) = t$ and $[\rho_\psi(\mu)]\leq M'(p)$. Let $q \in \pre{t}$. Then $m(q) = m'(q) + \sum_{b \in \supp{m'(p)}} m'(p)(b)\cdot \rho_{\mu(b)}\beta((q,t))$. Since $\bar{m}'(p) + [\rho_{\psi}(\mu)] = m'(p)$ and $\rho_{\psi}(\beta((q,u))) = \rho_{\mu([\rho_\psi(\mu)])}(\beta((q,u)))$, we obtain $m(q) = m'(q) + \left(\sum_{b \in \supp{\bar{m}'(p)}} \bar{m}'(p)(b)\cdot \rho_{\mu(b)}\beta((q,t))\right) + \rho_{\psi}\beta((q,t))$. Hence, a marking $\bar{m}$ exists such that $\fire{(N,m)}{t,\psi}{(N,\bar{m})}$ and $(\bar{m},\bar{m}') \in Q$. \end{proof} \subsubsection{Place Duplication} Whereas the previous two rules introduced ways to extend sequences, the third rule introduces parallelism by duplicating a place, as shown in Figure~\ref{fig:placeDuplication}. It is based on the \emph{fusion of parallel transitions} reduction rule of Murata. For t-PNIDs\xspace, duplicating a place has an additional advantage: as all information required for passing the identifiers is already guaranteed, the duplicated place can have any place type. Transition $t$ can emit new identifiers, provided that transition $u$ does not already emit these. \begin{definition}[Duplicate place] Let $(N,m)$ be a marked t-PNID\xspace with $N = (P, T, F, \alpha, \beta)$, let $p \in P$, such that $m(p) = \emptyset$, and some transitions $t, u\in T$ exist with $\pre{p} =\{t\}$ and $\post{p} = \{u\}$. Let $\vec{\lambda} \in \Lambda^*$ and $\vec{\mu} \in (\ensuremath{\mathcal{V}}\setminus \newvar{u})^*$ such that $\ensuremath {type}_\ensuremath{\mathcal{V}}(\mu) = \lambda$. % Its \emph{duplicated place t-PNID\xspace} is defined by $D_{p,\lambda,\mu}(N,m) = ((P', T,F', \alpha',\beta'),m)$, where: \begin{itemize} \item $P' = P \cup \{ q \}$, with $q\not\in P$, and $F' = F \cup \{ (t, q), (q, u) \}$; \item $\alpha' = \alpha\cup \{ q \mapsto \lambda \}$ and $\beta' = \beta \cup \{ (t,q) \mapsto [\mu], (q,u) \mapsto [\mu] \}$. \end{itemize} \end{definition} As the duplicated place cannot hamper the firing of any transition, all behavior is preserved by a strong bisimulation on the identity mapping. \begin{lemma}\label{lm:bisimplaceduplication} Given a marked t-PNID\xspace $(N,m_0)$ with $N = (P, T, F, \alpha, \beta)$, place $p\in P$, $\lambda\in\Lambda^*$ and $\mu \in \ensuremath{\mathcal{V}}^*$. Then $\tsys{N,m_0} \sim^r \tsys{D_{p,\lambda,\mu}(N,m_0)}$. \end{lemma} \begin{proof} Let $(N',m'_0) = D_{p,\lambda,\mu}(N,m_0)$. Define relation $Q \subseteq \mathbb{M}(N) \times \mathbb{M}(N')$ such that $(m, m') \in Q$ iff $m(p) = m'(p)$ for all places $p \in P$. The bisimulation relation trivially follows from the firing rule. \end{proof} \subsubsection{Transition Duplication} As already recognized by Berthelot~\cite{Berthelot78}, if two transitions have an identical preset and postset, one of these transitions can be removed while preserving liveness and boundedness. Murata's fusion of parallel places is a special case of this rule, requiring that the preset and postset are singletons. For t-JNs, this results in the duplicate transition rule: any transition may be duplicated, as shown in Figure~\ref{fig:transitionDuplication}. As duplication should not hamper the behavior of the original net, we require that the inscriptions of the duplicated transition are identical to the original transition. \begin{definition}[Duplicate place] Let $(N,m)$ be a marked t-PNID\xspace with $N = (P, T, F, \alpha, \beta)$, and let $t \in T$ such that some places $p, q\in P$ exist with $\pre{t} =\{p\}$ and $\post{t} = \{q\}$. % Its \emph{duplicated transition t-PNID\xspace} is defined by $D_{t}(N,m) = ((P, T',F', \alpha,\beta'),M)$, where: \begin{itemize} \item $T' = T \cup \{u \}$, with $t'\not\in T$, and $F' = F \cup \{ (p, u), (u, q) \}$; \item $\beta'((p,u)) = \beta((p,t))$, $\beta((u,q)) = \beta((t,q))$ and $\beta'(f) = \beta(f)$ for all $f\in F$. \end{itemize} \end{definition} As the above rule only duplicates $t\inT$, the identity relation on markings is a strong rooted bisimulation. The proof is straightforward from the definition. \begin{lemma}\label{lm:bisimtransduplication} Given a marked t-PNID\xspace $(N,m_0)$ with $N = (P, T, F, \alpha, \beta)$, and transition $t\inT$. Then $\tsys{N,m_0} \sim^r \rho_{\{(u,t)\}}(\tsys{D_{t}(N,m_0)})$. \end{lemma} \begin{proof} Let $(N',m'_0) = D_{t}(N,m_0)$. Define relation $Q \subseteq \mathbb{M}(N) \times \mathbb{M}(N')$ such that $(m, m') \in Q$ iff $m(p) = m'(p)$ for all places $p \in P$. The bisimulation relation trivially follows from the firing rule. \end{proof} \subsubsection{Adding Identity Transitions} In \cite{Berthelot78}, Berthelot classified a transition $t$ with an identical preset and postset, i.e., $\pre{t} = \post{t}$ as irrelevant, as its firing does not change the marking. The reduction rule \emph{elimination of self-loop transitions} is a special case, as Murata required these sets to be singletons. For t-JNs, adding a self-loop transition is the fifth rule, as shown in Figure~\ref{fig:selfLoopAddition}. \begin{definition}[Self-loop addition] Let $(N,m)$ be a marked t-PNID\xspace with $N = (P, T, F, \alpha, \beta)$, and let $p \in P$. % Its \emph{Self-loop Added t-PNID\xspace} is defined by $A_{p}(N,m) = ((P, T',F', \alpha,\beta'), m)$, where: \begin{itemize} \item $T' = T \cup \{ t \}$, with $t\not\in T$, and $F' = F \cup \{ (p, t), (t, p) \}$; \item $\beta'((p,t')) = \beta'((p,t')) = [\,\vec\mu\,]$ with $\vec\mu \in \ensuremath{\mathcal{V}}^*$ such that $\ensuremath {type}_\ensuremath{\mathcal{V}}(\mu) = \alpha(p)$, and $\beta'(f) = \beta(f)$ otherwise. \end{itemize} \end{definition} Similar to the duplicate transition rule, the self-loop addition rule does not introduce new behavior, except for silent self-loops. Hence, the identity relation on markings is a weak rooted bisimulation. \begin{lemma}\label{lm:selflooptrans} Given a marked t-PNID\xspace $(N,m_0)$ with $N = (P, T, F, \alpha, \beta)$, and place $p\inP$. Then $\tsys{N,m_0} \approx^r \hide{\{t\}}(\tsys{A_{p}(N,m_0)})$ with $t$ the added self-loop transition. \end{lemma} \begin{proof} Let $(N',m'_0) = A_{p}(N,m_0)$. Define relation $Q \subseteq \mathbb{M}(N) \times \mathbb{M}(N')$ such that $(M, m') \in Q$ iff $m(p) = m'(p)$ for all places $p \in P$. The bisimulation relation trivially follows from the firing rule. \end{proof} \subsubsection{Identifier Introduction} The first five rules preserve the criteria of block-structured WF-nets. Murata's \emph{elimination of self-loop places} states that adding or removing a marked place with identical preset and postset does preserve liveness and boundedness. This rule is often used to introduce a fixed resource to a net, i.e., the number of resources is determined in the initial marking. Instead, identifier introduction adds dynamic resources, as shown in Figure~\ref{fig:identifierCreation}: transition $t_e$ emits new identifiers as its inscription uses only ``new'' variables (i.e., those that have not been used in the net), and place $p$ works like a storage of the available resources, which can be removed by firing transition $t_c$. \begin{definition}[Identifier Introduction] Let $(N,m)$ be a marked t-PNID\xspace with $N = (P, T, F, \alpha, \beta)$, let $t \in T$, let $\vec\lambda \in (\Lambda\setminus \ensuremath {type}_P(N))^*$ and $\vec\mu \in \ensuremath{\mathcal{V}}^*$ such that $\ensuremath {type}_{\ensuremath{\mathcal{V}}}(\vec\mu) = \vec\lambda$. % The \emph{Identifier introducing t-PNID\xspace} is defined by $A_{t,\vec\lambda,\vec\mu}(N,m) = ((P', T',F', \alpha',\beta'), m)$, where: \begin{itemize} \item $P' = P' \cup \{ p \}$ and $T' = T \cup \{ t_e, t_c \}$, for $p \not\in P$ and $t_e, t_c \not\in T$, and $F' = F \cup \{ (p, t), (t, p), (t_e,p), (p, t_c) \}$; \item $\alpha' = \alpha \cup \{ p \mapsto \vec\lambda \}$ and $\beta' = \beta \cup \{ (p,t) \mapsto [\vec\mu], (t,p) \mapsto [\vec\mu], (t_e, p) \mapsto [\vec\mu], (p, t_c) \mapsto [\vec\mu] \}$; \end{itemize} \end{definition} \begin{lemma}\label{lm:selfloopplace} Given a marked t-PNID\xspace $(N,m_0)$ with $N = (P, T, F, \alpha, \beta)$, transition $t\inT$, $\vec\lambda \in \Lambda^*$ and $\vec\mu \in (\ensuremath{\mathcal{V}} \setminus \var{t})^*$. Then $\tsys{N,m_0} \approx^r \hide{\{t_e,t_c\}}(\tsys{A_{(p)}(N,m_0)})$ with $t_e, t_c$ the added transitions. \end{lemma} \begin{proof} Let $N' = (P',T',F',\alpha',\beta')$. Define $Q \subseteq \mathbb{M}(N) \times \mathbb{M}(N')$ such that $(m,m') \in Q$ iff $m(q) = m'(q)$ for all $q \in P$. \noindent($\Rightarrow$) Suppose $\fire{(N,m)}{u,\psi}{(N,\bar{m}')}$. If $t \neq u$, the statement directly follows from the firing rule. If $t = u$, then a marking $m''$ and binding $\psi'$ exists such that $\fire{(N',m')}{t_e,\psi'}{(N,m'')}$. Then $m'(p) > \emptyset$, $(m,m'')\in Q$, and $\enabled{(N',m'')}{t,\psi}$. Hence, markings $\bar{m}''$ and $\bar{m}'$ exist such that $\enabled{(N',m'')}{t,\psi}\fire{(N',\bar{m}'')}{t_c,\psi'}{(N,\bar{m}')}$, and $(m',\bar{m}''), (m',\bar{m}') \in Q$. \noindent($\Leftarrow$) Follows directly from the firing rule. \end{proof} As shown in~\cite{RVFE11}, unbounded places are width-bounded, i.e., can contain an infinite number of identifiers, or depth-bounded, i.e., for each identifier, the number of tokens carrying that identifier is bounded, or both. The place added by the identifier creation rule is by definition width-unbounded, as it has an empty preset. However, it is identifier sound, and thus depth-bounded, as shown in the next lemma. \begin{lemma}\label{lm:identplaceidentsound} Given a marked t-PNID\xspace $(N,m)$ with $N = (P,T,F,\alpha,\beta)$. Then $A_{t,\vec\lambda,\vec\mu}(N,M)$ is identifier sound iff $(N,m)$ is identifier sound. \end{lemma} \begin{proof} Let $(N',m') = A_{t,\vec\lambda,\vec\mu}(N,m)$, and let $p \in P'\setminus P$. Let $\vec\lambda \in \ensuremath {type}(N')$. If $\vec\lambda \in \ensuremath {type}_P(N)$, it is $\vec\lambda$-sound by Lemma~\ref{lm:selfloopplace}. Suppose $\vec\lambda \not\in\ensuremath {type}(N)$. Then $E_{N'}(\lambda) = \{t_e\}$ and $C_{N'}(\lambda) = \{t_c\}$. Let $\cname{a} \in \id{M}$ such that $\ensuremath {type}(\cname{a}) = \vec\lambda$. Then an $\vec{id} \in \funsym{C}(p)$ exists with $\cname{a} \in \vec{id}$ and $M(p)(\vec{id}) = 1$. Hence, a binding $\psi$ exists such that $\psi(\vec\mu) = \vec{id}$, and transition $t_c$ is enabled with $\psi$. Let $M'$ be a marking such that $\fire{(N,m)}{t_c,\psi}{(N,m')}$. Then $\cname{a} \not\in\id{M'}$, which proves the statement. \end{proof} \subsubsection{Soundness for Typed Jackson Nets} Any net that can be reduced to a net with a single transition using these rules is called a typed Jackson Net (t-JN). \begin{definition} The class of \emph{typed Jackson Nets} $\mathcal{T}$ is inductively defined by: \begin{itemize} \item $((\emptyset,\{t\},\emptyset,\emptyset,\emptyset),\emptyset) \in \mathcal{T}$; \item if $(N,M) \in \mathcal{T}$, then $R_{p,\vec\mu}(N,M) \in \mathcal{T}$; \item if $(N,M) \in \mathcal{T}$, then $R_{t,\vec\lambda,\vec\mu}(N,M) \in \mathcal{T}$; \item if $(N,M) \in \mathcal{T}$, then $D_{p,\vec\lambda,\vec\mu}(N,M_0) \in \mathcal{T}$; \item if $(N,M) \in \mathcal{T}$, then $D_{t}(N,M) \in \mathcal{T}$; \item if $(N,M) \in \mathcal{T}$, then $A_{p}(N,M) \in \mathcal{T}$; \item if $(N,M) \in \mathcal{T}$, then $A_{t,\vec\lambda,\vec\mu}(N,M) \in \mathcal{T}$. \end{itemize} \end{definition} As any t-JN reduces to a single transition, and each construction rule goes hand in hand with a bisimulation relation, any liveness property is preserved. Consequently, any t-JN is identifier sound and live. \begin{theorem}\label{thm:tJNisSound} Any typed Jackson Net is identifier sound and live. \end{theorem} \begin{proof} We prove the statement by induction on the structure of t-JNs. The statement holds trivially for the initial net, $((\emptyset,\{t\},\emptyset,\emptyset,\emptyset),\emptyset)$. Suppose $(N,M) \in \mathcal{T}$. Then for each of the rules, the statement follows directly from the respective bisimulation relations of Lemma~\ref{lm:bisimplaceexpansion}~--~\ref{lm:selfloopplace}, and the result of Lemma~\ref{lm:identplaceidentsound}. \end{proof} \begin{figure}[t] \centering \includegraphics[scale=.8]{figures/overallModelRepaired} \caption{The example of the retailer shop as a typed Jackson Net.}\label{fig:overallModelRepaired} \end{figure} To solve the problem of the running example, several solutions exist. One solution is shown in Figure~\ref{fig:overallModelRepaired}. In this example, the net is a t-JN: starting from transition $G$, a self loop is added (transition $G$). The transition is then expanded with transition $Z$. Place $p$ is then duplicated to create the subnet $R$. In this way, subnet $R$ only knows of type $\mathit{offer}$, as the connection with $\mathit{customer}$ is stored in place $p$. Consequently, the net is identifier sound, and live. \subsection{Workflow Refinement} A well-known refinement rule is workflow refinement~\cite{HeeSV03}. In a WF-net, any place may be refined with a generalized sound WF-net. If the original net is sound, then the refined net is sound as well. In this section, we present a similar refinement rule. Given a t-PNID\xspace, any place may be refined by a generalized sound WF-net. In the refinement, each place is labeled with the place type of the refined place, and all arcs in the WF-net are inscribed with the same variable vector. \begin{definition}[Workflow refinement] Let $L = (P_L,T_L,F_L,\alpha_L,\beta_L)$, be a t-PNID\xspace, $p \in P_L$ a place, and $N = (P_N, T_N,F_N, W_N,\mathit{in}, \mathit{out})$ be a WF-net. \emph{Workflow refinement} is defined by $L \oplus_{p} N = (P,T,F,\alpha,\beta)$, where: \begin{compactitem} \item $P = (P_L \setminus \{p\}) \cup P_N$ and $T = T_L \cup T_N$; \item $F = (F_N \cap ( ( P \times T ) \cup ( T \times P ) )) \cup F_L \cup \{(t,\mathit{in})\mid t \in \pre{p} \} \cup \{(\mathit{out}, t) \mid t\in\post{p}\}$; \item $\alpha(q) = \alpha_N(q)$ for $q \in P_L\setminus\{p\}$, and $\alpha(q) = \alpha(p)$ for $q \in P_N$; \item $\beta(f) = \beta_L(f)$ for $f\in F_L$, $\beta(f) = [\vec\mu]^{(W(f))}$for $f \in F_N$ and $\ensuremath {type}_\ensuremath{\mathcal{V}}(\vec\mu)=\alpha(p)$, $\beta((t,\mathit{in})) = \beta((t,p))$ for $t \in \pre{t}$ and $\beta((\mathit{out},t)) = \beta((p,t))$ for $t \in \post{t}$. \end{compactitem} \end{definition} Generalized soundness of a WF-Net ensures that any number of tokens in the initial place are ``transferred'' to the final place. As shown in Section~\ref{sec:ec-wf-closure}, the EC-closure of a sound WF-net is identifier sound and live. A similar approach is taken to show that the refinement is weakly bisimilar to the original net. Analogously to~\cite{HeeSV03}, the bisimulation relation is the identity relation, except for place $p$. The relation maps all possible token configurations of place $p$ to any reachable marking in the WF-net, given $p$'s token configuration. \begin{lemma} Let $L = (P_L,T_L,F_L,\alpha_L,\beta_L)$ be a t-PNID\xspace with initial marking $m_0$, let $p \in P_L$ be a place s.t. $m_0(p)=\emptyset$, and let $N = (P_N, T_N,F_N, W_N,\mathit{in}_N, \mathit{out}_N)$ be a WF-net. If $N$ is generalized sound, then $\tsys{L,m_0} \approx^{r} \hide{T_N}(\tsys{L\oplus_p N,m_0})$. \end{lemma} \begin{proof} For simplicity, we start by defining a type extension of $N$ as a t-PNID\xspace $N'= (P_N, T_N, F_N, \alpha, \beta)$, where $\ensuremath {type}(\vec{v})=\vec\lambda$, $\alpha(p) =\vec{\lambda}$ for all places $p \in P_N$, and $\beta(f) = \vec{v}^{W(f)}$ for all $f \in F_N$, and $\beta((t_e,\mathit{in}))=\beta((\mathit{out}, t_c)) = [\vec{v}]$. To prove bisimilarity, we define $R = \set{ (M, M'+m) \mid M \in \reachable{L}{M_0}, M'\in\ensuremath{\mathcal{A}}, m\in\ensuremath{\mathcal{B}}}$ where $\ensuremath{\mathcal{A}}=\set{M' \mid M',M\in\reachable{L}{M_0}, M'(p)=\emptyset,\forall q\in P_L\setminus\set{p}: M'(q)=M(q) }$ and $\ensuremath{\mathcal{B}}=\set{m\mid m\in\reachable{N'}{[\mathit{in}]},[\mathit{in}]=M(p), \forall M\in\reachable{L}{M_0}}$. \noindent($\Rightarrow$) Let $(M,M'+m)\in R$ and $\fire{M}{t,\psi}{\bar M}$. We need to show that exists $\bar{M}'$ and $\bar{m}$ s.t. $(M'+m) \xdasharrow{~(t,\psi)~} (\bar{M}'+\bar{m})$ and $(\bar{M},\bar{M}'+\bar{m})\in R$. If $t\not\in\pre{p}$ (or $p\not\in\pre{t}$), then $M'(q)=M(q)$ for all $q\in P_L\setminus{p}$. Thus $t$ is also enabled in $M'(q)$ and $M(q)\geq \beta((q,t))$. Then by the firing rule there exists $\bar{M}'$ s.t. $\fire{(M'+m)}{t,\psi}{(\bar{M}'+m)}$ and $\bar{M}(q)=\bar{M}'(q)$ for all $q\inP_L$. Thus, $(M',\bar{M}'+m)\in R$. If $t\in\pre{p}$, then, by construction, $M'(q)=M(q)$ for all $q\in P_L\setminus{p}$. Thus, using the same reasoning as above, $\fire{(M'+m)}{t,\psi}{(\bar{M}'+\bar{m})}$ for all $q\inP_L\setminus{p}$ and $\bar{m}(in)=M'(p)$. Thus, $(M',\bar{M}'+\bar{m})\in R$. Now, assume that $p\in \pre t$ and $\rho_\psi(\beta((p,t)))=\cname{id}$. Given that $N$ is generalized sound and by applying Lemma~\ref{lemma:weak-bisim-wrappednet}, there exists a firing sequence $\eta$ for $N'$ that carries identifier $\cname{id}$ to $\mathit{out}$. This means that, by construction, $M'(q)=M(q)$, for all $q\inP_L$, and $m(\mathit{out})(\cname{id})=M(p)(\cname{id})$. Hence, $t$ is enabled in $(M'+m)$ under binding $\psi'$ that differs from $\psi$ everywhere but on place $\mathit{out}$. By the firing rule, there exists $(\bar{M}'+\bar{m})$ s.t. $\fire{(M'+m)}{t,\psi'}{(\bar{M}'+\bar{m})}$ and $(M,(\bar{M}'+\bar{m}))\in R$. \noindent($\Leftarrow$) By analogy with the previous argument. \end{proof} As a consequence of the bisimulation relation, the refinement is identifier sound and live if the original net is identifier sound. \begin{theorem} Let $(L,M)$ be a marked t-PNID\xspace and $N$ be a generalized sound WF net. Then $(L, M)$ is identifier sound and live iff $(L\oplus N, M)$ is identifier sound and live. \end{theorem} The refinement rule allows to combine the approaches discussed in this section. For example, a designer can first design a net using the construction rules of Section~\ref{sec:typedJN}, and then design generalized WF-nets for specific places. In this way, the construction rules and refinement rules ensure that the designer can model systems where data and processes are in resonance. \section{Introduction} Petri nets are widely used to describe distributed systems capable of expanding their resources indefinitely~\cite{Reisig2013}. A \emph{Petri net} describes passive and active components of a system, modeled as places and transitions, respectively. The active components of a Petri net communicate asynchronously with each other via local interfaces. Thus, state changes in a Petri net system have local causes and effects and are modeled as tokens consumed, produced, or transferred by the transitions of the system. A \emph{token} is often used to denote an \emph{object} in the physical world the system manipulates or a \emph{condition} that can cause a state change in the system. Petri nets with identifiers~\cite{HSVW09} extend classical Petri nets to provide formal means to relate tokens to objects. Every token in such a Petri net is associated with a vector of identifiers, where each identifier uniquely identifies a data object. Consequently, active components of a Petri net with identifiers model how groups of objects, either envisioned or those existing in the physical world, can be consumed, produced, or transferred by the system. It is often desirable that modeled systems are correct. Many criteria have been devised for assessing the correctness of systems captured as Petri nets. Those criteria target models of systems that use tokens to represent conditions that control their state changes. In other words, they can be used to verify the correctness of processes the systems can support and not of the object manipulations carried out within those processes. Such widely-used criteria include boundedness~\cite{Karp1969}, liveness~\cite{Hack1974}, and soundness~\cite{Aalst1997}. The latter one, for instance, ensures that a system modeled as a \emph{workflow net}, a special type of a Petri net used to encode workflow at an organization, has a terminal state that can be distinguished from other states of the modeled system, the system can always reach the terminal state, and every transition of the system can in principle be enabled and, thus, used by the system. Real-world systems, such as information systems~\cite{PolyvyanyyWOB19}, are characterized by processes that manipulate objects. For instance, an online retailer system manipulates products, invoices, and customer records. However, although tool support allowed to design such models~\cite{WerfP20}, initial use showed that correctness criteria addressing both aspects, that is, the processes and data, are understood less well~\cite{WerfP18}. Hence, the paper at hand to close the gap. In this paper, we propose a correctness criterion for Petri nets with identifiers that combines the checks of the soundness of the system's processes with the soundness of object manipulations within those processes. Intuitively, objects of a specific type are correctly manipulated by the system if every object instance of that type, characterized by a unique identifier, can ``leave'' the system, that is, a dedicated transition of the system can consume it, and once that happens, no references to that object instance remain in the system. When a system achieves this harmony for its processes and all data object types, we say that the system is \emph{identifier sound}, or, alternatively, that the data and processes of the system are in \emph{resonance}. Specifically, this paper makes these contributions: \smallskip \begin{compactitem} \item It motivates and defines the notion of \emph{identifier soundness} for checking correctness of data object manipulations in processes of a system; \item It proposes a resource-aware extension for such systems and defines a suitable correctness criterion building on top of the one of identifier soundness and requiring that system resources are managed \emph{conservatively}; \item It discusses aspects related to \emph{decidability of identifier soundness} in the general case, and for certain restricted, but still useful, classes of systems; \item It establishes connections with existing results on verification of data-aware processes and shows which verification tasks are decidable for object-aware systems. \end{compactitem} \smallskip The paper proceeds as follows. The next section introduces concepts and notions required to support subsequent discussions. Section~\ref{sec:pnids} introduces typed Petri nets with identifiers, a model for modeling distributed systems whose state is defined by objects the system manipulates. Section~\ref{sec:soundness} presents various correctness notions for typed Petri nets with identifiers, including the one of identifier soundness, and demonstrates a proof that the notion is in general undecidable. Moreover, the section discusses connection to existing verification results and show which verification tasks are decidable for typed Petri nets with identifiers. Section~\ref{sec:soundness:by:construction} discusses several classes of systems for which identifier soundness is guaranteed by construction. Section~\ref{sec:soundness:with:resources} presents the formalism extension with resource management capabilities and discusses a series of results, including the one on resource-aware soundness, that is deemed to be undecidable. Finally, the paper concludes with a discussion on related work (Section~\ref{sec:relatedwork}) and future work. \section{Typed Petri nets with Identifiers} \label{sec:pnids} Processes and data are highly intertwined: processes manipulate data objects while objects govern processes. These processes can perform complex manipulations over multiple objects. For example, consider a retailer shop with three types of objects: \emph{products} sold through the shop, \emph{customers} that can order these products, and \emph{orders} that track products bought by customers. This example already involves many-to-many relations between objects, e.g., a product can be ordered by many customers, while a customer can order many products. Relations between objects can also be one-to-many, e.g., an order is always for a single customer, but a customer can have many orders. In addition, objects may have life cycles, which can be considered as processes themselves. Figure~\ref{fig:lifecycles} shows three life cycles of objects in the retailer shop. A product may be temporarily unavailable, while customers may be blocked by the shop, disallowing them to order products. These life cycles are inherently intertwined. For instance, customers should not be allowed to order products that are unavailable. Similarly, blocked customers should not be able to create new orders. \begin{figure} \centering \includegraphics[width=\textwidth]{figures/lifecycles} \caption{The life cycles of products, customers and orders in the retailer shop.}\label{fig:lifecycles} \end{figure} Several approaches have been studied to model and analyze models that combine objects and processes. For example, data-aware Proclets~\cite{Fahland19} allow describing the behavior of individual artifacts and their interactions. Another approach is followed in $\nu$-PN~\cite{RVFE11}, in which a token can carry a single identifier~\cite{RosaMF06}. In this formalism, markings map each place to a bag of identifiers, indicating how many tokens in each place carry the same identifier. These identifiers can be used to reference entities in an information model. However, referencing a fact composed of multiple entities is not possible in $\nu$-PNs. In this paper, we study \emph{typed Petri nets with identifiers} (t-PNIDs\xspace), which build upon $\nu$-PNs~\cite{RVFE11} by extending tokens to carry vectors of identifiers~\cite{PolyvyanyyWOB19,WerfP20}. Vectors, represented by sequences, have the advantage that a single token can refer to multiple objects or entities that compose (a part of) a \emph{fact}, such as an order is for a specific customer. Identifiers are typed, i.e., the countable, infinite set of identifiers is partitioned into a set of types, such that each type contains a countable, infinite set of identifiers. Identifier types should not overlap, i.e., each identifier has a unique type. Variables can take values of identifiers, and are, thus, are typed as well and can only refer to identifiers of the associated type. For example, the product, customer and order objects from the retailer shop make us three object types. \begin{definition}[Identifier Types] \label{def:id-types} Let $\ensuremath{\mathcal{I}}$, $\Lambda$, and $\ensuremath{\mathcal{V}}$ denote countable, infinite sets of identifiers, type labels, and variables, respectively. We define: \begin{itemize} \item the \emph{domain assignment} function $I : \Lambda \rightarrow \powerset{\ensuremath{\mathcal{I}}}$, such that $I(\lambda_1)$ is an infinite set, and $I(\lambda_1) \cap I(\lambda_2) \neq \emptyset$ implies $\lambda_1 = \lambda_2$ for all $\lambda_1, \lambda_2 \in \Lambda$; \item the \emph{id typing} function $\ensuremath {type}_{I}:\ensuremath{\mathcal{I}}\to\Lambda$ s.t. if $\ensuremath {type}_{I}(\cname{id})=\lambda$, then $\cname{id}\in I(\lambda)$; \item a \emph{variable typing} function $\ensuremath {type}_{\ensuremath{\mathcal{V}}}:\ensuremath{\mathcal{V}}\to\Lambda$, prescribing that $x\in\ensuremath{\mathcal{V}}$ can be substituted only by values from $I(\ensuremath {type}_{\ensuremath{\mathcal{V}}}(x))$. \end{itemize} When clear from the context, we omit the subscripts of $type$. \end{definition} In a t-PNID\xspace, each place is annotated with a label, called the \emph{place type}. A place type is a vector of types, indicating types of identifier tokens at the place can carry. A place with the empty place type, represented by the empty vector, is a classical Petri net place carrying indistinguishable (black) tokens. Each arc of a t-PNID\xspace is inscribed with a multiset of vectors of identifiers, such that the types of the variables in the vector coincide with the place types. This allows modeling situations where a transition may require multiple tokens with different identifiers from the same place. \begin{figure}[t] \centering \includegraphics[scale=.8]{figures/overallModel} \caption{t-PNID\xspace $N_{\mathit{rs}}$ for the retailer shop with types of products, customers and orders. Each place is colored according to its type. Place $p$ carries pairs of identifiers: an order and a customer. The net intertwines the life cycles of Figure~\ref{fig:lifecycles} and weakly simulates each of these life cycles. }\label{fig:overallModel} \end{figure} \begin{definition}[Typed Petri nets with identifiers] \label{def:tpnid} A \emph{Typed Petri net with identifiers} (t-PNID\xspace) $N$ is a tuple $(P,T,F,\alpha,\beta)$, where: \begin{itemize} \item $(P,T,F)$ is a Petri net; \item $\alpha:P\to\Lambda^*$ is the \emph{place typing function} \item $\beta : F\to \mult{(\ensuremath{\mathcal{V}}^*)}$ defines for each flow a multiset of \emph{variable vectors} such that $\alpha(p) = \ensuremath {type}(x)$ for any $x \in \supp{\beta((p,t))}$ and $\ensuremath {type}(y)=\alpha(p')$ for any $y \in \supp{\beta((t,p'))}$ where $t\inT$, $p\in\pre{t}$, $p'\in\post{t}$; \end{itemize} \end{definition} Figure~\ref{fig:overallModel} shows a t-PNID\xspace, $N_{\mathit{rs}}$, of the retailer shop. Each place is colored according to its identifier type. In $N_{\mathit{rs}}$, places \emph{product} and \emph{unavailable product} are annotated with a vector $\langle\mathit{product}\rangle$, i.e., these places contain tokens that carry only a single identifier of type $\mathit{product}$. Places \emph{customer} and \emph{blocked customer} have type $\langle\mathit{customer}\rangle$. All other places, except for place $p$, are labeled with type $\langle\mathit{order}\rangle$. Place $p$ maintains the relation between orders and customers, and is typed $\langle\mathit{order},\mathit{customer}\rangle$, i.e., tokens in this place are identifier vectors of size 2. $N_{\mathit{rs}}$ uses three variables: $x$ for $\mathit{product}$, $y$ for $\mathit{order}$ and $z$ for $\mathit{customer}$. A marking of a t-PNID\xspace $N$ is a configuration of tokens over its places. The set of all possible markings of $N$ is denoted by $\mathbb{M}(N)$. Each token in a place should be of the correct type, i.e., the vector of identifiers carried by a token in a place should match the corresponding place type. All possible vectors of identifiers a place $q$ may carry is defined by the set $\funsym{C}(q)$. \begin{definition}[Marking] Given a t-PNID\xspace $N = (P, T, F, \alpha, \beta)$, and place $p \in P$, its \emph{id set} is $\funsym{C}(p) = \prod_{1 \leq i \leq |\alpha(p)|} I(\alpha(p)(i))$. A \emph{marking} is a function $m \in \mathbb{M}(N)$, with $\mathbb{M}(N) = P \to \mult{(\ensuremath{\mathcal{I}}^*)}$, such that $m(p) \in \mult {\funsym{C}(p)}$, for each place $p \in P$. The set of identifiers used in $m$ is denoted by $\smash{\id{m} = \bigcup_{p \in P} \rng{\supp{m(p)}}}$. The pair $(N, m)$ is called a \emph{marked t-PNID\xspace}. \end{definition} To define the semantics of a t-PNID\xspace, the variables need to be valuated with identifiers. Variables may be used differently by transitions. In Fig.~\ref{fig:overallModel}, transition $G$ uses variable $y$ to create an identifier of type $\mathit{order}$, whereas transition $K$ uses the same variable to remove an identifier from the marking. We therefore first introduce some notation to work with variables and types in a t-PNID\xspace. Variables that are used on the input arcs, i.e., variables on arcs from a place to a transition $t$ are called the input variables of $t$. Similarly, variables on arcs from transition $t$ to a place are called the output variables of $t$. A variable that only occur in the set of output variables of a transition and not in the set of input variables, is an \emph{emitting variable}. Similarly, if a variable only appears as an input variable of a transition, it is called a \emph{collecting variable}. As variables are typed, an emitting variable creates a new identifier of a given type upon transition firing, whereas a collecting variable removes an identifier of that type. \begin{definition}[Variable sets, emitter and collector transitions, object types] Given a t-PNID\xspace $N=(P,T,F,\alpha,\beta)$, $t\in T$ and $\lambda \in \Lambda$, we define the following sets of variables: \begin{itemize} \item \emph{input variables} as $\smash{\invar{t} = \bigcup_{x \in \beta((p,t)), p\in\pre{t}} \rng{\supp{x}}}$; \item \emph{output variables} as $\smash{\outvar{t} = \bigcup_{x \in \beta((t,p)),p \in\post{t}} \rng{\supp{x}}}$; \item \emph{variables} as $\var{t} = \invar{t} \cup \outvar{t}$; \item \emph{emitting variables} as $\newvar{t} = \outvar{t}\setminus\invar{t}$; \item \emph{collecting variables} as $\delvar{t} = \invar{t} \setminus \outvar{t}$. \end{itemize} Using the above notions, we introduce the sets of: \begin{itemize} \item \emph{emitting transitions} as $E_N(\lambda) = \{ t \mid \exists x \in \newvar{t} \wedge \ensuremath {type}(x) = \lambda \}$; \item \emph{collecting transitions} as $C_N(\lambda) = \{ t \mid \exists x \in \delvar{t} \wedge \ensuremath {type}(x) = \lambda \}$. \end{itemize} To properly account for \emph{types of places used in $N$}, we introduce $\ensuremath {type}_P(N) = \{ \vec\lambda \mid \exists p \in P : \vec\lambda\in\alpha(p)\}$. Similarly, for objects, we introduce the set of \emph{object types in $N$} $\ensuremath {type}_\Lambda(N) = \{ \lambda \mid \lambda\in \vec\lambda, \vec\lambda\in\ensuremath {type}_P(N)\}$. \end{definition} The firing of a transition requires a \emph{binding} that valuates variables to identifiers. The binding is used to inject new fresh data into the net via variables that emit identifiers, i.e., via variables that appear only on the output arcs of that transition. We require bindings to be an injection, i.e., no two variables within a binding may refer to the same identifier. Note that in this definition, the freshness of identifiers is local to the marking, i.e., disappeared identifiers may be reused, as it does not hamper the semantics of the t-PNID\xspace. Our semantics allow the use of well-ordered sets of identifiers, such as the natural numbers, as used in~\cite{PolyvyanyyWOB19,RosaMF06} to ensure that identifiers are globally new. Here we assume local freshness over global freshness. \begin{definition}[Firing rule] Given a marked t-PNID\xspace $(N,m)$ with $N=(P,T,F,\alpha,\beta)$, a \emph{binding} for transition $t\in T$ is an injective function $\psi:\ensuremath{\mathcal{V}}\rightarrow \ensuremath{\mathcal{I}}$ such that $\ensuremath {type}(v) =\ensuremath {type}(\psi(v))$ and $\psi(v)\not\in \id{m}$ iff $v\in\newvar{t}$. Transition $t$ is \emph{enabled} in $(N,m)$ under binding $\psi$, denoted by $\enabled{(N,m)}{t,\psi}$ iff $\rho_\psi(\beta(p,t)) \leq m(p)$ for all $p\in\pre{t}$. Its firing results in marking $m'$, denoted by $\fire{(N,m)}{t,\psi}{(N, m')}$, such that $m'(p) + \rho_\psi(\beta(p,t)) = m(p) + \rho_\psi(\beta(t,p))$. \end{definition} Again, the firing rule is inductively extended to sequences $\eta\in (T\times(\ensuremath{\mathcal{V}}\rightarrow \ensuremath{\mathcal{I}}))^*$. A marking $m'$ is \emph{reachable} from $m$ if there exists $\eta\in (T\times(\ensuremath{\mathcal{V}}\rightarrow \ensuremath{\mathcal{I}}))^*$ s.t. $\fire{(N,m)}{\eta}{(N,m')}$. We denote with $\reachable{N}{m}$ the set of all markings reachable from $M$ for $(N,m)$. The execution semantics of a t-PNID\xspace is defined as an LTS that accounts for all possible executions starting from a given initial marking. \begin{definition}[Induced transition system] \label{def:induced-ts} Given a marked t-PNID\xspace $(N,m_0)$ with $N=(P,T,F,\alpha,\beta)$, its \emph{induced transition system} is $\tsys{N,m_0} = (\mathbb{M}(N),(T\times(\ensuremath{\mathcal{V}}\to\ensuremath{\mathcal{I}})),m_0, \to)$ with $m\xrightarrow{(t,\psi)} m^\prime$ iff $\fire{(N,m)}{t,\psi}{(N,m^\prime)}$. \end{definition} t-PNIDs\xspace are a vector-based extension of $\nu$-PNs. In other words, a $\nu$-PN can be translated into a strongly bisimilar t-PNID\xspace with a single type, and all place types are of length of at most $1$, which follows directly from the definition of the firing rule. \begin{corollary} \label{lemma:nupn} For any $\nu$-PN there exists a single-typed t-PNID\xspace such that the two nets are strongly rooted bisimilar. \end{corollary} As a result, the decidability of reachability for $\nu$-PNs transfers to t-PNIDs\xspace~\cite{RVFE11}. \begin{proposition}\label{prop:reachabilityundecidable} Reachability is undecidable for t-PNIDs\xspace. \end{proposition} \section{Enriching PNIDs with Resources} \label{sec:soundness:with:resources} In the previous section we discussed pattern-based correctness criteria, which allow to construct PNID models that are sound by design. We now consider arbitrary PNIDs, and study how they can be enriched with \emph{resources}, introducing a dedicated property, called \emph{conservative resource management}, which captures that the net suitably employs resources. Following a similar approach, in spirit, to that of Section~\ref{sec:soundness:by:construction}, we define a modelling guideline, called \emph{resource closure}, which takes as input a PNID and indicates how to enrich it with resources through a well-principled approach. We then show that, by construction, if the input PNID is sound, then all its possible resource closures do not only maintain soundness, but they also guarantee that resources are conservatively managed. In addition, we prove that such resource closures are also bounded, and discuss the implications on the analysis of this class of PNIDs. \subsection{Resource-Aware PNIDs} As customary for Petri nets, we model resource types as (special) places. However, differently from typical approaches like \cite{HSV06,LoBJ22,MontaliR16}, where resources are represented as indistinguishable (black) tokens populating such places, we assign identifiers to resources. This allows one to explicitly track how resources participate to the execution, and in particular how they relate to the different objects. At the same time, this poses a conceptual question: are different copies of the same identifier in distinct tokens representing different actual resources, or distinct references to the same resource? We opt for the latter approach, as it is the one that fully complies with this \emph{named approach} to resource management. As a consequence of this choice, we blur in the section the distinction between resource and resource identifier, using the two terms interchangeably. Technically, from now on we assume that $\Lambda$ is partitioned into two sets: $\obj{\Lambda}$ for object types, and $\res{\Lambda}$ for resource types. Given a resource type $\eta \in \res{\Lambda}$, we call its identifiers \emph{($\eta$-)resources}. We then simply define a \emph{resource-aware} t-PNID\xspace as a t-PNID\xspace with some distinguished places, each being of a certain resource type. \begin{definition}[Resource-aware t-PNID\xspace] A t-PNID\xspace $N=(P,T,F,\alpha,\beta)$ is \emph{resource-aware} if there exists at least one place $p \in P$ such that $\alpha(p) \in \res{\Lambda}$. We call the non-empty subset $\res{P} = \set{p \in P \mid \alpha(p) \in \res{\Lambda}}$ of $P$ as the set of \emph{resource places} of $N$. \end{definition} The initial marking of a resource-aware t-PNID\xspace hence identifies which resources are available per resource type. Consistently with the named approach to resources, every resource should be present at most once in the initial marking. Places typed by the combination of one or more object types and one resource type are used to establish relations between (tuples of) objects and corresponding resources, which we can interpret as \emph{resource assignments}. For example, given an object type $\mathit{Order}$ and a resource type $\mathit{Clerk}$, a token carrying pair $\tup{o,c}$ with $o \in \mathit{Order}$ and $c \in \mathit{Clerk}$ represents that order $o$ is assigned to clerk $c$. In an unrestricted t-PNID\xspace, resources and resource assignments can be freely manipulated, generating new resources along the execution, assigning the same resource to multiple objects, and establishing arbitrary relations between resources and objects/other resources. To determine whether a t-PNID\xspace employs resources property, we hence introduce a dedicated property that, intuitively, combines two requirements: \begin{compactitem} \item \emph{Resource preservation} - only resources present in the initial marking can be used throughout the execution; \item \emph{Resource exclusive assignment} - in a given marking, each resource can be assigned to at most an object/tuple of objects. \end{compactitem} The first requirement dictates that no resource can be newly generated during the execution; the second one stipulates that at every step, a resource can be responsible for at most one object or combination of objects, possibly being present in multiple tokens that all carry the same assignment. We formalize these two requirements as follows. \begin{definition}[Conservative resource management] \label{def:conservative-resource-management} A resource-aware marked t-PNID\xspace $(N,m_0)$ with $N=(P,T,F,\alpha,\beta)$ is \emph{managing resources conservatively} if the following two conditions hold. \begin{compactitem} \item \emph{Resource preservation}: for every marking $m\in\reachable{N}{m_0}$, resource type $\eta \in \res{\Lambda}$, and resource $r \in I(\eta) \cap \id{m}$, we have that $r \in I(\eta) \cap \id{m_0}$. \item \emph{Resource exclusive assignment}: for every marking $m\in\reachable{N}{m_0}$, resource type $\eta \in \res{\Lambda}$, and resource $r \in I(\eta) \cap \id{m}$, there is exactly one token $\vec{r_1},\vec{r_2}\in \supp{m}$ s.t. $r\in\vec{r_1}$ and $r\in\vec{r_2}$. \end{compactitem} \end{definition} \begin{figure}[t] \centering \begin{subfigure}{.32\textwidth} \centering \includegraphics[width=\textwidth]{figures/resource-not-pres} \caption{Resource not preserved\label{fig:resource-not-preserved}} \end{subfigure} \begin{subfigure}{.32\textwidth} \centering \includegraphics[width=\textwidth]{figures/resource-not-exclusive} \caption{Resource not exclusive\label{fig:resource-not-exclusive}} \end{subfigure} \begin{subfigure}{.32\textwidth} \centering \includegraphics[width=\textwidth]{figures/resource-conservative} \caption{Conservative resource\label{fig:resource-conservative}} \end{subfigure} \caption{Three examples of resource-aware t-PNID\xspace{s}. Nets (a) and (b) are not managing resources conservatively, as they respective violate the property of resource preservation and that of resource exclusive assignment. Net (c) is instead a positive example that satisfies both properties.}\label{fig:resource-management} \end{figure} \begin{example} \label{ex:resource-management} Figure \ref{fig:resource-management} shows three examples of resource-aware t-PNID\xspace{s}, where place order is of an object type and place clerk is of a resource type. The t-PNID\xspace in Figure \eqref{fig:resource-not-preserved} attempts to model a setting where every order is managed by a clerk. The main issue here is that there is no information stored in the net about which clerk handles which order. In fact, starting from a marking that indicates which clerks are available, the net violates the property of resource preservation, as when \emph{send order} fires, it brings into the \emph{clerk} place a freshly generated resource (not matching the one previously consumed in \emph{create order} - recall, in fact, that the scope of variables is that of a single transition). The t-PNID\xspace in Figure \eqref{fig:resource-not-exclusive} explicitly keeps track of the assignments of clerks to orders in a dedicated ``synchronization'' place. Starting from a marking that indicates which clerks are available, it satisfies resource preservation, as no new clerk identifier is generated, but it violates the property of resource exclusive assignment, since two different order creations may lead to select the same resource twice, assigning it to two different orders. The t-PNID\xspace in Figure \eqref{fig:resource-conservative} properly handles the assignment of clerks to orders. Starting from a marking that indicates which clerks are available, every time a new order is created, an existing clerk is exclusively assigned to that order. The fact that the same clerk is not reassigned is guaranteed by the fact that the clerk is consumed upon creating the order, and recalled in the assignment place. When the order is sent, its exclusively assigned clerk is released back into the place of (available) clerks, and can be later exclusively assigned to a different order. \end{example} By recalling that t-PNID\xspace{s} evolving tokens that carry pairs of identifiers are Turing-powerful \cite{GGMR22}, and hence every non-trivial property defined over them is undecidable to check, we obtain the following. \begin{remark} Verifying whether a marked t-PNID\xspace manages resources conservatively is in general undecidable. \end{remark} To mitigate this negative result, we introduce an approach that drives the modeller in enriching an input t-PNID\xspace via resources following a well-principled approach. The approach generalizes the idea introduced in \cite{MontaliR16} to the more sophisticated case of t-PNID\xspace{s}, and does so by following the modelling strategy used in Figure~\ref{fig:resource-conservative}. In particular, it aims at capturing the following modelling principles: \begin{compactenum} \item every object type $\lambda$ is associated to a dedicated resource type $\eta_\lambda$; \item each such resource type is used in two places - one just typed with $\eta_\lambda$, to indicate which resources of that type are currently available, the other typed by $\lambda \cdot restype_\lambda$, to keep track of which resources are currently assigned to which objects; \item every object of type $\lambda$ gets assigned a resource of type $\eta_\lambda$ upon creation, and until the consumption of the object, its resource cannot be assigned to any other object; \item transitions applied to an object may (or may not) require its resource in isolation from the others (if so, implicitly introducing serialization); \item upon consumption of an object, its resource may either be permanently consumed as well, or freed and become again available to further assignments. \end{compactenum} Technically, we substantiate these intuitive principles through the notion of resource closure. \begin{definition}[Resource closure] \label{def:closure} Let $N=(P,T,F,\alpha,\beta)$ and $N'=(P',T',F',\alpha',\beta')$ be two t-PNID\xspace{s}, and $\lambda\in\ensuremath {type}_\Lambda(N)$ be an object type. We say that $N'$ is a \emph{$\lambda$-resource closure} of $N$ if the following conditions hold: \begin{compactenum} \item $P' = P\cup\set{p_r,p_s}$, where and $p_r$ and $p_s$ are respectively called the \emph{resource} and \emph{assignment} places, and $p_r,p_s\not\inP$. \item $ \alpha'= \alpha \cup \set{p_r\mapsto \eta \mid \eta \in \res{\Lambda} \setminus \ensuremath {type}(N)} \cup \set{p_s\mapsto \lambda\cdot \alpha'(p_r)}$ extends $\alpha$ by typing $p_r$ with a resource type $\eta$ not already used in $N$, and $p_s$ with the combination of the object type $\lambda$ and the resource type $\eta$ of $p_r$. \item $F' = F \cup F_r^{out} \cup F_r^{in} \cup F_s^{in} \cup F_s^{syn} \cup F_s^{out}$, where: \begin{compactenum} \item $F_r^{out} = \set{(p_r,t)\mid t\in E_N(\lambda)}$, the \emph{output resource flow relation}, indicates that every emitter transition for $\lambda$ consumes a resource from $p_r$; \item $F_r^{in} \subseteq \set{(t,p_r)\mid t\in C_N(\lambda)}$, the \emph{input resource flow relation}, indicates that every consumer transition for $\lambda$ \emph{may} return a resource to $p_r$; \item $F_s^{in} = \set{(t,p_s)\mid t\in E_N(\lambda)}$, the \emph{input assignment flow relation}, indicates that every emitter transition generates an assignment in $p_s$; \item $F_s^{out} = \set{(p_s,t)\mid t\in C_N(\lambda)}$, the \emph{output assignment flow relation}, indicates that every emitter transition consumes an assignment from $p_s$; \item $F_s^{syn} \subseteq\set{(p_s,t),(t,p_s)\mid t\in T\setminus (E_N(\lambda)\cup C_N(\lambda))}$, the \emph{synchronization assignment flow relation}, indicates that every ``internal'' (i.e., non-emitting and non-consuming) transition for $\lambda$ \emph{may} check for the presence of an assignment in $p_s$. \end{compactenum} \item $\beta'$ is the extension of $\beta$ satisfying the following conditions: \begin{compactenum} \item $\beta'(a,b)=\beta(a,b)$, if $(a,b)\inF$. \item For every $\lambda$-emitter $t \in E_N(\lambda)$, we define $\beta'(p_r,t)$ and $\beta'(t,p_s)$ as described next. Let $X = \set{x_1,\ldots,x_n}$ be the set distinct variables of type $\lambda$ mentioned in the inscriptions of outgoing arcs of $t$, that is, $X = \set{x | x \in \beta(t,p) \text{ for some } p \in P}$. These variables denote the $n$ distinct objects of type $\lambda$ created upon firing $t$. We then need to consume $n$ distinct resources of type $\eta$ and establish the corresponding assignments: $\beta(p_r,t) = (r_1)\cdots(r_n)$ and $\beta(t,p_s) = (x_1,r_1) \cdots (x_n,r_n)$, where $r_1,\ldots,r_n$ are $n$ distinct (resource) variables of type $\eta$. \item A symmetric approach is used to define $\beta'(p_s,t)$ and (in case $(t,p_r) \in F_r^{in}$ is defined) $\beta'(t,p_r)$ for every $\lambda$-consumer $t \in C_N(\lambda)$ (based on the incoming arcs of $t$). \item For every (internal) transition $t\in T\setminus (E_N(\lambda)\cup C_N(\lambda))$ such that $\set{(p_s,t),(t,p_s)} \subseteq F_s^{syn}$, we define $\beta'(p_s,t)$ and $\beta'(t,p_s)$ as described next. Let $X = \set{x_1,\ldots,x_n}$ be the set distinct variables of type $\lambda$ mentioned in the inscriptions of incoming arcs of $t$, that is, $X = \set{x | x \in \beta(p,t) \text{ for some } p \in P}$. These variables denote the $n$ distinct objects of type $\lambda$ accessed upon firing $t$. We then need to check for the presence of the $n$ distinct assigned resources to this objects, by defining $\beta'(p_s,t) = \beta'(t,p_s) = (x_1,r_1) \cdots (x_n,r_n)$, where $r_1,\ldots,r_n$ are $n$ distinct (resource) variables of type $\eta$. \end{compactenum} \end{compactenum} A t-PNID\xspace is called a \emph{(full) resource closure of $N$} if it is obtained by recursively constructing, starting from $N$, $\lambda_i$-resource closures for every $\lambda_i\in\ensuremath {type}_\Lambda(N)$. \end{definition} The closure(s) of a marked t-PNID\xspace is defined by closing the t-PNID\xspace as per Definition~\ref{def:closure}, and enriching the initial marking by populating the resource places with some resources. \begin{definition} \label{def:marked-closure} Let $(N,m_0)$ and $(N',m'_0)$ be two marked t-PNID\xspace{s}, and $\lambda\in\ensuremath {type}_\Lambda(N)$ be an object type. We say that $(N',m'_0)$ is a \emph{$\lambda$-marked resource closure} of $N$ if the following conditions hold: \begin{enumerate} \item $N'$ is a $\lambda$-resource closure of $N$; \item $m'_0$ extends $m_0$ by assigning to the resource place $p_r$ introduced in $N'$ a \emph{finite subset} of identifiers of type $\ensuremath {type}(p_r)$. \end{enumerate} A marked t-PNID\xspace is called a \emph{(full) marked resource closure of $(N,m_0)$} if it is obtained by recursively constructing, starting from $(N,m_0)$, $\lambda_i$-marked resource closures for every $\lambda_i\in\ensuremath {type}_\Lambda(N)$. \end{definition} Notice that, in Definition~\ref{def:marked-closure}, we obey to the named approach described in the opening of this section by assigning to the resource place a set (and not a multi-set) of resources. It is easy to see that, for a t-PNID\xspace $N$ and a type $\lambda$, there are only finitely many distinct $\lambda$-closures of $N$, obtained by choosing which $\lambda$-consumers actually return resources in the resource place of the closure, and which internal $\lambda$-transitions access the assignment place of the closure. Marked t-PNID\xspace{s} defined on these finitely many distinct closures only differ by the set of identifiers they initially assign to each resource place. \begin{example} \label{ex:simple-resource-closure} Figure~\eqref{fig:resource-conservative} shows the only possible (order-)resource closure for the t-PNID\xspace manipulating orders via the \emph{create order} and \emph{send order} transitions, and the orange place in between. In particular, the resource type of clerk is chosen for the closure. The green place (in fact, typed \emph{clerk}) at the bottom of the picture is the resource place of the closure, while the mixed-colored place (in fact, typed \emph{order$\cdot$clerk}) is the assignment place of the closure. The inscriptions attached to the input/output arcs connecting these two places to the emitter and consumer transitions for orders indicate how identifiers are being matched when consuming/returning resources, while recalling the objects they get assigned to. \end{example} \begin{figure}[t] \centering \begin{subfigure}{.6\textwidth} \centering \includegraphics[width=\textwidth]{figures/sound-net} \caption{A sound t-PNID\xspace manipulating an object type $O \in \obj{\Lambda}$\label{fig:sound-net}} \end{subfigure} \begin{subfigure}{.6\textwidth} \centering \includegraphics[width=\textwidth]{figures/sound-net-closure-1} \caption{An $O$-resource closure of the t-PNID\xspace (a) \label{fig:sound-net-closure-1}} \end{subfigure} \begin{subfigure}{.6\textwidth} \centering \includegraphics[width=\textwidth]{figures/sound-net-closure-2} \caption{Another $O$-resource closure of the t-PNID\xspace (a) \label{fig:sound-net-closure-2}} \end{subfigure} \caption{An identifier-sound t-PNID\xspace and two alternative resource closures}\label{fig:resource-closures} \end{figure} \begin{example} \label{ex:resource-closures} Figure~\eqref{fig:sound-net} illustrates a t-PNID\xspace with a single object type $O$, manipulated using sequential and concurrent transitions, and finally consumed through one of two (mutually exclusive) consumers. resource closures. Two resource closures of this net are shown in Figures~\eqref{fig:sound-net-closure-1} and~\eqref{fig:sound-net-closure-2}, using $R$ as resource type. The closure in Figure~\eqref{fig:sound-net-closure-1} shows that for an object $o$ that is consumed by transition $f$, its assigned resource is returned to the resource place, becoming again available for a further assignment. If $o$ is instead consumed by transition $g$, the resource is also consumed (fetching it from the assignment place without returning it to the resource place). In addition, the two transitions $c$ and $d$, which are concurrent in the original t-PNID\xspace of Figure~\eqref{fig:sound-net}, are now declared to require the resource \emph{in isolation}, therefore implicitly requiring serialization (in whatever order). The closure in Figure~\eqref{fig:sound-net-closure-1} depicts a slightly different scenario. On the one hand, both consumers now return the assigned resource upon consuming an object. On the other hand, no internal transition of the original t-PNID\xspace are linked to the assignment place, hence transitions $c$ and $d$ continue to be truly concurrent even after the application of the resource closure. \end{example} Examples~\ref{ex:simple-resource-closure} and~\ref{ex:resource-closures} show different examples of well-behaved resource closures, which indeed technically substantiate the informal modelling principles listed above and, even more, actually satisfy the property of conservative resource management, as per Definition~\ref{def:conservative-resource-management}. A natural question is whether this holds when resource closure is applied to an arbitrary input t-PNID\xspace. It is easy to show on even very minimalistic examples that provide a negative answer to this question. \begin{figure}[t] \centering \begin{subfigure}{.49\textwidth} \centering \includegraphics[width=\textwidth]{figures/unsound-net} \vspace*{2.3cm} \caption{An unsound t-PNID\xspace with an object type $O \in \obj{\Lambda}$\label{fig:unsound-net}} \end{subfigure} \begin{subfigure}{.49\textwidth} \centering \includegraphics[width=\textwidth]{figures/unsound-net-closure} \caption{An $O$-resource closure of the t-PNID\xspace (a) \label{fig:unsound-net-closure}} \end{subfigure} \caption{An identifier-unsound t-PNID\xspace and one of its resource closures}\label{fig:resource-unwanted-closure} \end{figure} \begin{example} \label{ex:resource-unwanted-closure} Figure~\ref{fig:resource-unwanted-closure} illustrates a t-PNID\xspace and one of its resource closures. One can immediately see that the resource closure does not behave as expected. Upon creation of a new object of type $O$, say, $o_1$, a resource, say, $r_5$ of type $R$ is taken from the resource place and assigned to $o_1$, keeping track of the assignment $(o_1,r_5)$ in the assignment place. Object $o_1$ then flows through the t-PNID\xspace, leading to the generation of two tokens carrying $o_1$, concurrently enabling the consumer transitions $c$ and $d$. Upon the consumption of the first of such two tokens, the assignment token $(o_1,r_5)$ is removed from the assignment place and used to return $r_5$ to the resource place. This means that the second token carrying $o_1$ stays forever stuck, and cannot be consumed, as there is no assignment token matching $o_1$ that can be used to fire the consumer transition. \end{example} By more closely inspecting the negative example of resource closures discussed in Example~\ref{ex:resource-unwanted-closure}, one can notice that the modelling glitch is not natively caused by the resource closure itself, but actually originates from the fact that the input t-PNID\xspace of Figure~\eqref{fig:unsound-net} is not identifier-sound. In particular, considering this t-PNID\xspace, initially marked by the empty marking (or, equivalently, the t-PNID\xspace of Figure~\eqref{fig:unsound-net-closure}, initially marked by a marking that inserts some resources in the resource place), the violated property is the one of proper completion: once one of the two concurrent consumer transitions $c$ and $d$ is fired to consume a previously created object, the identifier of the object still persists in the token enabling the other consumer transition. The resource closure actually inherits the lack of proper completion, but also suffers of lack of weak termination. This leads to the following, natural follow-up question: how does identifier-soundness of an arbitrary input t-PNID\xspace impact on the properties of the t-PNID\xspace{s} resulting from the application of resource closure? We answer by showing three key properties: \begin{compactenum} \item \emph{Soundness induces conservative resource management} - the application of resource closure to an identifier-sound t-PNID\xspace leads to t-PNIDs\xspace that indeed satisfy the modelling principles listed above, and in particular the property of conservative resource management. \item \emph{Soundness is preserved} - Every resource closure of an identifier-sound t-PNID\xspace is an identifier-sound t-PNID\xspace. \item \emph{Soundness induces boundedness} - Every resource closure of an identifier-sound t-PNID\xspace is a bounded t-PNID\xspace. \end{compactenum} We start with conservative resource management. This is proved by showing that proper completion and weak termination combine well with resource closures. \begin{theorem} \label{thm:conservative-closure} Let $(N,m_0)$ be a marked t-PNID\xspace, and $(N',m'_0)$ one of its marked resource closures. If $(N,m_0)$ is identifier-sound, then $(N',m'_0)$ manages resources conservatively, in the sense of Definition~\ref{def:conservative-resource-management}. \end{theorem} \begin{proof} By definition of resource closure, every marking $m \in \reachable{N'}{m'_0}$ mentions only resources contained in $m'_0$, as no resource type has an emitter. This immediately proves resource preservation. In addition, by construction every resource closure is so that in every marking $m \in \reachable{N'}{m'_0}$, there can be at most one single token in the assignment place per resource. The only way of breaking exclusive resource assignment is to allow for markings where an object is not associated to any resource (i.e., the assignment place associated to the type of that object does not contain a token whose first component matches the object). This can only occur if an object identifier is fed into a collector transition, and its value still persists in the consequently obtained marking (attached to some other token). This is however impossible, as, by hypothesis, the original t-PNID\xspace is identifier-sound and, hence, properly completes, which contradicts this scenario. \end{proof} We continue with soundness preservation. The crux here is that the enrichment with a t-PNID\xspace with resources through resource closure does not alter the evolution of emitted objects, but only constrains \emph{when} new objects can be created. \begin{theorem} \label{thm:soundness-preservation} Let $(N,m_0)$ be a marked t-PNID\xspace, and $(N',m'_0)$ one of its marked resource closures. If $(N,m_0)$ is identifier-sound, then $(N',m'_0)$ is identifier-sound as well. \end{theorem} \begin{proof} By definition of resource closure, the reachability graph $\reachable{N'}{m'_0}$, projected on the original places of $N$, is a subset of $\reachable{N}{m_0}$. In fact, the only effect of resource closure on the original marked net is to prevent the possibility of creating new objects if the resource place attached to the corresponding emitter is empty. Since proper termination is a universal property over markings, it is preserved by subsets of $\reachable{N}{m_0}$ and, noticing that resource and assignment places do not affect the status of proper completion, hence also by $\reachable{N'}{m'_0}$. This proves that $(N',m'_0)$ properly completes. As for weak termination of $\reachable{N'}{m'_0}$, assume by absurdum that one object $o$ of type $\lambda$ cannot progress to consumption. Since the original t-PNID\xspace is weakly terminating, this can only happen due to the absence of (the only) assignment token referencing $o$ and being present in the assignment place associated to $\lambda$. Such a token was by construction generated upon the creation of $o$, and consequently its absence can be only due to a previous firing of some collector transition that consumed a token referencing $o$. This would however mean that $\reachable{N'}{m'_0}$ is not properly completing, which contradicts what was proven before. \end{proof} Finally, we turn to boundedness of resource closures of sound t-PNID\xspace{s}. Intuitively, this is due to the good interaction between resources and objects: \begin{compactitem} \item there are boundedly many resources available; \item new objects can be created as long as there are still available resources; \item when no resource is available, a new object can be created only upon destruction of a currently existing one. \end{compactitem} This reconstructs, in the more sophisticated case of t-PNID\xspace{s}, the boundedness result for resource and instance-aware workflow nets, at the core of \cite{MontaliR16}. \begin{theorem} \label{thm:closure-boundedness} Let $(N,m_0)$ be a marked t-PNID\xspace, and $(N',m'_0)$ one of its marked resource closures. If $(N,m_0)$ is identifier-sound, then $(N',m'_0)$ is bounded. \end{theorem} \begin{proof} Boundedness immediately holds for resource identifiers in $\reachable{N'}{m'_0}$, thanks to Theorem~\ref{thm:conservative-closure} and the fact that $(N',m'_0)$ manages resources conservatively, and to the fact that, by construction of resource closure, every resource originally present in $m'_0$ is either carried by one token present in its corresponding resource place, or by one token present in its corresponding assignment place. We then prove the theorem by showing that $(N',m'_0)$ is width- and depth-bounded when considering object identifiers. Depth boundedness is immediately obtained by recalling that, by Theorem~\ref{thm:soundness-preservation}, identifier-soundness of $(N,m_0)$ implies identifier-soundness of $(N',m'_0)$, which is consequently depth-bounded by Lemma~\ref{lemma:depth}. Width-boundedness instead follows from the observation, already used in the proof of Theorem~\ref{thm:conservative-closure}, that for every marking $m \in \reachable{N'}{m'_0}$, if $o \in \id(m)$, then there is exactly one token referencing $o$ in the assignment place associated to the type of $o$. Hence the maximum number of object identifiers is bounded by the number of resources present in $m'_0$. \end{proof} By combining Theorems~\ref{thm:conservative-closure} and~\ref{thm:model-checking}, we thus obtain the following conclusive result, that relates to the verification results discussed in Section~\ref{sec:verification}. \begin{corollary} \label{cor:model-checking-closure} Model checking of $\mu\L{\text{-FO}}^{\text{PNID}}$ and $LTL\text{-}FO_p^{\text{PNID}}$ is decidable for marked resource closures of identifier-sound t-PNIDs\xspace. \end{corollary} \endinput \todo[inline]{ANDY, HERE I HAVE CLOSED!} Without loss of generality, given a full resource closure of $N$, where $P_r$ is the set of resource places, we call a \emph{resource marking} a function $R: P_r \to \mult{\Lambda}$, such that $R(p) \in \mult {\funsym{C}(p_r)}$, for each place $p \in P_r$. In what follows, given $(\overline{N},m_0+R)$ with initial marking $m_0+R$, we denote with $\restr{\reachable{\overline N}{m_0+R}}{P}$ to denote the reachability set of $\overline{N}$ s.t. for every $m\in \restr{\reachable{\overline N}{m_0+R}}{P}$ it holds that $\dom{m}=P$.\footnote{Here $\dom{f}$ is used to define the domain of function $f$.} In other words, such reachability set carries only markings that do not feature resource and synchronization places. It is easy to see that $\restr{\reachable{\overline N}{m_0+R}}{P}\subseteq \reachable{N}{m_0}$ as the former contains only markings that can be produced by taking into account the resource acquisition and (potential) release cycle. The above definition demonstrates a necessary syntactic condition that has to be satisfied by every object type that is constrained by a bounded number of resources. Specifically, every resource place $r$ must be connected to all emitter transitions that generate identifiers of type $\alpha(r)$ as well as all collecting transitions that consume identifiers of the same type. he same must happen with synchronization places: upon firing of an emitter and consequent production of an identifier, one resource gets reserved and its ``binding'' to the generated identifier gets recorded (as a pair in the dedicated synchronization place). At the end of this identifier's lifecycle, the resource is either sent back to the resource place or simply consumed. The same happens with the token carrying the aforementioned identifier-resource pair: it gets removed from the associated synchronization place. \andy{here we should give a couple of examples of resource closures, one with XOR and one with AND split, highlighting also the need of synchronization places } We now present a soundness criterion, akin to the one presented in Section~\ref{sec:soundness}, that also accounts for net resources provided with the net's initial marking. This definition, apart from the proper type completion and weak termination, guarantees that resource tokens are always either consumed or back to their places whenever the execution of related active objects is over, and that at any moment in time the number of resources available in the net does not exceed the number that was originally provided by the initial resource marking. It is easy to see that the last condition also guarantees that no resources can be created during the process execution. \begin{definition}[Resource soundness]\label{def:rc-soundness} Given a marked t-PNID\xspace $(N, m_0)$ and a type $\lambda\in\ensuremath {type}_\Lambda(N)$, its marked $\lambda$-resource closure $(\overline{N_\lambda},m_0+R)$ is called \emph{$(\lambda, R)$-sound} iff \begin{enumerate} \item $(\overline{N_\lambda},m_0+R)$ is proper $\lambda$-completing and is weakly $\lambda$-terminating; \item for any $m\in\reachable{\overline{N_\lambda}}{m_0+R}$, it holds that $m(p_r)\subseteq R(p_r)$, where $p_r$ is the resource place of $\overline{N_\lambda}$. \end{enumerate} A full resource-closure $(\overline{N_\lambda},m_0+R)$ of $N$ is called \emph{$R$-sound} iff $(\overline{N_\lambda},m_0+R)$ is $(\lambda, R)$-sound, for every $\lambda\in \ensuremath {type}_\Lambda(N)$. \end{definition} The rationale behind introducing the resource-constrained soundness property is twofold. First, resources are intrinsic components of modern information systems and considering their presence in mathematical models of such systems is crucial in order to correctly represent all possible behaviors of the former. Second, constraining the production and consumption cycle of identifiers may seem beneficial from the technical perspective. \andy{\textbf{Marco}, you have the lock until here} Let us first mention an interesting and natural property that almost immediately follows from Definition~\ref{def:rc-soundness}. \begin{proposition} \label{lemma:rc-boundedness} Let $(N, m_0)$ be a marked t-PNID\xspace. If $(\overline{N}, m_0+R)$ is $R$-sound for any $R: P_r \to \mult{\Lambda}$, then $(\overline{N}, m_0+R)$ is bounded. \end{proposition} \begin{proof} Suppose that $(\overline{N}, m_0+R)$ is properly $\lambda$-completing for every $\lambda\in\ensuremath {type}_\Lambda(N)$ but it is not bounded. This means that there is at least one place $p\inP$ of $\overline N$ such that there exists an infinite sequence of growing markings s.t. for every $i\in\mathbb{N}$ in that sequence it holds that $m_i(p)<m_{i+1}(p)$, for $m_i,m_{i+1}\in\reachable{\overline{N}}{m_0+R}$. By the definition of $R$-soundness, the net weakly terminates and thus every identifier value must be eventually removed by one of the consumers, which also means that such sequence cannot exist. This ensures that the net is depth-bounded (similarly to Lemma~\ref{lemma:depth}). Notice also that, according to the same $R$-soundness definition, the number of resource tokens in each $m\in\reachable{\overline{N}}{m_0+R}$ does not go beyond their original number assigned by $R$. Moreover, by the construction of resource closure from Definition~\ref{def:closure}, whenever a new identifier is produced, it has to be associated to a resource from one of the resource places. Since the number of such resources is always bounded by $R$, the net is also width-bounded. Hence, $(\overline{N}, m_0+R)$ is bounded. \end{proof} As the lemma demonstrates, adding resources by following the construction described in Definition~\ref{def:closure} ensures that the sound net is also bounded. This is different from t-PNIDs\xspace without resources as identifier soundness guarantees only depth-boundedness (as it has been demonstrated in Lemma~\ref{lemma:depth}. One may also wonder whether resource closure is actually a soundness preserving transformation. We next answer positively this question. \begin{proposition} \label{prop:soundness-preservation} Let $(N, m_0)$ be a marked t-PNID\xspace. If $(N, m_0)$ is identifier sound, then $(\overline{N}, m_0+R)$ is $R$-sound for any $R: P_r \to \mult{\Lambda}$. \end{proposition} \begin{proof} \end{proof} \andy{bounded nets are generic (i.e., induce generic transition systems)} \andy{Jackson nets + resource closure allow to check sophisticated properties specified in a FO-variant of $\mu$-calculus (this is provided by the boundedness)} \andy{do we want to talk about safety for coa-nets?} \begin{theorem} $R$-soundness is undecidable for resource-closed t-PNIDs\xspace. \end{theorem} \begin{proof} \andy{are we sure about that?} \end{proof} \andy{At the fist glance, resource closed nets may seem bounded. This is not true as, strictly speaking, we may construct a t-PNID\xspace whose closure does not control ``copying'' of already created identifiers (each of which, upon construction, must be assigned to a resource). This case is demonstrated in Figure~\ref{add a figure of such an example}. To ensure the boundedness in the presence of resources, we have to require that, in the original net, identifier production and consumption is done correctly (that is, and that all the produced identifiers are consumed whenever one of the consumer transitions fires, which also results in releasing the resources assigned to these identifiers. } \andy{comment on the fact why we don't add more resource places. indeed, this is possible and would allow to see resource lifecycles (again, see our paper with Lomazova, we use a very similar machinery there)} Although resource soundness is undecidable in general, we saw from Proposition~\ref{prop:soundness-preservation}, that resource closure is the soundness preserving transformation. As we demonstrated in Section~\ref{sec:soundness:by:construction}, there are classes of t-PNIDs\xspace for which soundness can be shown by construction. Providing a resource closure for such nets does not alter their soundness and, moreover, makes them bounded (see Lemma~\ref{lemma:rc-boundedness}). As we have shown in Section~\ref{sec:verification}, boundedness is a necessary criterion to make t-PNIDs\xspace amenable for first-order $\mu$-calculus verification. Like that, for example, one may construct a resource closure for a t-JN (remember that t-JNs are identifier sound by construction which only ensures depth-boundedness of t-JNs) and verify more sophisticated properties on it using the verification machinery described in Section~\ref{sec:verification}.
\section{Introduction}\label{Intro} \IEEEPARstart{L}OCATION AWARENESS is an essential feature of sixth-generation cellular communication systems as high-accuracy user positioning facilitates low latency and reliable wireless communications, also in indoor or GNSS-deprived environments \cite{de2021convergent}. Indeed, in harsh \ac{EM} environments achieving high positioning accuracy is a challenging task due to the presence of multipath, cluttering and \ac{NLOS} propagation \cite{wang2022location}. Traditional solutions to this issue include the deployment of numerous \acp{BS} and the use of advanced signal processing techniques \cite{witrisal2016high} while lower complexity alternatives include passive relays typically made of a single omni-directional antenna. More recently, the introduction of intelligent surfaces (ISs), either in active or reflective mode, has been welcomed as a game-changer low-power technology to realize \acp{SRE}\cite{he2022beyond}. Thanks to their capability to control the amplitude and phase of the impinging wavefront, \acp{RIS} can be used to boost communication performance by focusing the power on interested users and by enabling higher data rates \cite{renzo2019smart, basar2019wireless, alexandropoulos2021reconfigurable, flamini2022towards, zhang2022beam}. At the same time, thanks to the possibility of constructing such surfaces with large physical apertures that enable an increased angular resolution, they also improve the accuracy of localization systems \cite{wymeersch2020radio, elzanaty2021reconfigurable, zhang2021metalocalization, dardari2021nlos,guidi2021radio, wymeersch2022radio, chen2022tutorial}. The potential benefits brought by the adoption of \acp{RIS} in localization systems have been investigated in several papers. For example, in \cite{bjornson2022reconfigurable}, a \ac{SISO} \acf{OFDM} downlink scenario with a \ac{RIS} in a far-field regime is analyzed from communication and localization perspective. Similarly, the authors in \cite{wymeersch2020radio} derive \ac{CRLB} on positioning in a downlink scenario, demonstrating the benefit of using \acp{RIS} in far-field over methods that merely utilize the environment's natural scattering. Instead, the authors in \cite{elzanaty2021reconfigurable} explore the localization performance limits for an uplink \ac{MIMO} system operating using near-field propagation models, valid for limited distances, demonstrating the improvement in localization accuracy when a single \ac{RIS} is present. In \cite{guidi2021radio}, the impact of an \ac{EM} lens on near-field positioning performance is investigated through a maximum likelihood estimation analysis, whereas, in \cite{dardari2021nlos}, the problem of single-anchor localization assisted by \ac{RIS} is considered for applications characterized by frequent \ac{NLOS} conditions. Other practical \ac{RIS}-aided localization algorithms can be found in \cite{zhang2021metalocalization,zhang2020towards,nguyen2021wireless}. The localization and communication performance severely depends on how \acp{RIS} are designed and controlled. In this regard, a rich literature is available for optimizing \ac{RIS}-aided communications under different \ac{CSI} and/or localization levels of a-priori knowledge \cite{abrardo2021intelligent,zhou2022joint,dai2021statistical}. \ac{RIS} optimization schemes designed to improve communications are not, in general, optimum or good to increase localization accuracy because the respective performance indicators (e.g., the achievable rate vs. position error bound) depend differently on RIS configuration, channel characteristics, and geometry. Fewer results on \ac{RIS} optimization dedicated to localization are available. In particular, \cite{denis2021method} develops a method for the computation of the \ac{UE} position through multiple \acp{RIS} that are alternatively enabled and tuned using a localization-based cost function. The overall problem is expressed as an iterative procedure during which a minimum distance criterion is used to activate a specific \ac{RIS} and to estimate the \ac{UE} position. In \cite{rahal2022constrained}, the authors present a \ac{RIS} design method based on optimizing a closed-form \ac{PEB} in the presence of \ac{NLOS} and considering practical hardware constraints. In \cite{gao2022wireless}, a worst-case localization design is proposed based on the minimization of the squared \ac{PEB}. In \cite{feng2021power}, an optimization problem for \ac{RIS} localization and transmit power minimization is presented both for the case of single and multiple targets, using the \ac{CRLB} and the semidefinite release method for the power optimization problem. Recently, the localization and communication tasks have been addressed jointly. Along this direction, the paper \cite{FanJiang2022} considers the localization statistics, determined using the \ac{FIM} of the observation model, and proposes a new framework for integrated localization and communication. Therefore, the subsequent \ac{RIS} configurations are fixed along a location coherence interval, while the \ac{BS} precoders are optimized at each channel coherence interval. In \cite{palmucci2022}, a joint communication and localization approach is presented in which the \ac{RIS} is designed to maximize the average rate by taking advantage of a \ac{RIS}-aided tracking procedure. The problem of jointly designing localization and communication is also tackled in \cite{he2020adaptive} where a hierarchical codebook for the \ac{RIS} phase profile is proposed to enable adaptive bisection search over the angular space. Most of the works entailing \ac{RIS}-aided localization consider snapshot positioning in the far-field region \cite{wang2022location, denis2021method, elzanaty2021reconfigurable, dardari2021nlos, feng2021power,zhang2021metalocalization,he2020adaptive}. In contrast, only a few works consider the \ac{UE} tracking problem. Among them, in \cite{boyu2022bayesian}, a multiple-antenna \ac{BS} estimates the position of a multiple-antenna \ac{UE} and tracks its trajectory through a message-passing algorithm that infers the \ac{UE} position starting from the estimated \acp{AOA}. Such an observation model is valid when the system operates in the far-field and only bearing information can be retrieved to infer the \ac{UE} position. Moreover, two-step positioning approaches starting from intermediate parameters, e.g., \acp{AOA}, are suboptimal with respect to direct algorithms and require a proper characterization of the measurement statistics. In the algorithm proposed in \cite{boyu2022bayesian} both the \ac{BS} and the \ac{RIS} design are optimized to minimize the Bayesian \ac{CRLB}, however the \ac{RIS} optimization, designed to focus the reflected power towards the position estimate, does not consider the \ac{UE} uncertainty area. Moreover, the authors assume that, at each time step and whenever a new position estimate is available, the transmission parameters are optimized, leading to higher system latency and signaling overheads. In general, better localization performance can be accomplished through directional beamforming at the \ac{BS} side, provided it is equipped with many antennas and, for the optimal result, that there exists a-priori \ac{UE} location information \cite{fascista2022ris}. Hence, to increase the system degrees of freedom in a \ac{RIS}-aided environment, the optimization process may involve the joint design of \ac{BS} precoder and \ac{RIS} profiles, as it happens in \cite{boyu2022bayesian}. However, considering that most applications require a high localization update during the tracking process (e.g., $10$-$100\,\mathrm{Hz}$ refresh rate), it is obvious that the optimization of the \ac{RIS} at the same rates of location update and precoder optimization would pose severe issues in terms of signaling overhead, complexity, latency, and technology. Therefore, there is a need for solutions ensuring reliable tracking with much lower \ac{RIS} reconfiguration rates in the presence of \ac{NLOS} conditions between the \ac{BS} and the \ac{UE} and exploiting the opportunities of near-field propagation. To overcome the limitations present in the literature, in this work we study a two-time scale joint optimization problem for the \ac{BS} precoder and the \acp{RIS} reflection coefficients in a single-user \ac{MIMO} scenario where a moving \ac{UE}, either in the far- or near-field, estimates its trajectory using multiple \acp{RIS}. Differently from the literature, the overall complexity is kept affordable assuming that \ac{RIS} optimization is performed less frequently than localization and precoding adaptation. Nonetheless, this optimization accounts for the trajectory prediction within a finite time horizon up to the next optimization step, avoiding the so-called {\em deafness problem} caused by a loss of tracking due to the narrow beams. In our analysis, a novel observation model is introduced for the tracking process and is based on the normalized received signals originating from different \acp{RIS} at each \ac{UE} receiving antenna. Unlike previous works on \ac{RIS}-aided tracking, we consider a near-field signal model and we design an observation function that accounts for direct positioning. In this way, there is no need for an intermediate process of \ac{AOA} estimation as the observations depend not only on the angle of view of the \ac{UE} but also on its distance \cite{guerra2021near}. Strong nonlinearities caused by phase periodicity are mitigated thanks to the proposed observation model without affecting the localization accuracy, thus allowing the adoption of a classical low-complexity \ac{EKF} algorithm \cite{dardari2015indoor}. Moreover, in this work, we consider a pilot-based method aimed at transmitting separated beams toward the RISs, i.e., capable of removing both the cross-RIS interference at the \ac{UE} and the contribution of the direct BS-UE connection. This is achieved by relying on \ac{BD} beamforming \cite{Saggese2019} for the design of the \ac{BS} precoders. Finally, based on the definition of the \ac{MSE} of the position estimate, we formulate an optimization problem for the transmission parameters consisting of the \ac{RIS} reflection coefficients and \ac{BS} precoder that minimize the tracking error and account for the range of position uncertainty between two subsequent optimization steps. Due to the high complexity and non-convexity of the derived function, the problem is recast in a simple form that allows to optimize the \acp{RIS} phase profiles and the precoders separately. As a result, through an iterative \ac{BCD} algorithm that provides a local optimum, the \acp{RIS} are designed to minimize the average of the inverse of the received power in the \ac{UE} uncertainty area. Moreover, we found that the optimal power allocation for tracking is different from the idea of waterfilling, used for maximizing the achievable rate, where most of the power is distributed in favor of the channels with the highest SNR. In our case, the algorithm instead allows for a more fair distribution of power among the different \acp{RIS} so that the spatial diversity, beneficial for localization, is preserved. In the numerical results, a typical millimeter-wave indoor scenario is investigated where a \ac{UE} can be tracked with high accuracy with a single \ac{BS} and few \acp{RIS}. Results confirm that focusing, which is the typical strategy for \ac{RIS} configuration in the near-field regime, is not the optimal strategy for tracking and that the \ac{RIS} and precoder optimization process is different from that studied in the literature for communication that might result to be suboptimal when dealing with \ac{UE} tracking. \paragraph{Notation} Scalar variables, vectors, and matrices are represented with lower letters, lower bold letters, and capital bold letters, respectively (e.g., $x$, $\mathbf{x}$, and $\mathbf{X}$). The symbols $\left( \cdot \right)^T$, $\left( \cdot \right)^H$, and $\left( \cdot \right)^{-1}$ represent the transpose, conjugate transpose, and inverse operators of their arguments, respectively. We use $\mathsf{t}$ for discrete temporal indexing, $i$, $r$ for \ac{BS} and \ac{UE} antenna indexing, $k$ is the index for indicating a generic \ac{RIS} and $p$ refers to a single radiating element of a \ac{RIS}. The notation $\mathbf{x}_{a \lvert b}$ indicates the value of a vector $\mathbf{x}$ at time instant $a$ estimated by considering the measurements collected up to time instant $b$. For example, $\mathbf{x}_{\mathsf{t} \lvert \mathsf{t-1}}$ is the value of $\mathbf{x}$ predicted at time instant $\mathsf{t-1}$ for the next time instant $\mathsf{t}$, whereas, once a new measurement becomes available at $\mathsf{t}$, this value is updated to $\mathbf{x}_{\mathsf{t} \lvert \mathsf{t}}$. The symbol $\Theta = \left(\theta,\phi\right)$ is intended to include both the elevation and azimuth directions. \section{Problem Formulation and System Geometry} \label{sec:problem} \subsection{Localization Scenario and Geometry} We consider a localization and communication scenario in which a single \ac{UE} in position $\mathbf{p}_{\text{RX}} \in \mathbb{R}^3$ moves in the environment and localizes itself by processing the received signals sent by a single \ac{BS} in $\mathbf{p}_{\text{TX}} \in \mathbb{R}^3$ and reflected by multiple \acp{RIS}. Either the \ac{UE} and the \ac{BS} are equipped with multiple antennas. We denote by $\mathbf{p}_{\text{RX},\rx} \in \mathbb{R}^3$ and $\mathbf{p}_{\text{TX},\tx} \in \mathbb{R}^3$, respectively, the positions of the $r$th antenna on the \ac{UE} side, with $r \in \mathcal{R} \triangleq \left\{0, 1, \ldots, {N}_{\text{RX}}-1\right\}$, and the $i$th antenna on the \ac{BS} side, with $i \in \mathcal{T} \triangleq \left\{0, 1, \ldots, {N}_{\text{TX}}-1\right\}$. In the following, for simplicity, we denote $\mathbf{p}_{\text{RX},0}=\mathbf{p}_{\text{RX}}$ and $\mathbf{p}_{\text{TX},0}=\mathbf{p}_{\text{TX}}$. The considered scenario is also characterized by $K$ large \acp{RIS}, each of them comprising $P$ unit cells. Consequently each \ac{RIS}'s cell position is indicated as $\mathbf{p}_{\risk,\riselem} \in \mathbb{R}^3$, $k \in \mathcal{K} \triangleq \left\{1, 2, \ldots, K \right\}$ and $p \in \mathcal{P} \triangleq \left\{0, 1, \ldots, P-1 \right\}$. \begin{figure}[t!] \centering \psfrag{b}[lc][lc][0.5]{$\beta$} \psfrag{g}[lc][lc][0.5]{$\gamma$} \psfrag{a}[lc][lc][0.5]{$\alpha$} \psfrag{B}[lc][lc][0.5]{BS} \psfrag{gg}[lc][lc][0.9]{} \psfrag{c}[rc][rc][0.9]{} \psfrag{cc}[rc][rc][0.9]{} \psfrag{h}[lc][lc][0.9]{} \psfrag{hh}[lc][lc][0.9]{} \psfrag{i}[rc][rc][0.9]{} \psfrag{n}[lc][lc][0.9]{} \psfrag{nn}[lc][lc][0.9]{} \psfrag{d}[c][c][0.9]{$\mathsf{t}$} \psfrag{e}[c][c][0.9]{$\mathsf{t+1}$} \psfrag{f}[c][c][0.9]{$\mathsf{\mathsf{t}+2}$} \psfrag{GG}[c][c][0.5]{\textit{Array Geometry}} \psfrag{RIS}[lc][lc][0.5]{$k$th {RIS}} \psfrag{MS}[lc][lc][0.5]{{UE}} \psfrag{x1}[rc][rc][0.5]{$X$} \psfrag{y1}[rc][rc][0.5]{$Y$} \psfrag{z1}[rc][rc][0.5]{$Z$} \psfrag{x}[rc][rc][0.5]{$X$} \psfrag{y}[rc][rc][0.5]{$Y$} \psfrag{z}[rc][rc][0.5]{$Z$} \psfrag{bo}[rc][rc][0.5]{$\mathbf{p}_{\text{TX},0}$} \psfrag{pb}[lc][lc][0.5]{$\mathbf{p}_{\tx}$} \psfrag{m}[lc][lc][0.5]{$\mathbf{p}_{\rx}$} \psfrag{mo}[lc][lc][0.5]{$\mathbf{p}_{\text{RX},0}=\mathbf{p}$} \psfrag{lo}[rc][rc][0.5]{$\mathbf{p}_{k,0}$} \psfrag{lk}[c][c][0.5]{$\mathbf{p}_{k,p}$} \psfrag{dBL}[lc][lc][0.5]{$d_{\risk, \text{TX}}$} \psfrag{dBM}[lc][lc][0.5]{$d_{\text{RX}, \text{TX}}$} \psfrag{dLM}[lc][lc][0.5]{$d_{\text{RX}, \risk}$} \psfrag{dlb}[rc][rc][0.5]{\textcolor{blue}{$d_{k;p, i}$}} \psfrag{dbm}[rc][rc][0.5]{\textcolor{blue}{$d_{r, i}$}} \psfrag{dlm}[rc][rc][0.5]{\textcolor{blue}{$d_{k;r, p}$}} \psfrag{tb}[c][c][0.5]{$\theta_{\text{S},s}$} \psfrag{p}[c][c][0.5]{$\phi_{\text{S},s}$} \psfrag{do}[c][c][0.5]{$\mathbf{p}_{\text{S},0}$} \psfrag{d}[c][c][0.5]{$\mathbf{p}_{\text{S},s}$} \psfrag{db}[c][c][0.5]{$\mathsf{d}_{\text{S},s}$} \includegraphics[width=\columnwidth,draft=false] {Figura1.eps} \caption{Joint user tracking and communication scenario. } \label{fig:scenario} \end{figure} Let define the direction vector as \begin{align} \mathbf{a}\left(\theta, \phi\right)& =\left[ \sin(\theta) \,\cos(\phi),\, \sin(\theta) \,\sin(\phi),\, \cos(\theta) \right]^T, \end{align} where $\theta$ and $\phi$ are the elevation (measured from the $z$-axis to the $(x,y)-$plane) and azimuth (measured from the $x$-axis) angles. Then, considering the \ac{BS} as the center of the coordinate system, for each $\text{S} \in \left\{\text{TX}, \text{RX}, k \right\}$ and for each corresponding antenna index $s \in \left\{i, r, p \right\}$, we can indicate the antenna coordinates of each array as \begin{align}\label{eq:antennacoord} &\mathbf{p}_{\text{S},s} = [x_{\text{S},s},\, y_{\text{S},s},\, z_{\text{S},s} ]^T= {\mathbf{p}_{\text{TX}}} + \mathsf{d}_{\text{S},s} \, \mathbf{a}\left(\theta_{\text{S},s}, \phi_{\text{S},s}\right), \end{align} where $\mathsf{d}_{\text{S},s}~=~\lVert \mathbf{p}_{\text{S},s} -\mathbf{p}_{\text{TX}} \rVert_2$ is the distance from the \ac{BS}, and $\phi_{\text{S},s}~=~\operatorname{atan}\left((y_{\text{S},s} -{y_{\text{TX}}})/(x_{\text{S},s} -{x_{\text{TX}}}) \right)$,\footnote{The operator $\operatorname{atan}$ corresponds to the four-quadrant inverse tangent.} and $\theta_{\text{S},s}~=~\operatorname{acos}\left((z_{\text{S},s} -{z_{\text{TX}}})/ \mathsf{d}_{\text{S},s} \right)$ are the azimuth and elevation angles.\footnote{{In the next, the subscripts RX and TX are omitted and $\left\{\mathbf{p}_{\rx}, \mathsf{d}_{r}, \theta_{\rx}, \phi_{r}\right\}$ and $\left\{\mathbf{p}_{\tx}, \mathsf{d}_{i}, \theta_{\tx}, \phi_{\tx}\right\}$ are used instead.}} Starting from \eqref{eq:antennacoord}, the distance between the $i$th antenna of the \ac{BS} and the $p$th element of the $k$th \ac{RIS} is given by\footnote{In the sequel, we indicate $d_{\text{RX}, \text{TX}} \triangleq \left \| \mathbf{p}_{\text{RX}} - \mathbf{p}_{\text{TX}} \right \| $, $d_{\rx,\tx} \triangleq \left \| \mathbf{p}_{\text{RX},\rx} - \mathbf{p}_{\text{TX},\tx} \right \| $, $d_{\risk, \text{TX}} \triangleq \left \| \mathbf{p}_{k} - \mathbf{p}_{\text{TX}} \right \| $, and $d_{\text{RX}, \risk} \triangleq \left \| \mathbf{p}_{\text{RX}} - \mathbf{p}_{k} \right \| $.} \begin{align} \label{eq:inter_d} &d_{\risk; \riselem, \tx}= \lVert \mathbf{p}_{\tx} - \mathbf{p}_{\risk,\riselem} \rVert_2 = \{\mathsf{d}_{i}^2 + \mathsf{d}_{\risk, \riselem}^2-2\, \mathsf{d}_{i}\, \mathsf{d}_{\risk, \riselem}\, \left[ \sin(\theta_{\tx})\,\right. \nonumber \\ & \left. \qquad \times \sin(\theta_{\risk, \riselem})\,\cos(\phi_{\tx}- \phi_{ \risk, \riselem}) + \cos(\theta_{\tx})\, \cos(\theta_{\risk, \riselem}) \right] \}^{1/2} \end{align} where $\left\{\mathsf{d}_{i}, \theta_{\tx}, \phi_{\tx}\right\}$ are the spherical coordinates of the generic $i$th transmitting antenna as defined above. Analogously, we indicate the angle between the $i$th antenna of the \ac{BS} and the $p$th element of the $k$th \ac{RIS} as \cite{abrardo2021intelligent} $\Theta_{\risk; \riselem, \tx}=\left (\theta_{\risk; \riselem, \tx},\phi_{\risk; \riselem, \tx} \right )$. $d_{\risk; \rx, \riselem}$ and $\Theta_{\risk; \rx, \riselem}$ are computed in a similar manner for every $k$th \ac{RIS}-\ac{UE} antenna couple. In the next, we consider that the \ac{BS} and \ac{RIS} antenna coordinates and array orientation are known. By contrast, the position of the \ac{UE} is unknown, whereas its orientation is considered known (e.g., estimated by onboard sensors as compass and gyroscopes). An example of the used localization and communication scenario and its geometry is reported in Fig.~\ref{fig:scenario}. From \cite{abrardo2021intelligent, dardari2021nlos} the local reflection coefficient of a unit cell of \ac{RIS} can be written as ${r}_{k; r, p, i} = G_\mathrm{c} e^{j \Psi_{k,p}} \sqrt{F\left( \Theta_{k; p, i} \right) F\left(\Theta_{\risk; \rx, \riselem} \right)},$ where $G_c$ is the gain of the unit-cell and $e^{j \Psi_{k,p}}$ is the unit-norm load reflection coefficient. $F ( {\Theta} )$ denotes the normalized power radiation pattern of each unit cell, that is frequency-independent within the bandwidth of interest and modeled as an exponential-Lambertian radiation pattern with parameter $q$ as \begin{align} F\left( {\Theta} \right) = \left\{ \begin{array}{ll} \cos^q \left( \theta \right), & \theta \in \left[0, \pi/2 \right], \phi \in \left[0, 2\pi \right] \\ 0, & \text{otherwise} \end{array} \right. \label{eqnprp} \end{align} \subsection{Pilot Signal Model} In the following, we describe the proposed pilot-based method for localization and derive the corresponding signal models. The proposed method aims at isolating the contribution of the different \acp{RIS} at the \ac{UE} receiver and eliminating the contribution of the direct BS-\ac{UE} channel since in many cases it is a \ac{NLOS} contribution that does not contain useful information for localization. The \ac{BS} pilot signal is \begin{equation} \mathbf{X}= \mathbf{F}\, \mathbf{Q} \in \mathbb{C}^{{{N}_{\text{TX}}} \times L}, \label{eq:pilot} \end{equation} where $\mathbf{Q}=[\mathbf{q}_1, \ldots, \mathbf{q}_K ]^H \in \mathbb{C}^{K \times L}$ contains $K$ sequences of unitary envelope orthogonal pilot signals, i.e. $|{q}_{k,l}|~=~1$, $\mathbf{q}_k^H \mathbf{q}_m=L\,\delta_{k,m}$, with $\mathbf{q}_k \in \mathbb{C}^{L \times 1}$, $L \ge K$ being the length of the pilot sequence.\footnote{More precisely, $L = K$ is the minimum pilot length to obtain orthogonality, although a higher $L$ can also be considered to reduce the overall noise of the received signal at the expense of communication overhead.} The precoding matrix is indicated as $ \mathbf{F}=[\mathbf{f}_1, \ldots, \mathbf{f}_K ] \in \mathbb{C}^{{N}_{\text{TX}} \times K}$ and each columns $\mathbf{f}_{\risk}=\left\{ f_{\tx,\risk} \right\} \in \mathbb{C}^{{N}_{\text{TX}} \times 1}, \, k \in \mathcal{K},$ is the precoding vector for the $k$th \ac{RIS}. The overall received signal at the \ac{UE}, $\mathbf{Y}\in \mathbb{C}^{{N}_{\text{RX}} \times L}$, is \cite{abrardo2021intelligent, elzanaty2021reconfigurable} \begin{align} \mathbf{Y}&= \mathbf{H} \mathbf{X} + \sum_{k=1}^{K} \mathbf{B}_k \RISPARAM_{\risk} \mathbf{G}_k \mathbf{X} +\mathbf{N}\triangleq \mathbf{H} \mathbf{X} + \sum_{k=1}^{K} \mathbf{Z}_{k}+\mathbf{N}, \end{align} where $\mathbf{H}= \left\{ h_{\rx,\tx}\right\}\in \mathbb{C}^{{N}_{\text{RX}} \times {N}_{\text{TX}}}$ is the direct \ac{BS}-\ac{UE} channel matrix, $\mathbf{B}_k=\left\{ b_{\risk;\rx, \riselem} \right\} \in \mathbb{C}^{{N}_{\text{RX}} \times P}$ is the channel matrix between the $k$th \ac{RIS} and the \ac{UE}, $\mathbf{G}_k=\left\{g_{\risk;\riselem, \tx } \right\} \in \mathbb{C}^{P \times {N}_{\text{TX}}}$ is the channel matrix between the \ac{BS} and the $k$th RIS, $\RISPARAM_{\risk}=\operatorname{diag}\left(c_{k ;1}, \ldots, c_{\risk;\riselem}, \ldots, c_{k ;P}\right) = \operatorname{diag} \left(\risparam_{\risk}\right) \in \mathbb{C}^{P \times P}$ contains the \ac{RIS}s responses, and $\mathbf{N} \in \mathbb{C}^{{N}_{\text{RX}} \times L}$ represents the additive white Gaussian noise sequences with variance $\sigma^2$. For the communication system it is assumed ${N}_{\text{TX}} \ge {N}_{\text{RX}}$. The generic \ac{RIS} coefficient $\left\{c_{\risk;\riselem}\right\} \, , p \in \mathcal{P}, \, k \in \mathcal{K}$, denotes the normalized reflection coefficient of the \textit{p}th element of the \textit{k}th \ac{RIS}, i.e., $c_{\risk;\riselem}=e^{\jmath\, \Psi_{ k, p}}$. Hence, the channel components are modeled as \begin{align}\label{eq:directch} &h_{\rx,\tx} = \sqrt{\frac{\kappa_{h}}{\kappa_{h}+1}} \gamma_{\rx,\tx} \,e^{ \left( - \jmath \frac{2\pi}{\lambda} d_{\rx,\tx} \right )} + \sqrt{\frac{1}{\kappa_{h}+1}} \beta_{\rx,\tx}, \\ &g_{\risk;\riselem, \tx } = \rho_{\risk;\riselem,\tx} \,e^{ \left( - \jmath \frac{2\pi}{\lambda}\, d_{\risk; \riselem, \tx} \right )}, \\ & b_{\risk;\rx, \riselem} = \sqrt{\frac{\kappa_b}{\kappa_b+1}} \rho_{\risk;\rx,\riselem}\,e^{ \left( - \jmath \frac{2\pi}{\lambda}\, d_{\risk; \rx, \riselem} \right )} + \sqrt{\frac{1}{\kappa_b+1}} \alpha_{\risk;\rx,\riselem}, \label{eq:cascadedch2} \end{align} where $\gamma_{\rx,\tx} \triangleq \frac{\lambda}{4\pi} \, \frac{\sqrt{G_{\tx} G_{\rx}}\, }{d_{\text{RX}, \text{TX}} }$, $\rho_{\risk;\riselem,\tx} \triangleq \frac{\lambda}{4\pi} \, \frac{\sqrt{G_{\tx}\,G_c\, F(\Theta_{\risk; \riselem, \tx})} }{d_{\risk, \text{TX}} }$, $\rho_{\risk;\rx,\riselem} \triangleq \left(\frac{\lambda }{4\pi} \, \frac{\sqrt{G_{\rx}\, G_c\, F\left( \Theta_{\risk; \rx, \riselem} \right)}\, }{d_{\text{RX}, \risk} }\right)$ are the channel amplitude of the \ac{LOS} components, {${\kappa_{h} \ge 0}$} and ${\kappa_b \ge 0}$ are the Ricean factors {for the direct BS-\ac{UE} and \ac{RIS}-\ac{UE} links, respectively}, $\alpha_{\risk;\rx,\riselem} \sim \mathcal{CN}(0,\rho_{\risk;\rx,\riselem}^2)$ {and $\beta_{\rx,\tx} \sim \mathcal{CN}(0,\gamma_{\rx,\tx}^2)$} denote the random complex fading coefficients of the \ac{NLOS} component \cite{cunhua2022overview}. $\rho_{\risk;\rx,\riselem}$, $\rho_{\risk;\riselem,\tx}$, and $\gamma_{\rx,\tx}$ represent the compact notation of the amplitude channel coefficients (except for the Ricen factor terms), $\lambda$ is the wavelength, $G_{\tx}$ is the gain of a single antenna element from BS, $G_{\rx}$ is the gain of a single antenna element from UE, and $G_c$ is the gain of a \ac{RIS} unit cell. {In accordance to \cite{hou2020reconfigurable}, we assume a \ac{LOS} channel between the \ac{BS} and the \ac{RIS} which is a realistic condition of most practical scenarios.} The received signal is then projected over each pilot sequence $\mathbf{q}_k$ to get the contribution of the $k$th \ac{RIS}, as \begin{align} \mathbf{y}_k&= \frac{1}{L} \mathbf{Y}\mathbf{q}_k= \sum_{l=1}^{K} \mathbf{B}_l \mathbf{\MakeUppercase{\risparamel}}_l \mathbf{G}_l \mathbf{f}_k + \mathbf{H} \mathbf{f}_k + \frac{1}{L} \mathbf{N} \mathbf{q}_k \nonumber \\ &= \mathbf{z}_{k} +\mathbf{n}_k \in \mathbb{C}^{{N}_{\text{RX}} \times 1}, \label{eq:y_o} \end{align} where $ \mathbf{z}_{k} \triangleq \mathbf{B}_k \RISPARAM_{\risk} \mathbf{G}_k \mathbf{f}_k $ represents the useful part of the received signal with respect to the \textit{k}th \ac{RIS}, $\mathbf{n}_k = \sum_{l=1, l\not = k}^{K}\mathbf{z}_{l}+\mathbf{H} \mathbf{f}_k + \mathbf{n}'_k$ is the noise plus interference terms, and $\mathbf{n}'_k \triangleq \frac{1}{L} \mathbf{N} \mathbf{q}_k$ is the AWGN noise term after correlation with the pilot sequence where each element has a power of $\sigma^2/L$, with $L$ being the pilot sequence length. \subsection{Block Diagonalization Precoding}\label{BDP} The goal of the proposed precoding strategy is to maximize the received energy while eliminating interference to the $k$th received signal in \eqref{eq:y_o} due to the presence of the direct BS-\ac{UE} channel and the other \acp{RIS}. \footnote{This goal can be achieved by placing the \ac{RIS} at a certain height above the ground and at a sufficient distance from each other so that they actually receive energy only from the intended beam. Optimal \acp{RIS} placement is beyond the scope of this work and has already been studied in \cite{ghatak2021placement, wymeersch2020radio} for localization-based applications. In our settings, \ac{RIS} placement for simulations is chosen to ensure model assumptions.} In this case, $\sum_{l=1, l\not = k}^{K}\mathbf{z}_{l} \simeq 0$ and $\mathbf{H} \mathbf{f}_k \simeq 0$. More precisely, assuming a large number of antennas on the BS, this condition can be exactly satisfied by using \ac{BD} beamforming. This procedure, commonly used to suppress interference between different \acp{UE} \cite{Saggese2019}, aims to orthogonalize the available channels by projecting the transmitted signal for the \textit{k}th \ac{RIS} into the null space of its interference. To elaborate, we introduce the \textit{k}th \ac{RIS} interference channel matrix $\tilde{\textbf{G}}_k \in \mathbb{C}^{\tilde{\alpha} \times {N}_{\text{TX}}}$ as \begin{equation} \tilde{\textbf{G}}_k=\left[\textbf{G}_1^T,\, \ldots, \, \textbf{G}_{l-1}^T,\, \textbf{G}_{l+1}^T, \, \ldots, \textbf{G}_K^T, \, \textbf{H}^T \right]^T , \end{equation} with $\tilde{\alpha}={N}_{\text{RX}}+(K-1)P$. Applying the \ac{SVD} it is possible to rewrite the matrix as \begin{equation} \tilde{\textbf{G}}_k= \tilde{\textbf{U}}_k\tilde{\boldsymbol{\Lambda}}_k\tilde{\textbf{V}}_k^H. \end{equation} {Denoting by} $\tilde{p} \triangleq \operatorname{rank}(\tilde{\boldsymbol{\Lambda}}_k)$, {we can write} $\tilde{\textbf{V}}_k= [ \tilde{\textbf{V}}_k^{(1)},\, \tilde{\textbf{V}}_k^{(0)}]$, {where $\tilde{\textbf{V}}_k^{(1)} \in \mathbb{C}^{{N}_{\text{TX}} \times \tilde{p}}$ and $\tilde{\textbf{V}}_k^{(0)} \in \mathbb{C}^{{N}_{\text{TX}} \times {N}_{\text{TX}}-\tilde{p}}$ spans the null space of $\tilde{\textbf{G}}_k$.} Specifically, the precoding vector $\mathbf{f}_k$ is designed as $\mathbf{f}_k = \tilde{\textbf{V}}_k^{(0)}\bar{\mathbf{f}_k}$ such that $\mathbf{G}_l \mathbf{f}_k = \mathbf{0}$, for $l \ne k$ and $\mathbf{H} \mathbf{f}_k = \mathbf{0}$, i.e., the inter-\ac{RIS} and direct link interferences are completely removed in \eqref{eq:y_o}. As for $\bar{\mathbf{f}}_k$, it represents the precoding vector of an equivalent MIMO channel with ${N}_{\text{TX}}-\tilde{p}$ antennas, transmitting over the equivalent channel $\bar{\textbf{G}}_k=\textbf{G}_k \tilde{\textbf{V}}_k^{(0)} \in \mathbb{C}^{P \times ({N}_{\text{TX}}-\tilde{p})}$, and can be designed by classical beamforming techniques. To elaborate, we denote by $\bar{\mathbf{v}}^{(0)}_k$ the first right singular vector of the SVD decomposition of $\bar{\textbf{G}}_k$, which corresponds to its optimal beamforming vector. The normalized beamforming vector ${\mathbf{v}}^{(0)}_k$ for ${\textbf{G}}_k$ can be expressed as follows \begin{align}\label{eq:norm_bm} {\mathbf{v}}^{(0)}_k = \tilde{\textbf{V}}_k^{(0)} \bar{\mathbf{v}}^{(0)}_k / \lVert{\tilde{\textbf{V}}_k^{(0)} \bar{\mathbf{v}}^{(0)}_k}\rVert. \end{align} Thus, if we denote by $\beta_k^2$ the power budget allocated at the \ac{BS} for the $k$th RIS, we have ${\mathbf{f}}_k ={\beta_k}{\mathbf{v}}^{(0)}_k$. It is worth noting that the \ac{BD} method reduces the number of equivalent antennas at the \ac{BS} available for each \ac{RIS} thus, limiting the beamforming gain. However, if the \acp{RIS} are at a certain height and sufficiently spaced, this effect may be negligible. Due to the elimination of the interference, the following expression for the received signal from the $k$th \ac{RIS} results \begin{align}\label{eq:rx_signal} y_{k; r} &= \sqrt{\frac{\kappa_b}{\kappa_b+1}} \sum_{i=0}^{{N}_{\text{TX}}-1} f_{\tx,\risk}\, \sum_{p=0}^{P-1} \rho_{\risk;\riselem,\tx} \, \rho_{\risk;\rx,\riselem} \, c_{\risk;\riselem} \, e^{- \jmath \frac{2\pi}{\lambda}\, d_{\risk; \rx, \riselem, \tx}} \nonumber \\ &+ n_{k; r} = a_{k; r}+n_{k; r}, \end{align} with $d_{\risk; \rx, \riselem, \tx} \triangleq d_{\risk; \riselem, \tx} + d_{\risk; \rx, \riselem}$. The noise $n_{k; r}$ includes the AWGN noise and the multipath components after correlation with the pilot signal and can be expressed as $n_{k; r} \sim \mathcal{CN}\left(0,{\sigma_{k; r}^2} \right) = \mathcal{CN}\left(0,\frac{\sigma^2}{L}+ \frac{1}{\kappa_b+1} \sum_{p=0}^{P-1} \rho_{\risk;\rx,\riselem}^2 \right)$. Since in most practical situations the dimension of the \ac{UE} antenna system is small compared to the distance to the RIS, we can assume that the same power is received at the different \ac{UE} antennas, i.e., $\rho_{\risk;\rx,\riselem} = \rho_{k ; p},\, \forall r \in \mathcal{R}$. Accordingly, we have the same noise variance at the different antennas, i.e., $n_{k; r} \sim \mathcal{CN}\left(0,{\sigma_{k}^2} \right)$. \section{Bayesian Localization: User Tracking} \label{sec:tracking} We now consider a single \ac{UE} tracking problem in \acp{SRE} where localization is aided by the presence of multiple \acp{RIS}. A common representation for tracking systems is a state-space model \cite{dardari2015indoor} consisting of a {\em transition model} that describes the evolution of the state over time, and an {\em observation model} that specifies how the measurements are related to the \ac{UE} state. In mathematical terms we have \begin{align} \label{eq:motionmodel} &\mathbf{s}_{\mathsf{t}} = f\left( \mathbf{s}_{\mathsf{t-1}}\right) + \mathbf{w}_{\mathsf{t}}, \\ & \mathbf{o}_{\mathsf{t}} = h\left(\mathbf{p}_{\tempo} \right) + \boldsymbol{\eta}_{\mathsf{t}}, \label{eq:observationmodel} \end{align} where $\mathbf{s}_{\mathsf{t}} \triangleq \left[\mathbf{p}_{\tempo}, \, \dot{\mathbf{p}}_{\mathsf{t}} \right] \in \mathbb{R}^{\Ns}$ is the state vector at time instant $\mathsf{t}$ and contains the position ($\mathbf{p}_{\text{RX}}$) and velocity ($\dot{\mathbf{p}}_{\text{RX}}$) of the \ac{UE} at time $\mathsf{t}$, and $\Ns$ is the dimension of the state vector. The transition function is indicated as $f\left( \mathbf{s}_{\mathsf{t-1}}\right)$ (in the following, a linear function is assumed as $f\left( \mathbf{s}_{\mathsf{t-1}}\right)=\mathbf{T}_{\mathsf{t}}\, \mathbf{s}_{\mathsf{t-1}}$), and $\mathbf{o}_{\mathsf{t}}$ is the observation model with $h\left(\mathbf{p}_{\tempo}\right)$ as the observation function. $\mathbf{w}_{\mathsf{t}}$ and $\boldsymbol{\eta}_{\mathsf{t}}$ are stochastic Gaussian noise processes. \paragraph{Transition Model} For the transition model, we consider a second-order kinematic model \cite{bar2004estimation} \begin{align}\label{eq:tmodel} &\mathbf{T}=\left[\begin{array}{cc} \mathbf{I}_3 & d\mathsf{t}\, \mathbf{I}_3 \\ \mathbf{0}_3 & \mathbf{I}_3 \end{array} \right], \\ &\mathbf{w}_{\mathsf{t}}\sim \mathcal{N} \left(\mathbf{w}_{\mathsf{t}}; \mathbf{0}, \mathbf{P} \right), && \mathbf{P}=\left[\begin{array}{cc} \frac{d\mathsf{t}^3}{3} \, \mathbf{P}_{\mathsf{a}}& \frac{d\mathsf{t}^2}{2} \, \mathbf{P}_{\mathsf{a}}\\ \frac{d\mathsf{t}^2}{2} \, \mathbf{P}_{\mathsf{a}} & d\mathsf{t} \, \mathbf{P}_{\mathsf{a}} \end{array} \right], \end{align} where $d\mathsf{t}$ is the delay between two adjacent time instants $\mathsf{t}$ and $\mathsf{t+1}$, and $\mathbf{P}_{\mathsf{a}} = \operatorname{diag}\left(\sigma^2_{\mathsf{a},\mathsf{x}}, \sigma^2_{\mathsf{a},\mathsf{y}} ,\sigma^2_{\mathsf{a},\mathsf{z}} \right)$ \cite{guerra2021near}. \paragraph{Observation Model} In MIMO systems, different signal parameters are considered to retrieve the location information \cite{elzanaty2021reconfigurable, dardari2015indoor}. In the presence of wideband signals, \ac{TOA} and \ac{AOA} can be used together \cite{guerra2018single}, while with narrowband signals and multiple antennas, \acp{AOA} can be considered alone to allow positioning \cite{bjornson2022reconfigurable}. Such approaches are referred to as two-step techniques because they first derive the geometric parameters contained in the model of the received signal and, then, estimate the position based on these signal parameters. Two-step approaches are generally suboptimal compared to direct methods that start from the received signal and avoid intermediate processing steps \cite{dardari2021nlos}. In addition, modeling the measurement noise in the two-step approach could be a difficult task, due to the nonlinear operations, which is avoided when starting directly from the received signals whose statistics are known \cite{wymeersch2022radio, chen2022tutorial}. In our narrowband method, we opt for a direct approach, where the range and angle information is implicitly accounted for by processing the received signals. Consequently, in order to define the observation vector, let denote the normalized received signals under the assumption of high \ac{SNR} as \begin{align} &{\bar{y}_{\risk; \rx}} =\frac{{y}_{k; r}}{|{y}_{k; r}|} \approx \frac{{a}_{\risk; \rx}+{n}_{\risk; \rx}}{\lvert a_{k} \rvert} = {\bar{a}_{\risk; \rx}}+ {\bar{n}_{\risk; \rx}}, \label{eq:rx_signal_norm} \end{align} where in \eqref{eq:rx_signal_norm} we have exploited the assumption of equal power at the different \ac{UE} antennas, leading to $\lvert {a}_{\risk; \rx}\rvert = \lvert a_{k}\rvert$, and we have introduced the normalized useful term ${\bar{a}_{\risk; \rx}}= \frac{{a}_{\risk; \rx}}{\lvert a_{k} \rvert}$. For the noise term we have ${\bar{n}_{\risk; \rx}} \sim \mathcal{CN}\left(0,{\bar{\sigma}_{k}^2} \right)$ with \begin{equation}\label{eq:noisem} \bar{\sigma}_{k}^2 \simeq \frac{\sigma_{k}^2}{\left|a_{k}\right|^2}. \end{equation} Starting from the normalized received signals in \eqref{eq:rx_signal_norm}, we consider the correlation between measurements at adjacent antennas as observations. In particular, for $Z = \lfloor {N}_{\text{RX}}/2 \rfloor$, the observation vector is given by \begin{align}\label{eq:obsRX_2} \mathbf{o}_{\mathsf{t}} \triangleq&\left[\Re\left\{\boldsymbol{\rho}_{1} \right\}, \ldots, \Re\left\{\boldsymbol{\rho}_k\right\}, \ldots, \Re\left\{\boldsymbol{\rho}_{K} \right\}, \nonumber \right.\\ &\left. \Im\left\{\boldsymbol{\rho}_{1} \right\}, \ldots, \Im\left\{\boldsymbol{\rho}_k\right\}, \ldots, \Im\left\{\boldsymbol{\rho}_{K} \right\} \right] \in \mathbb{R}^{2K\, Z}, \end{align} where the generic term $\boldsymbol{\rho}_k=\left\{\rho_{\risk; \rr} \right\}$, $\tilde{r} \in \mathcal{Z} \triangleq \left\{0,1, \ldots, Z-1\right\}$, is a phase gradient given by \begin{equation}\label{gradient} \rho_{\risk; \rr}= \left({\bar{y}_{\risk; 2\rr+1}}\right) \, \left({\bar{y}_{\risk; 2\rr}}\right)^*. \end{equation} When operating within the radiating near-field domain, \eqref{gradient} contains both range and bearing information (as it can also be seen from the system geometry of \eqref{eq:inter_d}), while in the far-field it contains only \ac{AOA} information \cite{guerra2021near}. Moreover, by directly processing the received signals, it is possible to fit the Gaussian model for the observation noise underlying the implementation of \ac{KF}, differently to what happens when considering the statistics of a specific estimator for \acp{AOA}. Other advantages of considering the gradient in \eqref{gradient} are the possibility of avoiding strong non-linearities arising from fast variations of the observed signals along the antenna array which could undermine the functioning of the tracking algorithm considered in this paper. More precisely, \eqref{gradient} is used to achieve a double effect. On the one hand, normalizing the received signal (i.e., using ${\bar{y}_{\risk; 2\rr}}$ instead of ${y}_{\risk; 2\rr}$) allows the observations to be independent of the received powers, which contain information about the distance but can vary rapidly due to the ability of \acp{RIS} to form very narrow beams. Moreover, \ac{RSS} measurements lead to less accurate positioning with respect to \ac{TOA} or \ac{AOA} measurements \cite{elzanaty2021reconfigurable}. On the other hand, conjugate multiplication (i.e. $ {\bar{y}_{\risk; 2\rr+1}} \, {\bar{y}_{\risk; 2\rr}}^*$ instead of ${\bar{y}_{\risk; 2\rr+1}}$ alone) allows to get rid of the dependence on absolute phase, which is also rapidly variable. The observation function in \eqref{eq:observationmodel} is given by the expected mean of \eqref{eq:obsRX_2}, i.e., $h\left(\mathbf{p}_{\mathsf{t}} \right) \triangleq \mathbb{E}\left[\mathbf{o}_{\mathsf{t}} \right]$ whose generic elements can be easily computed as \begin{align}\label{eq:obs_fun_re_2} &h\left( \Re\left\{\rho_{\risk; \rr} \right\} \right)= \mathbb{E}\left\{\Re\left\{\rho_{\risk; \rr} \right\} \right\}= \Re\left\{ \bar{a}_{\risk; 2\rr+1}\, {\bar{a}_{\risk; 2\rr}}^* \right\} \\ &h\left( \Im\left\{\rho_{\risk; \rr} \right\} \right)=\mathbb{E}\left\{\Im\left\{\rho_{\risk; \rr} \right\} \right\}= \Im\left\{ \bar{a}_{\risk; 2\rr+1} \, {\bar{a}_{\risk; 2\rr}}^* \right\}. \label{eq:obs_fun_im} \end{align} The measurement noise $\boldsymbol{\eta}_{\mathsf{t}}$ of \eqref{eq:observationmodel} is considered as zero-mean Gaussian distributed noise with a diagonal covariance matrix $\mathbf{R}_{\mathsf{t}}$. Now consider $\left \{ \mathbf{R}_{\mathsf{t}} \right \}_{n,n}$, the $n$th element of the main diagonal of $\mathbf{R}_{\mathsf{t}}$, and denote by $\mathcal{I}_k = \left\{(k-1)Z+\tilde{r}+(m-1)KZ{+1}\right\}$, for $\tilde{r} \in \mathcal{Z}$, $m = 1,2$ the set of indices of the observation vectors corresponding to the signal received from the $k$th RIS. Thus, considering a general $n \in \mathcal{I}_k$ and for each $\tilde{r} \in \mathcal{Z}$, we have \begin{align}\label{eq:var_ok_2} \left\{\mathbf{R}_{\mathsf{t}}\right\}_{n,n} &= \text{var}\left\{\Re\left\{\rho_{\risk; \rr} \right\} \right\}= \text{var}\left\{\Im\left\{\rho_{\risk; \rr} \right\} \right\} \nonumber \\ & \approx \text{var} \left \{ \Re \left (\bar{a}_{\risk; 2\rr+1}\right)\Re \left (\bar{n}_{\risk; 2\rr}\right) +\Im \left (\bar{a}_{\risk; 2\rr+1}\right)\Im \left (\bar{n}_{\risk; 2\rr}\right) \right. \nonumber \\ &\left.+ \Re \left ({\bar{a}_{\risk; 2\rr}}\right) \Re \left ({\bar{n}_{\risk; 2\rr+1}}\right)+ \Im \left ({\bar{a}_{\risk; 2\rr}}\right) \Im \left ({\bar{n}_{\risk; 2\rr+1}}\right) \right \} \nonumber \\ & = \frac{\bar{\sigma}_{k}^2}{2} \left[\lvert \bar{a}_{k}\rvert ^2\right] +\frac{\bar{\sigma}_{k}^2}{2} \left[\lvert \bar{a}_{k}\rvert ^2\right]=\bar{\sigma}_{k}^2 = \frac{\sigma_{k}^2}{| a_{k} |^2} \end{align} where, as before, we assume a large \ac{SNR} regime and independence between the received signals at adjacent antennas. In words, $\mathbf{R}_{\mathsf{t}}$ has a blockwise diagonal structure in which all elements corresponding to the signal received from the $k$th \ac{RIS} have the same value $\bar{\sigma}_{k}^2$. \paragraph{EKF Algorithm} Among the Bayesian estimators, we use the \ac{EKF}, which takes into account the signals in \eqref{eq:observationmodel}. The state is described by a Gaussian distribution $\mathbf{s}_{\mathsf{t}}\sim \mathcal{N}\left(\mathbf{s}_{\mathsf{t}}; \mathbf{m}_{\mathsf{t} \lvert \mathsf{t}}, \boldsymbol{\Sigma}_{\mathsf{t}\rvert \mathsf{t}} \right)$, where $\mathbf{m}_{\mathsf{t} \lvert \mathsf{t}} \, {\in \mathbb{R}^{\Ns}}$ and $\boldsymbol{\Sigma}_{\mathsf{t}\rvert \mathsf{t}} \, {\in \mathbb{R}^{\Ns^2}}$ are the posterior mean vector and the covariance matrix of the state. An important step of the \ac{EKF} is the evaluation of the Jacobian matrix associated with the linearization of the observation model $h \left(\mathbf{p}_{\tempo} \right)$, which can be written as $\mathbf{J}_{\mathsf{t}} \triangleq \nabla_{\mathbf{s}_{\mathsf{t}}}\, h \left(\mathbf{p}_{\tempo} \right)$, where $\nabla_{\mathbf{s}_{\mathsf{t}}}$ is the gradient with respect to the state vector. The Jacobian is evaluated at $\mathbf{s}_{\mathsf{t}}=\mathbf{m}_{\mathsf{t} \lvert \mathsf{t-1}}$, where $\mathbf{m}_{\mathsf{t} \lvert \mathsf{t-1}}$ is the predicted state (for $\mathsf{t}=1$ it is $\mathbf{m}_{\mathsf{t} \lvert \mathsf{t-1}}=\mathbf{m}_{0}$). The Jacobian computation is reported in the supplementary material as Appendix A, whereas the \ac{EKF} is reported in Appendix B. \subsubsection*{Noise covariance computation} Calculating $\mathbf{R}_{\mathsf{t}}$ in \eqref{eq:var_ok_2} to be plugged into the EKF is problematic because ${\sigma}_{k}^2$ depends on the multipath, which is difficult to predict, and $| a_{k} |^2$ depends on the user's location, which is the unknown term that must be estimated. To circumvent this difficulty, we consider an approximation for $\mathbf{R}_{\mathsf{t}}$ called $\tilde{\mathbf{R}}_{\mathsf{t}}$, where \begin{align}\label{eq:var_ok_3} &\left\{\tilde{\mathbf{R}}_{\mathsf{t}}\right\}_{n,n} = \frac{\sigma^2(1+\alpha)}{\lVert \mathbf{y}_{k} \rVert^2 / {N}_{\text{RX}}}, \end{align} for $n \in \mathcal{I}_{k}$. In \eqref{eq:var_ok_3} $\lVert \mathbf y_{k} \rVert^2 / {N}_{\text{RX}}$ is the average received power measured at the receiver, and $\alpha$ is an empirical parameter introduced to oversize the variance of the noise in the observation model with respect to the expected value in order to account for the noise increase due to multipath.\footnote{This is the typical approach followed in the literature to account for potential model mismatch in the observation that might be caused, for instance, by fading \cite{li2015resampling}.} \section{\ac{RIS} and Precoder Optimization for User Tracking: Problem Formulation} \label{sec:optimization} In this section, we will introduce a joint optimization problem for designing the transmission parameters, i.e., the precoding vectors and the \acp{RIS} reflection coefficients. At time $\mathsf{t}$ and for the $k$th \ac{RIS}, these parameters are grouped in a vector given by \begin{equation}\label{eq:optpara} \boldsymbol{\vartheta}_{\risk}^{(\mathsf{t})}=(\risparam_{\risk}^{(\mathsf{t})}, \beta^{(\mathsf{t})}_{k}), \end{equation} where $\risparam_{\risk}^{(\mathsf{t})}$ contains the $k$th \ac{RIS} reflection coefficients and $\beta_k^{(\mathsf{t})}$ are real-valued weights that determine the amount of power to be assigned to the $k$th \ac{RIS} -- under the constraint $\Sigma_{k = 1}^K [\beta_{k}^{(\mathsf{t})} ]^2 = P_{\text{tx}}$, with $P_{\text{tx}}$ denoting the power budget allocated for the transmission from the \ac{BS} to the $K$ \acp{RIS}. In fact, as illustrated in Sec. \ref{BDP}, the precoding vector can be found using a \ac{BD} approach so that the overall precoding optimization problem turns out to be a power allocation problem to different \acp{RIS}, i.e., $\mathbf{f}_{k}^{(\mathsf{t})} = \beta^{(\mathsf{t})}_{k}\, \mathbf{v}^{(0)}_{k}$. The optimization of parameters in \eqref{eq:optpara} is performed during the time update stage of the EKF, where we predict the state and covariance for the next time step $\mathsf{t+1}$ with the availability of measurements up to time $\mathsf{t}$. Such measurements and information consist of $\mathbf{J}_{\mathsf{t+1}}$, $\mathbf{m}_{\tempop \lvert \tempo} $, and $\boldsymbol{\Sigma}_{\mathsf{t+1} \lvert \mathsf{t}}$, among others (see Appendix B). \paragraph{Cost Function} The goal of the optimization is to minimize the \ac{MSE} on the \ac{UE} state estimation by considering its expectation over its uncertainty region. Denoting the state estimate at time $\mathsf{t+1}$ as \begin{equation} \hsskp= \mathbf{m}_{\tempop \lvert \tempop} = \mathbf{m}_{\tempop \lvert \tempo} + \mathbf{K}_{\tempop} \, \mathbf{v}_{\tempop}, \nonumber \end{equation} with $\boldsymbol{\vartheta}^{(\mathsf{t+1})} = \left\{\boldsymbol{\vartheta}_1^{(\mathsf{t+1})},\ldots,\boldsymbol{\vartheta}_K^{(\mathsf{t+1})}\right\}$, the \ac{MSE} of the estimator can be written as \begin{align} \label{eq:costfunctionw0} &\mathcal{E} = \text{Tr} \left( \mathbb{E} \left\{ \left( \mathbf{s}_{\tempop} - \hsskp\right) \left(\mathbf{s}_{\tempop} - \hsskp\right)^T\right\} \right) \nonumber \\ &= \text{Tr} \left(\mathbb{E} \left\{\left(\Delta\mathbf{s}_{\tempop}- \mathbf{K}_{\tempop} \mathbf{v}_{\tempop}\right) \left(\Delta\mathbf{s}_{\tempop}- \mathbf{K}_{\tempop}\mathbf{v}_{\tempop} \right)^T\right\}\right), \end{align} where $\text{Tr}\left(\cdot\right)$ is the trace operator, $\mathbb{E}=\mathbb{E}_{ \boldsymbol{\eta}_{\tempop} \lvert \mathbf{s}_{\tempop} } \{ \cdot \}$ is the expectation evaluated with respect to the observation noise conditioned on the actual position of the user and $\Delta \mathbf{s}_{\mathsf{t+1}}=\left(\mathbf{s}_{\tempop} - \mathbf{m}_{\tempop \lvert \tempo} \right)$. By considering \begin{align} & \mathbb{E}\left\{\mathbf{v}_{\tempop}\innkp^T\right\} = \mathbf{J}_{\tempop}\,\left(\Delta\mathbf{s}_{\tempop}\Delta\mathbf{s}_{\tempop}^T\right)\,\mathbf{J}_{\tempop}^T+\mathbf{R}_{\tempop},\\ &\mathbb{E} \left\{\mathbf{v}_{\tempop}\Delta\mathbf{s}_{\tempop}^T\right\} = \mathbf{J}_{\tempop}\,\left(\Delta\mathbf{s}_{\tempop}\Delta\mathbf{s}_{\tempop}^T\right), \end{align} it is straightforward to recast \eqref{eq:costfunctionw0} as \begin{align} \label{eq:costfunctionwy} \mathcal{E} & = \text{Tr} (\Delta\mathbf{s}_{\tempop}\Delta\mathbf{s}_{\tempop}^T - \mathbf{K}_{\tempop}\mathbf{J}_{\tempop} \Delta\mathbf{s}_{\tempop}\Delta\mathbf{s}_{\tempop}^T \nonumber \\ & + \mathbf{K}_{\tempop} \left[ \mathbf{J}_{\tempop}\,\Delta\mathbf{s}_{\tempop}\Delta\mathbf{s}_{\tempop}^T\,\mathbf{J}_{\tempop}^T + \mathbf{R}_{\tempop}\right] \mathbf{K}_{\tempop}^T \nonumber \\ & - \Delta\mathbf{s}_{\tempop}\Delta\mathbf{s}_{\tempop}^T \mathbf{J}_{\tempop}^T \mathbf{K}_{\tempop}^T ) . \end{align} To show how \eqref{eq:costfunctionwy} depends on the parameters to be optimized (i.e., $\boldsymbol{\vartheta}^{(\mathsf{t+1})}$) let make a step backward and let consider the actual node position at next time step $\mathbf{p}_{\tempop}$, denoting $P_{\risk}(\boldsymbol{\vartheta}_{\risk}^{(\mathsf{t+1})}, \mathbf{p}_{\tempop})$ the power received from $k$th \ac{RIS} when the node is in position $\mathbf{p}_{\tempop}$ for a {certain} $\boldsymbol{\vartheta}_{\risk}^{(\mathsf{t+1})}$. Let denote by $\mathbf{o}_{\tempop}$ the observation in $\mathbf{p}_{\tempop}$ (not yet available), and by $\mathbf{h}_{\tempop \lvert \tempo}$ the observation function evaluated in $\mathbf{m}_{\tempop \lvert \tempo} $, i.e., $\mathbf{h}_{\tempop \lvert \tempo} = h(\mathbf{m}_{\tempop \lvert \tempo} )$, we can write \begin{align}\label{eq:observa_model} &\mathbf{v}_{\tempop}=\mathbf{o}_{\tempop} - \mathbf{h}_{\tempop \lvert \tempo} = \mathbf{J}_{\tempop} \left(\mathbf{s}_{\tempop} - \mathbf{m}_{\tempop \lvert \tempo} \right) + \boldsymbol{\eta}_{\tempop}, \end{align} where $\mathbf{J}_{\tempop}$ is the Jacobian matrix evaluated in $\mathbf{m}_{\tempop \lvert \tempo} $. Note that \eqref{eq:observa_model} is the linearized version of \eqref{eq:observationmodel} according with the first-order Taylor expansion valid for small {$\Delta \mathbf{s}_{\mathsf{t+1}}$}. By adopting the same empirical term $\alpha$ introduced in \eqref{eq:var_ok_3} to characterize the observation model mismatch and by recalling \eqref{eq:noisem}, we have a covariance matrix of $\boldsymbol{\eta}_{\tempop}$ given by \begin{align}\label{eq:Rn_n1} &\left[\mathbf{R}_{\tempop}\left({\boldsymbol{\vartheta}^{(\mathsf{t+1})}},\mathbf{s}_{\tempop}\right) \right]_{n,n} = {\bar{\sigma}_k^2} =\frac{\sigma^2(1+\alpha)}{P_{k}({{\boldsymbol{\vartheta}_{\risk}^{(\mathsf{t+1})}},\mathbf{p}_{\tempop}})} \end{align} with $n \in \mathcal{I}_k$ . Then, the innovation covariance matrix and the Kalman gain, at the next time step, can be respectively written as \begin{align}\label{eq:S11} & \mathbf{S}_{\tempop}\left({\boldsymbol{\vartheta}^{(\mathsf{t+1})}}, \mathbf{s}_{\tempop}\right) = \mathbf{J}_{\tempop} \, \boldsymbol{\Sigma}_{\mathsf{t+1} \lvert \mathsf{t}}\, \mathbf{J}_{\tempop}^T + \mathbf{R}_{\tempop}, \\ & \mathbf{K}_{\tempop}\left({\boldsymbol{\vartheta}^{(\mathsf{t+1})}},\mathbf{s}_{\tempop}\right) = \boldsymbol{\Sigma}_{\mathsf{t+1} \lvert \mathsf{t}}\, \mathbf{J}_{\tempop}^T \mathbf{S}_{\tempop}^{-1}. \label{eq:K1} \end{align} \begin{comment} \paragraph{Cost Function} Let consider the actual node position at next time step $\mathbf{p}_{\tempop}$ and denote by $P_{\risk}(\boldsymbol{\vartheta}_{\risk}^{(\mathsf{t+1})}, \mathbf{p}_{\tempop})$ the power received from $k$th \ac{RIS} when the node is in position $\mathbf{p}_{\tempop}$ and for a {certain} \ac{RIS} configuration $\boldsymbol{\vartheta}_{\risk}^{(\mathsf{t+1})}$. Denoting by $\mathbf{o}_{\tempop}$ the observation in $\mathbf{p}_{\tempop}$ (not yet available), and by $\mathbf{h}_{\tempop \lvert \tempo}$ the observation function in $\mathbf{m}_{\tempop \lvert \tempo} $, i.e., $\mathbf{h}_{\tempop \lvert \tempo} = h(\mathbf{m}_{\tempop \lvert \tempo} )$, we can write \begin{align}\label{eq:observa_model} &\mathbf{v}_{\tempop}=\mathbf{o}_{\tempop} - \mathbf{h}_{\tempop \lvert \tempo} = \mathbf{J}_{\tempop} \left(\mathbf{s}_{\tempop} - \mathbf{m}_{\tempop \lvert \tempo} \right) + \boldsymbol{\eta}_{\tempop}, \end{align} where $\mathbf{J}_{\tempop}$ is the Jacobian matrix evaluated in $\mathbf{m}_{\tempop \lvert \tempo} $. Note that \eqref{eq:observa_model} is the linearized version of \eqref{eq:observationmodel} according with the first-order Taylor expansion valid for small {$\Delta \mathbf{s}_{\mathsf{t+1}}=\left(\mathbf{s}_{\tempop} - \mathbf{m}_{\tempop \lvert \tempo} \right)$}. By adopting the same empirical term $\alpha$ introduced in \eqref{eq:var_ok_3} to characterize the observation model mismatch and by recalling \eqref{eq:noisem}, we have a covariance matrix of $\boldsymbol{\eta}_{\tempop}$ given by \begin{align}\label{eq:Rn_n1} &\left[\mathbf{R}_{\tempop}\left({\boldsymbol{\vartheta}^{(\mathsf{t+1})}},\mathbf{s}_{\tempop}\right) \right]_{n,n} = {\bar{\sigma}_k^2} =\frac{\sigma^2(1+\alpha)}{P_{k}({{\boldsymbol{\vartheta}_{\risk}^{(\mathsf{t+1})}},\mathbf{p}_{\tempop}})} \end{align} with $n \in \mathcal{I}_k$, and $\boldsymbol{\vartheta}^{(\mathsf{t+1})} = \left\{\boldsymbol{\vartheta}_1^{(\mathsf{t+1})},\ldots,\boldsymbol{\vartheta}_K^{(\mathsf{t+1})}\right\}$. Then, the innovation covariance matrix and the Kalman gain, at next time step, can be respectively written as \begin{align}\label{eq:S11} & \mathbf{S}_{\tempop}\left({\boldsymbol{\vartheta}^{(\mathsf{t+1})}}, \mathbf{s}_{\tempop}\right) = \mathbf{J}_{\tempop} \, \boldsymbol{\Sigma}_{\mathsf{t+1} \lvert \mathsf{t}}\, \mathbf{J}_{\tempop}^T + \mathbf{R}_{\tempop}, \\ & \mathbf{K}_{\tempop}\left({\boldsymbol{\vartheta}^{(\mathsf{t+1})}},\mathbf{s}_{\tempop}\right) = \boldsymbol{\Sigma}_{\mathsf{t+1} \lvert \mathsf{t}}\, \mathbf{J}_{\tempop}^T \mathbf{S}_{\tempop}^{-1}. \label{eq:K1} \end{align} Denoting the state estimate at time $\mathsf{t+1}$ as \begin{equation} \hsskp= \mathbf{m}_{\tempop \lvert \tempop} = \mathbf{m}_{\tempop \lvert \tempo} + \mathbf{K}_{\tempop}\left({\boldsymbol{\vartheta}^{(\mathsf{t+1})}},\mathbf{s}_{\tempop}\right) \, \mathbf{v}_{\tempop}, \nonumber \end{equation} the \ac{MSE} of the estimator can be written as \begin{align} \label{eq:costfunctionw0} &\mathcal{E}\left({\boldsymbol{\vartheta}^{(\mathsf{t+1})}},\mathbf{s}_{\tempop}\right) = \text{Tr} \left( \mathbb{E} \left\{ \left( \mathbf{s}_{\tempop} - \hsskp\right) \left(\mathbf{s}_{\tempop} - \hsskp\right)^T\right\} \right) \nonumber \\ &= \text{Tr} \left(\mathbb{E} \left\{\left(\Delta\mathbf{s}_{\tempop}- \mathbf{K}_{\tempop} \mathbf{v}_{\tempop}\right) \left(\Delta\mathbf{s}_{\tempop}- \mathbf{K}_{\tempop}\mathbf{v}_{\tempop} \right)^T\right\}\right), \end{align} where $\text{Tr}\left(\cdot\right)$ is the trace operator and $\mathbb{E}=\mathbb{E}_{ \boldsymbol{\eta}_{\tempop} \lvert \mathbf{s}_{\tempop} } \{ \cdot \}$ is the expectation evaluated with respect to the observation noise conditioned on the actual position of the user. By considering \begin{align} & \mathbb{E}\left\{\mathbf{v}_{\tempop}\innkp^T\right\} = \mathbf{J}_{\tempop}\,\left(\Delta\mathbf{s}_{\tempop}\Delta\mathbf{s}_{\tempop}^T\right)\,\mathbf{J}_{\tempop}^T+\mathbf{R}_{\tempop},\\ &\mathbb{E} \left\{\mathbf{v}_{\tempop}\Delta\mathbf{s}_{\tempop}^T\right\} = \mathbf{J}_{\tempop}\,\left(\Delta\mathbf{s}_{\tempop}\Delta\mathbf{s}_{\tempop}^T\right), \end{align} it is straightforward to recast \eqref{eq:costfunctionw0} as \begin{align} \label{eq:costfunctionwy} &\mathcal{E}\left({\boldsymbol{\vartheta}^{(\mathsf{t+1})}},\mathbf{s}_{\tempop}\right) = \text{Tr} (\Delta\mathbf{s}_{\tempop}\Delta\mathbf{s}_{\tempop}^T \nonumber \\ & + \mathbf{K}_{\tempop} \left[ \mathbf{J}_{\tempop}\,\Delta\mathbf{s}_{\tempop}\Delta\mathbf{s}_{\tempop}^T\,\mathbf{J}_{\tempop}^T + \mathbf{R}_{\tempop}\right] \mathbf{K}_{\tempop}^T \nonumber \\ & - \mathbf{K}_{\tempop}\mathbf{J}_{\tempop} \Delta\mathbf{s}_{\tempop}\Delta\mathbf{s}_{\tempop}^T - \Delta\mathbf{s}_{\tempop}\Delta\mathbf{s}_{\tempop}^T \mathbf{J}_{\tempop}^T \mathbf{K}_{\tempop}^T ) . \end{align} Note that in \eqref{eq:costfunctionwy} the matrices $\mathbf{K}_{\tempop}$, $\mathbf{S}_{\tempop}$, and $\mathbf{R}_{\tempop}$ depends on the future state $\mathbf{s}_{\tempop}$ and on the parameters to be otimized, i.e. $\boldsymbol{\vartheta}^{(\mathsf{t+1})}$, as indicated by \eqref{eq:Rn_n1},\eqref{eq:S11},\eqref{eq:K1}. The goal of the optimization is to minimize the \ac{MSE} on the \ac{UE} state estimation by considering its expectation over its uncertainty region. \end{comment} \paragraph{Problem Formulation} The optimal transmission configuration parameters is obtained by solving the problem \begin{equation}\label{eq:problem111} \begin{array}{c} \underset{\substack{{\boldsymbol{\vartheta}^{(\mathsf{t+1})}}}} {\min} ~~ \mathbb{E}_{\mathbf{s}_{\tempop}} \left\{\mathcal{E}\left({\boldsymbol{\vartheta}^{(\mathsf{t+1})}},\mathbf{s}_{\tempop}\right)\right\} \\ \text{s.t.} \quad {\boldsymbol{\vartheta}^{(\mathsf{t+1})}} \in {\mathcal{Q}} \end{array} \end{equation} where $\mathbb{E}_{\mathbf{s}_{\tempop}}$ is the expectation with respect to distribution of $\mathbf{s}_{\tempop}$ and $\mathcal{Q}$ encompasses the precoder and \acp{RIS} constraints, i.e., $\sum_{k=1}^K \left [\beta_k\right]^2 \le P_{\text{tx}}$, $\lvert c_{\risk;\riselem} \lvert \le 1, \, \forall \, k \in \mathcal{K} \,, p \in \mathcal{P}$. The above problem is very complex in that the evaluation of the objective function is nontrivial and, moreover, it is nonconvex. Therefore, we resort to an approximated approach. To elaborate, we note that the transmission parameters {$\boldsymbol{\vartheta}^{(\mathsf{t+1})}$} affect the MSE in \eqref{eq:costfunctionwy} via the covariance matrix $\mathbf{R}_{\tempop}$, which appears both directly and indirectly via $\mathbf{K}_{\tempop}$ (see \eqref{eq:K1} and \eqref{eq:S11}). Then we note that the complexity is mainly due to the fact that $\mathbf{K}_{\tempop}$ depends on the inverse of $\mathbf{S}_{\tempop}$. To circumvent this difficulty, we argue that the dependence of $\mathbf{S}_{\tempop}$ on $\mathbf{R}_{\tempop}$ is weak, which is especially true when we consider high \acp{SNR}. Accordingly, we approximate the innovation covariance matrix as a fixed matrix independent of the transmission parameters. For this purpose, we could use the covariance matrix estimated by \eqref{eq:var_ok_3}. However, \eqref{eq:var_ok_3} depends on the power received at time $\mathsf{t}$, which is affected by the power allocation terms $\beta_k^{(\mathsf{t})}$ evaluated in the previous time step, so directly using \eqref{eq:var_ok_3} to evaluate $\mathbf{S}_{\tempop}$ would transfer the effect of the previous optimization to the next. Therefore, we introduce $\breve{\mathbf{R}}_t$ as \begin{align}\label{eq:var_ok_3bis} &\left\{\breve{\mathbf{R}}_{\mathsf{t}}\right\}_{n,n} = \frac{\left[\beta_k^{(\mathsf{t})}\right]^2}{P_{\text{tx}}/K} \cdot \frac{\sigma^2(1+\alpha)}{\lVert \mathbf{y}_k \rVert^2 / {N}_{\text{RX}}}, \end{align} for $n \in \mathcal{I}_k$. Note that $\breve{\mathbf{R}}_{\mathsf{t}}$ is an estimate of the noise covariance matrix when all \acp{RIS} are assigned the same power $P_{\text{tx}}/K$ and, as such, it is independent of the prior power allocation strategy. Accordingly, we take $\mathbf{S}_{\tempop}$ as \begin{equation}\label{eq:St} \mathbf{S}_{\tempop} \simeq \mathbf{J}_{\tempop} \, \boldsymbol{\Sigma}_{\mathsf{t+1} \lvert \mathsf{t}} \, \mathbf{J}_{\tempop}^T +\breve{\mathbf{R}}_{\mathsf{t}}, \end{equation} % and the Kalman gain in \eqref{eq:K1} can be approximated as % \begin{equation}\label{eq_Ktilde} \tilde{\mathbf{K}}_{\mathsf{t+1}} = \boldsymbol{\Sigma}_{\mathsf{t+1} \lvert \mathsf{t}} \mathbf{J}_{\tempop}^T\left(\mathbf{J}_{\tempop} \, \boldsymbol{\Sigma}_{\mathsf{t+1} \lvert \mathsf{t}} \, \mathbf{J}_{\tempop}^T+\breve{\mathbf{R}}_{\mathsf{t}} \right)^{-1} \end{equation} % with consequent independence from the parameters to be estimated. Also, it is worth noting that $\mathbf{R}_{\tempop}$ in \eqref{eq:Rn_n1} does not depend on velocity, so we can simplify as $\mathbf{R}_{\tempop}({\boldsymbol{\vartheta}^{(\mathsf{t+1})}},\mathbf{s}_{\tempop}) =\mathbf{R}_{\tempop}({\boldsymbol{\vartheta}^{(\mathsf{t+1})}},\mathbf{p}_{\tempop})$ and, in \eqref{eq:problem111}, we can consider the expected value over $\mathbf{p}_{\tempop}$ instead of considering the entire state. In the following, for the sake of notation, we omit the dependence of all quantities involved on time $\mathsf{t}$, unless this is explicitly required. Accordingly, the problem \eqref{eq:problem111} becomes % \begin{equation}\label{eq:problem1111} \begin{array}{c} \underset{\substack{{\boldsymbol{\vartheta}}}} {\min} ~~ \text{Tr} \left(\tilde{\mathbf{K}} ~ \mathbb{E}_{\mathbf{p}} \left\{\mathbf{R}_{\tempop}\left({\boldsymbol{\vartheta}},\mathbf{p}\right)\right\} \tilde{\mathbf{K}}^T \right)\\ \text{s.t.} \quad {{\boldsymbol{\vartheta}}} \in {\mathcal{Q}} \, \end{array}. \end{equation} The proof is given in the supplementary material in Appendix C. Let us denote by $\mathbf{u}_{n}$ the $n$th column of $\tilde{\mathbf{K}}$. Thus, by introducing $\xi_{ k} = \sigma^2(1+\alpha)\sum\limits_{n\in \mathcal{I}_k}\rVert \mathbf{u}_{n}\rVert^2$, the problem can be further reformulated as \begin{equation}\label{eq:wMMSE1_21} \begin{array}{c} \underset{\substack{{\boldsymbol{\vartheta}}}} {\min} ~~ \Sigma_{k=1}^{K} \xi_{k} \, \left({P_{\risk}({\mathbf{p}},{\boldsymbol{\vartheta}_{\risk}})}\right)^{-1}\\ \text{s.t.} \quad {{\boldsymbol{\vartheta}}} \in {\mathcal{Q}} \, \end{array} . \end{equation} Let us now introduce $P^{(0)}_{k}({\mathbf{p}},\risparam_{\risk})$ as the received power corresponding to unitary power distribution. Consequently, the actual received power is $P_{\risk}({\mathbf{p}},\boldsymbol{\vartheta}_{\risk}) = \left[\beta_k\right]^2 \, P^{(0)}_{k}({\mathbf{p}},\risparam_{\risk})$ and we can recast problem \eqref{eq:wMMSE1_21} as \begin{equation}\label{eq:wMMSE1_211} \begin{array}{c} \underset{\substack{{\boldsymbol{\vartheta}}}} {\min} ~~ \sum_{k=1}^{K}\xi_{k} \frac{1}{\left[\beta_k\right]^2} \mathbb{E}_{ \mathbf{p} }\left\{ P^{(0)}_{k}({\mathbf{p}},\risparam_{\risk}) ^{-1}\right\}\\ \text{s.t.} \quad {{\boldsymbol{\vartheta}}} \in {\mathcal{Q}} \, \end{array} . \end{equation} Since the $k$th \ac{RIS} design concerns only the term $\mathbb{E}_{ \mathbf{p}}\left\{ P^{(0)}_{k}({\mathbf{p}},\risparam_{\risk}) ^{-1}\right\}$, the design criterion for the \acp{RIS} becomes straightforward, i.e. \begin{equation}\label{eq:wMMSE1_2111} \begin{array}{c} \underset{\substack{{\risparam_{\risk}}}} {\min} ~~ \mathbb{E}_{ \mathbf{p}}\left\{ P^{(0)}_{k}({\mathbf{p}},\risparam_{\risk}) ^{-1}\right\}\\ \text{s.t.} \quad |c_{\risk;\riselem}| \le 1 \, \forall p \in \mathcal{P} \end{array}, \end{equation} Let us assume that problem \eqref{eq:wMMSE1_2111} is solved and let us denote by $\mathbf{\risparamel}^*_k$ and $\pi_k$, respectively, the optimal $\mathbf{\risparamel}_k$ and the value of the objective function, i.e., \begin{equation}\label{eq_gk} \pi_k = \mathbb{E}_{ \mathbf{p}}\left\{ P^{(0)}_{k}({\mathbf{p}},\mathbf{\risparamel}^*_k) ^{-1}\right\}. \end{equation} Hence, the precoder optimization problem can be written as follows \begin{equation}\label{eq:wMMSE1_21111} \begin{array}{c} \underset{\substack{{\beta_k}}} {\min} ~~ \sum_{k=1}^{K} \gamma_{ k} \frac{1}{\left[\beta\right]_k^2}\\ \text{s.t.} \quad \Sigma_{k = 1}^K \left[ \beta_k\right]^2 \le P_{\text{tx}} \end{array} \end{equation} where $\gamma_{ k} = \xi_{ k} \, \pi_k$. \section{\ac{RIS} and Precoder Optimization for User Tracking: Proposed Solutions} \label{sec:soloptimization} \subsection{\ac{RIS} optimization}\label{RIsopt} Let us first focus on problem \eqref{eq:wMMSE1_2111}. From the assumption that each \ac{UE} antenna receives the same power, the power of the signal coming from the $k$-th \ac{RIS} can be evaluated as the power coming from the first \ac{UE} antenna, i.e.: \begin{align} P_{\risk}^{(0)}({\mathbf{p}},\risparam_{\risk}) &= (\mathbf{v}_k^{(0)})^H \mathbf{G}_k^H \RISPARAM_{\risk}^H \mathbf{b}_k^H(\mathbf{p}) \mathbf{b}_k(\mathbf{p})\RISPARAM_{\risk}\mathbf{G}_k \mathbf{v}_k^{(0)} \label{eq:Power_def} \end{align} where $\mathbf{b}_k(\mathbf{p}) \in \mathbb{C}^{1 \times P}$ is the first row of $\mathbf{B}_k(\mathbf{p})$ corresponding to the first receiving antenna, and we recall that $\RISPARAM_{\risk}= \operatorname{diag} \left(\risparam_{\risk}\right)$ is the matrix containing the \ac{RIS} coefficients vector. Without loss of generality, the index $k$ is neglected from now on and a formulation valid for every \ac{RIS} is obtained. The goal of the \ac{RIS} optimization in \eqref{eq:wMMSE1_2111} is to find the beamforming vector $\mathbf{\risparamel}$ such that the (statistical) average of the inverses of \eqref{eq:Power_def} over the uncertainty range of $\mathbf{p}$ is minimized. Consequently, we can formulate \eqref{eq:wMMSE1_2111} as \begin{equation}\label{P_min_in_avg_power1} \begin{array}{c} \underset{\substack{{\mathbf{\risparamel}}}} {\min} ~~ \int {P}^{(0)}\left(\text{\boldmath{$p$}},\mathbf{\risparamel}\right)^{-1} f_{\boldsymbol{P}}(\text{\boldmath{$p$}}) d\text{\boldmath{$p$}}\\ \text{s.t.} \quad |c_p|^2 \le 1 \, ~ \forall p \in \mathcal{P} \end{array} \end{equation} where $f_{\boldsymbol{P}}(\text{\boldmath{$p$}})$ is the a-priori \ac{pdf} of the position $\text{\boldmath{$p$}}$. In particular, from the \ac{EKF} model, we have $f_{\boldsymbol{P}}(\text{\boldmath{$p$}}) = \mathcal{N}(\text{\boldmath{$p$}};\mathbf{m}_{\mathsf{t+1}|\mathsf{t}},{\boldsymbol{\Sigma}}_{\mathsf{t+1}|\mathsf{t}})$. The problem \eqref{P_min_in_avg_power1} is nonconvex and therefore, we propose below an iterative \ac{BCD} algorithm to find a local optimum. \paragraph{\ac{BCD} Algorithm} For the sake of notation, we set $\mathbf{g} \triangleq \mathbf{G}{\mathbf{v}^{(0)}}$ and we consider the following equivalence \begin{align} \label{eq:equivalence} &\mathbf{b}(\mathbf{p})\mathbf{C}\mathbf{g} = \mathbf{b}(\mathbf{p}) \text{diag}\left({\mathbf{g}}\right)\mathbf{\risparamel} = \tilde{\mathbf{h}}(\mathbf{p}) \mathbf{\risparamel} \end{align} where $\tilde{\mathbf{h}}(\mathbf{p}) \triangleq \mathbf{b}(\mathbf{p}) \text{diag}\left({\mathbf{g}}\right) \in \mathbb{C}^{{1} \times P}$. Accordingly, \eqref{eq:Power_def} simplifies as \begin{align} \label{P:power_def} {P}^{(0)}\left(\mathbf{p},\mathbf{\risparamel}\right) = \mathbf{\risparamel}^H \tilde{\mathbf{h}}^H(\mathbf{p})\tilde{\mathbf{h}}(\mathbf{p}) \mathbf{\risparamel}. \end{align} Let us introduce the following term: \begin{align} \label{eq:mMSEMat0_21} {\Sigma}\left(\mathbf{p},\mathbf{\risparamel}\right) & = \frac{\delta}{{P}^{(0)}\left(\mathbf{p},\mathbf{\risparamel}\right) + \delta} \, . \end{align} When $\delta$ is small, we can recast problem in \eqref{P_min_in_avg_power1} as \begin{equation}\label{Emin_problem} \begin{array}{c} \underset{\substack{{\mathbf{\risparamel}}}} {\min} ~~ \int {\Sigma}\left(\text{\boldmath{$p$}},\mathbf{\risparamel}\right) f_{\boldsymbol{P}}(\text{\boldmath{$p$}}) d\text{\boldmath{$p$}} \\ \text{s.t.} \quad |c_p|^2 \le 1 \, ~ \forall p \in \mathcal{P} \end{array} \end{equation} Then, we introduce \begin{align} \label{eq:mMSEMat0_22} {\Upsilon}\left(\mathbf{p},\mathbf{\risparamel},w\right) & = 1 + |w|^2 {P}^{(0)}\left(\mathbf{p},\mathbf{\risparamel}\right) - 2 \Re \{ w \tilde{\mathbf{h}}(\mathbf{p}) \mathbf{\risparamel} \} + \delta |w|^2, \end{align} where $w$ is a complex parameter. It is straightforward to get the equivalence \begin{equation}\label{Equivalence} \begin{array}{c} {\Sigma}\left(\text{\boldmath{$p$}},\mathbf{\risparamel}\right) = \min \limits_{w} {\Upsilon}\left(\text{\boldmath{$p$}},\mathbf{\risparamel},w\right) = {\Upsilon}\left(\text{\boldmath{$p$}},\mathbf{\risparamel},w^*\right), \end{array} \end{equation} where \begin{equation} \label{eq:wott} w^* = \frac{ \mathbf{\risparamel}^H \tilde{\mathbf{h}}^H(\mathbf{p}) }{{{P}^{(0)}\left(\mathbf{p},\mathbf{\risparamel}\right)}+\delta} \, . \end{equation} Accordingly, the problem in \eqref{P_min_in_avg_power1} can be reformulated as \begin{equation}\label{Emin_problem11} \begin{array}{c} \underset{\substack{{\mathbf{\risparamel}}}} {\min} ~~ \int \min \limits_{w}\left[ {\Upsilon}\left(\text{\boldmath{$p$}},\mathbf{\risparamel},w\right)\right] f_{\boldsymbol{P}}(\text{\boldmath{$p$}}) d\text{\boldmath{$p$}} \\ \text{s.t.} \quad |c_p|^2 \le 1 \, ~ \forall p \in \mathcal{P}. \end{array} \end{equation} Note that when $\delta$ tends to zero, ${\Sigma}\left(\text{\boldmath{$p$}},\mathbf{\risparamel}\right)$ in \eqref{Equivalence} also tends to zero for each $\mathbf{c}$ and $\mathbf{p}$ and the problem \ref{Emin_problem11} cannot provide a meaningful solution. Therefore, $\delta$ must be chosen appropriately so that the problem \eqref{Emin_problem11} is not starved in the zero solution, and, at the same time $\delta \ll {P}^{(0)}\left(\mathbf{p},\mathbf{\risparamel}\right)$ to ensure equivalence between \eqref{P_min_in_avg_power1} and \eqref{Emin_problem}. This aspect is explained in more detail below. Although \eqref{Emin_problem11} is not convex, it is convex for the remaining variable if one of the two variables is fixed. As a result, a good local optimum can be obtained using the iterative \ac{BCD} approach \cite{Bertsekas1999}, where all variables involved are updated sequentially at each iteration. To illustrate this, we denote by $\mathbf{\risparamel}^{(q)}$ the value of $\mathbf{\risparamel}$ after the $q$th iteration of \ac{BCD}. From \eqref{eq:wott} we can then compute ${w}^{(q)}$ as follows % \begin{align} \label{eq:wott_it} & w^{(q)}\left(\mathbf{p}\right) = \frac{(\mathbf{\risparamel}^{(q)})^H \tilde{\mathbf{h}}^H(\mathbf{p})}{{{P}^{(0)}\left(\mathbf{p},\mathbf{\risparamel}^{(q)}\right)}+\delta^{(q)}}, \end{align} where \begin{align} \label{eq:delta_q} &\delta^{(q)} = \frac{\min_{\mathbf{p}} P^{(0)}\left(\mathbf{p},\mathbf{\risparamel}^{(q)}\right)}{M}, \end{align} where $M \gg 1$. The optimal choice of $M$ depends on the tradeoff between fast convergence ($M$ must not be excessively high) and equivalence between \eqref{P_min_in_avg_power1} and \eqref{Emin_problem} ($M$ must be high). Finding an analytical approach to optimally deal with this trade-off is a very complex task. However, based on numerical considerations, we found that a value of $M = 100$ is a good compromise, and therefore we set this value in the numerical results section. In \eqref{P_min_in_avg_power1} and \eqref{Emin_problem} the problem of finding the optimal $\mathbf{\risparamel}^{(q+1)}$ for a given ${w}^{(q)}$ can be solved as follows. Let us first introduce the terms \begin{align} \label{Emin_problem1bis} &\mathbf{A}^{(q)} = \int |w^{(q)}\left(\text{\boldmath{$p$}}\right)|^2\tilde{\mathbf{h}}^H(\text{\boldmath{$p$}})\tilde{\mathbf{h}}(\text{\boldmath{$p$}}) f_{\boldsymbol{P}}(\text{\boldmath{$p$}})d\text{\boldmath{$p$}} && \in \mathbb{C}^{{P} \times P} \\\nonumber & \mathbf{s}^{(q)} = \int w^{(q)}\left(\text{\boldmath{$p$}}\right) \tilde{\mathbf{h}}(\text{\boldmath{$p$}}) f_{\boldsymbol{P}}(\text{\boldmath{$p$}})d\text{\boldmath{$p$}} \in \mathbb{C}^{{1} \times P} && \in \mathbb{C}^{{1} \times P} \end{align} which can be computed by numerical integration. Therefore, the optimal $\mathbf{\risparamel}$ for a given $w^{(q)}(\mathbf{p})$ can be found from \begin{equation}\label{Emin_problem2} \begin{array}{c} \underset{\substack{{\mathbf{\risparamel}}}} {\min} ~~ \mathbf{\risparamel}^H \mathbf{A}^{(q)} \mathbf{\risparamel} -2 \Re \{\mathbf{s}^{(q)} \mathbf{\risparamel}\} \\ \text{s.t.} \quad | c_p | ^2\le 1, \, \forall p \in \mathcal{P}. \end{array} \end{equation} This is a convex problem that can be solved using traditional numerical approaches whose solution will be denoted as OPT in the sequel. However, the inclusion of a large number of inequality constraints makes the problem computationally difficult when $P$ is high. An iterative strategy based on \ac{AO}, where optimization is performed at each step for a single element $c_p$ while the others remain fixed, is one way to simplify the problem. The \ac{AO} approach will be referred to as OPT-AO. We will show in the results that OPT-AO achieves performance very close to that of OPT, while noticeably reducing computational complexity. To elaborate, consider the following problem \begin{equation}\label{Emin_problem3} \begin{array}{c} \underset{\substack{{c_p }}} {\min} ~~ \mathbf{\risparamel}^H \mathbf{A}^{(q)} \mathbf{\risparamel} -2 \Re \{\mathbf{s}^{(q)} \mathbf{\risparamel}\} \\ \text{s.t.} \quad | c_p | ^2\le 1 \, \end{array} \end{equation} where the difference with respect to \eqref{Emin_problem2} is that the minimum is searched for each $c_p$ independently. The solution of this problem can be found in closed form by enforcing the \ac{KKT} optimality conditions. In particular, the Lagrangian function is \begin{align} \label{eq:Lag_fun} &L\left(c_p,{\lambda}_p\right) = \mathbf{\risparamel}^H \mathbf{A}^{(q)} \mathbf{\risparamel} -2 \Re \{\mathbf{s}^{(q)} \mathbf{\risparamel}\} + \lambda_p \left( |c_p | ^2 - 1\right). \end{align} Considering the KKT conditions we have \begin{align} \label{eq:KKTcond} &\nabla_{c_p} L\left(c_p,{\lambda}_p\right) = 2\mathbf{a}^{(q)}_p \mathbf{\risparamel} - 2 {\left(s^{(q)}_p\right)^*} + 2 \lambda_p c_p = 0\\ &\lambda_p \ge 0\\ &\lambda_p \left( |c_p | ^2 - 1\right) = 0 \end{align} where $\mathbf{a}^{(q)}_p \in \mathbb{C}^{{1} \times P}$ is the $p$th row of $\mathbf{A}^{(q)}$, $s^{(q)}_p$ is the $p$th element of $\mathbf{s}^{(q)} $ and the second condition is the complementary slackness condition. {Denote by $V_p = \Sigma_{l \ne p} a^{(q)}_{p,l} c_l$}, $A_p = a^{(q)}_{p,p}$, and $Y_p = (s^{(q)}_p)^*-V_p$, where $a^{(q)}_{p,l}$ is the $l$th element of $\mathbf{a}^{(q)}_p$, it is then easy to derive from \eqref{eq:KKTcond} \begin{align} \label{eq:solution} &c_p = {Y_p}/{A_p}, ~\lambda_p = 0 & \text{if } |Y_p| < |A_p|\\ \nonumber &c_p = {Y_p}/{|Y_p|}, ~\lambda_p = |Y_p|-A_p & \text{if } |Y_p| \ge |A_p| \end{align} \begin{algorithm}[t!] \SetAlgoLined {\textbf{Uncertainty area construction}};\\ \For{$q=1, \ldots, N_{r}$}{ Compute $f^{(q)}_{\boldsymbol{P}}(\boldsymbol{p})$ according to \eqref{Model_cov_joint}-\eqref{joint_pdf}; \\ } $f_{\boldsymbol{P}}(\boldsymbol{p})= \frac{1}{N_{r}}\Sigma_{q=1}^{N_{r}} f^{(q)}_{\boldsymbol{P}}(\boldsymbol{p})$;\\ {\textbf{\ac{RIS} Parameter Update}};\\ Initialize $\mathbf{\risparamel}^{*}=\risparam_{\risk}^{(\mathsf{t})}$;\\ \For{$q=1, \ldots, N_{\text{BCD}}$} { Initialize the iterative solution: $\mathbf{\risparamel}^{(q)}=\mathbf{\risparamel}^*$;\\ Update $w^{(q)}$, $\textbf{A}^{(q)}$ and $\textbf{s}^{(q)}$ according to \eqref{eq:wott_it}-\eqref{Emin_problem1bis};\\ \For{p=1, \ldots , P} {Solve problem \eqref{Emin_problem3} for $c_p$ as in \eqref{eq:solution}; } } $\mathbf{\risparamel}_{k}^{(\mathsf{t+1})}=\mathbf{\risparamel}^{*}$ \caption{\ac{RIS} Optimization with BCD Approach} \label{alg:RIS_Opt} \end{algorithm} \subsection{Precoder Optimization} The precoder optimization problem presented in \eqref{eq:wMMSE1_21111} can be easily solved by resorting to the \ac{KKT} constraints. Writing the Lagrangian function as \begin{equation} L(\beta_k,\lambda)= \Sigma_{k=1}^K \frac{\gamma_{k}}{\beta_k^2}+\lambda \left (\sum_{k=1}^K \beta_k^2 - P_{\text{tx}} \right), \end{equation} the \ac{KKT} conditions can be derived as \begin{align} & \nabla_{\beta_k} L(\beta_k,\lambda)= - 2 \frac{\gamma_{k}}{\left(\beta^*_k\right)^3} + 2 \lambda^* \beta_k^*=0\\ & \Sigma_{k=1}^K {\left(\beta^*_k\right)^2} - P_{\text{tx}} \leq 0\\ &\lambda^* \geq 0\\ &\lambda^*\left(\Sigma_{k=1}^K {\left(\beta^*_k\right)^2} - P_{\text{tx}}\right) =0 \, . \end{align} The existence conditions of the given equations are summarized as $\beta_k^* \neq 0$ and $\lambda^* \neq 0$, and thus, it is easy to derive the optimal solution as \begin{align} \label{eq:beta_and_lambda} & \lambda^*= \frac{\left(\sum_{k=1}^K \sqrt{\gamma_{k}}\right)^2}{P_{\text{tx}}^2}, && \left(\beta^*_k \right)^2 = \frac{\sqrt{\gamma_{k}}\, P_{\text{tx}}}{{\sum_{k=1}^K \sqrt{\gamma_{k}}}} \, . \end{align} \subsection{Two-timescale optimization} As discussed in Sec. \ref{Intro}, \ac{RIS} and precoding optimization are performed on two different time scales. As for the precoding, the time scale corresponds to the interval between two consecutive pilot signal transmissions and may be on the order of a few milliseconds, e.g., on the same time scale as channel estimation in communications. This interval corresponds to the time between two successive location updates of the EKF algorithm and will be denoted by $d\mathsf{t}$ in the following. Conversely, the time scale of the \ac{RIS} update, denoted by $T_O$, can be expected to be on the order of seconds, i.e., orders of magnitude higher. We denote with $N_{r} = T_O/ d\mathsf{t}$ the (integer) number of steps between two successive \ac{RIS} optimizations. Thus, if the previous \ac{RIS} optimization is performed at time $\mathsf{t}$, in order to obtain the new optimization at time $\mathsf{t}+N_{r}$ according to the approach presented in Section \ref{RIsopt}, the a-priori \ac{pdf} $f_{\boldsymbol{P}}(\boldsymbol{p})$ must be defined to account for the $N_{r}$ transitions of the EFK. More precisely, we have \begin{align}\label{Model_cov_joint} & \mathbf{m}_{\mathsf{t}+q+1|\mathsf{t}} = \mathbf{T}\mathbf{m}_{\mathsf{t}+q|\mathsf{t}}, && \boldsymbol{\Sigma}_{\mathsf{t}+q+1|\mathsf{t}} = \mathbf{T} \boldsymbol{\Sigma}_{\mathsf{t}+q|\mathsf{t}} \mathbf{T}^T+\mathbf{P}, \end{align} for $q = 1,\ldots,N_{r}$. The pdf of the position $\boldsymbol{p}$ at time $\mathsf{t}+q$ is given by $f^{(q)}_{\boldsymbol{P}}(\boldsymbol{p}) = \mathcal{N}(\mathbf{m}_{\mathsf{t}+q+1|\mathsf{t}},\boldsymbol{\Sigma}_{\mathsf{t}+q+1|\mathsf{t}})$ and \begin{equation}\label{joint_pdf} \begin{aligned} f_{\boldsymbol{P}}(\boldsymbol{p}) = \frac{1}{N_{r}}\Sigma_{q=1}^{N_{r}} f^{(q)}_{\boldsymbol{P}}(\boldsymbol{p}) \end{aligned} \, . \end{equation} The terms in \eqref{Emin_problem1bis} are then evaluated resorting to Monte Carlo numerical integration by drawing samples according to \eqref{joint_pdf}. The algorithms for \ac{RIS} and precoder optimization are sketched in Algorithm \ref{alg:RIS_Opt}, where $N_{\text{BCD}}$ indicates the number of iterations of the \ac{BCD}, and Algorithm \ref{alg:RIS_and_Precoder_Opt}. \begin{algorithm}[t!] \SetAlgoLined \For{${k}=1, \ldots, {K}$}{ \uIf{$N_{r} | \mathsf{t}$} {\text{Optimize the RIS};\\ } \Else{{$\risparam_{\risk}^{(\mathsf{t+1})}=\risparam_{\risk}^{(\mathsf{t})}$}} Evaluate $\tilde{\mathbf{K}}$ (see eq. \eqref{eq_Ktilde}), $\mathbf{u}_{n}$ and compute $\mathcal{I}_{k}$; \\ $\xi_{k}= \sigma_{k}^2 \, \Sigma_{n \in \mathcal{I}_{k}} \, \lVert \textbf{u}_n \rVert ^2$;\\ $\risparam_{\risk}^*=\risparam_{\risk}^{(\mathsf{t+1})}$;\\ Compute $\pi_{k}$ according to \eqref{eq_gk};\\ $\gamma_{k}=\xi_{k} \, \pi_{k}$;\\ $\left[\beta_{k}^{(\mathsf{t+1})}\right]^2=\frac{\sqrt{\gamma_{k}}\,P_{\text{tx}}}{\Sigma_{k=1}^{{K}} \sqrt{\gamma_{k}}}$;\\ } \caption{Optimization for Target Tracking} \label{alg:RIS_and_Precoder_Opt} \end{algorithm} \section{Results} \label{sec:results} \begin{figure} \centering \psfrag{a}[lc][lc][0.8]{1 m} \psfrag{b}[lc][lc][0.8]{2 m} \psfrag{c}[lc][lc][0.8]{3 m} \psfrag{k}[lc][lc][0.8]{20 m} \psfrag{e}[lc][lc][0.8]{30 m} \psfrag{f}[lc][lc][0.8]{30 m} \psfrag{g}[lc][lc][0.8]{30 m} \psfrag{h}[lc][lc][0.8]{BS} \psfrag{i}[lc][lc][0.8]{RIS} \psfrag{j}[lc][lc][0.8]{UE} \psfrag{x}[lc][lc][0.7]{\textit{x}} \psfrag{y}[lc][lc][0.7]{\textit{y}} \psfrag{z}[lc][lc][0.7]{\textit{z}} \includegraphics[width=1\linewidth,draft=false]{scenario_tracking.eps} \caption{Working scenario with an example of \ac{UE} trajectory.} \label{fig:scenario_sim} \end{figure} This simulation study aims to evaluate the validity of the optimized \ac{RIS}-based \ac{UE} tracking approach in a typical indoor scenario according to the following approaches: \begin{itemize} \item The optimization approach described in Sec.~\ref{RIsopt} with uniform power allocation for the different \acp{RIS}, i.e., $\beta^2_k = P_{\text{tx}}/K$, referred as OPT and its approximation obtained using the \ac{AO} method (Alg. \ref{alg:RIS_Opt}), referred as OPT-AO. \item The optimization approach described in Sec.~ \ref{RIsopt} with optimal power allocation denoted by $\beta$OPT and its \ac{AO} version (Alg. \ref{alg:RIS_Opt}) denoted as $\beta$OPT-AO. In both cases, power allocation is performed according to Alg. \ref{alg:RIS_and_Precoder_Opt}. \item The FOCUS and $\beta$FOCUS approaches, in which the \ac{RIS} design is performed to maximize the reflected power in the direction of the position estimate, as proposed in \cite{boyu2022bayesian}, while the power is allocated uniformly (FOCUS) or according to the Alg. \ref{alg:RIS_and_Precoder_Opt} ($\beta$FOCUS). \item The ROPT approach, in which the \ac{RIS} design is performed with the goal of maximizing the average communication rate when a-priori statistical knowledge about the user location is available and given by $f_{\boldsymbol{P}}(\mathbf{p})$. This approach has been proposed in \cite{abrardo2021intelligent} and power is uniformly allocated. \end{itemize} \paragraph{Parameter Settings} We refer to the 3GPP specifications for 5G localization in indoor open office (IOO) scenarios and the corresponding results reported in \cite{5Gloc_IEEE}. In particular, we consider the frequency range FR2 with carrier frequency $f_\mathrm{c}=28$ $\mathrm{GHz}$, a total bandwidth of $B = 400$ $\mathrm{MHz}$, a transmit power of $23$ $\mathrm{dBm}$, a noise power density of $-174$ $\mathrm{dBm/Hz}$ and a noise figure of $7$ $\mathrm{dB}$. The other system parameters are adjusted to match the narrowband \ac{RIS}-based near-field localization scenario considered in this work. Specifically, in the proposed scenario, localization is performed over a single $120$ $\mathrm{kHz}$ subcarrier band with a correspondent pilot symbol time $T_s = 8.3$ $\mathrm{\mu}$s. The transmitted pilot signal consists of $L = 100$ symbols, corresponding to a time of $\tau = 100\cdot T_s = 0.83$ $\mathrm{ms}$. To reduce the localization overhead, the pilot signal is transmitted periodically every $d\mathsf{t} \gg \tau$. Localization and power allocation are thus performed every $d\mathsf{t}$ seconds, while the \ac{RIS} optimization procedure is performed every $T_O = N_{r}\, d\mathsf{t}$ seconds. We assume that the total available power is uniformly distributed over the entire spectrum, i.e., a power $P_{\text{tx}} = 0.06$ $\mathrm{mW}$ for the transmission of the pilot signal is allocated. We also consider a simple Rice channel model for the channel \ac{RIS}-\ac{UE} (see \eqref{eq:cascadedch2}), i.e., we assume that the \ac{LOS} component is always present, and we consider an uncorrelated \ac{NLOS} component.\footnote{The first assumption is reasonable because in the near-field region the distance between \ac{RIS} and \ac{UE} is small and the LOS probability is close to 1 \cite{3GPPloc}. As for the second assumption, uncorrelated scattering is a reasonable model in the absence of well-established channel models to characterize the \ac{RIS}-\ac{UE} channel.} {For the simulations we set a Rice factor value $\kappa_b=5$} and $\alpha=0.5$. \begin{figure} \centering \centering \input{Fig1RIS_traj_TSP} \caption{Comparison between OPT-AO, FOCUS, and ROPT for a 3-second trajectory in terms of: (a) estimated trajectory, (b) received power.} \label{fig:1RIS_1Traj} \end{figure} \begin{figure*} \centering \centering \input{Figure_mappe_TSP} \caption{Distribution of reflected \ac{RIS} power in the scenario of Fig. \ref{fig:1RIS_1Traj} for the OPT-AO, FOCUS, and ROPT cases.} \label{fig:1RIS_1Traj_map} \end{figure*} The system geometry is sketched in Fig.~\ref{fig:scenario_sim}. The \ac{BS} is at a fixed position, namely at $\mathbf{p}_{\text{TX}}=\left[30,\, 15,\, 2 \right]\,\mathrm{m}$, and it has a \ac{URA} with $8 \times 2$ antennas in the $YZ$-plane. The \ac{UE} changes positions through time according with \eqref{eq:motionmodel}\footnote{The $z$ coordinate is kept fixed at $1\,\mathrm{m}$.} and it is equipped with a \ac{ULA} of four antennas, lying horizontally along the $Y$-axis and with a fixed and known orientation. For the motion of the \ac{UE}, to emulate a movement pattern compatible with a typical random pedestrian motion model, we set $\sigma^2_{\mathsf{a},\mathsf{x}}=\sigma^2_{\mathsf{a},\mathsf{y}}= 0.5\, \mathrm{m}^2/\mathrm{s}^3$, $\sigma^2_{\mathsf{a},\mathsf{z}}= 0 \, \mathrm{m}^2/\mathrm{s}^3$. In all simulations, it is assumed that the initial state of the node (i.e., its position and velocity) is known, i.e. $\mathbf{m}_0=\mathbf{s}_0$ and $\boldsymbol{\Sigma}_0=\mathbf{P}$. There are three \acp{RIS} in the environment located at $\left[0,\, 15,\, 3 \right]\,\mathrm{m}$,\, $\left[5,\, 0,\, 3 \right]\,\mathrm{m}$,\, $\left[10,\, 30,\, 3 \right]\,\mathrm{m}$, if not otherwise indicated. They consist of a \ac{URA} of $80 \times 5$ elements lying on the $YZ$-plane, i.e. they are mainly used in horizontal direction as long strips. In this way, the maximum dimension of the \ac{RIS} is nearly $40$ $\mathrm{cm}$ and the radiating near-field extends over about $32$ $\mathrm{m}$. \paragraph{Tracking Scenario} In Fig. \ref{fig:1RIS_1Traj}-(a), we consider a simplified scenario in which there is only the \ac{RIS} at position $(0,15)$ $\mathrm{m}$ and the terminal travel a 3-second trajectory starting at point $(3,15)$ with initial speed of $1$ $\mathrm{m/s}$ in the $y$ direction. The figure shows the actual node trajectory and the trajectories obtained considering \ac{RIS} optimization performed through the approaches OPT-AO, FOCUS, and ROPT. The \ac{RIS} is only optimized once at time $0$, while the location update is performed every $d\mathsf{t} = 0.03$ seconds, i.e., we have $100$ location updates. For this short trajectory, having a single \ac{RIS} is sufficient to achieve good localization performance especially when the OPT-AO scheme is considered. In contrast, the ROPT and FOCUS optimization leads to larger estimation errors. The reason for this behavior can be explained by analyzing Fig. \ref{fig:1RIS_1Traj}-(b), where the received power expressed in $\mathrm{dBW}$ is plotted as a function of the $y$ coordinate for the three systems under consideration. It is obvious that the FOCUS scheme maximizes the energy at the estimated point at time 0 (i.e., when the \ac{UE} is at $y=15\,$ $\mathrm{m}$), but it leads to a huge power penalty as long as the terminal moves from its starting point. On the other hand, the OPT-AO scheme allows the power to be balanced over the entire interval, while the ROPT method concentrates the energy on the central part of the uncertainty range and spares the outer edges. Although this may be optimal for obtaining the maximum average rate, as will be shown below, it is inconvenient for localization. In Fig. \ref{fig:1RIS_1Traj_map} we show the distribution of reflected \ac{RIS} power in the operational scenario of Fig. \ref{fig:1RIS_1Traj} for the cases OPT-AO, FOCUS, and ROPT, respectively. The value of the power at each point on the map is shown in false colors, with the color bar on the right indicating the power levels in $\mathrm{dBW}$. It can be seen that the OPT-AO approach provides a nearly uniform distribution of the received power over the uncertainty range, the FOCUS approach concentrates the power in a small area around the estimated endpoint $(3,15)$ $\mathrm{m}$, while the ROPT approach provides uniform distribution in a limited area with respect to OPT-AO. \paragraph{Simulation Results} In the following we report a comprehensive comparative simulation study considering the operating environment of Fig. \ref{fig:scenario_sim} with three \acp{RIS}. The \ac{UE} moves in a part of space with dimension $20$ $\mathrm{m}$ $\times$ $30$ $\mathrm{m}$ denoted as the range of motion (RM) corresponding to the yellow area in Fig. \ref{fig:scenario_sim}. Note that in the considered space we are always in the near-field region for all considered \acp{RIS}. The \ac{UE} is initially placed randomly and moves along a 12-second trajectory according to the motion model considered in this work. Statistics are collected for 1000 different simulations. Fig. \ref{fig:con_e_senza_beta} shows the empirical complementary \ac{CDF} of the localization error, indicating the probability (rate) that the localization error is above a threshold, for the cases FOCUS, $\beta$FOCUS, OPT, $\beta$OPT, OPT-AO, $\beta$OPT-AO and ROPT. The results are here obtained by considering a Rice factor $\kappa_b = 5$, $d\mathsf{t} = 0.03$ $\mathrm{s}$, and $N_{r} = 100$. First, we show that OPT-AO and $\beta$OPT-AO achieve the same performance as OPT and $\beta$OPT, confirming the validity of the approximation AO proposed in section \ref{RIsopt}. Moreover, the proposed approach OPT-AO significantly outperforms both FOCUS and ROPT, which confirms the validity of the proposed \ac{RIS} optimization for the localization procedure. Considering in particular 90\% \ac{CDF} (i.e., 10\% 1-\ac{CDF}), the results show that OPT-AO and $\beta$OPT-AO achieve an error below one meter. Regarding the mean localization errors (indicated in parentheses), we note that $\beta$OPT-AO has an average value of $33$ $\mathrm{cm}$, which increases to $53$ and $79$ $\mathrm{cm}$ for ROPT and $\beta$FOCUS, respectively. Finally, optimising $\beta$ can lead to some improvement in localization error performance, which is particularly evident for the case OPT-AO at high \ac{CDF} values (i.e., at low 1-\ac{CDF}). \begin{figure} \centering \input{1_cdf_TSP.tex} \caption{Empirical complementary \ac{CDF} of the localization error for different optimization approaches. In brackets, there are the mean values of the localization errors.} \label{fig:con_e_senza_beta} \end{figure} In Tab.~\ref{tab:rice_factors}, we provide the results for the case $\beta$OPT-AO for different values of the Rice factor $\kappa_b$. It can be seen that for the case shown in Fig. \ref{fig:con_e_senza_beta} ($\kappa_b = 5$), a slight performance degradation is observed compared to the LOS case ($\kappa_b = 100$). When the LOS component is further reduced, e.g., for $\kappa_b = 2$, the degradation increases as expected, although this does not affect the validity of the proposed approach. \begin{table} \begin{center} \makebox[\linewidth]{ \begin{tabular}{ |c|c|c|c| } \hline \rowcolor{silver} $\kappa_b$ & Mean value & 0.9 performance & 0.99 performance \\ \hline $\kappa_b=2$ &0.38 & 0.78 & 2.17 \\ \hline $\kappa_b=5$ & 0.33 & 0.69 & 1.92 \\ \hline $\kappa_b=100$ & 0.29 & 0.59 & 1.58 \\ \hline \end{tabular} } \end{center} \caption{Results for the case $\beta$OPT-AO for different values of the Rice factor $\kappa_b$ in terms of the localization error expressed in meters.} \label{tab:rice_factors} \end{table} In Fig. \ref{fig:different_Time_opt_histogram_error} the mean localization error (top) and the average achievable rate (bottom) for the algorithms $\beta$FOCUS, $\beta$OPT-AO and ROPT are shown for different $T_O$ values and for $d\mathsf{t} = 0.03$ $\mathrm{s}$. As expected, the localization error decreases with the decrease of $T_O$ for all methods considered, while $\beta$OPT-AO clearly outperforms the other methods in all cases. As for the rate, it is defined as the capacity in $\mathrm{bits/s/Hz}$ of the channel matrix $\mathbf{H}_{eq} = \sum_{k=1}^{K} \mathbf{B}_k \RISPARAM_{\risk} \mathbf{G}_k$ with noise variance $\sigma^2$, which can be determined by \ac{SVD} and waterfilling. \begin{figure}[t!] \centering \input{mean_error_Time_opt} \input{mean_rate_Time_opt} \caption{Mean localization error (top) and mean rate (bottom) for $\beta$FOCUS, $\beta$OPT-AO, and ROPT algorithms computed for different $T_O$ values and $d\mathsf{t}=0.03$ seconds.} \label{fig:different_Time_opt_histogram_error} \end{figure} Interestingly, it can be observed that the $\beta$OPT-AO approach, which is the best in terms of localization error, is the worst in terms of mean achievable rate. Moreover, the highest mean achievable rate is obtained by ROPT, as expected. This result shows that the optimal design of a system for communication is not necessarily optimal for localization and vice versa. \begin{figure} \centering \input{rates_TSP} \caption{Empirical pdf of the achievable average rate for $\beta$FOCUS, $\beta$OPT-AO, and ROPT.} \label{fig:hist_rate} \end{figure} In Fig. \ref{fig:hist_rate}, we give the empirical \ac{pdf} of the achievable rate for $\beta$FOCUS, $\beta$OPT-AO, and ROPT. It can be seen that the $\beta$FOCUS and $\beta$OPT-AO approaches, although better than $\beta$OPT-AO in terms of mean rate, have high probabilities of zero or quasi-zero rate, while $\beta$OPT-AO avoids such unpleasant situations. \begin{figure} \centering \input{mean_error_dt} \input{mean_rate_dt} \caption{Mean localization error (top) and mean rate (bottom) for $\beta$FOCUS, $\beta$OPT-AO, and ROPT algorithms computed for different $d\mathsf{t}$ values and $T_O=3$ seconds.} \label{fig:different_dt_histogram_rate} \end{figure} Finally, in Fig. \ref{fig:different_dt_histogram_rate}, the results for different $d\mathsf{t}$ values (in seconds) and for $T_O = 3\, \mathrm{s}$ are shown for the $\beta$FOCUS, $\beta$OPT-AO, and ROPT algorithms. As expected the mean localization error (top) decreases with the decrease of $d\mathsf{t}$ for all considered methods while the achievable rate (bottom) increases correspondingly. The opposite behavior is observed if $d\mathsf{t}$ increases. \section{Conclusions} \label{sec:conclusions} In this paper, we have proposed a novel framework to jointly design the reflection coefficients of multiple \acp{RIS} and the precoding strategy of a single \ac{BS}, with two different time scales, to optimize the tracking of a single multi-antenna \ac{UE} and keeping the overall system complexity affordable. The optimal derived \ac{RIS} and precoding strategy has been compared with focusing and rate maximization showing that \ac{RIS} optimization for communication is suboptimal when used for tracking purposes. Numerical results have shown the possibility of achieving 6G positioning requirements in a typical indoor environment with only one \ac{BS} and few \acp{RIS} at millimeter-waves. Simulation results have revealed that having multiple and bigger \acp{RIS} can lead to a significant increase of the tracking performance provided that are properly jointly optimized. \section*{Appendix A: Jacobian Computation} The first derivatives of the observation functions can be written as \begin{align}\label{eq:der1_v2} &\frac{\partial \mathbb{E}\left\{\Re\left\{\rho_{\risk; \rr} \right\} \right\}}{\partial \varsigma}= \nonumber\\ &\Re\left\{\bar{a}_{\risk; 2\rr}\right\} \frac{\partial \Re\left\{\bar{a}_{\risk; 2\rr+1}\right\} }{\partial \varsigma} + \Re\left\{\bar{a}_{\risk; 2\rr+1}\right\} \frac{\partial \Re\left\{\bar{a}_{\risk; 2\rr}\right\} }{\partial \varsigma} \nonumber\\ &+ \Im\left\{\bar{a}_{\risk; 2\rr}\right\} \frac{\partial \Im\left\{\bar{a}_{\risk; 2\rr+1}\right\} }{\partial \varsigma} + \Im\left\{\bar{a}_{\risk; 2\rr+1}\right\} \frac{\partial \Im\left\{\bar{a}_{\risk; 2\rr}\right\} }{\partial \varsigma}, \end{align} where $\varsigma \in \left\{x,\,y,\,z \right\}$ is a generic position coordinate. A similar calculation applies to the imaginary parts. According to the received signal, we have \begin{align} \label{eq:der3} \frac{\partial {\bar{a}_{\risk; \rx}}}{\partial \varsigma} & \approx \frac{1}{\lvert a_{k} \rvert} \frac{\partial {a}_{\risk; \rx} }{\partial \varsigma}, \end{align} where we assumed that the amplitude of the received signal changes slowly with respect to the phase and where \begin{align}\label{eq:der4} \frac{\partial {a}_{\risk; \rx} }{\partial \varsigma}= & - \jmath \frac{2\pi}{\lambda} \sqrt{\frac{\kappa_{b}}{\kappa_{b}+1}} \sum_{i=0}^{{N}_{\text{TX}}-1} f_{\tx,\risk} \sum_{p=0}^{P-1} \rho_{\risk;\rx,\riselem}\,\rho_{\risk;\riselem,\tx}\, \, \nonumber \\ &\times c_{\risk;\riselem} \, e^{- \jmath \frac{2\pi}{\lambda}\, d_{k; r,p,i} } \frac{\partial d_{k; r,p,i}}{\partial \varsigma}. \end{align} To simplify the notation $d_{k; r,p,i} \triangleq d_{\risk; \riselem, \tx} + d_{\risk; \rx, \riselem}$. From \eqref{eq:der4}, the derivatives of $\Re\left\{ {\bar{a}_{\risk; \rx}} \right\}$ and $\Im\left\{ {\bar{a}_{\risk; \rx}} \right\}$ can be easily derived by taking into account that \begin{align} &\frac{\partial d_{k; r,p,i}}{\partial x}=\frac{\partial d_{\risk; \rx, \riselem}}{\partial x} = \frac{x_{k, p}-x_{r}}{d_{\risk; \rx, \riselem}}, \\ &\frac{\partial d_{k; r,p,i}}{\partial y}=\frac{\partial d_{\risk; \rx, \riselem}}{\partial y}= \frac{y_{k, p}-y_{r}}{d_{\risk; \rx, \riselem}}, \\ &\frac{\partial d_{k; r,p,i}}{\partial z} =\frac{\partial d_{\risk; \rx, \riselem}}{\partial z}= \frac{z_{k, p}-z_{r}}{d_{\risk; \rx, \riselem}}, \end{align} and where we assume that the orientations of all devices are known. The derivatives with respect to the velocity are zeros, since the observations refer only to the position of \ac{UE}. Therefore, the velocity is derived using only the transition model and the latest position estimates (without measurement correction/update, which applies only to the position estimate). \section*{Appendix B: EKF Algorithm} The \ac{EKF} algorithm is reported in Alg. 0. \begin{algorithm}[h!] \SetAlgoLined \textbf{Initialization for $\mathsf{t}=0$}:\\ - Initialize the state $\mathbf{s}_0 \sim \mathcal{N}\left(\mathbf{s}_0; \mathbf{m}_{0}, {\boldsymbol{\Sigma}_{0}} \right)$; \\ - Initialize the transmission parameters $\boldsymbol{\vartheta}_{\risk}^{(1)}=(\risparam_{\risk}^{(1)}, \beta^{(1)}_k)$ for $k = 1,\ldots,K$; \\ - Set $\mathbf{m}_{1 \lvert 0}=\mathbf{m}_{0},\, \boldsymbol{\Sigma}_{1 \lvert 0}= {\boldsymbol{\Sigma}_{0}},\,\, \mathbf{h}_{1 \lvert 0}=h \left( \mathbf{m}_{1 \lvert 0} \right)$; \\ \For{$\mathsf{t}=1, \ldots, \mathsf{T}$}{ \textbf{Measurement update};\\ % - Collect a new measurement vector $\mathbf{o}_{\mathsf{t}}$; \\ - Compute the innovation: \\ $\mathbf{v}_{\mathsf{t}}=\mathbf{o}_{\mathsf{t}}-\mathbf{h}_{\tempo \lvert \tempom}$; \\ $\mathbf{S}_{\tempo \lvert \tempom}=\mathbf{J}_{\mathsf{t}}\boldsymbol{\Sigma}_{\mathsf{t} \lvert \mathsf{t-1}}\mathbf{J}_{\mathsf{t}}^{{T}} + \mathbf{R}_{\mathsf{t}}$; \\ - Compute the Kalman gain: \\ $\mathbf{K}_{\mathsf{t}}=\boldsymbol{\Sigma}_{\mathsf{t} \lvert \mathsf{t-1}} \mathbf{J}_{\mathsf{t}}^{{T}}\,\mathbf{S}_{\tempo \lvert \tempom}^{-1}$; \\ - Update the posterior state estimate and covariance: \\ $\mathbf{m}_{\mathsf{t} \lvert \mathsf{t}}=\mathbf{m}_{\mathsf{t} \lvert \mathsf{t-1}} + \mathbf{K}_{\mathsf{t}}\,\mathbf{v}_{\mathsf{t}}$;\\ $\boldsymbol{\Sigma}_{\mathsf{t}\rvert \mathsf{t}}=\boldsymbol{\Sigma}_{\mathsf{t} \lvert \mathsf{t-1}}-\mathbf{K}_{\mathsf{t}}\,\mathbf{S}_{\tempo \lvert \tempom}\,\mathbf{K}_{\mathsf{t}}^{{T}}$; \\ \textbf{State Estimation};\\ - Estimate the state: \\ $\hat{\mathbf{s}}_{\mathsf{t}}=\mathbf{m}_{\mathsf{t} \lvert \mathsf{t}}$; \\ \textbf{Time Update: State Prediction and RIS Optimization}; \\ - Predict the a-priori moments of the state based on the previous a-posteriori estimates; \\ $\mathbf{m}_{\tempop \lvert \tempo} = \mathbf{T} \, \mathbf{m}_{\mathsf{t} \lvert \mathsf{t}}$; \\ $\boldsymbol{\Sigma}_{\mathsf{t+1} \lvert \mathsf{t}} = \mathbf{T}\, \boldsymbol{\Sigma}_{\mathsf{t}\rvert \mathsf{t}} \, \mathbf{T}^{{T}} + \mathbf{P}$; \\ Evaluate $\mathbf{J}_{\mathsf{t+1}}$ and $\mathbf{h}_{\tempop \lvert \tempo} = h\left(\mathbf{m}_{\tempop \lvert \tempo} \right)$; \\ - Calculate $\boldsymbol{\vartheta}_{\risk}^{(\mathsf{t+1})}=(\risparam_{\risk}^{(\mathsf{t+1})}, \beta^{(\mathsf{t+1})}_k)$ for $k = 1,\ldots,K$ (see Alg. 1-2). \\ } \caption*{Extended Kalman Filter} \end{algorithm} \section*{Appendix C} In this Appendix we show how the problem expressed in \begin{equation}\label{eq:problem111} \begin{array}{c} \underset{\substack{{\boldsymbol{\vartheta}^{(\mathsf{t+1})}}}} {\min} ~~ \mathbb{E}_{\mathbf{s}_{\tempop}} \left\{\mathcal{E}\left({\boldsymbol{\vartheta}^{(\mathsf{t+1})}},\mathbf{s}_{\tempop}\right)\right\} \\%=\text{Tr} \left( \boldsymbol{\Sigma}_{\tempop \lvert \tempop} \right)\\ \text{s.t.} \quad {\boldsymbol{\vartheta}^{(\mathsf{t+1})}} \in {\mathcal{Q}} \end{array} \end{equation} can be recasted as % \begin{equation}\label{eq:problem1111} \begin{array}{c} \underset{\substack{{\boldsymbol{\vartheta}^{(\mathsf{t+1})}}}} {\min} ~~ \text{Tr} \left(\tilde{\mathbf{K}}_{\mathsf{t+1}} ~ \mathbb{E}_{\mathbf{p}_{\mathsf{t+1}}} \left\{\mathbf{R}_{\tempop}\left({\boldsymbol{\vartheta}^{(\mathsf{t+1})}},\mathbf{p}_{\mathsf{t+1}}\right)\right\} \tilde{\mathbf{K}}_{\mathsf{t+1}}^T \right)\\ \text{s.t.} \quad {{\boldsymbol{\vartheta}^{({\mathsf{t+1}})}}} \in {\mathcal{Q}} \, \end{array} \end{equation} By considering that the cost function can be written as \begin{align} \label{eq:costfunctionwy} &\mathcal{E}\left({\boldsymbol{\vartheta}^{(\mathsf{t+1})}},\mathbf{s}_{\tempop}\right) = \text{Tr} (\Delta\mathbf{s}_{\tempop}\Delta\mathbf{s}_{\tempop}^T \nonumber \\ & + \tilde{\mathbf{K}}_{\mathsf{t+1}} \left[ \mathbf{J}_{\tempop}\,\Delta\mathbf{s}_{\tempop}\Delta\mathbf{s}_{\tempop}^T\,\mathbf{J}_{\tempop}^T + \mathbf{R}_{\tempop}\right] \tilde{\mathbf{K}}_{\mathsf{t+1}}^T \nonumber \\ & - \tilde{\mathbf{K}}_{\mathsf{t+1}}\mathbf{J}_{\tempop} \Delta\mathbf{s}_{\tempop}\Delta\mathbf{s}_{\tempop}^T - \Delta\mathbf{s}_{\tempop}\Delta\mathbf{s}_{\tempop}^T \mathbf{J}_{\tempop}^T \tilde{\mathbf{K}}_{\mathsf{t+1}}^T ) , \end{align} where we have used the approximation ${\mathbf{K}}_{\mathsf{t+1}} \approx \tilde{\mathbf{K}}_{\mathsf{t+1}}$, we can apply the expectation as \begin{align} \label{eq:costfunctionwy_der} &\mathbb{E}_{\mathbf{s}_{\tempop}}\left\{\mathcal{E}\left({\boldsymbol{\vartheta}^{(\mathsf{t+1})}},\mathbf{s}_{\tempop}\right) \right\} =\text{Tr} ( \mathbb{E}_{\mathbf{s}_{\tempop}}\left\{\Delta\mathbf{s}_{\tempop}\Delta\mathbf{s}_{\tempop}^T \right\} \nonumber \\ & + \tilde{\mathbf{K}}_{\mathsf{t+1}} \left[ \mathbf{J}_{\tempop}\,\mathbb{E}_{\mathbf{s}_{\tempop}}\left\{\Delta\mathbf{s}_{\tempop}\Delta\mathbf{s}_{\tempop}^T \right\}\,\mathbf{J}_{\tempop}^T + \mathbb{E}_{\mathbf{s}_{\tempop}}\left\{\mathbf{R}_{\tempop} \right\}\right] \tilde{\mathbf{K}}_{\mathsf{t+1}}^T \nonumber \\ & - \tilde{\mathbf{K}}_{\mathsf{t+1}}\mathbf{J}_{\tempop} \mathbb{E}_{\mathbf{s}_{\tempop}}\left\{\Delta\mathbf{s}_{\tempop}\Delta\mathbf{s}_{\tempop}^T \right\} \nonumber \\ &- \mathbb{E}_{\mathbf{s}_{\tempop}}\left\{\Delta\mathbf{s}_{\tempop}\Delta\mathbf{s}_{\tempop}^T \right\}\mathbf{J}_{\tempop}^T \tilde{\mathbf{K}}_{\mathsf{t+1}}^T ) \nonumber \\ &=\text{Tr} ( \boldsymbol{\Sigma}_{\mathsf{t+1} \lvert \mathsf{t}} + \tilde{\mathbf{K}}_{\mathsf{t+1}} \left[ \mathbf{J}_{\tempop}\,\boldsymbol{\Sigma}_{\mathsf{t+1} \lvert \mathsf{t}}\,\mathbf{J}_{\tempop}^T + \mathbb{E}_{\mathbf{s}_{\tempop}}\left\{\mathbf{R}_{\tempop}\right\}\right] \tilde{\mathbf{K}}_{\mathsf{t+1}}^T \nonumber \\ & - \tilde{\mathbf{K}}_{\mathsf{t+1}}\mathbf{J}_{\tempop} \boldsymbol{\Sigma}_{\mathsf{t+1} \lvert \mathsf{t}}- \boldsymbol{\Sigma}_{\mathsf{t+1} \lvert \mathsf{t}}\mathbf{J}_{\tempop}^T \tilde{\mathbf{K}}_{\mathsf{t+1}}^T ). \end{align} In \eqref{eq:costfunctionwy_der} the only term that depends on $\boldsymbol{\vartheta}^{(\mathsf{t+1})}$ is $\mathbf{R}_{\tempop}$. Therefore we have \begin{align} \label{eq:costfunctionwy_der1} &\mathbb{E}_{\mathbf{s}_{\tempop}}\left\{\mathcal{E}\left({\boldsymbol{\vartheta}^{(\mathsf{t+1})}},\mathbf{s}_{\tempop}\right) \right\} = \text{Tr} ( \tilde{\mathbf{K}}_{\mathsf{t+1}} \, \mathbb{E}_{\mathbf{s}_{\tempop}}\left\{\mathbf{R}_{\tempop}\right\}\, \tilde{\mathbf{K}}_{\mathsf{t+1}}^T). \end{align} Finally it can be noted that $\mathbf{R}_{\tempop}$ only depends on the \ac{UE} position, hence $\mathbb{E}_{\mathbf{s}_{\tempop}}\left\{\mathbf{R}_{\tempop}\right\}=\mathbb{E}_{\mathbf{p}_{\mathsf{t+1}}}\left\{\mathbf{R}_{\tempop}\right\}$. \bibliographystyle{IEEEtran}
\section{Positive intersection product and differentiability of volume} \label{bfj-s} The Zariski-Riemann approach of \cite{bfj} fits very well indeed with the model theory of GVF's (indeed the description of quantifier-free types led us to the same formalism). Nevertheless we wish to remain for a while longer in the finite-dimensional setting, and will describe the main results of \cite{bfj} without this formalism. The positive intersection product here is the restriction of the one in \cite{bfj} to domain $N^1(X)$ and range $N_1(X)$; moreover we consider only the $n-1$'st power, where $n=\dim(X)$. \ssec{Definition of $\psi$, the $n-1$'st positive intersection power} For $x \in N^1_+(X)^o$, define: \[ A^{nef}(x) = \{(f,X',y): f: X' \to X \hbox { birational}, y \in N^1(X') \hbox{ a nef $\Qq$-Cartier divisor }, y \leq f^*(x) \}\] \[ W_x = \{ f_* y^{n-1}: (f,X',y) \in A^{nef}(x) \} \] $W_x$ is precompact. To see this pick an ample $a \geq x$. Also pick ample divisors $b_j$ such that $x \mapsto (x \cdot b_1,\ldots,x \cdot b_m)$ is an isomorphism $N_1(X) \to \Rr^m$. Any nef $y \leq f^*(x)$ satisfies $y \leq f^*(a)$, $y^{n-1} \leq f^*(a)^{n-1}$, and $f_* y^{n-1} \cdot b_i \leq a^{n-1} \cdot b_i$. (We used \lemref{monotone}.) Thus the image of $W_x$ is bounded. Secondly, $W_x$ is {\em directed} with respect to the partial ordering of $N_1(X)$ given by the closed cone generated by classes of curves on $X$. In fact $A^{nef}(x)$ is directed, in the following sense: if $y_1,y_2$ are nef $\Qq$-Cartier divisors below $f^*(x)$, let $D'$ represent $f^*(x)$; and represent $y_1,y_2$ by $\Qq$-Cartier divisors below $D'$. By pulling back to a further blowup we may assume their stable join $y$ exists. Then $y \leq D'$, and by \lemref{amalg-ggnef}, $y$ is nef. Thus we can define $\psi: N^1_+(X)^o \to N_1(X)$ by: \[ \psi(x) = \sup W_x \] \begin{rems} \begin{enumerate} \item The definition of $\psi$ would not change if in the definition of $W_x$ we replaced {\em nef} by {\em semi-free} or by {\em ample}. Indeed, since $x$ has positive volume, by \thmref{fujita1} some $y_0 \in A^{nef}(x)$ has positive volume. Whenever $(f,X',y) \in A^{nef}(x)$ lies above $y_0$, it has positive volume, and so can be approximated by an ample divisor, as any big, nef divisor is approximated by smaller amples by \lemref{freeample} . \end{enumerate}\end{rems} \ \ssec{A second definition} \label{naive} We also give a definition that does not require blowing up, and instead uses a naive intersection theory on $X$; compare \cite{lazarsfeld}, 11.4.10, 11.4.1, where the $n$-fold intersection is treated. We have not yet defined $N^k(X)$ for $k$ other than $1,n-1$. For our purposes we could easily do so by numerical equivalence {\em against $k$ divisors} (a definition that differs from the classical one when $X$ is smooth, but does not really lose information when in the construction below). At any rate, we will use this material only for $k=\dim(X)-1$. Let $D$ be an effective Cartier divisor, with at least one nonzero section. Let $k$ be an integer. Let $X'$ be a Zariski open subset of $X$. Let $f_1,\ldots,f_{k}$ be $k$ mutually generic sections of $L(X,D)$, let $Z$ be their common zero set {\em on $X'$}, viewed as a subscheme of $X'$; let $[Z]$ be the sum of components of $Z$ of codimension $k$, counted with multiplicity. Each irreducible subvariety of $X'$ appearing in $[Z]$ can be identified with its Zariski closure in $X$, so we can also view $[Z]$ as a cycle in $N^k(X)$; denote $\nint{D;X'}^k = [Z]$. \claim{} For some $z \in N^k(X)$, for all Zariski open $X' $ disjoint from the support of $D$, we have $\nint{D;X'}^k = z$. \begin{proof} Let $B_D$ be the base locus of $D$: the set of points at which every section of $D$ vanishes. Let $W$ be a subvariety of $X$. If $W$ is not contained in $B_{D}$, then a generic section $f$ of $L(X,D)$ does not vanish on $W$, so cutting $W$ with the zero set of $f$ reduces dimension. It follows that as soon as $X' \cap B_D = \emptyset$, all components of $Z$ have codimension at least $k$. Similarly if we replace $X'$ by $X''=X' \smallsetminus W$, where $W$ is some hypersurface of $X$, then for generically chosen $f_1,\ldots,f_k$, the intersection of $W$ with the zero sets of the $f_i$ has codimension at least $k+1$; no $k$-dimensional component of $Z$ will be contained in $W$; thus $\nint{D;X'} ^k = \nint{D;X''} ^k$. \end{proof} We can now define $\nint{D}^k_{naive} $ to be equal to $\nint{D;X'} ^k$, for any sufficiently small open $X' \subset X$. We will assume in particular (the base field being perfect) that $X'$ is smooth, i.e. disjoint from the singular locus of $X$. Note also that if $g_1,\ldots,g_k \in L(X,D)$ have common zero set $Z'$ on $X'$ of codimension $k$, then $[Z'] \leq [Z] = \nint{D;X'}^k$ (the inequality holds with respect to the effective cone in $N^k(X)$). In other words the generic choice of sections maximizes the intersection on $X'$. The reason is that $(f_1,\ldots,f_k)$ specializes to $(g_1,\ldots,g_k)$; by smoothness of $X'$, every component of $Z'$ is the specialization of some component of $Z$, and is covered with appropriate multiplicity. Some components of $Z$ may specialize into $X \smallsetminus X'$ and not be counted in $Z'$; but at any rate we have the inequality. We may summarize this symbolically in the formula: \[ \nint{D}^k_{naive} = \inf_{X'} \sup_{f_1,\ldots,f_k \in L(D)} [Z_{X'}(f_1) \cap \cdots \cap Z_{X'}(f_k)]_{n-k} \] If $D \leq D'$, let us compare $\nint{D}_{naive}^k $ with $ \nint{D'}_{naive}^k$. We have $L(X,D) \leq L(X,D')$ Choose a sufficiently small open $X'$, and generic $f_1,\ldots,f_k \in L(X,D)$ and $g_1,\ldots,g_k \in L(X,D')$. Then by the above specialization argument, the generic choice in $D'$ gives a bigger or equal result. Thus $\nint{D;X'}_{naive}^k \leq \nint{D';X'}_{naive}^k $, and \[ \nint{D}_{naive}^k \leq \nint{D'}_{naive}^k \] Next we compare $\nint{D}_{naive}^k$ to $\nint{l D}_{naive}^k$. Again choose a sufficiently small open $X'$, and generic $f_1,\ldots,f_k \in L(X,D)$ and $g_1,\ldots,g_k \in L(X,lD)$. Then $(g_1,\ldots,g_{k})$ specializes to $(f_1^l,\ldots,f_{k}^l)$. By the linearity of intersection with Cartier divisors, $\cap Z_{X'}(f_i^l) = l^k \cap Z_{X'} (f_i)$. Hence it follows as above that $l^n \nint{D;X'}_{naive}^k \leq \nint{l D; X'}_{naive}^k$ and so \[ l^k \nint{D}_{naive}^k \leq \nint{l D}_{naive}^k \] Finally we define \[ \nint{D}^k = \limsup_m \frac{1}{m^k} \nint{m D} _{naive}^k \] (in fact it follows easily from the above that this is also the $\liminf$ and hence the limit.) Clearly $\nint{l D}^k = l^k \nint{D}$. Observe, directly from this definition: \begin{prop} \label{sectionsonly} $\nint{ D}^k$ depends on $D$ only via the section spaces $(L(mD):m \in \Nn)$. \end{prop} In the following lemma, we show equality of the $1$-cycles $\nint{D}^{n-1} $ and $ \psi(D)$ on $X$. For our purposes, this can be understood numerically, i.e. $ \psi(D) \cdot A = \nint{D}^{n-1} \cdot A$ for all divisors $A$, equivalently for all very ample divisors $A$. The proof will use inequalities with respect to the pseudo-effective cone of curves; equivalently, $u \leq v$ iff $u \cdot A \leq v \cdot A$ for all very ample $A$, since the dual of the ample cone of divisors is the pseudo-effective cone of curves. \begin{lem} Let $D$ be a big Cartier divisor. Then $\nint{D}^{n-1} = \psi(D)$. \end{lem} \begin{proof} We first show that $\nint{D}^{n-1} \leq \psi(D)$. Since $\psi$ is homogeneous, it suffices to show that $\nint{D}^{(n-1)}_{naive} \leq \psi(D)$. (This for all $lD$ implies the claim, by taking limits.) Let $X'$ be small enough to compute $\nint{D}^{n-1}_{naive}$, as in the Claim. Let $f_1,\ldots,f_{{(n-1)}}$ be ${(n-1)}$ mutually generic sections of $L(X,D)$. By \lemref{fujita-lem} there exists a blow-up $\pi: X' \to X$ and a free divisor $D'$ on $X'$ with $D' \leq \pi ^*D$, such that each $f_i'= f_i \circ \pi $ is a section of $D'$; moreover by the proof, such that the zero locus $(f_i)^+$ of $f_i'$ is nef. So for any very ample $A$ \[ \nint{D}^{(n-1)}_{naive} \cdot A = \nint{D;X'}^{(n-1)} \cdot A \leq (f_1)^+ \cdot \ldots \cdot (f_{(n-1)})^+ \cdot \pi^* A \leq (D')^{n-1}\cdot \pi^*A \leq \psi(D) \cdot A \] (As $(f_i)^+$ and $D'$ are nef, and $(f_i)^+ \leq D'$.) Conversely for any blow-up $\pi: {\tX} \to X$ and ample $\Qq$-Cartier divisor $B \leq \pi^*D$, we have to show that \[ \pi_*(B^{n-1}) \leq \nint{D}^{n-1} = \limsup_m \frac{1}{m^n} \nint{m D} _{naive}^{n-1} \] It suffices to show for some $m$ that \[\pi_*(B^{n-1}) \leq \frac{1}{m^n} \nint{m D} _{naive}^{n-1} \] Multiplying $B$ and $D$ by a large integer, we may assume $B$ is a very ample Cartier divisor (and then prove the last inequality with $m=1$.) Note that (as $X$ is normal) $L(X,D) = L(\tX,\pi^*(D) ) \supseteq L(X,B)$. Let $f_1,\ldots,f_{n-1}$ be sufficiently generic global sections of $B$. Let $Z_i$ be the zeroes of $f_i$, viewed as a divisor on $\tX$. Let $e$ be the blowing-up locuas of $\pi$, and $E = \pi^{-1}(e)$; so $\pi$ restricts to an isomorphism $\tX \smallsetminus E \to X \smallsetminus e$. Then $E$ has codimension at least $1$ on $\tX$; as $B$ is very ample, $E \cap \cap_{i=1}^{n-1} Z_i $ is finite. Hence, $\pi_*( \cap_{i=1}^{n-1} Z_i)$ as a $1$-cycle has no components contained in $e$. Viewing the $f_i$ now as elements of $L(X,D)$, denoting their zeroes by $Z_i^+$, we see that no component of their intersection will be contained in $e$ (as all components are $1$-dimensional), and so $\pi_*( \cap_{i=1}^{n-1} Z_i) = \cap_i Z_i^+$. As we saw above, the intersection of the zero sets on $X$ of generic $g_1,\ldots,g_{n-1} \in L(D)$ can onlty be bigger. This proves the required inequality. \end{proof} \begin{lem} \label{psicont} $\psi$ is homogeneous of degree $n-1$, monotone and continuous on $N^1_+(X)^o$. \end{lem} \begin{proof} Monotonicity is immediate from the definition of $\psi$, and homogeneity is also easy. Now any function $v$, monotone with respect to the ordering of a cone $E$, and homogeneous of degree $d \geq 1$, must be continuous on the interior of $E$. For let $e \in E^o$ and $\varepsilon>0$. Then $\varepsilon a \in E^0$, so there exists a symmetric neighborhood $N=N_\varepsilon$ of $0$ with $\varepsilon a + N \subset E^0$, hence $\varepsilon a \geq N$. Thus $(1+\varepsilon) a \geq a+N \geq (1-\varepsilon)a$ so by homogeneity $(1+\varepsilon)^d f(a) \geq f(a+N) \geq (1-\varepsilon)^d f(a)$; hence for any linear functional $L$ with $L(E) \geq 0$ we have $(1+\varepsilon)^d Lf(a) \geq Lf(a+N) \geq (1-\varepsilon)^d Lf(a)$; letting $\varepsilon \to 0$ we see that $Lf$ is continuous at $a$. As such $L$'s span the dual space, $f$ is continuous. \end{proof} Here is the main theorem of \cite{bfj}. \begin{thm} \label{bfj1} The volume function $\vol$ is differentiable on the big cone of $N^1(X)$; and $d \vol = n \psi$. \end{thm} Here we use the identification $N_1 = N^1(X)^*$ given by the intersection pairing. Explicitly, if $\alpha \in N^1(X)$ is big and $\gamma \in N^1(X)$ is arbitrary, the statement is that \[ \frac{d}{dt} |_{t=0} \vol(\alpha + t \gamma) = n \psi(\alpha) \cdot \gamma \] \begin{proof} Fix an ample $\omega$ such that $\alpha \leq \omega$ and $\omega \pm \gamma $ is ample. Consider birational morphisms $f: X' \to X$; let $\omega' = f^* \omega$, $\alpha' = f^* \alpha$, $\gamma' = f^* \gamma$. Note that $\omega'$ and $\omega' \pm \gamma'$ remain nef. Recall \corref{15cor}: if $\beta \in N^1(X')$ is nef, for any $t \in [-1,1]$ we have $ \vol(\beta+t \gamma') \geq \beta^n + n t \beta^{n-1} \cdot \gamma' - 8^n \omega^n t^2$. When $\beta \leq \alpha'$ it follows that $\vol(\alpha'+t \gamma') \geq \beta^n + n t \beta^{n-1} \cdot \gamma' - 8^n \omega^n t^2 $. Taking the supremum over all $X'$ and all nef $\beta \leq \alpha'$, we find, using \thmref{fujita1} and the definition of $\psi$: \[ \vol(\alpha+t\gamma) \geq \vol(\alpha) + n t \psi(\alpha) \cdot \gamma - 8^n \omega^n t^2 \] \, Applying this to $\alpha^* = \alpha+ t \gamma$ ($t$ small enough so that this is still big), $\gamma^* = -\gamma$, so $\alpha= \alpha^* + t \gamma^*$, \[ \vol (\alpha) \geq \vol(\alpha + t \gamma) - n t \psi (\alpha^*) \cdot \gamma - 8^n \omega^n t^2 \] As $\psi$ is continuous at $\alpha$, this implies that $\frac{\vol(\alpha+t\gamma)-\vol(\alpha)}{t}$ is bounded on both sides by functions that approach $n \psi(\alpha)$ as $t \to 0$. \end{proof} Let $N_1^+(X)$ be the closed dual cone to $N^1_+(X)$; thus $ c \in N_1^+(X)$ iff for every effective $e \in N^1(X)$ we have $c \cdot e \geq 0$. \begin{defn}\label{movable-def} A class $c \in N_1(X)$ is called {\em movable} if for any hypersurface $H \subset X$, there exists an irreducible curve $C$ not lying on $H$, and some $\alpha >0$ with $c = \alpha [C]$. Call a class in $N_1(X)$ `strongly movable' if it is a pushforward, of the intersection product of $n-1$ ample rational classes in some blowup of $X$; if these are the same ample class, call it `very strongly movable'. In either case, note that such a class is a positive scalar multiple of the class of a curve, a complete intersection of very ample divisors. \end{defn} \begin{thm} \label{surj} Let $\dim(X)=n >1$. Then \[ N_1^+(X)^o \subseteq \psi(N^1_+(X)^o) \subseteq N_1^+(X) \] \end{thm} \begin{proof} By definition of $\psi$ as a positive intersection product, any element of $\psi(N^1_+(X)^o) $ is the supremum of a family of very strongly movable classes, and in particular the limit of a sequence of such classes. Now if $a$ is ample in $X'$ and $f: X' \to X$ is a birational morphism, then for any effective $e$ on $X$ we have $f_*(a^{n-1}) \cdot e = a^{n-1} \cdot f^*(e) \geq 0$. Thus any very strongly movable class lies in $N_1^+(X)$ and so $\psi(N^1_+(X)^o) \subseteq N_1^+(X)$. To show the inclusion $N_1^+(X)^o \subseteq \psi(N^1_+(X)^o)$ we verify the conditions of \thmref{convexity}, with $U=N^1_+(X)^o$ the big cone, $\phi(x)=\vol(x)^{1/n}$, $F=\vol^{-\frac{n-1}{n}} \psi$, $C=N_1^+(X)$. The volume function is continuous and non-negative and hence so is $\phi$. The concavity (1) follows from \corref{logconcavevolume} (or from the nef case along with \thmref{fujita1}, by continuity). The positive homogeneity (2) is clear, and (3) comes from the definition of the big cone. Note that $\Rr^{\geq 1} F(U) \subseteq \Rr^{>0} \psi(U) = \psi(U)$ (this last equality, by the $n-1$-positive homogeneity of $\psi$). By \corref{convexity-c}, $N_1^+(X)^o \subseteq \psi(U)$. \end{proof} \begin{cor} \cite{bdpp} \label{bdpp} The dual of the pseudo-effective cone, $N_1^+(X)$, is the closed convex cone generated by the (very) strongly movable classes, or by all movable classes. \end{cor} For our purposes it is important to know that the image of $\psi$ is dense, without taking convex closure. \begin{cor} \label{eclem} Let $c \in N_1^+(X)$. Then $c$ can be approximated by (very strongly) movable classes. \end{cor} Indeed $[C]$ can be taken to have the form $f_*(D_1 \cap \cdots \cap D_{n-1})$ where $D_i$ are Bertini / Weil representatives of an ample class on $X'$, $f: X' \to X $ birational. \begin{question} Is any $\Qq$-Cartier divisor in $N_1^+(X)^o$ movable? \end{question} \begin{rems} \label{1.13} \begin{enumerate} \item $ {\psi}$ is injective on $Nef^1(X) \cap N^1_+(X)^o$. \item If $x,y \in Nef^1(X) \cap N^1_+(X)^o$ and ${\psi}(x),{\psi}(y)$ are proportional then so are $x,y$. \item ${\psi}$ is a homeomorphism on the ample cone, and continuous on the nef cone. \end{enumerate} \end{rems} \begin{proof} (1,2) $ \vol^{1/n} $ is strictly concave on $Nef^1(X) \cap N^1_+(X)^o$ by \cite{bfj} Corollary E. Hence $ \log \vol $ is also strictly concave there. By \lemref{convexity1}, the differential $-n \vol ^{-1} {\psi}$ is therefore strictly increasing, and hence injective. If ${\psi}(x),{\psi}(y)$ are proportional, say ${\psi}(x)=c {\psi}(y)$. Note $c>0$ since $N_1^+(X)^o$ is a strict cone. Let $x' = \lambda x$ with $\lambda = c \vol(y) / \vol(x)$. Then $\vol(x') ^{-1} {\psi}(x') = \lambda^{-1} \vol(x) ^{-1} {\psi}(x) = \vol(y) ^{-1} {\psi}(y)$. By injectivity of $\vol^{-1} {\psi}$ we have $y = \lambda x$. In case $c=1$, by homogeneity of ${\psi}$ we have $\lambda^{n-1}=1$ so $\lambda =1 $, and $x=y$. (3) In fact $\psi$ is polynomial on the nef cone, and injective on the ample cone (by (1)). \end{proof} \end{section} \begin{section}{Quantifier-free types over a one-dimensional base} \label{qft-s} We will work over a constant field $k=k^{alg}$, and describe the quantifier-free GVF types over $k$ geometrically. We will see later how to deduce a description of types over the non-constant GVF $k(t)^{alg}$. When $X=Spec A$ is affine, the Berkovich space of $X$ over $k$ can be defined as the set of all $\Rr$-valued semi-valuations of $A$; these are just the $\Rr$-valued valuations of the fraction field of $A/P$, for any prime ideal $P$ of $A$. The topology on ${\widehat{X}}$ is induced from the Tychonoff topology on the functions from $K $to $\Rr \cup \{\infty\}$. For general $X$, the Berkovich space ${\widehat{X}}$ can be defined by glueing over an affine covering. Let $X$ be an irreducible, normal projective variety over $k$, $K=k(X)$. Then ${\widehat{X}}$ is compact. Let ${\widehat{K}}$ be the space of $\Rr$-valued valuations of $K/k$. So ${\widehat{K}}= {\widehat{X}} \smallsetminus \cup_{Y} \widehat{Y}$, the union ranging over proper subvarieties of $X$. We define a pairing $\beta: {\widehat{X}} \times Pic(X) \to \Rr_\infty $ as follows: given $v \in hX$ and a Cartier divisor $D$ pick a Zariski open set $U$ of $X$ such that $\Oo_X(U) \subset \Oo_v$ and $D$ is represented on $U$ by $f \in K$; and let $\beta(v,f) = v(f)$. It is easy to check that this is well-defined and linear in the $Pic(X)$- coordinate. We also have $\beta(v,(f)) = v(f)$ where $(f)$ is the principal Cartier divisor represented everywhere by $f$. This restricts to $\beta: {\widehat{K}} \times Pic(X) \to \Rr $ Extend it to an $\Rr$-linear map \[ \beta: {\widehat{K}} \times Pic_\Rr(X) \to \Rr \] Let $\Ii_X$ be the set of birational morphisms $\pi: Y \to X$ (over $k$). Given $\pi,\pi'$ there exists at most one $j_{Y',Y}: Y' \to Y$ with $\pi' = \pi \circ f$; in this case write $\pi \leq \pi'$; we obtain a directed partially ordered set. Let $\widehat{Pic} (K)$ be the direct limit of $Pic_\Rr(Y)$ over $\Ii_X$. By going to the limit we obtain: \[ \beta: {\widehat{K}} \times \widehat{Pic}_\Rr (K) \to \Rr \] Finally, let $C({\widehat{K}})$ be the space of continuous functions ${\widehat{K}} \to \Rr$, and define $\beta_*: Pic_\Rr(K) \to C({\widehat{K}})$ by ${\beta_*}(D)(v)=\beta(v,D)$. \begin{lem}\label{1100} The image $\beta_*(Pic_\Rr(K))$ separates points on ${\widehat{K}}$, and is closed under addition, scalar multiplication and $\min$. It separates points on ${\widehat{K}}$. \end{lem} \begin{proof} Closure under addition and scalar multiplication follows from linearity of $\beta$ in the second variable. Let $v \neq v' \in {\widehat{X}}$. Then $v(f) \neq v'(f)$ for some $f \in K$. So $\beta(v,(f)) \neq \beta(v',(f))$ for the associated principal divisor $(f)$. Thus $\beta_*$ separates points. Closure under $\min$ follows from the existence of stable meets, in an appropriate blowup. By adding a large ample divisor, it suffices to prove this for two effective divisors; we can assume they come from divisors $W_1,W_2$ on a blowup $Y$ of $X$, with ideal sheaves $I_1,I_2$. Further by blowing up $I_1+I_2$ we may assume it is principal, and hence determines a Cartier divisor $W$. In this case, it is easy to see that $\beta_*(W) = \min \beta_*(W_1),\beta_*(W_2)$, as required. \end{proof} If $Z \subset {\widehat{X}}$ is compact, let $C(Z)$ be the space of continuous functions $Z \to \Rr$, and define $\beta_Z $ to be the composition of $\beta_*$ with the restriction function $C({\widehat{K}}) \to C(Z)$. We endow $C(Z)$ with the topology of uniform convergence. \begin{lem} \label{110} Let $Z \subset {\widehat{K}}$ be compact, and assume $v(f_0)=1$ for some $f_0$ and for all $v \in Z$. Then $\beta_{Z}(Pic_\Rr(K))$ is dense in $C(Z)$. \end{lem} \begin{proof} By \lemref{stonew}, it suffices to show that the image of $\beta_Z$ separates points on $Z$, and is closed under addition, scalar multiplication and $\min$, as well as containing the constant function $1$. The constant function $1$ is provided by $v(f_0)$. The rest was proved in \lemref{1100}. \end{proof} \begin{rem} \rm We can similarly define $\beta: {\widehat{X}} \times Pic_\Rr(K) \to \Rr_\infty$, and hence $\beta_* :Pic_\Rr(K) \to C({\widehat{X}}, \Rr_\infty)$. Let $Z \subset {\widehat{X}}$ be compact, and $\beta_Z(y) =\beta_*(y)|Z$. Let $B=\beta_* (Pic_\Rr(K)) \cap C(Z)$, be the set of functions of the form $\beta_*(y) |Z$ that take only finite real values, and $\bar{B}$ the uniform closure of $B$. Then $\bar{B}=C(Z)$, provided that $1 \in \bar{B}$. The proof is the same as of \ref{110}. For separation of points, if $z \neq z' \in Z$, we find $y \in Pic_\Rr(K)$ as above with $\beta(z,y) \neq \beta(z',y)$, then replace $y$ by $\max(-r,\min(\beta(y,r)))$ where $-r \leq \beta(z,y),\beta(z',y) \leq r$. \end{rem} Let $M_K$ be the set of regular Borel measures $\mu$ on ${\widehat{K}}$, such that for any $f \in K$, $v \mapsto v(f)$ is integrable. It follows that for any $D \in \widehat{Pic} (K)$, $v \mapsto \beta(v,D)$ is $\mu$ integrable. Thus we can naturally extend $\beta$ to a map \[ \beta: M_K \times \widehat{Pic} (K) \to \Rr \] \begin{cor} \label{11} Let $\mu, \mu' \in M_K$ and suppose they define different GVF structures on $K$, i.e. $\mu,\mu'$ are distinct even up to renormalization. Then for some $D \in \widehat{Pic} (K)$, $\beta(\mu,D) \neq \beta(\mu',D)$. \end{cor} \begin{proof} We may assume $k$ is countable \footnote{For this we use the equivalence of GVF structures and globalizing measures up to renormalization}. We have ${\widehat{K}} \smallsetminus \{v_{triv}\} = \cup_{f \in K \smallsetminus (0)} W_f$ where $W_f=\{v: v(f)>0\}$. Thus for some $f$, the measures $\mu,\mu'$ are distinct (even up to normalization) when restricted to $W=\{v: v(f)>0\}$. By renormalizing we may assume $\mu,\mu'$ concentrate on $ \{v: v(f)=1\}$. Moreover these are regular measures, approximated by their values on compact sets, hence $\mu,\mu'$ have distinct restrictions to some compact $Z \subset \{v: v(f)=1\}$. Now the statement follows from \lemref{110} (with $f_0=f$). \end{proof} \begin{prop} Let $\mu \in M_K$ satisfy the product formula: \[ \hbox{for all } f \in K \smallsetminus (0), \ \ \int v(f) d\mu(v) = 0 \] Then $\beta(\mu, \ ): Pic_\Rr(Y) \to \Rr$ factors through the quotient map $Pic_\Rr(Y) \to NS(Y)$. \end{prop} \begin{proof} We have a normal, irreducible variety $Y$, and a homomorphism $\xi=\beta(\mu,\ ): Pic(Y) \to \Rr$. Let $H$ be an ample divisor on $Y$. Let $Pic^0(Y)$ be the group of divisors algebraically equivalent to $0$. It is known (\cite{kleiman}, Proposition 5.3 or Theorem 5.4, and Proposition 5.10) that $Pic^0(Y)$ is an algebraic variety, in particular constructible. For any $a \in Pic^0(Y)$, (as for any element of $Pic(Y)$), for large enough $m$, the line bundle corresponding to $mH - a$ has a nonzero section. So $-a+mH \geq 0$. Since $Pic^0(Y)$ is constructible, by compactness, there exists $m$ such that for all $a \in Pic^0(Y)$, $-a+mH \geq 0$. So $\xi(a) \leq m \xi(H)$. Thus $\xi | Pic^0(Y)$ is a homomorphism into $\Rr$ with bounded image; so it must be zero. Since $\Rr$ is torsion-free, if $mb \in Pic^0(Y)$ then $\xi(b)=0$. Hence $\xi$ vanishes on the divisors that have integral multiples algebraically equivalent to zero. But by \cite{kleiman}, Theorem 6.3, these are the same as the divisors numerically equivalent to $0$. So $\xi$ induces a homomorphism $NS(Y)_\Rr \to \Rr$. and factors through that homomorphism.\end{proof} Note that the homomorphism $\beta_\mu: Pic_\Rr(Y) \to \Rr$ obtained above is order-preserving with respect to the effective cone; i.e. an effective divisor has non-negative image. This is because by definition, $\beta(v,D)=v(g) \geq 0$ where $D$ is represented by $(g)$ on some affine open set $Y'$ with $\Oo_{Y'} \subset \Oo_v$, and as $D$ is effective, $g \in \Oo_{Y'}$ so $v(g)\geq0$. Taking into account that $\mu$ is a non-negative measure, the induced homomorphism $NS(Y)_\Rr \to \Rr$ is order-preserving with respect to the to the pseudo-effective cone. Let $S_K$ be the space of GVF structures on $K$ that are trivial on $k$; it can be viewed as the space of quantifier-free GVF types whose restriction to ACF is the generic type of $X$. If we pick any transcendence basis $f_1,\ldots,f_n$ for $K$ over $k$, and $r \in \Rr$, then the subspace of types with $ht(f_i) \leq r$ is compact. Each element $p$ of $S_K$ is induced by a measure $\mu \in M_K$ satisfying the product formula: this can be proved using a homogeneous variant of the Riesz representation theorem, but will also follow from the proof of \thmref{qft} below. It is clear that $\beta(\mu,D)$ depends only on $p$ and not on the choice of $\mu$; for instance this may be checked for very ample $D$, with a section $f$, so $\beta(\mu,D)=\int \min(v(f),0) d\mu(v)$. We thus write $\beta(p,D)$ for $\beta(\mu,D)$. Let $N^1(K)$ be the direct limit of the $\Rr$-spaces $N^1(Y)$ along $\Ii_X$; let $N_1(K)$ be the dual space, the inverse limit of the spaces $N_1(Y)$. (Cf. \cite{bfj}.) Note that when $j: Y' \to Y$ is birational, $j^* N_1^+(Y) \subset N_1^+(Y')$. Let $N_1^+(K)$ be the inverse limit of the cones $N_1(Y)^+$, dual to the effective cones of $N^1(Y)$. We define a map $\alpha: S_K \to N_1^+(K)$ via the pairing $\beta: S_K \times N^1(K)\to \Rr $. So $\alpha = \lim \alpha_Y$ where $Y$ is similarly defined via $\beta: S_Y \times N^1(Y) \to \Rr$, with $Y $ a birational extension of $X$. \begin{thm}\label{qft} $\alpha: S_K \to N_1^+(K)$ is a homeomorphism. \end{thm} \begin{proof} Injectivity: Let $p,p'$ be distinct elements of $S_K$. They are represented by measures $\mu,\mu'$ that are distinct even up to renormalization. By \lemref{11}, for some $D$ we have $\beta(\mu,D) \neq \beta(\mu',D)$. Thus $\alpha(p) \neq \alpha(p')$. Continuity: It suffices to prove that $\alpha: S_K \to N_1(Y)$ is continuous. Now the topology on $N_1(Y)$ is generated by $O_{\beta,\gamma,D} = \{a: \beta < |a \cdot D | < \gamma\}$, where $\beta,\gamma$ are reals and $D$ is a very ample divisor on $Y$. Let $s_1,\ldots,s_n$ be global sections of $D$. Then $\alpha ^{-1} (O_{\beta,\gamma,D} ) $ is cut out by $\beta < ht(s_1,\ldots,s_n) < \gamma$. A closed map: Let $f_1,\ldots,f_n$ be a transcendence basis for $K/k$; let $A$ be an ample divisor, such that each $f_i$ has poles at most on $A$. Let $D_i$ be the divisor of poles of $f_i$. Let $C$ be a closed subset of $S_X$. For $t >0$ let $R_t =\{b \in N_1^+(K): (b,D_i) \leq t\}$. Then $R_t$ is contained in the interior of $R_{t'}$ for $t<t'$, and $\cup_t R_t = N_1^+(K)$. Thus to show that a set is closed, it suffices to show that the intersection with each $R_t$ is closed. As $\alpha ^{-1}(R_t)$ is closed, to show that $\alpha$ is a closed map, it suffices to show that $\alpha(C)$ is closed when $C$ is a closed subset of $\alpha ^{-1} R_t $ for some $t$. But such a set is compact as $ht(f_i)$ is bounded on it. In particular, the image of $\alpha$ is closed. Hence to show that $\alpha$ is surjective, it suffices to prove that $\alpha$ is dense. For this, it suffices to show that each $\alpha_Y$ is surjective. Using de Jong, find a smooth projective variety $\tY$ and a generically finite morphism $\phi: \tY \to Y$. By \lemref{functorialcone}, $N_1^+(\tY) \to N_1^+(Y)$ is surjective. This reduces the statement to the smooth projective case; here it follows from \lemref{surj3}. \end{proof} \begin{remark} \label{heightsuffices} The fact that continuity was proved using the open sets \[\beta < ht(f_1,\ldots,f_n) < \gamma\] alone shows that the projective height functions, along with the field operations, generates the entire language of GVFs. \end{remark} \ssec{Discrete globalizing measures} \label{dgm} Let $X$ be a smooth projective variety. Let $\mathcal{W}$ be the set of irreducible hypersurfaces of $X$. Let $a$ be a class in $N_1(X)^+$. We let $\mu_a$ be the measure, supported on divisorial valuations $v_D$ of $K$ for each irreducible hypersurface $D$ of $X$, and with $\mu_a(v_D) = a \cdot [D]$. The same definition extends additively to Cartier divisors, in such a way that principle divisors map to $0$. This amounts to the fact that a rational function on a curve has as many zeroes as poles. From this it is clear that for $f \in K$, letting $(f)=\sum m_i D_i$ be the divisor of zeroes and poles of $f$, we have $\sum m_i \mu(D_i) = 0$. Indeed let $p \in C_t \cap D_i$; if $D_i$ is cut out by $(g)$ locally at $p$ then $(g^{m_i})=(f)$ on this local ring, so $m_i i(C_t,D_i) $ is the order of zero (or pole) of $f$ at $p$ on $C_t$, and the sum of these is zero. Thus $\mu_a$ is a GVF measure. In particular, it defines an element of $S_X$, depending only on the numerical equivalence class of $C$, that we denote $\delta_X([C])$. This gives a map \[ \delta_X: N_1^+(X) \to S_K \] \begin{lem} \label{surj3} $\alpha_X \circ \delta_X = Id_{N_1^+(X)}$. \end{lem} \begin{proof} This amounts to the relations: $v_D(D)=1$, $v_D(D')=0$ when $D,D' \in \mathcal{W}$ are distinct, and $v_D$ is the valuation corresponding to $D$, evaluated on $D,D'$ as Cartier divisors. Both are straightforward. \end{proof} \begin{rem} It is not true that $ \delta_X \circ \alpha_X $ is the identity on $S_K$; but $ \delta_X \circ \alpha_X (p) $ and $p$ do give the same value to a formula $\int t(vf_1,\ldots,vf_m) dv$ if $f_1,\ldots,f_m$ extend to morphisms $X \to \Pp^1$, $t$ is a term formed out of $+,-, \min$, and for any minimum occuring in $t(vf_1,\ldots,vf_m)$, the corresponding minimum of Cartier divisors $(f_1),\ldots,(f_m)$ is is a stable meet on $X$. In particular, the same height is computed for rational functions $f$ extending to a morphism $X \to \Pp^1$. This makes it possible to define $\alpha_K$ as the limit of $\alpha_Y$ over all blowups $Y$, and prove injectivity in a more explicit way. \end{rem} \begin{rem} \label{boundary} Let $a \in N_1^+(X)$; assume $a \cdot b =0$ for some effective $b$ with nonzero section growth. Then there exists a nonconstant rational function $g$ on $X$ such that $F(g)$ is a constant subfield of the GVF $F(X)_a$. The converse is also true. \end{rem} \begin{proof} By assumption there exists a nonconstant rational function $g$ with poles only on (a representative of) $b$. So the height of $g$ in $F(X)_a$ is zero. \end{proof} \ssec{Quantifier-free types over the function field of a curve} Here the picture is very similar. Let $k$ be a constant field, and let $k_1=k(U)$ for a curve $U$. Let $K=k_1(X)$ be a finitely generated field extension of $k_1$. Let $\mu_1$ be a nontrivial GVF structure on $k_1/k$. Then $N_1^+(k_1) = \Rr^{ \geq 0}$, with $\mu_1$ corresponding to $1$; and we have a natural map $\pi_*: N_1^+(K) \to N_1^+(k_1)$; it is obtained as the limit of the projections $\pi_*: N_1(X) \to N_1(U)$ at the level of varieties. Let $N_1^+(K/\mu_1) $ be the pullback of $1$. We have an $\Rr^{>0}$-action on $N_1(X) $ and on $N_1(U)$ respecting $\pi_*| N_1(X)$; so $N_1^+(K/\mu_1)$ can also be identified with the set of elements of $N_1^+(K)$ with nontrivial images in $N_1^+(U)$, modulo the $\Rr^{>0}$-action. Letting $S_X$ denote the space of quantifier-free types over $(k_1,\mu_1)$, we immediately obtain from \thmref{qft}, by restriction: \begin{thm}\label{qft1} $\alpha: S_X \to N_1^+(K/\mu_1)$ is a homeomorphism. \end{thm} \end{section} \begin{section}{Existential closedness of $k(x)^{alg}[r] $} \label{xc-s} Let $k=k^{alg}$. Let $\mu$ be a globalizing measure for $k(V)$ over $k$. Let $D$ be an ample divisor on $V$. \begin{lem}[Artin-Whaples] \label{whaples} Let $C$ be a curve of genus $g$ over $k$. Let $x \in k(C) \smallsetminus k$, and let $r>0$. Then $k(C)$ admits a unique GVF structure over $k$ with $ht(x)=r$. \end{lem} \begin{proof} The nontrivial valuations of $k(C)$ over $k$ can be identified with the points of $C(k)$. They form a discrete set; the compactification includes also the trivial valuation, which plays no role here. We have to show that if $\mu$ is a measure on $C(k)$ satisfying the product formula, then $\mu$ gives equal weight to each element of $k(C)$. Let $a,b$ be two points. Then $(n+g)a - nb $ is effective, so $(n+g) \mu(a) \geq n \mu(b)$. Thus $(1+g/n) \mu(a) \geq \mu(b)$. Letting $n \to \infty$, $\mu(a)\geq \mu(b)$. So $\mu(a)=\mu(b)$ for all $a,b \in k(C)$. \end{proof} A $c$-twisting automorphism $\sigma$ of $K$ is an isomorphism from $K$ to $K'$, where $K'$ is the renormalization of $K$ moving from $\mu$ to $c \mu$. \begin{cor} \label{homogeneity1} There is a unique $GVF$ structure $k(x)^{alg}[r]$ on $k(x)^{alg}$ over $k$, with $ht(x)=r$. Moreover if $F$ is a finitely generated extension field of $k$ of transcendence degree $1$, and $g,g': F \to k(x)^{alg}$ are two field embeddings, and $a \in F \smallsetminus k$, there exists an $ht(f'(a))/ ht(f(a))$-twisting automorphism $\sigma$ of $k(x)^{alg}$ with $g'=\sigma \circ g$. \end{cor} \begin{rem} \label{rationalrepa} If $r/r' \in \Qq$ then $k(x)^{alg}[r] \cong k(x)^{alg}[r']$. \rm Let $m \in \Nn$ and let $\sigma$ be an automorphism of the field $k(x)^{alg}$ with $\sigma(x)=x^m$. Then $\sigma$ is $m$-twisting so it gives an isomorphism $k(x)^{alg}[r] \to k(x)^{alg}[mr]$. Similarly find an $m'$-twisting $\sigma'$, with $m/m'=r/r'$. Then $(\sigma') ^{-1} (\sigma)$ is an isomorphism $k(x)^{alg}[r] \to k(x)^{alg}[r']$. \end{rem} \begin{cor} \label{homogeneity} Let $K^*$ be an ultrapower of $K=k(x)^{alg}$. Let $F$ be finitely generated over $k$, of transcendence degree $1$, and let $f,f': F \to K^*$ be two embeddings, with $ht(f(a))=ht(f'(a))>0$ for some $a \in F $. Then there exists an automorphism $\sigma^*$ of $K^*$ with $\sigma \circ f = f'$. This also holds if $K^*$ is an ultraproduct of GVF fields $k_i(x)^{alg}$ of increasing positive characteristics, and $F$ is finitely generated over $\Qq$, of transcendence degree $1$. \end{cor} \begin{proof} $F$ is the field of fractions of a finitely generated $k$-algebra $D$, with $a \in D$. $f|D,f'|D$ can be represented as ultrapowers of homomorphisms $f_i,f_i': F' \to K$. We have $ht(f_i(a)) \to ht(f(a))$ and $ht(f_i'(a)) \to ht(f'(a))$ along the ultrafilter $u$. So $r_i=ht(f_i(a))/ht(f_i'(a))$ approaches $1$ along $u$. Note that $f_i,f_i'$ extend to field embeddings (first on $k(a)$ since $f_i(a), f_i'(a) \notin k = k^{alg}$; then on $F$ since it is a finite extension of $k(a)$). Using \corref{homogeneity1} let $\sigma_i$ be an $r_i$-twisting automorphism of $K$ with $f_i'=\sigma \circ f_i $. Let $\sigma$ be the ultraproduct of the $\sigma_i$. Then $f'=\sigma \circ f$ and $\sigma$ is a $1$-twisting automorphism, i.e. simply an automorphism. The statement with ultraproducts is proved similarly. \end{proof} \begin{proof}[Proof of \thmref{ec}] We first show that any quantifier-free type $q$ over $k$ can be approximately realized in $K =k(t)^{alg}[1]$. Consider first a smooth projective variety $X$ over $k$, and a family of curves $C_t$ on $X$ as in \secref{dgm}, with class $[C] \in N_1^+(X)$. We have the corresponding quantifier-free type $\delta_X(C)$. Now the inclusion of $C_t$ in $X$ corresponds to an element $a_t \in X(k(C_t)) $. It is easy to see that any approximation to $\delta_X(C)$ involving finitely many divisors is realized by $a_t$, for almost all $t$ (namely as soon as $C_t$ is not contained in the support of these finitely many divisors). Thus $\delta_X([C])$ is approximately realized in $K$. Since $K \cong K[m]$ for integral $m$ by \remref{rationalrepa}, we aso have $\delta_X(\frac{1}{m}[C])$ approximately realized in $K$. Now by \corref{eclem}, \thmref{qft} and \lemref{surj}, the types $\delta_Y(\frac{1}{m}[C])$ for $Y$ a blow-up of $X$, and $C$ as above on $Y$, are dense on $S_X$. Thus all types in $S_X$ are approximately realized in $K$. Now we must also consider types over $K$ and not just over $k$. Let $K \leq L$, $L$ finitely generated over $K$, with a GVF structure. We have to find a $K$- embedding of GVF's $L \to K^*$, where $K^*$ is an ultrapower of $K$. By the above we do have a $k$-embedding of GVFs $h: L \to K^*$. Let $g$ be the inclusion of $K$ in $K^*$, and $g' = h|K$. Using \lemref{homogeneity}, find $\sigma \in Aut(K^*)$ with $\sigma \circ g' = g$. Then $\sigma \circ h$ is an embedding of $L$ to $K^*$ over $K$, as required. \end{proof} \end{section} \begin{section}{A non-archimedean Yau theorem} \thmref{surj} can be viewed as an absolute version of the non-archimedean Yau theorem of \cite{bfj2} and \cite{kt}. To bring this out, we give a proof along the same lines of a version of the relative theorem. (Our proof is valid in any characteristic, and addresses to some extent the `regularity' issue raised in \cite{bfj2} in the model case, in that we show that the metric is determined by a big divisor on the same model.) We are given not only a smooth projective $X$, but also a morphism to $U$. In the relative (Yau) version, the data is a measure on the vertical divisors, as well as an ample line bundle $L$ on the generic fiber of $X$; the theorem yields a big line bundle on $X$ compatible with the measure (vertically) and with $L$ (generically.) By comparison in \thmref{surj}, the data is a measure on {\em all} divisors of $X$, including the horizontal ones and the outcome is again big divisor compatible with both vertical and horizontal measures. \ssec{The relative setting} Assume now that $\dim(X)= n+1$, and we are given not only $X$ but also a morphism $\pi: X \to U$ and a point $0 \in U$, where $U$ is a curve. Let $K=k(U)$, and let $X_K$ be the generic fiber, and $X_0=f ^{-1}(0)$ the special fiber. Let $I$ be the set of irreducible components of $X_0$. Within $N^1(X)$, we have the subspace $\vdiv$ of {\em vertical divisors} generated by $I$. Note that $[X_0]^2=0$ and moreover $[X_0] \cdot [E]=0$ for any $E \in I$, since $X_0$ can be moved to any other fiber. By \lemref{pdc} (applied to $\vdiv$ and the vector $f=[X_0]$, and taking into account the Grothendieck connectedness theorem), $\vdiv / (f)$ is negative definite and $f=0$ is the unique relation on the generators $I$; as $f \neq 0$, in fact $I$ is a basis for $\vdiv$. Any ample $D \in N^1(X)$ defines, on the one hand, an ample line bundle $L$ on $X_K$, obtained by restriction of $D$ to the generic fiber. On the other hand, the point $0 \in U$ determines a valuation $v_0$ on $K$, and by extending rational sections of $L$ to sections of $D$ we obtain a metrization of $L$ over the valued field $(K,v_0)$. (Actually for any big $D \in N^1(X)$ with fixed ample generic part $L$, we can define a metrization of $L$ over $(K,v_0)$, the limit of the metrics associated to ample divisors $D-E$ with $E$ effective and vertical and $D-E$ ample, over all base change morphisms $X' \to X$ that are isomorphisms away from $X_0$.) In Arakelov theory, this is viewed as analogous to a smooth metrization of $L$, assuming given an embedding of $K$ into $\Cc$ in place of the valuation $v_0$. In the K\"ahler case, a metrized line bundle gives rise to a measure on $X$, obtained by taking the $n$'th power of the curvature $2$-form. A non-archimedean analogue of this construction was defined in \cite{acl}, following work of Gillet-Soul\'e, Gubler, Zhang and others. In the basic geometric case we are considering, the measure is very simple to define. It concentrates on $I$; any $c \in I$ is given weight $m_c c \cdot D^n$, where $m_c$ is the multiplicity with which $c$ occurs in $X_0$. More generally, if $D$ is a divisor on a blowup $b: X' \to X$ we can still define the measure by $\mu_D(c) = m_c c \cdot b_*(D^n) = m_c b^*(c) D^n$. For us it is natural to extend the definition to any big Cartier $\Rr$- divisor $D$ (with generic part $L$): \[ \hat{\mu}_D(c) = m_c c \cdot \psi(D) \] \begin{lem} \label{bigtobig} Any big line bundle $L$ of $X_K$ extends to a big divisor $\bL$ of $X$.\end{lem} \begin{proof} We can represent $L$ by an effective divisor $D_K$ on $X_K$. There exist $g_1,\ldots,g_n \in k(X)=K(X_K)$ that are algebraically independent over $K$, and whose poles are at most $D_K$. We can view the $g_i$ as elements of $k(X)$, and by adding some vertical divisors, can find a divisor $D$ on $X$ with generic part $D_K$, such that the poles of the $g_i$ are bounded by $D$. On the other hand we can find $f_1,\ldots,f_r \in K = k(U)$, $r=tr.deg._k K = \dim(U)$, algebraically independent over $k$; by adding to $D$ the pullback of the polar divisors of $f_1,\ldots,f_r$ to $D$ we may assume each $f_i \in L(D)$ as well. Finally since $D$ is effective, we have $1 \in L(D)$. It follows that $D$ is big. \end{proof} \begin{thm}\label{nacy} Let $L$ be a big line bundle on $X$, represented by an irreducible Cartier divisor. Let $I_t$ be the set of irreducible components of $X_t$, $I = \cup_t I_t$. Let $\mu$ be a nowhere vanishing positive measure on the vertical divisors, such that the total mass of each fiber $X_t$ is $\mu(I_t)= D^n = \deg(D)$. Then there exists a big $\Rr$-Cartier divisor $B$ on $X$ with generic part $L$, $\hat{\mu}_B = \mu$. \end{thm} Note that for all but finitely many $t \in U$, $I_t$ has a single point, so $\mu$ is fully constrained on $I_t$. \begin{rem} If only given a measure on $I_0$ of total mass $L^n$, it can be extended to a nowhere vanishing positive measure on $I$, as the proof below shows; thus \thmref{nacy} includes the local version usually considered. \end{rem} \begin{proof} Let $D_K$ be an irreducible Cartier divisor on $X_K$, representing $L$. Let $\gamma: Pic_\Rr(X) \to Pic_\Rr(X_K)$ be `restriction to the generic fiber'. We will also write $\gamma$ for restriction of $\Rr$-Cartier divisors. Fix an $\Rr$-Cartier divisor $D$ with generic part $D_K$. Let $E \leq Pic_\Rr(X)$ the the vector space generated by the class of $D$ and by the vertical divisors. Let $E^+ $ be the cone in $E$ generated by effective divisors. Consider the codimension one subspace $E_0:=\ker(\gamma)$ of $E$. Let $E_0^+$ be the cone of effective Cartier divisors in $E_0$. $E$ is generated by the finite set $I$, using \remref{hodge2c}; so it is finite dimensional, and closed; the natural homomorphism $Pic_\Rr(X) \to N^1(X)$ is, again by \remref{hodge2c}, injective on $E_0$, and $E_0^+$ is the pulback of the effective cone in $N^1(X)$. Let $U$ be the intersection of $E$ with the pullback to $Pic(X)$ of the cone of big divisors. By \lemref{bigtobig}, this intersection is nonempty, so it is an open cone on $E$. The hypotheses (1)-(3) of \thmref{convexity} are satisfied for the function $\vol^{\frac{1}{n+1}} |E$, since this is shown for $N^1(X)$ in \thmref{surj}, and they remain true upon restriction to the image of $E$. For $B \in U$, write $\psi(B)$ for $\psi$ of the image of $B$ in $N^1(X)$. Now $\mu$ defines a linear map on $E_0$, positive on $E_0^+$. By the strict positivity assumption, $\mu$ lies in the interior of the dual of $E_0^+$ by \lemref{interiorofdual}, by \lemref{coneproject} it lifts to an element $\mu'$ in the interior of the dual of $E^+$. By \corref{convexity-c}, there exists $B' \in E \cap U$ such that $\psi(B') \cdot c = \mu'(c)$ for any $c \in I$. We may represent $B'$ by an $\Rr$-Cartier divisor $B'=\alpha' D + F'$. It remains to show that $\alpha'$ may be chosen to be $1$. We do not claim that it necessarily equals $1$, but rather that there exists an $\Rr$-Cartier $B \leq B'$ with the same sections, with $\psi(B)=\psi(B')$, so that $B = D+F$. Indeed take $B$, as an $\Rr$-Weil divisor, be $\sup \{ (f)/n: (f) \leq nB, n =1 ,2,\cdots\}$. Then by definition $B,B'$ have the same sections, hence same Okounkov bodies, the same volume, and by \propref{sectionsonly}, $\psi(B)=\psi(B')$. Restricting to the generic fiber, and viewing $B,B'$ as $\Rr$-Weil divisors, we have $\gamma(B) \leq \gamma(B')= \alpha' D_K$ so using the irreducibility of $D_K$, $\gamma(B')= \alpha D_K$ for some $\alpha \leq \alpha'$. By definition, $\psi(B)$ is the limit of $H^n$ over nef divisors $H \leq b^*(B)$, where $b:X' \to X$ is a blowup of $X$. Working in $X'$, let $D' = b ^* D, F'=m^*F$, $\gamma':N_1(X') \to N_1(X'_K)$ the restriction. Let $f$ denote the class of a generic fiber of $\pi$. Note $f \cdot F = 0$ for any vertical divisor $F$. $ H^n \cdot b^*(f) \leq (\alpha D+ F)^n \cdot f = \alpha^n L^n = \alpha^n \mu(f)$. Thus taking the limit, $\mu(f) \leq \alpha^n \mu(f)$ so $\alpha \geq 1$. On the other hand if $\alpha >1$ then some section witnesses this; on some blowup $b: X' \to X$ there exists a semi-free (hence nef) $\Qq$- divisor $H \leq \alpha D + F$ with generic part $H_K \geq \beta D$, for some $\beta >1$. But in this case for some vertical $F'$ we have $H \geq \beta D + F'$, so $\mu(f)=\psi(B) \cdot f \geq H^n \cdot b^*(f) \geq (\beta D +F')^n \cdot f = \beta^n D^n \cdot f = \beta^n \mu(f)$, a contradiction. Thus $\alpha=1$. So $\hat{\mu}_B = \mu$. \end{proof} \begin{question} (and remarks). Clarify Calabi uniqueness in this setting. For semi-positive metrics on an ample line bundle, supremum of the nefs on blowups dominated by $B$, is proved in \cite{yuan-zhang}. In the global case, uniquenesss follows from a the strict log-concavity of volume in non-radial directions, \cite{bfj}, \cite{cutkosky}. As far as I could see nothing is known outside the nef cone, and it is possible that the collapse from $B$ to $B'$ above is responsible. Consider $B$ with generic part $D$, $\hat{\mu}_B=\mu$. \begin{itemize} \item The freedom in the choice of $\mu'$ corresponds to additive translation of $B'$ by a scalar multiple of $f$. At least in the multilinear domain, $B'+ \alpha f$ represents the same measure on $I$. Thus we can only expect to determine the image of $B$ in $N^1(X)/N^1(U)$. This is analogous to the fact that in the usual Calabi theorem, uniqueness is up to a scalar multiple. \item In the non-multi-linear region of $\psi$, is addition of $f$ still the same as addition of a constant to the Weil function, after collapse? (Seems so.) \item An interesting way to prove uniqueness of the asymptotic section spaces: use the strict convexity in Brunn-Minkowski. What can be concluded about $B,B'$ if the Okounkov body is the same for {\em every} choice of $v$? \item Is this image determined by the associated metrization ($v \mapsto \lim_n 1/n \min v(sections)$). \item Is it the case that if $\hat{\mu}_B= \hat{\mu}_{B'}$ and $B|D = B'|D$ is ample then the nef divisors on blowups below $B$ are cofinal with those below $B'$ ? (issue of f). \item Assuming this cofinality, we have $B=B'$. For every section of $B$ is a section of some free $N$ on a blowup, $N \leq \pi^*B$; hence of $\pi^*B'$ hence of $B'$. (issue of f.) \item Assuming this and that the limit is uniform, so that Yuan-Zhang Calabi applies, we do have $B= B'$.(issue of f.) \item Does a big divisor defines the same metrization as a limit over blow-up of nef divisors approaching it? This apparently does not imply that it is nef itself. Fujita says yes in terms of volume. Pointwise, for maximal rank $v$, the answer is also yes: Okounkov bodies must approach if volume does. \end{itemize}\end{question} \begin{question} What about higher dimensional $U$? Analogue of splitting divisors is clear. \end{question} \end{section}
\section{Introduction} The learning rate plays a crucial role in the training of deep neural networks. Unfortunately, tuning the learning rate is a tricky task -- too large a learning rate can cause the training loss to diverge, while too small a learning rate can result in inefficient use of time and computational resources. The optimal choice of learning rate has been observed to depend non-trivially on many factors, including the data, architecture, optimizer, and initialization scheme. As a result, it can be difficult to theoretically analyze the relationship between the learning rate and other elements of the training framework, and can be computationally expensive to find the best learning rate in practice. While there have been numerous works rigorously analyzing effective learning rates both from theoretical and empirical standpoints (\cite{NEURIPS2020_a7453a5f,l.2018dont}), these works tend to focus on behavior during late-stage training, considering which learning rates provide optimal performance (e.g.~\cite{pmlr-v97-park19b}), or lead to convergence guarantees (e.g.~\cite{wang2022large}). However, it is not clear that optimal learning rates early in training follow similar patterns to those near convergence, and indeed a variety of heuristics for learning rate scheduling suggest that a significant early change in learning rate can actually boost performance (e.g.~\cite{goyal2017accurate}). In this paper, we consider both empirically and theoretically how large the learning rate can be in early training. Our main contributions are as follows: \begin{itemize} \item In \S \ref{prelim:milr}, we introduce the \emph{maximal initial learning rate} $\eta^{\ast}$ -- the largest learning rate at which a randomly initialized neural network can successfully begin training -- and show how it can be computed. \item For fully-connected deep ReLU networks, we empirically identify a power law relating the maximal initial learning rate and the product of width and depth: $$\mathbb{E}[\log\eta^{\ast}]\sim -\alpha\log(\text{depth}\times \text{width}),$$ where $\alpha$ is a constant close to $.75$ for sufficiently wide networks (see \autoref{fig:const_width_depth_smallinputlr})\footnote{Our empirical results suggest that for sufficiently wide networks, $\alpha$ is task-independent, but confirming this would require further experiments that we do not undertake in the present work.}. Notably, while prior theoretical work (\cite{pmlr-v89-karakida19a}) suggests that at the end of training $\alpha=1$, we find that at the start of training $\alpha < 1$, allowing for larger initial learning rates. \item We show empirically that the sharpness $\lambda_{1}$ (i.e.~the largest eigenvalue of the training loss Hessian) at initialization is a function of $\eta^{\ast}$, though does not necessarily reflect the inverse relationship observed in late-stage training. We illustrate this in \autoref{fig:sharpness_milr_comparison}. \item In \S \ref{sec:thm}, we prove power law upper bounds on $\lambda_{1}$ at initialization as a function of $(\text{depth}\times\text{width})$ by studying the Frobenius norm of the Loss Hessian at initialization. \end{itemize} In the process, we also provide a counterexample to a claim about learning rates and sharpness made in \cite{gilmer2022a}, as detailed in \S \ref{section:sharpness}. \begin{figure}[htb!] \centering \subfloat[]{\includegraphics[width=0.5\textwidth]{Plots/threshold_accuracies_scatter.pdf}} \subfloat[]{\includegraphics[width=0.5\textwidth]{Plots/const_width_depth_cifar10_hero.pdf}} \caption{Behavior of the maximal initial learning rate $\eta^{\ast}$ as network architecture and training setup varies in constant width fully-connected ReLU networks. (a) illustrates how $\eta^{\ast}$ depends on the threshold accuracy $t$ as a function of $\text{width} / \text{depth}$, for MNIST. To this end, we plot $\eta^{\ast}$ at $t=$ 0.2 and 0.8, on the $x$ and $y$ axes respectively. There is no change in $\eta^{\ast}$ for architectures with sufficiently large $\text{width}/ \text{depth}$, and such points fall on the $x=y$ line. Otherwise, its value declines as $t$ becomes larger. Essentially, the exact value of $t$ has no impact on $\eta^{\ast}$ if the network architecture has sufficiently large $\text{width} / \text{depth}$. (b) shows $\eta^{\ast}$ as a function of $(\text{depth}\times \text{width})^{-1}$ when the input layer of the network is trained at a small learning rate, on CIFAR-10 (\cite{krizhevsky2009learning}). When $\text{width} / \text{depth}$ is larger than some small and constant value, the relation $\mathbb{E}[\log\eta^{\ast}]\sim -\alpha\log(\text{depth}\times \text{width})$ approximately holds. If it is not sufficiently large, this is not true and $\eta^{\ast}$ is smaller than predicted by extrapolating this power law. See \S \ref{prelim:milr} for a discussion on $\eta^{\ast}$ and $t$, and \S \ref{section:setup} for details on the experimental setup. } \label{fig:hero} \end{figure} \section{Related Work} Large learning rates have lately been a topic of interest (\cite{n.2018superconvergence,NEURIPS2019_bce9abf2,jastrzebski2018factors}). \cite{DBLP:journals/corr/abs-2003-02218} investigate large learning rates, their benefits to generalization, and predict maximum learning rates for some architectures. While their formulations for the maximum learning rate depend on the sharpness, our work finds the maximum learning rate in an empirical manner and investigates its relationship to the sharpness. Through theoretical analysis of the Fisher information matrix and its statistics, \cite{pmlr-v89-karakida19a} derive a relationship between the architecture of a network and the largest learning rate that would allow the network to converge to the global minimum when trained with SGD. They state that this learning rate would linearly scale down with ${(\text{depth}\times \text{width})}$ for a constant width fully-connected network. \cite{pmlr-v97-park19b} relate the optimal learning rate (in the sense of optimal performance) to the effective width of neural networks by studying the normalized noise scale -- a quantity derived from the learning rate, batch size, and training set size. We would like to point out a notable difference between this collection of work, and the work presented in this paper -- we focus on finding maximal learning rates that reliably work in practice, which are free of constraints like convergence to global minima or optimal performance. \cite{cohen2021gradient} introduce ``progressive sharpening'' and the ``edge of stability'' regime by investigating the evolution of sharpness over the course of training, which is extended to adaptive gradient methods in \cite{https://doi.org/10.48550/arxiv.2207.14484}. More recently, there have also been several theoretical investigations (\cite{pmlr-v162-ahn22a, pmlr-v162-arora22a, https://doi.org/10.48550/arxiv.2207.12678}) into this phenomenon. \cite{gilmer2022a} add to this line of work by looking at early training instabilities through the lens of sharpness, and argue that seemingly different methods such as learning rate warmup and gradient clipping stabilize the learning process through the same mechanism -- by reducing sharpness early in training. \cite{Jastrzebski2020The} similarly look at the effect of hyperparameters used in the early stages of training, and find that they determine properties of the entire training trajectory. Our work contributes by exploring how the initial sharpness for network architectures can change with the choice of initialization scheme, and exploring progressive sharpening for the same. We present an average-case analysis of the maximal initial learning rate, and how it relates to the architecture of fully-connected networks. Such average-case analyses can be useful in identifying gaps between theoretical possibilities and practical observations. Previous work (\cite{hanin2022deep,pmlr-v97-hanin19a,NEURIPS2019_9766527f}) provides average-case analyses for expected length distortion, the number of linear regions, and the number of activation regions in deep ReLU networks, respectively. For further examples of average-case analyses, see \cite{pmlr-v70-shalev-shwartz17a} and \cite{pmlr-v70-raghu17a}. Finally, we point the reader to several prior articles which show that in wide fully-connected networks it is the width-to-depth ratio, rather than depth or width separately, that effectively controls the stability of optimization. This is the reason that in many of our figures, we separate architectures based on this ratio. Examples include work about fully-connected networks at initialization, which study the fluctuations of the forward pass \cite{hanin2018start}, the fluctuations in the backward pass \cite{hanin2018neural, hanin2018products, hanin2022correlation}, and the extent of feature learning early in training \cite{hanin2019finite}. Moreover, for large values of width/depth, many novel results of this kind were also obtained for networks \textit{after training} of \cite{roberts2021principles} (especially Chapter $\infty$). \section{Preliminaries} \subsection{The Maximal Initial Learning Rate} \label{prelim:milr} We define the \emph{maximal initial learning rate} $\eta^{\ast}$ to be the largest, constant learning rate at which a given network can achieve validation accuracy of at least $t$, where $t$ is a given threshold accuracy. The choice of learning rate is largely dictated by the data being used to train the network and its architecture. Since a theoretical formulation of the data itself is unrealistic, the learning rate needs to be empirically tuned for each problem statement, which is further affected by changes in the training setup. By introducing the maximal initial learning rate $\eta^{\ast}$, exploring its properties, and relating it to the architecture, we aim to make it easier to find large learning rates that work in practice. Furthermore, several recent lines of work observe that the early phase of training can heavily impact training dynamics and performance at later stages (\cite{Frankle2020The,Jastrzebski2020The}) -- from this perspective, it is important to consider the behavior of $\eta^{\ast}$ and how it changes as a function of architecture and training setup. We also present a simple algorithm based on binary search, which can be used to compute $\eta^{\ast}$ in \autoref{alg:MILR}. \begin{algorithm}[htb!] \caption{Computing the Maximal Initial Learning Rate $\eta^{\ast}$} \label{alg:MILR} \begin{algorithmic} \State Define threshold accuracy $t$, and upper and lower learning rates $u$ and $l$ respectively. \For{a small number of search iterations $s$} \State Compute $m = \frac{u+l}{2}$ i.e. the midpoint of $u$ and $l$ \For{each epoch in a small number of epochs $e$} \State Train network at learning rate $m$ \State Evaluate validation accuracy $a$ \State If $a \geq t$, then break out of inner loop, and $l \gets m$ \EndFor \State If $a$ < $t$ after training for $e$ epochs, then $u \gets m$ instead \EndFor The last value of $m$ satisfying $a \geq t$ is the desired $\eta^{\ast}$. \end{algorithmic} \end{algorithm} To summarize: \autoref{alg:MILR} takes as input a network initialization, threshold accuracy $t$, and lower and upper learning rates $l$ and $u$ respectively. We perform a binary search on the continuous space of learning rates $\in (l,u)$ to identify $\eta^{\ast}$. More specifically, for each midpoint learning rate $m = \frac{u+l}{2}$, we train the network initialization for a small number of epochs. If this trained network, at any point during training, achieves validation accuracy at least $t$, then we set $l = m$. Else, we set $u = m$. The next search is performed in the newly defined $(l,u)$ space. This is repeated for a small number of search iterations, and the final value of $m$ that achieves validation accuracy at least $t$ is $\eta^{\ast}$. \subsection{Sharpness} \label{section:sharpness} As given in \cite{cohen2021gradient}, the sharpness $\lambda_{1}$ is defined as the maximum eigenvalue of the training loss Hessian. \begin{figure}[htb!] \centering \subfloat[Kaiming Initialization]{\includegraphics[width=0.5\textwidth]{Plots/sharpness_stats.pdf}} \subfloat[LeCun Initialization]{\includegraphics[width=0.5\textwidth]{Plots/sharpness_stats_lecun.pdf}} \caption{Visualization of sharpness $\lambda_{1}$ as a function of width and depth at initialization for (a) Kaiming (\cite{He_2015_ICCV}), and (b) LeCun (\cite{series/lncs/LeCunBOM12}) initialization schemes. We take absolute values and log scaling for $\lambda_{1}$ in (b) for the sake of clear representation - $\lambda_{1}$ values are extremely small in magnitude and can be positive or negative in sign. Width is given on the x-axis, and the different colors indicate different depths. There is a clear difference in how $\lambda_{1}$ scales for the considered initialization schemes -- while it becomes larger as width and depth increase for Kaiming-initialized networks, it becomes smaller with depth for LeCun-initialized networks.} \label{fig:sharpness_stats} \end{figure} \autoref{fig:sharpness_stats} compares $\lambda_{1}$ at initialization between the Kaiming and LeCun initialization schemes, as a function of changing fully-connected network architecture. Based on this figure, we make the following observations: \begin{itemize} \item For Kaiming-initialized networks, $\lambda_{1}$ scales with both width and depth, and its variance primarily scales with the depth of the network architecture. \item Compared to Kaiming initializations, LeCun-initialized networks show very little variation in $|\lambda_{1}|$ with a change in width, but considerably more with depth. Furthermore, $|\lambda_{1}|$ actually decreases as the depth gets larger, which is opposite to the trend we noticed for Kaiming initializations. \item As mentioned in \autoref{fig:sharpness_stats}, it is interesting to note that $\lambda_{1}$ for LeCun-initialized networks can be positive \emph{or} negative at initialization, which is not the case for Kaiming-initialized networks. It may be important to question why this is the case, and what factors affect the sign of $\lambda_{1}$ at initialization. \end{itemize} The above observations illustrate that the way in which $\lambda_{1}$ varies and scales with architecture is largely dependent on the initialization scheme employed. While we have the means to estimate the top eigenvalue(s) of the training Hessian, we do not yet understand how it is impacted by network architecture, data, and initialization. This is partly because the complete Hessian is difficult to compute and theoretically analyze in large-scale settings. We believe that a better understanding of this quantity could help us understand the role that sharpness plays in the optimization of neural networks. \begin{figure}[htb!] \centering \subfloat[LeCun Initialization]{\includegraphics[width=0.5\textwidth]{Plots/eos_lecun_init.pdf}} \subfloat[Kaiming Initialization]{\includegraphics[width=0.5\textwidth]{Plots/eos_kaiming_init.pdf}} \caption{Sharpness $\lambda_{1}$ as a function of training epochs, showcasing ``progressive sharpening'' for (a) LeCun initialization; and (b) Kaiming initialization. We replicate the experimental setup of \cite{cohen2021gradient} - the networks are trained with full-batch gradient descent until $99\%$ training accuracy is reached. We use the toy fully-connected ReLU network they describe, which is trained on a 5k subset of CIFAR-10. $\eta$ indicates the learning rate the network is trained with. Observe that $\lambda_{1}$ at initialization is much larger for Kaiming initialized networks (as pointed out in \autoref{fig:sharpness_stats}), and very steeply drops almost immediately after training starts. After this initial drop, the sharpness rises \textit{or} continues dropping until it hovers slightly above the $2/\eta$ line.} \label{fig:eos_comparison} \end{figure} \autoref{fig:sharpness_stats} illustrates progressive sharpening for networks initialized with LeCun and Kaiming initialization schemes. The Kaiming-initialized network seems to show a more complete picture of the evolution of sharpness -- there is a steep drop in the sharpness at the start of training, after which the sharpness proceeds to generally rise again to meet the $2/\eta$ line. \cite{gilmer2022a} state in Section 5: ``When the learning rate only slightly exceeds $2/\lambda_1$, optimization is unstable until the parameters move to a region with smaller $\lambda_{1}$.'' We note that the learning rate need not exceed $2/\lambda_1$ for the parameters to move to a region with smaller $\lambda_{1}$ -- this can be seen in the (magenta) graph corresponding to progressive sharpening for $\eta = 2/110$ in \autoref{fig:eos_comparison}(b). \section{Experimental Setup} \label{section:setup} We primarily focus on constant width,fully-connected deep ReLU networks trained with SGD, that are initialized with the Kaiming normal initialization scheme. The batch size is set to 128 across all our experiments. It is worth mentioning why we specifically make use of Kaiming-initialized networks -- prior work by \cite{NEURIPS2018_d81f9c1b} shows that its variance prevents the mean size of the activations from becoming exponentially large or small as a function of the depth. Further, \cite{NEURIPS2018_13f9896d} shows that having the correct variance is important in preventing the gradient explosion problem (\cite{279181}). Essentially, the Kaiming initialization scheme is, at present, the correct way to initialize deep ReLU networks. When using \autoref{alg:MILR}, we set threshold accuracy $t$ to be the accuracy that a linear classifier achieves on the given dataset, along with the number of training epochs $e = 10$. This ensures that networks trained at the maximal initial learning rate perform adequately while taking into account dataset complexity or ``easiness''. Refer to \autoref{table:1} for numerical values of these threshold accuracies. \begin{table}[htb!] \centering \begin{tabular}{|c|c|} \hline \textbf{Dataset} & \textbf{Threshold Accuracy $t$} \\ \hline \hline MNIST & 0.925 \\ \hline CIFAR-10 & 0.34 \\ \hline \end{tabular} \caption{Threshold Accuracy $t$ for datasets we use, which is equal to validation performance achieved by a linear classifier.} \label{table:1} \end{table} Upper and lower learning rate limits $u$ and $l$ can be arbitrarily set based on the architecture and dataset being considered. We set $l = 0.0$ for all our experiments, and find that search iterations $s = 5$ is sufficient for the precise computation of $\eta^{\ast}$. We make use of the PyHessian library (\cite{9378171}) to compute $\lambda_{1}$. \section{Main Empirical Results} \subsection{Relating Expected Maximal Initial Learning Rate and Architecture} We have established the maximal initial learning rate $\eta^{\ast}$ and explored some of its aspects with respect to changes in training setup and threshold accuracy $t$. Now, we discuss our experimental findings in order to understand how $\eta^{\ast}$ depends on the network architecture and learning rate of the input layer. More specifically, we show that if: \begin{itemize} \item the ratio $\text{width} / \text{depth}$ is sufficiently large and, \item the input layer is trained at a sufficiently small learning rate, \end{itemize} then the expected maximal initial learning rate is strongly correlated to $(\text{depth}\times \text{width})$. Formally, we observe a power relationship according to: $$\mathbb{E}[\log\eta^{\ast}]\sim -\alpha\log(\text{depth}\times \text{width}),$$ \begin{figure}[htb!] \centering \subfloat[CIFAR-10]{ \begin{minipage}{0.6\textwidth} \centering \includegraphics[width = \textwidth]{Plots/const_width_depth_cifar10.pdf} \end{minipage} \hfill \begin{minipage}{0.4\textwidth} \begin{tabular}{|c|c|c|} \hline \textbf{$\text{width} / \text{depth}$} & \textbf{Slope $m$} & \textbf{$R^{2}$} \\ \hline \hline 40 & 0.748 & 0.995\\ \hline 32 & 0.76 & 0.999 \\ \hline 16 & 0.713 & 0.994 \\ \hline 8 & 0.688 & 0.991 \\ \hline 4 & 0.587 & 0.967 \\ \hline 2 & 0.485 & 0.808 \\ \hline \end{tabular} \end{minipage} } \subfloat[MNIST]{ \begin{minipage}{0.6\textwidth} \centering \includegraphics[width = \textwidth]{Plots/const_width_depth_mnist.pdf} \end{minipage} \hfill \begin{minipage}{0.4\textwidth} \begin{tabular}{|c|c|c|} \hline \textbf{$\text{width} / \text{depth}$} & \textbf{Slope $m$} & \textbf{$R^{2}$} \\ \hline \hline 40 & 0.72 & 0.998\\ \hline 32 & 0.71 & 0.998 \\ \hline 16 & 0.687 & 0.991 \\ \hline 8 & 0.703 & 0.991 \\ \hline 4 & 0.693 & 0.98 \\ \hline 3 & 0.714 & 0.968 \\ \hline \end{tabular} \end{minipage} } \caption{Relationship between maximal initial learning rate $\eta^{\ast}$ and architecture for fully-connected networks for different values of $\text{width} / \text{depth}$. We use depths $\in \{5,7,10,12,15,18,20,23,25,27,30 \}$. If $\text{width} / \text{depth}$ is sufficiently large, the expected $\eta^{\ast}$ displays a strong power relationship with $(\text{depth}\times \text{width})^{-1}$. Interestingly, all such $\eta^{\ast}$ lie on the same line regardless of the exact $\text{width} / \text{depth}$ value. As $\text{width} / \text{depth}$ becomes smaller, networks deviate from the power relationship. The input layers of networks are trained at $(\eta \cdot 10^{-2})$, where $\eta$ is the learning rate for the rest of the network. We report slopes and coefficient of determination values for each $\text{width} $ to emphasize the linear fit.} \label{fig:const_width_depth_smallinputlr} \end{figure} We illustrate this in \autoref{fig:const_width_depth_smallinputlr}. It is also interesting to note that network architectures that deviate from this trend show much smaller $\eta^{\ast}$. In our experiments, these networks sometimes fail to beat the performance of a linear classifier, leading to no valid $\eta^{\ast}$ being found at all. \begin{figure}[htb!] \centering \subfloat[CIFAR-10]{\includegraphics[width = 0.5\textwidth]{Plots/const_width_depth_cifar10_standard.pdf}} \subfloat[MNIST]{\includegraphics[width = 0.5\textwidth]{Plots/const_width_depth_mnist_standard.pdf}} \caption{Relationship between the maximal initial learning rate $\eta^{\ast}$ and architecture for fully-connected networks with different $\text{width} / \text{depth}$ values, trained on CIFAR-10 and MNIST (\cite{lecun-gradientbased-learning-applied-1998}). We use the same network architectures as in \autoref{fig:const_width_depth_smallinputlr}. We observe a consistent power relationship for networks with relatively large widths and small depths. However, this soon becomes non-linear for other, relatively deeper architectures.} \label{fig:const_width_depth_standard} \end{figure} Next, we take a look at how $\eta^{\ast}$ scales as a function of $(\text{depth}\times \text{width})$, when networks are trained at the same learning rate. This is illustrated in \autoref{fig:const_width_depth_standard}. For relatively large $(\text{depth}\times \text{width})$ values (i.e. small $(\text{depth}\times \text{width})^{-1}$ values), the behavior for networks trained at a uniform learning rate is very similar to networks with a small input layer learning rate. However, it very quickly changes, and becomes a non-linear trend when $(\text{depth}\times \text{width})$ becomes smaller, which is not observed in the small input layer learning rate setup. We also note that these observations hold when the input layer is frozen instead of trained at a smaller learning rate. However, we avoid doing this to maximize the performance of networks so they can beat linear classifiers, while also attempting to reduce the influence of the input layer during training. The bulk of the parameters for fully-connected networks trained on modern datasets often belong to the input layer and are therefore important to performance. Some intuitive motivation with respect to these observations: The input layer of a fully-connected, constant-width network can be viewed as a point of architectural asymmetry -- all other layers of the network have constant width, while the width of the input layer depends on the dimensions of the data. Therefore, removing this point of asymmetry may be making it easier to observe an existing pattern. This also explains why networks with sufficiently large $\text{width} / \text{depth}$, and small $(\text{depth}\times \text{width})$ (i.e small depth, large width) show similar behavior across both setups -- these architectures essentially minimize the influence of the input layer by having numerically similar width. However, this does not explain why we do not observe a deviation when the width of the network is larger than that of the input layer (in the case of MNIST, for instance). In the context of the above experiments and results, we pose the following questions: \begin{itemize} \item Why is there a discrepancy between the largest learning rates prescribed by theory, and as seen in practice? Through theoretical analysis of the Fisher information matrix, past work (\cite{pmlr-v89-karakida19a}) has suggested that the largest learning rate should scale linearly with $(\text{depth}\times \text{width})$ -- both the setups we have discussed here display this behavior. It is also important to note that this assumes that these learning rates ensure the global convergence of SGD, and might be a potential reason for this apparent discrepancy between theory and observed results. \item Why does training the first layer at a smaller learning rate yield a more consistent power relationship as compared to standard training? Can we initialize the input layer to achieve predictable maximal initial learning rates, while also preserving performance? This may be due to the architectural asymmetry discussed earlier, but it fails to holistically explain our observations. \item Given a dataset, can we precisely compute the threshold value of $\text{width} / \text{depth}$ which ensures the preservation of the observed power relationship i.e. what factors does this threshold value depend on? \end{itemize} \subsection{Relating Expected Sharpness at Initialization and Architecture} The sharpness of a network is often associated with the learning rate at which it is trained. In particular, classical optimization tells us that the learning rate must be no larger than $2/\lambda_1$ to guarantee the convergence of SGD to the global minimum. However, this notion is recently being questioned in the context of deep neural networks (\cite{cohen2021gradient, DBLP:journals/corr/abs-2003-02218}). \begin{figure}[htb!] \centering \subfloat[CIFAR-10]{\includegraphics[width=0.5\textwidth]{Plots/sharpness_arch_cifar10_const_width_depth.pdf}} \subfloat[MNIST]{\includegraphics[width=0.5\textwidth]{Plots/sharpness_arch_mnist_const_width_depth.pdf}} \caption{$2/\lambda_1$ (where $\lambda_{1}$ is the sharpness) as a function of $(\text{depth}\times \text{width})$ for various fully-connected, Kaiming-initialized architectures for CIFAR-10 and MNIST. $\lambda_{1}$ is measured by considering the complete dataset as a single batch of data and is averaged over 25 initializations for each architecture. We observe that, for sufficiently large $(\text{depth}\times \text{width})$, the maximal initial learning rate $\eta^{\ast}$ and $2/\lambda_1$ both show similar power relationships.} \label{fig:sharpness_const_width_depth} \end{figure} This motivates a need for a deeper understanding of sharpness and its connection to the learning rate and architecture in deep neural networks. To this end, we now explore how the expected sharpness of a network at initialization relates to $(\text{depth}\times \text{width})$ in fully-connected networks. In addition to relating the sharpness to the architecture, this also allows us to indirectly compare the expected sharpness and the expected maximal initial learning rates at initialization. We illustrate this in \autoref{fig:sharpness_const_width_depth}. Note that the sharpness at initialization is the same regardless of whether the input layer is trained at the same or smaller learning rate as the rest of the network since no training is involved in computing sharpness at initialization. The similarity in the correlations between the maximal initial learning rate $\eta^{\ast}$ and the expected sharpness (more specifically $2/\lambda_1$) with $(\text{depth}\times \text{width})$ raises a key question: Are the maximal initial learning rate and sharpness two sides of the same coin -- i.e. are they measuring the same property? \subsection{Comparing the Maximal Initial Learning Rate and Sharpness At Initialization} In this section, we take the natural next step of comparing the sharpness and the maximal initial learning rate at initialization. More specifically, we plot $2/\lambda_1$ as a function of $\eta^{\ast}$. We exclusively use networks with $\text{width} / \text{depth}$ of 16 and train the input layer at a smaller learning rate compared to the rest of the network. This is done in order to compute $\eta^{\ast}$ that preserves the correlations we have observed in previous experiments. \begin{figure}[htb!] \centering \includegraphics[width=\textwidth]{Plots/sharpness_vs_critlr.pdf} \caption{We plot $2/\lambda_1$ versus the maximal initial learning rate $\eta^{\ast}$ for 25 initializations per architecture, for CIFAR-10 and MNIST. We use architectures with $\text{width} / \text{depth} = 16$, with the same depths given in \autoref{fig:const_width_depth_smallinputlr}, in order to ensure that we compute $\eta^{\ast}$ that preserve the established power relationship.} \label{fig:sharpness_milr_comparison} \end{figure} Based on \autoref{fig:sharpness_milr_comparison}, we again observe strong power relationships at initialization. We also provide another version of this figure, where we average over initializations for each architecture, in \autoref{appendix: averaged_comparison}. It is also worth noting that for any given point in the above plots, $\eta^{\ast}$ is clearly greater than $2/\lambda_1$. Recall that by definition, the computed $\eta^{\ast}$ ensures that the performance of a network initialization does at least as well as a linear classifier on a given dataset, without diverging. This goes against the ``Learning Rate $\leq2/\lambda_1$'' rule for the convergence of SGD that is often taken for granted, hence supporting the recent lines of work that question this notion. \section{Estimates for the Largest Eigenvalue of the Loss Hessian at Initialization}\label{sec:thm} In this section, we present our main theoretical result, Theorem \ref{thm:HS}, which computes the average squared Frobenius norm of the loss Hessian at initialization Before stating it exactly, we present informally a simple corollary that gives bounds for the largest eigenvalue of the loss Hessian at initialization. \begin{corollary}[Informal]\label{cor:lambda1} Consider a randomly initialized fully connected ReLU network of constant width, and denote by $\lambda_1$ the largest eigenvalue of the Hessian of an empirical MSE loss. We have the following upper bound on the largest eigenvalue: \[ \Ee{\abs{\lambda_1}}=O( \text{depth}\times\text{width} ) \] and the following lower bound on the sharpness: \[ \Ee{\frac{2}{\text{sharpness}}}=\Ee{\frac{2}{\abs{\lambda_1}}}= \Omega\lrr{\frac{1}{\text{depth}\times\text{width} }}, \] where the average in both estimates is over initialization. Both these bounds come from the estimate \[ \Ee{\text{sum of squared eigenvalues of loss Hessian}} = \text{const}\times \text{depth}\times\text{width} \lrr{1+O\lrr{\frac{1}{\text{width}}}}. \] \end{corollary} \vspace{.1cm} The preceding estimates show that depth times width, the key parameter which we found determines the maximal initial learning rate and the sharpness, naturally appears when computing the Frobenius norm of the loss Hessian (see also \autoref{thm:HS}) and hence can be used to obtain bounds on $\abs{\lambda_1}$ and sharpness at initialization. \subsection{Formal Statements} In order to state this Corollary and Theorem \ref{thm:HS} more precisely, we need some notation. We consider a ReLU network, which for an input $x\in \mathbb{R}^{n_0}$ outputs $z_{1}^{(L+1)}(x)\in \mathbb{R}$ via intermediate hidden layer pre-activations $z^{(\ell)}(x)\in \mathbb{R}^{n_\ell}$ as follows: \[ z_{i}^{(\ell+1)}(x)=\begin{cases} \sum_{j=1}^{n_\ell}W_{ij}^{(\ell)}\sigma\lrr{z_{j}^{(\ell)}(x)},&\quad \ell\geq 1\\ \sum_{j=1}^{n_\ell}W_{ij}^{(1)}x_{j},&\quad \ell=0 \end{cases},\qquad i = 1,\ldots,n_\ell. \] Note that we have set the biases in the network to $0$. Moreover, we will assume that the weights are independent Gaussians \[ W_{ij}^{(\ell)}\sim \mathcal N\lrr{0,\frac{2}{n_{\ell-1}}}\quad \text{independent}. \] Our goal is to understand the Hessian \[ H^{(L+1)}:= \lrr{ \partial_{W_{ij}^{(\ell)}}\partial_{W_{i'j'}^{(\ell')}}\mathcal L,\quad \ell,\ell'=1,\ldots, L+1,\quad i,i'=1,\ldots, n_{\ell},\quad j,j'=1,\ldots, n_{\ell-1}} \] of the empirical MSE \[ \mathcal L = \frac{1}{2k}\sum_{i=1}^k \lrr{z_1^{(L+1)}(x_i)-y_i}^2 \] over a collection of $k$ input-output pairs $(x_i,y_i)$. More precisely, we will compute the mean of the squared Frobenius norm \begin{equation}\label{eq:HS-def} \Ee{\norm{H^{(L+1)}}_{F}^2} = \Ee{\sum_{\ell,\ell'=1}^{L+1}\sum_{i,i'=1}^{n_{\ell}}\sum_{j,j'=1}^{n_{\ell-1}}\lrr{ \partial_{W_{ij}^{(\ell)}}\partial_{W_{i'j'}^{(\ell')}}\mathcal L }^2}, \end{equation} where the average is over the Gaussian distribution of the weights. Our main result is \begin{theorem}\label{thm:HS} Fix $n_0\geq 1$ as well as $c,C>0$ and a network input $x$ satisfying $\norm{x}^2=n_0$. There exist a constant $C_1$, depending only on $c,C$ with the following property. For any $L\geq 1$ there exists a constant $C_2$, depending only on $L,c,C$ such that for any $n\geq 1$ if \[ cn \leq n_1,\ldots, n_L\leq Cn, \] then \[ \abs{\Ee{\norm{H^{(L+1)}}_{F}^2} - C_1 n^2 L^2 }\leq C_2 n. \] \end{theorem} \vspace{.1cm} The preceding Theorem immediately implies the following upper bound on the largest eigenvalue of $H^{(L+1)}$ and its reciprocal: \begin{corollary}[Precise Statement of Corollary \ref{cor:lambda1}]\label{cor:lambda1-formal} with the notation of Theorem \ref{thm:HS} denote by $\lambda_1$ the largest eigenvalue of the Hessian of an empirical MSE loss. There exists a constant $K>0$ depending only on the constants $n_0, C,c$ from Theorem \ref{thm:HS} such that \[ \Ee{\abs{\lambda_1}}=KnL\lrr{1+O(n^{-1})} \] and \[ \Ee{\frac{2}{\text{sharpness}}}=\Ee{\frac{2}{\abs{\lambda_1}}}\geq \frac{1}{KnL}\lrr{1+O(n^{-1})}, \] where the average is over initialization. \end{corollary} \begin{proof} Since the squared Frobenius norm of $H^{(L+1)}$ is the sum of squares of its eigenvalues, we find from Theorem \ref{thm:HS} that \[ \Ee{\abs{\lambda_1}}\leq \sqrt{\Ee{\lambda_1^2}}\leq \sqrt{ \Ee{\norm{H^{(L+1)}}_F^2}} = C_1^{1/2} n L( 1+ O(n^{-1})). \] Further, since $x\mapsto 1/x$ is convex on $(0,\infty)$, we have \[ \Ee{\frac{2}{\text{sharpness}}}=\Ee{\frac{2}{\abs{\lambda_1}}}\geq \frac{2}{\Ee{\abs{\lambda_1}}} \geq \frac{2}{C_1^{1/2} n L}( 1+ O(n^{-1})). \] \end{proof} \subsection{Idea of Proof of Theorem \ref{thm:HS}} Our strategy for estimating the Frobenius norm of $H^{(L+1)}$ is to proceed recursively in $L$. To explain the main idea we need some notation. First, we will use $\mu,\nu$ to denote generic variables indexing network weights. Next, for any $\ell=1,\ldots, L$ and any expressions $f_k(z)$ depending on $z$ and $\partial_\mu z$ we write \begin{equation}\label{eq:Y-def-i} \Y{\ell}{f_1,\ldots, f_k} :=\Ee{ \sum_{\mu\leq \ell} \frac{1}{n_\ell^k}\sum_{j_1,\ldots, j_k=1}^{n_\ell} f_{1}(z_{j_1}^{(\ell)})\cdots f_k(z_{j_k}^{(\ell)})}. \end{equation} Thus, for example \[ \Y{\ell}{z\partial_\mu z} = \Ee{ \sum_{\mu\leq \ell} \frac{1}{n_\ell}\sum_{j=1}^{n_\ell} z_j^{(\ell)}\partial_\mu z_{j}^{(\ell)}}. \] In both cases, $\mu\leq \ell$ denotes the collection of weights in layers $1,\ldots, \ell$. Similarly, if the functions $f_k(z)$ depend in addition on $\partial_\nu z$ and $\partial_{\mu\nu}z$ then we we will write \begin{equation}\label{eq:Y-def} \Y{\ell}{f_1,\ldots, f_k} :=\Ee{ \sum_{\mu,\nu\leq \ell} \frac{1}{n_\ell^k}\sum_{j_1,\ldots, j_k=1}^{n_\ell} f_{1}(z_{j_1}^{(\ell)})\cdots f_k(z_{j_k}^{(\ell)})}. \end{equation} Thus, for example \[ \Y{\ell}{\lrr{\partial_\mu z}^2,z\partial_{\mu\nu}z} = \Ee{ \sum_{\mu\leq \ell} \frac{1}{n_\ell^2}\sum_{j_1,j_2=1}^{n_\ell}\lrr{ \partial_\mu z_{j_1}^{(\ell)}}^2 z_{j_2}^{(\ell)}\partial_{\mu\nu}z_{j_2}^{(\ell)}}. \] The key steps in proving Theorem \ref{thm:HS} are now as follows: \begin{enumerate} \item Integrate out the weights in layer $L+1$ to rewrite $\Ee{\norm{H^{(L+1)}}_F^2}$ in terms of various $Y^{(L)}$'s. This is one in Lemma \ref{lem:H-rec} and Corollary \ref{cor:H-Y}. Since the Hessian involves second derivatives, the $Y^{(L)}$ that appear depend on various combinations of $z,\partial_\mu z,\partial_\nu z, \partial_{\mu\nu }z$. \item Obtain consistent recursive expressions for the $Y^{(\ell+1)}$'s that depend only $z,\partial_\mu z$ in terms of $Y^{(\ell)}$'s that depend only on the same expressions. This is done in Lemma \ref{lem:Ymu-recs}. Each such recursion is derived by considering two cases. First, the case where the parameter $\mu$ is a weight in layer $\ell+1$. This gives expressions no longer containing any derivatives that depend only on moments of the norm of the vector of pre-activations $z^{(\ell)}$ at layer $\ell$. Such moments are well-known. Second, the case where the parameter $\mu$ is a weight in layers $1,\ldots, \ell$. By explicitly integrating out the weights in layer $\ell+1$, we obtain expressions involving various $Y^{(\ell)}$. \item Solve the recursions for the $Y^{(\ell+1)}$'s that depend only $z,\partial_\mu z$ to understand how they grow with depth and width. This is done in Corollary \ref{cor:Ymu-form}. \item Obtain consistent recursive expressions for the $Y^{(\ell+1)}$'s that depend only $z,\partial_\mu z, \partial_\nu z, \partial_{\mu\nu}z$ in terms of $Y^{(\ell)}$'s that depend only on the same expressions. This is done in Lemma \ref{lem:Ymunu-recs}. The strategy is the same as in deriving Lemma \ref{lem:Ymu-recs}, except one must consider three cases: $\mu,\nu$ are both weights in layer $\ell+1$, exactly one of $\mu,\nu$ is a weight in layer $\ell+1$, and neither of $\mu,\nu$ are weights in layer $\ell+1$. \item Solve the recursions for the $Y^{(\ell+1)}$'s that depend only $z,\partial_\mu z, \partial_\nu z, \partial_{\mu\nu}z$ to understand how they grow with depth and width. This is done in Corollary \ref{cor:Ymunu-form}. \item Combine Corollaries \ref{cor:H-Y}, \ref{cor:Ymu-form}, and \ref{cor:Ymunu-form} to obtain estimates for the average of the squared Frobenius norm of $H^{(L+1)}$. \end{enumerate} \section{Acknowledgements} The authors gratefully acknowledge a range of funding sources. Specifically, BH was funded by NSF CAREER grant DMS-2143754 as well as NSF grants DMS-1855684 and DMS-2133806. DR was funded the Canada CIFAR AI Chairs Program. The authors also are grateful for support from the NSERC Discovery Grants program, material support from NVIDIA in the form of computational resources, and technical support from the Mila IDT team in maintaining the Mila Compute Cluster.
\section{Introduction} \IEEEPARstart{O}{ver} the last decade and especially with the recent advent of data-driven approaches, many studies have been investigating the separation of audio sources found in media content; whether addressing the separation of speech from non-speech in speech enhancement~\cite{WDL2018, reddy2020interspeech}, speech from other speech in speech separation~\cite{Hershey2016,Drude2019, wichern2019wham}, individual musical instruments in music source separation~\cite{rafii2017musdb, stoter19, manilow2019slakh} or non-speech sound events (or sound effects) in universal sound separation~\cite{kavalerov2019universal,Tzinis_ICASSP2020, pishdadian2020finding,ochiai2020listen}, source separation finds its fit in many fields of application. Separating an audio mixture (e.g., movie soundtrack) into the three broad categories of speech, music, and sound effects (understood to include ambient noise and natural sound events) has however been left largely unexplored despite a wide domain of practical applications. A system properly trained on this task could indeed offer many potential benefits from the consumer standpoint, such as enhancing the listening experience by means of independent volume control over the sources (i.e., remixing), enabling the automatic captioning of sound events, or improving speech transcription accuracy, to name a few. \begin{figure}[t] \centering \includegraphics[width=.97\linewidth]{figs/cocktail_fork_new3_slim-crop.pdf}\vspace{-.1cm} \caption{Illustration of the cocktail fork problem: given a soundtrack consisting of an audio mixture of speech, music, and sound effects, the goal is to separate it into the three corresponding stems.}\vspace{-.2cm} \label{fig:cocktail_fork} \end{figure} In our preliminary work % \cite{petermann2022cfp}, we formalized this new task of music-sound effects (SFX)-speech separation for real-world soundtracks as the cocktail fork problem (CFP), as illustrated in Fig.~\ref{fig:cocktail_fork}, and introduced a dataset specifically tailored towards this task, the Divide and Remaster (DnR) dataset, to foster research on this topic. We benchmarked multiple existing popular source separation models and proposed a multi-resolution short-time Fourier transform (STFT) architecture to better address the variety of acoustic characteristics of the three source types. We reported model performance in terms of scale-invariant signal-to-distortion ratio (SI-SDR)~\cite{leroux2019sdr} and showcased the benefit of our proposed model, which produced SI-SDR improvements over the mixture of 11.0 dB for music, 11.2 dB for speech, and 10.8 dB for sound effects. We additionally included an analysis on system performance under different overlapping source conditions. Finally, we investigated separation performance at different sampling rates. In this work, we explore the natural extension of the CFP towards transcription, and explore multiple techniques for integrating source separation and transcription such that the performance of both can be improved. The DnR dataset includes time-stamped annotations for all three source types, in the form of speech transcription for speech, music genre labels for music, and sound-event tags for SFX. Specifically, we investigate transcription for the CFP with the following novel contributions: \begin{itemize} \item We present an activity detection system for the three parent classes (music, speech, SFX). By first detecting boundaries, we can then use sophisticated speech recognition and audio tagging models that expect pre-segmented chunks of audio as input. % \item We showcase the benefit of integrating the output of our activity detection system with our source separation model by means of various conditioning mechanisms. \item We investigate the three classification tasks using well-established pre-trained models. For music genre and sound-event tagging, we evaluate YAMNet, a deep net that predicts 521 audio event classes from the AudioSet-YouTube corpus~\cite{gemmeke2017audioset}. For speech transcription, we evaluate a conformer-based end-to-end automatic speech recognition (ASR) model provided by ESPnet~\cite{li2021espnetse}. The model is pre-trained on LibriSpeech~\cite{librispeech_dataset}, the same dataset DnR is based on. \item We explore the idea of source remixing, that is, the act of weighting and adding the separated sources back together, with the goal of increasing classification performance. We show that, in some cases, due to the imperfect nature of the separation, transcription can benefit from source remixing compared to using the raw separation output. \item In addition to SDR, we propose to evaluate our source separation models using two other metrics, that are arguably closer to human perception for audio quality assessment: PESQ~\cite{rix2001pesq} for speech and the 2f-model~\cite{kastner20192fmodel} for all three sources. \end{itemize} In this paper, we aim at further investigating the CFP task, not only from the source separation angle as previously achieved, but from that of transcription as well. We hope this paper serves as an important step to a system which would not only be capable of enhancing the listening experience but provide additional semantic understanding as well. \section{Related Work on the interaction between separation and downstream tasks} \label{sec:related_work} The three broad categories of music, speech, and sound effects in audio signals can be found in many different types of settings, from podcasts to radio broadcasts, movies and TV-shows, their presence and overlap are ubiquitous. In more elementary scenarios, for example involving only one or two of the three classes, the task of source separation has been well investigated and has shown great promises towards various downstream tasks. For instance, separating individual instruments in musical signals has been found to be beneficial towards music transcription \cite{manilow2020cerberus}, source remixing in the context of music production \cite{woodruff2006remixingSM}, or even towards audio compression \cite{yang2021compression}. In the context of noisy speech, speech enhancement (or speech denoising) has shown great promise towards ASR tasks \cite{subramanian2019asr, chang2022chime4}. More recent work proposed a joint audio-tagging and ASR system capable of fulfilling both tasks simultaneously \cite{moritz2020all}. Conversely, several works have considered how classification can improve performance in the context of general sound separation~\cite{Tzinis_ICASSP2020} or music separation \cite{slizovskaia2019class, hung2020multitask}. The interaction between voice activity detection and speech enhancement has also been explored \cite{verteletskaya2010speechactivity, tan2021speech}. While the quality of source separation output has no doubt increased dramatically in the deep learning era, artifacts in the separated outputs remain a big problem. For speech enhancement in broadcast applications in particular, recent studies~\cite{westhausen2021reduction, torcoli2021controlling} have shown that remixing the separated speech with some amount of the separated noise can substantially reduce artifacts and improve the listening experience compared to the noisy original. In this paper, we explore how similar remixing ideas can benefit the downstream transcription tasks of ASR, sound event detection, and music genre classification. Particularly in complex mixtures, where many sounds may interfere with the source of interest, transcription becomes a very challenging task. One way to address this obstacle and potentially improve on the classification output would be to somehow reduce the amount of interfering sources in the mixture and consequently benefit the transcription task. For speech, the idea of using speech enhancement as a front end for recognition has been widely explored \cite{kalinli2010nat, li2021espnetse}. However, these front-end systems are not perfect and may lead to artifacts and unwanted residual noises in the clean speech estimates, which ultimately may negatively affect the downstream ASR task. In \cite{koizumi2021snri}, the authors propose to overcome this limitation by introducing a mechanism controlling an optimal level of noise reduction for the ASR task. An approach for learning whether to use the enhanced speech or the noisy mixture for ASR was presented in~\cite{sato2022learning}, where the authors ultimately found a soft combination between the enhanced signal and the noisy mixture signal performed best. A related study~\cite{iwamoto2022bad} also demonstrated the benefit of remixing the enhanced speech and the noisy mixture for ASR. In this work, we not only evaluate remixing for ASR in the presence of difficult music and sound effect background signals, but also study the benefit of remixing separated signals for sound event tagging and music genre recognition. In \cite{turpault2020crnn}, the authors evaluated source separation as a pre-processing step to improve the sound-event detection (SED) task by first breaking down mixtures into their constituent sounds. % SED was then applied by combining the separated sources and the input mixture at different stages in the architecture. Although the separator is not trained jointly in this case (and consequently no active remixing is performed during training), one could argue that the remixing may be done implicitly within the SED network. Source separation in music applications often focuses on remixing separated musical stems~\cite{yang2022don}. Separation has also been widely used for music transcription (i.e., scoring), either as a pre-processing front-end~\cite{gupta2020automatic, chiu2021source} or within a joint approach % \cite{manilow2020cerberus,lin2021unified}. % In \cite{chadna2022framework}, the authors extensively explore the idea of source separation specifically applied to choir ensemble mixtures, allowing for a set of potential downstream applications such as $F_0$ contour analysis, synthesis, transposition, unison analysis, as well as singing group remixing. In \cite{wierstorf2017remix}, the authors investigate existing source separation algorithms and their perceptual impact on songs given various remixing scenarios. The claim suggests that existing separation approaches may suffer from imperfect separation, resulting in perceptible artifacts on individual source estimates, which can then jeopardize downstream task performance. To the best of our knowledge, there has not been any work investigating the task of music source remixing specifically targeted towards downstream labeling tasks such as genre recognition in a manner similar to what we explore in this work. \section{Methods} \label{sec:methods} \subsection{Problem Setup} \begin{figure*} \centering \includegraphics[width=1.0\textwidth]{figs/overall_pipeline_v2.pdf}\vspace{-.1cm} \caption{Overall separation, activity detection, and transcription pipeline. In \textbf{Stage I}, the activity detector $\Phi_{\text{EI}}$ is trained to provide frame-level activity labels for the three CFP classes (music, speech, SFX). In \textbf{Stage II}, MRX-C, a label-informed version of MRX, is trained using the activity label provided by $\Phi_{\text{EI}}$. Lastly, in \textbf{Stage III}, we proceed to total transcription for a given CFP mixture by first estimating its sources and frame-level labels. The transcription for the three sources is then achieved on the source estimates and using the frame labels.}\vspace{-.6cm} \label{fig:overall_pipeline} \end{figure*} In this work, we assume that we observe a single-channel mixture $x\in\mathbb{R}^T$ composed of three submixes: \begin{equation} x = y^{(s)}+y^{(m)}+y^{(e)}, \label{equation:cfp_mixture} \end{equation} where $y^{(s)}$ is the submix containing all speech signals, $y^{(m)}$ that of all music signals, and $y^{(e)}$ that of all sound effects. We use the term sound effects (SFX) to broadly cover all sources not categorized as speech or music, and choose it over alternatives such as sound events or noise, as the term is especially relevant to our target application where $x$ is a soundtrack. We here define the cocktail fork problem as that of recovering, from the audio soundtrack $x$, its music, speech, and sound effect submixes, as opposed to extracting individual musical instruments, speakers, or sound effects. \input{tables/transcription_example} Additionally, we consider the case where the submixes have associated collections $l^{(s)}_{1:N_s}$, $l^{(m)}_{1:N_m}$, $l^{(e)}_{1:N_e}$ of metadata labels describing the content for each source type. % Specifically, as illustrated by the examples in Table~\ref{table:transcription_example}, for speech we consider the speech recognition task where label $l^{(s)}_{i_s}$ represents the transcription of the $i_s$-th utterance and associated time boundaries, with index $i_s\in\{1,\dots,N_s\}$, where $N_s$ is the number of utterances in $y^{(s)}$. Similarly, $l^{(m)}_{i_m}$ represents a music genre label and associated time boundaries for the $i_m$-th music excerpt. For sound effects, $l^{(e)}_{i_e}$ represents a list of audio tags describing the $i_e$-th sound event, along with the associated time boundaries; these tags are further split into two sub-categories of foreground events (SFX-Fg) such as ``dog barking'' and background events (SFX-Bg) such as ``traffic noise,'' which are treated separately for transcription. In this work, we focus both on separation applications where the goal is to recover estimates $\hat{y}^{(s)}, \hat{y}^{(m)}, \hat{y}^{(e)}$ of the submixes, and on transcription applications where the goal is to estimate metadata label collections $\hat{l}^{(s)}_{1:N_s}$, $\hat{l}^{(m)}_{1:N_m}$, $\hat{l}^{(e)}_{1:N_e}$ given a mixture $x$ and its associated source separation outputs $\hat{y}^{(s)}, \hat{y}^{(m)}, \hat{y}^{(e)}$. In the same vein as some of the remixing approaches presented in Section~\ref{sec:related_work}, we explore the idea of source remixing towards the three transcription downstream tasks. Our working hypothesis is that, while source separation likely helps the downstream networks to reach a better performance on their respective tasks, it is imperfect, with the presence of added interferences and artifacts, and adding back a \emph{down-scaled} version of the predicted constituents in each of the target sources (e.g., music and SFX signals in the speech signal for ASR) prior to performing the transcription may help improve performance. More formally, this can be formulated as follows: \begin{align} \Tilde{y}^{(i)} = \tau_i^{(s)} \hat{y}^{(s)} + \tau_i^{(m)} \hat{y}^{(m)} + \tau_i^{(e)} \hat{y}^{(e)}, \quad i \in \{s,m,e\}, \label{equation:remixing} \end{align} where $\Tilde{y}^{(s)}$, $\Tilde{y}^{(m)}$, and $\Tilde{y}^{(e)}$ denote the remixed separated sources, and $\tau_i^{(j)}$ denotes the time invariant gain applied to the separated estimated of source $j$ to obtain the remixed source $i$, e.g., $\tau_m^{(s)}$ is the gain applied to the separated speech estimate $\hat{y}^{(s)}$ when remixing for music transcription. Taking the example of speech transcription, the gain $\tau_s^{(s)}$ applied to the speech estimate $\hat{y}^{(s)}$ is set to always remain at unit level, while the gains $\tau_s^{(m)}$ and $\tau_s^{(e)}$ of the interfering sources $\hat{y}^{(m)}$ and $\hat{y}^{(e)}$, respectively, are adjusted (either individually or jointly) to match a target SNR. In the individual case, the gains are set to \begin{equation} \tau_s^{(j)} = \frac{\|\hat{y}^{(s)}\|_2}{\|\hat{y}^{(j)}\|_2} 10^{- {\scriptstyle\text{snr}_s^{(j)}}/{20}}, \quad j \in \{m,e\}, \label{equation:snr_individual} \end{equation} where $\text{snr}_s^{(m)}$ is the desired SNR of the rescaled speech signal with respect to the rescaled music signal, and $\text{snr}_s^{(e)}$ is defined similarly with respect to the rescaled sound effect signal. Alternatively, we can adjust the gain to reach a desired SNR $\text{snr}_s^{(m+e)}$ of the speech signal with respect to the sum of the two interfering source signals $\hat{y}^{(m+e)}=\hat{y}^{(m)}+\hat{y}^{(e)}$, i.e., \begin{equation} \tau_s^{(m+e)} = \frac{\|\hat{y}^{(s)}\|_2}{\|\hat{y}^{(m+e)}\|_2} {10^ {-{\scriptstyle\text{snr}_s^{(m+e)}}/{20}}}. \label{equation:snr_combined} \end{equation} Note that, in all cases, we assume that the power of each separated source signal $\hat{y}^{(j)}$ is roughly equal to the power of the corresponding ground-truth source signal ${y}^{(j)}$, which holds in practice if the separation quality is reasonable. An overview of our proposed approach is shown in Fig.~\ref{fig:overall_pipeline}, and we now describe all stages in detail. \subsection{Source Separation with MRX} \label{sec:cfp_ss} In our preliminary work~\cite{petermann2022cfp}, we found that time-frequency (TF) separation models generally worked well, and we observed additional benefit from jointly evaluating multiple TF resolutions to better handle the diverse acoustic characteristics present in mixtures of speech, music, and sound effects. Therefore, in this work, we use the multi-resolution crossnet (MRX) introduced in \cite{petermann2022cfp} and shown in Fig.~\ref{fig:xumx_mixed} as our main network architecture. MRX takes a time-domain input mixture $x$ and encodes it into $I$ complex spectrograms $X_{W_i}=\text{STFT}_{W_i}(x),$ $i\in\{1,\dots,I\}$ with different STFT resolutions, where $W_i$ denotes the $i$-th window length in milliseconds. Fig.~\ref{fig:xumx_mixed} shows an example with $I=3$ and $\{W_1,W_2,W_3\}=\{32,64,256\}$. We use the same hop size (e.g., 8 ms in the example of Fig.~\ref{fig:xumx_mixed}) for all resolutions, so they remain synchronized in time, and $N$ denotes the number of STFT frames for all resolutions. In practice, we set the window size in samples to the nearest power of $2$, and the number of unique frequency bins is denoted as $F_{W_i}$. Each resolution is then passed to a fully connected block to convert the magnitude spectrograms of dimension ${N \times F_{W_i}}$ into a consistent dimension of $512$ across the resolution branches. This allows us to average them together prior to the bidirectional long short-term memory (BLSTM) stacks, whose outputs are averaged once again. MRX was inspired by the Cross-Unmix (XUMX) architecture proposed in~\cite{sawata2021all}. However, in our case, the input averaging is intended to allow the network to efficiently combine inputs with multiple resolutions. The average inputs and outputs of the BLSTM stacks are concatenated and decoded back into magnitude soft masks $\hat{M}^{(j)}_{W_i}$, one for each of the three sources $j\in\{s,m,e\}$ and each of the $I$ original input resolutions $W_i$. The decoder consists of two stacks of fully-connected layers, each followed by batch normalization (BN) and rectified linear units (ReLU). For a given source $j$, each magnitude mask $\hat{M}^{(j)}_{W_i}$ is multiplied element-wise with the original complex mixture spectrogram $X_{W_i}$ for the corresponding resolution, a corresponding time-domain signal $\hat{y}^{(j)}_{W_i}$ is obtained via inverse STFT, and the estimated time-domain signal $\hat{y}^{(j)}$ is obtained by summing the time-domain signals at each resolution: \begin{equation} \hat{y}^{(j)} = \sum_{i=1}^{I} \hat{y}^{(j)}_{W_i}= \sum_{i=1}^{I}\text{iSTFT}( \hat{M}^{(j)}_{W_i} \odot X_{W_i} ). \label{equation:mrx} \end{equation} \begin{figure}[t] \centering \includegraphics[width=.95\linewidth]{figs/xumx_fig_TASLP-crop.pdf}\vspace{-.1cm} \caption{Multi-resolution CrossNet (MRX) architecture.}\vspace{-.5cm} \label{fig:xumx_mixed} \end{figure} For the cocktail fork problem, the network has to estimate a total of $3I$ masks. % Since ReLU is used as the final mask decoder nonlinearity, the network can freely learn weights for each resolution that best reconstruct the time-domain signal. We use the SI-SDR loss function~\cite{luo2019convTasNet,leroux2019sdr} between the estimated signal $\hat{y}^{(j)}$ and the ground-truth signal $y^{(j)}$ for $j\in\{s,m,e\}$. We now investigate how source separation and activity detection may benefit from each other. \subsection{Stage I: Using source separation to improve activity detection} \label{sec:cfp_ad} As a first step towards transcribing the separated speech, music, and sound effects stems, we focus on detecting the temporal regions where each source is active. Only these detected temporal regions for each source are then fed to the appropriate downstream classifiers, namely, ASR for speech, genre recognition for music, and audio tagging for sound effects. End-to-end (E2E) ASR systems are typically sensitive to extended silent portions occurring between utterances as well as extensive utterance length, and may not work optimally when fed unsegmented signals. Similarly, for music and sound effects, we can pool over temporal regions to obtain more accurate tagging performance. Formally, we define $A=(a_{j,n})_{j,n}\in\{0,1\}^{3\times N}$ as the ground-truth activity labels, with elements $a_{j,n}=1$ indicating that source $j\in\{s,m,e\}$ is active at frame $n$, and $a_{j,n}=0$ that it is inactive. Note that the ground-truth activity labels are defined by the presence of an active excerpt at frame $n$ as defined in the metadata, rather than its energy, so pauses in a speech utterance or a song may still be considered active. Our goal is to obtain estimated activity labels $\hat{A}=(\hat{a}_{j,n})_{j,n}\in\mathbb{R}^{3\times N}$, using a neural network $\Phi$ applied to an input representation $R$ derived from the mixture of interest: \begin{equation}\label{equation:crnn} \hat{A}=\Phi(R). \end{equation} The network is trained to minimize the binary cross-entropy between $A$ and $\hat{A}$ over the training set: \begin{multline} \mathcal{L}(A,\hat{A})=\sum_{j,n}\text{BCE}(a_{j,n},\hat{a}_{j,n}) \\ =\sum_{j,n} \Big(-a_{j,n} \text{log}(\hat{a}_{j,n}) - (1 - a_{j,n}) \text{log}(1 - \hat{a}_{j,n})\Big). \label{equation:pc_loss} \end{multline} At inference time, we apply a median filter over time and threshold $\hat{A}$ to determine boundaries. We denote as $\hat{A}_j$ for the estimated activities for source $j$. For the core architecture of the neural network $\Phi$, we use a convolutional recurrent neural network (CRNN), as such architectures have proven to be highly effective in the context of sound event detection \cite{pishdadian2020finding, baumann2021crnn, debenito2021multi}, with mel spectrograms as the input representation. The estimated activity labels $\hat{a}_{j,n}$ are in the range $[0,1]$ as they are the outputs of a sigmoid activation function. Our baseline $\Phi_{\text{B}}$ simply takes the mel spectrogram $X_{\text{mel}}$ of the mixture as input, and we denote its output as $\hat{A}^{(\text{B,mix})}=\Phi_{\text{B}}(X_{\text{mel}})$. In \cite{turpault2020crnn}, multiple source-separation-based algorithms are proposed to improve sound event detection. We explore such approaches for the CFP as shown in Stage I of Fig.~\ref{fig:overall_pipeline}. In the first approach, \textbf{early integration} (EI), the input to a CRNN $\Phi_{\text{EI}}$ is formed by stacking the mel spectrograms of the mixture and estimated sources along the channel dimension, i.e., \begin{equation}\label{equation:early_integration} \hat{A}^{(\text{EI})}=\Phi_{\text{EI}}(\text{stack}(X_{\text{mel}}, \hat{Y}^{(s)}_{\text{mel}}, \hat{Y}^{(m)}_{\text{mel}}, \hat{Y}^{(e)}_{\text{mel}})). \end{equation} The input is thus of shape $(4\times N \times F)$ where $F$ is the number of mel bands, and $N$ the number of time frames. In \textbf{middle integration} (MI), $X_{\text{mel}}$ and the $\hat{Y}^{(j)}_{\text{mel}}$ are each individually input into the CNN block of a CRNN $\Phi_{\text{MI}}$, and their outputs are stacked before being fed to the RNN block. Both CRNNs $\Phi_{\text{EI}}$ and $\Phi_{\text{MI}}$ are trained using Eq.~(\ref{equation:pc_loss}), with the source separation network kept frozen. Finally, in \textbf{late integration} (LI), the baseline CRNN $\Phi_{\text{B}}$ is used to process independently the mel spectrograms $X_{\text{mel}}$ of the mixture and $\hat{Y}^{(j)}_{\text{mel}}$ of each estimated source to obtain the corresponding output probabilities $\hat{A}^{(\text{B,mix})}$ and $\hat{A}^{(\text{B},j)}=\Phi_{\text{B}}(\hat{Y}^{(j)}_{\text{mel}})$ (for example, $\hat{A}^{(\text{B},s)}\in{\mathbb R}^{3\times N}$ denotes the estimated activity labels of all three sources within the separated speech estimate). These probabilities are then combined to obtain the late integration estimates $\hat{A}^{(\text{LI})}$ as: \begin{equation} \hat{A}^{(\text{LI})} = \frac{1}{2}\hat{A}^{(\text{B,mix})} + \frac{1}{2}\Big(\frac{\hat{A}^{(\text{B},s)}+\hat{A}^{(\text{B},m)}+\hat{A}^{(\text{B},e)}}{3}\Big). \end{equation} In this work, all three fusion approaches will be compared in Section \ref{section:results}. We found that the early integration approach was the one that worked best for the CFP activity detection. We refer the interested reader to the original work on the topic \cite{turpault2020crnn} for further technical details. \subsection{Stage II: MRX-C -- Using activity detection to improve source separation}\label{sec:mrx_c} As shown in Stage II of Fig.~\ref{fig:overall_pipeline}, we also explore how activity detection can benefit source separation, by conditioning our MRX separation models on the activity detection output. In our conditioning approach, which we call MRX-C, we concatenate class probabilities $\hat{A}$ obtained at the output of one of the configurations of Section~\ref{sec:cfp_ad} with the MRX input mixture STFT at each resolution shown in Fig.~\ref{fig:xumx_mixed}. % Beside concatenation, we also experimented with a FiLM \cite{perez2018film} conditioning approach, which consisted in using a FiLM layer placed after each of the MRX STFT operations in Fig.~\ref{fig:xumx_mixed}. This approach led to very similar results to the concatenation counterpart in preliminary experiments, we thus opted to use the concatenation for all further experiments. Because the frame rate of the CRNN outputs may be lower than the STFT frame rate of MRX due to temporal pooling operations, we use nearest neighbor upsampling to match the frame rates. We further explore the impact of using the ground-truth class labels during the training and inference stages as the upper bound oracle performance. We also explored running two consecutive iterations, or passes, of Stage I and Stage II of Fig.~\ref{fig:overall_pipeline}, which we denote MRX-C$_{\text{2p}}$, where the suffix ``2p'' refers to ``2 passes''. As a comparison to the approaches combining activity detection and separation explored in this section, we also consider a multi-task learning approach that jointly does activity detection and source separation~\cite{hung2020multitask, tan2021speech}, referred to as MRX-MTL. Here, an additional decoder layer with three sigmoid outputs is added in parallel to the separation decoders in Fig.~\ref{fig:xumx_mixed} to estimate activity detection. A time average pooling layer with a factor of eight is applied at the input of this decoder to be consistent with the CRNN output resolution, and a weighted binary cross-entropy loss is added to the separation loss for training. \subsection{Stage III: CFP Transcription} \label{sec:cfp_transcription} In this section, we focus on downstream transcription tasks using the remixed source separation outputs and source activity boundaries. Specifically, we investigate audio tagging for music (in the form of music genre recognition) and sound effects, and ASR for speech. % \subsubsection{Audio Tagging} To transcribe music and sound effects, we make use of the powerful pre-trained audio tagging model YAMNet\footnote{\url{https://github.com/tensorflow/models/tree/master/research/audioset/yamnet}}, which predicts 521 audio event tags, including multiple music genres and sound effects classes. YAMNet is based on the MobileNet convolutional architecture~\cite{howard2017mobilenet}, and has been trained on the AudioSet Ontology~\cite{jort201audioset}, a human-labeled corpus derived from short Youtube audio segments. YAMNet operates on 960 ms frames with 50\% overlap, and outputs a vector of 521 class activity probabilities for each frame. The output layer uses sigmoid activation functions, so multiple classes (i.e., tags) can be active for each frame. In practice, we input the entire soundtrack (either the mixture, separated sources, or remixes) into YAMNet, and then average the class probabilities over segments estimated by the activity detector. Example annotations from a soundtrack are shown in Table~\ref{table:transcription_example}. % For music, we typically do not expect there to be multiple pieces of music playing simultaneously, so we limit the estimated tag to a single one describing the predominant music genre. As we are considering music genre classification, we only take into account the YAMNET outputs corresponding to music genre classes. In real-world soundtracks, sound effects typically serve two main purposes: \emph{background events} that usually entail longer and lower amplitude sounds that help set the scene (e.g., rain, traffic), and \emph{foreground events} which are shorter and louder to help tell the story (e.g., gun shot, footsteps). For this reason, we further sub-divide the sound effects audio tagging task into foreground (SFX-Fg) and background (SFX-Bg) sub-tasks as illustrated in Table~\ref{table:transcription_example}. Unlike for music genre, we allow sound events to be labeled with multiple tags from the AudioSet ontology (e.g., dog, bark, animal). Furthermore, sound events from both SFX-Bg and SFX-Fg can overlap in time as shown in the example of Table~\ref{table:transcription_example}. While our goal is to separate and annotate a single sound effects stem, because of the widely different characteristics of SFX-Fg and SFX-Bg sound events, we consider them separately when creating synthetic mixtures in Section~\ref{sec:dataset} and when evaluating audio tagging performance in Section~\ref{subsec:cfp_results_remixing}. However, for evaluating source separation and activity detection performance in Section~\ref{subsec:cfp_results_ss}, we consider SFX-Fg and SFX-Bg jointly as a single sound effects class. \begin{figure} \centering \includegraphics[width=.97\linewidth]{figs/espnet_pipeline.pdf}\vspace{-.0cm} \caption{Illustration of our ASR evaluation pipeline using ESPnet. We first segment the full 60-second utterance into smaller chunks using $\Phi$'s output. Each of the resulting sub-utterances are then individually fed to ESPnet for decoding. Finally their hypotheses are concatenated and compared against the full-utterance reference.}\vspace{-0.cm} \label{fig:espnet_pipeline} \end{figure} \subsubsection{Speech Transcription} We evaluate ASR using a model pre-trained on the LibriSpeech corpus. Specifically, we use a state-of-the-art end-to-end (E2E) model implemented in ESPnet \cite{li2021espnetse} that is based on the Conformer \cite{gulati2020conformer} architecture and uses HuBERT \cite{hsu2021hubert} input features. In general, a soundtrack contains multiple speech utterances interspersed among non-speech regions, which may cause difficulty when feeding the unsegmented soundtrack (be it the mixture, separated sources, or remixes) into an ASR model. Therefore, we evaluate the E2E ASR model using the approach shown in Fig.~\ref{fig:espnet_pipeline}, where the activity detector $\Phi_{\text{EI}}$ first retrieves individual utterances which can then be individually input to the E2E ASR model. The individual utterance hypotheses from the E2E ASR model are then concatenated and evaluated against the full-file reference. \section{Experimental Setup} \label{sec:exp_design} \subsection{Divide and Remaster (DnR) dataset}\label{sec:dataset} The DnR dataset was introduced in our preliminary work~\cite{petermann2022cfp} with the goal of creating synthetic monophonic soundtracks for training and evaluating source separation algorithms. The dataset is publicly available along with the data creation scripts\footnote{\url{https://cocktail-fork.github.io}}, and further details on the creation process are available in~\cite{petermann2022cfp}. DnR is created by mixing speech from LibriSpeech~\cite{librispeech_dataset}, music from the Free Music Archive (FMA)~\cite{fma_dataset}, and sound effects from the Freesound Dataset 50k (FSD50K) \cite{fsd50k_dataset}. All of the DnR building blocks contain audio at sampling rates of 44.1 kHz or greater (by default LibriSpeech is available at 16 kHz, but the original 44.1 kHz mp3 files are available), so we use 44.1 kHz as the default sampling rate for DnR. This enables real-world listening applications, and can easily be downsampled for transcription where high bandwidth is unnecessary. For FSD50k, we manually classify each of the 200 class labels into one of 3 groups: foreground sounds (e.g., dog bark), background sounds (e.g., traffic noise), and speech/musical instruments (e.g., guitar, speech). Speech and musical instrument clips are filtered out to avoid confusion with our speech and music datasets, and we use different mixing rules for foreground and background events. Many synthetic mixing pipelines for source separation such as wsj0-2mix~\cite{Hershey2016} or speech/music/noise separation~\cite{zhang2021multitask} create fully-overlapped mixtures, with arbitrarily selected source levels. However, models trained on these datasets may not robustly transfer to real-world situations without full-overlap~\cite{menne2019dpcl}. Therefore, we took great care in DnR to make mixtures that are sufficiently realistic in terms of source overlap and relative amplitude level between the three classes. In order to ensure that a mixture could contain multiple full speech utterances and feature a sufficient number of onsets and offsets between the different classes, we decided to make each mixture 60 seconds long. We do not allow within-class overlap between speech and music clips, i.e., two music files (or two speech files) will not overlap, but foreground and background sound effects can overlap. This mixing procedure leads to, approximately, $55\%$ of the DnR test set frames having speech, music, and sound effects active, $32\%$ containing two of the three, $10\%$ containing one of the three, and $3\%$ silent frames. Regarding the relative amplitude levels across the three classes, after analyzing studies such as~\cite{chaudhuri2018ava} and informal mixing rules from industries such as motion pictures, video games, and podcasting, we follow an approach where speech is generally found at the forefront of the mix, followed by foreground sound effects, then music, and finally background sound effects. DnR contains 3,406 60-second mixtures for training, 487 for validation, and 973 for testing. Along with the audio, DnR also contains transcription metadata in a format similar to the example of Table~\ref{table:transcription_example}. The start and end times correspond to where in the 60 s mixture the original clip was inserted. The gain applied to the clip is also available from the metadata, but is not shown in the example of Table~\ref{table:transcription_example}. For speech utterances, we use the unaltered transcription of the sentence from the LibriSpeech metadata. For music, we list all genres from the FMA annotations, but we use only the top-level genre (corresponding to 16 commonly used labels such as ``jazz'' or ``rock'') in our genre recognition experiments. For sound effects, we list all tags from the FSD50K metadata, and also note whether the clip is used as a foreground or background event. \subsection{Source Separation} \label{ssec:separation_design} \subsubsection{XUMX and MRX models} We consider single-resolution XUMX baselines with various STFT resolutions. We opt to cover a wide range of window lengths $W \in \{32,64,128,256\}$ to assess the impact of resolution on performance. For our proposed MRX model, we use three STFT resolutions of 32, 64, and 256 ms, which we found to work best on the validation set. We use XUMX$_{W}$ to denote a model with a $W$ ms window. We set the hop size to a quarter of the window size. For the MRX model, we determine hop size based on the shortest window. To parse the contributions of the multi-resolution and multi-decoder features of MRX, we also evaluate an architecture adding MRX’s multi-decoder to the best single-resolution model (XUMX$_{64}$), referred to as XUMX$_{64,\text{multi-dec}}$. This results in an architecture of the same size (i.e., same number of parameters) as our proposed MRX model. In all architectures, each BLSTM layer has 256 hidden units and input/output dimension of 512, and the hidden layer in the decoder has dimension 512. For all MRX models, we use a sampling rate of 44.1 kHz. \subsubsection{Other benchmarks} We also evaluate our own implementations of Conv-TasNet \cite{luo2019convTasNet} and a temporal convolution network (TCN) with mask inference (MaskTCN). The sampling rate is again 44.1 kHz for all models. MaskTCN uses an identical TCN to the one used internally by Conv-TasNet, but the learned encoder and decoder are replaced with STFT and iSTFT operations. For MaskTCN, we use an STFT window/hop of 64/16 ms, and for the learned encoder/decoder of Conv-TasNet, we use 500 filters with a window size of 80 samples and a stride of 40. All TCN parameters in both Conv-TasNet and MaskTCN follow the best configuration of~\cite{luo2019convTasNet}. Additionally, we evaluate Open-Unmix (UMX)~\cite{stoter19}, the predecessor to XUMX, by training a separate model for each source, but without the parallel branches and averaging operations introduced by XUMX. The Conv-TasNet, UMX, XUMX, and MRX models all use SI-SDR \cite{luo2019convTasNet,leroux2019sdr} as loss function, while MaskTCN uses the waveform domain $L_1$ loss. All models are trained on 9 s chunks, except MaskTCN, trained on 6 s chunks, and Conv-TasNet, trained on 2 s chunks; we found these values to lead to best performance under our GPU memory constraints. All models are trained for 300 epochs using ADAM. The learning rate is initialized to $10^{-3}$, and halved if the validation loss is not improved over 3 epochs. \subsection{Activity Detection} The activity detection CRNN models described in Section~\ref{sec:cfp_ad} follow the DCASE 2020 Task 4 baseline architecture and its extensions as described in \cite{turpault2020crnn}, based on the publicly available implementation\footnote{\url{https://github.com/turpaultn/dcase20_task4}}. We use the ADAM optimizer with a learning rate of $10^{-4}$, $\beta_1=0.9$, and $\beta_2=0.999$. We train the systems for 80 epochs and select the weights returning the lowest loss score on the validation set. Prior to training, the data is preprocessed in the following manner. First, we convert all the 60-second long input mixtures into mel spectrograms with 64 bands, using an FFT size of 2048 and hop-length of 512. During training, we randomly sample 10-second long chunks, which translate to 864 temporal frames, from the resulting features. Note that due to the CRNN pooling operations, the number of frames is reduced by a factor of 8 in contrast to the initial input temporal dimension, reducing the number of temporal frames from $864$ at the input down to $108$ at the output. The activity predictions are obtained by applying a median filter of size $5$ over time and thresholding $\hat{A}$ at $0.5$. \subsection{MRX-C models} The conditioned MRX-C models described in Section~\ref{sec:mrx_c} follow the same training pipeline as our MRX model described above. For the conditioning portion, the activity labels are obtained for the entirety of the DnR dataset prior to training by using our best performing activity detection model (later described in Section~\ref{subsec:cfp_results_ss}), the early-integration model $\Phi_{\text{EI}}$. During training and inference, the labels are upsampled to the length of the input mixture spectrogram using the nearest neighbor algorithm. % The multi-task learning model MRX-MTL is optimized on a compound objective function consisting of the SI-SDR and binary cross entropy losses, with their respective weight being $1.0$ and $10.0$. \subsection{Transcription} \subsubsection{Music Genre Recognition} As YAMNet was originally trained on 16 kHz audio data, all audio involved in our YAMNet experiments is first resampled from 44.1 kHz down to 16 kHz. The audio signal goes through a set of transforms prior to network input. First the magnitude spectrogram is obtained through the STFT transform using a window size of 25ms and hop size of 10ms, the spectrogram is then mapped to 64 mel bins covering a 125-7500Hz range in order to obtain its mel transform. Lastly, a stabilized log operation is applied to it. YAMNet uses 960 ms frames overlapped at 50\%. Since the DnR mixtures are 60 s long, we obtain 124 YAMNet frames for each DnR mixture. One challenge encountered when using YAMNet for the music classification task was the mapping from the 16 top-level genre labels used in the FMA dataset, to one of the 521 sound-event classes from the Audioset ontology used by YAMNet. Ten of the genres had straightforward mapping between FMA and Audioset, namely Pop, Rock, Soul-RnB, Jazz, Country, Electronic, Blues, Hip-hop, Folk, and Classical. The ``International'' genre used by FMA could be mapped to multiple Audioset genres (e.g., ``Music of Asia'', ``Music of Africa''), however, this one-to-many mapping provided very poor performance. The YAMNet ``Vocal Music'' category consistently yielded high confidence when fed music labeled as ``International'' by FMA, as these audio files typically contained singing with little-to-no instrumental parts. Therefore, we mapped ``International'' to ``Vocal Music''. There are 5 FMA genres that we excluded from the classification task as they were overly broad and had no appropriate Audioset genre counterpart (Experimental, Easy Listening, Instrumental, Spoken, and Old-time/historic). Any clips containing these 5 genres were still used for evaluation of music separation and activity detection, but they were ignored when evaluating music genre recognition performance using YAMNet. \subsubsection{Sound Event Detection} To filter music and speech clips from FSD50K during the DnR data creation process, we removed a clip if the majority of its tags were related to speech or music. The size of the FSD50K tag vocabulary after this filtering was reduced from 200 to 146. Furthermore, for YAMNet compatibility, we had to exclude 26 additional tags for the followings reasons: \begin{itemize} \item The class is an actual parent class in AudioSet, therefore not covered in YAMNet output (e.g., ``Domestic\_sounds\_and\_home\_sounds"). \item The class does not have any examples in AudioSet, therefore it is not covered in YAMNet output (e.g., ``Gull\_and\_seagull"). \item The tag contains a music or speech label (e.g., ``Male\_speech\_and\_man\_speaking"), even though a majority of its tags are not related to music and speech. \end{itemize} We then split the remaining 120 tags into SFX-Fg (85 tags) and SFX-Bg (35 tags). We treat the classification tasks for SFX-Fg and SFX-Bg separately, as we expect relatively poor performance for SFX-Bg due to its low relative level and long duration, which likely overlaps with multiple foreground events in DnR. When using YAMNet outputs for the music genre, SFX-Fg, and SFX-Bg tasks, we first filter the 521 class probabilities output by YAMNet at each time frame to only contain those relevant for the given task (i.e., 11 classes for music, 85 for SFX-Fg, and 35 for SFX-Bg). In practice, we would use the boundaries provided by the activity detector to sum the class probabilities across all relevant frames for a given segment, and then output any tags with a class probability above a threshold. However, in our experiments, whose results are described in Section~\ref{subsec:cfp_results_remixing}, we aim to evaluate how source separation and remixing can aid soundtrack transcription without having activity detection performance play an out-sized role. We therefore use oracle event boundaries for summing YAMNet probabilities. This also allows us to use threshold independent metrics such as mean average (mAP) precision and area under the ROC curve (AUC), without having to account for missed detections and false alarms. Furthermore, it enables evaluation of the SFX-Fg and SFX-Bg tasks separately, given that our activity detector only outputs overall sound effect boundaries. \subsubsection{Automatic Speech Recognition} All audio is downsampled to 16 kHz, prior to being input to the HuBERT \cite{hsu2021hubert} feature extraction frontend of the pre-trained Conformer-based \cite{gulati2020conformer} ESPnet model\footnote{\url{https://huggingface.co/espnet/simpleoier_librispeech_asr_train_asr_conformer7_hubert_ll60k_large_raw_en_bpe5000_sp}}. As we will demonstrate in Section~\ref{subsec:cfp_results_remixing}, inputting an entire unsegmented 60 s DnR file, which contains multiple utterances interspersed with noise/silence regions, leads to highly sub-optimal ASR performance. Therefore, using the activity detector to first segment speech regions, and then passing each segment to the ASR model before concatenating all the outputs (as previously discussed and illustrated in Fig.~\ref{fig:espnet_pipeline}) was essential to obtaining acceptable ASR performance. Since we evaluate the concatenated transcriptions with the ground-truth transcription from the entire soundtrack, we can easily compare performance using estimated activity detection boundaries and oracle boundaries in terms of word error rate (WER) and character error rate (CER) using the noisy mixture, separated speech stem, or remixed speech stem. \section{Experimental Results} \label{section:results} \subsection{CFP Separation and activity detection} \label{subsec:cfp_results_ss} \input{tables/peaq_pesq} In this section, we evaluate source separation performance in terms of signal reconstruction metrics for listening applications, as well as the interaction between source separation and sound activity detection. SI-SDR~\cite{leroux2019sdr} is perhaps the most widely used objective measure for deep learning-based source separation, and was used in our preliminary study~\cite{petermann2022cfp}. However, as shown in~\cite{torcoli2021objective}, SI-SDR is not among the objective metrics most correlated with perceptual quality. Therefore, in this work, we also report results using the {2f-model} \cite{kastner20192fmodel}, which combines two mid-level perceptual features from the Perceptual Evaluation of Audio Quality (PEAQ) \cite{colomes1999peaq} standard (we used the PEAQ implementation from~\cite{kabal2002examination}). The 2f-model was fit to output estimates of MUSHRA scores ranging from 0 to 100, and sound signals were upsampled from 44.1 kHz to 48 kHz for input into the PEAQ model. To avoid any influence due to the scaling of the output, which is particularly an issue for models trained with SI-SDR loss, we normalize all outputs to have the same LUFS as their corresponding ground truth. For the speech source, we also report wideband Perceptual Evaluation of Speech Quality (PESQ) \cite{rix2001pesq}, where sound signals are downsampled to 16 kHz. Table~\ref{table:pesq_peaq} presents the SI-SDR, PESQ, and 2f values of various models trained and tested on DnR, in addition to the ``No Processing'' condition (lower bound, using the mixture as estimate) and oracle phase sensitive mask~\cite{erdogan2015psf} (a form of upper bound). For each model, SI-SDR improvements are fairly consistent across source types, despite the differences in their relative levels in the mix, which can be seen in the ``No Processing'' SI-SDR. In general, we observe that our proposed multi-resolution (MRX) models outperform all single-resolution baselines on all source types in terms of SI-SDR, PESQ, and the PEAQ-based 2f-model scores. This implies that the network learns to effectively combine information from different STFT resolutions to more accurately reconstruct the target sources. The performance of $\text{XUMX}_{\text{64,multi-dec}}$ further confirms this hypothesis by performing nearly identically in comparison to $\text{XUMX}_{\text{64}}$, showing that the use of multiple decoders alone does not improve performance. We also observe that the single-source models (UMX) tend to perform comparably to the cross-source models (XUMX, MRX) for speech, but perform worse for music and SFX. We speculate that because music and SFX are quieter in the mix, it is harder for the network to isolate them effectively without the support of the other sources, while louder sources (here, speech) do not benefit from joint estimation. \input{tables/mrx} From Table~\ref{table:pesq_peaq}, we see that concatenating activity detection labels with the input spectrogram in the MRX-C model leads to the best overall separation performance, with some gains observed for all metrics compared to MRX. To further evaluate the impact of including activity detection labels as auxiliary inputs for source separation, Table~\ref{table:model_results} compares different settings for activity-conditioned source separation. We note that MRX-C leads to an average SI-SDR improvement of 0.7 dB compared to MRX when using oracle information, meaning the upper bound in expected performance improvement is limited, however larger improvements are observed for the quieter and more difficult to separate sources (i.e., music and SFX). When we switch to the realistic setup that does not use oracle information at test time, we see that training using estimated activity detection probabilities leads to a 0.2 dB improvement compared to using oracle information. We also observe that running multiple passes between activity detection and separation (MRX-C$_{\text{2p}}$) led to no performance improvement. Finally, we also considered a multi-task learning setup, where activity detection was used only as an additional training objective (MRX-MTL), but observed a degradation in performance compared to our plain MRX model. \input{tables/pc_classification} While we have just seen how activity detection can improve separation, we now turn our focus to how separation can aid activity detection. Table~\ref{table:activity_f_measure} displays the sound event detection performance in terms of parent-class F-measure computed using the SED EVAL package~\cite{mesaros2016metrics}. We used a threshold of 0.5, a collar of 750 ms for event-based metrics (with a 20\% offset length), and a time resolution of 1 s for segment-based metrics. Compared to a Baseline taking the mixture signal as input, little improvement is observed using multi-task learning of activity detection and source separation (MRX-MTL). When integrating source separation output into our three-class activity detector, we observed the best performance using early or middle integration, which differs from the permutation-invariant analysis in~\cite{turpault2020crnn} where late integration performed best. We suspect that integrating permutation-invariant source separation outputs at the input or at intermediate layers of the sound event detection network may cause difficulties during training, as the order in which separated outputs are stacked may change between training epochs. However, for problems such as the one studied in this paper, where separated outputs have a fixed ordering, the activity detection network does not have this inconsistency problem and hence early and middle integration perform better than late integration. \subsection{CFP Transcription and Remixing} \label{subsec:cfp_results_remixing} \subsubsection{Audio Tagging (Music and SFX)} We report audio tagging performance in terms of mAP and mAUC metrics using the implementation from~\cite{chen2020vggsound}. Both mAP and mAUC allow us to evaluate audio tagging performance in a threshold-independent way for situations where multiple tags can be active for a single sound file, and are commonly reported for large-scale audio tagging~\cite{hershey2017cnn, gemmeke2017audioset, fsd50k_dataset}. Table~\ref{table:remix} displays the audio tagging performance for music, SFX-Fg, and SFX-Bg sources using oracle event boundaries. The ``Noisy'' column is obtained from the original mixture and represents lower-bound performance, and the ``GT'' column represents upper-bound performance obtained using the ground-truth isolated sources. The scores for music are generally higher than for SFX, because there is only a single genre tag for each music segment, the set of possible music labels is smaller than for SFX, and SFX-Fg and SFX-Bg sounds may overlap as discussed in Section~\ref{sec:dataset}. The ``MRX-C'' column from Table~\ref{table:remix} displays audio tagging performance using the separated outputs of MRX-C, our best separation model. It can be seen that for all sources in Table~\ref{table:remix}, source separation improves audio tagging performance compared to the noisy mixture. The improvements for Music and SFX-Fg are larger than those for SFX-Bg, likely because those sources have higher relative levels in the DnR mixes. The ``MRX-C Remix'' column in Table~\ref{table:remix} shows the test set results of the systems which obtain the best performance on the validation set for each source in a grid search over remixing gains, as illustrated in Fig.~\ref{fig:results_music_sfx_snr}. % Figure \ref{fig:results_music_sfx_snr} provides a detailed illustration of the impact of different remixing gains on mAP and mAUC for music and SFX. The first row of Figs.~\ref{fig:music_snr}, \ref{fig:sfx_fg_snr}, and \ref{fig:sfx_bg_snr} shows remixing results on the validation set for the case where interfering source gains are adjusted individually as in~\eqref{equation:snr_individual}, while the second row shows the results on the validation and test sets for the case where the gains are adjusted jointly as in~\eqref{equation:snr_combined}. For each plot in Fig.~\ref{fig:results_music_sfx_snr}, the data points denoted by the intersections with the red line indicates the best validation set performance for the given metric over different remixing SNR values. In almost all use-cases, we see that both mAP and mAUC benefit from some source remixing in comparison to using the predicted source as the sole signal input. While music and SFX-Fg show only minor classification improvement with remixing, in the case of SFX-Bg, performance peaks at a much lower SNR, meaning that this source specifically benefits by remixing the other sources for its classification task. \input{tables/remix} \begin{figure}[htp] \centering \subfloat[mAP/mAUC remixing performances for Music]{% \includegraphics[width=.97\linewidth]{figs/music-snr-map-mauc_cv.pdf}\vspace{-.1cm} \label{fig:music_snr} } \subfloat[mAP/mAUC remixing performances for SFX-Fg]{% \includegraphics[width=.97\linewidth]{figs/sfx-fg-snr-map-mauc_cv.pdf}\vspace{-.1cm} \label{fig:sfx_fg_snr} } \subfloat[mAP/mAUC remixing performances for SFX-Bg]{% \includegraphics[width=.97\linewidth]{figs/sfx-bg-snr-map-mauc_cv.pdf}\vspace{-.1cm} \label{fig:sfx_bg_snr} } \caption{mAUC and mAP music genre classification mappings as a function of Music SNR against interfering sources. The contour plots (first row) show the classification performance on the validation set depending on the SNR against each interfering source individually, while the second row shows the performance on the validation and test sets for the scenario where the two interfering sources are combined in order to compute the SNR. The red symbols along the red dashed lines denote the performance on the test set (circle) where the best validation set performance is observed (triangle).} \label{fig:results_music_sfx_snr} \end{figure} \subsubsection{Automatic Speech Recognition} Table \ref{table:espnet} presents ASR results using ESPnet for three segmentation methods: using the oracle speech utterance onsets/offsets (``Oracle Boundaries''), using the onsets/offsets detected by $\Phi_{\text{EI}}$ (``VAD Boundaries''), and no segmentation (``No Boundaries''). We first note that in the ``No Boundaries'' case, ASR performance degrades dramatically, indicating that our pre-trained ASR model cannot handle 60 s long files containing multiple utterances. We tried training the ASR model from scratch on the DnR dataset speech files, but the performance still significantly lagged that of inputting segmented utterances into the pre-trained ASR model. We also note from Table~\ref{table:espnet} that performance on the original LibriSpeech test set (``Libri.\ Test-Clean'') and the clean DnR speech submix (``DnR Speech GT'') is comparable in the case of oracle boundary segmentation, which is to be expected since they are identical utterances with slightly different levels added during the DnR data creation process. Performance degrades dramatically when the noisy DnR mixture is used for ASR, which is also to be expected since our model is pre-trained using clean speech. When using the separated speech stem from MRX-C, we obtain a 10.5\% absolute (or 60\% relative) reduction in WER compared to the noisy mixture when using VAD boundaries. In the case of ASR, artifacts introduced by the separation process can degrade performance, and only partially separating the speech has been shown to improve performance~\cite{iwamoto2022bad, sato2022learning, koizumi2021snri}. Figure~\ref{fig:pesq_wer} displays the performance in terms of WER and PESQ on the validation set obtained for a grid search over the relative level between the remixed separated speech signal and the interference signals. Note that due to the large computational expense of speech decoding, we perform a grid search only for the combined (SFX+music) interference signal as described in~\eqref{equation:snr_combined}. For WER, a minimum is observed at 17.5 dB, which is selected as the gain for the MRX-C Remix system. In the ``MRX-C Remix'' row of Table~\ref{table:espnet}, we observe that by remixing the separated interference signal back with the estimated speech, WER is reduced from 7.0\% down to 6.3\% using VAD boundaries. In the case of PESQ, the non-remixed speech MRX-C output performs best. That is, MRX-C reports a PESQ score of 2.87, while the best scenario denoted by our remixing experiments is found at SNR set to 40 dB with a PESQ score of 2.85. This underscores the importance of remixing for transcription, while the benefit for listening end-goals is unclear (at least in terms of PESQ), but this is an important topic of future work. \input{tables/espnet} \begin{figure}[htp] \centering \includegraphics[width=.97\linewidth]{figs/wer_pesq.pdf}\vspace{-.0cm} \caption{WER (\%) and PESQ performances on speech as a function of speech SNR against interfering sources (Music and SFX). Once again the symbols along the red dashed lines denote the points where the best validation set performance is observed (triangle) as well as the test-set performance associated with it (circle).}\vspace{-0.cm} \label{fig:pesq_wer} \end{figure} \section{Conclusions and Discussions} \label{sec:conclusion} In this work, we extended our previous work on the cocktail fork problem by tackling transcription for each of the three sources involved: audio tagging for music and sound effect, and ASR for speech. We proposed an activity detection system for the three parent classes and showcased its benefits towards both the separation and transcriptions tasks; we first demonstrated how the system could help improve separation by using the activity labels as conditioning information. Secondly, we described how the integration of an activity detection mechanism was essential in order to tackle real-world soundtrack transcription tasks. We led an extensive investigation to show how source remixing could help towards transcription and demonstrated that mixing back the interfering signals with the isolated source estimates could help improve performance on their associated transcription downstream task. In the present work, we explored how transcription benefited from source-remixing strategies, due to the imperfect nature of our separator output. Beside negatively impacting the transcription downstream tasks, the presence of separation artifacts undoubtedly deteriorates the listening experience as well. Moving forward, we aim to explore source-remixing strategies that could minimize perceptual artifacts for the separator output and enhance the listening experience. While we approached this work from a fully supervised angle, for both separation and transcription, taking advantage of the large amount of ``real-world'' unlabeled data available is an important topic for our future work. \bibliographystyle{IEEEtran}
\section{Introduction} A hypergraph is a pair $(V,E)$ where $V$ is a set of vertices and $E$ is a set of edges. An edge in a hypergraph is a non-empty subset of $V$. Thus the total number of edges is at most $2^{|V|}-1$. More precisely, this is valid for {\em simple} hypergraphs, i.e., hypergraphs without repeated edges; we will consider only simple hypergraphs. Hypergraphs \cite{HG-book,Jost22} provide a natural extension of graphs \cite{Diestel,Flajolet}, and simplicial complexes \cite{Hatcher,Dima15,Ginestra16}. Hypergraphs and similar objects known as multilayer and higher-order networks \cite{Ginestra18,Bick21,Soumen22} encode higher-order interactions. Such interactions are inevitable in several ecological, financial, and social networks \cite{KR03,KR05-balance,Leskovec16,Ghrist,Lepri21,Petri22a,Kleinberg22a,Kleinberg22b}, and play important role in brain networks \cite{brain05,brain09,brain11}. Binary interactions are traditionally used in physics, but higher-order interactions appear e.g. in recent studies of toy models of quantum chaos \cite{chaos20,chaos21a,chaos21b,chaos21c,chaos22}. Random graphs are well-explored \cite{Drmota,Newman-book,Frieze,Hofstad}. Studies of random simplicial complexes (see \cite{Pippenger,Linial06,Meshulam,Linial16,Farber16,Ginestra16-NGF,Farber17a,Farber17b,Bobrowski17,Ginestra17,Ginestra-Sergey,Ginestra18-NGF,Kahle,Dima22} and references therein) are more recent. Simplicial complexes are beautiful but they require too strict mutual inclusion of interactions. Hypergraphs relax the assumption of mutual inclusion and represent a much broader class of systems with higher-order interactions. The analyses of random hypergraphs are gaining popularity. As with other large random structures, static random hypergraphs have been the first research subject \cite{Shamir,Newman09}, and they are still actively investigated \cite{Chodrow20,Dumitriu21b,Masuda,Petri22b,Ren22,Marc22}. Special families of static random hypergraphs, e.g., regular (where each vertex belongs to the same number of edges) and uniform (where each edge contains the same number of vertices) are relatively well understood, see \cite{Shamir,Cooley18,Cooley21,Dumitriu21a,Li21,Isaev}. Statistical physics models on random hypergraphs is another growing area of research, see e.g. \cite{Lenka17,Louise19,Louise20,Ginestra21,Cooley22}. Many hypergraphs are evolving, and our goal is to investigate a `null' model of growing random hypergraphs. We will ignore degradation, i.e., disappearance of vertices and edges, and consider hypergraphs growing via stochastic rules. When the hypergraphs become large, basic characteristics of these random hypergraphs are usually self-averaging, so the average values provide the chief information. (Some more subtle characteristics may remain non-self-averaging.) The cumulants and full probability distributions remain interesting even when a random quantity exhibits a self-averaging behavior, and for a few self-averaging quantities we will compute all cumulants and probability distributions. To motivate our model we begin with primordial hypergraph consisting of a single vertex and a single edge composed of that vertex. We study hypergraphs growing from the primordial hypergraph according to the following recursive rule: At each step, a new node $v$ is added together with a new edge obtained by adding $v$ to an edge $e$ chosen uniformly among existing edges. Hence the new edge is $e\cup {v}$. The number of vertices is always equal to the number of edges: \begin{equation} |V| = |E| = N \end{equation} This recursive procedure generates random recursive hypergraphs (RRHs). We call $N$ the size of the RRH. Treating $N$ as a (discrete) time variable allows one to study the evolution of RRHs. For $N=2$, the RRH hypergraph has the edge set \begin{eqnarray*} E = [\{v_1\}, ~\{v_1, v_2\}] \end{eqnarray*} Thus, the outcome of the growth procedure is deterministic for $N=2$. Starting from $N=3$, more than one hypergraphs can be built by the RRH procedure. For $N=3$, two edge sets \begin{subequations} \begin{align} \label{122} &E = [\{v_1\}, ~\{v_1, v_2\}\,, ~\{v_1, v_3\}] \\ \label{123} &E = [\{v_1\}, ~\{v_1, v_2\}\,, ~\{v_1, v_2,v_3\}] \end{align} \end{subequations} are formed with equal probability. The RRHs model is parameter-free and its definition mimics the definition of random recursive trees (RRTs), a paradigmatic parameter-free model of growing random trees \cite{Drmota,Frieze,Hofstad}. RRTs are engaging in their own right (see \cite{Pittel94,KR02,Janson05,Janson15,Janson19} and references therein). More importantly, the RRT is a mother model of growing networks as its simple deformations lead to interesting growing network models \cite{Kleinberg,KR01,KR02-fluct,KR05,BK10,KR-copy,KR14,Bertoin15,KR17,Sumpter22}. For instance, adding redirection generates preferential attachment in some models \cite{Kleinberg,KR01,KR14} and non-self-averaging behaviors in others \cite{KR14,KR17,Sumpter22}. Other simple deformations of the RRT generate dense networks \cite{KR-copy} that are poorly understood. Similarly to RRTs, hypergraphs built via the RRH rule are tractable and admit neat analytical description. Take, for instance, the total number $\mathcal{N}_1(N)$ of vertexes each belonging to a singe edge. For instance, $\mathcal{N}_1(3)=2$ for the hypergraph \eqref{122} and $\mathcal{N}_1(3)=1$ for the hypergraph \eqref{123}. The random variable $\mathcal{N}_1(N)$ has the probability distribution \begin{equation} \label{N1:Euler} \text{Prob}[\mathcal{N}_1(N)=n]=\frac{1}{(N-1)!}\,\eulerian{N-1}{n-1} \end{equation} expressible via Eulerian numbers. Another simple quantity is the total number $\mathcal{R}_2(N)$ of edges of size two. For instance, $\mathcal{R}_2(3)=2$ for the hypergraph \eqref{122} and $\mathcal{R}_2(3)=1$ for the hypergraph \eqref{123}. The random variable $\mathcal{R}_2(N)$ has the probability distribution \begin{equation} \label{R2:Stirling} \text{Prob}[\mathcal{R}_2(N)=r]=\frac{1}{(N-1)!}\,{N-1\brack r} \end{equation} expressible via Stirling numbers of the first kind. In Sec.~\ref{sec:DD}, we study the degree distribution of RRHs. The quantity $\mathcal{N}_1(N)$ is the number of vertexes of degree one, and we show that its distribution is given by \eqref{N1:Euler}. We also demonstrate that the average degree $\langle \mathcal{N}_k(N)\rangle$ distribution exhibits remarkable stationarity, namely, it is strictly linear in $N$ for all degrees $k\leq N-1$. The edge size distribution of RRHs is studied in Sec.~\ref{sec:rank} where among other results we derive \eqref{R2:Stirling}. In Sec.~\ref{sec:leader}, we discuss leaders in degree \footnote{The primordial vertex has the highest degree $N$, so the leader is the vertex with the highest degree among vertexes different from the primordial.}. We also analyze the dependence of the degree distribution of a vertex on its index. For instance, the degree of the second vertex has a uniform degree distribution, so it is a non-self-averaging quantity strongly fluctuating from realization to realization. In Sec.~\ref{sec:leaves}, we study leaves and determine their probability distribution in the $N\to\infty$ limit. In Sec.~\ref{sec:RD}, we deform the RRH model. Specifically, we employ the same growth rule as in the RRH model with probability $1-r$; with probability $r$, we redirect the randomly chosen edge $e$ to its maternal edge $e'$ and call $e'\cup v$ the new edge. In Sec.~\ref{sec:concl}, we comment on possible directions of future research and briefly mention a few natural deformations of the RRH model. \section{Degree Distribution} \label{sec:DD} The degree of a vertex in a hypergraph is the number of edges containing it \begin{equation} \label{degree:def} d(v) = \#\{e\,| ~v\in e\} \end{equation} Let $\mathcal{N}_k(N)$ be the total number of vertices of degree $k$: \begin{equation} \label{Nk:def} \mathcal{N}_k= \#\{v: \,d(v)=k\} \end{equation} The RRHs of size $N=1$ and $N=2$ are deterministic: $\mathcal{N}_1(1)=1$ and $\mathcal{N}_1(2)=\mathcal{N}_2(2)=1$. For $N \geq 3$, the quantities $\mathcal{N}_k(N)$ with $k<N$ are random. Generally \begin{equation} \label{norm} \sum_{k=1}^N \mathcal{N}_k(N) = N \end{equation} The maximal degree is equal to the size of the hypergraph, and there is only one vertex with maximal degree, the primordial vertex that belongs to every edge: \begin{equation} \label{max-degree} \mathcal{N}_N(N) = 1 \end{equation} \subsection{Vertices of degree one} \label{subsec:1} The total number of vertices of the smallest degree, $\mathcal{N}_1(N)$, is a random quantity for $N\geq 3$. We already know \begin{equation} \mathcal{N}_1(3) = \begin{cases} 2 & \text{prob} ~~1/2\\ 1 & \text{prob} ~~1/2 \end{cases} \end{equation} The recursive nature of the process shows that \begin{equation} \label{N1N} \mathcal{N}_1(N+1) = \begin{cases} \mathcal{N}_1+1 & \text{prob} ~~1-\mathcal{N}_1/N\\ \mathcal{N}_1 & \text{prob} ~~ \mathcal{N}_1/N \end{cases} \end{equation} for $N\geq 2$. Hereinafter we often omit the dependence of $N$, e.g., $\mathcal{N}_1$ means $\mathcal{N}_1(N)$; we explicitly write $\mathcal{N}_1(N+1)$ to avoid confusion. Averaging \eqref{N1N} shows that $N_1=\langle \mathcal{N}_1\rangle$ satisfies the recurrence \begin{equation} \label{N1-rec} N_1(N+1)=\left(1-\frac{1}{N}\right)N_1+1 \end{equation} for $N\geq 2$. Using the known value $N_1(2)=1$ as the boundary condition we solve \eqref{N1-rec} and find \begin{equation} \label{N1-sol} \langle \mathcal{N}_1\rangle = N_1 = \frac{N}{2}\,, \qquad N\geq 2 \end{equation} Similarly one can compute higher moments of the random quantity $\mathcal{N}_1$. The second moment $\langle \mathcal{N}_1^2\rangle$ satisfies the recurrence \begin{equation} \label{N2-rec} \langle \mathcal{N}_1^2(N+1)\rangle=\left(1-\frac{2}{N}\right)\langle \mathcal{N}_1^2\rangle+N+\frac{1}{2} \end{equation} when $N\geq 2$. Solving \eqref{N2-rec} subject to the boundary condition $\langle \mathcal{N}_1^2(3)\rangle=5/2$ we find that for $N\geq 3$ \begin{equation} \label{N2-sol} \langle \mathcal{N}_1^2\rangle= \frac{N(3N+1)}{12} \end{equation} The variance $V_1=\langle \mathcal{N}_1^2\rangle_c\equiv \langle [\mathcal{N}_1-N_1]^2\rangle$ is \begin{equation} \label{Var-N1} V_1= \frac{N}{12} \end{equation} for $N\geq 3$. The random quantity $\mathcal{N}_1(N)$ is concentrated around its average in the large $N$ limit. More precisely, the probability distribution $P(\mathcal{N}_1, N)$ is asymptotically Gaussian: \begin{equation} P_1(\mathcal{N}_1, N)\simeq \sqrt{\frac{6}{\pi N}}\,\text{exp}\!\left[-\frac{6(\mathcal{N}_1 -N/2)^2}{N}\right] \end{equation} Let us look at the behavior of higher cumulants. The third moment $\langle \mathcal{N}_1^3\rangle$ obeys the recurrence \begin{equation*} \label{N3-rec} \langle \mathcal{N}_1^3(N+1)\rangle=\left(1-\frac{3}{N}\right)\langle \mathcal{N}_1^3\rangle+\frac{(N+1)(3N+1)}{4} \end{equation*} which is solved for $N\geq 4$ to find \begin{equation} \label{N3-sol} \langle \mathcal{N}_1^3\rangle= \frac{N^2(N+1)}{8} \end{equation} The prediction \eqref{N3-sol} remains valid even for $N=3$. Surprisingly, the third cumulant vanishes \begin{eqnarray} \label{N1-cum3} \langle \mathcal{N}_1^3\rangle_c\equiv \langle [\mathcal{N}_1-N_1]^3\rangle = 0 \end{eqnarray} The fourth moment $\langle \mathcal{N}_1^4\rangle$ obeys the recurrence \begin{equation*} \label{N4-rec} \langle \mathcal{N}_1^4(N+1)\rangle=\left(1-\frac{4}{N}\right)\langle \mathcal{N}_1^4\rangle+\frac{6N^3+15N^2+9N+2}{12} \end{equation*} which is solved to give \begin{equation} \label{N4-sol} \langle \mathcal{N}_1^4\rangle= \frac{N(15N^3+30N^2+5N-2)}{240} \end{equation} for $N\geq 5$. Combining \eqref{N4-sol} with previous results \eqref{N1-sol}, \eqref{N2-sol}, \eqref{N3-sol} for lower moments we extract a neat expression for the fourth cumulant: \begin{equation} \label{N1-cum4} \langle \mathcal{N}_1^4\rangle_c = -\frac{N}{120} \end{equation} for $N\geq 5$. Equations \eqref{N1-sol}, \eqref{Var-N1}, \eqref{N1-cum3} and \eqref{N1-cum4} for the cumulants $\langle \mathcal{N}_1^p\rangle_c$ with $p=1,2,3,4$, suggest that all cumulants are strictly linear in $N$. More precisely, \begin{equation} \label{N1-cump} \langle \mathcal{N}_1^p\rangle_c = \kappa_p N \end{equation} is expected to hold for $N > p$. In other words, for any $N>p$, the fractions $\kappa_p=N^{-1}\langle \mathcal{N}_1^p\rangle_c$ are {\em stationary}, that is, independent on $N$. This observation is borne out of pedestrian calculations for small $p$ which are difficult to extend to large $p$. The simplicity of the conjectural behavior of the cumulants, Eq.~\eqref{N1-cump}, suggests to look at the entire probability distribution of the random quantity $\mathcal{N}_1(N)$: \begin{equation} \label{FnN:def} F(n,N)=\text{Prob}[\mathcal{N}_1(N)=n] \end{equation} Using \eqref{N1N} we deduce a recurrence \begin{eqnarray} \label{FnN:eq} F(n+1,N+1) &=& \left(1-\frac{n}{N}\right)F(n,N)\nonumber \\ &+& \frac{n+1}{N}\,F(n+1,N) \end{eqnarray} Making the substitution \begin{equation} \label{FnN:ansatz} F(n+1,N+1)=\frac{1}{N!}\,\eulerian{N}{n} \end{equation} we recast \eqref{FnN:eq} into \begin{equation} \label{Phi-nN:eq} \eulerian{n}{N}=(N-n)\eulerian{N-1}{n-1}+(n+1)\eulerian{N-1}{n} \end{equation} and recognize that this neat recurrence is an addition formula for Eulerian numbers \cite{Euler36,Knuth}. One can check that the boundary conditions agree with the standard definition of Eulerian numbers. Equation \eqref{FnN:ansatz} gives the probability distribution for the number of vertices of degree one. Using explicit expressions \cite{Knuth} for Eulerian numbers \begin{equation*} \begin{split} \eulerian{N}{0} &=1 \\ \eulerian{N}{1} &=2^N-N-1 \\ \eulerian{N}{2} &=3^N-(N+1)2^N+\binom{N+1}{2} \\ \eulerian{N}{3} &=4^N-(N+1)3^N+2^N\binom{N+1}{2}-\binom{N+1}{3} \end{split} \end{equation*} we obtain $F(n,N+1)$ for $n=1,2,3,4$. The prediction $F(1,N+1)=1/N!$ is obvious, while a direct pedestrian derivation of $F(n,N+1)$ for $n=2,3,4$ is laborious. Using the basic identity \cite{Knuth} \begin{equation} \label{mirror:E} \eulerian{N}{n}=\eulerian{N}{N-1-n} \end{equation} reflecting the mirror symmetry between Eulerian numbers one obtains \begin{equation} \label{mirror} F(n+1,N+1) = F(N-n,N+1) \end{equation} giving $F(n,N+1)$ for $n=N, N-1,N-2,N-3$. Thanks to numerous identities \cite{Knuth,Kyle} satisfied by Eulerian numbers, proving the conjectural behavior \eqref{N1-cump} of the cumulants and extracting the amplitudes $\kappa_p$ appears feasible. This has been done in the past, see \cite{David62,Janson13} where Eq.~\eqref{N1-cump} was derived and the amplitudes were expressed through Bernoulli numbers $B_p$: \begin{equation} \label{N1-cum-B} \langle \mathcal{N}_1^p\rangle_c =p^{-1} B_p N \end{equation} This is indeed correct when $p<N$, see \cite{David62,Janson13}. Since $B_p=0$ when $p\geq 3$ is odd, see \cite{Knuth}, we have \begin{equation*} \langle \mathcal{N}_1^3\rangle_c = \langle \mathcal{N}_1^5\rangle_c =\ldots= \langle \mathcal{N}_1^{2\lfloor N/2\rfloor -1}\rangle_c=0 \end{equation*} The first of this relations is \eqref{N1-cum3} which we derived above using pedestrian calculations. Even cumulants are non-zero, and their signs alternate. Even cumulants following \eqref{Var-N1} and \eqref{N1-cum4} are \begin{equation*} \begin{split} \langle \mathcal{N}_1^6\rangle_c &= \tfrac{N}{252}\,, \quad~\langle \mathcal{N}_1^8\rangle_c = - \tfrac{N}{240}\,, ~~\langle \mathcal{N}_1^{10}\rangle_c = \tfrac{N}{132}\\ \langle \mathcal{N}_1^{12}\rangle_c &= -\tfrac{691 N}{32760}\,, ~~\langle \mathcal{N}_1^{14}\rangle_c = \tfrac{N}{12}\,, ~~\langle \mathcal{N}_1^{16}\rangle_c = \tfrac{3617N}{8160} \end{split} \end{equation*} etc. \subsection{Vertices of higher degree: Average degree distribution} \label{subsec:k} When $k\geq 2$, the random quantity $\mathcal{N}_k$ evolves according to stochastic rule \begin{equation} \label{NkN} \mathcal{N}_k(N+1) = \begin{cases} \mathcal{N}_k+1 &\text{prob} ~~ \frac{(k-1)\mathcal{N}_{k-1}}{N}\\ \mathcal{N}_k-1 &\text{prob} ~~ \frac{k\mathcal{N}_{k}}{N} \\ \mathcal{N}_k &\text{prob} ~~ 1-\frac{(k-1)\mathcal{N}_{k-1}+k \mathcal{N}_k}{N} \end{cases} \end{equation} Averaging \eqref{NkN} we find that $N_k=\langle \mathcal{N}_k\rangle$ satisfies \begin{equation} \label{Nk-rec} N_k(N+1)=\left(1-\frac{k}{N}\right)N_k + \frac{k-1}{N}\,N_{k-1} \end{equation} This recurrence admits a remarkably simple solution \begin{equation} \label{Nk-sol} N_k= \frac{N}{k(k+1)}\,, \qquad k \leq N-1 \end{equation} Note that \begin{equation} \label{check} \sum_{k=1}^N N_k = \sum_{k=1}^{N-1}\frac{N}{k(k+1)}+1=N \end{equation} where we have used \eqref{Nk-sol} and \eqref{max-degree}. Equation \eqref{check} should be valid due to the exact sum rule \eqref{norm}, so confirming it provides a consistency check. We emphasize that there are no sub-leading terms in \eqref{Nk-sol}, that is, the average number of vertices $N_k(N)$ of degree $k$ exhibits a strictly linear in $N$ behavior. Thus for any $N>k$, the fractions $n_k=N_k(N)/N$ are {\em stationary}, that is, independent on $N$: \begin{equation} \label{nk-sol} n_k= \frac{1}{k(k+1)} \end{equation} For RRTs, the asymptotic behavior of the degree distribution is exponential, $n_k = 2^{-k}$, but sub-leading terms do not vanish \cite{KR02-fluct}. Interestingly, for RRHs, one gets algebraic behavior \eqref{nk-sol} without preferential attachment. The lack of correction terms in the degree distribution of the RRH is striking: For all degrees, $k\leq N-1$, the behavior of the degree distribution of the RRH is such as if the system was effectively infinite. \subsection{Vertices of degree two: Fluctuations} \label{subsec:2-fluct} The computations of fluctuations of the random quantities $\mathcal{N}_k$ become more involved as $k$ increases. Here we consider $\mathcal{N}_2$. Specializing \eqref{NkN} to $k=2$ gives \begin{equation} \label{N2N} \mathcal{N}_2(N+1) = \begin{cases} \mathcal{N}_2+1 &\text{prob} ~~ \frac{\mathcal{N}_1}{N}\\ \mathcal{N}_2-1 &\text{prob} ~~ \frac{2\mathcal{N}_2}{N} \\ \mathcal{N}_2 &\text{prob} ~~ 1-\frac{\mathcal{N}_1+2\mathcal{N}_2}{N} \end{cases} \end{equation} Let us try to determine the variance. Taking the square of \eqref{N2N} and averaging we derive the governing equation for the second moment $\langle \mathcal{N}_2^2\rangle$: \begin{equation} \label{N22} \langle \mathcal{N}_2^2(N+1)\rangle=\left(1-\frac{4}{N}\right)\langle \mathcal{N}_2^2\rangle+\frac{2}{N}\,\langle \mathcal{N}_1\mathcal{N}_2\rangle+\frac{5}{6} \end{equation} Equation \eqref{N22} shows that we need an additional equation for the correlation function $\langle \mathcal{N}_1\mathcal{N}_2\rangle$. We first note that the product $\mathcal{N}_1(N+1)\mathcal{N}_2(N+1)$ evolves according to \begin{equation} \label{N12N} \begin{cases} \mathcal{N}_1(\mathcal{N}_2+1) &\text{prob} ~~ \frac{\mathcal{N}_{1}}{N}\\ (\mathcal{N}_1+1)(\mathcal{N}_2-1) &\text{prob} ~~ \frac{2\mathcal{N}_{2}}{N} \\ (\mathcal{N}_1+1)\mathcal{N}_2 &\text{prob} ~~ 1-\frac{\mathcal{N}_{1}+2\mathcal{N}_{2}}{N} \end{cases} \end{equation} Averaging \eqref{N12N} and taking into account \eqref{N2-sol} and \eqref{Nk-sol} with $k=1, 2$ we obtain \begin{eqnarray} \label{N12} \langle \mathcal{N}_1(N+1)\mathcal{N}_2(N+1)\rangle &=& \left(1-\frac{3}{N}\right)\langle \mathcal{N}_1\mathcal{N}_2\rangle \nonumber \\ &+& \frac{5N-3}{12} \end{eqnarray} A straightforward calculation gives \begin{equation} \label{N123} (\mathcal{N}_1, \mathcal{N}_2, \mathcal{N}_3) = \begin{cases} (3,0,0) &\text{prob} ~~ \frac{1}{6} \\ (2,1,0) &\text{prob} ~~ \frac{1}{2} \\ (2,0,1) &\text{prob} ~~ \frac{1}{6} \\ (1,1,1) &\text{prob} ~~ \frac{1}{6} \end{cases} \end{equation} for $N=4$. Thus $\langle \mathcal{N}_1\mathcal{N}_2\rangle=\frac{7}{6}$ when $N=4$. Using this value as a boundary condition we solve the recurrence \eqref{N12} to yield \begin{equation} \label{N12-sol} \langle \mathcal{N}_1\mathcal{N}_2\rangle=\frac{N(N-1)}{12} +\frac{1}{(N-1)(N-2)(N-3)} \end{equation} for $N\geq 4$. Using \eqref{N12-sol} we find that the centered pair correlation $\langle \mathcal{N}_1\mathcal{N}_2\rangle_c=\langle \mathcal{N}_1\mathcal{N}_2\rangle-\langle \mathcal{N}_1\rangle \langle\mathcal{N}_2\rangle$ is given by \begin{equation} \label{N12-c} \langle \mathcal{N}_1\mathcal{N}_2\rangle_c=-\frac{N}{12}+\frac{1}{(N-1)(N-2)(N-3)} \end{equation} Inserting \eqref{N12-sol} into \eqref{N22} gives a closed recurrence for $\langle \mathcal{N}_2^2\rangle$. Solving this recurrence yields \begin{equation} \label{N22-sol} \langle \mathcal{N}_2^2\rangle=\frac{N(5N+23)}{180} + \frac{1}{(N-1)(N-2)(N-3)} \end{equation} for $N\geq 5$. The variance $V_2=\langle [\mathcal{N}_2-N_2]^2\rangle$ reads \begin{equation} \label{Var-N2} V_2=\frac{23N}{180} + \frac{1}{(N-1)(N-2)(N-3)} \end{equation} The random quantity $\mathcal{N}_2(N)$ is concentrated around its average in the large $N$ limit. More precisely, the probability distribution $P(\mathcal{N}_2, N)$ is asymptotically Gaussian: \begin{equation} P_2(\mathcal{N}_2, N)\simeq \sqrt{\frac{90}{23\pi N}}\,\text{exp}\!\left[-\frac{90(\mathcal{N}_2 -N/6)^2}{23 N}\right] \end{equation} Generally $\langle \mathcal{N}_i\mathcal{N}_j\rangle_c=\langle \mathcal{N}_i\mathcal{N}_j\rangle-\langle \mathcal{N}_i\rangle \langle\mathcal{N}_j\rangle$ is expected to grow linearly with $N$: \begin{equation} \lim_{N\to\infty}N^{-1}\langle \mathcal{N}_i\mathcal{N}_j\rangle_c=\nu_{i,j} \end{equation} The quantities $\nu_{i,j}$ appear to be rational numbers, and $\nu_{i,i}>0$ for all $i\geq 1$ as the variances are positive. From the above {\em exact} calculations, viz. from Eqs.~\eqref{Var-N1}, \eqref{N12-c}, \eqref{Var-N2}, we extract \begin{equation} \nu_{1,1}=\frac{1}{12}, \quad \nu_{1,2}=-\frac{1}{12}, \quad \nu_{2,2}=\frac{23}{180} \end{equation} Finding $\nu_{i,j}$ for all $i\leq j$ is a challenge. For RRTs, similar calculations have been performed (see, e.g., \cite{Janson05}), but no simple formulas giving $\nu_{i,j}$ for all $i\leq j$ have been found to the best of our knowledge. \section{Rank Distribution} \label{sec:rank} The rank of a vertex in a hypergraph is the size of the minimal edge containing it \begin{equation} r(v) = \text{min}\{|e|: v\in e\} \end{equation} For instance, for a hypergraph with edge set \begin{subequations} \begin{equation} \label{E14} \begin{split} & \{v_1\} \\ & \{v_1, v_2\}, ~ \{v_1, v_3\}, ~\{v_1, v_8\}, ~ \{v_1, v_9\},~\{v_1, v_{10}\} \\ & \{v_1, v_2, v_4\}, ~\{v_1, v_3,v_5\}, ~\{v_1, v_{10},v_{12}\}\\ & \{v_1, v_3,v_5,v_6\}, ~\{v_1, v_2, v_4,v_7\}, ~ \{v_1, v_2, v_4, v_{14}\}\\ & \{v_1, v_3,v_5,v_6,v_{11}\}, ~\{v_1, v_2, v_4,v_7,v_{13}\} \end{split} \end{equation} the ranks of the vertices are \begin{equation} \label{r14} \begin{split} & r(v_1)=1 \\ & r(v_2) = r(v_3) = r(v_8) = r(v_9) = r(v_{10})=2 \\ & r(v_4) = r(v_5) = r(v_{12}) = 3 \\ & r(v_6) = r(v_7) = r(v_{14}) = 4 \\ & r(v_{11}) = r(v_{13}) = 5 \end{split} \end{equation} \end{subequations} Let $\mathcal{R}_k$ be the total number of vertices of rank $k$: \begin{equation} \mathcal{R}_k= \#\{v: \,r(v)=k\} \end{equation} For any hypergraph of size $N$ \begin{subequations} \begin{equation} \label{norm-R} \sum_{k=1}^N \mathcal{R}_k = N \end{equation} For RRHs, there is exactly one vertex with minimal rank, the primordial vertex, see \eqref{r14}. Thus \begin{equation} \label{R1} \mathcal{R}_1 = 1 \end{equation} The maximal possible rank of a hypergraph is equal to its size. In contrast to the minimal rank which is always realized by the definition of RRHs, only the last vertex $v_N$ in an RRH may have the maximal rank $N$. The recursive building procedure of the RRHs implies that the vertex with rank $N$ is formed with probability $1/(N-1)!$. Hence the average number of vertices of the maximal possible rank, $R_N=\langle \mathcal{R}_N\rangle$, is \begin{equation} \label{RN} R_N = \frac{1}{(N-1)!} \end{equation} \end{subequations} Note that the number of vertices of rank $k$ is equal to the number of edges $\mathcal{E}_k$ of size $k$: \begin{equation} \mathcal{E}_k = \#\{e: \, |e|=k\} = \mathcal{R}_k \end{equation} The recursive nature of the RRHs leads to the following evolution equation for the (random) quantities $\mathcal{R}_k$: \begin{equation} \label{RkN} \mathcal{R}_k(N+1) = \begin{cases} \mathcal{R}_k+1 & \text{prob} ~~\mathcal{R}_{k-1}/N\\ \mathcal{R}_k & \text{prob} ~~ 1-\mathcal{R}_{k-1}/N \end{cases} \end{equation} This recurrence is valid for $k=2,\ldots,N$, and even for $k=1$ and $k=N+1$ if we recall that $\mathcal{R}_0=0$ and $\mathcal{R}_{N+1}(N)=0$. \subsection{Vertices of rank two} \label{subsec:2} When $k=2$, the recurrence \eqref{RkN} becomes \begin{equation} \label{R2N} \mathcal{R}_2(N+1) = \begin{cases} \mathcal{R}_2+1 & \text{prob} ~~1/N\\ \mathcal{R}_2 & \text{prob} ~~ 1-1/N \end{cases} \end{equation} Averaging \eqref{R2N} shows that $R_2=\langle \mathcal{R}_2\rangle$ satisfies the recurrence \begin{equation} \label{R2-rec} R_2(N+1) = R_2 + \frac{1}{N} \end{equation} from which \begin{equation} \label{R2-sol} R_2(N) = H_{N-1} \end{equation} where $H_n=\sum_{1\leq i\leq n} i^{-1}$ are harmonic numbers \cite{Knuth}. Using \eqref{R2N} one similarly deduces the recurrence for the second moment \begin{equation} \label{R22-rec} \langle \mathcal{R}_2^2(N+1)\rangle = \langle \mathcal{R}_2^2\rangle + \frac{2}{N}\,H_{N-1}+\frac{1}{N} \end{equation} from which \begin{equation} \label{R22-sol} \langle \mathcal{R}_2^2\rangle = (H_{N-1})^2 + H_{N-1}-H_{N-1}^{(2)} \end{equation} This equation and exact results for higher moments $\langle \mathcal{R}_2^p\rangle$ involve generalized harmonic numbers: \begin{equation} \label{Harmonic} H_n^{(p)}=\sum_{i=1}^n \frac{1}{i^p} \end{equation} Combining \eqref{R2-sol} and \eqref{R22-sol} we find the variance of the number of vertices of rank two: \begin{equation} \label{R2-var} \langle \mathcal{R}_2^2\rangle - \langle \mathcal{R}_2\rangle^2 = H_{N-1}-H_{N-1}^{(2)} \end{equation} In the particular case of vertices of rank two we can compute the entire probability distribution \begin{equation} \label{PrN:def} P(r,N)=\text{Prob}[\mathcal{R}_2(N)=r] \end{equation} Using \eqref{R2N} we deduce \begin{equation} \label{PrN:eq} P(r,N+1)=\frac{1}{N}\,P(r-1,N)+\left(1-\frac{1}{N}\right)P(r,N) \end{equation} Making the substitution \begin{equation} \label{PrN:ansatz} P(r,N)=\frac{1}{(N-1)!}\,\Pi(r,N) \end{equation} we recast \eqref{PrN:eq} into \begin{equation} \label{PirN:eq} \Pi(r,N+1)=\Pi(r-1,N)+(N-1)\Pi(r,N) \end{equation} which is an addition formula for Stirling numbers of the first kind \cite{Knuth}. Namely one identifies $\Pi(r,N)$ with ${N-1\brack r}$. To summarize \begin{equation} \label{PrN:sol} P(r,N)=\frac{1}{(N-1)!}\,{N-1\brack r} \end{equation} Using well-known expressions \cite{Knuth} for the extremal Stirling numbers of the first kind \begin{subequations} \begin{equation} \label{S:extremal} {n\brack 1} = (n-1)!, \qquad {n\brack n} = 1 \end{equation} one gets \begin{equation} \label{PrN:extremal} P(1,N)=\frac{1}{N-1}\,, \qquad P(N-1,N)=\frac{1}{(N-1)!} \end{equation} \end{subequations} These values readily follow directly from the definition of the RRH. Using expressions \cite{Knuth} for penultimate extremal Stirling numbers of the first kind \begin{subequations} \begin{equation} \label{S:extremal-2} {n\brack 2} = (n-1)! H_{n-1}, \qquad {n\brack n-1} = \binom{n}{2} \end{equation} one deduces \begin{equation} \label{PrN:extremal-2} P(2,N)=\frac{H_{N-2}}{N-1}\,, \quad P(N-2,N)=\frac{1}{2(N-3)!} \end{equation} \end{subequations} which are harder to derive in a straightforward manner, namely merely relying on the definition of the RRH. \subsection{Vertices of higher ranks} \label{subsec:Rk} Averaging \eqref{RkN} leads to the recurrence \begin{equation} \label{Rk-rec} R_k(N+1) = R_k + \frac{1}{N}\,R_{k-1} \end{equation} Using the recursive nature of these equations we begin with $R_1=1$ and solve \eqref{Rk-rec} for all $k$. The general result \begin{equation} \label{Rk-sol} R_{k+1}(N+1) = \sum_{1\leq j_1<\ldots<j_k\leq N}\frac{1}{j_1\times \ldots\times j_k} \end{equation} is neat, but involves the $k-$folded summation. Specializing the exact solution \eqref{Rk-sol} to $k=1$ we recover \eqref{R2-sol}. Specializing \eqref{Rk-sol} to $k=2$ and expressing the sum via harmonic numbers yields \begin{equation} \label{R3-sol} R_3(N+1) = \frac{(H_{N})^2 -H_{N}^{(2)}}{2} \end{equation} Simplifying the sum in \eqref{Rk-sol} and expressing the exact solution via known finite sums like harmonic numbers is feasible. However, the results become more and more cumbersome as $k$ increases. Here we only mention the leading asymptotic behavior for $k=O(1)$ and $N\to\infty$. In this situation, one can replace the recurrence \eqref{Rk-rec} by the differential equation \begin{equation} \label{Rk-DE} \frac{dR_k}{dN} = \frac{1}{N}\,R_{k-1} \end{equation} Solving these equations recurrently starting from $R_1=1$, see \eqref{R1}, yields \begin{equation} \label{Rk-asymp} R_{k+1} = \frac{(\ln N)^k}{k!} \end{equation} Let us gauge the accuracy of Eq.~\eqref{Rk-asymp}. First, we recall the asymptotic formulas \cite{Knuth} \begin{subequations} \begin{align} \label{Harmonic-1} H_n & = \ln n + \gamma +\frac{1}{2n} + O(n^{-2}) \\ \label{Harmonic-p} H_n^{(p)} & = \zeta(p)-\frac{1}{(p-1)n^{p-1}} + O(n^{-p}) \end{align} \end{subequations} Here $\gamma=0.57721\ldots$ is the Euler constant and $\zeta(\cdot)$ is the zeta function. Using \eqref{R2-sol} and \eqref{Harmonic-1} we obtain \begin{subequations} \begin{equation} \label{R2-asymp} R_2 = \ln N + \gamma - \frac{1}{2N} + O(N^{-2}) \end{equation} Using \eqref{R3-sol} and \eqref{Harmonic-p} with $p=2$ we obtain \begin{eqnarray} \label{R3-asymp} R_3 &=& \tfrac{1}{2}(\ln N)^2 +\gamma \ln N + \tfrac{1}{2}\gamma^2 - \tfrac{1}{12}\pi^2 \nonumber\\ &+& \frac{1-\gamma \ln N}{N}+O(N^{-2}) \end{eqnarray} \end{subequations} The leading terms in \eqref{R2-asymp}--\eqref{R3-asymp} agree with the general leading asymptotic predicted by Eq.~\eqref{Rk-asymp}. The asymptotic expansions \eqref{R2-asymp}--\eqref{R3-asymp} also suggest an improvement of the leading asymptotic \eqref{Rk-asymp}, e.g., next two sub-leading terms \begin{eqnarray} \label{Rk-asymp-2} R_{k+1} &=& \frac{(\ln N)^k}{k!} + \gamma\,\frac{(\ln N)^{k-1}}{(k-1)!} \nonumber \\ &+& \frac{6\gamma^2 - \pi^2}{12}\,\frac{(\ln N)^{k-2}}{(k-2)!}+\ldots \end{eqnarray} are easy to confirm by analyzing \eqref{Rk-rec}. \section{Leaders} \label{sec:leader} In RRTs and similar networks, the statistical properties of the node of the highest degree can be remarkable \cite{KR02,JML08}. In RRHs, the primordial vertex has the highest possible degree, so it is natural to define the leader in degree as the vertex with the highest degree among vertices different from the primordial. Take the second vertex, the most plausible candidate for having the second highest degree. The probability distribution $P_2(d,N))=\text{Prob}\{d[v_2(N)]=d\}$ of the degree of the second vertex satisfies the recurrence \begin{equation} \label{PdN-2} P_2(d,N+1)=\tfrac{d-1}{N}P_2(d-1,N)+\tfrac{N-d}{N}P_2(d,N) \end{equation} for $N\geq 2$. Using $P_2(1,2)=1$ as initial condition and iterating \eqref{PdN-2} we arrive at a very simple solution \begin{subequations} \label{PdN:sols} \begin{equation} \label{PdN:sol-2} P_2(d,N)=\frac{1}{N-1}\,, \qquad d=1,\ldots,N-1 \end{equation} Thus the probability distribution $P_2(d,N)$ is uniform, so the random quantity $d=d[v_2(N)]$ is non-self-averaging. For the third vertex, the probability distribution of its degree, $P_3(d,N)=\text{Prob}\{d[v_3(N)]=d\}$, satisfies the same equation as $P_2(d,N)$, viz. \begin{equation*} P_3(d,N+1)=\tfrac{d-1}{N}P_3(d-1,N)+\tfrac{N-d}{N}P_3(d,N) \end{equation*} which is valid for $N\geq 3$. The initial condition is different, $P_3(1,3)=1$, so the solution also differs from $P_2(d,N)$: \begin{equation} \label{PdN:sol-3} P_3(d,N)=\frac{2(N-d-1)}{(N-1)(N-2)} \end{equation} In contrast to \eqref{PdN:sol-2}, the distribution \eqref{PdN:sol-3} is not uniform. Generally for the $m^\text{th}$ vertex one gets again an equation mathematically identical to \eqref{PdN-2}. Solving it subject to the initial condition $P_m(1,m)=1$ yields \begin{equation} \label{PdN:sol-m} P_m(d,N)=(m-1)\frac{\Gamma(N-d)\,\Gamma(N-m+1)}{\Gamma(N-d-m+2)\,\Gamma(N)} \end{equation} \end{subequations} The random quantity $d=d[v_m(N)]$ is non-self-averaging for every $m$. Alternatively, the results \eqref{PdN:sols} could be appreciated after realizing that the evolution of a degree of any vertex is equivalent to the P\'olya urn process \cite{urn,urn-Mahmoud}. The P\'olya urn model proposed by Markov \cite{Markov17} and by Eggenberger and P\'olya \cite{Polya23} is the simplest, and best-understood urn model \cite{urn,urn-Mahmoud}. Urn models have been used by Huygens, Bernoulli, Laplace \cite{Laplace} and other founders of probability theory; traces of urn schemes appear in much earlier literature including (according to \cite{urn}) the {\em Old Testament}. Known behaviors of the P\'olya urn model allow one to extract some leadership characteristics. Suppose we seek the probability $\mathcal{D}_2$ that the degree of the second vertex exceeds half the size of the hypergraph in the quickest possible way and then holds throughout the evolution: \begin{equation} \label{D2:def} \mathcal{D}_2 = \frac{1}{2}\text{Prob}\{d[v_2(N)] > \lfloor N/2\rfloor \,| N\geq 3\} \end{equation} The factor $\frac{1}{2}$ accounts for the quickest path, viz. creating the hypergraph \eqref{123} with $d[v_2(3)] = 2>\lfloor 3/2\rfloor$. The probability in \eqref{D2:def} can be extracted from \cite{Tibor10} giving \begin{equation} \label{D2} \mathcal{D}_2 =\frac{1}{4} \end{equation} The virtue of $\mathcal{D}_2$ is in tractability and shedding light on a more natural quantity $\mathcal{S}_2$, the probability that the second vertex is the {\em strict} leader in degree (i.e., it has the second highest degree) for all sufficiently large sizes. We haven't computed $\mathcal{S}_2$, but the obvious inequality \begin{equation} \label{S2} \mathcal{S}_2 > \mathcal{D}_2 =\frac{1}{4} \end{equation} tells us that with a positive probability the second vertex eventually becomes the persistent strict leader in degree. Similarly, denote by $\mathcal{D}_m$ the probability that the degree of the $m^\text{th}$ vertex exceeds half the size of the hypergraph in the quickest possible way and then holds throughout the entire evolution. More precisely, \begin{equation} \label{Dm:def} \mathcal{D}_m = \frac{\text{Prob}\{d[v_m(N)] > \lfloor N/2\rfloor \,| N\geq 2m-1\}}{(2m-2)!} \end{equation} with $1/(2m-2)!$ factor accounting for the quickest path, namely, creating the hypergraph \begin{equation} \label{quick-m} \begin{split} & \{v_1\} \\ & \{v_1, v_2\}, ~ \cdots, ~\{v_1, v_m\} \\ & \{v_1, v_m, v_{m+1}\}, ~ \cdots, ~\{v_1, v_m, v_{m+1},\ldots,v_{2m-1}\} \end{split} \end{equation} of the smallest size $N=2m-1$ when the inequality in \eqref{D2:def} is feasible, $d[v_m(2m-1)] = m>\lfloor (2m-1)/2\rfloor$. The probability in \eqref{Dm:def} can be extracted from \cite{Tibor10} giving \begin{equation} \label{Dm} \mathcal{D}_m =\frac{1}{(2m-2)!}\,\frac{\Gamma\big(m-\frac{1}{2}\big)}{\Gamma\big(\frac{1}{2}\big)\,\Gamma(m)} \end{equation} A more natural quantity is again $\mathcal{S}_m$, the probability that the $m^\text{th}$ vertex is the strict leader in degree for all sufficiently large sizes. The obvious inequality \begin{equation} \label{Sm} \mathcal{S}_m > \mathcal{D}_m = \big[2^{m-1}\Gamma(m)\big]^{-2} \end{equation} tells us that with a positive probability, the $m^\text{th}$ vertex eventually becomes the persistent strict leader in degree. In \eqref{Sm}, we have simplified the expression \eqref{Dm} for $\mathcal{D}_m$ by using the duplication formula \cite{Flajolet} for the gamma function. The monotonicity of the probabilities $\mathcal{S}_m$ is obvious: $\mathcal{S}_m>\mathcal{S}_{m+1}$ for all $m\geq 2$. Leading degrees can undergo a bit of leapfrogging. Conjecturally, the degree of one vertex eventually becomes the winner, namely the strict leader in degree for all sufficiently large sizes. If true, \begin{equation} \label{norm-S} \sum_{m\geq 2} \mathcal{S}_m = 1 \end{equation} Replacing $\mathcal{S}_m$ in \eqref{norm} by the lower bound in \eqref{Sm} gives the lower bound for the sum, $I_0(1)-1=0.266\ldots$, where $I_0$ is the Bessel function. This lower bound for the sum \eqref{norm-S} is significantly lower than the exact value indicating that the lower bound \eqref{Sm} is rather weak. \section{Leaves} \label{sec:leaves} The RRH model is too simple to be overlooked, and it appeared (albeit not called the RRH) in \cite{KR05,Vazquez22}, and perhaps in other studies. More precisely, Ref.~\cite{Vazquez22} examines the one-parameter class of models: The RRH rule is applied with probability $1-\mu$, and with probability $\mu$, an edge is chosen randomly and duplicated. Thus after $N-1$ steps, there are $N$ edges, while the number of vertices is a random quantity concentrating around the average $\langle |V|\rangle = 1 +(N-1)(1-\mu)$. This class of models is a deformation of the RRH recovered at $\mu=0$. The influence of the deformation is minimal, e.g., the fractions $n_k=N_k(N)/N$ still follow the decay law \eqref{nk-sol} independently on $\mu$, albeit the stationarity is lost: When $0<\mu<1$, the decay law \eqref{nk-sol} is valid only when $N\to\infty$ and $k=O(1)$. Thus, the case of the RRH is particularly striking, and it well represents the behavior of the entire class of models \cite{Vazquez22}. The RRHs also appeared in an earlier work \cite{KR05} studying directed random graphs growing via a copying mechanism (CM). These graphs grow by adding nodes one by one. A newly introduced node randomly selects a target node and forms a direct link to it, as well as to all ancestors nodes of the target node (see Fig.~\ref{fig:C-color}). Identifying (i) nodes in a directed graph growing via CM with vertices in a hypergraph and (ii) each node together with its ancestors with an edge, we establish the isomorphism between directed random graphs growing via CM and RRH. For the directed graph shown in Fig.~\ref{fig:C-color}, the corresponding hypergraph is \begin{equation} \label{CM-H} \begin{split} & \{v_1\} \\ & \{v_1, v_2\}, ~\{v_1, v_3\} \\ & \{v_1, v_3,v_4\}, ~\{v_1, v_3,v_6\} \\ & \{v_1, v_3,v_4, v_5\}, ~\{v_1, v_3, v_4,v_7\} \end{split} \end{equation} \begin{figure}[t] \includegraphics[width=0.44\textwidth]{C-color} \caption{Illustration of the copying mechanism. The time order of the nodes is indicated. The new node ${\bf n}$ chooses the target node randomly (node 4 in the present case) and attaches to it and its ancestors, nodes 1 and 3 in the present case.} \label{fig:C-color} \end{figure} Some results of Ref.~\cite{KR05} are identical to the results presented above, albeit the interpretation differs: The degree distribution for RRH was the in-degree distribution in \cite{KR05}; the rank distribution for the RRH was the out-degree distribution in \cite{KR05}. The concepts of the degree distribution and rank distribution in the realm of the RRH seem more fundamental than the concepts of in- and out-degree distributions for graphs. Other characteristics could be more natural for graphs than for hypergraphs. For instance, leaves (nodes of degree one) are easily visible in connected graphs. For the graph in Fig.~\ref{fig:C-color}, node 2 is the only leaf. In RRH, a leaf is a vertex that belongs to a single edge, necessarily an edge of size two, since every edge contains the primordial vertex. The hypergraph shown in \eqref{E14} has two leaves, $v_8$ and $v_9$. Let us look at the number of leaves $\mathcal{L}_N$ in an RRH of size $N$. This number is a strongly fluctuating random quantity with average $\langle \mathcal{L}_N\rangle = 1$ for $N\geq 3$ when the number of leaves is a random quantity. Indeed \begin{equation} \mathcal{L}_3= \begin{cases} 0 & \text{prob}~~\frac{1}{2}\\ 2 & \text{prob}~~\frac{1}{2} \end{cases} \end{equation} from which $\langle \mathcal{L}_3\rangle = 1$. Further \begin{equation} \label{LNN} \mathcal{L}_{N+1}= \begin{cases} \mathcal{L}_N-1 & \text{prob}~~\frac{\mathcal{L}_N}{N}\\ \mathcal{L}_N+1 & \text{prob}~~\frac{1}{N}\\ \mathcal{L}_N & \text{otherwise} \end{cases} \end{equation} for $N\geq 3$. Averaging \eqref{LNN} yields \begin{equation} \langle \mathcal{L}_{N+1}\rangle= \langle \mathcal{L}_N\rangle+ \frac{1-\langle \mathcal{L}_N\rangle}{N} \end{equation} Starting with $\langle \mathcal{L}_3\rangle = 1$ we iterate and obtain $\langle \mathcal{L}_N\rangle = 1$ for all $N\geq 3$. The full probability distribution \begin{equation} \ell_k(N) = \text{Prob}[\mathcal{L}_N=k] \end{equation} satisfies an equation \begin{eqnarray} \label{LkN} \ell_k(N+1) &=& \left[1-\frac{k+1}{N}\right]\ell_k(N) \nonumber \\ &+&\frac{1}{N}\,\ell_{k-1}(N) + \frac{k+1}{N}\,\ell_{k+1}(N) \end{eqnarray} which is derived similarly to Eq.~\eqref{LNN}. In the $N\to\infty$ limit, the probabilities $\ell_k(N)$ saturate for any fixed $k$: \begin{equation} \ell_k \equiv \lim_{N\to\infty} \ell_k(N) \end{equation} Using \eqref{LkN} we deduce the recurrence \begin{equation} \label{Lk-rec} \ell_{k+1}=\ell_k-(k+1)^{-1}\ell_{k-1} \end{equation} for $k\geq 1$. Solving \eqref{Lk-rec} starting with $\ell_0=\ell_1$ which also follows from \eqref{LkN} we obtain \begin{equation} \label{Lk-sol} \ell_k = \frac{e^{-1}}{k!} \end{equation} with amplitude fixed by normalization: $\sum_{k\geq 0}\ell_k = 1$. \section{Redirection Mechanism} \label{sec:RD} Deformations of the RRT model via different types of redirection, see \cite{Kleinberg,KR01,KR02-fluct,KR05,BK10,KR-copy,KR14,Bertoin15,KR17,Sumpter22} and references therein, have significantly improved our understanding of growing random networks. Natural deformations of the RRH model may also lead to models of growing random hypergraphs exhibiting intriguing behaviors. Let us deform the RRH using the simplest implementation of the redirection mechanism. At each step, a vertex $v$ is added together with an edge formed from a randomly chosen existing edge $e$. This new edge is $e\cup {v}$ with probability $1-r$, while with probability $r$ we redirect from $e$ to its maternal edge $e'$, so the new edge is $e'\cup {v}$. If $e=\{v_{i_1}, \ldots,v_{i_n}\}$ with $1=i_1<\ldots<i_n$, we have $e'=\{v_{i_1}, \ldots,v_{i_{n-1}}\}$. Thus the added edge is \begin{equation} \label{RD} \begin{cases} \{v_{i_1}, \ldots,v_{i_{n-1}},v_{i_n}, v\} & \text{prob}\quad 1-r \\ \{v_{i_1}, \ldots,v_{i_{n-1}},v\} & \text{prob}\quad r \end{cases} \end{equation} The primordial vertex has no maternal edge, so if the primordial vertex is chosen, $e=\{v_1\}$, the added edge is always $e\cup {v}=\{v_1,v\}$. Consider vertices of degree one. The governing relation \eqref{N1N} generalizes to \begin{equation} \label{N1N-r} \mathcal{N}_1(N+1) = \begin{cases} \mathcal{N}_1+1 & \text{prob} ~~1-(1-r)\frac{\mathcal{N}_1}{N} \\ \mathcal{N}_1 & \text{prob} ~~ (1-r)\frac{\mathcal{N}_1}{N} \end{cases} \end{equation} for $N\geq 2$. Averaging we obtain \begin{equation} \label{N1-r} N_1(N+1)=\left(1-\frac{1-r}{N}\right)N_1+1 \end{equation} for $N\geq 2$. Solving \eqref{N1-r} subject to the boundary condition $N_1(2)=1$ we obtain \begin{equation} \label{N1-sol-r} N_1 = \frac{N}{2-r}-\frac{1}{(2-r)\Gamma(r)}\,\frac{\Gamma(N-1+r)}{\Gamma(N)} \end{equation} for $N\geq 2$. In contrast to the RRH model with $r=0$ when $N_1$ was strictly linear in $N$, there is a sub-leading term in \eqref{N1-sol-r} when $0<r<1$ that vanishes as $N^{-(1-r)}$. For $k\geq 2$, the random quantity $\mathcal{N}_k$ evolves according to stochastic rule \begin{equation*} \label{NkN-r} \mathcal{N}_k(N+1) = \begin{cases} \mathcal{N}_k+1 &\text{prob} ~~ \frac{(k-1-r)\mathcal{N}_{k-1}}{N}\\ \mathcal{N}_k-1 &\text{prob} ~~ \frac{(k-r)\mathcal{N}_{k}}{N} \\ \mathcal{N}_k &\text{prob} ~~ 1-\frac{(k-1-r)\mathcal{N}_{k-1}+(k-r) \mathcal{N}_k}{N} \end{cases} \end{equation*} Averaging this equation and taking the $N\to\infty$ limit we find that fractions $n_k=N_k(N)/N$ satisfy \begin{equation} \label{nkr} (k-r+1)n_k = (k-r-1)n_{k-1} \end{equation} Using $n_1=(2-r)^{-1}$ following from \eqref{N1-sol-r} as the initial condition, we solve \eqref{nkr} recurrently and find \begin{equation} \label{nkr:sol} n_k = \frac{1-r}{(k-r+1)(k-r)} \end{equation} We see that for the one-parameter class of models \eqref{RD}, the redirection parameter $r$ only quantitatively affects the behavior of the degree distribution. The influence on the degree distribution is more significant than in the one-parameter class of models introduced in \cite{Vazquez22}, but still just quantitative. However, the degree distribution in growing hypergraphs appears to be a very robust characteristic hardly sensitive to the evolution rules. Despite the name, the degree distribution in the hypergraphs, Eq.~\eqref{Nk:def} resembles the in-component size distribution in trees rather than the degree distribution. Intriguingly, in the one-parameter class of models of trees growing via the redirection mechanism \cite{KR01}, the in-component size distribution is given {\em exactly} by \eqref{nkr:sol}. The degree distribution in such trees is strongly affected by the parameter $r$: It decays algebraically as $k^{-1-1/r}$ when $0<r<1$, while for the RRTs ($r=0$) the decay is exponential, $n_k=2^{-k}$. The influence of the redirection parameter $r$ on the rank distribution is more substantial. Consider the vertices of rank two. For the RRHs, Eq.~\eqref{R2-sol} gives the average number of vertices of rank two. The growth with the size of the hypergraphs is logarithmic, Eq.~\eqref{R2-asymp}. When redirection can occur, $0<r<1$, the quantity $R_2(N)$ grows with $N$ algebraically, as we now demonstrate. To establish the growth law we write the stochastic equation for the number of vertices of rank two: \begin{equation} \label{R2N-r} \mathcal{R}_2(N+1) = \begin{cases} \mathcal{R}_2+1 & \text{prob} ~~\frac{1+r \mathcal{R}_2}{N}\\ \mathcal{R}_2 & \text{prob} ~~ 1-\frac{1+r \mathcal{R}_2}{N} \end{cases} \end{equation} The average $R_2=\langle \mathcal{R}_2\rangle$ satisfies the recurrence \begin{equation} \label{R2-rec-r} R_2(N+1) = \left(1+\frac{r}{N}\right)R_2 + \frac{1}{N} \end{equation} from which \begin{equation} \label{R2-sol-r} R_2(N) = \frac{1}{r}\left[\frac{\Gamma(N+r)}{\Gamma(1+r)\,\Gamma(N)} -1\right] \end{equation} Using the large $N$ asymptotic, $\Gamma(N+r)/\Gamma(N)\to N^r$, for the ratio of gamma functions \cite{Knuth}, we deduce an algebraic growth law for the average number of vertices of rank two: $R_2\simeq \frac{N^r}{r\,\Gamma(1+r)}$ when $0<r<1$. Similarly $\mathcal{R}_k$ with $k\geq 3$ satisfy \begin{equation} \label{RkN-r} \mathcal{R}_k(N+1) = \begin{cases} \mathcal{R}_k+1 & \text{prob} ~~\frac{(1-r)\mathcal{R}_{k-1}+r\mathcal{R}_k}{N}\\ \mathcal{R}_k & \text{prob} ~~ 1- \frac{(1-r)\mathcal{R}_{k-1}+r\mathcal{R}_k}{N} \end{cases} \end{equation} from which we deduce the recurrence for the averages: \begin{equation} \label{Rk-rec-r} R_k(N+1) = \left(1+\frac{r}{N}\right)R_k + \frac{1-r}{N}\,R_{k-1} \end{equation} Using the exact solution \eqref{R2-sol-r} one finds $R_3$, then $R_4$, etc. These explicit exact results are cumbersome, so we merely give the leading asymptotic: \begin{equation} \label{Rk-asymp-r} R_{k+2} \simeq \frac{N^r}{r\,\Gamma(1+r)}\,\frac{[(1-r)\ln N]^k}{k!} \end{equation} This asymptotic can be derived by replacing the recurrence \eqref{Rk-rec-r} by a system of differential equations and using the aforementioned leading behavior of $R_2$. \section{Discussion} \label{sec:concl} We have investigated random recursive hypergraphs (RRHs) built via simple growth rules. The RRH model is parameter-free, and it can be considered as a null mode of growing random hypergraphs. Reflecting the simplicity of the model, several characteristics of RRHs admit neat expressions via beautiful special numbers (harmonic numbers, Bernoulli numbers, Eulerian numbers, and Stirling numbers of the first kind). We have also briefly looked at a one-parameter class of models, a simple deformation of the RRH model. Namely, with a certain probability $r$, a parameter of the model, the redirection from a selected edge to its maternal edge is allowed. A detailed analysis of this class of models is a natural direction for future research. In the realm of random graphs, the redirection mechanism \cite{Kleinberg,KR01} generates preferential attachment. When redirection not only to the closest ancestor is allowed, the formation of hubs becomes feasible (see \cite{BK10}). It would be interesting to investigate hypergraphs built via such generalized redirection. For undirected trees, a particularly striking behavior was found in the case of isotropic complete redirection \cite{KR17}. A hypergraph version corresponds to $r=1$ and uniform choice among all neighbors of the initially chosen edge $e$. Complex networks growing via choice-driven rules exhibit phase transitions and other unexpected behaviors \cite{Raissa07,Mahmoud10,KR14-choice,Malyshkin14,Jordan16}. The same could happen for choice-driven growing hypergraphs. A simple implementation of choice relies on provisionally selecting two edges at random, say $e_1$ and $e_2$; choosing one of them, say $e_i$, according to some rule; and adding a new vertex $v$ together with edge $e_i\cup {v}$. For instance, smaller edge is always chosen, so if $|e_1|<|e_2|$ the new edge is $e_1\cup {v}$; if $|e_1|=|e_2|$, the new edge is $e_i\cup {v}$ where $i=1$ or $i=2$ with equal probabilities. An intriguing direction of future research concerns growing densifying hypergraphs for which the number of edges grows qualitatively faster than the number of vertices. A hypergraph version of the growing network model \cite{KR-copy} is expected to lead to growing densifying hypergraphs. As for RRHs, one randomly chooses an edge $e$ and adds an edge $e\cup\{v\}$; in addition, for each ancestor $e'\subset e$, an edge $e'\cup\{v\}$ is added with probability $p$. Numerous biological and technological networks are densifying \cite{brain05,brain09,brain11,Kleinberg07}. Densifying hypergraphs are also widespread, so simple models of growing densifying hypergraphs may shed light on properties of such objects. Growing graphs are sparse if the ratio of the number of edges to the number of nodes remains finite; if $|E|/N$ diverges as $N\to \infty$, growing graphs are densifying. For connected graphs, $|E|/N$ varies from one for trees (more precisely, $|E|=N-1$ for trees) to $\frac{N-1}{2}$ characterizing the complete graph of size $N$. For hypergraphs, the maximal number of edges is $2^{N}-1$. Thus, a potent sparse vs. dense dichotomy is not necessarily the same \footnote{For hypergraphs, the ratio of logarithms could be a better quantifier. Log-densifying hypergraphs are those for which the ratio $\ln |E|/\ln N$ diverges in the $N\to \infty$ limit.} for graphs and hypergraphs. \bigskip \noindent{\bf Acknowledgments.} I am grateful to G. Bianconi, H. Hartle, D. Krioukov, S. Redner, and J. Stepanyants for the discussions.
\section{Conclusions and future perspectives} \label{sec:future_perspective} \subsection{Where do we stand?} \label{sect:current} \ac{3D} hydrodynamic simulations of \ac{CEE} have seen a rapid improvement over the past decade. But still, these simulations are insufficient to answer fundamental questions and thus they only mark the beginning of a deeper physical understanding of \ac{CE} interaction. What can potentially be learned from \ac{3D} hydrodynamic \ac{CE} simulations? For given initial parameters of the pre-\ac{CE} binary systems, the ultimate questions to \ac{CE} modeling are: \begin{enumerate}[(1)] \item How much of the envelope gas is ejected? \item What is the final separation of the core binary in case it has not merged? \end{enumerate} If the stellar cores merge or the companion is destroyed, the long-term evolution of the remnant object poses an additional question. Certainly, \ac{3D} hydrodynamic approaches are a prerequisite to finding answers, but can we settle the questions with the currently available simulations? Regarding Question (1) the situation seems rather optimistic. As discussed in Sects.~\ref{ssec:why_is_CE_ejection_hard_to_achieve} and \ref{sect:simulations}, when including the ionization energy released in recombination processes and assuming that it thermalizes locally, envelope ejection seems plausible for many of the studied systems. It also seems likely, however, that in certain regions of the parameter space, envelope ejection still fails. Even if all of the recombination energy can be used to support envelope ejection, there may be cases where this energy is still insufficient to unbind the entire \ac{CE}---especially for high-mass primary stars \citep{kruckow2016a}. Moreover, \citet{sabach2017a}, \citet{grichener2018a} and \citet{soker2018a} questioned the validity of the assumption of local thermalization and argued that instead recombination energy may be transported away by convection \citep{wilson2019a, wilson2020a} or radiation. However, \cite{ivanova2018a} estimated that the amount of hydrogen recombination energy lost by these processes was negligible. Convection is in principle part of the basic gravo-hydrodynamic model of \ac{CEE}. The question is whether it is sufficiently resolved in the simulations. At least moving-mesh hydrodynamics schemes \citep{ohlmann2016a, ohlmann_phd, prust2019a, sand2020a} seem capable of reproducing convective flows. However, radiation transport is usually not accounted for. \citet{sand2020a} estimated that in their setup, most of the ionized material remains well inside the photosphere for most parts of the \ac{CEE}, but ultimately the question of how much of the recombination energy can be used to eject the envelope material has to be answered by simulations that model radiation transfer. In summary, the answer to Question (1) is challenged by potentially missing physical effects and not primarily by numerical problems or deficiencies in the model setups, although \citet{reichardt2020a} show that a smaller softening length of the potentials around the stellar cores alters the rate at which mass is unbound. The effects determining the orbital evolution of the system during the rapid inspiral phase---Phase (ii) of our classification, but not in the later \ac{CEE} in Phase (iii)---are also implemented in current models. Some part of the pre-\ac{CE} evolution, the actual plunge-in phase of \ac{CEE} and several hundred orbits of the inner core binary following it are accessible to \ac{3D} hydrodynamic simulations. However, we suspect that the period of time immediately after these \ac{3D} simulations---perhaps up to the thermal timescale---may be critical to the parameters characterizing the binary (or the merged object) later. \citet{iaconi2017a} summarized final orbital separations obtained global hydrodynamic simulations of \ac{CEE} and found that they are commonly too wide compared with observations of post-\ac{CE} binary systems. This points to additional physical processes (see Sect.~\ref{ssec:why_is_CE_ejection_hard_to_achieve}) that follow the simulated dynamical inspiral of the companion into the primary star and the first few hundred orbits, i.e.\ in Phase (iii) of our classification. Bound gas in the outer parts of the envelope may re-contract on thermal timescales leading to an increase of the drag force, further inspiral, and more unbound envelope material. This could proceed in cycles or as a slow process that is regulated by the energy transport rate through the remaining envelope material (see Sect.~\ref{ssec:why_is_CE_ejection_hard_to_achieve}). On the other hand, returning envelope gas has high specific angular momentum, which could change the orbital separations in Phase (iii) drastically \citep{kuruwita2016a}. It is also possible that once a certain orbital separation is reached, one or both of the cores start to overflow their Roche lobes. These additional mass transfer episodes would again alter the orbital separations. It therefore seems likely that the final orbital separation is not only set by the dynamics in Phase (ii) but also affected by Phase (iii) of our classification in Sect.~\ref{sect:phases}. But--\emph{hic sunt dracones}---this is territory that is difficult or impossible to access with multidimensional hydrodynamic simulations (see Sect.~\ref{ssec:why_is_CE_ejection_hard_to_achieve}). In Sect.~\ref{ssec:interfacing_3d_global_simulations_with_1d_simulations_of_the_ce_remnant}, we discuss how \ac{3D} hydrodynamic simulations need to be interfaced with simulations able to model longer timescales, including the future evolution of the star(s). As for answering Question (1), we again encounter the problem that not all physics deciding about Question (2) may be included in \ac{3D} hydrodynamic \ac{CE} simulation. Before extending our models, however, we need to have confidence in the parameters at the end of the \ac{3D} hydrodynamic simulations. It has to be determined why the plunge-in phase ceases in \ac{3D} simulations, giving rise the the subsequent phase that takes place on longer timescales. Regardless of whether or not the separation at the end of Phase (ii) is the actual final separation, we need to understand whether the slow-down of the inspiral, temporary as it might be, is in fact physical. A simplified view is to assume complete envelope ejection so that there is no matter left behind and the drag forces acting on the cores cease. But the \ac{3D} hydrodynamic simulations discussed in Sect.~\ref{sect:sim_global} show a different picture \citep[e.g.][]{iaconi2018a}: Envelope ejection---if successful---happens rather late in the evolution, when the expansion of the envelope leads to the release of recombination energy that ultimately unbinds the material \citep{nandez2015a}. At this stage, however, the orbital evolution has already slowed down. But still, the orbital volume is usually not completely devoid of gas, though the density has decreased. It is therefore not the evacuation of the orbit that slackens the inspiral. As discussed in Sect.~\ref{ssec:why_is_CE_ejection_hard_to_achieve}, other effects may contribute to reduce the drag: towards the end of the inspiral, the relative motion between cores and gas becomes very subsonic, for which the formalisms of \citet{bondi1952a}, \citet{ostriker1999a}, and \citet{kim2007a} predict a drastic reduction of the drag force. Ultimately, co-rotation may be re-established between the core binary and the surrounding envelope gas, particularly for the more massive companions. This would decrease the drag force dramatically. But for tighter orbits, stronger drag is needed to change the orbit appreciably: As the cores approach each other, their mutual gravitational attraction becomes stronger. This force is what sets the orbital separation and only a drag force on the same order of magnitude would lead to a change in orbital separation. This becomes ever more unlikely in the late stages of the evolution. While these reasons plausibly justify the end of the inspiral, there is still the concern that the representation of the stellar cores as point particles and the softening of the gravitational potentials impact the simulated orbital separation. We could assume that, while the core region is undisturbed, the simulation of the central part of the star is reasonable. Even so, we do worry that once the envelope has expanded and the core and companion are near one another, the structure of the flows may be non-physical. The mass adopted for the particle representing the core of the primary star is somewhat arbitrary. Even with the rather controlled approach suggested by \citet{ohlmann2017a}, a certain cut radius has to be defined, that is often chosen to be equal to the gravitational softening length of the core particle. Towards the end of the simulations, the stellar cores may have come so close that the softened regions overlap and this may compound any specific problem. Moreover, the physical modeling of cores as point masses raises other concerns. For example, they accumulate material in their vicinity which travels with the point masses. This material could in reality be accreted onto the cores under the release of energy. Certainly, the effects that these choices have on the final orbital separation call for further study. \subsection{Missing physical effects} \label{ssec:missing_phisical_effects} As discussed in Sect.~\ref{sect:gravohydro}, simulations carried out thus far show that the \ac{CE} can only be ejected if recombination energy is utilized to do mechanical work, i.e. expand the envelope as opposed to being convected and radiated away. Thus, one of the most urgent questions to \ac{CE} modeling is to test whether this assumption is justified. Estimates based on \ac{1D} stellar structure models \citep{ivanova2018a} and on the optical depth at which recombination energy is released in \ac{3D} hydrodynamic \ac{CEE} simulations \citep{reichardt2020a, sand2020a, lau2022a} seem to support this mechanism to aid \ac{CE} ejection. But for a solid conclusion, radiation transport in the envelope gas has to be modeled. The other mechanism to drain energy from its location of release by recombination---convection---is part of the fundamental gravo-hydrodynamic model and therefore readily included provided a careful preparation of the setup. While its proper representation is a challenge to the numerical methods and the spatical resolution reached in the simulations, radiation is an additional physical process that has to be modeled explicitly. Introducing a radiation transfer model into \ac{CE} simulations would not only help to determine the contribution to envelope ejection by recombination effects, but it would also allow a more accurate localization of the photosphere and therefore improve predictions of optical observables from \ac{CE} events. Moreover, for simulations of \ac{CEE} with very massive primaries, the setup requires to include radiation in order to properly represent the structure of these stars \citep{ricker2019a}. The energy transport by radiation depends critically on the opacity of the material it passes through. Here, effects can play a role that extend beyond the ionization structure which is usually followed in simulations accounting for recombination energy release. Dust potentially forming in outer layers of the ejecta (\citealp{clayton2017a}, \citealp{glanz2018a}, \citealp{reichardt2020a}, \citealp{iaconi2019a}, and \citealp{iaconi2020a}) would increase the opacities dramatically. Therefore, models of dust formation are another important ingredient to reaching a comprehensive physical modeling basis for \ac{CE} simulations. Magnetic fields have been introduced into \ac{CE} simulations, where strong field amplification is observed \citep{ohlmann2016a}. Their dynamical effect remains negligible, but they potentially contribute to the shaping of planetary nebulae \citep[e.g.][]{garcia2020a, ondratschek2022a}. It is also possible that magnetic activity favors dust formation as has been suggested for \ac{AGB} stars \citep{soker1998b, rapoport2021a}. Additional physical effects concern the vicinity of the companion and the primary core, as well as their structure. Related processes include accretion to or perhaps mass loss from the bound cores, accumulation of material in their vicinity, and mass transfer episodes between the remaining cores following the initial dynamical \ac{CE} phase. Some low-mass companions such as planets may dissolve in the envelope gas \citep[e.g.,][]{staff2016a}. If the companion star is very compact, for example a neutron star, densities close to it may reach values where nuclear burning and neutrino processes become important; in the case of black holes potentially even effects of general relativity. \subsection{Unresolved numerical problems} \label{sect:unresolved_num} The future challenge to improvements of the numerical approaches is the same as today: dealing with the scale problems in both time and space will persist as the main difficulty for \ac{CE} simulations. The timescale challenge applies in particular to Phases (i) and (iii) of our classification. As discussed in Sect.~\ref{sect:multiscale}, processes in these phases may take place on longer timescales than those accessible to \ac{3D} hydrodynamic simulations. This may pertain to some restructuring of gas remaining bound to the cores that involves radiation processes and acts on the thermal timescale, but it may also be caused by minute changes on dynamical timescales whose cumulative effects after very many orbits may determine, e.g., the onset of \ac{CEE} or the final orbital separation of the remnant core binary. The spatial scale problem mainly concerns the region around the cores and the cores themselves. While for special progenitor systems a (marginal) resolution of companions may be possible, this problem prevents a direct modeling of the detailed effects in the vicinity of the cores. Yet, for reaching the next level of numerical modeling, the details of the evolution of the cores and their interaction with the immediate surroundings are of primary interest, see Sect.~\ref{ssec:missing_phisical_effects}. These processes, however, are out of reach for common numerical techniques and available computational resources (see Sect.~\ref{sect:comp_feasible}). Resolving the core of the primary spatially may become possible if the timescale problem is alleviated. For this, a parallelization in the time domain, i.e.\ in the time level hierarchy instead of a spatial domain decomposition, is a potential future direction. For the time being, however, the barrier towards resolving the cores cannot be overcome, and thus the advantage gained from a modest increase in spatial resolution of the envelope remains limited. The focus of current simulations lies instead on determining the main ``global'' quantities, such as orbital separation between core and companion and mass ejection. For these, numerical convergence can typically be established at a moderate number of discretization elements (some $10^6$ grid cells or particles). There is, however, the prospect of using subgrid-scale models to capture at least some of the missing effects. Accretion, for instance, can be represented by sink particles similar to those used in star formation simulations \citep[e.g.][]{krumholz2004a, chamandy2018a}. In current and in future models, establishing the convergence of the simulation results is an important issue. While for the setup, hydrostatic equilibrium provides a well-understood reference to compare with, it is less clear what resolution is needed in later phases of the evolution at different locations. Due to the exploding computational costs, a global increase of the spatial resolution seems little promising and may not be necessary. Adaptive mesh refinement techniques can concentrate resolution to regions where it is needed for reaching convergence. The task in the near and mid-term future is to figure out what regions matter and what resolution needs to be reached in them for convergence. Another potential problem for \ac{CE} simulations are conservation properties. In principle, the applied finite-volume and \ac{SPH} schemes conserve energy. In addition, \ac{SPH} conserves angular momentum by construction. Moving-mesh codes are nearly-Lagrangian and inherit this property to good accuracy For Eulerian codes, \ac{AMR} provides the required resolution for reaching acceptable conservation of angular momentum. Still, simulations of global \ac{CEE} require to follow hundreds of orbits and errors may accumulate. A fundamental problem for all numerical approaches arises from the coupling between hydrodynamics and gravity as an external force which enters the equations as a source term. Even with the approximate schemes discussed in Sect.~\ref{sect:gravity} gravity itself can be calculated to any desired precision, so it does not by itself constitute an unavoidable error source. But it is discretized in a different approach than the hydrodynamic quantities and tiny mismatches lead to accumulating energy errors. After a large number of orbits this error may be on the same order of magnitude as the binding energy of the non-expelled gas and it is therefore difficult to judge the success of envelope ejection. As mentioned in Sect.~\ref{sect:challenges_setups}, in setups close to hydrostatic equilibrium, well-balancing methods improve on this issue \citep[e.g.][]{edelmann2021a}, but the lack of a clear reference state renders such approaches less promising in the context of the dynamical core--envelop interaction. \subsection{Interfacing 3D global simulations with 1D simulations of the common-envelope remnant} \label{ssec:interfacing_3d_global_simulations_with_1d_simulations_of_the_ce_remnant} A promising avenue to understand what happens \emph{after} the dynamical \ac{CE} inspiral phase is interfacing \ac{3D} hydrodynamic simulations to \ac{1D} hydrostatic or hydrodynamic time-implicit codes that can evolve the remnant much further in time. This is not an easy project for a number of reasons. The first is that the post-\ac{CE} object may be non-spherical and deciding how to map it into a \ac{1D} configuration is non-trivial. The second problem is that the dynamic and thermodynamic structure of the object may not be a good fit for the \ac{1D} code. Nonetheless, the work of \citet{munson2021a} provides some guidance in this direction. In a thoughtful paper, \citet{ivanova2016a} compared a \ac{1D} model of the inspiral with a \ac{3D} model. While the goal was to determine how to interface a \ac{3D} inspiral model to a \ac{1D}, longer-timescale post-inspiral model, the paper actually also discusses \ac{1D} simulations of the {\it entire} common envelope. They encountered a number of problems which they catalogued, together with recommendations for further efforts of this type. For example, the structure of the envelope during inspiral is quite different, as shown in Fig.~\ref{fig:IvanovaNandez16-Fig4b}, where the difference between the potential of the \ac{1D} and \ac{3D} inspirals is plotted as a function of time and location. They recommend that if the fast inspiral phase is to be modelled in \ac{1D}, kinetic energy should be injected instead of heat into the \ac{1D} model envelope to simulate the deposition of energy and angular momentum due to orbital decay. This is preferable because injecting released orbital energy into heat alters which layers of material release ionization energy in recombination processes, which has a strong effect on the envelope dynamics. An important point made by \citet{ivanova2016a} is that while modelling the inspiral in \ac{1D} is difficult at best, modelling the inspiral in \ac{3D} and then mapping to \ac{1D} for the post-inspiral phase also presents some serious problems when trying to interface the two simulations. This said, interfacing \ac{3D} and \ac{1D} models is an active research area with some success for the cases of main-sequence star mergers \citep{schneider2019a,schneider2020a} and mergers between white dwarfs \citep{munson2021a}. While the future will no doubt see sophisticated \ac{3D} hydro simulations, it is likely that short- and intermediate-term progress will have to rely on the ingenuity of the researchers in combining different computational tools. \begin{figure} \centering \includegraphics[width=0.65\textwidth]{fig20.pdf} \caption{Comparison of the gravitational potentials in the \ac{1D} ($\varphi_{\mathrm{env1D}}$) and \ac{3D} ($\varphi^{\mathrm{red}}_{\mathrm{3D}}$) approaches. The difference is color-coded and shown as a function of radius and time. The solid black line indicates the location of the companion and the dashed purple line marks the surface of the envelope intended as the outer boundary of bound gas. Figure adapted from \citet{ivanova2016a}.} \label{fig:IvanovaNandez16-Fig4b} \end{figure} If the binary is definitely going to survive and the envelope is mostly or fully ejected by the end of the simulation, then mapping the ejected envelope gas into a \ac{1D} code may poses additional challenges. Disks may form with certain properties that may contribute to change the orbital parameters towards the ``final'' orbital separation. It would be difficult to have a thorough self-consistent simulation of this phase, but it is possible that its parts may be addressed separately. For example if the parameters of the disk could be extracted, then it might be possible to determine its impact on the inner binary \citep{kashi2011a}. \subsection{Deriving parametric CE prescriptions from 3D simulations} \label{ssec:extracting_1d_parametrization_from_multiD_simulations} A practical goal of simulating the \ac{CE} interaction is to derive simple analytic parametrizations that can be used in population synthesis studies. Classical approaches are the $\alpha_\mathrm{CE}$ and the $\gamma$ formalisms discussed in Sect.~\ref{sec:parametrized_models}. The values of the involved parameters, or---in more sophisticated approaches---the functional dependence of their values on stellar and system characteristics, has been investigated extensively with a range of techniques. How can \ac{3D} hydrodynamic simulations improve on this? If we are to use global \ac{3D} hydrodynamic simulations to derive parametric descriptions of successful \ac{CEE}, three requirements must be met: \begin{enumerate}[(1)] \item The \ac{3D} hydrodynamic simulations must be converged and include all effects that determine the quantities to be parametrized. \item Arguably, the envelope must be mostly or even fully unbound. \item A suitable parametric model has to be identified that is able to capture the functional dependencies that determine the quantities. \end{enumerate} None of these issues is resolved yet. Determining whether convergence has been reached is difficult. Even if the envelope was fully unbound and requirement (2) is met, one wonders whether the recombination energy, which ultimately unbound the envelope should be fully thermalized, or whether some of it should have escaped into space. Fulfilling requirement (1) is even more challenging. Changes to the orbital parameters take place in the post-\ac{CE} phase on longer timescales and modeling such effects is outside of the capabilities of 3D time-explicit hydrodynamic approaches. Also requirement (3) poses questions: In the context of the parametrization given by Eqs.~(\ref{eq:alpha_CE})--(\ref{eq:ebind_para}), should the orbital energy term on the right hand side of Eq.~(\ref{eq:alpha_CE}) be accompanied by a recombination energy term, and should there be more than one efficiency parameter to accompany these two energy sources? Or should the recombination energy, together with thermal energy be included in the envelope's internal energy, and used on the other side of Eq.~(\ref{eq:alpha_CE}), that quantifies the binding energy of the envelope? In any choice and consideration, there are many approximations and caveats. An early attempt to derive the parameter $\alpha_\mathrm{CE}$ defined in Eq.~(\ref{eq:alpha_CE}) from \ac{3D} hydrodynamic simulations of \ac{CEE} was made by \citet{sandquist1998a, sandquist2000a}, despite the fact that their models failed to unbind the envelope and therefore violated requirement (2). In order to circumvent this problem, they only considered the \emph{change} in binding energy defined as the initial binding energy of the giant minus the value at the end of their simulation. In doing so, they presumably included potential and thermal energy in their binding energy calculation. \citet{ivanova2016a} carried out a similar calculation using some of the first \ac{3D} global simulations to successfully eject the envelope and meeting requirement (2). They derived values for $\alpha \lambda$ according to Eqs.~(\ref{eq:alpha_CE}) and (\ref{eq:ebind_para}) from their simulations of \ac{CEE} with \ac{RGB} primary stars. \cite{sand2020a} carried out a similar analysis, but they differentiated the two cases where only potential energy is included in the value of the binding energy, and the case where the full internal energy (including recombination energy) is accounted for. This way, the chose an agnostic approach with respect to requirement (3) and calculated the values of $\lambda$ and $\alpha$ separately for the two cases. When only considering gravitational potential energy in the binding energy of the envelope, they found $\ensuremath{\alpha_\mathrm{CE}} >1$ which---rather unsurprisingly---implies more than the orbital energy has been used to unbind the envelope. \citet{lau2022a} carried out an additional exercise. They took advantage of the fact that they had carried out a \ac{CE} simulation between a $12 \,\ensuremath{M_\odot}$ red supergiant and a companion using three different equations of state: ideal gas, ideal gas plus radiation and an equation of state that additionally accounts for ionization energy. From these they could calculate three different $\alpha$, one to quantify the fraction of orbital energy used to unbind the envelope, the second to quantify the fraction of thermal energy used to unbind the envelope and the last to quantify the fraction of recombination energy used to unbind the envelope. It is still to be seen whether these considerations have any universal significance. \citet{iaconi2019a} attempted to reconcile information from all simulations known at the time with observation of single-degenerate binaries, just to demonstrate how very complex the topic is. As discussed in Sect.~\ref{sect:current}, the uncertainty of the final orbital separation determined from \ac{3D} hydrodynamic \ac{CE} simulations hampers these efforts. \subsection{Constraining CE simulations with observations} \label{sect:observational_constraints} How can the results of \ac{3D} hydrodynamic simulations be connected to astronomical observations? What can we learn from such a connection? Is it possible to constrain models of \ac{CEE} from observations? To discuss these questions, we distinguish between observations of stars, binary systems, and \acp{PN}, whose parameters can directly or indirectly be compared with \ac{CE} simulations, and observations of transient events that are associated with systems in the act of undergoing a \ac{CE} interactions. \subsubsection{Observations of stars, binaries and PNe that constrain CE simulations} \label{sect:pne} We know of a number of close binary classes that must be post-\ac{CE} systems because one or both of the objects in the binary must have been much larger in the past than the orbit is today. The simplest objects of this type are those where the companion is a low mass main sequence star, while the primary is usually a white dwarf remnant of the giant star or a helium-burning, horizontal branch star. There are two types of giant producing the observed remnants: \ac{RGB} and \ac{AGB} stars. In the first case, the post-\ac{CE} remnant tends to be a core-helium burning, horizontal-branch star, almost always classified as a subdwarf B or O (sdB or sdO) or it can be a helium white dwarf, often of lower mass. In the second case the remnant is a carbon-oxygen white dwarf. In most cases, it is not known whether the primary of the CE event was an \ac{RGB} or an \ac{AGB} star; however, if the binary is in the middle of a planetary nebula, we can be \emph{almost} certain that the giant was recently on the \ac{AGB} \citep[there is only a handful of planetary nebulae for which the central star can be shown to be a post-\ac{RGB} star; see][]{jones2016c}. These post-\ac{CE} binaries are used to constrain the post-\ac{CE} separation of the remnant core system if we assume that today's separation is the same as that at the end of the \ac{CE} interaction. In some cases one can compensate for the fact that the binary may have suffered additional orbital reduction due to magnetic breaking or gravitational wave radiation \citep[e.g.,][]{schreiber2003a}. If the mass of the primary is known, one can derive the mass and the radius of the giant at the beginning of the \ac{CE} phase, with some assumptions and moderate uncertainties \citep[e.g.,][]{zorotovic2010a, demarco2011a}. This reconstruction allows one to estimate the parameters of the pre-\ac{CE} system, which, together with the observed post-\ac{CE} systems parameters, gives a value for $\alpha_\mathrm{CE}$ in the energy formalism described in Sect.~\ref{sec:parametrized_models}. In practice, this method is fraught with uncertainties and assumptions, and there is a rich literature of what can and what cannot be derived from it \citep[see][for a review]{iaconi2019a}. Another type of post-\ac{CE} binary that recently gained increased attention are sdB or white dwarf stars orbited by very low mass companions, most often brown dwarfs, but possibly even massive planets. There are approximately a dozen systems with companions in the mass range of $0.027$--$0.07 \,\ensuremath{M_\odot}$ \citep{schaffenroth2014a,casewell2018a}. The primary question arising from these observations is how such low mass companions can have escaped merging with the primary in the \ac{CE} interaction. As discussed in Sect.~\ref{sect:sim_movingmesh}, \citet{kramer2020a} performed \ac{3D} hydrodynamic \ac{CE} simulations of such systems. They concluded that if the companion is more massive than ${\sim} 0.05 \,\ensuremath{M_\odot}$, it can successfully eject the envelope of a primary star with a main sequence mass of $1 \,\ensuremath{M_\odot}$ evolved to the tip of its \ac{RGB}. If the mass of the companion is between $0.03$ and $0.05 ,\ensuremath{M_\odot}$, partial ejection may take place, while below $0.03 \, \ensuremath{M_\odot}$, only a small fraction of the envelope is ejected. This is consistent with the observations of sdB stars, but the final orbital separations measured at the end of the simulations of \citet{kramer2020a} are too large compared with the observations. \citet{iaconi2019a} compared a number of \ac{CE} simulations to observations of post-\ac{CE} binaries such as the ones just described, where the companion is a main sequence star and the primary is either an sdO, sdB (O and B, post-\ac{RGB}, core helium burning stars) or a white dwarf. They analyzed post-\ac{CE} separations as a function of pre-\ac{CE} system parameters, such as the mass ratio between primary star and companion and the binding energy of the envelope of the pre-\ac{CE} giant. Unfortunately most of the simulations available at that time did not unbind the envelope, making the simulated final separations upper limits. In Fig.~\ref{fig:alpha} we show an updated figure mimicking what was presented by \citet{iaconi2019a} in their Figure~3. Here we only use simulations that eject the entire \ac{CE}. The simulations by \citet{sand2020a} and by \citet{gonzalez2022a} used an \ac{AGB} primary, those of \citet{lau2022a} used a massive red supergiant, while the other adopted low mass \ac{RGB} stars. \begin{figure} \centering \includegraphics[width=0.99\textwidth]{fig21.pdf} \caption{A comparison of simulations (coloured symbols) and observations (black symbols; dots: post-\ac{RGB} post-\ac{CE} binaries; triangles: post-\ac{AGB} post-\ac{CE} binaries; with circles: a planetary nebula surrounds the binary), in the delivered orbital energy vs. binding energy plane. The binding energy is that of the giant star at the time of the \ac{CE} interaction and includes potential and thermal energy. The solid lines denote $\alpha$ values from 1 to 0.1 (top to bottom).} \label{fig:alpha} \end{figure} Figure~\ref{fig:alpha} shows that the $\alpha$ parameters derived from simulations are approximately unity (most simulations are even in the $\alpha > 1$ region, throwing some doubt on the virtue of the formalism itself; for a discussion see \citealp{lau2022a}). Moreover, as also observed by \citet{iaconi2019a}, there seems to be a systematic difference between post-\ac{RGB} and post-\ac{AGB} observations, but the simulations, in particular those with \ac{AGB} primaries, have far wider separations than the observations. With the exception of the \ac{RGB} simulations of \citet{nandez2016a} that fall on the same region as the post-\ac{RGB} observations, the post-\ac{AGB}, post-\ac{CE} binaries with their extremely compact orbits, are not reproduced by simulations. Other post-\ac{CE} systems, such as close white dwarf binaries---sometimes referred to as \emph{double degenerate systems}, or high- and low-mass X-ray binaries are too complex to provide useful constraints: Double degenerate systems went through two episodes of mass transfer, that could have been two common envelopes. \citet{nelemans2005b} wrote extensively about the ambiguity of the evolutionary path in these cases. X-ray binaries consist of a low- or high-mass giant that transfers mass to a neutron star or a black hole, hence an object that derives from a a core-collapse supernova whose effect on the binary is very difficult to predict. These systems must have gone through a \ac{CE} but the uncertainties in their evolution leave us with constraints that are even weaker than those obtained from lower-mass systems discussed above. An alternative approach to constraining \ac{CE} simulations is given by the analysis of the \acp{PN} around post-\ac{CE} binaries. At least one in five \acp{PN} is formed in \ac{CE} interaction; possibly quite a bit more \citep{miszalski2009a, jacoby2021a}. The shape of the nebula is likely not only carrying the blue print of the interaction, but also guarantees that the \ac{CE} interaction took place in the immediate past of the object, or else the nebula would have dispersed (\acp{PN} cannot be seen for much longer than \num{50000} years after ejection, and usually are quite a bit younger than that). The shapes of \acp{PN} around post-\ac{CE} systems were already studied in the 1990s \citep{bond1992a}, and \citet{demarco2009a} showed that there is a diversity of morphologies even around relatively similar binaries. The immediate conclusion is that there must be a diversity of interactions. Elongated or bipolar morphologies are often observed in remnants of interacting systems such as V838~Mon or Nova 1670 \citep[CK~Vul;][]{kaminski2021a} and can possibly interpreted as a result of jets or collimated outflows. Such mechanisms potentially contribute to the shaping of \acp{PN} \citep[e.g.][]{corradi1995a, soker1998c, soker2004b, soker2004c}. It is suggestive that shapes of post-\ac{CE} remnants are a sensitive probe of the details of the interaction. Pre-CE interaction and potentially also jets around the companion in the early inspiral phase may be important for the morphology of \acp{PN} \citep[e.g.][]{akashi2021a}. The spaping of biploar \acp{PN} and proto-\acp{PN} by jets or collimated outflow from a companion in a bianry system was simulated by, e.g., \citet{lee2003a, lee2004a}, \citet{garcia2004a}, \citet{akashi2008a}, \citet{akashi2008b}, \citet{dennis2008a}, \cite{huarte2012a}, \citet{velazquez2012a}, \citet{akashi2016a, akashi2017a, akashi2018a}, and \cite{akashi2018b}. These simulations assumed the interaction to take place in an isotropic wind issued from an \ac{AGB} star or inside the envelope of such a star but did not explicitly account for \ac{CE} interaction. \citet{garcia2018a}, \citet{frank2018a}, \citet{zou2020a}, \citet{garcia2020a}, and \citet{garcia2021a} modelled the formation of \acp{PN} using, as starting point, the circumstellar gas distribution generated by a \ac{CE} simulation. \citet{garcia2018a} employed the Eulerian grid-based \ac{CE} simulation of \citet{ricker2012a} under the assumption that the \ac{CE} gas represents the circumbinary environment into which the post-\ac{AGB} primary blows its low-density, spherical, fast wind, generating the visible \ac{PN} \citep[the origin of fast wind is not under debate, although there are scenarios in which this wind is not spherical at the origin, but already collimated;][]{balick2002a}. \citet{garcia2018a} carried out axisymmetric simulations of the long-term evolution for (\num{10000} years---typical \acp{PN} have maximum lifetimes of \num{50000} to \num{100000} years---accounting for ionization effects. The symmetry of their simulated \acp{PN} is not a surprise given the dimensionality of their simulation, but it already gives an idea that the nebula has a bipolar shape because of the typical equatorial concentration of the expanding \ac{CE}. \citet{frank2018a} and \citet{zou2020a} carried out \ac{3D} simulations of \ac{PN} formation using as starting point the \ac{SPH} \ac{CE} interaction model of \citet{reichardt2019a} taken several years after the end of the inspiral. As was the case for the work of \citet{garcia2018a}, they launched a spherical wind of a certain strength. However, the simulation covered only a shorter timescale of three years. Interestingly, they observed pronounced inertial collimation, but noticed that strong \ac{3D} effects do not guarantee a symmetric \ac{PN}. \citet{garcia2020a} continued the work started by \citet{garcia2018a} investigating different types of magnetized fast winds blown into the \ac{CE} ejecta. They also commented that the collimation observed by \citet{zou2020a} was due to the pronounced evacuated polar funnels in the \ac{CE} ejecta which, they remarked, must be due to the adiabatic nature of the \ac{CE} simulation. Only additional simulations will be able to tell just how much collimation is expected. \begin{figure} \centering \includegraphics[width=0.8\textwidth]{fig22.pdf} \caption{Radial velocity (a) in the \ac{MHD} \ac{CE} simulation of \citet{ondratschek2022a} compared with that in a pure hydrodynamics model (b). Figure from \cite{ondratschek2022a}.} \label{fig:ondratschek2022_fig3} \end{figure} \citet{ondratschek2022a} took a different approach to the problem of \ac{PN} formation. Their \ac{CE} simulation, which included magnetic fields and extended to a later phase of \ac{CE} interaction, where the envelope is completely unbound even according to the conservative estimate involving the kinetic energy of the gas only, results in a collimated jet, magneto-centrifugally launched towards the end of the inspiral. Similar jet-like outfows were also reported by \cite{garcia2021a}. The resulting bipolar morphology is certainly different from that of simulated ejected \acp{CE} that do not include magnetic fields, see Fig.~\ref{fig:ondratschek2022_fig3} for a comparison. The shaping of the \ac{PN} deriving from such configuration will still be affected by whatever fast wind is launched next due to the heating central star and, as is the case for the other post-\ac{CE} \ac{PN} simulations, by the ionization front propagating through the material. Clearly this line of comparison between \acp{PN} and \ac{CE} ejecta is in its early days, but it promises to yield very convincing results. \subsubsection{Transient events caused by CE interaction} \label{sssec:transient_events_likely_due_to_a_ce_interaction} The dynamical part of the \ac{CE} interaction is short-lived and it is therefore expected to be observed only rarely. With the advent of time-domain astrophysical observations, e.g., Palomar Transient Factory \citep{law2009a}, the Catalina Real Time Transient Survey \citep{drake2009a}, SkyMapper \citep{murphy2009a}, and The Zwicky Transient Factory \citep{bellm2019a}, we have now realized that a number of luminous outbursts, or transients, were actually \ac{CE} interactions, demonstrated beyond doubt for at least some objects \citep[such as V~1309~Sco,][]{tylenda2011a}. In the near future, the Legacy Survey of Space and Time at the Rubin Observatory \citep{ivezic2019a} will undoubtedly make great progress thanks to the discovery of a large amount of the fainter events \citep[according to][about 20 to 750 detections are expected]{howitt2020a}. The current thinking is that the class of objects known as gap transients---which we have mentioned in Sect.~\ref{sect:obs_constraints}---are actually deriving from a number of physical phenomena, only some of which are likely \ac{CE} interactions. While the terminology has been slightly confusing in the earlier literature, with the benefit of more observations, \citet{pastorello2019a} have proposed that the terms \acfi{RN} and \acfi{LRN} are reserved for binary coalescence events of a \ac{CE} nature for lower and higher mass primary stars, respectively. The best examples of \acp{RN} and \acp{LRN} to date are V1309~Sco, with an inferred primary star mass of ${\sim} 1.5\, \ensuremath{M_\odot}$ and a mass ratio (companion star mass over primary star mass) of the interacting stars of $q=0.1$ \citep{tylenda2011a}, V838~Mon with a progenitor mass of $5$--$10 \,\ensuremath{M_\odot}$ \citep{tylenda2005a}, M31-LRN2015 with a progenitor mass of $3$--$5.5 \, \ensuremath{M_\odot}$ \citep{macleod2017a} and M101~OT2015-1 with a progenitor mass ${\sim}\, 18 \, \ensuremath{M_\odot}$ \citep{blagorodnova2017a}, with more massive examples being NGC4490-OT \citep[$20$--$30 \,\ensuremath{M_\odot}$][]{smith2016a} and possibly, $\eta$~Carinae \citep{smith2016a, rest2012a}. For most of these objects, which---again confusing the terminology---may not all be standard \ac{CE} events but belong to the broader class of stellar interactions, we have only partial lightcurves. Occasionally, progenitor photometry is identified with the best case being the V1309~Sco system which had complete photometry for three years prior to outburst \citep{tylenda2011a}. Due to the rarity of \ac{CE} events, we tend to observe the brightest cases, usually deriving from more massive objects and/or less evolved donor stars \citep{kochanek2014a, demarco2017a}. Another observational bias is that we currently have no compelling evidence that in any of the observed cases a close binary has survived. This may indicate that the observed systems failed \ac{CE} ejection and resulted in a merger of the cores. On the other hand, \citet{howitt2020a} argued that the brightest events may betray the presence of a surviving binary. In truth, we do not know. Not having observed the post-\ac{CE} binary is no proof of the \ac{CE} having resulted in a merger, as in some cases a binary could have survived that either has not been detected yet due to a lack of data or simply because it is still embedded in considerable circumstellar material. As the number of observed \acp{RN} and \acp{LRN} increases, the interpretation will become more robust. Further monitoring of past transients will also, hopefully, determine whether there is a \emph{binary} remnant, in which case we would be able to connect the event with post-\ac{CE} binary classes. The connection between \ac{RN} and \ac{LRN} transients and post-\ac{CE} binaries needs to be established if we are to use these observations as constraints of simulations. They may also hold a an answer to why, as discussed in Sect.~\ref{ssec:why_is_CE_ejection_hard_to_achieve}, simulations struggle to unbind the \ac{CE} material---a prerequisite to the survival of the binary. Lightcurves of \ac{RN} and \ac{LRN} \citep[for a one-dimensional model see, e.g.,][]{matsumoto2022a}, whether they eventually prove to be \ac{CE} events where the core binary has survived or where it has merged, should be able to provide some constraints on simulations, if only simulated lightcurves could be calculated. These, however are not yet available \citep{galaviz2017a}. For their ``common-envelope jets supernova impostor'' scenario, \citet{schreier2021a} give an estimate for optical observations. For the ``grazing envelope evolution'' scenario, \citet{soker2015a, soker2016c} argue that a fraction of the energy carried away by the jets may be converted to radiation. Consequently, a bright object may be observable as an intermediate-luminosity optical transent (perhaps a \ac{LRN}). Besides the lightcurves, other observables of mergers that can constrain simulations are parameters such as the photospheric size \citet{macleod2017a} or the initial ejection velocities, which could be measured if early spectroscopy of the event were available. For \ac{CE} mergers with massive primary stars and neutron stars or black holes as companions, supernova-like events have been suggested in the scenario of ``common-envelope jets supernovae'' \citep[e.g.][]{chevalier2012a, soker2018b, schroder2020a}. It is still to be determined how to distinguish this scenario from other explanations for Type IIn or Type II-P supernovae. Interaction with \ac{CE} material may lead to a different shaping of the light curve than what is expected from other circumstellar material \cite{soker2019b}. \ac{CE} mergers of low-mass stars with white dwarf companions may give rise to thermonuclear explosions. In this ``core-degenerate'' scenario \cite[e.g.]{kashi2011a, ilkov2012a}, the merger dynamics is essentially that of the usual double degenerate scenario for Type Ia supernova explosions. The difference is in the rate and delay time of the expected events, because inspiral of the degenerate cores in a \ac{CE} is driven efficiently by drag whereas without the envelope material it is determined by gravitational wave emission. For the appearance of the event, however, the \ac{CE} material is important: hydrogen lines may be present in the spectra in contrast to the typical Type Ia supernovae \citep{livio2003a, soker2013a}. While comparing \ac{CE} models with optical observations seems promising, there are alternatives. Gravitational waves have been detected from mergers of compact objects and this naturally implies the question of whether \ac{CE} events would be detectable with upcoming observatories, such as the Laser Interferometer Space Antenna \citep[LISA,][]{baker2019a}. Analytic and semi-analytic studies \citep{holgado2018a, ginat2020a, renzo2021a} have looked into this question, but settling it requires a treatment in the framework of full \ac{3D} hydrodynamic simulations of \ac{CEE}. \subsection{Epilogue} Shortly after the \ac{CE} phase in binary stellar systems had been proposed by \citet{paczynski1976a}, the first numerical simulations of this binary interaction were presented. However, the spatial and temporal timescale challenges in combination with lacking spatial symmetries required coarse approximations and parametrizations of effects that could not be resolved by the simulations in the 1980a and 1990s. For this reason, early simulations failed to be predictive about the success of envelope ejection and the final orbital separation of the remnant core binary system. The key to understanding \ac{CE} phases are \ac{3D} hydrodynamic simulations of the inspiral of the companion into the envelope of the giant primary star. Thanks to increasing computational power and sophisticated numerical techniques, modeling these processes with sufficient accuracy is now within reach. This has motivated different groups using different hydrodynamics codes to join the search for a full description of the interaction and substantial progress was made recently. In our review, we discussed the basic physical modeling approaches and numerical methods used in \ac{3D} hydrodynamic simulations of \ac{CEE}. On this basis, we provided an overview of the simulations performed to date, which has allowed us to emphasize where the computational frontier currently stands. We hope that this provides a guide to concentrate efforts on some of the critical problems of modelling approaches, such as for example the need to interface different modelling methodologies. By doing so we will be able to carry out increasingly sophisticated, direct comparisons of \ac{CE} simulations with astronomical observables, which are themselves proliferating with the detection of large numbers of transient phenomena. The rapid development in modeling \ac{CE} interaction has the potential to solve one of the last remaining fundamental problems of stellar astrophysics. It can complete our understanding of the evolution of the progenitors of gravitational-wave emitting mergers of double-compact objects, supernovae, planetary nebulae, gamma-ray bursts, X-ray binaries, radio-millisecond pulsars in binaries, and cataclysmic variables, among others. \section{Introduction} \label{intro} The historic detection of gravitational waves from merging black holes \citep{abbott2016a} and neutron stars \citep{abbott2017a} highlights the importance of understanding the details of binary stellar evolution. What are the physical processes that lead to mergers of these ``double-compact objects'' \citep{kalogera2007a}? Reducing the orbit such that a merger commences requires to drain orbital energy and angular momentum from the system. In the last stage before the actual merger, this proceeds due to the emission of gravitational waves---a process that is highly inefficient. Orbital decay is extremely slow. This final phase, driven by gravitational wave emission, must therefore start with a very small orbital separation; otherwise a merger could not occur within a Hubble time. How is this possible? For some compact objects, a capture of a close companion in a dense stellar environment is conceivable. However, many of the systems that eventually merge are thought to start out as main-sequence star binaries. This, of course, implies an initial separation larger than the sum of the main-sequence star radii, so a mechanism must exist to reduce the orbital separation of the stellar cores\footnote{We use the terms ``stellar cores'' and ``core binary'' when referring to a system consisting of the core of a giant star and a companion. We note, however, that the companion need not necessarily be a core of a star. It can also be a main sequence star, a planet, or a compact remnant, such as a neutron star or even a black hole.} sufficiently that eventually they merge via the emission of gravitational waves. Similar evolutionary mechanisms must be responsible for the formation of interacting binary systems involving one or two compact objects (so-called single- or double-compact binaries). Prominent examples are cataclysmic variables \citep[e.g.][]{meyer1979a,webbink1984a}, Type Ia supernovae progenitors \citep[e.g.][]{wang2018a}, X-ray binaries \citep[e.g.][]{tauris2014a}, short gamma ray burst progenitors, binary pulsars \citep[e.g.][]{chen2014b}, and close white dwarf binaries \citep[e.g.][]{zorotovic2010a, demarco2011a}. Here, the same argument applies: While still on the main sequence, the two stars in the progenitor binary must be sufficiently separated to avoid interaction. The observed phenomena, however, imply an orbital distance significantly smaller than such a relatively large initial separation. It is therefore clear that the progenitors of compact binaries were much larger in the past and would not have fitted into the orbits of the systems we observe today. The requirement of sufficient separation of the stellar binary at birth, however, does not need to hold true for the subsequent evolution, where strong interaction and mass transfer is possible, in particular because the radii of stars increase substantially for later evolutionary stages. \citet{paczynski1976a} and others\footnote{\citet{paczynski1976a}, often cited as the having first formalized the idea of the common envelope interaction, credits aspects of the concept to a number of previous works. As is often the case, a number of separate steps are eventually formalized into a clear hypothesis.} realized that this is not just another nuisance in the description of the binary system, but rather the key to understanding its evolution towards a close binary: They proposed a phase in which the two stellar cores orbit each other sharing the stellar envelope and coined the name \acfi{CE} phase for it. Such an extreme case of binary stellar interaction is the ``magic trick'' to explain the short orbital separation of single and double-compact systems of various kinds: the orbit of the companion with the core of the ``primary'' star inside the common envelope causes drag (whether gravitational or hydrodynamical), which transfers orbital energy and angular momentum to the envelope material unbinding it from the system. The stellar cores approach each other, the envelope is ejected and---voil\`a!---a close binary system emerges. While critical for the formation of narrow binary systems, the \ac{CE} phase is also ubiquitous in stellar evolution. A substantial fraction of stars forms in multiples \citep[e.g.][]{moe2017a} and many of them are bound to interact during their evolution. For example, practically all massive stars are born in multiple systems and up to 70\% experience binary interaction in their life \citep{sana2012a}. The chances for interaction are not as high for low and intermediate-mass stars, but the consequences are no less impactful for the evolution of these systems \citep{demarco2017a}. The implications of \ac{CE} interaction are far-reaching and fundamental for answering questions such as: \begin{itemize} \item What are the progenitor systems of Type Ia supernovae? \item What defines the rates and parameter distributions of novae and dwarf novae? \item Can planets survive when they are engulfed by their host star? \item How are the source systems of gravitational wave emission formed? \end{itemize} Answers these questions pivotally depend on understanding the post-\ac{CE} separation distribution. This quantity cannot be determined reliably at the moment because of shortcomings in modeling the inspiral of the companion into the envelope of the primary, orbital tightening of the core binary system, envelope ejection, and potentially other effects in late stages of \ac{CEE}. Theoretical modeling of \ac{CE} phases in binary stellar evolution has a long history. Early attempts used \ac{1D} parametrizations in the framework of classical stellar evolution theory. There are, however, reasonable doubts as to whether their results are physical. Such parametrized models have certain advantages in covering processes that act on longer timescales, but they struggle to capture what is essentially a fast, dynamical phase with no symmetry \citep{ivanova2016a}. Other models use parametrized prescriptions to follow the evolution of large samples of binary systems or populations. By calibrating the parameters on observational constraints, some of the predictions reach a certain level of confidence. Such population models are used, for instance, to estimate the event rate in gravitational wave detectors \citep[e.g.,][]{dominik2012a, belczynski2014a} and to distinguish between different progenitor scenarios for Type Ia supernovae \citep[e.g.,][]{ruiter2009a, toonen2012a}. A more direct approach to understanding the physical processes governing \ac{CEE} is the goal of numerical simulations that we focus on in our review. In addition to the listed examples of astrophysical implications of \ac{CE} interaction, the process itself is fascinating featuring strong nonlinear dynamical effects. Understanding the underlying physical processes and making reliable predictions for the outcome of \ac{CE} events cannot be accomplished without complex \ac{3D} hydrodynamics models that cover phases of \ac{CEE}, because these lack obvious spatial symmetries and proceed on dynamical timescales. The aim of such simulations is to answer specific questions about details of the inspiral and envelope ejection, which then allow for tackling the higher-order questions listed above. Some of these still unanswered, specific questions are: \begin{itemize} \item How does the system enter \ac{CEE}? \item How are orbital energy and angular momentum of the core binary transferred to the envelope? \item What physical processes lead to the ejection of the envelope? Which energy reservoirs are tapped for accelerating the envelope material? \item What processes determine the final orbital separation of the remnant core binary? \item Which systems manage to eject the envelope completely? \item What are the conditions under which the process ``fails'', i.e. a merger of the core takes place without ejecting the envelope? \item What is the morphology of the ejected envelope in the case of success? Can it explain planetary nebulae? \item What is the role of magnetic fields in \ac{CEE}? \end{itemize} The ultimate goal is to connect the initial conditions, i.e.\ the parameters of the system before entering \ac{CE} interaction, with the properties of the remnant system---most importantly its orbital parameters in the case of successful envelope ejection---but also other quantities that determine its future evolution, such as left-over envelope material or a potentially forming circumbinary disk. \subsection{Observations of common-envelope evolution} \label{sect:obs_constraints} The concept of \ac{CE} was first envisaged by \citet{paczynski1976a} to explain a specific star, V~471~Tau, a detached, compact binary comprising a white dwarf and a K dwarf, rare at the time and presumed to be a direct predecessor of cataclysmic variables. Only through a \ac{CE} inspiral in the past evolution of the system, could today's parameters be explained. Over the years, many more low-mass systems were found that can only be explained with a \ac{CE} interaction. Low and intermediate-mass star binaries that have gone through a \ac{CE} interaction are observed as post-red giant branch, sub-dwarf B (sdB) and white dwarf (WD) close binaries, or as post-asymptotic giant branch WD binaries, with either another WD or a main sequence companion. These are the immediate progenitors of cataclysmic variables. In some cases even brown dwarfs or giant planets have been deemed capable of ejecting the \ac{CE} and surviving as binaries with the core of the original giant \citep[e.g.,][]{geier2011a, schaffenroth2014a, schaffenroth2019a, vanderburg2020a}. Such lower mass, post-\ac{CE} systems are plentiful, and their parameters can be measured with relative precision, thus providing statistical information about the outcome of orbital evolution in the \ac{CE} phase \citep{iaconi2019a}. The direct consequences of envelope ejection can be seen in many \acp{PN}. At least one in five \acp{PN} is an ejected \ac{CE} \citep{hillwig2016a, munday2020a, jacoby2021a}. After the initial idea of a \ac{CE} inspiral was fleshed out, it became clear how \ac{CE} phases can explain binaries comprising the remnant of massive stars, neutron stars and black holes. Today, this group of binaries is a prime target of multimessenger astronomy. The detection statistics of gravitational-wave induced mergers of double-compact systems is strongly linked to the parameters of the \ac{CE} interaction. There are other massive systems that can be identified as binaries and that must have emerged from a \ac{CE}, such as low and high mass X-ray binaries, but unfortunately the \ac{CE} phase is not the only event that determines the observed parameters of these systems, and therefore they are not ideal to constrain \ac{CE} interaction observationally. Additionally, thanks to time-resolved astronomical surveys, an increasing number of transient events has been discovered. Supported by pre-outburst observations, several of them have been unequivocally associated with \ac{CE} interactions and stellar mergers \citep[e.g., V1309~Sco,][]{tylenda2011a}. Others have very likely undergone a \ac{CE} inspiral even if there is no definitive proof (e.g., V838~Mon, \citealp{bond2003a, goranskij2004a}, but see \citealp{tylenda2006a} for a discussion of alternative models). By statistical necessity, the majority of objects detected in these brief phases of interaction are the most luminous events, which presumably derive from more massive stars \citep{kochanek2014a}. Examples include NGC~4490-2012OT1 \citep{smith2016a} and M101-2015OT1 \citep{blagorodnova2017a} that have been detected in external, sometimes distant galaxies. A new field of study has emerged from these discoveries, alongside several competing classifications, nomenclatures and preliminary explanations for the observed events. Such transients are commonly known as \emph{gap transients}---observed in the gap between the luminosities of novae and supernovae \citep{kasliwal2012b, pastorello2019a}---or \emph{intermediate-luminosity optical transients} (ILOTs). These include \emph{\aclp{ILRT}} (\acsp{ILRT}) \acused{ILRT} \citep{botticella2009a} and \emph{\aclp{LRN}} (\acsp{LRN}) \acused{LRN} \citep{munari2002a} distinguished by their lightcurves and spectral behaviour. The latter are thought to be \ac{CE} interactions between expanding, massive stars and companions that resulted in mergers, although in most cases it is impossible to say for sure if the binary has survived. Interestingly, while \acp{ILRT} are thought to be electron capture supernovae from super-\ac{AGB} stars, there are some cases where the classification is intermediate between \acp{ILRT} and \acp{LRN} \citep{cai2019a}. Finally, a distinction between \acp{LRN} and \acp{RN} is emerging, where the latter group are a less luminous and possibly less massive counterpart of the former group \citep{pastorello2019a}. In Sect.~\ref{sect:observational_constraints} we will return to these observations and consider how they can constrain the simulations that are the central topic of this review. \subsection{Terminology of common-envelope modeling} \label{ssec:terminology} Many stars in the Universe form in binaries or higher-order multiples, and a large fraction of these engages in some kind of interaction over their evolution. The nature of such interaction can be manifold; ranging from orbital perturbations mediated by gravitational interaction, irradiation, and hydrodynamical mass-transfer processes to the most violent case: a merger of two stellar objects. \ac{CE} interaction is very close to this extreme case. In a sense, it classifies as a merger of stars because at least for some period of time two (or perhaps even more\footnote{While interaction in a stellar binary system is perhaps the most relevant case, \ac{CEE} could also proceed in higher-order stellar multiples and involve more than two stellar cores. This case is in itself interesting but has received less attention in simulations \citep[see][for an exception and references therein for implications of mass transfer in stellar triples]{glanz2021b}. The ``traditional'' case of a stellar binary is already challenging enough and its processes remain sufficiently unclear to not open Pandora's box and postpone such complications to future work. Our review will therefore focus on modeling \ac{CE} interaction in binary systems.}) stellar objects join into a single envelope. Unlike a complete stellar merger, however, this ``merged'' phase may be a transient phenomenon. After the ejection of the \ac{CE}, separate stellar cores emerge. Special conditions are required for this to work. An obvious prerequisite is that one of the interacting stars, which we refer to as ``primary'', has to exhibit a clearly separated core--envelope structure. Otherwise, it would not make sense to speak of a \emph{common envelope} in the interaction phase and to define a stellar core that emerges as part of the newly formed binary star system after the envelope ejection. This implies that the primary star has to reach an evolved, giant stage before engaging into the interaction. For a time, the companion resides inside the envelope of the giant primary star. While this companion can be a stellar object of any kind, we encounter a special case if it is another giant star. For this to happen, the initial mass ratio of the binary system has to be very close to unity so that when the primary overfills its Roche lobe as a giant, accretion onto the companion causes it to expand and overfill its Roche lobe, too. A joint \ac{CE} establishes that consists of material from both stars. Still, during the interaction, two stellar cores orbit each other inside a \ac{CE}. This case is sometimes (and confusingly) termed \emph{double core evolution}, falling back to the term that was originally used for general \ac{CE} phases. It is particularly interesting for massive stars \citep{brown1995a, dewi2006a} and may contribute a substantial fraction to the population of double neutron stars \citep{vigna2018a}. Despite this ambiguity, a stellar merger with evolved giant stars provides a useful definition of \ac{CE} interaction and includes the classical case as well as the merger of two giant stars. Naturally, as the evolution into giant stages is a continuous process, the boundaries between \ac{CE} interaction and stellar mergers are blurred. For massive stars in the giant stage (so-called \emph{supergiants}), for instance, the separation between core and envelope is less clear than the sharp interface in low-mass \ac{RG} or \ac{AGB} stars. Another example is the system V1309~Sco \citep{tylenda2011a}. It was modeled as a merger of a $1.5 \,\ensuremath{M_\odot}$ star expanding into the Hertzsprung gap with a low-mass (${\sim}\, 0.15 \, \ensuremath{M_\odot}$) main sequence companion. The primary is about 40 times larger than the secondary and the system likely went through a brief common envelope, shortly followed by the disruption of the companion near the core of the primary \citep{nandez2014a}. As a Hertzsprung-gap star, the primary would have had a less clear core-envelope boundary. Therefore, the nature of the physical interaction in the later inspiral is not quite the same as for a system with a more distinguished core. Another characteristic of \ac{CE} interaction is the aforementioned interesting possibility that after envelope ejection a tight binary of stellar cores emerges. This case is sometimes referred to as \emph{successful} \ac{CEE} to distinguish it from the case where the energy available to envelope ejection is insufficient and only parts of it can be removed. The ultimate fate of such a system is a merger of the stellar cores inside the \ac{CE}, which can also give rise to interesting phenomena: for a high-mass primary star and neutron star companion, such a scenario could lead to the formation of Thorne--{\.Z}ytkov objects \citep{thorne1975a}. It has been also suggested that because of the high angular momentum involved, a neutrino-cooled accretion disk forms around a neutron star or a black hole companion when merging with the core of the primary star. This accretion liberates gravitational binding energy, which to a large fraction is carried away by the neutrinos but some part may also be released as mechanical energy---perhaps in form of material accelerated in a disk wind or a jet-like outflow---feeding back on the surrounding envelope material (a scenario originally proposed by \citealp{fryer1998b}, and \citealp{zhang2001a}, to explain gamma-ray bursts). The corresponding events have been suggested to resemble some sub-classes of Type II supernovae \citep[such as Type IIn or Type II-P supernovae; e.g.][]{chevalier2012a, soker2018b, schroder2020a} and are sometimes called ``common-envelope jets supernovae''\footnote{Events powered by a jet due to accretion onto a neutron star in the envelope instead of the core are termed ``common-envelope jets supernova impostors'' by \cite{gilkis2019a}} \citep{soker2018b, soker2019b}. For low-mass stars involved in \ac{CE} interactions with a white dwarf companion, a thermonuclear explosion resulting from the merger of the degenerate cores has been suggested to explain some peculiar Type Ia supernovae \citep{sparks1974a, livio2003a}. This mechanism is also called the``core degenerate scenario'', e.g.][]{kashi2011a,ilkov2012a,soker2013a}. While technically for all these events one may speak of a mergers, the term \emph{failed} \ac{CEE} is commonly used for it, or sometimes, as a compromise, \emph{\ac{CE} merger}. It highlights the fact that a giant star was involved in the interaction. Also from a practical point of view it makes sense to discuss these cases in conjunction with successful \ac{CE} interactions because they constitute an interesting limit in the parameter space of such systems. That said, it may be useful to give examples of cases that do not qualify as \ac{CE} interaction. A merger of two similarly sized (but not giant) stars, for instance between two white dwarf dwarfs (corresponding \ac{3D} simulations were pioneered by \citealp{benz1990a}; see, e.g., \citealp{dan2009a}, \citealp{dan2012a}, \citealp{zhu2015a} for more recent simulations), two neutron stars (e.g. \citealp{rasio1992a} \citealp{ruffert1996b}, and \citealp{rosswog1999a}; see also \citealp{faber2012a}, \citealp{rosswog2015a}, \citealp{baiotti2017a}, \citealp{shibata2019a}, and \citealp{radice2020a} for reviews), or two main sequence stars \citep[e.g.,][]{benz1987a, schneider2019a}. Such interactions are distinct from \ac{CEE}. The initial mass transfer, that invariably commences the interaction, leads to orbital decrease and soon thereafter a tidal disruption of one or both of the stars. We would be hard pressed to state which star is in which star's envelope. \subsection{Phases of common-envelope evolution} \label{sect:phases} To set the stage for our later discussion, we review some ideas on the temporal evolution of \ac{CE} interaction proceeds. A classification of stages through which \ac{CEE} proceeds was given by \citet{ivanova2013a}. This classification was largely inspired by concepts of classical stellar evolutionary theory. Here, we focus on the computational modeling of \ac{CE} interaction. In this context, it is more useful to think of \ac{CEE} as a three-part interaction, paying attention to the vastly different timescales (to be defined later in our discussion) on which the stages proceed and consequently our ability to model them in numerical simulations: \begin{enumerate}[(i)] \item The first part starts with mass-transfer triggered by a star growing into its Roche lobe, or from the synchronized orbit becoming Darwin-unstable and leading to a loss of co-rotation. The companion starts to approach the primary. This phase ends when the mass-transfer process assumes a runaway nature. \item The second part is the inspiral of the companion into the envelope of the primary. It leads to the typical structure in which two stellar cores orbit each other inside a \ac{CE}. This phase is essentially dynamical. \item The third phase is a combination of the self-regulating phase (phase III of \citet{ivanova2013a}), its termination (their phase IV) and what comes after (their phase V). This phase starts with the companion--core distance stabilizing and the envelope adjusting thermally to a new equilibrium. \end{enumerate} Our classification intentionally leaves out the long-term evolution of the binary system up to \ac{CE} interaction and the fate of the system after completion of the \ac{CE} phase. The former is important because it determines the global parameters of the interacting system and sets the initial conditions of the \ac{CE} interaction. However, we take these as given and focus on the \ac{CE} phase itself in this review. Likewise, however interesting from an astrophysical point of view, the long-term evolution of the system resulting from \ac{CEE} is not the subject of our discussion. There are a lot of subtleties to this picture and to an extent it is a matter of taste how we decide to break down the interaction into different parts. It is also clear that the last ten years of development have refined some of the ideas behind the phases listed by \citet{ivanova2013a}. For example, the pre-inspiral phase is more complex than a simple unstable mass-transfer starting out at the time of Roche lobe overflow. If the mass ratio is in the proximity of the analytically-derived threshold for instability \citep{tout1991a}, one may expect a longer phase of semi-stable mass-transfer, that only eventually leads to the formation of a \ac{CE} system. Similarly, the post-inspiral phase may not or not only consist of a self-regulating phase as described in the literature. It is still unclear whether in some setups all envelope material is ejected in the dynamic inspiral phase so that a subsequent self-regulated phase does not establish. The slowing down of the inspiral observed in hydrodynamic simulations is more due to the companion bringing local gas into co-rotation, than an evacuation of the orbit \citep[at least for lower mass stars;][]{reichardt2019a}. And the evolution of the orbit after the end of the dynamical inspiral may have more to do with the distribution and evolution of angular momentum of the gas as the inner envelope contracts. It is also possible that the evolution in late \ac{CE} phases involves phases of mass transfer between the remaining cores or that a circum-binary disk forms. It is likely not fruitful to complicate the nomenclature while a clearer picture has not yet emerged. So for now we elect to think about these three phases in lose terms as \begin{enumerate}[(i)] \item the \emph{pre-\ac{CE} phase,} \item the \emph{inspiral phase,} and \item the \emph{post-inspiral phase.} \end{enumerate} While the first two proceed largely on dynamical timescales (potentially longer in the pre-\ac{CE} phase), the post-inspiral phase may include dynamical effects as well as processes that take place on longer, thermal timescales. We use this simple subdivisions to provide a reference frame for the discussion that follows. While classical \ac{1D} models of stellar evolution are suitable for addressing processes on longer thermal timescales, the decisive part of \ac{CE} is part (ii) of our classification. Some aspects of parts (i) and (iii) proceed on dynamical timescales, which need to be addressed with the hydrodynamical simulations we focus on in our review. \subsection{Structure of this review} \label{ssec:structure_of_this_review} Our review concentrates on advances in the understanding of the common envelope interaction based on multidimensional hydrodynamic simulations. In Sect.~\ref{sect:understanding} we set this discussion into context by reporting the current stance on the common-envelope interaction. It derives from years of modelling using distinct approaches: parametric formalisms (Sect.~\ref{sec:parametrized_models}) use primarily energy and angular momentum considerations to connect an initial stellar binary system to the outcome of the interaction. One-dimensional ``mechanical'' models as described in Sect.~\ref{sec:one_dimensional_implicit_approaches} try to determine the drag force experienced by the companion when spiralling into the envelope of the primary star. Integrating a simple equation of motion results in a model for orbital evolution that can be coupled energetically to the envelope whose evolution is then followed with a classical one-dimensional stellar evolution code. Such \ac{CE} models are of interest not only from a historical perspective. They may help to interpret the general behaviour of more complicated hydrodynamic models and to derive a predictive model from them to be used in binary stellar evolution theory. The development of \ac{3D} hydrodynamic models is only briefly mentioned in Sect.~\ref{sec:multi_dimensional_hydro_models}, because they are at the core of the remainder of this review. In Sect.~\ref{sect:challenges_physical}, we discuss the physics that governs \ac{CEE} and its modeling. This section provides the physical basis of numerical implementations but also points out the modeling challenges caused by physical effects. After introducing the fundamental (but probably insufficient) gravo-hydrodynamic model that describes \ac{CE} interaction as arising exclusively from hydrodynamic and gravitational interaction in Sect.~\ref{sect:gravohydro}, we explain why multidimensional simulations of \ac{CE} phases are required to properly represent the relevant physical processes in Sect.~\ref{sect:whymultid}. The question of why in such simulations it remains difficult to decide on the most pressing problems---envelope ejection and final orbital separation of the remnant binary system---is discussed in Sect.~\ref{ssec:why_is_CE_ejection_hard_to_achieve}. Physical phenomena that should be included in \ac{CE} simulations are mentioned in Sect.~\ref{sect:whymultiphysics}. We conclude Sect.~\ref{sect:challenges_physical} with pointing out why the dynamic inspiral phase---although demanding to model and decisive for the outcome of \ac{CE} interaction---is not the full story and the phases preceding and following it have to be taken into account in order to establish a comprehensive model of \ac{CEE}. Approaches to numerical implementations of \ac{CE} models are reviewed in Sect.~\ref{sect:challenges_numerical} with a focus on computational fluid dynamics (Sect~\ref{sect:cfd}), self-gravity (Sect.~\ref{sect:gravity}) and problems of energy and angular momentum conservation (Sect.~\ref{sect:conservation}). Different discretization approaches have been used to model \ac{CEE} and we try to point out advantages and drawbacks of specific methods. Apart from some specific drawbacks of certain schemes, there are general problems arising from the multi-physics and multi-scale nature of the problem that have posed challenges to virtually all \ac{CE} simulations to date, and we discuss them, too. A related topic is the setup of \ac{3D} hydrodynamic \ac{CE} simulations. It is sufficiently important, but also delicate in its treatment, to deserve the separate Sect.~\ref{sect:setups}. The actual \ac{3D} hydrodynamic \ac{CE} simulations published so far are reviewed in Sect.~\ref{sect:simulations}. After discussing simulations pertaining to the pre-\ac{CE} phase (i) of our classification in Sect.~\ref{ssec:simulations_of_the_pre-dynamical_inspiral_phase}, we give some account of simulations that focus on resolving the details of the interaction between the companion and the gas of the \ac{CE} in Sect.~\ref{ssec:windtunnel}. While in these---as a necessary compromise for reaching high spatial resolution---only some part of the system is included in the simulated domain, global \ac{CE} simulations try to follow the evolution of the entire system through the inspiral phase (ii). As discussed in Sect.~\ref{sect:sim_global}, these have been developed over the past decades, and we give some account for the historical development of ideas and techniques. At the moment, a rapid increase in the quality of such hydrodynamic simulations is observed that originates from a combination of increasing computational power and new numerical modeling techniques. In Sect.~\ref{sec:future_perspective} we draw conclusions (Sect.~\ref{sect:current}) and give future perspectives for \ac{CE} modeling. We discuss physical modeling aspects (such as missing physical effects, Sect.~\ref{ssec:missing_phisical_effects}) as well as numerical issues (e.g. Sect.~\ref{sect:unresolved_num} on unresolved numerical problems). The post-inspiral phase (iii) is difficult to capture in \ac{3D} hydrodynamic approaches. Therefore, such simulations have to be augmented with \ac{1D} classical treatments of stellar evolution as discussed in Sect.~\ref{ssec:interfacing_3d_global_simulations_with_1d_simulations_of_the_ce_remnant}. An ultimate goal of \ac{CE} modeling is to connect directly to binary evolution calculations (Sect.~\ref{ssec:extracting_1d_parametrization_from_multiD_simulations}) and to astronomical observations (Sect.~\ref{sect:observational_constraints}). \section{Current theoretical understanding of common envelope interaction} \label{sect:understanding} In the previous section, we have introduced the \ac{CE} phase as a necessary model to explain a number of observed systems, and we have emphasized the importance of this phase to explain and connect a number of new observations, such as gravitational wave detections. In this section, we report on the progress that has been made to elucidate the details of this interaction since the days when it first was proposed in the late 1970s. Attempts to model \ac{CEE} can be classified into three categories: parametric formalisms, one-dimensional (\ac{1D}) ``mechanical'' models and \ac{3D} hydrodynamic simulations. In Sects.~\ref{sec:parametrized_models} and \ref{sec:one_dimensional_implicit_approaches} we discuss the former two categories. This is meant to summarize approaches that can be seen as complimentary to the \ac{3D} hydrodynamic simulations. While potentially useful for the interpretation and---potentially---for casting the results of such simulations into a simpler framework applicable in classical stellar evolution approaches, they lack predictive power and do not require sophisticated computational methods. Arriving at \ac{3D} hydrodynamic simulations of \ac{CEE} in in Sect.~\ref{sec:multi_dimensional_hydro_models} sets the stage for an in-depth discussion of these models in the following sections of our review. It has to be pointed out, however, that none of the three approaches has, to-date, provided a satisfactory picture of the interaction, nor have they enabled a predictive model of \ac{CEE}. Nevertheless, they have laid a solid foundation for the modern efforts, which will hopefully lead to the next wave of breakthroughs. \subsection{Parametric models: the energy ($\alpha_{\rm CE}$) and angular momentum ($\gamma$) formalisms} \label{sec:parametrized_models} Parametric formalisms for modeling \ac{CE} phases are based on general considerations of the energy or angular momentum budget in the interacting systems. They determine the orbital energy and angular momentum required to achieve envelope ejection. This simple estimate allows to determine whether successful \ac{CEE} is possible or a \ac{CE} merger is more likely. From the energy or angular momentum budgets, the formalisms allow to derive the orbital parameters of the surviving binary system. This way, they provide the end stage of \ac{CEE} for a given initial system without attempting to model the dynamical processes linking them. Therefore, such models give little insight into the physics of \ac{CE} phases. Their predictions seem questionable, but they allow us to construct population models to explain observations and they provide guidance for multidimensional simulations of \ac{CEE}. The \emph{energy formalism} \citep{vandenheuvel1976a, webbink1984a} is the coarsest parametrization of \ac{CEE}. It equates the binding energy of the envelope, $E_\mathrm{bind}$, with the loss of orbital energy, $\mathrm{\Delta} E_\mathrm{orb}$, during the inspiral \begin{equation} \label{eq:alpha_CE} E_\mathrm{bind} = \alpha_\mathrm{CE} \mathrm{\Delta} E_\mathrm{orb}, \end{equation} where the efficiency parameter \ensuremath{\alpha_\mathrm{CE}}\ accounts for the fact that only some of the deposited orbital energy may be needed to unbind the entire envelope with the remainder being expended to accelerate all or part of the envelope to speeds in excess of the escape velocity, or being radiated or convected away. This would imply values of \ensuremath{\alpha_\mathrm{CE}}\ in the range from $0$ to $1$. Accounting for the fact that other energy reservoirs than the orbital energy of the companion may be tapped to unbind the envelope, $\ensuremath{\alpha_\mathrm{CE}} > 1$ is formally possible. A reliable determination of \ensuremath{\alpha_\mathrm{CE}}\ is required to turn the energy formalism into a predictive model, but this is difficult to reach. In fact, many questions have been raised about the effectiveness of using this pasteurization to describe the event. What exactly is the value of \ensuremath{\alpha_\mathrm{CE}}? Should be a function of parameters, or of time? \citet{ivanova2013a} point out that $\alpha_\mathrm{CE}$ being exactly equal to one is an extreme fine-tuning problem. It could be a function of stellar and binary parameters, but has traditionally been set to a constant value for use in population synthesis models that need to predict the final separation of systems given their envelope binding energy \citep[e.g.,][]{toonen2018a}. Some population studies tried to use a functional value of \ensuremath{\alpha_\mathrm{CE}}\ \citep{politano2007a}, but this has not enlightened the discussion. Observational studies based on close binaries involving white dwarf stars (particularly single-degenerate systems, where the companion is a main sequence star) have attempted a calibration of \ensuremath{\alpha_\mathrm{CE}}. Some of these studies proposed a particular constant value for \ensuremath{\alpha_\mathrm{CE}}\ \citep[][see Fig.~\ref{fig:zorotovic+10}]{zorotovic2010a} while others advocated a variable value \citep{demarco2011a}. In the end, all these approaches are plagued by the large uncertainties introduced in the many steps required to reconstruct the parameters of the white dwarf progenitor star. \begin{figure} \centering \includegraphics[width=\textwidth]{fig01} \caption{Values of $\ensuremath{\alpha_\mathrm{CE}}$ derived by reconstructing or measuring the binding energy, the initial and the final separations of observed compact single degenerate post-\ac{CE} binaries. Colors indicate the nature of the primary star in the progenitor system: red dots mark \ac{RG} stars and blue dots \ac{AGB} stars. The results are plotted as a function of companion mass $M_2$ (left panel) or of the period after the \ac{CE} interaction $P_\mathrm{CE}$ (right panel). Figure adapted from \citet{zorotovic2010a}.} \label{fig:zorotovic+10} \end{figure} The energy formalism involves uncertainties that go beyond the tunable efficiency parameter. They relate to the definition of the binding energy of the envelope. Even if a non-parametric expression can be used, for example by calculating the binding energy from \ac{1D} stellar structure models, according to \begin{equation}\label{eq:ebind} E_\mathrm{bind} = \int_{M_\mathrm{core}}^{M_\star}\left[ - G \frac{M(r)}{r} + \alpha_\mathrm{th} u \right] \mathrm{d} m \end{equation} \citep{dewi2000a}, there is always the issue of the mass coordinate $M_\mathrm{core}$ at which the core of the primary star (of total mass $M_\star$) ends and its envelope (of mass $M_\mathrm{env}$) begins \citep[e.g.][]{dewi2000a, demarco2011a, kruckow2016a}. The choice of this parameter greatly alters the result. For the outcome of \ac{CE} interaction, the mass coordinate down to which the envelope has to be removed so that the remaining object does not re-expand---sometimes called \emph{bifurcation point}---is of particular interest. It sets the minimum orbital separation that the system has to reach in order to terminate \ac{CEE} \citep{tauris2001a, deloye2010a, ge2010a, marchant2021a, vigna2022a}. The first term in the integral of Eq.~(\ref{eq:ebind}) is clear: it is the gravitational binding energy of the envelope gas with $G$ denoting the gravitational constant. The specific\footnote{\emph{Specific} here means per unit mass.} internal energy $u$ in the second term, however, is a bit ambiguous. It should contain all other energies of the envelope that potentially decide on its binding status, such as the thermal energy of the gas, the energy of the radiation field (expressed via the Stefan-Boltzmann law), the ionization energy of the atoms, the dissociation energy of molecules \citep{dewi2000a}. The problem with including these energies is that in order to support envelope ejection, they must be converted into kinetic energy of the gas during \ac{CE} interaction. Because it is unclear for which of these energies and to which extent this is the case, a fudge factor $\alpha_\mathrm{th}$ was introduced \citep{han1995a, dewi2000a}. Unfortunately, the introduction of two tunable parameters, confusingly both called $\alpha$ but with partially different meanings\footnote{To add to the confusion the index ``th'' seems to refer to thermal energy of the envelope gas although it parametrizes also other contributions to its internal energy.}, leads to degeneracies in the formalism. The variation captured in $\alpha_\mathrm{th}$ could as well enter the global $\ensuremath{\alpha_\mathrm{CE}}$. In order to express the binding energy as a function of the structure of the envelope in a simple way, the structural parameter $\lambda$ was introduced\footnote{A similar formalism can be found in \citet{webbink1984a}.} by \citet{dekool1987b} via \begin{equation} E_\mathrm{bind} = -G \frac{M_\mathrm{env} (M_\mathrm{env} + M_\mathrm{core})}{\lambda R}, \label{eq:ebind_para} \end{equation} with the stellar radius $R$. The structural parameter $\lambda$ scales the radius of the star to represent its degree of internal concentration. This parameter can be determined by fitting to \ac{1D} stellar structure models, or it can remain a free parameter (often used in the combination $\alpha \lambda$, that summarizes both the binding energy and the envelope ejection efficiency). Obviously, the value of $\lambda$ for a given stellar structure depends on how the binding energy of the envelope is defined---and thus on the uncertainties captured in $\alpha_\mathrm{th}$ in Eq.~(\ref{eq:ebind}). For example, using the $\lambda$ values from the table of \citet{loveridge2011a} requires to adopt their analytical representation for the binding energy, which differs from that of other authors \citep[see the discussion in][]{iaconi2019a}. Returning to the question of which parts of internal energy can support envelope unbinding (which would justify their inclusion in the second term in the integral of Eq.~(\ref{eq:ebind}) as counteracting the first gravitational binding energy term), \emph{ionization energy} of the envelope gas seems to be particularly relevant. It has first been argued by \citet{han1995a} that as material in the expanding envelope falls below the ionization threshold, the released recombination energy can be used to expand or even eject the envelope. Its inclusion in the energy budget effectively implies that the binding energy of the envelope is less negative, or indeed even positive, in which case \ensuremath{\alpha_\mathrm{CE}}\ is larger than unity. The exact fraction of recombination energy that is used to do work is in question at the moment because recombined hydrogen is far more transparent to photons than ionized hydrogen, implying that a fraction of the hydrogen recombination energy could escape as radiation instead of being thermalized. Helium recombination energy, in contrast, may be used more efficiently as its release happens deeper in the star, in layers that stay optically thick for longer. Although several treatments of this phenomenon have been presented \citep[e.g.,][]{ivanova2018a,soker2018a}, the answer appears to be outside the ability of analytical theory, and gives another reason to recur to simulations that include radiation transport. Additional processes that may be relevant but are not accounted for in the simple energy formalism include nuclear energy generation, tidal heating, energy released by the accretion of material onto the companion star, radiation losses and magnetic field generation \citep{ivanova2013a}. Instead of considering energy balance, \citet{nelemans2000a} used the angular momentum balance to relate the pre- and post-\ac{CE} states of the system. Assuming a linear reduction of angular momentum $\mathrm{\Delta} J$ with mass loss $\mathrm{\Delta} M$ (which could be equated to the envelope mass for full envelope ejection), this gives \begin{equation} \frac{\mathrm{\Delta} J}{J} = \gamma \frac{\mathrm{\Delta} M}{M}, \end{equation} again introducing a tunable parameter $\gamma$. The motivation of this \emph{angular momentum}, or \emph{gamma-formalism} was to model the evolution of double helium white dwarfs, which requires $\gamma \approx 1.75$ \citep{nelemans2001a, nelemans2001b, nelemans2005b}. The authors argued that explaining these systems with the energy formalism fails, although \citet{webbink2008a} remarks that the reason is that the first of the two mass transfer phases in the systems discussed by \citet{nelemans2005b} was not a common envelope, but a quasi-conservative mass transfer phase. While this explanation is not perfectly satisfying, as \citet{webbink2008a} also discuss, the main problem with the gamma-formalism stems from its lack of predictive power. The value of $\gamma$ is in fact constrained to lie in the narrow range between $\nicefrac{5}{3}$ and $\nicefrac{5}{8}$, within which it predicts a wide range of values for the final orbital separation of the post-\ac{CE} core system. Parametric models provide a shortcut through the complex \ac{CE} interaction for population synthesis studies. The validity of the energy and angular momentum formalisms is still to be confirmed with simulations that capture the details of the actual physical interaction. It is therefore important to point out the fundamental differences and the relations between these formalisms and detailed hydrodynamic simulations of \ac{CE} interaction. The simplified descriptions are based on the global budgets of conserved quantities, but they do not specify where energy is injected and what fraction of it is used for unbinding the envelope. They assume certain initial and end stages without modeling the dynamical processes linking them and therefore give little insight into the physics of \ac{CEE}. But even within the global view of parametric models, questions arise: Are the efficiency parameters universal? If not, how do they depend on the parameters of the initial models, such as the mass ratio of the stellar components, the evolutionary state of the primary star, or even the plunge-in time? Consequently, parameters such as \ensuremath{\alpha_\mathrm{CE}}\ or $\gamma$ by themselves cannot shed much light on the physical processes and they are of little use to constrain \ac{3D} hydrodynamic models. Conversely, a goal of more advanced simulations of \ac{CEE} is to fix or predict parameters like $\ensuremath{\alpha_\mathrm{CE}}$ to enable their further use in parametric studies. A full treatment with detailed numerical simulations is ultimately required to validate such parametrizations and---if possible---generate prescriptions for parametrized approaches that supply them with predictive power. \subsection{One-dimensional inspiral models} \label{sec:one_dimensional_implicit_approaches} A more detailed description of \ac{CE} phases than that provided by the simple parametric formalisms discussed in Sect.~\ref{sec:parametrized_models} is obtained from \ac{1D} stellar structure models that integrate the change of orbital separation during the inspiral of the companion into the envelope of the primary star as obtained from a parametrized approach to the inspiral \citep[e.g.][]{alexander1976a, fragos2019a}. These models do not provide a self-consistent description of the drag forces acting on the stellar cores. With an assumed drag force model, they integrate a \ac{1D} equation of motion for the inspiral of the companion into the envelope of the primary star. A coarser approach summarizes the inspiral by a bulk mass-loss rate that simply removes the envelope \citep{xiong2017a, clayton2017a}. Before we can give details of these models, we need to discuss analytical approximations of the gravitational drag force. \subsubsection{Analytical approximation of the gravitational drag} \label{sssec:drag} The main energy reservoir driving the \ac{CE} interaction is the ``orbit" of the initial binary system. The mechanism of the transfer of orbital energy to the envelope gas of the primary star is mainly due to the interaction between the companion and the envelope as well as the core of the giant and the envelope. Quantifying the drag around stellar cores in \ac{CEE} is a difficult task. Several effects contribute to the total force \citep{livio1984a}: dynamical gravitational braking due to deflection of surrounding gas that transfers momentum onto the companion, drag due to accretion (or evaporation) onto (from) the companion, viscous hydrodynamical or turbulent friction, and tidal forces. In the case of light companions such as massive planets and brown dwarfs, it is easy to see analytically that hydrodynamic friction onto the companion easily competes with gravitational friction, complicating the inspiral \citep{staff2016a}, but for most other situations, gravitational drag dominates. When a body moves through gas, gravitational interaction leads to a deflection of the surrounding material into a wake behind the body. Some part of the gas is accreted onto the gravitating object \cite[see][for a detailed and pedagogical derivation]{edgar2004a}. This accretion flow was first studied by \citet{hoyle1939a}, who, under the assumption of a sufficiently rarefied gas, considered the problem in terms of a collisionless system. Gas particles around the moving object---modeled as a point mass---are deflected by its gravity and approach the axis of its motion (in this case the symmetry axis of the problem) downstream of it in a ballistic trajectory. If gas particles are gravitationally bound to the object (i.e.\ in absolute value their kinetic energy is smaller their gravitational potential energy) they will be accreted with a rate that depends on the distance from the object at which they reach the collimation axis. This, in turn, specifies a critical impact parameter $R_\mathrm{a}$ around the moving object inside of which the gravitational deflection directs particles to a point on the axis where they are bound. From this simple picture, an accretion rate is derived: \begin{equation} \label{eq:hoyle-lyttleton} \dot{M}_\mathrm{HL} = \pi R_\mathrm{a}^2 \rho_\infty v_\infty, \end{equation} where $\rho_\infty$ and $v_\infty$ denote the density and velocity upstream of the gas \citep{hoyle1939a, edgar2004a}. The subscript `$\infty$' indicates that the values are measured sufficiently far away from the moving object so that they are not affected by its gravitational attraction. The critical impact parameter is usually called the \emph{accretion radius} and it is given by $$ R_\mathrm{a} = \frac{2 G M}{v_\infty^2}. $$ Here, $G$ is the gravitational constant and $M$ is the mass of the accreting object. \citet{bondi1944a} extended the analytic treatment of \citet{hoyle1939a} by relaxing the assumption of a collisionless system. Collimation of the flow to the downstream axis of motion by gravitational deflection increases the density in a collisionless system to infinity, which is unphysical. Instead, a hydrodynamic pressure builds up and a wake of finite density forms behind the object, which \citet{bondi1944a} called an \emph{accretion column}. The finite density of the wake reduces the mass accretion rate to \citep{bondi1944a, edgar2004a} \begin{equation} \label{eq:bondi-hoyle} \dot{M} = \alpha \pi R_\mathrm{a}^2 \rho_\infty v_\infty, \end{equation} where, according to \citet{bondi1944a}, the factor $\alpha$ ranges between $\nicefrac{1}{2}$ and $1$. The setup considered by \citet{hoyle1939a} applies to highly supersonic velocities of the gravitating object with respect to the gas, but it fails in cases of slow motion. A different setup that avoids dynamical effects was considered as a limiting case by \citet{bondi1952a}: a static gravitating object inside a gas that is initially at rest and from which it accretes in a spherically symmetric way. This led \citet{bondi1952a} to introduce a characteristic accretion length scale, $$ R_\mathrm{B} = \frac{G M}{c^2_\infty}, $$ where $c_\infty$ denotes the sound speed far away from the object. Outside of this \emph{Bondi radius} the accretion flow is subsonic and the density is uniform; inside of it the gas becomes supersonic and accretes onto the object in free fall \citep{edgar2004a}. The nature of the flow---subsonic or supersonic---is characterized by the \emph{Mach number,} \begin{equation} \mathit{Ma} = \frac{v}{c}. \end{equation} The resulting accretion rate onto the static gravitating object is given by \citep{bondi1952a} \begin{equation} \label{eq:bondi} \dot{M} = 4 \pi \lambda R_\mathrm{B}^2 \rho_\infty c_\infty, \end{equation} with an order unity non-dimensional parameter $\lambda$. This parameter\footnote{The notation of the parameters $\alpha$ and $\lambda$ follows the original references. They are not to be confused with the stellar structure and efficiency parameters of Sect.~\ref{sec:parametrized_models}.} plays a role analogous to $\alpha$ in Eq.~(\ref{eq:bondi-hoyle}). The similarity of Eq.~(\ref{eq:bondi}), valid for the limiting case of a Mach number $\mathit{Ma}_\infty = 0$, with Eq.~(\ref{eq:bondi-hoyle}), that applies to the case of $\mathit{Ma}_\infty \gg 1$, led \citet{bondi1952a} to propose the interpolation \begin{equation} \label{eq:BH} \dot{M}_\mathrm{BH} \sim \frac{\pi (G M)^2 \rho_\infty}{\left(c^2_\infty + v^2_\infty\right)^{3/2}}, \end{equation} often called to as \emph{Bondi--Hoyle accretion rate}. Following \citet{edgar2004a} we will refer to the general framework as the \ac{BHL} formalism. The considered setups cannot be steady: material is accreted onto the gravitating object, which not only increases its mass, but also leads to a transfer of momentum. The momentum transfer corresponds to a drag force. Dimensional considerations very approximately suggest the relation \citep{edgar2004a} \begin{equation}\label{eq:dragforce} F_\mathrm{drag} = M \dot{v}_\infty \sim \dot{M} v_\infty, \end{equation} so that the accretion rates discussed above can be translated into corresponding drag forces that act on a gravitating object moving though gas. It is important to note that the origin of this drag force is not a direct friction of the gas exerted on the moving object---in the model the object is a point mass and does not have a surface---but rather an effect of the material deflected into and accreted from its wake \citep{edgar2004a}. While, according to Eq.~(\ref{eq:hoyle-lyttleton}), the drag force in the Hoyle-Lyttleton formalism decreases monotonically with the Mach number of the relative motion, the interpolation of Bondi [Eq.~(\ref{eq:BH})] predicts a peak in it at $\mathit{Ma}_\infty = \sqrt{\nicefrac12}$ (see Fig.~\ref{fig:drag}). \begin{figure} \centering \includegraphics[width=0.7\textwidth]{fig02} \caption{Drag force as a function of Mach number according to Eqs.~(\ref{eq:hoyle-lyttleton}), (\ref{eq:BH}), (\ref{eq:drag_coulomb} -- \ref{eq:I_supersonic}) assuming $r_\mathrm{max}/r_\mathrm{min} = 20$ and the expression given by \citet{kim2007a} with $r_\mathrm{max}/r_\mathrm{min} = 10$. Figure modified from L.~Thielbeer, Bachelor thesis, Heidelberg 2021.} \label{fig:drag} \end{figure} This, however, has an additional effect: more mass is present on the downstream side of the moving object than upstream of it and this causes a backward-directed gravitational pull on it---an effect that is usually referred to as \emph{dynamical friction} and was first studied by \citet{chandrasekhar1943a} under the assumption of a collisionless system. \citet{dokuchaev1964a} extend the discussion to a collisional fluid dynamical system. For the resulting drag force in the hypersonic case, \citet{ruderman1971a} proposed: \begin{equation} \label{eq:drag_dyn} F_\mathrm{drag} = \dot{M} v_\infty \ln \left( \frac{r_\mathrm{max}}{r_\mathrm{min}}\right). \end{equation} Because of its similarity to the formalism describing Coulomb collisions in plasma physics, the logarithm in this expression is usually called the \emph{Coulomb logarithm.} It introduces two length scales, $r_\mathrm{min}$ and $r_\mathrm{max}$. They result from integration boundaries that represent the minimum and maximum radius of gravitational interaction of the moving object with the gas. Unfortunately, there is no clear definition of what these scales should be and their choice remains somewhat arbitrary. In the hypersonic case, the density asymmetry is a maximum because the material is collimated in the region trailing the moving object. For lower velocities, this is no longer the case and in the subsonic regime the dynamical drag should be smaller. Therefore, the Coulomb logarithm should involve a quantity that characterizes the flow. \citet{rephaeli1980a} suggested a form for the supersonic case that depends on the Mach number of the flow, $\mathit{Ma}$, but they argued that in the subsonic case the dynamical drag should vanish. Based on a linear perturbation analysis, \citet{ostriker1999a} derived an expression for the drag force \begin{equation} \label{eq:drag_coulomb} F_\mathrm{drag} = \frac{\pi R_\mathrm{a}^2 \rho_\infty}{v_\infty^2} I \end{equation} with the Coulomb logarithm \begin{equation} I_\mathrm{subsonic} = \frac{1}{2} \ln \left( \frac{1 + \mathit{Ma}}{1 - \mathit{Ma}} \right) - \mathit{Ma} \label{eq:I_subsonic} \end{equation} for subsonic relative velocities and \begin{equation} I_\mathrm{supersonic} = \frac{1}{2} \ln \left( 1 - \frac{1}{\mathit{Ma}^2} \right) + \ln\left( \frac{v_\infty t}{r_\mathrm{min}}\right) \label{eq:I_supersonic} \end{equation} for supersonic velocities, where $r_\mathrm{min}$ is the effective size of the moving object. The resulting drag force is plotted in Fig.~\ref{fig:drag} as a function of the Mach number. Still, the specification of the upper integration limit for the gravitational interaction in the supersonic case remains problematic for the application of this formalism to \ac{CEE}. \citet{ostriker1999a} considered a perturber moving through a uniform gas on a straight line over some finite period of time $t$ and integrate over the path it travels. \citet{kim2007a} investigated the drag force on a perturber moving on a circular orbit in a uniform gaseous medium. The main effect of this change in geometry is that a trailing tail forms behind the perturber in which the density distribution is asymmetric. Therefore, the drag force has components in lateral as well as radial direction, although \citet{kim2007a} found that the latter contributes little to the orbital decay. Based on a semi-analytic approach, \citet{kim2007a} provided fits for $I$ in Eq.~(\ref{eq:drag_coulomb}) in different flow regimes with a functional dependency on the Mach number that resembles the form of \citet{ostriker1999a}, see also Fig.~\ref{fig:drag}. In addition to shrinking the orbital separation between the stellar cores and transferring angular momentum and orbital energy to the envelope so that it is ejected, drag also affects the eccentricity of the core binary system. \citet{szolgyen2022a} argue that while the hydrodynamic drag acting on the companion tends to circularize the orbit, gravitational drag can both enhance or decrease eccentricity, depending on the density structure of the envelope. The analytic expressions for the drag force discussed here are important to understand the underlying effects and the functional dependencies on characteristic quantities, chiefly the Mach number of the relative velocity between perturber and gas. They are, however, not fully self-consistent because the derived relations are proportional to the drag force up to multiplicative factors, that, at best, are constants. Whether these constants are universal or whether they depend on details of the envelope structure and the inspiral of the companion has to be determined in \ac{3D} hydrodynamic simulations. In Sect.~\ref{ssec:windtunnel} we discuss further attempts at modelling the gravitational drag using hydrodynamic simulations that do not necessarily comprise the entire \ac{CE} system but rather simulate objects in ``wind tunnels''. In the future, such simulations may join forces with global \ac{CE} simulations and \ac{1D} mechanical models to build a more complete understanding of the entire interaction. \subsubsection{Parametrized 1D models of dynamical common-envelope inspiral} \label{sssec:1d_stellar_structure_models_of_the_dynamicsl_ce_inspiral} Among the first computational models of \ac{CE} interaction were approaches that follow the inspiral of the companion into the envelope of the primary and, in most cases, the associated energy deposition into the envelope gas with \ac{1D} stellar evolution codes \citep[see][]{taam1978a, meyer1979a}. These approaches determine drag forces and energy (and/or angular momentum injection) according to local conditions as encountered in a \ac{1D} structure model of the primary star's envelope. This formulation allows for a simple \ac{1D} ``mechanical'' model of the inspiral phase, i.e.\ Phase (ii) of our classification in Sect.~\ref{sect:phases}. It is based on an equation of motion for the companion under the action of a gravitational force and a drag force, \begin{equation}\label{eq:motion} \ddot{\vec{r}} = - \frac{G \left(M_\star^* + M_2\right)}{r^3} \vec{r} + \frac{1}{M_2} \vec{F}_\mathrm{drag}, \end{equation} where $\vec{r}$ is the radius vector pointing from the center of the primary star to the companion of mass $M_2$ \citep{alexander1976a}. The mass of the primary star inside the radius $\vec{r}$ is denoted as $M_\star^*$. Obviously, such a model is a gross simplification of the physical processes at work in \ac{CEE}. It assumes a symmetry of the setup that diverges from reality, where the envelope is deformed by the gravitational interaction. Moreover, for the determination of the orbital shrinkage and the associated energy (and angular momentum) deposition due to drag, it considers only the motion of the companion in the envelope of the primary, whose core is assumed to be fixed in space. This setup thus misses the drag force that acts on the core of the primary star when it orbits the center of mass of the system and thus also moves relative to the envelope gas. Nonetheless, \ac{1D} ``mechanical'' models extend beyond the simple arguments of energy or angular momentum conservation used in the formalisms discussed in Sect.~\ref{sec:parametrized_models}. They attempt a physical description of the dynamical interaction between companion and envelope, albeit in a parametric way: The inspiral of the companion into the envelope is followed according to a drag force acting on it. This model raises questions: (i) What exactly is the nature of the interaction between the companion and the envelope gas and how can the drag force $F_\mathrm{drag}$ perturbing the orbital motion in Eq.~(\ref{eq:motion}) be modeled? (ii) How does the envelope react to the injection of energy and angular momentum and what are the consequences of structural changes for the drag force? As discussed in Sect.~\ref{sssec:drag}, Question (i) has been addressed in analytic treatments in the framework of linear theory, resulting in scaling relations \citep[e.g.][]{dokuchaev1964a, ostriker1999a}. The semi-analytical model of \citet{kim2007a} extends the original setup of linear motion to the more appropriate case of circular orbits. The omission of nonlinear effects and density gradients in the envelope is accounted for by fudge factors that have to be determined from numerical simulations. We discuss \ac{3D} simulations which attempt to quantify the gravitational drag force in Sect.~\ref{ssec:windtunnel}. They have been calculated either in wind-tunnel type models (where high spatial resolution can be achieved around the point mass that acts as the inspiralling companion, see \citealp{macleod2015a} \citealp{macleod2017a}, and \citealp{de2020a}), for massive perturbers on circular orbits in a gaseous medium \citep{kim2010a}, or in a full \ac{CE} simulation where the reaction of the envelope to the inspiral can be gauged, but the resolution is inferior \citep{reichardt2019a, chamandy2019a}. Parametric approaches to the description of the drag force have been used relatively rarely in \ac{1D} ``mechanical'' models. Perhaps the most modern and comprehensive approach was that of \citet{fragos2019a}, who used the parametrization of the gravitational drag determined by the \ac{3D} hydrodynamic models of \citet{macleod2015a}. Question (ii) concerns the expansion and change of structure of the envelope. In the simplest approach, the envelope is treated as static and unperturbed by the inspiral, as assumed, for instance, in the study of \citet{macleod2015b}. In principle, however, the co-evolution of orbit and envelope can be followed in \ac{1D} hydrodynamic stellar evolution models. The idea is to inject the orbital energy and/or angular momentum released by the drag force into the stellar envelope and to model its response in a \ac{1D} hydrodynamic stellar evolution code. Different groups have developed recipes for this: Some inject released orbital energy into the thermal energy of the envelope, while others model angular momentum transfer to envelope material that also increases its kinetic energy. The employed \ac{1D} parametrizations cannot self-consistently determine what fractions of energy and angular momentum are to be injected into each of these reservoirs. Consequently, the implementations vary, but the general approach has been followed in a number of early \ac{CE} studies \citep{taam1978a, meyer1979a, taam1979a, delgado1980a,livio1984a, livio1984b, soker1984a}. In the late 1980s and the 1990s, \ac{1D} ``mechanical'' models were abandoned because of the asymmetries observed in \ac{3D} hydrodynamic simulations that called the assumption of spherical symmetry into question. The work of \citet{podsiadlowski2001a}, however, revived the method. The list of deficiencies of \ac{1D} ``mechanical'' \ac{CE} models' is long: The assumed spherical symmetry in the parametrized models is a gross simplification. It implies a local transfer of orbital energy and angular momentum and injects them into a spherical shell. In reality, however, the gravitational perturbation of the envelope is non-local and the energy is not deposited into spherical shells. In fact, the plunge-in of the companion quickly destroys any sphericity of the primary star's envelope. Moreover, the orbit in the \ac{1D} parametrized models remains circular by necessity, with concomitant non-conservation of angular momentum. Despite all these shortcomings, however, such models have their value and hold promise for capturing effects that would be very difficult to include in \ac{3D} hydrodynamic simulations of \ac{CEE}. Their recent application is therefore motivated by the need to bridge scale gaps that are hard to overcome in \ac{3D} hydrodynamic models. An example is the inspiral of neutron stars into a massive red supergiant primary star, which pose a strong spatial scale challenge. This was addressed with a \ac{1D} parametrized model by \citet{fragos2019a} generating information about the final product: a binary comprising a $2.6 \,\ensuremath{M_\odot}$ helium star and a neutron star at a separation of $3.3$ to $5.7 \,\ensuremath{R_\odot}$. \citet{clayton2017a} explore the evolution of \ac{CE} systems after the inspiral phase (ii) when entering post-inspiral evolution [Phase (iii) of our classification in Sect.~\ref{sect:phases}], which poses a time-scale challenge. Generally, during the slower phases, several physical processes such as radiation transfer, convective energy transport, and nuclear burning, can have a substantial effect on the interaction and need to be modelled. These longer phases are themselves needed to understand the interaction as a whole, so the role of \ac{1D} parametrized models could be critical and was advocated as the most important step to further progress by \citet{ivanova2013a}. \subsection{Three-dimensional hydrodynamic models} \label{sec:multi_dimensional_hydro_models} The concept of \ac{CE} interaction is deceivingly simple, but the details are complex. As discussed above, finding a trustworthy way to parametrize actual \ac{CEE} turns out to be extremely challenging. Given a set of initial binary parameters, parametric formalisms and \ac{1D} models are still unable to reliably predict the outcome of the interaction. This is why the first \ac{3D} hydrodynamics attempts started as early as 1987 \citep{dekool1987a}. After early works \citep[see also][]{livio1988a, terman1994a}, efforts with modern codes are those of \citet[][]{rasio1996a}, who used a \ac{SPH} technique and of \citet[][]{sandquist1998a}, who used a static nested-grid technique (see Sect.~\ref{sect:sim_global} for details). These simulations generated a number of useful pieces of information, but they must be considered as being at the toy-model level from today's perspective, mostly because the vast ranges of spatial and temporal scales to be resolved was unmatched by early computational resources. A second wave of models involved a new suite of codes, both using Eulerian grid and SPH techniques \citep{ricker2008a, ricker2012a, passy2012a}. These modern efforts were fortunately soon followed by a number of additional simulations, which somewhat expanded the considered parameter space, and involved yet more codes and techniques \citep[e.g.,][]{nandez2014a, iaconi2016a, ohlmann2016a, ohlmann2016b, chamandy2018a, prust2019a, reichardt2019a}. The main appeal of \ac{3D} hydrodynamic simulations is that they can in principle model the interaction between the stellar cores and the envelope gas in a self-consistent way, although scale problems and resolution issues seriously hinder this prospect. Moreover, \ac{3D} simulations of the fast inspiral revealed just how non-spherical the CE interaction is, with outflows relatively close to the equatorial plane, and they revealed the complex flow structures involved in Phase (ii) of \ac{CE} interaction. They also clearly showed that ejecting the envelope using only orbital energy is very difficult, if not impossible, and paved the way to a deeper understanding of the energy exchange, including the impact of recombination energy on the expanding envelope. While---contrary to initial, perhaps na\"ive, hopes---\ac{3D} hydrodynamic \ac{CE} simulations have not provided a convincing value of $\ensuremath{\alpha_\mathrm{CE}}$ for the energy formalism discussed in Sect.~\ref{sec:parametrized_models}, they do provide a far deeper understanding of the parameter itself. These and other discoveries, which will be described in detail in Sect.~\ref{sect:sim_global}, have convinced many groups to pursue this investigation avenue. Computers and numerical techniques are, after all, advancing rapidly and enable ever more complex simulations. Yet, this enthusiasm also gives way to the realization that, in the end, it might be a clever combination of techniques that will take the podium. \section*{Acronyms} \begin{acronym} \acro{1D}{one-dimensional} \acro{2D}{two-dimensional} \acro{3D}{three-dimensional} \acro{AGB}{asymptotic giant branch} \acro{AMR}{adaptive mesh refinement} \acro{BHL}{Bondi--Hoyle--Lyttleton} \acro{CE}{common envelope} \acro{CEE}{common-envelope evolution} \acro{CFL}{Courant--Friedrichs--Lewy} \acro{HSE}{hydrostatic equilibrium} \acro{LRN}[LRN]{luminous red nova} \acroplural{LRN}[LRNe]{luminous red novae} \acro{MHD}{magneto-hydrodynamics} \acro{PN}[PN]{planetary nebula} \acroplural{PN}[PNe]{planetary nebulae} \acro{RG}{red giant} \acro{RN}[RN]{red nova} \acroplural{RN}[RNe]{red novae} \acro{ILRT}[ILRT]{intermediate-luminosity red transient} \acro{RLOF}{Roche-lobe overflow} \acro{RGB}{red giant branch} \acro{SPH}{smoothed particle hydrodynamics} \end{acronym} \end{document} \section{Numerical approaches and limitations} \label{sect:challenges_numerical} Once the physical model is fixed---which, as discussed above, is highly non-trivial---a valid numerical discretization of the underlying equations is bound to converge to the correct result of that model. In the ideal world of infinite numerical resolution, any consistent and stable numerical scheme should give the same answer\footnote{For linear finite difference equations, this is the Lax--Richtmyer equivalence theorem \citep{lax1956a}.}. This, however, is far from reality: the discrepancy of relevant spatial and temporal scales implies that such a convergence cannot be reached easily. While some effects are treated accurately by numerical approaches, others can only be approximated. Gas flows in the envelope are usually resolved, but effects closer to the cores are increasingly difficult to represent correctly. The challenge is to find appropriate approximations. Various choices are made which may interfere with the original physical modeling so that differences in the numerical results are to be expected. The goal, however, is to reach convergence to the correct results in some key quantities. Implementing the basic gravo-hydrodynamic model of \ac{CEE} as defined in Sect.~\ref{sect:gravohydro} requires two ingredients: (i) a solver for the Euler equations of fluid dynamics (\ref{eq:mass_cons}, \ref{eq:momentum_cons}, \ref{eq:energy_cons}), and (ii) a self-gravity solver that accounts for the Poisson equation (\ref{eq:poisson}). Both are in the standard repertoire of computational astrophysics, but also mark some of the more challenging aspects of it. We review methods to obtain solutions to the hydrodynamics in the presence of gravity in Sects.~\ref{sect:cfd} and \ref{sect:gravity}, but omit implementation details; these can be found in the literature. Instead, we focus on some of the more specific aspects arising from the application of standard techniques to \ac{CEE} simulations. It is likely that physical effects beyond the basic gravo-hydrodynamic model become more commonly included in future simulations of \ac{CE} interaction. These would deserve a dedicated discussion in this section. A prominent example is radiation transfer, which, however, has not yet been established as a standard in the simulations and we therefore refrain from including it at the moment. The same applies to magnetohydrodynamic simulations of \ac{CEE}, that thus far have only been carried out by a single group \citep{ohlmann2016a} with one specific way of treating magnetic field. While we mention these simulations in Sect.~\ref{sect:sim_movingmesh}, a review of different approaches is not yet called for. \subsection{Computational fluid dynamics} \label{sect:cfd} There are numerous approaches to discretize the Euler equations of fluid dynamics. A fundamental distinction is the frame of reference in which the basic equations are formulated. One possibility, where a fixed lab frame of reference is chosen, is given in Eqs.~(\ref{eq:mass_cons}, \ref{eq:momentum_cons}, and \ref{eq:energy_cons}). Discretizing this formulation gives rise to the so-called \emph{Eulerian schemes} for solving the equations of fluid dynamics. Alternatively, discretization of Eqs.~(\ref{eq:lagrange_mass}, \ref{eq:lagrange_momentum}, and \ref{eq:lagrange_energy}) in Lagrangian specification with a co-moving frame of reference results in \emph{Lagrangian schemes} of computational fluid dynamics. Lagrangian approaches are particularly well-suited to simulations of interactions between astrophysical objects---not only in the context of \ac{CEE}, but in various other setups reaching from the simulation of mergers of compact objects \citep[see][for a review]{rosswog2015a} to mergers and evolution of galaxies in cosmological contexts \citep[e.g.,][]{liu2016b, croft2009a, stinson2013a}. Both the Eulerian and the Lagrangian approaches have their particular strengths and weaknesses. Whether these play out in specific applications depends on the context, the setup, and the research questions to be answered. \ac{CEE} is in some sense a prototypical ``Lagrangian problem'': two main objects orbiting each other and a rotating stellar envelope embedded in vacuum make methods following the fluid flow attractive. The main advantage of Lagrangian methods is that the geometry is adapted to the problem at hand. Following the motion of the fluid, advection errors are minimized. This reduces common problems with angular momentum conservation (see Sect.~\ref{sect:SPH}) and diffusion over the surfaces of the stellar objects. This said, it is not \textit{a priori} clear that Lagrangian schemes perform best in all respects. This is related to the problem that in Lagrangian specification a grid-based discretization approach leads to complicated grid geometries and the danger of tangling if the grid is to be advected along with complex \ac{3D} hydrodynamic flows. Therefore, a grid-free Lagrangian approach is commonly chosen (see Sect.~\ref{sect:SPH}), which, however, lacks the precision of grid-based computational fluid dynamics. Eulerian approaches do not face this problem. Their grid-based discretizations are unproblematic and they benefit straightforwardly from the accuracy of Riemann-based hydrodynamics solvers (see Sect.~\ref{sect:eulerian}). Therefore, no general statement is justified giving preference to one or the other method and we discuss their application in the context of particular simulations in Sect.~\ref{sect:simulations}. \ac{CE} simulations with moving-mesh codes (see Sect.~\ref{sssec:moving_mesh_approaches}) combine the advantages of a (nearly) Lagrangian scheme with the accuracy of a grid-based discretization of the equations of fluid dynamics. \subsubsection{Eulerian, grid-based methods} \label{sect:eulerian} There are various general strategies to discretize and solve the Euler equations in Eulerian specification (Equations~\ref{eq:mass_cons}, \ref{eq:momentum_cons}, \ref{eq:energy_cons}), once initial conditions are specified. Overviews are given in standard textbooks, such as \citet{ferziger2020a}. In astrophysical applications, finite-volume methods have defined the quasi-standard for the past decades. They discretize space into computational grid cells and assign cell-averages of the conserved hydrodynamic quantities to their centers. Reconstructing these averaged conserved quantities to the cell edges introduces jumps over the interfaces between neighboring cells. Such initial conditions with one discontinuity define \emph{Riemann problems.} In \emph{Godunov schemes} \citep{godunov1959a}, they are solved to determine the numerical fluxes, which are used to update the cell-averaged conserved quantities. This discretization of the equations of fluid dynamics in space has to be augmented with a discretization in time. To this end, two main classes of approaches exist: \emph{explicit} and \emph{implicit} time discretization schemes. The former determine the state at the new timestep from the state at the current timestep while the latter solves for the state at the new timestep from the given current and the new state, which requires a numerically expensive matrix inversion. While implicit time discretization can be unconditionally stable, explicit time stepping is restricted by the so-called \acfi{CFL} condition \citep{courant1928a}. It states that for stability of the scheme, the time step has to be chosen smaller than the crossing time of the fastest wave emerging from the Riemann problem over a grid cell. A rough estimate for this would be the sound crossing time over a cell. So far, all hydrodynamic schemes employed for simulations of \ac{CE} interaction use explicit time discretization and their time stepping is therefore subject to the \ac{CFL} condition. Different methods exist to ensure higher-order accuracy with specific reconstruction and time integration schemes and for enhancing the efficiency with approximate Riemann solvers. For the details of such methods, we refer to textbooks such as that by \citet{toro2009a}. The resulting high-resolution shock capturing methods are advantageous for following the spiral shocks in the \ac{CE}. Fundamentally, this property results from the fact that finite-volume methods derive from the \emph{integral form} of the equations of fluid dynamics that in contrast to the differential form as in Eqs.~(\ref{eq:mass_cons}--\ref{eq:energy_cons}) allows for discontinuous (so-called \emph{weak}) solutions. Shocks are possible in the solutions of the Riemann problems at the cell interfaces. Depending on the quality of the employed approximate Riemann solver and the numerical dissipation of the scheme, however, shocks are usually smeared out over a few grid cells. In addition to the shock-capturing feature, Godunov methods are known to reproduce phenomena such as hydrodynamic instabilities and turbulence very well. The orbital motion of the cores and the rotation of the envelope, however, imply that matter will be dragged over the spatially fixed discretization grid. Transforming into a rotating frame of reference can alleviate the problem, but because of the strongly differential motion of the involved matter the problem cannot be completely eliminated. This situation leads to advection errors that can only be mitigated with high spatial resolution, which renders Eulerian grid-based approaches to simulate \ac{CEE} a computationally expensive choice. Covering the required large domains with equally-sized grid cells for discretization would either lead to low resolution of important parts of the system in case of large grid cells or excessive computational cost when trying to resolve the relevant spatial scales. For this reason, non-uniform grids concentrating resolution in the center around the core binary system or, even better, \ac{AMR} techniques \citep[e.g.][]{berger1984a, berger1989a} are commonly employed in \ac{CE} simulations. \ac{AMR} methods subdivide grid cells once pre-defined refinement criteria are met and they de-refine when they are no longer fulfilled. Multiple levels of refinement are possible so that very high spatial resolution can be reached in some patches of the domain. In \ac{CE} simulations, mesh refinement is successfully applied around the cores to reduce the advection errors. While not as excessive as global fine resolution, \ac{AMR} still comes at the price of the higher computational effort associated with larger cell numbers and shorter numerical timesteps in smaller cells required by the \ac{CFL} condition plus a significant overhead for the bookkeeping of the complex \ac{AMR} grid structure. Nonetheless, once the resolution is high enough to ensure reasonable conservation of angular momentum, Eulerian grid-based approaches show excellent reproduction of hydrodynamical effects such as shock waves and instabilities. Moreover, their methodology offers more flexibility for extending the physical modeling base. Magnetohydrodynamics, for instance, is best implemented in grid-based techniques and the formulation of subgrid-scale models for unresolved physical effects is an attractive perspective for the future development of \ac{CE} simulations. \subsubsection{Lagrangian, smooth particle hydrodynamics} \label{sect:SPH} The problem of growing complexity of a computational grid with the evolution of the fluid-dynamical system in Lagrangian approaches is avoided in \ac{SPH} methods (\citealp{lucy1977a}, \citealp{gingold1977a}; for reviews see \citealp{monaghan1992a}, \citealp{springel2010c}, \citealp{price2012a}, and \citealp{rosswog2015a}). A particle-based discretization of the mass distribution is applied instead of a computational grid. The pressure gradient appearing in Eq.~(\ref{eq:lagrange_momentum}), however, raises the question of evaluating the gradients of quantities in a particle representation of matter. To address this problem, the particles are not understood as point masses in \ac{SPH} schemes, but they rather mark the centers of smoothed-out distributions of the conserved hydrodynamic quantities. The amount of smoothing is quantified by the choice of a \emph{smoothing kernel}, $W(r, h)$, which assigns quantities to a location at a distance of $r = | \vec{x} - \vec{x}_i |$ from the \ac{SPH} particle at point $\vec{x}_i$ and is characterized by a certain \emph{smoothing length}, $h$. The mass density at point $\vec{x}$, for instance, is obtained from summing over all $N$ \ac{SPH} particles: \begin{equation}\label{eq:dens_sph} \rho (\vec{x}) = \sum\limits_{i = 1}^{N} m_i W(|\vec{x} - \vec{x}_i|, h). \end{equation} The mathematical form of the smoothing kernel is arbitrary, but has to obey the normalization conditions of giving $1$ when integrated over all space and degenerating to Dirac's delta function for $h \to 0$. An efficient choice are kernels with compact support. They restrict the overlap to nearby particles and thus reduce the terms that have to be evaluated for the sum in Eq.~(\ref{eq:dens_sph}). A popular form is the spline kernel of \citet{monaghan1985a}, \begin{equation}\label{eq:smoothing_kernel} W(r, h) = \frac{1}{\pi h^3} \begin{cases} 1 - \frac{3}{2} \frac{r}{h}^2 + \frac{3}{4} \frac{r}{h}^3 & \mbox{if } 0 \le \frac{r}{h} \le 1;\\ \frac{1}{4} (2 - \frac{r}{h})^3 & \mbox{if } 1 \le \frac{r}{h} \le 2;\\ 0 & \mbox{otherwise,} \end{cases} \end{equation} but there are various alternatives to this choice \citep[e.g.][]{dehnen2012a}. At any given point in space, the hydrodynamic quantities thus defined can be determined by summing over contributions with overlapping smoothing kernels. Therefore characteristic size of the kernel determines the spatial resolution in \ac{SPH} simulations. For all practically useful kernel functions, the standard deviation of the kernel is very similar to the chosen smoothing length. Efficient \ac{SPH} implementations employ variable smoothing lengths assigning an $h_i$ to each particle such that quantities are determined by summing over similar numbers of neighboring particles independently of the local density. Hence, $h_i$ is an approximate measure of the linear resolution at the location of particle $i$. This particle-based discretization leads to a set of ordinary differential equations, the equations of motion of \ac{SPH} \citep{lucy1977a, gingold1977a, monaghan1992a}, that have to be solved numerically. Stability of explicit time integration is again determined by the \ac{CFL} condition, requiring timesteps smaller than the sound crossing time over a smoothing length \citep{lucy1977a, gingold1977a}. \ac{SPH} methods allow to exploit the advantages of Lagrangian schemes in \ac{CE} simulations and they have been employed extensively for this purpose. Their main benefit is that they avoid advection errors. This leads to exact conservation of angular momentum (see also Sect.~\ref{sect:conservation}). Reaching an acceptable degree of angular momentum conservation with Eulerian grid-based approaches (which is fundamental for \ac{CE} simulations) requires high spatial resolution of the rotating objects which often can only be reached with \ac{AMR} techniques. This makes these schemes computationally more expensive than \ac{SPH}-based simulations. Another feature of Lagrangian schemes is Galilean invariance---the solution is not affected by the presence of bulk velocities. Violation of Galilean invariance may suppress hydrodynamic instabilities when altering the background velocity and keeping the spatial resolution fixed. Again, Galilean invariance in Lagrangian schemes results from avoiding advection errors and distinguishes \ac{SPH} from grid-based approaches. Conceptually, \ac{SPH} is very similar to numerical schemes for simulating the evolution of collisionless $N$-body systems under the action of gravity. The only differences in the underlying equations are the terms involving pressure. For such systems, efficient methods have been developed to calculate self-gravity (see Sect.~\ref{sect:gravity}) and these are exploited in the \ac{SPH}-based simulations of \ac{CEE}, where this effect is fundamental for the dynamics. Another advantage is that no pseudo-vacuum has to be introduced for embedding the system of interest. \ac{SPH} particles are placed where the matter of the object of interest is located. The computational domain is arbitrary, free boundary conditions are natural to the scheme and without excessive computational cost the computational domain can be large enough so that no material leaves and conservation of global quantities can be checked. The placement of particles exclusively inside the objects of interest in combination with summing up the contributions to conserved quantities from neighboring particles, however, introduces an imbalance that causes an artificial surface tension in \ac{SPH}. Despite these advantages, there is a potential problem with \ac{SPH} schemes. They are based on a discretization of Eqs.~(\ref{eq:lagrange_mass}--\ref{eq:lagrange_energy})---a \emph{differential form} of the equations of fluid dynamics---and therefore allow only for differentiable (so-called \emph{strong}) solutions and not for discontinuities such as shocks. In order to treat shocks in \ac{SPH}, artificial viscosity has to be introduced to broaden the shock to a numerically resolvable continuous structure \citep{monaghan1983a}. This at the same time allows for the necessary dissipation of energy in the shock. A careful choice of the form of the artificial viscosity is required to avoid undesired effects such as dissipation in non-shocked regions or violation of angular momentum conservation. A correct representation of pre- and post-shock states is possible within the \ac{SPH} framework, but high resolution (i.e.\ a local high density of particles) is required to keep the shock structure reasonably thin. In contrast, no artificial viscosity is needed in finite-volume Godunov schemes to represent shocks. The \ac{SPH} discretization into particles naturally and necessarily follows the mass distribution of the considered system. As opposed to other astrophysical application examples of \ac{SPH}, this is a clear disadvantage in \ac{CE} simulations, where the features in the gas dynamics in a rather dilute envelope may need to be followed. Still, with limited computational resources, \ac{SPH} simulations of \ac{CEE} published so far show better performance than their grid-based Eulerian counterparts. They are able to follow the gross dynamics of the system with a fairly low number of particles without sacrificing angular momentum conservation. However, reaching fine resolution in the fluid flows and resolving instabilities requires a drastic increase in the number of particles so that there seems to be some break-even point where grid-based Eulerian techniques become more efficient. \subsubsection{Moving-mesh approaches} \label{sssec:moving_mesh_approaches} A rather recent development is the use of moving-mesh hydrodynamics codes for \ac{CE} simulations. The first of such simulations---based on the \textsc{arepo} code developed by \citet{springel2010a} for cosmological simulations with the modifications of \citet{pakmor2016a} to ensure second-order accuracy of the scheme---was presented by \citet{ohlmann2016a}. A number of follow-up studies expanded on this including additional physical effects and testing parameters of the setup model \citep{ohlmann2016b, sand2020a, kramer2020a}. An independent implementation of the moving-mesh technique in the \textsc{manga} code was used for \ac{CE} simulations by \citet{prust2019a}. \begin{figure} \centering \includegraphics[width=0.6\textwidth]{fig09.pdf} \caption{Simulation of a Kelvin-Helmholtz instability between two shearing fluids with the code \textsc{arepo} in a low-resolution (50 × 50) to illustrate the Voronoi mesh overlaid in black in the lower half of the box. Figure from \citet{springel2010a}.} \label{fig:Springel2010-Fig32d} \end{figure} The moving-mesh method can be seen as combining advantages of the Lagrangian particle-based \ac{SPH} technique and Eulerian grid-based approaches. A Voronoi tessellation of space based on a set of discrete points is used to construct a complex unstructured mesh of polyhedral cells, see Fig.~\ref{fig:Springel2010-Fig32d}. As in conventional, finite-volume grid-based codes, numerical flux functions across the thus defined cell boundaries are computed in a Godunov-type approach using Riemann solvers. These provide a scheme to update the cell-averaged values of conserved hydrodynamical quantities. The mesh-generating points can in principle be moved arbitrarily or even kept fixed---in which case the scheme recovers an Eulerian grid-based approach to numerical fluid dynamics. Advecting the points with the fluid flow, however, yields a nearly Lagrangian method. Its advantages of reducing advection errors, conserving angular momentum, and guaranteeing Galilean invariance\footnote{The failure of Eulerian schemes to obey Galilean invariance is impressively demonstrated in Figure~10 of \citet{springel2010a}, who shows that a background velocity suppresses the development of Kelvin--Helmholtz instabilities on a fixed grid. \citet{robertson2010a}, however, argue that Eulerian methods converge may converge to the correct Galilean-invariant solution.} are combined with the superior shock capturing capabilities and the improved reproduction of hydrodynamic instabilities of grid-based Godunov-type schemes. For a detailed discussion of the advantages of the moving mesh scheme, we refer to the original publication of the \textsc{arepo} code \citep{springel2010a}. While moving-mesh methods overcome the notorious problems of grid tangling in grid-based Lagrangian schemes, some measures of correcting stretched cell shapes that would result from complex flows are still required to guarantee numerical benignity \citep{springel2010a}. Therefore, the resulting moving-mesh schemes are not exactly Lagrangian but very close to it\footnote{For this reason, advection errors are minimized but not eliminated, and angular momentum is conserved with high accuracy, but not exactly.}. The Godunov-type finite-volume scheme for updating the cell values is based on the integral form of the Euler equations of fluid dynamics. It eliminates the need of an artificial viscosity as in \ac{SPH} schemes. Moreover, it avoids the inherent sampling noise errors in the gradient estimates of \ac{SPH} \citep{pakmor2013a}. Based on a finite-volume discretization, moving-mesh schemes retain the versatility of Eulerian approaches with respect to the implementation of additional physical effects. Magnetic fields, for example, can be accounted for \citep{pakmor2011d, pakmor2013b}. The first \ac{3D} \ac{MHD} simulations of dynamical \ac{CE} interaction were performed by \citet{ohlmann2016b} with the moving-mesh code \textsc{arepo}. Unresolved effects can in principle be included via subgrid-scale models. While utilized extensively in cosmological simulations with \textsc{arepo} \citep[e.g.][]{vogelsberger2013a}, this capability has not been exploited yet in simulations of \ac{CEE}. The flexibility of mesh construction can be used to implement \ac{AMR} capabilities that, in contrast to \ac{SPH} approaches, are not limited to improving the resolution of high-density regions. This is of particular interest in \ac{CE} simulations because here the focus is on resolving effects in the rather dilute envelope gas. By adding grid generation points, cells can be split up and the resolution is increased locally; removal of grid generation points reverses this procedure. This spatial adaptivity can be combined with adaptive individual time stepping (as implemented in \textsc{arepo} and \textsc{manga}), which significantly enhances the computational efficiency because it pays attention to the temporal multi-scale nature of the problem as discussed in Sect.~\ref{sect:challenges_physical}. A moving, adaptively refined mesh as implemented in \textsc{arepo} and \textsc{manga} is a powerful approach to simulate \ac{CEE}, where certain parts of the envelope, particularly the regions around the cores, benefit from higher spatial resolution, while other parts of the envelope can be represented with less computational effort. Another advantage of the currently employed moving-mesh codes is that they were derived from powerful particle-based codes, that had been written for simulations of self-gravitating systems. The efficient parallel implementation of the tree-based gravity solver of \textsc{gadget-2} \citep{springel2005a} carries over to \textsc{arepo}, and that of \textsc{ChaNGa} \citep{menon2015a} to \textsc{manga}. The origin of the moving-mesh codes from tools to simulate galaxy evolution in a cosmological context required some modifications. Methods for capturing the relevant conditions and effects in stellar matter had to be implemented \citep{pakmor2013a, ohlmann2017a, prust2019a}, see Sects.~\ref{sect:challenges_setups} and \ref{sect:sim_movingmesh}. \subsection{Implementing the equation of state} \label{sect:eos} As mentioned in Sect.~\ref{sect:gravohydro}, an equation of state relating pressure to density and internal energy (and possibly other quantities such as chemical composition and ionization state) has to be provided in order to close the fluid dynamics equations set. Realistic treatments of matter require the inclusion of various effects. Already when augmenting an ideal-gas equation of state with radiation pressure, the computational effort increases significantly. The reason is that the equation of state derived from statistical physics and thermodynamics usually provides pressure and internal energy as a function of density and temperature. A fluid-dynamical model, however, follows the conserved hydrodynamic quantities, i.e.\ density and total energy, from which the kinetic energy can be subtracted to obtain the internal energy of the gas. While an ideal-gas equation of state can still be inverted analytically to give pressure as a function of density and internal energy, this is no longer possible when including radiation pressure and therefore an iteration is required. Since the equation of state is called at least in every hydrodynamic update of each computational cell, the computational expense of this iteration affects the total demand of the simulation significantly. The situation becomes even more critical when more complex physical effects are included such as degeneracy or ionization. In such cases, modern implementations revert to tabulated data. The look-up of table values and interpolation between them can add substantial computational cost to the hydrodynamics scheme. As discussed in Sect.~\ref{sect:ionization}, in the context of \ac{CE} simulations, ionization effects are of particular interest. When envelope gas expands and cools down below the ionization thresholds of hydrogen and helium, the corresponding recombination energies are released into thermal energy. Assuming local thermal equilibrium, the effect can be included into the equation of state as done by virtually all \ac{3D} hydrodynamic \ac{CE} simulations that accounted for these effects. This approach does not provide the detailed ionization structure of the gas, which would require the solution of the Saha equation or a detailed ionization network; however, for \ac{CE} simulations this is not of immediate interest. As an input, the equation of state is given the local density and the internal energy of the gas (that corresponds to the sum of thermal and ionization energy). From this, temperature and pressure are determined. This can result in a local over-pressure when recombination energy is released, giving rise to expansion and acceleration of material. If no losses due to cooling or radiation are included, all released recombination energy is transferred to kinetic energy of the envelope gas. The processes determining the equation of state are complex and therefore the native implementation of the \textsc{opal} equation of state \citep{rogers1996a, rogers2002a} or its derivative in \textsc{mesa} \citep{paxton2011a} rely on pre-computed tabulated data. As a side remark, we mention that applying such more elaborate equations of state requires to use suitable exact Riemann solvers \citep[see, e.g.,][]{colella1985a, chen2019a} or approximate Riemann solvers for Eulerian grid-based methods. This is accounted for in most implementations of modern astrophysical hydrodynamics codes. \subsection{Modelling self-gravity} \label{sect:gravity} Gravitational forces define the \ac{CE} interaction. They mediate (1) the binding of the stellar components and the binding of the progenitor binary system, (2) the interaction and orbiting motion of the stellar cores, and (3) the interaction of the cores and the envelope gas giving rise to drag and energy transfer. This highlights the importance of treating gravity accurately and efficiently in \ac{CE} simulations. As a long-range force, gravity enters the modeling as a source term in the momentum [Eqs.~(\ref{eq:momentum_cons}) and (\ref{eq:lagrange_momentum})] and energy equations [Eqs.~(\ref{eq:energy_cons}) and )\ref{eq:lagrange_energy})]. Source terms are often discretized separately from the equations of fluid dynamics in an operator splitting approach. For the case of gravity, there are two basic choices: the gravitational potential can be determined by solving the Poisson equation (\ref{eq:poisson}) in the continuum model of matter, or the gravitational forces are computed directly from Newton's law of gravity between point masses in particle-based discretizations of matter. We note that this choice is independent of the discretization of the equations of fluid dynamics. While \ac{SPH} codes preferably use a particle-based discretization for modeling gravity, mapping to grids in the particle-mesh method is also employed occasionally. Grid-based Poisson solvers seem a natural choice for grid-based discretizations of the equations of fluid dynamics. However, since stellar cores are often modelled as point masses, grid-based schemes are sometimes coupled with particle-based gravity solvers instead. Approximations, such as a gravitational potential that is constant in time or one that is derived from a low-order multipole expansion of the overall gravitational potential, are inappropriate for capturing \ac{CE} dynamics---a full treatment of self-gravity of the involved envelope gas and stellar cores is inevitable. The Poisson equation of Newtonian gravity (\ref{eq:poisson}) poses an elliptic problem and is numerically very challenging. A direct summation of the gravitational forces gives rise to algorithms that scale with the square of the number of cells or particles $N$ quickly leading to prohibitive costs in highly-resolved simulations. In the following, we discuss various approaches employed in \ac{CE} simulations to reduce this $\mathcal{O}(N^2)$ operation count to a more modest algorithm complexity, such as $\mathcal{O}(N \log N)$. \subsubsection{Tree methods to calculate self-gravity} \label{sect:tree} In particle-based discretizations, a preferred method for calculating self-gravity of astronomical objects is a tree-based approximation \citep{barnes1986a}. The method is based on the fact that the individual contribution of distant particles to the force of a target particle is negligible, so that it is sufficient to treat the collective effect of distant particles in an approximate way, i.e.\ as a low-order multipole of the gravitational potential. The interaction with close particles, in contrast, is treated accurately. To distinguish close from distant particles, a tessellation of space in a tree hierarchy is constructed. For details, we refer to the literature \citep[e.g.][]{appel1985a, barnes1986a}. This method reduces the complexity of the algorithm to the desired $\mathcal{O}(N \log N)$. Tree-based methods are commonly employed in \ac{CE} simulations. They are a natural choice when particle-based, Lagrangian schemes (\ac{SPH}) are used to solve the equations of fluid dynamics, because they can also help to efficiently search for neighbor particles as required for kernels with compact support (see Sect.~\ref{sect:SPH}). But also in grid-based approaches to fluid dynamics, a particle-based discretization may be used to model the gravitational interaction. This is popular in particular in the context moving-mesh methods. A problem with tree-based methods, however, is that they introduce asymmetries. The approximate treatment of the gravitational interaction of a target particle with distant particles violates Newton's third law (\emph{actio} equals \emph{reactio}). This is in conflict with global momentum conservation and introduces spurious motions. Indeed, many \ac{CE} simulations performed with this methods exhibit a slow drift of the center of mass of the system. There are ways to alleviate this problem. The important notion is that random force errors would cancel during the simulation. The overall drift and momentum conservation violation results from \emph{correlations} between the errors \citep{springel2021a}. These correlations can be broken, and for this purpose \cite{springel2021a} propose to randomize the relative location of the particles with respect to the computational box. \subsubsection{Alternative methods to calculate self-gravity} \label{sect:grav_alt} An approach that appears as a natural choice in the context of grid-based discretizations, but is also used with a particle-based schemes \citep[see][]{taam2006a}, are \emph{Fourier methods.} Solving the Poisson equation (\ref{eq:poisson}) with a Green's function gives \begin{equation} \mathrm{\Phi} (\vec{r}, t) = - G \int \frac{\rho(\vec{r}', t)}{| \vec{r} - \vec{r}' |} \mathrm{d}^3 r', \label{eq:grav_alt} \end{equation} which corresponds to a convolution of the Green's function for the Laplacian with the inhomogeneity of the equation, i.e.\ the density. In Fourier space, this reduces to a simple multiplication and the required discrete Fourier transforms can efficiently carried out with the Fast Fourier Methods (FFM). Similar to the tree-based methods, this reduces operation count for calculating gravity in an $N$-body system to $\mathcal{O}(N \log N)$. \begin{comment} Another technique to speed up the calculation of gravitational forces in an $N$-body system is the \emph{Fast Multipole Method} \citep[FMM,][]{greengard1987a}. It expands the potentials (or forces) of the point masses into multipole moments and then groups the distant contributions such that the operation count scales linearly with the number of objects ($\mathcal{O}(N)$). The scaling, however, depends logarithmically on the desired error tolerance $\varepsilon$ in addition, so that the overall complexity of FMM is a---still very favorable\footnote{\citet{dehnen2014a} propose a scheme that matches the accuracy of direct summation with less than $\mathcal{O}(N)$ operations.}---$\mathcal{O}(N \log \varepsilon)$. To our knowledge, such a scheme has not yet been used in \ac{CE} simulations. \end{comment} A fast grid-based approach that reduces the effort to at least $\mathcal{O}(N \log N)$ is the \emph{multigrid technique} \citep{brandt1977a}. It accelerates iterative relaxation methods for solving the Poisson equation \citep{press2007a}. Changing the elliptic original problem into a pseudo-time dependent expression, a diffusion equation is obtained that---when relaxed to equilibrium where the pseudo-time derivative vanishes---yields the solution of the original problem. Starting from an initial guess for the gravitational potential, the relaxation is achieved in an iteration. The error in the initial guess can be seen as being distributed over the domain with various modes of different wavelength. Since standard relaxation schemes couple only neighboring cells, short-wavelength errors are quickly eliminated, but damping the long-wavelength error components takes many iteration steps. This is avoided by mapping to a hierarchy of subsequently coarser grids where the original long-wavelength components are short compared to the grid spacing and can be damped out in few relaxation steps. Subsequent projection back to the original fine grid combined with further relaxation steps and cycling through this hierarchy of grids efficiently produces the desired equilibrium solution. The multigrid method is has been used in \ac{CE} simulations by \citet{ricker2012a}. \subsubsection{Gravitational softening} \label{sect:gravsoft} If the Poisson equation (\ref{eq:poisson}) is discretized on a grid together with the equations of fluid dynamics, the grid spacing limits the spatial resolution for both the hydrodynamic quantities and the gravitational potential. As discussed above, however, self-gravity can also be solved in a particle-based discretization, independently of the discretization choice for the hydrodynamic part of the model; and even in grid-based approaches the stellar cores are often modeled as point masses. Particles can get arbitrarily close and one may expect an arbitrarily fine spatial resolution in the discretization of gravitational interaction---a potential advantage when combined with a particle-based or moving-mesh discretization of fluid dynamics. As particles approach each other, however, the gravitational forces between them grow without limits requiring the scheme to take ever smaller timesteps. This produces undesirable time sinks in the numerical scheme. Therefore, a fix is commonly employed: the gravitational potential is unphysically altered to flatten for short distances, so that the force approaches zero instead of scaling with the inverse of the squared distance. Different functional forms are employed in practice, but the simplest \emph{softened} gravitational potential---sometimes called the Plummer form of softening \citep[e.g.,][]{dehnen2001a, price2007a}---reads \begin{equation}\label{eq:gravsoft} \mathrm{\Phi}_\mathrm{soft} (r) \defeq - \frac{G m}{\sqrt{r^2 + r_\mathrm{soft}^2}}, \end{equation} where $r$ denotes the distance to the particle of mass $m$, and $r_\mathrm{soft}$ is the parameter altering the physical law---the so-called \emph{softening length}. In grid-based discretizations of fluid dynamics combined with particle-based gravity solvers, the size of the grid cells $\delta$ provides an obvious choice for the scale of the gravitational softening. However, the softening parameter does not necessarily have to be a constant but it may depend on the distance $r$. \citet{ruffert1993a} suggested the form \begin{equation}\label{eq:ruffert} \mathrm{\Phi}_\mathrm{Ruffert} (r) \defeq - \frac{G m}{\sqrt{r^2 + \epsilon^2 \delta^2 \exp [-r^2/(\epsilon \delta)^2]}}, \end{equation} with $\epsilon = 1.5$. In \ac{SPH} approaches, the only sensible scale for the softening length is the \ac{SPH} smoothing length. This can be implemented by using a general formulation for force softening \citep{dehnen2001a, price2007a} with the gravitational potential due to all particles $i = 1 \ldots N$, \begin{equation}\label{eq:phi_general} \mathrm{\Phi} (\vec{r}) = - G \sum\limits_{i=1}^N m_b \phi(|\vec{r} - \vec{r}_i|, h). \end{equation} The \emph{softening potential kernel} $\phi$ is related to the \ac{SPH} smoothing kernel (\ref{eq:smoothing_kernel}) via the Poisson equation \begin{equation}\label{eq:phisoft} W(r, h) = - \frac{1}{4 \pi r^2} \frac{\partial}{\partial r} \left( r^2 \frac{\partial \phi}{\partial r}\right) \end{equation} \citep{price2007a}. As a consequence, the gravitational potential is softened with a spline function. Such a choice seems preferable because, in contrast to the expressions (\ref{eq:gravsoft}) and (\ref{eq:ruffert}), splines reproduce the exact gravitational potential outside a finite radius. \begin{figure} \centering \includegraphics[scale=0.75]{fig10.pdf} \caption{Exact gravitational potential compared with the softened potential according to Eq.~(\ref{eq:ruffert}), labeled as ``Ruffert (1993)'' and Eqs.~(\ref{eq:phi_general},\ref{eq:phisoft},\ref{eq:smoothing_kernel}) labeled as ``Monaghan (1992)'' in arbitrary units with $h = \epsilon \delta = 1$. Figure from \citet{passy2012a}.} \label{fig:passy12} \end{figure} While alleviating the time sink problem, a consequence of gravitational softening is that inside $r_\mathrm{soft}$ the simulated dynamics is altered and less trustworthy. The physical law of gravitational interaction is modified, most strongly at distances shorter than the softening length. This is no fundamental problem for simulating self-gravitating fluids in \ac{SPH} approaches or grid-based methods combined with particle-based discretization of gravity. The scale down to which fluid dynamics is resolved usually corresponds to the scale of the softening; therefore, the gravitational interactions are sufficiently well modeled. In the context of \ac{CE} simulations, however, the stellar cores are usually represented as point particles (in the case of \ac{SPH} approaches, they are not to be confused with the \ac{SPH} particles; see Sect.~\ref{sect:representing_cores}). These core particles are distinct from the envelope gas. They interact via gravitational forces but not via hydrodynamical effects. Since the core particles comprise a substantial fraction of the total mass of the system in two points, the associated gravitational potentials fall off very steeply close to them. Gravitational softening must be applied to the core particles in order to avoid fatal time sinks. For this, a softening length has to be set. Again, depending on the discretization approach of the hydrodynamics in the envelope gas, assigning $r_\mathrm{soft}$ to either the grid spacing scale or the smoothing length would be desirable. This, however, requires to follow the very steep gradient of the potential close to the core particle, which makes the numerical representation of mechanical equilibrium configurations (such as required in the setup of \ac{CE} simulations, see Sect.~\ref{sect:challenges_setups}) challenging. The pressure gradient counteracting gravity has to be resolved in the hydrodynamic part of the simulation and the required fine resolution leads to unacceptably small time steps. In this situation, a softening according to Eq.~(\ref{eq:ruffert}), has a practical advantage over the physically more accurate spline softening: at close distances it is shallower (see Fig.~\ref{fig:passy12}) and a shallower gradient can be resolved with fewer discretization elements. Whatever choice is made for the functional form of the softening, however, setting the gravitational softening to the scale of the hydrodynamic discretization elements does not ensure sufficiently large time steps for currently affordable simulations. Therefore, \ac{CE} simulations usually shy away from a safe choice of gravitational softening parameters---from a computational point of view, the softening length should be large to reduce the computational cost of the time integration. But large $r_\mathrm{soft}$ implies a large region around the core particles in which the gravo-hydrodynamical interaction is suspicious. The dynamics around the cores are the driver for \ac{CEE} and should be modeled as accurately as possible. In fact, \citet{reichardt2020a} found that smaller softening lengths in their simulations lead to faster interaction and earlier unbinding of the envelope material. \citet{staff2016b} carried out a similar test using an Eulerian grid-based hydrodynamics code and the interaction seems to be strengthened for smaller softening lengths leading to a slight increase in the final orbital separations of the cores and slightly more unbound mass. In virtually all \ac{CE} simulations softening length for the core particles is set according to computational efficiency considerations at the expense of physical accuracy. Therefore, careful convergence tests are necessary. \subsection{Advantages and drawbacks of hydrodynamic simulation methods} \label{sect:simulations_comparison} In this section, we summarize some advantages and drawbacks of each of the three main techniques used in \ac{3D} hydrodynamic \ac{CE} simulations: \ac{SPH}, Eulerian grid-based schemes, and moving-mesh approaches. Only few direct comparisons have been carried out \citep[most notably][who compare \ac{SPH} and Eulerian grid-based simulations]{passy2012a}, and the available results do not point to major systematic discrepancies between simulations employing different numerical methods. It is far more likely that different results are obtained because of individual choices within each method. This, of course, is not a universally true statement but merely an assessment of the current state-of-the-art. As long as the physical models and implementation details of the methods dominate, the specific features of the fundamental schemes may remain hidden. For future developments, however, it is important to be aware of the different capabilities of the methods. The current status of \ac{CE} simulations, discussed in Sect.~\ref{sect:current}, merely scratches the surface of the problems involved in this complex phase of binary stellar evolution. The basic question of whether envelope ejection is possible under certain modeling assumptions can be addressed with different numerical schemes. For the current simulations, this choice affects mostly the efficiency of \ac{CE} simulations: The spatial resolution required to capture certain physical processes depends on the discretization method and it differs with its choice. As a consequence, this affects the fidelity of the simulations that can be carried out with given computational resources. This situation may be regarded as an indication of the immaturity of the field of \ac{CE} simulations: A detailed understanding of \ac{CEE} requires improved simulations and the different features of methods will play out more in the future. Each technique has particular drawbacks that may compromise the fidelity of the simulated parameters of the \ac{CE} interaction. Generally, the important aspects to consider are accuracy, efficiency and parallelizability, boundary conditions and flexibility with the geometry of the setups, conservation properties, and general versatility when it comes to include additional physics. \subsubsection{Boundary conditions and setup geometries} \label{sect:boundaries} The system to be modeled consists of two stars orbiting each other and engaging into a dynamical interaction. This setup is far from a spherically-symmetric configuration. Because of the lack of spatial symmetries in \ac{CEE}, special grid geometries (such as a spherical grid) do not provide any advantage and there are no obvious boundaries of the domain of interest such as stellar surfaces. Eulerian grid-based \ac{CE} simulations are usually conducted on Cartesian meshes in cubical boxes. This leads to conflicts with the fact that the considered \ac{CE} systems are to a good approximation embedded in vacuum\footnote{Pre-CE stages, however, may lead to mass loss and some circum-binary material may be present in reality.}. Empty grid cells cause numerical problems and therefore ``true'' vacuum cannot be represented straightforwardly in grid-based approaches---a problem for both Eulerian and moving-mesh discretizations. Therefore, cells that are located outside of the system are usually filled with a low-density \emph{pseudo-vacuum} in the hope that it does not affect the dynamics of the simulated \ac{CE} interaction. If hot enough, however, this pseudo-vacuum may have a welcome effect on the initial setup: it can reduce the steep pressure gradient at the surface of the primary star and therefore stabilize the stellar model against the dispersion observed in the case of insufficient spatial resolution of the gradient. But this comes at the price that observables cannot be meaningfully be extracted from such simulations \citep[see][for a detailed discussion]{galaviz2017a}. Moreover, if too hot, pseudo-vacuum cells may reduce the \ac{CFL} timestep. Therefore, it is advisable to keep the pseudo-vacuum as cold as possible. With certain setup procedures (see Sect.~\ref{sect:challenges_setups}), this is possible. In grid-based \ac{CE} simulations, the simulated domain has to be finite in its spatial extent and therefore outer boundary conditions at the edges of the computational domain have to be implemented in a way such that they do not interfere with the modeled system. Certainly, no material should flow into the simulation box, but, in principle, outflow of material would be acceptable. A loss of material, however, makes checking for conservation of mass, energy, angular and linear momentum inaccurate and thus the simulations cannot be fully validated using these global criteria. For this reason, the domain sizes are usually chosen so large that even with successful envelope ejection no material leaves the domain. This requires to fill large volumes outside of the interacting system with pseudo-vacuum, which can have some unwanted dynamical effects on the simulation \citep[for a discussion see][]{chamandy2019a, iaconi2018a}. To minimize such artifacts, the pseudo-vacuum should contain as little mass as possible---i.e.\ for the desired large domain sizes it should have very low densities. Representing \ac{CE} systems on a static grid as in the Eulerian approaches causes strong advection errors, implying violation of conservation properties. The only cure to this is an increase in spatial resolution---a common numerical approach to alleviate problems. Because of the spatial scale problem (Sect.~\ref{sect:multiscale}) and in the light of the desire to make the simulation domain as large as possible to avoid interaction with the boundaries, this is only promising if high spatial resolution is only realized certain, temporarily changing parts of the domain. Therefore, as discussed in Sect.~\ref{sect:eulerian}, \ac{AMR} techniques are widely used in \ac{CE} simulations. \ac{SPH} methods do not require sophisticated outer boundary conditions. Empty spaces between the objects of interest are possible and no pseudo-vacuum is needed. The artificial surface tension mentioned in Sect.~\ref{sect:SPH} supports the surface of the primary star model and no advection errors disperse the stellar material. These features make \ac{SPH} codes a natural choice for simulations of \ac{CEE} simulations. However, as discussed in Sect.~\ref{sect:SPH}, these have drawbacks when it comes to resolving low-density envelope material and hydrodynamic processes in it. For this reason, moving-mesh approaches present a favorable compromise. They combine the accuracy of grid-based discretizations with the flexibility of a Lagrangian method. With their spatial discretization based on grid-generating points, adaptive mesh refinement is straightforward and sufficiently large computational domains pose no problem. The need of grid-based methods to fill voids with pseudo-vacuum, however, persists. \subsubsection{Accuracy, efficiency, and versatility} A satisfying flow representation can in principle be achieved with any converging scheme. The key question, however, is the numerical resolution required to reach a certain level of accuracy---and this is where the schemes differ fundamentally. In this context, it has to be pointed out that an often used comparison between the number of particles in an \ac{SPH} simulation and the number of cells in a Godunov-like grid-based simulation is misleading. Whereas \ac{SPH} methods average over the particles within the smoothing kernel, Godunov schemes compute the fluxes of hydrodynamic quantities between cells and reach an effective resolution defied by the grid scale. The effective spatial resolution of \ac{SPH} simulations with the same number of particles is usually lower by a factor of a few. Generally, finite-volume grid-based discretization techniques are superior over \ac{SPH} methods in resolving hydrodynamic flow features accurately. However, at low resolution, \ac{SPH} methods often have to be given preference. They yield robust results and, in the context of \ac{CE} simulations, are capable of determining global properties of the evolution with rather little computational cost. While grid-based simulations have to cover vast amounts of pseudo-vacuum with the same effort as the actual stars, \ac{SPH} focuses the resources on modeling the physical objects of interest. While \ac{AMR} techniques alleviate the problems with grid-based \ac{CE} simulations, they introduce a significant computational overhead and require some implementation effort. Still, Eulerian grid-based simulations reach an accuracy that is very hard to match with \ac{SPH} techniques. These tend to under-resolve low-density regions. Moreover, implementing additional physics such as magnetic fields and other effects seems more natural on a given grid than in the \ac{SPH} approach, although it is not impossible there either \citep{price2012a}. Subgrid-scale models representing unresolved physical effects require a well-defined grid-scale to connect to. As mentioned before, moving-mesh techniques combine the best of both worlds: the accuracy and versatility of grid-based finite-volume methods with the geometric flexibility of a Lagrangian method. A drawback is the complex grid-generation procedure that tessellates space in every timestep. This overhead renders moving-mesh approaches computationally more expensive than \ac{SPH} but they are still superior over Eulerian grid-based approaches in terms of efficiency. \subsubsection{Energy and angular momentum conservation} \label{sect:conservation} Many hydrodynamics codes guarantee conservation of total (i.e.\ kinetic plus internal) energy and linear momentum. For finite-volume schemes, cell-averaged conserved quantities are updated via fluxes over the cell edges. What leaves one cell enters its neighbor. This is the reason why finite-volume approaches conserve momentum and energy globally (but not necessarily locally)---inside the domain, net loss or gain in conserved quantities is impossible. In the case of \ac{SPH}, mass and energy are directly ascribed to the discretizing particles and as long as no particle is lost, these quantities are conserved in this scheme, too. Conservation of total energy and linear momentum, however, is not sufficient for reliable \ac{CE} simulations for two main reasons. The first reason is that for the problem at hand, \emph{angular} momentum conservation is critical. In contrast to linear momentum and energy balance, the Euler equations of fluid dynamics---(\ref{eq:mass_cons}) to (\ref{eq:energy_cons}) or (\ref{eq:lagrange_mass}) to (\ref{eq:lagrange_energy})---do not explicitly include angular momentum balance, but only imply it. Whether or not these quantities are conserved in numerical simulations depends critically on the discretization approach. In grid-based Eulerian schemes, angular momentum conservation is not guaranteed due to the inherent advection errors. These can be decreased by adapting the geometry of the spatial discretization to the expected flow, but this is neither universal nor always possible in complex astrophysical situations. As emphasized above, the flows in \ac{CEE} certainly lack clear symmetries that could be exploited. Therefore, the only way to improve angular momentum conservation in these approaches is a costly increase of numerical resolution. As discussed in Sect~\ref{sect:SPH}, Lagrangian schemes are superior in conserving angular momentum because they avoid advection errors by construction. In fact, a variational derivation of the \ac{SPH} method \citep[e.g.][]{monaghan2001a, springel2002a} proves this feature: Within the framework of Lagrangian mechanics, the equations of fluid dynamics can be derived from a Lagrangian \citep{eckart1960a} via a variational principle. Instead of discretizing the resulting partial differential equations, however, one can discretize the Lagrangian in a particle-based approach and then derive the (discretized) \ac{SPH} equations directly. Symmetries of the original and discretized Lagrangians give rise to conservation properties: the absence of explicit time dependence implies energy conservation, their translational invariance gives linear momentum conservation, and---most importantly---their rotational invariance leads to angular momentum conservation, not only at the level of the partial differential equations, but also for the discretized equations. The second problem is that while total energy and linear momentum conservation is---for conservative schemes---guaranteed for the numerical implementation of the equations of fluid dynamics without source terms, they do not generally hold in cases where external forces are discretized in different approaches than the hydrodynamic quantities. This is the case for gravity---which, as for many astrophysical problems, is of fundamental importance for \ac{CEE}. The basic gravo-hydrodynamic model relies on an exact treatment of the conversion of gravitational binding energy and orbital energy to internal energy and acceleration of the envelope gas. Mismatches between the discretizations of the hydrodynamic variables and the gravitational potential can lead to problems with maintaining the expected mechanical equilibrium in stars (see Sect.~\ref{sect:challenges_setups}), but they may also lead to accumulating errors in the conserved quantities over long simulation periods modeling the \ac{CE} interaction. Apart from these more subtle issues, the very treatment of self-gravity already poses challenges to numerical schemes. As argued in Sect.~\ref{sect:gravity}, an exact direct summation over all contributions of $N$ discrete elements (cells in grid-based approaches, or particles in the corresponding schemes) falls into the rather unacceptable $\mathcal{O}(N^2)$ time complexity class. Therefore, approximate algorithms, such as discussed in Sects.~\ref{sect:tree} and \ref{sect:grav_alt}, are preferred. The employed approximations induce errors that potentially can accumulate over the duration of the simulations---not only in the energy but also in linear angular momentum. The center-of-mass of the considered setup can start to drift. Apart from these numerically and algorithmically caused errors, the softening of the gravitational potential (Sect.~\ref{sect:gravsoft}) alters the interactions at the fundamental physical modeling level. Still being a central force field, conservation of energy should not be affected, but changes due to adaptive gravitational softening lengths may cause problems because they artificially modify the shape of the gravitational potential in time. \begin{figure} \centering \includegraphics[width = 0.48 \textwidth]{fig11.pdf}\hfill \includegraphics[width = 0.48 \textwidth]{fig12.pdf} \caption{Evolution of energy and angular momentum in two simulations (panels a and b) of \citet{sandquist1998a} with different initial parameters. Shown are different components: the kinetic energy of the core particles and the gas ($E_\mathrm{K,c}$ and $E_\mathrm{K,g}$, respectively), the internal energy of the gas ($E_\mathrm{I,g}$), energy lost from the simulated domain ($E_\mathrm{lost}$), potential energies from gravitational interaction between gas and gas ($E_\mathrm{G,gg}$), gas and core particles ($E_\mathrm{G,gc}$), and between the core particles ($E_\mathrm{G,cc}$), the $z$-components of the total angular momentum ($L_\mathrm{tot}$), the angular momentum of the gas ($L_\mathrm{gas}$), and the core system ($L_\mathrm{orb}$), and the angular momentum lost from the domain ($L_\mathrm{lost}$). By the end of the simulations, conservation of total energy and angular momentum was violated at the $\sim$10\% level. Figures from \citet{sandquist1998a}.} \label{fig:sandquist1998_conservation} \end{figure} Numerical errors in the conservation of angular momentum and energy are an unavoidable compromise when striving for efficient simulations. It is, however, essential to monitor them. Energy errors are particularly critical in simulations of \ac{CEE}, because one of the goals is to determine the unbinding of the envelope, which is rather loosely bound in the giant primaries anyway. It has to be ensured that any unbinding of material is physical and not caused by numerical inaccuracies. The question of what level of non-conservation can be tolerated is an important one. \citet{sandquist1998a} published their conservation of energy and angular momentum showing that over their entire simulations they tolerated a change of approximately 10~\%, see Fig.~\ref{fig:sandquist1998_conservation}. There is no strict quantification of an acceptable level and it might affect different output quantities differently. Clearly, if at the end of a numerical simulation the binding energy of remaining envelope gas is of the same order of magnitude as the accumulated energy error, little can be said about the success of envelope ejection. It is therefore mandatory to track the conservation of energy and angular momentum and the results should be published alongside with the simulations. Generally, more work is called for to identify and localize the numerical problems that violate energy and momentum conservation. This most likely requires extensive resolution studies. \subsubsection{Code speed and scalability} \label{ssec:speed-and-scalability} Performing \ac{3D} hydrodynamic simulations of \ac{CEE} is computationally very challenging. The system has to be followed over long periods of time with high accuracy, i.e.\ many numerical time integration steps are to be performed and the spatial resolution has to be sufficiently high. Clearly, such simulations require high performance computing (HPC) resources and are only possible when employing parallelization techniques. Therefore, scalability to large numbers of computational cores to be used in parallel is an important criterion when choosing a code for \ac{CE} simulations. Parallelization in the spatial domain is standard for the codes currently used for \ac{CE} simulations. In finite-volume approaches, the hydrodynamics solvers can usually be parallelized on distributed-memory machines with some acceptable communication overhead. Distributed-memory parallelization is more challenging for particle-based discretization approaches as used for modeling self-gravity (see Sect.~\ref{sect:tree}) or the hydrodynamics itself (see Sect.~\ref{sect:SPH}). For this reason, some of the \ac{SPH} codes employ shared-memory parallelization \citep[e.g., {\sc phantom};][]{price2018a}, which restricts the simulations to a moderate number of computational cores, but there are also \ac{SPH} implementations with distributed-memory parallelization, e.g. \textsc{gadget-2} \citep{springel2005a} and \textsc{snsph} \citep{fryer2006a}. In moving-mesh approaches, the grid generation poses an additional challenge to efficient parallelization. For an approximately fixed spatial resolution and a given numerical algorithm, the speed-up that can be reached with parallelization is limited by Amdahl's law \citep{amdahl1967a} or similar considerations. Beyond this limit, an increase of the number of employed compute cores no longer reduces the execution time proportionally. Therefore, it is not only scalability of the employed code that determines the feasibility of a certain \ac{CE} simulation, but also its overall efficiency, i.e.\ the required wall-clock time to perform a time integration step for a given number of discretization elements in a fixed parallel setup. A common experience in code development is that these aspects---scalability and overall efficiency---are competing. A higher efficiency often causes load-imbalances and thus comes at the expense of parallel scalability. This does not necessarily imply a disadvantage of the respective code for performing \ac{CE} simulations. Some of the codes employed for such simulations have been developed originally for extensive cosmological simulations and are highly optimized for efficiency; for example the \textsc{arepo} code of \citet{springel2010a} has been used for the groundbreaking \emph{Illustris} project \citep{vogelsberger2014a}. Ideally each simulation would report the total number of CPU-hours, the number of nodes and cores it was executed on, wall-clock times, and the computer specifications. It is assumed that at least a fraction of the publications would be presenting simulations at the limit of what is feasible. For example the 1 million particle simulation presented by \citet{iaconi2017a} was at the limit of feasibility for the OpenMP, shared memory code \textsc{phantom}. \subsection{CE phases accessible to 3D hydrodynamic simulations} \label{sect:3d_accessible} The numerical methods for \ac{3D} hydrodynamic simulations discussed here can be used to follow the dynamical part of \ac{CE} interaction. This includes the initiation of \ac{CEE} (perhaps only the last part of Phase (i) of our classification in Sect.~\ref{sect:phases}, but not the complete pre-\ac{CE} evolution) and the plunge in and inspiral of the companion, classified as Phase (ii). Phase (iii), however, is characterized by different timescales involving the long $\tau_\mathrm{KH}$, which, as discussed in Sect.~\ref{sect:multiscale}, differs from the dynamical timescale of the envelope of \ac{RGB} and \ac{AGB} stars by five orders of magnitude. The discrepancies in relevant timescales are a serious challenge to hydrodynamic simulations and it seems unlikely that the long-term \ac{CEE} can be followed in \ac{3D} hydrodynamic simulations. A reasonable resolution of the objects of interest requires about $10^2$ to $10^3$ discretization elements (grid cells or softening lengths) per spatial dimension. Taking the dynamical timescale as a proxy for the \ac{CFL} time step restriction in these discretization elements shows that covering timescales relevant for modeling Phase (iii) requires at least $10^7$ to $10^8$ time integration steps with hydrodynamic schemes, which makes such simulations unrealistic. A solution to this problem would be to couple \ac{3D} hydrodynamic simulations of the inspiral phase (ii) with classical \ac{1D} stellar evolution models to describe the subsequent evolution. While the \ac{3D} simulations provide the initial conditions, mapping them in a useful way to \ac{1D} is highly non-trivial. We discuss this problem further in Sect.~\ref{ssec:extracting_1d_parametrization_from_multiD_simulations}. \section{Physical modeling and challenges} \label{sect:challenges_physical} The system to be modeled consists of (at least) two stellar objects, a giant star and a companion (which can be a star but also a compact object or even a planet). This implies that the objects themselves can be described with a combination of fluid dynamics, thermodynamics, and gravity. The main problem for simulating the evolution of \ac{CE} systems arises from the discrepancy of scales---most obvious in the required distinction of an extended envelope from a small core in the structure of the giant primary stars (see also Sect.~\ref{ssec:terminology}). Thus, before turning to the numerical implementation, the physical model for \ac{CEE} has to be set out. We review it here together with the challenges that arise from the \emph{physical modeling} itself---\emph{numerical} implementation problems often resulting from the chosen physical model will be discussed in Sect.~\ref{sect:challenges_numerical}. \subsection{The gravo-hydrodynamic model} \label{sect:gravohydro} Astrophysical models are commonly plagued by the different nature the various physical processes at play and the wide ranges of spatial and temporal scales on which they act. Models of \ac{CE} phases are no exception. In fact, \ac{CEE} is driven by a complex interaction of physical phenomena combining fluid dynamics, thermodynamics, atomic physics, magnetic fields, radiation, accretion physics, and perhaps other effects. While some of the approaches discussed in Sect.~\ref{sect:understanding} are based on coarse approximations, we are interested here in a modeling basis that rests on fundamental physical principles and avoids approximations. The most basic model of \ac{CEE}---which we will refer to as \emph{gravo-hydrodynamic model} in the following---implements the equations of fluid dynamics, most commonly the Euler equations\footnote{A more general approach could use the Navier--Stokes equations instead, that explicitly account for viscosity. However, because numerical viscosity dominates in implementations, physical viscosity can usually be neglected.}, combined with a gravitational source term. The first of them is a scalar equation, \begin{equation} \label{eq:mass_cons} \frac{\partial \rho}{\partial t} + \nabla \cdot (\rho \vec{v}) = 0, \end{equation} with $\rho$, $t$, and $\vec{v}$ denoting mass density, time, and velocity, respectively. It expresses \emph{mass conservation.} The second (vector) equation is the \emph{momentum balance,} \begin{equation} \label{eq:momentum_cons} \rho \frac{\partial \vec{v}}{\partial t} + \rho \left(\vec{v} \cdot \nabla\right) \vec{v} + \nabla P = - \rho \nabla \mathrm{\Phi}, \end{equation} which accounts for pressure forces $\nabla P$ in the momentum flux and includes gravity (with the gravitational potential $\mathrm{\Phi}$) as a source term. Finally, \emph{energy balance} is expressed in terms of the specific total energy density, \begin{equation} e_\mathrm{tot} \defeq \frac{1}{2} |\vec{v}|^2 + \frac{\epsilon}{\rho}, \end{equation} where $\epsilon$ denotes the density of the internal energy. This gives the last (again scalar) equation \begin{equation} \label{eq:energy_cons} \frac{\partial \rho e_\mathrm{tot}}{\partial t} + \nabla \cdot (\rho e_\mathrm{tot} \vec{v}) + \nabla \cdot (P\vec{v}) = - \rho \vec{v} \cdot \nabla \mathrm{\Phi}. \end{equation} Equations (\ref{eq:mass_cons}), (\ref{eq:momentum_cons}), and (\ref{eq:energy_cons}) are formulated for a fixed frame of reference. This is called \emph{Eulerian specification}. An alternative is obtained from transforming the system into a frame of reference co-moving with the fluid. This is achieved by introducing the \emph{substantial} (or \emph{Lagrangian}) derivative \begin{equation} \frac{\ensuremath{\mathrm{D}}}{\ensuremath{\mathrm{D}} t} \defeq \frac{\partial}{\partial t} + \vec{v} \cdot \nabla. \end{equation} After this transformation, the Euler equations in \emph{Lagrangian specification} read \begin{eqnarray} \frac{\ensuremath{\mathrm{D}} \rho}{\ensuremath{\mathrm{D}} t} + \rho \nabla \cdot \vec{v} &=& 0,\label{eq:lagrange_mass}\\ \rho \frac{\ensuremath{\mathrm{D}} \vec{v}}{\ensuremath{\mathrm{D}} t} + \nabla P &=& - \rho \nabla \mathrm{\Phi},\label{eq:lagrange_momentum}\\ \rho \frac{\ensuremath{\mathrm{D}} e_\mathrm{tot}}{\ensuremath{\mathrm{D}} t} + \nabla\cdot P \vec{v} &=& - \rho \vec{v} \cdot \nabla \mathrm{\Phi}.\label{eq:lagrange_energy} \end{eqnarray} A special case is encountered for situations where gravity is exactly balanced by the pressure gradient. In this case, the acceleration in Eq.~\ref{eq:lagrange_momentum} vanishes. This mechanical equilibrium is an excellent approximation for the stratification of stellar envelopes in long-lasting stages of stellar evolution. It is called \acfi{HSE}: \begin{equation}\label{eq:hse} \frac{\nabla P}{\rho} = - \nabla \mathrm{\Phi}. \end{equation} The gravitational potential is determined by Poisson's equation: \begin{equation}\label{eq:poisson} \mathrm{\Delta} \mathrm{\Phi} = 4 \pi G \rho, \end{equation} where $G$ is Newton's gravitational constant. The Euler equations form a system of hyperbolic partial differential equations and thus pose an initial value problem. For their solution, initial conditions must be supplied. We devote Sect.~\ref{sect:setups} on how to set up \ac{CE} simulations. To close the system of Equations (\ref{eq:mass_cons}), (\ref{eq:momentum_cons}), and (\ref{eq:energy_cons}), an equation of state is needed that relates pressure, density and internal energy. The equation of state is an essential part of our model system. It accounts for micro-physical interaction between the constituents of matter in the effective macroscopic framework of thermodynamics. In the simplest case, an ideal gas is assumed as a model for stellar material, but radiation pressure can be added via the Stefan--Boltzmann law in a straightforward way. Obviously, the physical model described by this set of equations is not very specific for the problem at hand---the same set of equations forms the basis for the theoretical treatment of many astrophysical objects ranging from planets to the large-scale structures in the Universe\footnote{These equations also form the foundation of classical stellar modeling. Under the simplifying assumptions of spherical symmetry and hydrostatic equilibrium, the first two of the stellar structure equations can directly be derived from them. Energy balance with suitable source terms gives the third of the stellar structure equation. In addition, a prescription of energy transport in stellar material is needed that constitute the fourth equation of the set.}. Despite its generic nature, however, the gravo-hydrodynamic model captures the gravitational and hydrodynamic interaction between the orbiting cores and the envelope. Setting up a \ac{CE} model in this framework, gravitational (and also hydrodynamic) drag is naturally included. The model thus self-consistently accounts for the transfer of orbital energy and angular momentum from the core binary to the envelope gas---one of the most important processes in \ac{CEE}. In addition, the model also captures convection if it occurs in the stellar envelope. From a physical point of view, the gravo-hydrodynamic model does not pose particular challenges, but analytic solutions of the system of coupled nonlinear hyperbolic partial differential equations are virtually impossible for complex setups. Therefore, numerical approaches are needed and---as discussed in Sect.~\ref{sect:challenges_numerical}---neither fluid dynamics nor gravitational interaction are easy to deal with computationally. \subsection{Why do we need multi-D hydrodynamical simulations?} \label{sect:whymultid} \begin{figure} \centering \includegraphics[width=\textwidth]{fig03.pdf} \caption{Density on slices through the orbital plane (top row) and perpendicular to it (bottom row) in a \ac{3D} hydrodynamic simulation of \ac{CE} inspiral of a $0.49 \, \ensuremath{M_\odot}$ companion (marked with a $\times$ symbol) into a $0.97 \, \ensuremath{M_\odot}$ early \ac{AGB} star \citep[core marked with a $+$ symbol; Model O.50 of][courtesy of Christian Sand]{sand2020a}. The times of the snapshots after initiation of the \ac{CE} interaction are indicated in the respective upper panels.} \label{fig:ce_3D} \end{figure} In Sects.~\ref{sec:parametrized_models} and \ref{sec:one_dimensional_implicit_approaches} we have listed the shortcomings of parametric and \ac{1D} mechanical models and in Sect.~\ref{sec:multi_dimensional_hydro_models} we have explained that combining these models with \ac{3D} hydrodynamics models can fill in the glaring gaps in our understanding of \ac{CEE}. This in particular applies to the inspiral of the stellar cores into the \ac{CE}, i.e.\ Phase (ii) of our classification in Sect.~\ref{sect:phases}: Only \ac{3D} hydrodynamic approaches capture the physics of the interaction between the stellar cores and the envelope material consistently. They resolve the flow around the cores and the changes in the structure and morphology of the envelope. Adopting the gravo-hydrodynamical model described in Sect.~\ref{sect:gravohydro}, \ac{3D} simulations are able to tell where and how the transfer of orbital energy and angular momentum from the core binary onto the envelope material takes place. In this sense, \ac{3D} hydrodynamic simulations are the key to understanding the elusive physics of \ac{CE} interaction. As \ac{CEE} progresses, the envelope will strongly diverge from spherical symmetry. In an edge-on projection, the density structure of the envelope assumes a toroidal shape (Fig.~\ref{fig:ce_3D}, bottom row). It is immediately clear that perturbations induced to the envelope by the inspiralling core binary system cannot be captured by spherically symmetric models. In addition to the toroidal deformation of the envelope, there is a pronounced spiral shock structure issuing from the core binary that dominates the density structure (Fig~\ref{fig:ce_3D}, top row). In later phases of the evolution, shear-induced hydrodynamic instabilities become visible (Fig.~\ref{fig:ce_3D}, snapshots at $600\, \mathrm{d}$ and at $\num{1200} \, \mathrm{d}$). While all this does not necessarily mean that the basic results of the interaction such as envelope ejection and orbital decay of the core binary system cannot be represented in \ac{1D} models or parametric formalisms, it seems unlikely that the complex hydrodynamic flows observed in \ac{CEE} would give rise to universal parameters and thus self-consistent predictive prescriptions in such approaches. Full \ac{3D} hydrodynamic models remain indispensable and may be needed to calibrate the simplified models in very fragmented ranges of parameter space. Moreover, as discussed in Sect.~\ref{sssec:drag}, determining the drag around an obstacle is an extremely challenging problem of \ac{3D} hydrodynamics. A reliable description of accretion and deflection of material around the companion star in \ac{CEE} and the formation of a turbulent wake behind it are of fundamental importance to predict the envelope ejection efficiency and the orbital shrinkage. In complex setups with non-uniform background densities and circular orbits, \ac{3D} hydrodynamic simulations are required to capture the effects in a quantitative way. Clearly, \ac{3D} simulations of the inspiral phase of \ac{CEE} are a fundamental building block for developing a comprehensive model of this important phase of binary stellar evolution and they are the focus of our review. However, despite their obvious advantages, it is unlikely that they are sufficient. Adopting a fully \ac{3D} geometry requires to take a huge leap in the methods and in the computational resources spent on the modeling. Even pushing techniques, algorithm efficiency and computational resources to the limit, there are some inherent difficulties that make it impossible to carry out full \ac{3D} hydrodynamic simulations for all the relevant timescales involved in the problem in the foreseeable future---in particular if pre-\ac{CE} and post-inspiral phases [Phases (i) and (iii) defined in Sect.~\ref{sect:phases}] are to be part of the model. So, while in principle the \ac{3D} hydro-gravitational model takes into account the interactions between envelope gas and core/companion system, limitations such as resolution may curtail the initial advantages; see also Sect.~\ref{sect:unresolved_num}. \subsection{CE ejection and the end of the dynamical inspiral} \label{ssec:why_is_CE_ejection_hard_to_achieve} Simulating envelope ejection is a main goal of the numerical modeling of \ac{CEE}, but it is also one of the most elusive aspects of the interaction. In models, complete envelope removal seems hard to achieve. What are the physical aspects that determine the process and why is it challenging to incorporate them into numerical simulations? The question of envelope ejection is fundamentally related to the question of the final orbital separation of the stellar cores after completing \ac{CEE}, although, as discussed in Sect.~\ref{ssec:interfacing_3d_global_simulations_with_1d_simulations_of_the_ce_remnant}, it may not be the only process determining it. The gravo-hydrodynamic model implements the basic mechanism of \ac{CEE}: orbital shrinkage and unbinding of envelope gas due to transfer of energy and angular momentum from the core binary to the envelope. In its simplest version, it describes the stellar envelope material with an ideal gas equation of state, in some cases adding radiation pressure. This model, however, fails in all \ac{3D} simulations that have been carried out so far. The orbital shrinkage stalls or retards when a significant fraction of the envelope is still bound (see Fig.~\ref{fig:sand_01} for an example). This leads to the question of how to measure the efficiency of envelope unbinding in a numerical simulation. In a common approach, material is counted as bound if its total energy, determined as the sum of its gravitational potential energy and its kinetic energy is negative. In Sect.~\ref{sect:ionization}, we discuss other forms of energy that could enter this estimate, but here we note that generally arguments based on energy criteria may overestimate the amount of unbound material: Whether or not material is ejected depends not only on its energy but also on its location within the complex perturbed envelope where the total energy is positive. If surrounded by bound material, an unbound fluid element may dissipate its energy without being ejected. \begin{figure} \centering \includegraphics[width=0.75\textwidth]{fig04.pdf} \caption{Simulation of \ac{CEE} in the gravo-hydrodynamic model for a system with a $1.0 \, \ensuremath{M_\odot}$ early-\ac{AGB} primary star with a companion of mass ratio $0.5$. An ideal-gas equation of state was assumed in envelope material (Simulation I.50 of \citet{sand2020a}, see Sect.~\ref{sect:sim_movingmesh}). Shown are the orbital evolution (solid line, right axis) and the fraction of unbound envelope mass (dotted line, left axis) according to the criterion of counting gas in a cell as unbound if its kinetic energy is larger than its gravitational binding energy. Figure courtesy of Christian Sand. \label{fig:sand_01}} \end{figure} The failure of the basic gravo-hydrodynamic \ac{CE} model to eject the envelope shows that at some point in the evolution the energy transfer from the cores to the gas becomes inefficient. The fact that the orbital decay ceases (or becomes very slow) indicates a weaker drag acting on the cores. There are several effects that can potentially contribute to this phenomenon: \begin{itemize} \item The inspiral of the companion and the associated transfer of orbital energy from the core binary to the surrounding gas perturb the \ac{HSE} of the envelope such that it expands globally. In the vicinity of the cores, the bow shocks caused by the supersonic orbital motion heat the gas while at the same time the gas is dragged along by the companion and spun up. This injection of energy and angular momentum causes envelope expansion. As a result, the density in the vicinity of the cores decreases with an overall reduction of the drag force. In the analytic treatment of Eqs.~(\ref{eq:BH}) and (\ref{eq:drag_dyn}), the effect corresponds to $\rho_\infty \to 0$. Thus, orbital energy release has two counteracting implications: it drives expansion of the envelope and makes its ejection possible in the first place, but, at the same time, dilution of the gas around the stellar cores reduces the efficiency of energy conversion. This makes it hard to predict whether envelope ejection will succeed in the gravo-hydrodynamic model. \item The perturbation of the envelope injecting angular momentum as described above may bring the gas into co-rotation with the core binary. For a vanishing relative velocity between core and gas, $v_\infty \to 0$ or, equivalently $\mathit{Ma} \to 0$, the drag force vanishes, see Eqs.~(\ref{eq:BH}), (\ref{eq:dragforce}), (\ref{eq:drag_dyn}), and (\ref{eq:drag_coulomb}). For example, \citet{reichardt2019a} found that establishing co-rotation stalls their inspiral of a $0.6\, \ensuremath{M_\odot}$ point mass companion into the envelope of a $0.88\, \ensuremath{M_\odot}$ \ac{RG} star. Similarly, \citet{iaconi2018a} analyzed the reason for the halting of the inspiral in two simulations with giants of different masses (0.88 and 2.0~\ensuremath{M_\odot}) and a range of companions (from 0.1 to 0.9~\ensuremath{M_\odot}). They found that only the heavier companions can evacuate the orbit and bring gas into co-rotation. The lighter companions struggle to do either (see Fig.~\ref{fig:Iaconi+18-Fig12}). They also found that for lighter envelopes (lighter primaries) it takes a more massive companion to evacuate the orbit and/or bring the gas into co-rotation. \item The Mach number of the orbital motion may decrease because the local sound speed increases when the companion reaches the inner, high-temperature parts of the envelope. Except for the Hoyle--Lyttleton formalism [Eq.~(\ref{eq:hoyle-lyttleton})], all analytic treatments discussed in Sect.~\ref{sssec:drag} include the subsonic regime, where the drag force decreases. In these models, the drag acquires a maximum value at some finite Mach number and vanishes for $\mathit{Ma} \to 0$, see Fig.~\ref{fig:drag}. The more elaborate treatments of \citet{ostriker1999a} and \citet{kim2007a} predict a maximum of the drag force in the range $1 < \mathit{Ma} < 2$. \citet{staff2016a} showed that a transition through the sonic point may be responsible for the reduction of the the gravitational drag in their simulation. This was not observed in the simulations of \citet{iaconi2018a}, possibly due to the fact that even their lightest companions were chosen substantially more massive than the planets studied by \citet{staff2016a}. \item Another explanation of why the orbital separation stabilizes, is that the gravitational force between the cores increases as the cores approach each other. Therefore, one needs a larger drag force to noticeably perturb the orbital separation. Thus when the cores approach each other, maintaining the same rate of inspiral requires a larger and larger force, just when in fact orbit evacuation and a reduction of the velocity contrast is reducing the drag. \end{itemize} \begin{figure} \centering \includegraphics[width=\textwidth]{fig05.pdf} \caption{Parameters playing a role in the gravitational drag in simulations of \ac{CE} interaction of a $0.88 \, \ensuremath{M_\odot}$, $90 \, \ensuremath{R_\odot}$ \ac{RGB} primary star (top row) and a $2.0 \, \ensuremath{M_\odot}$, $66 \, \ensuremath{R_\odot}$ \ac{RGB} primary star (bottom row) with a $0.6 \, \ensuremath{M_\odot}$ companion. The vertical lines approximately represent the points where the rapid inspiral terminates. Left column: companion velocity (solid line), local average gas velocity projected on the direction of the companion velocity (dashed line), and local average gas velocity perpendicular to the direction of the companion velocity (dotted line). Right column: companion Mach number (solid line) and normalized average gas density in the companion’s proximity (dashed line). Figure adapted from \citet{iaconi2018a}.} \label{fig:Iaconi+18-Fig12} \end{figure} It is conceivable that all of these effects in combination play a role and conspire to halt the orbital decay. For a better physical understanding, an analysis of the relative contribution and relevance of the processes remains essential and it has to be based on \ac{3D} hydrodynamic simulations. This should be possible, because all listed effects are in principle accounted for in the context of the gravo-hydrodynamic base model of \ac{CEE}. It is possible, indeed likely, that the dynamics of the envelope would be different if physical effects beyond the simple gravo-hydrodynamic model were accounted for. As discussed in Sect.~\ref{sect:understanding}, an important phenomenon is the change in ionization as the envelope expands and cools below the ionization temperatures of hydrogen and helium. The released ionization energy can lead to a substantial increase in envelope unbinding and---for some systems---can even achieve complete envelope ejection \citep{nandez2016a, ohlmann_phd, reichardt2020a, prust2019a, sand2020a, ondratschek2022a}. While the debate continues on how much of the recombination energy can actually contribute to envelope unbinding \citep{ivanova2018a, soker2018a}, we question how the end of the inspiral actually takes place and the extent to which it can be simulated by explicit simulations. It is likely that even if the envelope is not entirely ejected, material may be ``lifted'' sufficiently to stall the inspiral. Some of this material could, however, fall back rapidly, even dynamically/ballistically and the inspiral could resume. As the non-ejected envelope contracts, a ``self-regulated inspiral'' could be established \citep{meyer1979a, ivanova2013a}: the envelope adjusts such that orbital energy is released at the same rate as convection in the remaining envelope can transport it to the surface where it is radiated away. If the heating becomes too weak, slow contraction revives the interaction of cores and gas, while too strong an interaction leads again to an expansion and dilution of the gas. In this sense, an equilibrium between orbital energy release and energy transport to the stellar surface is established and it is kept stable by self-regulation. This is certainly a slow process and the orbital evolution in the self-regulated inspiral regime is difficult or impossible to follow in \ac{3D} hydrodynamic simulations. Another complication is that the in-falling gas would have substantially more angular momentum, making the final stable configuration difficult to predict. It is possible that instead of a self-regulated envelope, a circumbinary disk could forms that interacts with the orbit of the stellar cores and modifies its parameters. Clearly, understanding the end of the inspiral extends beyond the applicability of the basic gravo-hydrodynamic model of \ac{CEE}. \subsection{Why are common-envelope phases a multi-physics problem?} \label{sect:whymultiphysics} The basic gravo-hydrodynamic description of \ac{CEE} certainly does not capture all effects associated with this phase of binary stellar evolution. A model extension to account for additional physics must be decided according to its relevance for specific aspects of \ac{CEE}: some effects may pertain to the dynamical inspiral [Phase (ii)] itself, others to the pre-\ac{CE} or post-inspiral phases [Phases (i) and (iii)], or even to later phases such as the shaping planetary nebulae expected to form in connection with envelope ejection of some stars. Including additional effects requires to modify the set of model equations (\ref{eq:mass_cons}), (\ref{eq:momentum_cons}), and (\ref{eq:energy_cons}). Even without diverging very far from the basic gravo-hydrodynamic model as discussed in Sect.~\ref{sect:gravohydro}, the results of simulated \ac{CEE} can change dramatically. Modeling the envelope of giant stars and their \ac{CE} as ideal gas is reasonable and commonly used in simulations for lower mass stars, while for massive stars radiation pressure needs to be taken into account. This can be done with an additive term in the equation of state. In the following, we discuss changes in the ionization structure of the envelope gas and magnetic fields as important ingredients for model extensions. Other phenomena that are not part of the basic gravo-hydrodynamic model of \ac{CEE} but still may be relevant include nuclear reactions that may occur in dense accreted material, neutrino cooling in the vicinity of compact object companions, accretion of material, jet formation, evaporation of the companion, and perhaps even relativistic effects. A rigorous assessment of the relevance of these effects for \ac{CEE} is still missing, but some aspects of accretion onto the stellar cores, the potential formation of a disk and jet-like outflows have been explored in more detail \cite[e.g.][]{macleod2015a, macleod2015b, chamandy2018a, soker2016b, moreno2017a, lopez2019a, shiber2019a, lopez2020a, lopez2022a, hillel2022a, zou2022a, schreier2019a, schreier2021a, schreier2023a}. These examples illustrate that \ac{CEE} is a pronounced multi-physics problem. Progress in understanding the dynamical evolution of the system cannot only achieved by improving the numerical methods for simulating it. The extension of the gravo-hydro\-dynamic base model with additional effects is essential to reach a reliable physical description. \subsubsection{Ionization and recombination effects} \label{sect:ionization} \begin{figure} \centering \includegraphics[width= 0.7\textwidth]{fig06.pdf} \caption{Fraction of unbound envelope mass (dotted lines, left axis) and orbital evolution of the cores (solid lines, right axis) for Simulation I.50 of \citet{sand2020a} as shown in Fig.~\ref{fig:sand_01} (blue color). In addition, in red color we plot the same quantities, but this time for Simulation O.50 of \citet{sand2020a}, that accounts for changes in the ionization of envelope material. Figure courtesy of Christian Sand.} \label{fig:sand2020} \end{figure} Over the past decades it has been realized that ionization effects play an important role in \ac{CEE} \citep{ivanova2015a}. As the envelope is lifted and starts to expand due to the perturbation by the inspiralling companion, its outer layers may gradually fall below the ionization thresholds of hydrogen and helium and previously ionized material recombines. This is a micro-physical matter effect leading to a source term in the energy equation of fluid dynamics (\ref{eq:energy_cons}). A simple model assuming local thermodynamic equilibrium is given by the corresponding Saha equation, but a general treatment would be achieved by implementing a detailed network accounting for changes in the ionization states and releasing the corresponding recombination energies. As a consequence, temperature and pressure of the gas change and this may cause a transfer into kinetic energy finally supporting envelope ejection. Instead of solving the equations explicitly, the ionization of matter as a micro-physical effect can be absorbed in a suitable equation of state, for instance the \textsc{opal} equation of state of \citet{rogers1996a} and \citet{rogers2002a} or its derivative in the \textsc{mesa} code \citep{paxton2011a}, see Sect.~\ref{sect:eos}. Thus, while formally sticking to the basic gravo-hydrodynamic \ac{CE} model, important physical effects can be incorporated via the equation of state. The consequence of including ionization effects in \ac{CE} simulations is shown in Fig.~\ref{fig:sand2020}. Compared with the basic gravo-hydrodynamic model, envelope ejection increases dramatically. Whether or not the released recombination energy can---at least in parts---support envelope ejection depends on its ability to thermalize. Instead of adding to the thermal energy, it may be transported outwards by radiation (\citealp{grichener2018a}, but see \citealp{ivanova2018a}) or convection \citep{sabach2017a} and lost from surface of the envelope. \citet{wilson2019a} point out that convection may also remove energy released by the orbital decay directly so that deeper inspiral of the companion is necessary to eject the envelope. While convection is in principle part of the basic gravo-hydrodynamic model (but may not be sufficiently resolved in \ac{3D} hydrodynamic simulaitons of \ac{CEE}), radiation transport constitutes an extension of the model. Because all simulations that successfully expel the \ac{CE} rely on the contribution of recombination energy to the unbinding of material, it is urgent to include radiation transport into the modeling. Without radiation transport the use of a tabulated equation of state that includes the release of recombination energy may severely overestimate the envelope unbinding, because a (large) fraction of that energy might instead leak out of the star. This illustrates the ambiguity of defining the unbound fraction of envelope material. Should thermal and ionization energy be counted in into the energy budget? Certainly, the criterion comparing the gravitational binding energy with the kinetic energy of the gas only is the most conservative choice, although it may still overestimate the effect of released recombination energy if no radiation transfer is included. Counting in the thermal energy of the gas is a widely accepted approximation, while including the ionization energy in addition marks the most optimistic case. The approximation relying on kinetic energy only is illustrated in Fig.~\ref{fig:sand2020}. Recombination energy, if it can be fully used to expand the envelope, acts in the immediate post-inspiral phases when the envelope is expanding substantially. During these phases it has been demonstrated that the conditions in the envelope are ideal for dust formation \citep{glanz2018a, reichardt2020a, iaconi2020a} which would likely have an impact on the dynamics of the envelope by the increase in opacity. Dust-driven winds are extremely effective in reducing the envelope mass of \ac{AGB} stars over short timescales with mass-loss rates as high as $10^{-4}$ to $10^{-3} \,\ensuremath{M_\odot} \, \mathrm{yr}^{-1}$ \citet{kwok1978a} and these stars are not dissimilar in mass and size to those typical simulated in the context of \ac{CEE}. \subsubsection{Magnetic fields} A second prominent example of a physical phenomenon that should be considered, are magnetic fields. These can be accounted for by extending to the equations of \ac{MHD}; see, e.g., \citet{campbell2018a} for a detailed treatment of \ac{MHD} in binary stars. Apart from the very challenging numerical implementation of \ac{MHD}, the presence of magnetic fields makes the range of physical phenomena extremely rich and complex. In addition to hydrodynamic flow instabilities, \ac{MHD} instabilities can play a role. It has been discussed whether the action of magnetic fields can help with envelope ejection. While magnetic fields do not introduce a new energy source---they can only be amplified at the expense of kinetic energy of the gas---they can redistribute energy and angular momentum in the envelope. Based on analytic considerations, \citet{regos1995a} argued that magnetic fields should be strongly amplified in \ac{CE} inspirals, while \citet{tocknell2014a} used jet-like features observed in post-\ac{CE} planetary nebulae as an indication that strong fields must have been present in the late \ac{CE} stages. The first \ac{MHD} simulation of \ac{CEE} was presented by \citet{ohlmann2016b}, see also Sect.~\ref{sect:sim_movingmesh}. It showed that the accretion flow around the companion star leads to strong amplification of magnetic fields (see left and middle panels of Fig.~\ref{fig:Bfields-sim}). The reason is proposed to be the magnetorotational instability \citep[MRI;][]{balbus1991a}. In late phases, the amplified magnetic field disperses over the entire \ac{CE} (Fig.~\ref{fig:Bfields-sim}, right panel). Despite the strong amplification, however, magnetic fields are not dynamically relevant in the situation modeled by \citet{ohlmann2016b}. Still, they may play a role in transport processes and in shaping the ejected envelope material as shown in the \ac{MHD} simulations of \citet{ondratschek2022a}. \begin{figure} \centering \includegraphics[width=0.6\textwidth]{fig07.pdf} \includegraphics[width=\textwidth]{fig08.pdf} \caption{Magnetic field energy over time (top) and radial magnetic field strength $B_r$ in the orbital plane (bottom) of the high-resolution simulation of \citet{ohlmann2016b} with a seed field of $10^{-6} \, \mathrm{G}$. The times at which the snapshots were taken are indicated in the panels. Note that the left and middle panel show the vicinity of the companion (marked with a $\times$ symbol). The position of the core of the \ac{RGB} primary star is marked by a $+$ symbol and visible in the right panel. Top figure courtesy of Sebastian Ohlmann. Bottom figures from \citet{ohlmann2016b}.} \label{fig:Bfields-sim} \end{figure} \subsection{Why are common-envelope phases a multi-scale problem?} \label{sect:multiscale} Like many other problems in astrophysics, \ac{CEE} is plagued by severe multi-scale challenges. These can be divided into two categories: a spatial and a \emph{temporal} scale challenge. The \emph{spatial scale problem} is rather obvious and caused by the discrepancy in sizes between the core of the primary star and the companion on the one side and the total radius of the primary star on the other side. Although typical values vary somewhat, for \acf{RGB} and \ac{AGB} stars core radii, $R_\mathrm{core}$, are around $0.03\,\ensuremath{R_\odot}$ while the size of the stars, $R_\star$, are between ${\sim} \, 20 \, \ensuremath{R_\odot}$ and ${\sim} \, 600\, \ensuremath{R_\odot}$. This gives a range of scales extending over up to four orders of magnitude, which is a lot but not overly impressive in comparison with other astrophysical scale challenges. For red supergiants, the cores have a radius of $\sim \, 0.07 \,\ensuremath{R_\odot}$ and stellar radii are hundreds to thousands of solar radii. Companions can be of various nature, but cases of interest include objects as small as planets, white dwarfs, and neutron stars, thus extending the scale range to eight orders of magnitude. A special case are systems with black hole companions. The orbital separation in the pre-\ac{CE} stage and the expansion of the envelope in the \ac{CE} interaciton extend the range of relevant spatial scales involved in the problem even more. The \emph{temporal} scale challenge is usually discussed in terms of the relevant characteristic timescales of the involved objects. One of these is given by the mechanical structure of the envelope. It can be defined as the \emph{free-fall timescale,} \begin{equation} \tau_\mathrm{ff} \sim \frac{\pi}{2} \frac{R_\star^{3/2}} {\left[ 2 G (M_\mathrm{core} + M_\mathrm{com}) \right]^{1/2}}, \end{equation} with the gravitational constant, $G$, the core mass of the primary star, $M_\mathrm{core}$ and the mass of the companion, $M_\mathrm{com}$. Note that $\tau_\mathrm{ff}$ differs from the orbital period of the companion at a distance of $R_\star$, \begin{equation} \tau_\mathrm{orbit} = 2\pi \frac{R_\star^{3/2}}{\left[G\,(M_\mathrm{core} + M_\mathrm{com})\right]^{1/2}}, \end{equation} only by a factor of $2^{-5/2}$. Both are due to the gravitational force and estimate the timescale of changes to the system driven by gravitational forces, that has to be captured in simulations of \ac{CEE}. The \emph{dynamical timescale} $\tau_\mathrm{dyn}$, in contrast, estimates the timescale of changes induced by hydrodynamic pressure effects. It is given by the sound crossing time over the system, \begin{equation} \label{eq:tdyn} \tau_\mathrm{dyn} \sim \frac{R}{c_\mathrm{sound}}, \end{equation} with the sound speed, $c_\mathrm{sound}$. Close to hydrostatic equilibrium, pressure effects should compensate gravity and thus $\tau_\mathrm{dyn} \,{\sim}\, \tau_\mathrm{ff} \,{\sim}\, \tau_\mathrm{orbit}$. The dynamical timescale of the envelope of \ac{RGB} and \ac{AGB} stars can be estimated to be $\tau_\mathrm{dyn, envelope} \, {\sim} \, 50 \, \mathrm{d}$ by adopting $R = R_\star$ and a typical sound speed of ${\sim}\, 10 \, \mathrm{km} \, \mathrm{s}^{-1}$. The cores of \ac{RGB} or \ac{AGB} stars and their envelopes have starkly different thermodynamic properties. The temperature in the cores is about four orders of magnitude higher than in the envelopes and their densities exceed the envelope densities by ${\sim} \, 10$ orders of magnitude. Therefore, the sound speed exceeds $10^3 \, \mathrm{km} \, \mathrm{s}^{-1}$ in the core of such stars, and the dynamical timescale is as short as $\tau_\mathrm{dyn, core} \, {\approx} \, 20 \, \mathrm{s}$. Some late episodes of \ac{CEE} may rely on thermal readjustment of the envelope which is associated with the much longer \emph{thermal} (Kelvin--Helmholtz) timescale, \begin{equation} \tau_\mathrm{KH} \sim \frac{G M_\star^2}{R_\star L_\star}, \end{equation} where $L_\star$ is the luminosity of the star. For \ac{RGB} and \ac{AGB} stars with $L_\star \, {\sim} \, 3000 \, L_\odot$, the thermal timescale $\tau_\mathrm{KH} \, {\sim}\, 10^4 \mathrm{yr}$, leading to a timescale discrepancy compared with $\tau_\mathrm{dyn, envelope}$ of $10^5$. For late \ac{CEE} stages, however, the relevant thermal timescale is that of the remaining envelope when part of the material has already been removed, which may differ significantly from our estimate for unperturbed stars. \subsection{The need to simulate the pre-common envelope and post-inspiral phases} \label{sect:pre-dynamical_phase} We conclude our summary of the physical challenges to simulating \ac{CEE} by discussing the phase that leads to the dynamical inspiral---Phase (i), pre-\ac{CE} evolution---and the phase that follows it---Phase (iii), post-\ac{CE} evolution. Both of them are likely to take place on thermal, rather than dynamical timescales. This fact alone makes them difficult to treat numerically. The \emph{need} to simulate both of these phases stems from the suspicion that what precedes the inspiral may change the playing field for the inspiral itself and that what follows the inspiral ultimately settles the final orbital separation for the surviving binary or even determines whether a binary survives at all. Here, we quickly set the stage for the physical challenge presented by these phases. Before engaging into the inspiral phase of \ac{CEE}, binary interactions may substantially affect the parameters of the system. Pre-CE evolution is likely to involve mass loss from the system, and this effect can be critical in determining whether or not the system enters \ac{CEE} in the first place \citep[e.g.][]{ivanova2013a}. Moreover, mass loss can change the angular momentum budget of the system and the binding energy of the primary's envelope. An extreme case of binary interaction preventing \ac{CEE} is proposed by \citet{soker2015a}, who argues that if the companion grazes the envelope of the giant primary star and accretes mass at a sufficiently high rate, it can launch jets that remove material and angular momentum. Additionally, mass and angular momentum can be lost through the second Lagrange point. This way, the envelope is ablated as the companion approaches the core of the primary star without ever entering a \ac{CE} phase. The orbital decay is very slow and if existing, it is driven by tidal interaction although the companion is never deeply immersed in the envelope. \citet{soker2015a} call this alternative to \ac{CEE} ``grazing envelope evolution'' (GEE) and \citet{sabach2015a} discuss the scenario in the context of triple star systems. Mass loss is also thought to lead to observable features, some of which have been connected to the \ac{LRN} class of optical transients (see \citealp{soker2006a, pejcha2014a, soker2015a, soker2016c, macleod2017a} and Sect.~\ref{sect:observational_constraints}). Once the primary star overfills its Roche lobe, mass transfer sets in. Whether or not this leads to the formation of a \ac{CE} depends on the dynamical stability of this mass transfer, which is determined by the relative readjustments of the Roche lobe to mass transfer and the donor (primary) star's structure to mass loss: if the donor expands relative to its Roche lobe, mass loss becomes unstable and a runaway in the mass transfer rate sets in. The details involve several complications---for a discussion we refer to \citet{ivanova2013a}---but stability analyses usually determine a critical mass ratio of donor and accretor (i.e.\ companion) $q_\mathrm{crit}$ for stability, which itself depends sensitively on the type of donor \citep{hjellming1987a}. This, however, is not the only criterion determining the events preceding the fast inspiral. Tides dominate the early phases of interaction, even before Roche lobe contact. Giant stars expand and when their companions are located within a distance of some stellar radii \citep[][the exact number is uncertain and can vary]{soker1994a, mustill2012a, madappatt2016a}, interaction between the two tends to synchronize and circularize the orbit. While the timescales for these processes are reasonably well understood \citep[see][]{zahn1977a}, the concomitant stellar evolution alters the playing field. In particular, an instability occurs when the angular momentum of the giant is larger than a certain fraction of the orbital angular momentum \citep{darwin1879a}. This tends to destabilize a tidally relaxed system leading to a reduction of its orbital separation. All in all, a complex interplay between tidal instability, mass-transfer instability, and stellar evolution set the initial conditions of the subsequent fast inspiral. While not all of these processes take place on the Kelvin--Helmholtz timescale characterizing changes in the thermal structure of the star---tidal interaction for instance is a dynamical process---the timescales of these phenomena are likely still too long to be modelled by global \ac{3D} simulations. After the dynamical inspiral stalls, a number of physical processes \citep[see Table 1 of][for an overview of some of these]{soker2017a} will take hold that operate on lengthening timescales. While some of the current \ac{3D} hydrodynamic simulations indicate successful envelope ejection, a general problem seems to be that the orbital separation reached over the simulation time is too large compared with observations of post-\ac{CE} binaries \citep[e.g.][]{iaconi2017a, kramer2020a}. This may be associated with shortcomings in the physical modeling or numerical deficiencies in the simulations, but there is a fair chance that the system parameters are affected by processes that act on timescales longer than the simulation period. Self-regulated inspiral (see Sect.~\ref{ssec:why_is_CE_ejection_hard_to_achieve}) is one possibility, but even if most of the envelope was unbound, some returning gas could interfere with the orbit once more, or form a disk around the binary which could alter the orbital parameters. If most of the envelope is still bound, the binary will presumably go through a renewed phase of inspiral. If the new delivery of orbital energy is still not sufficient to unbind the remaining envelope, then a merger of the stellar cores may be the final outcome of the interaction. The newly formed star would then relax on thermal timescales as it radiates the excess energy. However, the orbital angular momentum would have to find a final resting place in the envelope, redistributing itself in some way. Another possibility is that---instead of merging---the companion is destroyed during deep inspiral into the \ac{CE}. This is in particular possible for low-mass companions such as brown dwarfs or giant planets \citep{livio1984a, soker1998a, nelemans1998a, jia2018a, kramer2020a} Modelling the immediate pre- and post-inspiral, i.e.\ the parts of Phases (i) and (iii) that are closest to Phase (ii), with global \ac{3D} simulations is not impossible, as we will discuss in Sects.~\ref{ssec:simulations_of_the_pre-dynamical_inspiral_phase} and \ref{sect:current}, but some simplifications must be incorporated, which may or may not alter the results. The longer timescales likely will need different modelling approaches and, ideally, these will be interfaced with global simulations that best model the dynamical phase (see Sect.~\ref{ssec:interfacing_3d_global_simulations_with_1d_simulations_of_the_ce_remnant}). After discussing the \emph{physical} challenges we face in formulating a full description of \ac{CEE}, we turn to modelling problems that arise from \emph{numerical} obstacles in the following section. \section{Initial conditions and setups of common-envelope simulations} \label{sect:setups} We now turn to the question of what hydrodynamic simulations of \ac{CEE} are possible based on the physical foundations discussed in Sect.~\ref{sect:challenges_physical} and the numerical approaches described in Sects.~\ref{sect:cfd} and \ref{sect:gravity} with available computational resources. We start with the construction of a sensible initial model for global \ac{3D} hydrodynamic simulations of Phase (ii) of \ac{CEE} according to our classification in Sect.~\ref{sect:phases}. This is not only difficult from a technical point of view, but we also have to ensure that such a model represents a reasonable end point of the evolution \emph{preceding} the \ac{CE} interaction, i.e.\ at the end of Phase (i). The high densities in the cores of giant stars are the reason why degeneracy effects play a role in them, which cannot be described by a classical ideal-gas equation of state. Core material must be treated instead as an ideal quantum gas. This is no fundamental problem. The hard limit of what can be accommodated in simulations is set by the scale problems discussed in Sect.~\ref{sect:multiscale}. \subsection{Can the stellar cores be resolved?} \label{sect:comp_feasible} At the first glance, the \emph{spatial scale discrepancy} between the radius of the core, $R_\mathrm{core}$ and the outer envelope of a giant star, $R_\star$, of about four orders of magnitude (see Sect.~\ref{sect:multiscale})---and for some special cases of early-stage giants perhaps even less---seems challenging but not impossible to represent in numerical treatments. However, a closer look quickly reveals that simulations in which these components are fully resolved are quite unrealistic. A representation of the core structures would require to resolve spatial scales at least a factor of 10 to 100 below $R_\mathrm{core}$. Thus, a reasonable resolution of the core leads to a spatial scale difference of about $10^5$ between the integral scale of the primary star and the sizes of discrete elements relevant for the \ac{CFL} condition. Still, this is extremely challenging but not completely hopeless to be resolved in future simulations. A computational domain that allows to capture the expansion of the envelope during \ac{CEE} without losing material over its boundaries (which, as discussed in Sect.~\ref{sect:boundaries} would make it hard to track the conservation properties of the simulation) has to extend by several orders of magnitude beyond the radii of the giant stars. Covering such domains uniformly with the finest required resolution requires computational resources far beyond those of the foreseeable future. Adaptive resolution refinement as inherent to \ac{SPH} methods or included in grid-based approaches via \ac{AMR} techniques can alleviate the problem somewhat but not sufficiently to render fully resolved simulations a realistic option. There is yet another, more restrictive reason why \ac{CE} simulations with resolved cores are unrealistic. It arises from the \emph{timescale problem} mentioned in Sect.~\ref{sect:multiscale}. The dynamical timescale defined in Eq.~(\ref{eq:tdyn}) is the relevant quantity for estimating the computational cost of the simulation. Generally, hydrodynamic simulations aim to follow the evolution of the modeled system over a duration close to $\tau_\mathrm{dyn}$, which therefore sets a coarse order-of-magnitude estimate for the required number of time integration steps. This argument, however, can be formalized further. As discussed in Sects.~\ref{sect:eulerian} and \ref{sect:SPH}, the \ac{CFL} condition states that numerical stability of hydrodynamic schemes in explicit time discretization necessitates discrete time integration steps smaller than the sound crossing time\footnote{The sound crossing time is sufficient for our estimate, but the actual \ac{CFL} condition is more specific and refers to the hydrodynamic signal speeds.} over a grid cell in grid-based discretizations, or a smoothing length in \ac{SPH}. As estimated in Sect.~\ref{sect:multiscale}, the dynamical timescale of the envelopes of \ac{RGB} or \ac{AGB} stars is about $50$ days. In the cores of such stars, $\tau_\mathrm{dyn, core}$ is only ${\approx} \, 20 \, \mathrm{s}$ (see Sect.~\ref{sect:multiscale}), i.e.\ it is lower than $\tau_\mathrm{dyn, envelope}$ by five orders of magnitude. When covering the radius of the core with $100$ resolution elements (grid cells or \ac{SPH} smoothing lengths), the \ac{CFL} condition dictates timesteps that are seven orders of magnitude smaller than the dynamical timescale of the envelope. Global \ac{CE} simulations striving to resolve the core of the primary star while also following the evolution for a dynamical timescale of the envelope therefore face a temporal scale discrepancy of $10^7$, i.e.\ ten million numerical time integration steps are necessary to follow the system even over only one $\tau_\mathrm{dyn, envelope}$. Even in the most optimistic cases with a low spatial resolution of the stellar core, the timescale difference does not reduce below five orders of magnitude. Therefore, at best for some very favorable configurations fully resolved \ac{3D} hydrodynamic simulations of \ac{CEE} can possibly attempted with future computational hardware, but this will not become a standard approach anytime soon. Local time stepping focuses the computational resources on the stellar core---meaning that not the entire domain is evolved in each small time step. Nonetheless, the effort needed to follow the evolution of the envelope remains prohibitive. The \ac{CFL} condition can be relaxed for unconditionally stable implicit time integration schemes, but such schemes are computationally costly and difficult to implement, so that they have not yet been applied to simulations of \ac{CEE}. Moreover, although stability is not a concern in time-implicit schemes, accuracy of the solution is still important. If hydrodynamic flows inside the core are to be resolved, a \ac{CFL}-like condition applies that replaces the sound speed with the flow speed and a substantial gain is only achieved for strongly subsonic flows. \subsection{Representing the cores of the primaries and the companions} \label{sect:representing_cores} As discussed in the previous section, the question of resolving the core of the giant star is not primarily a spatial scale problem; the limiting factor is the timescale problem introduced by the core of the primary star. Depending on its nature, one may hope to resolve the companion. While compact objects such as white dwarfs or neutron stars are too small to achieve sufficient resolution, a main sequence companion may come into reach for future simulations. Still, for a reasonably resolved sun-like companion star, the timescale discrepancy of ${\sim}\, 10^5$ remains extremely challenging. When \ac{CE} interactions take place between a primary star that has just initiated its expansion, and a main sequence companion, simulations may be able to represent both stars in their entirety. An example are simulations of the transient V1309~Sco, whose progenitor system is thought to have comprised a slightly enlarged (${\sim} \, 4 \,\ensuremath{R_\odot}$) $1.5 \, \ensuremath{M_\odot}$ post-main sequence primary and a $0.15 \, \ensuremath{M_\odot}$ main sequence companion \citep{tylenda2011a}. \citet{nandez2014a} carried out a number of simulations of this system using, for some of them, a full representation of the two stars. These simulations were conducted with an \ac{SPH} code and extremely low particle numbers of $\num{100000}$ to $\num{200000}$ for the primary star and $\num{5000}$ to $\num{20000}$ for the companion. Lacking a credible convergence test, caution is required in the interpretation of the results. However, in principle one may attempt such simulations with higher resolution. This setup, however, is already at the rather blurred boundary between \ac{CEE} and stellar mergers and may, because of the lack of a clear core-envelope structure, not completely qualify as \ac{CE} interaction (see our discussion in Sect.~\ref{ssec:terminology}). For completeness we should mention again that stellar interaction simulations with both stars fully represented are also carried out for compact objects such as white dwarfs and neutron stars, as well as for massive main sequence stars, where the two stars have comparable sizes (see Sect.~\ref{ssec:terminology} for examples). However, these interactions, which result in mergers, do not follow the same path as the \ac{CEE} described here in that one of the stars is usually tidally shredded rather than moving into the envelope of the other. For more standard \ac{CE} setups, the timescale problem arising from the extremely compact nature of the core of the primary giant star remains an insurmountable obstacle to global, fully resolved simulations of well-defined \ac{CE} interactions in the foreseeable future. There are two ways of dealing with this fundamental problem. When \ac{CEE} results in the survival of the binary and the ejection of the envelope, simulations should aim to accurately reproduce the core--envelope interaction, the timing and mechanism of envelope ejection and the post-ejection orbital separation of the cores. In this first case, the stellar cores are largely unaffected by the inspiral. Resolving their internal structure is therefore less important than a precise representation of the envelope of the primary star that later becomes the common envelope. It is therefore common practice to replace the cores by a simple model while trying to capture the physics of the envelope on the simulation domain. This is usually achieved by substituting the core of the primary star and also the companion with \emph{point particles} that interact mutually and with the envelope gas only via gravity. In this context, such point masses are often referred to as \emph{core particles}. The main drawback of this approach is that only the gravitational interaction of the cores with the envelope is modeled and any hydrodynamic interaction, such as accretion, expansion, evaporation, and jet formation is ignored. Yet such phenomena may strongly affect the envelope gas. Therefore, subgrid-scale models have been employed to represent them in global \ac{CE} simulations \citep[e.g.][]{chamandy2018a, zou2022a}. If, however, the evolution of the large envelope is not the primary interest of the simulation, a second option is to follow inner parts of the system with resolved cores. This may apply to systems where additional simulations capturing the envelope or other considerations lead to the conclusion that envelope ejection fails and a merger of the cores or an evaporation of the companion is the focus. A clear core--envelope structure of the primary star is a prerequisite for replacing its core by a point particle. But an exact definition of a sharp core--envelope boundary is difficult to give. Depending on the evolutionary stage of the giant and the mass of the star, the boundary may be set according to different parameters. Supergiant stars usually have a less clearly defined core--envelope structure than \ac{RGB} or \ac{AGB} stars. From a stellar evolution point of view, chemical composition may provide a useful discrimination: the core may have undergone nuclear burning and the mass fractions of the corresponding ``ashes'' could be used to indicate the core--envelope boundary. Shell burning, however, leads to ambiguities. For the \ac{CE} dynamics, it would be more useful to determine the point down to which the envelope material has to be removed so that the remaining bound objects does not re-expand, i.e.\ the bifurcation point (see Sect.~\ref{sec:parametrized_models}). The strategy of a simplified representation of the cores has been implemented in various ways. In \ac{SPH} simulations, a definition of a core particle is rather straightforward because the envelope material is also discretized as particles. Grid-based approaches, in contrast, require somewhat more thought. One option here is to plainly ignore the problem when mapping the stellar structure from the initial \ac{1D} model to the hydrodynamic computational domain. Such setups do not use core particles. The core of the primary star is simply taken to be part of the central grid cell that comprises the stellar core and some envelope material. In principle, mass flows into and out of this central cell are possible. The density in the central cell containing the core is bound to be high, but its value depends on the spatial resolution. This rather ambiguous and resolution-dependent representation of the stellar core makes convergence studies difficult and must therefore be discarded in modern \ac{3D} hydrodynamic simulations of \ac{CEE}. The introduction of a core particle alone, however, does not solve the problem satisfactorily straight away. It introduces two ways of treating stellar material---a particle modeling the core and a grid-based discretization of the envelope. These need to be defined and coupled in a physically consistent way. A na\"ive approach that simply assigns the mass of the stellar core to the particle leaves a resolution-dependent amount of envelope material in the central grid cell. This high-density material is usually not sufficiently resolved to guarantee a correct treatment of core-envelope interaction. Leaving the envelope profile unaltered, as was common practice in many simulations of dynamical inspiral in \ac{CEE}, leads to perturbations of the \ac{HSE} in the envelope structure of the primary star and generates spurious velocities. As a resolution-dependent model, numerical convergence of the results of \ac{CE} simulations is hard to establish with such a setup. \begin{figure} \centering \includegraphics[width=\textwidth]{fig13.pdf} \caption{Radial profiles of density (top left), internal energy (bottom left), pressure (top right), and derivative of pressure (bottom right) of an original \textsc{mesa} model for a $2\,\ensuremath{M_\odot}$ \ac{RGB} star with reconstructed profiles (\textsc{``opal''}), in which the cores were cut out at the indicated percentage of the total stellar radius. Figure from \citet{ohlmann2017a}.} \label{fig:ohlmann17} \end{figure} For this reason, \cite{ohlmann2017a} proposed a procedure to cut the original stellar profile (that in practical simulations often results from preceding \ac{1D} stellar evolution calculations) at a certain chosen radius into a thus defined ``core'' and an ``envelope''. The ``core'' is then represented by the core particle and the ``envelope'' is constructed on the grid in a way that preserves its expected \ac{HSE} according to Eq.~(\ref{eq:hse}) before the onset of \ac{CE} interaction. The hydrostatic stratification of the gas discretized on the grid is reconstructed with a modified Lane--Emden equation \citep{ohlmann2017a}. In contrast to the original Lane--Emden equation for polytropic stellar models \citep[see, e.g.,][]{kippenhahn2012a}, it includes the gravitational force $g_\mathrm{core}(r)$ due to the core particle as a function of radius $r$ in addition to self-gravity of the envelope gas: \begin{equation} \label{eq:le_mod} \frac{1}{r^2}\frac{\mathrm{d}}{\mathrm{d} r} \left[ \frac{r^2}{4 \pi G \rho} \frac{\mathrm{d} P}{\mathrm{d} r} + \frac{r^2 g_\mathrm{core}(r)}{4 \pi G}\right] + \rho = 0 \end{equation} This procedure provides a reliable and resolution-independent reconstruction of the envelope profiles (see Fig.~\ref{fig:ohlmann17}). The important parameter of this setup model is the cut radius below which material is assigned to the core and represented by a particle. This radius is chosen according to physical considerations and numerical necessities. As discussed in \ref{sect:comp_feasible}, a resolved physical core would act as a time sink in numerical simulations and this is also true for the higher-density regions around the core. Resolving the bifurcation point on the grid would be desirable, but it often is located in high-density material. Extending the correct envelope gas representation to this point can result in unacceptable computational costs and compromises are made. According to Eq.~(\ref{eq:le_mod}), the core particle is still embedded in gas within the cut radius, but its density profile does not provide a realistic representation of the envelope close to the core. In fact, depending on the choice of the cut radius, some envelope material is absorbed in the core particle. Despite these deficiencies, the setup procedure of \cite{ohlmann2017a} provides a well-controlled setup with a clearly-defined, if not entirely astrophysical core--envelope boundary. This has not been the case in many other setups employed before. \ac{SPH} based setups for \ac{CE} simulations face a similar problem. The envelope gas represented by \ac{SPH} particles in the vicinity of the distinct (gravitation-only) core particles and within their gravitational softening radii is not necessarily in \ac{HSE} when they are placed randomly. To ensure equilibrium, a distribution of \ac{SPH} particles in this region can be chosen that represents a density profile according to Eq.~(\ref{eq:le_mod}). Whether or not such a structure captures a realistic core--envelope transition has to be tested and may depend on the number of \ac{SPH} particles as well as on the value of the softening length \citep{reichardt2020a}. Although the fluid-dynamical treatment of the core material is discarded for efficiency reasons, it is important to capture the gravitational effects of the cores as precisely as possible. In a fully particle-based implementation in the framework of \ac{SPH} this is relatively simple; the numerical treatment of self-gravity derives from $N$-body simulations and is well-suited to deal with the problem. When combining a grid-based discretization of the envelope gas with a particle representation of the cores, however, the treatment of self-gravity is less obvious. One option is to model the gravitational interaction of the gas cells in a particle-based approach, such as using the tree method (see Sect.~\ref{sect:tree}). To alleviate the inherent asymmetries of tree methods, a direct summation of the contributions to gravitational forces from the core particles is possible. Calculating the gravitational interaction between the core particles and between core particles and gas cells exactly adds a tolerable computational overhead only as long as the gravitational interaction of the many gas cells is treated in an approximate $\mathcal{O} (N \log N)$ approach. This is implemented for instance in the moving-mesh \ac{CE} simulations of \cite{ohlmann2016a}. A full, grid-based treatment of gravity employing Fast Fourier techniques or multigrid methods (see Sect.~\ref{sect:grav_alt}), in turn, requires to map the masses of core particles onto the grid, for instance with a cloud-in-cell algorithm \citep{taam2006a}. To avoid force anisotropies, a large number of particles moving rigidly together can be chosen to represent the cores \citep[][use $10^5$ particles per core]{ricker2008a}. The approach of replacing the cores by point masses naturally removes the timescale problem. It seems, however, likely that future generations \ac{3D} hydrodynamic \ac{CEE} simulations will strive to improve the representation of the cores. Even if resolving them spatially remains out of reach, subgrid-scale models may help to refine the implementation of physical properties of the cores and associated effects such as hydrodynamic friction, mass accretion, or evaporation. \subsection{Setting up the primary star in hydrostatic equilibrium} \label{sect:challenges_setups} The first step in simulating \ac{CEE} is to set up a model for the primary star. This step requires some diligence. Although reaching envelope ejection in \ac{CE} simulations remains a challenge, primary stars are giants and have rather loosely bound envelopes. It is far from trivial to keep them stable over many dynamical timescales in \ac{3D} hydrodynamic simulations. Usually, the initial model for the primary star is obtained from a \ac{1D} stellar evolution calculation. Such calculations and their results differ in many aspects from the representations of stars in multidimensional hydrodynamic treatments. Two of them are of particular significance when mapping models of primary stars into \ac{CE} simulations. (1) Due to their \ac{1D} nature, stellar evolution calculations can afford much higher resolutions in spatial or mass coordinates. This is additionally supported by the common choice of a Lagrangian frame of reference. (2) Classical \ac{1D} models are constructed under the assumption of a mechanical equilibrium in the stellar structure. Aspect (1) directly links to the question of how to geometrically place the discretization elements in the different \ac{3D} hydrodynamic approaches. Adapting the geometry of the discretization scheme to the shape of the simulated system becomes increasingly important with lower spatial resolution. While observing the overall spherical symmetry of a stellar model, spherical grids are plagued by their axial and central coordinate singularities and are ill-suited for the later simulation of the binary system evolution. In contrast, the geometry of Cartesian meshes is not adapted to the spherical symmetry of the stellar model and their spatial resolution is anisotropic with preferred axis directions. Adaptive mesh refinement techniques can alleviate the geometry problems somewhat. Particle-based discretizations follow the mass distribution inside the envelope by construction and may therefore provide poor spatial resolution at certain locations (most obviously near the stellar surface). Still, the mesh-free approach of \ac{SPH} and moving-mesh discretizations of hydrodynamics automatically adapt to the geometric properties of the simulated object as it evolves. This advantage, however, comes at a price to pay at the initial setup: unstructured moving meshes and random placements of particles in \ac{SPH} lack any symmetry. Mapping a spherical stellar model onto them introduces noise resulting in spurious velocities in the material. \citet{ohlmann2017a} tested a variety of grid structures for placing the discretization elements in the initial setup---a regular cubic grid, a nested cubic grid, an adaptive cubic grid, and a grid based on a HEALPix tessellation \citep{gorski2005a, pakmor2012b}. For reasons discussed below, however, they found that the initial grid geometry has little effect on the simulation results. Aspect (2) is related to the problem of ensuring \ac{HSE} in hydrodynamic simulations. Except for the explosive termination phases, stellar structures remain very close to \ac{HSE} throughout the evolution of the star. This, to good approximation, should hold true for the envelope of the primary star at the onset of \ac{CEE}. Simulations of the dynamic inspiral phase aim to determine the response of the \ac{CE} to the perturbations caused by the orbiting stellar cores. A key requirement for this is that the employed numerical model is able to maintain \ac{HSE} in the unperturbed envelope---any change in the envelope structure should originate from the core inspiral and not from numerical errors. This is challenging because, in contrast to the classical stellar structure calculations providing the initial model for the primary star, \ac{HSE} is not explicit at the level of the fundamental equations in a hydrodynamic model. It rather constitutes a special solution and there is no guarantee that the delicate balance between pressure gradient and gravity in the loosely bound envelope of a giant star is maintained over many dynamical timescales by the approximate numerical schemes. Moreover, the goal is not to force the setup into some arbitrary \ac{HSE} configuration but to reproduce the original stellar model as exactly as possible in the multidimensional hydrodynamic simulation. To enable the correct \ac{HSE} in the numerical model, the gravitational force as well as counteracting pressure gradient should be reproduced accurately. Since both effects are discretized independently (see Sects.~\ref{sect:cfd} and \ref{sect:gravity}), there is little hope for errors to cancel reliably\footnote{There is a special class of numerical schemes---so-called \emph{well-balancing methods}---that aim at ensuring \ac{HSE} in hydrodynamic codes \citep[see, e.g.,][]{edelmann2021a}, but these have not yet been employed to \ac{CE} simulations.}. A minimal requirement for global stability of the stellar model is a sufficiently precise numerical representation of the pressure gradient. To this end, a pressure scale height should be resolved by a certain number of discrete elements (grid cells or particles). Depending on the discretization approach, this can be a difficult task. For finite-volume hydrodynamic schemes, it is possible to estimate the resolution required in order to keep the Mach number of spurious velocities below a certain threshold \citep{zingale2002a}. The result depends on the chosen scheme and the order of reconstruction, but generally a resolution of several cells per pressure scale height is required for reasonably low velocity perturbations. For the solver implemented in the \textsc{arepo} code, \citet{ohlmann2017a} estimated the Mach number of velocity fluctuations when resolving a pressure scale height $H_p$ with a grid spacing $\mathrm{\Delta}$ to be \begin{equation}\label{eq:minmach} \mathit{Ma} = \frac{C_\mathrm{CFL}}{12 \gamma} \left( \frac{\mathrm{\Delta}}{H_p} \right)^3 + \mathcal{O} \left[ \left( \frac{\mathrm{\Delta}}{H_p} \right)^4 \right], \end{equation} where $C_\mathrm{CFL} < 1$ is the fudge factor introduced into the necessary but not sufficient \ac{CFL} criterion to stabilize the scheme and $\gamma$ is the adiabatic index of the gas. To stabilize the hydrostatic stratification with this scheme assuming $\gamma = \nicefrac{5}{3}$ and $C_\mathrm{CFL} = 0.4$ down to a Mach number of $10^{-2}$, one pressure scale height must be resolved with more than three cells \citep{ohlmann2017a}. Particular problems arise near the core of the giant star and at its surface, where the pressure gradients are steep. Here, adaptive mesh refinement techniques can help to alleviate the resulting computational costs. \citet{ohlmann2016a} found that \ac{HSE} can be maintained only when retaining a certain number of grid cells inside the softening length around the core particle of the primary star model. The rather steep density gradient has to be sufficiently resolved. A universal criterion for the necessary resolution, however, is difficult to establish as it is expected to not only depend on the parameters of the star but also on the numerical methods and their implementation (e.g.\ the order of spatial reconstruction). \citet{sand2020a}, for example, found that a higher resolution is required in the case of \ac{AGB} primary stars as compared with the \ac{RG} models of \cite{ohlmann2016a}. Reaching a sufficient resolution of the pressure gradient near the surface of the star is a harder task because of the even steeper pressure gradient encountered here. It turns out, however, that this is less critical for the overall stability of the modeled stellar envelope than resolving the region around the core. Small departures from equilibrium are often tolerable because they only lead to a slight expansion of the very outer stellar layers that contain little material. Insufficient resolution of the outer layers, and a correspondingly large mass loss over the surface, however, may cause a progressive dilution of the inner parts of the star. Moreover, similar to the problems noted by \citet{galaviz2017a}, the lost material may affect the prediction of the color and the lightcurve of the simulated \ac{CE} event. In low-resolution \ac{CE} simulations with grid codes, a practical way to stabilize the surface of the primary star is to impose a high temperature in the pseudo-vacuum embedding the star such that it is in pressure equilibrium with the surface layers \citep[e.g.,][]{sandquist1998a, passy2012a, chamandy2018a}. This, however, may lead to problems with predicting observables from \ac{CE} simulations, because the artificially hot pseudo-vacuum prevents a useful estimate of a photospheric temperature \citep{galaviz2017a}. By construction, \ac{SPH} codes have low resolution in the low density regions of the surface. However, they tend to retain the stellar shape without the addition of a hot pseudo-vacuum. In \ac{SPH} schemes, hydrodynamic quantities and their gradients are computed by summing over contributions from a certain set of neighboring particles. At the surface of an object, this leads to a one-sided evaluation of properties that can cause an artificial ``surface tension'' \citep[e.g.][]{springel2010c}. On the one hand, this may help to prevent the slow leakage of low-density material. On the other hand, however, the artificial surface tension may affect the modeling of the phase directly preceding the plunge-in of the companion into the envelope. A careful preparation of the \ac{3D} stellar model involves not only the mapping from the original \ac{1D} structure but in addition it requires a damping to ensure initial \ac{HSE} in the discretized structure. In particular, the arbitrary initial placement of the grid-generating points in moving-mesh hydrodynamics schemes and of the particles in \ac{SPH} requires care to not disturb local \ac{HSE} conditions, which would lead to spurious velocities in the envelope of the primary star. But also Eulerian grid-based simulations should be damped to \ac{HSE} because of the change in resolution in the mapping process. The damping can be implemented as an artificial friction term \citep{rosswog2004a, pakmor2012b} proportional to \begin{equation} \dot{\vec{v}} = - \frac{1}{\tau} \vec{v}, \end{equation} where $\tau$ is the timescale over which the velocities are damped. Following \citet{pakmor2012b}, \citet{ohlmann2017a} perform the damping with a constant $\tau$ over several dynamical timescales of the object, reduce the damping over a certain period and then follow the undamped evolution over some dynamical timescales to ensure stability of the obtained configurations, see Fig.~\ref{fig:ohlmann_relax}. The necessary damping step is the reason why the choice of the initial grid geometry is unimportant as long as it provides a reasonable representation of the structure: The adaptive moving mesh or the positions of the \ac{SPH} particles adjust themselves in the damping process and attain a structure that is largely independent of the initial choice. The purpose of the relaxation step is to approach the lower limit for the Mach numbers of spurious motions implied by criteria such as Eq.~(\ref{eq:minmach}). Similar damping procedures have been applied successfully for many years, starting with \citep{ricker2008a} and they are used time and again from \citet{passy2012a} to \cite{ohlmann2017a}, \citet{chamandy2018a}, and \citet{prust2019a}. \begin{figure} \centering \includegraphics[width=\textwidth]{fig14.pdf} \caption{Relaxation of the setup model shown in Fig.~\ref{fig:ohlmann17}. Shown are the radial profiles of the Mach number (top left), the density (bottom left), the two terms in the equation of \ac{HSE} (\ref{eq:hse}) (top right) and the relative error in \ac{HSE} for different times during the relaxation procedure. The density profile is well-preserved and the deviation from \ac{HSE} is at the percent level within the stellar structure (but not in the pseudo-vacuum embedding it). The Mach number increases but stays reasonably low inside the stellar envelope. Figures from \citet{ohlmann2017a}.} \label{fig:ohlmann_relax} \end{figure} An additional problem arises when a correct representation of the thermal structure of the \ac{1D} stellar model in the hydrodynamic simulation setup is intended. This usually implies the need to use exactly the same equation of state in both the stellar evolution code providing the \ac{1D} model and in the hydrodynamic code. With minimal changes in the hydrodynamical structure, however, it is possible to preserve the correct convective properties of the envelope when using the setup procedure proposed by \citet{ohlmann2017a} based on \citet{edelmann2017a}. \citet{ohlmann2017a} list five quality criteria for the representation of primary stars in \ac{3D} hydrodynamic \ac{CE} simulations: \begin{enumerate} \item Correct representation of the mechanical structure: deviations from the original \ac{1D} model in the pressure and density profiles should be small. \item Correct representation of the \ac{HSE}: the difference between both sides of Eq.~(\ref{eq:hse}) should be small. \item The Mach numbers in the envelope of the primary star model should be small compared to the Mach numbers expected in the later \ac{CE} evolution. \item Correct thermal structure of the envelope: if the convective structure of the primary star is retained in the mapping and relaxation procedures, a stationary state of convection should be reached in the model. \item Stability against large-scale oscillations: If the original primary star is not pulsating, the potential energy of the model should be constant. \end{enumerate} These criteria should be checked carefully before adding a companion and starting the actual \ac{CE} simulation. Again, we advocate to perform such tests as a standard procedure when performing \ac{CE} simulations and to document the results in the related publications. \subsection{Setting up the binary system} \label{sect:setup_binary} After setting up a primary star model and checking its stability, a companion is added. This requires to choose the parameters of the progenitor system, such as the initial orbital separation, the spin of the two stars, and the eccentricity of the orbit. Physically, these parameters are determined by the evolution of the progenitor binary system and set by choosing the time at which the simulation of this system is started. From this point of view, initializing the actual \ac{CE} simulation as early as possible seems advisable in order to capture the formation of the \ac{CE} correctly. The pre-\ac{CE} evolution, however, takes place on timescales that are not easily accessible to \ac{3D} hydrodynamic models (see Sects.~\ref{sect:pre-dynamical_phase} and \ref{sect:3d_accessible}). Therefore, an initial condition for the binary evolution must be constructed that reproduces an expected structure at a certain stage of the pre-\ac{CE} evolution. Starting at the onset of Roche lobe overflow appears to be a natural choice: The initial system is set up at the time when the primary, with radius $R_\star$, just fills its Roche lobe, whose radius, $r^\mathrm{Roche}_\star$, can be approximated by \begin{equation} R_\star = r^\mathrm{Roche}_\star = a \, \frac{0.49 \, q^{2/3}}{0.6 \, q^{2/3} + \ln (1+ q^{1/3})}, \end{equation} where $q = M_\star / M_\mathrm{comp}$ is the mass ratio of the primary star to the companion \citep{eggleton1983a}. This determines the initial orbital separation, $a$. We could ask whether starting the simulation at onset of Roche lobe overflow, as, e.g., in \citet{rasio1996a} and \citet{nandez2014a}, is actually necessary. After all, we do not know whether the simulations capture correctly the transition between stable Roche lobe overflow and the onset of instability and inspiral. Following this argument, the choice for the starting point of \ac{3D} hydrodynamic \ac{CE} simulations is often made according to practical considerations. A too large initial separation makes the simulations very expensive. Many orbits of the binary have to be followed from before the onset of mass transfer until the actual plunge-in of the companion into the envelope of the primary. This is possible provided that the employed hydrodynamics scheme preserves angular momentum well, which, of course, is desirable. With this, we face the paradoxical situation that the better the codes reproduce physical conservation laws, the more expensive the simulations become. As a compromise, many simulations position the companion near the surface of the primary \citep[e.g.,][]{sandquist1998a, ohlmann2016a}. The companion could even be initially placed inside the envelope---a choice motivated with the argument that there is very little binding energy in the outer layers \citep{law-smith2020a}. The danger with this approach is that a simple binding energy argument is insufficient. The inspiral is a dynamical process driven by the drag force. Therefore, an extreme choice may select an orbital separation of the initial core binary system that seems energetically plausible but is never reached in the actual dynamical evolution because the envelope is lifted earlier and the drag force vanishes. Placing the companion close to the primary star---be it at Roche lobe filling distance or closer---raises the question of how to define a consistent setup configuration. It implies that early tidal effects are missed. For a late initiation of the simulation, the primary star cannot be assumed to be spherical, but many simulations start out with exactly this assumption. From a practical point of view, a spherical setup of the primary star has the advantage that sufficient stability of its envelope can be guaranteed, e.g. by the procedures described in Sect.~\ref{sect:challenges_setups}. This allows to separate physical effects during the \ac{CE} evolution from numerical artifacts, which would be more difficult to ensure in a binary setup. Therefore, the assumption of a spherical primary star gives rise to numerically well-defined initial conditions for \ac{CE} simulations. Still, concerns remain as to whether this is a physically valid approach. There are methods that allow to initiate the binary with a separation larger than Roche lobe contact and to follow the evolution in a numerically efficient way. After creating a stable model of a spherical primary star as in Sect.~\ref{sect:challenges_setups}, another step is taken before simulating the plunge-in of the companion. This intermediate step aims at relaxing the envelope of the primary star into the potential of the binary system close to the onset of mass transfer. For white dwarf merger simulations, such a procedure has been suggested by \citet{dan2011a}. The idea is to place the spherical stellar models in orbit with a companion at an orbital separation large enough that the tidal interaction is negligible. The computational cost of following the slow inspiral due to gravitational wave emission is prohibitive. To speed up the orbital evolution, the distance is artificially decreased on a timescale that is substantially longer than the dynamical timescale of the stars. This allows the stellar structures to adapt to the changing potential. Such initial models, however, are not common in \ac{CE} simulations yet. Retaining force balance in the loosely bound envelopes of giant stars is more challenging than in the compact structures of white dwarfs. Even agreeing to start all simulations at the time of Roche lobe overflow, we next would need to decide on the rotation of the interacting stellar objects. Since the companion and the core of the primary star have to be treated as point particles (see Sect.~\ref{sect:representing_cores}), this question boils down to the rotation of the envelope of the primary. The general idea of the onset of \ac{CEE} is a loss of co-rotation between the orbit of the binary companion and the envelope of the primary. This triggers the inspiral, because for the drag force to act, a non-vanishing relative velocity between the companion and the envelope material is necessary. It remains unclear, however, how much co-rotation is to be expected in the epoch the simulation is initialized (provided, of course, that this initialization reflects a physical evolution stage in the first place). Moreover, not all progenitor systems may reach full co-rotation before entering \ac{CEE}. In simulations, anything between full co-rotation and a non-rotating primary star has been used. It may be surprising that even full co-rotation leads to inspiral, but this is due to non-relaxed initial conditions in the binary potential which quickly re-arrange the density distributions so that tidal forces can act. The issue of primary-star rotation and the extent of primary--orbit co-rotation goes hand in hand with the issue of stabilization of the binary in a certain rotating configuration. While the primary is always stabilized as a single star in the inertial frame (see Sect.~\ref{sect:challenges_setups}), some simulations also stabilize the binary in the rotating frame \citep{rasio1996a}. \citet{nandez2014a} and following papers stabilize the binary in the corotating frame using the method of \citet{lombardi2011a}, but such a method is not universally adopted by all simulations. \citet{reichardt2019a} evolved a Roche lobe contact system in the rotating frame, but like \citet{sandquist1998a}, they did not stabilize the binary in that frame, effectively spinning up a star that was in equilibrium only when non-rotating. An additional, dynamically important but poorly constrained parameter is the initial eccentricity of the system. Many simulations assume circularization of the orbit prior to the onset of \ac{CEE}, and this is also supported by simulations \citep{macleod2022a}, but cases with eccentric initial orbits have also been considered in numerical simulations \citep{staff2016b,glanz2021a}. Eccentric post-\ac{CE} binaries are observed and may result from pre-existing eccentricity or generation of eccentricity during the \ac{CE} interaction. In simulations with the companion initialized in a spherical orbit close to the edge of the primary star, the generation of substantial eccentricity in the plunge-in is indeed observed. Our discussion in the previous sections indicates that the setup of \ac{CE} simulations is a very delicate issue. Unlike the inspiral phase of \ac{CE} interaction, the prospects for \ac{3D} hydrodynamic simulations of large parts of the pre-\ac{CE} evolution are discouraging, leaving us with rather arbitrary choices of initial system parameters. This unsatisfactory situation calls for careful testing of the impact these parameters have on the results. The studies carried out thus far indicate some, but surprisingly little impact of the initial separation and even the rotation of the primary star on the final orbital separation \citep{sandquist1998a, iaconi2017a, prust2019a}. This, however, may depend on secondary parameters, such as the mass and evolutionary stage of the giant star and the mass of the companion. More extended parameter studies are required to settle the impact of the choice of initial parameters on the final orbital separation, but also on the mass and morphology of ejected envelope material. \section{Multidimensional hydrodynamic simulations} \label{sect:simulations} For reasons given in Sects.~\ref{sect:challenges_physical}, \ref{sect:challenges_numerical} and \ref{sect:setups}, only certain stages of \ac{CEE} are accessible to \ac{3D} hydrodynamic modeling. Although all phases are methodologically challenging, the dynamical inspiral, Phase (ii) of our classification in Sect.~\ref{sect:phases}, is out of reach for classical approaches to stellar evolution modeling. Yet, it is perhaps the most critical phase for the fate of the system. Progress in binary stellar evolution fundamentally depends on a detailed understanding of this phase. We argue that only \ac{3D} hydrodynamic simulations provide the required realism and predictive power to solve this problem. In this section, we review simulations pertaining to parts of the pre-\ac{CE} evolution of the progenitor system, the dynamical \ac{CE} interaction in the plunge-in phase, and a few tens to hundreds of orbits afterwards. These have been carried out over the past decades by several groups. In contrast to the previous sections, where we discussed general aspects of \ac{CE} simulations and expressed our own view on the approaches taken, we here summarize the findings reported by the respective authors of the studies. The interpretations and conclusions drawn are often complementary, but occasionally also contradictory. This is an unavoidable consequence of the historical development of the field, which we intend to convey from a neutral perspective. We therefore try to hold back our own views. \subsection{Simulations of the pre-dynamical inspiral phase and the onset of CE interaction} \label{ssec:simulations_of_the_pre-dynamical_inspiral_phase} Until recently, work on the pre-\ac{CE} evolution was mostly carried out based on analytical models, stellar evolution calculations or binary population synthesis tools. We have briefly discussed some important aspects of the pre-\ac{CE} interaction in Sect.~\ref{sect:pre-dynamical_phase} and refer the reader to Chapter~6 of \citet{ivanova2013a} for a more comprehensive review. A broader scope of modeling binary interactions, both with \ac{1D} stellar evolution approaches and with multidimensional hydrodynamic methods, is covered in the review of \cite{demarco2017a}. Here, we restrict our discussion to the few available multidimensional, hydrodynamic models that pertain to the the onset of \ac{CEE}. There is no doubt that the physical parameters of the binary system together with the nature and evolutionary stage of the primary star and the companion determine its fate in and after the \ac{CE} phase. But still we lack a comprehensive understanding of which systems achieve successful envelope ejections leaving behind a compact binary and which of them end up in a merger of the cores. It is expected that this is determined by the physical initial conditions and the many resulting processes that lead to the onset of \ac{CEE} discussed in Sect.~\ref{sect:pre-dynamical_phase}. As mentioned there, there is little hope to capture this complex phase comprehensively in \ac{3D} hydrodynamic simulations, but a few attempts exist. \citet{pejcha2016b} and \citet{pejcha2016a} carried out \ac{3D}, \ac{SPH}-based radiation-hydrodynamic simulations aimed at understanding the pre-merger phase of the transient V1309~Sco \citep{tylenda2011a}. This is now established to have been the merger of a slightly enlarged, ${\sim} 1.5 \, \ensuremath{M_\odot}$ main sequence or sub-giant primary star and its much less massive main sequence companion. As discussed in Sect.~\ref{ssec:terminology}, this configuration does not qualify as a show-case example of a \ac{CE} system, but is rather at the blurry interface between \ac{CEE} and classical stellar mergers. Nonetheless, the similarity of this system and the less extreme spatial scale challenges render it a suitable example to test some models with numerical simulations and comparisons to observations. The simulations of \citet{pejcha2016b} and \citet{pejcha2016a} modelled a very specific process: the mass loss of the interacting binary system from the outer Lagrange point $L_2$ and its observational consequences. \ac{SPH} was coupled to a simplified treatment of radiation that splits the process into flux-limited diffusion of radiation energy, radiative cooling in the direction perpendicular to the orbital plane, and---only in \citet{pejcha2016b}---irradiation of the gas from the central binary. A suitable equation of state was used to account for the ionization structure of the gas. The setup of \cite{pejcha2016b} consisted of a central binary with a mass ratio between $0.06$ and $0.8$, modeled only including the mutual gravitational force of the stars, but with no back-reaction of the gas flow on the binary orbit. The \ac{SPH} particles representing the gas component were injected directly at the $L_2$ Lagrange point of the binary system allowing one to follow the structure of the outflow, which was not self-consistently modeled in the hydrodynamic simulation but assumed in the setup. The spiral arms generated by the outflow overlapped and merged at a certain distance from the binary, which is of interest for observing the corresponding system. Shock waves thermalized and about 10\% to 20\% of the radial kinetic energy of the outflow was converted to thermal energy. Depending on the system parameters, some of this energy was radiated away, diffused or generated adiabatic expansion of the gas and dominated the resulting luminosity. Conditions for dust formation were found to prevail in the ejected material. The temperatures and luminosities detected in the simulations of \citet{pejcha2016b} matched observations of \ac{LRN} in order of magnitude, but because the model did not follow the dynamical evolution of the binary itself, lightcurves could not be reproduced. \citet{pejcha2016a} extended the study to other mass ratios of the binary system and found outflows of unbound material from $L_2$ if the thermal content of the ejecta was sufficiently high, i.e., the ratio between the sound speed and the orbital velocity at the injection point was large. On the other hand, cold outflows outside the mass ratio range determined in \citet{pejcha2016b} remained marginally bound. A rich phenomenology was observed in the simulations. Again, the expected optical emission from the implied processes was found to explain prolonged activity of systems due to $L_2$ mass loss before the peak of the emission was reached in the actual merger event. Informed by the radiation-SPH simulations of \citet{pejcha2016a, pejcha2016b}, \cite{metzger2017a} proposed that the interaction of material ejected in the dynamical stellar merger or \ac{CE} event with the previous outflow generates a shock that contributes to powering the lightcurves of \acp{LRN}. This was suggested to explain typically observed double peaks. \cite{pejcha2016b, pejcha2016a} assumed an outflow over an outer Lagrange point and studied its implications in their simulations, but they did not model the dynamics of the binary system itself. Although they focused on the pre-\ac{CE} evolution, they did not attempt to model how the system enters \ac{CEE}, nor the impact of the simulated phase on the following inspiral. This was addressed for the first time by \cite{macleod2018b}\footnote{Stellar mergers in other contexts have been studied in numerical simulations before. \cite{motl2017a} give an overview and discuss differences in the evolution when simulating mass transfer and mergers between white dwarf stars in different approaches.}, who studied the evolution from the onset of mass transfer towards the formation of a \ac{CE} in a system comprising an evolved primary star and a lower-mass companion. Their choice of parameters ensured that mass transfer reduces the binary separation initiating unstable mass transfer. To simulate the hydrodynamic evolution in \ac{3D}, \cite{macleod2018b} employed the Eulerian \ac{MHD} code \textsc{athena++} \citep{stone2020a}, but without accounting for the evolution of magnetic fields. The spherical polar mesh was uniformly spaced in angular directions, with the spacing growing logarithmically with radius. Two nested levels of static grid refinement were prescribed around the binary orbital plane. The giant star's envelope was constructed as a polytrope. Both the core of the primary star and the companion were modeled as point masses. Following the details of mass transfer required meticulous preparation of the initial model for the \ac{3D} hydrodynamic simulation. The envelope of the primary was relaxed damping out spurious velocities to ensure numerical \ac{HSE}. The gravitational force of the companion was slowly turned on to allow the structure to adapt to its presence. At Roche-radius separation, mass transfer commenced in an unstable mode with an increasing rate so that the orbit of the binary core system eventually experienced runaway decay. A fit to the loss rates of mass and angular momentum was provided that allows for an analytic description of the orbital evolution. The morphology of the gas outflow was observed to change during the evolution: initially a thin stream of high-entropy gas was launched from the $L_2$ and $L_3$ Lagrange points, which later developed into a broad fan of gas ejected on ballistic trajectories. The origin of the transition between the two modes was identified as desynchronization of the orbital motion with the rotation of the donor star's envelope. \citet{macleod2018a} interpreted their results in terms of observational features with particular emphasis on the formation of bipolar structures observed in remnants of stellar coalescences. While it is not the only path to binary coalescence and systems with mass ratios close to unity may evolve differently, their simulation captured an important case for the formation of a \ac{CE}. The case of ``grazing envelope evolution'' impeding or even preventing the onset of \ac{CEE} (see Sect.~\ref{sect:pre-dynamical_phase}) was simulated by \citet{shiber2017a} and \citet{shiber2018a} who prepared a model of a $3.4 \, \ensuremath{M_\odot}$ \ac{AGB} star of radius ${\sim} 215 \, \ensuremath{R_\odot}$ in the \textsc{mesa} code and mapped it into the \textsc{flash} code \citep{fryxell2000a} on a uniform Cartesian grid and assumed an ideal gas equation of state. The inner third of the radius was replaced with a constant density sphere. Gravity was modeled as constant, temporal evolution of the gravitational field and the effect of the companion star were ignored. A low-mass main sequence companion star was initialized on a Keplerian orbit at various radii. This radius was kept constant by \citet{shiber2017a} while \citet{shiber2018a} allowed for inspiral to a two thirds of the initial radios of the primary star at a prescribed rate inspired by \ac{CE} simulations. At the location of the companion, a bipolar jet was put in perpendicular to the orbital plane with a mass injection rate motivated by a \ac{BHL} formalism and a prescribed opening angle and velocity. \citet{shiber2017a} observed a complicated flow morphology and an efficient removal of material due to jet action. \citet{shiber2018a} concluded that the grazing envelope evolution may substantially delay or even prevent an inspiralling of the companion. Simulations trying to model the processes leading to the formation of a \ac{CE} system have to be distinguished from the conditions in which multidimensional hydrodynamic simulations are initialized, which are often chosen for practical and numerical reasons instead of a stringent physical motivation (see Sect.~\ref{sect:setup_binary}). Is this a fundamental problem for the credibility of current \ac{CE} simulations? A look into the currently available simulations and even semi-analytical descriptions suggests that the ability of the system to eject the envelope ultimately deciding between the formation of a compact binary remnant or a merger of the cores is less sensitive than one might expect to the initial conditions of the simulation, such as the degree of co-rotation and the initial distance of the companion from the primary star when setting up global simulations of \ac{CEE}. Some impact of these parameters, however, is recorded. For example, the exact value of the final orbital separation \citep{iaconi2017a} and the rate of orbital decay, do depend on the degree of co-rotation and the initial orbital angular momentum. The extent of these dependencies and whether there are large differences for different systems is not yet established. Following \citet{iaconi2018a}, \citet{reichardt2019a} carried out full CE interaction simulations starting at the time of Roche lobe overflow\footnote{Simulations of the early \ac{CE} phases starting out with unstable mass transfer were already conducted by \citet{rasio1996a}, see Sect.~\ref{sect:sim_sph}.}. They tested the sensitivity of the outcome of the simulations to the conditions at the start of the interaction. The mass transfer (though Lagrange point $L_1$) and mass loss (though $L_2$ and $L_3$) rates were found to be lower for higher resolution and for simulations that were carried out in the corotating frame, while the time before inspiral was longer. As a result, the mass lost before the inspiral was relatively insensitive to numerical conditions. The outcome of the simulations compared to similar ones that did not model the pre-\ac{CE} inspiral led to the conclusion that the clearest difference is the shape of the expanded and ejected \ac{CE}, which was found to be more symmetric in simulations that model the pre-inspiral thanks to the interaction with the disk of material formed during the early mass loss. However, it is likely that these conclusions only pertain to the chosen parameter set and cannot be generalized. This leaves us with the question of Sect.~\ref{sect:setup_binary}: how should we setup the simulation? Clearly, more work has to be devoted to the onset of \ac{CEE} and its impact on the processes in the inspiral phase. \subsection{Simulations of the companion--envelope interaction} \label{ssec:windtunnel} One of the fundamental questions of \ac{CEE} is how the companion star interacts with the envelope gas as it passes through it. This question was already addressed in the earliest models of \ac{CE} phases in binary stellar evolution, that were carried out in \ac{1D} in the framework of classical stellar evolution calculations, see Sect.~\ref{sec:one_dimensional_implicit_approaches}. The inspiral of the companion was attributed to the action of a hydrodynamical or tidal drag force and analytic approximations (see Sect.~\ref{sssec:drag}) were employed to implement this interaction into \ac{CE} simulations (Sect.~\ref{sssec:1d_stellar_structure_models_of_the_dynamicsl_ce_inspiral}). The simplistic approximate \ac{1D} view on the interaction in \ac{CEE}, however, diminishes the predictive power of the simulations. Effects that are not or only approximately captured in the basic formalism include density gradients in the envelope, asymmetries, nonlinearities, and the simple fact that not only the companion moves through the envelope gas but both stellar cores orbit each other inside it. To test some of these effects and to improve the accuracy of \ac{1D} models, multidimensional hydrodynamic simulations were used to study the interaction of objects with the stream of envelope gas---because of their similarity to technical setups they are sometimes called \emph{wind tunnel simulations}. In terms of the physics modeling, they are quite similar to the ``global'' \ac{CE} simulations in the framework of he basic gravo-hydrodynamic model, that are discussed in Sect.~\ref{sect:sim_global}. There are, however, two important differences: the advantage of ``local'' wind tunnel simulations is that they potentially can resolve the stellar core and the flow in its immediate vicinity---a region that often remains under-resolved in global simulations because they have to accommodate the entire structure of the giant primary star. Their drawback, however, is that they do not account for the global geometry, the full gravitational potential of the primary, the eccentricity of the orbit, large-scale distortions of the flow of envelope gas, instabilities, and microphysical effects such as the recombination of ions \citep{macleod2015a}. Nonetheless, wind tunnel simulations may capture main effects and with their superior spatial resolution they constitute an important complimentary approach to global \ac{CEE} simulations. The astrophysical problem of a compact body moving through gas while accreting material and being subject to drag forces is rather ubiquitous. Not all simulations of this type were performed in the context of \ac{CE} studies. Despite the differences in the setups, however, their results often carry over to the problem at hand. A review of such studies can be found in \citet{edgar2004a}. In their Section 3.1, \citet{macleod2015a} summarize some of the findings. Early wind tunnel simulations were carried out by \cite{shima1985a} with a finite-volume discretization of fluid dynamics based on the Riemann solver of Osher \citep{osher1983a} under the assumption of axisymmetry. They tested the analytic prescriptions discussed in Sect.~\ref{sssec:drag} and studied the details of the flow configurations relaxing the collisionless assumption. Overall, in the case of high-Mach number flows, the gas was found to converge behind the object. A bow shock forms slightly upstream of the body and it encloses the region where gas converges and flows towards the gravitating object, where it is accreted. This confirms the basic picture of \ac{BHL} accretion. Consequently, \citet{shima1985a} cast their results in the corresponding form of the drag force, \begin{equation} F_\mathrm{drag} = C_\mathrm{d} \frac{1}{2} \pi R_\mathrm{a}^2 \rho_\infty v_\infty^2, \end{equation} i.e.\ a variant of Eq.~(\ref{eq:bondi-hoyle}), and determined the drag coefficients $C_\mathrm{d}$ from their simulations with varying Mach numbers of the flows and specific heat ratios of the gas. \ac{3D} hydrodynamic simulations including a density gradient in the gas were carried out by \citet{soker1986a} and \citet{livio1986a} with a hybrid particle-grid based scheme, and by \citet{fryxell1988a} and \citet{ruffert1997a, ruffert1999a} with the piecewise-parabolic finite-volume method \citep{colella1984a}. These studies were motivated by other astrophysical scenarios and therefore considered shallower density gradients than those expected in \ac{CEE}. Additional simulations focused on flow instabilities that may occur in the Mach cone behind the moving object \citep[e.g.][]{ruffert1994b, ruffert1995a, ruffert1996a, foglizzo2005a}. \citet{armitage2000a} performed \ac{2D} simulations with the finite-volume code \textsc{zeus} \citep{stone1992a} to model the accretion during \ac{CEE} in the context of the formation of black holes. The treatment of drag forces discussed in Sect.~\ref{sssec:drag} is based on linear perturbation theory and applies to low-mass perturbers. In \ac{CEE}, the companion mass is sufficiently large so that we expect the density wakes to be in the nonlinear regime. Following up on their semi-analytical approach \citep{kim2007a}, \cite{kim2010a} performed \ac{3D} hydrodynamic simulations with the \textsc{zeus} code \citep{stone1992a} for a massive perturber moving through gas on circular orbits. They found that for supersonic motion a bow shock develops upstream of the perturber through which the flow becomes subsonic. In its immediate vicinity, the perturber was surrounded by a near-hydrostatic spherical envelope, which reduced the drag force below the estimates from linear perturbation analysis, and an extended low-density region trailed the object. The \ac{3D} wind tunnel simulations by \cite{macleod2015a} were specifically aimed at \ac{CE} interaction. They used the \textsc{flash} code \citep{fryxell2000a} to model a gravitating object (which one can think of as the companion in a \ac{CE} interaction) represented by a point particle with a softened gravitational potential. The point mass was surrounded by an absorbing boundary so that gravitational softening did not affect the flow. Block-wise \ac{AMR} was employed and between six and nine levels of refinement were used based on the second derivative of pressure, but still centered at the gravitating object. \cite{macleod2015a} pointed out that typical Bondi--Hoyle accretion radii in \ac{CE} dynamics are much larger than the companions and extend over a substantial density gradient in the envelope. This breaks the symmetry of the flow and leads to an angular momentum barrier impeding accretion onto the companion (with consequences for a potential growth of neutron star masses in \ac{CE} interaction), while the drag force is only mildly affected. \citet{macleod2015a} pointed out that the drag forces observed in their simulations are not dominated by hydrodynamic friction but are of dynamical origin, i.e., they are caused by envelope gas piling up due to gravitational interaction with the companion. They fitted their results to the formalism of \cite{bondi1944a}, see Eq.~(\ref{eq:bondi-hoyle}). Contrary to the \ac{2D} simulations of \citet{armitage2000a}, the \ac{3D} simulations of \citet{macleod2015a} showed no formation of a persistent disk around the companion. The study of \cite{macleod2017b} included the gravitational potentials of both the primary (assuming a planar geometry in the wind tunnel setup) and the companion and extended the parameter range in a systematic way. Different Mach numbers of the flow, density gradients, and mass ratios between primary and companion were tested. Again, the accretion rate was found to be reduced by the angular momentum barrier due to the density gradient. The universality of the drag forces determined in wind tunnel simulations remains an open question. Are they sufficient to calibrate semi-analytic \ac{1D} simulations so that they gain predictive power? A detailed discussion on the question of which quantities and phases in \ac{CEE} can be captured this way was presented by \citet{everson2020a}. \citet{chamandy2019a} compared the drag calculated using the analytical formalism of \citet{macleod2017b} with the drag measured in their \ac{3D} global \ac{CE} simulations of a ${\sim} 2 \, \ensuremath{M_\odot}$ \ac{RGB} primary star and a ${\sim} 1 \,\ensuremath{M_\odot}$ companion. They found that the two quantities match well only up to mid-inspiral. Afterwards, the analytical fit over-predicts the force experienced by the companion in the simulation by up to an order of magnitude. Other \ac{3D} simulations compared the measured gravitational drag with different variants of the analytical drag formalism (Sect.~\ref{sssec:drag}) to find reasonable agreement \citep{staff2016a,reichardt2019a}. This said, there has never been a comprehensive parameter study nor a systematic comparison between drag estimates and therefore, for the time being, it is impossible to conclude on the extent to which the drag in \ac{3D} global simulation matches predictions from analytic formalisms. In addition to simulations aiming at determining the drag force acting on the companion, studies have been performed that explore the effects of accretion and jet formation. In a series of publications, \citet{lopez2019a}, \citet{lopez2020a}, and \citet{lopez2022a} report on modeling jets launched from a compact object in a common envelope environment with the \textsc{Mezcal} code \citep{decolle2012a}. The compact object is represented by a point particle and a self-regulated jet is injected through an inner boundary. It is powered by a fraction of the mass accretion rate onto the compact object as measured at that boundary. Different parameters (efficiency of jet launching, inclination angle of the jet) are explored. In some cases, a neutron-star could drive a jet that breaks through the material piled up around it \citep{lopez2019a, lopez2020a}. A white dwarf companion star, however needs a very high efficiency to successfully launch a jet and for main sequence stars accretion is found to be too weak so that the jet does not break out of a \ac{RG} star envelope but is choked \citep{lopez2022a}. \subsection{Global CE simulations} \label{sect:sim_global} Global \ac{CE} simulations have a history dating back to the 1980s. Much of the early work was published in a series of papers on what was called back then ``double-core evolution'' by different groups of authors with various numerical methods \citep{bodenheimer1984a, taam1989a, taam1991a, terman1994a, taam1994a, terman1995a, yorke1995a, terman1996a, sandquist1998a}. The different approaches to numerical fluid dynamics that have been employed reflect the development of similar simulation techniques in other branches of computational astrophysics. \ac{CE} simulations have benefited substantially from the rapid evolution of computational resources over the past decades, which enabled significant refinement in the physical and numerical modeling. Each of the approaches has its strengths and drawbacks and we gave an account of this in Sect.~\ref{sect:simulations_comparison}. \subsubsection{Pioneering Eulerian grid-based approaches} \label{sect:sim_eulerian_pioneering} At a first glance, Eulerian approaches discretizing the equations of fluid dynamics on a static spatial grid may seem little appealing for simulating \ac{CEE}. Missing obvious symmetries, the grid geometry cannot easily be adapted to the \ac{CE} dynamics. Moreover, as detailed in Sect.~\ref{sect:cfd}, such schemes are not Galilean invariant and therefore the representation of physical phenomena, such as hydrodynamic instabilities, may depend on whether the simulations are conducted on a static or rotating frame of reference. Notorious advection errors tend to destabilize orbiting stellar objects and angular momentum conservation is problematic. Nonetheless, some Eulerian grid-based methods have been employed to studying \ac{CEE} early on, motivated as natural extensions of \ac{1D} \ac{CE} simulations in the drag force formalism. The primary goal was to alleviate a fundamental problem of the \ac{1D} models, where gravitational drag luminosity is injected into a spherical layer instead of a local energy deposition as expected to operate around the companion in reality. To give proper credit to early attempts to simulate \ac{CEE} in multidimensional hydrodynamic approaches, we start out our treatise with \emph{pioneering} grid-based simulations. Some of their value lies in the discussion of fundamental processes, that remains valid until today. Many of the employed methods, however, no longer meet modern standards. We therefore refrain from discussing them in detail; they are of historical interest rather than a guide for future developments. The first \ac{2D} simulation of \ac{CEE} was conducted by \citet{bodenheimer1984a}, who used a ``fluid-in-cell'' approach to discretize the equations of fluid dynamics and assumed axisymmetry. Their setup system consisted of a $16 \, \ensuremath{M_\odot}$ supergiant star, of which only a part of the envelope was modeled, and a $1 \, \ensuremath{M_\odot}$ companion representing a neutron star. Interestingly, this early multidimensional model already addressed a situation that---as a progenitor system of a gravitational-wave emitting merger event---is of utmost interest today, but still challenges numerical simulations. The transfer of angular momentum and orbital energy from the companion to the envelope gas was not self-consistently followed, but instead an analytic expression for frictional heating in the Bondi--Hoyle--Lyttleton formalism was applied following \citet{taam1978a}; see also Sect.~\ref{sssec:drag}. The gravitational interaction of the cores with the envelope gas was not included in this model. This simulation approach can be seen as a multidimensional generalization of earlier attempts to follow the inspiral of a companion into a giant star in classical \ac{1D} stellar evolution codes, such as discussed in Sect.~\ref{sssec:1d_stellar_structure_models_of_the_dynamicsl_ce_inspiral}. \cite{bodenheimer1984a} found that about $1 \, \ensuremath{M_\odot}$ of material is ejected in the evolution, preferentially in the direction of the orbital plane. Based on the multidimensional structure of the outflow, they argued that modeling \ac{CE} events based on energy conservation arguments alone is insufficient. Applying the same numerical method, \citet{taam1989a} explored \ac{CEE} in a system with a $5\, \ensuremath{M_\odot}$ \ac{RG} primary star, whose core is replaced by a point mass to reduce the associated time-scale problem, and a $1\, \ensuremath{M_\odot}$ companion. They report a significant mass ejection. The study of \citet{taam1994a} was performed with the hydrodynamical code of \citet{rozyczka1989a} and changed the model of the interaction between the companion and the envelope gas. The orbital decay of the core binary was explicitly prescribed according to angular momentum conservation: The angular momentum of the envelope gas was approximated in a \ac{2D} setup that modeled the dynamics in the orbital plane. Its temporal change was equated to the change in angular momentum of the core binary thus providing the evolution of the orbital separation. The in-fall of the companion was not followed completely. Instead, the focus was on simulating the gravitational torques in late stages of \ac{CEE} of a $3\, \ensuremath{M_\odot}$ \ac{RG} star, whose core was replaced by a point mass, and a companion, whose mass was slowly increased to $1\, \ensuremath{M_\odot}$ in a relaxation step. In agreement with the results of the \ac{SPH} simulation conducted by \citet{terman1994a} (see Sect.~\ref{sect:sim_sph}), these torques were found to establish co-rotation of the envelope material close to the companion. \citet{taam1994a} suggested this effect to be responsible for the termination of the inspiral phase. \citet{yorke1995a} used an axisymmetric setup of a $0.7 \, \ensuremath{M_\odot}$ main sequence star immersed into the envelope of a $3 \, \ensuremath{M_\odot}$ \ac{AGB} primary to follow later stages of \ac{CEE} in this system. In contrast to previous simulations, both cores were allowed to move and a nested-grid technique afforded a higher spatial resolution in the inner regions of the \ac{CE}: eight levels of cylindrical polar grids were used, each smaller by a factor of two in the radial extend than the next higher level grid. The treatment of angular momentum loss of the cores followed that of \citet{taam1991a}, with some modifications. \citet{yorke1995a} found that in their simulation the entire envelope was likely to be ejected without the cores merging. Orbital decay terminated at a separation of $15 \, \ensuremath{R_\odot}$ due to a spin-up to near co-rotation of envelope gas in the vicinity of the cores. Owing to the nested grid approach, the expansion of the ejected material could be followed to relatively large distances and \citet{yorke1995a} commented on the shaping the emerging planetary nebula. A leap forward in the quality of Eulerian grid-based \ac{CE} simulations was taken with the \ac{3D} hydrodynamic simulations of \cite{sandquist1998a}---reported in the last paper of the series on ``double-core evolution''. By abandoning analytic models for the drag force or the orbital decay, the modeling fidelity of physical processes drew level with the \ac{SPH} simulations conducted slightly earlier by \citet{terman1994a, terman1995a}, \citet{terman1996a} and \citet{rasio1996a}, (see Sect.~\ref{sect:sim_sph}). Therefore, the simulations of \citet{sandquist1998a} were the first to model \ac{CE} self-consistently in a \ac{3D} Eulerian grid-based approach. With their nested-grid approach similar to \citet{yorke1995a}, but extended to three spatial dimensions in Cartesian geometry, \citet{sandquist1998a} claimed to reach higher spatial resolution than the \ac{SPH} simulations. The nested-grid hydrodynamics code was based on that of \cite{burkert1993a} and employed a second-order finite-difference method to solve the equations of fluid dynamics. To determine the gravitational potential of the gas, the Poisson equation was solved on the coarsest grid with a particle-mesh algorithm. Two collisionless particles were used to model the core of the primary star and the companion. Their mutual gravitational interactions and their interactions with the gas were softened according to \citet{ruffert1993a}, with an adaptive reduction of the softening length as the core particles approached each other. The envelope was modeled with an ideal-gas equation of state in combination with radiation pressure. The setups followed the interactions of \ac{AGB} primary stars of $3$ and $5 \, \ensuremath{M_\odot}$ with main sequence companions of $0.4$ and $0.6 \, \ensuremath{M_\odot}$. \citet{sandquist1998a} found that about 20\% to 30\% of the envelope gas was ejected at the end of the simulations, but most of the mass, although largely removed from the volume of the original giants, remained marginally bound at larger distances. Because of limited spatial resolution, the core orbit did not completely settle to a final separation, and extrapolating to the further evolution, \citet{sandquist1998a} predicted full envelope removal for their setups with the $3 \, \ensuremath{M_\odot}$ primary, while for the more massive \ac{AGB} star they concluded that a merger of the cores may be possible. The most important result of \citet{sandquist1998a} is perhaps the first detailed description of the dynamical change in the envelope structure due to flows that are clearly not axisymmetric. Their resolution of the coupling between the core particles and the envelope gas allowed to identify for the first time spiral density waves that were generated in front of both stellar cores. \citet{sandquist1998a} concluded that these spiral shock waves were the primary mechanism for transporting the angular momentum released in the core inspiral outwards through the envelope \citep[but see also][]{rasio1996a}. With the same numerical approach, \citet{sandquist2000a} performed a systematic exploration of \ac{CEE} with \ac{RG} primaries of different total and core masses with companions of various masses. They found that such low-mass binary systems can survive \ac{CEE} provided that the total mass of the \ac{RG} primary is below $2 \, \ensuremath{M_\odot}$ and its degenerate helium core exceeds about $0.25 \, \ensuremath{M_\odot}$. The remnants of these interactions are associated with observed helium double degenerate systems, pre-cataclysmic variables and subdwarf B stars. With the same code, \cite{demarco2003a, demarco2003b} simulated the \ac{CE} phase between an \ac{AGB} primary star and companions of $0.1$ and $0.2 \, \ensuremath{M_\odot}$ as a potential origin of Wolf-Rayet central stars of planetary nebulae. \subsubsection{Modern Eulerian grid-based approaches} \label{sect:sim_eulerian_modern} Up to this point in the history of Eulerian grid-based \ac{CE} simulations, the treatment of fluid mechanics followed fluid-in-cell or finite-difference methods that are not commonly in use in modern astrophysical simulations any longer. The advantages of finite-volume techniques and high-resolution shock capturing schemes (see Sect.~\ref{sect:eulerian}) were introduced into the field of \ac{CE} simulations only relatively late compared with other astrophysical applications. This is surprising given the fact that conservation properties and resolution of shock waves are essential ingredients for capturing the dynamics of such events. Simulations performed after \citet{sandquist2000a} can be considered \emph{modern efforts}: Eulerian approaches stepped up using techniques such as finite-volume methods, Godunov schemes and \ac{AMR}. As such, they started to flank \ac{SPH} techniques in addressing the complications of the \ac{CE} interaction. The work of \citet[][already hinted at in \citealt{taam2006a}, who discussed some of the technical advantages]{ricker2008a} introduced the first modern Eulerian grid-based framework for numerical fluid dynamics to \ac{CE} simulations. The \textsc{flash} code \citep{fryxell2000a} features the piecewise-parabolic reconstruction method of \cite{colella1984a}. The use of \ac{AMR} techniques significantly improves flexibility in spatial resolution over fixed nested grids. This allows one to refine at shock fronts and in the vicinity of the stellar cores. As discussed in Sect.~\ref{sect:eulerian}, it is this technique, that ultimately renders Eulerian grid-based approaches to simulating \ac{CEE} competitive to alternative \ac{SPH} and moving mesh techniques that we discuss in Sects.~\ref{sect:sim_sph} and \ref{sect:sim_movingmesh}. However, even with \ac{AMR} it is impossible to resolve the $0.36 \, \ensuremath{M_\odot}$ core of the $1.05 \, \ensuremath{M_\odot}$ \ac{RG} primary star modeled by \citet{ricker2008a}---in particular in the view of the small time steps required by the \ac{CFL} condition (see Sect.~\ref{sect:comp_feasible}). They therefore represented the core of the primary as well as the $0.6 \, \ensuremath{M_\odot}$ companion by clouds of \num{2e5} particles each occupying a volume given by a length scale that exceeds the finest grid spacing by a factor of three. The particles are moved rigidly with their centers of mass. Their gravitational coupling is modeled with a cloud-in-cell interpolation and \citet{ricker2008a} argued that particle clouds avoid force anisotropy problems that would arise from using single particles in this approach. With their 8-level \ac{AMR} setup, \cite{ricker2008a} reached an effective resolution of $2048^3$ cells over the domain size. Transient motions in the setup of the primary star were damped for one dynamical timescale before the companion was added and the primary was set spinning with an angular velocity of 95\% of co-rotation with the orbit (that, if not previously stabilized, would have induced expansion). The simulation of \citet{ricker2008a} covered only a very short initial phase of \ac{CE} interaction---less than one orbit of the binary system is followed---but it confirmed the earlier finding of \citet{sandquist1998a} that the orbital decay was dominated by non-axisymmetric gravitational drag, which is one to two orders of magnitude larger than hydrodynamic drag. Moreover, \citet{ricker2008a} found a much faster orbital decay than predicted from the \ac{BHL} formalism. This was explained by the fact that within the \ac{BHL} framework, the predicted gravitational drag is similar to the hydrodynamic counterpart because it is only affected by the local formation of a wake. In \acp{CE}, however, this drag is increased by the gravitational forces over a larger volume of the entire envelope. Although \citet{ricker2008a} emphasized the shortcomings of their model in capturing accretion onto the companion caused by the lack of an inner boundary around it, they argued that the accretion rate onto the companion should be significantly smaller than expected from \ac{BHL} accretion arguments. \citet{ricker2012a} presented an update of their previous work, again employing the \textsc{flash} code, following the same system for somewhat longer times of the evolution, now covering five orbits. They explicitly mentioned the treatment of self-gravity in this simulation: the Poisson equation was solved with a multigrid method (see Sect.~\ref{sect:grav_alt}). The number of particles used to represent the stellar cores was increased to \num{2e5} for each cloud and 9 levels of \ac{AMR} were used. \cite{ricker2012a} reported an ejection of 25\% of the envelope's mass over the simulated time, higher than reported by \citet{sandquist2000a}, and possibly caused by a larger mass ratio between primary star and companion in their system. They further noted a rapid decrease of the eccentricity of the orbit and identified imprints of spiral shocks on the morphology of the envelope gas that was expelled preferentially close to the orbital plane. Again, they confirmed that gravitational drag dominates over hydrodynamic drag and emphasized that the \ac{BHL} prescription overestimates the accretion rate onto the companion. Recently, the same group, still using \textsc{flash}, has been attempting the simulation of \ac{CEE} in more massive systems. There is so far only one brief publication \citep{ricker2019b} presenting a simulation of \ac{CE} interaction with an $82\, \ensuremath{M_\odot}$ red supergiant primary star of radius of $2891 \, \ensuremath{R_\odot}$ at low metallicity, deriving from an $88 \, \ensuremath{M_\odot}$ main sequence star. The companion was a $35 \, \ensuremath{M_\odot}$ point particle, supposed to represent a black hole. This simulation included for the first time both the effects of partial ionization, via a suitable equation of state (see Sect.~\ref{sect:eos}) and the effects of radiation, via a single-group, flux-limited diffusion approximation. Interestingly, \citet{ricker2019b} concluded that envelope unbinding is not benefiting from recombination energy. Clearly, these simulations are critical to answer the question of whether double black hole binaries that merge under the emission of detectable gravitational waves can be formed via an isolated binary channel \citep{belczynski2016a}, but more work is needed to confirm the still very preliminary results of \cite{ricker2019b}. The next grid-based code to be exercised on the \ac{CE} problem was \textsc{enzo} \citep{bryan1995a}. This code was originally developed for cosmological simulations and \citet{passy2012a} adapted it to the stellar problem. Core and companion were modelled as point masses with the usual softening of the gravitational potentials (see Sect.~\ref{sect:gravsoft}). Self-gravity was implemented with a fast Fourier transform technique (see Sect.~\ref{sect:grav_alt}), while the gravity of the two point masses was treated analytically by adding the (softened) potential to that calculated for the gas. Starting out from a \ac{1D} stellar model, \citet{passy2012a} mapped a $0.88 \,\ensuremath{R_\odot}$, $100 \,\ensuremath{R_\odot}$ \ac{RGB} star with a core of $0.392 \, \ensuremath{M_\odot}$ onto a grid without any additional levels of refinement. Two resolutions with $[128]^3$ and $[256]^3$ cells were used. They carried out five \ac{CE} simulations for each resolution with companion masses of $0.1$, $0.15$, $0.3$, $0.6$ and $0.9 \,\ensuremath{M_\odot}$ and two additional low-resolution simulations to test the effects of the initial orbital separation and eccentricity. The companions were initialized on the stellar surface\footnote{For one simulation, an initial eccentricity was imposed by increasing slightly the initial separation of the two core particles.}. One finding of these simulations was the---perhaps expected---realization, that in none of them the entire \ac{CE} became unbound\footnote{\citet{passy2012a} do not list the fraction of envelope that is unbound but these values are very similar to those of their comparison simulations carried out with an \ac{SPH} code and presented in Sect.~\ref{sect:sim_sph}}. The range of final separations was ${\sim}\, 6$ to $30 \, \ensuremath{R_\odot}$, with wider final separations for more massive companions. The most important achievement of this study, however, was a direct comparison between Eulerian grid-based and \ac{SPH} (see Sect.~\ref{sect:sim_sph}) approaches to \ac{CE} simulations, which used the \textsc{snsph} code of \citet{fryer2006a}. This paper also raised some questions which remain unanswered to this day. The most pressing of them is whether the final separation of the stellar cores measured in the simulations is the actual post-\ac{CE} separation. The values determined from the simulations appeared to be on the high side of observations and it was therefore concluded that in post-dynamic inspiral phase the companion would migrate inwards. The \textsc{enzo} code was the basis for a number of follow-up papers, which, as an upgrade, used its \ac{AMR} capability and the adaptive particle-mesh solver of \citet{passy2014a}. \citet{iaconi2017a,iaconi2018a} modelled the same primary as \citet{passy2012a}, but this time fully investigated the effect of initial orbital separation. They concluded that starting the simulation at a wider separation (approximately that of the start of Roche lobe overflow) does result in a somewhat wider orbital separation due to the giant expanding before the fast inspiral rather than spinning up. They too carried out a comparison with an \ac{SPH} simulation (see Sect.~\ref{sect:sim_sph}), this time with the \textsc{phantom} code \citep{price2018a}. In a subsequent paper, \citet{iaconi2018a} compared results from setups identical to those of \citet{passy2012a} with simulations in which the primary was a more massive (${\sim} 2 \,\ensuremath{M_\odot}$) \ac{AGB} star. The reasoning was that if the envelope was more massive it would expand more reluctantly and allow the companion to sink deeper. This was expected to cause an increased transfer of orbital energy to the envelope. While companions did spiral in deeper, no substantial increase in unbound mass was observed: in both the original setup and in the simulations involving an \ac{AGB} primary star, the unbound mass fractions ranged between a few and about 15 percent. \citet{staff2016a} carried out \textsc{enzo}-based \ac{CE} simulations involving a ${\sim}\, 3 \, \ensuremath{M_\odot}$ \ac{AGB} star and companions between $0.6$ and $3.0 \, \ensuremath{M_\odot}$ with a range of eccentricities. Their aim was to understand systems such as the protoplanetary nebula OH~231.8+4.2. These had been suggested to result from a \ac{CE} interaction in an eccentric binary. On the one hand, these simulations were used primarily as platforms for a series of analytical discussions on the ability of the companion to launch a jet \emph{before} the actual \ac{CE} interaction, that would result in the observed nebular energetics. On the other hand, these simulations were among the few that started out with high eccentricities in the initial system, \ac{AGB} primary stars, and stellar masses above the common ${\sim}\, 1 \, \ensuremath{M_\odot}$. With the relatively low resolution achieved in these simulations, however, it remained difficult to put the results appropriately into context. Most of the envelope mass remained bound (again, between a few and about 15 percent of the material was unbound) and the separation still ranged on the wide side compared to observations. Moreover, the study concluded that if mass transfer takes place at periastron passage, the orbital elements are altered and it is likely that these orbital changes lead to a \ac{CE} within a short period of time. This means that it is unlikely that objects like OH231.8+4.2 could be formed by repeated jet episodes that take place during periastron passage. In a companion paper, \citep{staff2016b} used the same $3 \, \ensuremath{M_\odot}$ \ac{AGB} primary star as well as an \ac{RGB} star of similar mass to determine the outcome of planetary intrusions into the envelopes of giants. Somewhat unsurprisingly the conclusion was that planets would inspiral and merge with the core within a decade (\ac{RGB} star) to a century (\ac{AGB} star). Considerable angular momentum would be added the the envelopes of the giants which would expand somewhat and spin up to values commensurate with the fastest rotating giant stars observed by \citet{demedeiros1996a}. \begin{figure} \centering \includegraphics[width = \textwidth]{fig15.pdf} \caption{\ac{CEE} simulations with an \ac{AGB} (top panels) and an \ac{RGB} (bottom panels) primary star. Shown are slices after ten orbits of the core binary system through the orbital plane(left) and perpendicular to it in density (left panels) and total energy (right panels, where blue is bound gas while red is unbound). Figure from \citet{chamandy2020a}} \label{fig:Chamandy+20-Fig6b} \end{figure} Also using the version of \textsc{enzo} adapted by \citet{passy2012a}, \citet{shiber2019a} carried out a simulation using the same star used by \citet{passy2012a}. This time, however, the effect of jets was explored, that are potentially launched by the companion throughout the inspiral. In particular, the focus was on whether such jets enhance envelope unbinding. The jets were not self-consistently simulated, but were instead launched according to analytically derived quantities such as mass loss rate, launch speed and opening angle. The outcome of the simulation was not dramatically different from the equivalent simulation without jets: the final separation was somewhat wider and additional envelope gas was unbound (the unbound mass increased from $\sim\,$10\% without jets to $\sim\,$30\% with jets). This indicated that while jets may aid envelope ejection, it seems unlikely that they can fully explain it. \citet{schreier2019a} explore the effect of jets in \ac{CEE} of a triple system: a tight binary system is placed into the envelope of a $4 \, \ensuremath{M_\odot}$ \ac{AGB} star with $100 \, \ensuremath{R_\odot}$. The inner $5 \, \ensuremath{R_\odot}$ are replaced with a sphere of constant density, pressure, and temperature. The binary system is not resolved; one of its stars is assumed to accrete material and to launch two jets in opposite directions with an inclination relative to the orbital plane of the binary and the core of the \ac{AGB} star. In the simulation, the jets are injected with an inclination angle of $45^\circ$ at the location of the binary system. The simulation is carried out with the \textsc{Pluto} code \citep{mignone2012a} on a cubical domain with $400 \, \ensuremath{R_\odot}$ side length covered with 48 cells and three to four levels of \ac{AMR}. Self-gravity is not accounted for in the setup: gravitational effects of the tight binary system and of the deformed envelope are ignored. \citet{schreier2019a} observe vortices and associated density fluctuations perturbing the envelope structure and discuss implications for dust formation and the shaping of ``messy'' \acp{PN}. The follow-up studies of \citet{schreier2021a} and \citet{schreier2023a} were carried out with the \textsc{Flash} code \citep{fryxell2000a} in similar setups but with a more massive primary star of a zero-age main sequence mass of $15 \, \ensuremath{M_\odot}$ evolved to a red supergiant stage ($M = 12.5 \, \ensuremath{M_\odot}$, $R = 881 \, \ensuremath{R_\odot}$). To avoid prohibitively small time steps in the simulation, the inner 20\% of the stellar radius are replaced by an inert core. The \ac{AMR} capabilities of the \textsc{Flash} code are used. \citet{schreier2021a} assume a neutron star companion that passes through the envelope of the giant on a highly eccentric orbit---an event \cite{gilkis2019a} call a ``common-envelope jets supernova impostor''. The neutron star is modeled as a point particle and the jets are launched artificially ``by hand''. Again, neither gravity of the neutron star nor self-gravity of the envelope are included in the model such that no gravitational drag acts on the companion. Only one orbit of it is simulated. A complicated clumpy outflow morphology is detected and the luminosity of the event is estimated to place it into the regime of ``gap transients'' between classical novae and supernovae. \cite{schreier2023a} explore the deposition of angular momentum into the envelope due to jets that are launched perpendicular to the orbit and due to tilted jets (motivated by the triple scenario where the companion neutron star or black hole is part of a tight binary system). Another set of grid-based \ac{CE} simulations was carried out with the \ac{AMR} code \textsc{AstroBEAR} \citep{carroll2013a}. A few studies have been published so far, concentrating on the analysis of two primary stellar structures and a range of companions. The two structures are an \ac{RGB} and an \ac{AGB} star deriving from a $2 \, \ensuremath{M_\odot}$ main sequence star, with radii of $49 \,\ensuremath{R_\odot}$ and $122\,\ensuremath{R_\odot}$, respectively \citep{chamandy2018a, chamandy2020a}. All simulations initialized the companion approximately at the stellar surfaces. \citet{chamandy2018a} benchmarked \textsc{AstroBEAR} against a similar simulation carried out with the moving mesh code \textsc{arepo} \citep[][see Sect.~\ref{sect:sim_movingmesh}]{ohlmann2016a}. They also investigated the amount of accretion that would likely take place onto the companion---a very important topic, particularly in the massive-star regime when massive companions may generate large amounts of feedback energy. They concluded that the amount of accretion cannot be estimated just using control surfaces around the companion because a high-pressure pseudo-atmosphere that settles around the point mass companion and reduces the accretion. \citet{chamandy2018a} suggested that the introduction of mass ``disappearance'' likely results in a more realistic outcome and that high accretion rates (${\sim} \, 1 \,\ensuremath{M_\odot} \, \mathrm{yr}^{-1}$) could exist during the short-lived inspiral phase. In the simulation, this was implemented with a subgrid-scale accretion model. Following \citet{krumholz2004a}, the companion was represented by a sink particle in one of the runs. The simulations were also used to draw a comparison between the gravitational drag force measured in the simulation and what would be derived using the analytical approximations of \citet{macleod2017b}. \citet{chamandy2018a} concluded that the simulated force was similar to the analytical prescription only early on and until mid inspiral, but diverges later with the simulated force being much smaller than the analytical approximation. \citet{chamandy2020a} were first to model \ac{CEE} of a low-mass \ac{AGB} star with a ${\sim} \, 1 \, \ensuremath{M_\odot}$ companion. The conclusions that they could draw from a comparison of their \ac{RGB} and \ac{AGB} simulations was that the two were remarkably similar (see Fig.~\ref{fig:Chamandy+20-Fig6b}). However, both simulations were started with the companion at the surface, not accounting for the redistribution of gas that takes place when the simulation is started at the time of Roche lobe overflow. Only a fraction of the envelope mass was unbound during the simulated time, but \cite{chamandy2020a} estimated a full envelope ejection over 10 years if the rate of mass unbinding measured in the simulations stayed constant. \citet{zou2022a} modified the setup of \citet{chamandy2018a} that, with a $2\, \ensuremath{M_\odot}$ \ac{RG} primary star and a $1\, \ensuremath{M_\odot}$ or $0.5 \, \ensuremath{M_\odot}$ companion, was similar in the parameters and the treatment of the \ac{RG} core to that of \citet{ohlmann2016a} but used the \textsc{AstroBEAR} code. They included a jet launched via a subgrid model from the companion. This model injects mass at a chosen constant rate with a certain velocity perpendicular to the orbital plane into a prescribed opening angle. Comparing this model to simulations without jets, the influence of a potential jet on orbital evolution and the morphology and unbinding of the envelope is explored and the parameters of the jet model are tested. The jets were found to be choked in the envelope and transferred additional energy onto it so that the unbound mass was increased by 10\% over the ten simulated orbits compared to simulations without jets. Based on this result, \citet{zou2022a} expect that jets launched from main sequence or white dwarf companions are unlikely to dominate envelope unbinding. Except for the study of \citet{ricker2019b}, none of ``modern'' Eulerian grid-based simulations of \ac{CEE} accounted for ionization effects in the envelope material. None of them achieved a successful envelope ejection over the simulated time; the unbound mass fraction typically stayed below $\sim$20\%. \subsubsection{SPH approaches} \label{sect:sim_sph} In logical continuation of previous \ac{1D} models, early Eulerian grid-based approaches to simulating \ac{CEE} (see Sect.~\ref{sect:sim_eulerian_pioneering}) modeled the interaction of the companion with the envelope by explicitly imposing a drag force on it. \ac{SPH} simulations, in contrast, from the start relied on a self-consistent treatment of this interaction by implementing self-gravity. Although with their limited resolution simulations carried out in the 1980s and 1990s failed to converge in reproducing the effect, with increasing computer power this approach became gradually more realistic. In this sense, the development of \ac{SPH} methods for \ac{CE} simulations was not subject to breaks and breakthroughs in the modeling technique itself---although an efficient parallelization of the \ac{SPH} framework to distributed memory machines is not trivial and was achieved only in the early-to-mid 2000s \citep[e.g.][]{springel2001a, springel2005a, fryer2006a}. It paved the way to increasing the resolution of the simulations, but still today not all \ac{SPH}-based \ac{CE} simulations are carried out with MPI parallelization. The application of \ac{SPH} for simulating the onset of \ac{CEE} was pioneered by \cite{dekool1987a}. He modelled the interaction of a $11 \, \ensuremath{M_\odot}$ giant with a $4 \, \ensuremath{M_\odot}$ companion star. Only \num{600} particles were used to represent the envelope of the primary star assuming a polytropic equation of state while its core and the companion were modeled by single particles. The setup was obtained from relaxing the stellar envelope to hydrostatic equilibrium and---for the initial binary setup---by slowly reducing the separation between the interacting stars. This setup procedure is largely followed in \ac{SPH}-based \ac{CE} simulations to this day. \citet{livio1988a} simulated \ac{CEE} in a hybrid ``particles in cell'' (PIC) discretization of the equations of fluid dynamics, which combines a pseudo-particle approach with an Eulerian grid and thus differs from the \ac{SPH} formalism. The increase of computational power and improvements in numerical methods---most notably the introduction of a hierarchical tree algorithm for calculating self-gravity---allowed to conduct more detailed \ac{3D} \ac{CE} simulations with \ac{SPH}. For the first time, and in contrast to contemporary grid-based Eulerian simulations (see Sect.~\ref{sect:sim_eulerian_pioneering}), such simulations were able to follow the inspiral of the companion into a giant primary with the gravitational interaction between the cores and the envelope gas captured by the model instead of using an analytic prescription for a drag force. \citet{terman1994a} discretized the co-rotating envelope of a $4.67 \,\ensuremath{M_\odot}$ \ac{RG} primary mapped from a polytropic model using \num{10000} \ac{SPH}-particles. After random initial placement of the particles, frictional damping established \ac{HSE}. The core of the primary star as well as the $0.94 \, \ensuremath{M_\odot}$ companion were represented by single massive collisionless particles. A fictitious drag force was applied only initially to bring the binary system into the \ac{CE} stage---the actual \ac{CEE} was followed self-consistently with the drag force resulting from the modeled interaction. With this setup, \cite{terman1994a} demonstrated that gravitational tidal torques cause rapid orbital decay of the core binary after the onset of \ac{CEE}. The evolution of the system was followed for $\SI{0.6}{\year}$ when the orbital separation settles to about $6 \, \ensuremath{R_\odot}$ because of a spin-up of the gas in the vicinity of the cores approaching co-rotation. This simulation exploited the capability of \ac{SPH}-based approaches to follow the inspiral phase over many orbits. It was eventually terminated because the gravitational softening of the core particles became larger than their separation rendering the model nonphysical. Only about 13\% of \ac{RG} envelope mass was ejected to this point. Based on their simulations, \cite{terman1994a} discussed the importance of the \ac{3D} response of the envelope to the motion of the binary composed of the giant's core and the companion, pointing out deficiencies of models that assumed an inspiral of a companion star into a fixed core--envelope primary structure. \citet{terman1995a} extended their numerical approach to simulating the inspiral of a $1.4 \, \ensuremath{M_\odot}$ neutron star into massive primaries of $16$ and $24 \, \ensuremath{M_\odot}$ in various evolutionary stages. These simulations exploited the efficiency of the \ac{SPH} approach to simulate \ac{CEE}, although the achieved resolution was insufficient to accurately separate the core--envelope structure of the primary stars, which, with the given parameters, remains a challenge even for current simulations. For some of the considered systems, a mass ejection efficiency of $\sim$30\%--40\% was reported. \citet{terman1995a} pointed out that the survival of the core binary, as opposed to a merger of the neutron star with the primary's core potentially forming a Thorne--{\.Z}ytkov object \citep{thorne1975a}, depends on the structure and evolutionary stage of the non-compact star. \citet{terman1996a} relaxed their assumption of a polytropic equation of state to include both gas and radiation pressure in simulations of systems with a $5 \, \ensuremath{M_\odot}$ \ac{RG} and companions with $0.5$ and $1.0 \, \ensuremath{M_\odot}$. Again, \num{10000} \ac{SPH}-particles were used for modeling the \ac{RG} envelope, which, in this suite of simulations, was set up as spherical and non-rotating. The size of the cores was reduced with respect to the simulations of \cite{terman1994a}, allowing the simulations to follow the inspiral for longer, which resulted in the ejection of up to 70\% of the envelope gas. \citet{rasio1996a} used up to \num{50000} particles to follow the onset of the unstable mass transfer and initial inspiral of a $0.7 \, \ensuremath{M_\odot}$ main sequence star into a \ac{RG} of $4 \, \ensuremath{M_\odot}$ until a quasi-static \ac{CE} had formed. They pioneered the construction of a rotationally synchronized binary system in \ac{HSE} by means of a relaxation and damping procedure---in contrast to \cite{terman1996a} and without the need of applying an initial fictitious drag force as in \cite{terman1994a}. The core of the primary star and the secondary were modeled as point particles and their gravitational potentials were softened over a length comparable to the \ac{SPH} smoothing length of the innermost particles, typically a hundredth of the radius of the \ac{RG} primary \citep[which is similar to what][used]{terman1996a}. Under this assumption, the core of the primary star is much larger than in reality. In their simulation, \citet{rasio1996a} identified a co-rotating region of gas around the central binary and found indication for the onset of convection in the envelope in agreement with the predictions of \citet{meyer1979a}. Only about 10\% of the envelope material was unbound---most likely because of the establishment of co-rotation in late stages of the evolution as opposed to the findings of \citet{terman1996a} whose models eject a substantial fraction of the envelope. \citet{rasio1996a} attributed this discrepancy to differences in the spatial resolution, but as neither the numbers of particles nor the sizes of the core models differ significantly, this interpretation appears questionable. In their paper comparing \ac{CE} simulations carried out with a grid-based Eulerian code (see Sect.~\ref{sect:sim_eulerian_modern}) and \ac{SPH}, \citet{passy2012a} employed the \textsc{snsph} code of \citet{fryer2006a}. It adopts a distributed-memory parallelization \citep{fryer2006a} and therefore allowed to conduct simulations with enhanced resolution. \textsc{snsph} uses a special tree-based method \citep[a parallel hashed oct-tree,][]{warren1993a} to calculate gravitational accelerations. As in their grid-based counterpart simulations, \citet{passy2012a} followed the interaction of a non-rotating $0.88 \, \ensuremath{M_\odot}$ \ac{RG} primary star of $83 \, \ensuremath{R_\odot}$ with companions of masses between $0.9$ and $0.1 \, \ensuremath{M_\odot}$ that were initially placed at the primary's surface in a circular orbit and were modeled as collisionless particles. These simulations were set up as close as possible to the counterpart grid-based \textsc{enzo} simulations (see Sect.~\ref{sect:sim_eulerian_modern}). The envelope, modeled with an ideal-gas equation of state, was represented by an unprecedented number of \num{500000} \ac{SPH}-particles, that were initially placed with a weighted Voronoi tessellation. In contrast to other setups, the core of the giant primary star was treated as a massive \ac{SPH} particle of $0.392 \, \ensuremath{M_\odot}$ and not as a collisionless particle, such that its pressure stabilized the envelope against gravitational collapse. It was placed at the center, embedded in a region with \ac{SPH}-particles, such that the profile of density connected smoothly at the core-envelope boundary, which was located at twice the smoothing length of the core particle, i.e.\ $0.2 \, \ensuremath{R_\odot}$. Therefore, the interaction of the core with the envelope gas was better resolved than in any of the previous \ac{SPH} simulations of \ac{CEE}. The simulations of \citet{passy2012a} followed the evolution until the orbital separation and the mass of the unbound envelope gas saturated. The amount of envelope gas ejected during the simulation varied with the mass ratio and was expelled mostly close to the orbital plane. It remained below 10\% in all cases and the final orbital separations between the core particles were systematically larger than those found in observations of post-\ac{CE} systems. \citet{passy2012a} discussed additional physical effects that may increase the envelope ejection efficiency. They emphasized the capability of the \ac{SPH} method to model the accumulation of gas around the companion star---a direct implication of the Lagrangian nature of the scheme in which the spatial resolution automatically adapts to the mass distribution. The next group to simulate \ac{CEE} with \ac{SPH} codes were \citet{nandez2014a}, who modelled the interaction in system V1309~Sco (a $1.5 \, \ensuremath{M_\odot}$ subgiant and a ${\sim}\, 0.15 \, \ensuremath{M_\odot}$ main sequence star; \citealp{tylenda2011a}), using the \ac{SPH} code \textsc{starsmasher} \citep{lombardi2011a}. In this simulation, the two stars were spatially resolved because of their relatively similar sizes (with particle numbers ranging from \num{20000} to \num{200000} for the primary star and from \num{2000} to \num{19000} for the companion), and the interaction lead to a merger. V1309~Sco is a particular system and perhaps not a clear \ac{CE} case (see Sect.~\ref{ssec:terminology}). A more traditional \ac{CE} interaction was later simulated by the same group \citep{nandez2015a} with the goal of modeling the double white dwarf system WD 1001+364. For this purpose, the core of the \ac{RG} primary was selected to be $0.32 \, \ensuremath{M_\odot}$ (slightly larger than the value of the original \ac{1D} stellar profile in order to match the envelope structure) and represented by a point mass interacting only gravitationally. The $0.36 \, \ensuremath{M_\odot}$ companion was also modeled as a point particle. Various masses between $0.668$ and $1.481 \,\ensuremath{M_\odot}$ were assumed for the \ac{RG} envelope and resolved with \num{100000} particles; one run was carried out with twice this resolution. \citet{nandez2015a} were the first to model the effect of recombination processes in a \ac{3D} \ac{CE} simulation. For that purpose, they adapted the \textsc{mesa} equation of state \citep{paxton2011a}, that accounts for changes in the ionization structure by implementing the \textsc{opal} tables, see Sect.~\ref{sect:eos}. They found that while simulations of the basic gravo-hydrodynamic model removed only about 50\% of the envelope mass, complete envelope ejection could be achieved when assuming the released recombination energy to thermalize locally. The same approach was used by \citet{nandez2016a} for a range of primary \ac{RG} stars with masses of $1.2$ to $1.8 \, \ensuremath{M_\odot}$ and companions with masses of $0.32$ to $0.40 \,\ensuremath{M_\odot}$ meant to be white dwarfs and modelled as point particles that interact only gravitationally, as did the cores of the \ac{RG} primaries. The resolution of \num{100000} \ac{SPH} particles was similar to the production runs in \citet{nandez2014a}. Almost complete mass ejection was obtained thanks to their use of the tabulated equation of state that includes recombination energy. Their simulations were then used by \citet{ivanova2016a} to infer a number of parametrizations to be used, e.g., in population synthesis studies. \citet{iaconi2017a} carried out a simulation of \ac{CE} interaction using the same setup as \citet{passy2012a}, but with a wider initial separation between the primary star and the $0.6 \, \ensuremath{M_\odot}$ companion. They used the shared-memory (OpenMP) parallelized \ac{SPH} code \textsc{phantom} of \citet{price2018a}. This time, both the core of the primary and the companion were modeled as collisionless massive single particles. For gravitational softening, the prescription of \citet{ruffert1993a} was applied instead of the previously used formulation of \citet{monaghan1992a}. The envelope was represented by one million particles. Both the obtained post-\ac{CE} orbital separation and the amount of unbound gas ($\sim$16\% of the initial envelope material) were found to be slightly larger than those of \cite{passy2012a}. \citet{reichardt2019a} followed up on these studies and simulated \ac{CEE} with the \textsc{phantom} code again in a system similar to that of \citet{passy2012a}. Their resolution varied between \num{8e4} and \num{1.1e6} \ac{SPH} particles representing the envelope of the \ac{RG} primary star, which for one of their simulations was set up to co-rotate with the binary system. In contrast to previous simulations, the initial binary separation was chosen such that the \ac{RG} primary star just filled its Roche lobe and mass transfer started immediately. This way, \citet{reichardt2019a} extended the simulation to the time before the inspiral, which was possible thanks to the excellent angular momentum conservation of \ac{SPH}-based simulations (see Sect.~\ref{sect:conservation}). While the duration of the pre-inspiral evolution was found to be resolution-dependent, this simulation paves the way for the study of the impact of the initial conditions on the \ac{CEE}. Moreover, mass lost over the $L_2$ and $L_3$ Lagrange points of the system before the inspiral was found to remain bound and to potentially form a circumbinary disk. This disk was destroyed in the subsequent \ac{CE} ejection, but the authors speculated about its survival for other system parameters. The measured drag force in the \ac{CE} inspiral phase was consistent with analytical models, but only a small fraction of the envelope material (about 10\% to 30\%) was ejected---confirming previous simulations that indicated less unbound mass for increasing numerical resolution. \citet{reichardt2020a} equipped the \textsc{phantom} \ac{SPH} code with an equation of state that can account for changes of the ionization structure of the envelope material. With this modification and assuming local thermalization of the released recombination energy, they carried out two simulations with \ac{RG} primary stars of $0.88 \, \ensuremath{M_\odot}$ and $1.8 \, \ensuremath{M_\odot}$ and companions of $0.6 \, \ensuremath{M_\odot}$ and $0.36 \, \ensuremath{M_\odot}$, respectively. The latter configuration was the same as one of \citet{nandez2016a}, who claim complete envelope ejection for this case. In agreement with \citet{nandez2016a}, \citet{reichardt2020a} found that including recombination effects leads to a dramatic increase in envelope ejection. The system with the less massive primary star achieved complete envelope ejection, promoted by the release of both helium and hydrogen recombination energy. The model with the more massive primary, unbound more mass, seemingly at the hand of helium recombination energy (see Fig.~\ref{fig:Reichardt+20_Fig5}), but the system did not achieve complete envelope ejection, contrary to \citet{nandez2016a}. The cause for this discrepancy is the definition of unbound gas (see also Sect.~\ref{sect:ionization}): When including recombination energy in the definition, effectively the entire envelope becomes unbound. If instead only the thermal energy is accounted for, the conclusion is that no more than 37\% of the envelope are unbound. Moreover, \citet{reichardt2020a} discussed that while the hydrogen recombination energy may be more readily lost into space, helium recombination energy is much less prone to be radiated away, because it takes place deeper in the envelope, and it is therefore more likely to partake in the envelope ejection. Finally, they pointed out that the formation of dust in the expanded envelope is extremely likely. This could change the game-plan for the interaction. \citet{reichardt2020a} compared their simulations accounting for recombination energy release and assuming its local thermalization to counterparts carried out with an ideal-gas equation of state (that do not account for these effects). They found that the final orbital separation was almost unaffected by the equation of state and by the success of envelope ejection. \begin{figure} \centering \includegraphics[width = \textwidth]{fig16.pdf} \caption{Correlation between unbinding of gas and recombination zones in the simulations of \citet{reichardt2020a} with a $0.88 \, \ensuremath{M_\odot}$ (left) and a $1.8 \,\ensuremath{M_\odot}$ \ac{RGB} (right). The locations and times at which \ac{SPH} particles became permanently unbound are plotted in black. The coloured zones represent the partially ionized regions of H and He gas. The black line indicates the distance between the stellar cores. Figure from \cite{reichardt2020a}} \label{fig:Reichardt+20_Fig5} \end{figure} An efficient \ac{SPH} code with parallelization on distributed memory architectures is \textsc{gadget2} of \citet{springel2005a}. It was originally developed for cosmological simulations and has been applied to simulating \ac{CE} interaction. \cite{glanz2018a} pointed out the potential importance of dust formation for \ac{CEE} based on a simulation with \textsc{gadget2}. They set up a solar-like star and evolved it to the \ac{RG} stage ($R_\star = 83 \, \ensuremath{R_\odot}$, core mass $M_\mathrm{core} = 0.39 \, \ensuremath{M_\odot}$) with the \textsc{mesa} code. The \ac{CEE} with a main sequence companion was then simulated with \textsc{gadget2}, but \citet{glanz2018a} give little details about the setup and the numerical treatment. The structure resulting from the \ac{CE} simulation was compared to the structure of an \ac{AGB} star and it was concluded that large parts of the envelope meet the conditions for dust condensation. A similar approach was taken by \citet{glanz2021a} to model \ac{CEE} in binaries with eccentricities of $0 \le e \le 0.95$. Primary stars of $1\, \ensuremath{M_\odot}$, $4\, \ensuremath{M_\odot}$, and $8\, \ensuremath{M_\odot}$ were evolved to the \ac{RGB} stage with \textsc{mesa} (core masses of $0.39\, \ensuremath{M_\odot}$, $0.48\, \ensuremath{M_\odot}$ and $1.03\, \ensuremath{M_\odot}$, respectively), the intermediate-mass model was in addition followed to the \ac{AGB} stage. The stellar envelopes were mapped to distributions of \num{250000} \ac{SPH}-particles assuming an ideal-gas equation of state, while the cores were represented by point particles. For the mapping, the \textsc{amuse} framework of \citet{portegies2009a} was used and the obtained configuration was relaxed in a damping procedure \citep{glanz2021b}. Companions of $0.6 \, \ensuremath{M_\odot}$ were added with varying eccentricities to the two lower mass primary star models, while for the high mass model a companion of $2 \, \ensuremath{M_\odot}$ was chosen. These were modeled as point particles interacting only via gravity. In their simulations, \citet{glanz2021a} found that that the initial eccentricities only partially circularize. Because of the closer initial approach of the cores, more mass was unbound in highly eccentric systems compared to circular setups. However, no matter what setup was used the unbound mass was between $\sim$5\% to $\sim$25\%, typical values for all simulations that use an ideal-gas equation of state. \citet{glanz2021b} later used similar tools to simulate \ac{CEE} in a triple system in the ``circumstellar'' case, where a compact binary system (corresponding to the inner binary in a hierarchical triple) orbits in the envelope of a giant. In addition to the construction of the primary star models with \textsc{mesa} and the mapping and relaxation in the \textsc{gadget2} computational domain, however, they modeled the dynamics of the binary companion system inside the potential of the primary giant star with the N-body code \textsc{huayno} \citep{pelupessy2012a}, likewise integrated in the \textsc{amuse} framework of \citet{portegies2009a}. As models for primary stars, a $2 \, \ensuremath{M_\odot}$ and an $8\, \ensuremath{M_\odot}$ star were evolved to the \ac{RG} stage (core masses of $0.36 \, \ensuremath{M_\odot}$ and $1.03 \, \ensuremath{M_\odot}$, respectively). For mapping these models into the \ac{SPH} code \textsc{gadget2}, resolution tests were carried out with \num{100000}, \num{250000}, and \num{500000} \ac{SPH}-particles representing the envelope of the giant primary star. For the production runs, \cite{glanz2021b} settled to a resolution of \num{250000} particles. The masses of the objects in the close binary companion system were set to $0.6 \, \ensuremath{M_\odot}$ and $0.4 \, \ensuremath{M_\odot}$ for the lower mass primary star and to $1\, \ensuremath{M_\odot}$ for both objects when interacting with the more massive primary star. For the fate of this compact binary system, two cases were observed: a merger inside the envelope of the primary star and a disruption which---together with the core of the primary star---leads to chaotic triple dynamics. In the latter case, typically one of the former close-binary components was found to eventually merge with the core of the primary star, while the second component is ejected or continues ``classical'' binary \ac{CEE}. The effect of a compact binary companion system in the case of triple-\ac{CE} interaction was a slower inspiral and an increased mass ejection---attributed to the extraction of energy and momentum from the compact binary companion. Whereas comparison simulations with classical binary \ac{CE} setups resulted in ejecting about 10\% of the envelope mass (a typical value for simulations assuming an ideal-gas equation of state and not considering ionization effects), the triple systems unbound 11\% to 28\% of the envelope mass. \citet{glanz2021b} commented about the imprints of the altered triple dynamics on the morphology of the ejected material. Recently, \citet{lau2022a} carried out an \ac{SPH} simulation using \textsc{phantom} of a $12 \,\ensuremath{M_\odot}$ star and companions of $3.0 \, \ensuremath{M_\odot}$ and $1.26 \,\ensuremath{M_\odot}$, located at an orbital separation such that the primary just filled its Roche lobe (for their lower-resolved simulations with 50\,000 and 500\,000 \ac{SPH} particles) or overfilled the Roche lobe by 25\% (for their higher-resolution simulations, two million particles, which would have been unfeasibly long if started farther apart). These simulations were among the first modern attempts to model \ac{CE} interaction with a massive primary star. Comparisons were carried out using three equations of state: an ideal gas, an ideal gas plus radiation, and a ``full'' equation of state that included the effects of recombination. The final separation of the binary was of the order of $30$--$44 \,\ensuremath{R_\odot}$ (for the $3.0 \,\ensuremath{M_\odot}$ companion; the other companion sinks below the sum of the softening lengths of the core and companion, where the interaction is not reliable). Compared to simulations with a simple ideal-gas equation of state, including radiation pressure resulted in separations larger by about 10\% and accounting for recombination energy enlarged the final separations by another $\sim$20\%. The highest-resolution simulations with the $3.0 \,\ensuremath{M_\odot}$ companion unbound 18\%, 28\% and 60\% of the envelope for the ideal gas, ideal gas plus radiation, and full equations of state, respectively (using a criterion that accounts for mechanical and thermal energy, see Sects.~\ref{ssec:why_is_CE_ejection_hard_to_achieve} and \ref{sect:ionization}). The measurement of the unbound mass was taken at a particular point after the inspiral, not at the end of the simulation. The additional unbound gas in the case of the a full equation of state derived from the thermalization of the helium recombination energy, which, even if radiation transport were included, was released in the deep layers and is unlikely to escape. For the full equation of state, three quarters of the envelope were unbound by the end of the simulation and mass unbinding still continued at 0.2~\ensuremath{M_\odot}~yr$^{-1}$, demonstrating that the envelope was likely to become completely unbound. Finally, \citet{lau2022b} studied the effects of hydrogen, helium and molecular hydrogen recombination energy on the same structure as that investigated by \citet{lau2022a}. They concluded that helium recombination energy alone, already unbinds 30\% more gas than an ideal-gas equation of state and that the delivery of that energy is so deep in the envelope that it is highly likely that the entire payload can be thermalized and eventually converted to work. Somewhat more surprisingly, this is also so for hydrogen recombination energy. Only a fraction of the hydrogen recombination energy is needed to unbind the envelope and the delivery depth is such that, once again, we would conclude that it would be mostly thermalized locally and not escape. For a 12~\ensuremath{M_\odot}\ common envelope it is therefore to be concluded that recombination energy may well help unbind effectively the entire envelope. \subsubsection{Moving-mesh simulations of the common-envelope interaction} \label{sect:sim_movingmesh} In Sect.~\ref{sssec:moving_mesh_approaches} we have described the moving-mesh approach to hydrodynamical simulations. Based on its implementation in the \textsc{arepo} code of \citet{springel2010a}, \cite{ohlmann2016a} simulated the dynamical inspiral of a $1 \, \ensuremath{M_\odot}$ companion into a \ac{RGB} primary star of $2 \, \ensuremath{M_\odot}$ with a $0.4 \, \ensuremath{M_\odot}$ core. This rather standard setup was chosen because the scale problems discussed in Sect.~\ref{sect:challenges_physical} are less pronounced with a \ac{RG} primary than, e.g., with an \ac{AGB} star. The simulation is illustrated in Fig.~\ref{fig:ohlmann2016}. It demonstrated the advantages of using a moving mesh approach. The method allowed to follow the evolution for many orbits extending over the initial plunge-in phase into a regime where the orbital separation of the cores changed only very slightly. This was not only enabled by the efficiency of the method but also by its excellent conservation of angular momentum and energy lending credibility to the results even in late stages of the evolution. As discussed in see Sect.~\ref{sect:conservation}, this advantage derived from the almost Lagrangian nature of the scheme. At the same time, the Godunov approach to compute fluxes in the underlying finite-volume discretization facilitated high spatial resolution and captured hydrodynamical instabilities better than \ac{SPH} methods. This allowed the authors to detect large-scale flow instabilities between adjacent layers of the spiral shock after about $20$ orbits that were not noticed in earlier simulations. This effect ultimately lead to turbulent convection in the envelope. The simulation of \citet{ohlmann2016a}, however, failed to unbind the envelope. Only about 8\% of the material was ejected. This failure of the gravo-hydrodynamic model triggered the inclusion of additional effects into moving-mesh \ac{CE} simulations. \begin{figure} \includegraphics[width=\textwidth]{fig17.pdf} \caption{Time series of density cuts through the orbital plane during the inspiral simulated with the moving-mesh code \textsc{arepo}. The positions of the core of the \ac{RG} primary star and the companion are marked by a ``$+$'' and a ``$\times$'', respectively. The inset in the last panel shows the central region with a diameter of about $20 \, \ensuremath{R_\odot}$. Again, density is color-coded and ranges from $10^{-6}$ to $10^{-3}\, \mathrm{g}\,\mathrm{cm}^{-3}$. Figure from \citet{ohlmann2016a}.} \label{fig:ohlmann2016} \end{figure} The first \ac{MHD} simulation of \ac{CEE} was carried out by \citet{ohlmann2016a}. It showed that tiny initial magnetic fields are strongly amplified in the evolution. While previous studies speculated about dynamo processes in the differentially rotating envelope \citep{regos1995a}, magnetic field generation in an accretion disk formed from a tidally disrupted companion \citep{nordhaus2011a}, or in the outer layers of the degenerate core \citep{wickramasinghe2014a}, the simulation of \cite{ohlmann2016a} allowed to settle the issue by a direct simulation of the entire \ac{CE} structure. Three stages of magnetic field amplification could be distinguished (see Fig.~\ref{fig:magamp}): \begin{enumerate}[(i)] \item In the initial plunge-in of the companion into the primary's envelope, a fast amplification of the magnetic field in the forming accretion stream around the companion was observed. \item Once this accretion stream had been established, the amplification slowed down. \item Eventually, the magnetic field saturated and was dispersed over the envelope. \end{enumerate} The magnetic field amplification in the accretion flow was found to be consistent with the action of the magnetorotational instability (MRI, \citealp{balbus1991a}, \citealp{balbus1995a}). The observed generation of strong magnetic fields during the dynamical \ac{CE} phase is an interesting effect and may contribute to shaping the expected formation of a planetary nebula. However, the resulting fields are too weak to have a dynamical impact on the \ac{CEE} itself or to alter the transport of angular momentum significantly. In the setup of \citet{ohlmann2016b}, the envelope-mass loss exceeded that in non-MHD simulations with identical parameters only by a few percent. \begin{figure} \includegraphics[width=\textwidth]{fig18.pdf} \caption{Magnetic field energy in the \ac{CE} simulation of \citet{ohlmann2016b}. The three stages of the amplification process are marked in panel (a). Panel (c) zooms in on the fast amplification phase (i), the slow amplification phase (ii) is shown in panel (d) and the phase of saturation (iii) is shown in panel (b), where the initial surface fields are given. Figure from \cite{ohlmann2016b}} \label{fig:magamp} \end{figure} As discussed before, additional physical processes have to be considered to achieve envelope ejection. One of the most promising effects for unbinding envelope material that is ignored in the basic gravo-(magneto)hydrodynamic \ac{CE} model is the release of ionization energy when the envelope gas expands and recombines \citep{nandez2015a, nandez2016a}. This effect has been implemented in \ac{CE} simulations with moving mesh codes \citep{ohlmann_phd, prust2019a}. \citet{prust2019a} used the moving-mesh hydrodynamics code \textsc{manga} to simulate \ac{CEE} in setups similar to that of \citet{ohlmann2016a}. In one of their models, 95\% initial co-rotation of the primary star's envelope with the companion was assumed while a second simulation was started with a non-rotating primary star. Instead of assuming an ideal-gas equation of state, they used the \textsc{mesa} equation of state \citep{paxton2011a} to include ionization effects (see Sect.~\ref{sect:eos}). Compared with the simulations of \citet{ohlmann2016a}, a significant increase in unbound envelope material ($\gtrsim$ 60\%) was observed. An interesting new feature in modeling methods was introduced by \citet{prust2020a}. Moving-mesh hydrodynamics codes allow for moving boundaries inside the simulated domain \citep{springel2010a}. As a proof-of-concept, \citet{prust2020a} embedded the companion in a \ac{CE} simulation in a sphere of $4 \, \ensuremath{R_\odot}$ surrounded by a reflective moving boundary condition. This paves the way to an improved modeling of accretion or mass outflow around the companion object. \citet{sand2020a} followed \ac{CEE} in systems with a $1.0 \, \ensuremath{M_\odot}$ early-\ac{AGB} primary star and companions of different masses. This was a step towards a computationally more challenging scenario, because the spatial scale range widens compared with systems involving \ac{RG} primaries. Moreover, stabilizing the more loosely bound \ac{AGB} envelope required an increased spatial resolution of the region around the core of the star. Despite the less tightly bound \ac{AGB} envelope, \cite{sand2020a} found that envelope ejection in the basic gravo-hydrodynamic model fails, but the inclusion of recombination effects render a complete envelope ejection likely---at least under the assumption of local thermalization of the recombination energy. The efficiency of moving mesh approaches to simulate \ac{CEE} has been exploited to explore the parameter space of models and we give two examples here. \citet{sand2020a} tested the effect of different ratios between the mass of an \ac{AGB} primary star and that of the companion on the mass loss rate and the final orbital separation. Less massive companions were found to spiral deeper into the \ac{CE} and \citet{sand2020a} proposed a linear relation between the mass ratio and the orbital separation at the end of dynamical inspiral. Envelope ejection was found likely to be complete under the above-mentioned assumption of local thermalization of recombination energy. \cite{kramer2020a} addressed the question of whether hot sub-luminous B-type (sdB) stars can form from \ac{CE} interaction of primaries close to the tip of the \ac{RG} branch with light companions as suggested by observations \citep[e.g.][]{geier2011a, schaffenroth2014a, schaffenroth2015a}. They conjectured that down to the regime of brown dwarfs such a formation scenario is likely to work; whether or not envelope ejection can be triggered by a much less massive companion, such as a planet, remains to be explored in more detail although the simulations of \citet{kramer2020a} indicated that this may be hard. \begin{figure} \centering \includegraphics[width=0.75\textwidth]{fig19.pdf} \caption{Orbital separation and unbound mass fraction measured according to the criteria given in the legend for \ac{CE} simulations with a $0.970 \, \ensuremath{M_\odot}$ \ac{AGB} primary star and a $0.243 \, \ensuremath{M_\odot}$ companion. Magnetohydrodynamic simulations are labeled with ``MHD'' while ``non-MHD'' indicates pure hydrodynamical models. Figure from \cite{ondratschek2022a}.} \label{fig:ondratschek_fig2} \end{figure} A shortcoming of all recent \ac{CE} simulations that include ionization effects---whatever method was used for modeling the fluid dynamics---was that the evolution could only be followed for a rather short period of time. At termination, not all of the ionization energy was released by recombination effects. Therefore, while including the ionization energy in the energy budget to determine unbound material indicated successful envelope ejection in the case studied by \citet{sand2020a}, it remained to be proven that recombination indeed releases this energy so that it is converted into kinetic energy. This was achieved by \citet{ondratschek2022a}, who were able to follow one of the systems modeled by \citet{sand2020a} to a stage where the energy conversion was completed. They found that---under the assumption of local thermalization of recombination energy and no radiative losses---complete envelope ejection was indeed reached, see Fig.~\ref{fig:ondratschek_fig2}. In contrast to \citet{sand2020a}, however, the simulations of \citet{ondratschek2022a} included magnetic fields. Confirming the results of \citet{ohlmann2016a}, and as illustrated in Fig.~\ref{fig:ondratschek_fig2}, they found that although a weak initial field is strongly amplified during plunge-in of the companion, the magnetic field strength remains dynamically unimportant for envelope ejection. In the very late stages of \ac{CEE} a new phenomenon was observed. As the stellar cores came very close, mass transfer between them initiated and the resulting structure resembled a contact binary system. This led to a second phase of strong magnetic field amplification. In the resulting structure, a high-velocity jet-like outflow was launched. This magnetically-driven outflow was directed in polar direction of the orbital system and low-density, high-velocity material propagated along the chimney-like hole in the ejected \ac{CE} material perpendicular to the orbital plane. While this material had velocities of ${\sim}\, 10 \, \mathrm{km} \, \mathrm{s}^{-1}$, the polar outflow reached ${\sim}\, 100 \, \mathrm{km} \, \mathrm{s}^{-1}$. The resulting structures and the two velocity components of the gas resemble observations of bipolar \acp{PN} (see Sect.~\ref{sect:pne}). The first moving-mesh \ac{3D} magneto-hydrodynamic simulations of \ac{CEE} of objects with masses typical for neutron stars or black holes with a massive star were presented by \cite{moreno2022a}. For the primary star model, a $10 \, \ensuremath{M_\odot}$ star was evolved with \textsc{mesa} to the red supergiant stage. The choice of this mass was motivated by the numerical challenges introduced by massive stars when represented in \ac{CE} simulations. Therefore, a massive star at the lower end of the range of masses still capable of producing a neutron star at the end of its evolution was chosen. \cite{moreno2022a} demonstrated that with the setup procedure of \cite{ohlmann2017a} it is possible to construct a sufficiently stable model for a primary star in \ac{CE} simulations. \ac{CEE} was followed with the \textsc{arepo} code and the stellar cores were represented by point masses. Assuming local thermalization of the released recombination energy, nearly complete envelope ejection seemed possible for the considered systems. The orbital separation at the end of the simulations, however, was too large to allow for a gravitational-wave induced merger of the eventually resulting double compact system. \citet{moreno2022a} argued that for a favorable alignment of the expected supernova kicks, some of the systems may still qualify as progenitors of gravitational-wave emitting mergers of double neutron stars.
\section{Introduction} \label{sec:introduction} \begin{figure}[t] \begin{center} \includegraphics[width=\linewidth]{imgs/teaser} \end{center} \caption{Discovered semantics using Ganspace \cite{hrknen2020ganspace} and our ContraFeat model in the same $\mathcal{W}$ subspace (the subspace defined by the top 4 principal components found by Ganspace) of a StyleGAN2 network. No manual $\mathcal{W}$-space layer selection is conducted. In this example, our ContraFeat model discovers more disentangled semantics than Ganspace, including the decomposed gender and hair length attributes and the less obvious gaze change. This enables the construction of an out-of-distribution sample \emph{a man with long hair and beard gazing at the left} shown in the bottom-left, which is not possible using Ganspace.} \label{fig:teaser} \end{figure} Deep generative models such as GANs \cite{Goodfellow2014GenerativeAN} have shown superior ability in generating photo-realistic images \cite{Karras2017ProgressiveGO,Karras2020AnalyzingAI,Brock2018LargeSG}. Besides improving fidelity in generation, many works seek to augment these models with interpretability \cite{Yan2016Attribute2ImageCI,Chen2016InfoGANIR, Higgins2017betaVAELB,bau2019gandissect,Shen2019InterpretingTL}, which fertilizes applications such as controllable generation \cite{Kulkarni2015DeepCI,Lample2017FaderNM,Lee2018DiverseIT, Xing2019UnsupervisedDO}, domain adaptation \cite{Peng2019DomainAL,Cao2018DiDADS}, machine learning fairness \cite{Creager2019FlexiblyFR,Locatello2019OnTF}, etc. Yet this goal can be typically achieved via supervised learning \cite{Kingma2014SemisupervisedLW, Dosovitskiy2014LearningTG,Kulkarni2015DeepCI, Lample2017FaderNM,Shen2019InterpretingTL}, another recent popular branch of work approaches this target by \emph{semantic discovery}. Instead of training a fresh generator with labels, these semantic discovery methods \cite{voynov2020unsupervised,hrknen2020ganspace,wang2021aGANGeom, shen2021closedform, yuksel2021latentclr} seek semantically meaningful directions in the latent space of pretrained GANs without supervision. Among popular GANs, StyleGAN has shown great potential for disentangling semantics, thanks to its intermediate $\mathcal{W}$ space design with a multi-layer structure. This paper focuses on StyleGAN to develop a tailored semantic discovery model in its $\mathcal{W}$ space. Although many existing models \cite{hrknen2020ganspace,shen2021closedform, yuksel2021latentclr} have demonstrated ability in discovering semantically meaningful variations in StyleGANs, these methods share a common problem: they rely on manual layer-wise selection in the $\mathcal{W}$ space. As mentioned in \cite{hrknen2020ganspace}, this layer-wise selection is important for satisfactory manipulation results since entanglement can frequently happen in the discovered directions without this process. Unfortunately, this manual selection process is tedious and demanding because it requires humans to inspect and evaluate a large number of layer-wise modification combinations in the $\mathcal{W}$ latent space. There are two major reasons causing this problem in existing models: the first is the lack of a module designed for this layer-selection process; the second is the lack of a criterion that can substitute human intelligence to guide this selection. To solve the first problem, we develop a module to predict layer-wise attentions in the $\mathcal{W}$ space which simulates the selection of latent layers to apply discovered directions. For the second problem, we adopt a pretrained neural network to serve as the selective guidance. This is inspired by existing observation that the perceptual judgment of deep network features largely agrees with human judgment \cite{zhang2018perceptual}. In this paper, we make the hypothesis that this perceptual agreement also extends to semantic structure, e.g. similarity in \emph{semantic changes} judged by humans is agreed by neural networks, and difference as well. Technically, we develop a contrastive approach to encourage the discovery of semantics that will cause perceptually consistent and orthogonal changes in the pretrained feature maps. We propose two variants of our model, with one contrasting samples in a binary manner, and another one contrasting samples with learned prototype variation patterns. With the proposed models, we can discover more disentangled semantics on StyleGANs than existing methods without relying on manual layer-wise selection on $\mathcal{W}$ space. As shown in Fig. \ref{fig:teaser}, both methods (Ganspace \cite{hrknen2020ganspace} and our model) are applied to the same $\mathcal{W}$ space, and ours can discover cleaner semantics than the Ganspace model. Note that our model decomposes the hair length and gender attributes into two controllable factors, thus it can manipulate the latent code to generate an out-of-distribution face sample with long-hair and beard (shown in the bottom-left), which is not possible using Ganspace. Our main contributions are summarized as follows: \begin{itemize} \item We propose to substitute the manual layer-wise selection procedure in the $\mathcal{W}$ space of StyleGANs by a learnable attention module. \item We propose to use the deep features in pretrained networks to guide the discovery of semantics, verifying our hypothesis that deep features perceptually agree with human judgment on the semantic structure. \item We design one of our proposed model variants to learn prototype patterns for discovered semantics, avoiding the requirement of sampling multiple changing samples during contrastive learning. \item State-of-the-art semantic discovery results can be achieved with our models, and disentangled representations can be derived. \end{itemize} \section{Related Work} \label{sec:related_work} \textbf{Semantic Discovery.} Generative adversarial networks \cite{Goodfellow2014GenerativeAN} have demonstrated state-of-the-art performance \cite{Karras2017ProgressiveGO,Brock2018LargeSG, Karras2020ASG,Karras2020AnalyzingAI} in generating photo-realistic images. Recently, works revealed that the latent spaces of well-trained GANs can be interpreted with meaningful semantic directions \cite{bau2019gandissect,Shen2019InterpretingTL}. This phenomenon motivated the investigation of semantic properties in the latent spaces \cite{hrknen2020ganspace,wang2021aGANGeom}, and the discovery of semantic directions \cite{Plumerault2020Controlling,gansteerability, voynov2020unsupervised,spingarn2021gan,shen2021closedform,yuksel2021latentclr}. In both \cite{hrknen2020ganspace} and \cite{wang2021aGANGeom}, the latent space of GANs has been shown highly anisotropic, revealing most semantic variations are encoded in a low-dimension latent subspace. Methods in \cite{Plumerault2020Controlling,gansteerability} successfully learn latent directions to represent predefined transformations on images. Without relying on optimizations, \cite{hrknen2020ganspace, spingarn2021gan,shen2021closedform} discover semantic attributes by finding the latent directions that cause the most significant changes. Unfortunately, this assumption is too simple and the methods rely on manual adjustment in the latent space to obtain satisfactory results. Based on the idea that different latent directions should correspond to different changes, \cite{voynov2020unsupervised} and \cite{yuksel2021latentclr} adopted classification loss and contrastive loss to encourage the separation of different directions respectively. However, the former requires the training of a deep classifier, and the later is limited to using early features in the generator due to its dense computation in the contrastive loss. \begin{figure*}[t] \begin{center} \includegraphics[width=\linewidth]{imgs/navigator} \end{center} \caption{(a) A simplified diagram of StyleGAN. The discovered latent directions are applied on the $\mathcal{W}$ space after duplication (red dotted box). (b) Overview of our proposed navigator. It consists of two branches. The direction branch ($Dir$) predicts directions $\bsb{v}_{\text{dir} \rightarrow d}$ in the $\mathcal{W}_0$ space and the attention branch ($Att$) predicts attentions on $\mathcal{W}$-space layers $\bsb{v}_{\text{att} \rightarrow d}$. The combined results $\bsb{v}_{\rightarrow d}$ are used to modify the latent codes $\bsb{w} \in \mathcal{W}$. (c) Detailed illustration of $Dir$ and $Att$.} \label{fig:navigator} \end{figure*} \textbf{Disentanglement Learning.} Another popular branch of work to unsupervisedly find semantically meaningful changes is by learning disentangled representations \cite{Higgins2017betaVAELB,Chen2016InfoGANIR}. In this domain, various regularization methods have been proposed based on different assumptions, e.g. statistical independence \cite{Burgess2018UnderstandingDI, Kumar2017VariationalIO,Kim2018DisentanglingBF,chen2018isolating}, informativeness \cite{Chen2016InfoGANIR,Jeon2018IBGANDR,Xinqi_cvpr21}, separability \cite{Lin2019InfoGANCRDG}, and group decomposition \cite{Xinqi_liegroupvae_icml21}. These models usually succeed at the cost of degraded generation quality compared with the normal generative models. In \cite{Locatello2018ChallengingCA}, Locatello et al. proved that unsupervised disentanglement learning is impossible without additional biases. In \cite{pmlr-v119-locatello20a}, Locatello et al. showed that guaranteed disentanglement can be achieved with partial factor variation information on some VAE variants \cite{ijcai2019-348,BouchacourtTN18}. In this work, we show that state-of-the-art disentangled representations can be derived using our semantic discovery model, and the biases in our model include the perceptual contrastive property between semantics, spatial separation, and their hierarchical abstractness difference. \section{Method} \label{sec:method} In this section, we introduce our semantic discovery model ContraFeat (\textbf{Contra}sting deep \textbf{Feat}ures) in detail. \subsection{Navigator} \label{subsec:navigator} In StyleGANs (a simplified diagram shown in Fig. \ref{fig:navigator} (a)), a normally sampled latent code $\bsb{z}$ is fed through a mapping network $G_{map}$ to obtain an intermediate latent code $\bsb{w}_0$. The $\bsb{w}_0 \in \mathcal{W}_0$ is then broadcast as an extended code $\bsb{w} \in \mathcal{W}$ via duplication, where $\mathcal{W}$ is the extended space $k$ times larger than the original $\mathcal{W}_0$ space, with $k$ determined by the depth of the synthesis network ($G_{syn}$). We refer this duplication dimension as \emph{layer} of this $\mathcal{W}$ space. Thanks to this hierarchical design, disentanglement property emerges in StyleGANs \cite{Karras2020ASG,Karras2020AnalyzingAI}. This extended latent space $\mathcal{W}$ plays an important role in semantic editing, as works \cite{hrknen2020ganspace,shen2021closedform} have shown that layer-wise editing in the $\mathcal{W}$ space achieves more disentangled results. It is also discovered that real-world images can be more accurately inverted into the extended $\mathcal{W}$ space \cite{9008515,9157575} to perform semantic editing. However, the existing works require manual selection of the modifiable $\mathcal{W}$-space layers in order to curate satisfactory editing results. To eliminate this tedious human effort, we propose a navigator network to automate this procedure. Specifically, the module conducts semantic direction prediction (direction branch) and layer-wise selection (attention branch) in the $\mathcal{W}$ space (depicted in Fig. \ref{fig:navigator} (c) purple and green boxes respectively). In our design, these two submodules are separated and thus it is possible to replace the direction branch by other existing methods to verify the compatibility of our layer-selection branch with other direction prediction methods. The direction branch ($Dir$ purple boxes in Fig. \ref{fig:navigator}) outputs $m$ latent directions $\{\bsb{v}_{\text{dir} \rightarrow d}, d=1..m\}$ in the $\mathcal{W}_0$ space. During training, we randomly sample $d$'s to compute losses which will be introduced later. Rather than allowing $\bsb{v}_{\text{dir} \rightarrow d}$ to learn in the whole $\mathcal{W}_0$ space, we leverage PCA projection to constrain the discovery results in the informative subspace of $\mathcal{W}$, which will be introduced in the next subsection in detail. To conduct the selection along the $\mathcal{W}$-space layer dimension, we build a branch to predict attention weights on this layer dimension (depicted by the green boxes in Fig. \ref{fig:navigator} (b) (c)). Mathematically, \begin{equation} \bsb{v}_{\text{att} \rightarrow d} = \sigma * \mathtt{softmax}(\text{att\_logits}_d), \quad d \in 1..m, \end{equation} where the term ``$\text{att\_logits}_d$" denotes the output logits of the attention branch (whose length equal to the $\mathcal{W}$-space layers). We use a Gaussian kernel $\sigma$ convolution to soften the outputs of the $\text{softmax}$ function. Without the convolution operation, the modifications tend to be too sharp and are likely to cause artifacts on images. Note that each predicted direction $\bsb{v}_{\text{dir} \rightarrow d}$ corresponds to an attention output $\bsb{v}_{\text{att} \rightarrow d}$. We compute the product of them to obtain the latent modification , which is then applied to the latent code $w \in \mathcal{W}$: \begin{align} \bsb{v}_{\rightarrow d} &= \bsb{v}_{\text{dir} \rightarrow d} \odot \bsb{v}_{\text{att} \rightarrow d}, \\ \bsb{w}_{\rightarrow d} &= \bsb{w} + \bsb{v}_{\rightarrow d} \quad d \in 1..m, \label{eq:latent_var} \end{align} with $\bsb{w}_{\rightarrow d}$ being the edited code as illustrated in Fig. \ref{fig:navigator} (b). \subsection{Informative Subspace in $\mathcal{W}_0$} \label{sec:info_subspace} The $\mathcal{W}_0$ space of StyleGAN has been shown highly anisotropic \cite{hrknen2020ganspace,wang2021aGANGeom}, with a small latent subspace contributing to almost all generated varieties (highly informative) while leaving the rest of the space controlling almost nothing. This phenomenon hinders our discovery process as the solution space is sparse. Concerning this issue, we restrict the learning of predicted directions $\bsb{v}_{\text{dir}\rightarrow d}$ in the high-informative subspace so that the navigator can more easily converge to meaningful directions. In practice, this informative subspace is obtained by computing PCA on a large number of samples in the $\mathcal{W}_0$ space similar to \cite{hrknen2020ganspace}, and using the top-$k$ components (eigenvectors) to define the informative subspace. (see Appendix Sec. \ref{ap:how_to_pca} for a detailed introduction). \begin{figure*}[t] \begin{center} \includegraphics[width=\linewidth]{imgs/loss} \end{center} \caption{(a). Binary contrasting process. Two directions of change are sampled to contrast with each other. (b). Prototype contrasting process. One direction of change is sampled to contrast with prototype variation patterns. These prototype patterns are learned with gradient decent. (c). A layer of perceptual difference computed by two images differing in a single semantics (wall color). The pixel difference is large for changed areas and small for static areas.} \label{fig:loss} \end{figure*} Let the columns of matrix $V_\text{pca} \in \mathbb{R}^{|\mathcal{W}_0| \times |\mathcal{W}_0|}$ denote the computed principal components and the left-most $k$ columns form the basis of the used subspace. Instead of directly learning vectors $\bsb{v}_{\text{dir} \rightarrow d} \in \mathbb{R}^{|\mathcal{W}_0|}$ in the $\mathcal{W}_0$ space, we learn smaller vectors $\bsb{v}_{\text{sub}\rightarrow d}$ of length $k$ and project them into the $\mathcal{W}_0$ space with the top-$k$ PCA basis: \begin{equation} \bsb{v}_{\text{dir} \rightarrow d} = \mathtt{norm}(V_\text{pca}[:, :k] \cdot \bsb{v}_{\text{sub}\rightarrow d}), \quad \bsb{v}_{\text{sub}\rightarrow d} \in \mathbb{R}^{k}, \end{equation} where $\mathtt{norm}$ normalizes the vectors to a constant length. This projection ensures the learned directions are positioned in the informative subspace defined by the top-$k$ principal components. This process is depicted in Fig. \ref{fig:navigator} (c) purple box. \subsection{Losses} \label{subsec:losses} We propose to use pretrained-network features to guide the discovery process. Since deep features show similar judgment to humans \cite{zhang2018perceptual}, we hypothesize this agreement extends to semantic variation structure. In this paper, we consider losses reflecting the simple semantic structure of variation consistency (of the same semantics) and orthogonality (between different semantics). Given a latent code $\bsb{w} \in \mathcal{W}$ and its modified version (on direction $d$) $\bsb{w}_{\rightarrow d} = \bsb{w} + \bsb{v}_{\rightarrow d}$, the corresponding deep-feature changes are defined as: \small \begin{equation} [F_{\bsb{x}\rightarrow d}^l]_{l=1..L} = (E \circ G)(\bsb{w}_{\rightarrow d}) - (E \circ G)(\bsb{w}), 1 \leq d \leq m, \end{equation} \normalsize where $G$ is the generator and $E$ is the feature extractor (e.g. a ConvNet). Usually the extracted features will contain multiple layers ($l=1..L$). This variation extraction process is illustrated in Fig. \ref{fig:loss} (a) (b) (orange and green layers). \begin{figure*}[t] \centering \includegraphics[width=\linewidth]{imgs/evolve} \caption{Fixing discovered $\mathcal{W}_0$-space directions predicted by Ganspace \cite{hrknen2020ganspace}, we compare the difference introduced by our proposed attention branch. We can see by incorporating the attention module, the interpretability of each direction is improved. For instance, in the first direction, the facial gender features and skin color shift are removed, resulting in a specific control on hair length. (Bottom-right) Predicted $W$-space layer attentions for some semantics.} \label{fig:evolve} \end{figure*} \textbf{Consistency Loss.} For consistency, we compute two deep-feature changes by applying the same latent direction $d$ to different latent samples $\bsb{x}$ and $\bsb{y}$, and force them to be similar to each other: \begin{equation} l^\text{bi}_\text{cons-avg} = -\sum_{l=1}^{L}\big[\frac{1}{S} \sum_{s=1}^{S}\mathtt{Sim}^2(F_{\bsb{x}\rightarrow d}^{ls}, F_{\bsb{y}\rightarrow d}^{ls})\big] \label{eq:consistency_avg}, \end{equation} where $s$ indexes the spatial positions of the feature maps, and $\texttt{Sim}$ is the cosine similarity function. Unfortunately, this design has a flaw: it aggregates scores on all positions evenly but only varied areas are meaningful to the consistency measurement. An example of this uneven case is shown in Fig. \ref{fig:loss} (c) where only the wall color has varied and the rest areas are static. Since measuring variation similarity on static areas is meaningless, we instead adopt an L2-norm mask of the feature-map difference to implement the weighted aggregation: \begin{align} &l^\text{bi}_{\text{cons}} = -\sum_{l=1}^{L}\big[\frac{1}{Q} \sum_{s=1}^{S}q(s)\mathtt{Sim}^2(F_{\bsb{x}\rightarrow d}^{ls}, F_{\bsb{y}\rightarrow d}^{ls})\big], \\ &q(s) = \frac{\mathtt{nm}(F_{\bsb{x}\rightarrow d}^{s})} {\mathtt{nm_{max}}(F_{\bsb{x}\rightarrow d}^{s})} \cdot \frac{\mathtt{nm}(F_{\bsb{y}\rightarrow d}^{s})} {\mathtt{nm_{max}}(F_{\bsb{y}\rightarrow d}^{s})}, Q = \sum_{s=1}^{S}q(s),\label{eq:bi-cons} \end{align} where $\mathtt{nm}(F_{\bsb{x}\rightarrow d}^{s})$ computes the L2-norm of the activations on $F_{\bsb{x}\rightarrow d}$ at position $s$. This weighted aggregation forces the measurement to focus on the overlapped changes in both inputs. The division by $Q$ normalizes the weighted aggregation so that the loss cannot favor large changed areas. Empirically this version of consistency measurement leads to better discovery results. We compare different designs in experiment. Eq. \ref{eq:bi-cons} compares variations in a binary manner, where we need to apply the same change to two different codes (illustrated in Fig. \ref{fig:loss} (a)), which is not very efficient due to the doubled computation in generator. To solve this issue, we implement another contrastive learning variant by learning a set of prototype patterns: \begin{align} &l^\text{pt}_{\text{cons}} = -\sum_{l=1}^{L}\big[\frac{1}{Q} \sum_{s=1}^{S}q(s)\mathtt{Sim}^2(F_{\bsb{x}\rightarrow d}^{ls}, F_{* \rightarrow d}^{ls})\big], \\ &[F^l_{* \rightarrow d}]_{l=1..L} = E(\mathtt{tanh}(\text{P}^{var}_{d})) \label{eq:pt-cons}, \end{align} where $\text{P}^{var}_{d}\in \mathbb{R}^{h\times w\times c}$ denotes the prototype pattern of semantic $d$, learned along with the model. These prototype patterns serve as hallucinated pictures of the discovered semantic changes in the RGB space (see visualizations in Fig. \ref{fig:var_patterns}), which are supposed to cause similar deep-feature changes as by actual image pairs. \textbf{Orthogonality Loss.} Similarly, we define the orthogonality losses (both binary and prototype implementations), which encourage feature variations caused by different latent changes to be orthogonal: \small \begin{align} &l^\text{bi}_\text{orth} = \sum_{l=1}^{L}\big[\frac{1}{Q} \sum_{s=1}^{S}q(s)\mathtt{Sim}^2(F_{\bsb{x}\rightarrow d}^{ls}, F_{\bsb{y}\rightarrow d'}^{ls})\big], \label{eq:bi-orth}\\ &l^\text{pt}_{\text{orth}} = \frac{1}{m-1}\sum_{d'\neq d}\sum_{l=1}^{L}\big[\frac{1}{Q} \sum_{s=1}^{S}q(s)\mathtt{Sim}^2(F_{\bsb{x}\rightarrow d}^{ls}, F_{* \rightarrow d'}^{ls})\big] \label{eq:pt-orth}, \end{align} \normalsize where $d,d'$ denote different directions predicted by our navigator. \textbf{Diversity Regularization.} We add a small regularization term to encourage the navigator to proposed different directions in the latent space. This term practically increases the diversity of discovered concepts: \begin{equation} l_\text{div} = \sum_{i,j} \mathtt{Sim}^2(\bsb{v}_{\text{dir}\rightarrow i}, \bsb{v}_{\text{dir}\rightarrow j}), \quad i,j \in {1..m}, i \neq j. \label{eq:div} \end{equation} In summary, our overall losses (both binary and prototype) are: \begin{equation} l^\text{bi} = l^\text{bi}_\text{cons} + l^\text{bi}_\text{orth} + \lambda l_\text{div} \quad \text{and} \quad l^\text{pt} = l^\text{pt}_\text{cons} + l^\text{pt}_\text{orth} + \lambda l_\text{div} . \label{eq:final} \end{equation} \section{Experiments} \label{sec:experiments} \begin{table}[t] \begin{center} \begin{tabular}{lll} \toprule Models & $S_\text{disen}$ & $N_\text{discov}$ \\ \midrule Gsp\_dir-non-non & $0.304$ & $9$ \\ Gsp\_dir-att-bi & $\bsb{0.320}\pm 0.014$ & $10.6\pm 1.02$ \\ Gsp\_dir-att-pt & $0.327\pm 0.015$ & $\bsb{11.8}\pm 0.75$ \\ \midrule Sefa\_dir-non-non & $0.290$ & $9$ \\ Sefa\_dir-att-bi & $\bsb{0.328}\pm 0.023$ & $\bsb{13.8}\pm 0.75$ \\ Sefa\_dir-att-pt & $0.321\pm 0.016$ & $13.0\pm 0.63$ \\ \bottomrule \end{tabular} \end{center} \caption{Comparing the semantic discovery performance with and without our attention module on baselines Ganspace \cite{hrknen2020ganspace}, and Sefa \cite{shen2021closedform}. The shown model names follow the pattern: dir\_module - att\_module - loss\_type.} \label{table:att_effect} \end{table} \subsection{Evaluation Metrics} \label{subsec:metrics} We design two quantitative metrics on the FFHQ dataset \cite{Karras2020ASG} to evaluate the semantic discovery performance of models. Considering there are no labeled attributes on this dataset, we leverage a pretrained state-of-the-art disentanglement model \cite{Xinqi_cvpr21} to construct an attribute predictor. Specifically, for images $X$ generated by the disentangled generator, we train a predictor $P(X)$ to reconstruct the disentangled latent codes $\bsb{z} \in R^{p}$, with each dimension representing a score for an attribute (total of $p$ attributes). To evaluate a semantic discovery model, we iterate through all the predicted directions of the model, apply these modifications to a set of $N$ samples, and compute their mean absolute difference on the scores predicted by the pretrained predictor $P$. Mathematically, for $d = 1..m$: \small \begin{align} A[d, :] = &\frac{A'[d, :]}{\mathtt{max}(A'[d, :])}, \\ A'[d, :] = \frac{1}{N}\sum_{i=1}^{N}|(P\circ G)(\bsb{w}_i&+ \bsb{v}_{\rightarrow d}) - (P\circ G)(\bsb{w}_i)|, \end{align} \normalsize where each entry of the matrix $A \in R^{m \times p}$ represents how an attribute score ($i=1..p$) changes on average when images vary along a discovered semantic direction ($d=1..m$). Note that this matrix is normalized so that the maximum value of each row is 1. Then we define two evaluation quantities: \begin{align} S_\text{disen} = \frac{1}{m} \sum_{d=1}^{m} &\mathtt{max}_{1\text{st}}(A[d,:]) - \mathtt{max}_{2\text{nd}}(A[d,:]), \\ N_\text{discov} &= \sum_{i=1}^{p} \bsb{1}_{\{x| 1 \in x\}}(A[:,i]), \end{align} where $\mathtt{max}_{1\text{st}}(A[d,:])$ extracts the largest value in $A[d,:]$, and $\mathtt{max}_{2\text{nd}}(A[d,:])$ extracts the second largest value. The $S_\text{disen}$ evaluates how clean a discovered semantics is because an ideal discovery should only cause a single ground-truth attribute to change. The $N_\text{discov}$ quantity counts the number of semantics discovered by the model. The term $\bsb{1}_{\{x| 1 \in x\}}(A[:,i])$ is 1 if the attribute $i$ is at least once predicted as the maximum value in a row (indicating the attribute $i$ has been discovered by the model). Some additional information of evaluation metrics can be found in Appendix \ref{ap:metrics}. \subsection{Effectiveness of the Attention Branch} In Table \ref{table:att_effect}, we quantitatively compare the impact made by our attention branch when applied to Ganspace (Gsp) \cite{hrknen2020ganspace} and Sefa \cite{shen2021closedform} baselines. The results are obtained by training a proposed attention module on the top-30 directions predicted by either base models in both binary (bi) and prototype-pattern (pt) implementations. We can see the attention branch improves the baselines on both metrics, especially $N_\text{discov}$. This is because the base models predict many directions representing overlapped semantics, leading to low total counted number of discovered attributes ($N_\text{discov}$), while our attention module removes some of these overlapped semantics, leading to the emerge of other smaller but diverse attributes. In Fig. \ref{fig:evolve}, we qualitatively show the difference before and after the use of the attention branch on the Ganspace predicted directions. We can see though the Ganspace can propose directions to control meaningful image changes, many of them are still mixture of multiple semantics. In contrast, our learned attentions help to remove some correlated changes like the facial gender features, background changes, and hair style changes, leading to cleaner semantic controls. In Fig. \ref{fig:evolve} bottom-right, we show the predicted attentions for some semantic concepts discovered on FFHQ. We can see the that high-level changes (e.g. rotation) correspond to $\mathcal{W}$-space top layers, facial attribute changes (e.g. smile, haircolor) correspond to middle layers, and changes like ambient hue correspond to low layers, which is similar to results found in \cite{Karras2020ASG}. \begin{figure*}[t] \centering \includegraphics[width=\linewidth]{imgs/var_patterns} \caption{Prototype variation patterns learned with our proposed Contra-Pt variant. These patterns learn to characterize the changes that are related to the corresponding discovered semantics.} \label{fig:var_patterns} \end{figure*} \begin{table}[t] \begin{center} \begin{tabular}{lll} \toprule Models & $S_\text{disen}$ & $N_\text{discov}$ \\ \midrule Bi-30 & $0.313\pm 0.015$ & $13.6\pm 0.80$ \\ Bi-100 & $\bsb{0.357}\pm 0.017$ & $14.2\pm 0.85$ \\ Bi-300 & $0.340\pm 0.012$ & $\bsb{14.4}\pm 0.80$ \\ Bi-500 & $0.337\pm 0.014$ & $12.0\pm 0.89$ \\ \midrule Pt-30 & $0.314\pm 0.018$ & $\bsb{14.6}\pm 0.49$ \\ Pt-100 & $\bsb{0.344}\pm 0.022$ & $14.2\pm 0.75$ \\ Pt-300 & $0.336\pm 0.013$ & $13.6\pm 0.49$ \\ Pt-500 & $0.332\pm 0.015$ & $11.8\pm 0.75$ \\ \bottomrule \end{tabular} \end{center} \caption{Comparing the discovery performance of our models learned in PCA subspaces of different sizes.} \label{table:k_subspace} \end{table} \subsection{Informative Subspace} As introduced in Sec. \ref{sec:info_subspace}, there exists an informative subspace in the $\mathcal{W}_0$ space that accounts for most of the generation variety, and we can restrict the discovery process in this dense subspace to make the discovery easier. In Table \ref{table:k_subspace}, we compare the discovery results obtained in subspaces of different sizes. We can see when we restrict the subspace to be very small (30-dim), the disentanglement score $S_\text{disen}$ becomes the lowest in both model variants, while the number of discovered attributes $N_\text{discov}$ becomes highest. This is because the low-dim subspace is content-dense, thus the model can more easily find meaningful changes, leading to higher numer in $N_\text{discov}$. However, the semantics discovered in this small subspace may be incomplete as some of them are clipped and may be embedded beyond this subspace, resulting in partial discovery or artifacts, leading to low $S_\text{disen}$. On the other hand, using a large subspace (500-dim) leads to lower $N_\text{discov}$, meaning it becomes harder to converge to meaningful directions as a large part of the space controls null changes. In summary, we find that using a subspace of a middle size (100 or 300-dim) leads to more balanced discovery results. \subsection{Prototype Variation Patterns} \label{sec:proto_patterns} In Fig. \ref{fig:var_patterns}, we present the prototype variation patterns learned by our Contra-Pt model variant. We can see the model successfully learns to characterize many interpretable patterns including some subtle changes like clothes color, eye opening, and shoulder pose. It is also interesting to see that the model spontaneously decomposes the semantics spatially so that they are less like to interfere with each other. Learning such hallucinated patterns in the RGB space opens the possibility for conditional discovery and fine-grained manipulation, as it is possible to constrain the patterns by some predefined semantic/attribute segmentations. We leave this interesting extension for future work. \subsection{Compared to Other Discovery Models} In Table \ref{table:dis_sota} left, we quantitatively compare the proposed models with other existing models including recognition (Recog) \cite{voynov2020unsupervised} and LatentCLR (LatCLR) \cite{yuksel2021latentclr}. We can see: (1) our proposed contrastive loss performs best among all models; (2) existing models can be significantly boosted by incorporating our proposed $\mathcal{W}$-space attention module. Besides the performance gain, it is also worth noting that (1) the Recog model requires to train an extra deep predictor for the discovery process which takes more training steps to converge while our models only need to train the navigator (and the variation patterns in the PT variant); (2) the LatCLR model is designed to contrast every direction change with each other (an outer product) in very loss computation, which is highly memory-consuming. It prevents the model from using features beyond the early few layers of the generator for its loss computation, limiting the resulted semantic discovery performance. In Table. \ref{table:dis_sota} right, we also compare these losses on disentangled representation learning on 3DShapes dataset \cite{Kim2018DisentanglingBF}. We can see our models still outperform the baselines by an obvious margin. \begin{table}[t] \begin{center} \begin{tabular}{lll} \toprule Model & $S_\text{disen}$ & $N_\text{discov}$ \\ \midrule Recog & $0.249\pm 0.023$ & $4.8\pm 0.75$ \\ Recog-Att & $0.312\pm 0.015$ & $8.6\pm 0.80$ \\ LatCLR & $0.267\pm 0.014$ & $9.6\pm 1.02$ \\ LatCLR-Att & $0.304\pm 0.020$ & $10.2\pm 1.17$ \\ \midrule Contra-Bi & $\bsb{0.357}\pm 0.017$ & $\bsb{14.2}\pm 0.85$ \\ Contra-Pt & $\bsb{0.344}\pm 0.022$ & $\bsb{14.2}\pm 0.75$ \\ \bottomrule \end{tabular} \end{center} \caption{Semantic discovery comparison between different models with and without the proposed attention module on FFHQ dataset \cite{Karras2020ASG}.} \label{table:sem_disc_perform} \end{table} \begin{table}[t] \begin{center} \begin{tabular}{llll} \toprule Model & FVM & MIG & DCI \\%& DCI-c \\ \midrule $\beta$-VAE & $90.2_{\pm 8.1}$ & $39.5_{\pm 8.4}$ & $67.4_{\pm 3.7}$ \\%& $66.7_{\pm 5.8}$ \\ FacVAE & $91.4_{\pm 5.0}$ & $39.2_{\pm 8.9}$ & $\bsb{76.3}_{\pm 8.0}$ \\%& $\bsb{70.4}_{\pm 6.2}$ \\ Recog-Att & $86.7_{\pm 5.2}$ & $29.1_{\pm 10.2}$ & $49.4_{\pm 8.3}$ \\%& $45.7_{\pm 10.9}$ \\ LatCLR-Att & $92.9_{\pm 7.0}$ & $40.4_{\pm 5.3}$ & $70.5_{\pm 12.0}$ \\%& $68.0_{\pm 9.8}$ \\ \midrule Contra-Bi & $\bsb{93.4}_{\pm 6.2}$ & $\bsb{43.8}_{\pm 7.3}$ & $72.0_{\pm 5.4}$ \\%& $67.5_{\pm 4.7}$ \\ Contra-Pt & $\bsb{95.3}_{\pm 4.3}$ & $\bsb{47.2}_{\pm 6.5}$ & $\bsb{74.5}_{\pm 7.0}$ \\%& $\bsb{68.5}_{\pm 7.2}$ \\ \bottomrule \end{tabular} \end{center} \caption{Disentangled representation learning comparison on 3DShapes dataset \cite{Kim2018DisentanglingBF}.} \label{table:dis_sota} \end{table} \subsection{Learning Disentangled Representations} \label{subsec:disen} With semantics discovered, we can then construct disentangled representations by learning an encoder that aligns the semantic directions with axes in a latent space. This can be achieved by training a model on a dataset composed of paired images, with each data pair differing in a single semantic direction. This dataset can be constructed as follows: \begin{align} \{(G(\bsb{w}), G(\bsb{w} + \bsb{v}_{d})) \, | \, \bsb{w} \sim p(\bsb{w}), d = 1..m\}. \end{align} Then we can train an off-the-shelf group-based VAE model \cite{ijcai2019-348,BouchacourtTN18,pmlr-v119-locatello20a} to obtain disentangled representations. The implementation of the group-based VAE is shown in the Appendix Sec. \ref{ap:group_vae}. With disentangled representations, we can use quantitative metrics \cite{Kim2018DisentanglingBF, Eastwood2018AFF,chen2018isolating} to indirectly evaluate the quality of discovered semantic directions. We show the state-of-the-art comparison on 3DShapes in Table \ref{table:dis_sota}. We can see the derived representations by our ContraFeat models match or outperform the existing state-of-the-art disentanglement methods, showing this new pipeline (discovering semantics + disentangling) is an effective unsupervised disentangled representation learning approach. Qualitative results are in Appendix Sec. \ref{ap:3dshapes_trav}. \begin{figure}[t] \centering \includegraphics[width=\linewidth]{imgs/more_qualitative} \caption{(Left) Some real-image editing results. The red box shows the reconstructed original images. (Right) Some qualitative discovery results on different datasets.} \label{fig:more_qualitative} \end{figure} \subsection{Real-image Editing and More Qualitative Results} We can achieve real-image editing by projecting real images into the $\mathcal{W}$ latent space of StyleGAN. We adopt the projection method from \cite{Karras2020AnalyzingAI}, with the only modification of learning the projected code in the extended $\mathcal{W}$ space rather than the originally-used $\mathcal{W}_0$ space. After projection, we can apply our discovered semantic directions to the projected code to edit the image. In Fig. \ref{fig:more_qualitative} (left), we show some editing results on real-world images (more results are shown in the Appendix Sec. \ref{sec:real_image}). Here we see that we can conduct interesting editing like fatness and nose length adjustment, which are rarely-seen in existing other semantic discovery methods. In Fig. \ref{fig:more_qualitative} right, we show some discovered semantics on other datasets. We can see our model can discover specific semantics for different datasets like the \emph{ear pose} for Dogs dataset and \emph{trees} for Church dataset, indicating our models can work adaptively on these datasets. More discovery results can be found in the Appendix Sec. \ref{ap:other_sets}. \section{Conclusion} \label{sec:conclusion} Concerning the tedious procedure of manual selection on $\mathcal{W}$-space layers in existing semantic discovery methods, we introduced an attention-equipped navigator module to solve this problem. In order to encourage more effective semantic discovery, we additionally proposed to restrict the discovery process in the latent subspace of $\mathcal{W}$ defined by the top-$k$ principal components. Leveraging the high perceptual capability of deep-network features, we adopted a pretrained network as a cheap semantic sensor to guide the discovery process in a contrastive learning manner by encouraging consistency and orthogonality in image variations. Two model variants were introduced with one contrasting variation samples in a binary way and another contrasting samples with learned prototype variation patterns. To quantitatively evaluate semantic discovery models without ground-truth labels, we designed two metrics on FFHQ based on a pretrained disentanglement model. Experimentally, we showed that the two proposed models are both effective and can achieve state-of-the-art semantic discovery performance. Additionally, we showed that disentangled representations can be derived from our discovered semantics, and real-image editing can also be achieved based on image projection techniques. \section{Acknowledgements} This work was supported by the Australian Research Council under projects FL-170100117, IC-190100031, LE-200100049, DP210101859, the University of Sydney Research Accelerator (SOAR) Prize, and the University of Sydney Faculty of Engineering PhD Completion Award.
\section{Introduction} \label{sec:intro} The widespread evidence that volatility tends to cluster over time and negatively correlates with realised returns have motivated the use of volatility targeting to dynamically adjust the notional exposure to a given portfolio. A conventional approach to volatility targeting builds upon the idea that the capital exposure to a given portfolio is levered up (scaled down) based on the inverse of the previous month's realised variance. The theoretical foundation lies in the evolution of the risk-return trade-off over time (see, e.g., \citealp{moreira2017volatility}).\footnote{Notice that the terms ``volatility-managed'', ``volatility-targeting'', ``volatility-managing'' are used interchangeably throughout the paper as they carry the same meaning for our purposes.} However, volatility management based on realised variance estimates is associated with a dramatic increase in portfolio turnover and significant time-varying leverage. This casts doubt on the usefulness of conventional volatility-managed portfolios, especially for large institutional investors with high {\it all-in} implementation costs (see, e.g., \citealp{patton2020you}). Figure \ref{fig:weights} shows this case in point. The left panel shows the volatility-managed portfolio allocation based on realised variance estimates for three common portfolios; the market, and the size and momentum factors as originally proposed by \citet{fama1996multifactor} and \citet{jegadeesh1993returns}, respectively. Simple volatility targeting leads to a tenfold notional exposure compared to the original equity strategy. This excess leverage is pervasive across a broad set of 158 equity trading strategies which will be introduced in Section \ref{sec:appl}. For instance, the middle panel in Figure \ref{fig:weights} shows that volatility targeting based on realised variance leads to a leverage between 1.8 and 4 times for more than 10\%, and between 3 to 11 times for at least 1\% of the original 158 equity strategies. This makes volatility-managed strategies potentially both risky and costly to implement, especially when volatility targeting is missed and/or forecasts are not sufficiently accurate (see, e.g., \citealp{bongaerts2020conditional}). A simple approach towards cost mitigation is to reduce liquidity demand by slowing down the time-series variation in the factor leverage; this is often achieved by using less erratic estimates of risk, such as the realised volatility instead of the realised variance, or by introducing leverage constraints in the form of a capped notional exposure (see, e.g., \citealp{moreira2017volatility,cederburg2020performance,barroso2021limits}). While imposing leverage constraints may simplifies an empirical analysis, they do not regularise the often erratic monthly underlying volatility estimates and are typically set arbitrarily, absent sounded economic arguments for their optimal setup. In this respect, the economic value of leverage constraints is an indirect function of the statistical accuracy of the underlying volatility estimates.\footnote{This is akin a joint-test problem whereby leverage constraints are well-specified only to the extent that the assumptions underlying the volatility estimates are correct.} In this paper, we propose an alternative approach towards slowing down liquidity demand in volatility-managed portfolios which is based on smoothing the predictive density of an otherwise standard stochastic volatility model. Our view is that by smoothing monthly volatility forecasts, one can regularise trading turnover and therefore mitigate the effect of transaction costs on volatility-managed portfolios. Such regularisation is achieve by a variational Bayes inference scheme which flexibly encompasses different smoothness assumptions irrespective of the underlying persistence of the latent state. Put it differently, our underlying assumption is that actual monthly returns' volatility may simply follow a conventional autoregressive latent stochastic process.\footnote{See for example, \citet{harvey_etal.1994,andersen_etal.1996,ghysels_etal.1996,gallant_etal.1997,bali2000testing,durbin_koopman.2000,jacquier_etal.2002,jacquier_etal.2004,shephard_pitt.2004,yu2005leverage,han2006asset,hansen2008consumption,bansal2010long,schorfheide2018identifying}, among others. An extensive review of the use of stochastic volatility models as an alternative to ARCH-type approaches can be found in \citet{shephard2020statistical}.} However, monthly volatility forecasts can be noisy, which leads to extreme portfolio turnover from volatility targeting. As a result, one could ``filter out'' the noise based on a posterior approximation density which embeds both non-smooth predictive densities and different types of smoothing, e.g., wavelet basis functions (see \citealp{rue_held.2005}). We evaluate the economic performance of our smooth volatility prediction based on a broad sample of 158 equity trading strategies. We first consider the nine equity factors examined by \citet{moreira2017volatility}. We augment the first group of test portfolios with a second group covering a broader set of trading strategies based on the list of 153 characteristic-managed portfolios, or ``factors'', reported in \citet{jensen2021there}. In addition to previous month's realised variance (henceforth {\tt RV}), we benchmark our smooth volatility-managed portfolios ({\tt SSV}) against several alternative implementations of volatility-targeting. The first uses the expected variance from a simple AR(1) rather than realized variance ({\tt RV AR}), which helps to reduce the extremity of the weights. Second, we consider an alternative six-month window to estimate the longer-term realised variance ({\tt RV6}) as proposed by \citet{barroso2015momentum,barroso2021limits}. Third, we consider both a long-memory model for volatility forecast as proposed by \citet{corsi2009simple} ({\tt HAR}), and a standard AR(1) stochastic volatility model ({\tt SV}) (see, e.g., \citealp{taylor1994modeling}). Finally, we consider a plain GARCH(1,1) specification ({\tt Garch}), which has been proved a challenging benchmark in volatility forecasting (see, \citealp{hansen2005forecast}). \subsection{Main findings} Our empirical tests evaluate the performance of alternative volatility-managed implementations of a broad set of volatility managed portfolios, each of them constructed as \begin{align} y^\sigma_{t} & = \frac{c^*}{\widehat{\sigma}_{t-1|t}^2}y_{t}, \label{eq:volmanaged} \end{align} where $y^\sigma_{t}$ and $y_t$ are the scaled and the original portfolio's excess returns in month $t$, respectively. Here $\widehat{\sigma}_{t-1|t}^2$ is the variance forecast of the original portfolio's returns at month $t$ based on information available up to month $t-1$. We follow \citet{cederburg2020performance} and consider both an unconditional and a real-time implementation of volatility targeting. The former implies that the constant $c^*$ is chosen such that the unconditional variance of the managed $y^\sigma_{t}$ and unmanaged $y_{t}$ portfolios coincide. For the real-time implementation, $c_t^*$ is time-varying and is chosen such that the variance of the managed and unmanaged portfolios coincide only conditional on the returns up to month $t$. Most prior studies assess the value of volatility targeting strategies by comparing the Sharpe ratios obtained by scaled factors $y_t^\sigma$ as in Eq.\eqref{eq:volmanaged}, with the Sharpe ratios obtained from the original factors $y_t$ (see, e.g., \citealp{barroso2015momentum,daniel2016momentum,moreira2017volatility,bianchi2022taming}). We follow this approach and confirm the existing evidence in the literature that stand-alone investments in volatility-managed portfolios do not systematically improve upon unmanaged factors (see, e.g., \citealp{cederburg2020performance,barroso2021limits}). However, volatility targeting based on our smooth volatility forecasts substantially improves both upon conventional realised variance measures and a variety of competing volatility forecasting methods. Specifically, volatility-managed portfolios show a substantially lower turnover compared to alternative volatility forecasting methods. The right panel of Figure \ref{fig:weights} shows this case in point. The time variation of leverage for the volatility-managed market portfolio is much lower for our {\tt SSV} compared to a standard {\tt RV} or a lower-frequency {\tt RV6}. Perhaps more importantly, we show that greater portfolio stability translates into a substantially large risk-adjusted performance. For conservative levels of transaction costs, our {\tt SSV} produces a substantially higher economic utility compared to both standard and non-standard volatility forecasting methods. For each equity strategy and volatility-targeting methodology, we estimate the spanning regression on both the scaled and unscaled returns, \begin{align} y^\sigma_{t} & = \alpha + \beta y_t + \epsilon_t, \label{eq:spanning} \end{align} The economic implication of $\alpha>0$ is that volatility scaled portfolios may expand the mean-variance frontier relative to the unscaled portfolios (see, e.g., \citealp{gibbons1989test}). We test this assumption by comparing the certainty equivalent return (CER) when factoring in moderate levels of notional transaction costs, with and without leverage constraints. Specifically, we compare two strategies: (i) a strategy that allocates between a given volatility-managed portfolio and its corresponding original portfolio, and (ii) a strategy constrained to invest only in the original portfolio. The baseline combination correspond to the optimal mean-variance allocation assuming a risk aversion coefficient equal to five. We show that when transaction costs are considered, our {\tt SSV} stands out as the most profitable rescaling method, on average. Perhaps more interestingly, the {\tt SSV} is the only with a positive median CER differential with respect to the unmanaged portfolio strategies. That is, the economic gain is positive for at least 50\% of the equity strategies considered. Interestingly, a regularisation of the volatility targeting weights based on leverage constraints does not reduce the gap between our {\tt SSV} method and all the alternative weighting schemes we consider. Similarly, the economic gain from a mean-variance combination strategy of the unmanaged and managed portfolios is substantially in favour of our {\tt SSV} method. In addition to the empirical analysis on a broad set of equity trading strategies, we explore the statistical underpinnings of our modeling framework through an extensive simulation exercise. We compare the estimation accuracy of our VB inference scheme against state-of-the-art Bayesian methods, such as MCMC (see, e.g., \citealp{stochvol_package}) and variational Bayes (see, e.g., \citealp{chan_yu2022}). The results show that when we do not arbitrarily impose any smoothness in the posterior estimates of the latent stochastic volatility state, our algorithm is as accurate as MCMC and existing variational Bayes methods. Yet, when we smooth the posterior estimates the accuracy deteriorates. This is expected since the wavelet basis functions mechanically tilts the posterior estimates of the parameters towards a more persistent latent state relative to the actual data generating process. \subsection{Reference literature} In addition to \citet{moreira2017volatility}, our work contributes to a growing literature that seeks to understand the origins and the dynamic properties of volatility-managed portfolios (see, e.g., \citealp{harvey2018impact,bongaerts2020conditional,cederburg2020performance,liu2019volatility,barroso2021limits,wang2021downside}, among others). \citet{liu2019volatility} shows that a real-time implementation of volatility targeting suffers from severe drawdowns, compared to unmanaged portfolios. Similarly, \cite{cederburg2020performance} shows that volatility-managed portfolios do not systematically outperform the corresponding unmanaged equity strategies. We contribute to this literature by highlighting the importance of volatility modeling for the profitability of volatility-managed portfolios. Specifically, we show that smoothing the volatility forecasts provide an intuitive regularization to volatility targeting. This translates in an economically better performance versus realised variance measures when notional trading costs are factored in. In addition, we explicitly acknowledge that the uncertainty around the volatility predictions might be pervasive. By taking a Bayesian approach we can quantify the uncertainty around the scaled portfolio returns, so that a more direct statistical comparison between scaled and unscaled factors can be made. A second strand of literature we contribute to, relates to the estimation of stochastic volatility models. The non-linear interaction between the latent volatility state and the observed returns lead to a likelihood function that depends upon high dimensional integrals. A variety of estimation procedures have been proposed to overcome this difficulty, including the generalized method of moments (GMM) of \cite{melino_turnbull.1990}, the quasi maximum likelihood (QML) approach of \cite{harvey_etal.1994} and \cite{ruiz.1994}, and the efficient method of moments (EMM) of \cite{gallant_etal.1997}. Within the context of Bayesian methods, the analysis of stochastic volatility models has been initially proposed by \cite{kim_etal.1998,durbin_koopman.2000,jacquier_etal.2002,jacquier_etal.2004,shephard_pitt.2004,durbin_koopman.2000}. We contribute to this literature by proposing a novel variational Bayes estimation framework which allows to flexibly smooth the predictive density of the latent stochastic volatility state, irrespective of the underlying assumption about the data generating process. Our approach is general, meaning that encompasses different smoothness assumptions for the volatility forecasts without changing the underlying model structure. Finally, this paper connects to a third strand of literature that introduces the use of variational Bayes methods for economic forecasting (see, e.g., \citealp{gefang_koop_poon2019,koop_korobilis_2020,chan_yu2022}). Variational approximate methods \citep[][]{Bishop.2006} have become popular as computational feasible alternatives to Markov Chain Monte Carlo (MCMC) for approximating the posterior distributions. This type of inferential methods have been used in a wide range of applications, ranging from statistics \citep{rustagi.1976} to quantum mechanics \citep{sakurai.1994}, statistical mechanics \citep{parisi.1988}, machine learning \citep{hinton_vancamp.1993} and then generalized to many probabilistic models, taking advantage of the graphical models' representation \citep{jordan_etal.1999}. We contribute to this literature by proposing a flexible approximation based on a Gaussian Markov random field approximation of the latent stochastic volatility state. This allows to consider both non-smooth and smooth volatility forecasts based on a simple twist in the posterior approximating density of the latent state. \section{Modeling framework} \label{sec:univ_model} Let consider a standard univariate dynamic model with stochastic volatility \citep{taylor1994modeling}. A general specification is based on a state-space representation of the form: \begin{align} y_t &= \mathbf{x}_t^\intercal\beta + \exp(h_t/2)\varepsilon_t, &&\varepsilon_t\sim\mathsf{N}(0,1) \label{svm1a}\\ h_{t} &= c + \rho (h_{t-1}-c) + u_t, &&u_t\sim\mathsf{N}(0,\eta^2), \label{svm1b} \end{align} where $y_t$, $\mathbf{x}_t\in\mathbb{R}^p$, $h_t=\log\sigma_t^2$ are, respectively, the log-return, a set of covariates, and the log-volatility of an equity strategy at time $t$, for $t=1,2,\dots,n$. The error terms $\varepsilon_t$ and $u_t$ are mutually independent Gaussian white noise processes. The latent process in \eqref{svm1b} is a conventional autoregressive process of order one, with unconditional mean $c$, persistence $\rho$, and conditional variance $\eta^2$. We assume $|\rho|<1$, so that the initial state $h_0$ can be sampled from the marginal distribution, i.e. $h_0\sim\mathsf{N}\left(c,\frac{\eta^2}{1-\rho^2}\right)$. Notice that, for comparability with the existing literature on volatility-managed portfolios, we assume a constant mean $\mu$ in the observation equation \eqref{svm1a}, such that there are no covariates and $\mu=\mathbf{x}_t^\intercal\beta$ with $\mathbf{x}_t$ an n-dimensional vector of ones. However, in the following, we provide the full specification of our variational Bayes inference scheme under the general model with covariates. \subsection{Variational Bayes inference} A variational Bayes approach to inference requires to minimize the Kullback-Leibler ($\mathit{KL}$) divergence between an approximating density $q(\boldsymbol{\vartheta})$ and the true posterior density $p(\boldsymbol{\vartheta}|\mathbf{y})$, \citep[see, e.g.][]{Blei.2017}. The $\mathit{KL}$ divergence cannot be directly minimized with respect to $\boldsymbol{\vartheta}$ because it involves the expectation with respect to the unknown true posterior distribution. \cite{ormerod2010explaining} show that the problem of minimizing $\mathit{KL}$ can be equivalently stated as the maximization of the variational lower bound (ELBO) denoted by $\underline{p}\left(\mathbf{y};q\right)$: \begin{equation} \label{eq:vb_elbo_optim} q^*(\boldsymbol{\vartheta}) = \arg\max_{q(\boldsymbol{\vartheta}) \in \mathcal{Q}}\log\underline{p}\left(\mathbf{y};q\right),\quad \underline{p}\left(\mathbf{y};q\right)=\int q(\boldsymbol{\vartheta}) \log\left\{\frac{p(\mathbf{y},\boldsymbol{\vartheta})}{q(\boldsymbol{\vartheta})}\right\}\,d\boldsymbol{\vartheta}, \end{equation} where $q^*(\boldsymbol{\vartheta})\in\mathcal{Q}$ represents the optimal variational density and $\mathcal{Q}$ is a space of functions. The choice of the family of distributions $\mathcal{Q}$ is critical and leads to different algorithmic approaches. In this paper we consider two cases. The first is a mean-field variational Bayes (MFVB) approach which is based on a non-parametric restriction for the variational density, i.e. $q(\boldsymbol{\vartheta})=\prod_{i=1}^p q_i(\boldsymbol{\vartheta}_i)$ for a partition $\{ \boldsymbol{\vartheta}_1,\dots,\boldsymbol{\vartheta}_p\}$ of the parameter vector $\boldsymbol{\vartheta}$. Under the MFVB restriction, a closed form expression for the optimal variational density of each component $q(\boldsymbol{\vartheta}_j)$ is defined as: \begin{equation} q^\ast(\boldsymbol{\vartheta}_j) \propto \exp\left\{\mathbb{E}_{q(\boldsymbol{\vartheta}\setminus\boldsymbol{\vartheta}_j)}\Big[\log p(\mathbf{y},\boldsymbol{\vartheta})\Big] \right\},\qquad q(\boldsymbol{\vartheta}\setminus\boldsymbol{\vartheta}_j)=\prod_{\substack{i=1\\i\neq j}}^p q_i(\boldsymbol{\vartheta}_i),\label{eq:mfvb} \end{equation} where the expectation is taken with respect to the joint approximating density with the $j$-th element of the partition removed $q^\star(\boldsymbol{\vartheta}\setminus\boldsymbol{\vartheta}_j)$. This allows to implement a coordinate ascent variational inference (CAVI) algorithm to estimate the optimal density $q^*(\boldsymbol{\vartheta})$. Equation \eqref{eq:mfvb} shows that the factorization of $q(\boldsymbol{\vartheta})$ plays a central role in developing a MFVB algorithm. In the following, we consider a factorization of the joint variational density of the latent log-variances $\mathbf{h}$ and the parameters $\boldsymbol{\vartheta}=\left(\mbox{\boldmath $\beta$},c,\rho,\eta^2\right)$ of the form: \begin{equation} q(\mathbf{h},\boldsymbol{\vartheta}) = q(\mathbf{h})q(\boldsymbol{\vartheta}) = q(\mathbf{h})q(\mbox{\boldmath $\beta$})q(c)q(\rho)q(\eta^2). \end{equation} In the following, we focus on the approximating density for the latent process $\mathbf{h}$, where the novelty of our estimation procedure lies compared to the existing literature (see, e.g., \citealp{chan_yu2022}). For the interested reader, in Appendix \ref{app:params} we provide the full set of derivations of the optimal variational densities for the parameters $q(\mbox{\boldmath $\beta$})$, $q(c)$, $q(\rho)$, and $q(\eta^2)$. The marginal distribution $p\left(\mathbf{h}\right)$ of the joint vector $\mathbf{h}^\intercal=(h_0,h_1,\ldots,h_n)$ admits a Gaussian Markov random field (GMRF) representation $\mathbf{h}\sim\mathsf{N}_{n+1}(c\boldsymbol{\iota}_{n+1},\eta^2\mathbf{Q}^{-1})$ that preserves the time dependence structure implied by the autoregressive process. Specifically, the matrix $\mathbf{Q}=\mathbf{Q}(\rho)$ is a tridiagonal precision matrix with diagonal elements $q_{1,1}=q_{n+1,n+1}=1$ and $q_{i,i}=1+\rho^2$ for $i=2,\ldots,n$, and off-diagonal elements $q_{i,j}=-\rho$ if $|i-j|=1$ and $0$ elsewhere (see \citealp{rue_held.2005}). We exploit this representation to obtain the approximating density $q(\mathbf{h})$ as $\mathbf{h}\sim\mathsf{N}_{n+1}(\mbox{\boldmath $\mu$}_{q(h)},\mbox{\boldmath $\Omega$}_{q(h)}^{-1})$ with mean vector $\mbox{\boldmath $\mu$}_{q(h)}=\bW\mathbf{f}_{q(h)}$ and variance-covariance matrix $\mathbf{\Sigma}_{q(h)}=\mbox{\boldmath $\Omega$}_{q(h)}^{-1}$. Notice that the choice of $\mbox{\boldmath $\mu$}_{q(h)}$ as a linear projection $\bW\mathbf{f}_{q(h)}$, with $\mathbf{f}_{q(h)}\in\mathbb{R}^{k}$ the projection coefficients and $\bW$ an $(n+1)\times k$ deterministic matrix, has a direct effect on the posterior estimates of log-volatility. In Section \ref{subsec:MatrixW} we discuss in details how different structures of $\bW$ leads to different posterior estimates irrespective of the underlying dynamics of the latent state. This is a key feature of our estimation strategy since it allows to customise the volatility forecasts without changing the underlying model assumptions. In the following we focus on the more general heteroschedastic case, whereas the optimal density and the estimation details for the more restrictive homoschedastic case are discussed in Appendix \ref{app:homo_approx}. The optimal parameters $\boldsymbol{\xi}=(\mathbf{f}_{q(h)},\mathbf{\Sigma}_{q(h)})$ of the approximating density $q\left(\mathbf{h}\right)$ can be found by solving the optimization problem \begin{equation} \widehat{\boldsymbol{\xi}}=\arg\max_\xi \left\{\mathbb{E}_q(\log p(\by,\mathbf{h}))-\mathbb{E}_q(\log q(\mathbf{h}))\right\}, \end{equation} To solve the optimization we leverage on the GMRF representation of $q\left(\mathbf{h}\right)$ and exploit the results in \cite{rohde_wand2016}. They provide a closed-form updating scheme for the variational parameters when the approximating density is a multivariate Gaussian. Proposition \ref{eq:prop1} the details on the optimal updating scheme for the variational density of the latent volatility states. The proof and analytical derivations are available in Appendix \ref{app:hetero_approx}. A pseudo-code for the implementation of the proposed iterative estimation procedure is available in Algorithm \ref{code:VBSV} in Appendix \ref{app:algorithm_sv}. \begin{proposition}\label{eq:prop1} Let $\mbox{\boldmath $\mu$}_{q(\mathbf{s})}=(\mu_{q(s_1)},\ldots,\mu_{q(s_n)})^\intercal$ with $\mu_{q(s_t)} = (y_t-\mathbf{x}_t^\intercal\mbox{\boldmath $\mu$}_{q(\beta)})^2+\mathsf{tr}\left\{\mathbf{\Sigma}_{q(\beta)}\mathbf{x}_t\mathbf{x}_t^\intercal\right\}$, and $\mbox{\boldmath $\mu$}_{q(\beta)},\mathbf{\Sigma}_{q(\beta)}$ denote the variational mean and covariance of the regression parameters $\mbox{\boldmath $\beta$}$. Assuming a GMRF representation of $\mathbf{h}\sim\mathsf{N}_{n+1}(\mbox{\boldmath $\mu$}_{q(h)},\mbox{\boldmath $\Omega$}_{q(h)}^{-1})$, with mean vector $\mbox{\boldmath $\mu$}_{q(h)}=\bW\mathbf{f}_{q(h)}$ and variance-covariance matrix $\mathbf{\Sigma}_{q(h)}=\mbox{\boldmath $\Omega$}_{q(h)}^{-1}$, an iterative algorithm can be set as: \begin{align} \mathbf{\Sigma}_{q(h)}^{new} &= \left[\nabla_{\boldsymbol{\mu}_{q(h)}\boldsymbol{\mu}_{q(h)}}^2 S(\mbox{\boldmath $\mu$}_{q(h)}^{old},\mathbf{\Sigma}_{q(h)}^{old})\right]^{-1}, \\ \mathbf{f}_{q(h)}^{new} &= \mathbf{f}_{q(h)}^{old} + \bW^+\,\mathbf{\Sigma}_{q(h)}^{new}\nabla_{\boldsymbol{\mu}_{q(h)}} S(\mbox{\boldmath $\mu$}_{q(h)}^{old},\mathbf{\Sigma}_{q(h)}^{old}),\\ \mbox{\boldmath $\mu$}_{q(h)}^{new} &= \bW\mathbf{f}_{q(h)}^{new}, \end{align} with $\bW^+=(\bW^\intercal\bW)^{-1}\bW^\intercal$ the left Moore–Penrose pseudo-inverse of $\bW$, and $S(\mbox{\boldmath $\mu$}_{q(h)},\mathbf{\Sigma}_{q(h)})$ equal to $\mathbb{E}_q(\log p(\mathbf{h},\by))$ (see Eq.\ref{eq:seq_appendix}), such that, \begin{align} \nabla_{\boldsymbol{\mu}_{q(h)}} S(\mbox{\boldmath $\mu$}_{q(h)},\mathbf{\Sigma}_{q(h)}) &= -\frac{1}{2}[0,\boldsymbol{\iota}_n^\intercal]^\intercal+\frac{1}{2}[0,\mbox{\boldmath $\mu$}_{q(\mathbf{s})}^\intercal]^\intercal\odot\mathrm{e}^{-\boldsymbol{\mu}_{q(h)}+\frac{1}{2}\mathsf{diag}\left(\boldsymbol{\Sigma}_{q(\mathbf{h})}\right)} \\ &\qquad-\mu_{q(1/\eta^2)}\mbox{\boldmath $\mu$}_{q(\mathbf{Q})}(\mbox{\boldmath $\mu$}_{q(h)}-\mu_{q(c)}\boldsymbol{\iota}_{n+1}),\\ % \nabla_{\boldsymbol{\mu}_{q(h)}\boldsymbol{\mu}_{q(h)}}^2 S(\mbox{\boldmath $\mu$}_{q(h)},\mathbf{\Sigma}_{q(h)}) &=-\frac{1}{2}\mathsf{Diag}\Bigg[[0,\mbox{\boldmath $\mu$}_{q(\mathbf{s})}^\intercal]^\intercal\odot\mathrm{e}^{-\boldsymbol{\mu}_{q(h)}+\frac{1}{2}\mathsf{diag}\left(\boldsymbol{\Sigma}_{q(\mathbf{h})}\right)}\Bigg] -\mu_{q(1/\eta^2)}\mbox{\boldmath $\mu$}_{q(\mathbf{Q})}, \end{align} where $\boldsymbol{\iota}_n$ is an n-dimensional vector of ones, $\mu_{q\left(1/\eta^2\right)}$ is the variational mean of $1/\eta^2$, $\mbox{\boldmath $\mu$}_{q(\mathbf{Q})}$ is the element-wise variational mean of $\mathbf{Q}$, and $\odot$ denotes the Hadamard product. \end{proposition} Our approach expands the global approximation method proposed by \cite{chan_yu2022} along three main dimensions. First, we relax the assumption that the initial distribution $q(h_0)$ is independent on the trajectory of the latent state $q(\mathbf{h}_1)$, that is, we do not assume $q(\mathbf{h})=q(h_0)q(\mathbf{h}_1)$. Second, we do not make any assumption on the $\mathbf{\Sigma}_{q(h)}$, which is not fixed conditional on $\mbox{\boldmath $\mu$}_{q(h)}$, but is estimated jointly with $\mbox{\boldmath $\mu$}_{q(h)}$. Third, our latent volatility state accommodates a more general AR(1) dynamics, instead of a random walk. While the latter reduces the parameter space, it imposes a strong form of non-stationarity in the log-volatility process. In Section \ref{sec:sim_study}, we show via an extensive simulation study that all these features have a significant effect on the accuracy of the variational Bayes estimates. \subsubsection{Smoothing the volatility estimates} \label{subsec:MatrixW} The choice of $\mbox{\boldmath $\mu$}_{q(h)}$ as a linear projection $\bW\mathbf{f}_{q(h)}$, with $\mathbf{f}_{q(h)}\in\mathbb{R}^{k}$ the projection coefficients and $\bW$ an $(n+1)\times k$ deterministic matrix, has a direct effect on the posterior estimates of log-volatility. Figure \ref{fig:choice_of_W} shows examples of the shape of $\mbox{\boldmath $\mu$}_{q\left(\mathbf{h}\right)}=\bW\mathbf{f}_{q(h)}$ for difference choices of $\bW$ (solid line), and the corresponding confidence intervals implied by $\mathbf{\Sigma}_{q(h)}$ (dashed line). The gray trajectory represents the true simulated value of the log-stochastic volatility $\mathbf{h}^\intercal=(h_0,h_1,\ldots,h_n)$ for $n=300$. The top-left panel reports the posterior estimates obtained by setting $\bW=\mathbf{I}_{n+1}$, with $\mathbf{I}_{n+1}$ an identity matrix of dimension $n+1$. This represents a non-smooth estimate which is akin to the output of a standard MCMC estimation scheme (see, e.g., \citealp{stochvol_package}). The remaining panels of Figure \ref{fig:choice_of_W} highlight a key feature of our estimation strategy; that is, it allows to customise the volatility forecasts without changing the underlying model assumptions. For instance, the top-right panel shows the posterior estimates of the latent volatility state with $\bW$ a matrix of wavelet basis functions with a fixed degree of smoothness $l=4$ \citep[see][]{wand_ormerod.2011}. The fact that the matrix $\bW$ enters both in the conditional mean and covariance of the optimal variational density $q^\ast\left(\mathbf{h}\right)$ allows to smooth not only the conditional mean of the latent volatility state, but also the corresponding confidence intervals. The bottom panels in Figure \ref{fig:choice_of_W} highlight the flexibility of our approach; the left panel shows that more than one smoothing assumption can coexists in the same optimal variational density. For instance, the shape of the posterior estimates assuming $\bW=\mathbf{I}_{n+1}$ for the first half of the sample and $\bW$ a wavelet basis function with $l=4$ for the second half of the sample. The bottom-right panel shows that a variety of smoothing functions can be adopted; for instance, the estimates of the latent stochastic volatility can be smoothed based on $\bW$ equal to be a B-spline basis matrix representing the family of piecewise polynomials with the pre-specified interior knots ($kn$), degree ($dg$), and boundary knots. Figure \ref{fig:form_of_W} depicts the form of $\bW$ when B-spline and Daubechies wavelets are used. The form of $\bW$ in case of B-spline basis functions (top) and wavelet basis functions (bottom). Right panels correspond to columns of the matrix $\bW$. The B-spline basis functions is a sequence of piecewise polynomial functions of a given degree, in this case $dg=3$. The locations of the pieces are determined by the knots, here we assume $kn=20$ equally spaced knots. The functions that compose the wavelet basis matrix $\bW$ are constructed over equally spaced grids on $[0,n]$ of length $R$, where $R$ is called resolution and it is equal to $2^{l-1}$, where $l$ defines the level, and as a result the degree of smoothness. The number of functions at level $l$ is then equal to $R$ and they are defined as dilatation and/or shift of a more general {\it mother} function. \subsubsection{Variance prediction} \label{subsec:varianceprediction} Consider the posterior distribution of $p(\mathbf{h},\boldsymbol{\vartheta}|\mathbf{y})$ given the information set up to time $t$, $\mathbf{y}=\left\{y_{1:t}\right\}$, and $p(h_{n+1}|\mathbf{y},\mathbf{h},\boldsymbol{\vartheta})$ the likelihood for the new latent state $h_{n+1}$. The predictive density then takes the familiar form, \begin{equation}\label{eq:pred_post} p(h_{n+1}|\mathbf{y}) = \int p(h_{n+1}|\mathbf{y},\mathbf{h},\boldsymbol{\vartheta})p(\mathbf{h},\boldsymbol{\vartheta}|\mathbf{y}) \, d\mathbf{h} d\boldsymbol{\vartheta}. \end{equation} Given a variational density $q(\mathbf{h},\boldsymbol{\vartheta})=q(\mathbf{h})q(\boldsymbol{\vartheta})$ that approximates $p(\mathbf{h},\boldsymbol{\vartheta}|\mathbf{y})$, we follow \citet{gunawan2021variational} and obtain the variational predictive distribution: \begin{align} q(h_{n+1}|\mathbf{y}) &= \int p(h_{n+1}|\mathbf{y},\mathbf{h},\boldsymbol{\vartheta})q(\mathbf{h})q(\boldsymbol{\vartheta}) \, d\mathbf{h} d\boldsymbol{\vartheta} \nonumber\\ &= \int p(h_{n+1}|h_n,\boldsymbol{\vartheta})q(h_n)q(\boldsymbol{\vartheta}) \, dh_n d\boldsymbol{\vartheta},\label{eq:integral} \end{align} where the second equality follows from Markov property. Recall that within the context of a volatility-managed portfolio our object of interest is the forecast of the variance $\sigma_t^2$, rather than the log-volatility $h_t$ for $t=n+1$. Since $h_n=\log\sigma_n^2$, the density of the conditional variance is readily available as $q\left(\sigma_{n+1}^2|\mathbf{y}\right)=\frac{\partial h_{n+1}}{\partial\sigma_{n+1}^2}q\left(h_{n+1}|\mathbf{y}\right)=\frac{1}{\sigma_{n+1}^2} q\left(h_{n+1}|\mathbf{y}\right)$. The integral in Eq.\eqref{eq:integral} cannot be solved analytically. However, it can be approximated through Monte Carlo integration exploiting the fact that the optimal variational densities $q(h_n)$ and $q(\boldsymbol{\vartheta})$ are known and we can efficiently sample from them. A simulation-based approximated estimator for the variational predictive distribution of the conditional variance $q(\sigma^2_{n+1}|\mathbf{y})$ is therefore obtained by averaging the density $p(h_{n+1}|h_n^{(i)},\boldsymbol{\vartheta}^{(i)})$ over the draws $h_n^{(i)}\sim q(h_n)$ and $\boldsymbol{\vartheta}^{(i)}\sim q(\boldsymbol{\vartheta})$, for $i=1,\ldots,N$ from the optimal variational density, such that $\widehat{q}(\sigma^2_{n+1}|\mathbf{y}) = \frac{1}{\sigma_{n+1}^2}\frac{1}{N}\sum_{i=1}^N p(h_{n+1}|h_n^{(i)},\boldsymbol{\vartheta}^{(i)})$. \section{Simulation study and inference properties} \label{sec:sim_study} We now perform an extensive simulation study to evaluate the properties of our estimation framework in a controlled setting. We compare our variational Bayes ({\tt VB}) method against two state-of-the-art Bayesian approaches used within the context of stochastic volatility models, such as {\tt MCMC} (see, \citealp{stochvol_package}) and the global variational approximation recently introduced by \cite{chan_yu2022} (henceforth {\tt CY}). Since neither of the benchmark approaches entertain the possibility of arbitrarily smooth predictive densities, the baseline comparison is based on the assumption that $\bW=\mathbf{I}_{n+1}$ and the underlying latent state follows an autoregressive dynamics. This gives a cleaner comparison of the accuracy of our variational estimates both in absolute terms and with respect to {\tt MCMC} methods. We compare each estimation method across $N=100$ replications and for all different specifications. We consider $T=600$, consistent with the shortest time series in the empirical application, $c=0$, $\eta^2=0.1$ and both low and high persistence $\rho\in\{0.70,0.98\}$. Recall that our estimation framework is agnostic on the structure of covariance of the approximating density $\mathbf{\Sigma}_{q(h)}$ (see Proposition \ref{eq:prop1}). However, to better understand the contribution of such generalisation compared to existing methods, we also consider the performance of a more tight parametrization with $\mathbf{\Sigma}_{q(h)}=\tau^2\mathbf{Q}^{-1}$, where $\tau^2\in\mathbb{R}^+$ and $\mathbf{Q}=\mathbf{Q}(\gamma)$ (henceforth {\tt VBH}). This provides an homoschedastic representation of the approximating density in the spirit of \citet{chan_yu2022}, which further simplifies the estimation of $\mathbf{f}_{q(h)}$, $\tau^2$, and $\gamma$. Figure \ref{fig:simaccuracy} reports the mean squared error and a measure of global estimation accuracy compared to the {\tt MCMC}. The mean squared error is measured as $MSE=n^{-1}\sum_{t=1}^n(h_t-\hat{h}_t)^2$, where $h_t$ and $\hat{h}$ are the simulated log-variance and its estimate, respectively. The average aggregated accuracy of variatonal Bayes with respect to the {\tt MCMC} approach is calculated as: \begin{equation} \mathcal{ACC}=100\left\{1-0.5\int|q(\mathbf{h})-p(\mathbf{h}|\mathbf{y})|\,d\mathbf{h}\right\}\%,\label{eq:accuracy} \end{equation} where $p(\mathbf{h}|\mathbf{y})$ is the {\tt MCMC} posterior and $q(\mathbf{h})$ is the comparing variational Bayes approximation (see \citealp{wand_ormerod.2011}). For the higher-persistence scenario with $\rho=0.98$ (top panels), the {\tt MCMC}, {\tt CY}, {\tt VB}, and {\tt VBH} provide statistically equivalent performances. The best approximation to the {\tt MCMC} is provided by our {\tt VB} for $\rho=0.98$. Interestingly, for the lower-persistent scenario with $\rho=0.70$ (bottom panels), the {\tt CY} approach shows some difficulty in capturing the full extent of the dynamics of the latent stochastic volatility process. This is also reflected in a generally lower accuracy in approximating the true posterior density $p(\mathbf{h}|\mathbf{y})$ compared to the {\tt MCMC} approach. The lower accuracy of the {\tt CY} approach for $\rho=0.7$ is due to a more restrictive dynamics of the latent state imposed by their estimation setting. The approximation proposed by \cite{chan_etal.2021} is based on the computationally convenient assumption that the latent volatility state is a random walk. As a result, it shows a substantially lower accuracy when $\rho\ll1$. Although neither the {\tt CY} nor the {\tt MCMC} approach entertain the possibility of smooth volatility forecasts, for a full comparison of the estimation accuracy of our {\tt VB} method we also evaluate the performance of two alternative smoothing approaches, with $\bW$ either a B-spline basis matrix with knots equally spaced every 10 time points (henceforth {\tt VBS}), or a Daubechies wavelet basis matrix with $l=5$ (henceforth {\tt VBW}).\footnote{The choice of the equally spaced knots in the basis function and the $l$ for the wavelet basis matrix is such that both approaches give a similar degree of smoothness.} Notice that both these modifications of $\bW$ represent an arbitrary intervention on the approximating density $q\left(\mathbf{h}\right)$. Compared to the baseline {\tt VB}, the smooth approximations have a lower accuracy in the estimate of the underlying AR(1) latent process. Interestingly, similar to {\tt CY} the global accuracy with respect to the {\tt MCMC} deteriorates as the persistence of the latent log-volatility process decreases. The last column of Figure \ref{fig:simaccuracy} shows that our variational Bayes is less computationally expensive compared to both {\tt MCMC} and {\tt CY} methods. The gain in terms of computational cost holds for both highly persistent latent stochastic volatility (top-right panel) and lower-persistent volatility (bottom-right panel). More generally, our {\tt VB} is almost an order of magnitude faster than {\tt MCMC}, on average. This intuitively represents an advantage when implementing real-time predictions for more than a 150 equity strategies, as in our main empirical application. Figure \ref{fig:simaccuracy} suggests that the accuracy of our variational Bayes estimation framework deteriorates when smoothness on the latent state is imposed via the structure in $\bW$. We now investigate more in details why that is the case by looking at the posterior estimates of the parameters of interest $\{c,\eta^2,\rho\}$ for difference specifications of $\bW$. Figure \ref{fig:sim_par_hat} shows that by imposing smoothness in the form of either B-spline or a Daubechies wavelet basis forces the posterior estimates of $\rho$ to be close to one, irrespective of the actual level of persistence in the underlying latent process. Similarly, the estimates of the latent state variance $\eta^2$ are smaller for both {\tt VBS} and {\tt VBW} versus {\tt MCMC}'s, and even more so when $\rho=0.7$. Figure \ref{fig:sim_par_hat} confirms the intuition that a lower accuracy of the posterior estimates of the latent state is due to a tight regularization of the parameters implied by smoothing. The effect on the conditional variance estimates is particularly striking. Beside the possibility of introducing smoothness in the estimates, our variational Bayes approach relax the assumption that the initial distribution $q(h_0)$ is independent on the trajectory of the latent state $q(\mathbf{h}_1)$, that is, we do not assume $q(\mathbf{h})=q(h_0)q(\mathbf{h}_1)$. Figure \ref{fig:sim_acc_time} shows that this generalisation has a non-negligible impact on the posterior estimate of the latent state, especially at the beginning on the sample. This is shown by comparing the global accuracy for different slices of observations. The top (bottom) panels report the global accuracy when $\rho=0.98$ ($\rho=0.7$). We report the estimation results for $t\in\left(1,10\right)$ in the left panel, $t\in\left(301,310\right)$ in the middle panel, and $t\in\left(591,600\right)$ in the right panel. The simulation results show that our variational Bayes approach maintains an optimal performance over all the timeline. On the other hand, the accuracy of {\tt CY} drops at the beginning of the time series. This is due to the restrictive independence assumption between the initial condition and the rest of the latent state trajectory $q(\mathbf{h})=q(h_0)q(\mathbf{h}_1)$. \section{Empirical results} \label{sec:appl} We now investigate the statistical and economic value of our smooth volatility forecast within the context of volatility targeting across a large set of equity strategies. We first consider the nine equity factors examined by \citet{moreira2017volatility}. We collect daily and monthly data on the excess returns on the market, and the daily and monthly returns on the size, value, profitability and investment factors as originally proposed by \citet{fama2015five}, in addition to the profitability and investment factors from \citet{hou2015digesting} and the betting-against-beta factor from \citet{frazzini2014betting}.\footnote{Data on the \citet{fama2015five} factors and the \citet{jegadeesh1993returns} momentum are available on the Kenneth French's website at \url{http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html}. Data on the betting-against-beta factor are available on the AQR website \url{https://www.aqr.com/Insights/Datasets/Betting-Against-Beta-Original-Paper-Data}.} We augment the first group of test portfolios with a second group covering a broader set of trading strategies based on established asset pricing factors. We start with the list of 153 characteristic-managed portfolios, or ``factors'', reported in \citet{jensen2021there}. We then restrict our analysis to value-weighted strategies that can be constructed using the Center for Research in Security Prices (CRSP) monthly and daily stock files, the Compustat Fundamental annual and quarterly files, and the Institutional Broker Estimate (IBES) database. In addition, we exclude a handful of strategies for which there are missing returns. This process identifies 149 value-weighted long-short portfolios for which we collect both daily and monthly returns. For a more detailed description of the portfolio construction we refer to \citet{jensen2021there}.\footnote{Data on the 153 set of characteristic-based portfolios can be found at \url{https://jkpfactors.com}. We thank Bryan Kelly for making these data available.} The combined sample consists of 158 equity trading strategies. \subsection{Construction of volatility-managed portfolios} For a given equity trading strategy, let $y_t$ be the buy-and-hold excess portfolio return in month $t$. We follow \citet{moreira2017volatility} and construct the corresponding volatility-managed portfolio return $y^\sigma_{t}$ as \begin{align} y^\sigma_{t} & = \frac{c^*}{\widehat{\sigma}_{t-1|t}^2}y_{t}, \label{eq:volmanaged1} \end{align} where $c^*$ is a constant chosen such that the unconditional variance of the managed $y^\sigma_{t}$ and unmanaged $y_{t}$ portfolios coincide, and $\widehat{\sigma}_{t-1|t}^2$ is the variance forecast of unscaled portfolio returns based on information available up to the previous month $t-1$. The objective of Eq.\eqref{eq:volmanaged1} is to adjust the capital invested in the original equity strategy based on the inverse of the (lagged) predicted variance. Effectively, a volatility-managed portfolio is targeting a constant level of volatility, rather than a constant level of notional capital exposure. As such, the dynamics investment position in the underlying portfolio $\frac{c^*}{\widehat{\sigma}_{t-1|t}^2}$ is a measure of (de)leverage required to invest in the volatility-portfolio in month $t$. Notice that in the standard implementation in Eq.\eqref{eq:rv} the scaling parameter $c^*$ is not know by an investor in real time as it requires to observe the full time series of the unscaled returns $y_t$ and the volatility forecasts $\widehat{\sigma}_{t|t-1}^2$. A benchmark approach to approximate the variance forecast at month $t$, $\widehat{\sigma}_{t-1|t}^2$ is to use the previous month's realized variance (henceforth {\tt RV}) calculated based on daily portfolio returns (see, e.g., \citealp{barroso2015momentum,daniel2016momentum,moreira2017volatility,cederburg2020performance,barroso2021limits}), \begin{align} \widehat{\sigma}_{t|t-1}^2 & = \frac{22}{\mathcal{N}_{t-1}}\sum_{j=1}^{\mathcal{N}_{t-1}}y_{j,t-1}^2,\label{eq:rv}, \end{align} where $y_{j,t-1}$ be the excess returns on a given portfolio in day $j=1,\ldots,\mathcal{N}_{t-1}$ for month $t-1$. In addition to the realised variance, we compare our smoothing volatility targeting approach ({\tt SSV}) against a variety of alternative rescaling approaches. The first uses the expected variance from a simple AR(1) rather than realized variance ({\tt RV AR}), which helps to reduce the extremity of the weights. Second, we follow \citet{barroso2021limits} and consider an alternative six-month window to estimate the longer-term realised variance ({\tt RV6}). Third, we consider both a long-memory model for volatility forecast as proposed by \citet{corsi2009simple} ({\tt HAR}), and a standard AR(1) latent stochastic volatility model ({\tt SV}) (see, e.g., \citealp{taylor1994modeling}). Finally, we consider a plain GARCH(1,1) specification ({\tt Garch}), which has been shown to be a challenging benchmark in volatility forecasting (see, \citealp{hansen2005forecast}). Throughout the empirical analysis we consider, we follow \citet{cederburg2020performance} and consider both unconditional volatility targeting -- whereby $c^*$ is calibrated to match the unconditional volatility of the scaled and unscaled portfolios --, as well as real-time volatility targeting -- whereby $c_t^*$ is calibrated to match the volatility of the scaled and unscaled portfolios at each month $t$. \subsection{A simple statistical appraisal} In this section we provide a statistical appraisal of the performance of our smoothing volatility targeting approach compared to both conventional realised variance measures and benchmark volatility forecasts. This is based on the predictive density of the volatility forecasts obtained for both the non-smooth {\tt SV} and smooth {\tt SSV} stochastic volatility models. Recall that real-time volatility targeting for month $t$ takes the form $\omega_{t}=\frac{c_t^*}{\widehat{\sigma}_{t|t-1}^2}$, $t=1,\ldots,n$. As a result, given the unmanaged factors $y_{t}$ and the recursively calibrated coefficient $c_t^*$, for each month we can define the distribution of the volatility-managed returns based on the variational predictive density $q(\sigma^2_{t}|\mathbf{y})$ with $\mathbf{y}$ collecting the strategy returns up to $t-1$ (see Section \ref{subsec:varianceprediction} for more details). Figure \ref{fig:testing example} shows this case in point. The top panels report the distribution of the volatility-managed portfolio returns implied by the non-smooth {\tt SV} (red area) and smooth {\tt SSV} (blue area) stochastic volatility models. For the sake of simplicity, we report the volatility-managed returns on the market portfolio over three distinct months. The returns on the unmanaged portfolio and its scaled version based on previous month's realised variance are indicated as a white and green circle, respectively. By comparing this distribution on a given month with the realised returns on a benchmark strategy for the same month, we can calculate $\text{Prob}\left(y_t^{\mathcal{M}_1}<y_t^{\mathcal{M}_0}\right)$, which is akin to the p-value on a one-side test where the null hypothesis is $\mathcal{H}_0: y_t^{\mathcal{M}_1}\leq y_t^{\mathcal{M}_0}$. For instance, a $\text{Prob}\left(y_t^{\mathcal{M}_1}<y_t^{\mathcal{M}_0}\right)<0.05$ implies that the null hypothesis $\mathcal{H}_0$ is rejected with a p-value of 0.05 in favour of the alternative $\mathcal{H}_1: y_t^{\mathcal{M}_1}>y_t^{\mathcal{M}_0}$. On the opposite, if $\text{Prob}\left(y_t^{\mathcal{M}_1}<y_t^{\mathcal{M}_0}\right)>0.05$, the null hypothesis $\mathcal{H}_0$ can not be rejected with a p-value of 0.05. Here $y_t^{\mathcal{M}_0}$ represents the returns on the benchmark volatility managing method, for e.g., {\tt RV}, whereas $y_t^{\mathcal{M}_1}$ the returns on volatility targeting based on either a non-smooth or a smooth stochastic volatility model. The left panel shows the results for October 1995. The $\text{Prob}\left(y_t^{{\tt SSV}}<y_t^{{\tt RV}}\right)=0.07$, that is the null $\mathcal{H}_0: y_t^{{\tt SSV}}\leq y_t^{{\tt RV}}$ can not be rejected at standard significance levels. Similarly, $\text{Prob}\left(y_t^{{\tt SSV}}<y_t^{{\tt U}}\right)=0.66$, which again suggests that the returns on the {\tt SSV} volatility targeting and the unmanaged counterpart are statistically equivalent. The right panel of Figure \ref{fig:testing example} show as another example the returns distribution on March 2009. The probability $\text{Prob}\left(y_t^{{\tt SSV}}<y_t^{{\tt RV}}\right)=0$, that is the null hypothesis $\mathcal{H}_0: y_t^{{\tt SSV}}\leq y_t^{{\tt RV}}$ is rejected with a p-value of 0.000 in favour of the alternative $\mathcal{H}_1: y_t^{{\tt SSV}}>y_t^{{\tt RV}}$. On the other hand, $\text{Prob}\left(y_t^{{\tt SV}}<y_t^{{\tt RV}}\right)=0.08$, which suggests that the {\tt SV} model produce a volatility-managed portfolio which is statistically equivalent to the one implied by a realised variance {\tt RV}. Similarly we can setup the opposite one-side test, which is for the null hypothesis $\mathcal{H}_0: y_t^{{\tt SSV}}\geq y_t^{{\tt RV}}$ against the alternative $\mathcal{H}_1: y_t^{{\tt SSV}}< y_t^{{\tt RV}}$. The bottom panel of Figure \ref{fig:testing example} shows that the distribution of {\tt SSV} and {\tt SV} can be highly time varying. The figure shows as an example the distribution of the returns on a volatility-managed momentum portfolio. The large negative performance of the unmanaged momentum strategy in March-May 2009 coincides with the so-called ``momentum crashes'' (see \citealp{barroso2015momentum,daniel2016momentum,bianchi2022taming}). Two interesting facts emerge. First, and perhaps not surprisingly, a non-smooth stochastic volatility model tends to produce relatively similar volatility adjusted returns with few exceptions. In this respect, a standard {\tt RV} rescaling substantially overperform (underperform) the unmanaged portfolio during periods of large negative (positive) returns. Put it differently, standard volatility targeting helps to mitigate tail risk at the expense of cutting upside opportunities. This is consistent with the abundant empirical evidence that indeed, on average, {\tt RV} targeting does not systematically outperforms unmanaged portfolios. The second interesting fact pertains our smoothing volatility targeting; the returns on the {\tt SSV} are closer to the original equity strategy. We now take to task the intuition highlighted in Figure \ref{fig:testing example} and compare our {\tt SSV} methodology against all of the competing volatility targeting methods, across all of the 158 equity strategies in our sample. Specifically, we calculate each month two indicator dummies $\mathbb{I}^+_{i,t},\mathbb{I}^-_{i,t}$ for each of the $t=1,\ldots,n$ and each of the $i=1,\ldots,m$ equity trading strategies, \begin{align} \mathbb{I}^+_{i,t} & =\Bigg\{\begin{array}{cc} 1 & \text{if\ \ Prob}\left(y_{i,t}^{{\tt SSV}}<y_{i,t}^{\mathcal{M}_0}\right)<0.05\\ 0 & \text{otherwise} \end{array}\Bigg.\ \qquad \mathbb{I}^-_{i,t} & =\Bigg\{\begin{array}{cc} 1 & \text{if\ \ Prob}\left(y_{i,t}^{{\tt SSV}}>y_{i,t}^{\mathcal{M}_0}\right)<0.05\\ 0 & \text{otherwise} \end{array}\Bigg.\label{eq:probabilities} \end{align} We can then calculate $p^+_i = n^{-1}\sum_{t=1}^n\mathbb{I}^+_{i,t}$ and $p^-_i = n^{-1}\sum_{t=1}^n\mathbb{I}^-_{i,t}$, with $n$ the sample of observations, for each equity trading strategy. These indicate the frequency over the full sample with which the null hypothesis $\mathcal{H}_0$ is rejected in favour of the alternative $\mathcal{H}_1: y_t^{{\tt SSV}}>y_t^{\mathcal{M}_0}$, i.e., $p^+_i$, or the alternative $\mathcal{H}_1: y_t^{{\tt SSV}}<y_t^{\mathcal{M}_0}$, i.e., $p^-_i$. Figure \ref{fig:testing results} reports the difference between $p^+_i$ and $p^-_i$ for all 158 equity strategies. This indicates the imbalance between outperformance and underpeformance of our $y_{i,t}^{\tt SSV}$ compared to a benchmark $y_{i,t}^{\mathcal{M}_0}$. The left panel compares our {\tt SSV} against the original factor portfolios {\tt U} and the volatility targeting based on the realised variance {\tt RV}. The comparison against the unscaled factors confirms the results of \citet{cederburg2020performance}; there is no systematic outperformance of volatility targeting versus unmanaged equity strategies over the sample under investigation. This is reflected in the fact that the difference between $p_i^+$ and $p_i^-$ is centered around zero for the cross section of equity strategies. The middle and right panel also confirms that, unconditionally over the full sample, the performance of our {\tt SSV} does not systematically dominate other competing volatility targeting methods. For instance, the spread $p_i=p_i^+-p_i^-$ is as low as -0.1 and as high as 0.05 when comparing {\tt SSV} vs {\tt RV6}. Similarly, $p_i$ ranges between -0.05 and 0.05 when comparing our {\tt SSV} against the {\tt HAR} or the {\tt Garch} methods. The results in Figure \ref{fig:testing results} show that the returns on volatility-managed portfolios are statistically equivalent to unscaled factors, at least unconditionally. We now look at a conditional aggregation of the indicators $\mathbb{I}^+_{i,t}$ and $\mathbb{I}^-_{i,t}$. Specifically, we construct a $p^+_t = m^{-1}\sum_{i=1}^m\mathbb{I}^+_{i,t}$ and $p^-_t = m^{-1}\sum_{i=1}^m\mathbb{I}^-_{i,t}$, with $m$ the number of equity strategies, for month $t=1,\ldots,n$. Figure \ref{fig:testing results ts} reports the spread $p_t=p_t^+-p_t^-$ across the whole sample of observations. The left panel compares the performance of {\tt SSV} versus {\tt RV} and the unmanaged factors {\tt U}. Two interesting facts emerge; first, for the most part of the sample the performance of the {\tt SSV} is subpar compared to the {\tt RV}. This is primarily concentrated in the expansionary periods, whereby volatility is low and the exposure to the original unscaled portfolios is levered up (see, e.g., Figure \ref{fig:weights}). Second, a smooth volatility targeting substantially improves upon {\tt RV} during the recession in the aftermath of the dot-com bubble and the great financial crisis of 2008/2009. Interestingly, most of the underperformance of {\tt SSV} versus {\tt U} is concentrated during the burst of the dot-com bubble. A possible explanation is that volatility-targeting implies a deleveraging on the original factor, in period in which high volatility did not necessarily correspond to large losses in the original equity factors. The middle and right panel in Figure \ref{fig:testing results ts} shows that alternative volatility measures to {\tt RV} share a similar pattern compared to our {\tt SSV}; that is, by smoothing volatility forecasts the performance during major recessions improves at the expenses of a subpar performance during economic expansions and/or lower-volatility periods. \subsection{Economic evaluation} We begin our analysis by presenting detailed results on direct performance comparison between unscaled and scaled portfolios without considering transaction costs. Next, we build upon \citet{moreira2017volatility,cederburg2020performance} and consider two distinct levels of notional transaction costs to implement volatility targeting. Finally, we compare our {\tt SSV} volatility targeting against both {\tt RV} and other competing forecasting methods when both transaction costs and leverage constraints are considered (see, e.g., \citealp{barroso2021limits}). \subsubsection{Baseline results without transaction costs} Table \ref{tab:Returns} reports the annualised Sharpe ratio (henceforth SR) and the Sortino ratio, for both unconditional and real-time volatility targeting. For each performance measure, we report both the mean value and the 2.5th, 25th, 50th, 75th, and 97.5th percentiles across all the 158 equity trading strategies. Both the original and the volatility-managed factors yield a positive annualised Sharpe ratio, on average. The risk-adjusted performance is comparable across volatility estimates. For instance, the annualised SR from the {\tt RV} is 0.28 against 0.26 from {\tt SSV}. The dispersion of SRs across equity strategies is also quite comparable across methods. For instance, the 97.5th percentile in the distribution of SRs is 0.69 for the {\tt SSV} against 0.81 from a six-month realised variance {\tt RV6}. To determine whether the SR from a given volatility-managed portfolio is statistically different from its unmanaged counterpart, we follow \citet{cederburg2020performance} and implement a block bootstrap approach as proposed by \citet{jobson1981performance,ledoit2008robust}. Table \ref{tab:Returns} reports the percentage -- out of all 158 equity strategies -- of SR differences that are positive or negative, and are statistically significant at the 5\% level. The results in Table \ref{tab:Returns} confirms the existing evidence in the literature that volatility-managed portfolios do not systematically outperform their original counterparts (see, e.g., \citealp{barroso2021limits}). For instance, {\tt RV} yields a significantly larger (smaller) SR compared to unmanaged portfolios for 6\% (2.5\%) of the 158 equity trading strategies considered. The percentage of higher and significant SRs slightly improves when using our {\tt SSV} method versus both {\tt RV} and all other competing volatility forecasts. Nevertheless, the percentage of significant and positive SRs tend to be quite similar across different volatility targeting estimates. Table \ref{tab:Returns} also reveals that the gross performance across methods is quite comparable when looking at the risk-adjusted returns with a focus on downside risk only. For instance, the average Sortino ratio is 1.44, which is smaller than the 1.77 obtained from the {\tt RV}, but economically fairly close. Again, the Sortino ratios are fairly comparable across scaling methods. Existing evidence on the performance of volatility-managed portfolios follows from a spanning regression approach of the form $y_t^\sigma=\alpha + \beta y_t+\epsilon_t$. The object of interest is the intercept $\alpha$, that is a positive $\alpha$ implies that a combination of the original unmanaged factor and its volatility-managed counterpart expands the mean-variance frontier compared to investing in the original unscaled portfolio alone (see, e.g., \citealp{gibbons1989test}). The top panel in Table \ref{tab:spanning regression} reports the mean alpha (in \%) across all the 158 equity strategies obtained from different volatility target methods. Similar to the Sharpe ratios, we report the 2.5th, 25th, 50th, 75th, and 97.5th percentile of the alphas across all rescaled portfolios, in addition to the mean value across equity strategies. Volatility targeting based on realised variance {\tt RV} achieves the highest average gross $\alpha$ (1.68\%), on par with the six-month realised variance {\tt RV6}. This holds both for the unconditional and the real-time volatility implementation. The fraction of positive and significant gross alphas -- at a 5\% level --, is also higher for the {\tt RV} and {\tt RV6} methods. \citet{moreira2017volatility} link their spanning test results to appraisal ratios and utility gains for investors. Both metrics can be red in the context of mean-variance portfolio choice. The appraisal ratio for a given scaled strategy is $AR=\widehat{\alpha}/\widehat{\sigma}_\varepsilon$, where $\widehat{\alpha}$ is the estimated gross alpha from the spanning regression and $\widehat{\sigma}_\varepsilon$ the root mean squared error. The squared of the appraisal ratio reflects the extent to which volatility management can be used to increase the slope of the mean-variance frontier (see, \citealp{gibbons1989test}). The mid panel of Table \ref{tab:spanning regression} shows the results for both unconditional and real-time volatility targeting. On average, the appraisal ratio from the {\tt RV} is higher (0.05) compared to our {\tt SSV} (0.03). The cross-sectional distribution of the ARs is quite symmetric, as the mean and median estimates tend to coincide. Perhaps more interesting is the fact that the estimates of the $\widehat{\alpha}$ from the spanning regressions can be used to quantify the utility gain from volatility management. This is achieved by comparing the certainty equivalent return (CER) for the investor who has access to both the original and the volatility-managed factor against the investor who is constrained to the original equity strategy only. We follow \citet{cederburg2020performance,barroso2021limits} and define the difference in CER from the unmanaged and the scaled portfolios as \begin{align} \Delta\text{CER}& = \frac{\text{SR}\left(z^*_t\right) - \text{SR}\left(y_t\right)}{2\gamma},\notag \end{align} where $\text{SR}\left(y_t\right)$ is the Sharpe ratio of the unscaled portfolio and $\text{SR}\left(z^*_t\right)$ is the Sharpe ratio of the combined strategy $z_t=x_\sigma\omega_t + x$, with $\omega_t=\frac{c^*}{\widehat{\sigma}_{t|t-1}^2}$. The ex post optimal policy $\left[x_\sigma,\ x\right]^{\prime}=\frac{1}{\gamma}\widehat{\Sigma}^{-1}\widehat{\mu}$ allocates a static weight $x_\sigma$ to the volatility-managed portfolio and a static $x$ weight on the original factor, based on the sample covariance $\widehat{\Sigma}$ and the sample mean $\widehat{\mu}$ returns of the scaled and unscaled portfolios. This policy is equivalent to dynamically adjust the exposure to the original factor portfolio according to $z_t$, so that the returns on the combined strategy can be obtained as $z^*_t=z_t\cdot y_t$. The bottom panel of Table \ref{tab:spanning regression} reports $\Delta CER$(\%) for the unconditional and real-time volatility targeting. We follow \citet{cederburg2020performance,wang2021downside} and consider a risk aversion coefficient equal to $\gamma=5$. The $\Delta CER$ confirms that volatility targeting based on realised variance does indeed expands ex post the mean-variance frontier relative to the other volatility targeting methods, when no transaction costs or cost-mitigation strategies are considered. For instance, the $\Delta CER$ from the {\tt RV} is 18\% versus 9\% obtained from our {\tt SSV} smoothing volatility forecast. Interestingly, a slightly smoother estimate of realised volatility, i.e., {\tt RV6}, produces a higher $\Delta CER$(\%), both unconditionally and in real time. \subsubsection{Turnover and leverage} A standard volatility targeting strategy is built upon scaling the original portfolio returns by $\frac{c^*}{\widehat{\sigma}_{t|t-1}^2}$. The often erratic nature of $\widehat{\sigma}_{t|t-1}^2$ based on realised volatility implies that volatility-managed portfolios are associated with high turnover and significant time-varying leverage $\omega_t$. This is likely to cast doubt on the actual usefulness of volatility targeting portfolios under common liquidity constraints (see \citealp{moreira2017volatility,harvey2018impact,bongaerts2020conditional,patton2020you,barroso2021limits}). Table \ref{tab:turnover} shows the amount of portfolio turnover for different volatility targeting methods. The portfolio turnover is calculated as the average absolute change of the leverage weights $|\Delta w|$ (see \citealp{moreira2017volatility}). We report the mean turnover as well as the 2.5th, 25th, 50th, 75th, and 97.5th percentile across the 158 equity strategies. Clearly, our {\tt SSV} method substantially reduces the portfolio turnover compared to all other volatility forecasting methods. For instance, the turnover from the {\tt RV} is 0.65 against a 0.05 from {\tt SSV}, on average across equity strategies. Our {\tt SSV} produces a lower turnover not only on average, but for the full cross section of equity strategies. For instance, the 2.5th (97.5th) percentile is 0.03 (0.06) for the {\tt SSV} against a 0.51 (0.91) from {\tt RV}. Perhaps not unexpectedly, the six-month realised variance implies a lower turnover compared to {\tt RV}. Nevertheless, our {\tt SSV} stands out in terms of portfolio stability, both within the context of unconditional or real-time volatility targeting. The middle panel of Table \ref{tab:turnover} also reports the average leverage implied by volatility targeting, i.e., $\omega_t=\frac{c^*}{\widehat{\sigma}_{t|t-1}^2}$. The real-time implementation of the {\tt RV} portfolio scaling implies a leverage that is almost twice as large as the one implied by {\tt SSV} volatility targeting (0.73). Differences across volatility methods are lower for the unconditional targeting. In addition, the bottom panel shows that our smoothing volatility forecasting method significantly reduce liquidity demand, that is increases the stability of $\omega_t$ over time. For instance, the variability of leverage from {\tt SSV} is half (0.43) compared to {\tt RV} (1.09). The leverage mitigation effect of {\tt SSV} is even more clear when looking at the real-time implementation; the standard deviation of $w_t$ is 0.27, on average across equity strategies. This compares to 1.21, 1, and 0.85 from the {\tt RV}, {\tt RV6} and {\tt RV AR}, respectively. \subsubsection{Main specification with transaction costs} \label{subsec:transaction costs} Table \ref{tab:turnover} shows that alternative scaling methods, such as {\tt HAR}, {\tt Garch} and {\tt RV AR} indeed helps to stabilise volatility managing compared to a standard {\tt RV}. Yet, our smoothing volatility prediction {\tt SSV} generates by the lowest and most stable liquidity demand across all methods. For each equity factor we now consider the costs of the leverage adjustment associated with volatility targeting. We follow \citet{moreira2017volatility,wang2021downside} and consider two alternative levels of transaction costs of 14 basis points (bps) of the notional value traded to implement volatility targeting (see, e.g., \citealp{frazzini2012trading}) and a more conservative 50 basis points (see, e.g., \citealp{wang2021downside}). Table \ref{tab:Returns_tc} reports the net-of-costs performance statistics for the managed factors. After 14 bps costs, the average SR for {\tt RV} decreases from 0.23 to 0.17. With a more conservative level of transaction costs, the average SR from {\tt RV} turns to a negative -0.11 annualised. This is in stark contrast of what we obtain by smoothing the volatility predictions; that is, our {\tt SSV} generates a remarkable stable SR of 0.25 and 0.23 after 14 and 50 basis points of notional trading costs, respectively. Perhaps more importantly, only 10\% of volatility-managed portfolios produce a significantly lower SR compared to the unmanaged counterpart even with conservative 50 bps of trading costs. This is in contrast to {\tt RV}, for which 79\% of Sharpe ratios are significantly lower than the unscaled portfolios. Furthermore, when we consider 50 basis points of transaction costs, the Sortino ratio from {\tt SSV} is 1.38 versus -0.69 from {\tt RV}, 0.85 from {\tt RV6} and 0.98 from a {\tt Garch} model, respectively. Table \ref{tab:spanning regression tc} reports the results for the spanning regression $y_t^\sigma=\alpha + \beta y_t + \epsilon_t$, with $y_t^\sigma$ the returns on the volatility managed portfolio net of transaction costs and $y_t^\sigma$ its the original equity strategy. The top panels report the estimated alphas ($\widehat{\alpha}$ in \%). When considering a conservative notional trading cost of 50 basis points, our {\tt SSV} volatility forecast generates a positive alpha of 0.46\% annualised. This is against a large and negative alpha from the {\tt RV}, {\tt RV AR}, {\tt HAR}, and {\tt SV} methods. Consistent with \citet{barroso2021limits}, a longer-term six-month estimate of the realised variance {\tt RV6} improves the volatility-managed alphas (0.12\%). Perhaps more importantly, our {\tt SSV} method generates a significantly positive alpha for 21\% of the equity strategies in our sample, against, for instance, a 3\%, 9\%, and 14\% of the strategies from the {\tt RV}, {\tt RV6} and {\tt Garch} models, respectively. The appraisal ratio $AR$ reported in the middle panel of Table \ref{tab:spanning regression tc} confirms that {\tt SSV} substantially improves upon realised variance measures {\tt RV}, especially when a conservative transaction cost is factored in. For instance, with 50 basis points of trading costs the {\tt SSV} is the only method that can still generate a positive appraisal ratio. By comparison, the {\tt RV}, {\tt RV6}, {\tt Garch} and {\tt RV AR} all generate significantly negative ARs. The bottom panels report the difference in the certainty equivalent return between and investor that can access both the volatility-managed and the original portfolio, and an investor constrained to invest in the original portfolio only. The utility gain $\Delta CER$(\%) is highly in favour of our {\tt SSV} volatility targeting. For instance, for 14 basis points of transaction costs, the second-best performing strategy is the {\tt RV6} rescaling with a $\Delta CER$ of 9.56\%, annualised, against a 14.5\% from our {\tt SSV}. \subsubsection{Transaction costs with leverage constraints} The results in Tables \ref{tab:Returns_tc}-\ref{tab:spanning regression tc} show that when conservative levels of transaction costs to implement volatility targeting are considered, the performance of standard volatility targeting methods substantially deteriorates. Standard volatility targeting strategies are not designed to mitigate transaction costs. Hence, we next evaluate whether by reducing liquidity demand via capping leverage render volatility targeting still profitable after costs. This approach does not necessarily aim at an optimal allocation from the perspective of a mean-variance investor. Rather, it is a simple, yet effective, risk-management approach that aims to regularise the capital exposure to the original equity trading strategy. We follow \citet{moreira2017volatility,cederburg2020performance,barroso2021limits,wang2021downside} and consider two different levels of leverage constraint; one that cap the leverage at 1.5 times the original factor, and a second less restrictive that cap leverage at 5 times the exposure to the original factor. Table \ref{tab:Returns_leverage} reports the Sharpe and the Sortino ratios considering the same level of transaction costs as in Section \ref{subsec:transaction costs}, namely 14 and 50 basis points of the notional trading exposure. Panel A shows the results for a 500\% leverage constraint. For a conservative 50 basis points transaction costs our {\tt SSV} produces the highest Sharpe and Sortino ratios among the volatility targeting methods, on average across the 158 equity strategies. For instance, the {\tt SSV} generates a 0.23 Sharpe ratio on average against a dismal -0.10 annualised Sharpe ratio from the {\tt RV}. Compared to the unmanaged portfolios, the number of significantly higher SRs is also higher for the {\tt SSV} case. For instance, none of the rescaled portfolios with {\tt RV} has a positive and significant SR differential against 7\% of the portfolios rescaled with {\tt SSV}. Panel B shows the results for a more restrictive leverage constraint, which forces the exposure from volatility targeting no more than 1.5 times the original factor portfolio. Consistent with \citet{moreira2017volatility,barroso2021limits}, a tighter cap does indeed regularise more the performance of volatility targeting across all competing methods. Nevertheless, the performance of our {\tt SSV} portfolio is quite stable across different levels of leverage constraints. Interestingly, unlike the case without leverage constraints, the {\tt RV6} plus leverage cap proves to be a quite competitive benchmark volatility targeting method. Table \ref{tab:spanning regression capped} reports the results for the spanning regressions. The top panels report the estimated alphas ($\widehat{\alpha}$ in \%). When considering a conservative notional trading cost of 50 basis points, our {\tt SSV} volatility forecast generates a positive alpha of 0.46\% annualised. This is against a large and negative alpha from the {\tt RV}, {\tt RV AR}, {\tt HAR}, and {\tt SV} methods. Perhaps more importantly, our {\tt SSV} method generates a significantly positive alpha for 21\% of the equity strategies in our sample, against, for instance, 3\%, 17\%, and 14\% from the {\tt RV}, {\tt RV6} and {\tt Garch} models, respectively. The appraisal ratio $AR$ reported in the middle panel of Table \ref{tab:spanning regression capped} confirms that our {\tt SSV} substantially improves upon standard volatility targeting based on {\tt RV}, especially when more conservative transaction costs are factored in. For instance, with 50 basis points of trading costs the {\tt SSV} is the only method that can still generate a positive appraisal ratio together with the {\tt RV6} long-term realised variance method. By comparison, the {\tt RV}, {\tt Garch} and {\tt RV AR} all generate significantly negative ARs. The bottom panels report the difference in the certainty equivalent return between and investor that can access both the volatility-managed and the original portfolio, and an investor constrained to invest in the original portfolio only. The utility gain $\Delta CER$(\%) is highly in favour of our {\tt SSV} volatility targeting. For instance, for 14 (50) basis points of transaction costs, our {\tt SSV} method generates a 12\% (8\%) utility gain. This compares to the 7\% from the {\tt HAR} with 14 basis points and 2.2\% from the {\tt RV6} with 50 basis points of transaction costs. Table \ref{tab:spanning regression capped 05} reports the spanning regression results with a tighter leverage cap of 1.5. The results are largely in line with Table \ref{tab:spanning regression capped}. That is, the {\tt RV6} does indeed represents a challenging benchmark for our {\tt SSV} method when it comes to the estimated alphas. However, the $\Delta CER$(\%) from the combination strategy is substantially in favour of our smoothing volatility targeting. For instance, the $\Delta CER$(\%) from the {\tt SSV} is 9.52\% (13.8\%) with 50 (14) basis points of notional transaction costs, against a 4.5\% (8/2\%) from the {\tt RV6} volatility targeting. \section{Conclusion} \label{sec:conclu} Prior studies found that volatility-managed portfolios that increase leverage when volatility is low produce statistically equivalent economic value compared to the original unscaled factors. This contradicts conventional investment practice whereby risk mitigation should improve, or at least not deteriorates, portfolio returns on a risk-adjusted basis. We show that such equivalence is primarily due to the extreme leverage implied by volatility targeting. Indeed, volatility-managed portfolios based on standard realised variance tend to have extremely levered exposure to the original factors; such exposure is highly time varying. When factoring in moderate levels of notional transaction costs the benefit of volatility-managing disappears. To regularise turnover and mitigates the effect of transaction costs on volatility-managed portfolios, we propose a novel inference scheme which allows to smooth the predictive density of an otherwise standard stochastic volatility model. Specifically, we develop a novel variational Bayes estimation method that flexibly encompasses different smoothness assumptions irrespective of the underlying persistence of the latent state. Using a large set of 158 equity strategies, we provide evidence that our smoothing volatility targeting approach has economic value when conservative levels of transaction costs are considered. This has important implications for both the risk-adjusted returns and the mean-variance efficiency of volatility-managed portfolios. \section{Derivation of the variational densities} \subsection{Optimal density of the parameters} \label{app:params} \begin{remark} Assume a set of parameters $\{\vartheta_i\}_{i=1}^p$. The mean-field approach factorizes the joint variational distribution according to a partition $q(\boldsymbol{\vartheta})=\prod_{j=1}^M q(\boldsymbol{\vartheta}_j)$, where, following \cite{wand_ormerod.2011}, each component $q(\boldsymbol{\vartheta}_j)$ can be computed as \begin{equation}\label{eq:mfvb_opt} q(\boldsymbol{\vartheta}_j) \propto \exp\left\{\mathbb{E}_{-\boldsymbol{\vartheta}_j}\left[\log p(\boldsymbol{\vartheta},\mathbf{y})\right]\right\}, \end{equation} where $\mathbb{E}_{-\boldsymbol{\theta}_j}$ denotes the expectation with respect to the density $\prod_{k=1,k\neq j}^M q(\boldsymbol{\theta}_k)$ and $\log p(\boldsymbol{\theta}|\mathbf{y})$ is the joint distribution of parameters and the data. A valid alternative to \eqref{eq:mfvb_opt} is given by: \begin{equation} q(\boldsymbol{\vartheta}_j) \propto \exp\left\{\mathbb{E}_{-\boldsymbol{\vartheta}_j}\left[\log p(\boldsymbol{\vartheta}_j|\text{rest})\right]\right\}, \end{equation} where $p(\boldsymbol{\vartheta}_j|\text{rest})$ denotes the full conditional distribution of $\boldsymbol{\vartheta}_j$. \end{remark} \begin{proposition} The optimal variational density for the regression parameter vector is $q(\mbox{\boldmath $\beta$})\equiv\mathsf{N}_p(\mbox{\boldmath $\mu$}_{q(\beta)},\mathbf{\Sigma}_{q(\beta)})$ where: \begin{align}\label{eq:up_beta} \mathbf{\Sigma}_{q(\beta)}= \left(\bX^\intercal\mathbf{H}^{-1}\bX+\mathbf{\Sigma}_\beta^{-1}\right)^{-1} \qquad \mbox{\boldmath $\mu$}_{q(\beta)}=\mathbf{\Sigma}_{q(\beta)}\left(\bX^\intercal\mathbf{H}^{-1}\by+\mathbf{\Sigma}_\beta^{-1}\mbox{\boldmath $\mu$}_\beta\right), \end{align} where $\mathbf{H}^{-1}=\mathsf{Diag}\left(\mathbb{E}_h\left[\mathrm{e}^{\mathbf{h}_1}\right]\right)$ is a diagonal matrix with elements that depend on the optimal density for the latent log-volatilities. \end{proposition} \begin{proof} The logarithm of the full conditional $(\mbox{\boldmath $\beta$}|\mathrm{rest})$ is proportional to: \begin{align*} \log p(\mbox{\boldmath $\beta$}|\mathrm{rest}) &\propto -\frac{1}{2}\left(\mathbf{y}-\bX\mbox{\boldmath $\beta$}\right)^\intercal\mathsf{diag}\left(\mathrm{e}^{\mathbf{h}_1}\right)\left(\mathbf{y}-\bX\mbox{\boldmath $\beta$}\right) -\frac{1}{2}\left(\mbox{\boldmath $\beta$}-\mbox{\boldmath $\mu$}_\beta\right)^\intercal\mathbf{\Sigma}_\beta^{-1}\left(\mbox{\boldmath $\beta$}-\mbox{\boldmath $\mu$}_\beta\right) \\ &\propto -\frac{1}{2}\left(\mbox{\boldmath $\beta$}^\intercal\bX^\intercal\mathsf{diag}\left(\mathrm{e}^{\mathbf{h}_1}\right)\bX\mbox{\boldmath $\beta$}-2\mbox{\boldmath $\beta$}^\intercal\bX^\intercal\mathsf{diag}\left(\mathrm{e}^{\mathbf{h}_1}\right)\mathbf{y}\right) -\frac{1}{2}\left(\mbox{\boldmath $\beta$}^\intercal\mathbf{\Sigma}_\beta^{-1}\mbox{\boldmath $\beta$}-2\mbox{\boldmath $\beta$}^\intercal\mathbf{\Sigma}_\beta^{-1}\mbox{\boldmath $\mu$}_\beta\right). \end{align*} Compute the optimal variational density as $\log q(\mbox{\boldmath $\beta$})=\mathbb{E}_{-\beta}\left[\log p(\mbox{\boldmath $\beta$}|\mathrm{rest})\right]$: \begin{align*} \log q(\mbox{\boldmath $\beta$}) &\propto -\frac{1}{2}\left(\mbox{\boldmath $\beta$}^\intercal\bX^\intercal\mathsf{diag}\left(\mathbb{E}_h\left[\mathrm{e}^{\mathbf{h}_1}\right]\right)\bX\mbox{\boldmath $\beta$}-2\mbox{\boldmath $\beta$}^\intercal\bX^\intercal\left(\mathbb{E}_h\left[\mathrm{e}^{\mathbf{h}_1}\right]\right)\mathbf{y}\right) \\ &\qquad-\frac{1}{2}\left(\mbox{\boldmath $\beta$}^\intercal\mathbf{\Sigma}_\beta^{-1}\mbox{\boldmath $\beta$}-2\mbox{\boldmath $\beta$}^\intercal\mathbf{\Sigma}_\beta^{-1}\mbox{\boldmath $\mu$}_\beta\right) \\ &= -\frac{1}{2}\left(\mbox{\boldmath $\beta$}^\intercal(\bX^\intercal\mathbf{H}^{-1}\bX+\mathbf{\Sigma}_\beta^{-1})\mbox{\boldmath $\beta$}-2\mbox{\boldmath $\beta$}^\intercal(\bX^\intercal\mathbf{H}^{-1}\mathbf{y}+\mathbf{\Sigma}_\beta^{-1}\mbox{\boldmath $\mu$}_\beta)\right), \end{align*} where $\mathbf{H}^{-1}=\mathsf{diag}\left(\mathbb{E}_h\left[\mathrm{e}^{\mathbf{h}_1}\right]\right)$. Take the exponential and end up with the kernel of a multivariate gaussian distribution with parameters as in \eqref{eq:up_beta}. \end{proof} \begin{proposition} The optimal variational density for the unconditional mean of the log-volatility process is $q(c)\equiv\mathsf{N}(\mu_{q(c)},\sigma^2_{q(c)})$ where: \begin{equation}\begin{aligned}\label{eq:up_c} \sigma^2_{q(c)}&= (\mu_{q(1/\eta^2)}\boldsymbol{\iota}_{n+1}^\intercal\mbox{\boldmath $\mu$}_{q(\mathbf{Q})}\boldsymbol{\iota}_{n+1}+1/\sigma^2_c)^{-1} \\ \mu_{q(c)}&=\sigma^2_{q(c)}(\mu_{q(1/\eta^2)}\boldsymbol{\iota}_{n+1}^\intercal\mbox{\boldmath $\mu$}_{q(\mathbf{Q})}\mbox{\boldmath $\mu$}_{q(\mathbf{h})}+\mu_c/\sigma^2_c). \end{aligned}\end{equation} where \begin{equation*} \mbox{\boldmath $\mu$}_{q(\mathbf{Q})} = \begin{bmatrix} 1 & -\mu_{q(\rho)} &\dots & 0 & 0 \\ -\mu_{q(\rho)} & 1+\mu_{q(\rho^2)} &\dots & 0 & 0\\ \vdots & \vdots &\ddots &\vdots &\vdots\\ 0 & 0 &\dots & 1+\mu_{q(\rho^2)} & -\mu_{q(\rho)} \\ 0 & 0 &\dots & -\mu_{q(\rho)} & 1 \end{bmatrix}. \end{equation*} \end{proposition} \begin{proof} The logarithm of the full conditional $(c|\mathrm{rest})$ is proportional to: \begin{align*} \log p(c|\mathrm{rest}) &\propto -\frac{1}{2\eta^2}(\mathbf{h}-c\boldsymbol{\iota}_{n+1})^\intercal\mathbf{Q}(\mathbf{h}-c\boldsymbol{\iota}_{n+1}) -\frac{1}{2\sigma^2_c}(c-\mu_c)^2\\ &\propto -\frac{1}{2\eta^2}(c^2\boldsymbol{\iota}_{n+1}^\intercal\mathbf{Q}\boldsymbol{\iota}_{n+1}-2c\boldsymbol{\iota}_{n+1}^\intercal\mathbf{Q}\mathbf{h}) -\frac{1}{2\sigma^2_c}(c^2-2c\mu_c). \end{align*} Compute the optimal variational density as $\log q(c)=\mathbb{E}_{-c}\left[\log p(c|\mathrm{rest})\right]$: \begin{align*} \log q(c) &\propto -\frac{1}{2}\mathbb{E}_{\eta^2}[1/\eta^2](c^2\boldsymbol{\iota}_{n+1}^\intercal\mathbb{E}_\rho[\mathbf{Q}]\boldsymbol{\iota}_{n+1}-2c\boldsymbol{\iota}_{n+1}^\intercal\mathbb{E}_\rho[\mathbf{Q}]\mathbb{E}_h[\mathbf{h}]) -\frac{1}{2\sigma^2_c}(c^2-2c\mu_c)\\ &=-\frac{1}{2}\mu_{q(1/\eta^2)}(c^2\boldsymbol{\iota}_{n+1}^\intercal\mbox{\boldmath $\mu$}_{q(\mathbf{Q})} \boldsymbol{\iota}_{n+1}-2c\boldsymbol{\iota}_{n+1}^\intercal\mbox{\boldmath $\mu$}_{q(\mathbf{Q})} \mbox{\boldmath $\mu$}_{q(h)}) -\frac{1}{2\sigma^2_c}(c^2-2c\mu_c)\\ &=-\frac{1}{2}\left(c^2(\mu_{q(1/\eta^2)}\boldsymbol{\iota}_{n+1}^\intercal\mbox{\boldmath $\mu$}_{q(\mathbf{Q})} \boldsymbol{\iota}_{n+1}+1/\sigma^2_c)-2c(\boldsymbol{\iota}_{n+1}^\intercal\mbox{\boldmath $\mu$}_{q(\mathbf{Q})}\mbox{\boldmath $\mu$}_{q(h)}+\mu_c/\sigma^2_c) \right), \end{align*} where $\mbox{\boldmath $\mu$}_{q(\mathbf{Q})}$ denotes the element-wise expectation of the matrix $\mathbf{Q}$. Take the exponential and end up with the kernel of an univariate gaussian distribution with parameters as in \eqref{eq:up_c}. \end{proof} \begin{proposition} The optimal variational density for the autoregressive parameter has the following form: \begin{equation} \log q(\rho)\propto\frac{1}{2}\log(1-\rho^2)-\frac{1}{2}\mu_{q(1/\eta^2)}\left(\rho^2\sum_{t=1}^{n-1}a_t-2\rho\sum_{t=0}^{n-1}b_t\right), \quad \rho\in(-1,1) \end{equation} with \begin{align}\label{eq:ab_eq} a_t &= \mathbb{E}_q\left[(h_t-c)^2\right] = (\mu_{q(h_t)}-\mu_{q(c)})^2+\sigma^2_{q(h_t)}+\sigma^2_{q(c)} \\ b_t &= \mathbb{E}_q\left[(h_t-c)(h_{t+1}-c)\right] = (\mu_{q(h_t)}-\mu_{q(c)})(\mu_{q(h_{t+1})}-\mu_{q(c)})+\sigma_{q(h_t,h_{t+1})}+\sigma^2_{q(c)}, \end{align} where $\sigma_{q(h_t,h_{t+1})}$ denotes the covariance between $h_t$ and $h_{t+1}$ under the approximating density $q$. Notice that $\log q(\rho)$ can be written as: \begin{equation}\label{eq:up_rho} \log q(\rho)\propto\frac{1}{2}\log(1-\rho^2)-\frac{1}{2}\mu_{q(1/\eta^2)}\left(\sum_{t=1}^{n-1}a_t\right)\left(\rho^2-\frac{\sum_{t=0}^{n-1}b_t}{\sum_{t=1}^{n-1}a_t}\right)^2, \quad \rho\in(-1,1) \end{equation} thus the normalizing constant and the first two moments can be found by Monte Carlo methods by sampling from an univariate gaussian distribution with mean $\frac{\sum_{t=0}^{n-1}b_t}{\sum_{t=1}^{n-1}a_t}$ and precision $\mu_{q(1/\eta^2)}\left(\sum_{t=1}^{n-1}a_t\right)$. \end{proposition} \begin{proof} The logarithm of the full conditional $(\rho|\mathrm{rest})$ is proportional to: \begin{align*} \log p(\rho|\mathrm{rest}) &\propto \frac{1}{2}\log|\mathbf{Q}|-\frac{1}{2\eta^2}(\mathbf{h}-c\boldsymbol{\iota}_{n+1})^\intercal\mathbf{Q}(\mathbf{h}-c\boldsymbol{\iota}_{n+1}) \\ &\propto \frac{1}{2}\log(1-\rho^2)-\frac{1}{2\eta^2}\left(\rho^2\sum_{t=1}^{n-1}(h_t-c)^2-2\rho\sum_{t=0}^{n-1}(h_t-c)(h_{t+1}-c)\right), \end{align*} for $\rho\in(-1,1)$. Compute the optimal variational density as $\log q(\rho)=\mathbb{E}_{-\rho}\left[\log p(\rho|\mathrm{rest})\right]$: \begin{align*} \log q(\rho) &\propto \frac{1}{2}\log(1-\rho^2)-\frac{1}{2}\mathbb{E}_q\left[1/\eta^2\right]\left(\rho^2\sum_{t=1}^{n-1}\mathbb{E}_q\left[(h_t-c)^2\right]-2\rho\sum_{t=0}^{n-1}\mathbb{E}_q\left[(h_t-c)(h_{t+1}-c)\right]\right) \\ &=\frac{1}{2}\log(1-\rho^2)-\frac{1}{2}\mu_{q(1/\eta^2)}\left(\rho^2\sum_{t=1}^{n-1}a_t-2\rho\sum_{t=0}^{n-1}b_t\right), \quad \rho\in(-1,1), \end{align*} where $a_t$ and $b_t$ are as in \eqref{eq:ab_eq}. Take the exponential and obtain: \begin{align*} q(\rho) &\propto \sqrt{1-\rho^2}\,\mathbb{I}_{\rho\in(-1,1)}\,\phi\left(\rho;\frac{\sum_{t=0}^{n-1}b_t}{\sum_{t=1}^{n-1}a_t},\frac{1}{\mu_{q(1/\eta^2)}\sum_{t=1}^{n-1}a_t}\right), \end{align*} where $\phi(x;m,s^2)$ denotes the density function of an univariate gaussian distribution with mean $m$ and variance $s^2$. \end{proof} \begin{proposition} The optimal variational density for the variance parameter is an Inverse-Gamma distribution $q(\eta^2)\equiv\mathsf{IG}(A_{q(\eta^2)},B_{q(\eta^2)})$, where: \begin{equation}\begin{aligned}\label{eq:up_eta2} A_{q(\eta^2)} &= A + \frac{n+1}{2}\\ B_{q(\eta^2)} &= B + \frac{1}{2}(\mbox{\boldmath $\mu$}_{q(\mathbf{h})}-\mu_{q(c)}\boldsymbol{\iota}_{n+1})^\intercal\mbox{\boldmath $\mu$}_{q(\mathbf{Q})}(\mbox{\boldmath $\mu$}_{q(\mathbf{h})}-\mu_{q(c)}\boldsymbol{\iota}_{n+1}) \\ &\qquad\quad +\frac{1}{2}\left( \mathsf{tr}\left\{\mathbf{\Sigma}_{q(\mathbf{h})}\mbox{\boldmath $\mu$}_{q(\mathbf{Q})}\right\} + \sigma^2_{q(c)}\boldsymbol{\iota}_{n+1}^\intercal\mbox{\boldmath $\mu$}_{q(\mathbf{Q})}\boldsymbol{\iota}_{n+1}\right), \end{aligned}\end{equation} and recall that $\mu_{q(1/\eta^2)}=A_{q(\eta^2)}/B_{q(\eta^2)}$. \end{proposition} \begin{proof} The logarithm of the full conditional $(\eta^2|\mathrm{rest})$ is proportional to: \begin{align*} \log p(\eta^2|\mathrm{rest}) &\propto -\frac{n+1}{2}\log\eta^2-\frac{1}{2\eta^2}(\mathbf{h}-c\boldsymbol{\iota}_{n+1})^\intercal\mathbf{Q}(\mathbf{h}-c\boldsymbol{\iota}_{n+1}) -(A+1)\log\eta^2-B/\eta^2\\ &\propto -\left(A+\frac{n+1}{2}+1\right)\log\eta^2-\frac{1}{\eta^2}\left(B+\frac{1}{2}(\mathbf{h}-c\boldsymbol{\iota}_{n+1})^\intercal\mathbf{Q}(\mathbf{h}-c\boldsymbol{\iota}_{n+1})\right). \end{align*} Compute the optimal variational density as $\log q(\eta^2)=\mathbb{E}_{-\eta^2}\left[\log p(\eta^2|\mathrm{rest})\right]$: \begin{align*} \log q(\eta^2) &\propto -\left(A+\frac{n+1}{2}+1\right)\log\eta^2-\frac{1}{\eta^2}\left(B+\frac{1}{2}\mathbb{E}_{c,\rho,h}\left[(\mathbf{h}-c\boldsymbol{\iota}_{n+1})^\intercal\mathbf{Q}(\mathbf{h}-c\boldsymbol{\iota}_{n+1})\right]\right), \end{align*} where \begin{align*} \mathbb{E}_{c,\rho,h}\left[(\mathbf{h}-c\boldsymbol{\iota}_{n+1})^\intercal\mathbf{Q}(\mathbf{h}-c\boldsymbol{\iota}_{n+1})\right] &= \mathbb{E}_{c,\rho,h}\left[\mathbf{h}^\intercal\mathbf{Q}\mathbf{h}-2c\mathbf{h}^\intercal\mathbf{Q}\boldsymbol{\iota}_{n+1}+c^2\boldsymbol{\iota}_{n+1}^\intercal\mathbf{Q}\boldsymbol{\iota}_{n+1}\right] \\ &= \mathbb{E}_{h}\left[\mathbf{h}^\intercal\mbox{\boldmath $\mu$}_{q(\mathbf{Q})}\mathbf{h}\right]+\mathbb{E}_c[c^2]\boldsymbol{\iota}_{n+1}^\intercal\mbox{\boldmath $\mu$}_{q(\mathbf{Q})}\boldsymbol{\iota}_{n+1} \\ &\qquad -2\mu_{q(c)}\mbox{\boldmath $\mu$}_{q(h)}^\intercal\mbox{\boldmath $\mu$}_{q(\mathbf{Q})}\boldsymbol{\iota}_{n+1} \\ &= \mathsf{tr}\left\{\mathbb{E}_{h}[\mathbf{h}\bh^\intercal]\mbox{\boldmath $\mu$}_{q(\mathbf{Q})}\right\}+(\mu_{q(c)}^2+\sigma^2_{q(c)})\boldsymbol{\iota}_{n+1}^\intercal\mbox{\boldmath $\mu$}_{q(\mathbf{Q})}\boldsymbol{\iota}_{n+1} \\ &\qquad -2\mu_{q(c)}\mbox{\boldmath $\mu$}_{q(h)}^\intercal\mbox{\boldmath $\mu$}_{q(\mathbf{Q})}\boldsymbol{\iota}_{n+1} \\ &= \mathsf{tr}\left\{\left(\mbox{\boldmath $\mu$}_{q(h)}\mbox{\boldmath $\mu$}_{q(h)}^\intercal+\mathbf{\Sigma}_{q(h)}\right)\mbox{\boldmath $\mu$}_{q(\mathbf{Q})}\right\} \\ &\qquad +(\mu_{q(c)}^2+\sigma^2_{q(c)})\boldsymbol{\iota}_{n+1}^\intercal\mbox{\boldmath $\mu$}_{q(\mathbf{Q})}\boldsymbol{\iota}_{n+1} \\ &\qquad -2\mu_{q(c)}\mbox{\boldmath $\mu$}_{q(h)}^\intercal\mbox{\boldmath $\mu$}_{q(\mathbf{Q})}\boldsymbol{\iota}_{n+1} \\ &= \mbox{\boldmath $\mu$}_{q(h)}^\intercal\mbox{\boldmath $\mu$}_{q(\mathbf{Q})}\mbox{\boldmath $\mu$}_{q(h)} +\mu_{q(c)}^2\boldsymbol{\iota}_{n+1}^\intercal\mbox{\boldmath $\mu$}_{q(\mathbf{Q})}\boldsymbol{\iota}_{n+1} \\ &\qquad -2\mu_{q(c)}\mbox{\boldmath $\mu$}_{q(h)}^\intercal\mbox{\boldmath $\mu$}_{q(\mathbf{Q})}\boldsymbol{\iota}_{n+1}\\ &\qquad +\mathsf{tr}\left\{\mathbf{\Sigma}_{q(h)}\mbox{\boldmath $\mu$}_{q(\mathbf{Q})}\right\} +\sigma^2_{q(c)}\boldsymbol{\iota}_{n+1}^\intercal\mbox{\boldmath $\mu$}_{q(\mathbf{Q})}\boldsymbol{\iota}_{n+1} \\ &= (\mbox{\boldmath $\mu$}_{q(h)}-\mu_{q(c)}\boldsymbol{\iota}_{n+1})^\intercal\mbox{\boldmath $\mu$}_{q(\mathbf{Q})}(\mbox{\boldmath $\mu$}_{q(h)}-\mu_{q(c)}\boldsymbol{\iota}_{n+1})\\ &\qquad +\mathsf{tr}\left\{\mathbf{\Sigma}_{q(h)}\mbox{\boldmath $\mu$}_{q(\mathbf{Q})}\right\} +\sigma^2_{q(c)}\boldsymbol{\iota}_{n+1}^\intercal\mbox{\boldmath $\mu$}_{q(\mathbf{Q})}\boldsymbol{\iota}_{n+1}. \end{align*} Take the exponential and end up with the kernel of an inverse gamma distribution with parameters as in \eqref{eq:up_eta2}. \end{proof} \subsection{Homoscedastic log-volatility approximation} \label{app:homo_approx} First of all, the joint distribution of the latent states and the observations, given the set of covariates is given by: \begin{align} \log p(\mathbf{h},\by|\bX)&\propto\log p(\by\vert\mathbf{h}_1,\bX)+\log p(\mathbf{h})\nonumber\\ &=-\frac{1}{2}\boldsymbol{\iota}_n^\intercal\mathbf{h}_1-\frac{1}{2}\mathbf{s}^\intercal\mathrm{e}^{-\mathbf{h}_1}-\frac{1}{2\eta^2}(\mathbf{h}-c\boldsymbol{\iota}_{n+1})^\intercal\mathbf{Q}(\mathbf{h}-c\boldsymbol{\iota}_{n+1}), \end{align} where $\mathbf{s}=(s_1,\ldots,s_n)^\intercal$ with $s_t = (y_t-\mathbf{x}_t^\intercal\mbox{\boldmath $\beta$})^2$, $\mathbf{h}_1=(h_1,\dots,h_n)^\intercal$ and $\mathrm{e}^{\mathbf{h}_1}=(\mathrm{e}^{h_1},\dots,\mathrm{e}^{h_n})^\intercal$. Let the homoschedastic approximation be defined as $\mathbf{h}\sim\mathsf{N}_{n+1}(\bW\mathbf{f},\tau^2\mathbf{\Gamma}^{-1})$ where $\mbox{\boldmath $\mu$}_{q(h)}=\bW\mathbf{f}$ is the mean vector and $\mathbf{\Sigma}_{q(h)}=\tau^2\mathbf{\Gamma}^{-1}$ is the variance-covariance matrix. More precisely, $\Gamma$ is a tridiagonal precision matrix with diagonal elements $\Gamma_{1,1}=\Gamma_{n+1,n+1}=1$ and $\Gamma_{i,i}=1+\gamma^2$ for $i=2,\ldots,n$, and off-diagonal elements $\Gamma_{i,j}=-\gamma$ if $|i-j|=1$ and $0$ elsewhere (see \citealp{rue_held.2005}). Under this setting, the density function of the approximate distribution is given by: \begin{equation} \log \phi(\mathbf{h}\vert \bW\mathbf{f},\tau^{2}\mbox{\boldmath $\Gamma$}^{-1})\propto-\frac{n+1}{2}\log(\tau^2)-\frac{n}{2}\log(1-\gamma^2)-\frac{1}{2\tau^2}(\mathbf{h}-\bW\mathbf{f})^\intercal\mbox{\boldmath $\Gamma$}(\mathbf{h}-\bW\mathbf{f}). \end{equation} Define the variational lower bound (ELBO) as: \begin{align} \psi(\mathbf{f},\tau^2,\gamma)&=\mathbb{E}_q(\log p(\mathbf{h},\by))-\mathbb{E}_q(\log q(\mathbf{h}))\nonumber\\ &\propto-\frac{1}{2}\boldsymbol{\iota}_n^\intercal\bW_1\mathbf{f}-\frac{1}{2}\mbox{\boldmath $\mu$}_{q(\mathbf{s})}^\intercal\mathrm{e}^{-\bW_1\mathbf{f}+\frac{1}{2}\tau^2\boldsymbol{\iota}_n}\nonumber\\ &\qquad -\frac{1}{2}\mu_{q(1/\eta^2)}(\bW\mathbf{f}-\mu_{q(c)}\boldsymbol{\iota}_{n+1})^\intercal\mbox{\boldmath $\mu$}_{q(\mathbf{Q})}(\bW\mathbf{f}-\mu_{q(c)}\boldsymbol{\iota}_{n+1})\nonumber\\ &\qquad -\frac{1}{2}\mu_{q(1/\eta^2)}\tau^2\mathsf{tr}(\mbox{\boldmath $\Gamma$}^{-1}\mbox{\boldmath $\mu$}_{q(\mathbf{Q})})\nonumber\\ &\qquad+\frac{n+1}{2}\log(\tau^2)+\frac{n}{2}\log(1-\gamma^2), \end{align} where $\mbox{\boldmath $\mu$}_{q(\mathbf{s})}=(\mu_{q(s_1)},\ldots,\mu_{q(s_n)})^\intercal$ with $\mu_{q(s_t)} = (y_t-\mathbf{x}_t^\intercal\mbox{\boldmath $\mu$}_{q(\beta)})^2+\mathsf{tr}\left\{\mathbf{\Sigma}_{q(\beta)}\mathbf{x}_t\mathbf{x}_t^\intercal\right\}$, and $\bW_1\in\mathbb{R}^{n\times k}$ denotes the matrix obtained by deleting the first row of $\bW$. Moreover \begin{align*} \mathsf{tr}(\mbox{\boldmath $\Gamma$}^{-1}\mbox{\boldmath $\mu$}_{q(\mathbf{Q})})&=2+(1+\mu_{q(\rho^2)})(n-1)-2n\gamma\mu_{q(\rho)}. \end{align*} Let $\boldsymbol{\xi}=(\mathbf{f},\tau^2,\gamma)$ be the collection of the optimal parameters, the optimization we have to solve is equal to $\widehat{\boldsymbol{\xi}}=\arg\max_\xi \psi(\mathbf{f},\tau^2,\gamma)$, where the objective function $\psi(\mathbf{f},\tau^2,\gamma)$ has gradient equal to \begin{align*} \nabla_\xi \psi(\mathbf{f},\tau^2,\gamma)=\begin{bmatrix} \nabla_\mathbf{f} \psi(\mathbf{f},\tau^2,\gamma)\\ \nabla_{\tau^2}\psi(\mathbf{f},\tau^2,\gamma)\\ \nabla_{\gamma}\psi(\mathbf{f},\tau^2,\gamma) \end{bmatrix}, \end{align*} where \begin{align} \nabla_\mathbf{f} \psi(\mathbf{f},\tau^2,\gamma)&=-\frac{1}{2}\bW^\intercal[0,\boldsymbol{\iota}_n^\intercal]^\intercal+\frac{1}{2}\bW^\intercal\left([0,\mbox{\boldmath $\mu$}_{q(\mathbf{s})}^\intercal]^\intercal\odot\mathrm{e}^{-\bW\mathbf{f}+\frac{1}{2}\tau^2\boldsymbol{\iota}_{n+1}}\right)\nonumber\\ &\qquad-\mu_{q(1/\eta^2)}\bW^\intercal\mbox{\boldmath $\mu$}_{q(\mathbf{Q})}(\bW\mathbf{f}-\mu_{q(c)}\boldsymbol{\iota}_{n+1}), \\ \nabla_{\tau^2} \psi(\mathbf{f},\tau^2,\gamma)&=-\frac{1}{4}(\mbox{\boldmath $\mu$}_{q(\mathbf{s})}\odot\boldsymbol{\iota}_n)^\intercal\mathrm{e}^{-\bW_1\mathbf{f}+\frac{1}{2}\tau^2\boldsymbol{\iota}_n}\nonumber\\ &\qquad-\frac{1}{2}\mu_{q(1/\eta^2)}(2+(1+\mu_{q(\rho^2)})(n-1)-2n\gamma\mu_{q(\rho)}) +\frac{n+1}{2\tau^2},\\ \nabla_{\gamma} \psi(\mathbf{f},\tau^2,\gamma)&=n\tau^2\mu_{q(1/\eta^2)}\mu_{q(\rho)}-\frac{n\gamma}{1-\gamma^2}, \end{align} and Hessian equal to: \begin{equation*} \mathcal{H}_\xi=\begin{bmatrix} \nabla_{\mathbf{f},\mathbf{f}}^2 \psi(\mathbf{f},\tau^2,\gamma) & \nabla_{\mathbf{f},\tau^2}^2 \psi(\mathbf{f},\tau^2,\gamma) & \nabla_{\mathbf{f},\gamma}^2 \psi(\mathbf{f},\tau^2,\gamma)\\ \nabla_{\mathbf{f},\tau^2}^2 \psi(\mathbf{f},\tau^2,\gamma) & \nabla_{\tau^2,\tau^2}^2 \psi(\mathbf{f},\tau^2,\gamma) & \nabla_{\tau^2,\gamma}^2 \psi(\mathbf{f},\tau^2,\gamma)\\ \nabla_{\mathbf{f},\gamma}^2 \psi(\mathbf{f},\tau^2,\gamma) & \nabla_{\tau^2,\gamma}^2 \psi(\mathbf{f},\tau^2,\gamma) & \nabla_{\gamma,\gamma}^2 \psi(\mathbf{f},\tau^2,\gamma)\\ \end{bmatrix}, \end{equation*} with \begin{align} \nabla_{\mathbf{f},\mathbf{f}}^2 \psi(\mathbf{f},\tau^2,\gamma)&=-\frac{1}{2}\bW^\intercal\left\{\mathsf{Diag}\Bigg[[0,\mbox{\boldmath $\mu$}_{q(\mathbf{s})}^\intercal]^\intercal\odot\mathrm{e}^{-\bW\mathbf{f}+\frac{1}{2}\tau^2\boldsymbol{\iota}_{n+1}}\Bigg] +\mu_{q(1/\eta^2)}\mbox{\boldmath $\mu$}_{q(\mathbf{Q})}\right\}\bW \\ \nabla_{\tau^2,\tau^2}^2\psi(\mathbf{f},\tau^2,\gamma)&=-\frac{1}{8}(\mbox{\boldmath $\mu$}_{q(\mathbf{s})}\odot\boldsymbol{\iota}_n)^\intercal\mathrm{e}^{-\bW_1\mathbf{f}+\frac{1}{2}\tau^2\boldsymbol{\iota}_n}-\frac{n+1}{2\tau^4}\\ \nabla_{\gamma,\gamma}^2 \psi(\mathbf{f},\tau^2,\gamma)&= -\frac{n(1+\gamma^2)}{(1-\gamma^2)^2}\\ \nabla_{\mathbf{f},\tau^2}^2\psi(\mathbf{f},\tau^2,\gamma)&=\frac{1}{4}\mathbf{W}^\intercal([0,\mbox{\boldmath $\mu$}_{q(\mathbf{s})}^\intercal]^\intercal\odot\mathrm{e}^{-\bW\mathbf{f}+\frac{1}{2}\tau^2\boldsymbol{\iota}_{n+1}}) \\ \nabla_{\mathbf{f},\gamma}^2 \psi(\mathbf{f},\tau^2,\gamma)&= \mathbf{0}_k\\ \nabla_{\tau^2,\gamma}^2 \psi(\mathbf{f},\tau^2,\gamma)&= n\mu_{q(\rho)}\mu_{q(1/\eta^2)} \end{align} where $\mathbf{a}=\mathsf{diag}(\mathbf{A})$ denotes the operator that returns the vector $\mathbf{a}\in\mathbb{R}^n$ of elements belonging to the main diagonal of the square matrix $\mathbf{A}\in\mathbb{R}^{n\times n}$, while $\mathbf{A}=\mathsf{Diag}(\mathbf{a})$ denotes the operator that returns a diagonal square matrix $\mathbf{A}\in\mathbb{S}_+^{n}$ whose entries consist of the corresponding elements of the vector $\mathbf{a}\in\mathbb{R}^n$. \subsection{Heteroscedastic log-volatility approximation} \label{app:hetero_approx} Let the heteroschedastic approximation be defined as $\mathbf{h}\sim\mathsf{N}_{n+1}(\bW\mathbf{f}_{q(h)},\mathbf{\Sigma}_{q(h)})$ where the mean vector is $\mbox{\boldmath $\mu$}_{q(h)}=\bW\mathbf{f}_{q(h)}$. To find the optimal parameters of the approximating density $(\mathbf{f}_{q(h)},\mathbf{\Sigma}_{q(h)})$, we have to solve the following optimization problem: \begin{equation} \widehat{\boldsymbol{\xi}}=\arg\max_\xi \psi(\mathbf{f}_{q(h)},\mathbf{\Sigma}_{q(h)}), \end{equation} where $\psi(\mathbf{f}_{q(h)},\mathbf{\Sigma}_{q(h)})=\mathbb{E}_q(\log p(\mathbf{h},\by))-\mathbb{E}_q(\log q(\mathbf{h}))$ is called variational lower bound (ELBO). To this aim, we can exploit a result provided by \cite{rohde_wand2016} valid when the approximating density is a multivariate gaussian distribution. The latter states a closed-form update scheme for the variational parameters: \begin{align} \mathbf{\Sigma}^{new} &= \left[\nabla_{\mbox{\boldmath $\mu$},\mbox{\boldmath $\mu$}}^2 S(\mbox{\boldmath $\mu$}^{old},\mathbf{\Sigma}^{old})\right]^{-1} \\ \mbox{\boldmath $\mu$}^{new} &= \mbox{\boldmath $\mu$}^{old} + \mathbf{\Sigma}^{new}\nabla_{\mbox{\boldmath $\mu$}} S(\mbox{\boldmath $\mu$}^{old},\mathbf{\Sigma}^{old}), \end{align} where $\nabla_{\mbox{\boldmath $\mu$}} S(\mbox{\boldmath $\mu$}^{old},\mathbf{\Sigma}^{old})$ and $\nabla_{\mbox{\boldmath $\mu$},\mbox{\boldmath $\mu$}}^2 S(\mbox{\boldmath $\mu$}^{old},\mathbf{\Sigma}^{old})$ denote the first and second derivative of $S(\mbox{\boldmath $\mu$},\mathbf{\Sigma})$ with respect to $\mbox{\boldmath $\mu$}$ and evaluated at $(\mbox{\boldmath $\mu$}^{old},\mathbf{\Sigma}^{old})$. The function $S$ is the so called \textit{non-entropy function} which is given by $\mathbb{E}_q(\log p(\mathbf{h},\by))$. In our scenario, we have that \begin{align}\label{eq:seq_appendix} S(\mbox{\boldmath $\mu$}_{q(h)},\mathbf{\Sigma}_{q(h)})&=-\frac{1}{2}[0,\boldsymbol{\iota}_n^\intercal]\mbox{\boldmath $\mu$}_{q(h)}-\frac{1}{2}[0,\mbox{\boldmath $\mu$}_{q(\mathbf{s})}^\intercal]\mathrm{e}^{-\mbox{\boldmath $\mu$}_{q(h)}+\frac{1}{2}\boldsymbol{\sigma}^2_{q(\mathbf{h})}}-\frac{1}{2}\mu_{q(1/\eta^2)}\mathsf{tr}(\mathbf{\Sigma}_{q(\mathbf{h})}\mbox{\boldmath $\mu$}_{q(\mathbf{Q})})\nonumber\\ &\qquad -\frac{1}{2}\mu_{q(1/\eta^2)}(\mbox{\boldmath $\mu$}_{q(h)}-\mu_{q(c)}\boldsymbol{\iota}_{n+1})^\intercal\mbox{\boldmath $\mu$}_{q(\mathbf{Q})}(\mbox{\boldmath $\mu$}_{q(h)}-\mu_{q(c)}\boldsymbol{\iota}_{n+1}), \end{align} where $\boldsymbol{\sigma}^2_{q(h)}=\mathsf{diag}(\mathbf{\Sigma}_{q(h)})$ is the vector of variances and the $\mathsf{diag}$ operator extracts the diagonal vector from the input matrix. Moreover, we obtain: \begin{align} \nabla_{\boldsymbol{\mu}_{q(h)}} S(\mbox{\boldmath $\mu$}_{q(h)},\mathbf{\Sigma}_{q(h)}) &= -\frac{1}{2}[0,\boldsymbol{\iota}_n^\intercal]^\intercal+\frac{1}{2}[0,\mbox{\boldmath $\mu$}_{q(\mathbf{s})}^\intercal]^\intercal\odot\mathrm{e}^{-\boldsymbol{\mu}_{q(h)}+\frac{1}{2}\boldsymbol{\sigma}^2_{q(h)}} \nonumber\\ &\qquad-\mu_{q(1/\eta^2)}\mbox{\boldmath $\mu$}_{q(\mathbf{Q})}(\mbox{\boldmath $\mu$}_{q(h)}-\mu_{q(c)}\boldsymbol{\iota}_{n+1}),\\ % \nabla_{\boldsymbol{\mu}_{q(h)}\boldsymbol{\mu}_{q(h)}}^2 S(\mbox{\boldmath $\mu$}_{q(h)},\mathbf{\Sigma}_{q(h)}) &=-\frac{1}{2}\mathsf{Diag}\Bigg[[0,\mbox{\boldmath $\mu$}_{q(\mathbf{s})}^\intercal]^\intercal\odot\mathrm{e}^{-\boldsymbol{\mu}_{q(h)}+\frac{1}{2}\boldsymbol{\sigma}^2_{q(h)}}\Bigg] -\mu_{q(1/\eta^2)}\mbox{\boldmath $\mu$}_{q(\mathbf{Q})}, \end{align} where $\boldsymbol{\iota}_n$ is an n-dimensional vector of ones, $\mu_{q\left(1/\eta^2\right)}$ is the variational mean of $1/\eta^2$, $\mbox{\boldmath $\mu$}_{q(\mathbf{Q})}$ is the element-wise variational mean of $\mathbf{Q}$, and $\odot$ denotes the Hadamard product. Then, the updating scheme becomes: \begin{align} \mathbf{\Sigma}_{q(h)}^{new} &= \left[\nabla_{\boldsymbol{\mu}_{q(h)}\boldsymbol{\mu}_{q(h)}}^2 S(\mbox{\boldmath $\mu$}_{q(h)}^{old},\mathbf{\Sigma}_{q(h)}^{old})\right]^{-1}, \\ \mathbf{f}_{q(h)}^{new} &= \mathbf{f}_{q(h)}^{old} + \bW^+\,\mathbf{\Sigma}_{q(h)}^{new}\nabla_{\boldsymbol{\mu}_{q(h)}} S(\mbox{\boldmath $\mu$}_{q(h)}^{old},\mathbf{\Sigma}_{q(h)}^{old}),\\ \mbox{\boldmath $\mu$}_{q(h)}^{new} &= \bW\mathbf{f}_{q(h)}^{new}, \end{align} with $\bW^+=(\bW^\intercal\bW)^{-1}\bW^\intercal$ the left Moore–Penrose pseudo-inverse of $\bW$. \begin{remark} Under the multivariate gaussian approximation of $q(\mathbf{h})$ with mean vector $\mbox{\boldmath $\mu$}_{q(h)}$ and covariance matrix $\mathbf{\Sigma}_{q(h)}$, the optimal density of the vector of variances $\boldsymbol{\sigma}^2=\exp\{\mathbf{h}\}$, namely $q(\boldsymbol{\sigma}^2)$, is a multivariate log-normal distribution such that: \begin{align} \mathbb{E}_q[\sigma_t^2] &= \exp\{\mu_{q(h_t)}+1/2\sigma^2_{q(h_t)}\},\\ \mathsf{Var}_q[\sigma_t^2] &= \exp\{2\mu_{q(h_t)}+\sigma^2_{q(h_t)}\}(\exp\{\sigma^2_{q(h_t)}\}-1), \\ \mathsf{Cov}_q[\sigma_t^2,\sigma_{t+1}^2] &= \exp\{\mu_{q(h_t)}+\mu_{q(h_{t+1})}+1/2(\sigma^2_{q(h_t)}+\sigma^2_{q(h_{t+1})})\}(\exp\{\mathsf{Cov}_q[h_t,h_{t+1}]\}-1). \end{align} \end{remark} \subsection{Pseudo-code for algorithm implementation} \label{app:algorithm_sv} In this section we present the pseudo-code for the implementation of the proposed algorithm, with and without smoothing in the variational posterior distributions. The algorithm is iterative and the convergence is achieved when the variation in the parameters' update $q^*(\boldsymbol{\vartheta},\mathbf{h})^{(\mathsf{iter})}-q^*(\boldsymbol{\vartheta},\mathbf{h})^{(\mathsf{iter}-1)}$ is smaller than a threshold $\Delta$. \begin{table}[!ht] \begin{algorithm}[H] \SetAlgoLined \kwInit{$q^*(\boldsymbol{\vartheta},\mathbf{h})$, $\bW$, $\Delta$} \While{$\big(\widehat{\Delta}>\Delta\big)$}{ Update $q^*(\mathbf{h})$ as in Section \ref{app:homo_approx} or Section \ref{app:hetero_approx}; \\ \vspace{0.2cm} Update $q^*(c)=\mathsf{N}(\mu_{q(c)},\sigma^2_{q(c)})$ as in \eqref{eq:up_c} with \\ \hspace{0.3cm} $\sigma^2_{q(c)}= (\mu_{q(1/\eta^2)}\boldsymbol{\iota}_{n+1}^\intercal\mbox{\boldmath $\mu$}_{q(\mathbf{Q})}\boldsymbol{\iota}_{n+1}+1/\sigma^2_c)^{-1}$, \\ \hspace{0.3cm} $\mu_{q(c)}=\sigma^2_{q(c)}(\mu_{q(1/\eta^2)}\boldsymbol{\iota}_{n+1}^\intercal\mbox{\boldmath $\mu$}_{q(\mathbf{Q})}\mbox{\boldmath $\mu$}_{q(\mathbf{h})}+\mu_c/\sigma^2_c)$.\\ % \vspace{0.2cm} Update $q(\eta^2)=\mathsf{IG}(A_{q(\eta^2)},B_{q(\eta^2)})$ as in \eqref{eq:up_eta2} with \\ \hspace{0.3cm} $A_{q(\eta^2)} = A + \frac{n+1}{2}$, \\ \hspace{0.3cm} $B_{q(\eta^2)} = B + \frac{1}{2}(\mbox{\boldmath $\mu$}_{q(\mathbf{h})}-\mu_{q(c)}\boldsymbol{\iota}_{n+1})^\intercal\mbox{\boldmath $\mu$}_{q(\mathbf{Q})}(\mbox{\boldmath $\mu$}_{q(\mathbf{h})}-\mu_{q(c)}\boldsymbol{\iota}_{n+1})$ \\ \hspace{2cm} $+\frac{1}{2}\left( \mathsf{tr}\left\{\mathbf{\Sigma}_{q(\mathbf{h})}\mbox{\boldmath $\mu$}_{q(\mathbf{Q})}\right\}+ \sigma^2_{q(c)}\boldsymbol{\iota}_{n+1}^\intercal\mbox{\boldmath $\mu$}_{q(\mathbf{Q})}\boldsymbol{\iota}_{n+1}\right)$.\\ % \vspace{0.2cm} Update $q^*(\rho)$ as in \eqref{eq:up_rho}; \\ % \vspace{0.2cm} Update $q(\mbox{\boldmath $\beta$})=\mathsf{N}_p(\mbox{\boldmath $\mu$}_{q(\beta)},\mathbf{\Sigma}_{q(\beta)})$ as in \eqref{eq:up_beta} with \\ \hspace{0.3cm} $\mathbf{\Sigma}_{q(\beta)}= \left(\bX^\intercal\mathbf{H}^{-1}\bX+\mathbf{\Sigma}_\beta^{-1}\right)^{-1}$, \\ \hspace{0.3cm} $\mbox{\boldmath $\mu$}_{q(\beta)}=\mathbf{\Sigma}_{q(\beta)}\left(\bX^\intercal\mathbf{H}^{-1}\by+\mathbf{\Sigma}_\beta^{-1}\mbox{\boldmath $\mu$}_\beta\right)$.\\ % \vspace{0.2cm} Compute $\widehat{\Delta} = q^*(\boldsymbol{\vartheta},\mathbf{h})^{(\mathsf{iter})}-q^*(\boldsymbol{\vartheta},\mathbf{h})^{(\mathsf{iter}-1)}$ ; } \caption{Variational Bayes for arbitrary smoothness in stochastic volatility.} \label{code:VBSV} \end{algorithm} \end{table}
\section{Introduction} \label{sec:intro} Understanding how galaxies form and evolve over cosmic time is at the core of two of the four strategic goals that motivated the construction of {\it JWST}, launched on 2021 December 25 after many years of development. The first image released to the scientific community is that of the gravitational-lensing galaxy cluster SMACS~J0723.3$-$7327 \citep[``Webb's First Deep Field'',][]{Pontoppidan2022}, made public on 2022 July 11. These first data demonstrate the unprecedented power of {\it JWST} for near- and mid-infrared extragalactic astronomy, and have already formed the basis of a number of early science papers \citep[e.g.,][to give a few examples]{Atek2022, Caminha2022, Ferreira2022, Mowla2022, Schaerer2022, Yan2022, Carnall2022, Curti2023}. The SMACS~J0723.3$-$7327 field is thus rapidly becoming a major public resource for research in the field of galaxy formation and evolution. Accurate galaxy redshifts are vital for galaxy evolution studies as well as for the modeling of the gravitational-lensing potential of the cluster. While a number of redshifts in the SMACS~J0723.3$-$7327 field has already been published from ground-based studies \citep[VLT/MUSE, ][]{Caminha2022}, and a few from the analysis of the public {\it JWST}/NIRSpec observations of the field \citep[e.g., ][]{Schaerer2022, Carnall2022}, a much more comprehensive redshift catalogue is both desirable and possible with the existing {\it JWST} dataset, particularly using the {\it JWST}/NIRISS slitless grism spectroscopy data of the Early Release Observations (EROs) of the field \citep{Pontoppidan2022}. We here develop such a catalogue using primarily the {\it JWST}/NIRISS slitless grism spectroscopy of the field, supported with {\it JWST}/NIRCam and {\it HST}/ACS photometry. While the NIRISS grism dataset in SMACS~J0723.3$-$7327 was observed with two of the three NIRISS channels (F115W and F200W), it does not include the F150W channel, limiting the yield of secure redshifts with multiple spectral features. Nevertheless, we are able to securely identify $156$ NIRISS grism redshifts in the field, $123$ of which are for sources whose redshifts were previously unknown. Among the $156$ secure NIRISS grism redshifts, $87$ are identified unambiguously through the identification of multiple spectral features, and a further $69$ through a single spectral feature whose nature is unambiguously determined based on the object's nine-band photometric redshift. While the NIRISS EROs of the SMACS~J0723.3$-$7327 field do not fully demonstrate the power of NIRISS for obtaining large redshift samples due to the lack of the F150W filter in these observations, this should be alleviated in NIRISS programs that include the F150W channel in addition to the F115W and the F200W, such as the Canadian NIRISS Unbiased Cluster Survey (CANUCS) project\footnote{Information on the CANUCS Guaranteed Time Observations program can be found at {\url{https://niriss.github.io}.}}. In addition to the NIRISS slitless grism data, we also re-analyse the public {\it JWST}/NIRSpec multi-object spectroscopic slit data and extract six additional, previously unpublished, secure redshifts that we include in our catalogue. Throughout this work, we take a conservative approach to obtain secure redshifts for a fairly large subset of sources rather than a complete catalogue for the full sample. Objects with redshifts that we consider to be uncertain are thus excluded from our final catalogue. We make our spectroscopic redshift catalogue public\footnote{The catalogue is made available at {\url{https://niriss.github.io/smacs0723}}.}, and the purpose of this paper is to describe the techniques we use to create it and give some characteristics of the data it contains. This paper is structured as follows. Section~\ref{sec:data} describes our data and the basic processing we use to reduce it, including the basic reduction of the {\it JWST}/NIRISS data. In Section~\ref{sec:methods}, we describe our methods to ({\it i}) derive initial NIRISS grism redshifts (Sec.~\ref{sec:methods-grismredshifts}), ({\it ii}) obtain our photometric catalogue (Sec.~\ref{sec:photometry}) and photometric redshifts of the sources (Sec.~\ref{sec:photo_z}), and ({\it iii}) obtain our final spectroscopic redshift catalogue of the field (Sec.~\ref{sec:methods-grism-photoz}). Section~\ref{sec:redshift_sample} presents the properties of our redshift sample, including the fidelity of our NIRISS grism redshifts (Sec.~\ref{sec:redshift_fidelity}), the redshift distribution of the sample (Sec.~\ref{subsec:redshift-distribution}), and the colour distribution of our sources (Sec.~\ref{sec:colors}). In Section~\ref{sec:caveats} we present the limitations and caveats of this work before summarizing our work and presenting our conclusions in Section \ref{sec:conclusion}. Throughout, we use AB magnitudes, and a flat $\Lambda$CDM cosmology with $\Omega_{\rm M}=0.3$, $\Omega_{\rm \Lambda}=0.7$, and $H_0=70~{\rm km\,s^{-1}\,Mpc^{-1}}$. \section{Data and basic processing} \label{sec:data} We make use of the {\it JWST}/NIRCam images, NIRISS grism spectra, and NIRSpec multi-slit spectra released as part of the {\it JWST} Early Release Observations (EROs; \citealt{Pontoppidan2022}) of the field of the $z_{\rm cl}=0.39$ cluster SMACS~J0723.3$-$7327. We also use archival {\it HST} Advanced Camera for Surveys (ACS) imaging of the field from the RELICS program \citep{Coe2019}. We additionally supplement our data with published VLT/MUSE spectroscopic redshifts \citep{Caminha2022}, where available. We describe these data and their basic processing in the following sections. \subsection{{\it JWST}/NIRCam and {\it HST}/ACS imaging data}\label{sec:nircam_hst_imaging} The {\it JWST}/NIRCam images were obtained through the six broad-band filters F090W, F150W, F200W, F277W, F356W, and F444W, while the {\it HST}/ACS imaging was obtained in the F435W, F606W and F814W broad-band filters, respectively. The exposure time of the NIRCam data is $7.5$~ks, potentially reaching point-source depths of $\rm AB\sim30$~mag over much of the field \citep{Pontoppidan2022}. The observations were taken using the {\tt INTRAMODULEX} dither pattern with nine dither positions and the {\tt MEDIUM8} readout pattern \citep{Pontoppidan2022}. We first extract the {\it JWST}/NIRCam uncalibrated ramp exposures of the EROs of the field from the Mikulski Archive for Space Telescopes (MAST\footnote{\url{https://archive.stsci.edu/}}), and first run a modified version of the {\tt Detector1Pipeline} ({\tt calwebb\_detector1}) stage of the official STScI pipeline. This initial step includes detector-level correction and pixel flagging (including flagging of the ``snowball'' artifacts), as well as an additional correction of the $1/f$-noise. The ramp fitting, dark current subtraction, persistence correction, saturation flagging and cosmic ray rejection are also included in this step, which produces the ``rate images''. The {\it JWST} Operational Pipeline ({\tt CRDS\_CTX}) we use to reduce the NIRCam data is {\tt jwst\_0916.pmap}. This is a pre-flight reference file for which photometric zero-points may be incorrect \citep[see, e.g.,][]{Boyer2022}. We therefore use {\tt EAzY} \citep{Brammer2008} to rederive proper photometric zero-points consistent with the photometric redshift fitting of our source catalogue as we describe in \citet{Mowla2022}. After this initial step, we use version 1.6.0 of the grism redshift and line analysis software for space-based spectroscopy \citep[{\tt Grizli};][]{Brammer2021} to perform the remaining steps of the data reduction. Specifically, we first perform the astrometric alignement of the different exposures to the {\it HST} images, then subtract the sky-background from the exposures, and drizzle the {\it JWST}/NIRCam and {\it HST}/ACS imaging to a common pixel scale of $0\farcs04$. Additionally to these steps, we model and subtract the intracluster light and the light from the brightest cluster galaxies using a custom code (Martis et al., in preparation), and we PSF-match our imaging to the lowest resolution image (F444W) using empirical PSFs constructed from bright stars in the field. \subsection{NIRISS Wide-Field Slitless Spectroscopy} \subsubsection{Data and basic processing}\label{sec:grism_reduction} Additionally to the imaging data, the SMACS~J0723.3$-$7327 field was observed with the Wide-Field Slitless Spectroscopy (WFSS) mode \citep{willott2022} of the Near-InfraRed Imager and Slitless Spectrograph \citep[NIRISS,][Doyon et al.~in prep]{Doyon2012}. The NIRISS WFSS observations used the two orthogonal, low-resolution ($R\sim 150$), grisms, GR150C and GR150R, and were taken through the F115W ($\lambda=1.0-1.3$~\micron) and F200W ($\lambda=1.75-2.25$~\micron) filters. Total integrations were $2.8$~ks per channel, with an eight-point medium dither pattern \citep{Pontoppidan2022}. The basic processing steps of the NIRISS exposures follow the same procedure as done for the NIRCam imaging data. In short, we extract the uncalibrated data from MAST, run a modified version of the official {\tt Detector1Pipeline} ({\tt calwebb\_detector1}) for detector-level flagging and corrections including the $1/f$-noise, and then use {\tt Grizli} to perform the additional reduction steps (namely, exposure alignment to the {\it HST} images, sky-background subtraction, and drizzling of the exposures). The {\it JWST} Operational Pipeline ({\tt CRDS\_CTX}) we use to reduce the NIRISS data is {\tt jwst\_0932.pmap}. The {\tt Grizli} reduction steps of the NIRISS data also include the creation of a NIRISS direct image mosaic from which diffraction spikes of bright sources are masked. Source detection is then performed on the NIRISS mosaic image with the Source Extractor \citep{Bertin1996} python wrapper {\tt sep} \citep{Barbary2016}, using the default detection parameters implemented in {\tt Grizli} (a detection threshold `{\tt threshold}' of $1.8\sigma$ above the global background RMS, a minimum source area in pixels `{\tt minarea}' of 9, and a deblending contrast ratio `{\tt deblend\_cont}' and a number of deblending thresholds `{\tt deblend\_ntresh}' of 0.001 and 32, respectively). Matched-aperture photometry on the available NIRISS filters is performed at the same stage. From this NIRISS imaging catalogue, the position of sources are used to locate spectral traces in the grism data, and the spectral continua of the sources are modelled using an iterative polynomial fitting of the data for contamination estimate and removal. These are the NIRISS direct and grism images and contamination models we use in the rest of our analysis. \subsubsection{Coverage of spectral features}\label{sec:line_coverage} \begin{figure} \includegraphics[width=\columnwidth]{Figures/line_coverage_v4.png} \caption{ Typical strong emission lines (Ly$\alpha$, [OII]$\lambda3727$, [OIII]$\lambda\lambda 4959,5007$, and H$\alpha$, black solid lines) visible in the F115W and F200W grism observations of SMACS~J0723.3$-$7327, shown as a function of redshift and observed wavelength. The diagonal purple band represents the strong molecular bands ($\lambda_{\rm rest}\sim0.8~\micron$) used to identify the cluster galaxies in our NIRISS data, and the red dotted-dashed line indicates the redshift of the cluster ($z_{\rm cl}=0.39$). The light purple and light green vertical shaded areas represent the wavelength coverage of the F115W ($\lambda=1.0-1.3$~\micron) and F200W ($\lambda=1.75-2.25$~\micron) filters, respectively. The vertical grey-hatched shaded area indicates the wavelength gap in the grism coverage of the SMACS~J0723.3$-$7327 EROs. In this gap emission lines cannot be seen, and are indicated with dashed lines. The horizontal light-red shaded area highlights the only redshift range ($z=1.68-2.43$) in this data where at least two typically strong emission lines ([OII]$\lambda3727$ and H$\alpha$) are visible in the F115W and F200W filters at the same time. In this range, the blended [OIII]$\lambda\lambda 4959,5007$ doublet (as well as H$\beta$) falls in the missing F150W filter gap and cannot be detected. } \label{fig:line_coverage} \end{figure} The combination of the F115W and F200W filters ($\lambda=1.0-1.3$ and $1.75-2.25$~\micron, respectively) can in principle allow us to detect H$\alpha$ emission at $z=0.5-1.0$ and $z=1.7-2.4$, [OIII]$\lambda\lambda 4959,5007$ at $z=1.0-1.6$ and $z=2.5-3.5$, [OII]$\lambda3727$ at $z=1.7-2.5$ and $z=3.7-5.0$, and Ly$\alpha$ at $z=7.2-9.7$ and $z=13.4-17.5$. Figure~\ref{fig:line_coverage} shows the wavelength coverage of the NIRISS WFSS observations together with the emission line visibility as function of redshift within the filters. As indicated in the Figure by the horizontal shaded area, the combination of the F115W and F200W filters, without the intermediate F150W filter ($\lambda=1.32-1.68$~\micron), restricts the redshift range where at least two typically strong emission lines are visible at the same time to $z=1.68-2.43$. Within that range, only [OII]$\lambda3727$ and H$\alpha$ are visible, while the [OIII]$\lambda\lambda 4959,5007$ doublet (blended at the resolution of the grisms; hereafter referred to as [OIII]$\lambda5007$) falls in the missing F150W filter gap. All other redshift ranges have only one (or less) typically strong emission line (among Ly$\alpha$, [OII]$\lambda3727$, [OIII]$\lambda5007$, or H$\alpha$) visible in the F115W and F200W filters. This complicates the identification of emission lines outside of $z\sim1.7-2.4$, and potentially biases our results towards $z\sim2$ sources. Outside of this redshift range of $z=1.68-2.43$, redshift identification with the grism data typically relies on a single strong spectral feature or additional, typically weaker, emission lines. Note that strong Balmer and D4000 absorption features can also be observed in a similar range of redshifts and observed wavelengths as the [OII]$\lambda3727$ emission line shown in Fig.~\ref{fig:line_coverage}. We also use them in our procedure to determine the redshift of the sources when these features are well detected and unambiguously identified. The H$\alpha$ emission line only enters the F115W filter at redshifts $z>0.52$, which hinders the secure identification and confirmation of the SMACS~J0723.3$-$7327 cluster members (based on emission lines) with the grism data alone. However, we can use the $\lambda_{\rm rest} \sim 0.8~\micron$ absorption features seen in the spectra of bright quiescent galaxies to secure their redshifts. We show the visibility of these features as a light-purple shaded area in the Figure. At the redshift of the cluster ($z_{\rm cl} = 0.39$), these absorption features (primarily due to the presence of TiO in the atmospheres of low-mass main sequence stars -- see, e.g., \citealt{GrayCorballyBook}) fall in the F115W filter and can be successfully modelled and fitted as discussed in Sec.~\ref{sec:methods-grism-photoz}. In principle, the asymmetry of the blended [OIII]$\lambda5007$ doublet can be used to securely determine the redshift of sources in the range $z=1.0-1.6$ and $z=2.5-3.5$. However, we conservatively do not rely on this asymmetry to identify the line in our current work. To determine secure redshifts, we only rely on the clear detection of multiple lines or features (including [OIII]$\lambda5007$ + H$\beta$ only when clearly detected and non-blended), or of a single line whose nature is unambiguously determined based on the photometry (see our methodology in Sec.~\ref{sec:methods-grism-photoz}). \subsection{NIRspec and MUSE spectroscopic redshifts} \label{sec:ancillary_specz} The SMACS~J0723.3$-$7327 field was observed with the Near-InfraRed Spectrograph (NIRSpec) as part of the ERO program \citep{Pontoppidan2022} and a number of papers have reported redshifts based on these observations \citep[e.g.,][]{ Schaerer2022,Carnall2022}. We here re-analyse the NIRSpec ERO data and recover these redshifts along with eight additional, previously unpublished redshifts, among which four are identified as secure redshifts (spectroscopic $\rm flag=3$) and two as probable redshifts (spectroscopic $\rm flag=2$). This analysis and the resulting redshift list are presented in Appendix~\ref{sec:methods-nirspecredshifts}. To complement our dataset, we also use the redshifts published in \citet{Caminha2022} from VLT/MUSE integral field observations of the central $\sim$1~arcmin$^2$ region of the SMACS~J0723.3$-$7327 field. These MUSE observations are comprised of $50$ secure galaxy redshifts (spectroscopic $\rm flag = 2$ or $3$), nearly half of these being of galaxies in the $z_{\rm cl}=0.39$ cluster, with the rest at higher redshifts up to $z=1.5$. \section{Methods} \label{sec:methods} This section describes the generation of the various data products (grism redshift fits, photometry, photometric redshifts) and of our overall methodology to derive our secure spectroscopic catalogue in the field of SMACS~J0723.3$-$7327. \begin{figure*} \centering \fbox{\includegraphics[width=1\textwidth]{Figures/spectrum_quality1_v2.png}} \fbox{\includegraphics[width=1\textwidth]{Figures/spectrum_quality2_v2.png}} \caption{Examples of quality 1 (top) and quality 2 (bottom) grism spectra. Top panel: example of a quality 1 grism spectrum where multiple emission-lines are clearly identified in the data. In this example, we identify the [OII]$\lambda 3727$ and H$\alpha$ lines at $z=1.97$. Bottom panel: example of a quality 2 grism spectrum where a single emission-line is detected in the data and whose identification is determined based on the photometric redshift PDFs. In this example, we identify the blended [OIII]$\lambda\lambda 4959,5007$ doublet (here also blended with H$\beta$ due to morphological broadening) at $z=1.38$. Each panel shows the direct image stamp of the source (left), its 1D grism spectrum in the F115W and F200W filters (stacked from the two orthogonal grisms; top), and its 2D spectrum in each combination of grism and filter (GR150C, middle, and GR150R, bottom). The dispersion direction of each grism is indicated by the grey arrows overlaid on the direct image stamps. Grey hatched areas in the 1D spectra are regions where the filter transmissions drop below $50\%$ of their peak values. The red solid lines on the 1D spectra are the {\tt grizli} contamination estimates, and the black solid lines with grey error bars are the extracted 1D spectra where contamination is removed.} \label{fig:grism_spectra_examples} \end{figure*} \begin{figure} \centering \includegraphics[width=0.48\textwidth]{Figures/spectrum_cluster_galaxy_v3.png} \caption{Example of a $z_{\rm cl}=0.39$ cluster galaxy grism spectrum. The panels are the same as in Fig.~\ref{fig:grism_spectra_examples}, but here shown for the F115W filter only. In this example, the spectrum shows the $\lambda_{\rm rest} \sim 0.7-0.9 \micron$ molecular absorption bands (primarily due to the presence of TiO in the atmospheres of low-mass main sequence stars -- see, e.g., \citealt{GrayCorballyBook}) that we use to obtain redshifts for low-redshift quiescent galaxies. In the top panel, the blue line is the best-fitted model, which well captures the TiO $\lambda_{\rm rest}\approx 7850$\AA\ and 8600\AA\ absorption features seen at $\lambda_{\rm obs} \sim 1.1$ and $1.2~\micron$.} \label{fig:grism_spectra_clg} \end{figure} \subsection{Grism redshift fitting} \label{sec:methods-grismredshifts} After the reduction steps described in Sec.~\ref{sec:grism_reduction}, we use {\tt Grizli} to extract the 2D grism data of all sources detected in the field and perform an initial redshift fitting of the sources. For the redshift fitting, we use the default suite of FSPS \citep[Flexible Stellar Population Synthesis;][]{Conroy2009, Conroy2010} templates implemented in {\tt Grizli} as well as {\tt Grizli}'s default emission-line templates and complexes. The advantage of using {\tt Grizli} is that it forward-models the templates on to the 2D grism frames using the source morphology to account for proper spectral smearing of adjacent pixels in the direct imaging (the so-called `self-contamination' or `morphological broadening' of grism data). {\tt Grizli} also removes the contamination from neighbouring objects when fitting the data. We fit the grism data (fitted, with {\tt Grizli}, using the information from the two orthogonal grisms simultaneously) using a redshift range of $z=0-15$, and use the non-negative least square fitting implemented in {\tt Grizli} for the first, coarse fitting within the full redshift range, and the `bounded' fitting (enforcing non-negative continuum templates, but allowing line templates to be negative) for the second, fine fitting around the peaks of the coarse fitting. Then, we use the products of the fitting procedure (redshift PDFs, emission-line maps, best-fitting models), the 2D grism data in each combination of grism and filter, and our photometric redshift measurements (see Section~\ref{sec:photo_z}) to evaluate the quality of the fitting and create our spectroscopic catalogue following our methodology that we describe in Sec.~\ref{sec:methods-grism-photoz}. Figure~\ref{fig:grism_spectra_examples} shows two examples of grism spectra in our dataset. In the top panel of the Figure, we show an example of a multiple emission-line source (quality 1), and in the bottom panel of the Figure, we show an example of a single emission-line source (whose line is securely identified using our photometric redshift measurements, see our full procedure in Sec.~\ref{sec:methods-grism-photoz}; this is a quality 2 source). Figure~\ref{fig:grism_spectra_clg} shows an example of grism spectrum for a cluster galaxy in our dataset. As already mentioned, cluster galaxies cannot be identified based on the presence of emission-lines in their spectra. However, bright cluster quiescent galaxies can be identified based on the presence of $\lambda_{\rm rest} \sim 0.8~\micron$ absorption features (primarily TiO absorption bands) falling in the F115W filter at the redshift of the cluster. The 1D spectrum in Figure~\ref{fig:grism_spectra_clg} (top row) shows the clear features observed at $\lambda_{\rm obs} \sim 1.1$ and $\sim 1.2~\micron$ and the ability to recover and fit them through our fitting procedure (see Section~\ref{sec:methods-grism-photoz} for our detailed procedure for fitting cluster galaxies). \subsection{Photometry} \label{sec:photometry} A photometric catalogue is created using the imaging data from \textit{HST}/ACS (F435W, F606W, and F814W) and \textit{JWST}/NIRCam (F090W, F150W, F200W, F277W, F356W, and F444W). To detect all the sources in the imaging data, including potential dropouts, we first create a detection $\chi_{\rm mean}$ image (see Sec.~\ref{subsec:detection_image}). The photometry in all of the ACS and NIRCam bands is then measured for all sources detected in the $\chi_{\rm mean}$ image (see Sec.~\ref{sec:photometry-detection-measurement}). \subsubsection{Detection image}\label{subsec:detection_image} First, a $\chi_{\rm mean}$ detection image \citep{Drlica-Wagner+2018} is created by combining our {\it HST}/ACS and {\it JWST}/NIRCam images (Sec.~\ref{sec:nircam_hst_imaging}). In this procedure, we use the images before the PSF homogenization step. For each pixel, the $\chi_{\rm mean}$ signal is computed as \begin{equation} \label{eq:chi_mean} \chi_{\rm mean} = \frac{\sqrt{\sum\limits_{i\le n} {f_i^2}/{\sigma_i^2}} - \mu} {\sqrt{n - \mu^2}}, \end{equation} where $f_i$ is the flux in the $i^{\rm th}$ band, $\sigma_i^2$ its associated variance, $n$ is the number of input images used in the combination and $$\mu = \sqrt{2}\frac{\Gamma((n+1)/2)}{\Gamma(n/2)}.$$ The inclusion of the offset term $\mu$ in Eq.~\ref{eq:chi_mean} results in the suppression of artifacts at the edges of individual input images in the $\chi_{\rm mean}$ stack (see \citealt{Drlica-Wagner+2018}) and is important in reducing the number of false object detections. Ideally, the variance maps in the different bands must represent the true variance in the images, which can often not be the case due to image processing (e.g., due to drizzling). Thus, we here apply a re-scaling of the variance map to ensure that proper noise is propagated to the detection image. It is done by comparing the root-mean-square (RMS) noise in noise-normalized images to the RMS computed from variance maps. We implement this process by dividing the images in three regions to account for the difference of noise level due to image stacking. \subsubsection{Object detection and photometry} \label{sec:photometry-detection-measurement} We use version 1.5.0 of the \photutils \citep{larry_bradley_2022_6825092} package to perform object detection and photometry. We run object detection on the $\chi_{\rm mean}$ detection image, and use a two-mode ``hot + cold'' detection strategy which has been shown in previous surveys to be successful and effective in providing reliable detections for both bright, large and faint, small objects \citep[e.g., CANDELS;][]{guo_candels_2013, Galametz2013}. The cold mode detection parameters are set less aggressively so that bright and large objects can be detected without being overdeblended, while the hot mode parameters are set more aggressively to detect fainter and smaller objects. We then follow the strategy of \citet{barden_galapagos_2012} for combining the outputs of the two modes: all objects from the cold mode detection are kept in the final catalogue, but objects from the hot mode detection located within any of the Kron apertures of cold-mode objects are regarded as parts of substructures of cold-mode objects and are removed from the final catalogue. We run this two-mode detection on our $\chi_{\rm mean}$ detection image of the SMACS~J0723.3$-$7327 field and detect a total of $9703$ objects. For each of the detected objects, photometry measurements in all images are performed with the same strategy as Source Extractor dual-image mode \citep{Bertin1996}. We use the $\chi_{\rm mean}$ detection image to determine the Kron aperture for each detected object, and measure fluxes within the aperture on the F444W PSF-matched images to obtain the Kron flux in each band. Additionally, we also perform circular aperture photometry with the diameter of $0\farcs7$ at the position of each object. The photometry is then corrected for Galactic extinction using the value of $E(B-V)=0.19$~mag (AB) from \citet{schlafly_measuring_2011} for the right ascension and declination of the SMACS~J0723.3$-$7327 field and assuming the \citet{fitzpatrick_correcting_1999} extinction law, with $R_V=3.1$. The photometric errors are estimated from the re-scaled variance maps (see Sec.~\ref{subsec:detection_image} for details) to take in account the underestimation of the errors in the weight maps due to image processing and drizzling. \subsection{Photometric redshifts}\label{sec:photo_z} To securely identify the nature of single emission-lines in the grism data (see our methodology in Sec.~\ref{sec:methods-grism-photoz}), we use photometric redshift estimates that we derive from our photometric catalogue. For this, we choose to run two template-fitting codes with different configurations, namely \Phosphoros (\citealt{Desprez2020}; Paltani et al., in prep) and \texttt{EAzY} \citep{Brammer2008}. This strategy allows us to mitigate against errors and systematics, both in the (still novel) {\it JWST} photometry and in the photometric redshift fits themselves (especially given the relative lack of spectroscopic redshifts available ahead of our work to properly assess the quality of our photometric redshifts). \subsubsection{Phosphoros photometric redshifts} For the photometric redshifts computed using {\tt Phosphoros}, the 33 spectral energy distributions (SEDs) from the \citet{Ilbert2013} template library are used, including seven elliptical-galaxy SEDs, twelve spiral-galaxy SEDs \citep{Polletta2007,Ilbert2009}, twelve starburst-galaxy SEDs and two elliptical-galaxy SEDs generated with the \citet{BruzualCharlot2003} stellar population synthesis models. Intrinsic extinction is set as a free parameter with reddening excess ranging from $0$ to $0.5$~mag (AB), and considering different attenuation laws: ({\it i}) the Calzetti law \citep{Calzetti2000} for templates bluer than the Sb template, ({\it ii}) two versions of the Calzetti law including the 2175\AA\ bump for templates bluer than SB03, ({\it iii}) a Small-Magellanic-Cloud-like law \citep{Prevot1984} for templates redder than SB3, and ({\it iv}) no extinction for Sb templates and redder. As described in Paltani et al.~(in prep.), \Phosphoros includes emission lines in the templates by assuming an empirical relation between the UV continuum and H${\alpha}$ line fluxes \citep{Kennicutt1998}, and ratios between the different hydrogen lines and oxygen lines as measured in the Sloan Digital Sky Survey (SDSS; \citealt{York+2000}) galaxy spectra. No magnitude prior is applied. However, a prior is applied on the SEDs, weighing the SEDs according to their overlap in rest-frame color-space, thus mitigating the risk to overweight solutions produced by too similar templates (Paltani et al., in prep). The redshift fits are performed on the $0\farcs7$-diameter aperture photometry measured in the PSF-homogenized images. Photometric redshift probability distribution functions (PDFs) are computed by marginalizing the posterior grid obtained through $\chi^2$ minimization and the application of the priors. The PDFs are defined on a $z=0$--$16$ grid with a redshift step of $\delta z=0.02$. \subsubsection{EAzY photometric redshifts} We also use {\tt EAzY} to compute photometric redshifts for all sources with a configuration close to the default one. The default SEDs templates (i.e., {\tt tweak\_fsps\_QSF\_v12\_v3}) are used to fit the Kron photometry, allowing for multiple template combinations and emission line additions. No additional zero-point correction is applied to the photometry at this stage, but a systematic error of 3\% of the flux is added in quadrature to the photometric uncertainties in each band. A magnitude prior in the form of a $p(z|m_{\rm F150W})$ is also used. The PDFs are sampled on a redshift grid within $z=0 - 12$ with a step of $\delta z=0.01$ after the application of the prior. \subsection{Building the grism redshift catalogue} \label{sec:methods-grism-photoz} \begin{figure*} \centering \includegraphics [width=0.65\textwidth] {Figures/flowchart_v3.pdf} \caption{Flowchart of the methodology we employ to obtain our final sample of $156$ secure NIRISS grism redshifts. Our methodology is comprised of four main stages: ({\it i}) initial extraction and redshift fitting of all grism sources (1394 sources), ({\it ii}) initial pruning and identification of sources with single or multiple spectral features (370 sources), ({\it iii}) review of the grism redshift fits aided by the {\tt EAzY} and {\tt Phosphoros} photometric redshift PDFs (180 sources), and ({\it iv}) final quality assessment of the grism redshifts and merging with the photometric source catalogue (156 sources). The red-coloured text on the right-hand side of the flowchart describes the reasons for discarding sources in the different inspection stages of our methodology. This sample is then complemented with the NIRSpec and MUSE data described in Sec.~\ref{sec:ancillary_specz}. Together, this constitutes our final catalogue of $190$ secure spectroscopic redshifts in the field of SMACS~J0723.3$-$7327. See Sec.~\ref{sec:methods-grism-photoz} for a detailed description of the flowchart.} \label{fig:flowchart} \end{figure*} Figure~\ref{fig:flowchart} shows the flowchart of the methodology we employ to obtain our final sample of secure NIRISS grism redshifts. As described in Section~\ref{sec:grism_reduction}, we first use {\tt Grizli} to detect objects and extract their grism data in the NIRISS observations, and also to perform an initial redshift fitting of the grism data in the range $z=0-15$ for all detected objects (Sec.~\ref{sec:methods-grismredshifts}). This gives us an initial sample of $1394$~NIRISS sources each with a {\tt Grizli} redshift PDF and associated data products (e.g., emission-line maps, best-fit model, rest-frame EWs, etc). After this initial step, we visually inspect the spectral quality of the grism data and reject sources which do not have clear or tentative spectral features (single or multiple emission-lines, absorption features, and spectral breaks). After an initial training on a sample of $100$~sources, this step is performed by six reviewers (GN, GD, MS, VEC, YA, SM) on different subsets of the sample, with each source being inspected by a minimum of three reviewers. From this first visual inspection, all sources for which $>50\%$ of the three or more reviewers assign the lowest spectral quality (no clear or tentative spectral feature) are rejected from the sample. Typically, these sources are rejected due to ({\it i}) the imperfect subtraction of contamination from neighbouring sources, ({\it ii}) low signal-to-noise ratio (SNR) data, or ({\it iii}) featureless spectral continua. Due to the high density of sources in the field and the relatively shallow depth of the NIRISS observations, this step rejects $1024$~sources ($73\%$), while $370$~sources ($27\%$) with clear or tentative spectral features are kept in the sample for further assessment. In the third stage of our methodology, three reviewers (GN, GD, MS) visually inspect the results of the grism redshift fitting for the $370$~sources kept in the sample. The reviewers first assess the quality of the results independently, and then review discrepant assessments together to reach a consensus on the fitting quality. For this inspection, the {\tt Grizli} grism redshift fits are compared to the two photometric redshift PDFs obtained with \texttt{EAzY} and \texttt{Phosphoros}. Sources are assigned an ``OK'' flag if ({\it i}) multiple features are unambiguously identified in their grism data and are well fitted (i.e., no strong contamination in one or multiple grism/filters and both grism orientations show consistent features), or ({\it ii}) a single feature is unambiguously identified in the grism data and the nature of the feature is securely determined and consistent between the {\tt Grizli} redshift solution and the two solutions from the photometric redshift PDFs. Sources with clear single features but inconsistent solutions between the {\tt Grizli} and photometric redshifts are selected for reffiting of their grism data with {\tt Grizli} in a narrower redshift range. This is done only if the photometric redshift PDFs allow to unambiguously determine the nature of the feature detected in the grism data. In those cases, the grism data is refitted within $\pm0.15\times(1+z)$ of the redshift solution that is consistent with the position of the grism feature. However, if ({\it i}) the photometric redshift PDFs are consistent with solutions around the $z_{\rm cl}=0.39$ cluster redshift, and ({\it ii}) the spectral features in the grism data are indicative of the $\lambda_{\rm rest}\sim0.8~\micron$ molecular absorption bands (primarily due to the presence of TiO in the atmospheres of low-mass main sequence stars -- see, e.g., \citealt{GrayCorballyBook}) redshifted to $z\sim0.4$ (see Fig.~\ref{fig:grism_spectra_clg}), we use a custom redshift range of $z=0.33-0.45$ to refit the grism data. Sources for which the nature of the single spectral features cannot be unambiguously determined based on the photometric redshifts are discarded. In this third stage of inspection, we reject a total of $165$~sources ($45\%$) with ambiguous spectral features, refit $125$ ($33\%$), and keep $80$ ($22\%$) without further refitting. As mentioned, among the $125$~sources flagged for reffiting, sources consistent with being at the cluster redshift are refitted within $z=0.33-0.45$. To better capture the molecular absorption bands seen in the grism data of those potential cluster galaxies, we additionally complement the default set of {\tt Grizli} templates with $18$ new FSPS quiescent galaxy templates spanning a range of ages and metallicities. We create this additional template set using single stellar population (SSP) star-formation histories (SFHs), a \citet{Kroupa2001} initial mass function (IMF), the \citet{Calzetti2000} dust law with fixed attenuation of $A_V=0.2$~mag (AB), Cloudy photoionization for nebular emission \citep{Ferland2017}, and \citet{Madau1995} intergalactic medium (IGM) absorption. The FSPS models also include the \citet{Draine2007} dust emission models, and the \citet{Villaume2015} AGB circumstellar dust models. Note that while we use IGM absorption and nebular emission in our models, their effects in our new set of template should be relatively minor as we are generating old, quiescent templates for which the wavelength range of interest in our work is primarily the near infrared. We use two sets of ages and metallicities to create these additional quiescent templates. We create 9 templates using combinations of ${\rm Ages} = [6,9,10]$~Gyrs and $Z =[0.5,1,1.5]~Z_{\odot}$, and another set of 9 templates with ${\rm Ages} = [9,11,13]$~Gyrs and $Z = [2,2.5,3.0]~Z_{\odot}$. When fitting the cluster galaxies, we also remove the emission-line templates and complexes from the default {\tt Grizli} fitting routine. In a number of cases, we refit the F115W grism data alone (as this contains the redshifted $\lambda_{\rm rest}\sim0.8~\micron$ molecular absorption features) to better capture the grism absorption features when the fits are perturbed by the F200W data. After refitting the $125$~sources, the results are again reviewed by the three reviewers (GN, GD, MS) and either validated or rejected as in the previous step. The rejected sources are sources for which the refitting does not well capture the spectral features identified in the data. At this stage, we reject $25$ of the $125$~sources, and keep $100$ (including $62$ fitted using the TiO absorption bands) in our sample. Together with the 80~sources previously flagged as "OK", this gives us a sample of $180$~sources flagged with ``OK'' grism-fit quality ready for a final inspection. In the final step of our procedure, the three reviewers (GN, GD, MS) visually inspect the grism redshift fits of the $180$~sources with ``OK'' grism-fit quality for final vetting and quality assessment. In this step, five sources are rejected from the final catalogue due to poor confidence on the spectral features, and one is refitted (within our initial redshift range of $z=0-15$) using a slightly narrower spectral coverage in the F115W and F200W filters than the original fit of this source to remove edge effects biasing the fit. After this procedure, $175$~sources pass our final vetting and $90$ ($51\%$) are given a quality 1 class (i.e., multiple features), and $85$ ($49\%$) a quality 2 class (i.e., single features supported by photo-$z$). This conservative sample of $175$ secure grism redshifts represents $13\%$ (175/1394) of the original sample. Last, we identify the grism objects in our initial {\tt Grizli} extraction that correspond to single sources in the photometric catalogue, and we merge those multi-component grism sources in our final catalogue. Specifically, when multiple grism sources fall within the segmentation region of a single photometric object, we verify that the grism redshifts associated with the photometric objects are consistent with one another and report the average grism redshift of the components as the source redshift. For those sources, the quality flag is reported as the highest quality flag from among the multiple components. This step merges together $34$ grism sources to $15$ unique photometric objects. This gives us a total of $156$ secure NIRISS grism redshifts, including $87$ ($56\%$) quality 1 and $69$ ($44\%$) quality 2 sources. These 156 high-quality NIRISS redshifts form the basis of our catalogue. As mentioned in Sec.~\ref{sec:ancillary_specz}, we additionally complement the catalogue with the secure NIRSpec (see Appendix~\ref{sec:methods-nirspecredshifts}) and MUSE data (spectroscopic $\rm flag=2$ and $\rm flag=3$) available in the field (either published in the literature or from our own analysis). This complements our catalogue with an additional $65$ spectroscopic redshifts, including $31$ for which we have an independent grism redshift measurement in our NIRISS redshift sample. Overall, our final catalogue of secure NIRISS, NIRSpec and MUSE spectroscopic redshifts contains a total of $190$ sources, including 156 NIRISS grism redshifts, $123$ of which are for sources whose redshifts were previously unknown. Table~\ref{tab:catalog} lists the contents of our final spectroscopic catalogue of $190$ sources, while Table~\ref{tab:catalog2} shows the detail of each component for the multi-component sources. The two catalogues are made available at \url{https://niriss.github.io/smacs0723}. \section{Properties of the redshift sample}\label{sec:redshift_sample} \subsection{Redshift fidelity}\label{sec:redshift_fidelity} \subsubsection{Spectroscopic versus grism redshifts} \begin{figure} \centering \includegraphics [width=0.45\textwidth] {Figures/zgrism_vs_zspec_v3.png} \caption{Grism redshift fidelity as a function of spectroscopic redshift. In all panels, the magenta circles indicate sources with multiple spectral features ($\rm Q\_FLAG = 1$), and orange diamonds indicate sources with single spectral features aided by photometry ($\rm Q\_FLAG = 2$). The top panel shows $z_{\rm grism}$ vs.~$z_{\rm spec}$. The solid line is the 1:1 relation, and the dashed lines show the $\pm 0.15 \times (1+z)$ deviation around the line. The middle panel shows the redshift deviation, $\frac{\delta z}{1+z_{\rm spec}}$, with $\delta z = z_{\rm grism} - z_{\rm spec}$, as a function of spectroscopic redshift. In this panel, the horizontal dashed lines show $\pm 0.01$ level deviation. The bottom panel shows a zoom-in view of the $\frac{\delta z}{1+z_{\rm spec}}=\pm0.01$ interval within $z_{\rm spec}=0.2-1.6$. Cluster galaxies show a small systematic bias of the order of $\delta z = 2.6 \cdot 10^{-3} \times (1+z)$, indicated by the thick red line. In most cases, the size of the error bars in the different panels are smaller than data points.} \label{fig:zgrism_vs_zspec} \end{figure} Our final catalogue includes $65$ NIRSpec and MUSE spectroscopic redshifts. Among those, 31 are sources for which we independently measure a NIRISS grism redshift. We use this sample of 31 sources with independent spectroscopic and NIRISS grism redshift measurements to evaluate the redshift fidelity of our NIRISS grism work. In the top panel of Figure~\ref{fig:zgrism_vs_zspec}, we show the agreement between grism and spectroscopic redshifts (i.e., $z_{\rm grism}$ vs.~$z_{\rm spec}$). The solid line represents the 1:1 relationship, while the dashed lines show the $0.15\times (1+z)$ deviation around the line. We highlight with magenta circles sources that have a grism quality of 1 ($\rm Q\_FLAG = 1$) and with orange diamonds sources that have a grism quality of 2 ($\rm Q\_FLAG = 2$). As seen in the Figure, all sources are within the $0.15\times (1+z)$ deviation, and all but one very closely follow the 1:1 line. This is true for all galaxies whose NIRISS grism redshifts are based on the identification of multiple features, but is also true for all galaxies (except one showing a slight offset) whose NIRISS grism redshifts are based on the identification of a single feature whose nature is securely determined based on the {\tt EAzY} and {\tt Phosphoros} photometric redshift PDFs. This demonstrates the very high fidelity and quality of our NIRISS grism redshifts for both quality 1 and quality 2 sources. This is also seen in the middle panel of the Figure, which shows the redshift deviation ($\frac{\delta z}{1+z_{\rm spec}}$, with $\delta z = z_{\rm grism} - z_{\rm spec}$) as a function of spectroscopic redshift. In this panel, all quality 1 and quality 2 sources are within $\pm 0.01 \times (1+z)$ of the spectroscopic redshifts (highlighted by the dashed lines). The only source slightly deviating from this threshold is source ID~750 (c.f.~Table~\ref{tab:catalog}), with a quality 2 and a deviation of $\frac{\delta z}{1+z_{\rm spec}}=-0.05$. This source has a NIRSpec redshift of $z_{\rm spec} = 2.463$ \citep{Carnall2022}. At this redshift, [OII]$\lambda3727$, [OIII]$\lambda5007$, and H$\alpha$ are expected to fall at the edges of the wavelength coverage of the F115W and F200W filters, which prevents the measurement of such a redshift based on those emission-lines with the NIRISS grism data. In the NIRISS data of this source, we identify a single emission-line at $\lambda_{\rm obs} = 2.15$~\micron, together with a consistent photometric redshift between {\tt EAzY} and {\tt Phosphoros} of $z_{\rm phot} \sim 2.3\pm0.2$, indicating that the emission-line is consistent with H$\alpha$ at $z_{\rm grism} = 2.28$. While the line identified in the grism data is relatively weak, it is ({\it i}) well detected in the two orthogonal grisms, ({\it ii}) the overall wavelength range in the F115W and F200W show little to no contamination, and ({\it iii}) the line is well aligned with the position of the grism source. This indicates that the emission line is real and associated with the object detected in the {\tt Grizli} grism extraction. However, the source is relatively extended in the NIRCam imaging, and the centroid position of the photometric object and of the NIRSpec slit are both offset by $\sim 1$~arcsec from the position of the grism object. Specifically, the grism object corresponds to a bright knot offset by $\sim 1$~arcsec to the South of the center of the photometric source. Overall, this suggests that the difference between the grism and spectroscopic redshifts could be due to: ({\it i}) a real chance alignment between a foreground and a background object, or ({\it ii}) contamination or confusion on the nature of the line identified in the grism data. We exclude the possibility of a real rotational velocity offset given the observed redshift difference. While further analysis is necessary to determine the nature of the slight redshift discrepancy for this source, we keep it in the present catalogue and report both its NIRSpec and NIRISS measurements. In the bottom panel of Figure~\ref{fig:zgrism_vs_zspec}, we show a zoom-in view of the $\frac{\delta z}{1+z_{\rm spec}}=\pm0.01$ interval within $z_{\rm spec}=0.2-1.6$. While the agreement between spectroscopic and NIRISS grism redshifts are excellent for both quality 1 and quality 2 sources, this panel shows the slight systematic offset that may be present in the grism measurement of the cluster galaxy redshifts. For $z<0.5$ sources, we measure a median deviation of $\delta z = 2.6\cdot10^{-3} \times (1+z)$. The level of this deviation is shown as the thick red line over $z_{\rm spec} = 0.30 - 0.48$ in the Figure panel. We do not correct for this potential systematic offset in the present catalogue as it appears quite marginal, but note that it is a potential (marginal) bias in our measurement. Note that \citet{Li2022} reports seven NIRISS grism redshifts in the SMACS~J0723.3$-$7327 field as part of a larger analysis of the mass-metallicity relation of dwarf galaxies at cosmic noon. Three of these redshifts are independently recovered in our catalogue while the other four are rejected by our screening procedure detailed in Sec.~\ref{sec:methods-grism-photoz}. Appendix~\ref{sec:Li-comparison} discusses the \citet{Li2022} sample in more detail. \subsubsection{Field variation} \label{subsection:field-variation} \begin{figure} \centering \includegraphics [width=0.45\textwidth] {Figures/field_variation_zgrism_v2.png} \caption{Grism redshift variation across the field for galaxies within $0.37 \leq z_{\rm grism} \leq 0.41$ (coloured circles). The light-magenta contour line represents the NIRISS field of view; North is up and East is to the left. The colour of the data points represents the difference (noted $\Delta z_{\rm grism}$) between the redshift of the sources and $\tilde{z}=0.394$, the median redshift within $0.37 \leq z_{\rm grism} \leq 0.41$. A slight trend of the order of $|{\Delta z_{\rm grism}}| \leq 0.01$ can be seen in the North-South direction. This trend could be due to a real redshift/velocity offset in the $z_{\rm cl} = 0.39$ SMACS~J0723.3$-$7327 cluster across the field or slight field-dependent systematics affecting the NIRISS grism wavelength solutions.} \label{fig:field_variation} \end{figure} As seen in Figure~\ref{fig:zgrism_vs_zspec}, there is an overall excellent agreement between the spectroscopic and grism redshift measurements of both quality 1 and quality 2 sources in our catalogue. In these early days of science with {\it JWST}, it is however important to assess the different biases that may affect our data, data reduction, and measurements. In Figure~\ref{fig:field_variation}, we show the variation of our grism redshift measurements across the NIRISS field-of-view for galaxies with a measured grism redshift consistent with the redshift of the SMACS~J0723.3$-$7327 cluster. We select all galaxies within $0.37 \leq z_{\rm grism} \leq 0.41$, and show as coloured circles the difference between the redshift of the sources and $\tilde{z}=0.394$, the median redshift of the sources within that range. We denote this difference $\Delta z_{\rm grism}$. As seen in the Figure, there seems to be a slight trend of the order of $|{\Delta z_{\rm grism}}| \leq 0.01$ with respect to the North-South direction, with slightly negative $\Delta z_{\rm grism}$ towards the North of the field, and slightly positive $\Delta z_{\rm grism}$ towards the South. This trend could be due to a real redshift/velocity offset in the $z_{\rm cl} = 0.39$ SMACS~J0723.3$-$7327 cluster across the field or due to slight field-dependent systematics affecting the NIRISS grism wavelength solutions in our data. This effect is currently being investigated (J.~Matharu, G.~Brammer), and, if necessary, a correction will be provided in future versions of {\tt Grizli}. Note, however, that this trend currently appears limited and, if caused by systematics, should not affect the overall quality of our grism redshift measurements much beyond the $1\%$ level. Also, we do not observe such a trend with respect to field position when comparing our grism and spectroscopic redshifts for both cluster and non-cluster galaxies. However, spectroscopic sources are mostly located within the central part of the field which was observed with MUSE. This might prevent us from observing a similar field-dependent variation as seen with our grism sample of cluster galaxies. \subsection{Redshift distribution} \label{subsec:redshift-distribution} \begin{figure*} \centering \includegraphics [width=1\textwidth] {Figures/redshift_histogram_v4.png} \caption{Redshift histogram of our final spectroscopic catalogue (c.f.~Table~\ref{tab:catalog}). The main panel shows the redshift distribution up to $z=3.5$, and the inset highlights the $z = 4.5 - 8.5$ range. NIRSpec and MUSE redshifts are shown in orange and hatched-blue, respectively. The NIRSpec redshifts include the six new redshifts we measure in our work (Sec.~\ref{sec:methods-nirspecredshifts}). We show our new NIRISS redshifts in double-hatched purple. These are the new secure redshifts we obtain in our work which do not have a NIRSpec or MUSE measurement. The histogram shows the clear peak at the cluster redshift ($z_{\rm cl} = 0.39$). Three additional peaks at $z=1.1$, $z=1.4$, and $z=2.0$, are seen in the histogram and highlighted by black arrows. The light-red shaded area shows the redshift range where two typically strong emission-lines are visible at the same time in the NIRISS data of the field (c.f.~Sec.~\ref{sec:line_coverage} and Fig.~\ref{fig:line_coverage}). The narrow redshift peak seen at $z=2.0$ suggests it is real and not an instrumental bias.} \label{fig:redshift_histogram} \end{figure*} Figure~\ref{fig:redshift_histogram} shows the redshift distribution of our final spectroscopic catalogue (Table~\ref{tab:catalog}). We show NIRSpec and MUSE spectroscopic redshifts in orange and hatched-blue, respectively, while the double-hatched purple indicates the new NIRISS grism redshifts obtained in our analysis that do not have a NIRSpec or MUSE counterpart. The main panel shows the redshift distribution up to $z=3.5$, and the inset highlights the $z=4.5-8.5$ range (the $z=3.5-4.5$ range does not contain any source in our catalogue). As clearly seen in the Figure, our NIRISS analysis recovers the expected peak at the redshift of the SMACS~J0723.3$-$7327 cluster ($z_{\rm cl}=0.39$) and more than doubles its number of spectroscopic members. At redshifts $z>0.5$, our NIRISS (NIRSpec) work identifies 81 (5) new sources, increasing the number of sources behind SMACS~J0723.3$-$7327 from $31$ to $117$ (including the 5 new $z>0.5$ NIRSpec sources). This significant improvement allows us to identify three galaxy overdensities behind SMACS~J0723.3$-$7327 that were until now missed by the existing {\it JWST}/NIRSpec and VLT/MUSE data of the field. These overdensities, highlighted by the black arrows on the Figure, are at $\overline{z}=1.08$, $1.37$, and $1.98$, with $\gtrsim 10$ secure spectroscopic members each. \begin{itemize} \item {\bf $\overline{z}=1.08$ overdensity.} In the first overdensity, we identify 11 sources within $z=1.05-1.09$, including five based on MUSE spectrosocpy and six based solely on our NIRISS grism analysis. One grism source (ID~680 in our final catalogue; c.f.~Table~\ref{tab:catalog}) possesses four grism components within $\sigma_z=\pm0.002$ of $\overline{z}=1.085$ (IDs 680.1, 680.2, 680.3, 680.4 in our multi-component catalogue; c.f.~Table~\ref{tab:catalog2}), while another source (ID~1155) possesses one grism redshift and two MUSE counterparts with consistent redshifts (IDs~1155.1 and 1155.2). The spatial distribution of the 11 sources over the field is presented in the left panel of Figure~\ref{fig:spatial_dist} (red circles). In the right panel of the Figure, we show a close-up view on four of the sources (IDs~1155, 1156, 1157, 1158) which seem to form a closely-interacting system (indicated by the black ellipse on the left panel in Fig.~\ref{fig:spatial_dist}). These four sources have MUSE spectroscopic redshifts of $z_{\rm spec}=1.082$, $1.082$, $1.083$, and $1.083$, respectively. See Appendix~\ref{sec:spa_dist} for more details on the spatial distribution of the sources. \begin{figure*} \centering \fbox{\includegraphics[width=1\textwidth]{Figures/break_1d_1.png}} \fbox{\includegraphics[width=1\textwidth]{Figures/break_1d_2.png}} \fbox{\includegraphics[width=1\textwidth]{Figures/break_1d_3.png}} \caption{Direct image stamps and 1D grism spectra of the three sources in the $\overline{z}=1.98$ overdensity with significant spectral breaks in their F115W grism data, suggestive of old, quiescent stellar populations. In all panels, the contamination-subtracted F115W and F200W data are shown with black solid lines, while the best-fitting models and contamination estimates are shown in blue and red, respectively. Source IDs~475 (top), 621 (middle), and 836 (bottom) have grism redshifts of $z_{\rm grism}=1.99$, $1.98$, and $1.98$, respectively.} \label{fig:grism_spectra_breaks} \end{figure*} \item {\bf $\overline{z}=1.37$ overdensity.} In the second overdensity ($\overline{z}=1.37$), we identify nine sources within $z=1.36-1.39$, including one galaxy imaged three times by the foreground lensing cluster (artificially increasing the number of counts to 11 in Figure~\ref{fig:redshift_histogram}). The multiple images and redshift of this galaxy were first reported in \citet{Golubchik2022}. We here adopt the redshift of $z = 1.378 \pm 0.001$ obtained from the MUSE [OII]$\lambda3727$ line \citep{Caminha2022, Golubchik2022, Mahler2022arXiv}. In \citet{Mowla2022}, we further report on the discovery and analysis of twelve compact sources associated with the main body of the galaxy (refered to as the ``Sparkler''). In that work, we analyse the color of the compact sources as well as their spectral energy distributions and find that five of the twelve sources are consistent with being evolved globular clusters comprised of single stellar populations formed at $z>9$, i.e., within in the first 500 Myr of cosmic history. The three images of the Sparkler are included in our final catalogue (IDs~615, 679, and 772, corresponding to images 3, 2, and 1 of the Sparkler in the lensing models, respectively). The redshift of the other eight sources comprising the overdensity are based solely on our NIRISS grism analysis. Among those eight sources, one (ID~908) is comprised of three grism components. Two of the components have measured redshifts of $z=1.370$ and $1.372$ (IDs 908.1 and 908.3, respectively), while the third (ID 908.2) has a measured redshift of $z=1.342$. The lower redshift of this component could be due to a relative offset between the direct image centroid and the line-emitting region, contamination from another source, or a real offset indicating that this component is a foreground object. In our final, merged catalogue (c.f.~Table~\ref{tab:catalog}), we report the mean redshift of the three components as the redshift of the object (i.e., $z=1.362$). The spatial distribution of the overdensity is presented in the left panel of Figure~\ref{fig:spatial_dist} (orange crosses). On this Figure, the three images of the Sparkler galaxy are indicated by a black rectangle. Note that we have tentatively identified a number of additional sources in the field that are potentially associated with this $\overline{z}=1.37$ overdensity. Further analysis of these sources is necessary to verify the nature of the features seen in their grism spectra, and this is beyond the scope of the current paper. A more detailed study of this overdensity and its members is deferred to a later analysis. \item {\bf $\overline{z}=1.98$ overdensity.} As mentioned in Sec.~\ref{sec:line_coverage} (and Fig.~\ref{fig:line_coverage}), the redshift range $z=1.68-2.43$ (highlighted by the light-red shaded area on Figure~\ref{fig:redshift_histogram}) is the only range where two typically strong emission-lines are visible at the same time in the F115W and F200W filters ([OII]$\lambda3727$ and H$\alpha$). In that range, this effect might potentially bias the number of sources for which we obtain a secure NIRISS redshift. However, the $\overline{z}=1.98$ overdensity spans a significantly smaller redshift range, indicating that it is a real overdensity and not an instrumental bias. We identify twelve sources within $z=1.96-2.00$, including one based on the NIRSpec data, and eleven based solely on our NIRISS grism analysis. Remarkably, three of the sources (IDs~475, 621, 836) show significant spectral breaks in their F115W grism data, suggestive of old, quiescent stellar populations. We show the 1D grism spectra of these three sources in Figure~\ref{fig:grism_spectra_breaks}. The colors of these three galaxies, as well as an additional source of the overdensity, are also consistent with $z=2.0$ quiescent galaxies (see Sec.~\ref{sec:colors}). Among the eleven grism sources of the overdensity, two have multiple components identified in our work. One source (ID~376) possesses three components within $\sigma_z=\pm 0.008$ of $\overline{z} = 1.966$, while one source (ID~1153) possesses two components within $\pm 0.001$ of $1.985$. Interestingly, the twelve sources of this overdensity seem to be mostly located in the South part of the field, as is shown by the slate-blue squares in Figure~\ref{fig:spatial_dist}. \end{itemize} \begin{figure*} \centering \includegraphics [width=1\textwidth] {Figures/mag_z_phot_grism_merge_after_lens_corr.pdf} \caption{ Magnitude-redshift diagram for sources in our final spectroscopic catalogue, before lensing correction ({\it left}) and after lensing correction ({\it right}). The apparent magnitudes are measured in the F200W band. The magenta circles and orange diamonds represent grism sources of quality flags 1 and 2, respectively. The error bars on the data points are smaller than the symbols except for only one grism source and are therefore not shown in this Figure. Sources with MUSE and NIRSpec spectroscopic redshifts are also indicated with open circles and open squares, respectively. Sources with $z_{\rm spec}>5$ are not shown in the diagram. The cluster redshift ($z_{\rm cl}=0.39$) and the three additional redshift overdensities at $z\sim1.1$, $1.4$, and $2.0$ are highlighted by the vertical grey shaded areas. The redshift range where multiple, typically strong emission lines can be observed with the NIRISS data of the field ($1.68<z<2.43$) is shown by a light-red shaded area. } \label{fig:mag_redshift} \end{figure*} In addition to the well-known cluster at $z_{\rm cl}=0.39$, our work identifies three galaxy overdensities, at $\overline{z}=1.08$, $1.37$, and $1.98$. These are easily discernible in Fig.~\ref{fig:redshift_histogram} and are also apparent in the left panel of Fig.~\ref{fig:mag_redshift}, which shows the observed (i.e., not corrected for lensing magnification) F200W magnitude vs.~redshift of the sources in our final catalogue. On the other hand, the right panel of Fig~\ref{fig:mag_redshift} shows the magnitude-redshift diagram for F200W magnitudes that have been corrected for lensing magnification using the $\mu$ values from the \citet{Caminha2022} model. This Figure illustrates how deep in the galaxy population our catalogue probes. As mentioned earlier, the Sparkler galaxy, which is magnified by perhaps as much as 100$\times$ \citep{Mowla2022}, is part of the $\overline{z}=1.37$ overdensity seen in Figs.~\ref{fig:redshift_histogram} and \ref{fig:mag_redshift}. Given that many of the galaxies in the three redshift overdensities are significantly magnified by the gravitational potential of the foreground $z_{\rm cl}=0.39$ cluster, these structures can be interesting follow-up targets for studies of galaxies in cluster or group environments at higher redshifts. Overall, our work increases the number of secure spectroscopic redshifts in the field of SMACS~J0723.3$-$7327 by a factor of three compared to previous studies, and by more than an order of magnitude between our new {\it JWST}/NIRISS redshifts and previously published {\it JWST}/NIRSpec data. \subsection{Colour distributions}\label{sec:colors} \begin{figure} \includegraphics[width=\columnwidth]{Figures/BzK_phot_grism_merge.pdf} \caption{ The $B\! z\! K$ diagram (measured directly from F435W, F090W, and F200W fluxes) for sources in our photometric catalogue (grey points) and in our final grism redshift sample (coloured according to $z_{\rm grism}$). Only sources with $\rm S/N > 3$ in the different filters are shown in this diagram. Sources not detected in the F435W image are shown with right arrows. The dotted lines show the regions from \citet{daddi_new_2004} used to identify $z<1.4$ galaxies (lower right corner), $z>1.4$ star-forming galaxies (left-hand side of the diagonal line), and $z>1.4$ quiescent galaxies (upper right wedge). } \label{fig:BzK} \end{figure} \begin{figure} \includegraphics[width=\columnwidth]{Figures/F606W_vs_F090W_phot_grism_merge.pdf} \includegraphics[width=\columnwidth]{Figures/F090W_vs_F150W_phot_grism_merge.pdf} \caption{ The color-magnitude diagrams (CMDs) for sources in our photometric catalogue (grey points) and in our final grism redshift sample (coloured according to $z_{\rm grism}$). Only sources with $\rm S/N > 3$ in the different filters are shown in the CMDs. {\it Top panel}: the $m_{606}-m_{090}$ vs.~$m_{606}$ CMD. These colours roughly bracket the D4000 break at the redshift of the $z_{\rm cl}=0.39$ cluster. The red shaded area shows the expected colours of the cluster ellipticals, assuming magnitude uncertainties of $\Delta m=\pm0.25$, calculated from the \citet{coleman_colors_1980} spectral template of elliptical galaxies. {\it Bottom panel}: the $m_{090}-m_{150}$ vs.~$m_{090}$ CMD. These colours roughly bracket the D4000 break at the redshift of the $\overline{z}=1.98$ overdensity. In this panel, the red, grey, and blue shaded regions show the expected colours of the \citet{coleman_colors_1980} spectral templates of E, Sbc, and Im galaxies at $z=2$, respectively, again assuming magnitude uncertainties of $\Delta m=\pm0.25$. } \label{fig:CMD} \end{figure} Figure~\ref{fig:BzK} shows the observed-frame $BzK$ diagram \citep{daddi_new_2004} of all sources in our final catalogue (colour-coded by their grism redshift) as well as of sources from our parent photometric dataset (grey points). We directly use the observed {\it HST}/ACS F435W, and {\it JWST}/NIRCam F090W, and F200W fluxes that probe the $B$, $z$, and $K$ pass-bands, respectively, and only show sources that have a ${\rm S/N}>3$ in the different filters. Sources that are not detected in the F435W filter (i.e., $B$ pass-band) are shown as right arrows in the Figure. We also show as dotted lines the separation between $z>1.4$ star-forming (left-hand side of the diagonal line), $z>1.4$ quiescent (upper-right wedge), and $z<1.4$ (lower-right corner) galaxies \citep{daddi_new_2004}. As expected, galaxies identified at the cluster redshift populate the lower-right corner of the diagram, and galaxies with $z_{\rm grism}>1.4$ are predominantly located on the left-hand side of the diagonal line. A number of $z_{\rm grism} \geq 2.0$ sources with red, $z - K > 2.5$~mag (AB), colours are not detected in the F435W observations and it cannot be determined whether their colours are consistent with that of $z>1.4$ quiescent galaxies based on the $BzK$ diagram alone. In Figure \ref{fig:CMD}, we show the colour-magnitude diagrams (CMDs) of the sources in our final catalogue (colour-coded by their grism redshift) and of that of our parent photometric dataset (grey points). In the top panel of the Figure we show the $m_{606}-m_{090}$ vs.~$m_{606}$ diagram (roughly probing the D4000 break at the redshift of the cluster), while we show the $m_{090}-m_{150}$ vs.~$m_{090}$ diagram (roughly probing the D4000 break at the redshift of the $\overline{z}=1.98$ overdensity) in the bottom panel. Again, we only show sources that are detected with ${\rm S/N}>3$ in the different filters. The horizontal shaded areas show the expected colours of elliptical, spiral, and irregular galaxies derived from the Elliptical, Sbc, and Im template spectra of \citet{coleman_colors_1980} (CWW) at the redshifts indicated in the Figure. In the top panel of Figure~\ref{fig:CMD}, the $z_{\rm cl}=0.39$ SMACS~J0723.3$-$7327 cluster quiescent galaxies (blue circles) are seen forming a cluster red sequence at $m_{606}-m_{090}\sim 1.5$~mag (AB), as expected from the CWW models. These objects are also seen as a tight sequence in the $m_{090}-m_{150}$ vs.~$m_{090}$ colour-magnitude diagram, shown in the bottom panel of Fig.~\ref{fig:CMD}. However, this sequence is not the classic cluster color-magnitude `red-sequence' since the D4000 break is at shorter wavelengths than those probed by $m_{090}-m_{150}$ colours, but is due to the uniform and relatively flat colour of cluster galaxies above the D4000 break. Based on our template set of old, quiescent galaxy spectra, we interpret the tilt in this $z\sim0.4$ color-magnitude sequence as due to the metallicity and age dependence on galaxy stellar mass since the $m_{090}-m_{150}$ colour (rest-frame $\lambda_{\rm rest} = 0.6 - 1.1$~\micron~at the redshift of the cluster) is sensitive to the strength of the TiO bands present within that wavelength range. The Figure illustrates that even relatively shallow NIRISS observations can secure large samples of absorption-line redshifts for intermediate-redshift galaxies. The bottom panel of Fig.~\ref{fig:CMD} also reveals six $z\sim2$ sources with red, $m_{090}-m_{150}>2$~mag (AB), colours, consistent with the colours of quiescent galaxies at these redshifts. Among them are the three sources with significant D4000 breaks in their NIRISS spectra (see Fig.~\ref{fig:grism_spectra_breaks}), which are associated with the $\overline{z}=1.98$ redshift overdensity. We interpret them as group or (proto)cluster quiescent galaxies at this redshift. These six red, $z\sim2$ objects also stand out as $z-K>2.5$~mag (AB) objects in the $BzK$ diagram shown in Fig.~\ref{fig:BzK}. As already mentioned, none of the six are detected in the $B$ pass-band (observed F435W), but their $z-K$ colours and $B-z$ limits are not inconsistent with the colours of $z\sim2$ quiescent galaxies. This is not inconsistent with our observation that at least three of these objects are high-redshift quenched galaxies associated with the $\overline{z}=1.98$ redshift overdensity. In addition to the red, quiescent sources with prominent D4000 breaks in their NIRISS spectra, the $\overline{z}=1.98$ overdensity also contains a number of sources consistent with the colours of $z\sim2$ star-forming galaxies (consistent with the $z=2$ CWW Im spectral template in Fig.~\ref{fig:CMD}, shown as the light-blue shaded area) and identified through the presence of [OII]3727\AA\ and H$\alpha$ emission lines in their spectra. This $\overline{z}=1.98$ galaxy overdensity, containing a significant number of both red quiescent and blue star-forming galaxies offers the opportunity to study in great detail the properties of galaxies in a dense environment at cosmic noon. \section{Caveats} \label{sec:caveats} As mentioned and demonstrated in the previous sections, we have taken a conservative approach to obtain secure spectroscopic redshifts for a fairly large subset of sources that can be of use to the community, rather than a complete catalogue for the full sample. Objects with redshifts that we consider to be uncertain are thus excluded from our final catalogue. While our final spectroscopic catalogue is deemed secure, we here list the different caveats associated to our underlying data and analysis. \begin{itemize} \item {\bf Photometry.} In this work, we use a pre-flight reference file for which photometric zero-points may be incorrect \citep[see, e.g.,][]{Boyer2022}. As mentioned, we therefore use {\tt EAzY} to re-derive proper photometric zero-points consistent with the photometric redshift fitting of our source catalogue as we describe in \citet{Mowla2022}, and we also add a systematic error of $3\%$ of the flux to the photometric errors to derive our photometric redshifts. To test the quality of the photometry, we use the spectroscopic redshifts as well as the secure quality 1 grism redshifts to independently re-derive new zero-point corrections using {\tt Phosphoros}. In all {\it JWST}/NIRCam bands, the new corrections are less than $5\%$ of the fluxes. This is also true for the {\it HST}/ACS bands, except for the F435W where the correction reaches $\sim +40\%$. However, this large correction factor can be explained by the shallow depth of the {\it HST}/ACS F435W observations and the large errors on the F435W fluxes which do not allow a proper measurement of the zero-point correction for this filter. As an additional test, we derive new photometric redshifts using the {\tt Phosphoros} zero-point corrections, and we notice only small differences in the results, indicating that the large correction factor in the F435W band does not have a strong impact and that the errors on the flux measurements dominate. \item {\bf Completeness and purity.} As shown in the comparison of independently-measured grism and spectroscopic redshifts in Section~\ref{sec:redshift_fidelity}, our final spectroscopic catalogue represents a high-quality sample of redshifts, for both NIRISS grism redshifts of quality 1 (multiple features) and of quality 2 (single features identified with our photometric redshifts). Our redshift fidelity assessment suggests that very few, if any, of the redshifts are catastrophically wrong. Our catalogue is therefore deemed very secure, but at a potential high-cost against completeness, in terms of e.g., magnitude, colour, redshift, etc. Note that the lack of the F150W filter in the NIRISS WFSS observations of the SMACS~J0723.3$-$7327 field (see Sec.~\ref{sec:line_coverage} and Fig.~\ref{fig:line_coverage}), as well as the spectral contamination due to the high density of sources, additionally conspire against completeness in the field. \item {\bf Redshift precision and accuracy.} Due to the low resolution of the two orthogonal grisms ($R\sim150$) and the morphological broadening of emission and absorption features for extended objects\footnote{While we are developing methods to properly model and fit the grism data of such large objects (see, e.g., Sec.~3.3 in \citealt{Mowla2022}, and Estrada-Carpenter et al.~in prep.), those are currently not included in the present catalogue.}, the NIRISS grism redshifts of this work are of lower precision than the NIRSpec ($R\sim 1000$) and MUSE ($R\sim 3000$) redshifts of the field. Additionally, as shown in Section~\ref{subsection:field-variation}, the current reduction of the NIRISS data may be affected by slight field-dependent calibration issues (e.g., slight wavelength-solution systematics). While further analysis is necessary to better understand the origin of this slight field-variation, we caution the reader that we conservatively assume the current accuracy of our grism redshift measurements to be no better than $\delta z \sim 0.01$. \item {\bf Cluster galaxies.} In this work, the NIRISS grism redshifts of the bright cluster ellipticals are obtained based on the identification and fitting of the multiple, strong (TiO) absorption features present in the spectrum of old, quiescent galaxies around $\lambda_{\rm rest} \sim 0.8~\micron$ (see Fig.~\ref{fig:grism_spectra_clg}, and \citealp{GrayCorballyBook}). Given that a number of absorption bands are present in this spectral region, it is possible that a number of foreground or background objects have been misidentified for $z_{\rm cl}=0.39$ cluster galaxies. However, the comparison of our grism redshifts to the spectroscopic redshifts in the field do not reveal any such mis-identification (see Fig.~\ref{fig:zgrism_vs_zspec}). This suggests that our final spectroscopic catalogue is little to not affected by misidentified cluster galaxies. \item {\bf Multiply-imaged sources.} Because of the gravitational-lensing effect of the SMACS~J0723.3$-$7327 cluster, some sources in our final spectroscopic catalogue may correspond to the same, multiply-imaged objects. This may potentially affect the number of individual galaxies shown in our redshift distribution and in the three newly-identified redshift overdensities. In the $\overline{z} = 1.37$ overdensity, one source (the Sparkler) is imaged three times. We compare the observed colours of the other sources in the three overdensities, and visually inspect their direct image stamps, but we do not find evidence for additional multiply-imaged sources. Also, we do not find any match between our new NIRISS grism sources and the list of multiple-image systems of \citet{Caminha2022} and \citet{Mahler2022arXiv}. The multiple-image systems with a match in our final catalogue are spectroscopic sources with already known MUSE or NIRSpec redshifts (including the Sparkler), except system 4 in the \citet{Caminha2022} model for which we identify a new, previously unpublished, NIRSpec redshift (see Appendix~\ref{sec:methods-nirspecredshifts}). This comparison suggests that the new NIRISS grism redshifts identified in our work are likely comprised of a very small number, if any, of multiply-imaged systems. In particular, this should not affect our conclusions regarding the three newly-identified redshift overdensities in the field. \item {\bf Mismatched sources.} In our final spectroscopic catalogue, we merge together grism sources falling within the same segmentation region of a single photometric object (see Sec.~\ref{sec:methods-grism-photoz}). In this step, we verify {\it a posteriori} that the grism redshift measurements of the different grism components are consistent with one another. In all cases, we find that the different grism components of a single photometric source agree within $\pm 0.01\times(1+z)$. This suggests that only a very small number of sources, if any, may potentially be affected by a mis-match between our photometric and spectrocopic catalogues. \end{itemize} \section{Conclusions}\label{sec:conclusion} In this paper, we present a catalogue of spectroscopic redshifts in the field of SMACS~J0723.3$-$7327. We primarily use the {\it JWST}/NIRISS slitless grism spectroscopy of the Early Release Observations of the field, supported with {\it JWST}/NIRCam and {\it HST}/ACS photometry. And we complement our grism spectroscopic redshifts with {\it JWST}/NIRSpec and VLT/MUSE redshifts published in the literature. Throughout this work, we take a conservative approach to obtain secure NIRISS grism redshifts. To do so, we first develop a multi-step methodology to review and assess the quality of the NIRISS grism data and of our redshift fitting procedure. This methodology, which includes the visual inspection of the data products and of each spectral fitting by multiple reviewers, is primarily based on ({\it i}) the unambiguous identification of multiple spectral features in the NIRISS grism data (quality 1) or ({\it ii}) the unambiguous identification of a single spectral feature whose nature is securely determined based on two independent photometric redshift estimates (namely, using {\tt Phosphoros} and {\tt EAzY}; quality 2). Based on this careful methodology, we obtain the following results: \begin{itemize} \item[1.] We obtain a spectroscopic catalogue in the field of SMACS~J0723.3$-$7327 consisting of a total of 190 sources with secure spectroscopic redshifts, including 156 NIRISS grism redshifts, 123 of which are for sources whose redshifts were previously unknown. This increases the number of secure spectroscopic redshifts in this field by a factor of three compared to previous studies, and by more than an order of magnitude between our new {\it JWST}/NIRISS redshifts and previously published {\it JWST}/NIRSpec data. \item[2.] The redshift distribution of our final spectroscopic catalogue recovers the redshift peak at the redshift of the SMACS~J0723.3$-$7327 cluster ($z_{\rm cl} = 0.39$). In particular, the new NIRISS grism redshifts that we obtain in this work more than double the number of spectroscopic members of the cluster, which we identify based on the strong TiO absorption features ($\lambda_{\rm rest} \sim 0.8~\micron$) seen in their F115W grism data. It also increases the number of background sources behind SMACS~J0723.3$-$7327 from 31 to 117, including the five new $z>0.5$ NIRSpec redshifts we obtain in our work. \item[3.] We identify three galaxy overdensities behind SMACS~J0723.3$-$7327 thanks to our significant increase in the number of secure spectroscopic redshifts in the field. These newly-discovered overdensities, until now missed by the existing {\it JWST}/NIRSpec and VLT/MUSE data, are at $\overline{z} = 1.08$, $1.37$, and $1.98$, with $\gtrsim 10$ secure spectroscopic members each. In particular, we identify twelve sources in the $\overline{z} = 1.98$ overdensity, eleven of which are based solely on our NIRISS grism analysis. Three of the sources of this overdensity also show significant spectral breaks in their F115W grism data, consistent with $z=2.0$ quiescent galaxies. \item[4.] We compare {\it a posteriori} our NIRISS grism redshifts to the spectroscopic redshifts of the field. We find an excellent agreement between grism and spectroscopic redshifts, for both quality 1 and quality 2 grism sources, with all sources but one showing deviations of less than $\pm0.01\times(1+z_{\rm spec})$ with marginal systematic bias. Using the cluster galaxy grism redshifts, we however find a slight systematic trend no larger than $\pm0.01$ in redshift with respect to the North-South direction of the field. Therefore, we conservatively assume the current accuracy of our grism redshift measurements to be no better than $\delta z \sim 0.01$. \item[5.] We find that the colour distribution of the cluster galaxies identified in our NIRISS analysis is consistent with the expected colours of elliptical galaxies at the redshift of the cluster. Additionally, we find that the colours of six of our sources at $z\geq2$ are consistent with that of $z=2.0$ old, quiescent galaxies, including the three galaxies of the $\overline{z} = 1.98$ overdensity with strong spectral breaks in their grism data. \end{itemize} Altogether, our work demonstrates the power of {\it JWST}, and particularly of the Wide Field Slitless Spectroscopy mode of the NIRISS instrument to identify and securely determine the redshift of large numbers of extragalactic sources, even in relatively shallow NIRISS grism exposures that were further impacted by the lack of the middle F150W filter in these specific observations. Our spectroscopic catalogue\footnote{Which is made publicly available at \url{https://niriss.github.io/smacs0723}.} offers a new, significant resource of carefully-vetted spectroscopic redshifts in ``Webb's First Deep Field'', SMACS~J0723.3$-$7327. It also offers a basis for further studies of the properties of the new cluster galaxies identified in our work, as well as of the background sources, in particular those of the three new overdensities identified in our work. \section*{Acknowledgements} This research was enabled by grant 18JWST-GTO1 from the Canadian Space Agency, funding from the Natural Sciences and Engineering Research Council of Canada, and scholarships to YA from from the Japan Society for the Promotion of Science. \section*{Data Availability} Grism redshifts and associated photometry measurements made as part of this work are included as online material to this paper and are also available from the CANUCS project website ({\url{https://niriss.github.io/smacs0723}}). The underlying {\it JWST} and {\it HST} data are publicly available from MAST. \bibliographystyle{mnras}
\section{Introduction} \label{sec:tracing_introduction} \renewcommand*{\thefootnote}{\fnsymbol{footnote}} \footnotetext[2]{\url{https://github.com/DavoGrant/harmonica}} \footnotetext[2]{\url{https://harmonica.readthedocs.io}} Planets are inherently three-dimensional (3D) objects, with radiative and advective timescales governed by 3D chemical and dynamical processes. To study these processes, general circulation models (GCMs) have been developed to simulate the multidimensional physics at play in the atmospheres of exoplanets \citep[e.g.,][]{Showman2009, menou2009atmospheric, mayne2014unified}. These GCMs can help inform us of how physical processes may be manifested in observations, and thereby how the physics may become testable. For hot Jupiters, tidally-locked orbits and close proximity to their host stars create permanent, strong day-night heating contrasts. This process is a key driver of the resulting atmospheric circulation \citep{showman2013atmospheric, pierrehumbert2019atmospheric, zhang2020atmospheric}, leading to rotational and divergent flows \citep{hammond2021rotational} and net easterly equatorial superrotation \citep{showman2010matsuno}. For these types of planets, several observable multidimensional effects have been theorised. These include non-uniform thermal structure \citep{feng2016impact, KomacekShowman2016, KomacekShowmanTan2017, taylor2020understanding}, temperature and molecular abundance differences between leading and trailing limbs \citep{fortney2010}, transit timing offsets relating to differing limb signatures \citep{dobbs-dixon2012}, advection of the hot spot downwind of the substellar point \citep{cooper2005dynamic, Burrows2010ApJ, kataria2015atmospheric, parmentier2018exoplanet}, and inhomogeneous cloud and haze coverage at the terminator \citep{kempton2017, Powell2019ApJ, Lines2018HD209, Lines2019HD189}. For smaller terrestrial planets, although the observables are significantly weaker, processes such as the presence of a surface \citep{may2020super} or the exact physical prescription \citep{sergeev2022bistability} can influence the atmospheric circulation. \begin{figure*} \centering \includegraphics[width=\textwidth]{figs/transmission_strings_schematic.pdf} \caption{Concept schematic of transmission strings. Centre: four example transmission strings inferred from four light curve fits at wavelengths of 2.6, 3.3, 4.0, and 4.7 \textmu m. The eastern (trailing) terminator is on the left-hand side. Note that the deviations from circular have been amplified for visual clarity. Surrounding panels: three cuts around the terminator at angles of 0, $\pi/2$, and $\pi$ radians, produce three different transmission spectra. The transmission spectra are shown in units of transit depth, defined as $r_{\rm{p}}^2 / R_{\rm{s}}^2$ where $R_{\rm{s}}$ is the radius of the star. The transit depth data points correspond in colour with the transmission strings. These data are based on the models of \citet{fortney2010}, and show the transition in $\rm{CO/CH}_4$ abundance ratio from the cooler western terminator to the hotter eastern terminator.} \label{fig:transmission_string_schematic} \end{figure*} \begin{figure} \centering \includegraphics[width=\columnwidth]{figs/fourier_terms_schematic.pdf} \caption{The first 7 terms of our Fourier parameterisation of transmission strings. Each shape is the sum of the zeroth order term, $a_0=0.1$, and the corresponding grid point's high order term at varying amplitudes. For example, the bottom-left shape is given by $r_{\rm{p}}(\theta) = 0.1 + a_3 \cos{3 \theta}$, where $a_3 \in \{ -0.05, -0.02, 0.0, 0.02, 0.05 \}$.} \label{fig:fourier_terms_schematic} \end{figure} From the observational side, evidence for some of these multidimensional effects has already been found. Longitudinal variations, and hot-spot offsets, have been observed from numerous phase curves \citep[e.g.,][]{cowan2012thermal, Demory2013ApJ, Beatty2019AJ, Keating2019NatAs, mikal2022diurnal}, dayside brightness distributions measured via eclipse mapping \citep{knutson2007map, de2012towards, majeau2012two}, and high-resolution ground-based observations have revealed insights into the condensation of species across the day-night transition \citep[e.g.,][]{Ehrenreich2020, kesseli2022atomic}. However, these measurements are hard to make and require precise high-cadence observations limiting investigations to the hottest and brightest targets. With the launch of JWST, transit data is now available with greater precision than ever before. Previous analysis into multidimensional observables has centred around phase curves. But, for some planets the planet-to-star contrast ratio may be more favourable in transmission; and therefore, the multidimensional signals more susceptible to detection. In fact, it was shown by \citet{MacDonald2020} that accounting for the multidimensional nature of planetary atmospheres in transmission is vital to producing unbiased inferences. To extract these signals in transmission, one potential method is to fit light curves with a circular occultation model \citep[e.g.,][]{mandel2002analytic}, and then, with the resulting transmission spectrum perform multidimensional retrieval modelling \citep[e.g.,][]{MacDonaldLewis2022}. A transmission spectrum produced in this way constitutes some overall average of the atmospheric conditions through which the light propagates, and thus requires the retrievals to disentangle any multidimensional variability. Inferring differences around the terminator, along the line of sight, and in elevation, wrapped up in one spectrum, is a challenging modelling task. As shown by \citet{von2016inferring} and \citet{EspinozaJones2021AJ}, an alternative method is to draw out any spatial information available at the light curve fitting stage, prior to retrieval modelling. At both ingress and egress a planet only partially occults the star, with different sectors around the terminator interposing our line of sight at different times. Similarly, during transit the star's limb-darkened surface provides a variable backlight to different sectors of the atmosphere. These two effects mean that spatial information around the terminator is present directly in the light curve data. Therefore, it may be advantageous to draw out any variation around the terminator at the light-curve fitting stage, and alleviate multidimensional retrievals of one of their degrees of freedom. To this end, we devise a general mathematical object for inferring atmospheric variability around the terminator directly from the light curve data. We refer to these objects as {\it transmission strings}. The utility of transmission strings is to enable the extraction of transmission spectra as a function of angle around a planet's terminator. This method utilises the spatial information as early as possible in the data analysis procedure, with the intention of making multidimensional retrieval modelling easier and improving our 3D inferences of exoplanet atmospheres. Our study is structured as follows. In Section \ref{sec:transmission_strings} we describe the concept behind transmission strings and define their parameterisation in terms of Fourier series. In Section \ref{sec:computing_light_curves} we detail the mathematics and algorithm for computing the light curve associated with a given transmission string. In Section \ref{sec:performance_benchmarks} we measure the performance of our algorithm. In Section \ref{sec:demo} we demonstrate our technique's capabilities for inference on a JWST-like dataset. In Section \ref{sec:discussion} we discuss further complexities of our approach. Finally, in Section \ref{sec:summary_and_conclusions} we summarise our findings. \section{Transmission strings} \label{sec:transmission_strings} Typically, a model fit to a transit light curve yields a single measurement of planet radius, $r_{\rm{p}}$, based on a model of a circular occultor. Here, we extend this modelling approach beyond circular shapes, allowing for variability around the planet's terminator. We define the planet radius to be a single-valued function of angle around the terminator, $r_{\rm{p}}(\theta)$, and we refer to this mathematical object as a transmission string. The utility of a transmission string is borne out by observations of light curves at multiple wavelengths. For each light curve a different transmission string may be inferred. From these transmission strings a transmission spectrum may be produced for any $\theta$. To illustrate this concept, in Figure \ref{fig:transmission_string_schematic} we display an example based on the models of \citet{fortney2010}. In these models of tidally-locked hot Jupiters, a common feature that appears is a wide low-latitude wind circulating from west to east. This circulation displaces the hottest and coldest regions of the planet, with the hot substellar atmosphere being advected towards the east. The result is a difference in temperature between the eastern and western terminators; and therefore, a possible difference in chemical abundances. If observed light curves from a planet of this nature are fit with a circular transit model, the resulting transmission spectrum averages out the variability, and may make the multidimensional information difficult to retrieve. Instead, if at the light curve fitting stage we measure a transmission string for each wavelength, as displayed in the centre of Figure \ref{fig:transmission_string_schematic}, we can generate different transmission spectra at each angle around the terminator, which show the planet's atmospheric variation. Specific to this example, the $\rm{CO/CH}_4$ abundance ratio shows a strong dependence on the temperature variation around the terminator. In the right-hand panel, the transmission spectrum at $\theta=0$ has prominent $\rm{CH}_4$ absorption at 3.3 \textmu m, but little $\rm{CO}$ absorption at 4.7 \textmu m. In contrast, the left-hand panel, showing the transmission spectrum at $\theta=\pi$, has weaker $\rm{CH}_4$ but far stronger $\rm{CO}$ absorption. Inspecting the difference between these two transmission strings, at 3.3 \textmu m (light blue) and at 4.7 \textmu m (yellow), we see how the 4.7 \textmu m transmission string infers a relatively smaller planet radius at $\theta=0$, but for angles around $\theta=\pi$ this radius has inflated beyond that of the 3.3 \textmu m transmission string. Between these wavelengths, at 4.0 \textmu m the transmission string (green) is fairly circular. This transmission string probes wavelengths between strong molecular absorption bands, deeper in the atmosphere, and is only slightly inflated around $\theta=\pi$ due to the temperature increasing the atmospheric scale height \citep{dobbs-dixon2012}. The example above expresses how measurements of transmission strings, directly from the light curves, can extract multidimensional spectral information. Whilst this example focused on carbon chemistry, there are many further potential applications of transmission strings in investigations into the 3D chemical and dynamical processes in exoplanet atmospheres. \subsection{Harmonic transmission strings} \label{sec:harmonic_transmission_strings} A transmission string may be parameterised by any single-valued function, $r_{\rm{p}}(\theta)$. Using this definition, the classical circular model of a transiting planet can be thought of as a transmission string where $r_{\rm{p}}(\theta)=\rm{constant}$. Another previous parameterisation includes the back-to-back semi-circles of \citet{von2016inferring} and \citet{EspinozaJones2021AJ}, equivalent to a transmission string parameterised by a top-hat function. However, this parameterisation assumes a rigid dichotomy between the east and west hemispheres of a planet, while 3D effects likely imprint continuous functions around the terminator of a planet's atmosphere \citep[e.g.,][]{dobbs-dixon2012, parmentier20133d}. In this study, we expand the set of possible transmission strings into a more general framework. We define a transmission string in terms of a Fourier series, such that \begin{equation} r_{\rm{p}}(\theta) = \sum_{n=0}^{N_c} a_{n} \cos{(n \theta)} + \sum_{n=1}^{N_c} b_{n} \sin{(n \theta)}, \label{eq:transmission_string_real} \end{equation} where $a_n$ and $b_n$ are the $n$th harmonics' amplitudes, the total number of terms is equal to $2N_c + 1$, and $r_{\rm{p}}$ is in units of stellar radius. The angle $\theta$ is measured around the terminator, anti-clockwise in the plane of the sky, from the direction of the planet's sky-projected orbital velocity. The first 7 terms of our parameterisation are displayed in Figure \ref{fig:fourier_terms_schematic}. The zeroth order term, $a_0$, is displayed at the top and represents the mean radius of the planet. Subsequent drawings show the deviations from a circular geometry generated by the high order terms. The value of this parameterisation lies in the flexibility to build transmission strings of arbitrary complexity, whilst being reducible to the classical circular case. For a model utilising only the first 4 terms, a transmission string may already encode variation of the mean radius ($a_0$), east-to-west differences ($a_1\cos{\theta}$), north-to-south differences ($b_1\sin{\theta}$), and equatorial-vs-polar inflation ($a_2\cos{2\theta}$). In reality, the complexity we are able to infer in a given transmission string will be driven by the quality of the data. \section{Computing light curves} \label{sec:computing_light_curves} In this section we describe the mathematics for computing light curves of transiting exoplanets, where the occulting shape of a planet -- the transmission string -- is parameterised by a Fourier series. First we define two coordinate systems, one centred on the stellar disc defined by $x, y$ and $r,\phi$ in Cartesian and polar form, respectively, and another centred on the planet's transmission string defined by $x^{\prime}, y^{\prime}$ and $r^{\prime},\phi^{\prime}$. The two coordinate systems are separated by a distance $d$, with the $x$-directions pointing along the line of centres from the star to the planet, and the $z$-directions pointing towards the observer. Transmission strings are defined in terms of the angle $\theta$, such that they have a consistent orientation with respect to the planet's sky-projected orbital velocity vector, $\bmath{v}_{\rm{orbit}}$. We define $\nu$ as the angle between $\bmath{v}_{\rm{orbit}}$ and the line of centres, and therefore $\phi^{\prime} = \theta - \nu + \pi$. These coordinate systems are shown graphically in Figure \ref{fig:coordinates}. Note that the coordinate systems update as the planet orbits. For further reference, an index of symbols used throughout this work is provided in Tables \ref{tab:symbols} and \ref{tab:symbols_continued}. To compute the normalised light curve flux, $F = 1 - \alpha$, we must solve the integral \begin{equation} \alpha = \iint I(\mu) \,dA, \label{eq:flux_integral} \end{equation} where $\alpha$ is the fractional decrease in stellar flux due to an occulting planet. This integral is computed over the sky-projected area of the planet overlapping with the stellar disc, where $I$ is the normalised stellar flux as a function of $\mu = \sqrt{1 - r^2}$ due to limb darkening. This integral is not easy to solve, especially given we should like solutions to have both fast runtimes and high precisions (see Section \ref{sec:performance_benchmarks}), all the while being applicable to a variety of stellar limb-darkening laws. For the classical circular case, a variety of solutions and approximate methods have proved widely useful \citep[e.g.,][]{mandel2002analytic, gimenez2006equations, kreidberg2015batman}. However, for our non-circular case none of these methods are optimal, owing to the complex boundary of the planet's limb. Instead, it is insights from \citet{pal2012light} that our method stands on the shoulders of most. The crucial idea is to convert the double integral over the occulted area into a line integral around the boundary enclosing this area using Green's theorem. This method has been used to great effect for computing complex light curves of mutual transits \citep{pal2012light, short2018accurate}, bodies with specific surface intensity maps \citep{luger2019starry}, and for improving the runtime and precision of the classical circular transits \citep{agol2020analytic}. In the following subsections we detail our solutions using this method, with a particular emphasis on finding solutions that are performant. For these solutions we prefer to work with transmission strings reparameterised into complex form, such that \begin{equation} r_{\rm{p}}(\theta) = \sum_{n=-N_c}^{N_c} c_{n} e^{i n \theta}, \\ \label{eq:transmission_string_complex} \end{equation} where \begin{equation} c_{n} = \begin{cases} \frac{1}{2}(a_n + i b_n), & n < 0, \\ a_n, & n = 0, \\ \frac{1}{2}(a_n - i b_n), & n > 0. \end{cases} \\ \label{eq:transmission_string_coomplex_coeffs} \end{equation} \begin{figure} \centering \includegraphics[width=\columnwidth]{figs/coordinate_system.pdf} \caption{Coordinate system definitions. Both the stellar disc (orange line) and planet's transmission string (blue line) are shown in the plane of the sky. An index of symbols can be found in Tables \ref{tab:symbols} and \ref{tab:symbols_continued}.} \label{fig:coordinates} \end{figure} \subsection{Limb darkening basis} \label{subsec:limb_darkening_basis} We search for solutions to Equation \ref{eq:flux_integral} supporting the most common stellar limb-darkening laws: the quadratic law \citep{kopal1950detailed}, the square-root law, \citep{diaz1992new}, and the non-linear law \citep{claret2000new}. Given the overlap in terms between the square-root and non-linear law, these three parameterisations are encompassed by \begin{align} \label{eq:limb_darkening_law_quadratic} & \frac{I_{\rm{q}}}{I_{\rm{q}, 0}} = 1 - u_1 (1 - \mu) - u_2 (1 - \mu)^2, \\ \label{eq:limb_darkening_law_non_linear} & \frac{I_{\rm{nl}}}{I_{\rm{nl}, 0}} = 1 - u_1 (1 - \mu^{\frac{1}{2}}) - u_2 (1 - \mu) - u_3 (1 - \mu^{\frac{3}{2}}) - u_4 (1 - \mu^2), \end{align} where $u_i$ are the limb-darkening parameters, the subscripts q and nl denote the quadratic and non-linear laws, respectively, and the subscript 0 is a normalisation constant such that the total unocculted flux is unity. Following \citet{luger2019starry} and \citet{agol2020analytic}, we find it useful to recast the limb-darkening laws as dot products of vectors, and then transform into a more convenient basis for solving the integral. This may be written \begin{equation} \frac{I}{I_0} = \tilde{\bmath{u}}^T \bmath{u}, \label{eq:limb_darkening_dot_product} \end{equation} where $\tilde{\bmath{u}}$ is the limb-darkening basis and $\bmath{u}$ is the vector of limb-darkening parameters. These vectors take the form \begin{equation} \tilde{\bmath{u}}_{\rm{q}} \hspace{0.5mm} = \begin{bmatrix} 1 \\ -(1 - \mu) \\ -(1 - \mu)^2 \end{bmatrix}, \hspace{5.6mm} \bmath{u}_{\rm{q}} = \begin{bmatrix} 1 \\ u_1 \\ u_2 \end{bmatrix}, \label{eq:limb_darkening_vectors_quadratic} \end{equation} or \begin{equation} \tilde{\bmath{u}}_{\rm{nl}} = \begin{bmatrix} 1 \\ -(1 - \mu^{\frac{1}{2}}) \\ -(1 - \mu) \\ -(1 - \mu^{\frac{3}{2}}) \\ -(1 - \mu^2) \end{bmatrix}, \hspace{4.35mm} \bmath{u}_{\rm{nl}} = \begin{bmatrix} 1 \\ u_1 \\ u_2 \\ u_3 \\ u_4 \end{bmatrix}, \label{eq:limb_darkening_vectors_non_linear} \end{equation} for each of the quadratic and non-linear laws, respectively. Now, Equation \ref{eq:limb_darkening_dot_product} may be written in terms of a new basis. We find a polynomial basis aids the computation of our integral, and so we have \begin{equation} \frac{I}{I_0} = \tilde{\bmath{p}}^T \bmath{p} = \tilde{\bmath{p}}^T \mathbfss{B} \bmath{u}, \label{eq:limb_darkening_dot_product_change_of_basis} \end{equation} where $\tilde{\bmath{p}}$ is the new polynomial basis, $\bmath{p}$ is the vector of limb-darkening parameters in this new basis, and $\mathbfss{B}$ is the change of basis matrix. Again, for each of the quadratic and non-linear laws, these vectors and matrices take the form \begin{equation} \tilde{\bmath{p}}_{\rm{q}} \hspace{0.5mm} = \begin{bmatrix} 1 \\ \mu \\ \mu^2 \end{bmatrix}, \hspace{5.6mm} \mathbfss{B}_{\rm{q}} = \begin{bmatrix} 1 & -1 & -1\\ 0 & 1 & 2 \\ 0 & 0 & -1 \end{bmatrix}, \label{eq:limb_darkening_change_of_basis_quadratic} \end{equation} or \begin{equation} \tilde{\bmath{p}}_{\rm{nl}} = \begin{bmatrix} 1 \\ \mu^{\frac{1}{2}} \\ \mu \\ \mu^{\frac{3}{2}} \\ \mu^2 \end{bmatrix}, \hspace{4.35mm} \mathbfss{B}_{\rm{nl}} = \begin{bmatrix} 1 & -1 & -1 & -1 & -1 \\ 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 1 \\ \end{bmatrix}. \label{eq:limb_darkening_change_of_basis_non_linear} \end{equation} Using this framework, we may rewrite Equation \ref{eq:flux_integral} in terms of a vector of integrals, each element of which only depends on one power of $\mu$: \begin{align} \alpha &= I_0 \iint \tilde{\bmath{u}}^T \bmath{u} \,dA \nonumber \\ &= I_0 \iint \tilde{\bmath{p}}^T \mathbfss{B} \bmath{u} \,dA \nonumber \\ &= I_0 \bmath{s}^T \mathbfss{B} \bmath{u} \vphantom{\iint}, \label{eq:limb_darkening_integral_vector_form} \end{align} where \begin{equation} \bmath{s} = \iint \tilde{\bmath{p}} \,dA. \label{eq:solution_integral} \end{equation} Our task is now to solve the integrals in Equation \ref{eq:solution_integral}. Once solutions are found for each vector element, i.e. all half-integer powers of $\mu$ arising from Equations \ref{eq:limb_darkening_change_of_basis_quadratic} and \ref{eq:limb_darkening_change_of_basis_non_linear}, we will be able to compute $\alpha$ for any of the limb-darkening laws specified above. \subsection{The occultation integral and Green's theorem} \label{subsec:the_occultation_integral} Let us now consider methods of solving Equation \ref{eq:solution_integral}. As shown by \citet{pal2012light}, solutions may have favourable properties when converting these double integrals into line integrals, using Green’s theorem. We too find this approach to be beneficial, enabling us to identify closed-form solutions for some of the terms, and well-behaved approximations for others. To accomplish this conversion, we require a specific form for the $n$th element of $\tilde{\bmath{p}}$: \begin{equation} \tilde{p}_n = \frac{\partial D_n}{\partial x} - \frac{\partial G_n}{\partial y}. \label{eq:pn_greens_form} \end{equation} Here we have defined $D_n$ and $G_n$ for which any functions satisfying $\tilde{p}_n = \mu^n$ may be chosen. \citet{short2018accurate} derive a method for finding $D_n$ and $G_n$, and tabulate these solutions (see their appendix B and table 1). Informed by the pattern of solutions for polynomial basis terms, we are able to write down the general form: \begin{align} D_n &= x \zeta_n, \\ G_n &= -y \zeta_n, \label{eq:pn_greens_terms} \end{align} where \begin{equation} \zeta_n = \frac{1 - \mu^{n + 2}}{(n + 2) (1 - \mu^2)}. \label{eq:pn_greens_zeta} \end{equation} Now applying Green's theorem to Equation \ref{eq:solution_integral}, the $n$th element of $\bmath{s}$ becomes \begin{equation} s_n = \iint \Big( \frac{\partial D_n}{\partial x} - \frac{\partial G_n}{\partial y} \Big) \,dx dy = \oint (D_n \, dy + G_n \, dx), \label{eq:pn_greens_integral} \end{equation} where the integral on the right-hand side is to be computed piecewise anti-clockwise around the closed boundary enclosing the occulted area. \subsection{Planet-star limb intersections and the bounding curve} \label{subsec:planet_star_limb_intersections} To solve the line integral in Equation \ref{eq:pn_greens_integral} we must first determine its limits. This in turn requires us to determine the bounding curve around the occulted area. In general, this bounding curve is made up piecewise from sections of the stellar limb and the planet's transmission string. The exact composition of this bounding curve depends on the relative position of the planet and star, as well as the shape of the transmission string. For example, when the planet is completely overlapping with the stellar disc, the occulted area is bounded totally by the planet's transmission string. But, during ingress or egress, the occulted area is bounded by a combination of the stellar limb and the planet's transmission string. Whilst determining this bounding curve for classical circular transits has a simple solution, found from the intersection points of two circles, the solution is far less trivial when the planet's limb is parameterised by a Fourier series. In fact for complex transmission strings, there are possible configurations where the planet's limb criss-crosses the stellar limb multiple times. To determine the composition of the bounding curve, we search for intersections between the planet's transmission string and the stellar limb in terms of the planet-centred angle, $\theta$. This amounts to finding the roots of the intersection equation \begin{equation} T^{\pm}(\theta) = r_{\rm{p}} - r_{\rm{s}}^{\pm} = 0, \label{eq:intersection_equation} \end{equation} where $r_{\rm{s}}^{\pm}$ is the equation of an off-centred circle, i.e. the stellar limb from the planet-centred coordinate system, and the plus or minus correspond to the two potential intersection points with this circle for a given $\theta$. Substituting in the full equations and moving $r_{\rm{s}}^{\pm}$ to the right-hand side we have \begin{equation} \begin{split} & \sum_{n=0}^{N_c} a_{n} \cos{(n \theta)} + \sum_{n=1}^{N_c} b_{n} \sin{(n \theta)} \\ & = d \cos{(\theta - \nu)} \pm \big(d^2 \cos^2{(\theta - \nu)} - d^2 + 1 \big)^{\frac{1}{2}}. \end{split} \label{eq:intersection_equation_real} \end{equation} To find the $\theta$s that solve this equation we convert the trigonometric functions into their complex exponential form, \begin{equation} \begin{split} \sum_{n=-N_c}^{N_c} c_{n} e^{i n \theta} = & \frac{d}{2} \big(e^{i (\theta - \nu)} + e^{-i (\theta - \nu)} \big) \\ & \pm \bigg(\frac{d^2}{4} \big(e^{i (\theta - \nu)} + e^{-i (\theta - \nu)} \big)^2 - d^2 + 1 \bigg)^{1/2}, \end{split} \label{eq:intersection_equation_complex} \end{equation} and then rearrange, square, and expand, yielding \begin{equation} \begin{split} & \sum_{n=-N_c}^{N_c} \sum_{m=-N_c}^{N_c} c_{n} c_{m} e^{(2N_c + n + m) i \theta} \\ & - d e^{-i \nu} \sum_{n=-N_c}^{N_c} c_{n} e^{(2N_c + n + 1) i \theta} \\ & - d e^{i \nu} \sum_{n=-N_c}^{N_c} c_{n} e^{(2N_c + n - 1) i \theta} + \big(d^2 - 1 \big)e^{2N_c i \theta} = 0. \end{split} \label{eq:intersection_equation_exponential_polynomial} \end{equation} Here we have also multiplied through by $e^{2N_c i \theta}$ to generate only positive exponents for $n > 0$. The point being that this equation is now an exponential polynomial in $e^{i \theta}$ of degree $4N_c$. Using the substitution $w = e^{i \theta}$, as suggested by \citet{weidner1988durand} for these types of problems, the equation can be written as an algebraic polynomial, \begin{equation} H(w) = h_0 + h_1 w + \dots + h_{4N_c - 1} w^{4N_c - 1} + h_{4N_c} w^{4N_c}, \label{eq:intersection_equation_algebraic_polynomial} \end{equation} where the coefficients are \begin{equation} h_{j} = \begin{cases} \sum_{n = -N_c}^{-N_c + j} c_{n} c_{\rho}, \hfill \hspace{0.8mm}\scalebox{0.9}{\rm{$0 \leq j < N_c - 1$}} \hphantom{,} \\[1ex] \sum_{n = -N_c}^{-N_c + j} c_{n} c_{\rho} - d e^{i \nu} c_{\xi}, \hfill \hspace{0.8mm}\scalebox{0.9}{\rm{$N_c - 1 \leq j < N_c + 1$}} \hphantom{,} \\[1ex] \sum_{n = -N_c}^{-N_c + j} c_{n} c_{\rho} - d e^{i \nu} c_{\xi} - d e^{-i \nu} c_{\chi}, \hfill \hspace{0.8mm}\scalebox{0.9}{\rm{$N_c + 1 \leq j < 2N_c$}} \hphantom{,} \\[1ex] \sum_{n = -N_c}^{+N_c} c_{n} c_{\rho} - d e^{i \nu} c_{\xi} - d e^{-i \nu} c_{\chi} + d^2 - 1, \hfill \hspace{0.8mm}\scalebox{0.9}{\rm{$j = 2N_c$}} \hphantom{,} \\[1ex] \sum_{n = -3N_c + j}^{+N_c} c_{n} c_{\rho} - d e^{i \nu} c_{\xi} - d e^{-i \nu} c_{\chi}, \hfill \hspace{0.8mm}\scalebox{0.9}{\rm{$2N_c + 1 \leq j < 3N_c$}} \hphantom{,} \\[1ex] \sum_{n = -3N_c + j}^{+N_c} c_{n} c_{\rho} - d e^{-i \nu} c_{\chi}, \hfill \hspace{0.8mm}\scalebox{0.9}{\rm{$3N_c \leq j < 3N_c + 2$}} \hphantom{,} \\[1ex] \sum_{n = -3N_c + j}^{+N_c} c_{n} c_{\rho}, \hfill \hspace{0.8mm}\scalebox{0.9}{\rm{$3N_c + 2 \leq j < 4N_c + 1$}}, \end{cases} \nonumber \\ \end{equation} and the indexes $\rho = j - n - 2N_c$, $\xi = j - 2N_c + 1$, and $\chi = j - 2N_c - 1$. Polynomials, such as this, have well-trodden methods for finding their roots. In particular, \citet{boyd2006computing} shows how the roots of a Fourier series may be found by linear algebra operations. It turns out the roots of a monic polynomial are equivalent to the eigenvalues of the so-called Frobenius companion matrix, $\mathbfss{C}$. For our intersection problem, the companion matrix is \begin{equation} \mathbfss{C}(H) = \begin{bmatrix} 0 & 0 & \dots & 0 & -h_0/h_{4N_c} \\ 1 & 0 & \dots & 0 & -h_1/h_{4N_c} \\ 0 & 1 & \dots & 0 & -h_2/h_{4N_c} \\ \vdots & \vdots & \ddots & \vdots & \vdots \\ 0 & 0 & \dots & 1 & -h_{4N_c - 1}/h_{4N_c} \end{bmatrix}, \label{eq:companion_matrix} \end{equation} where the elements are \begin{equation} C_{jk} = \begin{cases} \delta_{j, k + 1}, \hfill \hspace{12.5mm}\scalebox{0.9}{\rm{$1 \leq j < 4N_c + 1, 1 \leq k < 4N_c$}} \hphantom{,} \\[1ex] (-1) \frac{h_{j - 1}}{h_{4N_c}}, \hfill \hspace{12.5mm}\scalebox{0.9}{\rm{$1 \leq j < 4N_c + 1, k = 4N_c$}}, \end{cases} \label{eq:companion_matrix_elements} \end{equation} and $\delta_{j, k + 1}$ is the Kronecker delta function. So for a given configuration, we construct $\mathbfss{C}$ and compute its eigenvalues, $w_j$. These complex values solve Equation \ref{eq:intersection_equation_algebraic_polynomial} for $H(w_j) = 0$. To convert back to $\theta$ we invert the substitution, \begin{equation} \theta_j = -i \ln{(w_j)} = -i (ln{|w_j|} + i \arg{(w_j)} + 2 \pi n), \label{eq:intersection_polynomial_complex_thetas} \end{equation} but since we only require intersections that have purely real angles in the principal branch, \begin{equation} \theta_j = \arg{(w_j)}, \label{eq:intersection_polynomial_real_thetas} \end{equation} where $|w_j| = 1$. This result implies real intersections of the planet's transmission string and the stellar limb occur when the arguments of the eigenvalues of $\mathbfss{C}$ lie on the unit circle in the complex plane. These intersections are sorted from $-\pi$ to $\pi$ and are allocated to a vector, $\bmath{\theta}$, of length $N_{\theta}$. So that these angles span the complete closed bounding curve of the occulted area, the first element of $\bmath{\theta}$ is duplicated, $2\pi$ is added, and then appended to the end of $\bmath{\theta}$. The adjacent angles form the limits of the piecewise line integral in Equation \ref{eq:pn_greens_integral}. For each piecewise integral, in addition to the limits, we must also determine if the bounding curve between $\theta_j$ and $\theta_{j + 1}$ is along the stellar limb or the planet's transmission string. We define each piece of the bounding curve to have a type $L(\theta_j, \theta_{j + 1}) \in \{ \mlq r_{\rm{p}} \mrq, \mlq r_{\rm{s}}^{\pm} \mrq \}$. The type is deduced by checking which intersection equation the angles solve, $T^{+}$ or $T^{-}$, and the derivatives of this intersection equation at these angles. The logic for determining $L$ is described in full in Appendix \ref{appendix:bounding_curve_composition}, including for the trivial configurations where no intersections are found and $\bmath{\theta} = (-\pi, \pi)^T$. \subsection{Line integral solutions} \label{subsec:line_integral_solutions} Our solutions to the line integral in Equation \ref{eq:pn_greens_integral} are categorised by the type of bounding curve segment, $L(\theta_j, \theta_{j + 1})$, and the element of $\bmath{s}$ being solved. This may be written as \begin{equation} s_n = \sum_{j=1}^{N_{\theta}} \begin{cases} \vphantom{s_{n \in \frac{1}{2}\mathbb{Z}, \rm{p}}} s_{n, \rm{s}}(\theta_j, \theta_{j + 1}), \hfill \hspace{2.1mm}\scalebox{0.9}{\rm{$L(\theta_j, \theta_{j + 1}) = \mlq r_{\rm{s}} \mrq, n \in \{0, \frac{1}{2}, 1, \frac{3}{2}, 2\}$}} \hphantom{,} \\[1ex] \vphantom{s_{n \in \frac{1}{2}\mathbb{Z}, \rm{p}}} s_{n \in 2\mathbb{Z}, \rm{p}}(\theta_j, \theta_{j + 1}), \hfill \hspace{2.1mm}\scalebox{0.9}{\rm{$L(\theta_j, \theta_{j + 1}) = \mlq r_{\rm{p}} \mrq, n \in \{0, 2\}$}} \hphantom{,} \\[1ex] s_{n \in \frac{1}{2}\mathbb{Z}, \rm{p}}(\theta_j, \theta_{j + 1}), \hfill \hspace{2.1mm}\scalebox{0.9}{\rm{$L(\theta_j, \theta_{j + 1}) = \mlq r_{\rm{p}} \mrq, n \in \{\frac{1}{2}, 1, \frac{3}{2}\}$}}, \end{cases} \hspace{-5mm} \label{eq:solution_cases} \end{equation} where $s_{n, \rm{s}}$ are the solutions along the stellar limb and $s_{n, \rm{p}}$ are the solutions along the planet's transmission string. The $s_{n, \rm{p}}$ solutions are further subdivided into even polynomial basis exponents, $n \in 2\mathbb{Z}$, and odd and half-integer polynomial basis exponents, $n \in \frac{1}{2}\mathbb{Z}$. \subsubsection{Stellar limb segments} \label{subsubsec:line_integral_solutions_stellar_limb} For segments along the stellar limb, we know that $\mu$ is always \begin{equation} \mu_{\rm{s}}(\theta) = 0. \label{eq:z_coord_stellar_limb} \end{equation} Substituting this into Equations \ref{eq:pn_greens_zeta} and \ref{eq:pn_greens_integral}, along with the Cartesian equations and differential elements for along the stellar limb (from Appendix \ref{appendix:coordinates_and_symbols}), we find \begin{equation} \begin{split} s_{n, \rm{s}}(\theta_j, \theta_{j + 1}) & = \int_{\phi_j}^{\phi_{j + 1}} \frac{1}{n + 2} \, d\phi \\ & = \frac{1}{n + 2} (\phi_{j + 1} - \phi_j), \end{split} \label{eq:solution_stellar_limb} \end{equation} where \begin{equation} \phi_j = \arctan{\bigg(\frac{-r_{\rm{p}}(\theta_j) \sin{(\theta_j - \nu)}}{-r_{\rm{p}}(\theta_j) \cos{(\theta_j - \nu)} + d}\bigg)}. \label{eq:solution_stellar_limb_phi} \end{equation} \subsubsection{Planet transmission string segments: $n \in 2\mathbb{Z}$} \label{subsubsec:line_integral_solutions_planet_limb_even_terms} For segments along the planet's transmission string, $\mu$ is given by \begin{equation} \mu_{\rm{p}}(\theta) = \big( 1 - d^2 - r_{\rm{p}}^2(\theta) + 2 d \cos{(\theta - \nu)} r_{\rm{p}}(\theta) \big)^{\frac{1}{2}}. \label{eq:z_coord_planet_limb} \end{equation} Again, let us substitute this into Equations \ref{eq:pn_greens_zeta} and \ref{eq:pn_greens_integral}, along with the Cartesian equations and differential elements for along the planet's transmission string (from Appendix \ref{appendix:coordinates_and_symbols}). This results in the expression \begin{equation} s_{n, \rm{p}}(\theta_j, \theta_{j + 1}) = \int_{\theta_j}^{\theta_{j + 1}} \zeta_n (\mu_{\rm{p}}(\theta)) \eta(\theta) \, d\theta, \label{eq:solution_planet_limb_integral} \end{equation} where we have defined \begin{equation} \eta(\theta) = r_{\rm{p}}^2(\theta) - d \cos{(\theta - \nu)} r_{\rm{p}}(\theta) -d \sin{(\theta - \nu)} \frac{d r_{\rm{p}}(\theta)}{d\theta}. \label{eq:solution_planet_limb_integral_eta} \end{equation} This integral is rather more difficult to solve than Equation \ref{eq:solution_stellar_limb}, and in fact we only find closed-form solutions for $n \in 2\mathbb{Z}$. For these terms the integral in full is \begin{equation} \begin{split} & s_{n \in 2\mathbb{Z}, \rm{p}}(\theta_j, \theta_{j + 1}) = \int_{\theta_j}^{\theta_{j + 1}} \frac{1}{(n + 2)} \\ & \vphantom{} \times \Big(\sum_{k=0}^{\frac{n}{2}} \big(1 - d^2 - r_{\rm{p}}^2(\theta) + 2 d \cos{(\theta - \nu)} r_{\rm{p}}(\theta) \big)^k \Big) \\ & \times \Big( r_{\rm{p}}^2(\theta) - d \cos{(\theta - \nu)} r_{\rm{p}}(\theta) -d \sin{(\theta - \nu)} \frac{d r_{\rm{p}}(\theta)}{d\theta} \Big) \, d\theta. \label{eq:solution_planet_limb_integral_full} \end{split} \end{equation} We are able to solve this integral by realising that each term may be represented as a Fourier series in the parameter $\theta$. Terms with no $\theta$ dependence may be written as Fourier series of zeroth order, trigonometric terms in $\theta$ may be written as Fourier series up to first order, and $r_{\rm{p}}$ terms are already in this representation. These Fourier series are then combined by a succession of sums or products, wherein the series coefficient vectors are summed or convolved, respectively. The result of this process is an integrand comprised of a single new Fourier series, which can be readily solved: \begin{equation} \begin{split} s_{n \in 2\mathbb{Z}, \rm{p}}(\theta_j, \theta_{j + 1}) & = \int_{\theta_j}^{\theta_{j + 1}} \sum_{m=-N_q}^{N_q} q_{n, m} e^{i m \theta} \, d\theta \\ & = \sum_{m=-N_q}^{N_q} \frac{q_{n, m}}{i m} \Big(e^{i m \theta_{j + 1}} - e^{i m \theta_j} \Big), \end{split} \label{eq:solution_planet_limb_integral_done} \end{equation} where, \begin{equation} \begin{split} q_{n, m} = \frac{1}{n + 2} \Bigg[ & \Big(\sum_{k=0}^{\frac{n}{2}} \big((1 - d^2)\bmath{e}_0 - \bmath{c} * \bmath{c} + 2 d \bmath{\beta}_{\rm{cos}} * \bmath{c} \big)^{* k} \Big) \\ & * \Big( \bmath{c} * \bmath{c} - d \bmath{\beta}_{\rm{cos}} * \bmath{c} - d \bmath{\beta}_{\rm{sin}} * (\bmath{\Delta} \circ \bmath{c}) \Big) \Bigg]_m , \end{split} \label{eq:solution_planet_limb_integral_coeffs} \end{equation} and $m$ denotes the coefficient vector element. The range of $m$ runs from $-N_q$ to $N_q$, where $N_q = \frac{n + 2}{4} (\max{(4N_c + 1, 2N_c + 3)} - 1)$. $\bmath{c}$ is a vector representation of the complex Fourier coefficients. The symbols $*$ and $* k$ represent the convolution and convolution power operators, respectively. We also define $\bmath{e}_0$, $\bmath{\Delta}$, $\bmath{\beta}_{\rm{sin}}$, and $\bmath{\beta}_{\rm{cos}}$ in Equation \ref{eq:solution_planet_limb_integral_coeffs}, all of which are detailed in Appendix \ref{appendix:coordinates_and_symbols}. Also note that for Equation \ref{eq:solution_planet_limb_integral_done}, the term in the summation takes the value $q_{n, 0} (\theta_{j + 1} - \theta_j )$ in the limit $m=0$. \subsubsection{Planet transmission string segments: $n \in \frac{1}{2}\mathbb{Z}$} \label{subsubsec:line_integral_solutions_planet_limb_odd_terms} For the integral in Equation \ref{eq:solution_planet_limb_integral}, where $n \in \frac{1}{2}\mathbb{Z}$, we compute an approximate solution. We are unable to find a closed-form solution owing to half-integer exponents appearing in the $\zeta$ term. These exponents preclude the Fourier series from being combined as per the technique described in Section \ref{subsubsec:line_integral_solutions_planet_limb_even_terms}. To approximate the solution we employ Gauss–Legendre quadrature, yielding the equation \begin{equation} s_{n \in \frac{1}{2}\mathbb{Z}, \rm{p}}(\theta_j, \theta_{j + 1}) \approx \frac{\theta_{j + 1} - \theta_j}{2} \sum_{k=1}^{N_l} \zeta_n(\mu_{\rm{p}}(t_k)) \eta(t_k) \gamma_k, \label{eq:solution_planet_limb_gl_approx} \end{equation} where \begin{equation} t_k = \frac{\theta_{j + 1} - \theta_j}{2} (\omega_k + 1) + \theta_j. \label{eq:solution_planet_limb_gl_approx_mod_roots} \end{equation} Here $N_l$ is the number of terms to use in the approximation, $\gamma_k$ are the associated weights, and $\omega_k$ are the roots of the $N_l$-th Legendre polynomial. \subsection{Computation summary} \label{subsec:computation_summary} Putting together the derivations from the previous sections, we can now rewrite an equation for the normalised light curve flux as \begin{equation} F = 1 - \alpha = 1 - I_0 \bmath{s}^T \mathbfss{B} \bmath{u}, \label{eq:summary_flux} \end{equation} where the elements of $\bmath{s}$ are \begin{equation} s_n = \sum_{j=1}^{N_{\theta}} \begin{cases} \vphantom{\sum_{m=-N_q}^{N_q}} \frac{1}{n + 2} (\phi_{j + 1} - \phi_j), \hfill \hspace{1.5mm}\scalebox{0.9}{\rm{$L = \mlq r_{\rm{s}} \mrq, n \in 2\mathbb{Z}, \frac{1}{2}\mathbb{Z}$}} \hphantom{,} \\[2ex] \sum_{m=-N_q}^{N_q} \frac{q_{n, m}}{i m} \Big(e^{i m \theta_{j + 1}} - e^{i m \theta_j} \Big), \hfill \hspace{1.5mm}\scalebox{0.9}{\rm{$L = \mlq r_{\rm{p}} \mrq, n \in 2\mathbb{Z}$}} \hphantom{,} \\[2ex] \vphantom{\sum_{m=-N_q}^{N_q}} \frac{\theta_{j + 1} - \theta_j}{2} \sum_{k=1}^{N_l} \zeta_n(\mu_{\rm{p}}(t_k)) \eta(t_k) \gamma_k, \hfill \hspace{1.5mm}\scalebox{0.9}{\rm{$L = \mlq r_{\rm{p}} \mrq, n \in \frac{1}{2}\mathbb{Z}$}}, \end{cases} \hspace{-15mm} \label{eq:summary_sn} \end{equation} and the intersections, $\bmath{\theta}$, and bounding curve types $L(\theta_j, \theta_{j + 1})$ are determined by the logic described in Section \ref{subsec:planet_star_limb_intersections}. \section{Performance benchmarks} \label{sec:performance_benchmarks} We implement the mathematics for computing our transit light curves in C++, and provide an open-source python package, \texttt{harmonica}\footnote[4]{https://github.com/DavoGrant/harmonica}, for interfacing with our algorithm. The aim of this algorithm is to solve Equation \ref{eq:summary_flux}, for any user-defined transmission string and planetary orbit, at high precision and with a fast runtime. It is important that the precision of our algorithm is well beyond that of any data we wish to model, and the runtime is sufficiently fast such that this method may be incorporated, without a huge time and energy cost, into frameworks for regression modelling. \begin{figure} \centering \includegraphics[width=\columnwidth]{figs/benchmark_precision.pdf} \caption{Benchmarking the precision of a typical transit light curve, with a five-term transmission string, as a function of planet-star separation, $d$. The injected transmission string has a mean radius 0.1 stellar radii, and ${\sim}1\%$ deviations from a circular shape. The tests are conducted for various values of $N_l$.} \label{fig:benchmark_precision} \end{figure} \begin{figure} \centering \includegraphics[width=\columnwidth]{figs/benchmark_runtime.pdf} \caption{Benchmarking the runtime of a typical transit light curve, with a five-term transmission string, as a function of planet-star separation, $d$ (top panel), and number of data points (bottom panel). The tests are conducted for various values of $N_c$, where the number of transmission string terms is equal to $2N_c + 1$. Runtimes are taken as the average over 100 tests.} \label{fig:benchmark_runtime} \end{figure} \begin{figure} \centering \includegraphics[width=\columnwidth]{figs/fourier_terms_residuals.pdf} \caption{Transit light curve residuals for the first 7 terms of our Fourier parameterisation of transmission strings. Light curves are generated for a transmission string composed of the zeroth-order term, plus or minus the corresponding grid point's high-order term at varying amplitudes. These light curves have a classical circular light curve subtracted, and the resulting residuals are shown. For reference, this figure follows the shapes in Figure \ref{fig:fourier_terms_schematic}.} \label{fig:fourier_terms_residuals} \end{figure} \subsection{Precision} \label{subsec:precision} To assess the precision of our algorithm we compare the generated transit light curves against those from a high-precision numerical integrator, \texttt{scipy.integrate} \citep[][]{2020SciPy-NMeth}, for various transmission strings. The intrinsic precision of the numerical integrator is approximately double-precision (${\sim}10^{-16}$). For purely circular transmission strings we compare to analytic light curves, \texttt{exoplanet-core} \citep{foreman2021exoplanet}, which are also computed to double-precision \citep{agol2020analytic}. Our algorithm has one tunable parameter, $N_l$, which determines the number of terms used to approximate $s_{n \in \frac{1}{2}\mathbb{Z}, \rm{p}}$, and we explore suitable values for this parameter. We test a wide range of orbits, limb darkening, and transmissions strings, checking the light curve precision. We find the precision of our algorithm is orders of magnitude more precise than the data of present day observing facilities. As a demonstrative case, in Figure \ref{fig:benchmark_precision} we present the results from a typical test. We inject a transmission string with five parameters, generating ${\sim}1\%$ deviations from a circular shape with a mean radius of 0.1 stellar radii. We test values of $N_l$ ranging from 20 to 500, and find a steady progression in minimum precision value from $10^{-9}$ to $10^{-16}$. The precision shows a strong dependence on the separation of the planet and stellar centres, with configurations having the transmission string traverse the very edge of the stellar disc proving the hardest to approximate. This can be seen in Figure \ref{fig:benchmark_precision} by the double peaked features between separations of 0.9 and 1.1 stellar radii. To balance precision verses runtime, we set default values of $N_l$ for configurations when the planet is completely inside the stellar disc, $N_l=20$, and for configurations when the planet intersects the stellar limb, $N_l=50$. Although we make these values tunable for users who wish to check their model precision. We conduct one final test of precision, where we set the quadratic limb-darkening parameters to values that satisfy the equation $u_1 + 2 u_2 = 0$. In this case the $s_{n=1, \rm{p}}$ term disappears, the resulting light curve has a purely analytic solution, and the precision reaches double-precision for all separations. \subsection{Runtime} \label{subsec:runtime} The runtime\footnote[3]{All runtimes are assessed on one 2 GHz Intel core i5 processor.} of our algorithm is assessed in two ways. First, we time the computation of individual light curve data points as a function of planet-star separation. In the top panel of Figure \ref{fig:benchmark_runtime}, we present the results for a typical transiting system for a range of values of $N_c$. Note that the number of transmission string terms is equal to $2 N_c + 1$. As expected, the runtime increases as the number of transmission string terms increases. For a given value of $N_c$, the highest runtime occurs when the planet's transmission string is intersecting with the stellar limb. This jump in runtime results from having to solve the eigenvalue problem described in Section \ref{subsec:planet_star_limb_intersections}. Solving for these eigenvalues has a time-complexity that is approximately cubic with the number of transmission string terms, and as a result, this operation becomes the main bottleneck to our algorithm. Although, we are able to restrict this operation to occur only when the planet is in the vicinity of the stellar limb, by initially computing the maximum transmission string radius, and then checking at each data point if the intersection algorithm is required. For the second test, we time the computation of entire light curves comprised of varying numbers of data points. In the bottom panel of Figure \ref{fig:benchmark_runtime}, we present the results for a typical transiting system, again, for a range of values of $N_c$. The runtime shows an approximately linear dependence on the number of data points. We observe a slight bump to longer runtimes for light curves of about 10 data points. These bumps are due to the light curves having sufficient data points that some of these points intersect with the stellar limb. Overall, for a typical light curve of 1000 data points, and a transmission string comprised of five parameters, the runtime is approximately 4ms. \subsection{Derivatives} \label{subsec:derivatives} Model optimisation and inference may be aided by computation of derivatives with respect to input parameters. For example, in least-squares regression via the Jacobian \citep[e.g.,][]{more1978levenberg}, or in Bayesian inference using Hamiltonian Monte Carlo (HMC) \citep[][]{duane1987hybrid, neal2011mcmc}. To this end, we derive model derivatives with respect to each input parameter. The derived equations are supplied in the online supplementary material. \section{Demonstration} \label{sec:demo} \begin{figure*} \centering \includegraphics[width=0.94\textwidth]{figs/demo_corner.pdf} \caption{Bottom-left panels: posterior distributions and covariances of a 5-parameter transmission string fitted to a JWST-like transit light curve. The injected parameters values are shown by the green lines. Top-right: the upper panel shows light curves drawn from the posterior distributions plotted against the simulated data. The lower panel shows the residuals between these light curve draws and the simulated data.} \label{fig:demo_corner} \end{figure*} \begin{figure*} \centering \includegraphics[width=\textwidth]{figs/demo_inferred.pdf} \caption{Inferences of a 5-parameter transmission string fit to a JWST-like transit light curve. The median transmission string (green), transmission string samples from the posterior distributions (light green), and true injected transmission string (black) are shown relative to a circle (grey dashes). The left panel shows the sky-projected shape, while the right panel shows the transmission string as a function of angle around the terminator.} \label{fig:demo_inferred} \end{figure*} To demonstrate the capabilities of our algorithm, in this section we generate a set of forward models, highlighting the signals imprinted in the transit data by various transmission string terms. We then simulate a JWST-like dataset for a typical hot Jupiter, and present the inferences we are able to make about the shape of the transmission string relative to the injected shape. \subsection{Forward models} \label{subsec:forward_models} We generate transit light curves for a set of planet transmission strings. Following the shapes presented in Figure \ref{fig:fourier_terms_schematic}, we start with a circular transmission string and then add or subtract small amounts of the higher-order Fourier terms one at a time. We compare each of the generated transit light curves to the purely circular case, and display the residuals in Figure \ref{fig:fourier_terms_residuals}. All the light curves are generated for identical planetary orbits, which have their inclinations set to $87^{\rm{\circ}}$. We find each Fourier term imprints a unique signal into the light curve residuals. The harmonic order determines how many distinct peaks there are in the residuals, and the harmonic type, either cosine or sine, determines the order of these peaks at ingress and egress. For example, the $\cos{(2 \theta)}$ term shows two residual peaks at both ingress and egress, with the order of the peaks mirrored about the transit centre. In contrast, the $\sin{(2 \theta)}$ term shows the same two peaks, but in this case the residual peaks are mirrored and flipped about the transit centre. Overall, the forward models encode distinguishable shapes that enable the inverse procedure: inferring the shapes directly from the light curves. \subsection{Inference} \label{subsec:inference} A JWST-like transit light curve is simulated for a typical hot Jupiter. The orbit and mean planet radius are based on WASP-39b \citep{fischer2016hst, mancini2018gaps}, and we inject a known 5-parameter transmission string with parameters $a_0=0.146$, $a_1=-0.002$, $b_1=0.0$, $a_2=0.002$, and $b_2=0.0$. This transmission string corresponds to an atmosphere with an inflated east-versus-west terminator, as well as an inflated equatorial-versus-polar region. We elect to simulate data for this system using JWST's NIRSpec/G395H mode, which spans a wavelength range from 2.7 to 5.2 \textmu m and provides high information content specifically for exoplanet atmosphere characterisation \citep{batalha2017information}. To simulate a realistic cadence and noise level we use \texttt{pandexo} \citep{batalha2017pandexo}. The resulting light curves are comprised of 465 integrations over the course of a 0.34 day observation. From these data we select a 1 \textmu m interval, centred on 3.2 \textmu m, to generate a single high-quality light curve. This is representative of a binning scheme aimed at probing the spatial distribution of molecular features in the infrared. Lastly, the star is given quadratic limb darkening calculated using \texttt{exotic-ld} \citep[][]{Laginja2020, hannah_wakeford_2022_6809899}. The resulting simulated light curve is shown in the top right of Figure \ref{fig:demo_corner}. This light curve has white noise with a standard deviation of 110 ppm. Next, we demonstrate our algorithm's inference capabilities by fitting the simulated transit light curve for a 5-parameter transmission string. The orbital and limb-darkening parameters are held fixed at their known simulated values. The fitting is performed using an HMC Markov Chain Monte Carlo sampler from the \texttt{NumPyro} package \citep{phan2019composable, bingham2019pyro}. We run the sampler in two parallel chains, each for 5000 steps, and discard the first 2000 steps as warm-up. In Figure \ref{fig:demo_corner} we show the model fit (top-right) and the marginalised posteriors and covariances for the 5 transmission string parameters (bottom-left panels). All 5 of the injected transmission string parameters are recovered to within 1 sigma of their simulated values. We also find that the posterior distributions appear Gaussian, and any covariance between the transmission string parameters is minimal. In Figure \ref{fig:demo_inferred} we show realisations of the inferred transmission string from the parameter posterior distributions. The transmission string is constrained to a standard deviation 0.56\% of the mean (circular) radius, easily enabling the injected shape to be resolved. This demonstration shows the fidelity with which transmission strings may be extracted directly from light curve data. Of course the constraints we may place on the inferred transmission strings are related to the quality of the data. As such, our recommended methodology is to start by fitting only the zeroth-order harmonic, corresponding to the classical circular case, and gradually add higher-order harmonics to the transmission string. The number of harmonics may then be justified through a model selection process; for example, by comparing models by their marginalised likelihoods or by some approximate information criterion. In this way, one may allow the data to inform the complexity of the transmission strings. In this demonstration we have inferred one transmission string from one light curve. By repeating this process for multiple wavelength channels, a set of transmission strings may then be used to generate transmission spectra as a function of angle around the planet's terminator (recall Figure \ref{fig:transmission_string_schematic}). \section{Discussion} \label{sec:discussion} The technique developed in this work opens up the ability to model transit light curves with adjustable complexity. The Fourier parameterisation allows for terms, or harmonics, to be added as the data requires. Starting with just one term, the zeroth-order harmonic, and our model is equivalent to that of the classical circular case. Next, by including two more terms, the first harmonic, and our model reaches similar complexity to that of the two-hemispheres model of \citet{EspinozaJones2021AJ}. Further harmonics may then be included to generate more and more complex shapes. The complexity of our parameterisation is only limited by the constraint that the radius must be a single-valued function of angle around the terminator. For an even more general framework of transiting shapes, including variable opacity levels, see the technique developed by \citet{sandford2019shadow}. For high-precision observations, our technique enables spatial information around a planet's terminator to be drawn out at the light curve fitting stage. This may be particularly important for subsequent retrieval analysis, as it has been shown that multidimensional effects can lead to degeneracies between clouds and metallicity \citep{LineParmentier2016ApJ}, as well as temperature biases \citep{MacDonald2020}. Our technique may be able to extract some of these multidimensional signals, and then allow retrievals to be performed for a transmission spectrum at a given angle around the terminator. An additional process worth noting is that of a planet's rotation. Any rotation between ingress and egress may lead to variation in the sky-projected shape of the occultor. As shown by \citet{wardenier2022all}, for many planets this rotation is smaller than the absorption region probed by transit data. However, for some ultra-hot Jupiters this may not be the case. For these close-in planets, the absorption region may change significantly between ingress and egress, and as such we may also expect changes to the shape of the transmission strings. To model these cases we include additional flexibility in the provided code, allowing for time-dependent transmission string parameterisations. In order to not immensely increase the number of free parameters, it may be judicious to define a transmission string at first contact, a transmission string at fourth contact, and interpolate between the values throughout transit. The intended use case for our technique is as a tool for studying exoplanet atmospheres. However, the technique can be applied more generally to any transit light curve, where the shape of the transiting body is of interest. \section{Summary and conclusions} \label{sec:summary_and_conclusions} In this study we have devised a technique for spatially mapping exoplanet atmospheres in transmission. The primary utility of such a technique is in probing the multidimensional physics at play in exoplanet atmospheres. Our work into this new technique is summarised as follows: \begin{enumerate} \item We defined a mathematical object, referred to as a {\it transmission string}, that describes the planet radius as a single-valued function of the angle around the planet's terminator. These objects enable spatial information encoded in transit light curves to be directly extracted, with one light curve yielding one transmission string. Given observations of light curves at multiple wavelengths, all the inferred transmission strings may be used to generate a transmission spectrum at any angle around the planet's terminator. \item The transmission strings were parameterised in terms of Fourier series. This choice was motivated by Fourier series generating practical shapes with only a small number of terms. The first few harmonics naturally produce shapes that can probe differences in the east-to-west, north-to-south, and equatorial-vs-polar radii. Furthermore, this parameterisation has the flexibility to build transmission strings of arbitrary complexity, all the while being reducible to the classical circular case. \item We devised the mathematics to compute transit light curves of planetary transmission strings. The emphasis of our formulation was on performance. The final algorithm is precise, fast, and differentiable, and so our model may be easily incorporated into frameworks for regression. \item We demonstrated the inference capabilities of our technique with simulated data. We synthesised a JWST-like transit light curve and ran an injection and recovery test of a known transmission string. Our results showed how high-fidelity spatial information may be inferred, given that high-precision light curves are available, such as those from JWST. \end{enumerate} The technique presented in this work is provided as an open-source package, called \texttt{harmonica}. The source code is available at https://github.com/DavoGrant/harmonica, with documentation and tutorials hosted at https://harmonica.readthedocs.io. \section*{Acknowledgements} \label{sec:acknowledgements} We would like to thank the referee for a helpful and constructive report. We also thank N. E. Batalha, T. J. Wilson, L. Alderson, M. Lodge, R. J. MacDonald, D. Rindt, and R. R. Surgenor for helpful discussions. We gratefully acknowledge the use of the following software: numpy \citep[][]{harris2020array}, SciPy \citep[][]{2020SciPy-NMeth}, matplotlib \citep[][]{Hunter:2007}, exotic-ld \citep[][]{Laginja2020, hannah_wakeford_2022_6809899}, corner \citep[][]{foreman2016corner}, pybind11 \citep[][]{jakob2017pybind11}, eigen v3 \citep[][]{guennebaud2010eigen}, jax \citep[][]{jax2018github}, and numpyro \citep[][]{phan2019composable, bingham2019pyro}. D. Grant acknowledges funding from the UKRI STFC Consolidated Grant ST/V000454/1. \section*{Data availability} \label{sec:data_availability} There are no new data associated with this article. \bibliographystyle{mnras}
\section{Introduction} \justify Diversity is the key ingredient of successful and resilient cities \citep{jacobs1961death}. The spatially concentrated interaction of people from various social and economic background create environments that foster creativity \citep{florida2004creative}, support inclusion \citep{bentonshort2013citiesnature} and in general, make cities vivid and prosperous \citep{glaeser2012triumph}. At the same time, cities show high levels of segregation such that individuals from different socio-economic background are separated from each other in the urban space \citep{musterd2020handbook}. This phenomenon limits social mobility for many \citep{mayer1989science} and induced inequalities can expose segregated groups to health or climate crises \citep{torrats2021using, loughran2022unequal} and can imply radicalization and populism \citep{abadie2006poverty, engler2021threat}. Recent studies leverage GPS mobility data to study socio-economic segregation and mixing patterns in visited urban locations \citep{cagney2020mobilityreview}. This growing literature frequently reports that people in cities visit and interact with locations that are similar to their residential neighborhood in terms of income, education, ethnicity or other socio-economic features \citep{wang2018pnas, dong2020epj, bokanyi2021scirep, hilman2022socioeconomic}. However, the places, services or amenities that individuals visit in the city exhibit different levels of experienced segregation, as some locations mix different socio-economic groups while others do not \citep{athey2021estimating, moro2021naturecomm}. In this study we search for urban locations that foster socio-economic mixing. In other words, we aim to identify locations that present less experienced segregation and are visited by people from diverse strata. To do so, we emphasize two aspects of urban locations that can influence observed socio-economic mixing. First, category of amenities available at a location determine its purpose and function and therefore can influence social mixing. \textcite{noyman2019epb} illustrates through individual GPS trajectories that urban locations are visited by a more diverse set of people in case they offer entertainment amenities, services or natural water features. \textcite{athey2021estimating} describes that individuals can experience relative low segregation at outdoor places like parks, sports fields and playgrounds, or at commercial establishments such as restaurants, bars and retail stores. They find that places of entertainment, like theaters and accommodations, like hotels are the least segregated urban locations. \textcite{moro2021naturecomm} shows that the category of places is a strong predictor for experienced income segregation and unique places in cities, such as arts venues, museums or airports tend to be highly integrated, while places that primarily serve local communities, such as grocery stores or places of worship are generally more segregated by income. Despite previous empirical efforts, systematic examination on how the mixture of amenities at specific urban locations contribute to social mixing is still missing from the literature. Second, specialized locations that serve the specific needs of the wider public and therefore can attract people from diverse neighborhoods tend to situate in the center of cities. The central place theory originally developed for the inter-urban scale by \textcite{christaller1933cpt} and \textcite{losch1954cpt} explains the hierarchy of cities and towns through their size and the range of functions that they provide. Higher-order centers share most of the functions (goods and services) of lower order centers and some specialised functions that attract population from a larger area. Lower-order center will locate relatively close to one another for efficiency reasons as people do not want to travel far for their everyday needs such as grocery shopping. However, people would travel further for infrequent purchases or specialized goods and services, which would be located in higher-order centers that are farther apart. Building on the central place theory, \textcite{zhong2015centrality} combines density, the number of people attracted to locations and diversity, the range of activities that they engage with at these locations in a single centrality measure to identify urban centers in Singapore and illustrate their evolution over time. \textcite{noyman2019epb} shows that urban locations with higher centrality in urban road networks attract more diverse visitors. On the contrary, \textcite{moro2021naturecomm} presents that urban locations with higher average travel distance to them tend to be less segregated than locations that are highly accessible. While most of the studies highlight that accessible, central locations attract more diverse visitors, yet, the nature of the available amenity mix might be related to the urban location, which has not been focused on so far. Here, we aim to extend the above literature by investigating how the amenity mix and central position of urban locations are related to experienced segregation or, put it differently, to the mixing of people from diverse socio-economic strata. A new contribution is the application of the economic complexity framework to urban amenities \citep{hidalgo2021review} to quantify the ability of locations -- on the level of neighborhoods and amenities as well -- in attracting visitors of diverse socio-economic status from across the city. The concept of economic complexity is originally developed by \textcite{hidalgohausmann2009pnas} who defined complexity of economies by the diversity of their non-ubiquitous products and services. Economic complexity is indicative of countries economic growth, income level, emissions and inequalities \citep{hidalgo2021review}. By now, the concept is applied to different data sources such as patents, occupations or scientific publications and to diverse spatial scales from countries to cities \citep{balland2022review, lucas2023ecibrazil}. Here we adopt the same logic to uncover the amenity complexity of urban locations. We argue that the complex amenity mix of an urban location should offer diverse amenities and the available amenities should be barely present at other locations. Consequently, amenity complexity of an urban location is connected to social mixing of people from diverse socio-economic background for two reasons. First, diverse amenity mixes can attract people with diverse demands and second, locations with non-ubiquitous amenities can attract people from diverse neighborhoods, as the particular service is only available at the location in question. Therefore, our hypothesis is that the diverse mix of non-ubiquitous amenities can create an inclusive, multi-purpose neighborhood that is most likely to be attractive for a wide-variety of people. While the contribution of amenity mix to the socio-economic diversity of visitors at urban locations has been rarely unveiled, diverse amenities are argued to concentrate in and attract people to central places of cities \citep{zhong2015centrality}. To better understand the connection between amenity complexity, urban centrality and socio-economic mixing, we test the influence of distance from center and the components of amenity complexity on the diversity of visitors in parallel. We build on the work of \textcite{hidalgo2020amenitymix} that created the amenity space by utilizing the co-location of amenities inside cities and construct the indicator(s) of amenity complexity. Utilizing the geographic distribution of point of interests (POIs) in urban neighborhoods, we measure the amenity complexity for both neighborhoods and amenity categories, analogously to economic complexity of regions and product complexity of economic outputs. We use these measures to illustrate that urban locations with complex structure of amenities attract diverse visitors from across the city. We test this argument by combining POI data and mobility data from individual GPS trajectories inside Budapest, the capital of Hungary. More precisely, we collect information on all POIs in Budapest from the Google Places API to have a detailed understanding on the portfolio of amenities present in urban neighborhoods through the world's most popular location service platform. We use data from a GPS aggregator company to trace individual mobility patterns. We identify home, work and third place visits \citep{oldenburg1999thirdplaces} in daily trajectories inside Budapest for 24 months by clustering the pings in geographical space and over time. We combine the information of predicted home locations with real estate prices at the census tract level. This allows us to infer the socio-economic diversity of visitors in each urban neighborhoods and in each actual amenity by investigating third place visits. Our results illustrate that urban locations with a more complex amenity mix are visited by a larger diversity of socio-economic groups. We demonstrate that, in the monocentric city of Budapest, amenity complexity is correlated with the relative geographical centrality of locations and distance from the center is a strong predictor of socio-economic mixing. The contribution of this paper is that it combines urban mobility data with the concept of economic complexity to show that the diversity of non-ubiquitous services, central locations, and the potentials for socio-economic mixing are interrelated. \section{Tracing mobility inside cities} \justify We capture socio-economic mixing at urban locations by identifying the diversity of visitors. In order to do so, we study urban mobility patterns of individuals. We rely on a raw GPS data from a data aggregator company. This data set allows us to trace the daily mobility of 5.2 million devices in Hungary over 24 months (between 2019 June and 2021 May). We initially filter this data to focus on devices that appear inside Budapest and have at least 20 GPS pings in total after discarding pings which indicate unreasonably high speeds of device mobility. Detailed description on the mobility data preparation process can be found in section S1 of the Supplementary information. \begin{figure}[!htbp] \includegraphics[width=0.85\textwidth]{mf01.pdf} \caption{Identifying home locations and third places visits from daily mobility trajectories. \textbf{(A)} Example trajectory to illustrate the stop detection process. \textbf{(B)} Identified places from the stop detection results and their function as home, work or third places. \textbf{(C)} Average number of home location over 24 months by urban neighborhoods of Budapest. \textbf{(D)} Average number of third place visits over 24 months by urban neighborhoods of Budapest. \textbf{(E)} The relationship between average number of home locations over 24 months and population of urban neighborhoods in Budapest. \textbf{(F)} Real estate prices at census tracts of identified home locations and across all census tracts of Budapest.} \label{fig:fig1} \end{figure} We process raw trajectories of individuals by applying the Infostop algorithm \citep{aslak2020infostop}. It enables us to effectively detect the stationary points of individual movements and cluster GPS pings around stop locations. Figure~\ref{fig:fig1}A-B illustrates the raw data and the outcome of stop detection through an example device. The algorithm gives each stop a label indicating a place that can reoccur along the trajectory of the device. We focus on devices with at least 2 distinct places and 10 stops in a month inside Budapest. Using the monthly recurrence of stops and places by each device, we label places as home, work or third place visits. We do this in two steps. First, we categorize each visited place as potential home or work based on the part of the day it is visited, the duration of visits and their reappearance in the daily trajectory. A place is identified as potential home location in case the device spends the most amount of time there between 20:00 pm and 8:00 am on a given week and the combined time spent at the place exceeds 8 hours. Places where devices spend most of their time between 8:00 am and 17:00 pm in a week (exceeding at least 3 hours) is identified as the potential workplace of the device. Second, we time-aggregate device trajectories to monthly visitation patterns. Thus, we identify home and work of a device in a month by the mean coordinate pairs of weekly potential home and work places, but only in case a device stops at the place at least 10 times over a month and the standard deviation of both latitude and longitude coordinates are smaller than 0.001 (about 100 meter in Budapest) over the respective month. We categorize every other visited place as a third place, in case it is labeled by the stop detection algorithm as a unique place, but it is not the home or the work place of the device in the respective month. Figure~\ref{fig:fig1}C presents the average number of devices with identified home location (and at least one visited third place) and Figure~\ref{fig:fig1}D illustrates the average number of third place visits over the 24 month period aggregated to the level of urban neighborhoods. To join home locations and third places to other data sources with spatial reference, we rely on Uber's Hexagonal Hierarchical Spatial Index (H3) \citep{h3}. The applied indexes of size 10 H3 hexagons refer to an average 15.000 m\textsuperscript{2} area, which is close to the buffer area of a point with a 70 meter radius. We connect all the identified home locations and third places to hexagons and split each neighborhood or census tract level polygons to the same hexagon size for efficient combination. To infer on the socio-economic status of the followed devices, we join home locations to census tract level real estate prices. In Hungary, information on income is not part of the census data collection. We rely on residential real estate sales contracts from 2013-2019 collected by the Hungarian Central Statistical Office and predict real estate prices to each census tract of Budapest. Section S2 in the Supplementary information introduces the prediction process in detail. Figure~\ref{fig:fig1}F presents that real estate prices at the identified home locations and across all census tracts are closely align. \section{Measuring amenity complexity} \justify To describe the attraction of urban locations for visitors, we construct the measures of amenity complexity. These indicators are based on the spatial distribution of amenities, which is studied through point of interest (POI) data from the Google Places API. Besides its limitations in terms of time scale and POI categorization, it is one of the world's most popular mapping service supporting applications worldwide and helping millions of individuals on a daily basis to find the location of businesses. This makes Google data attractive to study the spatial organization of amenities inside cities \citep{hidalgo2020amenitymix, kaufmann2022amenityscaling, heroy2022walkordrive}. \begin{figure}[!htbp] \includegraphics[width=0.85\textwidth]{mf02.pdf} \caption{Constructing the amenity complexity measures. \textbf{(A)} Distribution of point of interests (POIs) across neighborhoods and amenity categories. \textbf{(B)} Map of urban neighborhoods colored by the number of observed POIs. \textbf{(C)} Revealed comparative advantage (RCA) values transformed to a binary specialization matrix (M). \textbf{(D)} Similarity matrix of neighborhoods based on their specialization in amenity categories. This matrix is used to measure the amenity complexity of urban neighborhoods. \textbf{(E)} Similarity matrix of amenities based on their specialization in neighborhoods. This matrix is used to measure the complexity of amenity categories. \textbf{(F)} Relationship between amenity diversity and average amenity ubiquity in neighborhoods. Dots (neighborhoods) are colored by their amenity complexity value. \textbf{(G)} Relationship between ubiquity and average diversity of amenities. Dots (amenity categories) are colored by their amenity complexity value. \textbf{(H)} Neighborhoods with higher amenity complexity are specialized in amenity categories that have a higher complexity value. Each cell in the matrix represents a neighborhood specialized in an amenity category and cells are colored by the complexity of amenity categories.} \label{fig:fig2} \end{figure} We collected information as the latitude, longitude and amenity category for all the POIs around the city of Budapest in early 2022. The resulted data set contains 63.601 POIs in 78 different amenity categories. We removed the frequently appearing and ambiguous categories of ATM (1.054 POIs) and Parking (729 POIs) and filter out the category Casino with less than 2 POIs in Budapest. We use this data to illustrate the amenity profile of the 207 urban neighborhoods of Budapest \citep{kshregionalatlas}. Neighborhoods of Budapest are in between districts and census tracts in the spatial hierarchy, which makes them a suitable spatial scale for our analysis \citep{natera2020walkability}. They have an average population of 10.000 people (standard deviation around 10.000), have an average area of 2.5 km\textsuperscript{2} (standard deviation around 3.9) and on average they consist of 41 lower level census tracts (standard deviation around 50). Further description about the urban neighborhoods of Budapest can be found in section S3 of the Supplementary information. We consider every neighborhood in Budapest with at least 2 amenity categories with minimum 2 POIs. Figure~\ref{fig:fig2}A presents the resulted 75 amenity categories and the number of POIs across the focal 200 neighborhoods of Budapest. The most frequent categories are convenient store (5.989 observations), beauty salon (4.461 observations) and restaurant (3.727 observations), while we observe less than 10 amusement park, bowling alley and city hall. Figure~\ref{fig:fig2}B illustrates the unequal spatial distribution of POIs on the map of neighborhoods in Budapest. To describe the relative importance of amenity categories and illustrate the differences between the amenity structure of urban neighborhoods, we adopt the economic complexity index (ECI) \citep{hidalgohausmann2009pnas}. The ECI is successfully used to describe the economic development of countries and regions \citep{hidalgo2021review} and its approach is adoptable to amenities and urban neighborhoods. We measure \textit{amenity complexity} the following way. We normalize the matrix of Figure~\ref{fig:fig2}A to make comparisons appropriate between neighborhoods and amenity categories and compute the revealed comparative advantage (RCA) of neighborhoods in amenity categories by the following standard equation (also known as the Balassa index): \begin{equation} \label{eq:eq1} RCA_{n,a}=(P_{n,a}/P_{a})/(P_{n}/P) \end{equation} \noindent where $P_{n,a}$ is the number of POIs in neighborhood $n$ in amenity category $a$ and missing indices indicate summed variables such as $P_{a}=\sum_{a}P_{n,a}$. \textit{RCA $>=$ 1} suggests that neighborhood $n$ is specialized in amenity category $a$. In other words, an amenity category is overrepresented in a neighborhood in case its \textit{RCA} value is above or equal to 1. We use the $RCA$ values to create a binary specialization matrix $M_{n,a}$ the following way: \begin{equation} \label{eq:eq2} M_{n,a} = \left\{ \begin{array}{ccl} 1 & \textrm{if} & RCA_{n,a} >= 1 \\ 0 & \textrm{if} & RCA_{n,a} < 1 \end{array} \right. \end{equation} \noindent Figure~\ref{fig:fig2}C illustrates the resulted binary $RCA$ matrix of neighborhoods and amenity categories in Budapest. Sum of rows in this matrix present the number of amenity categories a neighborhood has comparative advantage in (amenity diversity) and the column sums give the number of neighborhoods where an amenity category is overrepresented (amenity ubiquity). \begin{equation} \label{eq:eq3} \textrm{Amenity diversity} = M_{n} = \sum_{a}M_{n,a} \end{equation} \begin{equation} \label{eq:eq4} \textrm{Amenity ubiquity} = M_{a} = \sum_{n}M_{n,a} \end{equation} \noindent In geographic matrices like $M$ the average ubiquity of the activities present in a location tends to correlate negatively with the diversity of activities in a location. This is the result of the matrix property known as nestedness and this feature is utilized to explain that more complex activities are only available at a handful of locations with a diverse portfolio of activities \citep{hidalgohausmann2009pnas, balland2020nhb}. \begin{equation} \label{eq:eq5} \textrm{Amenity complexity}_\mathrm{neighborhoods} = K_{n} = \frac{1}{M_{n}}\sum_{a}M_{n,a}K_{a} \end{equation} \begin{equation} \label{eq:eq6} \textrm{Amenity complexity}_\mathrm{amenities} = K_{a} = \frac{1}{M_{a}}\sum_{n}M_{n,a}K_{n} \end{equation} The economic complexity index (ECI) that describes the production structure of economies were originally defined through the iterative, self-referential algorithm of the 'method of reflection' \citep{hidalgohausmann2009pnas}. The algorithm calculates the above explained diversity and ubiquity vectors and then recursively uses the information in one to correct the other in equation (\ref{eq:eq5}) and (\ref{eq:eq6}). Later it was presented that the method of reflection is equivalent to finding the eigenvectors of the similarity matrix $M_{nn'}$ \citep{mealy2019interpreting, hidalgo2021review}, which in our case is defined from the original binary neighborhood-amenity matrix $M$ as $M_{nn'} = M^T * M$. The neighborhood-neighborhood similarity matrix used to construct the amenity complexity of locations is visualized by Figure~\ref{fig:fig2}D. To measure the complexity of amenity categories based on their geographic distribution across neighborhoods, we also create an amenity-amenity similarity matrix as $M_{aa'} = M * M^T$, visualized by Figure~\ref{fig:fig2}E. Applying the most common approach to measure complexity from geographical matrices, we take the second eigenvector of $M_{nn'}$, which is the leading correction to the equilibrium distribution and is the vector that is the best at dividing neighborhoods into groups based on the amenities that are present in them. Similarly, we take the second eigenvector of $M_{aa'}$ to get the complexity values of amenity categories. This process to measure complexity is similar to dimension reduction techniques (singular value decomposition) that provide ways to explain the structure of a matrices (for an overview, see \textcite{hidalgo2021review}). Figure~\ref{fig:fig2}F illustrates the relationship between amenity diversity and average amenity ubiquity of neighborhoods. Each point represents a neighborhood and is colored by the neighborhoods amenity complexity. Besides the expected negative correlation between amenity diversity and average amenity ubiquity \citep{hidalgo2021review}, the amenity complexity of locations and the diversity of amenities at these locations shows remarkable variance. Figure~\ref{fig:fig2}G presents the relationship between the ubiquity of amenity categories and their average diversity. Each point stands for an amenity category and is colored by the complexity of the category. Overall, we observe that more complex amenity categories are non-ubiquitous and on average appear in more diverse areas. However, the figure indicates a clear outlier (bottom left corner), zoo, which is very non-ubiquitous and at the same time appears in less diverse neighborhoods. Figure~\ref{fig:fig2}H visualizes the connection between the amenity complexity of neighborhoods and the complexity of amenities present in these neighborhoods. The figure makes it clear that complex neighborhoods mostly have complex amenities. These findings are in line with the patterns revealed by \textcite{mealy2019interpreting} for countries and exported products. Section S4 in the Supplementary information present the ranking of amenity complexity measures for amenity categories and for the urban neighborhoods of Budapest. \begin{figure}[h!] \includegraphics[width=0.95\textwidth]{mf03.pdf} \caption{Components of amenity complexity in neighborhoods and their connections to the distance from the center of Budapest. \textbf{(A)} Map of Budapest colored by the amenity diversity in neighborhoods. \textbf{(B)} Map of Budapest colored by the average amenity ubiquity in neighborhoods. \textbf{(C)} Map of Budapest colored by the amenity complexity of neighborhoods. \textbf{(D)} Relationship between the distance from center and amenity diversity in neighborhoods. \textbf{(E)} Relationship between the distance from center and average amenity ubiquity in neighborhoods. \textbf{(F)} Relationship between the distance from center and amenity complexity of neighborhoods.} \label{fig:fig3} \end{figure} Figure~\ref{fig:fig3}A, B and C presents amenity diversity, average amenity ubiquity and amenity complexity of neighborhoods on the map of Budapest, while Figure~\ref{fig:fig3}D, E and F illustrates the connection of these factors to the distance from the city center defined as Deák Ferenc square (section S5 of the Supplementary information illustrates the choice of the city center). The figures suggest that average amenity ubiquity and amenity complexity in neighborhoods correlate with distance from the center, but the correlation is stronger for the complexity measure. Figure~\ref{fig:fig4}A, B and C illustrates actual amenities on a zoomed in map of inner Budapest through size 10 H3 hexagons colored by the average diversity, ubiquity and complexity of the amenity category present at the location. At dense inner locations of the city, some hexagons contain amenities in multiple amenity categories. The identification of the dominant amenity category is detailed in section S6 of the Supplementary information. Figure~\ref{fig:fig4}D, E and F shows that more complex amenity categories have lower average distance from the center, while average diversity and ubiquity of amenities have no clear connection to distance from the center. The two figures suggests that there is a strong connection between geographic centrality and amenity complexity of urban locations in our case and we further discuss this feature in the following. \begin{figure}[h!] \includegraphics[width=0.95\textwidth]{mf04.pdf} \caption{Components behind the complexity of amenity categories and their connection to the distance from the center of Budapest. \textbf{(A)} Amenities around Budapest colored by the average diversity of amenity category. The map is zoomed to the city center for illustration. \textbf{(B)} Amenities around Budapest colored by the ubiquity of amenity category. The map is zoomed to the city center for illustration. \textbf{(C)} Amenities around Budapest colored by their complexity. \textbf{(D)} Relationship between average distance of amenity categories from the center of Budapest and average diversity of amenity categories. \textbf{(E)} Relationship between average distance of amenity categories from center of Budapest and ubiquity of amenity categories. \textbf{(F)} Relationship between average distance of amenity categories from the center of Budapest and complexity of amenity categories.} \label{fig:fig4} \end{figure} \section{Results} \subsection{Diversity of visitors to complex urban neighborhoods} \justify To illustrate the properties of urban locations that attract people of diverse socio-economic status, we combine amenity complexity measures at the neighborhood level with more granular visitation patterns from mobility data. Figure~\ref{fig:fig5} presents our process to join different data sources through the example neighborhood of Középső-Ferencváros in Budapest. \begin{figure}[h!] \includegraphics[width=0.9\textwidth]{mf05.pdf} \caption{Amenity complexity of a selected neighborhood and its visitors in January 2020. \textbf{(A)} Selected urban neighborhood of Középső-Ferencváros. \textbf{(B)} Home location of devices visiting Középső-Ferencváros. \textbf{(C)} Real estate prices at the home location of visitors. \textbf{(D)} Distribution of amenity complexity at the level of neighborhoods. The red vertical line indicates the complexity of the selected neighborhood of Középső-Ferencváros. \textbf{(E)} Distribution of observed visitors in neighborhoods. The red vertical line indicates the number of visitors in the selected neighborhood. \textbf{(F)} Distribution of real estate prices across all census tracts and at the home census tracts of visitors to the selected neighborhood.} \label{fig:fig5} \end{figure} Figure~\ref{fig:fig5}A presents the location of the selected neighborhood, while Figure~\ref{fig:fig5}B visualizes the home location of devices that visited any third places inside Középső-Ferencváros during the month of January 2020. We connect the home location of visitors to census tracts as Figure~\ref{fig:fig5}C indicates. This allows us to infer on the socio-economic status of visitors reflected by the real estate prices at the census tract of their home location. Figure~\ref{fig:fig5}D shows that the amenity mix at the selected neighborhood is relatively complex, while Figure~\ref{fig:fig5}E and F shows that Középső-Ferencváros is visited by more devices than most neighborhoods in January 2020 and its visitors come from diverse census tracts from all around Budapest. \renewcommand{\arraystretch}{0.9} \begin{table}[!htbp] \centering \caption{Controlled correlations between the socio-economic diversity of visitors and the amenity complexity of neighborhoods} \label{table:table1} \begin{tabular}{@{\extracolsep{2pt}}lcccc} \\[-1.8ex]\hline \\[-1.8ex] & \multicolumn{4}{c}{Coefficient of variation} \\ \\[-1.8ex] & (1) & (2) & (3) & (4)\\ \hline \\[-1.8ex] Amenity complexity & 0.126$^{***}$ & & & \\ & (0.036) & & & \\ & & & & \\ Amenity diversity & & $-$0.059 & & \\ & & (0.084) & & \\ & & & & \\ Avg amenity ubiquity & & & 0.019 & \\ & & & (0.052) & \\ & & & & \\ Distance from center (log) & & & & $-$0.139$^{***}$ \\ & & & & (0.023) \\ & & & & \\ Population (log) & $-$0.089$^{***}$ & $-$0.104$^{***}$ & $-$0.109$^{***}$ & $-$0.044$^{*}$ \\ & (0.024) & (0.024) & (0.026) & (0.024) \\ & & & & \\ Nr visitors (log) & 0.085$^{***}$ & 0.111$^{***}$ & 0.110$^{***}$ & 0.053$^{*}$ \\ & (0.029) & (0.029) & (0.030) & (0.028) \\ & & & & \\ Nr POIs (log) & 0.004 & 0.020 & 0.006 & $-$0.016 \\ & (0.024) & (0.036) & (0.028) & (0.023) \\ & & & & \\ Constant & 0.468$^{***}$ & 0.534$^{***}$ & 0.548$^{***}$ & 0.590$^{***}$ \\ & (0.066) & (0.072) & (0.070) & (0.057) \\ & & & & \\ \hline \\[-1.8ex] Observations & 185 & 185 & 185 & 185 \\ R$^{2}$ & 0.197 & 0.145 & 0.143 & 0.288 \\ Adjusted R$^{2}$ & 0.179 & 0.126 & 0.124 & 0.272 \\ \hline \textit{Note:} {$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01} \\ \end{tabular} \end{table} To capture socio-economic mixing at urban locations, we measure the diversity of visitors in each neighborhood for every month by calculating the coefficient of variation (ratio of standard deviation to the mean) of the real estate prices at the home census tracts of visitors. We focus only on neighborhoods with at least 10 observed visitors in the focal month to get meaningful measures. Table~\ref{table:table1} presents controlled correlations where we test the relationship between diversity of visitors and the amenity structure of neighborhoods by simple OLS regressions. Model (1) suggests that even after controlling for population, number of visitors and number of POIs in neighborhoods, amenity complexity is still positively correlated to the diversity of visitors. Interestingly, amenity diversity and average amenity ubiquity does not correlate with visitation patterns in our case (see Model (2) and (3) in Table~\ref{table:table1}). This suggests that amenity complexity captures the ability of mixing divers socio-economic groups than its elements: diversity and ubiquity of amenities. Assessing the influence of central location to the diversity of visitors, we test the relationship between distance from center, measured as the overhead distance between the geometric center of neighborhoods from the center of Deák Ferenc square (unlike the center of gravity, this square can be considered as Budapest's central point in urban mobility). Model (4) suggests that distance from the center has a strong negative connection to the diversity of visitors. The $R^2$ values of the different models suggest that distance from the center of Budapest has a higher explanatory power for the diversity of visitors than amenity complexity. Using the Gini coefficient or the Theil index to capture the diversity of visitors, we get the same results. Related model outputs can be found in section S7 of the Supplementary information. Figure~\ref{fig:fig6}A-D presents the direct relationship between the four key explanatory variables and coefficient of variation. The univariate models are in line with the results of Table~\ref{table:table1}. Figure~\ref{fig:fig6}E presents the coefficient of amenity complexity estimated for the available 24 months by the same model presented in Table~\ref{table:table1}. The figure suggests that amenity complexity of neighborhoods have a positive and significant relationship with the diversity of visitors in neighborhoods in all 24 months. Figure~\ref{fig:fig6}F illustrates that stable negative and significant relationship of distance from center on the diversity of neighborhoods visitors. The results of Figure~\ref{fig:fig6}E and F are especially robust in case we consider the influence of COVID-19 related mobility restrictions in 2020. We run the same models presented in Table~\ref{table:table1} on the visitation patterns of non-local users only. In this setting we only consider users living outside of the focal neighborhood, we observe similar patterns. Related models and figures can be found in section S8 of the Supplementary information. \begin{figure}[h!] \includegraphics[width=0.85\textwidth]{mf06.pdf} \caption{Univariate relationship and long time connection between our key variables and socio-economic diversity of visitors at the level of neighborhoods. \textbf{(A)} Relationship between amenity complexity in neighborhoods and socio-economic diversity of visitors measured by the coefficient of variation of the real estate prices at the home locations. \textbf{(B)} Relationship between amenity diversity and socio-economic diversity of visitors on a scatter plot with regression line. \textbf{(C)} Relationship between average amenity ubiquity and socio-economic diversity of visitors on a scatter plot with regression line. \textbf{(D)} Relationship between distance from city center and socio-economic diversity of visitors on a scatter plot with regression line. All scatter plots reflect only the observations from January 2020. \textbf{(E)} Regression coefficient of amenity complexity estimated for 24 months by the model presented in Table~\ref{table:table1}. \textbf{(F)} Regression coefficient of distance from center estimated for 24 months by the model presented in Table~\ref{table:table1}.} \label{fig:fig6} \end{figure} \clearpage \subsection{Diversity of visitors to complex amenities} \justify To go beyond the level of urban neighborhoods, we combine amenity complexity measured at the amenity category level with visitations to actual amenities derived from our fine-grained mobility data. Figure~\ref{fig:fig7} presents our process to join different data sources at the level of amenities through an example. The selected example is a bar in the neighborhood of Középső-Ferencváros, Budapest. Figure~\ref{fig:fig7}A shows the selected amenity and all the surrounding amenities on a zoomed-in map in size 10 H3 hexagons. Figure~\ref{fig:fig7}B illustrates the home location of visitor devices in 2020 January from the surrounding area in size 10 H3 hexagons. We connect the home location of visitors to census tracts to proxy the socio-economic status of visitors by real estate prices. Figure~\ref{fig:fig7}D shows that the selected example bar is from a relative complex amenity category and Figure~\ref{fig:fig7}E suggests that it is relate frequently visited in comparison to other observed amenities in 2020 January. Moreover, visitors from census tracts with middle and higher real estate prices are over-represented in 2020 January, as suggested by Figure~\ref{fig:fig7}F. \begin{figure}[h!] \includegraphics[width=0.9\textwidth]{mf07.pdf} \caption{ Connecting complexity of amenities to visitor diversity. \textbf{(A)} Selected bar on a map. Light red color hexagons indicate other nearby amenities. \textbf{(B)} Home location of the visitors of the selected amenity on a map. \textbf{(C)} Real estate prices at the census tracts of visitor home locations. \textbf{(D)} Distribution of amenity complexity values at the level of categories. The red vertical line indicates the complexity of the selected amenity in the category of bars. \textbf{(E)} Distribution of visitors to observed amenities in 2020 January, Budapest. The red vertical line indicates the number of visitors at the selected bar. \textbf{(F)} Distribution of real estate prices across all census tracts and at the home census tracts of visitors. } \label{fig:fig7} \end{figure} We measure the socio-economic diversity of visitors to each amenities for every month by calculating the coefficient of variation (ratio of standard deviation to the mean) of the real estate prices at the home census tracts of visitors. To do so, we focus only on amenities with at least 10 observed visitors in the focal month that helps us avoid meaningless vales of the indicator. Table~\ref{table:table2} presents simple OLS models to illustrate the relationship between the socio-economic diversity of visitors and components of amenity complexity at the level of amenities in 2020 January. Model (1) suggests that even after controlling for the total number of POIs in the respective amenity category around Budapest and the number of observed visitors in the focal month to the amenity, the complexity of the amenity category still has a positive and significant relationship with the socio-economic diversity of visitors. The negative and significant coefficient of the ubiquity of amenity category in Model (2) suggests that rare amenities are visited by more diverse groups of people. This result is consistent with the findings of \textcite{moro2021naturecomm}. The positive and slightly significant coefficient on the average diversity of amenities in Model (3) indicates that amenity categories that mostly appear in diverse neighborhoods attract visitors with different socio-economic status. \renewcommand{\arraystretch}{0.9} \begin{table}[!htbp] \centering \caption{Controlled correlations between the socio-economic diversity of visitors and the complexity of amenities} \label{table:table2} \begin{tabular}{@{\extracolsep{2pt}}lcccc} \\[-1.8ex]\hline \\[-1.8ex] & \multicolumn{4}{c}{Coefficient of variation} \\ \\[-1.8ex] & (1) & (2) & (3) & (4)\\ \hline \\[-1.8ex] Complexity of amenity & 0.110$^{***}$ & & & \\ & (0.015) & & & \\ & & & & \\ Ubiquity of amenity & & $-$0.112$^{***}$ & & \\ & & (0.018) & & \\ & & & & \\ Avg diversity of amenity & & & 0.061$^{**}$ & \\ & & & (0.026) & \\ & & & & \\ Distance from center (log) & & & & $-$0.110$^{***}$ \\ & & & & (0.007) \\ & & & & \\ Nr POIs in category (log) & 0.001 & 0.029$^{***}$ & 0.001 & 0.00000 \\ & (0.008) & (0.010) & (0.010) & (0.007) \\ & & & & \\ Nr visitors (log) & 0.073$^{***}$ & 0.074$^{***}$ & 0.082$^{***}$ & 0.039$^{***}$ \\ & (0.010) & (0.010) & (0.010) & (0.010) \\ & & & & \\ Constant & 0.223$^{***}$ & 0.241$^{***}$ & 0.249$^{***}$ & 0.382$^{***}$ \\ & (0.030) & (0.030) & (0.039) & (0.027) \\ & & & & \\ \hline \\[-1.8ex] Observations & 2,226 & 2,226 & 2,226 & 2,226 \\ R$^{2}$ & 0.056 & 0.051 & 0.037 & 0.124 \\ Adjusted R$^{2}$ & 0.055 & 0.049 & 0.035 & 0.123 \\ \hline \textit{Note:}{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01} \\ \end{tabular} \end{table} \begin{figure}[!htbp] \includegraphics[width=0.85\textwidth]{mf08.pdf} \caption{Univariate relationship and long time connection between our key variables and the socio-economic diversity of visitors at the level of amenities. \textbf{(A)} Relationship between complexity of amenities and the socio-economic diversity of visitors measured by the coefficient of variation of the real estate prices at the home locations. \textbf{(B)} Relationship between average amenity diversity and the socio-economic diversity of visitors on a scatter plot with regression line. \textbf{(C)} Relationship between amenity ubiquity and the socio-economic diversity of visitors on a scatter plot with regression line. \textbf{(D)} Relationship between distance from city center and the socio-economic diversity of visitors on a scatter plot with regression line. All scatter plots reflect only the observations from January 2020. \textbf{(E)} Regression coefficient of amenity complexity estimated for 24 months by the model presented in Table~\ref{table:table1}. Light colors indicate insignificant coefficients. \textbf{(F)} Regression coefficient of distance from center estimated for 24 months by the model presented in Table~\ref{table:table1}. Light colors indicate insignificant coefficients.} \label{fig:fig8} \end{figure} To measure the influence of central location on the socio-economic diversity of visitors to amenities, we test distance from center, measured as the overhead distance between the amenity and the center Budapest (see section S5 of the Supplementary information for more details) in the same model setting. The negative and significant coefficient in Model (4) suggests that the further away amenities are from the center, the less diverse their visitors are in terms of socio-economic status. The $R^2$ values of the different models indicate that distance from the center of Budapest has the highest explanatory power on the socio-economic diversity of visitors. As a robustness check, we use the Gini coefficient and the Theil index to capture the socio-economic diversity of visitors and we get the same results. Related regressions can be found in section S7 of the Supplementary information. Figure~\ref{fig:fig8}A-D illustrates the direct relationship between the four key explanatory variables and the coefficient of variation at the level of amenities on scatter plots with univariate regression lines. The figures suggest similar results to Table~\ref{table:table2}. Figure~\ref{fig:fig8}E presents the coefficient of amenity complexity estimated for the available 24 months by the same model presented in Table~\ref{table:table2}. Lighter colors on Figure~\ref{fig:fig8}E indicate insignificant estimates. The figure suggests that the complexity of amenities has a positive and significant relationship with the socio-economic diversity of visitors with the exception of 3 months in 2019. Figure~\ref{fig:fig8}F illustrates a stable negative and significant relationship between distance from center and the socio-economic diversity of visitors to amenities with the exception of 2 months in 2019. Despite the COVID-19 related restriction in 2020, our estimates on Figure~\ref{fig:fig8}E and F proved to be stable. \section{Discussion} \justify In this work we bring the ideas behind economic complexity to the urban problems of experienced segregation and social mixing. We measure amenity complexity by utilizing the spatial distribution of point of interests (POIs) inside a city. Then, we combine the information on the complexity of amenities with fine-grained mobility data to illustrate the relationship between amenity complex and visitor attraction. Focusing on the urban neighborhoods of Budapest, Hungary, we find that neighborhoods populated with a more complex amenity mix attract a bigger diversity of socio-economic groups. Applying the same logic to actual amenities inside Budapest, we also show that POIs of more complex amenity categories are visited by larger diversities of strata. However, components of amenity complexity, such as amenity diversity and amenity ubiquity, are only connected to the socio-economic diversity of visitors at the level of amenities and do not correlate with socio-economic mixing at the level of neighborhoods. Considering centrality inside the monocentric city of Budapest, we find that distance of locations from the center of the city is strongly connected to their ability to attract socio-economically diverse visitors. While amenity complexity seems to correlate with visitation patterns, central location turned out to be a more influential factor for socio-economic mixing. Our empirical work illustrates that diversity and ubiquity of amenities do not have a strong connection to urban centrality, however, amenity complexity and distance from center are strongly correlated in case of the unequally distributed city of Budapest. The general contribution of our paper is that we combine economic complexity concepts with urban mobility research. Constructing the measures of amenity complexity allows us to systematically test the contribution of certain amenity categories to socio-economic mixing in cities. Moreover, we contribute to the line of research on segregation patterns inside cities by illustrating in a direct fashion based on fine-grained mobility data that centrality of urban locations largely influence socio-economic mixing. Our empirical work has several limitations, but offers promising future research directions. The study only focuses on the city of Budapest. Budapest is the only large city in Hungary and it clearly has a monocentric structure. Therefore, our findings are limited to this specific context and similar empirical works in cities with different size, geography and urban structure are necessary to assess the generality of our conclusions. We construct our amenity complexity measures by mapping the distribution of POIs across amenity categories and urban neighborhoods in Budapest. We believe that the level of neighborhoods is the appropriate spatial scale to construct amenity complexity metrics for two reasons. First, the size of the applied spatial units can influence the nestedness of the location-amenity matrix used to construct complexity indexes. Co-occurrence of POIs in different amenity categories are less likely in case we consider smaller geographical areas. Neighborhoods are proved to be large enough to produce intuitive results. Second, neighborhoods are very important spatial units of urban life. They are argued to be the environment that can influence social capital accumulation and social mobility \citep{chetty2022nature, chetty2016neighborhood}. Moreover, they have clear administrative boarders and people can identify with them, which makes the interpretation of amenity complexity results more appealing. However, alternative spatial scales are necessary to be tested in the future. In our empirical exercise, we adopted the most commonly used economic complexity indicator to amenities and neighborhoods. However, several modifications have been suggested to improve economic complexity measurement \citep{tacchella2012fitness, mealy2019interpreting} and the adoption of these methods to intra-urban scale is an apparent future research direction. \section*{Acknowledgements} The authors acknowledge the help of Orsolya Vásárhelyi and Luis Guillermo Natera Orozco with the original POI data collection. We wish to thank Tom Broekel and Frank Neffke for their comments and suggestions. We acknowledge the significant assistance of our illustrator Szabolcs Tóth-Zs. in finalizing our primary figures. \newpage \printbibliography \newpage \clearpage \section*{Supplementary information} \section*{S1 Mobility data preparation} Our GPS based mobility data is provided by a data aggregator company that collects and combines anonymous location data from users' smartphone applications. The sample we use for our analysis is an unbalanced panel of GPS pings from 5.2 million devices in Hungary between 2019 June and 2021 May. Our raw data consists of a device identifier, a time stamp, a latitude, and a longitude coordinate, where GPS pings occur. Pings are logged in case an application on a device requests location information. Sometimes this is the result of an active behavior such as using a navigation application or requesting local weather information. In other cases, pings could be the result of an application requesting information while running in the background. As a consequence, pings occur at irregular intervals. To identify visitation patterns such as home, work or third place visits to urban locations, we transform and filter our raw GPS trajectory data in several steps. We detail these steps in the following. As the data contains some pings attributed to the same device that indicate unreasonable behavior, we start by iteratively removing all ping pairs that signals a movement over 300 kilometers per hour speed. Additionally, we discard all devices that have fewer than 20 pings remaining after this initial speed-based filter. These two steps reduce the total ping count from 3.18 billion to 3.13 billion and the total unique device count from 5.2 million to 1.88 million. To focus on locations where devices stopped for some time, we run the Infostop stop detection algorithm (\cite{aslak2020infostop}). In short, it classifies GPS pings to trips or stays and clusters stationary points into stops in an effective way. We apply the algorithm with the following parameter set. $r1$, the maximum roaming distance allowed for two pings within the same stay is set to 370 meters. $r2$, the typical distance between two stays in the same destination is set to 140 meters. $t_{min}$, the minimum duration of a stay is set to 270 seconds, while $t_{max}$, the maximum time difference between two consecutive pings to be considered within the same stay is set to 7200 seconds. The minimum number of GPS pings required for stationary points is set to 2. The parameters are calibrated using the Google location history data of 7 consenting individuals from Budapest, Hungary. We ran our stop detection algorithm on the sample trajectories with a wide range of parameters. We compared the results of the stop detection process to the personal, anecdotal experiences and to the semantic stop detection extracted from Google accounts. This experiment confirmed that the stop detection algorithm and the parameters produce a reasonable set of trips, stays, and destinations. Moreover, the subsequent home and work detection process built on it produced accurate results for our small sample. Using the output of the stop detection process, we further filter the data to devices that have at least 2 unique destinations with over 4 different stays in each. This reduces the total stop count from 100 million to about 80 million, and the unique device count from 1.75 million to about 240.000. However, even in this final form, over 2.1 billion pings are used from the original 3.18 billion. Our empirical exercise in the end only uses information for each month from devices with identified home, work and at least a single visited third place inside Budapest. \section*{S2 Socio-economic status from census tract level real estate prices} We infer on the socio-economic status of individuals living in Budapest by connecting their identified home location to residential real estate prices at the census tract level. Approximating socio-economic status through real estate prices has several benefits in comparison to the prevalent solution of using household income statistics of urban locations. First, real estate prices are by definition connected to places, while it is harder to connect income to locations. Second, real estate statistics in the census are comprehensive, while income information only reflects on the status of active employees. The Hungarian Central Statistical Office collects data on all residential real estate sales contracts and derives information on transaction prices for the entire country. As not every real estate is on the market and observed contracts sometimes suffer from missing information on the parameters of given properties, direct measurement on lower geographical level is difficult. By utilizing the fact that real estate prices tend to follow a strong multi-level hierarchy as location (and especially neighborhoods in Budapest) explains much of the price differences, we train a multi-level random slope regression model on the observed transaction prices (\cite{chi2021shedding, snijders2011multilevel}). To do so, we use real estate transaction contracts between 2013 and 2019. We create a pooled setting by correcting prices through the city level house price index published yearly by the National Bank of Hungary. Our model can be written as: \begin{equation} \begin{split} \label{eq:si_eq1} h_{i,j} = \beta_{0,j} + \beta_{1,j}s_{i,j} + \varepsilon_{i,j} \\ \beta_{0,j} = \beta_{0} + n_{0,j} \\ \beta_{1,j} = \beta_{1} + n_{1,j} \end{split} \end{equation} \noindent Here $h_{i,j}$ is the logarithm of the individual price of real estate $i$ in neighborhood $j$. $\beta_{0,j}$ represents how much the estimated mean house price differs by neighborhoods. Estimated mean neighborhood prices are decomposed to $\beta_{0}$, the city level mean, and $n_{0,j}$, the neighborhood deviation from this value. To be able to capture differences within neighborhoods, we apply the individual level parameter $s_{i,j}$ that refers to the size (floor area) of real estate $i$ in neighborhood $j$. Since the effect of floor area can vary between neighborhoods, we train a random slope model. $\beta_{1,j}$ represents the effect of floor area in neighborhood $j$. $\beta_{1,j}$ is decomposed to a city level slope $\beta_{1}$, and the deviation of neighborhood slopes around this value $n_{1,j}$. Utilizing this model, we predict prices for every real estate captured by the last Hungarian census in 2010. By taking the mean of the predicted real estate prices at the census tract level, we get a highly granular socio-economic status map for the entire city of Budapest. Figure \ref{fig:si2_fig1}A illustrates the predicted prices aggregated to the census tract level on the map of Budapest, while Figure \ref{fig:si2_fig1}B shows the distribution of predicted real estate prices. \begin{figure}[htb] \centering \includegraphics[width=0.95\textwidth]{si2_fig1_real_estate_prices_distributions.png} \caption{Predicted real estate prices at the census tract level around Budapest (A) and the distribution of real estate prices aggregated to the census tract level in Budapest (B)} \label{fig:si2_fig1} \end{figure} \clearpage \section*{S3 Urban neighborhoods of Budapest, Hungary} We use urban neighborhoods as geographic units to construct our amenity complexity measures. Budapest consists of 207 urban neighborhoods and they are in between districts and census tracts in terms of area and population. The unequal size distribution of urban neighborhoods are illustrated in Figure~\ref{fig:si3_fig1} and Figure~\ref{fig:si3_fig2}. The correlation between population of urban neighborhoods and the number of census tracts per urban neighborhoods is strong as Pearson's R is \num{0.979}. Further details about neighborhoods can be found at the website of \cite{kshregionalatlas}. \begin{figure}[htb] \centering \includegraphics[width=0.95\textwidth]{si3_fig1_population.png} \caption{Population of urban neighborhoods based on the census of 2010 on the map of Budapest (A) and as a distribution plot (B).} \label{fig:si3_fig1} \end{figure} \begin{figure}[htb] \centering \includegraphics[width=0.95\textwidth]{si3_fig2_nr_tracts.png} \caption{Number of census tracts per urban neighborhood based on the census of 2010 on the map of Budapest (A) and as a distribution plot(B).} \label{fig:si3_fig2} \end{figure} \clearpage \section*{S4 Amenity complexity rankings} Ranking of all amenity categories (Figure \ref{fig:si4_fig1}) and all neighborhoods by their amenity complexity values (Figure \ref{fig:si4_fig2}). \begin{figure}[htb] \centering \includegraphics[width=0.65\textwidth]{si4_fig1_amenity_complexity_ranking.png} \caption{Amenity categories ranked by their amenity complexity value. Categories are colored by their ubiquity across neighborhoods. Complexity and ubiquity values are normalized to 0-1 scale for visualization purposes.} \label{fig:si4_fig1} \end{figure} \clearpage \begin{figure}[htb] \centering \includegraphics[width=0.9\textwidth]{si4_fig2_amenity_complexity_ranking.png} \caption{Neighborhoods of Budapest ranked by their amenity complexity value. Neighborhoods are colored by the diversity of their amenities. Complexity and diversity values are normalized to 0-1 scale for visualization purposes.} \label{fig:si4_fig2} \end{figure} \clearpage \section*{S5 Center of Budapest, Hungary} We define the center of Budapest on a functional basis as Deák Ferenc tér. This square is the hotspot of public transportation in the heart of the inner city. Figure \ref{fig:si5_fig1} shows the location of the selected central square. We tested several alternatives for city center such as Landmark zero sculpture that serves as the transportation center of the city or the Hungarian parliament building and our results remain the same. Figure \ref{fig:si5_fig1} illustrates the overhead distance distribution for neighborhoods and amenities in our sample to Deák Ferenc tér. \begin{figure}[htb] \centering \includegraphics[width=0.5\textwidth]{si5_fig1_deak_ter_map.png} \caption{The location of Deák Ferenc tér, the center point.} \label{fig:si5_fig1} \end{figure} \begin{figure}[htb] \centering \includegraphics[width=0.9\textwidth]{si5_fig2_distance_from_center.png} \caption{Distance distribution for neighborhoods (A) and amenities (B) to the center of Deák Ferenc tér.} \label{fig:si5_fig2} \end{figure} \clearpage \section*{S6 Dominant amenity categories of H3 hexagons} The second part of our empirical exercise (section 4.2 Diversity of visitors to complex amenities) connects visitors to actual amenities. This is done by mapping each point of interest (POI) from the Google Places API to a size 10 H3 hexagons (\cite{h3}). These hexagons are on average 15.000 $m^{2}$ area, which is close to the buffer area of a point with a 70 meter radius. As we use the amenity complexity values calculated for amenity categories (see Equation (6) in the main text) to explain the diversity of visitors to size 10 H3 hexagons, we need to assign a single amenity category to each hexagon with POIs. Figure~\ref{fig:si6_fig1_poi_per_hex} illustrates that most hexagons only have amenities in a single amenity category, however, hexagons at dense, central locations often contain multiple POIs from different categories. \begin{figure}[H] \includegraphics[width=0.95\linewidth]{si6_fig1_hexagon_map.png} \caption{Number of different amenity categories per size 10 H3 hexagons on the map of Budapest (A) and on the map of the inner city (B). Distribution of different amenity categories per hexagons (C). The colorbar applies for all subplots.} \label{fig:si6_fig1_poi_per_hex} \end{figure} We assign a dominant amenity category for each hexagon based on the local frequency of POIs in amenity categories. Figure~\ref{fig:si6_fig2_dominant_category} visualizes our dominant category selection process. \num{35.15}\% of the hexagons have ambiguous amenity category dominance and in these cases we simply choose the first category listed. Table~\ref{table:si6_table1} illustrates in comparison to Table 2 of the main text that our key findings are the same in case we focus only on amenities in H3 hexagons with a single amenity category or in case we only consider amenities in H3 hexagons with an unambiguously dominant amenity category (Table~\ref{table:si6_table2}). \begin{figure}[H] \includegraphics[width=0.95\linewidth]{si6_fig2_hexagon_categories.png} \caption{Illustration of the dominant amenity category selection. Different POIs over the hexagons (A) and the determined hexagon category (\textbf{b}).} \label{fig:si6_fig2_dominant_category} \end{figure} \renewcommand{\arraystretch}{0.95} \begin{table}[!ht] \centering \caption{Controlled correlations between the diversity of visitors and the complexity of amenities in case we only consider H3 hexagons with a single amenity category} \label{table:si6_table1} \begin{tabular}{@{\extracolsep{5pt}}lcccc} \\[-1.8ex]\hline \\[-1.8ex] & \multicolumn{4}{c}{Coefficient of variation} \\ \\[-1.8ex] & (1) & (2) & (3) & (4)\\ \hline \\[-1.8ex] Complexity of amenity & 0.163$^{***}$ & & & \\ & (0.061) & & & \\ & & & & \\ Ubiquity of amenity & & $-$0.239$^{**}$ & & \\ & & (0.094) & & \\ & & & & \\ Avg diversity of amenity & & & 0.115 & \\ & & & (0.159) & \\ & & & & \\ Distance from center (log) & & & & $-$0.170$^{***}$ \\ & & & & (0.050) \\ & & & & \\ Nr POIs in category (log) & $-$0.037 & 0.061 & 0.007 & $-$0.000 \\ & (0.031) & (0.047) & (0.058) & (0.030) \\ & & & & \\ Nr visitors (log) & 0.076 & 0.081 & 0.059 & 0.100 \\ & (0.070) & (0.070) & (0.073) & (0.069) \\ & & & & \\ Constant & 0.296$^{**}$ & 0.168 & 0.208 & 0.403$^{***}$ \\ & (0.133) & (0.149) & (0.225) & (0.131) \\ & & & & \\ \hline \\[-1.8ex] Observations & 107 & 107 & 107 & 107 \\ R$^{2}$ & 0.079 & 0.074 & 0.021 & 0.117 \\ Adjusted R$^{2}$ & 0.052 & 0.047 & $-$0.007 & 0.091 \\ \hline \textit{Note:} & \multicolumn{4}{r}{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01} \\ \end{tabular} \end{table} \renewcommand{\arraystretch}{0.95} \begin{table}[!htbp] \centering \caption{Controlled correlations between the diversity of visitors and the complexity of amenities in case we only consider H3 hexagons with an unambiguously dominant amenity category} \label{table:si6_table2} \begin{tabular}{@{\extracolsep{5pt}}lcccc} \\[-1.8ex]\hline \\[-1.8ex] & \multicolumn{4}{c}{Coefficient of variation} \\ \\[-1.8ex] & (1) & (2) & (3) & (4)\\ \hline \\[-1.8ex] Complexity of amenity & 0.115$^{***}$ & & & \\ & (0.018) & & & \\ & & & & \\ Ubiquity of amenity & & $-$0.126$^{***}$ & & \\ & & (0.022) & & \\ & & & & \\ Avg diversity of amenity & & & 0.083$^{***}$ & \\ & & & (0.032) & \\ & & & & \\ Distance from center (log) & & & & $-$0.110$^{***}$ \\ & & & & (0.008) \\ & & & & \\ Nr POIs in category (log) & $-$0.002 & 0.027$^{**}$ & 0.001 & $-$0.006 \\ & (0.009) & (0.012) & (0.013) & (0.008) \\ & & & & \\ Nr visitors (log) & 0.073$^{***}$ & 0.072$^{***}$ & 0.083$^{***}$ & 0.038$^{***}$ \\ & (0.012) & (0.012) & (0.012) & (0.012) \\ & & & & \\ Constant & 0.233$^{***}$ & 0.258$^{***}$ & 0.243$^{***}$ & 0.404$^{***}$ \\ & (0.036) & (0.035) & (0.048) & (0.031) \\ & & & & \\ \hline \\[-1.8ex] Observations & 1,477 & 1,477 & 1,477 & 1,477 \\ R$^{2}$ & 0.068 & 0.063 & 0.045 & 0.140 \\ Adjusted R$^{2}$ & 0.066 & 0.061 & 0.044 & 0.138 \\ \hline \textit{Note:} & \multicolumn{4}{r}{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01} \\ \end{tabular} \end{table} \clearpage \section*{S7 Alternative measures on the diversity of visitors to neighborhoods and amenities} Table~\ref{table:si7_table1} supports the findings presented in Table 1 of the main text. It uses the same model setting to illustrate the relationship between the diversity of visitors to neighborhoods, amenity complexity and distance from the center of the city, but applies different measurements of the dependent variable. Besides the coefficient of variation, the Gini index and the Theil index are used to measure the diversity of visitors and all model version suggest similar connections. Table~\ref{table:si7_table2} supplements the findings of Table 2 in the main text in a similar fashion at the level of amenities. \begin{table}[!htbp] \centering \caption{Controlled correlations between different measures on the diversity of visitors and the amenity complexity of neighborhoods} \label{table:si7_table1} \begin{tabular}{@{\extracolsep{0pt}}lcccccc} \\[-1.8ex]\hline \\[-1.8ex] & Coeff var & Gini & Theil & Coeff var & Gini & Theil \\ \\[-1.8ex] & (1) & (2) & (3) & (4) & (5) & (6)\\ \hline \\[-1.8ex] Amenity complexity & 0.126$^{***}$ & 0.106$^{***}$ & 0.059$^{***}$ & & & \\ & (0.036) & (0.018) & (0.012) & & & \\ & & & & & & \\ Distance from center (log) & & & & $-$0.139$^{***}$ & $-$0.084$^{***}$ & $-$0.051$^{***}$ \\ & & & & (0.023) & (0.012) & (0.008) \\ & & & & & & \\ Population (log) & $-$0.089$^{***}$ & $-$0.034$^{***}$ & $-$0.023$^{***}$ & $-$0.044$^{*}$ & $-$0.010 & $-$0.009 \\ & (0.024) & (0.012) & (0.008) & (0.024) & (0.012) & (0.008) \\ & & & & & & \\ Nr visitors (log) & 0.085$^{***}$ & 0.029$^{**}$ & 0.021$^{**}$ & 0.053$^{*}$ & 0.015 & 0.011 \\ & (0.029) & (0.014) & (0.010) & (0.028) & (0.014) & (0.009) \\ & & & & & & \\ Nr POIs (log) & 0.004 & $-$0.002 & $-$0.003 & $-$0.016 & $-$0.014 & $-$0.011 \\ & (0.024) & (0.012) & (0.008) & (0.023) & (0.011) & (0.008) \\ & & & & & & \\ Constant & 0.468$^{***}$ & 0.212$^{***}$ & 0.090$^{***}$ & 0.590$^{***}$ & 0.307$^{***}$ & 0.144$^{***}$ \\ & (0.066) & (0.033) & (0.022) & (0.057) & (0.029) & (0.019) \\ & & & & & & \\ \hline \\[-1.8ex] Observations & 185 & 185 & 185 & 185 & 185 & 185 \\ R$^{2}$ & 0.197 & 0.241 & 0.200 & 0.288 & 0.300 & 0.269 \\ Adjusted R$^{2}$ & 0.179 & 0.224 & 0.182 & 0.272 & 0.284 & 0.253 \\ \hline \textit{Note:} & \multicolumn{6}{r}{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01} \\ \end{tabular} \end{table} \clearpage \begin{table}[!ht] \centering \caption{Controlled correlations between different measures on the diversity of visitors and the complexity of amenities} \label{table:si7_table2} \begin{tabular}{@{\extracolsep{0pt}}lcccccc} \\[-1.8ex]\hline \\[-1.8ex] & Coeff var & Gini & Theil & Coeff var & Gini & Theil \\ \\[-1.8ex] & (1) & (2) & (3) & (4) & (5) & (6)\\ \hline \\[-1.8ex] Complexity of amenity & 0.110$^{***}$ & 0.055$^{***}$ & 0.035$^{***}$ & & & \\ & (0.015) & (0.007) & (0.005) & & & \\ & & & & & & \\ Distance from center (log) & & & & $-$0.110$^{***}$ & $-$0.056$^{***}$ & $-$0.033$^{***}$ \\ & & & & (0.007) & (0.003) & (0.002) \\ & & & & & & \\ Nr POIs in category (log) & 0.001 & $-$0.003 & 0.00001 & 0.00000 & $-$0.003 & $-$0.001 \\ & (0.008) & (0.003) & (0.002) & (0.007) & (0.003) & (0.002) \\ & & & & & & \\ Nr visitors (log) & 0.073$^{***}$ & 0.032$^{***}$ & 0.016$^{***}$ & 0.039$^{***}$ & 0.014$^{***}$ & 0.006$^{*}$ \\ & (0.010) & (0.004) & (0.003) & (0.010) & (0.004) & (0.003) \\ & & & & & & \\ Constant & 0.223$^{***}$ & 0.132$^{***}$ & 0.031$^{***}$ & 0.382$^{***}$ & 0.212$^{***}$ & 0.081$^{***}$ \\ & (0.030) & (0.014) & (0.010) & (0.027) & (0.012) & (0.009) \\ & & & & & & \\ \hline \\[-1.8ex] Observations & 2,226 & 2,226 & 2,226 & 2,226 & 2,226 & 2,226 \\ R$^{2}$ & 0.056 & 0.061 & 0.042 & 0.124 & 0.147 & 0.100 \\ Adjusted R$^{2}$ & 0.055 & 0.060 & 0.040 & 0.123 & 0.146 & 0.099 \\ \hline \hline \\[-1.8ex] \textit{Note:} & \multicolumn{6}{r}{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01} \\ \end{tabular} \end{table} \clearpage \section*{S8 Diversity of non-local visitors to neighborhoods} Table~\ref{table:si8_table1} supports the findings presented in Table 1 of the main text, but the models are based only on non-local visits. This means that we excluded all third places visits inside the home neighborhoods of devices. Results are very similar to our main models. \begin{table}[!htbp] \centering \caption{Controlled correlations between the diversity of non-local visitors and the amenity complexity of neighborhoods} \label{table:si8_table1} \begin{tabular}{@{\extracolsep{0pt}}lcccc} \\[-1.8ex]\hline \\[-1.8ex] & \multicolumn{4}{c}{Coefficient of variation (non-local visitors only)} \\ \\[-1.8ex] & (1) & (2) & (3) & (4)\\ \hline \\[-1.8ex] Amenity complexity & 0.126$^{***}$ & & & \\ & (0.036) & & & \\ & & & & \\ Amenity diversity & & $-$0.079 & & \\ & & (0.084) & & \\ & & & & \\ Average amenity ubiquity & & & 0.057 & \\ & & & (0.052) & \\ & & & & \\ Distance from center (log) & & & & $-$0.130$^{***}$ \\ & & & & (0.023) \\ & & & & \\ Population (log) & $-$0.079$^{***}$ & $-$0.093$^{***}$ & $-$0.105$^{***}$ & $-$0.037 \\ & (0.024) & (0.024) & (0.025) & (0.025) \\ & & & & \\ Nr visitors (log) & 0.068$^{**}$ & 0.095$^{***}$ & 0.098$^{***}$ & 0.040 \\ & (0.029) & (0.029) & (0.030) & (0.028) \\ & & & & \\ Nr POIs (log) & 0.015 & 0.037 & 0.027 & $-$0.003 \\ & (0.024) & (0.036) & (0.028) & (0.023) \\ & & & & \\ Constant & 0.448$^{***}$ & 0.505$^{***}$ & 0.504$^{***}$ & 0.567$^{***}$ \\ & (0.066) & (0.072) & (0.070) & (0.057) \\ & & & & \\ \hline \\[-1.8ex] Observations & 185 & 185 & 185 & 185 \\ R$^{2}$ & 0.184 & 0.134 & 0.135 & 0.258 \\ Adjusted R$^{2}$ & 0.166 & 0.114 & 0.116 & 0.242 \\ \hline \textit{Note:} & \multicolumn{4}{r}{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01} \\ \end{tabular} \end{table} \end{document}
\section{Introduction} \label{sec:intro} \input{sections/01_intro} \section{Related Work} \label{sec:relatedwork} \input{sections/02_related-work} \section{LGAE Architecture} \label{sec:architecture} \input{sections/03_architecture} \section{Experiments} \label{sec:experiments} \input{sections/04_experiments} \subsection{Dataset} \label{sec:dataset} \input{sections/05_dataset} \subsection{Reconstruction} \label{sec:reconstruction} \input{sections/06_recons} \subsection{Anomaly Detection} \label{sec:anomaly} \input{sections/07_anomaly} \subsection{Latent Space Interpretation} \label{sec:latent-analysis} \input{sections/08_analysis} \section{Conclusion} \label{sec:conclusion} \input{sections/09_conclusion} \begin{acknowledgements} We would like to thank Dr. Rose Yu for discussions on equivariant neural networks, and Dr. Dylan Rankin for suggestions on the anomaly detection performance and latent space analysis of the LGAE. \end{acknowledgements} \bibliographystyle{cms_unsrt} \subsection{ML for HEP} \subsection{\label{sec:enns} Equivariant Neural Networks} A neural network $\mathrm{NN}: V \to W$ is said to be \textit{equivariant} with respect to a group $G$ if \begin{equation} \forall g \in G, v \in V \colon \mathrm{NN} (\rho_V(g) \cdot v) = \rho_W(g) \cdot \mathrm{NN}(v), \end{equation} where $\rho_V\colon G \to \mathrm{GL}(V)$ and $\rho_W\colon G \to \mathrm{GL}(W)$ are representations of $G$ in spaces $V$ and $W$ respectively. The neural network is said to be \textit{invariant} if $\rho_W$ is a trivial representation, i.e. $\rho_W(g) = \mathbbm{1}_W$ for all $g \in G$. Equivariance has long been built into a number of successful DNN architectures, such as translation equivariance in CNNs, and permutation equivariance in graph neural networks (GNNs)~\cite{bronstein2021geometric}. Recently, equivariance in DNNs has been extended to a broader set of symmetries, such as those corresponding to the 2-dimensional special orthogonal $\mathrm{SO}(2)$~\cite{walters2021trajectory}, the Euclidean $\mathrm{E}(2)$~\cite{E(2)-Equivariant}, the 3-dimensional special orthogonal $\mathrm{SO}(3)$~\cite{SO(3)-Equivariant}, the 3-dimensional Euclidean $\mathrm{E}(3)$~\cite{thomas2018tensor,E3-equivariant} groups, and arbitrary matrix Lie groups~\cite{Finzi-arbitary-group-equivariance}. Broadly, equivariance to a group $G$ has been achieved either by extending the translation-equivariant convolutions in CNNs to more general symmetries with appropriately defined learnable filters~\cite{equivariance-kernel-Cohen,equivariance-kernel-Finzi,Cohen-group-equivariance,e3cnn}, or by operating in the Fourier space of $G$ (or a combination thereof). The latter approach uses the set of irreducible representations (irreps) of $G$ as the basis functions for constructing an equivariant map~\cite{equivariance-Fourier-Kondor,equivariance-Fourier-Anderson,E(2)-Equivariant}, and is what we employ for the LGAE. \subsection{\label{sec:lgenn} Lorentz Group Equivariant Neural Networks} The Lorentz group $\mathrm{O}(3, 1)$ comprises the set of linear transformations between inertial frames with coincident origins. In this paper, we restrict ourselves to the special orthochronous Lorentz group $\mathrm{SO}^+(3, 1)$, which consists of all Lorentz transformations that preserve the orientation and direction of time. Lorentz symmetry, or invariance to transformations defined by the Lorentz group, is a fundamental symmetry of the data collected out of high-energy particle collisions. There have been some recent advances in incorporating this symmetry into NNs. The Lorentz group network (LGN)~\cite{LGN} was the first DNN architecture developed to be covariant to the $\mathrm{SO}^+(3, 1)$ group, based on a GNN architecture but operating entirely in Fourier space on objects in irreps of the Lorentz group, and using tensor products between irreps and Clebsch--Gordan decompositions to introduce non-linearities in the network. More recently, LorentzNet~\cite{LorentzNet,Li:2022xfc} uses a similar GNN framework for equivariance, with additional edge features --- Minkowski inner products between connected node features --- but restricting itself to features living only in scalar and vector representations of the group. Both networks have been successful to jet classification, with LorentzNet achieving SOTA results in top quark and quark versus gluon classification, further demonstrating the benefit of incorporating physical inductive biases into network architectures. In this work, we build on top of the LGN framework to output not only scalars (e.g. jet class probabilities) but covariantly encode and reconstruct an input set of particles in an autoencoder-style architecture. \subsection{\label{sec:aehep} Autoencoders in HEP} An autoencoder is a NN architecture comprised of an encoder, which maps the input into a, typically lower dimensional, latent space, and a decoder, which attempts to reconstruct the original input from the latent features. By using a lower dimensional latent space, an autoencoder can learn a smaller representation of data that captures salient properties~\cite{autoencoders}, which can be valuable in HEP for compressing the significant volumes of data collected at the LHC~\cite{Guglielmo}. This learned representation can also be exploited for later downstream tasks, such as anomaly detection, where an autoencoder is trained to reconstruct data considered ``background'' to our signal, with the expectation that it will reconstruct the signal poorly relative to the background. Thus, examining the reconstruction loss of a trained autoencoder may allow the identification of anomalous data\footnote{Another approach directly examines the latent space~\cite{VAE-anomaly-VAE, VAE-anomaly-latent-space}.}. This can be a huge advantage in searches for new physics, as a specific signal is therefore not needed and instead a broader search can be performed for data incompatible with the background. This approach has been successfully demonstrated in Refs.~\cite{Heimel:2018mkt,Farina-anomaly,Cerri:2018anq,Finke-anomaly,Kasieczka:2021xcg,Govorkova:2021utb,Pol:2020weg,Ngairangbam:2021yma,Dillon-lower-dimension}. Furthermore, there are many possible variations to the general autoencoder framework for alternative tasks~\cite{AE-review-1,AE-review-2}, such as variational autoencoders (VAEs)~\cite{VAE}, which are popular generative models. To our knowledge, while there have been some recent efforts at GNN-based models~\cite{pgae,Atkinson:2021nlt}, there has not yet been an attempt at developing an autoencoder architecture for any of these tasks that is equivariant to the Lorentz group. In this work, we focus on data compression and anomaly detection but note that our model can be extended to a variety of applications. \section{Training Details} \label{app:training} We use the Chamfer loss function~\cite{10.5555/1622943.1622971,Fan_2017_CVPR,Zhang2020FSPool} for the LGAE-Min-Max and GNNAE-JL models, and MSE for LGAE-Mix and GNNAE-PL. We tested the Hungarian loss~\cite{hungarian,scipy} and differentiable energy mover's distance (EMD)~\cite{emd}, calculated using the \jetnet library~\cite{jetnetlibrary}, as well but found the Chamfer and MSE losses more performant. All models are optimized using the Adam optimizer~\cite{ADAM} implemented in PyTorch~\cite{pytorch} with a learning rate $\gamma = 10^{-3}$, coefficients $(\beta_1, \beta_2) = (0.9, 0.999)$, and weight decay $\lambda = 0$. They are each trained on single NVIDIA RTX 2080 Ti GPUs each for a maximum of 2000 epochs using early stopping with a patience of 200 epochs. The total training time for LGAE models is typically 35 hours, and at most 100 hours, while GNNAE-PL and GNNAE-JL train for 50 and 120 hours on average, respectively. \subsection{Reconstruction} \label{app:recons} \subsubsection*{Cartesian Coordinates} Since the input of the LGAEs is $(E, p_x, p_y, p_z)$, we also computed the reconstruction relative errors in the original coordinates, as shown in \cref{tab:lgae-rel-err-cartesian}. As expected, in terms of the four metrics, the LGAEs reconstruct what they were trained to learn better than particle $(p_\mathrm{T}^\mathrm{rel}, \eta^\mathrm{rel}, \phi^\mathrm{rel})$. \begin{table*}[ht] \centering \caption{Median, IQR, IDR, and MAD of relative errors in particle feature $(p_x, p_y, p_z)$ reconstructions by LGAE models with min-max and mean aggregations and different latent 4-vector multiplicities ($\tau_{(1/2, 1/2}))$} \label{tab:lgae-rel-err-cartesian} \begin{tabular}{c|c|c|c|c|c} \toprule Aggregation & $\tau_{(1/2,1/2)}$ & Median & IQR & IDR & MAD \\ \hline \multirow{2}{*}{min-max} & $4$ ($56.7\%$) & $-0.0892$ & $\mathbf{0.4128}$ & $\mathbf{1.2832}$ & $\mathbf{0.3049}$ \\ & $5$ ($70\%$) & $\mathbf{0.0139}$ & $0.7405$ & $5.0714$ & $0.4717$ \\ \hline \multirow{3}{*}{mix} & $4$ ($28.33\%$) & $-0.0033$ & $0.1814$ & $0.5627$ & $0.1353$ \\ & $9$ ($61.67\%$) & $\mathbf{0.0001}$ & $0.0319$ & $0.3143$ & $0.0237$ \\ & $13$ ($88.33\%$) & $-0.0003$ & $\mathbf{0.0026}$ & $\mathbf{0.0589}$ & $\mathbf{0.0017}$ \\ \bottomrule \end{tabular} \end{table*} We trained the GNNAEs to reconstruct the particle momenta in lab Cartesian coordinates, $(p_x, p_y, p_z)$, for a direct comparison with the LGAEs. The LGAE was trained for about 200 epochs, whereas the GNNAE needed more than 1000 epochs to converge to an acceptable reconstruction performance. Figures~\ref{fig:recons-hist-gnnae_cartesian} and \ref{fig:recons-jet_images-gnnae_cartesian} show the distribution and jet-image reconstruction by a GNNAE model with particle-level compression that was trained to reconstruct the particle momenta in the lab Cartesian coordinates. The reconstructions of jet mass and jet images are worse than the LGAE at a similar level of compression, which is shown in \cref{fig:recons-jet-imgs-mix,fig:recons-hist}. Figure~\ref{fig:recons-corr-gnnae_cartesian} shows the correlation plots between the target and reconstructed particle momenta by the two models. Qualitatively, the LGAE's reconstruction shows a stronger correlation with the target than the GNNAE's. Quantitatively, in terms of the correlation coefficient $r$, the reconstructions by the LGAE are better than the GNNAE at a similar level of compression. Note that although the $r$ values for the $\phi$ reconstruction have a similar order of magnitude, the negative value in the one by GNNAE indicates that a positive target $\phi^\mathrm{rel}$ is likely to be reconstructed as a negative value by the GNNAE, indicating a poor reconstruction. \begin{figure*}[ht] \centering \includegraphics[scale=0.45]{figures/reconstructions/gnnae-cartesian/gnnae_cartesian-particle.pdf} \includegraphics[scale=0.45]{figures/reconstructions/gnnae-cartesian/gnnae_cartesian-jet.pdf} \caption{Particle momenta $(p_\mathrm{T}^\mathrm{rel}, \eta^\mathrm{rel}, \phi^\mathrm{rel})$ (top) and jet feature $(M, P_\mathrm{T}, \eta, \phi)$ (bottom) reconstructions by the GNNAE model with particle-level aggregation and the latent dimension of $\dim(L) = 2 \times 30$ when the model is trained to reconstruct $(p_x, p_y, p_z)$ at epoch 1001.} \label{fig:recons-hist-gnnae_cartesian} \end{figure*} \begin{figure*}[ht] \centering \includegraphics[height=0.8\paperheight]{figures/reconstructions/gnnae-cartesian/gnnae_cartesian-jet_images.pdf} \caption{Jet image reconstructions by the GNNAE model with particle-level aggregation and the latent dimension of $\dim(L) = 2 \times 30$ when the model is trained to reconstruct $(p_x, p_y, p_z)$ at epoch 1001.} \label{fig:recons-jet_images-gnnae_cartesian} \end{figure*} \begin{figure*}[ht] \centering \includegraphics[width=\linewidth]{figures/reconstructions/gnnae-cartesian/gnnae-recons-corr.pdf} \includegraphics[width=\linewidth]{figures/reconstructions/gnnae-cartesian/lgae-recons-corr.pdf} \caption{Correlations between the target particle momenta $(p_\mathrm{T}^\mathrm{rel}, \eta^\mathrm{rel}, \phi^\mathrm{rel})$ and reconstructed particle momenta by the GNNAE model with particle-level aggregation and the latent dimension of $\dim(L) = 2 \times 30$ (top) and by the LGAE model with mix aggregation and the $\tau_{(1/2, 1/2)} = 9$ latent 4-vectors (bottom).} \label{fig:recons-corr-gnnae_cartesian} \end{figure*} \subsubsection*{Learning Identity Mapping} To see if the LGAEs and GNNAEs can reconstruct the jet when the latent space is large enough, we show reconstructions of particle-feature distribution and jet images by the LGAE at $88.3\%$ compression and the GNNAE with the latent dimension with no compression in \cref{fig:recons-hist-best,fig:recons-jet-imgs-best}, respectively. In addition, \cref{fig:recons-hist-best} also shows the jet feature reconstruction by the LGAE model. We see that the LGAE performs jet-image reconstruction decently and the particle-feature and jet-feature distribution almost perfectly, whereas the GNNAE still cannot have a very accurate reconstruction of the particle-feature distribution---especially the $p_\mathrm{T}^\mathrm{rel}$-distribution---and average jet image. Therefore, we conclude that the LGAE can approximate the identity mapping better than the GNNAE when the latent space dimension is close enough to the dimension of physical data. \begin{figure*}[ht] \centering \includegraphics[width=0.8\linewidth]{figures/reconstructions/best-models/polarrel-mix.pdf} \includegraphics[width=0.8\linewidth]{figures/reconstructions/best-models/jet.pdf} \caption{ \textbf{Top}: Particle momenta $(p_\mathrm{T}^\mathrm{rel}, \eta^\mathrm{rel}, \phi^\mathrm{rel})$ reconstruction by the best-performance LGAE and GNNAE models. \textbf{Bottom}: Jet feature $(M, p_\mathrm{T}, \eta)$ reconstruction by the best-performance LGAE model. The best LGAE model is chosen to be that with mix aggregation and $\tau_{(1/2,1/2)}=13$ latent 4-vectors (resulting in $88.3\%$ compression). The best GNAE model is chosen to be that with particle-level aggregation and the latent dimension of $\dim(L) = 3 \times 30$ (resulting in no compression). } \label{fig:recons-hist-best} \end{figure*} \clearpage \begin{figure*}[ht] \centering \includegraphics[height=0.75\paperheight]{figures/reconstructions/best-models/jet_images-mix.pdf} \caption{Jet image reconstructions by the best-performance LGAE (middle column) and GNNAE (right column) models. The best LGAE model is chosen to be that with mix aggregation and $\tau_{(1/2,1/2)}=13$ aggregation (resulting in $88.3\%$ compression). The best GNAE model is chosen to be that with particle-level aggregation and the latent dimension of $\dim(L) = 3 \times 30$ (resulting in no compression). } \label{fig:recons-jet-imgs-best} \end{figure*} \section{Model Details} \label{app:hyperparams} \subsection{LGAE} For both encoder and decoder, we choose $N_\mathrm{MP}^\mathrm{E} = N_\mathrm{MP}^\mathrm{D} = 4$ LMP layers. The multiplicity per node in each LMP layer has been optimized to be \begin{equation} \left\{ \parenthesis{\tau_{(m, n)}^{(t)}}^\mathrm{E} \right\}_{t=1}^{4} = (3,3,4,4) \end{equation} for the encoder and \begin{equation} \left\{ \parenthesis{\tau_{(m, n)}^{(t)}}^\mathrm{D} \right\}_{t=1}^{4} = (4,4,3,3) \end{equation} for the decoder. After each CG decomposition, we truncate irreps of dimensions higher than $(1/2, 1/2)$ for tractable computations. Empirically, we did not find such a truncation to affect the performance of the model. The differentiable mapping $f(d_{ij})$ in Eq.(\ref{eq:msg}) is chosen to be the Lorentzian bell function as in Ref.~\cite{LGN}. For all models, the latent space contains only $\tau_{(0,0)} = 1$ complex Lorentz scalar, as increasing this does not improve the performance in either reconstruction or anomaly detection. \subsection{GNNAE} The GNNAE is constructed from fully-connected MPNNs. The update rule in the $(t+1)$-th MPNN layer is based on Ref.~\cite{Raghav_GAN}, and given by \begin{align} m_i^{(t)} & = \sum_{j=1}^n f_e^{(t)}\left( x_i^{(t)} \oplus x_j^{(t)} \oplus d\left(x_i^{(t)}, x_j^{(t)}\right) \right), \label{eq:gnnae-m} \\ x_i^{(t+1)} & = f_n^{(t)} \left( x_i^{(t)} \oplus m_i^{(t)} \right), \label{eq:gnnae-x} \end{align} where $x_i^{(t)}$ is the node embedding of node $i$ at $t$-th iteration, $d$ is any distance function (Euclidean norm in our case), $m_i^{(t)}$ is the message for updating node embedding in node $i$, $f_e^{(t+1)}$ and $f_n^{(t+1)}$ are any learnable mapping at the current MP layer. A diagram for an MPNN layer is shown in Fig.~\ref{fig:gnn-message-passing}. The overall architecture is similar to that in Fig.~\ref{fig:architecture-full}, with the LMP replaced by the MPNN. The code for the GNNAE model can be found in the Ref.~\cite{zichun_hao_2022_7434799}. \begin{figure}[htpb] \centering \includegraphics[scale=0.55]{figures/architectures/GNNAE-MPNN.pdf} \caption{An MPNN layer in the GNNAE. Here, $\mathrm{EdgeNet}$ and $\mathrm{NodeNet}$ are feed-forward neural networks.} \label{fig:gnn-message-passing} \end{figure} For both the encoder and decoder, there are $3$ MPNN layers. The learnable functions in each layer are optimized to be \begin{equation} \begin{split} f_n^{(1)} &= ( \mathrm{LeakyReLU}_{0.2} \circ \mathrm{Linear}_{30\to 15}) \\ &\quad \circ (\mathrm{LeakyReLU}_{0.2} \circ \mathrm{Linear}_{60\to 30}) \\ f_e^{(1)} &= (\mathrm{LeakyReLU}_{0.2} \circ \mathrm{Linear}_{40\to 30}), \\ &\quad \circ (\mathrm{LeakyReLU}_{0.2} \circ \mathrm{Linear}_{50\to 40}) \\ &\quad \circ (\mathrm{LeakyReLU}_{0.2} \circ \mathrm{Linear}_{61\to 50}), \end{split} \end{equation} \begin{equation} \begin{split} f_n^{(2)} &= ( \mathrm{LeakyReLU}_{0.2} \circ \mathrm{Linear}_{15\to 8}) \\ &\quad \circ (\mathrm{LeakyReLU}_{0.2} \circ \mathrm{Linear}_{45\to 15}) \\ f_e^{(2)} &= (\mathrm{LeakyReLU}_{0.2} \circ \mathrm{Linear}_{31\to 30}), \\ &\quad \circ (\mathrm{LeakyReLU}_{0.2} \circ \mathrm{Linear}_{30\to 30}) \\ &\quad \circ (\mathrm{LeakyReLU}_{0.2} \circ \mathrm{Linear}_{30\to 30}), \end{split} \end{equation} \begin{equation} \begin{split} f_n^{(3)} &= ( \mathrm{LeakyReLU}_{0.2} \circ \mathrm{Linear}_{8 \to \delta}) \\ &\quad \circ (\mathrm{LeakyReLU}_{0.2} \circ \mathrm{Linear}_{38\to 8}) \\ f_e^{(3)} &= (\mathrm{LeakyReLU}_{0.2} \circ \mathrm{Linear}_{20\to 30}), \\ &\quad \circ (\mathrm{LeakyReLU}_{0.2} \circ \mathrm{Linear}_{16\to 20}) \\ &\quad \circ (\mathrm{LeakyReLU}_{0.2} \circ \mathrm{Linear}_{17\to 16}), \end{split} \end{equation} where $\mathrm{LeakyRelu}_{0.2}(x) = \max(0.2 x, x)$ is the LeakyReLu function. Depending on the aggregation layer, the value of $\delta$ in $f_n^{(3)}$ and the final aggregation layer is different. For GNNAE-JL encoders, $\delta = N \times \dim(L)$, where $L$ is the latent space, and $N$ is the number of nodes in the graph. Then, mean aggregation is done across the graph. For GNNAE-PL encoders, $\delta = d$, where $d$ is the node dimension in the latent space. In the GNNAE-JL decoder, the input layer is a linear layer that recovers the particle cloud structure similar to that in the LGAE. \section{Covariance Tests} \label{app:covariancetests} We test the covariance of the LGAE models to Lorentz transformations and find they are indeed equivariant up to numerical errors. Bogatskiy et al.\ point out that equivariance to boosts in particular is sensitive to numerical precision~\cite{LGN}, so we use double precision (64-bit) throughout the model. In addition, we scale down the data by a factor of 1,000 (i.e. working in the units of PeV) for better numerical precision at high boosts. For a given transformation $\Lambda \in \mathrm{SO}^+(3,1)$ we compare $\Lambda \cdot \mathrm{LGAE}(p)$ and $ \mathrm{LGAE}(\Lambda \cdot p)$ are compared, where $p$ is the particle-level 4-momentum. The relative deviation is defined as \begin{equation} \label{eq:delta-p} \delta_p(\Lambda) = \left|\frac{ \mathrm{mean}(\mathrm{LGAE}(\Lambda \cdot p)) - \mathrm{mean}(\Lambda \cdot \mathrm{LGAE}(p)) }{\mathrm{mean}(\Lambda \cdot \mathrm{LGAE}(p))}\right| \end{equation} Figure~\ref{fig:equivariance} shows the mean relative deviation, averaged over each particle in each jet, over $3000$ jets from our test dataset in rotation and boost equivariance test. We find the relative deviation from boosts to be within $\order{10^{-3}}$ in the interval $\gamma \in [0, \cosh(10)]$ (equivalent to $\beta \in [0, 1 - 4\times10^{-9}$]) and from rotations to be $<10^{12}$. \begin{figure}[ht] \centering \includegraphics[width=\linewidth]{figures/covariance/equivariance-p4.pdf} \caption{The relative deviations, as defined in Eq.~(\ref{eq:delta-p}), of the output 4-momenta $p^\mu$ to boosts along the $z$-axis (left) and rotations around the $z$-axis (right).} \label{fig:equivariance} \end{figure} \subsection{LMP \label{sec:lmp}} LMP layers are a form of message-passing neural network~\cite{Gilmer-GNN} layers, but based on the LGN framework in Ref.~\cite{LGN}. The input to each LMP layer is a fully-connected graph with nodes representing particles and the Minkowski distance between respective node 4-vectors as edge features. Each node $\mathcal{F}_i$ is defined by its features, all transforming under a corresponding irrep of the Lorentz group in the canonical basis~\cite{gelfand1963}, including at least one 4-vector (transforming under the $(1/2, 1/2)$ representation) representing its 4-momentum. The $(t+1)$-th MP layer operation consists of message-passing between each pair of nodes, with a message $m_{i j}^{(t)}$ to node $i$ from node $j$ (where $j \neq i$) and a self-interaction term $m_{ii}$ defined as \begin{align} \label{eq:msg} m_{i j}^{(t)} &= f\left( \left(p_{ij}^{(t)}\right)^2 \right) p_{ij}^{(t)} \otimes \mathcal{F}_j^{(t)} \\ m_{i i}^{(t)} &= \mathcal{F}_i^{(t)} \otimes \mathcal{F}_i^{(t)} \end{align} where $\mathcal{F}_{i}^{(t)}$ are the node features before the $(t+1)$-th layer, $p_{ij} = p_i - p_j$ is the difference between node four-vectors, $p_{ij}^2$ is the squared Minkowski norm of $p_{i j}$, and $f$ is a learnable, differentiable function acting on Lorentz scalars. A Clebsch--Gordan (CG) decomposition, which reduces the features to direct sums of irreps of $\mathrm{SO}^+(3,1)$, is performed on both terms before concatenating them to produce the message $m_i$ for node $i$: \begin{equation} m_i^{(t)} = \mathrm{CG}\left[ m_{i i}^{(t)} \right] \oplus \mathrm{CG}\left[ \sum_{j\neq i} m_{i j}^{(t)} \right]. \end{equation} Finally, this aggregated message is used to update each node's features, such that \begin{equation} \label{eq:update} \mathcal{F}_i^{(t+1)} = W \left( \mathcal{F}_i^{(t)} \oplus m_i^{(t)} \right) \end{equation} for all $i \in \{1, \ldots, N_\mathrm{particle}\}$, where $W$ is a node-wise operator with learnable parameters which linearly mixes features in the same representation space to the desired multiplicity. As in Ref~\cite{LGN}, we use $\tau_{(m,n)}^{(t)}$ to denote the multiplicity of the $(m,n)$ representation in each node at the $t$-th LMP layer. In practice, we truncate the output irreps to a maximum dimension to make computations more tractable. \subsection{Encoder \label{sec:lgaee}} The encoder takes as input a point cloud of $N$ particles, termed a ``particle cloud'', each associated with a 4-momentum vector and an arbitrary number of scalars representing physical features such as mass, charge, and spin. Each isotypic component is then mixed via learned weights, to a chosen multiplicity of $\parenthesis{\tau_{(m, n)}^{(0)}}_\mathrm{E}$. The resultant graph is then processed through $N_{\mathrm{MP}}^\mathrm{E}$ LMP layers, specified by a sequence of multiplicities $\left\{ \parenthesis{\tau_{(m, n)}^{(t)}}_\mathrm{E} \right\}_{t=1}^{N_{\mathrm{MP}}^\mathrm{E}}$, where $\parenthesis{\tau_{(m, n)}^{(t)}}_\mathrm{E}$ is the multiplicity of the $(m, n)$ representation at the $t$-th layer. Weights are shared across the nodes in a layer to ensure permutation equivariance. After the final MP layer, node features are aggregated to the latent space by a component-wise minimum (min), maximum (max), or mean. The min and max operations are performed on the respective Lorentz invariants. We also find, empirically, interesting performance by simply concatenating isotypic components across each particle and linearly ``mixing" them via a learned matrix as in Eq.~(\ref{eq:update}), which thereby breaks the permutation symmetry. \subsection{Decoder \label{sec:lgaed}} The decoder recovers the $N$-particle cloud by acting on the latent space with $N$ independent, learned linear operators, which again mix components living in the same representations. This cloud passes through $N_{\mathrm{MP}}^\mathrm{D}$ LMP layers, specified by a sequence of multiplicities $\left\{ \parenthesis{\tau_{(m, n)}^{(t)}}_\mathrm{D} \right\}_{t=1}^{N_{\mathrm{MP}}^\mathrm{D}}$, where $\parenthesis{\tau_{(m, n)}^{(t)}}_\mathrm{D}$ is the multiplicity of the $(m, n)$ representation at the $t$-th LMP layer. After the LMP layers, node features are mixed back to the input representation space $\parenthesis{D^{(0,0)}}^{\oplus \tau_{(0,0)}^{(0)}} \oplus D^{(1/2, 1/2)}$ by applying a linear mixing layer and then truncating other isotypic components.
\section{Introduction} Black strings and black branes can be defined as black hole spacetimes with horizons that have extended directions, which in the simplest case are planar \cite{Horowitz-book}. These spacetimes have a very interesting dynamics, since in general they suffer from the Gregory-Laflamme (GL) instability \cite{GL1, GL2} , which is triggered by a gravitational perturbation travelling along an extended direction with a wavelength above a given critical value. In a remarkable series of works \cite{Lehner-Pretorius-1, Lehner-Pretorius-2, Lehner-Pretorius-3}, the authors were able to find strong numerical evidence in favour of the pinching-off of the horizons of black strings in a finite time. This phenomenon is compatible with the previous no-go results by Horowitz and Maeda \cite{Horowitz-Maeda}, since it refers to a finite value of the time for asymptotic observers, providing an example of violation of cosmic censorship in dimension five for generic initial data. This result has been recently confirmed in \cite{Figueras-Andrade-reciente}, where the authors were able to numerically evolve the spacetime closer to the pinch-off, and provide evidence of a non-geometric progression for the time intervals of the appearance of new generations of black holes connected by black strings. The non-linear evolution of the system was also addressed in the context of the Large-D expansion of General Relativity (GR) \cite{Emparan-Suzuki-Tanabe-1, Emparan-Suzuki-Tanabe-2, Emparan-Suzuki-Tanabe-3}, giving rise to a non-uniform black string as the final configuration after the GL instability is triggered, which is consistent with the existence of a critical dimension obtained by Sorkin in \cite{Sorkin-criticalD}. In references \cite{Wiseman-numerics-black-string, Gubser-NUBS} non-uniform black strings were constructed numerically and perturbatively, and in \cite{Figueras-Kun-1, Figueras-Kun-2, Figueras-Kun-3, Andrade-Fig} new numerical simulations of the fully non-linear Einstein equations provide evidence of violations of cosmic censorship triggered by GL instabilities for asymptotically Minkowski spacetimes. As the black string evolves, regions with higher curvature will be exposed, and it is natural to expect that higher curvature corrections to gravity may play a role. Remarkably, in the recent paper \cite{Reall-Kovacs-Stronghyperbolicity} a new gauge was found for initial value problem in Einstein-Gauss-Bonnet gravity, which leads to a strongly hyperbolic system for bounded curvatures. This may allow to evolve the black string in the presence of higher curvature terms, and study their effect on the dynamics of the system. In this paper we study the black string instability spectrum of backgrounds that are corrected at leading order in the Gauss-Bonnet parameter. This precise $R^{2}$ correction can be obtained from string theory as an expansion on the string tension. In such a framework, in order to construct solutions and study their stability beyond linear order in $\alpha$ in a consistent manner, one would have to consider higher powers of the curvature as corrections, therefore if one insists in interpreting our results as string theory corrections to the GL instability one can not go beyond linear terms in $\alpha$, having always in mind that one is indeed working in an effective field theory setup. As mentioned below, this also affects the regime of validity of the gravitational perturbation. We also construct the boosted black string of this theory and obtain the first order corrections in $\alpha$ to the energy, momentum, entropy, temperature and tension. \section{The corrected, static, black string} We will consider the Einstein-Gauss-Bonnet action \cite{Lovelock-original} \begin{equation} I\left[ g\right] =\int d^{5}x\sqrt{-g}\left( R+\alpha\left( R_{ABCD}% R^{ABCD}-4R_{AB}R^{AB}+R^{2}\right) \right) +O\left( \alpha^{2}\right) \ .\label{action}% \end{equation} as an effective field theory, to first order in the coupling $\alpha$, which has mass dimension $-2$. We start by re-obtaining the closed form static black string solutions, which were originally obtained in \cite{Brihaye-Delsate-Radu-BS-EGB} to first order in $\alpha$. Additionally, we provide thermodynamic quantities associated to this spacetime. Let us consider a black string ansatz in dimension five, in the field equations of the theory defined by (\ref{action}): \begin{equation}\label{metricstring} ds^{2}=-f\left( r\right) dt^{2}+\frac{dr^{2}}{g\left( r\right) }% +r^{2}d\sigma^2+b\left( r\right) dz^{2}\ , \end{equation} where $d\sigma$ is the line element of a two-sphere. We assume that the metric functions $X=\left\{ f,g,b\right\} $ are analytic in $\alpha=0$, therefore they can be expanded as $X=X_{0}+\alpha X_{1}+\mathcal{O}\left( \alpha^{2}\right) $. The introduction of a dimensionful scale $\alpha$ forces us to consider a non-constant warp factor, $b\left( r\right) $ \cite{Giribet-Oliva-Troncoso, Kastor-Mann}. Dropping terms $\mathcal{O}\left( \alpha^{2}\right) $, the system of equations for the functions $X_{0}$ and $X_{1}$ can be integrated in a closed manner. The general solution involves four new integration constants on top the integration constant of the $X_{0}$ functions, namely the mass parameter of the GR solution, as well as logarithmic terms in the radial coordinate. Using the freedom under coordinate transformations, the perturbative scheme in $\alpha$ and requiring the $\alpha$-corrected spacetime to have an event horizon leads to the following expressions in terms of the radius of the horizon $r_{+}$:% \begin{align}\label{bs5df} f\left( r\right) &=f_5\left( r\right) =1-\frac{r_{+}}{r}-\frac{\left( r-r_{+}\right) \left( 6r_{+}^{2}+11rr_{+}+23r^{2}\right) }{9r_{+}r^{4}}\alpha+O\left( \alpha^{2}\right) \ ,\\\label{bs5dg} g\left( r\right) & =g_5\left( r\right) =1-\frac{r_{+}}{r}+\frac{\left( r-r_{+}\right) \left( r+5r_{+}\right) \left( r+2r_{+}\right) }{9r_{+}r^{4}}% \alpha+O\left( \alpha^{2}\right) \ ,\\\label{bs5db} b\left( r\right) &= b_5\left( r\right) =1+\frac{4\left( 6r^{2}+3rr_{+}+2r_{+}^{2}\right) }{9r_{+}r^{3}}\alpha+O\left( \alpha^{2}\right) \ , \end{align} The temperature, mass and entropy of this black string are respectively given by \begin{align} T&=\frac{1}{4\pi r_+}-\frac{11}{36\pi r_+^3}\alpha+\mathcal{O}\left(\alpha^2\right) \ , \\ M&=8\pi r_{+}L_{z}+\frac{88\pi}{9r_{+}}L_{z}\alpha+\mathcal{O}\left( \alpha^{2}\right)\ , \\ S&=16 \pi^2 r_+^2 L_z+\frac{928 \pi^2}{9}L_z \alpha+\mathcal{O}\left( \alpha^{2}\right) \, \end{align} where the former was computed from the surface gravity in Eddington-Finkelstein-like coordinates, and the latter two were computed using the Iyer-Wald method \cite{Iyer-Wald-1, Iyer-Wald-2}. These expressions fulfil the first law of black hole thermodynamics \begin{equation} dM=TdS\ , \end{equation} disregarding quadratic terms in $\alpha$. Here, $L_z$ is the length of the extended direction with coordinate $z$. Notice that both the correction to the mass and entropy are positive. \section{The perturbation} The generalized Lichnerowicz operator, namely, the linearized field equations around a generic background $\mathring{g}_{\mu\nu}$, read \begin{eqnarray} &&0=\frac{1}{2}\left( -\delta _{\mu }^{\rho }\delta _{\nu }^{\lambda }\mathring\square +2\mathring{R}_{\ \mu \nu }^{\rho \ \ \lambda }+\mathring{g_{\mu \nu }}\mathring{R}^{\rho \lambda }+4\mathring{g}^{\lambda \eta }\mathring{G}_{\eta (\mu }\delta _{\nu )}^{\rho }\right) h_{\rho \lambda }-2\alpha \mathring{R}_{\mu \xi \lambda \nu }\mathring{\square} h^{\lambda \xi } \notag \\ &&+\alpha \left( -\mathring{R}_{\ \ \ \ \ \lambda }^{\rho \eta \sigma }% \mathring{R}_{\xi \sigma \rho \eta }\mathring{g}_{\mu \nu }-2\mathring{R}_{\ \ \ \lambda \nu }^{\sigma \rho }\mathring{R}_{\sigma \rho \xi \mu }+4% \mathring{R}_{\mu \ \ \nu }^{\ \rho \sigma }\mathring{R}_{\lambda \rho \sigma \xi }+4\mathring{R}_{\mu \rho \lambda \sigma }\mathring{R}_{\nu \ \ \ \xi }^{\ \sigma \rho }\right) h^{\lambda \xi } \notag \\ &&+\alpha \left( 4\mathring{g}_{\lambda (\mu }\mathring{R}_{\nu )\rho \sigma \xi }\mathring{\nabla}^{\sigma }\mathring{\nabla}^{\rho }h^{\lambda \xi }+4% \mathring{\nabla}^{\sigma }\mathring{\nabla}_{(\mu }h^{\xi \lambda }% \mathring{R}_{\nu )\xi \lambda \sigma }-2\mathring{g}_{\mu \nu }\mathring{R}% _{\ \lambda \xi \eta }^{\rho }\mathring{\nabla}_{\rho }\mathring{\nabla}% ^{\eta }h^{\lambda \xi }\right)+\mathcal{O}\left(\alpha^2\right) \ , \notag \end{eqnarray} where we have imposed transversality and tracelessness of the perturbation, i.e. $\mathring\nabla_{\mu}h^{\mu\nu}=0$ and $h_{\mu}^{\ \ \mu}=0$. We have also used the vacuum field equations, which allow to write the Ricci tensor and Ricci scalar in terms of an expression that is linear in $\alpha$, that can be used in the linearization of the Gauss-Bonnet tensor to write every Ricci tensor and Ricci scalar in terms of the Riemann tensor plus $\mathcal{O}\left(\alpha^2\right)$ terms. \textbf{On the regime of validity of the perturbation:} The black string is parameterized by the coordinates $(t,r,x^i,z)$, where the $x^i$ collectively denote the coordinates on a round sphere. We will focus on the s-wave, scalar mode, which is the responsible for the GL instability in GR. Therefore the metric perturbation that we are considering reads \begin{equation} h_{AB}=\varepsilon e^{\Omega t}e^{ikz}\left( \begin{array} [c]{cccc}% H_{tt}\left( r\right) & H_{tr}\left( r\right) & 0 & 0\\ H_{tr}\left( r\right) & H_{rr}\left( r\right) & 0 & 0\\ 0 & 0 & H\left( r\right) \sigma_{ij} & 0\\ 0 & 0 & 0 & 0 \end{array} \right)\sim e^{\Omega t}e^{i k z}H_{\mu\nu}(r) \ ,\label{perturbationstring}% \end{equation} with $\varepsilon<<1$ and where $\sigma_{ij}$ denotes the metric on the sphere. Schematically, when evaluated on the perturbation, the bulk Lagrangian will have the form \begin{align} R+\alpha R^2 &\sim \text{Background}+\partial h \partial h +\alpha \left(\partial h\partial h\right)^2+\mathcal{O}\left(\alpha^2\right) \ . \end{align} Due to the separation in modes, the terms $\partial h \partial h +\alpha \left(\partial h\partial h\right)^2$ will contain the following contributions \begin{align} T_1&=k^2+\alpha k^4+ \mathcal{O}\left(\alpha^2\right)\ , \\ T_2&=\Omega^2+\alpha \Omega^4 +\mathcal{O}\left(\alpha^2\right)\ , \end{align} from the derivatives with respect to $z$ and to $t$, respectively. In consequence, in order to ensure the validity of the perturbative approach, we impose \begin{align} \alpha k^2<<1\ \text{and} \ \alpha \Omega^2<<1\ , \end{align} namely, a sufficient condition for the validity of dropping-off terms $\mathcal{O}\left(\alpha^2\right)$, is to keep attention on the modes with small $k$ and small $\Omega$ as compared with $\alpha^{-1/2}$. We are interested in the existence and behavior of unstable modes, therefore, for a given $k$, after imposing the boundary conditions for the perturbations, we look for positive values of $\Omega$ that may allow to connect the regular asymptotic behavior of the perturbation both at the horizon and infinity. As in GR, the dynamics of the scalar mode, defined by the functions $\left\{ H_{tt},H_{tr},H_{rr},H\right\} $ is completely controlled by the master variable $H_{tr}\left( r\right) $, and the remaining functions are given in terms of the master variable and its derivatives. The second order, linear, homogeneous ODE for $H_{tr}\left( r\right) $ has the form% \begin{equation} A\left( r;\alpha\right) \frac{d^{2}H_{tr}}{dr^{2}}+B\left( r;\alpha\right) \frac{dH_{tr}}{dr}+C\left( r;\alpha\right) H_{tr}=0\ ,\label{ecuHtr}% \end{equation} where the coefficients depend on $r$ and are linear in $\alpha$, which is consistent with the perturbative approach we are considering. We do not provide the explicit expression for the coefficients since they are not illuminating. The asymptotic expansions of (\ref{ecuHtr}) near the horizon and infinity lead to% \begin{align} H_{tr}\left( r\right) &\sim\left( r-r_{+}\right) ^{-1\pm\Omega\left( r_{+}+\frac{11\alpha}{9r_{+}}+\mathcal{O}\left( \alpha^{2}\right) \right) }\left( 1+O\left(r-r_+\right) \right) \ , \\ H_{tr}\left( r\right) & \sim\frac{e^{\pm r \sqrt{\Omega^{2}+k^{2}}}}% {r^{\xi_{\pm}}}\left( 1+O\left(r^{-1}\right) \right), \end{align} where $\xi_{\pm}$ are constants which are not-relevant for recognizing the regular asymptotic behavior, dominated by the exponential growing/suppression. In consequence, we choose the $\left( +\right) $-branches in the near horizon expansion and the $\left( -\right) $-branches as $r$ goes to infinity. In order to find the spectrum, we proceed as follows: we introduce the function $F\left( r\right) $ such that \begin{align} H_{tr}\left( r\right) &=\left( r-r_{+}\right) ^{-1+\Omega\left( r_{+}+\frac{11\alpha}{9r_{+}}+\mathcal{O}\left( \alpha^{2}\right) \right) }F\left( r\right) \ , \end{align} and rewrite the equation for $F\left( r\right) $ in terms of the coordinate $x$ such that $r=r_{+}/\left( 1-x\right) $ which maps $r\in]r_{+},+\infty \lbrack$ to $x\in]0,1[$. Then, we select the regular branch at the horizon by assuming that $F\left( x\right) $ has a Taylor expansion around $x=0$. We therefore define the truncated series as% \begin{equation}\label{truncated} F_{N}\left( x\right) =1+\sum_{j=1}^{N}a_{j}\left( k,r_{+},\Omega, \alpha\right) x^{j}\ , \end{equation} and solve the equation, near the horizon ($x\rightarrow0$) for the coefficients $a_{j}$. For a given wavenumber $k$, horizon radius $r_{+}$ and value of the coupling $\alpha$, the frequencies are obtained by setting $F_{N}\left(1\right)=0$, for a large enough $N$, such that a notion of numerical stability for the frequency $\Omega$ is attained. Actually, one can introduce the dimensionless quantities $\hat{\Omega}=r_+\Omega$ and $\hat{k}=r_+ k$ and observe that \eqref{truncated} depends only on the pair $(\hat{k},\hat{\Omega})$ and the dimensionless ratio $\alpha/r_+^2$. We have also used shooting to validate our numerical results. \begin{figure}[htb] \begin{center} \includegraphics[scale=0.8]{spectra} \caption{Spectra of the perturbation for different values of the $\alpha$ correction, and $r_+$=1.} \end{center} \end{figure} Figure 1 depicts the spectrum of the scalar perturbation in GR (red lines), as well as its correction for different values of the coupling $\alpha$. Aside from the unstable modes, with positive $\Omega$, we also depict a second stable mode with $\Omega<0$, which is present in GR and corrected due to the presence of the perturbative Gauss-Bonnet term. Our numerical resolution is not enough to discriminate the behavior of the corrected spectrum for $k\sim 0$, which may be attained for analytic treatment if one generalizes the approach of the AdS/Ricci-flat correspondence of \cite{ads-rflat} to the presence of higher curvature terms. It is interesting to notice that the critical value of $k_c$ that may trigger the GL instability grows with the value of the Gauss-Bonnet coupling, namely the region of instability grows as the GB coupling is turned on, which can be seen in more detail in Figure 2. \begin{figure}[htb] \begin{center} \includegraphics[scale=0.49]{critical}\quad\includegraphics[scale=0.49]{kcdealpha} \caption{Behavior of the critical wavelength that triggers the black string instability on the scalar mode, as a function of the $\alpha$ correction, and $r_+$=1.} \end{center} \end{figure} \section{The $\alpha$-corrected, boosted black string} A boosted black string, with momentum along the $z$ direction, can be obtained by applying the transformation% \begin{equation}\label{boost} t\rightarrow\cosh\beta t+\sinh\beta z\text{ and }z\rightarrow\cosh\beta z+\sinh\beta t\ , \end{equation} to the metric \eqref{metricstring}. This transformation corresponds to a boost with rapidity $v=-\tanh\beta$, and it generates non-vanishing momentum along the $z$ direction, which can be checked by computing the corresponding, $\alpha$-corrected ADM momentum, as in GR \cite{Myers-Hovdebo-boosted-bs}. Since the new configuration is characterized by a different set of global charges, it corresponds to a physically different state in the phase space of the theory in spite of being generated from the static solution \eqref{metricstring} by a simple boost \eqref{boost}. Then, the $\alpha $-corrected, boosted black string is \begin{equation}\label{boosted} ds_{\text{boosted}}^{2}=-b\left( r\right) dt^{2}+\frac{dr^{2}}{g\left( r\right) }+r^{2}d\sigma^{2}+b\left( r\right) dz^{2}+\left( b\left( r\right) -f\left( r\right) \right) \cosh^{2}\beta\left( dt+\tanh\beta dz\right) ^{2}\ . \end{equation} Notice that the solution is asymptotically flat on a static frame, since given $b,f$ and $g$ of equations \eqref{bs5df}-\eqref{bs5db}, the $g_{tz}$ component of the metric \eqref{boosted} vanishes as $r\rightarrow+\infty$. Again, using the Iyer-Wald method, one can obtain the energy and the momentum of these $\alpha$-corrected, boosted black strings, as conserved charges associated to the Killing vectors $\partial_{t}$ and $\partial_{z}$, respectively. This yields \begin{align} Q\left( \partial_{t}\right) & =E=4\pi r_{+}\left( \cosh^{2}% \beta+1\right) L_{z}+\frac{4\pi}{9r_{+}}\left( 47\cosh^{2}\beta-25\right) L_{z}\alpha+\mathcal{O}\left( \alpha^{2}\right) \ ,\\ Q\left( \partial_{z}\right) & =P=-4\pi r_{+}\cosh\beta\sinh\beta L_{z}% -\frac{188\pi}{9r_{+}}\cosh\beta\sinh\beta L_{z}\alpha+\mathcal{O}\left( \alpha^{2}\right) \ . \end{align} Going to Eddington-Finkelstein-like coordinates, one computes the surface gravity of the boosted black string, which leads to the following expression for the temperature \begin{equation} T=\frac{1}{4\pi r_+\cosh{\beta}}-\frac{11}{36\pi r_+^3\cosh{\beta}}\alpha+\mathcal{O}\left( \alpha^{2}\right)\ . \end{equation} The entropy of the configuration is given by the Iyer-Wald formula \begin{equation} S=\frac{1}{T}\int_{\mathcal{H}_+} \mathbf{Q}[\xi] \, , \end{equation} where $\xi$ is the horizon generator. As expected, the expression for $\xi$ leads to the horizon velocity $v_h=-\tanh{\beta}$, and the entropy takes the form \begin{equation} S=\cosh\beta\left(16 \pi^2 r_+^2 L_z+\frac{928 \pi^2}{9}L_z \alpha\right)+\mathcal{O}\left( \alpha^{2}\right) \, . \end{equation} As before, one recovers the GR expression of reference \cite{Myers-Hovdebo-boosted-bs} when $\alpha$ goes to zero. For black strings of a fixed length, the first law is fulfilled, namely \begin{equation} dM=TdS+v_hdP \ , \end{equation} disregarding terms $\mathcal{O}\left( \alpha^{2}\right)$. On a more general ensemble, one can also consider variations of $L_z$, as in \cite{Myers-Hovdebo-boosted-bs}. This leads to an extra work term in the first law, with the tension $\hat{\mathcal{T}}$ as the variable conjugate to $L_z$. In this case, the first law takes the form \begin{equation} dM=TdS+v_hdP+\hat{\mathcal{T}}dL_z \ , \end{equation} where the tension acquires a correction with respect to that of black strings in GR, namely \begin{equation} \hat{\mathcal{T}}=4\pi r_+-\frac{100\pi}{9r_+}\alpha+\mathcal{O}\left( \alpha^{2}\right). \end{equation} It is very interesting to notice that in contra-position to what occurs for boosted black strings in GR \cite{Kastor-Ray}, the inclusion of the higher curvature correction $\alpha$, spoils the validity of an standard Smarr Law, namely $2M$ is different from $3TS+\hat{\mathcal{T}}L_z+2v_hP$. As in the presence of a cosmological constant \cite{Kastor-Ray-first-law-boosted-BH, Dolan-BH-eqofstate-cosmoconstant}, one can restore the validity of a relation between finite thermodynamics quantities, i.e. the validity of the Euler relation of thermodynamics for a homogeneous system, by including in the first law a work term proportional to variations of the dimensionfull coupling constant $\alpha$. This approach leads to \begin{equation} dM=TdS+v_hdP+\hat{\mathcal{T}}dL_z+\mu_\alpha d\alpha \ , \end{equation} with $\mu$ being the canonical conjugate of $\alpha$ and is defined as \begin{equation} \mu_\alpha=\frac{\partial M(S,P,L_z,\alpha)}{\partial\alpha}=-\frac{16 L_z\pi}{r_+} \ . \end{equation} With these expressions at hand, for the boosted black string characterized by the parameters $v_h$ and $r_+$, it is direct to prove the following Smarr-like formula \begin{equation} 2M=3TS+\hat{\mathcal{T}}L_z+2v_hP+2\mu_\alpha \alpha \ , \end{equation} which can also be obtained on dimensional grounds by a scaling argument. It would be interesting to have a physical understanding of the latter work term, which must be present if one insists on the validity of an Euler-like relation within this setup, and to explore its effect on the possible phase transitions that may be triggered by this new term. Notice also that the correction to the mass and the entropy are positive, while the contribution of the $\alpha$ term to the momentum of the boosted black string has the same sign as the uncorrected value\footnote{See the recent \cite{Newpapers-2-higherderivatvecorrectionstothermoofblackbranes, Newpapers-3-BHentropycorrectedfromstrings} for a string theory setup that leads to negative contributions to the entropy, due to $\alpha'$ corrections at fixed global charges, for black strings and black branes. This is in tension with standard expectations from the weak gravity conjecture.}. \section{Further remarks} In this paper, we computed the effect of the Gauss-Bonnet term on the spectrum of the scalar mode that triggers the GL instability in a regime in which the Gauss-Bonnet coupling can be treated as a perturbation, which is necessary if we want to interpret this $R^2$ term as a higher curvature correction coming from string theory. Recently, the static, spherically symmetric black hole solution of this setup was obtained for arbitrary dimensions including the dilaton in a frame that leads to second order field equations \cite{Agurto-Oliva-alpha} (see also \cite{Callan-Myers-bhs-in-st} for the original computation on the frame leading to fourth order field equations). Furthermore, the mentioned second order frame \cite{Maeda-Field-Redef} allowed to identify the four-dimensional, rotating solution containing terms of order $\alpha,\ a, \ a^2$ and $\alpha a$. It would be interesting to explore effects of the rotation of the four-dimensional metric on the black string and evaluate the interplay between the superradiant instability and the GL instability as in \cite{Newpapers-superradiance-1, Newpapers-0-superradiance}. The presence of $a^2$ terms of the perturbative solution constructed in \cite{Agurto-Oliva-alpha} allows the existence of an ergoregion and therefore a potential superradiant behavior. As with the dilaton, it is also known that the presence of fluxes and scalars with non-minimal couplings, permits the construction of closed form solutions of homogeneous black strings and black branes in presence of higher curvature terms \cite{Cisterna-Oliva-Fuenzalida-2, Cisterna-Mora-1-BSs-in-Lovelock, Cisterna-and-beyond, Cisterna-Corral-del-Pino-5}. The effect of such terms on the GL instability still remains an open problem, but it is important to mention that some of the field theories that involve non-minimally coupled scalar fields may also admit strongly hyperbolic formulations as shown in \cite{Reall-Kovacs-Stronghyperbolicity}. As a simplified setup to evaluate the effect of the higher curvature corrections, one can consider the regime in which the higher curvature terms completely dominate over GR terms, which may be consistent if one goes beyond the perturbative regime. This approach was considered in pure $R^2$ \cite{Giacomini-1, Giacomini-3} and pure $R^3$ \cite{Giacomini-2} Lovelock theories, exploiting the fact that these theories admit exact, homogeneous black strings \cite{Giribet-Oliva-Troncoso, Kastor-Mann}. In these works it was shown that the GL instability persists, but in this regime the region of instability shrinks as one goes from $R$ to $R^2$ and then to the $R^3$ theory. Recently, in the context of the Large-D expansion, these results were recovered analytically for the $R^2$ case \cite{Newpapers-4-PhasesofBSatlargeD} and also by the inclusion NLO terms in the $1/D$ correction it was shown that the critical dimension increases with the value of the coupling (see also \cite{Suzuki-2}). Finally, it is important to mention that in the context of M-theory, still at a perturbative level, the authors of \cite{Hyakutake-M} considered the $R^4$ correction in the analysis of the thermodynamic analogue of the GL instability of boosted black strings. More recently, the authors of \cite{Newpapers-1-newBSwithapcorrections} showed that the singularity of a two-dimensional black hole can be smoothed out by using a recent classification of the higher curvature corrections from a Bottom-Up approach via T-duality \cite{Hohm-zwie-1, Hohm-zwie-2, Hohm-zwie-3}. Furthermore, they elaborated on the regularity of the corresponding black string constructed out from this black hole. This setup is simple enough as to study the dynamics of black strings in three dimensions, considering higher curvature corrections of arbitrary high power. \begin{acknowledgments} We thank Tomás Andrade, Adolfo Cisterna, Nicolás Grandi, Gaston Giribet, Rodrigo Olea and Ricardo Stuardo for useful discussions and insight. C. H. is partially funded by the National Agency for Research and Development ANID - PAI Grant No. 77190078 and also thanks the support of FONDECYT Grant No. 1181047. J.O. is partially supported by FONDECYT grants 1221504 and 1210635 and by Proyecto de cooperaci\'{o}n internacional 2019/13231-7 FAPESP/ANID. The work of M.O. is partially funded by Beca ANID de Doctorado 21222264. \end{acknowledgments}
\section{Method}\label{sec:method} In this section, we specify the post-hoc uncertainty learning framework defined in Problem~\ref{prob:general}. First, we introduce the structure of the meta-model. Next, we discuss the meta-model training procedure, including the training objectives and a validation trick. Finally, we define metrics for uncertainty quantification used in different applications. The design of our proposed meta-model method is based on three high-level insights: (1) Different intermediate layers of the base model usually capture various levels of feature representation, from low-level features to high-frequency features, e.g., for OOD detection task, the OOD data is unlikely to be similar to in-distribution data across all levels of feature representations. Therefore, it is crucial to leverage the diversity in feature representations to achieve better uncertainty quantification performance. (2) Bayesian method is known to be capable of modeling different types of uncertainty for various uncertainty quantification applications, i.e., total uncertainty and epistemic uncertainty. Thus, we propose a Bayesian meta-model to parameterize the Dirichlet distribution, used as the conjugate prior distribution over label distribution. (3) We believe that the overconfident issue of the base model is caused by over-fitting in supervised learning with cross-entropy loss. In the post-hoc training of the meta-model, a validation strategy is proposed to improve the performance of uncertain learning instead of prediction accuracy. \begin{figure}[t] \centering \includegraphics[width=1\linewidth]{figures/toy_problem.pdf} \vspace{-0.5em} \captionsetup{font=small} \caption{A toy example of our proposed meta-model method in OOD detection application shows the diversity of features in different layers. MetaModel utilizes two intermediate features, while Layer1 and Layer2 only are trained with one individual feature.} \label{fig: toy_problem} \end{figure} Before discussing the details of our proposed method, we want to use a toy example of the OOD detection task shown in Figure~\ref{fig: toy_problem} to elaborate our insights. The goal is to improve the OOD (FashionMNIST) detection performance of a LeNet base model trained on MNIST. The meta-model takes base-model intermediate feature representation as input and parameterizes a Dirichlet distribution over the probability simplex. We train three different meta-models using both intermediate layer features, using either of the two features, respectively, and then visualize and compare the output Dirichlet distribution on the simplex. Specifically, we take the three dominant classes with the largest logits to approximately visualize the Dirichlet distribution over the probability simplex. We observe that the meta-model outputs a much sharper distribution for the in-distribution sample than the OOD sample. Moreover, compared to the meta-model trained with one feature, the meta-model trained with multiple intermediate layers can further distinguish the two distributions on simplex. They generate sharper distribution for the in-distribution sample while exhibiting a more uniform distribution for the OOD sample, which strongly supports our key claims. \subsection{Meta-Model Structure}\label{subsec: model} The proposed meta-model consists of multiple linear layers $\{{\bm{g}}_j\}_{j=1}^{m}$ attached to different intermediate layers from the base model, and a final linear layer ${\bm{g}}_{c}$ that combines all the features and generates a single output. Specifically, given an input sample ${\bm{x}}$, denote the multiple intermediate feature representation extracted from the base-model as $\{\Phi_j\left({\bm{x}}\right)\}_{j=1}^{m}$. For each intermediate base-feature $\Phi_j$, the corresponding linear layer will construct a low-dimensional meta-feature $\{{\bm{g}}_j\left(\Phi_j\left({\bm{x}}\right)\right)\}_{j=1}^{m}$. Then, the final linear layer of the meta-model takes the multiple meta-features as inputs and generates a single output, i.e., $\tilde{{\bm{y}}} = {\bm{g}}\left(\{\Phi_j\left({\bm{x}}\right)\}_{j=1}^{m}; {\bm{w}}_g\right) = {\bm{g}}_c\left(\{{\bm{g}}_j\left(\Phi_j\left({\bm{x}}\right)\right)\}_{j=1}^{m}; {\bm{w}}_{g_c}\right) $. In practice, the linear layers ${\bm{g}}_{i}$ and ${\bm{g}}_{c}$ only consist of fully connected layers and activation function, which ensures the meta-model has a much simpler structure and enables efficient training. Given an input sample ${\bm{x}}$, the base model outputs a conditional label distribution $P_B\left({\bm{y}} | \Phi({\bm{x}})\right) \in \Delta^{K-1}$, corresponding to a single point in the probability simplex. However, such label distribution $P_B\left({\bm{y}} | \Phi({\bm{x}})\right)$ is a point estimate, which only shows the model's uncertainty about different classes but cannot reflect the uncertainty due to the lack of knowledge of a given sample, i.e., the epistemic uncertainty. To this end, we adopt the Dirichlet technique commonly used in the recent literature~\citep{malinin2018predictive, malinin2019reverse, nandy2020towards, charpentier2020posterior} in order to better quantify the epistemic uncertainty. Let the label distribution as a random variable over probability simplex, denote as $\boldsymbol{\pi} = [\pi_1, \pi_2, ..., \pi_k]$, the Dirichlet prior distribution is the conjugate prior of the categorical distribution, i.e., \begin{equation} \operatorname{Dir}(\boldsymbol{\pi} | \boldsymbol{\alpha}) \triangleq \frac{\Gamma\left(\alpha_{0}\right)}{\prod_{c=1}^{K} \Gamma\left(\alpha_{c}\right)} \prod_{c=1}^{K} \pi_{c}^{\alpha_{c}-1}, \alpha_c>0,\alpha_0 \triangleq \sum_{c=1}^K \alpha_c, \end{equation} Our meta-model ${\bm{g}}$ explicitly parameterize the posterior Dirichlet distribution, i.e, \begin{equation*} q(\boldsymbol{\pi}|\Phi({\bm{x}});{\bm{w}}_g ) \triangleq \operatorname{Dir}(\boldsymbol{\pi} | \boldsymbol{\alpha}({\bm{x}})), \ \boldsymbol{\alpha}({\bm{x}}) = e^{{\bm{g}}\left(\Phi({\bm{x}}); {\bm{w}}_g\right)}, \end{equation*} where the output of our meta-model is $\tilde{{\bm{y}}} = \log{\boldsymbol{\alpha}({\bm{x}})}$, and $\boldsymbol{\alpha}({\bm{x}}) = [\alpha_1({\bm{x}}), \alpha_2({\bm{x}}), ..., \alpha_k({\bm{x}})]$ is the concentration parameter of the Dirichlet distribution given an input ${\bm{x}}$. The overall structure of the meta-model is shown in Figure~\ref{fig: structure}. \begin{figure}[t] \centering \includegraphics[width=1\linewidth]{figures/structure.pdf} \vspace{-0.5em} \captionsetup{font=small} \caption{Meta-Model structure} \label{fig: structure} \end{figure} \subsection{Uncertainty Learning} \paragraph{Training Objective}\label{subsec: objective} From Bayesian perspective, the predicted label distribution using the Dirichlet meta-model is given by the expected categorical distribution: \begin{equation} q(y=c|\Phi({\bm{x}}); {\bm{w}}_g) = \mathbb{E}_{q(\boldsymbol{\pi}|\Phi({\bm{x}}); {\bm{w}}_g)} [P(y=c|\boldsymbol{\pi})] = \frac{\alpha_c({\bm{x}})}{\alpha_0({\bm{x}})}, \end{equation} where $\alpha_0=\sum_{c=1}^K \alpha_c$ is the precision of the Dirichlet distribution. The true posterior of the categorical distribution over sample $({\bm{x}},y)$ is $P(\boldsymbol{\pi}| \Phi({\bm{x}}), y) \propto P(y | \boldsymbol{\pi}, \Phi({\bm{x}})) P(\boldsymbol{\pi} | \Phi({\bm{x}}))$, which is difficult to evaluate. Instead, we utilize a variational inference technique used in~\citep{joo2020being} to generate a variational distribution $q(\boldsymbol{\pi}| \Phi({\bm{x}}); {\bm{w}}_g)$ parameterized by Dirichlet distribution with meta-model to approximate the true posterior distribution $P(\boldsymbol{\pi}| \Phi({\bm{x}}), y)$, then minimize the KL-divergence $\mathrm{KL}\left(q(\boldsymbol{\pi}| \Phi({\bm{x}}); {\bm{w}}_g) \| P(\boldsymbol{\pi}| \Phi({\bm{x}}), y)\right)$, which is equivalent to maximize the evidence lower bound (ELBO) loss (derivation is provided in Appendix~\ref{sec:ELBO-appendix}), i.e., \begin{align} {\mathcal{L}}_{\mathrm{VI}}({\bm{w}}_g) &=\frac{1}{N_M}\sum_{i=1}^{N_M} \mathbb{E}_{q(\boldsymbol{\pi}| \Phi({\bm{x}}_i); {\bm{w}}_g)}[\log P(y_i \mid \boldsymbol{\pi}, \boldsymbol{x}_i)] \nonumber \\ &\quad - \lambda\cdot\mathrm{KL}\left(q(\boldsymbol{\pi}| \Phi({\bm{x}}_i); {\bm{w}}_g) \| P(\boldsymbol{\pi} | \Phi({\bm{x}}_i))\right)\\ &= \frac{1}{N_M}\sum_{i=1}^{N_M} \psi\left(\alpha^{(i)}_{y_i}\right)-\psi\left(\alpha^{(i)}_{0}\right) \nonumber\\ &\quad - \lambda\cdot \mathrm{KL}\left( \operatorname{Dir}(\boldsymbol{\pi}| \boldsymbol{\alpha}^{(i)}) \| \operatorname{Dir}(\boldsymbol{\pi} | \boldsymbol{\beta})\right), \end{align} where $\boldsymbol{\alpha}^{(i)}$ is the Dirichlet concentration parameter parameterized by the meta-model, i.e., $\boldsymbol{\alpha}^{(i)} = e^{\left({\bm{g}}\left(\Phi({\bm{x}}_i); {\bm{w}}_g\right)\right)}$, $\boldsymbol{\psi}$ is the digamma function, and $\boldsymbol{\beta}$ is the predefined concentration parameter of prior distribution. In practice, we simply let $\boldsymbol{\beta} = [1,\cdots,1]$. The likelihood term encourages the categorical distribution to be sharper around the true class on the simplex, and the KL-divergence term can be viewed as a regularizer to prevent overconfident prediction, and $\lambda$ is the hyper-parameter to balance the trade-off. \paragraph{Validation for Uncertainty Learning} \label{sec:validation} Validation with early stopping is a commonly used technique in supervised learning to train a model with desired generalization performance, i.e., stop training when the error evaluated on the validation set starts increasing. However, we observe that the standard validation method does not work well for uncertainty learning. One possible explanation is that model achieves the highest accuracy when validation loss is small, but may not achieve the best UQ performance, i.e., the model can be overconfident. To this end, we propose a simple and effective validation approach specifically for uncertainty learning. Instead of monitoring the validation cross-entropy loss, we evaluate a specific uncertainty quantification performance metric. For example, we create another noisy validation set for the OOD task by adding noise to the original validation samples and treating such noisy validation samples as OOD samples (more details are provided in the Appendix~\ref{ood-dataset-appendix}). We evaluate the uncertainty score ${\bm{u}}\left(\tilde{{\bm{y}}}\right)$ on both the validation set and noisy validation set and stop the meta-model training when the OOD detection performance achieves its maximum based on some predefined metrics, e.g., AUROC score. Unlike most existing literature using additional training data to help achieve desired performance~\citep{hendrycks2018deep, kristiadi2021learnable, malinin2018predictive}, we nonetheless do not require any additional data for training the meta-model. \subsection{Uncertainty Metrics} \label{sec:metric} In this section, we show that our meta-model has the desired behavior to quantify different uncertainties and how they can be used in various applications. \textbf{Total Uncertainty.} Total uncertainty, also known as predictive uncertainty, is a combination of epistemic uncertainty and aleatoric uncertainty. The total uncertainty is often used for misclassification detection problems, where the misclassified samples are viewed as in-distribution hard samples. There are two standard ways to measure total uncertainty: (1) \textbf{Entropy} (Ent): The Shannon entropy of expected categorical label distribution over the Dirichlet distribution, i.e., ${\mathcal{H}}\left(P(y|\Phi({\bm{x}}); {\bm{w}}_g) \right) = {\mathcal{H}}\left(\mathbb{E}_{P(\boldsymbol{\pi}|\Phi({\bm{x}}); {\bm{w}}_g)}[P(y|\boldsymbol{\pi})]\right) $; (2) \textbf{Max Probability} (MaxP): The probability of the predicted class in label distribution, i.e., $\max_c P(y=c|\Phi({\bm{x}}); {\bm{w}}_g)$. \textbf{Epistemic Uncertainty.} The epistemic uncertainty quantifies the uncertainty when the model has insufficient knowledge of a prediction, e.g., the case of an unseen data sample. The epistemic uncertainty is especially useful in OOD detection problems. When the meta-model encounters an unseen sample during testing, it will output a high epistemic uncertainty score due to a lack of knowledge. We define three metrics to measure the epistemic uncertainties. (1) \textbf{Differential Entropy} (Dent): Differential entropy measures the entropy of the Dirichlet distribution, a large differential entropy corresponds a more spread Dirichlet distribution, i.e., ${\mathcal{H}}\left(P(\boldsymbol{\pi}| \Phi({\bm{x}}_i); {\bm{w}}_g) \right) = -\int P(\boldsymbol{\pi}| \Phi({\bm{x}}_i); {\bm{w}}_g)\cdot \log{P(\boldsymbol{\pi}| \Phi({\bm{x}}_i); {\bm{w}}_g)} d\boldsymbol{\pi}$. (2) \textbf{Mutual Information} (MI): Mutual Information is the difference between the Entropy (measures total uncertainty) and the expected entropy of the categorical distribution sampled from the Dirichlet distribution (approximates aleatoric uncertainty), i.e., ${\mathcal{I}}\left(y,\boldsymbol{\pi}|\Phi({\bm{x}}_i) \right) = {\mathcal{H}}\left(\mathbb{E}_{P(\boldsymbol{\pi}|\Phi({\bm{x}}); {\bm{w}}_g)} [P(y|\boldsymbol{\pi})]\right)- \mathbb{E}_{P(\boldsymbol{\pi}|\Phi({\bm{x}}); {\bm{w}}_g)}[{\mathcal{H}}\left(P(y|\boldsymbol{\pi})\right)]$. (3) \textbf{Precision}(Prec): The precision is the summation of the Dirichlet distribution concentration parameter $\boldsymbol{\alpha}$, larger value corresponds to sharper distribution and higher confidence, i.e., $\alpha_0 = \sum_{c=1}^k \alpha_c$. \section{Introduction}\label{sec:intro} Despite the promising performance of deep neural networks achieved in various practical tasks~\citep{simonyan2014very, ren2015faster, hinton2012deep, mikolov2010recurrent, alipanahi2015predicting, litjens2017survey}, uncertainty quantification (UQ) has attracted growing attention in recent years to fulfill the emerging demand for more robust and reliable machine learning models, as UQ aims to measure the reliability of the model's prediction quantitatively. Accurate uncertainty estimation is especially critical for the field that is highly sensitive to error prediction, such as autonomous driving~\citep{bojarski2016end} and medical diagnosis~\citep{begoli2019need}. Most state-of-the-art approaches~\citep{gal2016dropout, lakshminarayanan2017simple, malinin2018predictive, van2020simple} focus on building a deep model equipped with uncertainty quantification capability so that a single deep model can achieve both desired prediction and UQ performance simultaneously. However, such an approach for UQ suffers from practical limitations because it either requires a specific model structure or explicitly training the entire model from scratch to impose the uncertainty quantification ability. A more realistic scenario is to quantify the uncertainty of a pretrained model in a post-hoc manner due to practical constraints. For example, (1) compared with prediction accuracy and generalization performance, uncertainty quantification ability of deep learning models are usually considered with lower priority, especially for profit-oriented applications, such as recommendation systems; (2) some applications require the models to impose other constraints, such as fairness or privacy, which might sacrifice the UQ performance; (3) for some applications such as transfer learning, the pretrained models are usually available, and it might be a waste of resources to train a new model from scratch. Motivated by these practical concerns, we focus on tackling the post-hoc uncertainty learning problem, i.e., given a pretrained model, how to improve its UQ quality without affecting its predictive performance. Prior works on improving uncertainty quality in a post-hoc setting have been mainly targeted towards improving calibration \citep{guo2017calibration,kull2019beyond}. These approaches typically fail to augment the pre-trained model with the ability to capture different sources of uncertainty, such as epistemic uncertainty, which is crucial for applications such Out-of-Distribution (OOD) detection. Several recent works \citep{chen2019confidence,jain2021deup} have adopted the meta-modeling approach, where a meta-model is trained to predict whether or not the pretrained model is correct on the validation samples. These methods still rely on a point estimate of the meta-model parameters, which can be unreliable, especially when the validation set is small. In this paper, we propose a novel Bayesian meta-model-based uncertainty learning approach to mitigate the aforementioned issues. Our proposed method requires no additional data other than the training dataset and is flexible enough to quantify different kinds of uncertainties and easily adapt to different application settings. Our empirical results provides crucial insights regarding meta-model training: (1) The diversity in feature representations across different layers is essential for uncertainty quantification, especially for out-of-domain (OOD) data detection tasks; (2) Leveraging the Dirichlet meta-model to capture different uncertainties, including total uncertainty and epistemic uncertainty; (3) There exists an over-fitting issue in uncertainty learning similar to supervised learning that needs to be addressed by a novel validation strategy to achieve better performance. Furthermore, we show that our proposed approach has the flexibility to adapt to various applications, including OOD detection, misclassification detection, and trustworthy transfer learning. \section{Concluding Remarks} \label{sec:conclusion} We provide a novel solution for the uncertainty quantification problem via our proposed post-hoc uncertainty learning framework and the Dirichlet meta-model approach. Our method turns out to be both effective and computationally efficient for various UQ applications. We believe our meta-model approach not only has the flexibility to tackle other applications relevant to uncertainty quantification, such as quantifying transfer-ability in transfer learning and domain adaptation, but also can adapt to other model architecture such as transformer and language model. Exploring these potential applications and offering a theoretical interpretation of the meta-model can be interesting future work. \section*{Acknowledgement} This work was supported, in part, by the MIT-IBM Watson AI Lab under Agreement No.~W1771646, and NSF under Grant No.~CCF-1816209. \section{Uncertainty Quantification Applications} In this section, we will discuss several important applications that can be tackled using our proposed post-hoc uncertainty learning framework. Our meta-model has two major advantages: (1) It is efficient, i.e., it is easy to optimize and empirically require less number of training data due to smaller model complexity, (2) It is versatile, i.e., it not only can quantify different uncertainties to adapt to different applications, but also different settings, i.e., like transfer learning, the distribution of training data for meta-model can even be different from the base-model. \paragraph{Out of domain data detection} The base-model ${\bm{h}}$ is trained using data sampled from distribution $P^B_{Z}$. During testing, if there exists some unobserved out of domain data from another distribution $P^{ood}_{Z}$, the meta-model should correctly identify the in-distribution or out-of-distribution input sample. We use the same training set as base model to train the meta-model, i.e., $\mathcal{D}_{B} = \mathcal{D}_{M}$, which means our proposed method does not require additional OOD data for training. For OOD task, we use three epistemic uncertainties to measure the uncertainty score ${\bm{u}}\left(\tilde{y}\right)$. \paragraph{Miss-classification Detection} Instead of detecting whether a testing sample is out of domain, the meta-model aims to identify the failure or success of prediction during testing. We train the meta-model with the same setting as OOD detection task, and use the two total uncertainties. \paragraph{Trustworthy Transfer Learning} The aforementioned applications assume the data used for training the base-model and the meta-model are exactly same, i.e., $\mathcal{D}_{B} = \mathcal{D}_{M}$, or $P^B_{Z} = P^B_{M}$ in general. Instead, the transfer learning assumes there exists a pretrained model ${\bm{h}}_s$ trained using source task data $\mathcal{D}_{s}$ sampled from source distribution $P^s_{Z}$, and the goal is to adapt the source model to target task using target data $\mathcal{D}_{t}$ sampled from target distribution $P^t_{Z}$. Most existing transfer learning problem focus on improving the prediction performance of transferred model, but ignore its uncertainty quantification performance on the target task. Our meta-model method can be utilized as a simple and effective way to address this problem, i.e, given pretrained source model ${\bm{h}} \circ {\bm{f}} = \argmin_{{\bm{h}} \circ {\bm{f}}} {\mathcal{L}}_E({\bm{h}} \circ {\bm{f}},{\mathcal{D}}_s)$, the meta-model can be efficiently trained using target domain data, i.e., ${\bm{g}} = \argmin_{{\bm{g}}} {\mathcal{L}}_E({\bm{g}} \circ {\bm{f}},{\mathcal{D}}_t)$. \section{Rebuttal} We thank the reviewers for their detailed feedback and valuable suggestions to help us further improve this work. We address their concerns through this response and will include more detailed results in the final version. \subsection{Response to Review-1:} \paragraph{(1) Results of Calibration:} Our method has demonstrated strong performance on the selective classification, which is directly related to model calibration and requires an accurate estimation of the total uncertainty. As per the reviewer's suggestion, we computed the ECE scores of our methods and other baseline methods. CIFAR10: Ours(10.4), Base-Model(13.2), LULA(10.8), BeBayesian(10.6), MCDropout(11.3); CIFAR100: Ours(7.3), Base-Model(26.2), LULA(7.1), BeBayesian(5.8), MCDropout(22.5). It shows that our method achieves comparable or better calibration performance than the baseline methods. \paragraph{(2) Comparison with existing meta-modeling approach:} To the best of the authors' understanding, Chen et al. 2019 and Jain et al. 2021 are the only existing meta-model-based UQ works. It’s possible that we misunderstood the reviewer’s request, but we already compared with Chen et al. 2019 (denoted as "Whitebox") in the experiment section and demonstrated that our method outperformed it across different tasks. Additionally, we note that Jain et al. 2021 mainly focuses on regression instead of classification and should be considered contemporaneous. We leave comparison with this work for future work. \subsection{Response to Review-2:} \paragraph{(1)} Thanks to the reviewer for pointing out the typo in Table 1. We will correct it in the revision. \paragraph{(2) Difference between our work and prior network:} First, the motivations and problem settings are different. Our work tries to improve the uncertainty quantification performance of an arbitrary pre-trained model in a post-hoc manner. Prior Network [1] aims to train a Bayesian model with the UQ capability from scratch. Second, the Dirichlet technique used in this work, though it might be similar to [1], simply serves as one efficient technique to quantify epistemic uncertainty. However, our method is not limited to using the Dirichlet technique as long as the output of the meta-model can quantify total and epistemic uncertainties. Moreover, compared to [1], our proposed method uses the variational loss instead of the KL divergence loss that requires additional OOD data defined by Equation 12 in [1]. In the revision, we will further clarify the main differences. \subsection{Response to Review-5:} \paragraph{(1) Comparison with existing OOD work ALOE[1]:} The relation between UQ and OOD has been discussed in section 5.1, and we agree that we can introduce more about OOD in the related work. The scope of this work is to propose a general approach that can quantify different types of uncertainties for various tasks, especially in a challenging post-hoc setting. The OOD detection task considered here is a specific application that highly relies on good epistemic uncertainty. However, the existing OOD detection approach is not necessarily capable of the general UQ capability for other applications, such as selective classification that relies on total uncertainty. As the reviewer suggested, we compare with [1] to further validate our method. The results are the AUROC scores evaluated on CIFAR 10 and CIFAR 100 (average over five OOD datasets). CIFAR10: Ours-MI(98.4), ALOE(97.3); CIFAR100: Ours-MI(87.4), ALOE(86.9). Our method can still demonstrate advantages over ALOE on OOD tasks. Moreover, ALOE [1] requires an additional OOD dataset for training their model, while our method does not. Besides, we notice that training ALOE is computationally expensive. We will cite [1] in the final version and provide more discussion and comparison. \paragraph{(2) Comparison with Calibration approach [2]:} Traditional calibration approaches, such as temperature scaling [2], have two major limitations. First, it requires an additional validation dataset to optimize the temperature. Second, as we mentioned in the third paragraph of the introduction section, calibration methods fail to capture epistemic uncertainty, which is crucial for OOD detection. To further elaborate this argument, we evaluate the performance of the calibration approach [2] on OOD detection and provide the average AUROC score: CIFAR10: Ours-MI(98.4), Base-Model(87.9), Calibration[2](92.3); CIFAR100: Ours-MI(87.4), Base-Model(75.8), Calibration[2](82.5). The calibration can improve the performance over the base model, but our proposed method can still outperform calibration [2] by a large margin. \subsection{Response to Review-6:} \paragraph{(1) Demonstrate the efficiency:} Our meta-model-based approach is much more efficient than traditional uncertainty quantification approaches because it has a simpler structure and faster convergence speed. To quantitatively demonstrate such efficiency, we measure the wall-clock time of training the meta-model in seconds (on a single Titan RTX GPU): CIFAR10/VGG16: 66.5s (for five epochs); CIFAR100/WideResNet: 241.9s (for ten epochs). The training time of the meta-model can be negligible compared to those approaches training the entire base model from scratch (usually taking several hours). \section{Problem Formulation} \label{sec:problem} We focus on classification problems in this paper. Let ${\mathcal{Z}} = {\mathcal{X}} \times {\mathcal{Y}}$, where ${\mathcal{X}}$ denotes the input space, and ${\mathcal{Y}}=\{1,\cdots,K\}$ denotes the label space. Given a base-model training set $\mathcal{D}_B=\left\{\boldsymbol{x}^B_{i}, y^B_{i}\right\}_{i=1}^{N_B}\in {\mathcal{Z}}^{N_B} $ containing i.i.d. samples generated from the distribution $P^{B}_{Z}$, a pretrained base model ${\bm{h}} \circ \Phi:{\mathcal{X}} \rightarrow \Delta^{K-1}$ is constructed, where $\Phi: {\mathcal{X}} \rightarrow {\mathbb{R}}^{l}$ and ${\bm{h}}: {\mathbb{R}}^{l} \rightarrow \Delta^{K-1}$ denote two complementary components of the neural network. More specifically, $\Phi\left({\bm{x}}\right) = \Phi\left({\bm{x}}; {\bm{w}}_{\phi}\right)$ stands for the intermediate feature representation of the base model, and the model output ${\bm{h}}\left(\Phi({\bm{x}})\right) = {\bm{h}}\left(\Phi({\bm{x}}; {\bm{w}}_{\phi}); {\bm{w}}_h\right)$ denotes the predicted label distribution $P_B\left( {\bm{y}} \mid \Phi({\bm{x}})\right) \in \Delta^{K-1}$ given input sample ${\bm{x}}$, where $\left({\bm{w}}_{\phi}, {\bm{w}}_h\right)\in {\mathcal{W}}$ are the parameters of the pretrained base model. The performance of the base model is evaluated by a non-negative loss function $\ell_B: {\mathcal{W}} \times {\mathcal{Z}} \to {\mathbb{R}}_+$, e.g., cross entropy loss. Thus, a standard way to obtain the pretrained base model is by minimizing the empirical risk over $\mathcal{D}_B$, i.e., ${\mathcal{L}}_B({\bm{h}} \circ \Phi,{\mathcal{D}}_B) \triangleq \frac{1}{N_B}\sum_{i=1}^{N_B} \ell_B \left({\bm{h}} \circ \Phi, ({\bm{x}}^B_i,y^B_i) \right)$. Although the well-trained deep base model is able to achieve good prediction accuracy, the output label distribution $P_B\left({\bm{y}} \mid \Phi({\bm{x}})\right)$ is usually unreliable for uncertainty quantification, i.e., it can be overconfident or poorly calibrated. Without retraining the model from scratch, we are interested in improving the uncertainty quantification performance in an efficient post-hoc manner. We utilize a meta-model ${\bm{g}} : {\mathbb{R}}^{l} \rightarrow \mathcal{\tilde{Y}}$ with parameter ${\bm{w}}_{g}\in {\mathcal{W}}_g$ building on top of the base model. The meta-model shares the same feature extractor from the base model and generates an output $\tilde{{\bm{y}}} = {\bm{g}}\left(\Phi({\bm{x}}); {\bm{w}}_g\right)$, where $\tilde{{\bm{y}}}\in \mathcal{\tilde{Y}}$ can take any form, e.g., a distribution over $\Delta^{K-1}$ or a scalar. Given a meta-model training set $\mathcal{D}_M=\left\{\boldsymbol{x}^M_{i}, y^M_{i}\right\}_{i=1}^{N_M}$ with i.i.d. samples from the distribution $P^{M}_{Z}$, our goal is to obtain the meta-model by optimizing a training objective ${\mathcal{L}}_M({\bm{g}} \circ \Phi,{\mathcal{D}}_M) \triangleq \frac{1}{N_M}\sum_{i=1}^{N_M} \ell_M \left({\bm{g}} \circ \Phi, ({\bm{x}}^M_i,y^M_i) \right)$, where $\ell_M: {\mathcal{W}}_g \times {\mathcal{W}}_{\phi} \times {\mathcal{Z}} \to {\mathbb{R}}_+$ is the loss function for the meta-model. In the following, we formally introduce the post-hoc uncertainty learning problem using meta-model. \begin{problem}\label{prob:general}[Post-hoc Uncertainty Learning by Meta-model] Given a base model ${\bm{h}} \circ \Phi$ learned from the base-model training set ${\mathcal{D}}_B$, the uncertainty learning problem by meta-model is to learn the function ${\bm{g}}$ using the meta-model training set ${\mathcal{D}}_M$ and the shared feature extractor $\Phi$, i.e., \begin{equation} {\bm{g}}^* = \argmin_{{\bm{g}}} {\mathcal{L}}_M({\bm{g}} \circ \Phi,{\mathcal{D}}_M), \end{equation} such that the output from the meta-model $\tilde{{\bm{y}}} = {\bm{g}}\left(\Phi(x)\right)$ equipped with an uncertainty metric function ${\bm{u}} : \mathcal{\tilde{Y}} \rightarrow {\mathbb{R}}$ is able to generate a robust uncertainty score ${\bm{u}}\left(\tilde{{\bm{y}}}\right)$. \end{problem} Next, the most critical questions are how the meta-model should use the information extracted from the pretrained base model, what kinds of uncertainty the meta-model should aim to quantify, and finally, how to train the meta-model appropriately. \section{Related Work} Uncertainty Quantification methods can be broadly classified as \textit{intrinsic} or \textit{extrinsic} depending on how the uncertainties are obtained from the machine learning models. Intrinsic methods encompass models that inherently provide an uncertainty estimate along with its predictions. Some intrinsic methods such as neural networks with homoscedastic/heteroscedastic noise models \citep{wakefield2013bayesian} and quantile regression \cite{koenker1978regression} can only capture \textit{Data} (aleatoric) uncertainty. Many applications including out-of-distribution detection, requires capturing both \textit{Data} (aleatoric) and \textit{Model} (epistemic) accurately. Bayesian methods such as Bayesian neural networks (BNNs) \cite{neal2012bayesian,blundell15,welling2011bayesian} and Gaussian processes \cite{gpbook} and ensemble methods~\citep{lakshminarayanan2017simple} are well known examples of intrinsic methods that can quantify both uncertainties. However, Bayesian methods and ensembles can be quite expensive and require several approximations to learn/optimize in practice~\citep{mackay1992practical,kristiadi2021learnable,welling2011bayesian}. Other approaches attempt to alleviate these issues by directly parameterizing a Dirichlet prior distribution over the categorical label proportions via a neural network~\citep{malinin2018predictive, sensoy2018evidential, malinin2019reverse, nandy2020towards, charpentier2020posterior, joo2020being}. Under model misspecification, Bayesian approaches are not well-calibrated and can produce severely miscalibrated uncertainties. In the particular case of BNNs, sparsity-promoting priors have been shown to produce better-calibrated uncertainties, especially in the small data regime \cite{ghosh2019model}, and somewhat alleviate the issue. Improved approximate inference methods and methods for prior elicitation in BNN models are active areas of research for forcing BNNs to produce better-calibrated uncertainties. Frequentist methods that approximate the jackknife have also been proposed to construct calibrated confidence intervals~\cite{alaa2019discriminative}. For models without an inherent notion of uncertainty, extrinsic methods are employed to extract uncertainties in a post-hoc manner. The post-hoc UQ problem is still under-explored, and few works focus on tackling this problem. One such approach is to build auxiliary or meta-models, which have been used successfully to generate reliable confidence measures (in classification) \citep{chen2019confidence}, prediction intervals (in regression), and to predict performance metrics such as accuracy on unseen and unlabeled data~\citep{elder2020learning}. Similarly, DEUP~\citep{jain2021deup} trains an error predictor to estimate the epistemic uncertainty of the pretrained model in terms of the difference between generalization error and aleatoric uncertainty. LULA~\citep{kristiadi2021learnable} trains additional hidden units building on layers of MAP-trained model to improve its uncertainty calibration with Laplace approximation. However, many of these methods require additional data samples that are either validation or out of distribution dataset to train or tune the hyper-parameter, which is infeasible when these data are not available. Moreover, they are often not flexible enough to distinguish epistemic uncertainty and aleatoric uncertainty, which are known to be crucial in various learning applications~\citep{hullermeier2021aleatoric}. In contrast, our proposed method does not require additional training data or modifying the training procedure of the base model. \section{Experiment Results} \label{sec:exp} In this section, we will demonstrate the strong empirical performance of our proposed meta-model-based uncertainty learning method: first, We introduce the UQ applications; then we describe the experiment settings; next, we present the main results of the three aforementioned uncertainty quantification applications; and finally, we discuss our takeaways. More experiment results and implementation details are given in the Appendix~\ref{setup-appendix} and Appendix~\ref{results-appendix}. \subsection{Uncertainty Quantification Applications} \label{sec:app} We primarily focus on three applications that can be tackled using our proposed meta-model approach: (1) \textbf{Out of domain data detection.} Given a base-model ${\bm{h}}$ trained using data sampled from the distribution $P^B_{Z}$. We use the same base-model training set to train the meta-model, i.e., $\mathcal{D}_{B} = \mathcal{D}_{M}$. During testing, there exists some unobserved out-of-domain data from another distribution $P^{ood}_{Z}$. The meta-model is expected to identify the out-of-distribution input sample based on epistemic uncertainties. (2) \textbf{misclassification Detection.} Instead of detecting whether a testing sample is out of domain, the goal here is to identify the failure or success of the meta-model prediction at test time using total uncertainties. (3) \textbf{Trustworthy Transfer Learning.} In transfer learning, there exists a pretrained model trained using source task data $\mathcal{D}_{s}$ sampled from source distribution $P^s_{Z}$, and the goal is to adapt the source model to a target task using target data $\mathcal{D}_{t}$ sampled from target distribution $P^t_{Z}$. Most existing transfer learning approaches only focus on improving the prediction performance of the transferred model, but ignore its UQ performance on the target task. Our meta-model method can be utilized to address this problem, i.e, given pretrained source model ${\bm{h}}^{s} \circ \Phi^{s}$, the meta-model can be efficiently trained using target domain data by ${\bm{g}}^t = \argmin_{{\bm{g}}} {\mathcal{L}}_E({\bm{g}} \circ \Phi^s,{\mathcal{D}}_t)$. \begin{table*}[t] \begin{center} \scriptsize \captionsetup{font=small} \caption{\textbf{OOD Detection AUROC score.} MI, Dent, and Prec stand for different epistemic uncertainty metrics, i.e., Mutual Information, Differential Entropy, and precision. Settings stand for post-hoc or traditional, i.e., training the entire model from scratch. Additional Data stands for if using additional training data or not.} \vspace{-2em} \begin{tabular}{lllllllll} \\ \toprule \textbf{ID Data}\ \&\ \textbf{Model} & \textbf{Methods} & \textbf{Settings} & \textbf{Additional Data} & \textbf{Omniglot}& \textbf{FMNIST} & \textbf{KMNIST}& \textbf{CIFAR10} &\textbf{Corrupted} \\ \hline MNIST & Base Model(Ent) & Traditional & No & 98.9$\pm$0.5 & 97.8$\pm$0.8 & 95.8$\pm$0.8 & 99.4$\pm$0.2 & 99.5$\pm$0.3 \\ LeNet & Base Model(MaxP) & Traditional & No & 98.7$\pm$0.6 & 97.6$\pm$0.8 & 95.6$\pm$0.8 & 99.3$\pm$0.2 & 99.4$\pm$0.4 \\ & Whitebox & Post-hoc & Yes & 98.5$\pm$0.3 & 97.7$\pm$0.6 & 96.0$\pm$0.2 & 99.5$\pm$0.1 & 99.5$\pm$0.1 \\ & LULA & Post-hoc & Yes & 99.8$\pm$0.0 & 99.4$\pm$0.0 & \textcolor{violet}{\textbf{99.3}$\pm$0.1} & 99.9$\pm$0.0 & 99.6$\pm$0.1 \\ \hline & \textbf{Ours(Ent)} & Post-hoc & No & 99.7$\pm$0.1 & 99.5$\pm$0.2 & 98.2$\pm$0.3 & \textcolor{violet}{\textbf{100.0}$\pm$0.0} & \textcolor{violet}{\textbf{100.0}$\pm$0.0} \\ & \textbf{Ours(MaxP)} & Post-hoc & No & 99.3$\pm$0.2 & 99.3$\pm$0.2 & 98.0$\pm$0.2 & \textcolor{violet}{\textbf{100.0}$\pm$0.0} & \textcolor{violet}{\textbf{100.0}$\pm$0.0} \\ & \textbf{Ours(MI)} & Post-hoc & No & \textcolor{violet}{\textbf{99.9}$\pm$0.0} & \textcolor{violet}{\textbf{99.6}$\pm$0.2} &97.7$\pm$0.4 & \textcolor{violet}{\textbf{100.0}$\pm$0.0} & \textcolor{violet}{\textbf{100.0}$\pm$0.0} \\ & \textbf{Ours(Dent)} & Post-hoc & No & 99.8$\pm$0.0 & 99.5$\pm$0.2 & 97.6$\pm$0.4 & \textcolor{violet}{\textbf{100.0}$\pm$0.0} & \textcolor{violet}{\textbf{100.0}$\pm$0.0} \\ & \textbf{Ours(Prec)} & Post-hoc & No & \textcolor{violet}{\textbf{99.9}$\pm$0.0} & \textcolor{violet}{\textbf{99.5}$\pm$0.2} &97.7$\pm$0.5 & \textcolor{violet}{\textbf{100.0}$\pm$0.0} & \textcolor{violet}{\textbf{100.0}$\pm$0.0} \\ \toprule \textbf{ID Data}\ \&\ \textbf{Model} & \textbf{Methods} & \textbf{Settings} & \textbf{Additional Data} & \textbf{SVHN}& \textbf{FMNIST} & \textbf{LSUN}& \textbf{TinyImageNet} &\textbf{Corrupted} \\ \hline CIFAR10 & Base Model(Ent) & Traditional & No & 86.4$\pm$4.6 & 90.8$\pm$1.3 & 89.0$\pm$0.5 & 87.5$\pm$1.1 & 85.9$\pm$8.2 \\ VGG16 & Base Model(MaxP) & Traditional & No & 86.3$\pm$4.4 & 90.4$\pm$1.2 & 88.7$\pm$0.5 & 87.3$\pm$1.1 & 85.7$\pm$8.1 \\ & Whitebox & Post-hoc & Yes & 96.9$\pm$0.9 & 95.2$\pm$1.2 & 89.3$\pm$2.2 & 88.9$\pm$2.5 & 96.4$\pm$1.0 \\ & LULA & Post-hoc & Yes & 97.1$\pm$1.7 & 94.3$\pm$0.0 & 92.8$\pm$0.1 & 90.0$\pm$0.0 & 97.7$\pm$2.0 \\ \hline & \textbf{Ours(Ent)} & Post-hoc & No & 96.3$\pm$3.0 &89.0$\pm$5.2 & 89.6$\pm$3.4 & 89.4$\pm$3.5& 95.9$\pm$4.3 \\ & \textbf{Ours(MaxP)} & Post-hoc & No & 95.6$\pm$3.6 & 87.8$\pm$4.4 &89.1$\pm$2.4 & 88.2$\pm$2.6 & 94.0$\pm$7.3 \\ & \textbf{Ours(MI)} & Post-hoc & No & \textcolor{violet}{\textbf{100.0$\pm$0.0}} & \textcolor{violet}{\textbf{98.8$\pm$0.5}} & 95.2$\pm$0.9 & \textcolor{violet}{\textbf{98.1$\pm$0.3}} & \textcolor{violet}{\textbf{100.0$\pm$0.0}} \\ & \textbf{Ours(Dent)} & Post-hoc & No & \textcolor{violet}{\textbf{100.0$\pm$0.0}} & 98.4$\pm$0.9 & \textcolor{violet}{\textbf{95.7}$\pm$0.8} & 97.7$\pm$0.5 & \textcolor{violet}{\textbf{100.0$\pm$0.0}} \\ & \textbf{Ours(Prec)} & Post-hoc & No & \textcolor{violet}{\textbf{100.0$\pm$0.0}} & \textcolor{violet}{\textbf{98.8$\pm$0.5}} & 95.1$\pm$0.5 & \textcolor{violet}{\textbf{98.1$\pm$0.3}} & \textcolor{violet}{\textbf{100.0$\pm$0.0}} \\ \toprule CIFAR100 & Base Model(Ent) & Traditional & No & 76.2$\pm$5.2 & 77.8$\pm$2.4 & 80.1$\pm$0.5 & 79.7$\pm$0.3 & 65.8$\pm$11.4 \\ WideResNet & Base Model(MaxP) & Traditional & No & 73.9$\pm$4.3 & 76.4$\pm$2.3 & 78.7$\pm$0.5 & 78.0$\pm$0.2 & 63.8$\pm$10.4 \\ & Whitebox & Post-hoc & Yes & 89.0$\pm$0.7 & 82.4$\pm$1.1 & 80.5$\pm$0.7 & 79.0$\pm$1.1 & 83.1$\pm$1.6 \\ & LULA & Post-hoc & Yes & 84.2$\pm$1.0 & 83.2$\pm$0.1 & 79.6$\pm$0.3 & 78.5$\pm$0.1 & 80.6$\pm$1.0 \\ \hline & \textbf{Ours(Ent)} & Post-hoc & No & 92.6$\pm$2.0 & 80.8$\pm$3.0 & 81.1$\pm$1.2 & 84.9$\pm$1.2& 85.6$\pm$3.9 \\ & \textbf{Ours(MaxP)} & Post-hoc & No & 88.6$\pm$3.2 & 78.4$\pm$3.0 & 79.7$\pm$0.6 & 82.4$\pm$0.6& 79.3$\pm$4.5 \\ & \textbf{Ours(MI)} & Post-hoc & No & 94.3$\pm$1.0 & \textcolor{violet}{\textbf{84.4}$\pm$1.8} & 81.9$\pm$4.7 & 85.5$\pm$3.6 & \textcolor{violet}{\textbf{90.8}$\pm$3.3} \\ & \textbf{Ours(Dent)} & Post-hoc & No & 93.3$\pm$1.4 & 84.0$\pm$2.3 & 79.5$\pm$3.0 & 84.6$\pm$2.8& 89.8$\pm$2.6 \\ & \textbf{Ours(Prec)} & Post-hoc & No & \textcolor{violet}{\textbf{94.4}$\pm$1.0} & \textcolor{violet}{\textbf{84.4}$\pm$1.7} & \textcolor{violet}{\textbf{82.1}$\pm$4.9} & \textcolor{violet}{\textbf{85.6}$\pm$3.6}& \textcolor{violet}{\textbf{90.8}$\pm$3.4} \\ \toprule \end{tabular} \label{table:OOD} \end{center} \vspace{-2em} \end{table*} \begin{comment} \begin{table*}[t!] \begin{center} \scriptsize \captionsetup{font=small} \caption{\textbf{CIFAR10 OOD Detection AUROC score} } \vspace{-1.5em} \begin{tabular}{lllllllll} \\ \toprule \makecell{\textbf{ID Data}\\/\textbf{Model}} & \textbf{Methods} & \textbf{Settings} & \textbf{Additional Data} & \textbf{SVHN}& \textbf{FMNIST} & \textbf{LSUN}& \textbf{TIM} &\textbf{Corrupted} \\ \hline CIFAR10 & Base Model(Ent) & Traditional & No & 86.4$\pm$4.6 & 90.8$\pm$1.3 & 89.0$\pm$0.5 & 87.5$\pm$1.1 & 85.9$\pm$8.2 \\ VGG16 & Base Model(MaxP) & Traditional & No & 86.3$\pm$4.4 & 90.4$\pm$1.2 & 88.7$\pm$0.5 & 87.3$\pm$1.1 & 85.7$\pm$8.1 \\ & Whitebox & Post-hoc & Yes & 96.9$\pm$0.9 & 95.2$\pm$1.2 & 89.3$\pm$2.2 & 88.9$\pm$2.5 & 96.4$\pm$1.0 \\ & LULA & Post-hoc & Yes & 97.1$\pm$1.7 & 94.3$\pm$0.0 & 92.8$\pm$0.1 & 90.0$\pm$0.0 & 97.7$\pm$2.0 \\ \hline & \textbf{Ours(Ent)} & Post-hoc & No & 96.3$\pm$3.0 &89.0$\pm$5.2 & 89.6$\pm$3.4 & 89.4$\pm$3.5& 95.9$\pm$4.3 \\ & \textbf{Ours(MaxP)} & Post-hoc & No & 95.6$\pm$3.6 & 87.8$\pm$4.4 &89.1$\pm$2.4 & 88.2$\pm$2.6 & 94.0$\pm$7.3 \\ & \textbf{Ours(MI)} & Post-hoc & No & 100.0$\pm$0.0 & 98.8$\pm$0.5 & 95.2$\pm$0.9 & 98.1$\pm$0.3 & 100.0$\pm$0.0 \\ & \textbf{Ours(Dent)} & Post-hoc & No & \textcolor{violet}{\textbf{100.0}$\pm$0.0} & \textcolor{violet}{\textbf{98.4}$\pm$0.9} & \textcolor{violet}{\textbf{95.7}$\pm$0.8} & \textcolor{violet}{\textbf{97.7}$\pm$0.5} & \textcolor{violet}{\textbf{100.0}$\pm$0.0} \\ & \textbf{Ours(Prec)} & Post-hoc & No & 100.0$\pm$0.0 & 98.8$\pm$0.5 & 95.1$\pm$0.5 & 98.1$\pm$0.3 & 100.0$\pm$0.0 \\ \toprule \end{tabular} \label{table:OOD-CIFAR10} \end{center} \vspace{-1.5em} \end{table*} \begin{table*}[t!] \begin{center} \scriptsize \captionsetup{font=small} \caption{\textbf{CIFAR100 OOD Detection AUROC score}} \vspace{-1.5em} \begin{tabular}{lllllllll} \\ \toprule \makecell{\textbf{ID Data}\\/\textbf{Model}} & \textbf{Methods} & \textbf{Settings} & \textbf{Additional Data} & \textbf{SVHN}& \textbf{FMNIST} & \textbf{LSUN}& \textbf{TIM} &\textbf{Corrupted} \\ \hline CIFAR100 & Base Model(Ent) & Traditional & No & 76.2$\pm$5.2 & 77.8$\pm$2.4 & 80.1$\pm$0.5 & 79.7$\pm$0.3 & 65.8$\pm$11.4 \\ WideResNet & Base Model(MaxP) & Traditional & No & 73.9$\pm$4.3 & 76.4$\pm$2.3 & 78.7$\pm$0.5 & 78.0$\pm$0.2 & 63.8$\pm$10.4 \\ & Whitebox & Post-hoc & Yes & 89.0$\pm$0.7 & 82.4$\pm$1.1 & 80.5$\pm$0.7 & 79.0$\pm$1.1 & 83.1$\pm$1.6 \\ & LULA & Post-hoc & Yes & 84.2$\pm$1.0 & 83.2$\pm$0.1 & 79.6$\pm$0.3 & 78.5$\pm$0.1 & 80.6$\pm$1.0 \\ \hline & \textbf{Ours(Ent)} & Post-hoc & No & 92.6$\pm$2.0 & 80.8$\pm$3.0 & 81.1$\pm$1.2 & 84.9$\pm$1.2& 85.6$\pm$3.9 \\ & \textbf{Ours(MaxP)} & Post-hoc & No & 88.6$\pm$3.2 & 78.4$\pm$3.0 & 79.7$\pm$0.6 & 82.4$\pm$0.6& 79.3$\pm$4.5 \\ & \textbf{Ours(MI)} & Post-hoc & No & 94.3$\pm$1.0 & \textcolor{violet}{\textbf{84.4}$\pm$1.8} & 81.9$\pm$4.7 & 85.5$\pm$3.6 & \textcolor{violet}{\textbf{90.8}$\pm$3.3} \\ & \textbf{Ours(Dent)} & Post-hoc & No & 93.3$\pm$1.4 & 84.0$\pm$2.3 & 79.5$\pm$3.0 & 84.6$\pm$2.8& 89.8$\pm$2.6 \\ & \textbf{Ours(Prec)} & Post-hoc & No & \textcolor{violet}{\textbf{94.4}$\pm$1.0} & \textcolor{violet}{\textbf{84.4}$\pm$1.7} & \textcolor{violet}{\textbf{82.1}$\pm$4.9} & \textcolor{violet}{\textbf{85.6}$\pm$3.6}& \textcolor{violet}{\textbf{90.8}$\pm$3.4} \\ \toprule \end{tabular} \label{table:OOD-CIFAR100} \end{center} \vspace{-1.5em} \end{table*} \end{comment} \subsection{Settings}\label{sec:setting} \paragraph{Benchmark.} For both OOD detection and misclassification detection tasks, we employ three standard datasets to train the base model and the meta-model: MNIST, CIFAR10, and CIFAR100. For each dataset, we use different base-model structures, i.e., LeNet for MNIST, VGG-16~\citep{simonyan2014very} for CIFAR10, and WideResNet-16~\citep{zagoruyko2016wide} for CIFAR100. For LeNet and VGG-16, the meta-model uses extracted feature after each pooling layer, and for WideResNet-16, the meta-model uses extracted feature after each residual black. In general, the total number of intermediate features is less than 5 to ensure computational efficiency. For the OOD task, we consider five different OOD datasets for evaluating the OOD detection performance: Omiglot, FashionMNIST, KMNIST, CIFAR10, and corrupted MNIST as outliers for the MNIST dataset; SVHN, FashionMNIST, LSUN, TinyImageNet, and corrupted CIFAR10 (CIFAR100) as outliers for CIFAR10 (CIFAR100) dataset. For the trustworthy transfer learning task, we use the ResNet-50 pretrained on ImageNet as our pretrained source domain model and adapt the source model to the two target tasks, STL10 and CIFAR10, by training the meta-model. \paragraph{Baselines.} For OOD and misclassification tasks, except the naive base-model trained with cross-entropy loss, we mainly compare with the existing post-hoc UQ methods as baselines: (1) The meta-model based method (Whitebox)~\citep{chen2019confidence}; (2) The post-hoc uncertainty quantification using Laplace Approximation (LULA)~\citep{kristiadi2021learnable}. In order to further validates our strong empirical performance, we also compare with other SOTA intrinsic UQ methods in the Appendix~\ref{results-appendix}: (1) The standard Bayesian method Monte-Carlo Dropout~\citep{gal2016dropout}; (2) The Dirichlet network with variational inference (Be-Bayesian)~\citep{joo2020being}; (3) The posterior network with density estimation~\citep{charpentier2020posterior}; (4) The robust OOD detection method ALOE~\citep{chen2020robust}. For the trustworthy transfer learning task, since there is no existing work designed for this problem, we compare our method with two simple baselines: (1) Fine-tune the last layer of the source model. (2) Train our proposed meta-model on top of the source model using standard cross-entropy loss. \paragraph{Performance Metrics.} We evaluate the UQ performance by measuring the area under the ROC curve (AUROC) and the area under the Precision-Recall curve (AUPR). The results are averaged over five random trails for each experiment. For the OOD task, we consider the in-distribution test samples as the negative class and the outlier samples as the positive class. For the misclassification task, we consider correctly classified test samples as the negative class and miss-classified test samples as the positive class. \subsection{OOD Detection}\label{sec:OOD} The OOD detection results for the three benchmark datasets, MNIST, CIFAR10, and CIFAR100, are shown in Table~\ref{table:OOD}. Additional baseline comparisons are provided in Table~\ref{table:OOD-appendix} in Appendix. Our proposed Dirichlet meta-model method consistently outperforms all the baseline methods in terms of AUROC score (AUPR results are shown in Appendix), including the recent proposed SOTA post-hoc uncertainty learning method LULA. We also evaluate the performance of all the uncertainty metrics defined in section~\ref{sec:metric}, as it can be observed that compared to total uncertainty (Ent and MaxP), epistemic uncertainties (MI, Dent, Prec) can achieve better UQ performance for the OOD detection task. Moreover, our proposed method does not require additional data to train the meta-model. In contrast, Whitebox requires an additional validation set to train the meta-model, and LULA also needs an additional OOD dataset during training to distinguish the in-distribution samples and outliers, which imposes practical limitations. \subsection{Misclassification Detection}\label{sec:Miss} The misclassification detection results for the three benchmark datasets, MNIST, CIFAR10, and CIFAR100, are shown in Table~\ref{table:miss-class}. Additional baseline comparisons are provided in Table~\ref{table:miss-class-appendix}. LULA turns out to be a strong baseline for the misclassification detection task. Although our proposed method performs slightly worse than LULA in terms of the AUROC, it outperforms all the baselines in terms of AUPR. \begin{table*}[t] \begin{center} \scriptsize \captionsetup{font=small} \caption{\textbf{Misclassification Results.} Ent and MaxP stand for Entropy and Max Probability, respectively. Settings stand for post-hoc or traditional, i.e., training the entire model from scratch.} \vspace{-1.5em} \begin{tabular}{llllllllll} \\ \toprule \textbf{Methods} & \textbf{Settings} & \textbf{Metric} & \textbf{MNIST}& \makecell{\textbf{CIFAR 10}} & \makecell{\textbf{CIFAR 100}}& \textbf{Metric} & \textbf{MNIST}& \makecell{\textbf{CIFAR 10}} & \makecell{\textbf{CIFAR 100}}\\ \hline Base Model(Ent) & Traditional & AUROC & 96.7$\pm$0.9 & 92.1$\pm$0.2 & 87.2$\pm$0.2 & AUPR & 37.4$\pm$4.0 & 47.5$\pm$1.2 & 67.0$\pm$1.2 \\ Base Model(MaxP) & Traditional & AUROC & 96.7$\pm$0.9 & 92.1$\pm$0.2 & 86.8$\pm$0.2 & AUPR & 39.4$\pm$3.6 & 46.6$\pm$1.1 & 65.7$\pm$1.0 \\ Whitebox &Post-hoc & AUROC & 94.9$\pm$0.2 & 90.2$\pm$0.1 & 80.3$\pm$0.1 & AUPR & 30.4$\pm$0.3 & 45.7$\pm$0.2 & 52.5$\pm$0.3 \\ LULA &Post-hoc & AUROC & \textcolor{violet}{\textbf{98.8}$\pm$0.1} & \textcolor{violet}{\textbf{94.5}$\pm$0.0} & \textcolor{violet}{\textbf{87.5}$\pm$0.1} & AUPR & 40.7$\pm$4.2 & 47.3$\pm$0.7 & 66.0$\pm$0.4 \\ \hline \textbf{Ours(Ent)} &Post-hoc & AUROC & 96.9$\pm$0.6 & 91.1$\pm$0.2 & 83.4$\pm$0.1 & AUPR & 35.6$\pm$4.5 & 50.0$\pm$3.1 & 66.3$\pm$0.4 \\ \textbf{Ours(MaxP)} &Post-hoc & AUROC & 97.4$\pm$0.4 & 92.2$\pm$0.7 & 85.8$\pm$0.2 & AUPR & \textcolor{violet}{\textbf{44.5}$\pm$5.1} & \textcolor{violet}{\textbf{54.2}$\pm$3.2} & \textcolor{violet}{\textbf{68.2}$\pm$0.5} \\ \toprule \end{tabular} \label{table:miss-class} \end{center} \vspace{-1.2em} \end{table*} \begin{table*}[t] \begin{center} \scriptsize \captionsetup{font=small} \caption{\textbf{Trustworthy Transfer Learning Results.} Ent, MaxP, MI, and Dent stand for different uncertainty measurements, i.e., Entropy, Max Probability, Mutual Information, and Differential Entropy, respectively. We use ResNet-50 pretrained with ImageNet as the source model and FashionMNIST as OOD samples.} \vspace{-1.5em} \begin{tabular}{lllllllll} \\ \toprule \textbf{Methods} &\textbf{Target} &\textbf{Test Acc} & \textbf{AUROC} & \textbf{AUPR}& \textbf{Target} &\textbf{Test Acc}& \textbf{AUROC} & \textbf{AUPR} \\ \hline FineTune(Ent) &\textbf{STL10} &48.1$\pm$0.5 & 89.2$\pm$0.9 & 89.3$\pm$1.2 & \textbf{CIFAR10} &65.0$\pm$0.4 &74.8$\pm$1.6 &71.6$\pm$1.8 \\ FineTune(MaxP) & &48.1$\pm$0.5 & 81.8$\pm$1.2 & 83.2$\pm$1.7 & &65.0$\pm$0.4 &72.7$\pm$1.4&69.4$\pm$1.5 \\ \hline CrossEnt Loss(Ent) & &48.0$\pm$0.2 & 88.9$\pm$1.0 & 87.4$\pm$1.5 & &86.3$\pm$0.1 &85.0$\pm$ 1.0& 82.2$\pm$1.9 \\ CrossEnt Loss(MaxP) & &48.0$\pm$0.2 & 84.9$\pm$0.7 & 84.7$\pm$0.8 & &86.3$\pm$0.1 &83.1$\pm$0.9& 79.0$\pm$1.6 \\ \hline \textbf{Ours(Ent)} & &47.2$\pm$0.3 & \textcolor{violet}{\textbf{91.8$\pm$0.8}} & \textcolor{violet}{\textbf{91.3$\pm$0.7}} & &86.6$\pm$0.3 &89.9$\pm$1.3&88.8$\pm$1.5\\ \textbf{Ours(MaxP)}& &47.2$\pm$0.3 & 87.3$\pm$1.7 & 87.9$\pm$1.5 & &86.6$\pm$0.3 &87.6$\pm$1.6&85.5$\pm$2.0 \\ \textbf{Ours(MI)} & &47.2$\pm$0.3 & 90.2$\pm$2.0 & 88.7$\pm$2.8 & &86.6$\pm$0.3 &90.8$\pm$0.9&89.9$\pm$1.2\\ \textbf{Ours(Dent)}& &47.2$\pm$0.3 & 91.7$\pm$1.0 & 90.3$\pm$1.7 & &86.6$\pm$0.3 &\textcolor{violet}{\textbf{92.0$\pm$0.8}}& \textcolor{violet}{\textbf{91.1$\pm$0.8}}\\ \toprule \end{tabular} \label{table:transfer} \end{center} \vspace{-1.5em} \end{table*} \subsection{Trustworthy Transfer Learning}\label{sec:transfer} We use ImageNet pretrained ResNet-50 as our source domain base model and adapt the pretrained model to the target task by training the meta-model using the target domain training data. Unlike traditional transfer learning, which only focuses on testing prediction accuracy on the target task, we also evaluate the UQ ability of the meta-model in terms of OOD detection performance. We use FashionMNIST as OOD samples for both target tasks STL10 and CIFAR10 and evaluate the AUROC score. The results are shown in Table~\ref{table:transfer}. Our proposed meta-model method can achieve comparable prediction performance to the baseline methods and significantly improve the OOD detection performance, which is crucial in trustworthy transfer learning. \subsection{Discussion}\label{sec:ablation} In this section, we further investigate our proposed method through an ablation study using the CIFAR10 OOD task. Based on our insights and the empirical results, we conclude the following four key factors in the success of our meta-model based method: \textbf{Feature Diversity.} We replace our proposed meta-model structure with a simple linear classifier attached to only the final layer. The ablation results are shown in Table~\ref{table:ablation-structure} as ``\textbf{Linear-Meta}''. It can be observed here and in Figure~\ref{fig: toy_problem} that the performance degrades without using features from all intermediate layers, which further justifies the importance of feature diversity and the effectiveness of our meta-model structure. \textbf{Dirichlet Technique.} Instead of using a meta-model to parameterize a Dirichlet distribution, we train the meta-model using the standard cross-entropy loss, which simply outputs a categorical label distribution. The ablation results are shown in Table~\ref{table:ablation-structure} as ``\textbf{Cross-Ent}''. It can be shown that performance degrades again because it cannot quantify epistemic uncertainty, which justifies the effectiveness of using Bayesian techniques. \textbf{Validation for Uncertainty Learning.} We retrain the last layer of the base model using the cross-entropy loss with the proposed validation trick. The results are shown in Table~\ref{table:ablation-structure} as ``\textbf{LastLayer}''. It turns out even such a naive method can achieve improved performance compared to the base model, which further justifies the effectiveness of the post-hoc uncertainty learning setting, i.e., the benefit of solely focusing on UQ performance at the second stage. This interesting observation inspires us to conjecture that efficiently retraining the classifier of the base model at the second stage will lead to better UQ performance. A theoretical investigation of this observation can be interesting for future work. \textbf{Data Efficiency.} Instead of using all the training samples, we randomly choose only $10\%$ samples to train the meta-model. The results are shown in Table~\ref{table:ablation-structure} as ``$10\%$\textbf{data}''. It can be observed that our meta-model requires a small amount of data to achieve comparable performance due to the smaller model complexity. Therefore, our proposed method is also more computationally efficient than the approaches that retrain the whole model from scratch. \begin{table}[h] \begin{center} \scriptsize \captionsetup{font=small} \caption{\textbf{Ablation Study of Meta-model (CIFAR10 AUROC score).} The results are reported as mean over five experiment trails. Error bars are provided in Table~\ref{table:ablation-structure-appendix} in the Appendix.} \vspace{-1.5em} \begin{tabular}{lllllll} \\ \toprule \textbf{Methods} & \textbf{SVHN}& \textbf{FMNIST} & \textbf{LSUN}& \textbf{TIM} &\textbf{Corrupted} \\ \hline Base Model(Ent) & 86.4 & 90.8 & 89.0 & 87.5 & 85.9 \\ Base Model(MaxP) & 86.3 & 90.4 & 88.7 & 87.3 & 85.7 \\ \hline \textbf{Linear-Meta(Ent)} & 90.4 & 91.3 & 91.5 & 89.5 & 90.4 \\ \textbf{Linear-Meta(MaxP)} & 90.1 & 91.5 & 91.4 & 89.6 & 90.1 \\ \textbf{Linear-Meta(MI)} & 90.6 & 90.1 & 91.2 & 88.8 & 90.5 \\ \textbf{Linear-Meta(Dent)} & 90.4 & 90.7 & 91.4 & 89.2 & 90.3 \\ \textbf{Linear-Meta(Prec)} & 90.6 & 90.0 & 91.2 & 88.8 & 90.6\\ \hline \textbf{Cross-Ent(Ent)} & 94.2 & 91.2 & 91.2 & 90.3& 94.7 \\ \textbf{Cross-Ent(MaxP)} & 93.3& 91.1 &90.9 & 90.0 & 94.0 \\ \hline \textbf{LastLayer(Ent)}& 93.0& 90.2 & 91.9 & 89.9& 93.1 \\ \textbf{LastLayer(MaxP)} & 92.9 & 90.5 &91.9& 90.1 & 93.1\\ \hline \textbf{$10\%$data(Ent)} & 90.0 &89.1& 88.7 & 88.2& 90.2 \\ \textbf{$10\%$data(MaxP)} & 90.9 & 88.1&86.9& 86.5& 91.7 \\ \textbf{$10\%$data(MI)}& 99.9 & 98.1 & 95.4& 97.2 & 99.9 \\ \textbf{$10\%$data(Dent)} & 96.7 & 97.4 & 94.3& 95.7 & 96.7\\ \textbf{$10\%$data(Prec)} & 99.9& 98.0& 95.4 & 97.3& 99.9 \\ \hline \textbf{Ours(Ent)} & 96.3 &89.0& 89.6 & 89.4& 95.9 \\ \textbf{Ours(MaxP)} & 95.6 & 87.8 &89.1 & 88.2 & 94.0 \\ \textbf{Ours(MI)}& \textcolor{violet}{\textbf{100.0}} & \textcolor{violet}{\textbf{98.8}} & 95.2 & \textcolor{violet}{\textbf{98.1}} & \textcolor{violet}{\textbf{100.0}} \\ \textbf{Ours(Dent)} & \textcolor{violet}{\textbf{100.0}} & 98.4 & \textcolor{violet}{\textbf{95.7}} & 97.7 & \textcolor{violet}{\textbf{100.0}} \\ \textbf{Ours(Prec)} & \textcolor{violet}{\textbf{100.0}} & \textcolor{violet}{\textbf{98.8}} & 95.1 & \textcolor{violet}{\textbf{98.1}} & \textcolor{violet}{\textbf{100.0}} \\ \toprule \end{tabular} \label{table:ablation-structure} \end{center} \vspace{-1.5em} \end{table} \section{Derivation of ELBO loss} \label{sec:ELBO-appendix} The Dirichlet ELBO loss can be fomulated as follows: \begin{align} {\mathcal{L}}_{\mathrm{VI}}({\bm{w}}_g) &=\frac{1}{N_M}\sum_{i=1}^{N_M} \mathbb{E}_{q(\boldsymbol{\pi}| \Phi({\bm{x}}_i); {\bm{w}}_g)}[\log P(y_i \mid \boldsymbol{\pi}, \boldsymbol{x}_i)] \nonumber \\ &- \lambda\cdot\mathrm{KL}\left(q(\boldsymbol{\pi}| \Phi({\bm{x}}_i); {\bm{w}}_g) \| P(\boldsymbol{\pi} | \Phi({\bm{x}}_i))\right) \end{align} \normalsize The second term in the summation is simply the KL-divergence between variational distribution parameterized by the meta model and the predefined prior distribution, i.e., $\mathrm{KL}\left( \operatorname{Dir}(\boldsymbol{\pi}| \boldsymbol{\alpha}^{(i)}) \| \operatorname{Dir}(\boldsymbol{\pi} | \boldsymbol{\beta})\right)$. The first term in the summation is the expectation of cross-entropy loss w.r.t the variational Dirichlet distribution, whose closed form can be obtained as follows, \begin{align} &\mathbb{E}_{q(\boldsymbol{\pi}| \Phi({\bm{x}}_i); {\bm{w}}_g)}[\log P(y_i \mid \boldsymbol{\pi}, \boldsymbol{x}_i)] \nonumber \\ =& \mathbb{E}_{ \operatorname{Dir}(\boldsymbol{\pi}| \boldsymbol{\alpha}^{(i)})}[\log \boldsymbol{\pi}_{y_i}]\\ =& \int \log \boldsymbol{\pi}_{y_i} \operatorname{Dir}(\boldsymbol{\pi}| \boldsymbol{\alpha}^{(i)}) d\boldsymbol{\pi}\\ =&\int_{0}^{1} \log \boldsymbol{\pi}_{y_i} \operatorname{Beta}(\alpha^{(i)}_{y_i}, \alpha^{(i)}_{0}-\alpha^{(i)}_{y_i}) d\boldsymbol{\pi}_{y_i}\\ =& \int_{0}^{1} \log \boldsymbol{\pi}_{y_i} \frac {\boldsymbol{\pi}_{y_i}^{\alpha^{(i)}_{y_i}-1}(1-\boldsymbol{\pi}_{y_i})^{\alpha^{(i)}_{0}-\alpha^{(i)}_{y_i}-1}} {\operatorname{B}(\alpha^{(i)}_{y_i}, \alpha^{(i)}_{0}-\alpha^{(i)}_{y_i})} d\boldsymbol{\pi}_{y_i}\\ =& \frac {\int_{0}^{1} \frac {d \boldsymbol{\pi}_{y_i}^{\alpha^{(i)}_{y_i}-1}}{d\alpha^{(i)}_{y_i}}(1-\boldsymbol{\pi}_{y_i})^{\alpha^{(i)}_{0}-\alpha^{(i)}_{y_i}-1} d\boldsymbol{\pi}_{y_i}} {\operatorname{B}(\alpha^{(i)}_{y_i}, \alpha^{(i)}_{0}-\alpha^{(i)}_{y_i})} \\ =& \frac { \frac{d}{d\alpha^{(i)}_{y_i}} \int_{0}^{1} \boldsymbol{\pi}_{y_i}^{\alpha^{(i)}_{y_i}-1} (1-\boldsymbol{\pi}_{y_i})^{\alpha^{(i)}_{0}-\alpha^{(i)}_{y_i}-1} d\boldsymbol{\pi}_{y_i}} {\operatorname{B}(\alpha^{(i)}_{y_i}, \alpha^{(i)}_{0}-\alpha^{(i)}_{y_i})} \\ =& \frac {1} {\operatorname{B}(\alpha^{(i)}_{y_i}, \alpha^{(i)}_{0}-\alpha^{(i)}_{y_i})} \frac {d\operatorname{B}(\alpha^{(i)}_{y_i}, \alpha^{(i)}_{0}-\alpha^{(i)}_{y_i})} {d\alpha^{(i)}_{y_i}}\\ =& \frac {d \log \operatorname{B}(\alpha^{(i)}_{y_i}, \alpha^{(i)}_{0}-\alpha^{(i)}_{y_i})} {d\alpha^{(i)}_{y_i}}\\ =& \frac {d \left(\log \Gamma(\alpha^{(i)}_{y_i})+ \log \Gamma(\alpha^{(i)}_{0}-\alpha^{(i)}_{y_i}) - \log \Gamma(\alpha^{(i)}_{0})\right)} {d\alpha^{(i)}_{y_i}}\\ =& \frac {d \log \Gamma(\alpha^{(i)}_{y_i})}{d\alpha^{(i)}_{y_i}} - \frac {d \log \Gamma(\alpha^{(i)}_{0})}{d\alpha^{(i)}_{0}}\\ =& \psi\left(\alpha^{(i)}_{y_i}\right)-\psi\left(\alpha^{(i)}_{0}\right) \end{align} Therefore, the ELBO loss can be formulated as the closed form as follows, \begin{align} {\mathcal{L}}_{\mathrm{VI}}({\bm{w}}_g) &= \frac{1}{N_M}\sum_{i=1}^{N_M} \psi\left(\alpha^{(i)}_{y_i}\right)-\psi\left(\alpha^{(i)}_{0}\right) \nonumber\\ &- \lambda\cdot \mathrm{KL}\left( \operatorname{Dir}(\boldsymbol{\pi}| \boldsymbol{\alpha}^{(i)}) \| \operatorname{Dir}(\boldsymbol{\pi} | \boldsymbol{\beta})\right). \end{align} \newpage \section{Experiment Setup} \label{setup-appendix} \subsection{Implementation Details for OOD and Misclassification} The post-hoc uncertainty learning problem aims to improve the UQ performance of a pretrained base model. First, we generate the pretrained model by training the base model using cross-entropy loss to achieve optimal testing accuracy. The maximum epochs for training LeNet, VGG-16, and WideResNet-16 are set to be 20, 200, and 200, respectively. Then, in the second stage, we freeze the parameter of the pretrained base model and train the meta-model on top of it using the Dirichlet variational loss. The meta-model uses the same training data as the base model, and the maximum epochs for training the meta-model is set to be 50. All the models are optimized using an SGD optimizer. The hyper-parameters for training the base model and meta-model are summarized in Table~\ref{table: hyper}, where $bs$ denotes the batch size, $lr$ denotes the learning rate, $m$ denotes the momentum, $wd$ denotes the weight decay, $\lambda$ is the hyper-parameter to balance the two terms in variational loss, and $\beta$ is the concentration parameter of prior Dirichlet distribution. All experiments are implemented in PyTorch using Titan RTX GPUs with 24 GB memory. \begin{table*}[t] \caption{Hyper-parameter for training the base model and meta-model} \centering \begin{tabular}{llllllllll} \toprule Dataset & Model & Epoch & $bs$ & $\lambda$ & $\beta$ & $lr$ & $m$ & $wd$\\ \midrule MNIST & LeNet-Base & 20 & 128 & / & / & 0.01 & 0.9 & $5\times10^{-4}$ \\ \midrule MNIST & LeNet-Meta & 50 & 128 & $10^{-1}$ & 1 & 0.1 & 0.9 & $5\times10^{-4}$ \\ \midrule CIFAR10 & VGG16-Base & 200 & 128 & / & / & 0.1 & 0.9 & $1\times10^{-4}$ \\ \midrule CIFAR10 & VGG16-Meta & 50 & 128 & $10^{-3}$ & 1 & 0.001 & 0.9 & $1\times10^{-4}$ \\ \midrule CIFAR100 & WideResNet-Base & 200 & 128 & / & / & 0.1 & 0.9 & $1\times10^{-4}$ \\ \midrule CIFAR100 & WideResNet-Meta & 50 & 128 & $10^{-3}$ & 1 & 0.1 & 0.9 & $1\times10^{-4}$ \\ \bottomrule \end{tabular} \label{table: hyper} \end{table*} \subsection{Implementation Details of Trustworthy Trnasfer Learning} We download the pretrained ResNet-50 trained on ImageNet as the base-model. Similarly, we freeze the parameter of the pretrained model and train the meta-model on top of it using the training data of the target task. All the models are optimized using an SGD optimizer. The hyper-parameters for training the meta-model are summarized in Table~\ref{table: hyper-transfer}, where $bs$ denotes the batch size, $lr$ denotes the learning rate, $m$ denotes the momentum, $wd$ denotes the weight decay, $\lambda$ is the hyper-parameter to balance the two terms in variational loss, and $\beta$ is the concentration parameter of prior Dirichlet distribution. \begin{table*}[t] \caption{Hyper-parameter} \centering \begin{tabular}{llllllllll} \toprule Dataset & Model & Epoch & $bs$ & $\lambda$ & $\beta$ & $lr$ & $m$ & $wd$\\ \midrule STL10 & ResNet50-Meta & 50 & 128 & $10^{-3}$ & 1 & 0.01 & 0.9 & $1\times10^{-4}$ \\ \midrule CIFAR10 & ResNet50-Meta & 50 & 128 & $10^{-3}$ & 1 & 0.01 & 0.9 & $1\times10^{-4}$ \\ \bottomrule \end{tabular} \label{table: hyper-transfer} \end{table*} \subsection{Meta-Model Structure} The high-level description of the meta-model structure is provided in~\ref{subsec: model}. More specifically, all the linear layers ${\bm{g}}_{i}$ and ${\bm{g}}_{c}$ consist of three elements: a fully-connected layer, ReLU activation function, and Max-Pooling. Each ${\bm{g}}_{i}$ has multiple fully-connected layers, each is followed by a ReLU and a Max-Pooling, each fully-connected layer reduces the input feature dimension to half size, and the output meta-feature of ${\bm{g}}_{i}$ has the dimension as the class number, e.g., 10 for CIFAR10. The final linear layer ${\bm{g}}_{c}$ is a single fully-connected layer that takes the concatenation of all the meta-feature and outputs the concentration parameter $\alpha$. \subsection{Training Time Complexity} Our meta-model-based approach is much more efficient than traditional uncertainty quantification approaches due to the simpler structure and faster convergence speed. To quantitatively demonstrate such efficiency, we measure the wall-clock time of training the meta-model in seconds (on a single Titan RTX GPU) as follows. The training time of training VGG16 model on CIFAR10 dataset is 66.5s for five epochs; The training time of training WideResNet model on CIFAR100 dataset is 241.9s for ten epochs. The training time of the meta-model can be negligible compared to those approaches training the entire base model from scratch (usually taking several hours). \subsection{Validation for Uncertainty Learning} We use the proposed validation trick discussed in~\ref{sec:validation} to perform early stopping in the training of the meta-model. We randomly pick $\%20$ training data as our validation set. For the OOD detection task, we create the noisy validation set by by applying various kinds of noise and perturbation to the original images, including permuting the pixels, applying Gaussian blurring, and contrast re-scaling. For the misclassification task, we directly use the validation set to evaluate the misclassification detection performance with the correctly classified and miss-classified validation samples. \subsection{Description of OOD datasets} \label{ood-dataset-appendix} For OOD detection task, we use the testing set as in-domain dataset, and make sure the out of domain dataset has the same number of samples (10000 samples) as in-domain dataset. Different dataset input images are resized to 32x32 to ensure they have the same size, and all gray-scale images are converted into three-channel images. We use the following datasets as OOD samples for the OOD detection task: \begin{itemize} \item \textbf{Omniglot} contains 1632 hand-written characters taken from 50 different alphabets. We randomly pick 10000 images from its testing set as OOD samples for MNIST. \item \textbf{Fashion-MNIST} is a dataset of Zalando's article images. We use the testing set with 10000 images as OOD samples for both MNIST and CIFAR. \item \textbf{KMNIST} contains handwritten characters from the Japanese Kuzushiji texts. We use the testing set with 10000 images as OOD samples for MNIST. \item \textbf{SVHN} contains images of house numbers taken from Google Street View. We use the testing set with 10000 images as OOD samples for CIFAR. \item \textbf{LSUN} The Large-scale Scene UNderstanding dataset(LSUN) is a dataset of different objects taken from 10 different scene categories. We use the images from the classroom categories and randomly sample 10000 training images as OOD samples for CIFAR. \item \textbf{TIM} TinyImageNet(TIM) is a subset of the ImageNet dataset, and we use the validation set with 10000 images as OOD samples for CIFAR \item \textbf{Corrupted} is an artificial dataset generated by perturbing the original testing image using Gaussian blurring, pixel permutation, and contrast re-scaling. \end{itemize} \section{Additional Experiment Results} \label{results-appendix} \subsection{OOD Detection} In the following, we compare our proposed method with several SOTA uncertainty quantification methods with traditional settings on the OOD detection task. The results are shown in~Table \ref{table:OOD-appendix}. our proposed method can still outperform these methods. We provide additional OOD detection results in terms of AUPR score as shown in~Table \ref{table: OOD-aupr}. \begin{table*}[t] \begin{center} \scriptsize \captionsetup{font=small} \caption{\textbf{OOD Detection AUROC score.} MI, Dent, and Prec stand for different epistemic uncertainty metrics, i.e., Mutual Information, Differential Entropy, and precision. Settings stand for post-hoc or traditional, i.e., training the entire model from scratch. Additional Data stands for if using additional training data or not.} \vspace{-1.5em} \begin{tabular}{lllllllll} \\ \toprule \textbf{ID Data}\ \&\ \textbf{Model} & \textbf{Methods} & \textbf{Settings} & \textbf{Additional Data} & \textbf{Omniglot}& \textbf{FMNIST} & \textbf{KMNIST}& \textbf{CIFAR10} &\textbf{Corrupted} \\ \hline MNIST & Base Model(Ent) & Traditional & No & 98.9$\pm$0.5 & 97.8$\pm$0.8 & 95.8$\pm$0.8 & 99.4$\pm$0.2 & 99.5$\pm$0.3 \\ LeNet & Base Model(MaxP) & Traditional & No & 98.7$\pm$0.6 & 97.6$\pm$0.8 & 95.6$\pm$0.8 & 99.3$\pm$0.2 & 99.4$\pm$0.4 \\ & MCDropout & Traditional & No & 98.2$\pm$0.1 & 98.1$\pm$0.4 & 92.9$\pm$0.3 & 99.3$\pm$0.4 & 98.7$\pm$0.2 \\ & BeBayesian & Traditional & No & 99.2$\pm$0.4 & 98.5$\pm$0.5 & 96.1$\pm$0.9 & 99.5$\pm$0.2 & 99.7$\pm$0.2 \\ & PostNet & Traditional & No & 99.0$\pm$0.5 & 99.1$\pm$0.5 & 99.3$\pm$0.3 & 99.0$\pm$0.2 & 98.9$\pm$0.7 \\ & ALOE & Traditional & Yes & 100.0$\pm$0.1 & 99.0$\pm$0.3 & 96.7$\pm$0.6 & 99.8$\pm$0.1 & 100.0$\pm$0.0 \\ \hline & \textbf{Ours(Ent)} & Post-hoc & No & 99.7$\pm$0.1 & 99.5$\pm$0.2 & 98.2$\pm$0.3 & \textcolor{violet}{\textbf{100.0}$\pm$0.0} & \textcolor{violet}{\textbf{100.0}$\pm$0.0} \\ & \textbf{Ours(MaxP)} & Post-hoc & No & 99.3$\pm$0.2 & 99.3$\pm$0.2 & 98.0$\pm$0.2 & \textcolor{violet}{\textbf{100.0}$\pm$0.0} & \textcolor{violet}{\textbf{100.0}$\pm$0.0} \\ & \textbf{Ours(MI)} & Post-hoc & No & \textcolor{violet}{\textbf{99.9}$\pm$0.0} & \textcolor{violet}{\textbf{99.6}$\pm$0.2} &97.7$\pm$0.4 & \textcolor{violet}{\textbf{100.0}$\pm$0.0} & \textcolor{violet}{\textbf{100.0}$\pm$0.0} \\ & \textbf{Ours(Dent)} & Post-hoc & No & 99.8$\pm$0.0 & 99.5$\pm$0.2 & 97.6$\pm$0.4 & \textcolor{violet}{\textbf{100.0}$\pm$0.0} & \textcolor{violet}{\textbf{100.0}$\pm$0.0} \\ & \textbf{Ours(Prec)} & Post-hoc & No & \textcolor{violet}{\textbf{99.9}$\pm$0.0} & \textcolor{violet}{\textbf{99.5}$\pm$0.2} &97.7$\pm$0.5 & \textcolor{violet}{\textbf{100.0}$\pm$0.0} & \textcolor{violet}{\textbf{100.0}$\pm$0.0} \\ \toprule \textbf{ID Data}\ \&\ \textbf{Model} & \textbf{Methods} & \textbf{Settings} & \textbf{Additional Data} & \textbf{SVHN}& \textbf{FMNIST} & \textbf{LSUN}& \textbf{TinyImageNet} &\textbf{Corrupted} \\ \hline CIFAR10 & Base Model(Ent) & Traditional & No & 86.4$\pm$4.6 & 90.8$\pm$1.3 & 89.0$\pm$0.5 & 87.5$\pm$1.1 & 85.9$\pm$8.2 \\ VGG16 & Base Model(MaxP) & Traditional & No & 86.3$\pm$4.4 & 90.4$\pm$1.2 & 88.7$\pm$0.5 & 87.3$\pm$1.1 & 85.7$\pm$8.1 \\ & MCDropout & Traditional & No & 75.6$\pm$1.1 & 80.9$\pm$0.5 & 85.1$\pm$1.6 & 80.0$\pm$1.3 & 86.8$\pm$1.1 \\ & BeBayesian &Traditional & No & 91.7$\pm$3.9 & 88.3$\pm$0.6 & 83.2$\pm$0.6 & 81.0$\pm$0.6 & 94.6$\pm$4.6 \\ & PostNet & Traditional & No & 93.7$\pm$1.2 & 95.8$\pm$2.8 & 93.3$\pm$3.4 & 92.4$\pm$2.9 & 93.4$\pm$2.2 \\ & ALOE & Traditional & Yes & 99.9$\pm$1.1 & 98.3 $\pm$ 0.7 & 92.1$\pm$1.3 & 99.9$\pm$0.1 & 96.2$\pm$0.7 \\ \hline & \textbf{Ours(Ent)} & Post-hoc & No & 96.3$\pm$3.0 &89.0$\pm$5.2 & 89.6$\pm$3.4 & 89.4$\pm$3.5& 95.9$\pm$4.3 \\ & \textbf{Ours(MaxP)} & Post-hoc & No & 95.6$\pm$3.6 & 87.8$\pm$4.4 &89.1$\pm$2.4 & 88.2$\pm$2.6 & 94.0$\pm$7.3 \\ & \textbf{Ours(MI)} & Post-hoc & No & \textcolor{violet}{\textbf{100.0$\pm$0.0}} & \textcolor{violet}{\textbf{98.8$\pm$0.5}} & 95.2$\pm$0.9 & \textcolor{violet}{\textbf{98.1$\pm$0.3}} & \textcolor{violet}{\textbf{100.0$\pm$0.0}} \\ & \textbf{Ours(Dent)} & Post-hoc & No & \textcolor{violet}{\textbf{100.0$\pm$0.0}} & 98.4$\pm$0.9 & \textcolor{violet}{\textbf{95.7}$\pm$0.8} & 97.7$\pm$0.5 & \textcolor{violet}{\textbf{100.0$\pm$0.0}} \\ & \textbf{Ours(Prec)} & Post-hoc & No & \textcolor{violet}{\textbf{100.0$\pm$0.0}} & \textcolor{violet}{\textbf{98.8$\pm$0.5}} & 95.1$\pm$0.5 & \textcolor{violet}{\textbf{98.1$\pm$0.3}} & \textcolor{violet}{\textbf{100.0$\pm$0.0}} \\ \toprule CIFAR100 & Base Model(Ent) & Traditional & No & 76.2$\pm$5.2 & 77.8$\pm$2.4 & 80.1$\pm$0.5 & 79.7$\pm$0.3 & 65.8$\pm$11.4 \\ WideResNet & Base Model(MaxP) & Traditional & No & 73.9$\pm$4.3 & 76.4$\pm$2.3 & 78.7$\pm$0.5 & 78.0$\pm$0.2 & 63.8$\pm$10.4 \\ & MCDropout & Traditional & No & 77.6$\pm$1.9 & 77.1$\pm$0.4 & 77.0$\pm$3.5 & 79.7$\pm$0.4 & 64.4$\pm$8.9 \\ & BeBayesian &Traditional & No & 74.9$\pm$8.2 & 81.0$\pm$2.1 & 80.0$\pm$0.7 & 79.6$\pm$0.2 & 63.0$\pm$13.7 \\ & PostNet & Traditional & No & 83.4$\pm$1.6 & 83.1$\pm$3.2 & 81.0$\pm$1.3 & 80.1$\pm$1.1 & 87.7$\pm$4.2 \\ & ALOE & Traditional & Yes & 93.9$\pm$0.3 & 86.9$\pm$3.7 & 70.2$\pm$1.2 & 85.3$\pm$3.7 & 92.2$\pm$1.5 \\ \hline & \textbf{Ours(Ent)} & Post-hoc & No & 92.6$\pm$2.0 & 80.8$\pm$3.0 & 81.1$\pm$1.2 & 84.9$\pm$1.2& 85.6$\pm$3.9 \\ & \textbf{Ours(MaxP)} & Post-hoc & No & 88.6$\pm$3.2 & 78.4$\pm$3.0 & 79.7$\pm$0.6 & 82.4$\pm$0.6& 79.3$\pm$4.5 \\ & \textbf{Ours} & Post-hoc & No & 94.3$\pm$1.0 & \textcolor{violet}{\textbf{84.4}$\pm$1.8} & 81.9$\pm$4.7 & 85.5$\pm$3.6 & \textcolor{violet}{\textbf{90.8}$\pm$3.3} \\ & \textbf{Ours(Dent)} & Post-hoc & No & 93.3$\pm$1.4 & 84.0$\pm$2.3 & 79.5$\pm$3.0 & 84.6$\pm$2.8& 89.8$\pm$2.6 \\ & \textbf{Ours(Prec)} & Post-hoc & No & \textcolor{violet}{\textbf{94.4}$\pm$1.0} & \textcolor{violet}{\textbf{84.4}$\pm$1.7} & \textcolor{violet}{\textbf{82.1}$\pm$4.9} & \textcolor{violet}{\textbf{85.6}$\pm$3.6}& \textcolor{violet}{\textbf{90.8}$\pm$3.4} \\ \toprule \end{tabular} \label{table:OOD-appendix} \end{center} \vspace{-1.5em} \end{table*} \begin{comment} \begin{table*}[h] \begin{center} \scriptsize \captionsetup{font=small} \caption{\textbf{CIFAR10 OOD Detection AUROC score} } \vspace{-1.5em} \begin{tabular}{lllllllll} \\ \toprule \makecell{\textbf{ID Data}\\/\textbf{Model}} & \textbf{Methods} & \textbf{Settings} & \textbf{Additional Data} & \textbf{SVHN}& \textbf{FMNIST} & \textbf{LSUN}& \textbf{TIM} &\textbf{Corrupted} \\ \hline CIFAR10 & Base Model(Ent) & Traditional & No & 86.4$\pm$4.6 & 90.8$\pm$1.3 & 89.0$\pm$0.5 & 87.5$\pm$1.1 & 85.9$\pm$8.2 \\ VGG16 & Base Model(MaxP) & Traditional & No & 86.3$\pm$4.4 & 90.4$\pm$1.2 & 88.7$\pm$0.5 & 87.3$\pm$1.1 & 85.7$\pm$8.1 \\ & MCDropout & Traditional & No & 75.6$\pm$1.1 & 80.9$\pm$0.5 & 85.1$\pm$1.6 & 80.0$\pm$1.3 & 86.8$\pm$1.1 \\ & BeBayesian &Traditional & No & 91.7$\pm$3.9 & 88.3$\pm$0.6 & 83.2$\pm$0.6 & 81.0$\pm$0.6 & 94.6$\pm$4.6 \\ & PostNet & Traditional & No & 93.7$\pm$1.2 & 95.8$\pm$2.8 & 93.3$\pm$3.4 & 92.4$\pm$2.9 & 93.4$\pm$2.2 \\ \hline & \textbf{Ours(Ent)} & Post-hoc & No & 96.3$\pm$3.0 &89.0$\pm$5.2 & 89.6$\pm$3.4 & 89.4$\pm$3.5& 95.9$\pm$4.3 \\ & \textbf{Ours(MaxP)} & Post-hoc & No & 95.6$\pm$3.6 & 87.8$\pm$4.4 &89.1$\pm$2.4 & 88.2$\pm$2.6 & 94.0$\pm$7.3 \\ & \textbf{Ours(MI)} & Post-hoc & No & 100.0$\pm$0.0 & 98.8$\pm$0.5 & 95.2$\pm$0.9 & 98.1$\pm$0.3 & 100.0$\pm$0.0 \\ & \textbf{Ours(Dent)} & Post-hoc & No & \textcolor{violet}{\textbf{100.0}$\pm$0.0} & \textcolor{violet}{\textbf{98.4}$\pm$0.9} & \textcolor{violet}{\textbf{95.7}$\pm$0.8} & \textcolor{violet}{\textbf{97.7}$\pm$0.5} & \textcolor{violet}{\textbf{100.0}$\pm$0.0} \\ & \textbf{Ours(Prec)} & Post-hoc & No & 100.0$\pm$0.0 & 98.8$\pm$0.5 & 95.1$\pm$0.5 & 98.1$\pm$0.3 & 100.0$\pm$0.0 \\ \toprule \end{tabular} \label{table:OOD-CIFAR10-appendix} \end{center} \vspace{-1.5em} \end{table*} \begin{table*}[h] \begin{center} \scriptsize \captionsetup{font=small} \caption{\textbf{CIFAR100 OOD Detection AUROC score}} \vspace{-1.5em} \begin{tabular}{lllllllll} \\ \toprule \makecell{\textbf{ID Data}\\/\textbf{Model}} & \textbf{Methods} & \textbf{Settings} & \textbf{Additional Data} & \textbf{SVHN}& \textbf{FMNIST} & \textbf{LSUN}& \textbf{TIM} &\textbf{Corrupted} \\ \hline CIFAR100 & Base Model(Ent) & Traditional & No & 76.2$\pm$5.2 & 77.8$\pm$2.4 & 80.1$\pm$0.5 & 79.7$\pm$0.3 & 65.8$\pm$11.4 \\ WideResNet & Base Model(MaxP) & Traditional & No & 73.9$\pm$4.3 & 76.4$\pm$2.3 & 78.7$\pm$0.5 & 78.0$\pm$0.2 & 63.8$\pm$10.4 \\ & MCDropout & Traditional & No & 77.6$\pm$1.9 & 77.1$\pm$0.4 & 77.0$\pm$3.5 & 79.7$\pm$0.4 & 64.4$\pm$8.9 \\ & BeBayesian &Traditional & No & 74.9$\pm$8.2 & 81.0$\pm$2.1 & 80.0$\pm$0.7 & 79.6$\pm$0.2 & 63.0$\pm$13.7 \\ & PostNet & Traditional & No & 83.4$\pm$1.6 & 83.1$\pm$3.2 & 81.0$\pm$1.3 & 80.1$\pm$1.1 & 87.7$\pm$4.2 \\ \hline & \textbf{Ours(Ent)} & Post-hoc & No & 92.6$\pm$2.0 & 80.8$\pm$3.0 & 81.1$\pm$1.2 & 84.9$\pm$1.2& 85.6$\pm$3.9 \\ & \textbf{Ours(MaxP)} & Post-hoc & No & 88.6$\pm$3.2 & 78.4$\pm$3.0 & 79.7$\pm$0.6 & 82.4$\pm$0.6& 79.3$\pm$4.5 \\ & \textbf{Ours} & Post-hoc & No & 94.3$\pm$1.0 & \textcolor{violet}{\textbf{84.4}$\pm$1.8} & 81.9$\pm$4.7 & 85.5$\pm$3.6 & \textcolor{violet}{\textbf{90.8}$\pm$3.3} \\ & \textbf{Ours(Dent)} & Post-hoc & No & 93.3$\pm$1.4 & 84.0$\pm$2.3 & 79.5$\pm$3.0 & 84.6$\pm$2.8& 89.8$\pm$2.6 \\ & \textbf{Ours(Prec)} & Post-hoc & No & \textcolor{violet}{\textbf{94.4}$\pm$1.0} & \textcolor{violet}{\textbf{84.4}$\pm$1.7} & \textcolor{violet}{\textbf{82.1}$\pm$4.9} & \textcolor{violet}{\textbf{85.6}$\pm$3.6}& \textcolor{violet}{\textbf{90.8}$\pm$3.4} \\ \toprule \end{tabular} \label{table:OOD-CIFAR100-appendix} \end{center} \vspace{-1.5em} \end{table*} \end{comment} \begin{table*}[h] \begin{center} \scriptsize \caption{\textbf{OOD Detection AUPR score.} MI, Dent, and Prec stand for different epistemic uncertainty metrics, i.e., Mutual Information, Differential Entropy, and precision. Settings stand for post-hoc or traditional, i.e., training the entire model from scratch. Additional Data stands for if using additional training data or not.} \vspace{-1.5em} \begin{tabular}{lllllllll} \\ \toprule \textbf{ID Data}\ \&\ \textbf{Model} & \textbf{Methods} & \textbf{Settings} & \textbf{Additional Data} & \textbf{Omniglot}& \textbf{FMNIST} & \textbf{KMNIST}& \textbf{CIFAR10} &\textbf{Corrupted}\\ \hline MNIST & Base Model(Ent) & Traditional & No & 98.7$\pm$0.6 & 97.6$\pm$0.8 & 95.4$\pm$0.7 & 99.4$\pm$0.2 & 99.5$\pm$0.3 \\ LeNet & Base Model(MaxP) & Traditional & No & 98.4$\pm$0.7 & 97.3$\pm$0.9 & 95.1$\pm$0.8 & 99.2$\pm$0.2 & 99.3$\pm$0.4 \\ & MCDropout & Traditional & No & 98.1$\pm$0.4 & 97.9$\pm$0.5 & 92.7$\pm$0.8 & 99.3$\pm$0.3 & 98.7$\pm$0.6 \\ & BeBayesian &Traditional & No & 99.1$\pm$0.4 & 98.4$\pm$0.5 & 95.8$\pm$0.9 & 99.5$\pm$0.2 & 99.6$\pm$0.2 \\ & Whitebox & Post-hoc & Yes & 97.8$\pm$0.3 & 97.2$\pm$0.6 & 95.3$\pm$0.3 & 99.4$\pm$0.2 & 99.4$\pm$0.2 \\ & LULA & Post-hoc & Yes & 99.8$\pm$0.0 & 99.5$\pm$0.1 & \textcolor{violet}{\textbf{99.3}$\pm$0.0} & 99.9$\pm$0.0 & 99.9$\pm$0.0 \\ \hline & \textbf{Ours(Ent)} & Post-hoc & No & 99.7$\pm$0.1 & 99.4$\pm$0.2 & 97.9$\pm$0.3 & \textcolor{violet}{\textbf{100.0}$\pm$0.0} & \textcolor{violet}{\textbf{100.0}$\pm$0.0} \\ & \textbf{Ours(MaxP)} & Post-hoc & No & 99.2$\pm$0.2 & 99.2$\pm$0.2 &97.6$\pm$0.3 & \textcolor{violet}{\textbf{100.0}$\pm$0.0} & \textcolor{violet}{\textbf{100.0}$\pm$0.0} \\ & \textbf{Ours(MI)} & Post-hoc & No & \textcolor{violet}{\textbf{99.9}$\pm$0.0} & \textcolor{violet}{\textbf{99.6}$\pm$0.2} & 97.5$\pm$0.4 & \textcolor{violet}{\textbf{100.0}$\pm$0.0} & \textcolor{violet}{\textbf{100.0}}$\pm$0.0 \\ & \textbf{Ours(Dent)} & Post-hoc & No & 99.7$\pm$0.0 & 99.4$\pm$0.3 & 97.4$\pm$0.4 & \textcolor{violet}{\textbf{100.0}$\pm$0.0} & \textcolor{violet}{\textbf{100.0}$\pm$0.0} \\ & \textbf{Ours(Prec)} & Post-hoc & No & \textcolor{violet}{\textbf{99.9}$\pm$0.0} & \textcolor{violet}{\textbf{99.6}$\pm$0.2} &97.6$\pm$0.5 & \textcolor{violet}{\textbf{100.0}$\pm$0.0} & \textcolor{violet}{\textbf{100.0}$\pm$0.0} \\ \toprule \textbf{ID Data}\ \&\ \textbf{Model} & \textbf{Methods} & \textbf{Settings} & \textbf{Additional Data} & \textbf{SVHN}& \textbf{FMNIST} & \textbf{LSUN}& \textbf{TinyImageNet} &\textbf{Corrupted} \\ \hline CIFAR10 & Base Model(Ent) & Traditional & No & 77.1$\pm$7.8 & 87.9$\pm$1.5 & 85.2$\pm$0.6 & 83.1$\pm$1.4 & 76.5$\pm$14.0 \\ VGG16 & Base Model(MaxP) & Traditional & No & 77.4$\pm$7.1 & 86.8$\pm$1.5 & 84.3$\pm$0.5 & 82.5$\pm$1.5 & 76.3$\pm$13.7 \\ & MCDropout & Traditional & No & 61.5$\pm$1.0 & 70.9$\pm$0.7 & 79.3$\pm$1.9 & 71.9$\pm$1.2 & 78.2$\pm$2.4 \\ & BeBayesian & Traditional & No & 86.5$\pm$6.6 & 86.9$\pm$0.7 & 82.3$\pm$0.7 & 80.0$\pm$0.5 & 90.8$\pm$8.5 \\ & Whitebox & Post-hoc & Yes & 92.8$\pm$1.8 & 93.4$\pm$2.4 & 85.3$\pm$2.8 & 86.8$\pm$3.0 & 90.5$\pm$2.1 \\ & LULA & Post-hoc & Yes & 97.3$\pm$1.4 & 94.8$\pm$0.0 & 93.4$\pm$0.0 & 89.2$\pm$0.0 & 97.7$\pm$1.7 \\ \hline & \textbf{OursELBO(Ent)} & Post-hoc & No & 94.0$\pm$5.7 & 87.0$\pm$5.9 & 87.2$\pm$5.0 & 88.6$\pm$4.6 & 92.3$\pm$8.2 \\ & \textbf{OursELBO(MaxP)} & Post-hoc & No & 93.6$\pm$5.0 & 86.2$\pm$4.2 & 86.7$\pm$3.5 & 87.5$\pm$3.1 & 90.4$\pm$9.1 \\ & \textbf{OursELBO} & Post-hoc & No & 100.0$\pm$0.0 & \textcolor{violet}{\textbf{98.4$\pm$0.8}} & 92.9$\pm$1.8 & \textcolor{violet}{\textbf{97.9$\pm$0.4}} & \textcolor{violet}{\textbf{100.0$\pm$0.0}} \\ & \textbf{OursELBO(Dent)} & Post-hoc & No & \textcolor{violet}{\textbf{100.0}$\pm$0.0} & 98.1$\pm$0.9 & \textcolor{violet}{\textbf{94.2}$\pm$1.1} & 97.8$\pm$0.4 & \textcolor{violet}{\textbf{100.0}$\pm$0.0} \\ & \textbf{OursELBO(Prec)} & Post-hoc & No & 100.0$\pm$0.0 & 98.3$\pm$0.9 & 92.8$\pm$1.9 & \textcolor{violet}{\textbf{97.9$\pm$0.4}} & \textcolor{violet}{\textbf{100.0$\pm$0.0}} \\ \hline CIFAR100 & Base Model(Ent) & Traditional & No & 70.8$\pm$5.7 & 73.0$\pm$1.9 & 75.2$\pm$1.1 & 76.6$\pm$0.5 & 60.5$\pm$11.9 \\ WideResNet & Base Model(MaxP) & Traditional & No& 67.4$\pm$4.4 & 71.0$\pm$1.9 & 73.3$\pm$0.9 & 73.8$\pm$0.4 & 57.7$\pm$10.1 \\ & MCDropout & Traditional & No & 67.9$\pm$2.5 & 70.4$\pm$1.5 & 72.4$\pm$3.3 & 75.6$\pm$0.7 & 55.9$\pm$6.3 \\ & BeBayesian & Traditional & No & 67.5$\pm$7.8 & 75.5$\pm$2.6 & 74.4$\pm$1.0 & 74.9$\pm$0.4 & 58.1$\pm$11.7 \\ & Whitebox & Post-hoc & Yes & 84.2$\pm$2.0 & 79.5$\pm$0.7 & 74.3$\pm$1.2 & 73.5$\pm$0.5 & 77.1$\pm$4.0 \\ & LULA & Post-hoc & Yes & 84.3$\pm$1.1 & 83.8$\pm$0.2 & 79.4$\pm$0.4 & 76.8$\pm$0.2 & 79.2$\pm$1.5 \\ \hline & \textbf{OursELBO(Ent)} & Post-hoc & No & 88.0$\pm$3.0 & 75.5$\pm$3.3 & 75.3$\pm$1.7 & 82.0$\pm$1.7& 80.0$\pm$6.3 \\ & \textbf{OursELBO(MaxP)} & Post-hoc & No & 83.5$\pm$4.6 & 73.7$\pm$2.9 & 74.2$\pm$1.1 & 79.2$\pm$0.9& 71.8$\pm$6.3 \\ & \textbf{OursELBO(MI)} & Post-hoc & No & 90.1$\pm$1.9 & \textcolor{violet}{\textbf{79.4}$\pm$1.9} & 77.1$\pm$3.6 & 83.2$\pm$4.5 & \textcolor{violet}{\textbf{86.4}$\pm$5.2} \\ & \textbf{OursELBO(Dent)} & Post-hoc & No & 88.5$\pm$2.2 & 78.6$\pm$2.8 & 74.1$\pm$3.7 & 82.0$\pm$3.6& 85.4$\pm$5.1 \\ & \textbf{OursELBO(Prec)} & Post-hoc & No & \textcolor{violet}{\textbf{90.2}$\pm$1.9} & \textcolor{violet}{\textbf{79.4}$\pm$1.8} & \textcolor{violet}{\textbf{77.4}$\pm$4.2} & \textcolor{violet}{\textbf{83.3}$\pm$4.6}& \textcolor{violet}{\textbf{86.4}$\pm$5.2} \\ \toprule \end{tabular} \label{table: OOD-aupr} \end{center} \vspace{-1.5em} \end{table*} \begin{comment} \begin{table*}[h] \begin{center} \scriptsize \caption{\textbf{CIFAR10 OOD Detection AUPR score.}} \vspace{-1.5em} \begin{tabular}{llllllll} \\ \toprule \makecell{\textbf{ID Data}\\/\textbf{Model}} & \textbf{Methods} & \textbf{Settings} & \textbf{SVHN}& \textbf{FMNIST} & \textbf{LSUN}& \textbf{TIM} &\textbf{Corrupted}\\ \hline CIFAR10 & Base Model(Ent) & No/No & 77.1$\pm$7.8 & 87.9$\pm$1.5 & 85.2$\pm$0.6 & 83.1$\pm$1.4 & 76.5$\pm$14.0 \\ VGG16 & Base Model(MaxP) & No/No& 77.4$\pm$7.1 & 86.8$\pm$1.5 & 84.3$\pm$0.5 & 82.5$\pm$1.5 & 76.3$\pm$13.7 \\ & MCDropout & No/Yes & 61.5$\pm$1.0 & 70.9$\pm$0.7 & 79.3$\pm$1.9 & 71.9$\pm$1.2 & 78.2$\pm$2.4 \\ & BeBayesian &No/Yes & 86.5$\pm$6.6 & 86.9$\pm$0.7 & 82.3$\pm$0.7 & 80.0$\pm$0.5 & 90.8$\pm$8.5 \\ & Whitebox & Yes/No & 92.8$\pm$1.8 & 93.4$\pm$2.4 & 85.3$\pm$2.8 & 86.8$\pm$3.0 & 90.5$\pm$2.1 \\ & LULA &Yes/No & 97.3$\pm$1.4 & 94.8$\pm$0.0 & 93.4$\pm$0.0 & 89.2$\pm$0.0 & 97.7$\pm$1.7 \\ \hline & \textbf{OursELBO(Ent)} &No/No & 94.0$\pm$5.7 & 87.0$\pm$5.9 & 87.2$\pm$5.0 & 88.6$\pm$4.6 & 92.3$\pm$8.2 \\ & \textbf{OursELBO(MaxP)} &No/No & 93.6$\pm$5.0 & 86.2$\pm$4.2 & 86.7$\pm$3.5 & 87.5$\pm$3.1 & 90.4$\pm$9.1 \\ & \textbf{OursELBO} &No/No & 100.0$\pm$0.0 & 98.4$\pm$0.8 & 92.9$\pm$1.8 & 97.9$\pm$0.4 & 100.0$\pm$0.0 \\ & \textbf{OursELBO(Dent)} &No/No & \textcolor{violet}{\textbf{100.0}$\pm$0.0} & \textcolor{violet}{\textbf{98.1}$\pm$0.9} & \textcolor{violet}{\textbf{94.2}$\pm$1.1} & \textcolor{violet}{\textbf{97.8}$\pm$0.4} & \textcolor{violet}{\textbf{100.0}$\pm$0.0} \\ & \textbf{OursELBO(Prec)} &No/No & 100.0$\pm$0.0 & 98.3$\pm$0.9 & 92.8$\pm$1.9 & 97.9$\pm$0.4 & 100.0$\pm$0.0 \\ \toprule \end{tabular} \label{table: OOD-CIFAR10-aupr} \end{center} \vspace{-1.5em} \end{table*} \begin{table*}[h] \begin{center} \scriptsize \caption{\textbf{CIFAR100 OOD Detection AUPR score.}} \vspace{-1.5em} \begin{tabular}{llllllll} \\ \toprule \makecell{\textbf{ID Data}\\/\textbf{Model}} & \textbf{Methods} & \textbf{Settings} & \textbf{SVHN}& \textbf{FMNIST} & \textbf{LSUN}& \textbf{TIM} &\textbf{Corrupted}\\ \hline CIFAR100 & Base Model(Ent) & No/No & 70.8$\pm$5.7 & 73.0$\pm$1.9 & 75.2$\pm$1.1 & 76.6$\pm$0.5 & 60.5$\pm$11.9 \\ WideResNet & Base Model(MaxP) & No/No& 67.4$\pm$4.4 & 71.0$\pm$1.9 & 73.3$\pm$0.9 & 73.8$\pm$0.4 & 57.7$\pm$10.1 \\ & MCDropout & No/Yes & 67.9$\pm$2.5 & 70.4$\pm$1.5 & 72.4$\pm$3.3 & 75.6$\pm$0.7 & 55.9$\pm$6.3 \\ & BeBayesian &No/Yes & 67.5$\pm$7.8 & 75.5$\pm$2.6 & 74.4$\pm$1.0 & 74.9$\pm$0.4 & 58.1$\pm$11.7 \\ & Whitebox & Yes/No & 84.2$\pm$2.0 & 79.5$\pm$0.7 & 74.3$\pm$1.2 & 73.5$\pm$0.5 & 77.1$\pm$4.0 \\ & LULA &Yes/No & 84.3$\pm$1.1 & 83.8$\pm$0.2 & 79.4$\pm$0.4 & 76.8$\pm$0.2 & 79.2$\pm$1.5 \\ \hline & \textbf{OursELBO(Ent)} &No/No & 88.0$\pm$3.0 & 75.5$\pm$3.3 & 75.3$\pm$1.7 & 82.0$\pm$1.7& 80.0$\pm$6.3 \\ & \textbf{OursELBO(MaxP)} &No/No & 83.5$\pm$4.6 & 73.7$\pm$2.9 & 74.2$\pm$1.1 & 79.2$\pm$0.9& 71.8$\pm$6.3 \\ & \textbf{OursELBO(MI)} &No/No & 90.1$\pm$1.9 & \textcolor{violet}{\textbf{79.4}$\pm$1.9} & 77.1$\pm$3.6 & 83.2$\pm$4.5 & \textcolor{violet}{\textbf{86.4}$\pm$5.2} \\ & \textbf{OursELBO(Dent)} &No/No & 88.5$\pm$2.2 & 78.6$\pm$2.8 & 74.1$\pm$3.7 & 82.0$\pm$3.6& 85.4$\pm$5.1 \\ & \textbf{OursELBO(Prec)} &No/No & \textcolor{violet}{\textbf{90.2}$\pm$1.9} & \textcolor{violet}{\textbf{79.4}$\pm$1.8} & \textcolor{violet}{\textbf{77.4}$\pm$4.2} & \textcolor{violet}{\textbf{83.3}$\pm$4.6}& \textcolor{violet}{\textbf{86.4}$\pm$5.2} \\ \toprule \end{tabular} \label{table: OOD-CIFAR100-aupr} \end{center} \vspace{-1.5em} \end{table*} \end{comment} \subsection{Misclassification Detection} In the following, we compare our proposed method with several SOTA uncertainty quantification methods with traditional settings on the misclassfication detection task. The results are shown in~Table \ref{table:miss-class-appendix}. \begin{table*}[t] \begin{center} \scriptsize \captionsetup{font=small} \caption{\textbf{Misclassification Results.} Ent and MaxP stand for Entropy and Max Probability, respectively. Settings stand for post-hoc or traditional, i.e., training the entire model from scratch.} \vspace{-1.5em} \begin{tabular}{llllllllll} \\ \toprule \textbf{Methods} & \textbf{Settings} & \textbf{Metric} & \textbf{MNIST}& \makecell{\textbf{CIFAR 10}} & \makecell{\textbf{CIFAR 100}}& \textbf{Metric} & \textbf{MNIST}& \makecell{\textbf{CIFAR 10}} & \makecell{\textbf{CIFAR 100}}\\ \hline Base Model(Ent) & Traditional & AUROC & 96.7$\pm$0.9 & 92.1$\pm$0.2 & 87.2$\pm$0.2 & AUPR & 37.4$\pm$4.0 & 47.5$\pm$1.2 & 67.0$\pm$1.2 \\ Base Model(MaxP) & Traditional & AUROC & 96.7$\pm$0.9 & 92.1$\pm$0.2 & 86.8$\pm$0.2 & AUPR & 39.4$\pm$3.6 & 46.6$\pm$1.1 & 65.7$\pm$1.0 \\ MCDropout & Traditional & AUROC & 95.1$\pm$0.1 & 90.4$\pm$0.6 & 83.7$\pm$0.1 & AUPR & 34.0$\pm$0.5 & 42.1$\pm$2.1 & 60.3$\pm$0.2 \\ BeBayesian & Traditional & AUROC & 97.1$\pm$0.5 & 86.6$\pm$0.5 & 85.1$\pm$0.6 & AUPR & 39.4$\pm$4.0 & 47.1$\pm$1.6 & 63.2$\pm$1.3 \\ PostNet & Traditional & AUROC & 97.0$\pm$0.6 & 90.3$\pm$0.3 & 84.1$\pm$0.5 & AUPR & 41.3$\pm$2.7 & 51.3$\pm$2.1 & 66.4$\pm$0.3 \\ \hline \textbf{Ours(Ent)} &Post-hoc & AUROC & 96.9$\pm$0.6 & 91.1$\pm$0.2 & 83.4$\pm$0.1 & AUPR & 35.6$\pm$4.5 & 50.0$\pm$3.1 & 66.3$\pm$0.4 \\ \textbf{Ours(MaxP)} &Post-hoc & AUROC & \textcolor{violet}{\textbf{97.4$\pm$0.4}} & \textcolor{violet}{\textbf{92.2$\pm$0.7}} & \textcolor{violet}{\textbf{85.8$\pm$0.2}} & AUPR & \textcolor{violet}{\textbf{44.5}$\pm$5.1} & \textcolor{violet}{\textbf{54.2}$\pm$3.2} & \textcolor{violet}{\textbf{68.2}$\pm$0.5} \\ \toprule \end{tabular} \label{table:miss-class-appendix} \end{center} \vspace{-1.5em} \end{table*} \subsection{Ablation Study} In the following, we show the complete results of ablation study in Table~~\ref{table:ablation-structure-appendix}. \begin{table*}[!t] \begin{center} \scriptsize \captionsetup{font=small} \caption{\textbf{Ablation Study of Meta-model (CIFAR10 AUROC score)}} \vspace{-1.5em} \begin{tabular}{llllllll} \\ \toprule \textbf{ID Data}\ \&\ \textbf{Model} & \textbf{Methods} & \textbf{SVHN}& \textbf{FMNIST} & \textbf{LSUN}& \textbf{TIM} &\textbf{Corrupted} \\ \hline CIFAR10 & Base Model(Ent) & 86.4$\pm$4.6 & 90.8$\pm$1.3 & 89.0$\pm$0.5 & 87.5$\pm$1.1 & 85.9$\pm$8.2 \\ VGG16 & Base Model(MaxP) & 86.3$\pm$4.4 & 90.4$\pm$1.2 & 88.7$\pm$0.5 & 87.3$\pm$1.1 & 85.7$\pm$8.1 \\ \hline & \textbf{Single-layer Meta(Ent)} & 90.4$\pm$0.7 & 91.3$\pm$0.2 & 91.5$\pm$0.2 & 89.5$\pm$0.2 & 90.4$\pm$0.8 \\ & \textbf{Single-layer Meta(MaxP)} & 90.1$\pm$0.6 & 91.5$\pm$0.1 & 91.4$\pm$0.2 & 89.6$\pm$0.1 & 90.1$\pm$0.6 \\ & \textbf{Single-layer Meta(MI)} & 90.6$\pm$1.2 & 90.1$\pm$0.6 & 91.2$\pm$0.2 & 88.8$\pm$0.3 & 90.5$\pm$1.3 \\ & \textbf{Single-layer Meta(Dent)} & 90.4$\pm$0.9 & 90.7$\pm$0.3 & 91.4$\pm$0.2 & 89.2$\pm$0.2 & 90.3$\pm$1.0 \\ & \textbf{Single-layer Meta(Prec)} & 90.6$\pm$1.2 & 90.0$\pm$0.6 & 91.2$\pm$0.2 & 88.8$\pm$0.4 & 90.6$\pm$1.4 \\ \hline & \textbf{Cross-Ent Meta(Ent)} & 94.2$\pm$2.2 & 91.2$\pm$0.7 & 91.2$\pm$0.6 & 90.3$\pm$0.8& 94.7$\pm$2.5 \\ & \textbf{Cross-Ent Meta(MaxP)} & 93.3$\pm$1.6 & 91.1$\pm$0.7 &90.9$\pm$0.4 & 90.0$\pm$0.6 & 94.0$\pm$2.0 \\ \hline & \textbf{Base-Model+LastLayer(Ent)}& 93.0$\pm$1.1 & 90.2$\pm$0.3 & 91.9$\pm$0.2 & 89.9$\pm$0.2& 93.1$\pm$1.2 \\ &\textbf{Base-Model+LastLayer(MaxP)} & 92.9$\pm$0.9 & 90.5$\pm$0.3 &91.9$\pm$0.2 & 90.1$\pm$0.1 & 93.1$\pm$0.9 \\ \hline & \textbf{$10\%$data(Ent)} & 90.0$\pm$7.1 &89.1$\pm$4.4 & 88.7$\pm$6.4 & 88.2$\pm$5.2& 90.2$\pm$7.4 \\ & \textbf{$10\%$data(MaxP)} & 90.9$\pm$5.5 & 88.1$\pm$3.3 &86.9$\pm$7.0 & 86.5$\pm$4.5 & 91.7$\pm$5.4 \\ & \textbf{$10\%$data(MI)}& 99.9$\pm$0.2 & 98.1$\pm$2.2 & 95.4$\pm$1.7 & 97.2$\pm$2.4 & 99.9$\pm$0.1 \\ & \textbf{$10\%$data(Dent)} & 96.7$\pm$3.5 & 97.4$\pm$3.0 & 94.3$\pm$4.1 & 95.7$\pm$4.1 & 96.7$\pm$3.4 \\ & \textbf{$10\%$data(Prec)} & 99.9$\pm$0.1 & 98.0$\pm$2.2 & 95.4$\pm$1.7 & 97.3$\pm$2.3 & 99.9$\pm$0.1 \\ \hline & \textbf{Ours(Ent)} & 96.3$\pm$3.0 &89.0$\pm$5.2 & 89.6$\pm$3.4 & 89.4$\pm$3.5& 95.9$\pm$4.3 \\ & \textbf{Ours(MaxP)} & 95.6$\pm$3.6 & 87.8$\pm$4.4 &89.1$\pm$2.4 & 88.2$\pm$2.6 & 94.0$\pm$7.3 \\ & \textbf{Ours(MI)} & \textcolor{violet}{\textbf{100.0$\pm$0.0}} & \textcolor{violet}{\textbf{98.8$\pm$0.5}} & 95.2$\pm$0.9 & \textcolor{violet}{\textbf{98.1$\pm$0.3}} & \textcolor{violet}{\textbf{100.0$\pm$0.0}} \\ & \textbf{Ours(Dent)} & \textcolor{violet}{\textbf{100.0$\pm$0.0}} & 98.4$\pm$0.9 & \textcolor{violet}{\textbf{95.7}$\pm$0.8} & 97.7$\pm$0.5 & \textcolor{violet}{\textbf{100.0$\pm$0.0}} \\ & \textbf{Ours(Prec)} & \textcolor{violet}{\textbf{100.0$\pm$0.0}} & \textcolor{violet}{\textbf{98.8$\pm$0.5}} & 95.1$\pm$0.5 & \textcolor{violet}{\textbf{98.1$\pm$0.3}} & \textcolor{violet}{\textbf{100.0$\pm$0.0}} \\ \toprule \end{tabular} \label{table:ablation-structure-appendix} \end{center} \vspace{-1.5em} \end{table*}
\section{Introduction} With the rapid development in attophysics, the real-time time-dependent quantum chemical methods coupled to specifically designed Gaussian basis sets gain increasing interest in solving the time-dependent Schrödinger equation, a task required for the description of electron dynamics during attosecond processes \cite{ishikawa2015,goings2017,coccia2022}. Among various computational chemistry approaches, the two that are currently most widely used in theoretical attoscience are the real-time time-dependent density functional theory (RT-TDDFT) \cite{runge1984,tong1998,castro2004} and the real-time time-dependent configuration interaction restricted to single excitations (RT-TDCIS) \cite{klamroth2003,huber2005,rohringer2006,krause2007,schlegel2007}. Both of them have been successfully applied to a wide range of systems from simplest one- or two-electron atoms \cite{rohringer2006,luppi2013,castro2015,coccia2016a,pabst2016,wozniak2021,wozniak2022} to complex biological molecules \cite{lopata2011,luppi2021,morassut2022} and nanostructures \cite{kuisma2015,wopperer2015,rossi2017,mrudul2020}. Their popularity relies chiefly on great scalability with the number of electrons, allowing for propagating large systems for timescales of femto- or even picoseconds. However, both of them also have their shortcomings. RT-TDCIS is a well established wavefunction theory, in which the wavefunction of the examined system is expanded in the basis of $N$-electronic ground and excited states. By employing only single excitations it offers a very favourable linear scaling with the number of occupied spinorbitals. However, being a counterpart of the HF method for excited states, it completely neglects any dynamical correlation effects. Each year, more experimental evidence is being reported for novel attosecond phenomena, such as the giant dipole resonances \cite{barillot2015,zhong2020} or the Cooper minima in photoionization cross sections \cite{bertrand2012,schoun2014,alexandridi2021}, the theoretical explanations of which often rely on dynamical electron-electron interactions. It therefore becomes inevitable that when trying to model such subtle effects, one has to eventually abandon RT-TDCIS in favour of correlated methods. By contrast, electronic correlation is easily included in RT-TDDFT by using an approximate and appropriate exchange-correlation potential of choice. As opposed to the wavefunction theories, RT-TDDFT employs propagation Kohn-Sham orbitals within a single determinant, which usually provides efficiency comparable to or even better than that of RT-TDCIS. Among the disadvantages of RT-TDDFT one can mention the non-linearity of the equations of motion for the KS orbitals \cite{bedurke2021}, and the inability to describe open-shell singlet states, which is a common feature of all single-determinant approaches \cite{isborn2009,sato2014}. The latter has some severe consequences for the description of strong field processes, such as the high-harmonic generation (HHG), in systems with a closed-shell ground state. HHG, one of the key aspects of attophysics, is a highly nonlinear optical process occuring in atoms and molecules placed in laser fields of extreme intensity and relatively long wavelengths, in which the frequency of the exciting field is converted into a series of its integer multiples \cite{antoine1996}. As explained by celabrated analytical models of HHG, such as the three-step model (3SM) \cite{krause1992,schafer1993,corkum1993} or Lewenstein model \cite{lewenstein1994}, the key component of the HHG process is the field-induced tunelling ionization of a single electron, followed by its reacceleration and recombination with the residual ion accompanied by the emission of light. Therefore, the correct description of HHG in closed-shell systems requires involving transitions to open-shell singlet states that are accesible only within the wavefunction (multideterminant) framework. The above-mentioned limitations of currently used real-time propagation methods entail the development of novel, more precise theoretical approaches that will combine the strengths and avoid the weaknesses of RT-TDCIS and RT-TDDFT, while at the same time ensuring similar computational efficiency. One of the promising candidates is the real-time time-dependent equation-of-motion coupled-cluster (RT-TDEOMCC) method, however its current implementations are troubled by numerical instabilities \cite{kvaal2012}. In our recent paper we presented proof-of-concept RT-TDCISD (effectively RT-TDFCI) calculations of HHG spectra in the helium atom \cite{wozniak2022}. We used Gaussian basis sets sufficiently large to describe the evolution of the wavefunction at laser intensities above $10^{14}$ W/cm\textsuperscript{2}, frequently used in attosecond experiments. It was shown that RT-TDCISD provides improvements in terms of features of of the spectra the spectra such as position of harmonic cutoff or intensity of harmonic peaks. However, the scale of these corrections is in general not commensurate with the huge increase in the computational costs related to including double excitations in the CI wavefunction. This issue is exacerbated when increasing the laser intensity, as higher field's ponderomotive force makes the ionized electron travel longer distances. This, in turn, requires using larger, more diffuse basis set, making RT-TDCISD unfeasible from a certain point on. Therefore, in this paper we explore possible ways of decreasing the computational cost of RT-TDCISD while at the same time keeping it able to capture the essential correlation effects in laser-induced electron dynamics. We introduce and implement several algorithms of decreasing the CISD space the real-time propagation is performed in. They rely either on truncating the subspace of virtual orbitals from which the configurations are constructed, or on selecting certain CI states after solving the time-independent CI problem. We evaluate the performance of the proposed algorithms by calculating the HHG spectra of the hydrogen molecule, as the example of a multicenter, many-electron system. The diatomic molecules have been in the center of attoscience for the last few decades, being studied both experimentally \cite{schmidt1994,cornaggia1994,lynga1996,lappas2000,velotta2001,hay2002,lein2002a} and theoretically, often using approximate models \cite{lappas2000,ivanov1993,zuo1993,yu1995,moreno1997,kopold1998,bandrauk1999,averbukh2001,kreibich2001,suarez2016,suarez2017}. The molecular HHG offers additional degrees of freedom and promising possibilities, such as the alignment of the molecular axis with respect to the laser field polarization axis. Specifically for a diatomic system, the existence of a distinctive quantum-interference minima pattern in the spectra and its dependence with the molecular orientation have been theoretically predicted \cite{lein2002b,lein2003,ciappina2007}. This pattern is due to a destructive interference from the high-harmonic emission at spatially separated centers; it allows to estimate the internuclear distance from the HHG spectra. In addition, the chance of controlling the phases and improving the phase-matching condition opens novel routes of investigation. The distinctive features of the molecular HHG spectra can be used to retrieve structural and dynamical information in simple molecules \cite{itatani2004}. Finally, from the molecular HHG spectra the temporal evolution of the electronic wavefunction can be directly recovered \cite{smirnova2009,haessler2010,kraus2015}. The paper is constructed as follows. In Section II we present the outline of the RT-TDCI theory and the details of proposed algorithms, as well as provide computational parameters of the simulations. In Section III we present and discuss the numerical results. Finally, in Section IV we conclude our work. \section{Theoretical methods} \subsection{The RT-TDCI theory} We aim at solving the time-dependent Schrödinger equation (TDSE), \begin{equation} \label{tdse} i \frac{\partial}{\partial t}\Psi(t) = \hat{H}(t)\Psi(t), \end{equation} for the electronic wavefunction of the hydrogen molecule subject to a pulse of intense laser radiation, in a non-pertubative manner, using time discretization. The Hartree atomic units are used throughout the paper. The time-dependent Hamiltonian $\hat{H}(t)$ consists of the ground state H\textsubscript{2} Hamiltonian and the field interaction operator represented in the length gauge and in the dipole approximation: \begin{equation} \hat{H}(t) = \hat{H}_0 - \hat{\mu}\mathcal{E}(t). \end{equation} Here, $\hat{\mu}$ is the molecular dipole operator and $\mathcal{E}(t)$ is the time-dependent electric component of the external laser field. The time dependent wavefunction in RT-TDCI is written as a linear combination of $\hat{H}_0$ eigenstates with time-dependent coefficients: \begin{equation} \Psi(t) = \sum_k C_k(t) \Psi^\textrm{CI}_k, \end{equation} where $k$ is the electronic (ground or excited) state index. Each CI eigenstate is further expanded in the basis of the reference Slater determinant - the solution of the restricted Hartree-Fock (RHF) equations - and the $n$-tuply excited Slater determinants, \begin{equation} \Psi^\textrm{CI}_k = c_{0,k} \Phi^\textrm{RHF} + \sum_{i}^{occ.} \sum_{a}^{virt.} c_{i,k}^a \Phi_i^a + \sum_{i,j}^{occ.} \sum_{a,b}^{virt.} c_{ij,k}^{ab} \Phi_{ij}^{a,b} + ... \end{equation} The maximum excitation number defines the CI (and conseqeuently also the RT-TDCI) level of theory. In our case of the H\textsubscript{2} molecule there are only two electrons, so the CISD level is equivalent to full CI. Since we are considering a closed-shell system and the time-dependent Hamiltonian does not contain any spin-dependent terms, the time-evolution of the wavefunction is limited to singlet-state manifold, and therefore in actual calculations we use singlet spin-adapted configuration state functions (CSFs or simply configurations) rather than Slater determinants. The details of the construction of singly- and doubly-excited CSFs can be found in the literature \cite{szabo2012,krause2007,wozniak2022}. The coefficients $c_{0,k}$, $c_{i,k}^a$ and $c_{ij,k}^{ab}$ are obtained by solving the time-independent CI eigenequation, \begin{equation} \label{ci} \mathbf{H}_0^\textrm{CI}\mathbf{c}_k = E^\textrm{CI}_k \mathbf{c}_k. \end{equation} Afterwards, the CI vector of coefficients $C_k(t)$ is propagated in time starting from the obtained ground state. In this work Eq. \eqref{tdse} is approximated by the Crank-Nicolson propagator: \begin{equation} \label{crank} \left(\mathbf{I}+\frac{i\Delta t}{2}\mathbf{H^\textrm{CI}}(t+\Delta t/2)\right)\mathbf{C}(t+\Delta t) = \left(\mathbf{I}-\frac{i\Delta t}{2} \mathbf{H^\textrm{CI}}(t+\Delta t/2)\right)\mathbf{C}(t), \end{equation} where $\mathbf{H^\textrm{CI}}_{lk} = \delta_{lk} E^\textrm{CI}_k - \mathcal{E}(t)\bra{\Psi_l}\hat{\mu}\ket{\Psi_k}$. After the real-time propagation is finished, the time-resolved observables are retrieved from $C(t)$ and the HHG spectrum is calculated as the squared modulus of the Fourier transform of the time-resolved molecular dipole moment, normalized over the total simulation time $[t_i,t_f]$: \begin{equation} I_{\mathrm{HHG}}(\omega) = \abs{ \sum_{k,l}\bra{\Psi_l}\hat{\mu}\ket{\Psi_k}\frac{1}{t_f-t_i}\int_{t_i}^{t_f}C_l^*(t)C_k(t) e^{i\omega t}dt}^2. \end{equation} \subsection{Reducing RT-TDCISD propagation space} In the most conventional realisation of RT-TDCI (which we will from now on refer to as ``standard'') Eq. \eqref{ci} is solved in the basis of all configurations possible at a given level of theory, constructed using the whole set of molecular orbitals (MOs). Usually the full diagonalization of the Hamiltonian matrix is performed, and the time-dependent CI vector is expanded in all obtained states. This is obviously the source of the much higher cost of RT-TDCISD when compared to RT-TDCIS: for instance, from $o$ occupied MOs and $v$ virtual MOs one can construct $\frac{1}{2}(o^2v^2+3ov+2)$) singlet CISD configurations and only $ov +1$ singlet CIS configurations. In modeling phenomena like HHG with discrete basis sets, a high density of states, especially those near and above the ionization threshold, is desirable, because it allows to accurately approximate the electronic continuum spectrum involved in the ionization process. However, one can expect that not every state has an equal contribution to the time-evolution and some of them may be in fact not needed, eg. simply because they are not energetically accessible under applied laser conditions. In this section we will discuss methods of identifying and \textit{a priori} excluding such redundant states and/or configurations, in order to speed up the real-time propagation. Let us start by recalling the famous three-step HHG cutoff formula \cite{krause1992,schafer1993,corkum1993}, \begin{equation} E_{\mathrm{cut}} = I_p + 3.17 U_p = I_p + 3.17 \frac{\mathcal{E}_0}{4\omega_0} \end{equation} which predicts the energy of the highest harmonic generated by an atomic or molecular species with ionization potential $I_p$ in an oscillating electric field characterized by the ponderomotive force $U_p$. Here, $\mathcal{E}_0$ and $\omega_0$ are the field's amplitude and angular frequency, respectively. In this paper we approximate $I_p$ in the spirit of Koopmans' theorem, as $-\epsilon_{\mathrm{HOMO}}$. In the simplest one-electron picture, $3.17 U_p$ is at the same time the energy of the highest virtual orbital to which an electron can be excited during harmonic generation. This is due to energy conservation, since the three-step model assumes that a single HHG event starts from and leads to the electronic ground state. Therefore, we can limit the configuration basis by constructing CSFs using virtual orbitals with $\epsilon < 3.17 U_p$ only or, more generally, introduce an auxiliary parameter $\lambda$ that allows us to adjust the threshold for maximum orbital energy, $\epsilon_{\mathrm{thr}} = 3.17 \lambda U_p$. In this way, setting e.g. $\lambda = 2$ means that in the calculations we use CSFs constructed only from orbitals with energies below twice the electron ponderomotive energy. Reducing the number of configurations lowers the computational cost of both the time-independent and the time-dependent problem, as well as the amount of memory required for storing the operator matrices in the configuration representation and in the CI representation. This procedure of selecting a subset of active orbitals is very well known from methods like restricted-active-space CI; in this work we just make the active virtual-orbital space dependent on the laser conditions. Shifting from the single-electron picture to the more accurate $N$-electron state picture, we can propose an alternate reasoning for truncating the space of CISD eigeinstates after we obtain them using the whole set of canonical MOs. In this case, the highest continuum state able to emit harmonic radiation according to the three-step model has the excitation energy of $I_p + 3.17 U_p$. Similarly to the truncation of the virtual-orbital space, we give some additional flexibility to this boundary, and introduce another auxiliary parameter $\eta$ that regulates the energy threshold for the CISD eigenstates to be included in RT-TDCISD propagation, $E_{\mathrm{thr}} = I_p + 3.17 \eta U_p$. Just like the $\lambda$ parameter defined the subset of active MOs, the $\eta$ parameter analogously defines the subspace of active CI states, and setting either of the parameters to 1 corresponds to the respective 3SM prediction. Like the previous one, this algorithm also allows for reducing the dimension of the CI representation, and thus accelerates the real-time propagation. The dimension of the configuration representation remains unchanged in this case and the full CSF Hamiltonian matrix must be constructed. However, it is still possible to speed up the solution of the time-independent CI equation by employing algorithms for partial matrix diagonalization, available eg. in the implementations of LAPACK numerical library. In the last algorithm for reducing the CISD propagation space we also expand the time-dependent CI vector into a certain subset of CISD eigenstates. This time, however, we will adopt a different criterion for choosing these eigenstates, which is no longer related to the excitation energies. Numerous examples of good agreement between experimental results and theoretical predictions from 3SM and related approaches, such as the strong field approximation or single-active electron model, prove that in a wide variety of atoms and molecules HHG is indeed dominated by single-electron transitions \cite{amini2019}. We reached a similar conclusion when examining relatively small differences between RT-TDCIS and RT-TDCISD spectra in helium \cite{wozniak2022}. Therefore, we can deduce that the CISD states crucial for the laser-driven dynamics are mostly dominated by single excitations, and the dynamical correlation between the electron being ionized and the one within the residual ion is provided by a lesser admixture of double excitations. On the other hand, it is well known that from a CISD calculation one obtains a huge number of states dominated by doubly excited configurations, that are not necessarily required for the description of HHG. They may be useful for simulating other non-linear processes, such as non-sequential double ionization, that take place under different laser regimes. However, for the purpose of HHG modeling, we can exclude these states from the RT-TDCISD space and perform the propagation using only states with a certain minimal contribution of single excitations. To do this, after computing a full CISD eigenspectrum, for each state vector we calculate its squared partial norm as a sum of the squares of the coefficients $c_k$ corresponding to the reference configuration and to the singly excited configurations: \begin{equation} N_k^{\mathrm{RS}} = \abs{c_{0,k}}^2 + \sum_i^{occ.} \sum_a^{virt.} \abs{c_{i,k}^a}^2 \end{equation} and select only states with $N_k^{\mathrm{RS}}$ above some threshold. This approach is conceptually similar to RT-TDCIS(D), which was also proposed in the literature as a method for including electronic correlation in the description of HHG \cite{krause2005,krause2007,schlegel2007}. It is an extension of RT-TDCIS, in which the effects of double excitations are treated via perturbative corrections to CIS eigenenergies. However, unlike RT-TDCIS(D), the number of states selected by our algorithm is not limited by the dimension of the CIS space. We can vary the threshold for $N_k^{\mathrm{RS}}$ to obtain the distribution and density of states that ensures a proper balance between accuracy and computational efficiency. The main drawback of the algorithm is that it requires a full diagonalization of the standard CISD Hamiltonian (unless of course it is combined with another truncation method) and thus is only able to reduce the computational costs of the real-time propagation. The algorithm of selecting only single-excitation dominated states may on first sight look very efficient, since the fact that the number of singly excited configurations is smaller by orders of magnitude than the number of doubly excited configurations usually implies a similar tendency in the numbers of states dominated by single and double excitations. However, it must be noted that not all double-excitation dominated states stand in contradiction with the single ionization assumption of 3SM. In particular, the contribution of configurations in which one electron is excited to a continuum orbital and the other is excited to a bound orbital (we call them bound+continuum excitations) may have pivotal role in dynamic correlation, since they are responsible for the polarization of the electronic density in the residual ion caused by the ionized electron. Discarding states with a predominant contribution of such configurations may be too excessive, and therefore we propose also a second variant of the algorithm, in which we calculate modified squared partial norms of CI state vectors, \begin{equation} N_k^{\mathrm{RSBC}} = \abs{c_{0,k}}^2 + \sum_i^{occ.} \sum_a^{virt.} \abs{c_{i,k}^a}^2 + \sum_{i,j}^{occ.} \sum_a^{virt.} \sum_b^{bv.} \abs{c_{ij,k}^{ab}}^2 \end{equation} where the index $bv.$ refers to summing over bound virtual orbitals (with energies $\epsilon_b < 0$). In this way, we exclude only states dominated by double excitations to two continuum orbitals. \subsection{Computational details} To assess the performance of the proposed algorithms, we solve the time discretized TDSE \eqref{tdse} for the hydrogen molecule in the fixed-nuclei approximation, at the equilibrium bond distance of 1.4 a.u. The laser pulse is represented by an oscillating electric field with a sin-squared envelope, \begin{equation} \label{efield} \mathcal{E}(t) = \begin{cases} \mathcal{E}_0 \sin(\omega_0 t) \sin^2(\omega_0 t/2 n_c)&\text{if}\; 0 \leq t \leq 2\pi n_c/\omega_0, \\ 0& \text{otherwise,} \end{cases} \end{equation} where we use $\omega_0$ = 1.55 eV (corresponding to a wavelength of 800 nm) and the number of optical cycles $n_c$ = 20, so that the total duration of the pulse is approximately 2206 a.u. (53.4 fs). The polarization of the field is assumed perpendicular to the bond axis. We carry out calculations for two laser intensities: $I_0$ = $7 \times 10^{13}$ W/cm\textsuperscript{2} and $I_0$ = $10^{14}$ W/cm\textsuperscript{2}. The time-dependent CI vector is propagated with a timestep $\Delta t$ = 0.01 a.u., a value that provided stability of the calculations. After the pulse ends, we propagate the wavefunction for ten additional optical cycles, to ensure that the system reaches a stationary point. The set of canonical MOs is obtained through the solution of the RHF equations in a Gaussian basis set adjusted specifically to describe highly excited and continuum electronic states. We use Dunning's correlation-consistent aug-cc-pVTZ basis set, which we further augment with the so-called active-range-optimized (ARO) functions we introduced and tested in our previous works \cite{wozniak2021,wozniak2022}. In this paper we compare two types of ARO augmentation. In the first one we place a set of ARO functions at each atomic center (atomic augmentation), while in the second we place only one set of ARO functions in the center of charge of the examined system, in our case in the middle of the H\textsubscript{2} bond (midbond augmentation). The latter augmentation scheme using different kinds of diffuse functions has already been used in HHG calculations of larger molecules \cite{bedurke2019}, and it is appealing due to a number of reasons. First, introducing a new basis set center allows for obtaining states with higher angular momenta due to mixing of spherical harmonics at different centers. This feature is highly desired in simulating laser-driven dynamics, when absorption of multiple photons is involved. Second, midbond augmentation allows to use more Gaussian exponents compared to atomic augmention, when the total number of basis functions is kept the same. Finally, an ionized electron at a sufficiently large distance from the molecule experiences the potential of the residual ion approximately as a point charge, so it's behavior should be reasonably described using single-center orbitals, analogously to Coulomb wave functions of a hydrogen-like ion. In our calculations we use ARO functions with angular momenta from $l$=0 ($s$-type orbitals) to $l$=3 ($f$-type orbitals), fitted to set Slater orbitals with exponent $\zeta$=1.0 and principal quantum numbers from 1 to 100, according to procedure described in ref. \cite{wozniak2021}. In the atomic augmentation scheme we place three ARO functions per angular momentum at each of the two atom, while in the midbond augmentation scheme we use a single ``ghost'' atom with six ARO functions per angular momentum, so that the total numbers of functions in both basis sets are equal. Because the Gaussian basis sets we use are far from completeness, we have to account for the ionization losses during HHG. We employ the so-called heuristic finite lifetime model reported by Klinkusch \textit{et al.} \cite{klinkusch2009a}. Its main idea is to add imaginary ionization rates to energies of CI eigenstates beyond the ionization threshold: \begin{equation} E_k^{\textrm{CI}} \rightarrow E_k^{\textrm{CI}} - \frac{i}{2} \Gamma_k^{\textrm{CI}} \quad \text{for} \; E_k^{\textrm{CI}} \geq E_0^{\textrm{CI}} + I_p, \end{equation} so that these eigenstates are interpreted as non-stationary. After this modification the time-dependent Hamiltonian matrix is no longer Hermitian, so the time-evolution becomes non-unitary. The ionization rates $\Gamma_k$ are calculated according to ref. \cite{klinkusch2009a}, as sums of single-orbital ionization rates $\gamma_a$, \begin{equation} \gamma_a = \theta(\epsilon_a) \sqrt{2\epsilon_a}/d_a, \end{equation} where $\theta(x)$ is the Heaviside step function and $d_a$ is a characteristic escape length of an electron on orbital with energy $\epsilon_a$. The expressions for $\Gamma_k^{\textrm{CI}}$ for the CIS and CISD level are, respectively, \begin{eqnarray} \Gamma_k^{\textrm{CIS}} = &&\sum_{i}^{occ.} \sum_{a}^{vir.} \abs{c^a_{i,k}}^2 \gamma_a, \\ \Gamma_k^{\textrm{CISD}} = &&\sum_{i}^{occ.} \sum_{a}^{vir.} \abs{c^a_{i,k}}^2 \gamma_a + \sum_{i,j}^{occ.} \sum_{a,b}^{vir.} \abs{c^{ab}_{ij,k}}^2 (\gamma_a + \gamma_b). \end{eqnarray} In our calculations we use a modification of the finite lifetime model introduced in our previous work \cite{wozniak2022}, in which we divide the virtual MOs into two groups and assign a different value of escape lenght $d$ to each group. For orbitals with energies $\epsilon_a < 3.17 U_p$ we set $d_1$ equal to the semiclassical electron quiver amplitude in an electromagnetic field, $\mathcal{E}_0/\omega_0^2$, while for orbitals with energies exceeding $3.17 U_p$ we set $d_2$ = 0.1. This helps us to reduce numerical noises stemming from the fact that the electronic continuum is discretized and the energy levels may not be evenly distributed. A similar modification has been proposed by Coccia \textit{et al.} \cite{coccia2016a,coccia2019}, who, however, attributed different values of $d$ to different CI eigenstates instead of different virtual orbitals. Within the above-presented framework, we perform RT-TDCI calculations: first RT-TDCIS and standard RT-TDCISD, and then RT-TDCISD in reduced propagation space. For the truncation of the virtual-orbital space we use values of $\lambda$ = 1, 2, 3, 4 and 5. Similarly, for the truncation of the CISD state space we use values of $\eta$ = 1, 2, 3, 4 and 5. Finally, when selecting the CISD states based on squared partial norms of their vectors we use the thresholds for $N_k^{\mathrm{RS}}$ and $N_k^{\mathrm{RSBC}}$ equal to 0.5, 0.1, 10\textsuperscript{-2} and 10\textsuperscript{-3}. \section{Results and discussion} Let us start the analysis of the obtained results with a comparison between HHG spectra calculated at the RT-TDCIS and standard RT-TDCISD level of theory. This will allow us to gauge the effects in the laser-driven electron dynamics stemming from full inclusion of dynamic correlation, as well as establish a reference for the results of propagations in the truncated CI space. In each of the two Gaussian basis sets we obtain one occupied MO and 141 virtual MOs, so the full diagonalizations of the Hamiltonian matrices provide 142 CIS and 10153 CISD eigenstates. The spectra obtained from real-time propagations in such complete CI spaces are presented on Figure 1. We can notice is that at both levels of theory and at both laser intensities the atomic-augmented basis set (aug-cc-pVTZ+ARO3a for short) is able to correctly reproduce the spectrum profile described by the three-step model: a low energy perturbative region with a rapid decrease of harmonic intensity, the plateau region with nearly constant intensity of consecutive harmonic peaks, and the cutoff at energy close to $E_{\mathrm{cut}}$, after which the spectrum abruptly drops by several orders of magnitude. On the other hand, the midbond-augmented basis set (aug-cc-pVTZ+ARO6m for short) fails completely to reproduce the 3SM predictions, with the harmonic plateau extending far beyond $E_{\mathrm{cut}}$ and a linear decrease of the peak intensities instead of a sharp, well-located cutoff. This may seem surprising, especially since we use a very small value of escape length for orbitals which according to the single-electron picture should not contribute to harmonic generation, so this kind of artifacts should be largely reduced. Moreover, the distributions of the CI eigenstates obtained in both basis sets (shown at Figure 2) are rather similar to each other, with the aug-cc-pVTZ+ARO6m eigenspectrum being only slighty shifted towards higher energies. \begin{figure} \centering \includegraphics[width=0.8\linewidth]{fig1.eps} \caption{HHG spectra of the H\textsubscript{2} molecule computed using the atomic-augmented basis set (left column) and the midbond-augmented basis set (right column). Solid vertical lines denote the cutoff positions predicted by the three-step model} \end{figure} \begin{figure} \centering \includegraphics[width=0.8\linewidth]{fig2.eps} \caption{Distributions of electronic energies of the H\textsubscript{2} molecule calculated using Gaussian basis sets with atomic augmentation and with midbond augmentation, at the CIS and CISD level of theory. Inset on the right plot shows the distribution of lowest 160 CISD states for an easier comparison with CIS results} \end{figure} We argue that the reason of the differences in spectra is that introducing the midbond augmentation inadvertently divides the CI eigenstates into two subgroups. The bound and lower energy continuum states are described mostly with Dunning orbitals, while the description of higher energy continuum states is dominated by the contribution of ARO functions. This may provide a reasonable picture in terms of electronic energies, but due to different shapes of molecular orbitals constructed from atomic and midbond functions, other observables of the eigenstates, such as the dipole moment expectaction values, may be reproduced with different accuracy between two subgroups. When the wavefunction is excited from lower to higher energy part of energy spectrum, it experiences unphysical ``switches'' in the total dipole moment, that manifest in the HHG spectra in the form of additional harmonics beyond the theoretical cutoff positons, as well as more jagged shapes of the harmonic peaks. Is is therefore clear that the midbond-augmented basis set is, at least in our case, not a reliable choice for modeling HHG spectra, and so we perform all further calculations only in the aug-cc-pVTZ+ARO3a basis set. Aside from the performance differences between Gaussian basis sets, in all plots on Figure 1 one may notice some distinctive features of the spectra that can be attributed to the inclusion of double excitations. For example, the RT-TDCISD spectra are characterized by lower HHG background intensity, with a more pronounced cutoff region (this obviously can be seen more clearly for the atomic-augmented basis set). Such high difference in the intensity between the plateau peaks and of the baseline usually indicates a better quality of the theoretical spectra and a lower level of numerical noises. Moreover, when using RT-TDCISD, the harmonic emission is decreased in the middle of the plateau, overall resulting in a more constant intensity of consecutive peaks, a feature we already reported in analogous calculations for the helium atom \cite{wozniak2022}. In particular, lowering of peak intensities in the region close the ionization threshold (which in case of the H\textsubscript{2} molecule is located around 10th harmonic, corresponding to the ionization potential of 15.4 eV) is a clear instance of dynamic correlation in HHG. The correlation effects are expected to be most significant in transitions to Rydberg or low energy continuum states, because the two electrons remain relatively close to each other and have to correlate their movements to minimize Coulombic repulsion. Therefore, during deexcitation from a low energy state in the RT-TDCISD picture, the electron in the H\textsubscript{2}\textsuperscript{+} ion has its position already adjusted to the trajectory of the returning electron, so that the latter emits less \textit{bremsstrahlung}-like radiation than it would in the mean-field approximation of RT-TDCIS. Naturally, the same effect is expected to occur in the perturbative region, but due to much higher intensity of first few harmonic peaks its practically unnoticeable in the logarithmic forms of the spectra. By analogy, in transitions to high energy continuum states the ionized electron travels far away from the residual ion, so the electronic interaction weakens. Thus, the recollision picture provided by RT-TDCIS and by RT-TDCISD is more similar, as are the intensities of harmonics at the end of the plateau. Let us now move to the analysis of the simulations performed using different truncation algorithms, starting with the truncation of the virtual-orbital space. The comparison of the HHG spectra computed using standard RT-TDCISD and using different values of $\lambda$ is presented on Figure 3, while the numbers of orbitals and CISD eigenstates used in real-time propagations are given in Table 1. At first sight one can notice that the number of truncated virtual orbitals has a strong effect on the shapes of the spectra, with all curves varying in terms of peak shapes and intensities and the position of the baseline. However, these changes are by no means systematic, i.e. the profiles of the spectra do not converge to the standard RT-TDCIS spectrum together with increasing value of $\lambda$. For instance, at both laser conditions the lowest background intensity is obtained with $\lambda$=5, while the background intensity of RT-TDCIS is located between these of $\lambda$=3 and $\lambda$=4. Another observation is that the virtual-orbital truncation scheme performs differently at different laser intensites, especially for lowest $\lambda$. Spectra computed with $\lambda$=1 and $\lambda$=2 much closer resemble the standard RT-TDCISD at intensity $7 \times 10^{13}$ W/cm\textsuperscript{2} than at intensity $10^{13}$ W/cm\textsuperscript{2}. Therefore, due to largely unpredictable effects of the truncation of virtual-orbital space on the obtained time-resolved observables, we consider this algorithm not a reliable choice for accelerating RT-TDCISD calculations. \begin{figure}[h] \centering \includegraphics[width=0.8\linewidth]{fig3.eps} \caption{HHG spectra of the H\textsubscript{2} molecule computed using standard RT-TDCISD and using RT-TDCISD with the algorithm of truncating the virtual-orbital space, for different values of $\lambda$} \end{figure} \begin{table} \centering \caption{Properties of the RT-TDCISD propagation spaces obtained using the algorithm of truncating the virtual-orbital space, for different values of $\lambda$ ($n_{vir}$ - number of selected virtual orbitals, $n_{\textrm{CISD}}$ - number of obtained CISD states)} \begin{tabular}{ccccccc} \toprule \multicolumn{1}{c}{} & \multicolumn{3}{c}{$I_0$ = $7 \times 10^{13}$ W/cm\textsuperscript{2}} & \multicolumn{3}{c}{$I_0$ = $10^{14}$ W/cm\textsuperscript{2}} \\ \cmidrule(rl){2-4} \cmidrule(rl){5-7} \textbf{$\lambda$} & {$\epsilon_{\mathrm{thr}}$ [Ha]} & {$n_{vir}$} & {$n_{\textrm{CISD}}$} & {$\epsilon_{\mathrm{thr}}$[Ha]} & {$n_{vir}$} & {$n_{\textrm{CISD}}$} \\ \midrule 1 & 0.4873 & 104 & 5565 & 0.6962 & 106 & 5778 \\ 2 & 0.9746 & 109 & 6105 & 1.3923 & 119 & 7260 \\ 3 & 1.4619 & 119 & 7260 & 2.0885 & 122 & 7626 \\ 4 & 1.9492 & 120 & 7381 & 2.7846 & 124 & 7875 \\ 5 & 2.4366 & 123 & 7750 & 3.4808 & 125 & 8001 \\ \bottomrule \end{tabular} \end{table} A far more consistent picture emerges from the calculations employing the truncation of CISD eigenspace, as presented on Figure 4. We observe some barely distinguishable differences between the spectra obtained with $\eta$=1 and the standard RT-TDCISD spectra, while the spectra obtained for $\eta$=2, 3, 4 and 5 completely overlap with the standard ones. What is extremely important, this convergence rate is independent from the applied laser intensity, even though the number of CI eigenstates discarded using a particular value of $\eta$ may strongly depend on $I_0$ (Table 2). This is an irrefutable proof that the states with energies above $E_{\mathrm{cut}}$ have little to no contribution to the laser-driven electron dynamics, at least from the HHG perspective. If it were otherwise, we would observe much more distinct differences between the curves for not one but two reasons. First, lack of sufficiently high energy states would force the wavefunction to populate low energy part of the eigenspectrum, which would translate into changes in the time-resolved dipole moment. Second, in the employed ionization model states with high $E_k^{\textrm{CISD}}$ are expected to have very large ionization rates, due to dominant contribution of virtual orbitals with high $\gamma_a$. Therefore, if the states beyond $E_{\mathrm{cut}}$ were relevant for the time-propagation, removing them would cause unphysical reflections of the wavefunction, further affecting the observables. From the computational point of view, this algorithm seems to be highly efficient in accelerating RT-TDCISD calculations. By setting $\eta$=1, we can already capture most of the correlation effects in HHG offered by standard RT-TDCISD, even though the amount of states used in the actual real-time propagation is comparable to the amount of CIS states that can be obtained in the same basis set. Nevertheless, for the optimal quality of results we recommend using a value of $\eta$=2, that can provide a complete convergence of the observables while still keeping the propagation space relatively compact. \begin{figure}[h] \centering \includegraphics[width=1.0\linewidth]{fig4.eps} \caption{HHG spectra of the H\textsubscript{2} molecule computed using standard RT-TDCISD and using RT-TDCISD with the algorithm of truncating the CISD eigenspace, for different values of $\eta$} \end{figure} \begin{table}[h] \centering \caption{Properties of the RT-TDCISD propagation spaces obtained using the algorithm of truncating the CISD eigenspace, for different values of $\eta$ ($n_{\textrm{CISD}}$ - number of selected CISD states)} \begin{tabular}{ccccc} \toprule \multicolumn{1}{c}{} & \multicolumn{2}{c}{$I_0$ = $7 \times 10^{13}$ W/cm\textsuperscript{2}} & \multicolumn{2}{c}{$I_0$ = $10^{14}$ W/cm\textsuperscript{2}} \\ \cmidrule(rl){2-3} \cmidrule(rl){4-5} \textbf{$\eta$} & {$E_{\mathrm{thr}}$ [Ha]} & {$n_{\textrm{CISD}}$} & {$E_{\mathrm{thr}}$[Ha]} & {$n_{\textrm{CISD}}$} \\ \midrule 1 & 1.0817 & 110 & 1.2905 & 200 \\ 2 & 1.5690 & 528 & 1.9867 & 5901 \\ 3 & 2.0563 & 6031 & 2.6829 & 7210 \\ 4 & 2.5436 & 7164 & 3.3790 & 7677 \\ 5 & 3.0309 & 7467 & 4.0752 & 7962 \\ \bottomrule \end{tabular} \end{table} Finally, on Figure 5 we present the comparison between the HHG spectra computed using RT-TDCISD with the selection of states based on the values of $N_k^{\mathrm{RS}}$ and $N_k^{\mathrm{RSBC}}$. For both variants of this algorithm we see an even better convergence of the spectra profiles than we observed with the previous algorithm. In fact, setting the threshold for either squared partial norm equal to 0.5 already results with a spectrum \textit{de facto} identical with the standard RT-TDCISD one. Interestingly, if we look at the dimensions of the propagation spaces (Table 3), we notice that for the smallest threshold values the numbers of selected CISD states strongly differ depending on whether we choose them based on $N_k^{\mathrm{RS}}$ or on $N_k^{\mathrm{RSBC}}$. However, along with increasing the threshold, this difference starts to decrease, and for the largest value of 0.5 in both selection schemes we arrive at the same number of 129 states. After a careful analysis, we found these states to constitute exactly the same subset of the full CISD eigenspectrum. This discards our hypothesis that the bound+continuum double excitations have a key role in laser-driven dynamics and should be treated on an equal footing with single excitations when performing correlated real-time calculations. Instead, of all 10153 CISD eigenstates we have identified a subset of 129 ones which are dominated by the reference and/or singly excited configurations, and which are sufficient to describe the correlated laser-driven electron dynamics at both examined laser intensities. The fact that we can reduce the dimension of the propagation space by two orders of magnitude while still being able to retrieve a fully correlated picture of HHG shows the true strength of this algorithm. \begin{figure}[h] \centering \includegraphics[width=0.8\linewidth]{fig5.eps} \caption{HHG spectra of the H\textsubscript{2} molecule computed using standard RT-TDCISD and using RT-TDCISD with the algorithm of selecting CISD eigenstates based on the value of $N_k^{\mathrm{RS}}$ (left column) and $N_k^{\mathrm{RSBC}}$ (right column)} \end{figure} \begin{table}[h] \centering \caption{Dimensions of RT-TDCISD propagation spaces obtained using the algorithm of selecting CISD states based on their $N_k^{\mathrm{RS}}$ and $N_k^{\mathrm{RSBC}}$ values} \begin{tabular}{ccc} \toprule {partial norm} & {CISD states with $N_k^{\mathrm{RS}}$} & {CISD states with $N_k^{\mathrm{RSBC}}$} \\ {threshold} & {above threshold} & {above threshold} \\ \midrule 0.001 & 1382 & 5034 \\ 0.01 & 492 & 2769 \\ 0.1 & 173 & 529 \\ 0.5 & 129 & 129 \\ \bottomrule \end{tabular} \end{table} \section{Conclusion} In this work we introduced, implemented, and tested several algorithms designed for reducing computational costs of RT-TDCISD simulations of laser-driven electron dynamics, with particular emphasis on modeling the high-harmonic generation process. Their common feature is that they all rely on decreasing the number of CISD eigenstates the time-dependent CI vector is expanded into. In the first one we limit the number of active virtual orbitals from which the configurations are constructed from, leaving only these with energies lower than a certain threshold linked to the HHG cutoff energy predicted by the three-step model. In the second one, we apply a similar procedure, but instead of truncating the number of virtual orbitals, we compute the CISD eigenspectrum in a full MO space and then discard eigenstates above a predefined energy threshold. Finally, in the third one, from the full CISD eigenspectrum we select the eigenstates to be included in real-time propagation depending on the contribution of certain types of excited configurations. After performing test calculations of the HHG spectra of the hydrogen molecule, we found the latter two algorithms to be extremely efficient at selecting eigenstates that are of the most importance for the laser-driven electron dynamics. At two examined laser intensities both of them were able to reduce the dimension of the propagation space by two orders of magnitude without affecting the time-resolved observables. Moreover, both algorithms are largely independent from each other because they rely on different theoretical assumptions: that not all excited states are energetically accessible in a certain laser field, and that the matter-light interaction in the tunneling ionization regime of HHG is dominated by single-electron transitions, respectively. Thanks to this, one can potentially combine both selection schemes to obtain even better results. Aside for making the RT-TDCISD calculations much more affordable for larger systems and longer simulation times, these two algorithms may also be used as a tool for obtaining valuable information about the evolution of the wavefunction in the electromagnetic field. For instance, we found out that at intensities typical for strong field experiments the HHG process in the H\textsubscript{2} molecule is driven mostly by a surprisingly small percentage of all excited CISD states, all of which are characterized by a dominant contribution of the ground and singly excited configurations and energies at most slightly exceeding the HHG energy cutoff of the three-step model. As a consequence, we have confirmed that even if describing the laser-driven electron dynamics with a fully correlated \textit{ab initio} approach, the key predictions of 3SM still hold true. On the other hand, we have shown that the method of truncating the active virtual-orbital space, routinely used in time-independent calculations of ground and low-excited states, is not a recommended approach in modeling strong field processes. The excitations to very high-energy virtual orbitals usually have small but non-neglible contribution to all excited states and removing even a small portion of them may disrupt the description of HHG in a way that is hard to predict. Finally, in this paper we also compare two approaches of supplementing the Gaussian basis sets with functions designed for the description of highly excited and continuum states: the one in which we place the additional functions on each atomic center and the one in which we place them at the center of the examined system. From our calculations, we conclude that for diatomic molecules the latter option, although initially appealing, produces less accurate results and should be used with caution. \section*{Acknowledgements} We acknowledge support from the National Science Centre, Poland (Symfonia Grant No.\\ 2016/20/W/ST4/00314). The calculations have been partially carried out using resources provided by Wroclaw Centre for Networking and Supercomputing, grant No. 567. M. L. also acknowledges support from: ERC AdG NOQIA; Ministerio de Ciencia y Innovation Agencia Estatal de Investigaciones (PGC2018-097027-B-I00/10.13039/501100011033, CEX2019-000910-S/10.13039/501100011033, Plan National FIDEUA PID2019-106901GB-I00, FPI, QUANTERA MAQS PCI2019-111828-2, QUANTERA DYNAMITE PCI2022-132919, Proyectos de I+D+I “Retos Colaboración” QUSPIN RTC2019-007196-7); MICIIN with funding from European Union NextGenerationEU(PRTR-C17.I1) and by Generalitat de Catalunya; Fundació Cellex; Fundació Mir-Puig; Generalitat de Catalunya (European Social Fund FEDER and CERCA program, AGAUR Grant No. 2017 SGR 134, QuantumCAT \textbackslash U16-011424, co-funded by ERDF Operational Program of Catalonia 2014-2020); Barcelona Supercomputing Center MareNostrum (FI-2022-1-0042); EU Horizon 2020 FET-OPEN OPTOlogic (Grant No 899794); EU Horizon Europe Program (Grant Agreement 101080086 — NeQST); ICFO Internal “QuantumGaudi” project; European Union’s Horizon 2020 research and innovation program under the Marie-Skłodowska-Curie grant agreement No 101029393 (STREDCH) and No 847648 (“La Caixa” Junior Leaders fellowships ID100010434: LCF/BQ/PI19/11690013, LCF/BQ/PI20/11760031, LCF/BQ/PR20/11770012, LCF/BQ/PR21/11840013). Views and opinions expressed in this work are, however, those of the author(s) only and do not necessarily reflect those of the European Union, European Climate, Infrastructure and Environment Executive Agency (CINEA), nor any other granting authority. Neither the European Union nor any granting authority can be held responsible for them.
\section{Phase space analysis for the number of EPs in bulk} The NH Hamiltonian $H_{NHW}=H_0(k)+i\delta\sigma_0\kappa_1$ in the main text hosts two, four, six, and a maximum of eight EPs in the bulk. The parameters chosen in the main text are such that there are eight EPs in the bulk. The location of these EPs as the function of $k_z$ is obtained by solving the dispersion relation $E(k_z)=0$, where, \normalsize{ \begin{equation}\label{eq1} E(k_z)=\pm \frac{1}{2} \sqrt{8 \gamma (\gamma +2)-4 \delta ^2+8 (\gamma +1) \cos (k_z)\pm 4 \sqrt{\left(2 m^2-\delta ^2\right) (2 \gamma +\cos (k_z)+2)^2}+\cos (2 k_z)+4 m^2+9}. \end{equation} } Here, we have fixed $k_x$ and $k_y$ to be at zero. The eight EPs are located at values, $\pm [\pi-\arccos{\left(2 \gamma +\delta +m'+2\right)}$, $ \arccos \left(-2 \gamma +\delta \pm m'-2\right)$, $ \arccos \left(-2 \gamma -\delta + m'-2\right)]$ with $m'=\sqrt{2m^2-\delta^2}$. For a fixed value of $\delta$, when $\gamma$ varies such that one goes from a phase with eight EPs to six EPS, two of the $k_z$ values where EPs appear become complex (the argument of the arccos have a value greater than one). Similar behavior has been observed whenever we cross the phase boundaries in Fig. \ref{phase}. Their number clearly depends upon $\gamma$ and $\delta$ as $m$ is kept constant. At $k_z=\pm\pi$, EPs annihilate each other to change their number. So, we solve the dispersion relation at $k_z=\pm\pi$ to obtain the phase space trajectory. Solving the dispersion relation of $H(k)_{NHW}$ at $k_z=\pm\pi$ , we get phase separation trajectory $(1+2\gamma\pm\delta)^2=2m^2-\delta^2$. \begin{figure}[h] \centering \includegraphics[width=8cm]{phase_diagram.png} \caption{The phase diagram for the number of EPs in the bulk with elliptical phase boundaries. From the extreme left ($\gamma=-1$) we start with eight EPs and gradually annihilate them to decrease their number. One cannot directly reach from eight to zero EPs. There exist an interesting point in the phase diagram with values $\gamma=-0.5$ and $\delta \sim 0.4$, which we name the triple point of EPs in the bulk. Infinitesimal change around this point marks a phase transition and takes us to phases with different no. of EPs.} \label{phase} \end{figure} We evaluate the value of $\delta$ from the phase space trajectory as, \begin{equation}\label{eq2} \left\{\delta \to \pm \frac{1}{2} \left(2 \gamma \pm \sqrt{4 m^2-(2 \gamma +1)^2} + 1\right)\right\}. \end{equation} For a fixed value of $m$, $\delta$ depends only on $\gamma$, therefore, we obtain two intersecting ellipses in the $\gamma-\delta$ plane. This plot is shown in Fig. \ref{phase}, with the number of EPs in the bulk encoded with color code. Notably, there exists a peculiar point in the parameter space $\gamma=-0.5$ and $\delta\sim0.4$ where an infinitesimal change in the value of $\delta$ or $\gamma$ will take to phases with different number of EPs therefore we coin it as triple point of EPs. \section{Surface states Analysis } In this section, we calculate the tight-binding Hamiltonian of $H_\text{NHW} (k)$ with one axis OBC while maintaining PBC in the other two directions. The lattice version of the bulk Hamiltonian has the following form, \begin{equation}\label{seq4} H_{slab}= H_0 \sum_{x=1}^N \, c_{x}^{\dagger}c_{x} + \sum_{x=1}^{N-1} (t_x\,c_{x}^{\dagger}c_{x+1}+ \text{H.c.} ). \end{equation} Here, $H_0(k_z,k_y,\gamma,\delta,m)=(\gamma+\frac{1}{2}cos(k_z)\Gamma_4+ (\gamma +\frac{1}{2}cos(k_z)+ cos k_y)\Gamma_2 + sin k_y \Gamma_1 + m\sigma_0\kappa_2.$ and $t_x=\frac{1}{2}\Gamma_4-i\Gamma_3$ and $j$ is the unit cell index, we remind the readers that each unit cell has four spinless orbitals. The matrix form or the slab Hamiltonian of the above model is expressed in block off-diagonal form as, \begin{equation}\label{seq5} H_{slab} = \begin{bmatrix} H_0 & t_x & 0 & \dots & 0 & 0 & 0\\ t_x^{\dagger} & H_0 & t_x & \dots & 0 & 0 & 0 \\ 0 & t_x^{\dagger} & H_0 & \dots & 0 & 0 & 0 \\ \vdots & \vdots & \vdots & \ddots & \vdots &\vdots &\vdots \\ 0 & 0 & 0 & \dots & H_0 & t_x & 0 \\ 0 & 0 & 0 & \dots & t_x^{\dagger} & H_0 & t_x \\ 0 & 0 & 0 & \dots & 0 & t_x^{\dagger} & H_0 \\ \end{bmatrix}. \end{equation} \begin{figure}[t] \centering \begin{tabular}{c c c c} \includegraphics[width=0.24\linewidth]{g-13resur.png}& \includegraphics[width=0.24\linewidth]{g-07resur.png}& \hspace*{-0.2cm}\includegraphics[width=0.24\linewidth]{g-13imsur.png}& \hspace*{-0.3cm}\includegraphics[width=0.24\linewidth]{g-07imsur.png} \\ \includegraphics[width=0.24\linewidth]{g-13abssur.png}& \hspace*{-0.4cm}\includegraphics[width=0.24\linewidth]{g-07abssur.png}& \includegraphics[width=0.23\linewidth]{Figure_31.png} & \hspace*{-0.cm}\includegraphics[width=0.235\linewidth]{Figure_11.png} \end{tabular} \caption{Band diagrams for the slab Hamiltonian in Eq. (\ref{seq4}) as a function of $k_z$. (a) The real part of the energy spectrum for $\gamma=-1.3$. (b) Same plot for the parameter $\gamma=-0.7$. Both of them host zero energy surface states. (c) and (d) imaginary energy spectra for (a) and (b) respectively, both show the formation of concentric rings. (e) and (f) Plots of the absolute value of energy for $\gamma=-1.3$ and $-0.7$ respectively, one can clearly point out the deviation of dispersion around DPs from linear Dirac nature ($\gamma=-1.0$ in the main text). (g) and (h) are contour plots for (e) and (f) respectively, in ($k_y$-$k_z$) plane. These plots capture the nonlinear nature of the dispersion around the DPs (elliptical contour), which appear at $k_y=0 $ and $k_z=\text{cos}^{-1}[{-2(1+\gamma)}]$.} \label{sur1} \end{figure} The diagonal or the onsite part of the slab Hamiltonian is, \begin{equation}\label{seq6} H_0(k_z,k_y,\gamma,\delta,m)= \normalsize{\left( \begin{array}{cccc} 0 & i \delta -i m & \gamma +\frac{\cos \left(k_z\right)}{2} & \gamma +e^{i k_y}+\frac{\cos \left(k_z\right)}{2} \\ i \delta +i m & 0 & -\gamma -e^{-i k_y}-\frac{\cos \left(k_z\right)}{2} & \gamma +\frac{\cos \left(k_z\right)}{2} \\ \gamma +\frac{\cos \left(k_z\right)}{2} & -\gamma -e^{i k_y}-\frac{\cos \left(k_z\right)}{2} & 0 & i \delta -i m \\ \gamma +e^{-i k_y}+\frac{\cos \left(k_z\right)}{2} & \gamma +\frac{\cos \left(k_z\right)}{2} & i \delta +i m & 0 \\ \end{array} \right)}, \end{equation} whereas, the off-diagonal part is, \begin{equation}\label{seq7} t_x= \left( \begin{array}{cccc} 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ \end{array} \right) \,\,\,\,\,\,\,\,\, and \,\,\,\,\,\,\,\,\, t_x^{\dagger}= \left( \begin{array}{cccc} 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ \end{array} \right). \end{equation} The surface plots for the other two parameters, apart from $\gamma=-1$, are shown in Fig. \ref{sur1}. \section{Higher order hinge state analysis } \begin{figure}[t] \centering \begin{tabular}{c c c c} \includegraphics[width=0.23\linewidth]{g-13rehinge.png}& \hspace*{-0.2cm}\includegraphics[width=0.23\linewidth]{g-07rehinge.png}& \hspace*{-0.2cm}\includegraphics[width=0.23\linewidth]{g-13abshinge.png}& \hspace*{-0.2cm}\includegraphics[width=0.23\linewidth]{g-07abshinge.png}\\ \includegraphics[width=0.22\linewidth]{psil1.png}& \hspace*{-0.4cm}\includegraphics[width=0.225\linewidth]{psil2.png}& \hspace*{-0.4cm} {\includegraphics[width=0.22\linewidth]{psil3.png}}& \hspace*{-0.4cm}\includegraphics[width=0.26\linewidth]{psil4.png}\\ \includegraphics[width=0.22\linewidth]{psir1.png}& \hspace*{-0.4cm}\includegraphics[width=0.215\linewidth]{psir2.png}& \hspace*{-0.4cm}\includegraphics[width=0.22\linewidth]{psir3.png}& \hspace*{-0.4cm}\includegraphics[width=0.26\linewidth]{psir4.png} \end{tabular} \caption{The real (blue) and the imaginary (red) part of the energy eigen spectrum for two-axes OBC Hamiltonian for (a) $\gamma=-1.3$ and (b) $\gamma=-0.7$ as a function of $k_z$. In (b) hinge states appear connecting two EPs (higher-order) and therefore, for this parameter value $H_\text{NHW}$ is in the higher order topological phase (c) and (d) corresponding absolute energy plots for (a) and (b). (e)-(h) four hinge states left handed wavefunction $\ket{\psi_L}$ evaluated for $k_z=0$ for $\gamma=-0.7$ . Out of four, there are two distinct-looking wavefunctions forced to be caged at the lower two corners because of HONHSE. (i)-(l) The corresponding right wavefunction $\ket{\psi_R}$ evaluated in same region for the same parameter value. Remarkably, these are localized at the upper two corners. } \label{hinges} \end{figure} In order to construct the hinges of the bulk system, we apply OBC along the $x$ and $y$ axes however, PBC is maintained along the z direction. The lattice Hamiltonian in two directions takes the form, \begin{equation}\label{seq8} H_\text{hinge}= H_0 \sum_{x,y=1,1}^{N_x,N_y} \, c_{x,y}^{\dagger}c_{x,y} \, \ \delta_{x,y} + \Big( t_x \sum_{x,y=1,1}^{N_x-1,N_y} \,c_{x,y}^{\dagger}c_{x+1,y}+ t_y \sum_{x,y=1,1}^{N_x,N_y-1} c_{x,y}^{\dagger}c_{x,y+1}+ \text{H.c.} \Big), \end{equation} where $N_x=N_y=N$ is the number of unit cells along $x$ and $y$ directions on a square lattice. The form of $H_0$ has the following form \begin{equation}\label{seq9} H_0(k_z,\gamma,\delta,m)= \left( \begin{array}{cccc} 0 & i \delta -i m & \gamma +\frac{\cos \left(k_z\right)}{2} & \gamma +\frac{\cos \left(k_z\right)}{2} \\ i \delta +i m & 0 & -\gamma -\frac{\cos \left(k_z\right)}{2} & \gamma +\frac{\cos \left(k_z\right)}{2} \\ \gamma +\frac{\cos \left(k_z\right)}{2} & -\gamma -\frac{\cos \left(k_z\right)}{2} & 0 & i \delta -i m \\ \gamma +\frac{\cos \left(k_z\right)}{2} & \gamma +\frac{\cos \left(k_z\right)}{2} & i \delta +i m & 0 \\ \end{array} \right), \end{equation} and the hopping matrices are, \begin{equation}\label{seq10} t_x=\left( \begin{array}{cccc} 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ \end{array} \right) \,\,\,\,\,\,\,\,\,\text{and} \,\,\,\,\,\,\,\,\,t_y=\left( \begin{array}{cccc} 0 & 0 & 0 & 1 \\ 0 & 0 & 0 & 0 \\ 0 & -1 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ \end{array} \right). \end{equation} The band diagram figure for the Hamiltonian $H_{\text{hinge}}$ depicts that for $\gamma=-1.3$, the hinges are fully gapped however, for $\gamma=-0.7$, hinge states connect the two EPs closest to $k_z=0$. This marks the higher-order topological phase of $H_{NHW}$. We check that these hinge states are four-fold degenerate with absolute zero energy eigenvalues. The energy spectrum and eigenstates are shown in Fig. \ref{hinges}. Notably, the hinge states occupy only the lower corners. This mismatch lies in the fact that this model possesses non-hermitian higher order skin effect (NHHOSE) \cite{zhang2021observation} due to which hinges are caged in the lower corners only. In order to visualize all four hinge localizations, we plot the left $\ket{\psi_L}$ along with right $\ket{\psi_R}$ wavefunctions, as discussed in the main text. \section{Slab Calculation for diabolic points: An analytical way to match eigenvalues} In this section, we provide an analytical way of calculating eigenvalues corresponding to DPs and their degeneracy. We begin by using the slab Hamiltonian \cite{ETI} in Eq. (\ref{seq4}), \begin{equation}\label{seq11} H_{slab} = \begin{bmatrix} H_0 & t_x & 0 & \dots & 0 & 0 & 0\\ t_x^{\dagger} & H_0 & t_x & \dots & 0 & 0 & 0 \\ 0 & t_x^{\dagger} & H_0 & \dots & 0 & 0 & 0 \\ \vdots & \vdots & \vdots & \ddots & \vdots &\vdots &\vdots \\ 0 & 0 & 0 & \dots & H_0 & t_x & 0 \\ 0 & 0 & 0 & \dots & t_x^{\dagger} & H_0 & t_x \\ 0 & 0 & 0 & \dots & 0 & t_x^{\dagger} & H_0 \\ \end{bmatrix}. \end{equation} In the diagonal or onsite part of the above Hamiltonian, we make the following substitutions, $k_z=\pi/2$, $k_y=0$, $\gamma=-1$ and $m=2\delta$ (we set $\delta$ and m as used in the main text). After substituting and simplifying it looks like, \begin{equation}\label{seq12} H_0(k_z=\pi/2,k_y=0,\gamma=-1,\delta,m=2\delta)= \left( \begin{array}{cccc} 0 & -i \delta & -1 & 0 \\ 3 i \delta & 0 & 0 & -1 \\ -1 & 0 & 0 & -i \delta \\ 0 & -1 & 3 i \delta & 0 \\ \end{array} \right). \end{equation} To derive the spectrum for these parameters, we analyze the solution of characteristics polynomial of $\text{det}[H_{\text{slab}}-\lambda \mathbb{I}_{4N \text{x} 4N}]=0$ where square lattice size is $4N$x$4N$. Even after these simplifications, the analytical solution remains infeasible. Therefore, to tackle this problem, we use Schur's determinant identity, \cite{terrier2020dissipative} \begin{equation}\label{seq13} det \left( \begin{array}{cc} a_2 & t_x^{\dagger} \\ t_x & a_1 \\ \end{array} \right) = det(a_1) \, det(a_1-t_x a_1^{-1}t_x^{\dagger} ). \end{equation} \begin{figure}[t] \centering \includegraphics[width=8cm]{finite.png} \caption{Two lowest energy eigenvalues as a function of the number of times Schur's determinant identity is used. We recursively use this identity and show that with the increase in the lattice size these two eigenvalues ultimately converge to zero. This captures the degeneracy of the DPs as well as the finite size effect of the system.} \label{finite} \end{figure} Here, we set $a_1=H_0-\lambda \mathbb{I}_{4 X 4}$ and thus, for slab Hamiltonian $a_2=H_{slab}(\pi/2,0,-1,\delta,m=2\delta)_{4(N-1) \text{x} 4(N-1)}$. We apply Schur's determinant identity to $a_2$ in an iterative manner and obtain a recursion relation that allows us to calculate all eigenvalues. We can start with $\text{det}(a_1)=0$, which gives four solutions. Next we compute $a_2=a_1-(a_1-t_x a_1^{-1} t_x^{\dagger} )$ along with $\text{det}(a_2)=0$ and repeat this process recursively as, \begin{equation}\label{seq14} \boxed{ a_{i+1}=a_1-(t_x a_{i}^{-1}t_x^{\dagger})}. \end{equation} \normalsize{ Finally, we take $\text{det}(a_{i+1})=0$, which gives us the eigenspectrum. We notice that there are two eigenvalues which converge to zero after continuing a series of iterations. The plot of the lowest energy solution with the number of times Schur's identity is being used is shown in Fig. \ref{finite}. Ultimately these two values converge to zero corresponding to two-fold degeneracy of DPs. It also captures the finite size effect, which demands the lattice to be large enough such that the DPs are exactly at zero energy. \section{Derivation of momenta values at DPs} In this section, we provide an analytical solution to find the exact momenta values at which the DPs are formed. In principle, one should work with the slab Hamiltonian, however, with $H_\text{slab}$ the analytical solution remains infeasible. Therefore, to proceed further, we project the bulk Hamiltonian along $k_x=0$ and $k_y=0$ momenta axes, \begin{equation}\label{seq15} H(k_z,\gamma,\delta,m)= \left( \begin{array}{cccc} 0 & i \delta -i m & \gamma +\frac{\cos \left(k_z\right)}{2}+1 & \gamma +\frac{\cos \left(k_z\right)}{2}+1 \\ i \delta +i m & 0 & -\gamma -\frac{\cos \left(k_z\right)}{2}-1 & \gamma +\frac{\cos \left(k_z\right)}{2}+1 \\ \gamma +\frac{\cos \left(k_z\right)}{2}+1 & -\gamma -\frac{\cos \left(k_z\right)}{2}-1 & 0 & i \delta -i m \\ \gamma +\frac{\cos \left(k_z\right)}{2}+1 & \gamma +\frac{\cos \left(k_z\right)}{2}+1 & i \delta +i m & 0 \\ \end{array} \right). \end{equation} \normalsize To reduce one more variable we keep $m=2\delta$ as in the main text. The characteristics polynomial of the above projected Hamiltonian is given by the form, \begin{equation}\label{seq16} E^4 + A \,E^2 +B =0, \end{equation} \normalsize where E is the energy eigenvalue, A and B have the following forms \begin{equation} A \,\,=\,\, \left(\delta ^2-2 \gamma (\gamma +2)\right)-8 \delta ^2-\cos \left(k_z\right) \left(4 \gamma +\cos \left(k_z\right)+4\right)-4, \end{equation} and \begin{equation} \begin{split} B\,\,=\,\,-16 \gamma (\gamma +2) \delta ^2+4 \gamma (\gamma +2) (\gamma (\gamma +2)+2)+9 \delta ^4-16 \delta ^2-4 \delta ^2 \cos \left(k_z\right) \left(4 \gamma +\cos \left(k_z\right)+4\right) \\ +\frac{1}{4} \cos ^2\left(k_z\right) \left(4 \gamma +\cos \left(k_z\right)+4\right){}^2+2 (\gamma +1)^2 \cos \left(k_z\right) \left(4 \gamma +\cos \left(k_z\right)+4\right)+4. \end{split} \end{equation} \normalsize We solve the characteristics polynomial for low energy, thus putting $E^4=0$ and solving for $E^2=0$, which is satisfied at $B/A=0$. After simplification we get, \begin{equation} B/A= -\gamma (\gamma +2)+\frac{11 \delta ^2}{2}-\frac{42 \delta ^4}{4 (\gamma +1)^2+6 \delta ^2+\cos \left(k_z\right) \left(4 \gamma +\cos \left(k_z\right)+4\right)}-\frac{1}{4} \cos \left(k_z\right) \left(4 \gamma +\cos \left(k_z\right)+4\right)-1. \end{equation} Neglecting the second and third terms as $\delta$ is small enough, it further simplifies into, \begin{equation} B/A= -\gamma (\gamma +2)-\frac{1}{4} \cos \left(k_z\right) \left(4 \gamma +\cos \left(k_z\right)+4\right)-1. \end{equation} Solving $B/A=0$ leads us to the following values of $k_z$ \begin{equation} \boxed{k_z\to \pm \cos ^{-1}[-2 (\gamma +1)]}. \end{equation} We note that $k_z$ is independent of $m$ and $\delta$ and explicitly depends only on $\gamma$. Also, the DPs appear exactly at those locations where the Dirac nodes are formed in the HODS \cite{huges} phase. From this, one can clearly deduce that DPs retain the memory of HODS phase.\\ \section{Verification of low energy dispersion relation near diabolic points} The Hamiltonian $H_\text{NHW}$ in the main text has the following matrix form, \begin{equation} H_\text{NHW}(k_x,k_y,k_z,\gamma,\delta,m)= {\left( \begin{array}{cccc} 0 & i \delta -i m & \gamma +e^{i k_x}+\frac{\cos \left(k_z\right)}{2} & \gamma +e^{i k_y}+\frac{\cos \left(k_z\right)}{2} \\ i \delta +i m & 0 & -\gamma -e^{-i k_y}-\frac{\cos \left(k_z\right)}{2} & \gamma+e^{-i k_x} +\frac{\cos \left(k_z\right)}{2} \\ \gamma +e^{-i k_x}+\frac{\cos \left(k_z\right)}{2} & -\gamma -e^{i k_y}-\frac{\cos \left(k_z\right)}{2} & 0 & i \delta -i m \\ \gamma +e^{-i k_y}+\frac{\cos \left(k_z\right)}{2} & \gamma +e^{i k_x} +\frac{\cos \left(k_z\right)}{2} & i \delta +i m & 0 \\ \end{array} \right)}. \label{S21} \end{equation} \normalsize{ We notice that the DPs are formed on the $x$-surface of the system. Therefore, we project the bulk Hamiltonian in the $k_y-k_z$ plane, assuming $k_x=0$. In principle, one should work with the slab Hamiltonian, however, with $H_\text{slab}$ the analytical solution remains infeasible. Therefore, we work only with $H_0$ (the diagonal part which depends on momentas) to extract the dependency of $E$ on $k_y$ and $k_z$. First, we expand the Hamiltonian near these momenta values of DPs for small values of $k_y$ which gives $e^{\pm i k_y}=1\pm i k_y$. Second, expansion of $k_z$ around $\pm \pi/2$ gives ${\cos \left(k_z\right)=\cos \left(k_{z}\pm \pi/2\right)=\pm \sin{(k_z)}=k_z}$. This step tremendously simplifies the Hamiltonian, thus the matrix form of $H_0$ takes the form} \begin{equation} H_0(k_x=0,k_z,k_y,\gamma=-1,\delta,m=\delta/2)= \normalsize{\left( \begin{array}{cccc} 0 & -i\delta & \frac{ k_z}{2} & i k_y+\frac{ k_z}{2} \\ 3i \delta & 0 & i k_y-\frac{ k_z}{2} & \frac{ k_z}{2} \\ \frac{ k_z}{2} & -i k_y-\frac{ k_z}{2} & 0 & -i \delta\\ -i k_y+\frac{ k_z}{2} & \frac{ \left(k_z\right)}{2} & 3i\delta & 0 \\ \end{array} \right)}. \label{S22} \end{equation} \begin{figure}[h] \centering \includegraphics[width=6cm]{abskz.png} \includegraphics[width=6cm]{g-1absky.png} \caption{Absolute energy band diagram for the OBC (surface) Hamiltonian of the main text, (a) along $k_z$ ($k_y=0$) showing the formation of two Dirac cones with linear dispersion at low energy. These are formed exactly at $k_z=\pm \pi/2$. (b) surface band diagram with same parameters along $k_y$ ($k_z=\pm \pi/2$), depicting a single Dirac cone at $k_y=0$. At this particular parameter, that is, $\gamma=-1$ low energy dispersion relations are linear along both the momenta direction.} \label{dirac} \end{figure} Although this form of Hamiltonian looks simple, the analytical form of the eigenvalues is complicated. In order to reduce the complicated form of eigenvalues, we take $k_y=0$ and solve the dispersion relation for $k_z$ and vice-versa. First taking $k_y=0$, the dispersion relation along $k_z$ has the form \begin{equation} E^4(k_z)= (k_z^2+2\sqrt{7} \delta k_z+6\, \delta^2) (k_z^2-2\sqrt{7}\delta k_z+6\, \delta^2)/4 = \big[ (k_z^2+6\, \delta^2)^2 -28 \delta^2 k_z^2\big]/4 \end{equation} and for $k_z=0$, along $k_y$ the dispersion takes the form, \begin{equation} E^4(k_y)=(k_y -3 i\,\delta) (k_y+i\,\delta)(k_y +3i\,\delta) (k_y-i\,\delta)=(k_y^2 +9\delta^2) (k_y^2+\delta^2). \end{equation} For small $\delta$, along both axes dispersion of the absolute value of energy $\sim |k|$ is shown in Fig. \ref{dirac}. Therefore, we verify analytically the linear form of low energy dispersion along $k_y$ and $k_z$ direction around the DPs at $\gamma=-1$. On plotting the surface band diagrams, we notice that at $\gamma=-1.5$ or -0.5, the low energy dispersion around DPs is quadratic in nature along $k_z$ and linear along $k_y$. This kind of quadratic dispersion is seen in Luttinger semimetals \cite{mandal2021transport,boettcher2016superconducting,ghorashi2018irradiated}. To analytically capture the quadratic dependency, we make following substitution in Eq. (\ref{S21}), $k_x=0$, and expand close to $k_y=0$ and $k_z=0$ such that $e^{\pm i k_y}=1\pm i k_y$ and $\cos(k_z)=1+\frac{k_z^2}{2}$ after neglecting higher order terms. We note that the only difference between $\gamma=-1.5$ and -0.5 is the value of $k_{z0}$. Further, some algebraic manipulations simplify the Hamiltonian into,} \begin{equation} H_0(k_x=0,k_y,k_z,\gamma=-1.5,\delta,m=\delta/2)= {\left( \begin{array}{cccc} 0 & -i \delta & \frac{ k_z^2}{4} & i k_y+\frac{ k_z^2}{4} \\ 3i \delta & 0 & i k_y-\frac{ k_z^2}{4} & \frac{ k_z^2}{4} \\ \frac{ k_z^2}{4} & -i k_y-\frac{ k_z^2}{4} & 0 & -i \delta\\ -i k_y+\frac{ k_z^2}{4} & \frac{ k_z^2}{4} & 3i \delta & 0 \\ \end{array} \right)}. \end{equation} \begin{figure}[t] \centering \includegraphics[width=6cm]{g-15abskz.png} \includegraphics[width=6cm]{g-15absky.png} \caption{Surface band diagram similar to Fig. \ref{dirac} with $\gamma=-1.5$. (a) as a function of $k_z$ ($k_y=0$) depicting a Luttinger quadratic dispersion relation. At $\gamma=-0.5$ this quadratic dispersion is formed at $k_z=\pm \pi/2$ as shown in Fig. 2(e) of the main text. (b) In the band diagram, a single Dirac cone has been observed as a function of $k_y$. Therefore, along $k_y$ the dispersion is always linear in nature.} \label{lutt} \end{figure} It has an exactly similar form to Eq. (\ref{S22}) where only $k_z/2$ gets replaced with $k_z^2/4$ and remarkably $ik_y$ remains the same. Therefore, using a similar analysis we can account for quadratic dispersion, with absolute value of $E \sim k_z^2$, along one axis and as $k_y$ along another. This kind of dispersion relation is captured in Fig. \ref{lutt}. \section{Topological Invariants} \subsection{1-D winding number to characterize the topology of Bulk EPs} The main text Hamiltonian $H_{NHW}(k)=H_0(k)+i\delta\sigma_0\kappa_1$, is not off-block diagonal for the chosen basis. So, in order to invoke the hidden sublattice symmetry in the model and make it an off-block diagonal, we change the basis of the Hamiltonian $H_{NHW}$ by rotating the Pauli matrix ($\sigma_s^i$ and $\kappa_s^i$) about the $y$ axis. The transformations are as follows, $\sigma^x \rightarrow \kappa^y\sigma^x$, $\sigma^y \rightarrow \sigma^y$, $\sigma^z \rightarrow \kappa^y\sigma^z$ for $\sigma_s^i$ and $\kappa^x \rightarrow \sigma^y\kappa^x$, $\kappa^y \rightarrow \kappa^y$, $\kappa^z \rightarrow \sigma^y\kappa^z$ for $\kappa_s^i$. After successfully applying these transformations to the Hamiltonian and projecting it along the $x$-axis, the bulk Hamiltonian takes the form, \begin{equation} H_{NHW}(k)= \left( \begin{array}{cc} 0 & Q_1 \\ Q_2 & 0 \\ \end{array} \right) \end{equation} where the upper block is given by, \begin{equation} Q_1=\left( \begin{array}{cc} -\sin \left(k_y\right)-i \text{m} & \delta +(1-i) \left(\gamma +\frac{\cos \left(k_z\right)}{2}\right)-i+\cos \left(k_y\right) \\ -\delta +(-i-1) \left(\gamma +\frac{\cos \left(k_z\right)}{2}\right)-i-\cos \left(k_y\right) & -\sin \left(k_y\right)-i \text{m} \\ \end{array} \right), \end{equation} and, the lower block is given by, \begin{equation} Q_2=\left( \begin{array}{cc} -\sin \left(k_y\right)+i \text{m} & \delta +(i-1) \left(\gamma +\frac{\cos \left(k_z\right)}{2}\right)+i-\cos \left(k_y\right) \\ -\delta +(i+1) \left(\gamma +\frac{\cos \left(k_z\right)}{2}\right)+i+\cos \left(k_y\right) & -\sin \left(k_y\right)+i \text{m} \\ \end{array} \right). \end{equation} As the system is NH, $Q_2 \neq Q_1^{\dagger}$ as expected. The winding number as a function of $k_z$ is given by, \begin{equation} W_{(1,2)}^{k_x=0}(k_z)=\int_{-\pi}^{\pi}\frac{1}{2\pi i}\partial_{k_y}\log\big(\text{det}[ Q_{1,2}(k_y,k_z)]\big)dk_y. \end{equation} As discussed in the main text, it is noticed that $W=W_1+W_2$ flip sign after hitting any of the EPs and jumps from 0 to $\pm 1$. Therefore, we conclude that these bulk EPs are topological in nature. \subsection{Real space open boundary Chern number } In Hermitian systems, the appearance of robust topologically protected edge modes can be directly predicted only by looking at the bulk. These edge modes appear whenever there is a quantization of the Chern number or any of the topological indices in the bulk. So, if one knows about the bulk, the boundary can be predicted and vice versa, this is known as bulk boundary correspondence (BBC). This is a remarkable phenomenon in Hermitian systems where the topological phase transition is marked by band touchings. On the contrary, NH systems do not follow the traditional BBC \cite{genbbc,okuma2020topological}. In such a scenario, it is quite difficult to reestablish a simplified correspondence between the bulk or boundary as in the case of Hermitian systems. Therefore, we calculate the topological invariant in real space with open boundaries as opposed to calculating them in momentum space. To begin with, we use the eigenstates of the Hamiltonian with OBC along two axes. As written in the main text, using $\hat{P_{\alpha}}$, open boundary Chern number is calculated as \cite{song2019non}, \begin{equation} C_\alpha=\frac{2\pi \iota}{L_{x}'L_{y}'}Tr'\left(\hat{P_\alpha}[[\hat{X},\hat{P_\alpha}],[\hat{Y},\hat{P_\alpha}]]\right). \end{equation} \subsection{Biorthogonal higher order topological invariant: $q_{xy}$} It is well known that the appearance of hinge states is a clear signature of the higher order topological phase of 3D systems\cite{huges, wang}. Hinge gapless modes appear where the one-axis OBC spectrum, that is, the surface is gapped. We notice that the innermost EPs closest to the $\Gamma$ point in BZ are connected by four-fold degenerate hinge states. Thus, we conclude that the innermost EPs are higher-order \cite{mandal2021symmetry,hodaei2017enhanced}. For Hermitian systems as well as their NH generalizations, higher order topology is always characterized by the presence of quadruple moment, $q_{xy}$. This kind of analysis is well explored in existing literature \cite{multipole,benalelectric} and is given by, \begin{equation} Q_{corner}-p_x^{edge}-p_y^{edge}=-q_{xy}. \end{equation} Here, $p_x^{edge}$ ($p_y^{edge}$) is surface polarization along the $x (y)$ axis. The charge $Q_{corner}$ is localized at the corners of each 2D $k_z$ slice of the material. As mentioned in the previous section due to the presence of the NH skin effect and breaking down of BBC, it is challenging to use this formula \cite{nhhigherdirac} as the explicit calculations of $p_x^{edge}$ and $p_y^{edge}$ and corner charge($Q_{corner}$) are complicated. In order to avoid all these complications and be motivated by the previous success of biorthogonal approach, we use real space operator-based formalism to calculate the quadruple moment $q_{xy}$. From a previous study \cite{wu2021floquet}, using the same line of thought $q_{xy}$ is defined in main text as, \begin{equation} q_{xy}=\left (\frac{Im (\,\, \text{ln} \, [\text{det}s \,\, \hat{Q}] \, )}{2\pi}-\frac{\sum_i \hat{X}_i\hat{Y}_i}{2 l_x l_y}\right) \,\, mod \,\, 1, \end{equation} This formalism gives the quantized value of quadruple moment to half only at those locations where gapless hinge modes appear connecting the innermost EPs. \section{Model preserving Inversion symmetry} Here we present a model with explicit momentum dependence in the NH perturbation. As a result, it breaks the time-reversal symmetry ($\mathcal{T}$) but preserves inversion symmetry ($\mathcal{P}$) \cite{hughesinv}. \begin{equation} H^{\mathcal{I}}_{\text{NHW}}(k)=H_0(k)+i\, \delta\sigma_0\kappa_1 \sin(k_z), \label{IH} \end{equation} where $H_0(k)$ is the same Hermitian part as of the main text, \begin{align} &H_0(k)= \sum_{j=1}^4 h_j \Gamma_j + m \sigma_0\kappa_2. \end{align} Similar to the model in the main text, here also we can control the number of EPs in the bulk. The EPs are either connected by first-order surface or higher-order hinge states, depending upon the topological phase of the material. All the band diagrams corresponding to the bulk, surface, and hinges are plotted in Fig. \ref{invsym}. Upon increasing the value of $\gamma$, from -1.3 to -0.7, we are able to generate higher-order EPs in the bulk, which are connected by hinge states. Thus, similar to the model in the main text, one can traverse from normal to a higher-order phase by tuning system parameters. \begin{figure}[h] \centering \begin{tabular}{c c c } \includegraphics[width=0.28\linewidth]{g-13invbulk.png}& \hspace*{-.1cm}\includegraphics[width=0.28\linewidth]{g-10invbulk.png}& \hspace*{-.1cm}\includegraphics[width=0.28\linewidth]{g-07invbulk.png} \\ \includegraphics[width=0.28\linewidth]{g-13invresur.png} & \hspace*{-0.1cm} \includegraphics[width=0.28\linewidth]{g-10invresur.png}& \hspace*{-0.1cm}\includegraphics[width=0.28\linewidth]{g-07invresur.png} \\ \includegraphics[width=0.28\linewidth]{g-13invimsur.png}& \hspace*{-0.1cm}\includegraphics[width=0.28\linewidth]{g-10invimsur.png} & \hspace*{-0.1cm}\includegraphics[width=0.28\linewidth]{g-07invimsur.png} \\ \includegraphics[width=0.28\linewidth]{g-13invabssur.png}& \hspace*{-0.1cm}\includegraphics[width=0.28\linewidth]{g-10invabssur.png}& \hspace*{-0.1cm}\includegraphics[width=0.28\linewidth]{g-07invabssur.png} \\ \includegraphics[width=0.28\linewidth]{g-13invrehinge.png} & \hspace*{-0.1cm}\includegraphics[width=0.28\linewidth]{g-10invrehinge.png}& \hspace*{-0.1cm}\includegraphics[width=0.28\linewidth]{g-07invrehinge.png} \\ \includegraphics[width=0.28\linewidth]{g-13invabshinge.png} & \hspace*{-0.1cm}\includegraphics[width=0.28\linewidth]{g-10invabshinge.png}& \hspace*{-0.1cm}\includegraphics[width=0.28\linewidth]{g-07invabshinge.png} \end{tabular} \caption{(a)-(c) Bulk energy spectrum for inversion symmetric Hamiltonian written in Eq. (\ref{IH}), for $\gamma(-1.3,-1.0,-0.7)$ from left to right column in all the rows. We consider $m$ and $\delta$ to have the same values as in the main text. Corresponding real, imaginary, and absolute parts of eigenvalues for the $x$ surface, have been shown in (d)-(f), (g) - (i), and (j)- (l), respectively. The absolute energy consists of DPs with modulating dispersion with the variation in $\gamma$. In (m)-(o), hinge spectrum with two-axes OBC for inversion symmetric model with real part in blue and imaginary in red. (p)-(r) Corresponding absolute energy spectrum for hinge states. Notably, spectrum is linear close to DPs at $\gamma=-1$.} \label{invsym} \end{figure} \section{Model preserving Time Reversal symmetry} Unlike the inversion symmetric model written in Eq. (\ref{IH}), here we introduce momentum dependence to the Weyl perturbation along with NH perturbation. Due to this change, the model breaks inversion symmetry ($\mathcal{P}$) but in turn, preserves time-reversal symmetry ($\mathcal{T}$) with complex conjugate ($\mathcal{K}$) being the time reversal operator. \begin{equation} H^{\mathcal{T}}_{\text{NHW}}(k)=H'_0(k)+i\, \delta\sigma_0\kappa_1sin(k_z), \label{HTR} \end{equation} where $H'_0(k)$ is the Hermitian part with momentum dependant Weyl perturbation, \begin{align} &H'_0(k)= \sum_{j=1}^4 h_j \Gamma_j + m \sigma_0\kappa_2 sin(kz). \end{align} The band diagrams of the TR symmetric model corresponding to the bulk, one-axis OBC surface, and two-axis OBC hinges are plotted in Fig. \ref{trsym}. In contrast to the inversion symmetric model, this model hosts eight EPs in the bulk for all three values of $\gamma$. We notice that out of eight EPs, four are of the normal order in nature as they are connected by the surface states. At $\gamma=-1.3$, hinge states do not appear, and thus, higher-order EPs are not present. As we vary $\gamma$, two EPs closest to $k_z=0$ transform into higher-order and are connected by four-fold degenerate hinge states, along with the remaining four first-order EPs. \\ Figs. \ref{invsym} and \ref{trsym} highlight the fact that there is no significant deviation in the outcome from the model discussed in the main text. This implies that these symmetries ($\mathcal{I}$ and $\mathcal{T}$) turn out to be futile for the model in the main text. Another interesting point is, the momenta values of DP and the form of low energy dispersion around them do not change when we are at Dirac phase $(\gamma=-1)$ or in the Luttinger phase $(\gamma=-0.5)$ even after invoking the above symmetries. We, therefore, conclude that the DPs on the surface do not require these symmetries to stabilize them. \begin{figure}[h] \centering \begin{tabular}{c c c } \includegraphics[width=0.28\linewidth]{g-13trbulk.png}& \hspace*{-.1cm}\includegraphics[width=0.28\linewidth]{g-10trbulk.png}& \hspace*{-.1cm}\includegraphics[width=0.28\linewidth]{g-07trbulk.png} \\ \includegraphics[width=0.28\linewidth]{g-13trresur.png} & \hspace*{-.1cm} \includegraphics[width=0.28\linewidth]{g-10trresur.png}& \hspace*{-.1cm}\includegraphics[width=0.28\linewidth]{g-07trresur.png} \\ \includegraphics[width=0.28\linewidth]{g-13trimsur.png} & \hspace*{-.1cm}\includegraphics[width=0.28\linewidth]{g-10trimsur.png} & \hspace*{-.1cm} \includegraphics[width=0.28\linewidth]{g-07trimsur.png} \\ \includegraphics[width=0.28\linewidth]{g-13trabssur.png}& \hspace*{-.1cm}\includegraphics[width=0.28\linewidth]{g-10trabssur.png} & \hspace*{-.1cm}\includegraphics[width=0.28\linewidth]{g-07trabssur.png} \\ \includegraphics[width=0.28\linewidth]{g-13trrehinge.png}& \hspace*{-.1cm}\includegraphics[width=0.28\linewidth]{g-10trrehinge.png}& \hspace*{-.1cm}\includegraphics[width=0.28\linewidth]{g-07trrehinge.png} \\ \includegraphics[width=0.28\linewidth]{g-13trabshinge.png} & \hspace*{-.1cm}\includegraphics[width=0.28\linewidth]{g-10trabshinge.png}& \hspace*{-.5cm}\includegraphics[width=0.28\linewidth]{g-07trabshinge.png} \end{tabular} \caption{(a)-(c) Bulk spectrum for the time-reversal symmetric model written in Eq. (\ref{HTR}), for $\gamma=(-1.3,-1.0,-0.7)$. (d)-(f) Corresponding real eigenspectrum of $x$ surface ($k_y=0$) along $k_z$, showing surface FAs. (g)-(i) Imaginary eigenspectrum along $k_z$ (j)-(l) Same $x$ surface but with absolute energy depicting DPs with modulating dispersion with change in $\gamma$. (m)-(o) Hinge spectrum with two-axis OBC for inversion symmetric model. (p)-(r) Corresponding hinge absolute energy spectrum. Other parameters are the same as used in Fig. \ref{invsym}.} \label{trsym} \end{figure} \end{document}
\section{Introduction} \label{sec:intro} The origin of ultra-high energy cosmic rays (UHECRs) is currently unknown. Their identification is based mostly on catching a potentially interesting class of astronomical objects in the UHECR arrival directions. An observation remains remains elusive, although new investigations have allowed for broad statements to be made. Above $\simeq 8$ EeV \citep{PierreAuger:2017pzq}, an anisotropy at large scales has been discovered, the intensity and direction of which are consistent with assumptions drawn from sources distrubuted in a similar way to extragalactic matter \citep{PierreAuger:2017pzq,PierreAuger:2018zqu}. A correlation between UHECR arrival directions and the flux distributions of massive, star-forming, or active galaxies within 200 Mpc provides evidence for anisotropy at higher energies ($\gtrsim 40$ EeV) \citep{PierreAuger:2018qvk,PierreAuger:2022rfz}. Overall, these results suggest that UHECRs are primarily of extragalactic origin, at least above the so-called ankle energy ($\simeq 5$ EeV). The observed energy spectrum and chemical composition of UHECRs on Earth are the result of emission processes that include acceleration mechanisms, losses and escape from source environments, as well as propagation effects. Differently from, and complementing to anisotropies, these two observables provide constraints, helping to infer the features of the acceleration processes, the energetics of the sources, and the abundances of elements in the source environments. Following this idea, various investigations have set the groundwork for a generic scenario that broadly replicates the observations. \citep{Aloisio:2013hya,PierreAuger:2016use,PierreAuger:2021mmt}. The intensity of the different nuclear components at the sources, generally assumed as standard candles and uniformly distributed in a comoving volume, is supposed to drop off at the same magnetic rigidity to explain the steady increase with energy of mass number $A$ observed on Earth \citep{PierreAuger:2010ymv,PierreAuger:2014gko}. This agrees to the underlying assumption that electromagnetic processes accelerate particles to a maximum energy proportional to their electric charge $Z$. The abundance of nuclear elements is observed to be dominated by intermediate-mass ones, ranging from He to Si, accelerated to $E^{Z}_{\mathrm{max}}\simeq 5Z\,\text{EeV}$ and leaving from the source environments with a very hard spectral index $\gamma$. The constraints on the characteristics of the sources are actually discussed in \citep{Luce_2022}. To accomplish so, data from the Pierre Auger Observatory beyond 0.63 EeV ($10^{17.8}$ eV) were taken into account. However, in contrast to other approaches, only the proton spectrum is used in the energy range between 0.63 EeV and 5 EeV. This method allows us to reconstruct the extra-galactic component without introducing any ad hoc nuclear components at the lowest energies, to represent what is generally believed to be the upper end of the galactic component, in the combined fit of both energy spectrum and mass composition. Because of both observational systematics and theoretical uncertainties, such modeling alters the reconstruction of the extragalactic proton component with biases intrinsic in the choices made. \section{Generic model of UHECR production with in-source interactions} \label{sec:model} The main assumptions of the benchmark astrophysical model employed here can be found in \cite{PierreAuger:2016use}. The non-thermal processes responsible for accelerating the different types of particles are modeled using power-law spectra proportional to the charge $Z$, such as $E^{Z}_{\mathrm{max}}=ZE_{\mathrm{max}}$, while an exponential suppression is used to describe the end of the acceleration process in the absence of any strong indication from theory. The sources are believed to accelerate diverse proportions of nuclei, which are represented by five stable ones: hydrogen ($^1$H), helium ($^4$He), nitrogen ($^{14}$N), silicon ($^{28}$Si), and iron ($^{56}$Fe). The ejection rate per comoving volume unit and per energy unit of nucleons is usually modeled as \begin{equation} \label{eqn:qN} q_{\rm p}(E) = q_{0{\rm p}}\left(\frac{E}{E_0}\right)^{-\gamma_{\rm p}}f_{\mathrm{supp}}(E,Z_{\rm p}), \end{equation} Using $Z_{\rm p}=1$,which is a single ejection rate $q_{0{\rm p}}$, spectral index $\gamma_{\rm p}$, and suppression function $f_{\mathrm{supp}}(E,Z_{\rm p})$ for both escaping protons and neutron decay protons. In this case, $E_0$ is arbitrarily fixed to 1\:EeV. Generically, the ejection rate of nuclei with mass number ${A}_i$ is likewise modeled as \begin{equation} \label{eqn:qA} q_{{A}_i}(E) = q_{0{A}_i}\left(\frac{E}{E_0}\right)^{-\gamma_{A}}f_{\mathrm{supp}}(E,Z_{{A}_i}), \end{equation} For helium, nitrogen, silicon, and iron, there is a single spectral index $\gamma_{A}$ and four separate reference ejection rates $q_{0{A}_i}$. The suppression function used for nucleons and nuclei is the same as in the reference case of \cite{PierreAuger:2016use}. \begin{equation} \label{eqn:fsupp} f_{\mathrm{supp}}(E,Z) = \begin{cases} 1 & \mathrm{if~}E\leq E^{Z}_{\mathrm{max}},\\ \exp{\left(1-E/E^{Z}_{\mathrm{max}}\right)} & \mathrm{otherwise}. \end{cases} \end{equation} The maximum acceleration energy is expected to be proportional to the electric charge of each element, $E^{Z}_{\mathrm{max}} = ZE_{\mathrm{max}}$, with the five species having a single free parameter $E_{\mathrm{max}}$. The ejection rate for protons in this approach accounts for both the accelerated ones up to $E_{\mathrm{max}}$ and those produced by escaping neutrons, resulting in an energy of the order of $E/A$ inherited from the nuclei of energy $E$. The maximal energy reached by this population of secondary protons is then $E^{Z}_{\mathrm{max}}/A\simeq E_{\mathrm{max}}/2$, which is not represented in the rigidity-acceleration scheme modeled by Equation~\eqref{eqn:fsupp}. Replacing $E_{\mathrm{max}}$ with $E_{\mathrm{max}}/2$ in $q_{\mathrm{p}}(E)$ would test the extreme situation in which all ejected protons are photodissociation by-products. Modeling of sources and their environments is required for further characterization of the balance between the population of accelerated protons from the initial abundance in the source environment and that of secondaries from nuclear cascades. For each species $j$, the differential energy production rate per comoving volume unit of the sources, which is directly connected to their differential luminosity, is consequently $\ell_j(E,z)= E^2q_j(E)S(z)$, where $S(z)$ reflects the redshift evolution of the UHECR luminosity density. For convenience, the quantity $\ell_j(E,z)$ is referred to as the differential energy production rate. The bolometric energy production rate per comoving volume unit at redshift $z$, on the other hand, is calculated as $\mathcal{L}_j(E, z)=S(z)\int_{E}^{\infty}\mathrm{d} E'E'q_j(E')$. We report its average value in a volume spanning $z_\text{min}-z_\text{max}$ as $\bar{\mathcal{L}}_j(E) = \int_{z_\text{min}}^{z_\text{max}} \mathrm{d} z \left|\frac{\mathrm{d} t}{\mathrm{d} z}\right| \mathcal{L}_j(E, z) / \int_{z_\text{min}}^{z_\text{max}} \mathrm{d} z \left|\frac{\mathrm{d} t}{\mathrm{d} z}\right|$, where $t(z)$ is the lookback time. The density of baryonic matter is used to trace the evolution of the UHECR luminosity density throughout cosmic time. This is supposed to follow star mass density, which is well approximated by a constant out to redshift $z=1$ \citep[e.g.][]{2014ARA&A..52..415M}. As in the benchmark case of \cite{PierreAuger:2016use}, such a constant evolution is expected to hold to a first approximation of $z_\text{max} = 2.5$. The local Universe, on the other hand, has an overdensity because the Milky Way, like most galaxies, is part of a group of galaxies which is embedded in the Local Sheet \citep{2014MNRAS.440..405M}. We use the overdensity correction factor calculated by ~\cite{2019ApJ...872..148C}, which is defined as a function of distance $r$ and is effective up to 30\:Mpc, \begin{equation} \label{eqn:rho} \frac{\delta\rho(r)}{\bar \rho} = 1+\left(\frac{r}{r_0}\right)^{-\alpha}, \end{equation} with $r_0=5.4\:$Mpc and $\alpha=1.66$. The evolution of the UHECR luminosity density is then represented by the equation $S(z) = \delta\rho/\bar \rho$, with $z_\text{max} = 2.5$ and $z_\text{min} = 2\times 10^{-4}$. The minimal redshift, which corresponds to the Local Group limit ($r\simeq 1\:$Mpc), precludes any divergence in Equation~\eqref{eqn:rho} and effectively removes very-closeby galaxies that would otherwise dominate the UHECR sky, which contradicts observations \cite{PierreAuger:2022rfz}. In this scenario, we are neglecting the effect of extra-galactic magnetic field on particle propagation, therefore this can thus be termed one-dimensional. The current all-particle energy spectrum $J(E)$ derives from the integration of all sources' contributions across lookback time, with redshift playing a role: \begin{equation} \label{eqn:model} J(E) = \frac{c}{4\pi}\sum_{A,A'} \iint \mathrm{d} z\,\mathrm{d} E' \left|\frac{\mathrm{d} t}{\mathrm{d} z}\right|S(z) q_{A'}(E')\frac{\mathrm{d}\eta_{AA'}(E,E',z)}{\mathrm{d} E}. \end{equation} The relationship between cosmic time and redshift is derived from the cosmological concordance model, $(\mathrm{d} t/\mathrm{d} z)^{-1}= -H_0(1+z)\sqrt{\Omega_{\mathrm{m}}(1+z)^3+\Omega_{\Lambda}}$, where $H_0=70\:$km\:s$^{-1}$\:Mpc$^{-1}$ is the Hubble constant at present time, $\Omega_{\mathrm{m}}\simeq0.3$ is the density of matter (baryonic and dark matter) and $\Omega_{\Lambda}\simeq0.7$ is the dark-energy density; $\eta_{AA'}(E,E',z)$ is the amount of particles detected on Earth with energy $E$ and mass number $A$ released by sources with energies $E'>E$ and mass numbers $A'>A$ and describes the energy losses and spallation processes. In practice, for a given redshift $z_0$ source emitting a nuclear species $A_0$ at energy $E_0$, the corresponding $\eta_{AA'}(E,E',z)$ function is tabulated in bins of $A'$ and $E'$ by propagating a large number of emitted particles (O($10^7$) particles) by using the SimProp package~\citep{Aloisio:2012wj}. By repeating the simulations for different $z_0$, $A_0$, and $E_0$ values, the entire $\eta_{AA'}(E,E',z)$  function is tabulated as a 5D histogram, returning the fractions sought. SimProp accounts for pair production, photo-pion production, and photodissociation off the photon fields of interest, which are those from cosmic-microwave-background (CMB) radiation and infrared photons from extragalactic background light (EBL), which is the radiation produced in the Universe since the formation of the first stars. The CMB radiation can be described as a black-body spectrum with a redshift-dependent temperature $T(z)=T_0(1+z)$, with $T_0=2.725\:$K. The EBL is less well known, particularly in the far infrared and at high redshifts. For the benchmark scenario explored below, we utilise the model of ~\cite{Gilmore:2011ks}, which is consistent with the minimal intensity level derived from galaxy counts as well as indirect measurements derived from gamma-ray absorption at multi-TeV energies \citep[e.g.][for a recent review]{2021arXiv211205952P}. Equation~\eqref{eqn:model} can be used, with these ingredients, to evaluate the all-particle flux from the various contributions of each individual nuclear component on the condition of assigning values to the five ejection rates $q_{0A_i}$, the two indices $\gamma_{\rm p}$ and $\gamma_A$, and the maximum energy $E_{\rm max}$. These eight parameters are fitted to the data applying the method described in the following section. \section{Combined fit to energy-spectrum and mass-composition data} \label{sec:data} The expected spectrum represented by Equation~\eqref{eqn:model}  is dependent on various unknown features that characterize acceleration processes, source surroundings, and source energetics. Constraints from the measured energy spectrum and mass composition can contribute in inferring these properties. We will use, on the one hand, the all-particle energy spectrum inferred from these data ~\citep{PierreAuger:2021hun}, and on the other, the distributions of the slant depth of maximum of shower development (hereinafter called $X_{\mathrm{max}}$), which is the best up-to-date proxy of the primary mass of the particles ~\citep{PierreAuger:2014gko,Bellido:2017cgf} . Using the hadronic-interaction generators to represent the development of the showers, the $X_{\mathrm{max}}$ distributions allow for statistical inference of the energy-dependent mass composition. Here, two hadronic-interaction generators are considered: EPOS-LHC ~\citep{Pierog:2013ria} for the benchmark scenario and Sibyll2.3c~\citep{riehn2017hadronic} as an alternative, both of which are the most recent and best describe the data. As a result, by combining the all-particle energy spectrum and the abundances of the various mass components $J_j(E)$, the different elemental spectra as a function of energy can be calculated. The energy threshold here taken into account is the nominal one of the $X_{\mathrm{max}}$ detection mode at ultra-high energies, namely ${\simeq}\: 0.63\:$EeV ($10^{17.8}\:$eV). This threshold, incidentally, allows us to investigate the energy spectrum of the ankle feature. A Gaussian likelihood fit is used to establish the best match between the observed spectrum and that expected from Equation~\eqref{eqn:model} from a set of proposed parameters $\mathbf{\Theta}$. Assuming that the transition to extragalactic UHECRs has already occurred above 5\:EeV,\footnote{ We evaluated that a moderate increase in the value at which the transition to extragalactic UHECRs is considered to be complete would not have any effect on the final results.} the equivalent probability term, $L_J$, is calculated above that threshold. The model is fitted to the $X_\mathrm{max}$ data using the multinomial distribution, which represents how likely it is to observe $k_{mx}$ events out of $n_m$ with probability $p_{mx}$ in each $X_{\mathrm{max}}$ bin in each energy bin $m$. The probabilities $p_{mx}$ are calculated by modeling the $X_{\mathrm{max}}$ distributions in terms of the parameters $\mathbf{\Theta}$ using generators of hadronic interactions. The corresponding likelihood, $L_{X_{\mathrm{max}}}$, is considered as the product of energy bins greater than 5\:EeV. The last contribution to the likelihood comes from the sub-ankle proton component, $L_{J_{\mathrm{p}}}$, which is calculated by weighting the all-particle spectrum below 5\:EeV with the proton abundance $f_{\mathrm{p}}(E)$ from the $X_{\mathrm{max}}$ distributions. The statistical uncertainties in $\hat{J}_{\mathrm{p}}(E)$ are dominated by those in $f_{\mathrm{p}}(E)$, and they are accounted for using a Gaussian likelihood fit. As a result, the model likelihood is provided by $L=L_JL_{X_{\mathrm{max}}}L_{J_{\mathrm{p}}}$. The goodness-of-fit is measured using a deviance, $D$, which is defined as the negative log-likelihood ratio between a given model and the saturated model that represents the data: \begin{equation} \label{eqn:deviance} D=-2\log{\frac{L_J}{L_J^{\mathrm{sat}}}}-2\log{\frac{L_{X_{\mathrm{max}}}}{L_{X_{\mathrm{max}}}^{\mathrm{sat}}}}-2\log{\frac{L_{J_{\mathrm{p}}}}{L_{J_{\mathrm{p}}}^{\mathrm{sat}}}}. \end{equation} The three different contributions are referred to as $D_J$, $D_{X_{\mathrm{max}}}$ and $D_{J_{\mathrm{p}}}$ respectively. \section{Results} \label{sec:results} Fitting the model to the data using the benchmark scenario provided in Section~\ref{sec:model}, with free spectral indices for both nucleons and nuclei ($\gamma_{\rm p}\neq\gamma_{A}$), provides the parameters and deviance shown in Table 1 of \cite{Luce_2022} using EPOS-LHC to interpret $X_{\mathrm{max}}$ data. Table 1 of \cite{Luce_2022} includes the results predicted under the assumptions of a proton component dominated by neutron escape (proton maximum energy of $E_{\rm max}/2$), no local overdensity (widely used uniform distribution), and a shared spectral index across the five species ($\gamma_{\rm p}=\gamma_{A}$). The value of $E_{\mathrm{max}}$, derived by the drop in the nuclear components at $E^Z_{\mathrm{max}}$, indicates that the suppression of the spectrum is due to a combination of the cut-off energy at the sources for the heavier nuclei and energy losses \emph{en route}, as found in \cite{PierreAuger:2017pzq}. The nuclei's spectral index, $\gamma_A$, is defined by the increase in average mass with energy, which is virtually monoelemental, in order to mimic the $X_\mathrm{max}$ distributions as as accurately as possible. The fit's solution thus consists on setting a hard index for nuclei so that the contributions of each element mix as little as possible: high-energy suppression imposed by the cut-off beyond $E^{Z}_{\mathrm{max}}$  and low-energy suppression via the hard index $\gamma_{A}$. This effect, however, does not apply to protons, which persist in an energy range where a mixing of elements is required. The best-fit value of $\gamma_{\mathrm{p}}$ is significantly softer than that of $\gamma$. The addition of $\gamma_{\mathrm{A}}$ improves the fit of the data down to 0.63\:EeV, with a total deviance $D=236.8$ compared to $862.7$ in the case of $\gamma_{\mathrm{p}}=\gamma_{\mathrm{A}}$, therefore the addition of this extra free parameter is sufficiently justified. On the other hand, using local overdensity to trace the source distribution improves the deviation significantly while it has a minor impact on the best-fit parameters. The balance determining the intensity of each component is reported in terms of energy production rates $\bar{\mathcal{L}}$ greater than 0.63\:EeV. The result is displayed in Figure~\ref{fig:FitFlux}, which shows the contributions of each nuclear component to the observed energy flux and energy density. The energy production rates necessary at the sources to power the observed energy flux are shown as a function of energy in Figure~\ref{fig:EProdRate} for the various primary mass groups. The solution is illustrated in Figure~\ref{fig:FitFlux}, \begin{figure}[t] \centering \includegraphics[scale=.5]{Detected_free_GammaP_EPOS-LHC.pdf} \caption{Energy flux at Earth as a function of energy, as modeled by the best-fit parameters for the benchmark scenario. The all-particle spectrum and proton component are shown as black circles and red squares, respectively ~\citep{PierreAuger:2021hun}. Lighter points are not included in the fit. The best-fit components obtained for five detected mass groups are displayed with solid colored lines, as labeled in the Figure. The energy flux of the heaviest mass group, with detected mass number in 39--56, is below the range of interest.} \label{fig:FitFlux} \end{figure} While the contribution of nuclei is highest at ${\simeq}\: 5 \times 10^{44}\: {\rm erg}\: {\rm Mpc}^{-3}\: {\rm yr}^{-1}\: {\rm dex}^{-1}$, that of protons is increasing up to ${\simeq}\: 10^{45}\: {\rm erg}\: {\rm Mpc}^{-3}\: {\rm yr}^{-1}\: {\rm dex}^{-1}$ when going down in energy. Extrapolations of the results below 0.63\:EeV, on the other hand, are unsafe since the functional form employed in Equation~\eqref{eqn:qN}  may no longer hold depending on the features of the source environments that determine the nuclear cascade. The total energy production rate, integrating above 0.63\:EeV, is found to be $(10.8 \pm 0.4 )\times 10^{44}\: {\rm erg}\: {\rm Mpc}^{-3}\: {\rm yr}^{-1}$. The reduced deviance is divided into three terms, according to Equation~\eqref{eqn:deviance}. The fit of the spectra leads to an acceptable fit ($D_J+D_{J_{\mathrm{p}}}=37.3$ for $N_J+N_{J_{\mathrm{p}}}=24$ points). As in~\cite{PierreAuger:2017pzq}, the $X_{\mathrm{max}}$ sector has a worse deviance (value $D_{X_{\mathrm{max}}}=199.5$ for $N_{X_{\mathrm{max}}}=109$ points). In general, the benchmark scenario has a fit quality quite similar to those obtained by considering only data beyond 5\:EeV. Considering the variation of Equation~\eqref{eqn:qN} that consists in substituting $E_{\mathrm{max}}$ for $E_{\mathrm{max}}/2$, it was found that the main changes concern the spectral index of protons, which becomes $\gamma_{\mathrm{p}}\simeq 2.5$, while the deviance does not change between the two scenarios. \begin{figure}[t] \centering \includegraphics[scale=.5]{Emissivities.pdf} \caption{Mass-dependent energy production rate at the sources as a function of energy, as constrained by the best-fit parameters for the benchmark scenario. The dashed lines illustrate a variation of the hadronic interaction model, with EPOS-LHC and Sibyll2.3c shown as solid and dashed lines, respectively.} \label{fig:EProdRate} \end{figure} \section{Discussion} \label{sec:discussion} The results help to explain the origin of protons below the ankle energy and the hard spectra of nuclei above this energy. The component of protons in this scenario is extragalactic in origin and exponentially suppressed above the ankle energy, while heavier nuclei slowly take over to the highest energies via a rigidity-dependent maximum-energy scenario. A softer spectral index for this population of light primaries reflects the fact that protons are not suppressed when they lose energy at the same rate as heavier nuclei. Remarkably, such behavior qualitatively corresponds to scenarios of in-source interactions in which abundant fluxes of neutrons originated by accelerated charged particles interacting with the bath of photons permeating the sources escape unimpeded from the electromagnetic fields. Our conclusions provide a solid base for constraining the spectral indices $\gamma_{\rm p}$ and $\gamma_A$, as well as the energetics of the sources and the abundances of elements in their surroundings. There are two reasons for the constraints' robustness. First, by taking into account only the proton spectrum between 0.63~EeV and 5~EeV, we can rebuild the extragalactic component as directly and accurately as possible, with no "interference" from the expected  composition of the supposed end of the galactic component. Second, by adding a local overdensity to the widely used uniform distribution of sources in a comoving volume, we can match the prediction with the data on a statistical basis characterized by $D/{\rm ndf}\simeq 237/125$ i.e. a reduced deviance on the order of that found in \cite{PierreAuger:2016use} for data strictly above the ankle. The study presented here significantly enhances the description of the data, particularly in the mass-composition sector. Future observations will thus provide evidence to either confirm the role of in-source interactions in the interpretation of UHECR data, by detecting such a sub-dominant component below the ankle and its nature, either galactic or extra-galactic, with the upgraded instrumentation of the Pierre Auger Observatory in the next years~\citep{Castellina:2019irv}.
\section{Introduction}\label{Introduction} Entanglement is one of the most peculiar property of quantum physics. It is due to quantum correlations between different parts of a system, meaning that it is an intrinsically non-local quantity without a classical analogue. It is a fundamental tool in theoretical physics, with applications in high-energy physics \cite{high1,high2,high3,high4}, in the context of black holes \cite{black1,black2,Solodukhin_2011}, and in low-energy physics, where it can be useful to study extended quantum systems \cite{intro1,intro2,eisert-2010,intro3,Vidal_2003}. Given the relevance of the subject, several different ways to quantify the entanglement have been studied over the years. Here, we consider two of them: the first one is the von Neumann entropy, which characterises the entanglement of a bipartite system in a pure quantum state $\ket{\psi}$ \cite{intro3}. Starting from a bipartition of a system $A\cup B$, and the corresponding reduced density matrix (RDM) $\rho_A=\mathrm{Tr}_B(\ket{\psi}\bra{\psi})$, the entanglement entropy is defined as \begin{equation} \label{eq:entr0} S_1=-\Tra{\rho_A\ln \rho_A}. \end{equation} A related family of functions, known as R\'enyi entropies, is given by \begin{equation} \label{eq:entr} S_n=\f{1}{1-n} \ln\mathrm{Tr} \rho_A^{n}, \quad S_1 =\lim_{n \to 1} S_n=-\mathop{\mbox{\normalfont Tr}}\nolimits[\rho_A\log \rho_A]. \end{equation} The latter are particularly convenient because in the path-integral formalism, for integer $n$, $\Tra{\rho_A^{n}}$ corresponds to a partition function on an $n$-sheeted Riemann surface $\mathcal{R}_n$, obtained by joining cyclically the $n$ sheets along the region $A$ \cite{Calabrese:2004eu}. In quantum field theory, this object can be computed as a correlation function involving a particular type of twist fields, which are related to branch points in the Riemann surface $\mathcal{R}_n$ \cite{Cardy:2007mb,Calabrese_2009}. Then, the limit $n \to 1$ allows to compute the von Neumann entropy. Despite the success of R\'enyi entropies in describing bipartite pure systems, entanglement entropies are no longer good measures of entanglement in mixed states since they mix quantum and classical correlations (e.g. in a high temperature state, $S_1$ gives the extensive result for the thermal entropy that has nothing to do with entanglement). If we consider the mixed state described by the reduced density matrix $\rho_A$, where $A=A_1 \cup A_2$, and we want to quantify the entanglement between $A_1$ and $A_2$, we can use the entanglement negativity \cite{vw-02,Plenio_2005}, defined as \begin{equation}\label{eq:bos1} \mathcal{N}^{(b)}\equiv\f{\mathrm{Tr}|\rho_A^{T_1}|-1}{2}, \end{equation} where $\mathrm{Tr}|O|:= \mathrm{Tr} \sqrt{O^{\dagger}O}$ denotes the trace norm and $\rho_A^{T_1}$ is the partially-transposed RDM of $A$, which is defined as follows. Let us write the RDM as \begin{equation} \rho_A=\sum_{ijkl}\mel{e^1_i,e^2_j}{\rho_A}{e^1_k, e^2_l}\ketbra{e_i^1,e_j^2}{e^1_k,e^2_l}, \end{equation} where $\ket{e_j^1}$ and $\ket{e_k^2}$ are orthonormal bases for the Hilbert spaces $\mathcal{H}_1$ and $\mathcal{H}_2$ describing the system in $A_1,A_2$, respectively. The partial transpose $\rho_A^{T_1}$ is defined by exchanging the matrix elements in the subsystem $A_1$, i.e. \begin{equation}\label{eq:bosonic} (\ket{e_i^1,e_j^2}\bra{e^1_k,e^2_l})^{T_1} \equiv \ket{e_k^1,e_j^2}\bra{e^1_i,e^2_l}. \end{equation} In terms of the eigenvalues of $\rho_A^{T_1}$, $\lambda_i$, and recalling the normalisation $\sum_i \lambda_i=1$, $\mathrm{Tr}|\rho_A^{T_1}|$ can be written as \begin{equation} \mathrm{Tr}|\rho_A^{T_1}|=\sum_i |\lambda_i|=\sum_{\lambda_i >0}|\lambda_i|+\sum_{\lambda_i <0}|\lambda_i|=1+2\sum_{\lambda_i<0}|\lambda_i|. \end{equation} This expression shows that the negativity measures ``how much'' the eigenvalues of $\rho_A^{T_1}$ are negative, from which the name negativity comes. Finally, it is worth mentioning that the superscrit $b$ in Eq. \eqref{eq:bos1} refers to the fact that this expression is sometimes referred to as bosonic negativity: indeed, it turned out that its definition is not well-suited to investigate entanglement properties in the context of (free-)fermionic systems. To circumvent this issue, a slightly different definition for the partial transpose, based on the partial time-reversal (TR) transformation of the RDM, can be adopted, as we are going to review in Section \ref{sec:defs}. Recently, it has also gained importance the study of the interplay between entanglement and the internal symmetries of a system. This new aspect has become accessible experimentally \cite{Lukin,neven2021symmetryresolved,vitale2021symmetryresolved,operator_entanglement}, together with the development of the theoretical framework necessary to treat the problem \cite{Goldstein_2018,PhysRevB.98.041106}. In this regard, in \cite{Goldstein_2018} a simple generalisation of the replica trick has been proposed to relate symmetry resolved quantities to the moments of $\rho_A$ on a modified Riemann surface: we refer to them as {\it charged moments}. This idea paved the way to the study of the {\it symmetry resolved entanglement} in various contexts, such as Conformal Field Theories (CFTs) \cite{Goldstein_2018,PhysRevB.98.041106,Belin:2013uta,Murciano_2020,Capizzi_2020,calabrese2021symmetryresolved,Milekhin2021,Hung:2019bnq,ghasemi}, interacting integrable quantum field theories \cite{Horv_th_2020,horvath2021u1,Capizzi:2021kys,Horvath:2021rjd,cdfmssca-22,cdfmssca-22-2}, holographic settings \cite{Zhao_2021,Weisenberger:2021eby,Zhao:2022wnp,Baiguera:2022sao}, disordered systems \cite{Turkeshi_2020,Kiefer2_Emmanouilidis_2020,Kiefer-Emmanouilidis20Scipost,Kiefer-Emmanouilidis21}, non-trivial topological phases \cite{Cornfeld_2019,Monkman_2020,Azses_2020,ahn-20,ads-21}, spin chains \cite{Bonsignori_2019,Bonsignori:2020laa,Fraenkel_2020, Murcianobis_2020,Murciano:2020lqq,Calabresebis_2020,Laflorencie_2014,Barghathi_2018,Barghathi_2019,Barghathi_2020,PhysRevB.103.L041104,parez2021exact,Wiseman_2003,Estienne_2021,Tan_2020,fraenkel2021entanglement,ore-21,Ares:2022hdh,Scopa_2022,jones-22,pvcc-22,Lau2022,page,asymmetry}, and also its extension to several entanglement measures \cite{Cornfeld_2018,Feldman:2019upn,Chen_2021,chen2022negativityboson,parez22,multicharged,Wellnitz:2022cuf,operator_entanglement,fidelity}. Here, we continue to work in this direction by studying a system of one-dimensional massive Dirac fermions and extracting their symmetry resolved entropy at finite temperature and size. In the context of non-complementary subsystems and mixed-states, we also investigate the {\it charge imbalance resolved negativity} at finite temperature and size, generalising the results of \cite{Murciano_2021} by taking into account the mass correction. The paper is organised as follows. In Section \ref{sec:defs} we provide all the definitions concerning the measures of symmetry resolved entanglement. We also introduce the concept of negativity for fermionic systems and we discuss the charge imbalance resolved negativity. This setup allows us to calculate the symmetry resolved entanglement entropy of massless Dirac fermions for a subsystem with multiple intervals at finite size and temperature in Section \ref{sec:masslessE}. By adding a massive perturbative term to the Dirac action, we generalise the previous study in Section \ref{Section:massive_calculations}. The approach we adopt is suitable also to study the charge imbalance negativity, extending the results found in \cite{Murciano_2021} to the massive case in Section \ref{sec:fneg}. Throughout the manuscript, we check the agreement of the analytic expressions with the numerical lattice computations, both for the charged moments and their Fourier transforms. We draw our conclusions in Section \ref{sec:conclusion}. Five appendices provide the details of our computations, especially for the analytic continuations of the R\'enyi entropy. \section{Entanglement resolution in pure and mixed states}\label{sec:defs} In this section, we provide the general definitions of the main quantities of interest, namely the symmetry resolved entanglement entropies and the charge imbalance negativity: they quantify the entanglement in each charge sector when the system is invariant under a global $U(1)$ symmetry. A charge sector is defined as a $U(1)$ invariant subspace of the Hilbert space \cite{Goldstein_2018}. \subsection{Symmetry resolved entanglement}\label{sec:review_bosonization} Le us briefly review the study of critical systems with an additional internal global $U(1)$ symmetry. The generator of the symmetry, which we call $Q$, commutes with the Hamiltonian and thus the density matrix, that for a system at nonzero temperature $1/\beta$ reads $\rho=e^{-\beta H}/Z$, with $Z=\mathrm{Tr} e^{-\beta H}$. If the generator $Q$ can be written as the sum of the local charges in the two subsystems $A \cup B$, $Q=Q_A+Q_B$, the charge restricted to $A$ commutes with the reduced density matrix \begin{equation} [Q_A,\rho_A]=0, \end{equation} and the RDM takes a block form in the basis of the eigenstates of $Q_A$, with eigenvalues $q$: \begin{equation} \rho_A=\begin{pmatrix} p(q_1)\rho_A(q_1)&0&0&\ldots\\ 0&p(q_2)\rho_A(q_2)&0&\ldots\\ 0&0&p(q_3)\rho_A(q_3)&\ldots\\ \vdots&\vdots&\vdots&\ldots\\ \end{pmatrix}. \end{equation} The factors $p(q)$ have been introduced in order to normalise each block, so that \begin{align} \mathop{\mbox{\normalfont Tr}}\nolimits(\rho_A(q))=1, \qquad \sum_q p(q)=1. \end{align} They describe the probability of finding $q$ as an outcome of the measurement of $Q_A$. The density matrix of each block can be found projecting $\rho_A$ in the corresponding eigenspace and normalising the result \begin{equation} \rho_A (q)=\f{\Pi_q \rho_A \Pi_q}{\mathop{\mbox{\normalfont Tr}}\nolimits(\Pi_q \rho_A)}, \end{equation} where $\Pi_q$ is the projector in the $q$-charge sector. Since each $\rho_A(q)$ is a density matrix (meaning it is positive semidefinite and normalised), the corresponding entanglement entropy, which we call symmetry resolved entanglement entropy, is given by \begin{equation}S_A(q)=-\mathop{\mbox{\normalfont Tr}}\nolimits(\rho_A(q)\log(\rho_A(q))),\end{equation} and is related to the total entanglement entropy as \begin{align}\label{eq:sum} S_A=\sum_q [p(q) S_A(q)-p(q)\log(p(q))]. \end{align} From this expression, we can decompose the total entanglement as a sum of two quantities. The first one is the weighted sum of the entanglement in each symmetry sector, which has been called \emph{configurational entanglement entropy} $S^c$ \cite{Lukin}; the second one, instead, arises from the fact that the system can be found in each symmetry sector with a certain probability $p(q)$. This uncertainty, which can be viewed as ``missing" information, is called \emph{number entanglement}, $S^{num}$.\\ One can also define the symmetry resolved R\'enyi entropy as \[S_n(q)=\f{1}{1-n}\Tra{\rho_A(q)^n}.\numberthis\] To compute these quantities using CFT, we will follow the approach described in \cite{Goldstein_2018}. Exploitng the property that the eigenvalues of $Q_A$ only take integer discrete values (for the $U(1)$ symmetry), we can conveniently express the projector with a Fourier transform \begin{align} \Pi_q=\int_{-\pi}^\pi e^{iQ_A\alpha} e^{-i q \alpha}\f{\d \alpha}{2\pi}. \end{align} By introducing the charged moments $Z_n(\alpha)=\mathrm{Tr}(\rho_A^n e^{i\alpha Q_A})$, the projected density matrix in a charge sector is a Fourier transform \begin{align}\label{eq:ft} \Op{Z}_n(q)\equiv \mathrm{Tr}(\Pi_q \rho_A^n)=\int_{-\pi}^\pi e^{- i \alpha q}Z_n(\alpha)\f{\d \alpha}{2\pi}, \quad \Op{Z}_1(q)=p(q), \end{align} and the symmetry resolved R\'enyi entropies read \begin{align} S_n(q)=\f{1}{1-n}\log \f{\Op{Z}_n(q)}{\Op{Z}^n(q)}, \quad S_1(q)=\lim_{n\to 1}S_n(q).\label{renyi entropy symmetry-resolved(Sela-G)} \end{align} Luckily, the charged moments can be computed via the replica trick; the factor $e^{i\alpha Q_A}$ is translated in a phase difference condition in the path integral formulation \cite{Goldstein_2018}. This means that, when sewing all the Riemann sheets together, we get a phase $e^{ i \alpha}$ whenever we complete a cycle through the $n$ copies. \subsection{Fermionic negativity and charge imbalance}\label{sec:details_neg} As mentioned in the introduction, the limit of applicability for entanglement entropy lies in the requirement that the system is in a pure state, thus excluding the case of a finite temperature system or a multipartite geometry. In this subsection, we review the definition of fermionic negativity presented in \cite{Shapourian2_2017}, which covers such cases. Consider a one-dimensional subsystem $A$, described by a RDM $\rho_A$, partitioned in two parts $A_1$ and $A_2$. The fermionic negativity can be defined by looking at the action of a \textit{partial time-reversal} transformation on the density matrix. This operation, in bosonic systems, is equivalent to a partial transposition, while it differs for a phase in the case of fermions. This property can be conveniently shown by looking at the time-reversal operation on fermionic coherent states \cite{Shapourian_2017}, which is:\begin{align} \left(\ketbra{\bar{\xi}}{\xi}\right)^R=\ketbra{i\xi}{i\bar{\xi}}, \end{align} where $\xi,\bar{\xi}$ are Grassman variables and $\ket{\xi}=\mathrm{e}^{-\xi c^{\dagger}}\ket{0}$,$\bra{\bar{\xi}}=\bra{0}\mathrm{e}^{- c\bar{\xi}}$ are the related fermionic coherent states while $c, c^{\dagger}$ are the fermionic operators satisfying $\{c^{\dagger}_i,c_j\}=\delta_{ij}$. The factor $i$ is necessary for the anticommuting nature of the Grassman variables, and it is required to leave the trace invariant under this operation. The superscript $R$ is used to distinguish the fermionic from the standard partial transpose operation defined in Eq. \eqref{eq:bosonic}. This transformation rule can be rewritten in the occupation number basis as \begin{multline} \left( \ketbra{\{n_i\}_{i\in A_1},\{n_j\}_{j\in A_2}}{\{\bar{n_i}\}_{{i}\in A_1},\{\bar{n}_j\}_{j\in A_2}}\right)^{R_1}=\\ = \left(-1\right)^{\phi\left(\{n_i\},\{\bar{n}_i\}\right)}\left( \ketbra{\{\bar{n_i}\}_{{i}\in A_1},\{\bar{n}_j\}_{j\in A_2}}{\{n_i\}_{i\in A_1},\{n_j\}_{j\in A_2}}\right)\label{eq13} \end{multline} where \begin{align} \phi\left(\{n_i\},\{\bar{n_i}\}\right)=\f{\tau_1+\bar{\tau_1}\mod 2}{2}+\left(\tau_1+\bar{\tau_1}\right)\left(\tau_2+\bar{\tau_2}\right)\quad \tau_x=\sum_{i\in A_x} n_i\quad\bar{\tau}_x=\sum_{i\in A_x} \bar{n}_i. \end{align} It shows that the partial time-reversal acts as the composition of the partial transpose plus a unitary operator, i.e. a phase \cite{Shapourian_2017}: \begin{multline} \left( \ketbra{\{n_i\}_{i\in A_1},\{n_j\}_{j\in A_2}}{\{\bar{n_i}\}_{{i}\in A_1},\{\bar{n}_j\}_{j\in A_2}}\right)^{R_1}=\\=U_A\left( \ketbra{\{n_i\}_{i\in A_1},\{n_j\}_{j\in A_2}}{\{\bar{n_i}\}_{{i}\in A_1},\{\bar{n}_j\}_{j\in A_2}}\right)^{T_1}U_A^\dagger.\label{eq15} \end{multline} In this basis, the phase contribution is $0$ along the diagonal, since $\phi\left(\{n_i\},\{{{n}_i}\}\right)=0$.\\ Under the partial time-reversal $R_1$, the density matrix is no longer hermitian, in general. To restore this property, we can consider the matrix $\abs{\rho^{R_1}}=\sqrt{{\rho^{R_1}}^\dagger\rho^{R_1}}$ which has only real eigenvalues, and the fermionic negativity is defined by \begin{align} \Op{N}=\f{\mathop{\mbox{\normalfont Tr}}\nolimits \abs{\rho^{R_1}}-1}{2}. \end{align} Analogously to R\'enyi entropy, we can define the \emph{fermionic Rényi negativity} as \begin{align} R_n=\begin{cases} \log \mathop{\mbox{\normalfont Tr}}\nolimits\left(\rho^{R_1}{\rho^{R_1}}^\dagger\right)^\f{n_e}{2} \qquad &n=n_e \quad\text{even},\\ \log \mathop{\mbox{\normalfont Tr}}\nolimits \left[ \left(\rho^{R_1}{\rho^{R_1}}^\dagger\right)^\f{n_o-1}{2}\rho^{R_1}\right] \qquad &n=n_o \quad\text{odd}.\\ \end{cases}\label{Renyi_negativity} \end{align} From Eq. \eqref{Renyi_negativity}, we can recover the fermionic negativity by the analytical continuation of the \emph{even} Rényi negativities, evaluated in $n_e=1$ as \begin{align} \mathcal{\Op{N}}=\frac{1}{2}\lim_{n_e\rightarrow 1}\left(R_{n_e}-1\right). \end{align} To further investigate the internal symmetry structure of this quantity in the presence of a conserved charge, we can follow Refs. \cite{Cornfeld_2018, Bonsignori_2019}: let us call $Q_A$ the conserved charged restricted to $A$, which in turn can be expressed as the sum $Q_1$ and $Q_2$ of charges localised in the two partitions of the system $A_1$ and $A_2$, respectively. The density matrix commutes with the total charge and we act on the commutation relation with a partial time-reversal operation, as in Eq. \eqref{eq15}: \begin{align} & 0=[\rho_A,Q_A ]=[\rho_A,Q_1 ]+[\rho_A,Q_2 ] \implies\nonumber\\ & 0=[\rho_A,Q_2 ]+U_A\left([\rho_A,Q_1 ]\right)^T U_A^\dagger =[\rho_A,Q_2 ]-[U_A^\dagger\rho_A^{T}U_A,U_A^\dagger Q_1^TU_A ]=[\rho_A^{R_1},Q_2-Q_1^{R}] \end{align} In the occupation number basis, which diagonalises the charge operator, we can see explicitly $Q_1^R=Q_1$, since $Q$ is diagonal in this basis, so the conserved charge of the partial time-reversed operator, $Q_{imb}=Q_2-Q_1$, has the form of a \emph{charge imbalance} between $A_1$ and $A_2$.\\ Exploiting the presence of a conserved charge, we can decompose the total negativity of the system as done for the entropy: \begin{align} \Op{N}=\sum_q p(q) \Op{N}(q), \end{align} where the normalising factor $p(q)$ now is defined as \begin{align} p(q)=\mathop{\mbox{\normalfont Tr}}\nolimits(\Pi_q \rho_A^{R_1}), \end{align} and $\Pi_q$ is the projector in the symmetry $q$ imbalance sector. Let us remark that if our initial density matrix $\rho_A$ is in a pure state, there exist some degenerate values of $q$ for which $p(q)=0$; this is due to the fact that the value of $Q_A=Q_1+Q_2$ is fixed in this case, thus allowing only certain values of the imbalance $Q_{imb}=Q_2-Q_1$ to be different from zero. This is not the case for mixed states.\\ Finally, we can define the charged moments of the partial time-reversed density matrix \begin{align} N_n(\alpha)= \begin{cases} \mathrm{Tr}\left( \left(\rho_A^{R_1}(\rho_A^{R_1})^{\dagger}\right)^n e^{i\alpha Q_{imb}}\right), \qquad \,\,\, n=2m \\ \mathrm{Tr}\left(\left(\rho_A(\rho_A)^{\dagger}\right)^{n-1} \rho_A e^{i\alpha Q_{imb}}\right), \quad n=2m+1 \end{cases}\label{momentsnegativity} \end{align} and the charge imbalance resolved moments as their Fourier transform \begin{align} \Op{Z}_{R_1,n}(q)=\int_{-\pi}^\pi \d \alpha e^{-i \alpha q} N_{n}(\alpha). \label{eq:inverse Fourier} \end{align} From the moments, we can recover the normalised R\'enyi negativity \begin{align} \Op{N}_n(q)=\f{\Op{Z}_{R_1,n}(q)}{p(q)^n} \qquad p(q)=\Op{N}_1(q)\label{momentstransform}. \end{align} The analitycal continuation performed on the even numbers provides the charge imbalance negativity according to the limit \begin{align} \mathcal{N}(q)=\lim_{n_e \to 1}\frac{1}{2}\left(\mathcal{N}_{n_e}(q)-1\right). \end{align} \section{Warmup: Symmetry resolution - massless case}\label{sec:masslessE} As a warmup, we consider the massless Dirac field theory, described by the following Lorentz invariant Lagrangian in a $1+1$ dimensional spacetime \begin{equation} \label{eq:lagrangianDirac} \mathcal{L}= \bar{\psi}\gamma^\mu \partial_\mu \psi , \end{equation} where $\bar{\psi}=\psi^\dagger \gamma^0$. The $\gamma^\mu$ matrices can be represented in terms of the Pauli matrices as $\gamma^0=\sigma_1$ and $\gamma^1=\sigma_2$. This action has a global $U(1)$ symmetry, $\psi\mapsto e^{i \alpha}\psi$ and $\bar{\psi}\mapsto e^{-i \alpha}\bar{\psi}$ which is related to the conservation of the charge $Q=\int {\rm d}x_1 \psi^\dagger\psi $. Here, we focus first on the computation of the charged moments through a diagonalisation in the space of replicas. Using the bosonisation technique, the problem is mapped to the calculation of a correlation function of vertex operators. The analytical expressions are compared with the lattice computations, finding a good agreement. Finally, we perform a Fourier transform of the obtained quantities. We think it is instructive to report all the steps for the derivation of the known results about the massless case since they will be the building blocks for the following sections about the massive Dirac fermions, whose computations are more cumbersome. \subsection{Replica diagonalisation} Let us consider a system of free one-dimensional Dirac fermions at finite temperature and size, whose corresponding field is defined on a torus spacetime, given the periodicity in both imaginary time $\tau$ and space $x$. The partition function corresponding to $\Tra{\rho^n_A}$ has a single fermionic field defined on a Riemann surface made of $n$ different sheets, and can be mapped to an equivalent one in which one deals with a $n$-component field, which is instead defined on a single sheet: \begin{equation} \label{eq:nfieldsonC} \Psi= \begin{pmatrix} \psi_1 \\ \psi_2 \\ \vdots \\ \psi_n \end{pmatrix}, \end{equation} where $\psi_j$ is the Dirac field of the $j$-th copy of the system. These copies interact through a \emph{composite twist field operator} $\mathcal{T}_{n,\alpha}$ which imposes the appropriate boundary conditions that, in the Riemann surface picture, connects the various sheets. Given a component of the field $\psi_j$, the insertion of a twist field at a point $u$ implies that a winding around such point $(z-u)\mapsto e^{2\pi i}(z-u)$ maps it to the next component, with an additional phase $e^{i\alpha/n}$. The same applies to the composite anti-twist field $\tilde{\mathcal{T}}_{n,\alpha}$, which takes a field from the copy $j$ to $j-1$ adding a phase $e^{-i\alpha/n}$. This transformation can be encoded in the twist matrix: \begin{align} T_{\alpha}=\begin{pmatrix} 0&-e^{i\f{\alpha}{n}}&0&\ldots&0 &0\\ 0&0&-e^{i\f{\alpha}{n}}&\ldots&0 &0\\ \vdots&\vdots&\vdots&\vdots&\vdots&\vdots\\ 0&0&0&\ldots&0&-e^{i\f{\alpha}{n}} \\ e^{i\f{\alpha}{n}}&0&0&\ldots&0&0 \end{pmatrix}\qquad \mathcal{T}_{n,\alpha}: \psi_i\rightarrow \left[T_{\alpha}\right]_{ij}\psi_j\label{twistmatrix1} .\end{align} The action of this matrix is diagonalised by the appropriate change of basis in the replica space: \begin{equation}\tilde{ \psi}_k\equiv\sum_{j=1}^n e^{-i\left(\f{2\pi k\cdot j}{n}-\pi j\right)}\psi_j,\quad T_\alpha \tilde{ \psi}_k=e^{i \f{\alpha+2\pi k }{n}}\tilde{ \psi}_k, \end{equation} for $k=-\f{n-1}{2},\dots \f{n-1}{2}$, so that the twist fields can be decomposed into $n$ different twists acting independently on each replica \[\mathcal{T}_{n,\alpha}=\prod_k \mathcal{T}_{k,n,\alpha},\qquad \tilde{\mathcal{T}}_{n,\alpha}=\prod_k \tilde{\mathcal{T}}_{k,n,\alpha} .\] Since the $\tilde{\psi}_k$ fields are decoupled, the total partition function is just the product of $n$ independent partition functions, ${Z}_k$. In this formalism, the addition of a global flux $\alpha$ is straightforward by equally splitting it among all the $n$ replicas.\\ There is an ambiguity in the choice of the phase as it can generically take the form $\f{2\pi k+\alpha}{n}+2\pi m$. Different choices of the winding number $m$ correspond to different configurations of the field, and in principle we should take a linear combination of the partition functions computed with all the possible choices of $m$. However, the leading order contribution to the partition function $Z_k$ corresponds to the choice $m=0$, as explained in Appendix \ref{fluxambiguity}. We now review the procedure outlined in \cite{Casini_2005} to compute the decoupled partition functions $Z_k$. The most generic subsystem $A$ is composed of $p$ intervals \[A=\bigcup_{i} [u_i,v_i],\numberthis \] the charged moments can then be expressed as a correlator \[Z_n(\alpha)=\ave{\prod_{i=1}^p{{\mathcal{T}}}_{n,\alpha}(u_i){\tilde{\mathcal{T}}}_{n,\alpha}(v_i)}=\prod_{k=-\f{n-1}{2}}^{\f{n-1}{2}}\ave{\prod_{i=1}^p{{\mathcal{T}}}_{k,n,\alpha}(u_i){\tilde{\mathcal{T}}}_{k,n,\alpha}(v_i)}\equiv \prod_k Z_k (\alpha), \label{partitionfunctiondecoupled}\numberthis \] where we indicate as $u_i,v_i$ the points corresponding to $\vec{u}_i=(u_i,0),\vec{v_i}=(v_i,0)$ in the Euclidean coordinates of the path integral. Our fields are multivalued: they gain a different phase around the branch points $u_i$ and $v_i$, respectively. In order to obtain single-valued fields, we can let the phase be absorbed by a gauge transformation \cite{Casini_2005}. Calling $\psi^G$ the new, gauged, fields, they are related with the multivalued ones by the gauge transformation \[\tilde{ \psi}_k(\vec{x})\rightarrow \psi^G_k=\exp \left[ i\int_\vec{0}^\vec{x} \mathcal{A}_\mu(\vec{x}')\d x'^\mu \right]\tilde{ \psi}_k(\vec{x}). \numberthis \] Requiring a null phase condition around the branch points for $\psi^G_k$, Stokes theorem allows to find the appropriate gauge transformation: \begin{equation} \f{2\pi k+\alpha}{n}+\oint_{u_i} \mathcal{A}_\mu(\vec{x}')\d x'^\mu=0 \implies \epsilon^{\mu\nu} \partial_\nu\mathcal{A}_\mu(\vec{x}')=\f{2\pi k+\alpha}{n}\delta^{(2)}(\vec{x}-\vec{u}_i). \label{Gaugefield definition} \end{equation} where $\epsilon_{\mu\nu}$ is the antisymmetric tensor in $2$ dimensions. Similarly, the points $\vec{v}_i$ give an opposite phase and putting all together we get \begin{equation} \epsilon^{\mu\nu} \partial_\nu\mathcal{A}_\mu(\vec{x})=\sum_i\f{2\pi k+\alpha}{n}\left(\delta^{(2)}(\vec{x}-\vec{u}_i)-\delta^{(2)}(\vec{x}-\vec{v}_i)\right).\label{Gauge potential}\end{equation} The Dirac Euclidean lagrangian in a gauge field is \begin{equation} \Op{L}_k=\bar{\psi}^G_k\gamma^\mu(\partial_\mu-i\mathcal{A}_\mu)\psi^G_k+m{\bar{\psi}^G_k\psi^G_k}.\label{Dirac lagrangian}\end{equation} We can use the fermionic current $j^\mu=\bar{\psi}^G_k\gamma^\mu \psi^G_k$ to isolate the gauge field term in the action, rewriting the partition function as \[Z_k=\ave{e^{i \int j_\mu A^\mu\d^2 x}}_{CFT},\label{eq12}\numberthis \] where $\langle \cdot \rangle_{CFT}$ denotes that the expectation value is taken on the massless, ungauged theory, which is conformal invariant. We can apply the bosonisation technique, with the substitution \begin{align} j^\mu \rightarrow\f{1}{2\pi}\epsilon^{\mu\nu}\partial_\nu\phi_k ,\label{eq:bosonized_current} \end{align} and compute Eq. \eqref{eq12} in the dual theory of the Dirac fermion, which is that of a free scalar $\phi_k$, described by the action: \[S=\int\f{1}{8\pi}(\partial_\mu \phi_k)^2\d^2 x.\numberthis \] Because of Eq. \eqref{Gauge potential}, $Z_k(\alpha)$ is nothing but a correlation function of vertex operators: \begin{equation}\label{partitionfunctiondefinition} Z_k(\alpha)=\ave{\prod_je^{i\f{k+\alpha/2\pi}{n} \phi_k(u_j)}e^{-i\f{k+\alpha/2\pi}{n} \phi_k(v_j)}}. \end{equation} The correlation function of vertex operators on a torus is given by \cite{DiFrancesco:639405}:\begin{align} \ave{\prod_i \exp{i \alpha_i \phi(z_i)}}=\delta_{0,\sum_i {\alpha_i}}\: \abs{\frac{\theta_\nu\cbr{\sum_i \alpha_i z_i|\tau}}{\theta_\nu\cbr{0|\tau}} }\prod_{i<j} \abs{\frac{\partial_z\eva{\theta_1\cbr{z|\tau}}{z=0}}{\theta_1\cbr{z_i-z_j|\tau}}}^{-2 \alpha_i \alpha_j}. \label{eq:corrfunctiontorus}\end{align} Using Eqs. \eqref{eq:corrfunctiontorus} and \eqref{partitionfunctiondefinition}, we find: \begin{equation} Z_k(\alpha)=\Big|\f{\prod_{a<b}\theta_1(\frac{u_a-u_b}{L}|\tau)\theta_1(\frac{v_a-v_b}{L}|\tau)}{\prod_{a,b}\theta_1(\frac{u_a-v_b}{L}|\tau)}\left({\epsilon} \partial_z \theta_1(0|\tau)\right)^p\Big|^{2\f{(k+{\alpha/2\pi}{})^2}{n^2}}\left|\f{\theta_\nu(\sum_a\f{k+\alpha/2\pi}{n}(\frac{u_a-v_a}{L}))}{\theta_\nu(0|\tau)}\right|^2\label{kdependentpartitionfunction}, \end{equation} where we have added an ultraviolet cutoff $\epsilon\approx\frac{a}{L}$ necessary for the numerical comparison with a lattice theory with spacing $a\ra0$. The spacial length of the torus is set equal to $L$, and $\tau=\frac{i\beta}{L}$ is the ratio of the two periods of the torus. $\theta_\nu$ are the Jacobi theta functions, with the pedix $\nu$ specifying one of the four possible boundary conditions along the torus, the \textit{spin sectors} $\nu=1,2,3,4$. Their meaning is reported in the following table using the standard notation of $NS$ and $R$ for Neveu-Schwarz or Ramond periodic condition, respectively:\begin{center} \begin{tabular}{ c c c } Spin sector & Periodicity in the $x$ direction & Periodicity in the $\tau$ direction \\ $\nu=1$ & R & R\\ $\nu=2$ & R & NS\\ $\nu=3$ & NS & NS\\ $\nu=4$ & NS & R \end{tabular} \end{center} \quad \\ Before concluding this section, we notice that Eq. \eqref{kdependentpartitionfunction} can be put in another form by applying a modular transformation on the parameter $\tau\rightarrow-\f{1}{\tau}$. Under such transformation, the Jacobi theta functions obey the identity \cite{DiFrancesco:639405}:\begin{align} \theta_\nu(x|\tau)=-\frac{e^{-\frac{\pi i x^2}{\tau}}}{\sqrt{-i\tau}}\theta_{\nu'}\left(\frac{x}{\tau}|-\frac{1}{\tau}\right){}, \end{align} where $\nu'=\nu$ for $\nu=1,3 $, while $\nu=2,4$ interchange. Applying this transformation to \eqref{kdependentpartitionfunction}, we obtain the expression: \begin{multline} Z_k(\alpha)=\Big |\f{\prod_{a<b}\theta_1(\f{u_a-u_b}{i\beta}|-\f{1}{\tau})\theta_1(\f{v_a-v_b}{i\beta}|-\f{1}{\tau})}{\prod_{a,b}\theta_1(\f{u_a-v_b}{i\beta}|-\f{1}{\tau})}\left(\f{\epsilon}{\tau} \partial_z \theta_1\left(0\left|-\f{1}{\tau}\right.\right)\right)^p\Big|^{2\f{(k+{\alpha/2\pi}{})^2}{n^2}}\\ \times \left|\f{\theta_{\nu'}(\sum_a\f{(k+\alpha/2\pi)(u_a-v_a)}{i\beta n}\left|-\f{1}{\tau}\right.)}{\theta_{\nu'}(0|-\f{1}{\tau})}\right|^2\label{kdependentpartitionfunctionmodulartransformed}, \end{multline} \subsection{Charged moments on the torus} We can start from Eq. \eqref{partitionfunctiondecoupled} to compute the charged moments. To this end, we divide it in two parts, where the first factor, $Z_k^{0}(\alpha)$, does not depend on the spin sector $\nu$, so we dub it the \textit{spin independent part}. The second factor will be named instead the \textit{spin dependent part} $Z_k^\nu(\alpha)$, such that \begin{align} \log(Z_n)=\log(Z^\nu_n)+\log(Z^0_n )\label{eq:total_partition_function} \end{align} Explicit analytic expressions are provided in Eqs. \eqref{eq:chm}, \eqref{eq:nu2spindeppart}, \eqref{eq:nu3spindeppart}. \subsubsection{Spin independent part}\label{Spin independent Part} For convenience, we take the logarithm of both terms in \ref{partitionfunctiondecoupled}, to transform the product into a sum: \begin{align} \log Z_n(\alpha)=&\sum_{k=-\f{n-1}{2}}^{\f{n-1}{2}}2\f{(k+{\alpha/2\pi}{})^2}{n^2}\log \Big|\f{\prod_{a<b}\theta_1(\f{u_a-u_b}{i\beta}|-\f{1}{\tau})\theta_1(\f{v_a-v_b}{i\beta}|-\f{1}{\tau})}{\prod_{a,b}\theta_1(\f{u_a-v_b}{i\beta}|-\f{1}{\tau})}\nonumber\\&\times \left(\f{\epsilon}{\tau} \partial_z \theta_1\left(0\left|-\f{1}{\tau}\right.\right)\right)^p\Big|+\sum_{k=-\f{n-1}{2}}^{\f{n-1}{2}}\log\Big|\f{\theta_{\nu'}(\sum_a\f{(k+\alpha/2\pi)(u_a-v_a)}{i\beta n}\left|-\f{1}{\tau}\right.)}{\theta_{\nu'}(0|-\f{1}{\tau})}\Big|^2.\label{partitionfunctionnu for integers}\end{align} We focus on the physical sectors $\nu=2,3$ which are antiperiodic in the imaginary time with period $\beta$. The sum of the spin independent part can be easily calculated since \[ \f{2}{n^2}\sum_{k=-\f{n-1}{2}}^{\f{n-1}{2}}{(k+{\alpha/2\pi}{})^2}=\f{n^2-1}{6n}+\f{2(\alpha/2\pi)^2}{n} \numberthis, \] and we get \begin{multline} \label{eq:chm} \log Z^{0}_n(\alpha)=\\ =\left(\f{n^2-1}{6n}+\f{\alpha^2}{2\pi^2 n }\right) \log\left|\f{\prod_{a<b}\theta_1(\f{u_a-u_b}{i\beta}|-\f{1}{\tau})\theta_1(\f{v_a-v_b}{i\beta}|-\f{1}{\tau})}{\prod_{a,b}\theta_1(\f{u_a-v_b}{i\beta}|-\f{1}{\tau})}\left(\f{\epsilon}{\tau} \partial_z \theta_1\left(0\left|-\f{1}{\tau}\right.\right)\right)^p\right|. \end{multline} This expression, in the limit ${L,\beta \rightarrow\infty}$, agrees with the well known CFT results on a flat space-time \cite{Goldstein_2018} . \subsubsection{Spin dependent part}\label{Spin dependent Part} The spin dependent part of the partition function is the most interesting, since it shows deviations from standard CFT on a plane. As we will find out, these terms, which come purely from the boundary conditions, are responsible for small violations of the equipartition of entanglement. Physically, the influence of the boundary on entanglement shows the non-local nature of the latter. The goal is the computation of \begin{equation} \log Z_n^{\nu}(\alpha)=\sum_{k=-\f{n-1}{2}}^{\f{n-1}{2}}2\log\left|\f{\theta_{\nu'}(\f{(k+\alpha/(2\pi))r}{i\beta n}\left|-\f{1}{\tau}\right.)}{\theta_{\nu'}(0|-\f{1}{\tau})}\right|, \label{nu2sectorspindependentpartitionfunction} \end{equation} where $r$, from now on, will be defined as the total length of the subsystem: \[r=\sum_a {u_a-v_a}. \numberthis \] Let us focus on the{ $\nu=2$} spin sector. Substituting the infinite product expansion of theta functions \cite{DiFrancesco:639405}, Taylor-expanding the logarithm and using the results for the geometric series, we find \[\log(Z_n^{\nu=2})=2\sum_{m=1}^\infty \f{1}{m}\f{1}{\sinh(\frac{\pi m L }{\beta})} {\left(n-\f{\sinh(\f{\pi m r}{\beta})}{\sinh(\f{\pi m r}{\beta n })}\cosh(\f{ m r\alpha}{\beta n} )\right)}. \label{eq:nu2spindeppart}\numberthis \] This series converges exponentially fast for all real values of $n$. \\ A similar formula can be found for the spin sector $\nu=3$ \[\log Z^{\nu=3}_n(\alpha)=2\sum_{m=1}^\infty \f{(-)^m}{m\sinh(\f{\pi m L}{\beta})} \left(n-\f{\sinh(\f{\pi m r}{\beta })}{\sinh(\f{\pi m r}{\beta n})}\cosh(\f{ m r\alpha}{\beta n} )\right).\label{eq:nu3spindeppart}\numberthis \] \subsubsection{Comparison with the lattice theory} In this section we benchmark the results for the charged moments $\log Z_n\equiv\log Z_n^{0}(\alpha)+\log Z_n^{\nu}(\alpha)$, $\nu=2,3$. For the lattice computations, we use the techniques reported in the Appendix \ref{app:num}, setting the number of lattice sites in the numerics to $N=300$. We also choose the lattice spacing $a=1/N$ in such a way that $L=Na=1$.\\ As can be seen from Eq. \eqref{eq:chm}, there is an unknown lattice parameter, $\epsilon$, necessary to compare the CFT results with the numerics. To avoid this problem, a possibility is to consider quantities such as the difference of the logarithm of two charged moments, each computed for the same number of intervals of different length, so that the dependence on $\epsilon$ cancels out. This has been done in Figure \ref{diffnu2}, showing a good agreement between the lattice computations and the field theory prediction in Eqs. \eqref{eq:chm} and \eqref{nu2sectorspindependentpartitionfunction}. \begin{figure}[h] \includegraphics{main-figure0.pdf} \includegraphics{main-figure1.pdf} \caption{Difference between the logarithm of the charged moments $\Delta\log Z_n(\alpha)\equiv \eva{\log Z_n(\alpha)}{r=\ell_1}-\eva{\log Z_n(\alpha)}{r=\ell_2}$, evaluated for a single interval of length, respectively, $\ell_2=0.3 L$ and $\ell_1=0.6 L$, in the spin sectors $\nu=2$ (left) and $\nu=3$ (right), with the temperature set to $\beta=3L$ and $N=300$ lattice sites. The blue continuous line uses the field theory prediction in Eq. \eqref{eq:total_partition_function} while the symbols correspond to the exact results obtained through the techniques reported in Appendix \ref{app:num}. }\label{diffnu2} \end{figure} \\ It is also possible to fix $\epsilon$ using its analytical expression found in \cite{Bonsignori_2019} by exploiting the generalised Fisher-Hartwig conjecture. In short, this technique allows to obtain an explicit formula for the charged moments computed on a lattice theory at $T=0$ and $N\rightarrow\infty$. The comparison with the analytical formula derived from field theory provides an expression for the lattice constant $\epsilon$, which we assume to weakly depend on $\tau=i\frac{\beta}{L}$. Numerical evidence seems to validate this assumption, as shown in Fig. \ref{plot:alphadependencechargedmoments}, where the lattice data and the field theory prediction perfectly overlap. We report explicitly the expression we used for the lattice constant $\epsilon$ \cite{Bonsignori_2019}, which is \begin{equation} \begin{split} \epsilon(n,\alpha)=&\f{1}{2 N} \exp\left(\f{6n}{n^2-1+12 (\alpha/2\pi)^2}\Upsilon(n,\alpha)\right),\\ \Upsilon(n,\alpha)=& ni\int_{-\infty}^\infty \d w \left[\tanh( \pi w)-\tanh( \pi n w+{\frac{1}{2} i \alpha})\right] \log\left(\f{\Gamma\left(\frac{1}{2}+i w\right)}{\Gamma\left(\frac{1}{2}-i w\right)}\right). \end{split}\label{eqepsilon} \end{equation} \begin{figure} \includegraphics{main-figure2.pdf} \includegraphics{main-figure3.pdf} \caption{Logarithm of the charged moment $\log(Z_1(\alpha))$ evaluated for a subsystem made of two intervals of length $0.1 L,\, 0.3 L$, separated by a distance $\Delta x =0.2 L$, at $\beta=0.1L$. The blue solid line corresponds to Eq. \eqref{partitionfunctionnu for integers} while the lattice cutoff $\epsilon$ is given by Eq. \eqref{eqepsilon}. We have set the number of lattice sites $N=300$.} \label{plot:alphadependencechargedmoments} \end{figure} \subsection{Symmetry resolved moments via Fourier transform} Applying the inverse Fourier transform \eqref{eq:inverse Fourier} we obtain the symmetry resolved R\'enyi entropies. In order to explicitly carry out this integral, we consider the physically relevant limit $\epsilon\sim\frac{a}{L}=\frac{1}{N}\ll 1$. The function $\log Z_n(\alpha)$ is well described by a quadratic function in $\alpha$ in this limit, since the spin independent part is dominant, thanks to the term $\propto \alpha^2 \log(\epsilon)$ in Eq. \eqref{eq:chm}: \begin{align} \abs{\log(Z^0_n)}\sim \left(\frac{n^2-1}{6n}+\frac{\alpha^2}{2 n \pi^2}\right)\log(N)\gg \abs{\log(Z^\nu_n)}=O(1). \end{align} In this limit, we can approximate the charged moments at the lowest nontrivial order in $\alpha$ as \[Z_n(\alpha)\approx A_n e^{-\f{b_n\alpha^2}{2}}, \label{eq:saddlepoint expansion}\numberthis \] where the explicit expression for the parameters $A_n, b_n$ are reported in Appendix \ref{app:saddlepoint} to lighten the notations. The Fourier transform can be explicitly carried out by extending the integration domain of Eq. \eqref{eq:ft} to the whole real axis, instead of just $[-\pi,\pi]$. This is a good approximation provided again $\f{b_n}{8}\gg 1$, which holds true in the thermodynamic limit $\epsilon\sim\frac{a}{L}\rightarrow 0$. Within this assumption, we get the symmetry resolved moments \[\Op{ Z}_n(q)={A_n}\sqrt{\f{1}{2\pi b^{\nu}_n}} e^{-\f{( q)^2}{2 b^{\nu}_n}}, \label{saddle}\numberthis \] and the symmetry resolved entanglement entropy \begin{equation} S^{\nu}_n(q)=\f{1}{1-n}\left[\log \f{A_n}{A^n_1}+\frac{1}{2}\log \f{ (b^{\nu}_1)^n}{b^{\nu}_n} - \f{1-n}{2}\log(2\pi) - \f{( q)^2}{2}\left(\f{n}{b^{\nu}_1}-\f{1}{b^{\nu}_n}\right)\right].\label{symmetry-resolved entropy saddle approximation}\end{equation} It is interesting to study whether the equipartition of entanglement is broken. In particular, looking at Eq. \eqref{symmetry-resolved entropy saddle approximation}, the charge dependent contribution cancels if $b_n\propto\f{1}{n}$. Since this is always true for the spin independent part of the partition function (ignoring the $n$ and $\alpha$ dependence of the lattice constant $\epsilon$), any breaking of equipartition predicted by pure CFT is due to the spin dependent part of the charged moments, thus to the boundary conditions. Moreover, if we consider the explicit expression for $b_n^{\nu=3}$ in Eq. \eqref{divergnu3}, we observe that the spin dependent part is suppressed for $\frac{\beta}{L}\ll 1$, meaning the equipartition is preserved at high temperatures. \\ In Figure \ref{Tdependence}, we show the temperature dependence of the symmetry resolved entanglement entropy for one interval and different charges $q$, in both relevant spin sectors. We can clearly see that the equipartition is recovered in the high temperature regime, while this is spoiled by the boundary terms at low temperature, in particular in the spin sector $\nu=2$. In Figure \ref{plot:masslessSREE} (top panels), we plot the symmetry resolved moments obtained with the saddle point approximation in Eq. \eqref{saddle}, testing the agreement with the ones obtained from a numerical transform of the field theory formula in Eq. \eqref{partitionfunctionnu for integers} and with the lattice theory. Finally, in Figure \ref{plot:masslessSREE} (bottom panels) we do the same for the symmetry resolved entropy in Eq. \eqref{symmetry-resolved entropy saddle approximation}. We see that the agreement is good around $q=0$ and it worsens for higher values of $q$ since, while the lattice entropy seems to saturate, the saddle point predicts a parabolic behavior for all $q$, which only mimics the lattice behavior in a neighborhood of $q=0$. \begin{figure}[h] \includegraphics{main-figure4.pdf} \includegraphics{main-figure5.pdf} \caption{Temperature dependence, in unit of the inverse spacial dimension of the system, for the entanglement entropy of a subsystem composed of an interval of length $0.4 L$ in the $\nu=2$ (left) and $\nu=3$ (right) spin sectors, obtained from Eq. \eqref{symmetry-resolved entropy saddle approximation}, with the constant $\epsilon$ evaluated for $N=300$ in Eq. \eqref{eqepsilon}. The asymptotic linear growth for higher temperatures reproduces the well known thermodynamic entropy of free fermions (quantum correlations are subleading at higher temperatures). } \label{Tdependence} \end{figure} \begin{figure} \includegraphics{main-figure6.pdf} \includegraphics{main-figure7.pdf} \includegraphics{main-figure8.pdf} \includegraphics{main-figure9.pdf} \caption{Top panels: Symmetry resolved moments $\Op{Z}_n(q)$ for $n=1$, computed with the saddle point approximation in Eq. \eqref{saddle} (blue continuous line), with a numerical Fourier transform of the field theory charged moments in Eq. \eqref{partitionfunctionnu for integers} (cross mark) and with the lattice model (orange dots), for $N=300$. The values of the parameters are $\beta=10L$ and $r=0.3 L$, where $r$ is the size of the interval defining the subsystem. The plot on the left is obtained in the spin sector $\nu=2$, the other one corresponds to $\nu=3$. Bottom panels: Symmetry resolved entanglement entropy in the spin sector $\nu=2$ (left) and $\nu=3$ (right) for a subsystem made of a single interval of length $0.3L$, at $\beta=10 L$. The blue continuous line represents the result obtained from the field theory with the saddle point approximation in Eq. \eqref{symmetry-resolved entropy saddle approximation} and the orange dots show, instead, the numerical result for a finite lattice model ($N=300$).} \label{plot:masslessSREE} \end{figure} \section{Symmetry resolution - massive case}\label{Section:massive_calculations} In this section we derive the leading correction to the symmetry resolved entanglement entropy on the torus due to a mass term in the Dirac Lagrangian, i.e. \begin{equation} \Op{L}=\bar{\psi}\gamma^\mu(\partial_\mu)\psi+m{\bar{\psi}\psi}.\label{Dirac lagrangian2}\end{equation} The procedure to compute the partition function is the same as the one described in Section \ref{sec:review_bosonization}, with the only difference that the average \eqref{eq12} is now computed on a massive theory and not on a CFT. Given the complexity of the resulting expressions, we refer to Appendix \ref{analytical_sum_ssEE} for the technical details, while we report the steps for their derivation in the main text. We show that the presence of a small mass in the Dirac action does not spoil equipartition at leading order, in the thermodynamic limit, but gives a subleading, spin sector dependent correction, which is proportional to the mass. Here, we treat the mass perturbatively, in such a way that the extra term in the Lagrangian is considered as a perturbation of the massless theory, as follows \begin{multline} Z_k^m(\alpha)=\ave{e^{i\int \d^2x\bar{\psi}\slashed{A}\bar{\psi}}}_{\text{massive theory}}\equiv\f{\int [D\bar{\psi}_k][D\psi_k] e^{-\int \d^2 x\bar{\psi}\left(\slashed{\partial}-i\slashed{A}+m\right)\psi}}{\int [D\bar{\psi}_k][D\psi_k] e^{-\int \d^2 x\bar{\psi}\left(\slashed{\partial}+m\right)\psi}}= \\ \label{eq19} =\f{\ave{ e^{\int \d^2 x\bar{\psi}\left(i\slashed{A}-m\right)\psi}}_{CFT}}{\ave{e^{-\int \d^2 x\bar{\psi}m\psi}}_{CFT}}. \end{multline} We use the superscript $m$ in order to distinguish the massive charged moments from the massless ones. Using the bosonisation technique, Eq. \eqref{Dirac lagrangian2} can be mapped into a sine-Gordon model, whose action reads \[S_{SN}=\int \left[\f{1}{8\pi}\partial_\mu\phi\partial^\mu\phi+\lambda\cos(\phi) \right]\d^2 x,\numberthis \] where the coupling $\lambda$ is proportional to the mass with a dimensional factor dependent on a cutoff scale (this constant will be fitted when comparing the field theory and the numerical results). \\Eq. \eqref{eq19} can be rewritten in terms of expectation values on a bosonic theory replacing the massive term with the cosine interaction, and using Eq. \eqref{eq:bosonized_current} for the current: \[Z^m_k(\alpha)=\f{\ave{e^{\int \f{\d^2 x }{2\pi} \left(i{A}_\mu\epsilon^{\mu\nu}\partial_\nu \phi-\lambda \cos(\phi)\right)}}}{\ave{e^{-\int \d^2 x\lambda \cos(\phi)}}},\numberthis \] where for brevity we omit the subscript CFT on the average from now on, assuming all path integrals are performed on the massless action. The first nontrivial order for the mass term is quadratic in $\lambda$, due to the neutrality condition of vertex operators: \[\ave{e^{-\int \d^2 x\lambda \cos(\phi)}}= \ave{1+\f{\lambda^2}{4} \int e^{i(\phi(x)-\phi(y))}\d^2 x\d^2 y+O(\lambda^4)}.\numberthis \] We can then express the first order mass correction to the charged moments as: \begin{equation} \begin{split} Z^m_k(\alpha)=\f{\ave{\prod_j e^{i\f{k+\alpha/2\pi}{n}\phi(0,u_j)}e^{-i\f{k+\alpha/2\pi}{n}\phi(0,v_j)}\left[1+\f{\lambda^2}{4} \int e^{i(\phi(x)-\phi(y))}\d^2 x\d^2 y\right]}}{\ave{1+\f{\lambda^2}{4} \int e^{i(\phi(x)-\phi(y))}\d^2 x\d^2 y}} \\ \approx Z_k(\alpha)+\f{\lambda^2}{4}\ave{\left[\prod_j e^{i\f{k+\alpha/2\pi}{n}\phi(0,u_j)}e^{-i\f{k+\alpha/2\pi}{n}\phi(0,v_j)}-1\right]\int e^{i(\phi(x)-\phi(y))}\d^2 x\d^2 y}. \end{split} \end{equation} We use the following compact notation to label our main quantities of interest: \begin{align} A_{k,n}(\alpha,x,y) \equiv&\f{\ave{e^{i(\phi(x)-\phi(y))}\prod_j e^{i\f{k+\alpha/2\pi}{n}\phi(0,u_j)}e^{-i\f{k+\alpha/2\pi}{n}\phi(0,v_j)}}}{\ave{\prod_j e^{i\f{k+\alpha/2\pi}{n}\phi(0,u_j)}e^{-i\f{k+\alpha/2\pi}{n}\phi(0,v_j)}}},\qquad \\ A^{tot}_n(\alpha)=&\sum_{k=-\f{n-1}{2}}^{\f{n-1}{2}} A_{k,n}(\alpha,x,y)-A_{k=0,n}(0,x,y),\label{eq:rego} \end{align} allowing us to write the correction to the full partition function as: \begin{equation} \begin{split}\label{eq:toderive} Z^{m}_n(\alpha)\approx Z^{m=0}_n(\alpha)\left(1+m^2\int A^{tot}_n(\alpha) \d^2 x\d^2 y\right) +O(m^4), \end{split} \end{equation} where, we stress again, $\lambda \propto m$ up to a renormalisation constant. \\ $A_{k,n}$ is a correlation function of vertex operators, so Eq. \eqref{eq:corrfunctiontorus} yields: \begin{equation} \begin{split} A_{k,n}-\eva{A_{k,n}}{k=\alpha=0}&=\left|\f{\theta_\nu\left(\f{(k+\alpha ) r}{n}+x-y\right)|\tau}{\theta_\nu\left(\f{(k+\alpha ) r}{n}|\tau\right)}\f{\epsilon\partial_z\theta_1\left(0|\tau\right)}{\theta_1\left(y-x|\tau\right)}\right|^2 \\ &\times \prod_a\left|\f{\theta_1\left(v_a-x|\tau\right)\theta_1\left(u_a-y|\tau\right)}{\theta_1\left(v_a-y|\tau\right)\theta_1\left(u_a-x|\tau\right)}\right|^\f{2(k+\alpha )}{n}-\left|\f{\epsilon\partial_z\theta_1\left(0|\tau\right)}{\theta_1\left(y-x|\tau\right)}^2\f{\theta_\nu(x-y|\tau)}{\theta_\nu(0|\tau)}\right|^2.\label{kdependent massive correction to the partition function} \end{split} \end{equation} The second addendum ensures that there is no mass correction when the size of the subsystem goes to $0$, and its presence is crucial to regularise the integral. Indeed, we can check that the integral in Eq. \eqref{kdependent massive correction to the partition function} does not diverge, so that a regularisation for the mass is not required to obtain a meaningful result. Assuming to work at finite $L,\beta$, a divergent contribution can only come from poles of the integrand. Since $\theta_1(z)\propto z$ as $ z\rightarrow 0 ,$ $x=y$ is a singular point. Expanding around $x=y$ at the lowest order, we have \[\prod_a \left|\f{\theta_1\left(v_a-x|\tau\right)\theta_1\left(u_a-y|\tau\right)}{\theta_1\left(v_a-y|\tau\right)\theta_1\left(u_a-x|\tau\right)}\right|^\f{2(k+\alpha )}{n}=1+O(|x-y|), \numberthis \] and \[\f{\theta_\nu\left(\f{(k+\alpha ) r}{n}+x-y|\tau\right)}{\theta_\nu\left(\f{(k+\alpha ) r}{n}|\tau\right)}=1+O(|x-y|), \numberthis \] which means that the two singular addends in Eq. \eqref{kdependent massive correction to the partition function} cancel out at the leading order, and the divergence can behave at most as $\sim \f{1}{|x-y|}$. Since $x,y$ are $2-$dimensional variables, when divided in real and imaginary part, a pole must diverge at least like $\sim\f{1}{|x-y|^2}$ to give an infinite contribution, which is not the case. Points where $x=u_a,v_a$ or $y=u_a,v_a$ (and vice-versa) behave as $\abs{x-u_a}^{-\f{2(k+\alpha/(2\pi))}{n}}$. In our case, $|k|\le \f{n-1}{2}$ and $|\alpha|/(2\pi)\le \frac{1}{2}$, so this exponent can be $2$ at most, where the value $2$ occurs only for the most extreme values of $\alpha=\pm\pi$. Except for these $\alpha=\pm\pi$, such poles behave like $1/|x-x_0|^s, s< 2 $ which means they do not give a divergent contribution. The analytical resummation of $\sum_{k}A_{k,n}$, can be done using identities for the Jacobi theta functions and we report the result of these computations in Appendix \ref{analytical_sum_ssEE}. \subsection{Numerical implementation} While the total entanglement entropy at finite temperature and sistem size has already been studied in Ref. \cite{Herzog_2013} for the massless case, the massive correction was only found for integer values of $n\ge2$, so it is important to test the analytic continuation for $n=1$ and $\alpha=0$ against lattice computations. As already stressed, the mass is defined up to a renormalisation factor; to match the field theory result with the lattice model we fit a multiplicative constant for the renormalised mass and use it in the plots. We assume that the renormalised mass does depend on both the number of lattice sites and the ratio $\frac{\beta}{L}$, so a different fit is performed for every choice of these parameters. The R\'enyi entropies get a small mass contribution equal to \[\delta S^m_n=m^2\f{1}{1-n}\int A^{tot}_n \d^2 x \d^2 y,\label{eq:entropy perturbation}\numberthis \] and taking the limit $n\ra1$ of this expression (as explained in Appendix \ref{analytical_sum_ssEE}), we get the entanglement entropy mass correction, which has been plotted in Fig. \ref{plot:r-dependencemassivecorrectionRE}. As noted in \cite{Herzog_2013}, since the ground state in the spin sector $\nu=2$ is degenerate, the limit $e^{-\beta H}|_{\beta\rightarrow\infty}$ does not produce a pure state. The presence of the mass should remove this degeneracy, but our perturbative assumption requires $m\ll T,L^{-1}$, meaning that the degeneracy is not lifted and the limits $m\rightarrow 0,\ T\rightarrow 0$ do not commute. This is shown in Figure \ref{plot:r-dependencemassivecorrectionRE}, where, within the spin sector $\nu=2$, the property \begin{align} S_n(r)=S_n(L-r), \end{align} which holds for a pure state, is not respected. \begin{figure}[h!] \includegraphics{main-figure10.pdf} \includegraphics{main-figure11.pdf} \caption{Mass correction to the R\'enyi entropy as a function of the subsystems size, $r$ for $N=300$ sites. We compare the lattice results (continuous orange line) with Eq. \eqref{eq:entropy perturbation} (blue points) for a subsystem of one single interval, at $\frac{\beta}{L}=5$, in the spin sectors $\nu=2$ (left) and $\nu=3$ (right). We plot the R\'enyi entropy $S_n$ corresponding to $n=1$ for the $\nu=2$ spin sector, while we choose $n=1.5$ for the $\nu=3$ spin sector. Notice that in this case we used the symbols for the field theory prediction, since the evaluation of the integrals defining this correction makes it hard to sample many points; for visual clarity, we used instead a continuous line for the lattice data. The overlap between the field theory and the lattice theory is obtained by a fit of a multiplicative constant for the data, due to a renormalisation of the mass. } \label{plot:r-dependencemassivecorrectionRE} \end{figure}\begin{figure} \includegraphics{main-figure12.pdf} \includegraphics{main-figure13.pdf} \caption{Mass correction to the logarithm of the charged moment $\log(Z^m_n(\alpha))$ computed at $\beta=5$ for a subsystem of size $r=0.5 L$ in a system of $N=300$ sites. This quantity is evaluated for $n=1.5$, in the spin sector $\nu=2$ (left), and for $n=1$ in the spin sector $\nu=3$ (right). The plots have been overlapped thanks to a multiplicative constant obtained by a subsystem-size fit like the one shown in Figure \ref{plot:r-dependencemassivecorrectionRE}. In particular, the blue points correspond to the analytical prediction in Eq. \eqref{eq:saddlezetacal}.} \label{plot:alphadependencemassivecorrectionchargedmoments} \end{figure} \begin{figure} \includegraphics{main-figure14.pdf} \includegraphics{main-figure15.pdf} \caption{Mass correction to the symmetry resolved entanglement entropy evaluated for a subsystem of size $\ell=0.5 L$ and $N=300$ total sites. The inverse temperature and the spin sector shown are $\beta=5, \nu=2$ (left) and $\beta=1, \nu=3$ (right). We compare the results on the lattice (in orange) and the field theory correction (in blue) in Eq. \eqref{masscorrectionsymmresentr}.}\label{plot:SREEmassivecorr2} \end{figure} Similarly, we compare the leading order mass correction of the charged moments in Fig. \ref{plot:alphadependencemassivecorrectionchargedmoments}. The integration of Eqs. \eqref{eq:toderive} and \eqref{eq:entropy perturbation} has been carried out with the Mathematica Montecarlo algorithm, averaged on many different realisations, to reduce the integration error, which was not negligible in a single run of the algorithm. \subsection{Fourier transform and number entropy} Starting from the charged moments in Eq. \eqref{eq:toderive}, the leading order massive correction to the symmetry resolved moments and entropy are given by \begin{align}\label{eq:saddlezetacal} \delta \mathcal{Z}_n(q) \equiv \eva{\pdv{\mathcal{Z}^m_n(q)}{m^2}}{m^2=0}=\int_{-\pi}^\pi e^{i\alpha q} Z_n^{m=0}(\alpha)\int A^{tot}_n(\alpha,x,y)\d^2 x \d^2 y \frac{\d \alpha}{2\pi} \end{align} and \begin{align} \eva{\frac{\partial S^m_n(q)}{\partial m^2}}{m=0}=\f{1}{1-n}\left(\f{\delta \mathcal{Z}_n(q)}{\mathcal{Z}_n(q)}-n\f{\delta \mathcal{Z}_1(q)}{\Op{Z}_1(q)}\right)\label{masscorrectionsymmresentr}\end{align} respectively. The presence of a mass gives, within this perturbative approach, a term which violates the equipartition, and which is subleading in the small $m$ limit we are considering. The correction to the symmetry resolved entropy has been plotted in Fig. \ref{plot:SREEmassivecorr2} against the exact lattice computations; we can observe a deviation between the lattice data and the field theory results for $q>1$, which are due to finite size effect. Before concluding the section, we want to show how the mass correction to the Dirac action affects the result for the number entropy. Using a quadratic approximation for the logarithm of the charged moments around $\alpha=0$, we can get an expression for the number entropy using the saddle point approximation: by defining \begin{align} \int\pdv[2]{A^{tot}_{1}}{\alpha}\d^2 x \d^2 y \equiv c^\nu \end{align} we can rewrite Eq. \eqref{eq:toderive} as \begin{align} \log(Z^m_1(\alpha))\approx\log(Z_1^{m}(0))+\f{\alpha^2}{2}\left(m^2 c^\nu - b^\nu_1\right) \end{align} and, using Eq. \eqref{eq:ft}, the probability distribution $p(q)$ reads \begin{align} p(q)\approx\int_{-\infty}^\infty e^{-\f{\alpha^2(b_1^\nu-m^2c^\nu)}{2}}e^{-i\alpha q}\f{\d\alpha}{2\pi} = e^{-\f{q^2}{2(b_1^\nu-m^2c_1^\nu)}}\f{1}{\sqrt{2\pi(b_1^\nu-m^2 c^\nu )}}. \end{align} Estimating the sum with an integral, a substitution justified in the same limit of the saddle entropy approximation, the number entropy defined in Eq. \eqref{eq:sum} is \begin{align} S^{num}=-\sum_q p(q)\log(p(q)) \approx- \int_{-\infty}^\infty p(q) \log(p(q)) \d q = \frac{1}{2} \left(1+\log(2\pi(b_1^\nu-m^2 c^\nu )) \right), \end{align} where for small $m$, we can find the $O(m^2)$ corrections to the massless case. \section{Charge imbalace resolution - massive case}\label{sec:fneg} We now turn to the computation of the fermionic negativity. We need to evaluate $N_1(\alpha)$ for the normalisation constant $p(q)$ in Eq. \eqref{momentstransform} and the even charged moments \begin{align} N_{n_e}(\alpha)= \mathop{\mbox{\normalfont Tr}}\nolimits(\left(\rho_A^{R_1}{\rho_A^{R_1}}^\dagger\right)^{n_e } e^{i\alpha Q_{imb}}),\end{align} which will be analytically continued to $n_e\ra1$. This quantity has been studied in Ref. \cite{Murciano_2020} for massless free fermions at finite size and temperature and we will briefly review it as a starting point to compute the leading order massive correction. As custom, we denote with $A_1$ and $A_2$ the subpartitions of $A$ and we want to evaluate the charge imbalance negativity between them. The odd and even charged moments $N_n(\alpha)$ can be found via replica trick; in this case we need to sew the $n$ copies of the fermionic field taking into account also the antiperiodic boundary connection to each field due to the anticommuting nature of fermions, i.e. \begin{align} \psi_j(x)=\begin{cases} T_\alpha^{R}\psi_{j-1}(x) \qquad &x\in A_1\\ T_\alpha\psi_{j-1}(x) \qquad &x\in A_2\\ \psi_j(x) \qquad &x\notin A \end{cases},\end{align} where $T_\alpha$ is the twist matrix already defined in Eq. \eqref{twistmatrix1}, while $T^R_\alpha$ takes into account the time-reversal operation and reads \begin{align} T^{R_1}_\alpha=\begin{pmatrix} 0&0&0&\ldots&0 &e^{-i\frac{\alpha}{n_e}} (-1)^{n_e-1 }\\ e^{-i\frac{\alpha}{n_e}}&0&0&\ldots&0 &0\\ 0&e^{-i\frac{\alpha}{n_e}}&0&\ldots&0 &0\\ 0&0&e^{-i\frac{\alpha}{n_e}}&\ldots&0 &0\\ \vdots&\vdots&\vdots&\vdots&\vdots&\vdots\\ 0&0&0&\ldots&e^{-i\f{\alpha}{n}}&0 \end{pmatrix}.\label{twistmatrix2} \end{align} The twist matrices $T_{\alpha}$ and $T^{R_1}_{\alpha}$, defined in Eqs. \eqref{twistmatrix1} and \eqref{twistmatrix2}, respectively, can be simultaneously diagonalised for $n$ even or, trivially, for $n=1$, by choosing the following basis for the fields on the replicas \begin{align} \tilde{\psi}_k\equiv \sum_{j=1}^n e^{-\frac{2\pi i kj}{n_e}-i\pi j} \psi_j, \qquad T_{\alpha}\tilde{\psi}_k=e^{\frac{i(2\pi k+\alpha)}{n_e}}\tilde{\psi}_k\qquad T^R_{\alpha}\tilde{\psi}_k=e^{\frac{-i(2\pi k+\alpha)}{n_e}+i\pi}\tilde{\psi}_k,\label{diagonalization_twistfield}\end{align} for $k=\frac{1-n_e}{2},\ldots\frac{n_e-1}{2}$. In this basis, our problem is split into the computation of $n$ decoupled partition functions in which the fields have different twist phases, $e^{2\pi i \frac{k+\alpha/2\pi}{n_e}}$ and $-e^{-2\pi i \frac{k+\alpha/2\pi}{n_e}}$ passing through $A_2$ and $A_1$, respectively. The total partition function is the product of each of these \begin{align} N_{n_e}(\alpha)=\prod_k Z_{R_1,k}(\alpha). \end{align} As a concrete example, we consider the following geometry: our subsystems $A_1,A_2$ are adjacent segments of lengths $\ell_1,\ell_2$, respectively, such that $A_1=[-{\ell_1},0], A_2=[0,\ell_2]$. Moreover, we work at finite size and temperature, so that each partition function is defined on a torus. Using again the bosonisation technique, $ Z_{R_1,k}(\alpha)$ is expressed as a correlation function of vertex operators. As explained in Appendix \ref{fluxambiguity} we need to fix the phase ambiguity of the vertex operators by choosing the leading order contribution in the scaling limit. This has been done in Appendix \ref{ambiguity_negativity}, and we report here only the final result \begin{align} Z_{R_1,k}=\ave{e^{- i \left(\f{\text{sgn}\left(k\right)}{2}+\f{k}{n_e}+\f{\alpha}{2\pi n_e}\right)\phi(-\ell_1)}e^{ i \left(\f{\text{sgn}(k)}{2}+\f{2k}{n_e}+\f{\alpha}{\pi n_e}\right)\phi(0)}e^{ i \left(\f{k}{n_e}+\f{\alpha}{2\pi n_e}\right)\phi(\ell_2)}}\label{eq31}, \end{align} which is readily evaluated for massless fermions as \cite{Murciano_2020} \begin{align} \begin{split} Z^{m=0}_{R_1,k}(\alpha)=&\f{\abs{\theta(-\ell_1+\ell_2|\tau)}^{2\left(\f{k}{n_e}-\f{\text{sgn}{(k)}}{2}+\f{\alpha}{2\pi n_e}\right)\left(\f{k}{n_e}+\f{\alpha}{2\pi n_e}\right)}}{\abs{\theta_1(\ell_1|\tau)}^{2\left(\f{k}{n_e}-\f{\text{sgn}{(k)}}{2}+\f{\alpha}{2\pi n_e}\right)\left(\f{2k}{n_e}-\f{\text{sgn}{(k)}}{2}+\f{2\alpha}{n_e}\right)}\abs{\theta_1(\ell_2|\tau)}^{2\left(\f{k}{n_e}+\f{\alpha}{2\pi n_e}\right)\left(\f{2k}{n_e}-\f{\text{sgn}{(k)}}{2}+\f{2\alpha}{n_e}\right)}}\times\\&\times \abs{\f{\theta_\nu\left[\left(\ell_2-\ell_1\right)\f{k+\alpha/2\pi}{n_e}+\ell_1\f{\text{sgn}(k)}{2}\right]}{\theta_\nu(0|\tau)}}^2\abs{\epsilon\theta'(0|\tau)}^{\Delta_{k,n}},\\ \Delta_{k,n}=&\left(\f{\text{sgn}\left(k\right)}{2}+\f{k}{n_e}+\f{\alpha}{2\pi n_e}\right)^2+\left(\f{\text{sgn}(k)}{2}+\f{2k}{n_e}+\f{\alpha}{\pi n_e}\right)^2+\left(\f{k}{n_e}+\f{\alpha}{2\pi n_e}\right)^2. \end{split} \end{align} Here we want to study the leading order massive correction using again a perturbative expansion, which mirrors the one in Section \ref{Section:massive_calculations}. This expansion is meaningful only if the mass is taken to be smaller than all the energy scales involved, i.e. $m\ll T, L^{-1}$. In this case we define the quantity $\tilde{A}_{k,n}$ as \begin{align}\tilde{A}_{k,n}= \f{\ave{e^{i\left(\phi(x)-\phi(y)\right)}\left(e^{i \left(\f{k+\alpha/2\pi}{n_e}-\f{\text{sgn}(k)}{(k+\alpha/2\pi)}\right)\phi(-\ell_1)}e^{-i \left(\f{2(k+\alpha/2\pi)}{n_e}-\f{\text{sgn}(k)}{2}\right)\phi(0)}e^{i \f{k+\alpha/2\pi}{n_e}\phi(\ell_2)}\right)}}{\ave{e^{i \left(\f{k+\alpha/2\pi}{n_e}-\f{\text{sgn}(k)}{2}\right)\phi(-\ell_1)}e^{-i \left(\f{2(k+\alpha/2\pi)}{n_e}-\f{\text{sgn}(k)}{2}\right)\phi(0)}e^{i \f{k+\alpha/2\pi}{n_e}\phi(\ell_2)}}}, \end{align} which is again a correlator of vertex operator that can be explicitly worked out. Thus, the massive correction can be written as \begin{align} \log(Z_{R_1,k}^m)\approx\log(Z_{R_1,k}^{m=0})+m^2 \int \tilde{A}_{k,n}(\alpha,x,y)-\eva{\tilde{A}_{k,n}(\alpha,x,y)}{k=\alpha=0} \d^2 x\d^2 y, \label{eq:espansionefunzionepartneg} \end{align} \begin{align} \tilde{A}_{k,n}=\abs{\left(\f{\theta_1(x+\ell_1)\theta_1(x-\ell_2)\theta_1(y)^2}{\theta_1(y+\ell_1)\theta_1(y-\ell_2)\theta_1(x)^2}\right)^\f{k+\alpha/2\pi}{n_e}\left[ \f{\theta_1(x+\ell_1)\theta_1(y)}{\theta_1(y+\ell_1)\theta_1(x)}\right]^{-\f{\text{sgn}(k)}{2}}}^2\times\nonumber\\ \times \abs{\f{\epsilon \theta'_1(0|\tau)\theta_\nu(\f{k+\alpha/2\pi}{n_e}(\ell_2-\ell_1)+\ell_1\f{\text{sgn}(k)}{2}+x-y)}{\theta_1(x-y|\tau)\theta_\nu(\f{k+\alpha/2\pi}{n_e}(\ell_2-\ell_1)+\ell_1\f{\text{sgn}(k)}{2})}}^2. \label{eq:10} \end{align} The integral in Eq. \eqref{eq:espansionefunzionepartneg}, similarly to the one in Eq. \eqref{kdependent massive correction to the partition function}, does not have any UV divergences. This expression can be analytically continued to \begin{align} \tilde{A}^{tot}_n(\alpha,x,y)=\sum_k \tilde{A}_{k,n}(\alpha,x,y)-\eva{\tilde{A}_{k,n}(\alpha,x,y)}{k=\alpha=0}, \end{align} for all values of $n_e\ge 1$. In Appendix \ref{app:resummation_negativity}, we report its explicit expression, which has been used to obtain the numerical plots. \begin{figure} \includegraphics{main-figure16.pdf} \includegraphics{main-figure17.pdf} \includegraphics{main-figure18.pdf} \includegraphics{main-figure19.pdf} \label{plot:SREEmassivecorr} \caption{Top and bottom left: massive correction to the partial transposed moment $Z_{n_e}^{R_1}(\alpha)$, for $n_e=1$, $\beta=10$, as a function of the length of the interval $A_2$, $\ell_2$. $A_1$ and $A_2$ are two adjacent intervals, where the size of $A_1$ is fixed and equal to $0.4$ (we chose the total spacial length of the system to be $L=1$ with $N=300$ sites ). The value of $\alpha$ is fixed and shown in the legend. In blue we plot the field theory prediction, in orange the lattice data. Bottom right: $\alpha$-dependence of the massive correction for the partial transposed moment. The subsystems are adjacent and their size is fixed to be $\ell_1=0.4 $ and $\ell_2=0.3$. The blue points are the field theory prediction in Eq. \eqref{eq:negtoplot}, while the solid orange line describes the lattice data. } \label{plot:dependencemassivecorrectionNeg} \end{figure} The case $n=1$, where $n$ is considered odd and not an analytic continuation from the even values, can be treated explicitly: \begin{align} I(\alpha,x,y)\equiv \f{\ave{e^{i\left(\phi(x)-\phi(y)\right)}e^{ -i \left(\Phi_\alpha+\f{\alpha}{2\pi }\right)\phi(-\ell_1)}e^{ i \left(\Phi_\alpha+\f{\alpha}{\pi }\right)\phi(0)}e^{ -i \left(\Phi_\alpha+\f{\alpha}{2\pi }\right)\phi(\ell_2)}}}{\ave{e^{ -i \left(\left(\Phi_\alpha+\f{\alpha}{2\pi }\right)\phi(-\ell_1)\right)}e^{ i \left(\Phi_\alpha+\f{\alpha}{\pi }\right)\phi(0)}e^{ -i \left(\Phi_\alpha+\f{\alpha}{2\pi }\right)\phi(\ell_2)}}},\nonumber\\ \delta(({Z}_{R_1,n=1}^m))=m^2\int \d^2 x\d^2 y \left(I(\alpha,x,y)-I(0,x,y)\right)\:, \end{align} where the phase ambiguity is fixed by the prescription\begin{align} \Phi_\alpha=\begin{cases} 0 &\abs{\alpha}\le\f{2\pi}{3},\\ -\text{sgn}{(\alpha)} &\abs{\alpha}\ge\f{2\pi}{3}, \end{cases} \end{align}as derived in Appendix \ref{ambiguity_negativity}, and the correlation function is evaluated using Eq. \eqref{eq:corrfunctiontorus}. In Figure \ref{plot:dependencemassivecorrectionNeg}, we plot the analytic continuation of \begin{align}\label{eq:negtoplot} \f{1}{Z_{R_1,n_e=1}(\alpha)}\eva{\pdv{{Z}_{R_1,n_e=1}(\alpha)^m}{m^2}}{m}\int \tilde{A}^{tot}_n \d^2 x \d^2 y. \end{align} In the first three plots, we fix the value of $\alpha$ to $\alpha=0,0.5,1$, the size of $A_1$ is $0.4 L$ and the size of $A_2$ corresponds to the $x$ axis; in the last panel, instead, we have fixed the sizes of $A_1, A_2$ and we let the value of $\alpha$ vary in the range $[-\pi,\pi]$. In every case, we compare the field theory result with the ones obtained from the lattice, fitting a mass renormalisation constant. Moreover, the evaluation of the integral in Eq. \eqref{eq:negtoplot}, performed with the Mathematica Montecarlo algorithm, is particularly challenging given the oscillations of the integrand, which may lead to small, systematic errors. We also made the assumption, for the cutoff constant $\epsilon$ in Eq. \eqref{eq:10}, to be independent on $\alpha$, which allows it to be absorbed in the definition of $\lambda$, and that may explain a small mismatch between the lattice theory and the field theory in the last plot of Figure \ref{plot:dependencemassivecorrectionNeg}. Finally, following the steps outlined in Section \ref{sec:details_neg}, one can link the charged quantities to the charge-imbalance negativity. The massive correction to the Fourier transforms can be expressed as \begin{align}\label{eq:saddlezetacalneg} \delta \mathcal{Z}_{R_1,n}(q) \equiv \eva{\pdv{\mathcal{Z}^m_{R_1,n}(q)}{m^2}}{m^2=0}=\int_{-\pi}^\pi e^{-i\alpha q} Z_{R_1,n}^{m=0}(\alpha)\int \tilde{A}^{tot}_n(\alpha,x,y)\d^2 x \d^2 y \frac{\d \alpha}{2\pi}, \end{align} while the charge-imbalance resolved negativities read \begin{align} \eva{\frac{\partial \mathcal{N}(q)}{\partial m^2}}{m=0}=\frac{1}{2}\left(\f{\delta \mathcal{Z}_{R_1,n_e=1}(q)}{\mathcal{Z}_{R_1,n_e=1}(q)}-\f{\delta \mathcal{Z}_{R_1,n=1}(q)}{\Op{Z}_{R_1,n=1}(q)}\right).\label{masscorrectionsymmresneg}\end{align} Since we are working in the regime in which the mass correction is smaller than the other inverse lengths, the correction is subleading with respect to the results found in \cite{Murciano_2021} for massless fermions, so we find again equipartition at leading order. \section{Conclusions}\label{sec:conclusion} In this manuscript, we have studied the behaviour of entanglement in systems with a conserved local charge explicitly computing both the symmetry resolved entropies and the charge imbalance resolved negativity. We first considered the 1+1 dimensional CFT of free Dirac fermions at finite temperature $T$ and finite size $L$, distinguishing the boundary conditions imposed on the fermionic field in the spacial and temporal directions. We focused on the sectors with antiperiodic conditions in the imaginary time and periodic ($\nu=2$) or antiperiodic ($\nu=3$) along the space. The other two spin sectors (i.e. $\nu=1,4$) have not been considered here, since they correspond to periodic conditions in the imaginary time, while physical fermions are required to be antiperiodic. We found that while the spin-independent part of the symmetry resolved entropies satisfies entanglement equipartition, the spin dependent term, i.e. the one related to the boundary conditions, causes a small subleading violation of equipartition. The comparisons between the analytical formulae and the exact lattice computations showed an overall very good agreement. We then moved to the massive Dirac fermions treating the mass as a perturbation of the CFT. We found that the correction due to the small mass violates equipartition, showing that, when moving away from criticality, systems tend to part from this behavior. This result generalises the findings of Ref. \cite{Murciano_2020}, in the planar limit, to the torus. As a byproduct, we have also managed to analytically continue the expression of the leading massive correction to the total R\'enyi entropies. % We also studied how the presence of the mass affects the charge imbalance resolved-negativity, always in conformal perturbation theory. Also for the negativity, the massive term breaks the equipartition. There are some aspects that our manuscript leaves open for further investigations. For example, the sum over all the possible spin sectors on the torus would lead to the symmetry resolved entanglement for the modular invariant Dirac fermion. Furthermore, our formalism strictly relies on the decoupling of the fermionic modes in the replica space, which is true only for free theories. It is natural to wonder what happens for interacting fermion (i.e. a compact boson with given compactification radius). To this aim, we could employ some of the methods developed in the literature as, e.g., in Ref. \cite{multicharged}. \section*{Acknowledgements} P.C. acknowledges support from ERC under Consolidator grant number 771536 (NEMO). SM is supported by Walter Burke Institute for Theoretical Physics at Caltech. \begin{appendix} \section{Numerical methods}\label{app:num} In this first appendix, we report how to numerically calculate the charged moments of the reduced density matrix $\rho_A$. In free lattice models, $\rho_A$ can be written as \cite{Peschel_2009,Peschel_2003,Chung_2001} \begin{equation} \rho_A=\f{1}{Z}e^{-\Op{H}},\label{effective Hamiltonian definition} \end{equation} where $\Op{H}$ is a free effective entanglement (or modular) Hamiltonian. Using the relation between the entanglement Hamiltonian and the correlation matrix restricted to the subsystem $A$, $\vec{C}$, the charged moments on the lattice $Z_n(\alpha)=\mathop{\mbox{\normalfont Tr}}\nolimits {\rho^n_Ae^{ iQ_A\alpha}}$ are \cite{Goldstein_2018, Bonsignori_2019} \begin{equation} Z_n(\alpha)=\log(\mathop{\mbox{\normalfont Tr}}\nolimits{\vec{C}^n e^{2 \pi i \alpha \vec{N}}+\left(\vec{\mathds{1}-C}\right)^n}) \end{equation} where the charge (or number) operator $\Op{N}$ distinguishes between particles and antiparticles \[\Op{N}=\sum_l f^\dagger_l f_l-g^\dagger_l g_l,\numberthis \] with $g^\dagger_l$ the creation operator for antiparticles, and $f^\dagger_l$ for particles. The entanglement Hamiltonian is also the sum of two parts which contain particles and antiparticles, respectively: \[\Op{H}=\sum_l \epsilon_l f^\dagger_lf_l+\epsilon_l g^\dagger_l g_l=\Op{H}_p+\Op{H}_a. \numberthis \] The correlation matrix is similarly divided in two blocks \[\vec{C}=\begin{pmatrix}\vec{P}&0\\0&\vec{A} \end{pmatrix} \numberthis \] since $\ave{g^\dagger f}=0$, and $\vec{P},\vec{A}$ are the particles/antiparticles restricted correlation matrices, respectively. Restricting to particles, $\vec{N}=\mathds{1}$, so that \[\log(Z^p_n(\alpha))=\mathop{\mbox{\normalfont Tr}}\nolimits{\log(e^{2\pi i \alpha\mathds{1}}\vec{P}^n+\left({1-\vec{P}}\right)^n)}, \label{symmetryresolved expressionparticles}\numberthis \] while for antiparticles, $\vec{N}=-\mathds{1}$ and \[\log(Z^a_n(\alpha))=\mathop{\mbox{\normalfont Tr}}\nolimits{\log(e^{-2\pi i \alpha\mathds{1}}\vec{A}^n+\left({1-\vec{A}}\right)^n)}. \numberthis \] Assuming we have the same number of states for particles and antiparticles (i.e. the total state is neutral): \begin{multline} \log(Z_n(\alpha))=\left[\mathop{\mbox{\normalfont Tr}}\nolimits{\log(e^{-2\pi i \alpha\mathds{1}}\vec{A}^n+\left({\mathds{1}-\vec{A}}\right)^n)}+\mathop{\mbox{\normalfont Tr}}\nolimits{\log(e^{2\pi i \alpha\mathds{1}}\vec{P}^n+\left({\mathds{1}-\vec{P}}\right)^n)}\right]=\\ \mathop{\mbox{\normalfont Tr}}\nolimits{\log(e^{-i\pi{\alpha}{}\mathds{1}}\vec{A}^n+e^{i\pi {\alpha}{}\mathds{1}}\left({\mathds{1}-\vec{A}}\right)^n)}+\mathop{\mbox{\normalfont Tr}}\nolimits{\log(e^{i\pi{\alpha}{}\mathds{1}}\vec{P}^n+e^{-i\pi{\alpha}{}\mathds{1}}\left({\mathds{1}-\vec{P}}\right)^n)}.\label{latticefermionrenyientropy} \end{multline} We now need a proper lattice discretisation of the field theory. The free (massive) fermion Lagrangian in Minkowsky space is \[\Op{L}=\int \bar{\psi}\left(i\slashed{\partial}-m \right)\psi\d x^1, \label{Minkowsky lagrangian}\numberthis \] where $\slashed{\partial}=\partial_\mu \gamma^\mu$, $\bar{\psi}=\psi^{\dagger} \gamma^0$ and the matrices $\gamma^\mu$ obey the Clifford algebra \[\{\gamma^\mu,\gamma^\nu\}=2\eta^{\mu\nu}\mathds{1} \qquad \eta^{\mu\nu}=\mathrm{diag}\begin{pmatrix}+&-\end{pmatrix}.\numberthis \] A representation of such matrices in 2D is \[\gamma^0=\sigma^1=\begin{pmatrix} 0&1\\ 1&0 \end{pmatrix}\qquad\gamma^1=-i\sigma^2=\begin{pmatrix} 0&-1\\ 1&0 \end{pmatrix}. \numberthis \] If the total length of the lattice is $L$ (in particular we set $L=1$) and we have $N$ sites, the discretisation rules are: \[\epsilon\equiv \f{L}{N}\qquad \partial_1\longrightarrow\f{1}{\epsilon}\Delta\qquad \int \d x^1\longrightarrow\epsilon \sum_j \qquad\delta(x)\longrightarrow \delta_{jk}\f{1}{\epsilon}. \numberthis \] It is also useful to rescale the fields, obtaining the canonical anticommutation relations \[\{\psi(x),\psi(y)\}=\delta(x-y)\rightarrow \{\Psi_i,\Psi_j\}=\f{\delta_{ij}}{\epsilon}\implies \{\psi_i,\psi_j\}={\delta_{ij}}\qquad \psi_i\equiv\Psi_i \sqrt{\epsilon}. \numberthis \] Then, the discretised Lagrangian is \[\f{1}{\epsilon}\sum_j {\psi}_j^\dagger\left(i\partial_0\epsilon-m\epsilon\sigma^1 \right)\psi_j+\frac{1}{2}\psi_j^\dagger i\sigma^3\psi_{j+1}-\frac{1}{2}\psi_{j+1}^\dagger i\sigma^3\psi_j. \numberthis \] In order to get the Hamiltonian, we perform a Legendre transformation, which yields \[ H=\f{1}{\epsilon}\sum_j^N\frac{1}{2}\left(\psi_{j+1}^\dagger i\sigma^3\psi_j-\psi_j^\dagger i\sigma^3\psi_{j+1}\right)+m \epsilon \psi^\dagger_{j} \sigma^1 \psi_j.\label{discretized Dirac Hamiltonian}\numberthis \] Being the Hamiltonian quadratic, it can be explicitly diagonalised. In particular, we can notice it is invariant under translations $j\rightarrow j+1$, so the eigenvectors are of the form (with $\nu_1=0,\frac{1}{2}$ corresponding to periodic or antiperiodic spacial fermions, respectively, and with Greek letters for spinor indices): \[f^\alpha_{k,n}=\sum_{j,\beta} \f{1}{\sqrt{N}}e^{\f{2\pi i (k-\nu_1)j}{N}}\tensor{\left(\Op{M}^{-1}\right)}{^\alpha^\beta}\psi_j^\beta \numberthis \] This relation can be inverted \begin{equation} {\psi_j}^\alpha=\sum_{\beta\in\{1,2\},k=1}^{N}\f{1}{\sqrt{ N}}\tensor{\Op{M}}{^\alpha^\beta} e^{-\f{2\pi i (k-\nu_1)j}{N}}f^\beta_{k,n} .\label{field operators diagonalized}\end{equation} Plugging it into the Hamiltonian \eqref{discretized Dirac Hamiltonian}, the diagonalisation reads \begin{equation} \tan(\theta)\equiv\f{m\epsilon}{\sin(\f{2\pi (k-\nu_1)}{N})}\implies\left(\Op{M}\right)^{\pm 1}=\cos(\f{\theta}{2})\mathds{1}\pm i\sin(\f{\theta}{2})\sigma_2\label{matrixchangeofbasis}\end{equation} The energy eigenvalues are \cite{Herzog_2013} \[\epsilon_{\pm,k}=\pm\sqrt{m^2+\f{\sin(\f{2\pi (k-\nu_1)}{N})^2}{\epsilon^2}}\label{eigenvalues} \numberthis \] where the negative eigenvalues physically represent the annihilation of antiparticles. As noted in \cite{Herzog_2013}, in Eq. \eqref{eigenvalues}, the eigenvalues $\epsilon_{\pm,k}$ are equal to the $\epsilon_{\pm,N-k}$ (this is true for $\nu_1=0$, in the antiperiodic case $\nu_1=1/2$ the correspondence is $k\leftrightarrow N-k+1$) and so a doubling problem is present. We simply fix the doubling problem by dividing the final result by two. The correlator of a Dirac field includes both particles and antiparticles: \[\ave{f^\dagger_k f_q}=\f{\delta_{kq}}{1+e^{\epsilon_k}}, \qquad\ave{g_k g^\dagger_q}=\delta_{kq}-\ave{g^\dagger_q g_k}=\delta_{kq}-\f{\delta_{kq}}{1+e^{\epsilon_k}},\qquad \ave{g_k f_q}=\ave{g^\dagger_k f^\dagger_q}=0, \numberthis \] and the implicit form of the correlation matrix of the Dirac field is \begin{multline}\label{finalformlatticecorr} \vec{C}_{(l,\alpha),(m,\beta)}\equiv\ave{{\psi_l^\alpha}^\dagger{\psi_m^\beta}}=\\ =\sum_k \f{e^{\f{2\pi i (k-\nu_1)(l-m)}{N}}}{{N}}\left[ {(\Op{M}^{\alpha+})}^*(k)\Op{M}^{\beta+}(k)\ave{f_k^\dagger f_k }+\ave{g_k g^\dagger_k} {(\Op{M}^{\alpha-})}^*(k)\Op{M}^{\beta-}(k)\right]. \end{multline} This shows that the spinor indices in the correlation matrix $\psi^\dagger\psi$ contain the particle correlation function $P_{lm}$, and the matrix $\ave{g_m g^\dagger_l}=\left(\mathds{1}-\vec{A}\right)_{ml}$. Using Eq. \eqref{latticefermionrenyientropy}, we get \begin{equation} Z_n(\alpha)=\frac{1}{2} \left[\mathop{\mbox{\normalfont Tr}}\nolimits{\log(e^{i\pi{\alpha}{}\mathds{1}}\vec{C}^n+e^{-i\pi{\alpha}{}\mathds{1}}\left({\mathds{1}-\vec{C}}\right)^n)}\right], \label{fermionlatticemoments} \end{equation} where the $\frac{1}{2}$ factor has been inserted to cure of the doubling problem. Using Eq. \eqref{finalformlatticecorr}, we can now compute $\vec{C}$ explicitly. The correlators in the eigenstate basis are \[\ave{{f^{\alpha}_l}^\dagger f^{\beta}_m}=\frac{1}{2}\left(\mathds{1}+\sigma_3\tanh(\f{\epsilon_k}{2})\right)\qquad f^+_k=f_k\qquad f^-_k=g^\dagger_k \numberthis \] By plugging the explicit form of $\Op{M}$ \eqref{matrixchangeofbasis} into Eq. \eqref{finalformlatticecorr}, we get \begin{equation} C_{jh}=\sum_k \f{e^{\f{2\pi i (k-\nu_1)(j-h)}{N}}}{2N}\left(\mathds{1}+\f{\sin(\f{2\pi i (k-\nu_1)}{N})\sigma_3+m\epsilon\sigma_1}{\sqrt{\sin(\f{2\pi i (k-\nu_1)}{N})^2+(m\epsilon)^2}}\tanh(\f{\beta\epsilon_k}{2})\right). \label{correlation matrix, massive case} \end{equation} In the massless case we have instead \cite{Herzog_2013} \begin{equation} C_{jh}=\sum_k \f{e^{\f{2\pi i (k-\nu_1)(j-h)}{N}}}{2N}\left(\mathds{1}+{\text{sgn}\left(\sin(\f{2\pi i (k-\nu_1)}{N})\right)\sigma_3}\tanh(\f{\beta\epsilon_k}{2})\right). \label{correlation matrix, massless case} \end{equation} Moreover, there is an additional subtlety in the choice of $N$: as noted in \cite{Herzog_2013}, for $N$ odd we end up with two copies of the system (which are due to the doubling problem), of opposite spacial periodicity. In order to only have one fixed boundary condition, the simplest solution is to limit ourselves to take $N$ even. \subsection{Fermionic negativity}\label{sec:numerics_negativity} We want now to compute the entanglement negativity for the same system of lattice free fermions. We switch to the Majorana fermion operators $c_{i,\alpha}$: \begin{align} c_{2i-1,\alpha}=f_{i,\alpha}+f_{i,\alpha}^\dagger\qquad c_{2i,\alpha}=i\left(f_{i,\alpha}-f_{i,\alpha}^\dagger\right) \end{align} Any operator can be expressed as a sum of string of Majoranas, in the form \begin{align} \rho=\sum_{k \text{ even}}\sum_{\{a_i\}_{i=1}^k}\rho_{\{a_i\}} c_{a_1}c_{a_2}\ldots c_{a_2}. \end{align} We took the string length to be even, which is a constraint for theories conserving the parity fermion number operator. Following \cite{Murciano_2021}, we consider the covariance matrix $\Gamma$, that can be expressed as $\sigma_2\otimes (\mathds{1}-2 C)\equiv \sigma_2\otimes \Gamma$, with $C$ being the correlation matrix \eqref{correlation matrix, massive case}. Our total system is bipartite into $A,B$, and we want to compute the entanglement between two parts of $A$, which are $A_1, A_2$. The reduced covariance matrix on $A$ takes the block form \begin{align} \Gamma=\begin{pmatrix} \Gamma_{AA} & \Gamma_{AB}\\ \Gamma_{BA} & \Gamma_{BB}\\ \end{pmatrix}. \end{align} Under partial transposition, we find the correlation matrices associated to $\rho^{R_1}$, ${\rho^{R_1}}^\dagger$, which we call $\Gamma_{\pm}$\begin{align} \Gamma_\pm=\begin{pmatrix} -\Gamma_{AA} & \pm i\Gamma_{AB}\\ \pm i\Gamma_{BA} & \Gamma_{BB}\\ \end{pmatrix}. \end{align} We also introduce \begin{equation}\label{eq:gammax} \Gamma_{\mathrm{x}}=(\mathbbm{1}+\Gamma_+\Gamma_-)^{-1}(\Gamma_++\Gamma_-). \end{equation} Finally, with the eigenvalues of $\Gamma_{\mathrm{x}}$ and $C$, which we call $\nu_i$ and $\zeta_i$, respectively we can express the even charged moments of the partial transposed density matrix, as\begin{multline} \log(N_{n_e})=\\-i\alpha\f{\ell_1+\ell_2 }{2}+\sum_j\log\left[\left(\f{1-\nu_j}{2}\right)^\f{n}{2}+\left(\f{1+\nu_j}{2}\right)^\f{n}{2} e^{i\alpha}\right]+\f{n}{2}\sum_j \log\left[\zeta^2+(1-\zeta_j)^2\right]. \end{multline} We also need the charged normalisation $N_1$, which can be written in terms of the eigenvalues of $\Gamma_+$, $\nu^+_j$, as \cite{Murciano_2021} \begin{align} \log(N_1)=-i\alpha\f{\ell_1+\ell_2}{2}+\sum_j\log\left[\left(\f{1-\nu^+_j}{2}\right)+e^{i\alpha}\left(\f{1+\nu^+_j}{2}\right)\right]. \end{align} \section{Flux strength ambiguity}\label{fluxambiguity} As observed in Ref. \cite{Shapourian_2019}, Eq. \eqref{Gaugefield definition} is actually ambiguous, since we can add an integer number of $2\pi$ flux caused by the gauge field $A_\mu$, such that \[\f{k+\alpha/2\pi}{n}\rightarrow\f{k+\alpha/2\pi}{n}+m, \qquad m\in \mathbb{N}, \numberthis \] without affecting the monodromy of the fermion fields. The partition function $Z_k$ must preserve this symmetry, so the correct form of the partition function is a combination of all the possible \emph{inequivalent} representations each corresponding to a different value of $m$. Without losing generality, we suppose to compute the correlation functions of $p$ vertex operators with phases $h_i$, respecting the neutrality condition\begin{align} \sum_i h_i=0. \end{align} We call $m_i$ the integer addition to the flux, which must respect the neutrality $\sum_i m_i=0$, too. The most general partition function is a combination of all the choices of $\{m_i\}_{i=1,\ldots,p}$\begin{equation} \begin{split} Z=&\sum_{\{m_i\}} C_{\{m_i\}}\ave{\prod_i e^{\left(h_i+m_i\right)\phi(x_i)}}=\\=&\sum_{\{m_i\}} C_{\{m_i\}} \abs{\f{\abs{\theta_{\nu}(\sum_{i}\left(h_i+m_i\right)x_i|\tau)}}{\theta_\nu(0|\tau)}}^2\abs{\prod_{i<j}\f{\epsilon\partial_x \eva{\theta_1(x|\tau)}{x=0}}{\theta_1(x_i-x_j)}}^{-2 (h_i+m_i)(h_j+m_j)}. \end{split} \label{robba} \end{equation} In the end, we want to test our field theoretical predictions against the numerical results for the theory defined on a lattice. This implies that the cutoff behaves as $\epsilon\propto a$, where $a=\frac{L}{N}$ is the lattice spacing, given by the ratio between the total spacial lenght of the torus, which we set $L=1$ in Appendix \ref{app:num}, and the number of lattice sites. This can be seen by either a dimensional argument, or by noting that, if we compute on the lattice the correlation function of two vertex operators, we find \begin{align} \ave{e^{i\alpha \phi(0)}e^{-i\alpha \phi(a)}}\sim 1 \end{align} because the two opposite vertex operators almost overlap on the lattice. Field theory would predict, instead \begin{align} \ave{e^{i\alpha \phi(0)}e^{-i\alpha \phi(a)}}=\abs{\f{\theta_\nu(\alpha a|\tau)}{\theta_\nu(0|\tau)}}^2\abs{\f{\epsilon \theta'_1(0|\tau)}{ \theta_1(a|\tau)}}^{2\alpha^2}=\abs{\f{\epsilon \theta'_1(0|\tau)}{ a\theta_1'(0|\tau)}+o(a^2)}^{2\alpha^2} , \end{align} where we have done an expansion at the lowest order in $a$. Comparing the two expressions we get $\epsilon\sim a$. Going back to Eq. \eqref{robba}, we focus on the $\epsilon$ factor, which is: \begin{align} \prod_{i<j}\epsilon^{-2(h_i+m_i)(h_j+m_j)}=\left(\f{\prod_{i,j}\epsilon^{-2(h_i+m_i)(h_j+m_j)}}{\prod_{i}\epsilon^{-2(h_i+m_i)^2}}\right)^\frac{1}{2}=\epsilon^{(h_i+m_i)^2}, \end{align} where we used the neutrality condition $\prod_i \epsilon^{-2(h_i+m_i)}=1$. In the limit $\epsilon\sim a\ra0$ the leading term in \eqref{robba} will be the one minimising the exponent of $\epsilon$, which is $\sum_i(h_i+m_i)^2$. \subsection{Entanglement entropy} In the entanglement entropy calculations, rewriting the partition function in Eq. \eqref{partitionfunctiondefinition} as \begin{equation} Z_k=\ave{\prod_j\exp( i\left(\f{k+\alpha/(2\pi)}{n}+{m}_a \right)\phi(u_j,0))\exp( i\left(-\f{k+\alpha/(2\pi)}{n}+\bar{m}_a \right)\phi(v_j,0))},\label{rewritten partition function definition}\end{equation} the neutrality condition of vertex operators imposes \begin{equation}\sum_a m_a+\bar{m}_a=0.\label{neutrality condition extra fluxes}\end{equation} This factor is maximised by the following choices: \begin{equation} \begin{split}\label{alphacondition} \bar{m_i}=-m_i,\quad \Big |\f{k+{\alpha}/({2\pi})}{n}+{m}_a \Big |<\frac{1}{2}. \end{split} \end{equation} Since $n\ge 1$, $|k|\le \f{n-1}{2}, |\alpha|\le \pi,$ we have that $ |\f{k+\alpha/(2\pi)}{n}|<\frac{1}{2},$ thus all the dominant $m_a$'s have to be $0$. This justifies retrospectively our calculations, and also predicts a worse agreement with the lattice computations for $|\alpha|\approx \pi$, where the power law suppression with $\epsilon^{2\left(\f{k+\alpha/2\pi}{n}\right)^2}$ is much weaker and contested by a $m=-1$ flux, for example with a term of the form $\sim \epsilon^{2\left(\f{k+\alpha/2\pi}{n}-1\right)^2}$. Thus, when plotting the $\alpha$ dependence of the charged moments, we expect a worse agreement at the edges of the figure (as can be well seen in Figs. \ref{diffnu2}-\ref{plot:alphadependencechargedmoments}). Similar conclusions were also drawn in \cite{Bonsignori_2019}, where the subleading corrections were found to be comparable to the dominant ones around the edges $\alpha=\pm \pi$. \subsection{Fermionic negativity}\label{ambiguity_negativity} For the negativity in the tripartite geometry, the partition function has, in general, the form \begin{align} Z_{R_1,k}=\ave{e^{- i \left(\frac{1}{2}+m_1+\f{k}{n_e}+\f{\alpha}{2\pi n_e}\right)\phi(-\ell_1)}e^{ i \left(\frac{1}{2}+m_1+m_2+\f{2k}{n_e}+\f{\alpha}{\pi n_e}\right)\phi(0)}e^{- i \left(m_2+\f{k}{n_e}+\f{\alpha}{2\pi n_e}\right)\phi(\ell_2)}}, \end{align} for $n=n_e$ even. As before, we need to minimise the sum\begin{align} \left(m_1+\frac{1}{2} +\f{k}{n_e}+\f{\alpha}{2\pi n_e}\right)^2+ \left(\f{2k}{n_e}+\frac{1}{2}+\f{\alpha}{\pi n_e}+m_1+m_2\right)^2+ \left(m_2+\f{k}{n_e} +\f{\alpha}{2\pi n_e}\right)^2, \end{align} where we already imposed the neutrality condition for the extra fluxes $m_a$. When $k+\f{\alpha}{2\pi}\ge0$ we need to require $m_1=-1$, i.e. $m_2=1$, while, in the remaining case, $m_1=0$ ($m_2=0$). The lowest positive value of $k$ we can take is $k=\f{n_e-1}{2}=\f{1}{2}\ge\f{\alpha}{2\pi}$, since $\alpha\in[-\pi,\pi]$. This implies $\text{sgn}(k+\f{\alpha}{2\pi})=\text{sgn}(k)$, leading to the correct expression:\begin{align} Z_{R_1,k}\sim\ave{e^{- i \left(-\f{\text{sgn}\left({k}\right)}{2}+\f{k}{n_e}+\f{\alpha}{2\pi n_e}\right)\phi(-\ell_1)}e^{ i \left(\f{\text{sgn}\left({k}\right)}{2}+\f{2k}{n_e}+\f{\alpha}{\pi n_e}\right)\phi(0)}e^{- i \left(\f{k}{n_e}+\f{\alpha}{2\pi n_e}\right)\phi(\ell_2)}}.\label{flux-corrected_correlator} \end{align} Additionally, in the $n=1$ case, we need to consider \begin{align} Z_{R_1,n=1}=\ave{e^{- i \left(m_1+\f{\alpha}{2\pi }\right)\phi(-\ell_1)}e^{ i \left(m_1+m_2+\f{\alpha}{\pi }\right)\phi(0)}e^{- i \left(m_2+\f{\alpha}{2\pi }\right)\phi(\ell_2)}}. \end{align} The quantity \begin{align} \left(m_1+\f{\alpha}{2\pi }\right)^2+ \left(\f{\alpha}{\pi }+m_1+m_2\right)^2+ \left(m_2 +\f{\alpha}{2\pi }\right)^2, \end{align} is minimised, if $\abs{\alpha}\le \f{2\pi}{3}$, for the value $m_1=m_2=0$, while, in the remaining cases, for either $(m_1,m_2)=(-\text{sgn}(\alpha),0),(0,-\text{sgn}(\alpha))$. \section{Saddle point approximation in the massless case}\label{app:saddlepoint} In the limit of the cutoff $\epsilon$ going to $0$, the leading order for the alpha dependence of the logarithm of the charged moments is \begin{align} \log(Z_n(\alpha))\approx \log(Z_n(\alpha=0))+\frac{\alpha^2}{2\pi^2 n}\log(\epsilon)+O(\epsilon^0). \end{align} This allows us to perform an expansion around $\alpha^2=0$ in order to obtain the leading order contribution from the other terms, as has been done in Eq. \eqref{eq:saddlepoint expansion}. The coefficients are obtained by expanding Eqs. \eqref{eq:chm}, \eqref{eq:nu2spindeppart}, \eqref{eq:nu3spindeppart}: \begin{align} \begin{split} b^{\nu=2}_n\equiv &-\f{1}{ \pi^2 n}\log\left(\f{\prod_{a<b}\theta_1(\f{u_a-u_b}{i\beta}|-\f{1}{\tau}=\f{i}{\beta})\theta_1(\f{v_a-v_b}{i\beta}|-\f{1}{\tau}=\f{i}{\beta})}{\prod_{a,b}\theta_1(\f{u_a-v_b}{i\beta}|-\f{1}{\tau}=\f{i}{\beta})}\left(\f{ \epsilon\partial_z \theta_1(0|\tau)}{ i\beta }\right)^p\right)+\\&+2\sum_{m \ge 1} \left(\f{ r}{ n\beta}\right)^2\f{m}{2\sinh(\f{\pi m L}{\beta} )}\left({\f{\sinh{\f{\pi r m}{\beta}}}{\sinh{\f{\pi r m }{\beta n}}}}\right)+p\frac{1-n^2}{6n\epsilon}\eva{\pdv[2]{\epsilon(n,\alpha)}{\alpha}}{\alpha=0},\label{divergnu3}\\ b^{\nu=3}_n\equiv& -\f{1}{\pi^2 n}\log\left(\f{\prod_{a<b}\theta_1(\f{u_a-u_b}{i\beta}|-\f{1}{\tau}=\f{i}{\beta})\theta_1(\f{v_a-v_b}{i\beta}|-\f{1}{\tau}=\f{i}{\beta})}{\prod_{a,b}\theta_1(\f{u_a-v_b}{i\beta}|-\f{1}{\tau}=\f{i}{\beta})}\left(\f{ \epsilon\partial_z \theta_1(0|\tau)}{ i\beta }\right)^p\right)+\\&+2\sum_{m \ge 1} (-1)^m \left(\f{r}{ n\beta}\right)^2\f{m}{\sinh(\f{\pi m L}{\beta} )}\left({\f{\sinh{\f{\pi r m}{\beta}}}{\sinh{\f{\pi r m }{\beta n}}}}\right)+p\frac{1-n^2}{6n\epsilon}\eva{\pdv[2]{\epsilon(n,\alpha)}{\alpha}}{\alpha=0}, \\ A_n=&{\Big|\f{\prod_{j<k}\theta_1(u_j-u_k|\tau)\theta_1(v_j-v_k|\tau)}{\prod_{j,k}\theta_1(u_j-v_k|\tau)}(\epsilon \partial_z \theta_1(0|\tau))^p\Big|}^\f{n^2-1}{6n}\\ &\times\exp{2\sum_{m=1}^\infty \f{1}{m\sinh(\f{\pi m L }{\beta})} \left(n-\f{\sinh(\f{\pi m r}{\beta })}{\sinh(\f{\pi m r}{\beta n})}\right)}. \end{split} \end{align} \section{Analytical continuation of the symmetry resolved entanglement entropy } \label{analytical_sum_ssEE} Here we report the details for the analytical continuation of the symmetry resolved entanglement in the massive fermionic theory for any real values of $n$. This is the main step to take the replica limit $n \to 1$. \subsection{$\nu=2$ spin sector} A modular transformation of Eq. \eqref{kdependent massive correction to the partition function} leads to \begin{multline} A_{k,n}=\left|\f{\theta_{\nu'}\left(\f{(k+\alpha/2\pi) r}{i\beta n}+\f{x-y}{i\beta}|-\f{1}{\tau}\right)}{\theta_{\nu'}\left(\f{(k+\alpha/2\pi) r}{i\beta n}|-\f{1}{\tau}\right)}\f{\epsilon\partial_z\theta_1\left(0|-\f{1}{\tau}\right)}{\beta \theta_1\left(\f{x-y}{i\beta}|-\f{1}{\tau}\right)}\right|^2\\ \times \prod_a\left|\f{\theta_1\left(\f{v_a-x}{i\beta}|-\f{1}{\tau}\right)\theta_1\left(\f{u_a-y}{i\beta}|-\f{1}{\tau}\right)}{\theta_1\left(\f{v_a-y}{i\beta}|-\f{1}{\tau}\right)\theta_1\left(\f{u_a-x}{i\beta}|-\f{1}{\tau}\right)}\right|^\f{2(k+\alpha/2\pi)}{n},\label{modular transformed mass correction} \end{multline} with $\nu'=4$, since $\nu=2$. The resummation can be carried out rewriting $A_{k,n}$ with the following identity, \cite{whittaker_watson_1996} \begin{equation}\label{whittakerformula} \f{\theta_1(x+y|\tau)\theta_1'(0|\tau)}{\theta_1(x|\tau)\theta_1(y|\tau)}=\pi(\cot(y\pi)+\cot(x\pi)+4\sum_{m,n=0}^\infty e^{2mni\pi \tau}\sin(2\pi(mx+ny))), \end{equation} combined with the quasiperiodicity relation \begin{equation}\jacobitheta{4}{z}{\tau}=i e^{-i\pi z} e^{\f{i\pi\tau}{4}}\jacobitheta{1}{z-\f{\tau}{2}}{\tau}. \end{equation} $A_{k,n}$ is rewritten as \begin{equation} \begin{split} \sqrt{ A_{k,n}} &= \f{\epsilon}{\beta}e^{-\pi \f{ \Re{x-y} }{\beta}}e^{\f{\Phi(k+\alpha/(2\pi) )}{n}}\left|\coth({\f{x-y}{\beta}}{\pi})+\coth(\f{\pi}{\beta}{}\left(\f{(k+\alpha/(2\pi) ) r}{n}+\frac{1}{2}\right))+\right.\nonumber\\ &\left.-4 \sum_{m,l=1}^{\infty} e^{-\f{2ml \pi}{\beta}}\sinh(\f{2\pi}{\beta } \left(m (x-y)+ l\left(\f{(k+\alpha/(2\pi) ) r}{n}+\frac{1}{2}\right) \right))\right|. \label{nu2 expression to sum} \end{split} \end{equation} and \begin{equation} \Phi(x,y) \equiv\log\left(\prod_a|\f{\theta_1\left(v_a-x|\tau\right)\theta_1\left(u_a-y|\tau\right)}{\theta_1\left(v_a-y|\tau\right)\theta_1\left(u_a-x|\tau\right)}|\right). \label{def:phifunction} \end{equation} When Eq. \eqref{nu2 expression to sum} is squared, we get $6$ terms that we can index schematically as $K_i$ \[\sum_k A_{k,n}= \f{\epsilon^2}{\beta^2}e^{-2\pi \f{ \Re{x-y} }{\beta}}\sum_{k=-\f{n-1}{2}}^{\f{n-1}{2}}\left(|K_1|^2+|K_2|^2+|K_3|^2+2 \Re{K_1^*K_2+K_2^*K_3+K_1^*K_3}\right), \numberthis\] where $i\in\{1,2,3\}$: \begin{align} K_1=&e^{\f{\Phi(k+\alpha/(2\pi) )}{n}} \coth({\f{x-y}{\beta}}{\pi}),\label{def:K1}\\ K_2=&e^{\f{\Phi(k+\alpha/(2\pi) )}{n}} \coth(\f{\pi}{\beta}{}\left(\f{(k+\alpha/(2\pi) ) r}{n}+\frac{1}{2}\right)),\label{def:K2}\\ K_3=&-4e^{\f{\Phi(k+\alpha/(2\pi) )}{n}} \sum_{m,l=1}^{\infty} e^{-\f{2ml \pi}{\beta}}\sinh(\f{2\pi}{\beta } \left(m (x-y)+ l\left(\f{(k+\alpha/(2\pi) ) r}{n}+\frac{1}{2}\right) \right)).\label{def:K3} \end{align} We sum in $k$ each addendum in this equation separately, labelling the results as $\gamma_{ij}$: \[\gamma_{ii}\equiv\sum_{k=-\f{n-1}{2}}^{\f{n-1}{2}}|K_i|^2\qquad\gamma_{ij}\equiv2\sum_{k=-\f{n-1}{2}}^{\f{n-1}{2}} \Re{K_iK_j^*}\qquad j\ne i\qquad i,j=1,2,3.\label{Eq:sumoverk} \numberthis\] Finally, we follow the prescription in Eq. \eqref{eq:rego}, which amounts to change the $\gamma$s as\begin{align} \gamma^{reg}=\gamma_{ij}-\gamma_{ij}(\alpha=0, r=0), \end{align} so that the final result is written as\begin{align} A^{tot}_n=\f{\epsilon^2}{\beta^2}e^{-2\pi \f{ \Re{x-y} }{\beta}}\sum_{i,j}\gamma^{reg}_{ij}. \end{align} The analytic continuation in $n$ of expressions \eqref{Eq:sumoverk} can be found since every term in Eqs. \eqref{def:K1}, \eqref{def:K2}, \eqref{def:K3} can be expressed as a convergent sum of exponentials, for the range of parameters we are interested in. In particular, we can rewrite the $\coth$ function with the identity:\begin{align} \coth(x)=\text{sign}(x)\left(1+2\sum_{m=1}^{\infty} e^{-2 m\abs{x}}\right). \label{coth expansion} \end{align} Using this fact, we can reduce the sum over $k$ in \eqref{Eq:sumoverk} to a geometric series with a trivial analytic continuation. We now report the final expressions found using this approach: \[\gamma_{11}=\f{\sinh({\Phi })}{\sinh(\f{\Phi}{n})} e^{\f{\Phi\alpha }{\pi n}}\abs{ \coth(\f{x-y}{\beta}\pi)}^2 \numberthis \] \[\gamma_{12}=2 \Re{\coth(\f{x-y}{\beta}\pi)}e^{\f{\Phi \alpha }{\pi n}}\left(\f{\sinh(\Phi)}{\sinh(\f{\Phi}{n})}+2\sum_{m=1}^\infty e^{-\f{2\pi m}{\beta}\left(\f{\alpha r}{2\pi n}+\frac{1}{2}\right)}\f{\sinh(\Phi-\f{\pi m r}{\beta})}{\sinh(\f{1}{n}\left({\Phi-\f{\pi m r}{\beta}}\right))}\right).\numberthis \] \[\gamma_{22}=e^{\f{\Phi \alpha }{\pi n}}\left(\f{\sinh{\Phi }}{\sinh(\f{\Phi}{n})}+4\sum_{m=1}^\infty m e^{-\f{2\pi m}{\beta}\left(\f{\alpha r}{2\pi n}+\frac{1}{2}\right)}\f{\sinh(\Phi-\f{\pi m r}{\beta})}{\sinh(\f{1}{n}\left({\Phi-\f{\pi m r}{\beta}}\right))}\right). \numberthis \] \[\gamma_{33}={\gamma_{33}^{++}+\gamma_{33}^{--}}-2 \Re{\gamma_{33}^{-+}}. \numberthis \] \[\gamma_{13}=-4 \Re{\coth(\f{\bar{x}-\bar{y}}{\beta})\Sigma_{13}\exp(\f{\alpha \Phi}{\pi n})}, \numberthis \] \[\gamma_{23}=-4\left(\Sigma_{13}+2 \Sigma_{23}\right)\exp(\f{\alpha \Phi}{\pi n}), \numberthis \] We used the following auxiliary expressions: \begin{align} \gamma_{33}^{++}= 4 e^{\f{\Phi \alpha }{\pi n}} \sum_{l,q=1}^{\infty} \exp(\f{2\pi}{\beta } (l+q){}\left(\frac{1}{2}+\f{\alpha r}{2\pi n}\right))\f{\sinh(\Phi+\f{\pi(l+q)r}{\beta})}{\sinh({\f{\Phi}{n}+\f{\pi(l+q)r}{n\beta}})}\times\nonumber\\\times\f{1}{\exp(\f{2\pi}{\beta}(l-x+y))-1}\f{1}{\exp(\f{2\pi}{\beta}(q-\bar{x}+\bar{y}))-1}, \end{align} \begin{align} \gamma_{33}^{--}= 4 e^{\f{\Phi \alpha }{\pi n}}\sum_{l,q=1}^{\infty} \exp(-\f{2\pi}{\beta } (l+q){}\left(\frac{1}{2}+\f{\alpha r}{2\pi n}\right))\f{\sinh(\Phi-\f{2\pi(l+q)r}{\beta})}{\sinh({\f{\Phi}{n}-\f{2\pi(l+q)r}{n\beta}})}\times\nonumber\\\times\f{1}{\exp(\f{2\pi}{\beta}(l+x-y))-1}\f{1}{\exp(\f{2\pi}{\beta}(q+\bar{x}-\bar{y}))-1}, \end{align} \begin{align} \gamma_{33}^{-+}=4 e^{\f{\Phi \alpha }{\pi n}}\sum_{l,q=1}^{\infty} \exp(-\f{2\pi}{\beta } (l-q){}\left(\frac{1}{2}+\f{\alpha r}{2\pi n}\right))\f{\sinh(\Phi-\f{2\pi(l-q)r}{\beta})}{\sinh({\f{\Phi}{n}-\f{2\pi(l-q)r}{n\beta}})}\times\nonumber\\\times\f{1}{\exp(\f{2\pi}{\beta}(l+x-y))-1}\f{1}{\exp(\f{2\pi}{\beta}(q-\bar{x}+\bar{y}))-1} , \end{align} \begin{equation}\label{eq::sigma13}\begin{gathered} \Sigma_{13}= \sum_{l=1}^{\infty}\left( e^{\f{\pi \left(2r\alpha/(2\pi) +n\right) l}{\beta n}}\f{\sinh(\Phi+\f{\pi l r}{\beta})}{\sinh(\f{\Phi}{n}+\f{\pi l r }{\beta n})}\f{1}{\exp(\f{2\pi}{\beta}(l-x+y))-1}+\right.\\\left.-e^{-\f{\pi \left(2r\alpha/(2\pi) +n\right) l}{\beta n}}\f{\sinh(\Phi-\f{\pi l r}{\beta})}{\sinh(\f{\Phi}{n}-\f{\pi l r }{\beta n})}\f{1}{\exp(\f{2\pi}{\beta}(l+x-y))-1}\right),\end{gathered}\end{equation} \begin{align}\begin{gathered} \Sigma_{23}= \sum_{l,p=1}^{\infty} e^{\f{\pi \left(2r\alpha/(2\pi) +n\right) (l-p)}{\beta n}}\f{\sinh(\Phi+\f{\pi (l-p) r}{\beta})}{\sinh(\f{\Phi}{n}+\f{\pi (l-p) r }{\beta n})}\f{1}{\exp(\f{2\pi}{\beta}(l-x+y))-1}\\-e^{-\f{\pi \left(2r\alpha/(2\pi) +n\right) (l+p)}{\beta n}}\f{\sinh(\Phi-\f{\pi (l+p) r}{\beta})}{\sinh(\f{\Phi}{n}-\f{\pi (l+p) r }{\beta n})}\f{1}{\exp(\f{2\pi}{\beta}(l+x-y))-1}.\end{gathered} \end{align} \subsection{$\nu=3$ spin sector}\label{nu=3 massive case resummation} Similar calculations can be carried out in this spin sector $\nu=3$. We can write again: \begin{align} A^{tot}_n=\frac{\epsilon^2}{\beta^2} e^{-\frac{2\pi \Re{x-y}}{\beta}} \sum_{i,j}\gamma^{reg}_{ij}. \end{align} We use again expression \eqref{def:phifunction} for $\Phi$, while we need to modify those for $\gamma_{ij}$ in this spin sector, as following:\[\gamma_{11}=\f{\sinh({\Phi })}{\sinh(\f{\Phi}{n})} e^{\f{\Phi\alpha }{\pi n}}\abs{ \coth(\f{x-y}{\beta}\pi)}^2, \numberthis \] \begin{equation} \gamma_{12}=2 \Re{\coth(\f{x-y}{\beta}\pi)}e^{\f{\Phi \alpha }{\pi n}}\left(\f{\sinh(\Phi)}{\sinh(\f{\Phi}{n})}+2\sum_{m=1}^\infty(-)^m e^{-\f{2\pi m}{\beta}\left(\f{\alpha r}{2\pi n}+\frac{1}{2}\right)}\f{\sinh(\Phi-\f{\pi m r}{\beta})}{\sinh(\f{1}{n}\left({\Phi-\f{\pi m r}{\beta}}\right))}\right),\numberthis \end{equation} \[\gamma_{22}=e^{\f{\Phi \alpha }{\pi n}}\left(\f{\sinh{\Phi }}{\sinh(\f{\Phi}{n})}+4\sum_{m=1}^\infty(-)^m m e^{-\f{2\pi m}{\beta}\left(\f{\alpha r}{2\pi n}+\frac{1}{2}\right)}\f{\sinh(\Phi-\f{\pi m r}{\beta})}{\sinh(\f{1}{n}\left({\Phi-\f{\pi m r}{\beta}}\right))}\right) ,\numberthis \] \[\gamma_{13}=-4 \Re{\coth(\f{\bar{x}-\bar{y}}{\beta})\Sigma_{13}\exp(\f{\alpha \Phi}{\pi n})}, \numberthis \] \[\gamma_{23}=-4\left(\Sigma_{13}+2 \Sigma_{23}\right)\exp(\f{\alpha \Phi}{\pi n}), \numberthis \] \[\gamma_{33}={\gamma_{33}^{++}+\gamma_{33}^{--}}-2 \Re{\gamma_{33}^{-+}} .\numberthis \] The auxiliary expressions used are \begin{align} \gamma_{33}^{++}= 4 e^{\f{\Phi \alpha }{\pi n}} \sum_{l,q=1}^{\infty} (-)^{l+q}\exp(\f{2\pi}{\beta } (l+q){}\left(\frac{1}{2}+\f{\alpha r}{2\pi n}\right))\times\nonumber\\\times\f{\sinh(\Phi+\f{\pi(l+q)r}{\beta})}{\sinh({\f{\Phi}{n}+\f{\pi(l+q)r}{n\beta}})}\f{1}{\exp(\f{2\pi}{\beta}(l-x+y))-1}\f{1}{\exp(\f{2\pi}{\beta}(q-\bar{x}+\bar{y}))-1}, \end{align} \begin{align} \gamma_{33}^{--}= 4 e^{\f{\Phi \alpha }{\pi n}}\sum_{l,q=1}^{\infty} (-)^{l+q}\exp(-\f{2\pi}{\beta } (l+q){}\left(\frac{1}{2}+\f{\alpha r}{2\pi n}\right))\times\nonumber\\\times\f{\sinh(\Phi-\f{2\pi(l+q)r}{\beta})}{\sinh({\f{\Phi}{n}-\f{2\pi(l+q)r}{n\beta}})}\f{1}{\exp(\f{2\pi}{\beta}(l+x-y))-1}\f{1}{\exp(\f{2\pi}{\beta}(q+\bar{x}-\bar{y}))-1}, \end{align} \begin{align} \gamma_{33}^{-+}=4 e^{\f{\Phi \alpha }{\pi n}}\sum_{l,q=1}^{\infty} (-)^{l+q}\exp(-\f{2\pi}{\beta } (l-q){}\left(\frac{1}{2}+\f{\alpha r}{2\pi n}\right))\times\nonumber\\\times\f{\sinh(\Phi-\f{2\pi(l-q)r}{\beta})}{\sinh({\f{\Phi}{n}-\f{2\pi(l-q)r}{n\beta}})}\f{1}{\exp(\f{2\pi}{\beta}(l+x-y))-1}\f{1}{\exp(\f{2\pi}{\beta}(q-\bar{x}+\bar{y}))-1}, \end{align} \begin{align}\begin{gathered} \Sigma_{13}= \sum_{l=1}^{\infty} (-)^l \left(e^{\f{\pi \left(2r\alpha +n\right) l}{\beta n}}\f{\sinh(\Phi+\f{\pi l r}{\beta})}{\sinh(\f{\Phi}{n}+\f{\pi l r }{\beta n})}\f{1}{\exp(\f{2\pi}{\beta}(l-x+y))-1}\right.+\nonumber\\\left.-e^{-\f{\pi \left(2r\alpha +n\right) l}{\beta n}}\f{\sinh(\Phi-\f{\pi l r}{\beta})}{\sinh(\f{\Phi}{n}-\f{\pi l r }{\beta n})}\f{1}{\exp(\f{2\pi}{\beta}(l+x-y))-1}\right)\end{gathered},\end{align} \begin{align}\begin{gathered} \Sigma_{23}= \sum_{l,p=1}^{\infty} (-)^{l+p}\left[e^{\f{\pi \left(2r\alpha +n\right) (l-p)}{\beta n}}\f{\sinh(\Phi+\f{\pi (l-p) r}{\beta})}{\sinh(\f{\Phi}{n}+\f{\pi (l-p) r }{\beta n})}\f{1}{\exp(\f{2\pi}{\beta}(l-x+y))-1}+\right.\nonumber\\\left.-e^{-\f{\pi \left(2r\alpha +n\right) (l+p)}{\beta n}}\f{\sinh(\Phi-\f{\pi (l+p) r}{\beta})}{\sinh(\f{\Phi}{n}-\f{\pi (l+p) r }{\beta n})}\f{1}{\exp(\f{2\pi}{\beta}(l+x-y))-1}\right]\end{gathered}.\end{align} \end{appendix} \section{Analytical continuation of moments for the charge imbalance negativity }\label{app:resummation_negativity} Here we give explicit analytical continuations for $A_k$ in Eq. \eqref{eq:10}, in the spin sectors of interest, $\nu=2$. Similar results can be obtained also for $\nu=3$, as done for the entanglement entropy. The techniques used for the resummation are similar to the ones described in Appendix \ref{analytical_sum_ssEE}, the main difference being the fact we need to divide the case $k>0$ from $k<0$, to handle the sign function; we only report the final expressions for simplicity, after some premises. The expression to resum, after a modular transformation, is: \begin{align} \tilde{A}_{k,n}=e^{2\Phi(\f{k+\alpha/(2\pi)}{n_e})-{\Psi}{\text{sgn}(k)}}\abs{\f{\epsilon}{i\beta}\f{\theta'_1\left(0\left|-\f{1}{\tau}\right.\right)\jacobitheta{\nu'}{\f{k+\alpha/2\pi}{i\beta n_e}(\ell_2-\ell_1)+\f{\ell_1\text{sgn}(k)}{2i\beta}+\f{x-y}{i\beta}}{-\f{1}{\tau}}}{\jacobitheta{1}{\f{x-y}{i\beta}}{-\f{1}{\tau}}\jacobitheta{\nu'}{\f{k+\alpha/2\pi}{i\beta n_e}(\ell_2-\ell_1)+\f{\ell_1\text{sgn}(k)}{2i\beta}}{-\f{1}{\tau}}}}^2, \end{align} with \begin{align} \Phi=&\log \left|\left(\f{\jacobitheta{1}{\f{x+\ell_1}{i\beta}}{-\f{1}{\tau}}\jacobitheta{1}{\f{x-\ell_2}{i\beta}}{-\f{1}{\tau}}\jacobitheta{1}{\f{y}{i\beta}}{-\f{1}{\tau}}}{\jacobitheta{1}{\f{y+\ell_1}{i\beta}}{-\f{1}{\tau}}\jacobitheta{1}{\f{y-\ell_2}{i\beta}}{-\f{1}{\tau}}\jacobitheta{1}{\f{x}{i\beta}}{-\f{1}{\tau}}}\right)\right|,\\ \Psi=&\log \left| \f{\jacobitheta{1}{\f{x+\ell_1}{i\beta}}{-\f{1}{\tau}}\jacobitheta{1}{\f{y}{i\beta}}{-\f{1}{\tau}}} {\jacobitheta{1}{\f{y+\ell_1}{i\beta}}{-\f{1}{\tau}}\jacobitheta{1}{\f{x}{i\beta}}{-\f{1}{\tau}}}\right|. \end{align} We set $\nu=2\implies \nu'=4$. Using property \ref{whittakerformula} and definining $r=\ell_2-\ell_1$, it becomes: \begin{align} \tilde{A}_{k,n} =&\left(\f{\epsilon}{\beta}\right)^2 e^{2\Phi(\f{k+\alpha/(2\pi)}{n_e})-{\Psi}{\text{sgn}(k)}}e^{-2\pi\f{\Re{x-y}}{\beta}}\left|\coth(\pi\left(\f{(k+\alpha/2\pi) r}{\beta n}+\f{1+\text{sgn}{(k)}\ell_1}{2\beta}\right))+\right.\nonumber\\&+\coth(\pi\f{x+y}{\beta}) \nonumber\\&\left. -4\sum_{c,d=1}^\infty e^{-\f{2cd\pi}{\beta}}\sinh(2\pi\left( c \left(r\f{k+\alpha/2\pi}{\beta n}+\f{1+\ell_1\text{sgn}(k)}{2\beta}\right)+d\f{x-y}{\beta}\right))\right|^2. \end{align} Note that this series is well defined and convergent for all values of the parameters we are interesed in, i.e. $\alpha\in[-\pi,\pi], k\in[-\frac{n-1}{2n},\frac{n-1}{2n}]$.\\ Moreover, if we assume a cutoff independent of $n$ and $\alpha$, then we can reabsorb $\epsilon$ in the definition of the mass, so we will ignore it from now on. We define auxiliary quantities similar to what has been done in Appendix \ref{analytical_sum_ssEE}: \begin{align} &\abs{K_1+K_2+K_3}^2\equiv \\&=e^{2\Phi\left(\f{k+\alpha/(2\pi)}{n_e}\right)-{\Psi}{\text{sgn}(k)}}\left|\coth(\pi\f{x+y}{\beta})+\coth(\pi\left(\f{(k+\alpha/2\pi) r}{\beta n}+\f{1+\text{sgn}{(k)}\ell_1}{2\beta}\right))+\right.\nonumber\\&\left.-4\sum_{c,d=1}^\infty e^{-\f{2cdi\pi}{\tau}}\sinh(2\pi\left( c \left(r\f{k+\alpha/2\pi}{\beta n}+\f{1+\ell_1\text{sgn}(k)}{2\beta}\right)+d\f{x-y}{\beta}\right))\right|^2. \end{align} \begin{align} \gamma_{ii}= \sum_k \abs{K_i}^2,\qquad \gamma_{ij}=\sum_k {2} \Re{K_i K_j^*},\end{align} \begin{align} \tilde{A}^{tot}_n=\frac{e^{-2\pi \frac{\Re{x-y}}{\beta}}}{\beta^2}\sum_{i,j} \gamma^{reg}_{ij}. \end{align} Again, all the terms $K_{i}K_{j}^*$ can be written as a sum of exponentials, and this allows to find an analytic continuation for the sum in $k$. The final expressions are \[ {\gamma_{11}=\coth(\pi\f{x-y}{\beta})^2 e^{\f{2\Phi \alpha}{n_e}}\f{\sinh\left({\Phi-\Psi} \right) +\sinh(\Psi)}{\sinh{\f{\Phi}{n_e}}}},\numberthis\] \begin{align} \gamma_{22}=e^{\f{\Phi \alpha }{\pi n}}\f{\sinh\left({\Phi-\Psi} \right) +\sinh(\Psi)}{\sinh{\f{\Phi}{n_e}}}+\nonumber\\+4e^{\f{\Phi \alpha }{\pi n}}\sum_{m=1}^\infty m e^{-\f{2\pi m}{\beta}\left(\f{\alpha r}{2\pi n}+\frac{1}{2}\right)}\f{\sinh(\Phi-\Psi-\f{\pi m \ell_2}{\beta})+\sinh(\Psi+\f{\pi m \ell_1}{\beta})}{\sinh(\f{1}{n}\left({\Phi-\f{\pi m r}{\beta}}\right))}, \numberthis \end{align} \begin{align} \gamma_{12}=2 \Re{\coth(\f{x-y}{\beta}\pi)}e^{\f{\Phi \alpha }{\pi n}}\left(\f{\sinh\left({\Phi-\Psi} \right) +\sinh(\Psi)}{\sinh{\f{\Phi}{n_e}}}\right.+\nonumber\\ +\left.2\sum_{m=1}^\infty e^{-\f{2\pi m}{\beta}\left(\f{\alpha r}{2\pi n}+\frac{1}{2}\right)}\f{\sinh(\Phi-\f{\pi m \ell_2}{\beta}-\Psi)+\sinh(\Psi+\f{\pi m \ell_1}{\beta})}{\sinh(\f{1}{n}\left({\Phi-\f{\pi m r}{\beta}}\right))}\right), \end{align} \[ {\gamma_{13}=-4 \Re{\coth(\f{\bar{x}-\bar{y}}{\beta})\Sigma_{13}\exp(\f{\alpha \Phi}{\pi n})}}. \numberthis \] \[ {\gamma_{23}=-4\left(\Sigma_{13}+2 \Sigma_{23}\right)\exp(\f{\alpha \Phi}{\pi n})}. \numberthis \] \[ {\gamma_{33}={\gamma_{33}^{++}+\gamma_{33}^{--}}-2 \Re{\gamma_{33}^{-+}}}. \numberthis \] The auxiliary expressions read \begin{align} \gamma_{33}^{--}= 4 e^{\f{\Phi \alpha }{\pi n}}\sum_{l,q=1}^{\infty} e^{-\f{2\pi}{\beta } (l+q){}\left(\frac{1}{2}+\f{\alpha r}{2\pi n}\right)}\f{\sinh(\Phi-\f{2\pi(l+q)\ell_2}{\beta}-\Psi)+\sinh(\Psi+\f{2\pi(l+q)\ell_1}{\beta})}{\sinh({\f{\Phi}{n}-\f{2\pi(l+q)r}{n\beta}})}\times\nonumber\\\times\f{1}{\exp(\f{2\pi}{\beta}(l+x-y))-1}\f{1}{\exp(\f{2\pi}{\beta}(q+\bar{x}-\bar{y}))-1}, \end{align} \begin{align} \gamma_{33}^{++}= 4 e^{\f{\Phi \alpha }{\pi n}} \sum_{l,q=1}^{\infty} e^{\f{2\pi}{\beta } (l+q){}\left(\frac{1}{2}+\f{\alpha r}{2\pi n}\right)}\f{\sinh(\Phi+\f{2\pi(l+q)\ell_2}{\beta}-\Psi)+\sinh(\Psi-\f{2\pi(l+q)\ell_1}{\beta})}{\sinh({\f{\Phi}{n}+\f{2\pi(l+q)r}{n\beta}})}\times\nonumber\\\times\f{1}{\exp(\f{2\pi}{\beta}(l-x+y))-1}\f{1}{\exp(\f{2\pi}{\beta}(q-\bar{x}+\bar{y}))-1}, \end{align} \begin{align} \gamma_{33}^{-+}=4 e^{\f{\Phi \alpha }{\pi n}}\sum_{l,q=1}^{\infty} e^{-\f{2\pi}{\beta } (l-q){}\left(\frac{1}{2}+\f{\alpha r}{2\pi n}\right)}\f{\sinh(\Phi-\f{2\pi(l-q)\ell_2}{\beta}-\Psi)+\sinh(\Psi+\f{2\pi(l-q)\ell_1}{\beta})}{\sinh({\f{\Phi}{n}-\f{2\pi(l-q)r}{n\beta}})}\times\nonumber\\\times\f{1}{\exp(\f{2\pi}{\beta}(l+x-y))-1}\f{1}{\exp(\f{2\pi}{\beta}(q-\bar{x}+\bar{y}))-1} , \end{align} \begin{align} \Sigma_{13}= \sum_{l=1}^{\infty}\left( e^{\f{\pi \left(r\alpha /\pi+n\right) l}{\beta n}}\f{\sinh(\Phi+\f{\pi l}{\beta}\ell_2-\Psi)+\sinh(-\f{\pi l }{\beta}\ell_1+\Psi)}{\sinh(\f{\Phi}{n}+\f{\pi l r }{\beta n})}\f{1}{\exp(\f{2\pi}{\beta}(l-x+y))-1}+\right.\nonumber\\\left.-e^{-\f{\pi \left(r\alpha /\pi+n\right) l}{\beta n}}\f{\sinh(\Phi-\f{\pi l}{\beta}\ell_2-\Psi)+\sinh(\f{\pi l }{\beta}\ell_1+\Psi)}{\sinh(\f{\Phi}{n}-\f{\pi l r }{\beta n})}\f{1}{\exp(\f{2\pi}{\beta}(l+x-y))-1}\right), \end{align} \begin{gather} \Sigma_{23}=\sum_{l,p=1}^{\infty} e^{\f{\pi \left(r\alpha/\pi +n\right) (l-p)}{\beta n}}\f{\sinh(\Phi+\f{\pi (l-p) \ell_2}{\beta}-\Psi)+\sinh(-\f{\pi (l-p) \ell_1}{\beta}+\Psi)}{\sinh(\f{\Phi}{n}+\f{\pi (l-p) r }{\beta n})}\f{1}{\exp(\f{2\pi}{\beta}(l-x+y))-1}\nonumber\\-e^{-\f{\pi \left(r\alpha/\pi+n\right) (l+p)}{\beta n}}\f{\sinh(\Phi-\f{\pi (l+p) \ell_2}{\beta}-\Psi)+\sinh(\f{\pi (l+p) \ell_1}{\beta}+\Psi)}{\sinh(\f{\Phi}{n}-\f{\pi (l+p) r }{\beta n})}\f{1}{\exp(\f{2\pi}{\beta}(l+x-y))-1}. \end{gather} \bibliographystyle{nb}
\section{Introduction} Exploration of gauge theories and their phase diagrams continue to surprise us time and again. In this paper, we will study gauge theories at non-zero density and temperature, focusing on so-called Higgs phases. These phases can be described at weak coupling (but non-perturbatively) as the condensation of a scalar operator which breaks the gauge symmetry and gives a mass to (part of) the spectrum. As one important real-world example, we mention QCD; at asymptotically large baryon density, the theory can be treated as weakly coupled, and quark pairing can be shown to lead to a Higgs phase known as a color superconductor (see \cite{Alford:2007xm} for a review). However, at more moderate densities, such as those that might be realized in compact star cores, the coupling is no longer weak, and the precise fate of the color superconducting state is unknown. Holographic duality has been successfully used to describe various phenomena and phases of strongly coupled gauge theories and one would expect it to be able to capture the physics of Higgs phases as well. However, this has proven a challenging task; previous attempts have either focused on bottom-up models describing it as global symmetry breaking \cite{Basu:2011yg,BitaghsirFadafan:2018iqr,Ghoroku:2019trx,Nam:2021ufk} or on a special top-down realization where the finite-density ground state is supersymmetric \cite{Faedo:2018fjw}. Here we aim to improve on this situation by proposing a simple bottom-up scenario which can describe a class of holographic Higgs phases. The novel aspect of our scenario, which we detail in a specific case model, is the inclusion of explicit brane sources. This is how gauge symmetry breaking can be realized in well-understood top-down models as we now review. \subsection{Top-down motivation} Consider the familiar case of $\mathcal{N}=4$ super-Yang-Mills (SYM), holographically dual to type IIB string theory on $AdS_5\times S^5$. In the vacuum at zero temperature and vanishing R-charge density, this theory has a large moduli space corresponding to diagonal expectation values for the six adjoint scalar fields. In the gravity dual, this manifests through the BPS property of parallel D3-branes allowing them to be distributed arbitrarily in the six transverse directions at no cost in energy. While $N$ coincident branes gives rise to an SU($N$) gauge theory,\footnote{The theory of $N$ coincident D3-branes is actually U($N$), but in the near horizon limit that gives the holographic dual, the degrees of freedom of the diagonal Abelian group decouple.} a generic distribution of them breaks this to U(1)$^{N-1}$. Corresponding dual geometries in the large-$N$ limit can be constructed \cite{Kraus:1998hv,Freedman:1999gk,Lin:2004nb}. Hence, in the vacuum, the existence of the moduli space makes it easy to find a Higgs phase in the theory.\footnote{Technically it is a Coulomb phase because an Abelian subgroup remains unbroken, but all the non-Abelian components become massive, so we will adopt a less rigorous but more physical terminology and refer to these phases as Higgsed.} The question is now, how does this change when turning on a temperature and, most importantly, an R-charge chemical potential? At weak coupling, non-zero temperature gives a thermal mass to the massless scalars, while the chemical potential gives a negative contribution. As discussed in \cite{Basu:2005pj,Yamada:2006rx,Hollowood:2008gp}, at low temperatures and non-zero chemical potential this seems to lead to a fatal instability in the theory, giving an effective potential which is unbounded from below. In the holographic dual at strong coupling this picture was seemingly confirmed through a probe brane calculation: In \cite{Yamada:2008em} it was noted that the effective action of a single D3-brane is also unbounded from below in a black brane geometry corresponding to a finite-density deconfined state \cite{Cvetic:1999xp} . This was, however, re-examined in \cite{Henriksson:2019zph}, which came to a somewhat different conclusion. The black brane backgrounds in question rotate in the $S^5$-part of the geometry, the angular momentum being dual to the R-charge density of the field theory. While \cite{Yamada:2008em} assumed that the D3-brane probe rotates at exactly the angular velocity of the event horizon, \cite{Henriksson:2019zph} instead took the angular momentum of the brane to be constant, as required by the equations of motion. It was then observed that there is a critical angular momentum for the brane to signal an instability. Furthermore, even for supercritical values of the angular momentum, the potential remains bounded from below, but now possessing a global minimum away from the horizon. When the field theory lives in flat space, this minimum is infinitely far away, at the boundary of AdS. Interestingly, however, when the field theory lives on a sphere, so that the dual geometry is global AdS, the global minimum is at a finite position in the holographic radial direction. In that case, it was argued that a (meta)stable Higgs phase will result, in general with some fraction of the branes localized in the bulk and some behind the horizon. If $M$ out of the $N$ branes nucleate in the bulk, the gauge symmetry will be effectively broken as $SU(N)\to SU(N-M)\times U(1)^M$. To determine exactly which is the final state of this instability for a given temperature and chemical potential, one must take the backreaction of the nucleated branes into account. This is a primary motivation that sparked our present work. As an initial step towards constructing Higgs phases in the holographic dual of ${\mathcal{N}}=4$ SYM, we will consider a 5D bottom-up model that captures its main features. In more detail, we will include explicit 3-brane sources, which capture all the relevant features of the full top-down construction. This approach has two benefits. First, it is somewhat simpler to treat, since we do not need to detail how the internal geometry is affected. At any rate, one can consistently truncate the ten-dimensional geometry and would presumably end up with a setup very similar to the case at hand. Second, it emphasizes the generality of the phenomena we study; this scenario can likely be implemented in a variety of holographic settings. In fact, in addition to extending our case study to the dual of $\mathcal{N}=4$ SYM, it is worth pointing out that other top-down theories, such as the Klebanov-Witten gauge theory \cite{Klebanov:1998hh}, share similar brane nucleation instabilities \cite{Herzog:2009gd,Henriksson:2019ifu,Henriksson:2021zei} and will likely therefore also have Higgs phases. We thus believe that our program will provide valuable lessons on understanding the properties of Higgs phases of strongly coupled gauge theories in general. The rest of the paper is organized as follows. Section~\ref{sec:model} introduces and further motivates our setup: a five-dimensional gravity theory with a one-form gauge field (holographically dual to a conserved current), a four-form gauge field, and 3-branes which carry charge under both the one-form and four-form fields. In Section~\ref{sec:junction} we use Israel junction conditions to find static solutions with 3-brane sources forming a thin domain wall, or a shell, localized in the holographic radial coordinate. Section~\ref{sec:thermo} provides a study of the thermodynamics of these shell solutions and the resulting phase diagram, including the phase transition between shell solutions and regular AdS-Reissner-Nordström (AdS-RN). We conclude and discuss future directions in Section~\ref{sec:discussion}. In Appendix~\ref{app:10Dprobemodel} we review parts of the probe D3-brane computations from \cite{Henriksson:2019zph,Danielsson:2022lsl} which motivates our approach. \section{Bottom-up gravity model}\label{sec:model} We aim to construct the simplest possible holographic model that could capture the physics of a finite-density Higgs phase. We thus start from a 5D gravitational theory with a negative cosmological constant and a gauge field, with two-form field strength $F_2=dA_1$, which will be dual to a conserved current. To this workhorse of applied holography we add a five-form field strength $F_5=dC_4$, giving the following bulk action: \begin{equation}\label{eq:bulkaction} S_\text{bulk}=\frac{1}{2\kappa^2}\int d^{5}x\sqrt{-g}\left( {\mathcal{R}}+\frac{12}{L^{2}}-L^2 F_2^2-\frac{1}{2\cdot 5!} F_5^2\right) + \frac{1}{4!}\int d^5x\, \partial_{\mu_1} \left( \sqrt{-g}F^{\mu_1\ldots\mu_5}C_{\mu_2\ldots\mu_5} \right) \ . \end{equation} Here, ${\mathcal{R}}$ is the Ricci scalar, $L$ is the radius of curvature, and $\kappa^2=8\pi G_5$ with $G_5$ the Newton constant in five dimensions. The addition of $F_5$ is motivated by string theory constructions where the rank of the group is linked to the flux of the form potential. This potential couples to the color branes that source the geometry and eventually determines the radius of curvature. If the field theory is in a Higgs phase, we expect the effective rank to change as we move from the UV (near the AdS boundary) to the IR (deep inside the AdS bulk). This then indicates that we should allow the effective AdS radius to vary. The five-form field strength makes this possible, as described by Brown and Teitelboim \cite{Brown:1987dd,Brown:1988kg}. In the absence of sources, the equations of motion set it equal to \begin{equation} F_{\mu_1\ldots\mu_5}=f\sqrt{-g}\, \epsilon_{\mu_1\ldots\mu_5} \ , \end{equation} with $f$ a constant. Substituting this back into the bulk action gives \begin{equation} S_\text{bulk}=\frac{1}{2\kappa^2}\int d^{5}x\sqrt{-g}\left( {\mathcal{R}}+\frac{12}{L^{2}}-\frac{1}{2} f^2-L^2 F_2^2\right) \ , \end{equation} so we see that the flux of $F_5$ shifts the effective cosmological constant to\footnote{The boundary term in \eqref{eq:bulkaction} was chosen such that the Einstein equations agree with this value.} \begin{equation}\label{eq:shiftedLambda} \Lambda=-\frac{6}{L_\text{eff}^2}=-\frac{6}{L^{2}}+\frac{1}{4} f^2 \ . \end{equation} We will identify the cosmological constant in the absence of fluxes as the value that corresponds to the un-Higgsed phase, which should thus be the value at the AdS boundary. We therefore impose the condition that the flux vanishes at the boundary. Moving to the interior from the boundary can result to a non-vanishing flux which reduces the magnitude of the effective cosmological constant. The maximum magnitude for the flux $f=\pm f_\text{max}$, corresponding to a completely Higgsed phase, is the one that makes the effective cosmological constant vanishing \begin{equation} \label{eq:fmax} f_\text{max}=\frac{2\sqrt{6}}{L}\ . \end{equation} In order to describe the change in the flux through the geometry we furthermore add 3-branes to our theory, with an action given by \begin{equation}\label{eq:braneAction} S_{\text{brane}}=-T_3\int d^4\xi \sqrt{-\det P[g]} + \mu_3 \int P[C_4] + \int P[A_1]\wedge J_3 \ . \end{equation} The total action is then $S=S_{\text{bulk}}+S_{\text{brane}}$. The branes are codimension-one and thus act as domain walls in our 5D spacetime. Their action is clearly inspired by the action of a D3-brane in string theory: The first term is of the standard Dirac-Born-Infeld (DBI) form, with $T_3$ the tension and $P[g]$ the pullback of the 5D metric $g_{\mu\nu}$. The second term is a standard Wess-Zumino (WZ) coupling to the potential of the five-form $F_5=dC_4$, with charge $\mu_3$. This means that the flux of $F_5$, and the effective cosmological constant, will change upon crossing a 3-brane domain wall. The difference in fluxes between the two sides of the wall is \begin{equation}\label{eq:fluxjump} \Delta f=2\kappa^2 \mu_3\,. \end{equation} Therefore, from \eqref{eq:shiftedLambda}, the change in the cosmological constant is \begin{equation}\label{eq:lambdajump} \Delta \Lambda=\kappa^2\mu_3\bar{f}\,, \end{equation} where $\bar{f}$ is the average value $\bar{f}=(f_1+f_2)/2$. Note that, while in a top-down scenario, the entirety of the cosmological constant is typically due to the branes, in our bottom-up framework we allow ourselves to set its ``bare'' value (corresponding to $L$) as we see fit. Moreover, we are free to set the value of the five-form flux near the AdS boundary, as a boundary condition. In a top-down realization, these will be related. The third term in (\ref{eq:braneAction}) does not appear in the standard D-brane action; it introduces a coupling to the 5D gauge field $A_1$ (with $F_2=dA_1$) through a worldvolume three-form $J_3$, which must be closed, $dJ_3=0$, to respect gauge invariance. The idea that the 3-branes should couple to $P[A_1]$ in this way is again motivated by top-down computations in, {\emph{e.g.}}, the dual of $\mathcal{N}=4$ SYM at non-zero density. While the fundamental D-brane action does not have such a coupling, it was seen in \cite{Henriksson:2019zph,Danielsson:2022lsl} that a similar term is effectively induced through the embedding in the dual spinning black brane geometry. As we review in the appendix, this follows from the fact that for the brane to nucleate, it needs some non-zero angular momentum; the angular momentum in turn couples to off-diagonal components of the metric which, upon reduction to five dimensions, act as the gauge field(s) dual to the R-charge current. The physical picture to have in mind is that larger charge densities lead to a repulsion between the branes, which will lead to them separating and thus Higgsing the dual theory. We expect that such a picture will continue to hold true in many other top-down instances of holography, possibly with modified couplings between the gauge field and the branes. Thus, this setup can lead to interesting possibilities for holographic model building with the ability to adapt both the bulk as well as the brane actions to describe the physics of interest. \subsection{Regular black hole solutions} In the absence of 3-branes, the five-form flux can be set to zero, and our theory has standard AdS-RN charged black hole solutions, \begin{equation} ds^{2}=-f(r)dt^{2}+f(r)^{-1}dr^{2}+r^{2}d\Omega_{3}^{2} \end{equation} with \begin{equation} \label{eq:f} f(r)=\frac{r^{2}}{L^{2}}+1-\frac{m}{r^{2}}+\frac{q^{2}}{r^{4}} \ , \end{equation} and with $d\Omega_3^2$ being the metric of a unit three-sphere. The event horizon radius can be defined as the largest root of $f(r_H)=0$. The existence of an event horizon imposes a bound on the parameters, which can be written in the form $|q|\ge q_\text{ext}(m)$ with $q_\text{ext}(m)$ a fairly complicated function which we will not reproduce here; if this inequality is saturated, the black hole is extremal. Note, however, that if the theory admits a supersymmetric embedding, such extremal black holes are not BPS \cite{Chamblin:1999tk}. The corresponding one-form gauge field, which we require to approach zero at the horizon, is \begin{equation}\label{eq:GaugeField} A_1=\frac{\sqrt{3}q}{2L}\left(\frac{1}{r_H^2}-\frac{1}{r^{2}}\right)dt\ . \end{equation} All of the solutions we study will asymptote to global AdS, so the dual field theory lives on a three-sphere, whose radius is (for now) set to equal $L$. \section{Thin-shell solutions}\label{sec:junction} The model introduced in the previous section can in principle be solved for arbitrary distributions of 3-branes in the holographic radial direction. Here, we will focus on a simple special case, by assuming that \begin{enumerate}[(i),topsep=-1pt,itemsep=0ex,partopsep=3ex,parsep=2ex] \item the nucleated branes are tightly distributed around a certain radius, meaning we can approximate them by a thin shell partitioning the 5D spacetime into an interior and an exterior, and \item that \emph{all} the branes have nucleated, meaning that the interior spacetime of the shell is completely sourceless, a flat Minkowski. \end{enumerate} The resulting geometry is analogous to the vacuum Coulomb-branch solution studied in \cite{Kraus:1998hv}, where $N$ D3-branes are distributed in an $SO(6)$-symmetric shell with a flat interior. With this configuration, the five-form flux in the interior of the geometry can be taken to be $f=-f_\text{max}$ in \eqref{eq:fmax}, while the flux outside vanishes. This implies that $N$ times $\Delta f$ in \eqref{eq:fluxjump} equals $f_\text{max}$, which fixes the relation between the number of branes and the asymptotic AdS radius \begin{equation} \label{eq:mu3val} L=\frac{\sqrt{6}}{N\kappa^2 \mu_3}\ . \end{equation} Let us momentarily assume that our model corresponds to a dimensional reduction of a ten-dimensional string construction with a geometry asymptotically $AdS_5\times {\cal M}_5$, and that the domain walls actually correspond to D3-branes. In this case \begin{equation} \kappa^2=\frac{\kappa_{10}^2}{\text{Vol}({\cal M}_5)}\ , \ \kappa_{10}^2=\frac{1}{2}(2\pi)^7g_s^2(\alpha')^4\ , \ \mu_3=\frac{g_3}{(2\pi)^3g_s(\alpha')^2}\ , \end{equation} where $g_3$ takes into account that the normalization of the five-form in the reduced theory might be different from the normalization in ten dimensions. The volume of the internal space is expected to have a size of the same order as the AdS radius, so that $\text{Vol}({\cal M}_5)=v_5 L^5$. Together with (\ref{eq:mu3val}) this leads to relations of the form \begin{equation} L^4/(\alpha')^2= \frac{4\pi^4}{v_5}\sqrt{\frac{2}{3}}g_3 g_s N \ , \ \ \ \frac{L^8}{G_{10}}=\frac{4\pi^2}{3 v_5^2}g_3^2 N^2\ , \end{equation} which is similar to what is found in the ten-dimensional theory. For instance, one can recover the same expressions as the $AdS_5\times S^5$ dual to ${\cal N}=4$ super Yang-Mills by setting $v_5=\pi^3/3$ and $g_3=1/\sqrt{6}$. While we believe that on a generic point of the phase diagram only a fraction of all the branes will nucleate, it seems plausible that there would exist regions where all, or almost all, branes nucleate, motivating assumption \textit{(ii)}. Assumption \textit{(i)} can be motivated as follows: In the top-down treatment of \cite{Henriksson:2019zph}, it was argued that the $N$ D3-branes will tend to share the total charge (in that case, angular momentum) equally. From the probe computations in that paper, one then concludes that they all prefer to localize around the same radius. Assumption \textit{(i)} lets us treat the problem using Israel junction conditions \cite{Israel:1966rt}; on each side of the shell, the solution will be of the general AdS-RN form discussed in the previous section, but the parameters $m$, $q$, and $L_{\text{eff}}$ will differ on the two sides. We use $+$/$-$ to denote quantities on the outside/inside of the shell. Then, by assumption \textit{(ii)}, inside the shell we take $f^-(r)=1$. Outside we allow for a general blackening function $f^+(r)=f(r)$; we take as boundary condition that the flux $f$ is zero, allowing us to replace $L_\text{eff}$ with $L$. The shell hypersurface will be parameterized by the angular coordinates $(\psi,\theta,\phi)$ on the spacetime three-sphere it wraps, together with the time coordinate of the inner, flat solution $t^-\equiv\tau$. The shell will be localized in the radial direction at $r^\pm=R^\pm$. The first junction condition states that the induced metric on the shell should be the same when approached from both directions. With said parametrization, it becomes \begin{equation} ds_{B}^{2}=h_{ab}d\xi^a d\xi^b = -(dt^-)^{2}+(R^-)^2d\Omega_{3}^{2}=-f(R^+)(dt^+)^2+(R^+)^2d\Omega_{3}^{2} \ . \end{equation} Equality of the spatial part of this metric means that the radial coordinate of the shell is the same in both the coordinates of the interior and exterior solution, $R^+=R^-\equiv R$. The time coordinate, however, has a discontinuity on the shell, $\sqrt{f(R)}t^+ = t^-$. The second junction condition is \begin{equation}\label{eq:2ndJunctionCond} K_{ab}^{+}-K_{ab}^{-}=-\kappa^2\Bigg(T_{ab}-\frac{1}{3}T_{c}^{c}h_{ab}\Bigg) \ , \end{equation} where $K_{ab}$ is the extrinsic curvature and $T_{ab}$ is the shell stress tensor. The extrinsic curvature can be computed using \begin{equation} K_{ab}= -n_\mu \left( \frac{\partial^2 X^\mu}{\partial\xi^a \partial\xi^b} + \Gamma^\mu_{\nu\lambda} \frac{\partial X^\nu}{\partial\xi^a}\frac{\partial X^\lambda}{\partial\xi^b} \right) \ , \end{equation} where $n^\mu$ is the unit normal of the shell, $X^\mu$ is the embedding of the shell, and $\Gamma^\mu_{\nu\lambda}$ are the Christoffel symbols. For the exterior AdS-RN geometry, this gives the result \begin{equation} K^\tau_\tau = \frac{f'(R)}{2\sqrt{f(R)}} \ , \qquad K^\psi_\psi=K^\theta_\theta=K^\phi_\phi = \frac{\sqrt{f(R)}}{R} \ , \end{equation} while the results for the interior flat geometry are the same with $f(R)=1$. Since the shell is supposed to consist of $N$ 3-branes, the shell stress tensor can be computed from the variation of (\ref{eq:braneAction}) with respect to the induced metric. Only the DBI-term contributes to this variation, giving a worldvolume cosmological constant, \begin{equation} T_{ab} = -\frac{2}{\sqrt{-h}}\frac{\delta S_\text{brane}}{\delta h^{ab}} = -N T_3 h_{ab} \ . \end{equation} To proceed we must choose a value for the tension $T_3$ of our 3-branes. We do this by, again, mimicking the top-down probe computation of \cite{Henriksson:2019zph}; from the effective potential therein one finds that the D3-brane tension is \emph{critical}, meaning that the effective worldvolume cosmological constant which receives contributions from $T_3$ as well as from the embedding is zero.\footnote{For a more detailed discussion of this see \cite{Danielsson:2022lsl}, or \cite{Kraus:1999it} in a Randall-Sundrum setting (where the critical tension differs from here by a factor of 2).} This corresponds to a tension \begin{equation} T_3=\frac{3}{\kappa^2 N L} =\sqrt{\frac{3}{2}}\, \mu_3\ , \end{equation} where we have used \eqref{eq:mu3val} in the last equality. Inserting the extrinsic curvature for the flat and AdS-RN spacetimes, we now obtain two independent equations, \begin{equation} \label{eq:2ndJunctionCondExpl} -\frac{f'(R)}{2\sqrt{f(R)}} = \frac{1}{L} \qquad \text{and} \qquad \sqrt{f(R)}-1 =-\frac{R}{L} \ , \end{equation} coming from the time-time and the space-space components of (\ref{eq:2ndJunctionCond}), respectively. These equations are solved by \begin{equation}\label{eq:shellSol} m=\frac{5R^3}{L} \qquad \text{and} \qquad q=\pm\sqrt{\frac{3R^5}{L}} \ , \end{equation} \emph{provided} $0\le R\le L$. We thus have a one-parameter family of static shell solutions. It turns out that the solution (\ref{eq:shellSol}) corresponds to an over-extremal black hole. In Fig.~\ref{fig:overExtremal} this is visualized by plotting the charge of the shell solution minus the extremal charge, as a function of mass (in units of $L$). The charge is seen to be over-extremal everywhere except at $m=0$ (no black hole) and at $m/L^2=5$, corresponding to $R=L$; at this special point the exterior AdS-RN geometry in the shell solution becomes extremal, with the shell position coinciding with the horizon. Everywhere else, the exterior geometry of the shell solutions has a naked singularity; however, when the region interior to the shell is replaced by flat space, the singularity is excised. This is somewhat reminiscent of other stringy resolutions of singularities such as the enhan\c con \cite{Johnson:1999qt}. In fact, it has been argued in a top-down setting \cite{Evans:2002fk} that certain solutions with naked singularities can be relevant thermodynamic phases, which can even be preferred in some parts of the phase diagram (that reference focused on the canonical ensemble). If our shell solutions can be uplifted to such top-down settings, it is plausible that they can replace such naked singularities in the phase diagram. \begin{figure}[ht] \centering \includegraphics[scale=1.]{./overExtremal.pdf} \caption{The difference between the charge of the shell solution (\ref{eq:shellSol}) and the extremal charge $q_\text{ext}$ as a function of mass, in units of $L$.}\label{fig:overExtremal} \end{figure} The fact that the exterior solution typically has a naked singularity means that the shell will never risk falling into a horizon. Thus we can also consider the limit $R\to 0$; we see that this also brings $m$ and $q$ to zero, meaning that the exterior geometry, which is now all there is, approaches thermal AdS. \section{Thermodynamics and phase diagram} \label{sec:thermo} Before studying the thermodynamics of the shell solutions, we review the thermodynamics of the regular AdS-RN solutions. This can be obtained by standard methods and is found in many references, see for instance \cite{Chamblin:1999tk}. Note that up to now, we have worked in units in which the 3-sphere radius on which the field theory is defined has been set equal to $L_{\text{eff}}$. In this section, we will allow for an arbitrary radius $\rho$. This is accomplished by rescaling the coordinates $r\to(\rho/L)r$, $t\to(L/\rho)t$ with a simultaneous rescaling of the parameters $m\to\frac{\rho^{4}}{L^{4}}m$, $q\to\frac{\rho^{3}}{L^{3}}q$. At large $r$ the metric now assumes the canonical AdS form \begin{equation} ds^{2}\to -\frac{r^{2}}{L^{2}}dt^{2}+\frac{L^{2}}{r^{2}}dr^{2}+\frac{\rho^{2}}{L^{2}}r^{2}d\Omega_{3}^{2} \ . \end{equation} For shell solutions, we only rescale the coordinates of the exterior AdS-RN solution (so after the rescaling, the radial coordinate is no longer continuous at the shell). The volume of the three-sphere on which the field theory lives is then $V=2\pi^2 \rho^3$. The stress tensor can be determined by evaluating the Brown-York tensor at the AdS-RN boundary with the standard counterterms. The resulting energy $E$ and pressure $P$ are \begin{equation} E=3VP=\frac{3\pi^2 \rho^3}{\kappa^2 L^3}m \ . \end{equation} The entropy is given by the horizon area, and the temperature is obtained by imposing regularity near the horizon in imaginary time: \begin{equation} S=\frac{4\pi^3 \rho^3}{\kappa^2 L^3}r_H^3 \ , \qquad T=\frac{f'(r=r_H)}{4\pi} \ . \end{equation} Finally, the conserved charge and the chemical potential are \begin{equation} Q=\frac{4\sqrt{3}\pi^2 \rho^3}{\kappa^2 L^2}q \ , \qquad \mu=\frac{\sqrt{3}q}{2L r_H^2} \ . \end{equation} These expressions can be seen to obey the first law of thermodynamics, $dE=TdS+\mu dQ-PdV$. The free energy can be computed (in the grand canonical ensemble) as $\Omega=E-TS-\mu Q$. \subsection{Thermodynamics of shell solutions} The thermodynamics for our shell solutions is obtained by similar methods. In particular, the expressions for energy, pressure, and charge density are the same as above, with the parameters $m$, $q$, and $L$ being those of the exterior AdS-RN solution. The shell solutions are flat inside, and in the absence of a horizon have vanishing entropy to leading order in the large-$N$ expansion. For the same reason, the temperature of a particular shell solution is unconstrained and can be chosen at will. Naively, the chemical potential is unconstrained in a similar way. It is dual to the asymptotic value of $A_t$; for regular AdS-RN solutions, the gauge field should be set to zero on the horizon, but in the absence of a horizon it can be shifted by an arbitrary constant. However, we argue that there must be a relationship between the chemical potential and the shell position, in order to satisfy the first law in the presence of a non-trivial charge density. (It is clear that, for non-zero $dQ$, the first law cannot be satisfied for arbitrary $\mu$.) This requirement gives \begin{equation} \mu_s=\frac{\sqrt{3}q}{2LR^2} = \frac{3}{2L}\sqrt{\frac{R}{\rho}} \ , \end{equation} which means that the shell is forced to sit at the radius where the gauge field vanishes. The same result can be found by considering an inside geometry with a black hole of mass $\tilde m$ and taking the limit $\tilde m \to 0$. With these relations, we again find (by construction) that the first law is satisfied, and we can compute the free energy of our shell solutions, with the simple result \begin{equation} \Omega_s = -\frac{3\pi^2 \rho^2 R^3}{\kappa^2 L^3} = -\frac{64\pi^2L^3\rho^5\mu^6}{243\kappa^2} \ . \end{equation} Recall that the shell solutions only existed for $R\le L$, or $R\le L^2/\rho$ in the rescaled units used in this section. This corresponds to chemical potentials $\rho\mu\le 3/2$. The point $R=L^2/\rho$, $\rho\mu=3/2$ is also the sole special point discussed in the previous section where the blackening function $f(r)$ has a (double) zero and the shell sits at the position of the extremal horizon. It might seem surprising that our proposed Higgs phase exists only below a certain value of the chemical potential. However, note that we have restricted ourselves to studying a particularly simple version of the Higgs phase, with all branes having nucleated, leaving an empty interior. If one allows for more general interiors, describing partial nucleation with black holes inside the shell, it is plausible that one will find solutions at larger densities as well. \subsection{Phase diagram} In the absence of the shell solutions, there are two standard geometries, AdS-RN and thermal AdS. Thermal AdS has trivial thermodynamics at leading order in the large-$N$ expansion, with zero energy, entropy, and charge density (we are subtracting off the Casimir energy throughout). The results for AdS-RN were covered above. It can be shown that for small temperatures and chemical potentials, in units of the three-sphere radius, no black hole solutions exist and thermal AdS is the prevailing phase, while at larger temperatures and/or chemical potentials, AdS-RN dominates. At $\mu=0$, this corresponds to the famous Hawking-Page transition \cite{Hawking:1982dh}. Note that there are two branches of black hole solutions; in the grand canonical ensemble which we focus on here, only one of these (the ``large black holes'') are relevant for the phase diagram. In the canonical or microcanonical ensemble, the small black hole phases can dominate over the large ones, leading to an interesting interpretation on the phase structure of the dual field theory \cite{Chamblin:1999tk,Asplund:2008xd,Jokela:2015sza,Hanada:2022wcq}. Turning to the shell solutions, we note that their free energy is always of order $N^2$ and negative for non-zero $\mu$, hence they will always dominate over thermal AdS (in the limit $\mu\to0$ the shell solutions reduce to thermal AdS, as previously discussed). Comparing their free energy with that of AdS-RN we arrive at Fig.~\ref{fig:freeEnergy}. We observe a first order phase transition with the shells being dominant at lower temperatures. The critical temperature approaches zero as $\rho\mu$ approaches 3/2. Note that at chemical potentials below $\rho\mu=\sqrt{3}/2$ there are two branches of black hole solutions; the branch with higher free energy corresponds to black holes with smaller radii which are thermodynamically subdominant. \begin{figure} \centering \includegraphics[scale=0.75]{./freeEnergy_vs_T_v2.pdf} \caption{Free energy of the shell solutions (blue curve) and AdS-RN (black curves) as a function of $T$ at fixed $\mu$, in units of the three-sphere radius $\rho$. The chemical potentials are (clockwise from the top left) $\rho\mu=(0,0.5,1,1.5)$. For small chemical potentials (upper plots) there are two branches of black hole solutions (upper branch corresponding to the thermodynamically subdominant small BH solutions). Above $\rho\mu=1.5$ (bottom left) no shell solution exists.}\label{fig:freeEnergy} \end{figure} The resulting phase diagram is shown in Fig.~\ref{fig:phaseDiagram}. The shell solutions are preferred in the blue region, AdS-RN is preferred in the white region, and the orange curve indicates where the phase transition to thermal AdS would be in the absence of the shell solutions. We note that the line of phase transitions between the shell solutions and AdS-RN follows the orange curve closely at small $\mu$; it can be shown that it asymptotes to the orange curve from above, with their difference going as $\mu^6$. This agrees with what was stated earlier; in the limit $\mu_s\to 0$ (equivalent to $R\to 0$), the shell solutions approach thermal AdS. \begin{figure} \centering \includegraphics[scale=1.]{./phaseDiagram_v2.pdf} \caption{The phase diagram, with temperature $T$ and chemical potential $\mu$ in units of the three-sphere radius $\rho$. The white region shows where the normal, deconfined plasma described by AdS-RN dominates. The blue region denotes where the shell solution dominates. The orange curve denotes where the phase transition between AdS-RN and thermal AdS would be in the \emph{absence} of the shell solution.}\label{fig:phaseDiagram} \end{figure} \section{Discussion}\label{sec:discussion} In this paper we have proposed a simple holographic bottom-up model for finite-density Higgs phases akin to color superconductivity in QCD. Motivated by top-down considerations, explicit brane sources played an important role; the Higgs phase is characterized by the appearance --- or \emph{nucleation} --- of branes in the bulk of the gravity solution, outside possible event horizons. We moreover considered a simple class of novel solutions to our model, describing a thin shell of branes partitioning spacetime into an interior and an exterior; we assumed a ``fully nucleated'' state, meaning the interior is source free and thus flat, while the exterior is described by an AdS-RN geometry. Using the Israel junction conditions we found a family of static shells, studied their thermodynamic properties, and verified that they obey the first law of thermodynamics. We compared their free energy (in the grand canonical ensemble) to that of the standard AdS-RN solution, as well as thermal AdS, and found that there exists a region at small $T$ and $\mu$ where the shell solution dominates. This region (blue in Fig.~\ref{fig:phaseDiagram}) completely overwhelms the thermal AdS, but is also the preferred phase over the AdS-RN for slightly larger chemical potentials. The phase transition between AdS-RN and the shell solutions is everywhere first order. Let us examine the state corresponding to the simple ``shell phase'' solutions in some more detail. The free energy of the corresponding state scales as $N^2$, thus it is unlike the ``confined'' thermal AdS phase, which has zero free energy at this order.\footnote{We have in mind here ``kinematic confinement'' which forbids physical colorful states on the sphere, {\emph{i.e.}}, Gauss law disallowing charged states on compact space.} To probe the nature of the state in more detail could be exposed by loop operators. While we have been studying field theory on a three-sphere, we can borrow some intuition from a field theory in flat space. Wilson and 't Hooft loops can be computed from the actions of fundamental or D-strings, respectively. Following the reasoning in \cite{Rozali:2012ry}, we then expect shell solutions like ours to be classified as Higgs phases, in particular, displaying an area law for the 't Hooft loop at least when the radius of the three-sphere is very large. Another class of probes of the properties of Higgs phases are two-point functions of gauge-invariant operators. Known supergravity solutions dual to the ${\cal N}=4$ SYM Coulomb branch predict a gapped spectrum with the exception of a massless mode corresponding to the dilaton of the spontaneously broken conformal invariance \cite{Freedman:1999gk,Bianchi:2001de}. One might expect to find similar results for the shell solutions. The fully nucleated solution is a simple special case of more general shell solutions, where the interior of the shell would be an AdS-RN geometry with arbitrary values for $m$, $q$, and $L$. Then, one might anticipate to find several possible shell solutions at various points in the phase diagram and one must minimize the free energy to find which one is preferred. Even more generally, one should allow for an arbitrary distribution of 3-branes along the holographic radial dimension, which might lead to solutions with even lower free energies. Relatedly, we also hope to address more general questions of stability of these solutions, as well as a more detailed look at their physics, including the computation of correlation functions and loop operators. In addition, from a gravitational vantage point, since the shells take over parts of the phase diagram at vanishing temperature, they could play a role in addressing the fate of the weak gravity conjecture \cite{Arkani-Hamed:2006emk,Harlow:2022gzl}; see \cite{Montero:2018fns,Henriksson:2019ifu,McInnes:2022tut} for some recent discussions in the holographic context. We expect that it will be possible to find exact, top-down embeddings of our setup, with only minor modifications in, {\emph{e.g.}}, the dual of $\mathcal{N}=4$ SYM at non-zero R-charge density. One must then deal with the complication of the extra internal dimensions. However, in the most symmetric cases, such as when the three chemical potentials of $\mathcal{N}=4$ SYM are set equal, one can perhaps smear the nucleated branes over the internal manifold, thus recovering something close to the effective five-dimensional setup studied here. One of our motivations for studying finite-density Higgs phases is to model dense nuclear matter. As mentioned in the introduction, the cores of compact stars may hold nuclear matter in such phases, potentially offering experimental access through astrophysical observations. We hope that a better understanding of Higgs phases in holography will offer qualitative insights into the QCD phase diagram, as well as ideas on how to implement them in more realistic phenomenological models \cite{Jarvinen:2021jbd,Hoyos:2021uff}. With this in mind, it is particularly important to study thermodynamics and transport properties of these solutions, since they can be related to astrophysical observables \cite{Hoyos:2020hmq}. Finally, let us spell out a feasible and captivating extension of the shell construction. In principle, it could be possible to have flux inside the shells exceeding the value quoted in \eqref{eq:fmax}. A natural interpretation then is that there is some anti-3-brane charge in the interior of the shell that is screened by the 3-branes at the shell. In this case the cosmological constant would be positive in the interior and the spacetime would become de Sitter. This scenario would serve as a simple anchor for studies of quantum gravity in de Sitter spacetime using holography, along the lines of the $dS_2$ inside $AdS_2$ `centaur geometry' proposed in \cite{Anninos:2017hhn}. Extending the centaur geometry to higher dimensional geometries has proved to be a difficult task \cite{Kiritsis:2019wyk}, however, so it would be particularly interesting to have access to a tractable toy model. \vspace{1cm} \addcontentsline{toc}{section}{Acknowledgments} \textit{Acknowledgments } We would like to thank Ulf Danielsson and Daniel Panizo for discussions on related topics. O.~H. has been supported by the Academy of Finland grant no. 1330346 and by the Ruth and Nils-Erik Stenb\"ack foundation. C.~H. is partially supported by the AEI and the MCIU through the Spanish grant PID2021-123021NB-I00 and by FICYT through the Asturian grant SV-PA-21-AYUD/2021/52177. N.~J. and A.~P. have been supported in part by the Academy of Finland grant no. 1322307. O.~H. and N.~J. acknowledge the hospitality of the APCTP where part of this work was done.
\section{Introduction} Rayleigh-type surface acoustic wave (SAW) is a propagating wave on a surface of elastic material~\cite{LL7,TB2017}. Due to their surface localization, high electrical controllability, and low propagation loss, the SAW is used in many classical electrical devices, e.g., communication equipment and sensors for gases and liquids~\cite{C1998,BB2008,LR2008,RM2009,R2017,ZL2021}. The SAW is also a quantum information carrier, taking advantage of its long coherence time~\cite{SK2015,MK2017,MS2018,SZ2018,NY2020}. Recently, the coupling and hybridization of the SAW with other physical systems have also attracted attention, including magnetoelastic coupling~\cite{W2002,WD2011,WH2012,GM2015,BV2020} between the SAW and magnetization, acoustoelectric coupling~\cite{MC2012,PB2015,PS2015} between the SAW and electron charge, and spin-volticity coupling~\cite{M2013,IMM2014,K2017,K2020} between the SAW and electron spin. Quantitative imaging of the SAW is a powerful tool for advancing SAW-related research. Specifically, it leads to the evaluation of various coupling strengths as well as the characterization of the SAW itself. A few optical measurement techniques have been developed to realize this~\cite{K2000,H2011,FS2019,K2005,H1970,FS2019}, but it is challenging to obtain quantitative results in practice in many cases. Thus, we have turned our attention to a simple phenomenon in which an optical path of reflected light is modulated according to the law of reflection depending on a surface slope at the optical spot position. We have developed a method to quantitatively obtain spatial distributions of the amplitude and phase of the surface slope by observing this optical path modulation with a measurement system working in the shot-noise-limited regime. Those distributions provide enough information to specify the SAW with a wavelength longer than the optical spot size. Although our recently reported imaging method of the SAW using a polarimeter can also quantitatively evaluate the surface slope~\cite{TH2021}, it requires the material complex refractive index at the optical spot position for analysis. That might be a problem in experiments with novel materials. The method using the optical path modulation is, therefore, more versatile. This paper shows that the optical path modulation method can quantitatively evaluate the amplitude and phase of time-periodically varying surface slope due to the coherently driven SAW. Furthermore, by sweeping the optical spot within the device surface, two-dimensional spatial imaging of the amplitude and phase of the time-varying surface slope is realized. After a brief description of a theoretical model of the quantitative probing of the surface slope in Sec.~\ref{sec:model}, we present experiments in which quantitative measurement of the surface slope with the SAW is demonstrated in Sec.~\ref{sec:experiments}. Then, the slope amplitude obtained from the optical path modulation signal is compared with the slope amplitude obtained from other schemes, and its validity is discussed. \begin{figure*}[t] \begin{center} \includegraphics[width=17.8cm,angle=0]{setup_W178_11.pdf} \caption{ Experimental setup and device for observing optical path modulation and optical polarization modulation induced by SAW. (a) With polarization beam splitter (PBS) and half-wave plate (HWP), the incident light is made linearly polarized with the polarization plane aligned parallel to the direction of SAW propagation ($z$-direction). The light is focused with an objective lens into a diameter of around $3\,\rm{\mu}m$ on the device surface. The angle of incidence is set to $45^{\circ}$. The reflected light is then collimated by another objective lens and analyzed in the two balanced detectors indicated as (i) and (ii) with HWP, PBS, beam splitter (BS), periscope-type mirror pair, and prism mirror. (b) Microscope image of a Fabry-Perot type SAW resonator with a coordinate system. The SAW resonator consists of a $0.5$-mm-thick YZ-cut $\rm{LiNbO}_3$ substrate, Bragg mirrors, and interdigitated transducers (IDTs). Bragg mirrors and IDTs are made by depositing $5\,\mathrm{nm}$ of Ti and $80\,\mathrm{nm}$ of Au. Two Bragg mirrors composed of $100$ fingers of $400$-$\mathrm{\mu m}$-long with a $10$-$\mathrm{\mu m}$ line and space are placed at a distance of $360\,\mathrm{\mu m}$. Two IDTs composed of $3$ fingers of $400$-$\mathrm{\mu m}$-long with a $10$-$\mathrm{\mu m}$ line and space are placed $105\,\mathrm{\mu m}$ apart from the center between Bragg mirrors, respectively. A Ti($5\,\mathrm{nm}$)/Au($80\,\mathrm{nm}$) film with a length of $520\,\mathrm{\mu m}$ and a width of $80\,\mathrm{\mu m}$ is deposited at the center between Bragg mirrors. (c)(d) Schematics of light reflection on the surface of the SAW device when the SAW drive is (c) OFF and (d) ON. (e) Setup for measuring beam displacement in the $X$-direction induced by optical path modulation by the SAW. (f) Relationship between slight beam displacement $L$ and output voltage $V$ from the balanced detector. } \label{fig:setup} \end{center} \end{figure*} \section{Measurement principle of \\surface slope} \label{sec:model} According to the law of reflection, a time variation in the local slope of the device surface induces a time modulation of the light path reflected off that local position. This phenomenon, \textit{optical path modulation}, is the key to surface slope measurement. Figures~1(c) and 1(d) show this paper's experimental situation around the SAW device. The red arrows represent wavevectors of the incident and reflected light, and the blue arrows represent normal vectors at the optical spot. Although the optical path modulation occurs at any incident angle, we set the incident angle to $45^{\circ}$ and the propagation direction of the SAW in the $z$-direction. In this situation, we can observe the optical path and the polarization modulation simultaneously. By comparing the slope amplitudes obtained from both modulation measurements, the validity of the optical path modulation measurement can be verified. From here, we describe the details of the optical path modulation measurement according to the experimental situation in Fig~\ref{fig:setup}(a). Let us assume that the normal vector of the SAW device surface in Fig.~\ref{fig:setup}(c) is initially oriented in the $y$-direction, and the wavevector of the incident light is in the $xy$-plane. In this case, the wavevector of the reflected light is definitely in the $xy$-plane. On the other hand, when we drive the SAW propagating in the $z$-direction shown in Fig.~\ref{fig:setup}(d), the normal vector is periodically tilted with time in the $z$-direction. Accordingly, the wavevector of the reflected light deviates from the $xy$-plane, resulting in the optical path modulation. Note here that the optical spot size needs to be smaller than the quarter wavelength of the SAW in order to allow law of reflection to hold locally. This paper achieves the condition by inserting an objective lens in front of the SAW device and placing the device surface at the focus, as shown in Fig.~1(a). The tilt of the normal vector in Fig.~1(d) is the same as the surface slope, which can be written as \begin{equation} \theta_n(x,z,t) = \frac{\partial u_{y}(x,z,t)}{\partial z},\label{eq:Tanduy} \end{equation} where $u_y(x,z,t)$ is the $y$-component of the surface displacement field at the optical spot position $x$ and $z$ and time $t$. As shown in Figs.~1(a) and~1(d), by placing an objective lens after the SAW device in the proper position (such that the reflected light is collimated), the wavevector of the reflected light becomes parallel to the $xy$-plane again. In this case, the vertical displacement of the optical beam from the nominal position, $L(x,z,t)$, is given by \begin{equation} L(x,z,t) =F\times \tan\left(2\theta_n(x,z,t)\right) \simeq F\times2\theta_n(x,z,t),\label{eq:LandTheta} \end{equation} where $F$ is the focal length of the objective lens after the SAW device and $\theta_{n}(x,z,t)$ is assumed to be very small. To observe the surface slope $\theta_n(x,z,t)$, we measure the optical beam displacement $L(x,z,t)$ in the following manner by using a periscope-type mirror pair and subsequent elements in Fig~1(a). First, the periscope-type mirror pair plays the functional role of converting vertical beam displacement along the $z$-axis into horizontal beam displacement along the $X$-axis before a prism mirror. Second, as shown in Fig.~1(e), the prism mirror placed in the center of the beam splits the light in half without SAW driving. Third, the split light is collected on two photo-detectors constituting a balanced detector using lens. Then, the differential voltage signal $V(x,z,t)$ output from the balanced detector is input to a lock-in amplifier. The output differential voltage signal $V(x,z,t)$, which is proportional to the difference in input optical power, can be written using the beam displacement $L(x,z,t)$ as follows, \begin{equation} V(x,z,t) = 2CDL(x,z,t),\label{eq:VandL} \end{equation} where $C$ is a conversion efficiency of the balanced detector and $D$ is an optical power density in the $X$-direction before the prism mirror. Substituting Eq.~(\ref{eq:LandTheta}) into Eq.~(\ref{eq:VandL}), we find $V(x,z,t)=4CDF\theta_{n}(x,z,t)$. Finally, by measuring the voltage signal $T\times V(x,z,t)$ with the lock-in amplifier, where $T$ is transfer coefficient including attenuation and amplification of the electrical signal in the transmission line between the balanced detector and the lock-in amplifier, we can obtain information related to the surface slope $\theta_n(x,z,t)$. To evaluate the absolute value of the slope amplitude from experiment, it is usually necessary to calibrate the measurement system. Specifically, the values $T$, $C$, and $D$, for which no nominal values exist, need to be determined from independent experiments. The procedure is usually rather difficult. However, we show here that it is possible to evaluate the slope amplitude~$\tilde{\theta}_{n}(x,z)$ straightforwardly with our scheme as long as we can observe the \textit{optical shot noise}. Note here that the surface slope $\theta_n(x,z,t)$ is divided into amplitude and phase components, \begin{equation} \theta_n(x,z,t) =\tilde\theta_n(x,z) e^{-i\omega_{\rm{SAW}} t}, \label{eq:theta_tilde} \end{equation} where $\omega_{\mathrm{SAW}}$ is an angular frequency of the SAW driven, and $\tilde{\theta}_{n}$ is positive. The key to our method is that the theoretical expression for the power spectrum acquired by the lock-in amplifier with SAW driven is given by (see Appendix \ref{SM:PS} for details), \begin{equation} S_{VV}(\omega_{\mathrm{SAW}}) \Delta f \propto \frac{8D^2F^2\tilde{\theta}^2_{n}}{\hbar^2\omega_{0}^2} +\frac{P_{i}}{\hbar \omega_0}\Delta f,\label{eq:PS} \end{equation} where $S_{VV}(\omega)$ is the power spectral density obtained when the optical spot is at position $(x,z)$, $\Delta f$ is a measurement bandwidth, $P_{i}$ is a power of the incident light going to the prism mirror, $\omega_0$ is an angular frequency of the incident light, and $\hbar$ is Planck constant. The first term represents the coherent signal due to the driven SAW, and the second term represents the optical shot noise. In situation where optical shot noise can be measured, we can experimentally obtain a ratio between the first and second terms in Eq.~(\ref{eq:PS}), $R$, defined by \begin{equation} R(x,z)=\frac{8 D^2 F^2 \left[\tilde\theta_n(x,z)\right]^2}{P_{i} \hbar \omega_0 \Delta f }.\label{eq:R} \end{equation} The experimentally acquired ratio $R$ allows for a quantitative evaluation of the slope amplitude $\tilde\theta_n$ with the known values of the focal length of the objective lens $F$, the optical power density $D$ (see Appendix \ref{SM:D} for details), the incident optical power $P_{i}$, and the measurement bandwidth $\Delta f$. \begin{figure*}[t] \begin{center} \includegraphics[width=18cm,angle=0]{main_results_W180_5.pdf} \caption{ Spectra of the fundamental SAW resonator mode acquired by (a) electrical transmission measurement, (b) optical path modulation measurement, and (c) optical polarization modulation measurement. (a)~Rf transmission spectra (blue dots) from Port~1 to Port~2 with fitting curves (red line) . The peak around $85.63\,\mathrm{MHz}$ corresponds to the fundamental SAW resonator mode. The resonance frequency is the almost same as that in the following optical modulation spectroscopy. (b) Spectra of the optical path modulation signal (blue dots) and the background signal (green dots) with fitting curves (red line). (c) Spectra of the optical polarization modulation signal (blue dots) and the background signal (yellow dots) with fitting curves (red line). (d) Relative amplitudes for the optical path modulation (blue dots) as a function of the rf power that is used for driving the SAW with fitting curves (red line). (e) Relative amplitudes for the the optical path modulation (blue dots) as a function of the optical power $P_{i}$ into the balanced detector with fitting curves (red line). The amplitude when the SAW drive power is $0\,\mathrm{dBm}$ is the reference. (f) Total noise power spectral density (blue triangles) and shot noise power spectral density (green squares) at the measurement frequency $\omega/2\pi=85.625\,\mathrm{MHz}$ within the bandwidth $\Delta f =1\,\mathrm{kHz}$ as a function of the optical power $P_{i}$ into the balanced detector with fitting curves (red line). The shot noise power is obtained by subtracting the separately measured electronic noise (black line) from the total noise. Note that we refer to the noise power as the square of the voltage measured by the lock-in amplifier, which is a quantity proportional to the actual noise power. } \label{fig:mainresults} \end{center} \end{figure*} \section{Experiments} \label{sec:experiments} The experimental setup is schematically shown in Fig.~1(a). A continuous-wave light with a wavelength of $1550\,\rm{nm}$ output from a laser (Santec: TSL-550) is polarized in the $z$-direction using a polarization beam splitter (PBS) and a half-wave plate (HWP), then focused by the objective lens (Mitutoyo: M-PLAN NIR 20X), and set so that the device surface is in focus. The incident angle to the SAW device is set at $45^{\circ}$, as shown in Figs.~1(c) and 1(d). We analyze signal on the reflected light from the SAW device with two balanced detectors labeled (i) and (ii) in Fig.~1(a). Those aim to detect (i) the optical path modulation and (ii) the optical polarization modulation~\cite{TH2021}, respectively. The optical system for (i)~the optical path modulation measurement is the part following the periscope-type mirror pair in Fig.~1(a). The light split by the prism mirror is separately coupled to the photo-detectors of the balanced detector (Thorlabs: PDB415C). This system works according to the measurement principle described in Sec.\ref{sec:model} and is sensitive to the beam displacement $L$. Note that several optical elements between the SAW device and the periscope-type mirror pair do not affect the optical path modulation. In (ii)~the polarization modulation measurement system, the orthogonal polarization components of the reflected light are split by the PBS, coupled separately to multi-mode (MM) fibers, and differentially measured by the balanced detector (Thorlabs: PDB465C). Here, the polarization plane is rotated with the HWP after the SAW device by the angle of $45^{\circ}$ with respect to the original plane to maximize the amplitude of the polarization modulation~\cite{TH2021}. Figure~1(b) shows a microscope image of the SAW device. The SAW device is a Fabry-Perot type SAW resonator consisting of two Bragg mirrors, two interdigitated transducers (IDTs), and single pad for optical observation formed by Ti($5$) and Au($80$) films on a $\rm{LiNbO}_3$ substrate, where the values in parentheses are the thicknesses in nanometers. Note that the single pad in the center of the device is in preparation for future experiments and is not significant in this paper. The SAW resonator is fabricated so that the SAW propagation direction is along the crystalline $Z$-axis of the $\rm{LiNbO}_3$ monocrystal. The fundamental SAW resonator mode with a wavelength of $\sim\micron{40}$ is coherently generated by driving the IDT of Port~1 with an rf signal at the frequency of $\sim \MHz{86}$. \begin{figure}[t] \begin{center} \includegraphics[width=8.6cm,angle=0]{main2_results_W86_4.pdf} \caption{ Imaging results of the SAW resonator by optical path modulation measurement. Color maps of (a) detected optical power into the balanced detector, (b) amplitude and (c) phase acquired by the lock-in amplifier at a frequency $\omega/2\pi=85.625\,\mathrm{MHz}$, and (d) evaluated slope amplitude as a function of the position of optical spot. Together with the color maps, cross-sections of (e) the phase and (f) the slope amplitude at the position $x=250\,\mathrm{\mu m}$ (indicated by white dash lines in the color maps) are shown. The color of dots in (e) and (f) is consistent with the color in (c) and(d), respectively. } \label{fig:mainresults2} \end{center} \end{figure} We first characterize the SAW resonator electrically. Figure~2(a) shows rf transmission spectra $|\rm{S}_{\rm{21}}|$ of the SAW resonator from Port~1 to Port~2 in Fig.~1(b) measured with a vector network analyzer. By fitting with a model function, we find the resonance frequency of the fundamental SAW resonator mode is $\MHz{85.637}$ and internal quality factor is $2\times10^3$ (see Appendix~\ref{SM:S21} for details). Figures 2(b) and 2(c) show amplitude and phase spectra of (i) the optical path modulation and (ii) the optical polarization modulation. These results are obtained when the optical spot (diameter is about $\micron{3}$) is placed at the same position in a rectangular Ti/Au pad region between the IDTs. Both measurements are performed where the SAW resonator mode is driven from port 1 with an rf signal with the power $P_{\mathrm{rf}}$ of $\dBm{-11}$ produced by mixing a fixed-frequency signal at $\MHz{80}$ from an rf generator (Rhode\&Schwarz: SGS100A) and a variable-frequency signal at $5.50$-$\MHz{5.75}$ from the lock-in amplifier (Zurich instruments: HF2LI). The optical signals are acquired by the balanced detectors shown in Fig.~1(a), mixed-down with the $80$-$\rm{MHz}$ rf signal, and then demodulated with the lock-in amplifier. The spectra in Figs.~2(b) and 2(c) show amplitude peaks and steep phase changes around $\MHz{85.6}$, which are similar to the rf transmission spectra in Fig.~2(a). The red lines in Figs.~2(b) and 2(c) show the fitting results with a model function of the same type as the function used in Fig.~2(a) (see Appendix \ref{SM:S21} for details). The agreement of these spectra is evidence that the rf signal is coherently converted into the optical path modulation signal and the polarization modulation signal via the SAW. The agreement also indicates that the SAW can be observed simultaneously in both modulation measurements. Note that the green dots in Fig.~2(b) is the background signal obtained when the optical beam is blocked in front of the balanced detector, and there is no noticeable structure. We confirm that there is no stray rf field directly coupled to the balanced detector. Note also that the yellow dots in Fig.~2(c) is the background signal obtained when the polarization plane of the reflected light from the SAW device are not rotated with respect to the original plane, and there is no noticeable structure. This setting is insensitive to the optical polarization modulation. Thus, we confirm that the observed signal (blue dots) is from the optical polarization modulation. Now, we measure the SAW drive power dependence and optical power dependence of the optical path modulation signal to verify the measurement principle described in Sec.~\ref{sec:model}. Figure~2(d) shows the observed relative amplitude of the optical path modulation signal (blue dots) at the resonant frequency $85.625\,\mathrm{MHz}$ as a function of the SAW drive power from the lock-in amplifier. From the linear fitting (red line), we obtain the slope is $0.5$. Substituting Eqs.~(\ref{eq:Tanduy}) and (\ref{eq:LandTheta}) into Eq.~(\ref{eq:VandL}), we find that the output voltage from the balanced detector $V(x,z,t)$ is proportional to the surface slope $\partial u_{y}(x,z,t)/\partial z$. And using the fact that the $y$-component of the surface displacement field of the SAW resonator mode can be written as $u_{y}(x,z,t) = \alpha \sin(kz) \cos(\omega t)$~\cite{TB2017}, where $\alpha \sin(kz)$ is amplitude, $k$ is wavevector, and $\omega$ is angular frequency, we can obtain $V(x,z,t)\propto \alpha \sin(kz)$. By considering that the amplitude of the displacement $\alpha \sin(kz)$ is proportional to the square root of the SAW drive power, we can verify that the theoretical prediction and the experimental result agree. Furthermore, Fig.~2(e) shows the relative amplitude of the optical path modulation signal (blue dots) as a function of incident optical power going to the balanced detector. From the linear fitting, we obtain the slope equal to $1$. By considering that the optical flux density $D$ in Eq.~(\ref{eq:VandL}) is proportional to the incident optical power, we can confirm that the theoretical prediction agrees with the experimental result. Next, we evaluate the slope amplitude from the optical path modulation measurement result in Fig.~2(b) according to the scheme described in the last paragraph of Sec.~\ref{sec:model}. Here, we describe more specific procedure. The first step is to obtain the optical shot noise level in the optical path modulation measurement system. Figure~2(f) shows the total noise power spectral density (blue triangles) without SAW driving as a function of the optical power impinged into the balanced detector at the measurement rf frequency $\MHz{85.625}$ within the bandwidth $\Delta f =1\,\rm{kHz}$. Since the optical shot noise and electronic noise are comparable in this measurement system, the shot noise (green squares) is obtained by subtracting the electronic noise (black line), which is independent of the optical power, from the total noise (blue triangles). As shown by the red line in Fig.~2(f), the optical shot noise increases linearly with a slope of $1$ for the optical power, confirming the nature of the optical shot noise (See Appendix \ref{SM:PS} for details). From the optical power detected when the optical spot is at a position $(x,z)$ on the SAW device, we can determine the shot noise level corresponding to each optical position. The next step is to calculate the ratio $R$ defined in Eq.~(\ref{eq:R}). By comparing the experimentally obtained signal power at $\omega/2\pi=\MHz{85.625}$ in Fig.~2(b) with the shot noise level, we obtain the resultant ratio $R$ of $19.5\,\mathrm{dB}$. Finally, substituting this value of ratio and the following parameters, $\omega_{0}=194\,\mathrm{THz}$, $\Delta f = 1\,\mathrm{kHz}$, $P_{i}= 0.13\,\mathrm{mW}$, $D=P_{i}/(6.1\,\mathrm{mm})$, and $F= 10\,\mathrm{mm}$, into Eq.~(\ref{eq:R}), we evaluate the slope amplitude $\tilde{\theta}_n =2.0\times 10^{-6}\,\mathrm{rad}$. To validate this new method, we evaluate the slope amplitude in two different ways using literature values. The first is an evaluation using the optical polarization modulation and the material complex refractive index, resulting $\tilde\theta_n \sim 1.1\times10^{-6}\,\mathrm{rad}$ (see Appendix \ref{SM:Pol} for details). The second is an evaluation using the SAW resonator mode volume and material constants, resulting $\tilde\theta_n \sim 1.3\times10^{-6}\,\mathrm{rad}$ (see Appendix \ref{SM:volume} for details). All of the evaluation values are very close to each other, confirming the validity of the optical path modulation measurement. Finally, we demonstrate the acquisition of two-dimensional plots of the amplitude and the phase of the surface slope in a region ($470\,\rm{\mu m}\times 500\,\rm{\mu m}$) around center of the SAW device . Figures~3(a), 3(b), and 3(c) show two-dimensional plots of the detected optical power and the amplitude and the phase of the optical path modulation signal while the optical spot position is scanned in the $x$ and $z$ axes every $\micron{1}$. Figure~3(a) reflects the reflectance at each optical position, thus confirming the surface structure of the SAW device in the scanned area. Figure 3(d) shows a color map of the slope amplitude $\tilde{\theta}_{n}$ at each optical position evaluated according to the specific procedure described in the previous paragraph. Figure~3(e) (3(f)) is a cross section of Fig.~3(c) (3(d)) at the position $x=250\,\mathrm{\mu m}$. The interval between the peak positions of $\tilde{\theta}_{n}$ in Fig.~3(f) is about $20\,\mathrm{\mu m}$, and the phase in Fig.~3(e) changes by exactly $\pi$ at each peak. These results show that the observed SAW mode is the fundamental mode of the SAW resonator. \section{Discussion} \label{sec.discussion} The optical path and polarization modulation measurements are helpful in quantitatively observing surface slope due to SAW. When a measurement system is in the shot-noise-limited regime, both measurements can be calibrated with optical shot noise, and the amplitude of the surface slope can be evaluated. In practice, the optical path modulation measurement is more suitable for surface slope measurement since it does not require information on the material complex refractive index at an optical spot~\cite{TH2021}, and the alignment of the optical system is relatively simple. In this paper, we focused only on the surface slope in the $z$-direction shown in Fig.~1(d), but the slope in the $x$-direction can also be observed by appropriately changing the optical beam displacement measurement basis. Thus, two-dimensional surface slope due to SAW can be observed by combining the optical path modulation measurements with orthogonal measurement bases. The shot-noise-based calibration method proposed in this paper can also be used to easily quantify optical displacement measurements of cantilevers and torsion pendulums, which have been used in many studies~\cite{WH2021,RB2004}. \section{Conclusion} In summary, we demonstrated the optical path modulation measurement of SAW. The precisely calibrated optical path modulation measurement can be a practical tool to quantitatively evaluate the spatiotemporal profile of the displacement field of SAW. By assigning the optical polarization modulation measurement to magnon detection, simultaneous quantitative measurements of the displacement profile of SAW and the magnetization profile of magnon may become feasible. Those results will lead to an experimental determination of the coupling strength of the phonon-magnon coupling. \acknowledgments We would like to thank Koji~Usami, Rekishu~Yamazaki, Yuichi~Ohnuma, Alto~Osada, Atsushi~Noguchi, and Toshiyuki~Hosoya for useful discussions. We acknowledge financial support from JST PRESTO (Grant Number MJPR200A) and JSPS KAKENHI (JP22K14589). R.~S. and K.~T. are supported in part by the Japan Society for the Promotion of Science.
\section{Introduction and Results} \label{Introduction} \setcounter{equation}{0} In this work we consider the three basic initial-boundary value problems (ibvp) for the Majda-Biello (MB) system on the half-line. This system consists of two coupled Korteweg-de Vries (KdV) equations with the dispersion of the second equation having a coefficient $\alpha$, which in \cite{mb2003} is assumed to be in the interval $(0, 1)$ and close to 1, although here we consider all $\alpha>0$. We begin with the Robin problem: \begin{subequations} \label{Rob-MBsys} \begin{align} \label{Rob-MB-eqn1} & \partial_tu+\partial_x^3u+ \partial_x(v^2) = 0, \quad x\in\mathbb{R}^+, \,\, t\in(0,T), \\ \label{Rob-MB-eqn2} & \partial_tv+\alpha\partial_x^3v+ \partial_x(uv) = 0, \\ \label{Rob-MBsys-ic} &(u,v)(x,0) = (u_0,v_0)(x), \quad x\in\mathbb{R}^+, \\ \label{Rob-MBsys-bc} &(u_x+\gamma_1 u ,v_x+\gamma_2v)(0, t) = (\varphi_1,\varphi_2)(t), \quad t\in(0,T), \end{align} \end{subequations} where the parameters $\gamma_1$, $\gamma_2$ are real numbers. When $\gamma_1=\gamma_2=0$, then this becomes the Neumann problem, which is the second ibvp we study here. Finally, replacing the Robin boundary data \eqref{Rob-MBsys-bc} with the Dirichlet boundary data $ (u,v)(0, t) = (g_0,h_0)(t) $ gives the third problem. Here, we shall study the well-posedness of these problems for initial data $u_0(x) ,v_0(x)$ in spatial Sobolev spaces $H^s(0,\infty)$ and boundary data in temporal Sobolev spaces suggested by the time regularity of the Cauchy problem of the corresponding linear MB system, which for the Robin problem \eqref{Rob-MBsys} we have that $\varphi_1(t),\varphi_2(t)$ are in $H^{s/3}(0,T)$. Before stating our results about MB we provide an outline of its physical significance. System \eqref{Rob-MBsys} was introduced by Majda and Biello in \cite{mb2003} to model the nonlinear interaction of barotropic and equatorial baroclinic Rossby waves. These waves occur in the troposphere, which is the lowest layer of the atmosphere, largely due to the Earth's rotation, and affect weather and climate. % In the system \eqref{Rob-MBsys} $u$ is the amplitude of a (barotropic) Rossby wave packet with significant energy in the midlatitudes, and $v$ is the amplitude of an equatorially confined (baroclinic) Rossby wave packet. The parameter $\alpha$ is close to 1 with 0.899, 0.960, 0.980, being some of its numerical estimates given in \cite{mb2003}. For a complete picture about the physical relevance of the MB system we refer the reader to \cite{mb2003, mb2004, bm2004-1, bm2004-2, b2009}. % Concerning conservation laws, it can be seen that the MB system conserves the quantities $\int udx$ and $\int vdx$. Furthermore, and more importantly, MB conserves the total energy \cite{mb2003} % \begin{equation} \label{conserved-energy} E=\int \Big[u^2+v^2\Big]dx, \end{equation} % which is useful in the study of its global well-posedness, and the Hamiltonian % \begin{equation} \label{conserved-hamiltonian} H=\int \Big[u_x^2+\alpha v_x^2-uv^2\Big]dx, \end{equation} % which provides MB with a Hamiltonian structure \cite{bm2004-1}. There are no other conservation laws \cite{V2015}. Therefore, MB may not be a completely integrable system. This should be contrasted with KdV \cite{b1877, kdv1895}, which is an integrable equation having infinitely many conservation laws, a Lax pair \cite{lax1968}, and it can be solved via the inverse scattering transform \cite{ggkm1967, zk1965}. We mention that although the Fokas unified transform method was motivated by integrable equations \cite{f1997}, our work demonstrates that it can also be applied to other equations and systems, like the MB system whose ibvp's we are studying here. % Next, we recall the spaces needed for stating our results precisely. For $s\in \mathbb{R}$ the Sobolev space $H^s(\mathbb{R})$ consists of all temperate distribution $F$ with finite norm $ \left\| F \right\|^2_{H^s(\mathbb R)} \doteq \int_{\xi\in\mathbb R} \hskip-0.02in (1+ \xi^2)^s |\widehat F(\xi)|^2 d\xi, $ where $\widehat F(\xi)$ is the Fourier transform defined by $ \widehat F(\xi) \doteq \int_{\mathbb{R}} e^{-ix\xi} F(x)dx. $ Furthermore, for an open interval $(a, b)$ in $\mathbb{R}$, the Sobolev space $H^s(a,b)$ is defined by \begin{equation} H^s(a,b) = \Big\{f: f= F\big|_{(a,b)}\ \mathrm{where}\ F\in H^s(\mathbb R)\ \mathrm{and}\ \left\| f \right\|_{H^s(a,b)}\doteq \inf_{F \in H^s(\mathbb R)} \left\| F \right\|_{H^s(\mathbb R)} <\infty \Big\}. \end{equation} \vskip-0.05in \noindent Also, for any real numbers $s$, $b$ and $\alpha$ the Bourgain space $X^{s,b}_{\alpha}(\mathbb{R}^2)$ associated with the linear part of KdV is defined by the norm \cite{b1993-kdv, kpv1996} \begin{equation} \label{bourgain-kdv} \|u\|_{X^{s,b}_{\alpha}}^2 = \|u\|_{X^{s,b}_{\alpha}(\mathbb{R}^2)}^2 \doteq \int_{-\infty}^\infty\int_{-\infty}^\infty (1+|\xi|)^{2s} (1+|\tau-\alpha\xi^3|)^{2b} |\widehat{u}(\xi,\tau)|^2 d\xi d\tau. \end{equation} Furthermore, we shall need the restriction space $X^{s,b}_{\alpha,\mathbb{R}^+\times(0, T)}$, which is defined as follows \begin{equation} \label{sb-restrict} X^{s,b}_{\alpha,\mathbb{R}^+\times(0, T)} \doteq \{ u: u(x,t) = \tilde{u}(x,t) \;\;\mbox{on}\;\; \mathbb{R^+}\times(0,T) \,\, \text{with} \,\, \tilde{u}\in X^{s,b}_{\alpha}(\mathbb{R}^2) \}, \end{equation} and which is equipped with the norm \begin{equation} \label{sb-restrict-norm} \| u\|_{X^{s,b}_{\alpha,\mathbb{R}^+\times(0, T)}} \doteq \inf\limits_{\tilde{u}\in X^{s,b}_{\alpha}}\left\{ \| \tilde{u}\|_{X^{s,b}_{\alpha}} : \tilde{u}(x,t) = u(x,t) \;\;\mbox{on}\;\; \mathbb{R^+}\times(0,T) \right\}. \end{equation} Also, we shall need the following modification of the Bourgain norm for the KdV equation \cite{b1993-kdv} \begin{align} \label{bourgain-like-kdv} \|u\|_{X^{s,b,\theta}_{\alpha}}^2 =& \|u\|_{X^{s,b,\theta}_{\alpha}(\mathbb{R}^2)}^2 \doteq \|u\|_{X^{s,b}_{\alpha}(\mathbb{R}^2)}^2 + \Big[ \int_{-\infty}^\infty \int_{-1}^1 (1+|\tau|)^{2\theta} |\widehat{u}(\xi,\tau)|^2 d\xi d\tau \Big] \\ \simeq& \int_{-\infty}^\infty \int_{-\infty}^\infty \Big[ (1+|\xi|)^{s} (1+|\tau-\alpha\xi^3|)^{b} + \chi_{|\xi|< 1}(\xi)(1+|\tau|)^{\theta} \Big]^2 |\widehat{u}(\xi,\tau)|^2 d\xi d\tau, \notag \end{align} where $\theta>\frac 12$ (in fact $\theta<1$ and close to $\frac 12$), and $\chi_{|\xi|< 1}$ is the characteristic function of the interval $(-1, 1)$. Finally, we shall need the modified restriction space $X_{\alpha,\mathbb{R}^+\times(0, T)}^{s,b,\theta}$, which is defined as follows \begin{equation} \label{sb-restrict} X_{\alpha,\mathbb{R}^+\times(0, T)}^{s,b,\theta} \doteq \{ u: u(x,t) = \tilde{u}(x,t) \;\;\mbox{on}\;\; \mathbb{R^+}\times(0,T) \,\, \text{with} \,\, \tilde{u}\in X^{s,b,\theta}_{\alpha}(\mathbb{R}^2) \}, \end{equation} and which is equipped with the norm \begin{equation} \label{sb-restrict-norm} \|u\|_{X_{\alpha,\mathbb{R}^+\times(0, T)}^{s,b,\theta}} \doteq \inf\limits_{\tilde{u}\in X^{s,b,\theta}_\alpha}\left\{ \| \tilde{u}\|_{X^{s,b,\theta}_{\alpha}}: \;\tilde{u}(x,t) = u(x,t) \;\;\mbox{on}\;\; \mathbb{R^+}\times(0,T) \right\}. \end{equation} $Y^{s,b}_{\alpha}$ is a ``temporal" Bourgain space defined by the norm, used for the KdV ibvp by Faminskii \cite{Fa2004,Fa2007}, \begin{equation} \label{Y-def-recall} \| u \|_{Y^{s,b}_{\alpha}} \doteq \left( \int_{\mathbb{R}^2} (1+|\tau|)^{\frac{2s}{3}} (1+|\tau-\alpha\xi^3|)^{2b} |\widehat{u}(\xi,\tau)|^2 d\xi d\tau \right)^{1/2}. \end{equation} Also, we need the restriction space $Y_{\alpha,\mathbb{R}^+\times(0, T)}^{s,b}$, which is defined as follows \begin{equation} \label{sb-restrict-Y} Y_{\alpha,\mathbb{R}^+\times(0, T)}^{s,b} \doteq \{ u: u(x,t) = \tilde{u}(x,t) \;\;\mbox{on}\;\; \mathbb{R}^+\times(0,T) \,\, \text{with} \,\, \tilde{u}\in Y^{s,b}_{\alpha}(\mathbb{R}^2) \}, \end{equation} and which is equipped with the norm \begin{equation} \label{sb-restrict-norm-Y} \| u\|_{Y_{\alpha,\mathbb{R}^+\times(0, T)}^{s,b}} \doteq \inf\limits_{\tilde{u}\in Y^{s,b}_{\alpha}}\left\{ \| \tilde{u}\|_{Y^{s,b}_{\alpha}}: \;\tilde{u}(x,t) = u(x,t) \;\;\mbox{on}\;\; \mathbb{R}^+\times(0,T) \right\}. \end{equation} For $\alpha=1$ we simplify the notation for the spaces defined above as follows $$ X^{s,b} \doteq X^{s,b}_{1}, \quad X^{s,b,\theta} \doteq X^{s,b,\theta}_{1} \quad \text{and} \quad Y^{s,b} \doteq Y^{s,b}_{1}. $$ \noindent Finally, to state our results concisely we need the following definition of critical Sobolev exponent: \begin{minipage}{0.5\linewidth} \begin{equation} \label{MB-critical-sob-index} s_{c}(\alpha) \doteq \begin{cases} 0, \quad &0<\alpha<4 \,\, \text{and} \,\, \alpha\ne 1, \\ -\frac34^+, \quad &\alpha=1 \,\, \text{or} \,\, \alpha>4, \\ \frac34, \quad &\alpha=4. \end{cases} \end{equation} \end{minipage} \noindent \begin{minipage}{0.5\linewidth} \begin{center} \begin{tikzpicture}[yscale=1.3, xscale=1] \newcommand\X{0}; \newcommand\Y{0}; \newcommand\FX{8}; \newcommand\FY{8}; \newcommand\R{0.6}; \newcommand*{\TickSize}{2pt}; \draw[black,line width=0.5pt,-{Latex[black,length=2mm,width=2mm]}] (0,0) -- (6,0) node[above] {\fontsize{\FX}{\FY} \textcolor{black}{$\alpha$}}; \draw[black,line width=0.5pt,-{Latex[black,length=2mm,width=2mm]}] (0,-1) -- (0,1.3) node[right] {\fontsize{\FX}{\FY} \textcolor{black}{$s_{c}(\alpha)$}}; \draw[dashed,black,line width=0.5pt] (0,0) node[xshift=-0.2cm, yshift=0cm] {\fontsize{\FX}{\FY} $0$} (0,-3/4) node[xshift=-0.25cm, yshift=0cm] {\fontsize{\FX}{\FY}$-\frac34$} -- (0.1,-3/4) (1,-3/4) node[red,xshift=0cm, yshift=0cm] {$\bullet$} -- (1,-0.05) node[xshift=0cm, yshift=0.3cm] {\fontsize{\FX}{\FY} $1$} (0,3/4) node[xshift=-0.2cm, yshift=0cm] {\fontsize{\FX}{\FY}\bf $\frac34$} -- (0.1,3/4) (4,3/4) node[red,xshift=0cm, yshift=0cm] {$\bullet$} -- (4,0.05) node[xshift=0cm, yshift=-0.3cm] {\fontsize{\FX}{\FY}\bf $4$} (1,0) node[xshift=0cm, yshift=0cm] {$\circ$} (4,0) node[xshift=0cm, yshift=0cm] {$\circ$} (4,-3/4) node[xshift=0cm, yshift=0cm] {$\circ$} ; \draw[red,line width=1.5pt] (0,0) -- (0.9,0) (1.1,0) -- (3.9,0) (4.1,-3/4) -- (5.5,-3/4) ; \end{tikzpicture} \end{center} \end{minipage} \begin{theorem} [\textcolor{blue}{Well-posedness for the Robin and Neumann ibvp's}] \label{thm-MB-half-line-Rob} Let $\alpha>0$. \vskip0.03in \noindent $\bullet$ If $\gamma_1\le 0$ and $\gamma_2\le 0$, then for $s_c(\alpha)\le s<\frac32$, initial data $(u_0, v_0) \in H^s(0,\infty)\times H^s(0,\infty)$, and boundary data $(\varphi_1,\varphi_2)\in H_t^\frac{s}{3}(0,T)\times H_t^\frac{s}{3}(0,T)$, there is a lifespan $0 < T_0\leq T<\frac12$ such that the MB system ibvp \eqref{Rob-MBsys} admits a unique solution $(u,v)\in X^{s,b,\theta}_{1,\mathbb{R}^+\times(0,T_0)}\times X^{s,b,\theta}_{\alpha,\mathbb{R}^+\times(0,T_0)}$ satisfying the size estimate \begin{align} \label{X-norm-def-Rob1} \|u\|_{X^{s,b,\theta}_{1,\mathbb{R}^+\times(0,T_0)}} \hskip-0.1in + \|v\|_{X^{s,b,\theta}_{\alpha,\mathbb{R}^+\times(0,T_0)}} \hskip-0.05in \lesssim \Big[ \| u_0 \|_{H^{s}(\mathbb{R}^+)} + \| v_0 \|_{H^{s}(\mathbb{R}^+)} + \|\varphi_1\|_{H_t^\frac{s}{3}(0,T)} + \|\varphi_2\|_{H_t^\frac{s}{3}(0,T)} \Big], \end{align} for some $b\in(0,\frac12)$ and $\theta\in (\frac12,1)$. Also, an estimate for the lifespan is given by \begin{align} \label{MB-lifespan-Rob1} T_0 =c_0 \Big[ 1 + \| u_0 \|_{H^{s}(\mathbb{R}^+)} + \| v_0 \|_{H^{s}(\mathbb{R}^+)} + \|\varphi_1\|_{H_t^\frac{s}{3}(0,T)} + \|\varphi_2\|_{H_t^\frac{s}{3}(0,T)} \Big]^{-4/\beta}, \end{align} where $\beta$ is given by \eqref{beta-choice}. Finally, the data to solution map $\{u_0, v_0, \varphi_1, \varphi_2\}\mapsto (u,v)$ is locally Lipschitz continuous. \vskip0.05in \noindent $\bullet$ If $\gamma_1>0 $ or $\gamma_2> 0$, then the above conclusions hold for $\max\{0, s_c(\alpha)\}\le s<\frac32$. \end{theorem} Well-posedness results for the Robin and Neumann problems of the KdV and NLS equations with smooth data were obtained in \cite{hmy2021, hm2021}. Furthermore, these problems for KdV and rough data were studied in \cite{hy2022-Robin}. The common ingredient in both situations was the employment of the Fokas method for solving the corresponding forced linear ibvp. \vskip0.05in \noindent \textbf{\large The Dirichlet ibvp.} Concerning the Dirichlet problem for the MB system \begin{subequations} \label{KdV-sys} \begin{align} \label{KdV-eqn1} & \partial_tu+\partial_x^3u+ \partial_x(v^2) = 0, \quad x\in\mathbb{R}^+, \,\, t\in(0,T), \\ \label{KdV-eqn2} & \partial_tv+\alpha\partial_x^3v+ \partial_x(uv) = 0, \\ \label{KdV-sys-ic} &(u,v)(x,0) = (u_0,v_0)(x), \quad x\in\mathbb{R}^+, \\ \label{KdV-sys-bc} &(u,v)(0, t) = (g_0,h_0)(t), \quad \, t\in(0,T), \end{align} \end{subequations} we shall need the following compatibility conditions \begin{equation} \label{comp-cond} u_0(0) = g_0(0), \quad \text{and} \quad v_0(0) = h_0(0), \qquad \frac12<s<\frac32. \end{equation} Our local well-posedness result for this problem is the following, which is stated concisely by using the critical Sobolev exponent $s_c(\alpha)$ defined in \eqref{MB-critical-sob-index}. \begin{theorem} [\textcolor{blue}{Well-posedness for MB Dirichlet ibvp}] \label{thm-MB-half-line-Dir} Let $\alpha>0$. Then, for $s_c(\alpha)\le s<\frac32$, $s\ne \frac 12$, initial data $(u_0, v_0) \in H^s(0,\infty)\times H^s(0,\infty)$ with the compatibility conditions \eqref{comp-cond}, and boundary data $(g_0,h_0)\in H_t^\frac{s+1}{3}(0,T)\times H_t^\frac{s+1}{3}(0,T)$, there is a lifespan $0 < T_0\leq T<\frac12$ such that Majda-Biello system ibvp \eqref{KdV-sys} admits a unique solution $(u,v)\in X^{s,b,\theta}_{1,\mathbb{R}^+\times(0,T_0)}\times X^{s,b,\theta}_{\alpha,\mathbb{R}^+\times(0,T_0)}$ satisfying the size estimate \begin{align} \label{X-norm-def-Dir1} \|u\|_{X^{s,b,\theta}_{1,\mathbb{R}^+\times(0,T_0)}} \hskip-0.1in + \|v\|_{X^{s,b,\theta}_{\alpha,\mathbb{R}^+\times(0,T_0)}} \hskip-0.05in \lesssim \Big[ \| u_0 \|_{H^{s}(\mathbb{R}^+)} + \| v_0 \|_{H^{s}(\mathbb{R}^+)} + \|g_0\|_{H_t^\frac{s+1}{3}(0,T)} + \|h_0\|_{H_t^\frac{s+1}{3}(0,T)} \Big], \end{align} for some $b\in(0,\frac12)$ and $\theta\in (\frac12,1)$. Also, it satisfies the lifespan estimate given by \begin{align} \label{MB-lifespan-Dir1} T_0 =c_0 \Big[ 1 + \| u_0 \|_{H^{s}(\mathbb{R}^+)} + \| v_0 \|_{H^{s}(\mathbb{R}^+)} + \|g_0\|_{H_t^\frac{s+1}{3}(0,T)} + \|h_0\|_{H_t^\frac{s+1}{3}(0,T)} \Big]^{-4/\beta}, \end{align} where $\beta$ is given by \eqref{beta-choice}. Moreover, the data to solution map $\{u_0, v_0, g_0, h_0\}\mapsto (u,v)$ is locally Lipschitz continuous. \end{theorem} One can show that the Dirichlet problem for the MB system is well-posed on the half-line for all $s\ge s_c(\alpha)$ except for $\frac{s+1}{3} \in \mathbb{N}_0 +\frac 12$, and with certain additional compatibility conditions. (For the Robin and Neumann problems the excluded values are $\frac{s}{3}\in \mathbb{N}_0 +\frac 12$.) We mention that the well-posedness of the MB system with Dirichlet data for $0<\alpha<1$, $s\ne \frac 12, \frac 32$, has been studied in \cite{e2020} using the Laplace transform in the time variable for solving the forced linear ibvp. For $s>-3/4$, the analogous to Theorem \ref{thm-MB-half-line-Dir} result for KdV has been proved in \cite{hy2022-KdVm}. For smooth data the Dirichlet problem on the half-line for the KdV, NLS, and the ``good" Boussinesq equations with smooth data was studied in \cite{fhm2016, fhm2017, hm2015}. In both situations the basic ingredient in the proofs was the use of the Fokas unified transform method for producing the solution formulas of the corresponding linear ibvp. We recall that there are two other approaches for studying ibvp's. The first method, developed by Bona, Sun and Zhang \cite{bsz2002,bsz2003, bsz2018}, uses the Laplace transform in the time variable for solving the related to the equation forced linear ibvp. This method in combination with a bilinear smoothing is also used by Erdogan and Tzirakis \cite{et2016}. The second method, developed by Colliander and Kenig \cite{ck2002}, and by Holmer \cite{h2005, h2006}, expresses an ibvp as a superposition of initial value problems. \vskip0.05in \noindent \textbf{\large The Linear Neumann and Robin Problems.} In order to prove the well-posedness result for the MB system ibvp \eqref{Rob-MBsys} we first solve the corresponding forced linear ibvp for the $u$-equation % \begin{subequations} \label{Rob-LKdV} \begin{align} \label{Rob-LKdV-eqn} &\partial_tu+\partial_x^3u=f_1(x,t), \quad 0<x<\infty, \,\, 0<t<T, \\ \label{Rob-LKdV-ic} &u(x,0) = u_0(x)\in H_x^s(0,\infty), \\ \label{Rob-LKdV-bc} &u_x(0, t)+\gamma_1 u(0,t) = \varphi_1(t) \in H_t^\frac{s}{3}(0,T), \end{align} \end{subequations} and also for the $v$-equation with a different forcing \begin{subequations} \label{Rob-LKdV-v} \begin{align} \label{Rob-LKdV-eqn-v} &\partial_tv+\alpha\partial_x^3v=f_2(x,t), \quad 0<x<\infty, \,\, 0<t<T, \\ \label{Rob-LKdV-ic-v} &v(x,0) = v_0(x)\in H_x^s(0,\infty), \\ \label{Rob-LKdV-bc-v} &v_x(0, t)+\gamma_2 v(0,t) = \varphi_2(t) \in H_t^\frac{s}{3}(0,T). \end{align} \end{subequations} Using the Fokas unified transform method (UTM) we get the following {\bf UTM solution formulas} for $u$ and $v$ (see \cite{hmy2021} for a detailed derivation): \begin{align} \label{Rob-kdv-utm} &u(x,t) = S_1[u_0,\varphi_1;f_1] \\ &\doteq \frac{1}{2\pi} \int_{-\infty}^\infty e^{i\xi x+i\xi^3 t} \big[ \widehat{u}_0(\xi ) + F_1(\xi , t) \big] d\xi \nonumber \\ &+ \frac{1}{2\pi} \int_{\partial D^+} e^{i\xi x+i\xi ^3 t} \frac{ (\xi +i(\sigma+1)\gamma_1) [ F_1(\sigma \xi , T) + \widehat{u}_0(\sigma \xi )] - (\xi (\sigma+1)+i\gamma_1) [ F_1(\sigma^2 \xi , T) + \widehat{u}_0(\sigma^2 \xi )] }{ \sigma(\xi -i\gamma_1) } d\xi \nonumber \\ &- \chi_{(0,\infty)}(\gamma_1) \frac{(2+\sigma)\gamma_1}{\sigma} \Big[ \widehat{u}_0(i\sigma^2\gamma_1) + F_1(i\sigma^2\gamma_1, T) - \widehat{u}_0(i\sigma\gamma_1) - F_1(i\sigma\gamma_1, T) \Big] e^{-\gamma_1 x+\gamma_1^3t}, \qquad \nonumber \\ &+ \frac{3i}{2\pi} \int_{\partial D^+} e^{i\xi x+i\xi ^3 t} \frac{\xi ^2}{\xi -i\gamma_1} \widetilde{\varphi}_1(\xi ^3, T) d\xi \,\,-\,\, 3\chi_{(0,\infty)}(\gamma_1) \gamma_1^2 \widetilde{\varphi}_1(-i\gamma_1^3, T) e^{-\gamma_1 x+\gamma_1^3t}, \nonumber \end{align} \begin{align} \label{Rob-kdv-utm-v} &v(x,t) = S_\alpha[v_0,\varphi_2;f_2] \\ &\doteq \frac{1}{2\pi} \int_{-\infty}^\infty e^{i\xi x+i\alpha\xi^3 t} \big[ \widehat{v}_0(\xi ) + F_2(\xi , t) \big] d\xi \nonumber \\ &+ \frac{1}{2\pi} \int_{\partial D^+} e^{i\xi x+i\alpha\xi ^3 t} \frac{ (\xi +i(\sigma+1)\gamma_2) [ F_2(\sigma \xi , T) + \widehat{v}_0(\sigma \xi )] - (\xi (\sigma+1)+i\gamma_2) [ F_2(\sigma^2 \xi , T) + \widehat{v}_0(\sigma^2 \xi )] }{ \sigma(\xi -i\gamma_2) } d\xi \nonumber \\ &- \chi_{(0,\infty)}(\gamma_2) \frac{(2+\sigma)\gamma_2}{\sigma} \Big[ \widehat{v}_0(i\sigma^2\gamma_2) + F_2(i\sigma^2\gamma_2, T) - \widehat{v}_0(i\sigma\gamma_2) - F_2(i\sigma\gamma_2, T) \Big] e^{-\gamma_2 x+\alpha\gamma_2^3t}, \qquad \nonumber \\ &+ \alpha \frac{3i}{2\pi} \int_{\partial D^+} e^{i\xi x+i\alpha\xi ^3 t} \frac{\xi ^2}{\xi -i\gamma_2} \widetilde{\varphi}_2(\xi ^3, T) d\xi \,\,-\,\, \alpha 3\chi_{(0,\infty)}(\gamma_2) \gamma_2^2 \widetilde{\varphi}_2(-i\gamma_2^3, T) e^{-\gamma_2 x+\alpha\gamma_2^3t}, \nonumber \end{align} where \vskip-0.3in \begin{align} \label{sigma-def} &\hskip2in \sigma\doteq e^{\frac{2\pi}{3}i}, \\ \label{half-line-FT-ic} &\hskip0.3in \widehat {u}_0(\xi) \doteq \int_0^\infty e^{-ix\xi} u_0(x) dx, \qquad \widehat {v}_0(\xi) \doteq \int_0^\infty e^{-ix\xi} v_0(x) dx, \,\,\, \text{ Im} \xi\le 0, \\ \label{time-trans-bc} &\hskip0.3in \widetilde \varphi_1(\xi,T) \doteq \int_0^Te^{-i\xi t}\varphi_1(t)dt, \qquad \widetilde \varphi_2(\xi,T) \doteq \int_0^Te^{ -i\alpha\xi t }\varphi_2(t)dt, \\ \label{time-trans-F1} &F_1(\xi,t) \doteq \int_0^t e^{-i\xi^3\tau}\widehat f_1(\xi,\tau)d\tau = \int_0^t e^{-i\xi^3\tau}\int_0^\infty e^{-i\xi x}f_1(x,\tau)dxd\tau, \quad t\in (0,T), \\ \label{time-trans-F2} &F_2(\xi,t) \doteq \int_0^t e^{ -i\alpha\xi^3\tau } \widehat f_2(\xi,\tau)d\tau = \int_0^t e^{ -i\alpha\xi^3\tau }\int_0^\infty e^{-i\xi x}f_2(x,\tau)dxd\tau, \quad t\in (0,T), \end{align} and $D^+$ is the domain in the complex $\xi$-plane displayed in Figure \ref{domain-D-pos-Rob} when $\gamma_j>0$ (making $i\gamma_j$ a singularity), and Figure \ref{domain-D-neg-Rob} when $\gamma_j\le 0$. \hskip-0.3in \begin{minipage}{0.56\linewidth} \begin{center} \begin{tikzpicture}[scale=0.75] \newcommand\X{0}; \newcommand\Y{0}; \newcommand\FX{9}; \newcommand\FY{9}; \newcommand\R{0.6}; \filldraw [fill=gray, fill opacity=0.2, draw opacity=0.01] (0,0)--(-1.5,{3/2*sqrt(3)}) to[out=25,in=175] (1.5,{3/2*sqrt(3)})--cycle; \filldraw [fill=gray, fill opacity=0.2, draw opacity=0.01] (0,0)--(-1.5,{-3/2*sqrt(3)}) arc (240:180:3cm)--cycle; \filldraw [fill=gray, fill opacity=0.2, draw opacity=0.01] (0,0)--(1.5,{-3/2*sqrt(3)}) arc (-60:0:3cm)--cycle; \draw[middlearrow={Stealth[scale=1.3]},blue,line width=0.5pt] (0,0) -- (60:3); \draw[middlearrow={Stealth[scale=1.3,reversed]},blue,line width=0.5pt] (0,0) -- (120:3); \draw[black,line width=0.5pt] (0,0) -- (180:3); \draw[black,line width=0.5pt] (0,0) -- (0:3); \draw[black,line width=0.5pt] (0,0) -- (-60:3); \draw[black,line width=0.5pt] (0,0) -- (-120:3); \draw (0.5,0) node[xshift=0.1cm,yshift=0.3cm] {\fontsize{\FX}{\FY} $\frac{\pi}{3}$} arc (0:60:0.5); \draw (-0.5,0) node[xshift=-0.2 cm,yshift=0.3cm] {\fontsize{\FX}{\FY} $\frac{\pi}{3}$} arc (180:120:0.5); \draw [] (0.8,2.5) node {\it\fontsize{\FX}{\FY} $D^+$}; \draw [] (0,1.7) node {$\bullet$}; \draw [] (0,1.7) node[yshift=-0.1cm,xshift=0.25cm] {\it\fontsize{\FX}{\FY} $i\gamma_j$}; \draw[dashed, line width=0.5pt] (0,-2.8) -- (0,2.85) ; \draw[line width=0.5pt, black] (2,2.5)--(2,2) (2.5,2)--(2,2); \node[] at ({2.2},{2.3}) {\fontsize{\FX}{\FY} $\xi$}; \end{tikzpicture} \end{center} \vskip-0.15in \captionof{figure}{The domain $D^+$ with $\gamma_j>0$} \label{domain-D-pos-Rob} \end{minipage} \hskip-0.3in \begin{minipage}{0.56\linewidth} \begin{center} \begin{tikzpicture}[scale=0.75] \newcommand\X{0}; \newcommand\Y{0}; \newcommand\FX{9}; \newcommand\FY{9}; \newcommand\R{0.6}; \filldraw [fill=gray, fill opacity=0.2, draw opacity=0.01] (0,0)--(-1.5,{3/2*sqrt(3)}) to[out=25,in=175] (1.5,{3/2*sqrt(3)})--cycle; \filldraw [fill=gray, fill opacity=0.2, draw opacity=0.01] (0,0)--(-1.5,{-3/2*sqrt(3)}) arc (240:180:3cm)--cycle; \filldraw [fill=gray, fill opacity=0.2, draw opacity=0.01] (0,0)--(1.5,{-3/2*sqrt(3)}) arc (-60:0:3cm)--cycle; \draw[middlearrow={Stealth[scale=1.3]},blue,line width=0.5pt] (0,0) -- (60:3); \draw[middlearrow={Stealth[scale=1.3,reversed]},blue,line width=0.5pt] (0,0) -- (120:3); \draw[black,line width=0.5pt] (0,0) -- (180:3); \draw[black,line width=0.5pt] (0,0) -- (0:3); \draw[black,line width=0.5pt] (0,0) -- (-60:3); \draw[black,line width=0.5pt] (0,0) -- (-120:3); \draw (0.5,0) node[xshift=0.1cm,yshift=0.3cm] {\fontsize{\FX}{\FY} $\frac{\pi}{3}$} arc (0:60:0.5); \draw (-0.5,0) node[xshift=-0.2 cm,yshift=0.3cm] {\fontsize{\FX}{\FY} $\frac{\pi}{3}$} arc (180:120:0.5); \draw [] (0.8,2.5) node {\it\fontsize{\FX}{\FY} $D^+$}; \draw [] (0,-1.5) node {$\bullet$}; \draw [] (0,-1.5) node[yshift=-0.25cm,xshift=0.2cm] {\it\fontsize{\FX}{\FY} $i\gamma_j$}; \draw [] (0,0) node {$\bullet$}; \draw[dashed, line width=0.5pt] (0,-2.8) -- (0,2.85) ; \draw[line width=0.5pt, black] (2,2.5)--(2,2) (2.5,2)--(2,2); \node[] at ({2.2},{2.3}) {\fontsize{\FX}{\FY} $\xi$}; \end{tikzpicture} \end{center} \vskip-0.15in \captionof{figure}{The domain $D^+$ with $\gamma_j \le0$} \label{domain-D-neg-Rob} \end{minipage} \vskip.05in \noindent The second step of our approach is to estimate the UTM solution formula \eqref{Rob-kdv-utm} and \eqref{Rob-kdv-utm-v} in Bourgain spaces. Doing so we derive the linear estimates contained in the following result. \begin{theorem} [\textcolor{blue}{Linear estimates for the Robin and Neumann ibvp}] \label{thm-MB-forced-linear-Rob} Let $\alpha>0$. Also, assume that $0<b<1/2$ and $1/2<\theta < \min\{ \frac{1}{2} +\frac 13 (s+\frac32),1 \}$. Then, the Fokas formula \eqref{Rob-kdv-utm} defines a solution $u$ to the ibvp \eqref{Rob-LKdV} which is in the space $ X^{s,b,\theta}_{1,\mathbb{R}^+\times (0,T)}$ and satisfies the estimates \begin{align} \label{MB-forced-linear-est1-Rob} &\|S_1\big[u_0,\varphi_1;f_1\big]\|_{X_{1,\mathbb{R}^+\times(0,T)}^{s,b,\theta}} \le c\big[ \|u_0\|_{H_x^{s}(\mathbb{R}^+)} + \|\varphi_1\|_{H_t^\frac{s}{3}(0,T)} + \|f_1\|_{X^{s,-b,\theta-1}_{1,\mathbb{R}^+\times(0,T)}} + \|f_1\|_{Y^{s,-b}_{1,\mathbb{R}^+\times(0,T)}} \big], \end{align} where $-\frac32<s<\frac32$ if $\gamma_1\le 0$, and $0\le s<\frac32$ if $\gamma_1>0$. Also, the Fokas formula \eqref{Rob-kdv-utm-v} define a solution $v$ to the ibvp \eqref{Rob-LKdV-v} in the space $X^{s,b,\theta}_{\alpha,\mathbb{R}^+\times (0,T)}$ satisfying the estimates \begin{align} \label{MB-forced-linear-est2-Rob} &\|S_\alpha\big[v_0,\varphi_2;f_2\big]\|_{X_{\alpha,\mathbb{R}^+\times(0,T)}^{s,b,\theta}} \hskip-0.05in \le c\big[ \|v_0\|_{H_x^{s}(\mathbb{R}^+)} + \|\varphi_2\|_{H_t^\frac{s}{3}(0,T)} + \|f_2\|_{X^{s,-b,\theta-1}_{\alpha,\mathbb{R}^+\times(0,T)}} + \|f_2\|_{Y^{s,-b}_{\alpha,\mathbb{R}^+\times(0,T)}} \big], \end{align} where $-\frac32<s<\frac32$ if $\gamma_2\le 0$, and $0\le s<\frac32$ if $\gamma_2>0$. \end{theorem} \noindent {\bf From Robin to Neumann.} If we let $\gamma_1=\gamma_2=0$ in the Robin problem \eqref{Rob-MBsys}, then we get the Neumann problem for the MB system, and our well-posedness Theorem \ref{thm-MB-half-line-Rob} becomes a result for the Neumann problem. Also, letting $\gamma_2=0$ in the UTM solution formula \eqref{Rob-kdv-utm-v}, using the facts that $ \frac1\sigma = \sigma^2 $ and $ \sigma+1 = -\sigma^2, $ we get the solution to the Neumann problem (for the linear $v$-equation involving $\alpha$) \begin{align*} v(x,t) &= \frac{1}{2\pi} \int_{-\infty}^\infty e^{i\xi x+i\alpha\xi^3 t} \big[ \widehat{v}_0(\xi) + F_2(\xi, t) \big] d\xi \\ &+ \frac{1}{2\pi} \int_{\partial D^+} e^{i\xi x+i\alpha\xi^3 t} \left\{ \sigma^2 [ F_2(\sigma \xi, T) + \widehat{v}_0(\sigma \xi)] +\sigma [ F_2(\sigma^2 \xi, T) + \widehat{v}_0(\sigma^2 \xi)] \right\} d\xi \\ &+ \alpha \frac{3i}{2\pi} \int_{\partial D^+} e^{i\xi x+i\alpha\xi^3 t} \xi \widetilde{\varphi}_2(\xi^3, T) d\xi, \hskip0.2in \varphi_2(t)=v_x(0,t), \,\, \text{when } \gamma_2=0. \end{align*} \vskip0.05in \noindent \textbf{\large The Linear Dirichlet Problem.} As in the case of the Robin problem, the first step in our approach is to solve the corresponding forced Dirichlet problem for the linear MB system, which decouples to the $u$-equation problem with forcing $f_1$ % \begin{subequations} \label{LKdV} \begin{align} \label{LKdV-eqn} &\partial_tu+\partial_x^3u=f_1(x,t), \quad 0<x<\infty, \,\, 0<t<T, \\ \label{LKdV-ic} &u(x,0) = u_0(x)\in H_x^s(0,\infty), \\ \label{LKdV-bc} &u(0, t) = g_0(t) \in H_t^\frac{s+1}{3}(0,T), \end{align} \end{subequations} and to the $v$-equation Dirichlet problem with forcing $f_2$ \begin{subequations} \label{LKdV-v} \begin{align} \label{LKdV-eqn-v} &\partial_tv+\alpha\partial_x^3v=f_2(x,t), \quad 0<x<\infty, \,\, 0<t<T, \\ \label{LKdV-ic-v} &v(x,0) = v_0(x)\in H_x^s(0,\infty), \\ \label{LKdV-bc-v} &v(0, t) = h_0(t) \in H_t^\frac{s+1}{3}(0,T). \end{align} \end{subequations} Again, employing the Fokas method we obtain the following {\bf UTM solution formulas} (see Section \ref{sec:utm-deriv} for an outline of the derivation): \begin{align} \label{kdv-utm} &u(x,t) = S_1\big[u_0,g_0;f_1\big](x, t) \doteq \frac{1}{2\pi}\int_{-\infty}^\infty e^{i\xi x+i\xi^3t} [\widehat {u}_0(\xi)+F_1(\xi,t)]d\xi \\ +& \frac{1}{2\pi}\int_{\partial D^+} e^{i\xi x+i\xi^3t} \big\{ \sigma[\widehat u_0(\sigma \xi) + F_1(\sigma \xi,t)]+\sigma^2[\widehat u_0(\sigma^2 \xi)+F_1(\sigma^2 \xi,t)] - 3\xi^2 \tilde g_0(\xi^3,T) \big\}d\xi, \nonumber \end{align} \begin{align} \label{kdv-utm-v} &v(x,t) = S_{\alpha}\big[v_0,h_0;f_2\big](x, t) \doteq \frac{1}{2\pi}\int_{-\infty}^\infty e^{i\xi x+ i\alpha\xi^3t } [\widehat {v}_0(\xi)+F_2(\xi,t)]d\xi \\ +& \frac{1}{2\pi}\int_{\partial D^+} e^{i\xi x+ i\alpha\xi^3t } \big\{ \sigma[\widehat v_0(\sigma \xi) + F_2(\sigma \xi,t)]+\sigma^2[\widehat v_0(\sigma^2 \xi)+F_2(\sigma^2 \xi,t)] - 3 \alpha \xi^2 \tilde h_0(\xi^3,T) \big\}d\xi, \nonumber \end{align} where $\sigma, \widehat{u}_0, \widehat{v}_0, F_1, F_2$ are given in \eqref{sigma-def}, \eqref{half-line-FT-ic}, \eqref{time-trans-F1}, \eqref{time-trans-F2} respectively and \begin{equation} \label{Rob-time-trans-bc} \tilde g_0(\xi^3,T) \doteq \int_0^Te^{-i\xi^3 t} g_0(t) dt, \qquad \tilde h_0(\xi^3,T) \doteq \int_0^Te^{ -i\alpha\xi^3 t } h_0 (t)dt. \end{equation} \begin{minipage}{1\linewidth} \begin{center} \begin{tikzpicture}[scale=0.75] \newcommand\X{0}; \newcommand\Y{0}; \newcommand\FX{9}; \newcommand\FY{9}; \newcommand\R{0.6}; \filldraw [fill=gray, fill opacity=0.2, draw opacity=0.01,variable=\x,domain={pi/3}:{2*pi/3}] (0,0)-- plot({3*cos(deg(\x))},{3*sin(deg(\x))}) --cycle; \draw[middlearrow={Stealth[scale=1.3]},blue,line width=0.5pt] (0,0) -- (60:3); \draw[middlearrow={Stealth[scale=1.3,reversed]},blue,line width=0.5pt] (0,0) -- (120:3); \draw[black,line width=0.5pt ] (0,0) -- (180:3); \draw[ black,line width=0.5pt ] (0,0) -- (0:3); \draw (0.5,0) node[xshift=0.1cm,yshift=0.2cm] {\fontsize{\FX}{\FY} $\frac{\pi}{3}$} arc (0:60:0.5); \draw (-0.5,0) node[xshift=-0.2 cm,yshift=0.2cm] {\fontsize{\FX}{\FY} $\frac{\pi}{3}$} arc (180:120:0.5); \draw [] (0,1.5) node[xshift=0.5cm,yshift=0.8cm] {\fontsize{\FX}{\FY} $D^+$}; \draw[line width=0.5pt, black] (2,3)--(2,2.5) (2.5,2.5)--(2,2.5); \node[] at ({2.2},{2.8}) {\fontsize{\FX}{\FY} $\xi$}; \draw[dashed, line width=0.5pt, -{latex[length=3mm, width=2mm]} ] (0,0) -- (0,3.5) ; \end{tikzpicture} \end{center} \vskip-0.15in \captionof{figure}{Domain $D^+$} \label{kdv-domain} \end{minipage} \vskip0.05in Next, we state the linear estimates for the Dirichlet Problem. \begin{theorem} [\textcolor{blue}{Linear estimates for Dirichlet ibvp}] \label{thm-MB-forced-linear-Dir} Let $\alpha>0$. Suppose that $-\frac32< s<\frac32$, $s\neq\frac12$, $0<b<1/2$ and $1/2<\theta < \min\{ \frac{1}{2} +\frac 13 (s+\frac32),1 \}$. Then, under the compatibility conditions \eqref{comp-cond}, the Fokas formula \eqref{kdv-utm} and \eqref{kdv-utm-v} define a solution $u,v$ to the ibvp \eqref{LKdV} and \eqref{LKdV-v} respectively, which are in the space $ X^{s,b,\theta}_{1,\mathbb{R}^+\times (0,T)}$ and $X^{s,b,\theta}_{\alpha,\mathbb{R}^+\times (0,T)}$, satisfying the estimates \begin{align} \label{MB-forced-linear-est1-Dir} &\|S_{1}\big[u_0,g_0;f_1\big]\|_{X_{1,\mathbb{R}^+\times(0,T)}^{s,b,\theta}} \le c\big[ \|u_0\|_{H_x^{s}(\mathbb{R}^+)} + \|g_0\|_{H_t^\frac{s+1}{3}(0,T)} + \|f_1\|_{X^{s,-b,\theta-1}_{1,\mathbb{R}^+\times(0,T)}} + \|f_1\|_{Y^{s,-b}_{1,\mathbb{R}^+\times(0,T)}} \big], \\ \label{MB-forced-linear-est2-Dir} &\|S_{\alpha}\big[v_0,h_0;f_2\big]\|_{X_{\alpha,\mathbb{R}^+\times(0,T)}^{s,b,\theta}} \le c\big[ \|v_0\|_{H_x^{s}(\mathbb{R}^+)} + \|h_0\|_{H_t^\frac{s+1}{3}(0,T)} + \|f_2\|_{X^{s,-b,\theta-1}_{\alpha,\mathbb{R}^+\times(0,T)}} + \|f_2\|_{Y^{s,-b}_{\alpha,\mathbb{R}^+\times(0,T)}} \big]. \end{align} \end{theorem} The third and final step of our method for proving Theorems \ref{thm-MB-half-line-Rob} and \ref{thm-MB-half-line-Dir} consists of deriving appropriate bilinear estimates for the coupled nonlinearities, considering that the iteration map defined by the UTM formulas \eqref{Rob-kdv-utm}, \eqref{Rob-kdv-utm-v} and \eqref{kdv-utm}, \eqref{kdv-utm-v} of the corresponding forced linear MB system with forcing terms $f_1$ and $f_2$ are replaced by the nonlinearities $\partial_x(v^2)$ and $\partial_x(uv)$. Looking at the linear estimates \eqref{MB-forced-linear-est1-Rob}, \eqref{MB-forced-linear-est2-Rob} for the Robin problem, and the linear estimates \eqref{MB-forced-linear-est1-Dir}, \eqref{MB-forced-linear-est2-Dir} for Dirichlet problem, we see that in order to obtain a contraction map we must estimate the spatial modified Bourgain norms $\|\partial_x(v^2)\|_{X^{s,-b,\theta-1}_{1,\mathbb{R}^+\times(0,T)}}$, $\|\partial_x(uv)\|_{X^{s,-b,\theta-1}_{\alpha,\mathbb{R}^+\times(0,T)}}$ and the temporal Bourgain norms $\|\partial_x(v^2)\|_{Y^{s,-b}_{1}}$, $\|\partial_x(uv)\|_{Y^{s,-b}_{\alpha}}$ appropriately. All these estimates are included in our next result, which is stated concisely by using critical exponent $s_c(\alpha)$ defined in \eqref{MB-critical-sob-index}. \begin{theorem} [\textcolor{blue}{Bilinear estimates}] \label{mb-bilinear-est} Let $\alpha>0$. If $s\ge s_c(\alpha)$, then for any $\frac12-\beta_1\le b'\le b<\frac12<\theta'\le \theta\le \frac12+\beta_1$, where $\beta_1=\beta_1(s)$ is given below, % \begin{equation} \label{beta1-choice} \beta_1 \doteq \begin{cases} \frac1{36}, \quad & s\ge 0, \\ \frac1{96}[s+\frac34], \quad & -\frac34<s<0, \end{cases} \end{equation} % we have the bilinear estimates in the modified Bourgain spaces \begin{equation} \label{bi-est-X-1} \| \partial_x(fg) \|_{X^{s,-b,\theta-1}_{1}} \le c_2 \| f \|_{X^{s,b',\theta'}_{\alpha}} \| g \|_{X^{s,b',\theta'}_{\alpha}}, \end{equation} \begin{equation} \label{bi-est-X-2} \| \partial_x(fg) \|_{X^{s,-b,\theta-1}_{\alpha}} \le c_2 \| f \|_{X^{s,b',\theta'}_{\alpha}} \| g \|_{X^{s,b',\theta'}_{1}}. \end{equation} In addition, if $ s_c(\alpha)\le s<3$, then for any $\frac12-\beta\le b'\le b<\frac12<\theta'\le \theta\le \frac12+\beta$, where % \begin{equation} \label{beta-choice} \beta \doteq \min\{\beta_1,\frac{3-s}{36}\}, \end{equation} we have the bilinear estimates in the ``temporal" Bourgain spaces \begin{equation} \label{bi-est-Y-1} \| \partial_x(fg) \|_{Y^{s,-b}_{1}} \le c_2 \| \partial_x(fg) \|_{X^{s,-b}_{1}} + c_2 \| f \|_{X^{s,b'}_{\alpha}} \| g \|_{X^{s,b'}_{\alpha}}, \end{equation} \begin{equation} \label{bi-est-Y-2} \| \partial_x(fg) \|_{Y^{s,-b}_{\alpha}} \le c_2 \| \partial_x(fg) \|_{X^{s,-b}_{\alpha}} + c_2 \| f \|_{X^{s,b'}_{\alpha}} \| g \|_{X^{s,b'}_{1}}. \end{equation} \end{theorem} Such bilinear estimates in Bourgain spaces for KdV have been used by many authors (see for example \cite{b1993-kdv, kpv1996, ck2002, ckstt2003, Fa2004, h2006}) and play a central role in the analytic theory of dispersive equations. The key ingredients in the proof of these bilinear estimates are the following two Bourgain quantities \begin{align} \label{u-Bourgain-q} &d_{\alpha}(\xi,\xi_1) \doteq (\tau-\xi^3)-(\tau_1-\alpha\xi_1^3)-[\tau-\tau_1-\alpha(\xi-\xi_1)^3] = -\xi^3+\alpha\xi_1^3+\alpha(\xi-\xi_1)^3, \\ &\widetilde{d}_{\alpha}(\xi,\xi_1) \doteq (\tau-\alpha\xi^3)-(\tau_1-\xi_1^3)-[\tau-\tau_1-\alpha(\xi-\xi_1)^3] = -\alpha\xi^3+\xi_1^3+\alpha(\xi-\xi_1)^3, \end{align} that appear in the denominator of the multipliers when these estimates are expressed in their $L^2$ form (see, for example, \eqref{bilinear-est-L2-form}). Note that $d_{\alpha}$ is associated with the $u$-equation and $\widetilde{d}_{\alpha}$ with the $v$-equation. Their zeros, which are lines (at most three) in the $(\xi_1,\xi)$-plane passing through the origin, are causing resonances influencing the value of the critical exponent $s$ above which the related bilinear estimates hold. Notice that for $\alpha =1$, which is the KdV-KdV system case, the two quantities are the same and this results to less resonances and to the lower critical exponent $-3/4$. \vskip0.05in Next, we state our last result which follows from counterexamples to bilinear estimates. \begin{theorem} \label{optimal-thm} The bilinear estimates in Theorem \ref{mb-bilinear-est} are optimal, i.e. they hold only for $s\ge s_c(\alpha)$. \end{theorem} \noindent A direct implication of Theorem \ref{optimal-thm} is that our well-posedness Theorems \ref{thm-MB-half-line-Rob} and \ref{thm-MB-half-line-Dir} are optimal. \vskip0.05in The unified transform method (UTM), also known as the Fokas method \cite{f1997}, provides a novel approach for solving initial-boundary value problems for linear and integrable nonlinear partial differential equations. In particular, it gives solution formulas for forced linear ibvp's like the ones used in our work here. For further results on ibvp's for KdV, NLS, Boussinesq, heat, and related equations we refer the reader to \cite{bfo2020, dtv2014, f1997, f2002, fpbook2015, fis2005, fs2012, hmy2019, hm2015, hm2020, hm2021, fl2012, lf2012a, lenells2013, oy2019, f2002, y2020} and the references therein. Finally, for a thorough introduction to the Fokas method we refer to the monograph \cite{f2008}. The initial value problem for the Majda-Biello system on both the line $\mathbb{R}$ and the circle $\mathbb{T}$ was investigated by Oh \cite{o2009-1, o2009-2} using Bourgain spaces and bilinear estimates. For data in Sobolev space in $H^s(\mathbb{R})\times H^s(\mathbb{R})$ local and global well-posedness was proved for $s\ge 0$ when $0<\alpha<1$, and for $s> -3/4$ when $\alpha=1$. On the circle, local and global well-posedness was proved in $H^s(\mathbb{T})\times H^s(\mathbb{T})$, $s\ge -1/2$, when $\alpha=1$. When $0<\alpha<1$, then the Majda-Biello system is locally well-posed on $H^s(\mathbb{T})\times H^s(\mathbb{T})$ for $s\ge s^*(\alpha)$ where $s^*(\alpha)$ is described by using Diophantine conditions that are generated by the resonance relations introduced via the bilinear estimates in the two Bourgain norms corresponding to the two symbols. In particular, this implies well-posedness for $s>1/2$ for almost every $\alpha\in (0, 1)$. Again on the circle, global well-posedness of the MB system in homogeneous Sobolev spaces for $s\ge 0$ was proved in \cite{gst2015} using a different approach based on a successive time-averaging method. Next we recall the well-posedness results for the KdV equation with rough data. Its well-posedness in $H^s(\mathbb{T})$ (and also in $H^s(\mathbb{R})$) when $s\ge 0$ was proved by Bourgain \cite{b1993-kdv} by introducing the well-known $X^{s,b}$ spaces. Utilizing these spaces Kenig, Ponce and Vega \cite{kpv1996} prove the local well-posedness of KdV on the line for $s> -3/4$, and on the circle for $s\ge -1/2$. Furthermore, Colliander, Keel, Staffilani, Takaoka, Tao \cite{ckstt2003} proved its global well-posedness for the same range of Sobolev exponents. It is worth noticing that for $\alpha=1$ the MB system and the KdV equation have the same critical well-posedness exponent on $\mathbb{R}$ or $\mathbb{T}$. % For additional results we refer the reader to \cite{cks1992, bs1975, b1993-nls, {flpv2018}, kato1983, kpv1989, kpv1991-reg, kpv1991, kpv1993, kpv2001, kv2019, lpbook,ckt2003, st1976} and the references therein. \noindent {\it Organization.} The rest of the paper is organized as follows. In Section 2 we provide the proof of the linear estimates for the MB Robin and Neumann problems utilizing its UTM solution formulas, starting with the reduced pure ibvp. In Section 3, we derive the linear estimates for the Dirichlet problem of the forced linear MB system. Using the linear estimates and the needed bilinear estimates, in Section 4 we provide the proof of well-posedness for the Robin and Neumann problems. The proof for the Dirichlet problem is similar. In Section 5 we derive the required bilinear estimates in spatial modified Bourgain spaces, and in Section 6 we derive the corresponding bilinear estimates in temporal Bourgain spaces. Then, in Section 7 we demonstrate the optimality of the bilinear estimates proved in Sections 5 and 6. This implies the optimality of our well-posedness results (Theorems \ref{thm-MB-half-line-Rob} and \ref{thm-MB-half-line-Dir}). Finally, in Section 8, we provide an outline for the derivation of the UTM formula in the case of the Dirichlet problem and for the equation containing the parameter $\alpha$. \section{Linear estimates for Robin and Neumann problems -- proof of Theorem \ref{thm-MB-forced-linear-Rob} } \label{Rob-Neu-linear-sec} \setcounter{equation}{0} Throughout this work, we shall use the familiar {\bf time localizer} $\psi(t)$, which is defined as follows: \begin{equation} \label{time-localizer} \psi \in C^{\infty}_0(-1, 1), \,\,\, 0\le \psi \le 1 \,\, \text{ and } \,\, \psi(t)=1 \,\, \text{ for } \,\, |t|\le 1/2. \end{equation} We prove the linear estimates \eqref{MB-forced-linear-est1-Rob}, \eqref{MB-forced-linear-est2-Rob} for the Robin ibvp, by decomposing its forced linear ibvp to simpler problems and estimate each one of them separately. We begin with the most important one. \subsection{The reduced pure linear ibvp.} This ibvp has forcing and initial data equal to zero, and boundary data compactly supported in the time interval $(0, 2)$, which for the $v$-equation is % \begin{subequations} \label{Rob-kdv-reduced} \begin{align} \label{Rob-kdv-reduced-eqn} &\partial_tv+\alpha\partial_x^{3}v=0, \quad 0<x<\infty, \,\, 0<t<2, \\ \label{Rob-kdv-reduced-ic} &v(x,0) = 0, \\ \label{Rob-kdv-reduced-bc} &v_x(0,t) + \gamma_2 v(0, t) = h(t), \quad \text{supp}(h)\subset (0, 2). \end{align} \end{subequations} We call this problem the {\bf reduced pure ibvp}. Since $\text{supp}(h)\subset (0, 2)$ we can write its time transform as a Fourier transform over $\mathbb{R}$, that is \begin{equation} \label{Rob-h-time-tran} \widetilde h(\xi,2) = \int_0^2e^{-i\alpha\xi\tau}h(\tau)d\tau = \int_\mathbb{R} e^{-i\alpha\xi\tau}h(\tau)d\tau = \hat h(\alpha\xi), \end{equation} and using it we write the Fokas solution formula \eqref{Rob-kdv-utm-v} as follows \begin{align} \label{Rob-pure-kdv-sln} v(x, t) =& S_\alpha[0,h;0](x,t) \nonumber \\ =& \frac{3\alpha i}{2\pi} \int_{\partial D^+} e^{i\xi x+i\alpha\xi^3 t} \frac{\xi^2}{\xi-i\gamma_2} \widehat{h}(\alpha\xi^3) d\xi - 3\alpha\chi_{(0,\infty)}(\gamma_2) \gamma_2^2 \widehat{h}(-i\alpha\gamma_2^3) e^{-\gamma_2 x+\gamma_2^3\alpha t}. \end{align} Utilizing formula \eqref{Rob-pure-kdv-sln} we derive the following estimates in Bourgain spaces. \begin{theorem} [\b{Estimates for pure ibvp of linear $\alpha$-KdV (Robin)}] \label{Rob-reduced-thm-kdv} For boundary data a test function $h(t)$ with $\text{supp}(h)\subset (0, 2)$, $b\in[0,\frac12)$ and $ 0 \le \theta \le 1+s/3$, the solution of the linear $\alpha$-KdV reduced pure ibvp \eqref{Rob-kdv-reduced} satisfies the following estimate in modified Bourgain spaces \begin{align} \label{Rob-reduced-pure-ibvp-B-es} \| S_{\alpha}[0,h;0] \|_{X^{s, b,\theta}_{\alpha,\mathbb{R}^+\times (0,2)}} \leq c_{s,b,\theta,\alpha} \|h\|_{H_t^{\frac{s}{3}}(\mathbb{R})}, \,\,\, s>-\frac32, \,\, \text{if} \,\, \gamma_2\le 0, \,\,\, \text{and} \,\,\, s\ge 0, \,\, \text{if} \,\, \gamma_2>0. \end{align} \end{theorem} \noindent {\bf Proof of Theorem \ref{Rob-reduced-thm-kdv}.} We follow the lines of the Robin ibvp for KdV ($\alpha=1$) in \cite{hy2022-Robin}. Parametrizing the right (left) contour of $\partial D^+$ via $[0,\infty)\ni \xi\to a \xi$ ($a^2\xi$) with $a = e^{i\frac{\pi}{3}} $, we write the solution as $ v(x,t) \simeq v_{r}(x,t)+v_{\ell}(x,t)+v_i(x,t), $ where \begin{align} \label{Rob-def-vr} v_r(x,t) = \int_0^\infty e^{ia \xi x-i\alpha\xi^3t} \frac{a^2\xi^2}{a\xi-i\gamma_2} \hat h(-\alpha\xi^3)d\xi, \end{align} \vskip-0.15in \begin{align*} v_{\ell}(x,t) = \int_0^\infty e^{ia^2\xi x+i\alpha\xi^3t} \frac{a^4\xi^2}{a^2\xi-i\gamma_2} \hat h(\alpha\xi^3)d\xi, \end{align*} \vskip-0.15in \begin{align*} v_i(x,t) = \chi_{(0,\infty)}(\gamma_2) \gamma_2^2 \widehat{h}(-i\alpha\gamma_2^3) e^{-\gamma_2 x+\gamma_2^3\alpha t}, \end{align*} with $v_i$ corresponding to the residue at the pole $i\gamma_2$ inside $D^+$, occurring only when $\gamma_2>0$. Below we estimate only $v_{r}$. The estimate $v_\ell$ is similar and we omit it. Furthermore, we split the $\xi$-integral defining \eqref{Rob-def-vr} for $\xi$ near 0 and for $\xi$ away from 0, that is, we write $ v_r = v_0 + v_1, $ where \begin{equation*} v_0(x,t) \doteq \int_0^1 e^{-i\alpha\xi ^3t}e^{ia_R\xi x}e^{-a_I \xi x} \frac{a^2\xi^2}{a\xi-i\gamma_2} \, \widehat h(-\alpha\xi ^3)d\xi, \quad x\in\mathbb{R}^+, \quad t\in(0,2), \end{equation*} \begin{equation} \label{Rob-def-v1-kdv} v_1(x,t) \doteq \int_1^\infty e^{-i\alpha\xi ^3t}e^{ia_R\xi x}e^{-a_I \xi x} \frac{a^2\xi^2}{a\xi-i\gamma_2} \, \widehat h(-\alpha\xi ^3)d\xi, \quad x\in\mathbb{R}^+ \quad t\in(0,2), \end{equation} with $a=a_R+ia_I=\frac12+i\frac{\sqrt3}{2}$, and prove estimate \eqref{Rob-reduced-pure-ibvp-B-es} for each one separately. We begin with $v_0$. \vskip.05in \noindent {\bf Proof of estimate \eqref{Rob-reduced-pure-ibvp-B-es} for $v_0$.} First we extend $v_0$ as an ``almost" even function $V_0$ of $x$ from $\mathbb{R}^+\times (0,2)$ to $\mathbb{R}\times\mathbb{R}$ as follows \begin{equation*} V_0(x,t) \doteq \int_0^1 e^{ia\xi \varphi_1(x)}e^{-i\alpha\xi ^3t} \frac{a^2\xi^2}{a\xi-i\gamma_2} \,\widehat {h}(-\alpha\xi ^3)d\xi, \quad x\in\mathbb{R}, \,\, t\in\mathbb{R}, \end{equation*} where $\varphi_1(x)$ is a smooth version of $|x|$ described below and drawn in Figure \ref{fig:phi1} \vskip-0.05in \begin{minipage}{0.49\linewidth} \begin{center} \begin{tikzpicture}[yscale=0.6, xscale=1] \newcommand\X{0}; \newcommand\Y{0}; \newcommand\FX{11}; \newcommand\FY{11}; \newcommand\R{0.6}; \newcommand*{\TickSize}{2pt}; \draw[black,line width=1pt,-{Latex[black,length=2mm,width=2mm]}] (-2.5,0) -- (2.5,0) node[above] {\fontsize{\FX}{\FY}\bf \textcolor{black}{$x$}}; \draw[black,line width=1pt,-{Latex[black,length=2mm,width=2mm]}] (0,-0.5) -- (0,3) node[right] {\fontsize{\FX}{\FY}\bf \textcolor{black}{$y$}}; \draw[line width=1pt, yscale=1,domain=-2.1:-1.2,smooth,variable=\x,red] plot ({\x},{-\x}); \draw[line width=1pt, yscale=1,domain=0:2.1,smooth,variable=\x,red] plot ({\x},{\x}); \draw[smooth,line width=1pt, red] (-0.4,-0.2) to[out=5,in=-135] (0,0) ; \draw[smooth,line width=1pt, red] (-1.2,1.2) to[out=-45,in=175] (-0.4,-0.2) ; \draw[red,dashed, line width=0.5pt] (2,1.3) node[] {\fontsize{\FX}{\FY}$\varphi_1(x)$} (0,0) node[yshift=-0.2cm,xshift=0.2cm] {\fontsize{\FX}{\FY}$0$} (-1.5,1.5) -- (-1.5,0) node[yshift=-0.2cm] {\fontsize{\FX}{\FY}$-1$}; \end{tikzpicture} \vskip-0.15in \captionof{figure}{$\varphi_1(x)$} \label{fig:phi1} \end{center} \end{minipage} \begin{minipage}{0.48\linewidth} \begin{equation} \label{phi1-x-even-ext} \varphi_1(x) = \begin{cases} x, \quad \,\,\,\, x\geq 0, \\ -x, \quad x\leq -1, \\ \text{ smooth on } \mathbb{R}. \quad \end{cases} \end{equation} \end{minipage} \noindent From the inequalities $ (1+|\xi|)^{2s} \lesssim (|\xi|^0+|\xi|^{2|s|}), $ $ (1+|\tau|)^{2\theta} \lesssim (|\tau|^0+|\tau|^{2\theta}), $ and $ (1+|\tau-\alpha\xi^3|)^{2b} \leq (1+|\tau|+\alpha|\xi|^3)^{2b} \leq (1+|\tau|)^{2b} (1+\alpha|\xi|^3)^{2b} \lesssim (|\tau|^0+|\tau|^{2b}) (|\xi|^0+|\xi|^{6b}), $ we get \begin{equation} \label{Rob-est-sb-norm-fact-no3} (1+|\xi|)^{2s} (1+|\tau-\alpha\xi^{3}|)^{2b} + \chi_{|\xi|\le 1} (1+|\tau|)^{2\theta} \lesssim (|\xi|^0+|\xi|^{6b+2|s|}) (|\tau|^0+|\tau|^{2b+2\theta}). \end{equation} Using \eqref{Rob-est-sb-norm-fact-no3} we obtain the following $L^2$ estimate for $\psi_4(t)V_0$, with $\psi_4(t)=\psi(t/4)$, \begin{align} \label{Rob-v0-L2-est} \|\psi_4 V_0\|^2_{X^{s,b,\theta}_\alpha} \lesssim \|\psi_4 V_0\|^2_{L^2_{x,t}} + \|\partial_x^{n_1}[\psi_4 V_0]\|^2_{L^2_{x,t}} + \|\partial_t^{n_2}[\psi_4 V_0]\|^2_{L^2_{x,t}} + \|\partial_x^{n_1}\partial_t^{n_2}[\psi_4 V_0]\|^2_{L^2_{x,t}}, \end{align} where $n_1 = n_1(s,b) \doteq 6\lfloor b\rfloor+2\lfloor |s|\rfloor+8 $ and $ n_2 = n_2(b,\theta) \doteq 2\lfloor b\rfloor+2\lfloor\theta\rfloor+4. $ Now, from \eqref{Rob-v0-L2-est} and an appropriate application of the $L^2$ boundness of Laplace transform \cite{fhm2017}, \cite{hardy1933} (for $\alpha=1$ a detailed proof is provided in \cite{hy2022-Robin}) we get \begin{equation} \label{Rob-L2-V0-est-kdv} \|\partial_x^{n_1}\partial_t^{n_2}[\psi_4\,V_0]\|_{L^2_{x,t}}^2 \le C_{n_1, n_2} \int_{-1}^{0} | \widehat{h}(\alpha\tau) |^2 d\tau, \end{equation} \vskip-0.15in \noindent which gives \begin{align*} \|\psi_4 V_0\|^2_{X^{s,b,\theta}_{\alpha}} \le C_{n_1, n_2} \int_{-1}^{0} (1+|\alpha\tau|)^{-2\cdot\frac{s}{3}} (1+|\alpha\tau|)^{2\cdot\frac{s}{3}} | \widehat{h}(\alpha\tau) |^2 d\tau \lesssim \|h\|_{H_t^{\frac{s}{3}}}^2, \quad s\in\mathbb{R}, b\ge 0, \theta\ge 0, \end{align*} thus arriving at the desired estimate \eqref{Rob-reduced-pure-ibvp-B-es} for $v_0$, that is $ \| v_0 \|_{X^{s, b,\theta}_{\alpha,\mathbb{R}^+\times (0,2)}}\le \|\psi_4 V_0\|_{X^{s,b,\theta}_{\alpha}}\lesssim \|h\|_{H_t^{\frac{s}{3}}}. $ \,\, $\square$ \noindent {\bf Proof of estimate \eqref{Rob-reduced-pure-ibvp-B-es} for $v_1$.} Using the identity $ \xi [ e^{ia_R\xi x} e^{-a_I\xi x} ] = \frac{1}{ia} \partial_x [ e^{ia_R\xi x} e^{-a_I\xi x} ] $ and the fact that $e^{-a_I \xi x}$ decays exponentially in $\xi$, since $x>0$, we move the $\partial_x$-derivative outside the integral sign in \eqref{Rob-def-v1-kdv} and rewrite $v_1$ as follows \begin{equation*} v_1(x,t) = \frac{1}{ia} \partial_x \int_1^\infty e^{-i\alpha\xi ^3t}e^{ia_R\xi x}e^{-a_I \xi x} \frac{a^2\xi}{a\xi-i\gamma_2} \, \widehat h(-\alpha\xi ^3)d\xi, \quad x\in\mathbb{R}^+, \quad t\in(0,2). \end{equation*} Next, we need an one-sided $C^\infty$ cutoff function $\rho(x)$, $0\le\rho(x)\le1$, $x\in\mathbb{R}$, defined as follows outside the interval $(-1, 0)$, and is increasing in $(-1, 0)$ \vskip.01in \noindent \begin{minipage}{0.6\linewidth} \begin{center} \begin{tikzpicture}[yscale=0.5, xscale=0.8] \newcommand\X{0}; \newcommand\Y{0}; \newcommand\FX{11}; \newcommand\FY{11}; \newcommand\R{0.6}; \newcommand*{\TickSize}{2pt}; \draw[black,line width=1pt,-{Latex[black,length=2mm,width=2mm]}] (-5,0) -- (5,0) node[above] {\fontsize{\FX}{\FY}\bf \textcolor{black}{$x$}}; \draw[black,line width=1pt,-{Latex[black,length=2mm,width=2mm]}] (0,0) -- (0,3) node[right] {\fontsize{\FX}{\FY}\bf \textcolor{black}{$\rho$}}; \draw[line width=1pt, yscale=2,domain=-1.5:-4.3,smooth,variable=\x,red] plot ({\x},{0}); \draw[line width=1pt, yscale=2,domain=0:4.3,smooth,variable=\x,red] plot ({\x},{1}); \draw[smooth,line width=1pt, red] (0,2) to[out=-170,in=10] (-1.5,0) ; \draw[red] (2,2.5) node[] {\fontsize{\FX}{\FY}$\rho(x)$} (0,0) node[yshift=-0.2cm] {\fontsize{\FX}{\FY}$0$} (-1.5,0) node[yshift=-0.2cm] {\fontsize{\FX}{\FY}$-1$}; \end{tikzpicture} \end{center} \end{minipage} \hskip-0.88in \begin{minipage}{0.5\linewidth} \begin{equation} \label{Rob-rho-def} \rho(x) = \begin{cases} 1, &\quad x\ge0, \\ 0, &\quad x\le -1. \end{cases} \end{equation} \end{minipage} \noindent Using $\rho(x)$ we extend $v_1$ from $\mathbb{R}^+\times(0,2)$ to $V_1$ on $\mathbb{R}\times\mathbb{R}$ by the formula \begin{align*} V_1(x,t) \doteq& \frac{1}{ia} \partial_x \int_1^\infty e^{-i\alpha\xi ^3t}e^{ia_R\xi x}e^{-a_I \xi x} \rho(a_I\xi x) \frac{a^2\xi}{a\xi-i\gamma_2} \, \widehat h(-\alpha\xi ^3)d\xi, \quad x\in\mathbb{R}, \quad t\in\mathbb{R}. \end{align*} Since $ \|v_1\|_{X^{s,b,\theta}_{\alpha,\mathbb{R}^+\times(0,2)}} \le \|V_1\|_{X^{s,b,\theta}_{\alpha}}, $ to prove estimate \eqref{Rob-reduced-pure-ibvp-B-es} for $v_1$ it suffices to show that \begin{align} \label{Rob-reduced-ibvp-Bourgain-est-1} \|V_1\|_{X^{s,b,\theta}_{\alpha}} \le c_{s,b,\alpha} \|h\|_{H_t^{\frac{s}{3}}(\mathbb{R})}. \end{align} To prove this, we rewrite the modified Bourgain norm as follows \begin{align*} \|V_1\|_{X^{s,b,\theta}_{\alpha}}^2 = \|V_1\|_{X^{s,b}_{\alpha}}^2 + \|V_1\|_{D^\theta}^2, \,\, \text{with} \,\, \|V_1\|_{D^\theta}^2 \doteq \int_{-\infty}^\infty \int_{-1}^1 (1+|\tau|)^{2\theta} |\widehat{V}_1(\xi,\tau)|^2 d\xi d\tau. \end{align*} \underline{Estimate of the Bourgain $X^{s,b}_{\alpha}$ norm for $V_1$}. Making the change of variables $\tau=-\xi^3$, and defining the Schwartz function \begin{equation} \label{Rob-def-eta} \eta(x) \doteq e^{i\frac{a_R}{a_I}x} e^{-x} \rho(x), \end{equation} we write $V_1$ in the form \begin{equation} \label{Rob-eqn-V1-1} V_1(x,t) \simeq \partial_x \int_{-\infty}^{-1} e^{i\alpha\tau t} \eta(-a_I\tau^{1/3}x) \frac{a^2\tau^{1/3}}{a\tau^{1/3}-i\gamma_2} \, \tau^{-\frac23} \, \widehat h(\alpha\tau) d\tau, \quad x\in\mathbb{R}, \quad t\in\mathbb{R}. \end{equation} Also, letting $V_{1,\alpha}(x,t)\doteq V_1(x,\frac{t}{\alpha})$ and using the identity $ \widehat{V}_{1,\alpha}(\xi,\tau) = \alpha \widehat{V}_{1}(\xi,\alpha\tau), $ we get $ \|V_1\|_{X_\alpha^{s,b}} \lesssim \|V_{1,\alpha}\|_{X^{s,b}_1} $ ($b\ge 0$), which reduces estimate \eqref{Rob-reduced-ibvp-Bourgain-est-1} to the following one \begin{align} \label{Rob-reduced-ibvp-Bourgain-est-2} \|V_{1,\alpha}\|_{X^{s,b}_{1}} \le c_{s,b,\alpha} \|h\|_{H_t^{\frac{s}{3}}(\mathbb{R})}, \end{align} \vskip-0.1in \noindent where, by \eqref{Rob-eqn-V1-1}, \begin{equation} \label{Rob-eqn-V1-alpha} V_{1,\alpha}(x,t) \simeq \partial_x \int_{-\infty}^{-1} e^{i\tau t} \eta(-a_I\tau^{1/3}x) \frac{a^2\tau^{1/3}}{a\tau^{1/3}-i\gamma_2} \, \tau^{-\frac23} \, \widehat h(\alpha\tau) d\tau, \quad x\in\mathbb{R}, \quad t\in\mathbb{R}. \end{equation} Now we claim that the Bourgain space estimate \eqref{Rob-reduced-ibvp-Bourgain-est-2} follows from next result. \begin{lemma} \label{Rob-reduced-pibvp-thm1} Let $\varepsilon>0$. If $s\geq -\frac32-\varepsilon$, and $b\ge 0$, then $V_{1,\alpha}$ in \eqref{Rob-eqn-V1-alpha} satisfies the estimate \begin{align} \label{Rob-reduced-ibvp-Bourgain-est} \|V_{1,\alpha}\|_{X^{s,b}_1} \leq c_{s,b,\varepsilon,\rho,a,\alpha} \|h\|_{H_t^{\frac{s+3b-\frac32+\varepsilon}{3}}(\mathbb{R})}. \end{align} \end{lemma} \vskip-0.05in \noindent In fact, choosing $\varepsilon$ such that $ \varepsilon = 3(\frac12-b), $ which is possible if $b<1/2$, we get $(s+3b-3/2+\varepsilon)/3= s/3$ and estimate \eqref{Rob-reduced-ibvp-Bourgain-est} gives \eqref{Rob-reduced-ibvp-Bourgain-est-2}. And, since $\|V_1\|_{X_\alpha^{s,b}}\lesssim \|V_{1,\alpha}\|_{X^{s,b}_1}$ we get the desired estimate \eqref{Rob-reduced-ibvp-Bourgain-est-1}. \vskip0.1in \noindent {\bf Proof of Lemma \ref{Rob-reduced-pibvp-thm1}.} To estimate $\|V_{1,\alpha}\|_{X^{s,b}_1}$ we need the Fourier transform of $V_{1,\alpha}$. Using formula \eqref{Rob-eqn-V1-alpha} we see that its time Fourier transform is \begin{align*} \widehat{V}_{1,\alpha}^t(x,\tau) \simeq \partial_x \big[ \chi_{(-\infty,-1)}(\tau) \, \eta(-a_I\tau^{1/3}x) \, \frac{a^2\tau^{1/3}}{a\tau^{1/3}-i\gamma_2} \, \tau^{-\frac23} \, \widehat h(\alpha\tau) \big], \end{align*} and therefore its full Fourier transform is \begin{align} \label{Rob-v1-xt-FT} \widehat{V}_{1,\alpha}(\xi,\tau) \simeq \xi \, \chi_{(-\infty,-1)}(\tau) \, F(\xi,\tau) \, \frac{a^2\tau^{1/3}}{a\tau^{1/3}-i\gamma_2} \, \tau^{-\frac23} \, \widehat h(\alpha\tau), \,\, \text{with} \,\, F(\xi,\tau) \doteq \int_{\mathbb{R}} e^{-i\xi x}\eta(-a_I\tau^\frac13 x) dx. \end{align} Also, we need the following estimate for $F$, which follows from the fact that $\eta$ is a Schwartz function. \begin{lemma} \label{Rob-F-bound-lem} For any $n\ge 0$, $\tau<-1$, and $\xi\in\mathbb{R}$, we have \begin{align*} |F(\xi,\tau)| \leq c_{\rho,a,n} \, \frac{1}{|\tau|^{1/3}} \, \big( \frac{|\tau|^{1/3}}{|\xi|+|\tau|^{1/3}} \big)^n, \end{align*} where $c_{\rho,a,n}$ is a constant depending on $a$, $n$ and $\rho$, which is described in \eqref{Rob-rho-def}. \end{lemma} \noindent Now, using \eqref{Rob-v1-xt-FT} we write $\|V_{1,\alpha}\|_{X^{s,b}_1}^2$ as follows \begin{align} \label{Rob-X-norm-v1} \|V_{1,\alpha}\|_{X^{s,b}_1}^2 \lesssim& \int_{-\infty}^{-1} \Big[ \int_{-\infty}^{\infty} (1+|\xi|)^{2s} (1+|\tau-\xi^3|)^{2b} \xi^2 | F(\xi,\tau) |^2 d\xi \Big] \cdot \frac{\tau^{2/3}}{|a\tau^{1/3}-i\gamma_2|^2} \, \tau^{-\frac43} \big| \widehat h(\alpha\tau) \big|^2 d\tau, \end{align} and estimate the $d\xi$-integral in the following result. \begin{lemma} \label{Rob-v1-mult-lema} For any $\varepsilon>0$ and $\tau<-1$, if $s\geq -\frac32-\varepsilon$, $b\ge 0$ then we have \begin{equation} \label{Rob-v1-mult-ine-1} \int_{-\infty}^{\infty} (1+|\xi|)^{2s} (1+|\tau-\xi^3|)^{2b} \xi^2 \big| F(\xi,\tau) \big|^2 d\xi \leq c_{s,b,\varepsilon,\rho,a} |\tau|^{\frac{2s+6b+1+2\varepsilon}{3}}, \end{equation} where $c_{s,b,\varepsilon,\rho}$ is a constant depending on $s$, $b$, $\varepsilon$, $\rho$ and $a$. \end{lemma} \noindent Estimate \eqref{Rob-v1-mult-ine-1} is proved in \cite{hy2022-KdVm} (see Lemma 2.3). Now, combining it with \eqref{Rob-X-norm-v1}, we get \begin{align*} \|V_{1,\alpha}\|_{X^{s,b}_{1}}^2 \le c_{s,b,\varepsilon,\rho,a} \int_{-\infty}^{-1} \big| \tau^{\frac{s+3b-\frac32+\varepsilon}{3}} \widehat h(\alpha\tau) \big|^2 d\tau \le c_{s,b,\varepsilon,\rho,a} \|h\|_{H_t^{\frac{s+3b-\frac32+\varepsilon}{3}}}^2, \end{align*} which is the desired estimate \eqref{Rob-reduced-ibvp-Bourgain-est} in Lemma \ref{Rob-reduced-pibvp-thm1}. \,\, $\square$ \vskip0.1in \noindent \underline{Estimation of $D^\theta$ norm for $V_1$.} As before, letting $V_{1,\alpha}(x,t)\doteq V_1(x,\frac{t}{\alpha})$ and using the identity $ \widehat{V}_{1,\alpha}(\xi,\tau) = \alpha \widehat{V}_{1}(\xi,\alpha\tau), $ we get $ \|V_1\|_{D^\theta} \lesssim \|V_{1,\alpha}\|_{D^\theta} $, if $\theta\ge0$. Using the Fourier transform of $V_{1,\alpha}$, i.e. \eqref{Rob-v1-xt-FT} we get \begin{align*} \|V_{1,\alpha}\|_{D^\theta}^2 = \int_{-\infty}^{-1} \int_{-1}^1 (1+|\tau|)^{2\theta} | \xi F(\xi,\tau) \frac{a^2\tau^{1/3}}{a\tau^{1/3}-i\gamma_2} \tau^{-2/3} \widehat h(\alpha\tau)|^2 d\xi d\tau, \end{align*} where $ F(\xi,\tau) $ is defined in \eqref{Rob-v1-xt-FT}. Next, applying Lemma \ref{Rob-F-bound-lem} with $n=0$, we get $ |F(\xi,\tau)| \lesssim |\tau|^{-1/3}, $ which implies that the integrand is bounded in $\xi$. Thus, integrating $\xi$ we get \begin{align*} \|V_{1,\alpha}\|_{D^\theta}^2 \lesssim \int_{-\infty}^{-1} (1+|\tau|)^{2\theta} | \tau^{-1} \widehat h(\alpha\tau)|^2 d\tau \lesssim \int_{-\infty}^{-1} (1+|\tau|)^{2\theta-2} | \widehat h(\alpha\tau)|^2 d\tau \lesssim \|h\|_{H_t^{\theta-1}}^2, \end{align*} which gives the desired estimate $\|V_{1,\alpha}\|_{D^\theta}^2 \lesssim \|h\|_{H_t^{s/3}}^2$, if we choose $\theta-1\le s/3$ or $ 0 \le \theta \le 1+s/3. $ \,\, $\square$ \vskip.05in \noindent {\bf Proof of estimate \eqref{Rob-reduced-pure-ibvp-B-es} for $v_i$ (where the signs of $\gamma_1$, $\gamma_2$ appear).} When $\gamma_2\le 0$, then $v_i=0$ and estimate \eqref{Rob-reduced-pure-ibvp-B-es} holds trivially. So, we focus on $\gamma_2> 0$ in which case $v_i(x,t) = \gamma_2^2 \widehat{h}(-i\alpha\gamma_2^3) e^{-\gamma_2 x+\gamma_2^3\alpha t}. $ Replacing $x$ with $ \varphi_1(x)$ defined in \eqref{phi1-x-even-ext} we extend $v_i$ as an ``almost" even function of $x$ from $\mathbb{R}^+\times(0,2)$ to $\mathbb{R}\times\mathbb{R}$ as follows \begin{equation} \label{Rob-def-vi-extension} V_i(x,t) \doteq \gamma_2^2 \widehat{h}(-i\alpha\gamma_2^3) e^{-\gamma_2 \varphi_1(x)+\gamma_2^3\alpha t}, \quad x\in\mathbb{R}, \,\, t\in\mathbb{R}. \end{equation} Thus, for its modified Bourgain norm we have (by splitting integration for $|\tau|\le |\xi|$ and $|\tau|>|\xi|$) \begin{align} \label{vi-est} \nonumber \|v_i\|_{X^{s, b,\theta}_{\alpha,\mathbb{R}^+\times (0,2)}}^2 &\le \|\psi_4 V_i\|_{X^{s, b,\theta}_{\alpha}}^2 \le c_{\gamma_2} 3 \gamma_2^4 \Big(\|e^{-\gamma_2 \varphi_1}\|_{H^{|s|+3b}}^2 \|\psi_4 e^{\gamma_2^3\alpha t}\|_{H^{|s|+3b+\theta}}^2 \Big) \cdot |\widehat{h}(-i\alpha\gamma_2^3)|^2 \\ &\le C_{\psi, \phi_1,\gamma_2} |\widehat{h}(-i\alpha\gamma_2^3)|^2. \end{align} Also, using the definition \eqref{Rob-h-time-tran} and the Cauchy--Schwarz inequality we have \begin{equation} \label{h-l2-estt} |\widehat{h}(-i\alpha\gamma_2^3)|^2 = \Big| \int_0^2e^{-i (-i\alpha\gamma_2^3)\tau}h(\tau)d\tau \Big|^2 = \Big| \int_0^2e^{-\alpha \gamma_2^3\tau}h(\tau)d\tau \Big|^2 \le \Big| \int_0^2 h(\tau)d\tau \Big|^2 \le 2 \|h\|_{L^2}^2. \end{equation} Therefore, combining estimate \eqref{vi-est} with \eqref{h-l2-estt}, for $s\ge 0$ we get $ \|v_i\|_{X^{s, b,\theta}_{\alpha,\mathbb{R}^+\times (0,2)}}^2 \le \|\psi_4 V_i\|_{X^{s, b,\theta}_{\alpha}}^2 \lesssim \|h\|_{H^{s/3}}^2, $ which completes the proof of estimate \eqref{Rob-reduced-pure-ibvp-B-es} for $v_i$. \,\, $\square$ \subsection{Proof of Linear estimates for Robin ibvp (Theorem \ref{thm-MB-forced-linear-Rob})} It suffices to prove estimate \eqref{MB-forced-linear-est2-Rob}, since estimate \eqref{MB-forced-linear-est1-Rob} follows from this one by letting $\alpha=1$. We start by decomposing the forced problem \eqref{Rob-LKdV-v} for the linear $\alpha$-KdV (i.e. the KdV with dispersion coefficient $\alpha$) into the homogeneous ibvp % \begin{subequations} \label{homo-ibvp-kdv} \begin{align} \label{homo-ibvp-kdv:eqn} &v_t+\alpha v_{xxx} = 0, \\ \label{homo-ibvp:ic} &v(x,0) = v_0(x)\in H^{s}(\mathbb{R}^+), \\ \label{homo-ibvp-kdv:bc} &\partial_xv(0,t)+\gamma_2v(0,t) = \varphi_2(t)\in H^{\frac{s}{3}}(0,T), \end{align} \end{subequations} and the remaining forced ibvp with zero data \begin{subequations} \label{inhomo-ibvp-kdv} \begin{align} \label{inhomo-ibvp-kdv:eqn} &v_t+\alpha v_{xxx} = f_2(x,t) \in X_{\alpha,\mathbb{R}^+\times(0,T)}^{s,-b,\theta-1} \cap Y_{\alpha,\mathbb{R}^+\times(0,T)}^{s,-b}, \\ \label{inhomo-ibvp-kdv:ic} &v(x,0) = 0, \\ \label{inhomo-ibvp-kdv:bc} &\partial_xv(0,t)+\gamma_2v(0,t) = 0, \end{align} \end{subequations} thus having the relation $ S_\alpha\big[v_0, \varphi_2; f_2\big] = S_\alpha\big[v_0, \varphi_2; 0\big] + S_\alpha\big[0, 0; f_2\big] $ between their solutions. Furthermore, we decompose the homogeneous ibvp \eqref{homo-ibvp-kdv} into an ivp and the remaining pure ibvp having zero initial data. The ivp reads as follows \begin{subequations} \label{homo-ivp-kdv} \begin{align} \label{homo-ivp-kdv:eqn} &V_t+ \alpha V_{xxx} = 0, \\ \label{homo-ivp-kdv:ic} &V (x,0) = V_0(x)\in H^{s}(\mathbb{R}), \end{align} \end{subequations} where $V_0\in H^{s}(\mathbb{R})$ is an extension of the initial data $v_0\in H^{s}(\mathbb{R}^+)$ with $ \|V_0\|_{H^{s}(\mathbb{R})} \le 2\|v_0\|_{H^{s}(\mathbb{R}^+)} $. Its solution is given by the familiar formula \begin{equation} \label{homo-ivp-sln-kdv} V(x,t) = S_\alpha\big[V_0; 0\big] (x, t) = \frac{1}{2\pi} \int_{\xi\in \mathbb{R}} e^{i\xi x+i\alpha\xi^3t}\, \widehat{V}_0(\xi) d\xi,\quad (x,t)\in \mathbb{R}^2, \end{equation} where $ \widehat{V}_0(\xi) = \int_{x\in \mathbb{R}} e^{-i\xi x}\, V_0(x) dx $, and satisfies the following result. \begin{proposition} \label{pro-ivp-kdv} For $s, b,\theta\in \mathbb{R}$, the solution \eqref{homo-ivp-sln-kdv} to ivp \eqref{homo-ivp-kdv} satisfies the space estimates \begin{align} \label{homo-ivp-est-B-kdv} \|\psi\, S_\alpha\big[V_0; 0\big]\|_{X^{{s},b,\theta}_\alpha} \le c_{s} \|V_0\|_{H^{s}(\mathbb{R})}, \end{align} and the following time regularity estimates \begin{align} \label{homo-ivp-est-time-kdv} &\sup_{x\in\mathbb{R}}\| \psi \, S_\alpha\big[V_0; 0\big](x)\|_{H_t^{\frac{s+1}{3}}(\mathbb{R})} \le C_{s}\, \|V_0\|_{H^{s}(\mathbb{R})}, \\ \label{homo-ivp-est-time-kdv-der} &\sup_{x\in\mathbb{R}}\| \psi \, \partial_x S_\alpha\big[V_0; 0\big](x)\|_{H_t^{\frac{s}{3}}(\mathbb{R})} \le C_{s}\, \|V_0\|_{H^{s}(\mathbb{R})}. \end{align} \end{proposition} \noindent {\bf Proof of Proposition \ref{pro-ivp-kdv}.} For $\alpha=1$, estimate \eqref{homo-ivp-est-time-kdv} (with $s\ge -1$) is proved in \cite{fhm2016} and estimate \eqref{homo-ivp-est-time-kdv-der} (with $s\ge 0$) is proved in \cite{hmy2019}. For $\alpha\neq 1$ and $s\in\mathbb{R}$, the proof is similar. Estimate \eqref{homo-ivp-est-B-kdv} follows from the definition of Bourgain norm (also, see Lemma 5.5 in \cite{h2006}). \,\, $\square$ \vskip.05in \noindent The remaining pure ibvp mentioned above is given by \begin{subequations} \label{pure-ibvp-kdv} \begin{align} \label{pure-ibvp-kdv:eqn} &v_t+\alpha v_{xxx} = 0, \\ \label{pure-ibvp-kdv:ic} &v(x,0) = 0, \\ \label{pure-ibvp-kdv:bc} &\partial_xv(0,t)+\gamma_2v(0,t) = \varphi_2(t) - [\partial_xV(0,t)+\gamma_2V(0,t)] \doteq \varphi(t) \in H^{\frac{s}{3}}(0,T). \end{align} \end{subequations} For its solution $ v \doteq S_\alpha \big[0, \varphi; 0\big] $, defined by UTM formula \eqref{Rob-kdv-utm-v}, we have the following result. \begin{proposition} \label{pro-p-ibvp-kdv} For $b\in [0,\frac12)$, $\frac12<\theta \le 1+s/3$, we have the estimate in Bourgain spaces \begin{align} \label{pure-ibvp-est-B-kdv} \| S_\alpha [0,\varphi;0]\|_{X^{s,b,\theta}_{\alpha ,\mathbb{R}^+\times(0,T)}} \le C_{s}\, \|\varphi\|_{H^{\frac{s}{3}}(0,T)}, \,\,\, -\frac32 < s< \frac32, \,\, \text{if} \,\, \gamma_2\le 0, \,\,\, \text{and} \,\,\, 0\le s<\frac32, \,\, \text{if} \,\, \gamma_2>0. \end{align} \end{proposition} \noindent {\bf Proof of Proposition \ref{pro-p-ibvp-kdv}.} Since $-\frac32<s<\frac32$, we have $-\frac12<\frac{s}{3}<\frac12$. Now, we extend $\varphi(t)$ from $(0,T)$ to $\mathbb{R}$ such that the extension $\widetilde{\varphi}(t)$ satisfies $ \|\widetilde{\varphi}\|_{H^{\frac{s}{3}}(\mathbb{R})} \le 2 \|\varphi\|_{H^{\frac{s}{3}}(0,T)}. $ Furthermore, multiplying $\varphi$ by the characteristic functions $\chi_{(-\infty,T)}$ and $\chi_{(0,\infty)}$ we get $ \widetilde{\varphi}_1 \doteq \chi_{(-\infty,T)}\chi_{(0,\infty)}\widetilde{\varphi}. $ Now, we need the following result \cite{jk1995, h2006}. \begin{lemma} \label{ext-lem-neg-new} For $-\frac12<s<\frac12$ and $g\in H^s(\mathbb{R})$, we have $ \|\chi_{(0,\infty)}g\|_{H^s(\mathbb{R})} \le c_s\|g\|_{H^s(\mathbb{R})}. $ \end{lemma} \noindent Applying this result twice, we obtain $ \|\widetilde{\varphi}_1\|_{H^{\frac{s}{3}}(\mathbb{R})} \lesssim \|\varphi\|_{H^{\frac{s}{3}}(0,T)}. $ Therefore, since $\widetilde{\varphi}_1$ is an extension of $\varphi$ from $(0,T)$ to $\mathbb{R}$ and is compactly support in $(0,T)$, we can apply the reduced pure ibvp estimate \eqref{Rob-reduced-pure-ibvp-B-es} to get the string of inequalities \begin{align*} \| S_\alpha [0,\varphi;0]\|_{X^{s,b,\theta}_{\alpha ,\mathbb{R}^+\times(0,T)}} = \| S_\alpha [0,\widetilde{\varphi}_1;0]\|_{X^{s,b,\theta}_{\alpha ,\mathbb{R}^+\times(0,T)}} \le \| S_\alpha [0,\widetilde{\varphi}_1;0]\|_{X^{s,b,\theta}_{\alpha ,\mathbb{R}^+\times(0,2)}} \lesssim \,\| \widetilde{\varphi}_1\|_{H^{\frac{s}{3}}(\mathbb{R})} \lesssim \|\varphi\|_{H^{\frac{s}{3}}(0,T)}, \end{align*} for $-\frac32 < s< \frac32$, if $\gamma_2\le 0$, and for $0\le s<\frac32$, if $\gamma_2>0$, which gives the desired estimates \eqref{pure-ibvp-est-B-kdv}. \,\, $\square$ \vskip.05in \noindent Next, we decompose the forced ibvp with zero initial and boundary data \eqref{inhomo-ibvp-kdv} to a forced ivp with zero initial data and a companion pure ibvp. The forced ivp with zero initial data is given by \begin{subequations} \label{inhomo-ivp-kdv} \begin{align} \label{inhomo-ivp-kdv:eqn} &W_t+ \alpha W_{xxx} = w(x, t) \in X^{s,-b,\theta-1}_\alpha \cap Y^{s,-b}_\alpha , \\ \label{inhomo-ivp-kdv:ic} & W(x,0) = 0, \end{align} \end{subequations} where $w \in X^{s,-b,\theta-1}_\alpha \cap Y^{s,-b}_\alpha $ is an extension of the forcing $f_2 \in X_{\alpha ,\mathbb{R}^+\times(0,T)}^{s,-b,\theta-1}\cap Y_{\alpha ,\mathbb{R}^+\times(0,T)}^{s,-b}$ such that $ \|w\|_{X^{s,-b,\theta-1}_\alpha } + \|w\|_{Y^{s,-b}_\alpha } \leqslant 2 (\|f_2\|_{X_{\alpha ,\mathbb{R}^+\times(0,T)}^{s,-b,\theta-1}} + \|f_2\|_{Y_{\alpha ,\mathbb{R}^+\times(0,T)}^{s,-b}} ). $ Its solution, by the Duhamel formula, is \begin{align} \label{inhomo-ivp:sln-kdv} W(x,t) \doteq S_\alpha \big[0; w\big](x, t) =& \frac{1}{2\pi} \int_{\xi \in \mathbb{R}} \int_{t'=0}^t e^{i\xi x+i\alpha \xi^3(t-t')} \widehat w(\xi, t') dt' d\xi \\ \label{inhomo-ivp:sln-d-kdv} =& \int_{t'=0}^t S_\alpha \big[w(\cdot, t'); 0\big](x, t-t') dt', \end{align} where $\widehat{w}$ is the $x$-Fourier transform of $w$, and $S_\alpha \big[w(\cdot, t'); 0\big]$ in the solution formula \eqref{inhomo-ivp:sln-d-kdv} is the solution of the ivp \eqref{homo-ivp-kdv} with initial data $V_0(\cdot)=w(\cdot, t')$. For this problem we have the following result. \begin{proposition} \label{pro-f-ivp-kdv} The solution $S_\alpha \big[0; w\big]$ of ivp \eqref{inhomo-ivp-kdv} satisfies the following estimate \begin{equation} \label{forced-ivp-bourgain-est-kdv} \|\psi\, S_\alpha \big[0; w\big]\|_{X^{s,b,\theta}_\alpha } \lesssim \|w\|_{X^{s,-b,\theta-1}_\alpha }, \quad s\in\mathbb{R}, \,\, 0< b<\frac12<\theta <1. \end{equation} Also, satisfies the following time regularity estimates \begin{align} \label{inhomo-ivp-est-time-kdv} \sup_{x\in\mathbb{R}}\|\psi S_\alpha [0;w](x)\|_{H^{\frac{s+1}{3}}(\mathbb{R})} \lesssim \begin{cases} \|w\|_{X^{s,-b}_\alpha }, \quad -1 \le s \le \frac12, \,\, 0< b<\frac12, \\ \|w\|_{X^{s,-b}_\alpha } + \|w\|_{Y^{s,-b}_\alpha }, \quad s\in\mathbb{R}, \,\, 0< b<\frac12, \end{cases} \\ \label{inhomo-ivp-est-time-kdv-der} \sup_{x\in\mathbb{R}}\|\psi \partial_xS_\alpha [0;w](x)\|_{H^{\frac{s}{3}}(\mathbb{R})} \lesssim \begin{cases} \|w\|_{X^{s,-b}_\alpha }, \quad 0 \le s \le \frac32, \,\, 0< b<\frac12, \\ \|w\|_{X^{s,-b}_\alpha } + \|w\|_{Y^{s,-b}_\alpha }, \quad s\in\mathbb{R}, \,\, 0< b<\frac12. \end{cases} \end{align} \end{proposition} \noindent {\bf Proof of Proposition \ref{pro-f-ivp-kdv}.} Here we prove estimates \eqref{forced-ivp-bourgain-est-kdv} and \eqref{inhomo-ivp-est-time-kdv}. The proof of estimate \eqref{inhomo-ivp-est-time-kdv-der} is similar to that of estimate \eqref{inhomo-ivp-est-time-kdv}. \vskip.05in \noindent \underline{Proof of estimate \eqref{forced-ivp-bourgain-est-kdv}.} For the $X^{s,b}_\alpha$ part, we use the inequality \begin{align} \label{elementary-est-kdv} \| \psi\, S_\alpha\big[0; w\big] \|_{X^{s,b}_\alpha }^2 \lesssim \|w\|_{X^{s,b-1}_\alpha }^2 + \int_{\mathbb{R}}(1+|\xi|)^{2s}\Big(\int_{\tau\in\mathbb{R}} \frac{|\widehat{w}(\xi,\tau)|}{1+|\tau-\alpha \xi^3|}d\tau\Big)^2d\xi, \,\, 0< b<1, \end{align} whose proof for $\alpha=1$ is given in \cite{fhy2020} (see estimate (2.17)). The proof for $\alpha\neq 1$ is similar. Then, using the fact $0< b<\frac12$ and applying the Cauchy--Schwarz inequality in $\tau$-integral we get it bounded by $\|w\|_{X^{s,-b}_\alpha }$ (also, for $\alpha=1$ see Lemma 5.6 in \cite{h2006}). For the $D^\theta$ part we use the following inequality \begin{align*} \| \psi\, S_\alpha\big[0; w\big] \|_{D^\theta}^2 \doteq& \int_{\mathbb{R}} \int_{-1}^1 (1+|\tau|)^{2\theta} | \mathcal{F}\big( \psi S_\alpha\big[0; w\big] \big)(\xi,\tau)|^2 d\xi d\tau \\ \lesssim& \int_{\mathbb{R}} \int_{-1}^1 (1+|\tau|)^{2\theta-2} | \widehat{ w} (\xi,\tau)|^2 d\xi d\tau = \|w\|_{D^{\theta-1}}^2, \end{align*} whose proof is again similar to the proof of \eqref{elementary-est-kdv}. In the formula above, $\mathcal{F}$ denotes full Fourier transform. \vskip.05in \noindent \underline {Proof of estimate \eqref{inhomo-ivp-est-time-kdv}.} For this, we use the decomposition \begin{subequations} \label{f-kdv-decomp} \begin{align} \label{Tfg2-term-kdv} \psi(t)S_\alpha \big[0; w\big](x,t) =& \frac{i}{4\pi^2} \psi(t) \int_{\mathbb{R}^2} e^{i(\xi x+\tau t)} \frac{1-\psi(\tau-\alpha \xi^3)}{\tau-\alpha \xi^3} \widehat{w}(\xi,\tau) d\tau d\xi \\ \label{Tfg3-term-kdv} -& \frac{i}{4\pi^2} \psi(t) \int_{\mathbb{R}^2} e^{i(\xi x+\alpha \xi^3t)} \frac{1-\psi(\tau-\alpha \xi^3)}{\tau-\alpha \xi^3} \widehat{w}(\xi,\tau) d\tau d\xi \\ \label{Tfg4-term-kdv} +& \frac{i}{4\pi^2} \psi(t) \int_{\mathbb{R}^2} e^{i(\xi x+\alpha \xi^3 t)} \frac{\psi(\tau-\alpha \xi^3)[e^{i(\tau-\alpha \xi^3)t} - 1]}{\tau-\alpha \xi^3} \widehat{w}(\xi,\tau) d\tau d\xi, \end{align} \end{subequations} and estimate each term separately like in \eqref{elementary-est-kdv} (also, for $\alpha=1$ see Lemma 5.6 in \cite{h2006}). \,\, $\square$ \vskip.05in \noindent The companion pure ibvp from the decomposition of ibvp \eqref{inhomo-ibvp-kdv} is \begin{subequations} \label{forced-pure-ibvp-kdv} \begin{align} \label{forced-pure-ibvp:eqn-kdv} &v_t+\alpha v_{xxx} = 0, \\ \label{forced-pure-ibvp:ic-kdv} &v(x,0) = 0, \\ \label{forced-pure-ibvp:bc-kdv} &\partial_xv(0,t)+\gamma_2v(0,t) = - [\partial_xW(0,t)+\gamma_2W(0,t)] \doteq W_0(t) \in H^{\frac{s}{3}}(0,T), \end{align} \end{subequations} where by the KdV time estimate \eqref{inhomo-ivp-est-time-kdv} and \eqref{inhomo-ivp-est-time-kdv-der}, $W_0\in H^{\frac{s}{3}}(0,T)$. Its solution $ v(x, t) \doteq S_\alpha \big[0, W_0; 0\big](x, t) $ is defined by UTM formula \eqref{Rob-kdv-utm-v} and satisfies an estimate like the one in Proposition \ref{pro-p-ibvp-kdv} with $\varphi$ being replaced with $W_0$. \vskip0.05in \noindent {\bf Proof of estimate \eqref{MB-forced-linear-est2-Rob}.} For this estimate using the superposition principle we express the Fokas solution formula $S_\alpha\big[v_0, \varphi_2; f_2\big]$ for the forced ibvp \eqref{Rob-LKdV-v} as follows \begin{equation*} S_\alpha\big[v_0, \varphi_2; f_2\big] = \psi(t) S_\alpha\big[ V_0; 0\big] + S_\alpha\big[0, \varphi; 0\big] + \psi(t) S_\alpha\big[0; w\big] + S_\alpha\big[0, W_0; 0\big], \,\, x>0, \,\, t\in(0,T). \end{equation*} Applying the triangular inequality for the norm $\|\cdot\|_{X^{s,b,\theta}_{\alpha,\mathbb{R}^+\times(0,T)}}$, and using Propositions \ref{pro-ivp-kdv}--\ref{pro-f-ivp-kdv} we get \begin{align} \label{Rob-wp-fin} \big\| S_\alpha\big[v_0, \varphi_2; f_2\big] \big\|_{X^{s,b,\theta}_{\alpha,\mathbb{R}^+\times(0,T)}} \lesssim \big\|V_0\big\|_{H^{s}(\mathbb{R})} + \| \varphi \|_{H_t^{\frac{s}{3}}(0,T)} + \| w \|_{X_\alpha^{s,-b,\theta-1}} + \| W_0 \|_{H_t^{\frac{s}{3}}(0,T)}. \end{align} Finally, considering that $\varphi(t)=\varphi_2(t) - [\partial_xV(0,t)+\gamma_2V(0,t)]$, $ W_0(t) =- [\partial_xW(0,t)+\gamma_2W(0,t)], $ using the time regularity estimates \eqref{homo-ivp-est-time-kdv}, \eqref{homo-ivp-est-time-kdv-der}, \eqref{inhomo-ivp-est-time-kdv}, \eqref{inhomo-ivp-est-time-kdv-der} and using the inequalities $\|V_0\|_{H^{s}(\mathbb{R}))}\le 2\|v_0\|_{H^{s}(\mathbb{R}^+)}$, $ \|w\|_{X_\alpha^{s,-b,\theta-1}} + \|w\|_{Y_\alpha^{s,-b}} \le 2 \|f_2\|_{X_{\alpha,\mathbb{R}^+\times(0,T)}^{s,-b,\theta-1}} + 2 \|f_2\|_{Y_{\alpha,\mathbb{R}^+\times(0,T)}^{s,-b}} $, from \eqref{Rob-wp-fin} we complete the proof of estimate \eqref{MB-forced-linear-est2-Rob}. \,\, $\square$ \section{Linear estimates for Dirichlet problem -- Proof of Theorem \ref{thm-MB-forced-linear-Dir} } \label{sec:linear-Dir} \setcounter{equation}{0} \subsection{Reduced pure ibvp for Dirichlet problem} We begin with the reduced pure ibvp corresponding to the $v$-equation ($\alpha$-KdV), which is our main tool in proving the linear estimates for the Dirichlet problem. This problem reads as follows % \begin{subequations} \label{kdv-reduced} \begin{align} \label{kdv-reduced-eqn} &\partial_tv+\alpha\partial_x^{3}v=0, \quad 0<x<\infty, \,\, 0<t<2, \\ \label{kdv-reduced-ic} &v(x,0) = 0, \\ \label{kdv-reduced-bc} &v(0,t) = h(t), \,\,\, \text{supp}(h)\subset (0, 2). \end{align} \end{subequations} Since the boundary data $h$ are compactly supported in time interval $(0, 2)$, we see the time transform $\widetilde h$ over the interval $(0, 2)$ is the following Fourier transform over $\mathbb{R}$ \begin{equation*} \widetilde h(\xi,2) = \int_0^2e^{-i\alpha\xi\tau}h(\tau)d\tau = \int_\mathbb{R} e^{-i\alpha\xi\tau}h(\tau)d\tau = \widehat h(\alpha\xi). \end{equation*} Thus, the Fokas solution formula \eqref{kdv-utm-v} for this ibvp on $\mathbb{R}^+\times (0, 2)$ reads as follows \begin{align} \label{pure-kdv-sln} v(x,t) \doteq S_\alpha[0,h;0] = - \frac{3\alpha}{2\pi}\int_{\partial D^+} e^{i\xi x+i\alpha\xi^3t}\xi^2\, \widehat h(\alpha\xi^3)d\xi. \end{align} Next, using formula \eqref{pure-kdv-sln} we prove the following key result. \begin{theorem} [\b{Estimates for pure ibvp of linear $\alpha$-KdV (Dirichlet)}] \label{reduced-thm-kdv} For boundary data $h$ a test function with $\text{supp}(h)\subset (0, 2)$ the solution to reduced pure linear ibvp \eqref{kdv-reduced} satisfies the Bourgain space estimate \begin{align} \label{reduced-pure-ibvp-B-es} \| S_\alpha[0,h;0] \|_{X^{s,b,\theta}_{\alpha,\mathbb{R}^+\times(0,2)}} \leq c_{s,b,\theta,\alpha} \|h\|_{H_t^{\frac{s+1}{3}}(\mathbb{R})}, \,\, s>-\frac32, \,\, 0\le b<\frac12, \,\, 0\le \theta< 1+\frac13s. \end{align} \end{theorem} \noindent {\bf Proof of Theorem \ref{reduced-thm-kdv}.} Like in the Robin problem, parametrizing the right (left) contour of $\partial D^+$ via $[0,\infty)\ni \xi\to a \xi$ ($a^2\xi$) with $a = e^{i\frac{\pi}{3}} $, we write the solution as $ v \simeq v_{r}+v_{\ell}, $ where \begin{align} \label{def-vr-vl} v_r(x,t) = \int_0^\infty e^{ia\xi x} e^{-i\alpha\xi ^3t} \xi ^{2} \, \widehat h(-\alpha\xi ^3)d\xi \quad \text{and} \quad v_\ell(x,t) = \int_0^\infty e^{ia^2\xi x} e^{i\alpha\xi^3t} \, \xi^{2} \widehat h(\alpha\xi^3)d\xi. \end{align} Here we only estimate $v_{r}$. The estimation of $v_{\ell}$ is similar. We begin by we splitting the integration in formula \eqref{def-vr-vl} for $\xi$ near 0 and for $\xi$ near $\infty$. Thus, we have $ v_r = v_0 + v_1, $ where \begin{align*} v_0(x,t) \doteq \int_0^1 \hskip-0.05in e^{ia\xi x} e^{-i\alpha\xi ^3t} \xi ^{2} \widehat h(-\alpha\xi ^3)d\xi \,\,\, \text{and} \,\,\, v_1(x,t) \doteq \int_1^\infty \hskip-0.05in e^{ia\xi x} e^{-i\alpha\xi ^3t} \xi ^{2} \widehat h(-\alpha\xi ^3)d\xi, \,\, x>0, \,\, t\in\mathbb{R}. \end{align*} {\bf Proof of estimate \eqref{reduced-pure-ibvp-B-es} for $v_0$.} Using $\varphi_1(x)$, which is a smooth version of $|x|$ defined by \eqref{phi1-x-even-ext}, we extend $v_0$ as an ``almost" even function of $x$ from $\mathbb{R}^+\times (0,2)$ to $\mathbb{R}\times\mathbb{R}$ as follows \begin{equation*} V_0(x,t) \doteq \int_0^1 e^{ia\xi \varphi_1(x)}e^{-i\alpha\xi ^3t} \xi^2 \,\widehat {h}(-\alpha\xi ^3)d\xi, \quad x\in\mathbb{R}, \,\, t\in\mathbb{R}. \end{equation*} Then, using \eqref{Rob-est-sb-norm-fact-no3} we get the following $L^2$ estimate for the extension $\psi_4(t)V_0$ \begin{align} \label{v0-L2-est} \|\psi_4 V_0\|^2_{X^{s,b,\theta}_{\alpha}} \lesssim \|\psi_4 V_0\|^2_{L^2_{x,t}} + \|\partial_x^{n_1}[\psi_4 V_0]\|^2_{L^2_{x,t}} + \|\partial_t^{n_2}[\psi_4 V_0]\|^2_{L^2_{x,t}} + \|\partial_x^{n_1}\partial_t^{n_2}[\psi_4 V_0]\|^2_{L^2_{x,t}}, \end{align} where $n_1 = n_1(s,b) \doteq 6\lfloor b\rfloor+2\lfloor |s|\rfloor+8 $ and $ n_2 = n_2(b,\theta) \doteq 2\lfloor b\rfloor+2\lfloor\theta\rfloor+4. $ Also, working like in the case of estimate \eqref{Rob-L2-V0-est-kdv}, we get \begin{equation} \label{L2-V0-est-kdv} \|\partial_x^{n_1}\partial_t^{n_2}[\psi_4\,V_0]\|_{L^2_{x,t}}^2 \le C_{n_1, n_2} \int_{-1}^{0} | \widehat{h}(\alpha\tau) |^2 d\tau, \quad \text{for any nonnegative integers} \,\, n_1,n_2. \end{equation} Finally, combining \eqref{v0-L2-est} and \eqref{L2-V0-est-kdv} we get \begin{align*} \|\psi_4 V_0\|^2_{X^{s,b,\theta}_{\alpha}} \lesssim \int_{-1}^{0} (1+|\alpha\tau|)^{\frac{-2(s+1)}{3}} (1+|\alpha\tau|)^{\frac{2(s+1)}{3}} | \widehat{h}(\alpha\tau) |^2 d\tau \lesssim \|h\|_{H_t^{\frac{s+1}{3}}}^2, \,\, s\in\mathbb{R},b\ge0,\theta \ge 0, \end{align*} which implies $\| v_0 \|_{X^{s, b,\theta}_{\alpha,\mathbb{R}^+\times (0,2)}}\le \|\psi_4 V_0\|_{X^{s,b,\theta}_{\alpha}}\lesssim \|h\|_{H_t^{\frac{s+1}{3}}}$ and gives the desired estimate \eqref{reduced-pure-ibvp-B-es} for $v_0$. \,\, $\square$ \vskip0.05in \noindent {\bf Proof of estimate \eqref{reduced-pure-ibvp-B-es} for $v_1$.} Since $a=a_R+ia_I=\frac12+i\frac{\sqrt3}{2}$, we rewrite $v_1$ as \begin{equation*} \label{v1-formula} v_1(x,t) = \int_1^\infty e^{-i\alpha\xi ^3t} e^{ia_R\xi x}e^{-a_I\xi x} \xi ^{2} \widehat h(-\alpha\xi ^3)d\xi, \quad x>0, \,\, t\in\mathbb{R}. \end{equation*} Then, using the identity $ \xi [ e^{ia_R\xi x}e^{-a_I\xi x} ] = \frac{\partial_x}{ia} [ e^{ia_R\xi x}e^{-a_I\xi x} ] $ and the fact that $e^{-a_I \xi x}$ is exponentially decaying in $\xi$ for $x>0$, we move the $\partial_x$-derivative outside the integral sign to rewrite $v_1$ as follows \begin{equation*} v_1(x,t) = \frac{1}{ia} \partial_x \int_1^\infty e^{-i\alpha\xi^3t}e^{ia_R\xi x}e^{-a_I \xi x} \xi \, \widehat h(-\alpha\xi ^3)d\xi, \quad x>0, \quad t\in\mathbb{R}. \end{equation*} Furthermore, using the one-sided $C^\infty$ cutoff function $\rho(x)$, which is defined by \eqref{Rob-rho-def}, we extend $v_1$ from $\mathbb{R}^+\times \mathbb{R}$ to $\mathbb{R}^2$ via the formula below \begin{align*} V_1(x,t) \doteq& \frac{1}{ia} \partial_x \int_1^\infty e^{-i\alpha\xi^3t}e^{ia_R\xi x}e^{-a_I \xi x} \rho(a_I\xi x) \xi \, \widehat h(-\alpha\xi ^3)d\xi, \quad x\in\mathbb{R}, \quad t\in\mathbb{R}. \end{align*} Since $ \|v_1\|_{X^{s,b,\theta}_{\alpha,\mathbb{R}^+\times(0,2)}} \le \|V_1\|_{X^{s,b,\theta}_{\alpha}}, $ to prove estimate \eqref{reduced-pure-ibvp-B-es} for $v_1$ it suffices to show that \begin{align} \label{reduced-ibvp-Bourgain-est-1} \|V_1\|_{X^{s,b,\theta}_{\alpha}} \le c_{s,b,\theta,\alpha} \|h\|_{H_t^{\frac{s+1}{3}}(\mathbb{R})}. \end{align} We do this for both parts of modified Bourgain norm shown below \begin{align*} \|V_1\|_{X^{s,b,\theta}_{\alpha}}^2 = \|V_1\|_{X^{s,b}_{\alpha}}^2 + \|V_1\|_{D^\theta}^2, \,\, \text{with} \,\, \|V_1\|_{D^\theta}^2 \doteq \int_{-\infty}^\infty \int_{-1}^1 (1+|\tau|)^{2\theta} |\widehat{V}_1(\xi,\tau)|^2 d\xi d\tau. \end{align*} \underline{Estimate of the Bourgain $X^{s,b}_{\alpha}$ norm for $V_1$}. Using the Schwartz function $\eta(x)$ defined by \eqref{Rob-def-eta} and making the change of variables $\tau=-\xi^3$ we see that $V_1$ takes the form \begin{equation} \label{eqn-V1-1} V_1(x,t) \simeq \partial_x \int_{-\infty}^{-1} e^{i\alpha\tau t} \eta(-a_I\tau^{1/3}x) \, \tau^{-\frac13} \, \widehat h(\alpha\tau) d\tau, \quad x\in\mathbb{R}, \quad t\in\mathbb{R}. \end{equation} Now, letting $V_{1,\alpha}(x,t)=V_1(x,\frac{t}{\alpha})$ and using $ \widehat{V}_{1,\alpha}(\xi,\tau) = \alpha \widehat{V}_{1}(\xi,\alpha\tau), $ we get $ \|V_1\|_{X_\alpha^{s,b}} \lesssim \|V_{1,\alpha}\|_{X^{s,b}_1} $ ($b\ge 0$), which reduces estimate \eqref{reduced-ibvp-Bourgain-est-1} to the inequality \begin{align} \label{reduced-ibvp-Bourgain-est-2} \|V_{1,\alpha}\|_{X^{s,b}_{1}} \le c_{s,b,\alpha} \|h\|_{H_t^{\frac{s+1}{3}}(\mathbb{R})}, \end{align} where, by \eqref{eqn-V1-1}, \begin{equation} \label{eqn-V1-alpha} V_{1,\alpha}(x,t) \simeq \partial_x \int_{-\infty}^{-1} e^{i\tau t} \eta(-a_I\tau^{1/3}x) \, \tau^{-\frac13} \, \widehat h(\alpha\tau) d\tau, \quad x\in\mathbb{R}, \quad t\in\mathbb{R}. \end{equation} Now, we see that Bourgain space estimate \eqref{reduced-ibvp-Bourgain-est-2} follows from the next result. \begin{lemma} \label{reduced-pibvp-thm1} For any $\varepsilon>0$, if $s\geq -\frac32-\varepsilon$, and $b\ge 0$, then the function $V_{1,\alpha}(x,t)$, which is defined by \eqref{eqn-V1-alpha} satisfies the Bourgain spaces estimate \begin{align} \label{reduced-ibvp-Bourgain-est} \|V_{1,\alpha}\|_{X^{s,b}_{1}} \leq c_{s,b,\varepsilon,\rho,a,\alpha} \|h\|_{H_t^{\frac{s+3b-\frac12+\varepsilon}{3}}(\mathbb{R})}. \end{align} \end{lemma} \noindent In fact, choosing $ \varepsilon = 3(\frac12-b), $ which is possible if $b<1/2$, we get $(s+3b-\frac12+\varepsilon)/3=\frac{s+1}{3}$ and estimates \eqref{reduced-ibvp-Bourgain-est} gives \eqref{reduced-ibvp-Bourgain-est-2}. Combining this with $ \|V_1\|_{X_\alpha^{s,b}} \lesssim \|V_{1,\alpha}\|_{X^{s,b}_1}, $ gives the desired estimate \eqref{reduced-ibvp-Bourgain-est-1}. \vskip0.05in \noindent {\bf Proof of Lemma \ref{reduced-pibvp-thm1}.} This proof is similar to the proof of Lemma \ref{Rob-reduced-pibvp-thm1}. By \eqref{eqn-V1-alpha} we have the following formula for the time Fourier transform $ \widehat{V}_{1,\alpha}^t(x,\tau) \simeq \partial_x \big[ \chi_{(-\infty,-1)}(\tau) \eta(-a_I\tau^{1/3}x) \, \tau^{-1/3} \, \widehat h(\alpha\tau) \big], $ which gives us the full Fourier transform \begin{align} \label{v1-xt-FT} \widehat{V}_{1,\alpha}(\xi,\tau) \simeq \xi \chi_{(-\infty,-1)}(\tau) \, F(\xi,\tau) \, \tau^{-1/3} \, \widehat h(\alpha\tau), \end{align} where $ F(\xi,\tau) \doteq \int_{\mathbb{R}} e^{-i\xi x}\eta(-a_I\tau^\frac13 x) dx $ is defined by \eqref{Rob-v1-xt-FT}. Now, using estimate \eqref{Rob-v1-mult-ine-1}, we get \begin{align*} \|V_{1,\alpha}\|_{X^{s,b}_1}^2 =& \int_{-\infty}^{-1} \Big( \int_{\mathbb{R}} (1+|\xi|)^{2s} (1+|\tau-\alpha\xi^3|)^{2b} \xi^2 |F(\xi,\tau)|^2 d\xi \Big) |\tau^{-1/3}\widehat{h}(\alpha\tau)|^2 d\tau \\ \lesssim& \int_{-\infty}^{-1} |\tau|^{\frac{2s+6b+1+2\varepsilon}{3}} |\tau^{-1/3} \widehat h(\alpha\tau) |^2 d\tau = \int_{-\infty}^{-1} \Big| \tau^{\frac{s+3b-\frac12+\varepsilon}{3}} \widehat h(\alpha\tau) \Big|^2 d\tau \lesssim \|h\|_{H_t^{\frac{s+3b-\frac12+\varepsilon}{3}}}^2, \end{align*} which is the desired estimate \eqref{reduced-ibvp-Bourgain-est} in Lemma \ref{reduced-pibvp-thm1}. \,\, $\square$ \vskip0.05in \noindent \underline{Estimate of $D^\theta$ norm for $V_1$}. As before, letting $V_{1,\alpha}(x,t)\doteq V_1(x,\frac{t}{\alpha})$ and using the identity $ \widehat{V}_{1,\alpha}(\xi,\tau) = \alpha \widehat{V}_{1}(\xi,\alpha\tau), $ we get $ \|V_1\|_{D^\theta} \lesssim \|V_{1,\alpha}\|_{D^\theta} $, if $\theta\ge0$. Using Fourier transform formula \eqref{v1-xt-FT} we get \begin{align*} \|V_{1,\alpha}\|_{D^\theta}^2 = \int_{-\infty}^{-1} \int_{-1}^1 (1+|\tau|)^{2\theta} | \xi F(\xi,\tau) \tau^{-1/3} \widehat h(\alpha\tau)|^2 d\xi d\tau, \end{align*} where $ F(\xi,\tau) $ is defined in \eqref{Rob-v1-xt-FT}. Also, applying Lemma \ref{Rob-F-bound-lem} with $n=0$, we get estimate $ |F(\xi,\tau)| \lesssim |\tau|^{-1/3}, $ which we use in the last relation to integrate $\xi$ and to obtain the inequality \begin{align} \label{V1-D} \|V_{1,\alpha}\|_{D^\theta}^2 \lesssim \int_{-\infty}^{-1} (1+|\tau|)^{2\theta} | \tau^{-2/3} \widehat h(\alpha\tau)|^2 d\tau \lesssim \int_{-\infty}^{-1} (1+|\tau|)^{2\theta-4/3} | \widehat h(\alpha\tau)|^2 d\tau \lesssim \|h\|_{H_t^{\theta-2/3}}^2. \end{align} Choosing $\theta-2/3\le (s+1)/3$ or $\theta\le 1+s/3$ gives $ \|V_1\|_{D^\theta} \lesssim \|V_{1,\alpha}\|_{D^\theta} \lesssim \|h\|_{H_t^{(s+1)/3}}$, i.e. \eqref{reduced-ibvp-Bourgain-est-1}.\, $\square$ \subsection{Proof of Linear estimates for Dirichlet ibvp (Theorem \ref{thm-MB-forced-linear-Dir})} It suffices to prove linear estimate \eqref{MB-forced-linear-est2-Dir} for $\alpha-KdV$, the second equation of our MB system. Linear estimate \eqref{MB-forced-linear-est1-Dir} for the first equation is obtained by letting $\alpha=1$, replacing data $(v_0,h_0)$ by $(u_0,g_0)$, and replacing forcing $f_2$ by $f_1$. We begin by decomposing the forced linear $\alpha$-KdV ibvp \eqref{LKdV-v} into the homogeneous ibvp % \begin{subequations} \label{Dir-homo-ibvp-kdv} \begin{align} \label{Dir-homo-ibvp-kdv:eqn} &v_t+\alpha v_{xxx} = 0, \\ \label{Dir-homo-ibvp:ic} &v(x,0) = v_0(x)\in H^{s}(\mathbb{R}^+), \\ \label{Dir-homo-ibvp-kdv:bc} &v(0,t) = h_0(t)\in H^{\frac{s+1}{3}}(0,T), \end{align} \end{subequations} and the companion forced ibvp with zero initial and boundary data \begin{subequations} \label{Dir-inhomo-ibvp-kdv} \begin{align} \label{Dir-inhomo-ibvp-kdv:eqn} &v_t+\alpha v_{xxx} = f_2(x,t) \in X_{\alpha,\mathbb{R}^+\times(0,T)}^{s,-b,\theta-1} \cap Y_{\alpha,\mathbb{R}^+\times(0,T)}^{s,-b}, \\ \label{Dir-inhomo-ibvp-kdv:ic} &v(x,0) = 0, \\ \label{Dir-inhomo-ibvp-kdv:bc} &v(0,t) = 0. \end{align} \end{subequations} Their solutions, by linearity, satisfy the relation $ S_\alpha\big[v_0, h_0; f_2\big] = S_\alpha\big[v_0, h_0; 0\big] + S_\alpha\big[0, 0; f_2\big]. $ Then, we decompose the homogeneous ibvp \eqref{Dir-homo-ibvp-kdv} into the ivp \eqref{homo-ivp-kdv}, and the pure ibvp \begin{subequations} \label{Dir-pure-ibvp-kdv} \begin{align} \label{Dir-pure-ibvp-kdv:eqn} &v_t+\alpha v_{xxx} = 0, \\ \label{Dir-pure-ibvp-kdv:ic} &v(x,0) = 0, \\ \label{Dir-pure-ibvp-kdv:bc} &v(0,t) = h_0(t) - V(0,t) \doteq h_1(t) \in H^{\frac{s+1}{3}}(0,T), \end{align} \end{subequations} whose solution $ v \doteq S_\alpha \big[0, h_1; 0\big] $, defined by UTM formula \eqref{kdv-utm-v}, satisfies the following result. \begin{proposition} \label{Dir-pro-p-ibvp-kdv} For $b\in [0,\frac12)$, $\frac12<\theta \le 1+\frac13s$, the solution to ibvp \eqref{Dir-pure-ibvp-kdv} satisfies the estimate \begin{align} \label{Dir-pure-ibvp-est-B-kdv} \| S_\alpha [0,h_1;0]\|_{X^{s,b,\theta}_{\alpha ,\mathbb{R}^+\times(0,T)}} \le C_{s}\, \|h_1\|_{H^{\frac{s+1}{3}}(0,T)}, \quad -\frac32 < s< \frac12. \end{align} In addition, if $h_1(0)=0$, then estimates \eqref{Dir-pure-ibvp-est-B-kdv} holds for $\frac12<s<2$. \end{proposition} \noindent {\bf Proof of Proposition \ref{Dir-pro-p-ibvp-kdv}.} Like in the Robin problem, we transform the pure ibvp \eqref{Dir-pure-ibvp-kdv} to the reduced pure ibvp \eqref{kdv-reduced}. For this, we extend the boundary data $h_1(t)$ to a function $\widetilde{h}_1$ on $\mathbb{R}$ supported in $(0,2)$ and such that $\|\widetilde{h}_1\|_{H^{(s+1)/3}(\mathbb{R})}\lesssim \|h_1\|_{H^{(s+1)/3}(0,T)}$, via using compatibility condition \eqref{comp-cond}, Lemma \ref{ext-lem-neg-new} and the following result \cite{LM-book1972, T-book1996, fhm2017}. \begin{lemma} \label{Extension-lemma} For a general function $h^*(t)\in H_t^s(0,2)$, $s\ge 0$, let \begin{align*} \widetilde h^*(t) \doteq \begin{cases} h^*(t), \quad t\in(0,2), \\ 0, \quad \text{elsewhere}. \end{cases} \end{align*} If $0\leq s<1/2$, then for some $c>0$, which is depending on $s$, we have \begin{align} \label{ext-est-Rob} \|\widetilde h^*\|_{H_t^s(\mathbb{R})} \leq c\|h^*\|_{H_t^s(0, 2)}. \end{align} If $1/2<s<1$, then for estimate \eqref{ext-est-Rob} to hold we must have the condition $h^*(0)=h^*(2)=0$. \end{lemma} \noindent Since $\widetilde{h}_1$ extends $h_1$ from $(0,T)$ to $\mathbb{R}$, we have $\| S_\alpha [0,h_1;0]\|_{X^{s,b,\theta}_{\alpha ,\mathbb{R}^+\times(0,T)}}=\| S_\alpha [0,\widetilde{h}_1;0]\|_{X^{s,b,\theta}_{\alpha ,\mathbb{R}^+\times(0,T)}}$, which combined with estimate \eqref{reduced-pure-ibvp-B-es} implies that $ \| S_\alpha [0,h_1;0]\|_{X^{s,b,\theta}_{\alpha ,\mathbb{R}^+\times(0,T)}} \lesssim \,\| \widetilde{h}_1\|_{H^{\frac{s+1}{3}}(\mathbb{R})} \lesssim \|h_1\|_{H^{\frac{s+1}{3}}(0,T)}. $ This completes the proof of Proposition \ref{Dir-pro-p-ibvp-kdv}. \,\, $\square$ \vskip.05in \noindent Next, we decompose the forced ibvp \eqref{Dir-inhomo-ibvp-kdv} to the forced ivp \eqref{inhomo-ivp-kdv} and the companion pure ibvp \begin{subequations} \label{Dir-forced-pure-ibvp-kdv} \begin{align} \label{Dir-forced-pure-ibvp:eqn-kdv} &v_t+\alpha v_{xxx} = 0, \\ \label{Dir-forced-pure-ibvp:ic-kdv} &v(x,0) = 0, \\ \label{Dir-forced-pure-ibvp:bc-kdv} &v(0,t) = - W(0,t) \doteq W_0(t) \in H^{\frac{s+1}{3}}(0,T), \end{align} \end{subequations} where, by the time regularity estimate \eqref{inhomo-ivp-est-time-kdv}, $W_0\in H^{\frac{s+1}{3}}(0,T)$. Its solution $ v \doteq S_\alpha \big[0, W_0; 0\big] $, defined by the Fokas UTM formula \eqref{kdv-utm-v}, satisfies an estimate like the one in Proposition \ref{Dir-pro-p-ibvp-kdv} with $h_1$ being replaced with $W_0$. \vskip0.05in \noindent {\bf Proof of estimate \eqref{MB-forced-linear-est2-Dir}.} First, using the superposition principle, we express the Fokas solution formula $S_\alpha\big[v_0, h_0; f_2\big]$ for the forced ibvp \eqref{kdv-utm} as follows \begin{equation*} S_\alpha\big[v_0, h_0; f_2\big] = \psi(t) S_\alpha\big[ V_0; 0\big] + S_\alpha\big[0, h_1; 0\big] + \psi(t) S_\alpha\big[0; w\big] + S_\alpha\big[0, W_0; 0\big], \,\, x>0, \,\, t\in(0,T). \end{equation*} Then, applying the triangular inequality and utilizing Propositions \ref{pro-ivp-kdv}, \ref{Dir-pro-p-ibvp-kdv} and \ref{pro-f-ivp-kdv} we get \begin{align} \label{Dir-wp-fin} \big\| S_\alpha\big[v_0, h_0; f_2\big] \big\|_{X^{s,b,\theta}_{\alpha,\mathbb{R}^+\times(0,T)}} \lesssim \big\|V_0\big\|_{H^{s}(\mathbb{R})} + \| h_1 \|_{H_t^{\frac{s+1}{3}}(0,T)} + \| w \|_{X_\alpha^{s,-b,\theta-1}} + \| W_0 \|_{H_t^{\frac{s+1}{3}}(0,T)}. \end{align} Finally, considering $ h_1(t) = h_0(t)-V(0,t), $ $W_0(t)=-W(0,t)$, using the time regularity estimate \eqref{inhomo-ivp-est-time-kdv} and using the inequalities $\|V_0\|_{H^{s}(\mathbb{R}))}\le 2\|v_0\|_{H^{s}(\mathbb{R}^+)}$ and $\|w\|_{X_\alpha^{s,-b,\theta-1}} + \| w \|_{Y_\alpha^{s,-b}} \le 2 \|f_2\|_{X_{\alpha,\mathbb{R}^+\times(0,T)}^{s,-b,\theta-1}} + 2 \|f_2\|_{Y_{\alpha,\mathbb{R}^+\times(0,T)}^{s,-b}}, $ from \eqref{Dir-wp-fin} we complete the proof of estimate \eqref{MB-forced-linear-est2-Dir}. \,\, $\square$ \section{ Proof of Well-posedness of the Majda-Biello System } \label{sec:wp} \setcounter{equation}{0} Here we present only the proof of well-posedness for the Robin and Neumann ibvp's (Theorem \ref{thm-MB-half-line-Rob}). The proof of well-posedness for the Dirichlet ibvp (Theorem \ref{thm-MB-half-line-Dir}) is similar. We begin by recalling the critical Sobolev exponent $s_{c}(\alpha)$, $\alpha>0$, defined in the introduction by \eqref{MB-critical-sob-index}. Also, we assume that $s_c(\alpha)\le s<\frac32$ when $\gamma_1\le 0$ and $\gamma_2\le 0$, and $\max\{0, s_c(\alpha)\}\le s<\frac32$ when $\gamma_1>0 $ or $\gamma_2> 0$. Then, for initial data $u_0\in H^{s}(\mathbb{R}^+)$, $v_0\in H^{s}(\mathbb{R}^+)$, boundary data $\varphi_1\in H^{\frac{s}3}(0,T)$, $\varphi_2\in H^{\frac{s}3}(0,T)$, where $0<T<1/2$, and $T^*$, (to be chosen later), satisfying the condition \begin{equation*} 0<T^*<T<1/2, \end{equation*} we define the iteration map $ (u,v) \mapsto \Phi_{T^*}\times\Psi_{T^*}(u,v) \doteq (\Phi_{T^*}(u,v), \Psi_{T^*}(u,v)) $ which is obtained from the Fokas solution formula \eqref{Rob-kdv-utm} and \eqref{Rob-kdv-utm-v} for the forced linear MB ibvp with the forcing terms $f_1$, $f_2$ replaced by the nonlinearities, and localized appropriately. More precisely, we have \begin{align} \label{Rob2-iteration-map-T-loc} \Phi_{T^*} (u,v) \doteq S_1\big[u_0, \varphi_1; -\frac12\psi_{2T^*}[\partial_x(v^2)]\big] \quad \text{and} \quad \Psi_{T^*}(u,v) \doteq S_{\alpha}\big[v_0, \varphi_2;-\frac12\psi_{2T^*}[\partial_x(uv)]\big], \end{align} where $\psi_{T^*}(t)=\psi(t/T^*)$ with $\psi(t)$ being localizer \eqref{time-localizer}. Since, $\psi_{2T^*}(t)=1$ for $|t|\le T^*$, the fixed point of the iteration map \eqref{Rob2-iteration-map-T-loc} is the solution to the MB system ibvp \eqref{Rob-MBsys}. Next, we will show that our iteration map \eqref{Rob2-iteration-map-T-loc} is a contraction in the complete metric space $\mathcal{X}_{MN}\subset X^{s,b,\theta}_{1,\mathbb{R}^+\times(0,T)} \times X^{s,b,\theta}_{\alpha,\mathbb{R}^+\times(0,T)}$ defined by \begin{align*} \mathcal{X}_{MN} = \{ (u,v): u\in X^{s,b,\theta}_{1,\mathbb{R}^+\times(0,T)}, \,\, v\in X^{s,b,\theta}_{\alpha,\mathbb{R}^+\times(0,T)} \,\, \text{such that} \,\, \|u\|_{X^{s,b,\theta}_{1,\mathbb{R}^+\times(0,T)}} \le M, \,\, \|v\|_{X^{s,b,\theta}_{\alpha,\mathbb{R}^+\times(0,T)}} \le N \}, \end{align*} % and having norm $ \|(u,v)\|_{\mathcal{X}_{MN}} \doteq \|u\|_{X^{s,b,\theta}_{1,\mathbb{R}^+\times(0,T)}} + \|v\|_{X^{s,b,\theta}_{\alpha,\mathbb{R}^+\times(0,T)}}, $ if we choose $ {T^*}$, $M$ and $N$ appropriately. \vskip.05in \noindent {\bf $\Phi_{T^*}\times\Psi_{T^*}$ is onto.} We estimate the components of the iteration map separately. Concerning $\Phi_{T^*}$, using the linear estimate \eqref{MB-forced-linear-est1-Rob} with forcing replaced by $-\frac12\psi_{2{T^*}}[\partial_x(v^2)]$, for $0<b\le b^*<\frac12$ we get \begin{align} \label{Rob2-onto-map-fin-est-large} \mathcal{N}_{\Phi} \doteq &\|\Phi_ {T^*}(u,v)\|_{X^{s,b,\theta}_{1,\mathbb{R}^+\times(0,T)}} \le \|\Phi_ {T^*}(u,v)\|_{X^{s,b^*,\theta}_{1,\mathbb{R}^+\times(0,T)}} \nonumber \\ \le& c \big( \| u_0 \|_{H^{s}(\mathbb{R}^+)} + \|\varphi_1\|_{H_t^\frac{s}{3}(0,T)} + \frac12 \big\| \psi_{2{T^*}}[\partial_x(v^2)] \big\|_{X^{s,-b^*,\theta-1}_{1,\mathbb{R}^+\times(0,T)}} + \frac12 \big\| \psi_{2{T^*}}[\partial_x(v^2)] \big\|_{Y^{s,-b^*}_{1,\mathbb{R}^+\times(0,T)}} \big) \nonumber \\ \le& c \big( \| u_0 \|_{H^{s}(\mathbb{R}^+)} + \|\varphi_1\|_{H_t^\frac{s}{3}(0,T)} + \frac12 \big\| \psi_{2{T^*}}[\partial_x(\widetilde{v}^2)] \big\|_{X^{s,-b^*,\theta-1}_1} + \frac12 \big\| \psi_{2{T^*}}[\partial_x(\widetilde{v}^2)] \big\|_{Y^{s,-b^*}_1} \big), \end{align} where $\widetilde{v}$ is the extension of $v$ from $\mathbb{R}^+\times(0,T)$ to $\mathbb{R}^2$ such that $ \|\widetilde v\|_{X^{s,b,\theta}_\alpha} \le 2 \|v\|_{X^{s,b,\theta}_{\alpha,\mathbb{R}^+\times(0,T)}}. $ For $\big\| \psi_{2{T^*}}[\partial_x(\widetilde{v}^2)] \big\|_{Y^{s,-b^*}_1}$, using bilinear estimate \eqref{bi-est-Y-1} we get $ \big\| \psi_{2{T^*}}[\partial_x(\widetilde{v}^2)] \big\|_{Y^{s,-b^*}_1} \le $ $ c_2 \big\| \psi_{2{T^*}}\partial_x(\widetilde{v}^2) \big\|_{X^{s,-b^*}_1} $ $ + c_2 \| \psi_{2{T^*}}\widetilde{v} \|_{X^{s,b'}_\alpha} \| \widetilde{v} \|_{X^{s,b'}_\alpha}, $ which combined with estimate \eqref{Rob2-onto-map-fin-est-large} implies that \begin{align} \label{Rob2-onto-map-fin-est-no1} \mathcal{N}_{\Phi} \le c \big( \| u_0 \|_{H^{s}(\mathbb{R}^+)} + \|\varphi_1\|_{H_t^\frac{s}{3}(0,T)} + \frac{1+c_2}2 \big\| \psi_{2{T^*}}[\partial_x(\widetilde{v}^2)] \big\|_{X^{s,-b^*,\theta-1}_1} + \frac{c_2}2 \| \psi_{2{T^*}}\widetilde{v} \|_{X^{s,b'}_\alpha} \| \widetilde{v} \|_{X^{s,b'}_\alpha} \big). \end{align} Now we need the following result about multipliers. \begin{lemma} \label{tao-lemma-modified} Let $\eta(t)$ be a function in the Schwartz space $\mathcal{S}(\mathbb{R})$ and $\alpha>0$. If $ -\frac12 < b' \le b < \frac12 $ and $-\frac12<\theta'-1\le \theta-1<\frac12$ ($\frac12<\theta'\le \theta<1$ is sufficient condition) then for any $0<{T^*}\le 1$ we have \begin{align} \label{tao-est} &\|\eta(t/{T^*})u\|_{X^{s,b'}_{\alpha}} \le c_1(\eta,b',b,\alpha) \,\, {T^*}^{b-b'}\|u\|_{X^{s,b}_{\alpha}}, \\ \label{tao-est-modified} &\|\eta(t/{T^*})u\|_{X^{s,b',\theta'-1}_\alpha} \le c_1(\eta,b,b',\theta,\theta',\alpha) \,\, \max\{ {T^*}^{b-b'}, {T^*}^{\theta-\theta'} \} \|u\|_{X^{s,b,\theta-1}_\alpha}. \end{align} \end{lemma} \noindent For $\alpha=1$ the proof of estimate \eqref{tao-est} can be found in \cite{tao-book} (see Lemma 2.11). % For $\alpha\neq 1$, the estimate is similar. Also, the proof of estimate \eqref{tao-est-modified} is similar to the proof of estimate \eqref{tao-est}. Applying estimate \eqref{tao-est-modified} with the choices: \begin{align} \label{Rob2-b-b'-choice-wp-2} &b = \frac12-\frac12\beta \text{ ($-b$ is in place of $b$) } \quad \text{and} \quad b^* = \frac12-\frac14\beta \text{ ($-b^*$ is in place of $b'$)}, \\ \label{Rob2-a-a1-choose} &\theta = \frac12+\frac14\beta \text{ (in place of $\theta'$) } \quad \text{and} \quad \theta^* = \frac12+\frac12\beta \text{ (in place of $\theta$)}, \end{align} where $\beta$ is defined in \eqref{beta-choice}, we get $ \big\| \psi_{2{T^*}}[\partial_x(\widetilde{v}^2)] \big\|_{X^{s,-b^*,\theta-1}_1} \le c_1 {T^*}^{\beta/4} \big\| \partial_x(\widetilde{v}^2) \big\|_{X^{s,-b,\theta^*-1}_1}. $ Also, using estimate \eqref{tao-est} with $b'=\frac12-\frac34\beta$ we get $\| \psi_{2{T^*}}\widetilde{v} \|_{X^{s,b'}_\alpha} \le c_1 {T^*}^{\beta/4} \| \widetilde{v} \|_{X^{s,b}_\alpha} $. Combining these with \eqref{Rob2-onto-map-fin-est-no1} gives \begin{align} \label{Rob2-onto-map-fin-est-no2} \mathcal{N}_{\Phi} \le c \big( \| u_0 \|_{H^{s}(\mathbb{R}^+)} + \|\varphi_1\|_{H_t^\frac{s}{3}(0,T)} + \frac{c_1(1+c_2)}2 {T^*}^{\beta/4} \big\| \partial_x(\widetilde{v}^2) \big\|_{X^{s,-b,\theta^*-1}_1} + \frac{c_1c_2}2 {T^*}^{\beta/4} \| \widetilde{v} \|_{X^{s,b}_\alpha}^2 \big). \end{align} Furthermore, applying bilinear estimate \eqref{bi-est-X-1} with $b=b'=\frac12-\frac12\beta$ and $f=g=\widetilde{v}$ for $\big\| \partial_x(\widetilde{v}^2) \big\|_{X^{s,-b,\theta^*-1}_1}$, from \eqref{Rob2-onto-map-fin-est-no2} we get $ \mathcal{N}_{\Phi} \le c_3 \big( \| u_0 \|_{H^{s}(\mathbb{R}^+)} + \|\varphi_1\|_{H_t^\frac{s}{3}(0,T)} + {T^*}^{\frac14\beta} \| \widetilde v \|_{X^{s,b,\theta}_{\alpha}}^2 \big) $ or, \begin{align} \label{Rob2-onto-map-fin-est-1} \|\Phi_ {T^*}(u,v)\|_{X^{s,b,\theta}_{1,\mathbb{R}^+\times(0,T)}} \le c_3 \big( \| u_0 \|_{H^{s}(\mathbb{R}^+)} + \|\varphi_1\|_{H_t^\frac{s}{3}(0,T)} + 4 {T^*}^{\frac14\beta} \| v \|_{X^{s,b,\theta}_{\alpha,\mathbb{R}^+\times(0,T)}}^2 \big), \end{align} where $c_3\doteq c+cc_1(1+c_2)c_2$. Concerning $\Psi_{T^*}$, working similarly we obtain the estimate \begin{align} \label{Rob2-onto-map-fin-est-1-psi} \hskip-0.1in \|\Psi_ {T^*}(u,v)\|_{X^{s,b,\theta}_{\alpha,\mathbb{R}^+\times(0,T)}} \le c_3 \big( \| v_0 \|_{H^{s}(\mathbb{R}^+)} + \|\varphi_2\|_{H_t^\frac{s}{3}(0,T)} \hskip-0.05in + 4 {T^*}^{\frac14\beta} \| u \|_{X^{s,b,\theta}_{1,\mathbb{R}^+\times(0,T)}} \| v \|_{X^{s,b,\theta}_{\alpha,\mathbb{R}^+\times(0,T)}} \big). \end{align} Now, for $(u,v)\in \mathcal{X}_{MN}$, by estimates \eqref{Rob2-onto-map-fin-est-1} and \eqref{Rob2-onto-map-fin-est-1-psi}, we see that $\Phi\times \Psi$ is onto $\mathcal{X}_{MN}$ if the following two conditions are satisfied \begin{align} \label{Rob2-onto-map-condition-nls} &c_3 \big( \| u_0 \|_{H^{s}(\mathbb{R}^+)} + \|\varphi_1\|_{H_t^\frac{s}{3}(0,T)} \big) + 4 c_3 {T^*}^{\frac14\beta} N^2 \le M, \\ \label{Rob2-onto-map-condition-kdv} &c_3 \big( \| v_0 \|_{H^{s}(\mathbb{R}^+)} + \|\varphi_2\|_{H_t^\frac{s}{3}(0,T)} \big) + 4 c_3 {T^*}^{\frac14\beta} MN \le N. \end{align} {\bf $\Phi_{T^*}\times\Psi_{T^*}$ is contraction.} Again, using the linear estimate \eqref{MB-forced-linear-est1-Rob} with forcing replaced by $\psi_{2{T^*}}[-\frac12\partial_x(v_1^2 - v_2^2)]$, for $0<b\le b^*<\frac12$ we have \begin{align} \label{Rob2-contraction-1} \widetilde{\mathcal{N}}_{\Phi} \doteq &\|\Phi_{T^*}(u_1,v_1)-\Phi_{T^*}(u_2,v_2)\|_{X^{s,b,\theta}_{1,\mathbb{R}^+\times(0,T)}} \le \|\Phi_{T^*}(u_1,v_1)-\Phi_{T^*}(u_2,v_2)\|_{X^{s,b^*,\theta}_{1,\mathbb{R}^+\times(0,T)}} \nonumber \\ \le& \frac12 c \big\| \psi_{2{T^*}}[\partial_x(v_1^2 - v_2^2)] \big\|_{X^{s,-b^*,\theta-1}_{1,\mathbb{R}^+\times(0,T)}} + \frac12 c \big\| \psi_{2{T^*}}[\partial_x(v_1^2 - v_2^2)] \big\|_{Y^{s,-b^*}_{1,\mathbb{R}^+\times(0,T)}} \nonumber \\ \le& \frac12 c \big\| \psi_{2{T^*}} [\partial_x(\widetilde{v}_1^2 - \widetilde{v}_2^2)] \big\|_{X^{s,-b^*,\theta-1}_1} + \frac12 c \big\| \psi_{2{T^*}}[\partial_x(\widetilde{v}_1^2 - \widetilde{v}_2^2)] \big\|_{Y^{s,-b^*}_{1}}, \end{align} where $\widetilde{v}_1$, $\widetilde{v}_2$ are extensions of $v_1$, $v_2$ from $\mathbb{R}^+\times(0,T)$ to $\mathbb{R}^2$ respectively, with $ \|\widetilde{v}_2\|_{X^{s,b,\theta}_\alpha} \le 2 \|v_2\|_{X^{s,b,\theta}_{\alpha,\mathbb{R}^+\times(0,T)}}. $ The extension $\widetilde{v}_1$ is obtained as follows. First, we extend $v=v_1-v_2$ from $\mathbb{R}^+\times(0,T)$ to $\mathbb{R}^2$ such that $ \|\widetilde v_1-\widetilde v_2\|_{X^{s,b,\theta}_\alpha} = \|\widetilde v\|_{X^{s,b,\theta}_\alpha} \le 2 \|v_1-v_2\|_{X^{s,b,\theta}_{\alpha,\mathbb{R}^+\times(0,T)}}. $ Then defining $\widetilde{v}_1\doteq \widetilde v+\widetilde{v}_2$, we see that $\widetilde{v}_1$ extends $v_1$ from $\mathbb{R}^+\times(0,T)$ to $\mathbb{R}^2$ and it satisfies $ \|\widetilde{v}_1\|_{X^{s,b,\theta}_\alpha} \le \|\widetilde{v}\|_{X^{s,b,\theta}_\alpha} + \|\widetilde{v}_2\|_{X^{s,b,\theta}_\alpha} \le 2 \|v_1-v_2\|_{X^{s,b,\theta}_{\alpha,\mathbb{R}^+\times(0,T)}} + 2 \|v_2\|_{X^{s,b,\theta}_{\alpha,\mathbb{R}^+\times(0,T)}} \le 6N. $ Using basic identities about the nonlinearities of our MB system, like \begin{align} \label{product-algebral} v_1^2 - v_2^2 = (v_1-v_2)(v_1+v_2) \quad \text{and} \quad u_1v_1 - u_2v_2 = (u_1-u_2)v_1 + (v_1-v_2)u_2, \end{align} from the bilinear estimates \eqref{bi-est-X-1}-- \eqref{bi-est-Y-2} we get the following useful estimates. \begin{lemma} \label{mb-bi-lem-diff} If $s_c(\alpha)\le s<3$, $\frac12-\beta\le b'\le b<\frac12<\theta'\le \theta\le \frac12+\beta$, then we have \begin{align} &\| \partial_x(v_1^2-v_2^2) \|_{X^{s,-b,\theta-1}_1} \le c_2 ( \| v_1 \|_{X^{s,b',\theta'}_\alpha} + \| v_2 \|_{X^{s,b',\theta'}_\alpha} ) \| v_1-v_2 \|_{X^{s,b',\theta'}_\alpha}, \nonumber \\ &\| \partial_x(u_1v_1 - u_2v_2) \|_{X^{s,-b,\theta-1}_\alpha} \le c_2 \| v_1 \|_{X^{s,b',\theta'}_\alpha} \| u_1-u_2 \|_{X^{s,b',\theta'}_1} + c_2 \| u_2 \|_{X^{s,b',\theta'}_1} \| v_1-v_2 \|_{X^{s,b',\theta'}_\alpha}, \nonumber \\ \label{mb-bilinear-est-diff} &\| \partial_x(v_1^2-v_2^2) \|_{Y^{s,-b}_1} \le c_2 \| \partial_x(v_1^2-v_2^2) \|_{X^{s,-b}_1} + c_2 ( \| v_1 \|_{X^{s,b'}_\alpha} + \| v_2 \|_{X^{s,b'}_\alpha} ) \| v_1-v_2 \|_{X^{s,b'}_\alpha}, \\ &\| \partial_x(u_1v_1 \hskip-0.03in - \hskip-0.03in u_2v_2) \|_{Y^{s,-b}_\alpha} \le c_2 \big[ \| \partial_x(u_1v_1 \hskip-0.03in - \hskip-0.03in u_2v_2) \|_{X^{s,-b}_\alpha} \hskip-0.03in + \hskip-0.03in \| v_1 \|_{X^{s,b'}_\alpha} \| u_1 \hskip-0.03in - \hskip-0.03in u_2 \|_{X^{s,b'}_1} \hskip-0.03in + \hskip-0.03in \| u_2 \|_{X^{s,b'}_1} \| v_1 \hskip-0.03in - \hskip-0.03in v_2 \|_{X^{s,b'}_\alpha} \big]. \nonumber \end{align} \end{lemma} Next, applying bilinear estimates \eqref{mb-bilinear-est-diff} we get $$ \big\| \psi_{2{T^*}}[\partial_x(\widetilde{v}_1^2 - \widetilde{v}_2^2)] \big\|_{Y^{s,-b^*}_{1}} \le c_2 \| \psi_{2{T^*}}\partial_x(\widetilde{v}_1^2-\widetilde{v}_2^2) \|_{X^{s,-b^*}_1} + c_2 ( \| \widetilde{v}_1 \|_{X^{s,b'}_\alpha} + \| \widetilde{v}_2 \|_{X^{s,b'}_\alpha} ) \| \psi_{2{T^*}}( \widetilde{v}_1-\widetilde{v}_2 ) \|_{X^{s,b'}_\alpha}, $$ which combined with estimate \eqref{Rob2-contraction-1} gives us that \begin{align*} \widetilde{\mathcal{N}}_{\Phi} \le \frac{c(1+c_2)}2 \big\| \psi_{2{T^*}} [\partial_x(\widetilde{v}_1^2 - \widetilde{v}_2^2)] \big\|_{X^{s,-b^*,\theta-1}_1} + \frac{cc_2}2 ( \| \widetilde{v}_1 \|_{X^{s,b'}_\alpha} + \| \widetilde{v}_2 \|_{X^{s,b'}_\alpha} ) \| \psi_{2{T^*}}( \widetilde{v}_1-\widetilde{v}_2 ) \|_{X^{s,b'}_\alpha}. \end{align*} Applying the multiplier estimate \eqref{tao-est-modified} with $b$, $b^*$ chosen in \eqref{Rob2-b-b'-choice-wp-2} and $\theta,\theta^*$ chosen in \eqref{Rob2-a-a1-choose} for $\big\| \psi_{2{T^*}} [\partial_x(\widetilde{v}_1^2 - \widetilde{v}_2^2)] \big\|_{X^{s,-b^*,\theta-1}_1}$ and applying estimate \eqref{tao-est} with $b'=\frac12-\frac34\beta$ for $\| \psi_{2{T^*}}( \widetilde{v}_1-\widetilde{v}_2 ) \|_{X^{s,b'}_\alpha}$ we get % \begin{align} \label{Rob2-contraction-map-fin-est} \widetilde{\mathcal{N}}_{\Phi} \le \frac{cc_1(1+c_2)}2 {T^*}^{\frac14\beta} \big\| \partial_x(\widetilde{v}_1^2 - \widetilde{v}_2^2) \big\|_{X^{s,-b,\theta^*-1}_1} + \frac{cc_1c_2}2 {T^*}^{\frac14\beta} ( \| \widetilde{v}_1 \|_{X^{s,b'}_\alpha} + \| \widetilde{v}_2 \|_{X^{s,b'}_\alpha} ) \| \widetilde{v}_1-\widetilde{v}_2 \|_{X^{s,b}_\alpha} \end{align} Also, using estimates \eqref{mb-bilinear-est-diff}, from \eqref{Rob2-contraction-map-fin-est} we get $\widetilde{\mathcal{N}}_{\Phi} \le c_3 {T^*}^{\frac14\beta} ( \| \widetilde{v}_1 \|_{X^{s,b,\theta}_\alpha} + \| \widetilde v_2 \|_{X^{s,b,\theta}_\alpha} ) \| \widetilde v_1-\widetilde v_2 \|_{X^{s,b,\theta}_\alpha} $, or \begin{align} \label{Rob2-contraction-map-fin-est-1} \|\Phi_{T^*}(u_1,v_1)-\Phi_{T^*}(u_2,v_2)\|_{X^{s,b,\theta}_{1,\mathbb{R}^+\times(0,T)}} \le 2c_3 {T^*}^{\frac14\beta} 8N \| v_1-v_2 \|_{X^{s,b,\theta}_{\alpha,\mathbb{R}^+\times(0,T)}}. \end{align} For $\Psi_{T^*}$, working similarly we obtain the companion estimate \begin{align} \label{Rob2-contraction-map-fin-est-1-psi} \hskip-0.1in \|\Psi_{T^*}(u_1,v_1) \hskip-0.02in - \hskip-0.02in \Phi_{T^*}(u_2,v_2)\|_{X^{s,b,\theta}_{\alpha,\mathbb{R}^+\times(0,T)}} \hskip-0.1in \le 2c_3 {T^*}^{\frac14\beta} (6N \| u_1 \hskip-0.02in - \hskip-0.02in u_2 \|_{X^{s,b,\theta}_{1,\mathbb{R}^+\times(0,T)}} \hskip-0.1in + 2M \| v_1 \hskip-0.02in - \hskip-0.02in v_2 \|_{X^{s,b,\theta}_{\alpha,\mathbb{R}^+\times(0,T)}} \hskip-0.03in ). \end{align} Combining estimates \eqref{Rob2-onto-map-condition-nls}, \eqref{Rob2-onto-map-condition-kdv}, \eqref{Rob2-contraction-map-fin-est-1}, \eqref{Rob2-contraction-map-fin-est-1-psi}, and choosing $M$ and $N$ as follows $$ M = N = 2c_3\big( \| u_0 \|_{H^{s}(\mathbb{R}^+)} + \| v_0 \|_{H^{s}(\mathbb{R}^+)} + \|\varphi_1\|_{H_t^\frac{s}{3}(0,T)} + \|\varphi_2\|_{H_t^\frac{s}{3}(0,T)} \big), $$ we see that the iteration map $\Phi_{T^*}\times\Psi_{T^*}$ is a contraction, if $T^*$ satisfies the conditions: $ 4c_3 {T^*}^{\frac14\beta} N^2 \le \frac{M}{2}, $ $ 4c_3 {T^*}^{\frac14\beta} MN \le \frac{N}{2}, $ $ 16c_3N {T^*}^{\frac14\beta} \le \frac14 $ and $ 2c_3( 6N + 2M ) {T^*}^{\frac14\beta} \le \frac14. $ Solving these inequalities, we get $$ {T^*}^{\frac14\beta} \le \frac{1}{64c_3 M} \Longrightarrow T^* \lesssim \big[ 2c_3\big( \| u_0 \|_{H^{s}(\mathbb{R}^+)} + \| v_0 \|_{H^{s}(\mathbb{R}^+)} + \|\varphi_1\|_{H_t^\frac{s}{3}(0,T)} + \|\varphi_2\|_{H_t^\frac{s}{3}(0,T)} \big) +1 \big]^{-4/\beta}, $$ which holds if we choose a lifespan $T_0<\frac12$ satisfying estimate \eqref{MB-lifespan-Rob1} stated in our main Theorem \ref{thm-MB-half-line-Rob}. The proof for the Lip-continuity of the data to solution map and for the uniqueness of solution is similar to the one presented in \cite{bop1998} for well-posedness on the line. \,\, $\square$ \section{Proof of Bilinear Estimates in $X^{s,b,\theta}$} \label{sec:bilinear-est} \setcounter{equation}{0} In this section we prove the spatial bilinear estimates in modified Bourgain spaces. We focus mostly on estimate \eqref{bi-est-X-1} for the coupled nonlinearity of the $u$-equation. Since the bilinear estimates for the $v$-equation are similar, we only provide a brief outline of their main differences at the end of this section. % Also, the bilinear estimates for $\alpha=1$ (i.e. for the KdV equation) can be found in \cite{h2006}. We begin by recalling the following calculus estimates \cite{kpv1996, h2006}. \begin{lemma} \label{lem:calc_ineq} If $1>\ell>1/2, 1>l'>1/2$ then \begin{subequations} \begin{align} \label{eq:calc_1a} \int_{\mathbb{R}}\frac{dx}{(1+|x-a|)^{2\ell}(1+|x-c|)^{2\ell'}}&\lesssim\frac{1}{(1+|a-c|)^{2\min\{\ell',\ell\}}}, \\ \label{eq:calc_4} \int_{|x|\leq c}\frac{dx}{(1+|x|)^{2(1-l)}\sqrt{|a-x|}}&\lesssim\frac{(1+c)^{2(\ell-1/2)}}{(1+|a|)^{1/2}}. \end{align} \end{subequations} In addition, if $\frac14<\ell'\leq \ell<\frac12$, then \begin{equation} \label{eq:calc_5} \int_{\mathbb{R}}\frac{dx}{(1+|x-a|)^{2\ell}(1+|x-c|)^{2\ell'}}\lesssim\frac{1}{(1+|a-c|)^{2\ell+2\ell'-1}}. \end{equation} \end{lemma} \noindent Next, we express our bilinear estimate \eqref{bi-est-X-1}, i.e. $ \| \partial_x(fg) \|_{X^{s,-b,\theta-1}_{1}} \le c_2 \| f \|_{X^{s,b',\theta'}_{\alpha}} \| g \|_{X^{s,b',\theta'}_{\alpha}} $ in its $L^2$ form. Using the fact that $a^2+b^2\leq(|a|+|b|)^2\leq 2(a^2+b^2)$, we get $ \|w\|_{X^{s,b,\theta}_{\alpha}}^2 \simeq \int_{\mathbb{R}^2} \big[ (1+|\xi|)^{s} (1+|\tau-\alpha\xi^3|)^{b} + $ $ \chi_{|\xi|< 1}(1+|\tau|)^{\theta} \big]^2 |\widehat{w}(\xi,\tau)|^2 d\xi d\tau. $ Following Colliander and Kenig's notation \cite{ck2002}, for a function $h$ we denote the integrand under the integral of the modified Bourgain norm by \begin{equation} \label{eq:c_u} c_{h,\alpha}(\xi,\tau) \doteq \Big[ (1+|\xi|)^{s} (1+|\tau-\alpha\xi^3|)^{b'} + \chi_{|\xi|< 1}(1+|\tau|)^{\theta'} \Big] |\widehat{h}(\xi,\tau)|. \end{equation} Then, the modified Bourgain norm of $h$ is approximately equal to the $L^2$ norm of $c_{h,\alpha}$, that is \begin{equation} \label{eq:c_useful} \|h\|_{X^{s,b',\theta'}_{\alpha}} \simeq \|c_{h,\alpha}(\xi,\tau)\|_{L^2_{\xi,\tau}}. \end{equation} Thus, to prove bilinear estimate \eqref{bi-est-X-1}, it suffices to show the following $L^2$ inequality (formulation) \begin{align} \label{bilinear-est-L2-form} \Big\| \int_{\mathbb{R}^2} Q(\xi,\tau,\xi_1,\tau_1) c_{f,\alpha}(\xi-\xi_1,\tau-\tau_1) c_{g,\alpha}(\xi_1,\tau_1) d\xi_1 d\tau_1 \Big\|_{L^2_{\xi,\tau}} \lesssim \big\|c_{f,\alpha}\big\|_{L^2_{\xi,\tau}} \big\|c_{g,\alpha}\big\|_{L^2_{\xi,\tau}}, \end{align} where $Q$ is the multiplier defined by \begin{align*} Q(\xi,\tau,\xi_1,\tau_1) \doteq& |\xi| \cdot \Big[ \frac{ (1+|\xi|)^s }{ (1+|\tau-\xi^{3}|)^{b} } + \frac{ \chi_{|\xi|< 1} } { (1+|\tau|)^{1-\theta} } \Big] \cdot \frac{1}{ (1+|\xi_1|)^{s} (1+|\tau_1-\alpha\xi_1^3|)^{b'} + \chi_{|\xi_1|< 1}(1+|\tau_1|)^{\theta'} } \\ \times& \frac{1}{ (1+|\xi-\xi_1|)^{s} (1+|\tau-\tau_1-\alpha(\xi-\xi_1)^3|)^{b'} + \chi_{|\xi-\xi_1|< 1}(1+|\tau-\tau_1|)^{\theta'} }. \end{align*} For $b'\le b$ and $ 1-\theta \ge b, $ we have $ \big[ \frac{ (1+|\xi|)^s }{ (1+|\tau-\xi^{3}|)^{b} } + \frac{ \chi_{|\xi|< 1} } { (1+|\tau|)^{1-\theta} } \big] \lesssim \frac{ (1+|\xi|)^s }{ (1+|\tau-\xi^{3}|)^{b'} }. $ Using this and factoring out $ \frac{(1+|\xi|)^s}{ (1+|\xi_1|)^{s} (1+|\xi-\xi_1|)^{s} }, $ we get $ Q(\xi,\tau,\xi_1,\tau_1) \lesssim Q'(\xi,\tau,\xi_1,\tau_1), $ where \begin{align} \label{Q'-def} Q'(\xi,\tau,\xi_1,\tau_1) =& \frac{|\xi|}{(1+|\tau-\xi^{3}|)^{b'}} \frac{(1+|\xi|)^s}{ (1+|\xi_1|)^{s} (1+|\xi-\xi_1|)^{s} } \frac{1}{ (1+|\tau_1-\alpha\xi_1^3|)^{b'} + \chi_{|\xi_1|< 1}(1+|\tau_1|)^{\theta'} } \nonumber \\ \times& \frac{1} { (1+|\tau-\tau_1-\alpha(\xi-\xi_1)^3|)^{b'} + \chi_{|\xi-\xi_1|< 1}(1+|\tau-\tau_1|)^{\theta'} }. \end{align} Hence for any $s\in\mathbb{R}$, to prove the bilinear estimate \eqref{bilinear-est-L2-form-no1}, it suffices to prove that \begin{align} \label{bilinear-est-L2-form-no1} \Big\| \int_{\mathbb{R}^2} Q'(\xi,\tau,\xi_1,\tau_1) c_{f,\alpha}(\xi-\xi_1,\tau-\tau_1) c_{g,\alpha}(\xi_1,\tau_1) d\xi_1 d\tau_1 \Big\|_{L^2_{\xi,\tau}} \lesssim \big\|c_{f,\alpha}\big\|_{L^2_{\xi,\tau}} \big\|c_{g,\alpha}\big\|_{L^2_{\xi,\tau}}. \end{align} \subsection{The case $s\ge 0$} Then, we have $ \frac{(1+|\xi|)^s}{(1+|\xi-\xi_1|)^s(1+|\xi_1|)^s} \lesssim 1, $ which implies that $Q'\leq Q_0$, where \begin{align*} Q_0(\xi,\tau,\xi_1,\tau_1) \doteq& \frac{|\xi|}{(1+|\tau-\xi^{3}|)^{b'}} \frac{1}{ (1+|\tau_1-\alpha\xi_1^3|)^{b'} + \chi_{|\xi_1|< 1}(1+|\tau_1|)^{\theta'} } \\ \times& \frac{1} { (1+|\tau-\tau_1-\alpha(\xi-\xi_1)^3|)^{b'} + \chi_{|\xi-\xi_1|< 1}(1+|\tau-\tau_1|)^{\theta'} }. \end{align*} Therefore, when $s\geq 0$ the proof of (\ref{bilinear-est-L2-form-no1}) is reduced to proving \begin{align} \label{bilinear-est-s-0} \Big\| \int_{\mathbb{R}^2} Q_0(\xi,\tau,\xi_1,\tau_1) c_{f,\alpha}(\xi-\xi_1,\tau-\tau_1) c_{g,\alpha}(\xi_1,\tau_1) d\xi_1 d\tau_1 \Big\|_{L^2_{\xi,\tau}} \lesssim \big\|c_{f,\alpha}\big\|_{L^2_{\xi,\tau}} \big\|c_{g,\alpha}\big\|_{L^2_{\xi,\tau}}, \end{align} which corresponds to proving the bilinear estimate when $s=0$. By symmetry (in convolution writing), we may assume that \begin{equation} \label{conv-symmetry-xi} |\xi-\xi_1| \leq |\xi_1|. \end{equation} Next, for simplifying our proof, we decompose the multiplier $Q_0(\xi,\tau,\xi_1,\tau_1)$ as the sum of three multipliers $ Q_0(\xi,\tau,\xi_1,\tau_1) = Q_1(\xi,\tau,\xi_1,\tau_1) + Q_2(\xi,\tau,\xi_1,\tau_1) + Q_3(\xi,\tau,\xi_1,\tau_1), $ where \begin{align} \label{u-s-0-Q1} &Q_1(\xi,\tau,\xi_1,\tau_1) \doteq \chi_{|\xi_1|< 1} \cdot \chi_{|\xi-\xi_1|< 1} \cdot Q_0(\xi,\tau,\xi_1,\tau_1) \\ =& \frac{|\xi|}{(1+|\tau-\xi^{3}|)^{b'}} \frac{ \chi_{|\xi_1|< 1} }{ (1+|\tau_1-\alpha\xi_1^3|)^{b'} + (1+|\tau_1|)^{\theta'} } \frac{ \chi_{|\xi-\xi_1|< 1} } { (1+|\tau-\tau_1-\alpha(\xi-\xi_1)^3|)^{b'} + (1+|\tau-\tau_1|)^{\theta'} }, \nonumber \end{align} \begin{align} \label{u-s-0-Q2} &Q_2(\xi,\tau,\xi_1,\tau_1) \doteq \chi_{|\xi_1|\ge 1} \cdot \chi_{|\xi-\xi_1|<1} \cdot Q_0(\xi,\tau,\xi_1,\tau_1) \nonumber \\ =& \frac{|\xi|}{(1+|\tau-\xi^{3}|)^{b'}} \frac{ \chi_{|\xi_1|\ge 1} }{ (1+|\tau_1-\alpha\xi_1^3|)^{b'} } \frac{ \chi_{|\xi-\xi_1|< 1} } { (1+|\tau-\tau_1-\alpha(\xi-\xi_1)^3|)^{b'} + (1+|\tau-\tau_1|)^{\theta'} }, \end{align} \vskip-0.1in \noindent and \begin{align} \label{u-s-0-Q3} Q_3(\xi,\tau,\xi_1,\tau_1) \doteq& \chi_{|\xi_1|\ge 1} \cdot \chi_{|\xi-\xi_1|\ge 1} \cdot Q_0(\xi,\tau,\xi_1,\tau_1) \nonumber \\ =& \frac{|\xi|}{(1+|\tau-\xi^{3}|)^{b'}} \frac{ \chi_{|\xi_1|\ge 1} }{ (1+|\tau_1-\alpha\xi_1^3|)^{b'} } \frac{ \chi_{|\xi-\xi_1|\ge 1} } { (1+|\tau-\tau_1-\alpha(\xi-\xi_1)^3|)^{b'} }. \end{align} Now, in the multiplier $Q_3$ we recognize the familiar (from the Cauchy problem theory) Bourgain quantity \begin{align} \label{d3-quantity} (\tau-\xi^3)-(\tau_1-\alpha\xi_1^3)-[\tau-\tau_1-\alpha(\xi-\xi_1)^3] = -\xi^3+\alpha\xi_1^3+\alpha(\xi-\xi_1)^3 \doteq d_{\alpha}(\xi,\xi_1), \end{align} which is related to the $u$-equation. Observe that for the KdV equation ($\alpha=1$) this quantity is \begin{equation} \label{d-1} d_1(\xi,\xi_1) \doteq -\xi^3+\xi_1^3+(\xi-\xi_1)^3 = 3\xi\xi_1(\xi_1-\xi) . \end{equation} Below, we list several useful and elementary properties for this quantity. \begin{lemma} \label{d-alpha-property} The Bourgain quantity $d_\alpha (\xi,\xi_1)$ satisfies the following properties: \begin{equation} \label{d-comparison} \max\{ |\tau-\xi^3|, |\tau_1-\alpha\xi_1^3|, |\tau-\tau_1-\alpha(\xi-\xi_1)^3| \} \ge \frac13 |d_{\alpha}(\xi,\xi_1)|, \end{equation} \vskip-0.3in \begin{align} \label{d-le-4-xi1} d_{\alpha}(\xi,\xi_1) =& 3\alpha\xi (\xi_1 - r_1 \xi) ( \xi_1- r_2\xi ), \,\, \text{with} \,\, r_1 = \frac12-\frac{\sqrt{-3+12\alpha^{-1}}}{6}, \,\, r_2 = \frac12+\frac{\sqrt{-3+12\alpha^{-1}}}{6}, \\ \label{d-4} d_{4}(\xi,\xi_1) =& 3\xi (\xi-2\xi_1)^2 = 12 \xi (\xi_1-\xi/2)^2, \\ \label{d-bound-xi} d_{\alpha}(\xi,\xi_1) =& 3\alpha\xi \big[ (\xi_1-\frac12\xi)^2 + \frac{\alpha-4}{12\alpha} \xi^2 \big] \Longrightarrow |d_{\alpha}(\xi,\xi_1)| \ge \frac{\alpha-4}{4} |\xi|^3, \,\, \alpha>4, \\ \label{d-bound-xi1} d_{\alpha}(\xi,\xi_1) =& (\alpha-1)\xi \Big[ \Big( \xi-\frac{3\alpha\,\xi_1}{2(\alpha-1)} \Big)^2 \hskip-0.04in + \frac{3\alpha(\alpha-4)}{4(\alpha-1)^2} \xi_1^2 \Big] \Longrightarrow |d_{\alpha}(\xi,\xi_1)| \ge \frac{3\alpha(\alpha-4)}{4(\alpha-1)} |\xi||\xi_1|^2, \,\, \alpha>4, \end{align} \vskip-0.2in \begin{align} \label{d-partial-xi1} \frac{\partial d_{\alpha}}{\partial\xi_1} =& 3\alpha\xi_1^2 - 3\alpha(\xi_1-\xi)^2 = 6\alpha \xi(\xi_1-\xi/2), \\ \label{d-partial-xi} \frac{\partial d_{\alpha}}{\partial\xi} =& 3(\alpha-1)(\xi-p_1)(\xi-p_2), \,\, \text{with} \,\, p_1 = \frac{\sqrt{\alpha}}{\sqrt{\alpha}-1}\xi_1, \,\, p_2 = \frac{\sqrt{\alpha}}{\sqrt{\alpha}+1}\xi_1, \quad \alpha\neq 1, \\ \label{d-2partial-xi} \frac{\partial^2 d_{\alpha}}{\partial\xi^2} =& -6\xi + 6\alpha(\xi-\xi_1) = 6(\alpha-1) (\xi-q), \,\, \text{with} \,\, q = \frac{\alpha}{\alpha-1}\xi_1, \quad \alpha\neq 1. \end{align} \end{lemma} \noindent To prove the bilinear estimate \eqref{bilinear-est-s-0}, it suffices to prove that for $\ell = 1,2,3$ we have \begin{align} \label{bilinear-est-s-l} \Big\| \int_{\mathbb{R}^2} Q_\ell(\xi,\tau,\xi_1,\tau_1) c_{f,\alpha}(\xi-\xi_1,\tau-\tau_1) c_{g,\alpha}(\xi_1,\tau_1) d\xi_1 d\tau_1 \Big\|_{L^2_{\xi,\tau}} \lesssim \big\|c_{f,\alpha}\big\|_{L^2_{\xi,\tau}} \big\|c_{g,\alpha}\big\|_{L^2_{\xi,\tau}}. \end{align} \underline{\bf Proof for multiplier $Q_1$.} Using the Cauchy--Schwarz inequality with respect to $(\xi_1,\tau_1)$ and taking the supremum in $(\xi,\tau)$, we arrive at \begin{align*} \Big\| \hskip-0.05in \int_{\mathbb{R}^2} \hskip-0.07in Q_1(\xi,\tau,\xi_1,\tau_1) c_{f,\alpha}(\xi-\xi_1,\tau-\tau_1) c_{g,\alpha}(\xi_1,\tau_1) d\xi_1 d\tau_1 \Big\|_{L^2} \hskip-0.06in \lesssim \hskip-0.02in \big\|c_{f,\alpha}\big\|_{L^2} \big\|c_{g,\alpha}\big\|_{L^2} \Big\| \hskip-0.06in \int_{\mathbb{R}^2} \hskip-0.06in Q_1^2(\xi,\tau,\xi_1,\tau_1) d\xi_1 d\tau_1 \Big\|_{L^{\infty}_{\xi,\tau}}^{\frac12}. \end{align*} Thus, to prove bilinear estimate \eqref{bilinear-est-s-l} with $\ell=1$, it suffices to show the following result for $Q_1$ in \eqref{u-s-0-Q1}. \begin{lemma} \label{s-0-theta-1-lemma} Let $\alpha>0$, $\theta'>\frac12$ and $b'\ge0$, for $\xi,\tau\in\mathbb{R}$, we have \begin{align} \label{s-0-theta-1} \Theta_1(\xi,\tau) \doteq& \frac{\xi^2}{(1+|\tau-\xi^{3}|)^{2b'}} \int_{\mathbb{R}^2} \frac{ \chi_{|\xi_1|< 1} }{ [ (1+|\tau_1-\alpha\xi_1^3|)^{b'} + (1+|\tau_1|)^{\theta'} ]^2 } \nonumber \\ \times&\frac{ \chi_{|\xi-\xi_1|< 1} \quad d\xi_1 d\tau_1 } { [ (1+|\tau-\tau_1-\alpha(\xi-\xi_1)^3|)^{b'} + (1+|\tau-\tau_1|)^{\theta'} ]^2 } \lesssim 1. \end{align} \end{lemma} \noindent {\bf Proof of Lemma \ref{s-0-theta-1-lemma}}. In \eqref{s-0-theta-1}, dropping $(1+|\tau_1-\alpha\xi_1^3|)^{b'}$ and $(1+|\tau-\tau_1-\alpha(\xi-\xi_1)^3|)^{b'}$ from the denominator, applying estimate \eqref{eq:calc_1a} with $x=\tau_1$, $\ell=\ell'=\theta'>\frac12$, $a=0$ and $c=\tau$, we get $ \Theta_1(\xi,\tau) \leq \frac{\xi^2}{(1+|\tau-\xi^{3}|)^{2b'}} \int_\mathbb{R} \frac{ \chi_{|\xi_1|< 1} \chi_{|\xi-\xi_1|<1} } { (1+|\tau|)^{2\theta'} } d\xi_1\lesssim 1, $ since $|\xi_1|<1$ and $|\xi-\xi_1|<1$. \,\, $\square$ \vskip0.05in \noindent \underline{\bf Proof for multiplier $Q_2$.} We will consider two possible microlocalizations \vskip0.05in \noindent {\bf $\bullet$ Microlocalization I: $|\tau-\xi^{3}|\ge |\tau_1-\alpha\xi_1^3|$}. In this case we define the domain \begin{align*} B_{I} \doteq \big\{ (\xi,\tau,\xi_1,\tau_1) \in{\mathbb{R}}^4: |\tau-\xi^{3}|\ge |\tau_1-\alpha\xi_1^3|, |\xi_1|\ge 1, |\xi-\xi_1|<1 \big\}. \end{align*} {\bf $\bullet$ Microlocalization II: $|\tau-\xi^{3}|< |\tau_1-\alpha\xi_1^3|$}. In this situation we define the domain \begin{align*} B_{II} \doteq \big\{(\xi,\tau,\xi_1,\tau_1)\in{\mathbb{R}}^4: |\tau-\xi^{3}|< |\tau_1-\alpha\xi_1^3|, |\xi_1|\ge1, |\xi-\xi_1|<1 \big\}. \end{align*} {\bf Estimate in microlocalization I:} $|\tau-\xi^{3}|\ge |\tau_1-\alpha\xi_1^3|$. As before, using the Cauchy--Schwarz inequality with respect to $(\xi_1,\tau_1)$, and taking the supremum over $(\xi,\tau)$ we arrive at \begin{align*} & \Big\| \int_{\mathbb{R}^2} (\chi_{B_I} Q_2)(\xi,\tau,\xi_1,\tau_1) c_{f,\alpha}(\xi-\xi_1,\tau-\tau_1) c_{g,\alpha}(\xi_1,\tau_1) d\xi_1 d\tau_1 \Big\|_{L^2_{\xi,\tau}} \nonumber \\ & \lesssim \big\|c_{f,\alpha}\big\|_{L^2_{\xi,\tau}} \big\|c_{g,\alpha}\big\|_{L^2_{\xi,\tau}} \Big\| \int_{\mathbb{R}^2} (\chi_{B_I} Q_2^2)(\xi,\tau,\xi_1,\tau_1) d\xi_1 d\tau_1 \Big\|_{L^{\infty}_{\xi,\tau}}^{1/2}. \end{align*} Thus, to prove bilinear estimate \eqref{bilinear-est-s-l}, it suffices to show the following result for $Q_2$ defined in \eqref{u-s-0-Q2}. \begin{lemma} \label{s-0-theta-2-lemma} Let $\alpha>0$. If $\frac13\leq b'<\frac12$ and $\theta'>1/2$, then for $\xi,\tau\in\mathbb{R}$ we have \begin{align} \label{s-0-theta-2} \hskip-0.12in \Theta_2(\xi,\tau) =& \frac{ \xi^2 }{ (1\hskip-0.03in + \hskip-0.03in |\tau-\xi^{3}|)^{2b'} } \hskip-0.04in \int_{\mathbb{R}^2} \hskip-0.04in \frac{ \chi_{|\xi_1|\ge 1} \, \chi_{|\xi-\xi_1|<1} \, \chi_{B_{I}}(\xi,\tau,\xi_1,\tau_1) \quad d\xi_1 d\tau_1 } { (1\hskip-0.02in + \hskip-0.02in |\tau_1-\alpha\xi_1^3|)^{2b'} [ (1 \hskip-0.02in + \hskip-0.02in |\tau-\tau_1-\alpha(\xi-\xi_1)^3|)^{b'} \hskip-0.04in + (1 \hskip-0.02in + \hskip-0.02in |\tau-\tau_1|)^{\theta'} ]^2 } \lesssim 1. \end{align} \end{lemma} \noindent {\bf Proof of Lemma \ref{s-0-theta-2-lemma}}. Dropping $(1+|\tau-\tau_1-\alpha(\xi-\xi_1)^3|)^{b'}$ from the denominator, splitting $ \frac{1}{(1+|\tau-\xi^{3}|)^{2b'}} = \frac{1}{(1+|\tau-\xi^{3}|)^{6b'-2}} \frac{1}{(1+|\tau-\xi^{3}|)^{2-4b'}}, $ putting $\frac{1}{(1+|\tau-\xi^{3}|)^{2-4b'}}$ inside the integral in \eqref{s-0-theta-2} and using $ \frac{1}{(1+|\tau-\xi^{3}|)^{2-4b'}} \lesssim \frac{1}{(1+|\tau_1-\alpha\xi_1^3|)^{2-4b'}} $ to replace $\frac{1}{(1+|\tau-\xi^{3}|)^{2-4b'}}$ by $\frac{1}{(1+|\tau_1-\alpha\xi_1^3|)^{2-4b'}}$, we get \begin{align} \label{s-0-theta-2-est-no1} \Theta_2(\xi,\tau) \leq& \frac{\xi^2}{(1+|\tau-\xi^{3}|)^{6b'-2}} \int_{\mathbb{R}^2} \frac{ 1 }{ (1+|\tau-\xi^3|)^{2-4b'} } \frac{ \chi_{|\xi_1|\ge1} }{ (1+|\tau_1-\alpha\xi_1^{3}|)^{2b'} } \frac{ \chi_{|\xi-\xi_1|< 1} } { (1+|\tau-\tau_1|)^{2\theta'} } d\xi_1 d\tau_1 \nonumber \\ \leq& \frac{\xi^2}{(1+|\tau-\xi^{3}|)^{6b'-2}} \int_{\mathbb{R}^2} \frac{ \chi_{|\xi_1|\ge 1} }{ (1+|\tau_1-\alpha\xi_1^{3}|)^{2-2b'} } \frac{ \chi_{|\xi-\xi_1|< 1} } { (1+|\tau-\tau_1|)^{2\theta'} } d\xi_1 d\tau_1. \end{align} Now, applying estimate \eqref{eq:calc_1a} with $x=\tau_1$, $\ell'=\theta'$, $\ell=1-b'$, $a=\tau$ and $c=\alpha\xi_1^3$, we get \begin{equation} \label{s-0-theta-2-est-no1} \Theta_2(\xi,\tau) \lesssim \frac{ \xi^2 }{ (1+|\tau-\xi^3|)^{6b'-2} } \int_{\mathbb{R}} \frac{ \chi_{|\xi_1|\ge1} \chi_{|\xi-\xi_1|< 1} }{ (1+|\tau-\alpha\xi_1^{3}|)^{\min\{2\theta',2-2b'\}} } d\xi_1. \end{equation} Next we consider the following two possible cases \vskip0.05in \noindent $\bullet $ Case 1: $|\xi|\leq 20$ \qquad $\bullet $ Case 2: $|\xi|> 20$ \vskip0.05in \noindent {\bf Estimate in Case 1: $|\xi|\leq 20$.} Then, using the triangle inequality we get $ |\xi_1| = |\xi_1-\xi+\xi| \leq |\xi-\xi_1|+|\xi| \lesssim 1. $ Combining this estimate with \eqref{s-0-theta-2-est-no1}, for $b'<1/2$ and $6b'-2\geq 0$ or $ 1/3\le b'<1/2$ we get the desired estimate \eqref{s-0-theta-2}. This completes the proof in case 1. \vskip0.05in \noindent {\bf Estimate in Case 2: $|\xi|> 20$.} Then, using the triangle inequality we have $ |\xi_1| \simeq |\xi|. $ Combining this with \eqref{s-0-theta-2-est-no1} and making the change of variable, $\mu=\alpha\xi_1^3$, for $\min\{2\theta',2-b'\}>1$ we get $ \Theta_2(\xi,\tau) \lesssim \frac{1}{(1+|\tau-\xi^{3}|)^{6b'-2}}, $ which is bounded if $6b'-2\ge 0$ or $ b' \geq \frac13. $ This completes the proof of Lemma \ref{s-0-theta-2-lemma}. \,\, $\square$ \vskip0.05in \noindent {\bf Estimate in microlocalization II: $|\tau-\xi^{3}|< |\tau_1-\alpha\xi_1^3|$.} In this microlocalization, using duality and applying the Cauchy--Schwarz inequality first in $(\xi_1, \tau_1)$ and then in $(\xi, \tau)$, we arrive at \begin{align*} &\Big\| \int_{\mathbb{R}^2} (\chi_{B_{II}} Q_2)(\xi,\tau,\xi_1,\tau_1) c_{f,\alpha}(\xi-\xi_1,\tau-\tau_1) c_{g,\alpha}(\xi_1,\tau_1) d\xi_1 d\tau_1 \Big\|_{L^2_{\xi,\tau}} \\ \leq& \|c_{f,\alpha}\|_{L^2_{\xi,\tau}}\|c_{g,\alpha}\|_{L^2_{\xi,\tau}} \Big\| \int_{\mathbb{R}^2} (\chi_{B_{II}} Q_2^2)(\xi,\tau,\xi_1,\tau_1)d\xi d\tau \Big\|_{L^{\infty}_{\xi_1,\tau_1}}^{1/2}. \end{align*} Thus, to prove our bilinear estimate \eqref{bilinear-est-s-l} in this microlocalization, it suffices to show the following result for $Q_2$ defined in \eqref{u-s-0-Q2}. \begin{lemma} \label{s-0-theta-3-lemma} Let $\alpha>0$. If $\frac13\leq b'<\frac12$ and $\theta'>\frac12$, then for $\xi_1,\tau_1\in\mathbb{R}$ we have \begin{align*} \Theta_3(\xi_1,\tau_1) =& \frac{ \chi_{|\xi_1|\ge1} }{ (1+|\tau_1-\alpha\xi_1^3|)^{2b'} } \int_{\mathbb{R}^2} \frac{ \xi^2 }{ (1+|\tau-\xi^{3}|)^{2b'} } \frac{ \chi_{|\xi-\xi_1|< 1} \, \chi_{B_{II}}(\xi,\tau,\xi_1,\tau_1) \quad d\xi d\tau } { [ (1+|\tau-\tau_1-\alpha(\xi-\xi_1)^3|)^{b'} + (1+|\tau-\tau_1|)^{\theta'} ]^2 } \lesssim 1. \end{align*} \end{lemma} \noindent {\bf Proof of Lemma \ref{s-0-theta-3-lemma}}. This proof is similar to the proof of Lemma \ref{s-0-theta-2-lemma}. So, we omit it. \,\, $\square$ \vskip.05in \noindent \underline{\bf Proof for multiplier $Q_3$.} By symmetry (in convolution writing), we assume that $ |\tau-\tau_1-\alpha(\xi-\xi_1)^{3}| \leq |\tau_1-\alpha\xi_1^{3}|. $ Therefore, to prove estimate \eqref{bilinear-est-s-l} for $Q_3$ we distinguish two microlocalizations: \vskip0.05in \noindent {\bf $\bullet$ Microlocalization III: $|\tau_1-\alpha\xi_1^{3}|<|\tau-\xi^{3}|$}. In this situation we define the domain \begin{align*} B_{III} \doteq \big\{ (\xi,\tau,\xi_1,\tau_1) \in{\mathbb{R}}^4: |\tau-\tau_1-\alpha(\xi-\xi)^{3}|\leq|\tau_1-\alpha\xi_1^{3}|<|\tau-\xi^{3}|, |\xi_1|\ge1, |\xi-\xi_1|\ge1 \big\}. \end{align*} {\bf $\bullet$ Microlocalization IV: $|\tau-\xi^{3}|\leq|\tau_1-\alpha\xi_1^{3}|$}. In this case we define the domain \begin{align*} \hskip-0.1in B_{IV} \doteq \big\{(\xi,\tau,\xi_1,\tau_1)\in{\mathbb{R}}^4: \max\{|\tau-\tau_1-\alpha(\xi-\xi)^{3}|, |\tau-\xi^{3}| \}\leq|\tau_1-\alpha\xi_1^{3}|, |\xi_1| \hskip-0.01in \ge1, |\xi-\xi_1| \hskip-0.01in \ge1 \big\}. \end{align*} {\bf Proof of bilinear estimate in microlocalization III.} In this situation, using the Cauchy--Schwarz inequality with respect to $(\xi_1,\tau_1)$, and taking the supremum over $(\xi,\tau)$ we arrive at \begin{align*} & \Big\| \int_{\mathbb{R}^2} (\chi_{B_{III}} Q_3)(\xi,\tau,\xi_1,\tau_1) c_{f,\alpha}(\xi-\xi_1,\tau-\tau_1) c_{g,\alpha}(\xi_1,\tau_1) d\xi_1 d\tau_1 \Big\|_{L^2_{\xi,\tau}} \nonumber \\ & \lesssim \big\|c_{f,\alpha}\big\|_{L^2_{\xi,\tau}} \big\|c_{g,\alpha}\big\|_{L^2_{\xi,\tau}} \Big\| \int_{\mathbb{R}^2} (\chi_{B_{III}} Q_3^2)(\xi,\tau,\xi_1,\tau_1) d\xi_1 d\tau_1 \Big\|_{L^{\infty}_{\xi,\tau}}^{1/2}. \end{align*} Thus, to prove our bilinear estimate \eqref{bilinear-est-s-l} in this microlocalization, it suffices to show the following result for $Q_3$ defined in \eqref{u-s-0-Q3}. \begin{lemma} \label{s-0-lem4} Let $\alpha>0$ and $\alpha\neq 4$. If $\frac{5}{12}\leq b'<1/2$, then for $\xi,\tau\in\mathbb{R}$ \begin{align} \label{s-0-theta4} \Theta_4(\xi,\tau) \doteq \frac{\xi^2}{(1+|\tau-\xi^{3}|)^{2b'}} \int_{\mathbb{R}^2}\frac{ \chi_{B_{III}}(\xi,\tau,\xi_1,\tau_1)\,\,\, \quad d\tau_1 d\xi_1 }{(1+|\tau-\tau_1-\alpha(\xi-\xi_1)^{3}|)^{2b'}(1+|\tau_1-\alpha\xi_1^{3}|)^{2b'}} \lesssim 1. \end{align} \end{lemma} \noindent {\bf Proof of bilinear estimate in microlocalization IV.} In this case, using duality and applying the Cauchy--Schwarz inequality first in $(\xi_1, \tau_1)$ and then in $(\xi, \tau)$, we get \begin{align*} &\Big\| \int_{\mathbb{R}^2} (\chi_{B_{IV}} Q_3)(\xi,\tau,\xi_1,\tau_1) c_{f,\alpha}(\xi-\xi_1,\tau-\tau_1) c_{g,\alpha}(\xi_1,\tau_1) d\xi_1 d\tau_1 \Big\|_{L^2_{\xi,\tau}} \\ \lesssim& \|c_{f,\alpha}\|_{L^2_{\xi,\tau}}\|c_{g,\alpha}\|_{L^2_{\xi,\tau}} \Big\| \int_{\mathbb{R}^2} (\chi_{B_{IV}} Q_3^2)(\xi,\tau,\xi_1,\tau_1)d\xi d\tau \Big\|_{L^{\infty}_{\xi_1,\tau_1}}^{1/2}. \end{align*} Thus, to prove our bilinear estimate \eqref{bilinear-est-s-l} in this microlocalization, it suffices to show the following result for $Q_3$ as in \eqref{u-s-0-Q3}. \begin{lemma} \label{s-0-lem5} Let $\alpha>0$, $\alpha\neq 1$ and $\alpha\neq 4$. If $\frac{5}{12}\leq b'<1/2$, then for $\xi_1,\tau_1\in\mathbb{R}$ \begin{align} \label{s-0-theta5} \Theta_5(\xi_1, \tau_1) \doteq \frac{1}{(1+|\tau_1-\alpha\xi_1^{3}|)^{2b'}} \int_{\mathbb{R}^2} \frac{ \chi_{B_{IV}}(\xi,\tau,\xi_1,\tau_1) \,\, \xi^2\, \, d\tau d\xi}{(1+|\tau-\tau_1-\alpha(\xi-\xi_1)^{3}|)^{2b'}(1+|\tau-\xi^{3}|)^{2b'}} \lesssim 1. \end{align} \end{lemma} \noindent {\bf Proof of Lemma \ref{s-0-lem4}.} For the $\tau_1$-integral in \eqref{s-0-theta4}, applying estimate \eqref{eq:calc_5} with $\ell=\ell'=b'$, $a=\tau-\alpha(\xi-\xi_1)^3$ and $c=\alpha\xi_1^3$, we get \begin{equation} \label{s-0-theta4-est} \Theta_4(\xi,\tau) \lesssim \frac{\xi^2}{(1+|\tau-\xi^{3}|)^{2b'}} \int_{\mathbb{R}} \frac{ \chi_{B_{III}}(\xi,\tau,\xi_1,\tau_1) d\xi_1 }{(1+|\tau-\alpha(\xi-\xi_1)^{3}-\alpha\xi_1^3|)^{4b'-1}} = \frac{\xi^2}{(1+|\tau-\xi^{3}|)^{2b'}} I(\xi,\tau), \end{equation} \vskip-0.08in \noindent where \begin{equation} \label{I-def-s-0} I(\xi,\tau) \doteq \int_{\mathbb{R}} \frac{ \chi_{B_{III}}(\xi,\tau,\xi_1,\tau_1) d\xi_1 }{(1+|\tau-\alpha(\xi-\xi_1)^{3}-\alpha\xi_1^3|)^{4b'-1}} = \int_{\mathbb{R}} \frac{ \chi_{B_{III}}(\xi,\tau,\xi_1,\tau_1) d\xi_1 }{(1+|\tau-\xi^3-d_{\alpha}(\xi,\xi_1)|)^{4b'-1}}. \end{equation} Here we recall that $d_{\alpha}(\xi,\xi_1)=-\xi^3+\alpha\xi_1^3+\alpha(\xi-\xi_1)^3$ is the Bourgain quantity of $u$-equation. Now we need the following result. \begin{lemma} \label{l-lem-s-0} Let $\alpha>0$. If $\frac14<b'<\frac12$, then for all $\xi\neq 0$ and $\tau\in\mathbb{R}$ we have \begin{align} \label{I-est-s-0} I(\xi, \tau) \lesssim \frac{|\xi|^{-\frac12}(1+|\tau-\xi^3|)^{2-4b'}}{(1+|\tau-\frac{\alpha}{4}\xi^3|)^{\frac12}}. \end{align} \end{lemma} \noindent The proof of Lemma \ref{l-lem-s-0} comes later. Here combining estimate \eqref{I-est-s-0} with \eqref{s-0-theta4-est}, we get \begin{align} \label{s-0-theta4-est-no1} \Theta_4(\xi,\tau) \lesssim& \frac{\xi^2}{(1+|\tau-\xi^{3}|)^{2b'}} \frac{|\xi|^{-\frac12}(1+|\tau-\xi^3|)^{2-4b'}}{(1+|\tau-\frac{\alpha}{4}\xi^3|)^{\frac12}} = \frac{|\xi|^{3/2}}{(1+|\tau-\xi^{3}|)^{6b'-2}(1+|\tau-\frac{\alpha}{4}\xi^3|)^{\frac12}}. \end{align} For $|\xi|\le 1$ and $6b'-2\ge 0$ or $b'\ge \frac13$, from \eqref{s-0-theta4-est-no1} we get $\Theta_4\lesssim1$. Hence, we assume that $|\xi|>1$. For $\alpha\ne 4$, we consider the two cases possible. \vskip0.05in \noindent $\bullet$ Case 1: $|\tau-\xi^3|\leq \frac12\big|1-\frac{\alpha}{4}\big||\xi|^3$ \qquad $\bullet$ Case 2: $|\tau-\xi^{3}|> \frac12\big|1-\frac{\alpha}{4}\big||\xi|^3$ \vskip0.05in \noindent {\bf Estimate in Case 1: $|\tau-\xi^3|\leq \frac12\big|1-\frac{\alpha}{4}\big||\xi|^3$.} Then, using the triangle inequality, we have $ |\tau-\frac{\alpha}4\xi^3| \ge \frac12\big|1-\frac{\alpha}{4}\big||\xi|^3. $ Hence, from \eqref{s-0-theta4-est-no1} for $6b'-2\ge 0$ or $b'\ge\frac13$ we get $ \Theta_4(\xi,\tau) \lesssim \frac{|\xi|^{3/2}}{1} \frac{1}{|\xi|^{3/2}} = 1. $ \vskip0.05in \noindent {\bf Estimate in Case 2: $|\tau-\xi^{3}|> \frac12\big|1-\frac{\alpha}{4}\big||\xi|^3$.} Then $ |\tau-\xi^{3}| \gtrsim |\xi|^{3} $ and therefore from \eqref{s-0-theta4-est-no1} we get $ \Theta_4(\xi,\tau) \lesssim \frac{|\xi|^{3/2}}{|\xi^3|^{6b'-2}} \cdot \frac{1}{1} \leq \frac{1} { |\xi|^{3(6b'-2)-3/2} }. $ Since $|\xi|> 1$, this quantity is bounded if and only if $ 3(6b'-2)-3/2 \geq 0 $ or $ b' \geq 5/12. $ This completes the proof of Lemma \ref{s-0-lem4}, once we prove Lemma \ref{l-lem-s-0}. \,\, $\square$ \vskip0.05in \noindent {\bf Proof of Lemma \ref{l-lem-s-0}.} Our strategy is to make the change of variables, $ \mu=\mu(\xi_1)=d_{\alpha}(\xi,\xi_1)$. For this to be a good change, we must split the integration at the critical point of $\mu(\xi_1)$. Using the identity \eqref{d-partial-xi1}, i.e. $ \partial d_{\alpha}/\partial\xi_1 = 6\alpha \xi(\xi_1-\xi/2), $ we see that $\xi_1={\xi}/{2}$ is the only critical point. Thus, assuming $\xi>0$ ($\xi<0$ is similar) we define the $\xi_1$-intervals $ \mathcal{I}_1^{\xi_1} \doteq (-\infty, \xi/2) $ and $ \mathcal{I}_2^{\xi_1} \doteq (\xi/2, \infty). $ Now, making the change of variables $\mu=\mu(\xi_1)=d_{\alpha}(\xi,\xi_1)$ in each one of these intervals and defining $\mathcal{I}_k^{\mu}$ be the range of $\mu(\xi_1)$ for $\xi_1\in \mathcal{I}_k^{\xi_1}$, from \eqref{I-def-s-0} we get \begin{equation} \label{s-0-xi1-Jk} I(\xi,\tau) = J_1(\xi,\tau)+J_2(\xi,\tau), \quad \text{ where } J_k(\xi,\tau) = \int_{\mathcal{I}_k^{\mu}} \frac{ \chi_{B_{III}}(\xi,\tau,\xi_1,\tau_1) }{(1+|\tau-\xi^3-\mu|)^{4b'-1}} \frac{1}{|\mu'(\xi_1)|} d\mu, \quad k=1,2. \end{equation} Next, we estimate $|\mu'(\xi_1)|$. Using $ |\mu(\xi_1) - \mu(\xi/2)| = \big| [-\xi^{3} + \alpha\xi_1^{3} + \alpha(\xi-\xi_1)^{3} ] - [ -\xi^{3} + \alpha(\xi/2)^{3} + \alpha(\xi-\xi/2)^{3} ] \big| = 3\alpha|\xi|(\xi_1-\xi/2)^2, $ we get $ |\xi_1-\xi/2| = \sqrt{|\mu(\xi_1)-\mu(\xi/2)|/ (3\alpha|\xi|)}. $ Combining this identity with formula \eqref{d-partial-xi1}, we have $ |\mu'(\xi_1)| = 6\alpha|\xi(\xi_1-\xi/2)| \simeq |\xi|^{1/2} |\mu(\xi_1)-\mu(\xi/2)|^{1/2}. $ Substituting this into the integral in \eqref{s-0-xi1-Jk}, we obtain \begin{equation} \label{s-0-xi1-Jk-no1} J_{k}(\xi,\tau) \lesssim |\xi|^{-\frac12}\int_{\mathcal{I}_k^\mu}\frac{ \chi_{B_{III}}(\xi,\tau,\xi_1,\tau_1) }{(1+|\tau-\xi^3-\mu|)^{4b'-1}} \frac{1}{|\mu-\mu(\xi/2)|^{\frac12}} d\mu, \quad k=1,2. \end{equation} Moreover making the change of variables $\mu_1=\tau-\xi^3-\mu$ and using $\mu(\xi/2)=-(1-\frac14\alpha)\xi^3$, we get \begin{align} \label{I1-split-s-0-no3} J_{k}(\xi,\tau) \le |\xi|^{-\frac12}\int_{\mathbb{R}}^\infty \frac{ \chi_{B_{III}}(\xi,\tau,\xi_1,\tau_1) }{(1+|\mu_1|)^{4b'-1}} \frac{1}{|\mu_1-(\tau-\frac{\alpha}4\xi^3)|^{\frac12}} d\mu_1, \quad k=1,2. \end{align} In addition, by comparison property \eqref{d-comparison} we have $ |\tau-\xi^3| \ge \frac13 |d_{\alpha}(\xi,\xi_1)| = \frac13|\mu|, $ which implies that $ |\mu_1| \leq |\mu| + |\tau-\xi^3| \lesssim |\tau-\xi^3|. $ Finally, for the $\mu_1$-integral in \eqref{I1-split-s-0-no3}, applying estimate \eqref{eq:calc_4} with $2(1-\ell)=4b'-1$, $a=\tau-\frac{\alpha}{4}\xi^3$ and $c=|\tau-\xi^3|$, we get $ J_k(\xi, \tau) \lesssim \frac{|\xi|^{-\frac12}(1+|\tau-\xi^3|)^{2-4b'}}{(1+|\tau-\frac{\alpha}{4}\xi^3|)^{\frac12}} $ ($k=1,2$), which combined with \eqref{s-0-xi1-Jk} gives us the desired estimate \eqref{I-est-s-0} and completes the proof of Lemma \ref{l-lem-s-0}. \,\, $\square$ \vskip0.05in \noindent {\bf Proof of Lemma \ref{s-0-lem5}.} For the $\tau$-integral in \eqref{s-0-theta5}, applying estimate \eqref{eq:calc_5} with $\ell=\ell'=b'$, $a=\xi^3$ and $c=\tau_1+\alpha(\xi-\xi_1)^3$, we get \begin{align} \label{s-0-theta5-est} \Theta_5(\xi_1,\tau_1) \lesssim \frac{1}{(1+|\tau_1-\alpha\xi_1^{3}|)^{2b'}} \int_{\mathbb{R}} \frac{ \chi_{B_{IV}}(\xi,\tau,\xi_1,\tau_1) \, \xi^2 }{(1+|\tau_1-\alpha\xi_1^3+d_{\alpha}(\xi,\xi_1)|)^{4b'-1}} d\xi , \end{align} \begin{minipage}{0.65\linewidth} where we recall that $ d_{\alpha}(\xi,\xi_1) = -\xi^{3} + \alpha\xi_1^{3} + \alpha (\xi-\xi_1)^{3}. $ Now, our strategy for estimating the $\xi$-integral in \eqref{s-0-theta5-est} is to make the change of variables $\mu=\mu(\xi)=d_{\alpha}(\xi,\xi_1)$. For this to be a good change, we must split the integration at the critical points of $d_{\alpha}(\xi,\xi_1)$, which are $ p_1 = \frac{\sqrt{\alpha}}{\sqrt{\alpha}-1}\xi_1, $ $ p_2 = \frac{\sqrt{\alpha}}{\sqrt{\alpha}+1}\xi_1. $ Also, the inflection point of $\mu(\xi)=d_{\alpha}(\xi,\xi_1)$ is $q=\frac{\alpha}{\alpha-1}\xi_1$. In the case that $0<\alpha<1$ and $\xi_1>0$, the graph of $\mu=\mu(\xi)=d_{\alpha}(\xi,\xi_1)$ looks as in Figure \ref{fig:s-0-xi}. \end{minipage} \hskip-0.4in \begin{minipage}{0.5\linewidth} \begin{center} \begin{tikzpicture}[yscale=0.3, xscale=0.7] \newcommand\X{0}; \newcommand\Y{0}; \newcommand\FX{8}; \newcommand\FY{8}; \newcommand\R{0.6}; \newcommand\Alpha{0.5}; \newcommand*{\TickSize}{2pt}; \draw[black,line width=1pt,-{Latex[black,length=2mm,width=2mm]}] (-4.5,0) -- (2,0) node[above] {\fontsize{\FX}{\FY}\bf \textcolor{black}{$\xi$}}; \draw[black,line width=1pt,-{Latex[black,length=2mm,width=2mm]}] (0,-5.5) -- (0,2) node[right] {\fontsize{\FX}{\FY}\bf \textcolor{black}{$\mu(\xi)$}}; \draw[line width=1pt, yscale=1,domain=-3.9:1.5,smooth,variable=\x,red] plot ({\x},{-(\x)^3+\Alpha+\Alpha*(\x-1)^3}); \draw[dashed,black,line width=0.5pt] (0,0) node[xshift=-0.15cm, yshift=-0.3cm] {\fontsize{\FX}{\FY}\bf $0$} ({sqrt(\Alpha)/(sqrt(\Alpha)-1)},0) node[yshift=0.2cm] {\fontsize{\FX}{\FY}\bf $p_1$} -- ({sqrt(\Alpha)/(sqrt(\Alpha)-1)},{(\Alpha*\Alpha-2*(sqrt(\Alpha))^(3))/(1-sqrt(\Alpha))^2}) ({sqrt(\Alpha)/(sqrt(\Alpha)+1)},0) node[yshift=-0.2cm] {\fontsize{\FX}{\FY}\bf $p_2$} -- ({sqrt(\Alpha)/(sqrt(\Alpha)+1)},{(\Alpha*\Alpha+2*(sqrt(\Alpha))^(3))/(1+sqrt(\Alpha))^2}) ({\Alpha/(\Alpha-1)},0) node[xshift=0cm, yshift=0.2cm] {\fontsize{\FX}{\FY}\bf $q$} -- ({\Alpha/(\Alpha-1)},{-(\Alpha/(\Alpha-1))^3+\Alpha+\Alpha*(\Alpha/(\Alpha-1)-1)^3}) ; \end{tikzpicture} \vskip-0.05in \captionof{figure}{$0<\alpha<1$, $\xi_1>0$} \label{fig:s-0-xi} \end{center} \end{minipage} \vskip0.04in Also, we would like to split the $\xi$-integral in a way such that $\xi$ is close to the critical points $p_1$, $p_2$ and away from the inflection points $q$. Furthermore, we notice that $|p_1-q|=|p_2-q|=\frac{\sqrt{\alpha}}{|1-\alpha|}|\xi_1|$. Thus, choosing a small number $\delta=\delta(\alpha)>0$ as follows \begin{equation} \label{delta-def} \delta = \delta(\alpha) \doteq \frac{1}{10} \min\big\{ \frac{\sqrt{\alpha}}{|1-\alpha|}, \frac{1}{1000} \big\}, \end{equation} \vskip-0.03in \noindent and assuming that $\xi_1>0$ and $0<\alpha<1$ (the other cases are similar), we define the $\xi$-intervals $ \mathcal{I}_{1}^\xi \doteq \big( -\infty , p_1-\delta\xi_1 \big), $ $ \mathcal{I}_{2}^\xi \doteq \big( p_1-\delta\xi_1 , p_1 \big), $ $ \mathcal{I}_{3}^\xi \doteq \big( p_1 , p_1+\delta\xi_1 \big), $ $ \mathcal{I}_{4}^\xi \doteq \big( p_1+\delta\xi_1 , p_2-\delta\xi_1 \big), $ $ \mathcal{I}_{5}^\xi \doteq \big( p_2-\delta\xi_1 , p_2 \big), $ $ \mathcal{I}_{6}^\xi \doteq \big( p_2 , p_2+\delta\xi_1 \big) $ and $ \mathcal{I}_{7}^\xi \doteq \big( p_2+\delta\xi_1 , \infty \big), $ which are visualized in Figure \ref{fig:s-0-xi-axis} \noindent \begin{minipage}{1\linewidth} \begin{center} \begin{tikzpicture}[yscale=1, xscale=0.8] \newcommand\X{0}; \newcommand\Y{0}; \newcommand\FX{11}; \newcommand\FY{11}; \newcommand\R{0.6}; \newcommand*{\TickSize}{2pt}; \draw[black,line width=1pt,-{Latex[black,length=2mm,width=2mm]}] (-9,0) -- (9,0) node[above] {\fontsize{\FX}{\FY} $\xi$}; \draw[red] (-10,0) node[yshift=0cm,black,line width=1pt] {\bf \fontsize{\FX}{\FY}$\xi_1> 0:$} node[xshift=-0.3cm,yshift=-0.5cm,black,line width=1pt] {\bf \fontsize{\FX}{\FY}$0<\alpha<1$} (0,0) node[yshift=-0.4cm] {\fontsize{\FX}{\FY}$q$} node[yshift=0cm] {$\bullet$} node[xshift=0cm,yshift=0.6cm, black] {\fontsize{\FX}{\FY}$\mathcal{I}_4^\xi$} (-7,0) node[xshift=-1cm,yshift=0.6cm, black] {\fontsize{\FX}{\FY}$\mathcal{I}_1^\xi$} (-5,0) node[yshift=-0.4cm] {\fontsize{\FX}{\FY}$p_1$} node[yshift=0cm] {$\bullet$} node[xshift=-1cm,yshift=0.6cm, black] {\fontsize{\FX}{\FY}$\mathcal{I}_2^\xi$} node[xshift=1cm,yshift=0.6cm, black] {\fontsize{\FX}{\FY}$\mathcal{I}_3^\xi$} (-2.5,0) node[yshift=-0.4cm] {\fontsize{\FX}{\FY}$p_1+\delta\xi_1$} node[yshift=0cm] {$\bullet$} (-7.5,0) node[yshift=-0.4cm] {\fontsize{\FX}{\FY}$p_1-\delta\xi_1$} node[yshift=0cm] {$\bullet$} (5,0) node[yshift=-0.4cm] {\fontsize{\FX}{\FY}$p_2$} node[yshift=0cm] {$\bullet$} node[xshift=-1cm,yshift=0.6cm, black] {\fontsize{\FX}{\FY}$\mathcal{I}_5^\xi$} node[xshift=1cm,yshift=0.6cm, black] {\fontsize{\FX}{\FY}$\mathcal{I}_6^\xi$} (2.5,0) node[yshift=-0.4cm] {\fontsize{\FX}{\FY}$p_2-\delta\xi_1$} node[yshift=0cm] {$\bullet$} (7.5,0) node[yshift=-0.4cm] {\fontsize{\FX}{\FY}$p_2+\delta\xi_1$} node[yshift=0cm] {$\bullet$} (8,0) node[xshift=0cm,yshift=0.6cm, black] {\fontsize{\FX}{\FY}$\mathcal{I}_7^\xi$} ; \draw [decorate,decoration={brace,mirror,raise=5pt},thick] (-2.5,0) -- (-5,0); \draw [decorate,decoration={brace,mirror,raise=5pt},thick] (-5,0) -- (-7.5,0); \draw [decorate,decoration={brace,mirror,raise=5pt},thick] (7.5,0) -- (5,0); \draw [decorate,decoration={brace,mirror,raise=5pt},thick] (5,0) -- (2.5,0); \end{tikzpicture} \vskip-0.15in \captionof{figure}{$\xi$-intervals} \label{fig:s-0-xi-axis} \end{center} \end{minipage} \vskip0.05in \noindent Then, making the change of variables $\mu=\mu(\xi)=d_{\alpha}(\xi,\xi_1)$ in each one of these intervals and defining $\mathcal{I}_k^\mu$ be the range of $\mu(\xi)$ for $\xi\in \mathcal{I}_k^\xi$, from \eqref{s-0-theta5-est} we obtain % \begin{align*} \Theta_5 \lesssim \sum\limits_{k=1}^7 J_k(\xi_1,\tau_1) \text{ with } J_k(\xi_1,\tau_1) \doteq \frac{1}{(1+|\tau_1-\alpha\xi_1^{3}|)^{2b'}} \int_{\mathcal{I}_{k}^{\mu}} \frac{ \chi_{B_{IV}}(\xi,\tau,\xi_1,\tau_1) \, \xi^2 }{(1+|\tau_1-\alpha\xi_1^3+\mu|)^{4b'-1}} \frac{1}{|\mu'(\xi)|} d\mu. \end{align*} For our estimation below, we need the next inequality. \vskip-0.1in \begin{lemma} \label{dist-lem} If $|a-b|\ge \varepsilon |b|$ with $\varepsilon>0$, then $ \displaystyle |a-b| \ge \min\{ \frac12, \frac{\varepsilon}{2} \} |a|. $ \end{lemma} \noindent {\bf Estimation away from critical points.} If $\xi\in \mathcal{I}_k^\xi$, $k=1,4,7$, then using formula \eqref{d-partial-xi} and the elementary inequality of Lemma \ref{dist-lem}, we get $ |\mu'(\xi)| = 3|\alpha-1| | \xi-p_1 | | \xi-p_2 | \gtrsim \xi^2, $ which gives us \begin{align} \label{s-0-theta5-J1-est} J_k(\xi_1,\tau_1) \lesssim \frac{1}{(1+|\tau_1-\alpha\xi_1^{3}|)^{2b'}} \int_{\mathbb{R}} \frac{ \chi_{B_{IV}}(\xi,\tau,\xi_1,\tau_1) }{(1+|\mu_1|)^{4b'-1}} d\mu_1, \quad k=1,4,7. \end{align} Now, using comparison property \eqref{d-comparison}, i.e. $|\tau_1-\alpha\xi_1^3|\ge \frac13|d_\alpha|=\frac13|\mu|$, we have $|\mu_1|\le|\mu|+|\tau_1-\alpha\xi_1^3|\lesssim |\tau_1-\alpha\xi_1^3|$, which helps us estimate the $\mu_1$-integral in \eqref{s-0-theta5-J1-est} as follows \begin{align*} J_k(\xi_1,\tau_1) \lesssim& \frac{1}{(1+|\tau_1-\alpha\xi_1^{3}|)^{2b'}} \cdot (1+|\tau_1-\alpha\xi_1^{3}|)^{2-4b'} = \frac{1}{(1+|\tau_1-\alpha\xi_1^{3}|)^{6b'-2}}, \quad k=1,4,7, \end{align*} and we see that $J_k$ is bounded if $6b'-2\ge 0$ or $b'\ge 1/3$. \vskip0.05in \noindent {\bf Estimation near critical points.} Since $p_1, p_2$ are like $\xi_1$, and $\xi$ is near $p_1$ and $p_2$, we have $|\xi|\simeq |\xi_1|$. Using this and taking $|\xi|^2$ outside the integral, we get % \begin{align} \label{s-0-theta5-J2} J_k(\xi_1,\tau_1) \lesssim \frac{|\xi_1|^2}{(1+|\tau_1-\alpha\xi_1^{3}|)^{2b'}} \int_{\mathcal{I}_{k}^{\mu}} \frac{ \chi_{B_{IV}}(\xi,\tau,\xi_1,\tau_1) }{(1+|\tau_1-\alpha\xi_1^3+\mu|)^{4b'-1}} \frac{1}{|\mu'(\xi)|} d\mu, \quad k=2,3,5,6. \end{align} \underline{Estimation for $J_2$ and $J_3$.} We begin by deriving a lower bound for $|\mu'(\xi)|=|\partial d_\alpha/\partial \xi|$. Using linear approximation at $p_1$ with remainder, we have $ \mu(\xi) = \mu(p_1) + \mu'(p_1) (\xi-p_1) + \frac{\mu''(\eta_1)}2 (\xi-p_1)^2, $ where $\eta_1$ is some number between $\xi$ and $p_1$. Since $p_1$ is a critical point, we have $ \mu(\xi) = \mu(p_1) + \frac{\mu''(\eta_1)}2 (\xi-p_1)^2, $ which gives \begin{equation} \label{xi-p1-dis} |\xi-p_1| = \sqrt{ 2[\mu(\xi)-\mu(p_1)]/\mu''(\eta_1) }. \end{equation} Furthermore, since $\xi\in \mathcal{I}_{2}^\xi\cup \mathcal{I}_{3}^{\xi}$, $\eta_1$ is also in $\mathcal{I}_{2}^\xi\cup \mathcal{I}_{3}^{\xi}$. Moreover, by the choosing of $\delta$, we get $\delta |\xi_1|\le \frac1{10}|p_1-q|=\frac1{10}\frac{\sqrt{\alpha}}{|\alpha-1|}|\xi_1|$, which gives us $|\eta_1-q|\le \frac{11}{10}|p_1-q|=\frac{11}{10}\frac{\sqrt{\alpha}}{|\alpha-1|}|\xi_1|$. Now, using formula \eqref{d-2partial-xi}, i.e. $ \mu''(\eta_1) = 6(1-\alpha) \big( \eta_1-q \big), $ we get $|\mu''(\eta_1)|\lesssim |\xi_1|$, which combined with \eqref{xi-p1-dis} implies \begin{equation} \label{s-0-xi-p1-dist} |\xi-p_1| \gtrsim \sqrt{ |\mu(\xi)-\mu(p_1)|/|\xi_1| }. \end{equation} Also, for $\xi\in \mathcal{I}_2^\xi\cup \mathcal{I}_3^\xi$, we have $|\xi-p_2|\ge \delta|\xi_1|$. Combining this with estimate \eqref{s-0-xi-p1-dist}, by \eqref{d-partial-xi} we get \begin{equation} \label{s-0-mu-der-est} |\mu'(\xi)| = 3|\alpha-1| | \xi-p_1 | | \xi-p_2 | \gtrsim \sqrt{ |\mu(\xi)-\mu(p_1)|/|\xi_1| } |\xi_1| = |\xi_1|^{1/2} \sqrt{ |\mu(\xi)-\mu(p_1)| }. \end{equation} Using estimate \eqref{s-0-mu-der-est} and making the change of variables $\mu_1=\mu+\tau_1-\alpha\xi_1^3$, from \eqref{s-0-theta5-J2} we get \begin{align} \label{s-0-case2-theta-3-est2} J_k(\xi_1,\tau_1) \lesssim \frac{|\xi_1|^{3/2}}{(1+|\tau_1-\alpha\xi_1^{3}|)^{2b'}} \int_{\mathbb{R}} \frac{ \chi_{B_{IV}}(\xi,\tau,\xi_1,\tau_1) }{(1+|\mu_1|)^{4b'-1}} \frac{1}{\sqrt{ |\mu_1-(\tau_1-\alpha\xi_1^3)-\mu(p_1)| }} d\mu_1, \quad k=2,3. \end{align} Moreover, using comparison property \eqref{d-comparison}, we have $|\mu_1|\lesssim |\tau_1-\alpha\xi_1^3|$. For the $\mu_1$-integral in \eqref{s-0-case2-theta-3-est2}, applying estimate \eqref{eq:calc_4} with $2(1-\ell)=4b'-1$, $a=\tau_1-\alpha\xi_1^3+\mu(p_1)$ and $c=|\tau_1-\alpha\xi_1^3|$, we get \begin{align} \label{s-0-case1-theta-3-est-no2} J_k(\xi_1,\tau_1) \lesssim \frac{|\xi_1|^{3/2}}{ (1+|\tau_1-\alpha\xi_1^{3}|)^{6b'-2} (1+|\tau_1-\alpha\xi_1^3+\mu(p_1)|)^{\frac12}}, \quad k=2,3. \end{align} We observe that the difference between the two factors in the denominator is $\mu(p_1)$, which is $ \mu(p_1) = -p_1^3 + \alpha\xi_1^3 + \alpha(p_1-\xi_1)^3 = \frac{\alpha^2-2\alpha^{3/2}}{(1-\sqrt{\alpha})^2} \xi_1^3. $ Noticing that for $|\xi_1|\ge 1$, $\mu(p_1)=0$ if and only if $\alpha=4$. So if $\alpha\neq 4$, then like the estimate for the quantity in \eqref{s-0-theta4-est-no1}, by considering the following two cases: $|\tau_1-\alpha\xi_1^3|\leq \frac12|\mu(p_1)|$ and $|\tau_1-\alpha\xi_1^{3}|> \frac12|\mu(p_1)|$, we get $J_k\lesssim 1$ ($k=2,3$) for $b'\ge \frac5{12}$. \vskip0.05in \noindent \underline{Estimation for $J_5$ and $J_6$.} Using the linear approximation at $p_2$, we get (similar to estimate \eqref{s-0-case1-theta-3-est-no2}) \begin{align*} J_k(\xi_1,\tau_1) \lesssim \frac{|\xi_1|^{3/2}}{ (1+|\tau_1-\alpha\xi_1^{3}|)^{6b'-2} (1+|\tau_1-\alpha\xi_1^3+\mu(p_2)|)^{\frac12}}, \quad k=5,6. \end{align*} Also, since $\mu(p_2)=\frac{\alpha^2+2\alpha^{3/2}}{(1+\sqrt{\alpha})^2} \xi_1^3\neq 0$ for $|\xi_1|>1$, by considering the two cases $|\tau_1-\alpha\xi_1^3|\leq \frac12|\mu(p_2)|$ and $|\tau_1-\alpha\xi_1^{3}|> \frac12|\mu(p_2)|$, we get $J_5\lesssim 1$ and $J_6\lesssim 1$ for $b'\ge \frac{5}{12}$. This completes the proof of Lemma \ref{s-0-lem5}. \,\, $\square$ \vskip0.05in \noindent {\bf Conclusion.} In the case $s\ge 0$, Lemmas \ref{s-0-theta-1-lemma}--\ref{s-0-lem5} imply bilinear estimate \eqref{bilinear-est-s-0}, if $\alpha\neq 1$ and $\alpha\neq 4$. \subsection{$s<0$ with $\alpha>4$} First, we observe that to prove the bilinear estimate \eqref{bi-est-X-1}, it suffices to show it for $|\xi_1|$ and $|\xi-\xi_1|$ away from 0, that is \begin{equation} \label{above-1-cond} |\xi_1|> 1 \qquad \text{and} \qquad |\xi-\xi_1|>1. \end{equation} In fact, if $|\xi_1|\leq 1$ or $|\xi-\xi_1|\leq 1$ then our estimate \eqref{bilinear-est-L2-form-no1} is reduced to the case that $s=0$ by \begin{equation} \label{sob-mult} \frac{(1+|\xi|)^s}{ (1+|\xi_1|)^{s} (1+|\xi-\xi_1|)^{s} } \lesssim 1, \end{equation} which is the combination of Sobolev multipliers appearing in $Q'$ defined in \eqref{Q'-def}. For $|\xi_1|< 1$ inequality \eqref{sob-mult} follows from $ (1+|\xi-\xi_1|)(1+|\xi_1|)\leq (1+|\xi|+1)\cdot2 = 4(1+|\xi|/2)\leq 4(1+|\xi|) $ and $s<0$. For $|\xi-\xi_1|< 1$ this inequality \eqref{sob-mult} follows from $ (1+|\xi-\xi_1|)(1+|\xi_1|)\leq 2\cdot(1+|\xi|+1) = 4(1+|\xi|/2)\leq 4(1+|\xi|) $ and $s<0$. Then $Q'$ in estimate \eqref{bilinear-est-L2-form-no1} is replaced by $Q_0$ and so we are reduced to $s=0$. \vskip0.05in Now, using assumption \eqref{above-1-cond} we can replace $ (1+|\xi_1|)^{-s} (1+|\xi-\xi_1|)^{-s} $ by $ |\xi_1(\xi-\xi_1)|^{-s} $. Also, dropping $ \chi_{|\xi_1|< 1}(1+|\tau_1|)^{\theta'} $ and $ \chi_{|\xi-\xi_1|< 1}(1+|\tau-\tau_1|)^{\theta'}, $ we see that to prove estimate \eqref{bilinear-est-L2-form-no1} it suffices to do it with $Q'$ being replaced with \begin{align} \label{Q1-modify-no1-s-neg} Q_1(\xi,\tau,\xi_1,\tau_1) \doteq \frac{|\xi|}{(1+|\tau-\xi^{3}|)^{b'}} \frac{(1+|\xi|)^s|\xi_1(\xi-\xi_1)|^{-s}}{ (1+|\tau_1-\alpha\xi_1^3|)^{b'} } \frac{1} { (1+|\tau-\tau_1-\alpha(\xi-\xi_1)^3|)^{b'} }. \end{align} Furthermore, by symmetry (in convolution writing), we assume that $ |\tau-\tau_1-\alpha(\xi-\xi_1)^{3}| \leq |\tau_1-\alpha\xi_1^{3}|. $ Also, we consider the following two microlocalizations: \vskip0.05in \noindent {\bf $\bullet$ Microlocalization I: $|\tau_1-\alpha\xi_1^{3}|\leq|\tau-\xi^{3}|$}. In this situation we define the domain \begin{align*} E_I \doteq \big\{ (\xi,\tau,\xi_1,\tau_1) \in{\mathbb{R}}^4: |\tau-\tau_1-\alpha(\xi-\xi)^{3}|\leq|\tau_1-\alpha\xi_1^{3}|<|\tau-\xi^{3}|, |\xi_1|\ge1, |\xi-\xi_1|\ge1 \big\}. \end{align*} {\bf $\bullet$ Microlocalization II: $|\tau-\xi^{3}|\leq|\tau_1-\alpha\xi_1^{3}|$.} In this case we define the domain \begin{align*} E_{II} \doteq \big\{ (\xi,\tau,\xi_1,\tau_1)\in{\mathbb{R}}^4: \max\{|\tau-\tau_1-\alpha(\xi-\xi)^{3}|, |\tau-\xi^{3}| \}\leq|\tau_1-\alpha\xi_1^{3}|, |\xi_1| \ge1, |\xi-\xi_1| \ge1 \big\}. \end{align*} {\bf Proof of bilinear estimate in microlocalization I.} Here our bilinear estimate \eqref{bilinear-est-L2-form-no1} is reduced to \begin{align} \label{bilinear-est-neg-EI} \Big\| \int_{\mathbb{R}^2} (\chi_{E_I} Q_1)(\xi,\tau,\xi_1,\tau_1) c_{f,\alpha}(\xi-\xi_1,\tau-\tau_1) c_{g,\alpha}(\xi_1,\tau_1) d\xi_1 d\tau_1 \Big\|_{L^2_{\xi,\tau}} \lesssim \big\|c_{f,\alpha}\big\|_{L^2_{\xi,\tau}} \big\|c_{g,\alpha}\big\|_{L^2_{\xi,\tau}}. \end{align} Using the Cauchy--Schwarz inequality with respect to $(\xi_1,\tau_1)$, and taking the supremum over $(\xi,\tau)$ we obtain the following estimate for the left-hand side of \eqref{bilinear-est-neg-EI} \begin{align*} &\Big\| \int_{\mathbb{R}^2} (\chi_{E_I} Q_1)(\xi,\tau,\xi_1,\tau_1) c_{f,\alpha}(\xi-\xi_1,\tau-\tau_1) c_{g,\alpha}(\xi_1,\tau_1) d\xi_1 d\tau_1 \Big\|_{L^2_{\xi,\tau}} \nonumber \\ & \lesssim \big\|c_{f,\alpha}\big\|_{L^2_{\xi,\tau}} \big\|c_{g,\alpha}\big\|_{L^2_{\xi,\tau}} \Big\| \int_{\mathbb{R}^2} (\chi_{E_{I}} Q_1^2)(\xi,\tau,\xi_1,\tau_1) d\xi_1 d\tau_1 \Big\|_{L^{\infty}_{\xi,\tau}}^{\frac12}. \end{align*} So, to prove bilinear estimate \eqref{bilinear-est-neg-EI}, it suffices to show the following result for $Q_1$ defined by \eqref{Q1-modify-no1-s-neg}. \begin{lemma} \label{s-neg-lem1} Let $\alpha>4$. If $\max\{\frac{15-4s}{36},\frac{7}{18}\}< b'<\frac12$ and $s>-\frac34$ then for $\xi,\tau\in\mathbb{R}$ \begin{align} \label{s-neg-theta1} \Theta_1(\xi,\tau) \doteq \frac{\xi^2(1+|\xi|)^{2s}}{(1+|\tau-\xi^{3}|)^{2b'}} \int_{\mathbb{R}^2} \frac{ \chi_{E_I}(\xi,\tau,\xi_1,\tau_1)|\xi_1(\xi-\xi_1)|^{-2s}\,\,\, \quad d\tau_1 d\xi_1 }{(1+|\tau-\tau_1-\alpha(\xi-\xi_1)^{3}|)^{2b'}(1+|\tau_1-\alpha\xi_1^{3}|)^{2b'}} \lesssim 1. \end{align} \end{lemma} \noindent {\bf Proof of bilinear estimate in microlocalization II.} In this situation, using duality and applying the Cauchy--Schwarz inequality first in $(\xi_1, \tau_1)$ and then in $(\xi, \tau)$, we get \begin{align*} & \Big\| \int_{\mathbb{R}^2} (\chi_{E_{II}} Q_1)(\xi,\tau,\xi_1,\tau_1) c_{f,\alpha}(\xi-\xi_1,\tau-\tau_1) c_{g,\alpha}(\xi_1,\tau_1) d\xi_1 d\tau_1 \Big\|_{L^2_{\xi,\tau}} \\ \lesssim& \|c_{f,\alpha}\|_{L^2_{\xi,\tau}}\|c_{g,\alpha}\|_{L^2_{\xi,\tau}} \Big\| \int_{\mathbb{R}^2} (\chi_{E_{II}} Q_1^2)(\xi,\tau,\xi_1,\tau_1)d\xi d\tau \Big\|_{L^{\infty}_{\xi_1,\tau_1}}^{\frac12}. \end{align*} Thus, to prove estimate \eqref{bilinear-est-neg-EI} in this case it suffices to prove the following lemma with $Q_1$ as in \eqref{Q1-modify-no1-s-neg}. \begin{lemma} \label{s-neg-lem2} Let $\alpha>4$. If $\max\{\frac{15-4s}{36},\frac{7}{18}\}< b'<1/2$ and $s>-\frac34$, then for $\xi_1,\tau_1\in\mathbb{R}$ \begin{align} \label{s-neg-theta2} \Theta_2(\xi_1, \tau_1) \doteq \frac{1}{(1+|\tau_1-\alpha\xi_1^{3}|)^{2b'}} \int_{\mathbb{R}^2} \frac{ \chi_{E_{II}}(\xi,\tau,\xi_1,\tau_1) \,\, \xi^2 (1+|\xi|)^{2s} |\xi_1(\xi-\xi_1)|^{-2s} \, \, d\tau d\xi}{(1+|\tau-\tau_1-\alpha(\xi-\xi_1)^{3}|)^{2b'}(1+|\tau-\xi^{3}|)^{2b'}} \lesssim 1. \end{align} \end{lemma} \noindent {\bf Proof of Lemma \ref{s-neg-lem1} .} For the $\tau_1$-integral in \eqref{s-neg-theta1}, applying calculus estimate \eqref{eq:calc_5} with $\ell=\ell'=b'$, $a=\tau-\alpha(\xi-\xi_1)^3$ and $c=\alpha\xi_1^3$, we get \begin{align} \label{s-neg-theta1-est} \Theta_1(\xi,\tau) \lesssim \frac{\xi^2(1+|\xi|)^{2s}}{(1+|\tau-\xi^{3}|)^{2b'}} \int_\mathbb{R} \frac{ \chi_{E_I}(\xi,\tau,\xi_1,\tau_1) |\xi_1(\xi-\xi_1)|^{-2s} d\xi_1 }{(1+|\tau-\xi^3-d_{\alpha}(\xi,\xi_1)|)^{4b'-1}}, \end{align} \begin{minipage}{0.64 \linewidth} where we recall that $ d_{\alpha}(\xi,\xi_1) = -\xi^{3} + \alpha\xi_1^{3} + \alpha (\xi-\xi_1)^{3}. $ Now, our strategy for estimating the above $\xi_1$-integral is to make the change of variables, $ \mu=\mu(\xi_1)=d_{\alpha}(\xi,\xi_1). $ Since by formula \eqref{d-partial-xi1}, i.e. $ \partial d_{\alpha}/\partial\xi_1 = 6\alpha \xi(\xi_1-\xi/2), $ we need to split the $\xi_1$-integral at the critical point $\xi_1=1/2\xi$, so that this change of variables makes sense. In the case that $\alpha>4$ and $\xi>0$, the graph of $\mu=\mu(\xi_1)=d_{\alpha}(\xi,\xi_1)$ looks as in Figure \ref{fig:s-neg-xi1}. \end{minipage} \hskip-0.2in \begin{minipage}{0.45\linewidth} \begin{center} \begin{tikzpicture}[yscale=0.35, xscale=3,every node/.style={scale=1}] \newcommand\X{0}; \newcommand\Y{0}; \newcommand\FX{9}; \newcommand\FY{9}; \newcommand\R{0.6}; \newcommand*{\TickSize}{2pt}; \newcommand*{\Num}{4}; \newcommand*{\Alphalpha}{6}; \newcommand*{2}{2}; \newcommand*{\Dist/\Num}{2/\Num}; \draw[line width=1pt,-{Latex[length=2mm]}] (-0.1,0) -- (1.1,0) node[above] {\fontsize{\FX}{\FY} $\xi_1$} ; \draw[line width=1pt,-{Latex[length=2mm]}] (0,-0.2) -- (0,4.5) node[xshift=0.5cm] {\fontsize{\FX}{\FY} $\mu (\xi_1)$}; \draw[red, line width=1pt, domain=0.1:0.9,variable=\x] plot ({\x},{-1+\Alphalpha*(\x)^3+\Alphalpha*(1-\x)^3}) ; \draw[black,dashed] (0.5,0) node[yshift=-0.2cm] {\fontsize{\FX}{\FY}$ \xi/2$} -- (0.5,{-1+\Alphalpha*(0.5)^3+\Alphalpha*(1-0.5)^3}) ; \draw[black] (0,0) node[xshift=-0.2cm,yshift=-0.2cm] {\fontsize{\FX}{\FY} $0$} ; \end{tikzpicture} \vskip-0.15in \captionof{figure}{$\alpha>4$ and $\xi>0$} \label{fig:s-neg-xi1} \end{center} \end{minipage} \vskip0.05in \noindent Now, for $\xi>0$ we define the $\xi_1$-intervals ($\xi<0$ is similar) $ \mathcal{I}_1^{\xi_1} \doteq (-\infty, -\frac34\xi), $ $ \mathcal{I}_2^{\xi_1} \doteq (-\frac34\xi, \frac34\xi) $ and $ \mathcal{I}_3^{\xi_1} \doteq (\frac34\xi, \infty). $ Thus, from estimate \eqref{s-neg-theta1-est} we obtain \begin{align} \label{s-neg-theta1-est-deco} \Theta_1(\xi,\tau) \lesssim \sum\limits_{k=1}^3 J_k \text{ with } J_k(\xi,\tau) \doteq \frac{\xi^2(1+|\xi|)^{2s}}{(1+|\tau-\xi^{3}|)^{2b'}} \int_{\mathcal{I}_k^{\xi_1}} \frac{ \chi_{E_I}(\xi,\tau,\xi_1,\tau_1) |\xi_1(\xi-\xi_1)|^{-2s} d\xi_1 }{(1+|\tau-\xi^3-d_{\alpha}(\xi,\xi_1)|)^{4b'-1}}. \end{align} {\bf Estimation near critical points (estimate for $J_2$).} Since $\xi_1\in \mathcal{I}_2^{\xi_1}$, we have $1\le |\xi_1|\lesssim |\xi|$ and $|\xi-\xi_1|\lesssim |\xi|$, which gives us $|\xi_1(\xi-\xi_1)|^{-2s}\lesssim |\xi|^{-4s}$. Using this estimate, from \eqref{s-neg-theta1-est-deco} we get \begin{align} \label{s-neg-theta1-est-no1} J_2(\xi,\tau) \lesssim \frac{|\xi|^{2-2s}}{(1+|\tau-\xi^{3}|)^{2b'}} \int_{-3/4\xi}^{3/4\xi} \frac{ \chi_{E_I}(\xi,\tau,\xi_1,\tau_1) d\xi_1 }{(1+|\tau-\xi^3-d_{\alpha}(\xi,\xi_1)|)^{4b'-1}} \lesssim \frac{|\xi|^{2-2s}}{(1+|\tau-\xi^{3}|)^{2b'}} I(\xi,\tau), \end{align} where $I(\xi,\tau)$ is defined by \eqref{I-def-s-0}, which was estimated in Lemma \ref{l-lem-s-0}. Combining estimate \eqref{I-est-s-0} with \eqref{s-neg-theta1-est-no1}, we obtain \begin{align} \label{s-neg-theta1-est-no2} J_2(\xi,\tau) \lesssim& \frac{|\xi|^{2-2s}}{(1+|\tau-\xi^{3}|)^{2b'}} \frac{|\xi|^{-\frac12}(1+|\tau-\xi^3|)^{2-4b'}}{(1+|\tau-\frac{\alpha}{4}\xi^3|)^{\frac12}} = \frac{|\xi|^{3/2-2s}}{(1+|\tau-\xi^{3}|)^{6b'-2}} \frac{1}{(1+|\tau-\frac{\alpha}{4}\xi^3|)^{\frac12}}. \end{align} Furthermore, by property \eqref{d-comparison}, i.e. $ |\tau-\xi^3| \ge \frac13 |d_{\alpha}(\xi,\xi_1)|, $ and using estimate \eqref{d-bound-xi} for $d_{\alpha}$, we get $|\tau-\xi^3|\gtrsim |\xi|^3$. Combining this with \eqref{s-neg-theta1-est-no2} and dropping $(1+|\tau-\frac{\alpha}{4}\xi^3|)^{\frac12}$ we get $ J_2(\xi,\tau) \lesssim \frac{|\xi|^{3/2-2s}}{|\xi^{3}|^{6b'-2}}, $ which is bounded if $3(6b'-2)\ge(3/2-2s)$ or $ b' \geq \frac{15-4s}{36}. $ For $b'<\frac12$, it suffices to have $ s>-3/4. $ This completes the estimate for $J_2(\xi,\tau)$. \vskip0.05in \noindent {\bf Estimation away from critical points (estimate for $J_1$ and $J_3$).} Making the change of variables $\mu=\mu(\xi_1)=d_{\alpha}(\xi,\xi_1)$ and defining $\mathcal{I}_k^\mu$ be the range of $\mu(\xi_1)$ for $\xi_1\in \mathcal{I}_k^{\xi_1}$, we get \begin{align} \label{s-neg-theta1-case2-no1} J_k(\xi,\tau) \lesssim \frac{\xi^2 (1+|\xi|)^{2s}}{(1+|\tau-\xi^{3}|)^{2b'}} \int_{\mathcal{I}_k^{\mu}} \frac{ \chi_{E_I}(\xi,\tau,\xi_1,\tau_1)\, |\xi_1(\xi-\xi_1)|^{-2s} }{(1+|\tau-\xi^3-\mu|)^{4b'-1}} \frac{1}{|\mu'|} d\mu, \,\, k=1,3. \end{align} For $\xi_1<-\frac34\xi$ or $\xi_1>\frac34\xi$, we have $|\xi-\xi_1|\lesssim |\xi_1|$. Also, using the formula \eqref{d-partial-xi1} and using inequality of Lemma \ref{dist-lem} we have $ |\mu'(\xi_1)| = 6\alpha |\xi(\xi_1-\xi/2)| \gtrsim |\xi| |\xi_1|, $ which combined with \eqref{s-neg-theta1-case2-no1} implies that \begin{align} \label{s-neg-theta1-case2-no3} J_k(\xi,\tau) \lesssim \frac{ |\xi| (1+|\xi|)^{2s}}{(1+|\tau-\xi^{3}|)^{2b'}} \int_{\mathbb{R}} \frac{ |\xi_1|^{-4s-1} \chi_{E_I}(\xi,\tau,\xi_1,\tau_1)\, }{(1+|\tau-\xi^3-\mu|)^{4b'-1}} d{\mu}, \quad k=1,3. \end{align} Next, we consider the following two cases \vskip0.05in \noindent $\bullet$ Case 1: $0>s\ge -\frac14$ \qquad $\bullet$ Case 2: $s< -\frac14$ \vskip0.05in \noindent \underline{Proof in Case 1.} Using $-4s-1\le 0$ and $|\xi_1|\ge 1$ we have $|\xi_1|^{-4s-1}\le 1$. Combining this estimate with \eqref{s-neg-theta1-case2-no3} and making the change of variables $\mu_1=\tau-\xi^3-\mu$, we get \begin{align} \label{s-neg-theta1-case2-no5} J_k(\xi,\tau) \lesssim \frac{ |\xi| (1+|\xi|)^{2s}}{(1+|\tau-\xi^{3}|)^{2b'}} \int_{\mathbb{R}} \frac{ \chi_{E_I}(\xi,\tau,\xi_1,\tau_1)\, }{(1+|\mu_1|)^{4b'-1}} d{\mu_1}, \quad k=1,3. \end{align} % Also, in this microlocalization using comparison property \eqref{d-comparison} we get $|\tau-\xi^3|\ge \frac13|d_\alpha|=\frac13|\mu|$, which implies that $|\mu_1|\le |\tau-\xi^3|+|\mu|\lesssim |\tau-\xi^3|$. This helps us integrate $\mu_1$ in \eqref{s-neg-theta1-case2-no5} \begin{align} \label{s-neg-theta1-case2-no6} J_k(\xi,\tau) \lesssim& \frac{ |\xi| (1+|\xi|)^{2s}}{(1+|\tau-\xi^{3}|)^{2b'}} \cdot (1+|\tau-\xi^{3}|)^{2-4b'} = \frac{ |\xi| (1+|\xi|)^{2s}}{(1+|\tau-\xi^{3}|)^{6b'-2}}, \quad k=1,3. \end{align} % Furthermore, using $|\tau-\xi^3|\ge \frac13|d_\alpha|$ and estimate \eqref{d-bound-xi} i.e. $|d_\alpha|\ge \frac{\alpha-4}{4} |\xi|^3$, we get $|\tau-\xi^3|\gtrsim |\xi|^3$. Combining this with estimate \eqref{s-neg-theta1-case2-no6}, we get $ \Theta_1(\xi,\tau) \lesssim \frac{ |\xi| (1+|\xi|)^{2s}}{(1+|\xi^3|)^{6b'-2}} \lesssim \frac{ 1}{(1+|\xi|)^{3(6b'-2)-1-2s}}, $ % which is bounded if $3(6b'-2)-1-2s\ge 0$ or $ b'\ge \frac{7}{18}+\frac19s. $ Since $ 0> s \ge - \frac14, $ % it suffices to have $b'\ge 7/18$. This completes the proof for $J_1(\xi,\tau)$ and $J_3(\xi,\tau)$ in case 1. \vskip0.05in \noindent \underline{Proof in Case 2.} Using property \eqref{d-comparison}, i.e. $|\tau-\xi^3|\ge \frac13|d_\alpha|$, and by estimate \eqref{d-bound-xi1}, i.e. $|d_\alpha|\ge\frac{3\alpha(\alpha-4)}{4(\alpha-1)} |\xi||\xi_1|^2$, we get $|\tau-\xi^3|\gtrsim |\xi|\xi_1^2$ or $\xi_1^2\lesssim \frac{|\tau-\xi^3|}{|\xi|} $. Thus, for $-4s-1>0$ we have $ |\xi_1|^{-4s-1} \lesssim (|\tau-\xi^3|/|\xi| )^{-2s-1/2}. $ Using this estimate and the change of variables $\mu_1=\tau-\xi^3-\mu$, from \eqref{s-neg-theta1-case2-no3} we get \begin{align} \label{s-neg-theta1-case2-2-no1} J_k(\xi,\tau) \lesssim \frac{ |\xi|^{3/2+2s} (1+|\xi|)^{2s}}{(1+|\tau-\xi^{3}|)^{2b'+2s+1/2}} \int_{\mathbb{R}} \frac{ \chi_{E_I}(\xi,\tau,\xi_1,\tau_1)\, }{(1+|\mu_1|)^{4b'-1}} d{\mu_1}, \quad k=1,3. \end{align} % Also, by property \eqref{d-comparison}, we have $|\mu_1|\lesssim |\tau-\xi^3|$, which helps us integrate $\mu_1$ in \eqref{s-neg-theta1-case2-2-no1} \begin{align} \label{s-neg-theta1-case2-2-no2} J_k(\xi,\tau) \lesssim& \frac{ |\xi|^{3/2+2s} (1+|\xi|)^{2s}}{(1+|\tau-\xi^{3}|)^{2b'+2s+1/2}} \cdot (1+|\tau-\xi^{3}|)^{2-4b'} = \frac{ |\xi|^{3/2+2s} (1+|\xi|)^{2s}}{(1+|\tau-\xi^{3}|)^{6b'-3/2+2s}}, \quad k=1,3. \end{align} % Furthermore, using $|\tau-\xi^3|\ge \frac13|d_\alpha|$ and estimate \eqref{d-bound-xi}, we get $|\tau-\xi^3|\gtrsim |\xi|^3$. Combining this estimate with \eqref{s-neg-theta1-case2-2-no2}, for $ 6b'-3/2+2s \ge 0 $ or $ b' \ge 1/4 - 1/3s, $ we get % \begin{equation} \label{s-neg-theta1-case2-2-no3} J_k(\xi,\tau) \lesssim \frac{ |\xi|^{3/2+2s} (1+|\xi|)^{2s}}{(1+|\xi^{3}|)^{6b'-3/2+2s}}, \quad k=1,3. \end{equation} In addition, for $3/2+2s\ge0$ or $s\ge-3/4$, we have $|\xi|^{3/2+2s}\lesssim (1+|\xi|)^{3/2+2s}$. Combining this estimate with \eqref{s-neg-theta1-case2-2-no3}, we get $ \Theta_1(\xi,\tau) \lesssim \frac{ 1}{(1+|\xi|)^{3(6b'-3/2+2s)-3/2-4s}} \lesssim \frac{ 1}{(1+|\xi|)^{18b'-6+2s}}, $ % % which is bounded if $18b'-6+2s\ge 0$ or % $ b'\ge \frac13-\frac19s. $ For $b'<\frac12$, it suffices to have $ s+3/2>0$ or $s>-3/2$. % This completes the proof of Lemma \ref{s-neg-lem1} . \,\, $\square$ \vskip0.05in \noindent {\bf Proof of Lemma \ref{s-neg-lem2}.} For the $\tau$-integral in \eqref{s-neg-theta2}, applying estimate \eqref{eq:calc_5} with $\ell=\ell'=b'$, $a=\xi^3$ and $c=\tau_1+\alpha(\xi-\xi_1^3)$, we get \begin{align} \label{s-neg-theta2-est-no1} \Theta_2(\xi_1, \tau_1) \lesssim \frac{1}{(1+|\tau_1-\alpha\xi_1^{3}|)^{2b'}} \int_\mathbb{R} \frac{ \chi_{E_{II}}(\xi,\tau,\xi_1,\tau_1) |\xi_1(\xi-\xi_1)|^{-2s} \xi^2 (1+|\xi|)^{2s} \, \, d\xi}{ (1+|\tau_1-\alpha\xi_1^3+d_{\alpha}(\xi,\xi_1)|)^{4b'-1} }. \end{align} \begin{minipage}{0.7\linewidth} Like before, we split the $\xi$-integral near critical points and away from critical points. Here we recall that the two critical points are given by $ p_1 = \frac{\sqrt{\alpha}}{\sqrt{\alpha}-1}\xi_1, $ $ p_2 = \frac{\sqrt{\alpha}}{\sqrt{\alpha}+1}\xi_1, $ and the inflection point is $q=\frac{\alpha}{\alpha-1}\xi_1$. In the case that $\xi_1>0$, the graph of $\mu=\mu(\xi)=d_{\alpha}(\xi,\xi_1)$ looks as in Figure \ref{fig:s-neg-xi}. Also, using the small number $\delta$ given by \eqref{delta-def}, for $\xi_1>0$ (for $\xi_1<0$, it is similar) we define the $\xi$-intervals % $ \mathcal{I}_{1}^\xi \doteq \big( -\infty , p_2-\delta\xi_1 \big), $ $ \mathcal{I}_{2}^\xi \doteq \big( p_2-\delta\xi_1 , p_2 \big), $ $ \mathcal{I}_{3}^\xi \doteq \big( p_2 , p_2+\delta\xi_1 \big), $ $ \mathcal{I}_{4}^\xi \doteq \big( p_2+\delta\xi_1 , p_1-\delta\xi_1 \big), $ $ \mathcal{I}_{5}^\xi \doteq \big( p_1-\delta\xi_1 , p_1 \big), $ $ \mathcal{I}_{6}^\xi \doteq \big( p_1 , p_1+\delta\xi_1 \big), $ $ \mathcal{I}_{7}^\xi \doteq \big( p_2+\delta\xi_1 , \infty \big), $ which are visualized in Figure \ref{fig:s-neg-xi-axis}. \end{minipage} \hskip-0.3in \begin{minipage}{0.4\linewidth} \begin{center} \begin{tikzpicture}[yscale=0.35, xscale=0.7] \newcommand\X{0}; \newcommand\Y{0}; \newcommand\FX{8}; \newcommand\FY{8}; \newcommand\R{0.6}; \newcommand\Alpha{5}; \newcommand*{\TickSize}{2pt}; \draw[black,line width=1pt,-{Latex[black,length=2mm,width=2mm]}] (-0.5,0) -- (3,0) node[above] {\fontsize{\FX}{\FY}\bf \textcolor{black}{$\xi$}}; \draw[black,line width=1pt,-{Latex[black,length=2mm,width=2mm]}] (0,-1.5) -- (0,5) node[right] {\fontsize{\FX}{\FY}\bf \textcolor{black}{$\mu(\xi)$}}; \draw[line width=1pt, yscale=1,domain=-0.1:2.3,smooth,variable=\x,red] plot ({\x},{-(\x)^3+\Alpha+\Alpha*(\x-1)^3}); \draw[dashed,black,line width=0.5pt] (0,0) node[xshift=-0.2cm, yshift=-0.2cm] {\fontsize{\FX}{\FY}\bf $0$} ({sqrt(\Alpha)/(sqrt(\Alpha)-1)},0) node[xshift=0cm,yshift=-0.2cm] {\fontsize{\FX}{\FY}\bf $p_1$} -- ({sqrt(\Alpha)/(sqrt(\Alpha)-1)},{(\Alpha*\Alpha-2*(sqrt(\Alpha))^(3))/(1-sqrt(\Alpha))^2}) ({sqrt(\Alpha)/(sqrt(\Alpha)+1)},0) node[yshift=-0.2cm] {\fontsize{\FX}{\FY}\bf $p_2$} -- ({sqrt(\Alpha)/(sqrt(\Alpha)+1)},{(\Alpha*\Alpha+2*(sqrt(\Alpha))^(3))/(1+sqrt(\Alpha))^2}) ({\Alpha/(\Alpha-1)},0) node[xshift=0cm, yshift=-0.2cm] {\fontsize{\FX}{\FY}\bf $q$} -- ({\Alpha/(\Alpha-1)},{-(\Alpha/(\Alpha-1))^3+\Alpha+\Alpha*(\Alpha/(\Alpha-1)-1)^3}) ; \end{tikzpicture} \captionof{figure}{$\xi_1>0$} \label{fig:s-neg-xi} \end{center} \end{minipage} \vskip0.05in \noindent \begin{minipage}{1\linewidth} \begin{center} \begin{tikzpicture}[yscale=1, xscale=0.8] \newcommand\X{0}; \newcommand\Y{0}; \newcommand\FX{11}; \newcommand\FY{11}; \newcommand\R{0.6}; \newcommand*{\TickSize}{2pt}; \draw[black,line width=1pt,-{Latex[black,length=2mm,width=2mm]}] (-9,0) -- (9,0) node[above] {\fontsize{\FX}{\FY} $\xi$}; \draw[red] (-10,0) node[yshift=0cm,black,line width=1pt] {\bf \fontsize{\FX}{\FY}$\xi_1> 0:$} (0,0) node[yshift=-0.4cm] {\fontsize{\FX}{\FY}$q$} node[yshift=0cm] {$\bullet$} node[xshift=0cm,yshift=0.6cm, black] {\fontsize{\FX}{\FY}$\mathcal{I}_4^\xi$} (-7,0) node[xshift=-1cm,yshift=0.6cm, black] {\fontsize{\FX}{\FY}$\mathcal{I}_1^\xi$} (-5,0) node[yshift=-0.4cm] {\fontsize{\FX}{\FY}$p_2$} node[yshift=0cm] {$\bullet$} node[xshift=-1cm,yshift=0.6cm, black] {\fontsize{\FX}{\FY}$\mathcal{I}_2^\xi$} node[xshift=1cm,yshift=0.6cm, black] {\fontsize{\FX}{\FY}$\mathcal{I}_3^\xi$} (-2.5,0) node[yshift=-0.4cm] {\fontsize{\FX}{\FY}$p_2+\delta\xi_1$} node[yshift=0cm] {$\bullet$} (-7.5,0) node[yshift=-0.4cm] {\fontsize{\FX}{\FY}$p_2-\delta\xi_1$} node[yshift=0cm] {$\bullet$} (5,0) node[yshift=-0.4cm] {\fontsize{\FX}{\FY}$p_1$} node[yshift=0cm] {$\bullet$} node[xshift=-1cm,yshift=0.6cm, black] {\fontsize{\FX}{\FY}$\mathcal{I}_5^\xi$} node[xshift=1cm,yshift=0.6cm, black] {\fontsize{\FX}{\FY}$\mathcal{I}_6^\xi$} (2.5,0) node[yshift=-0.4cm] {\fontsize{\FX}{\FY}$p_1-\delta\xi_1$} node[yshift=0cm] {$\bullet$} (7.5,0) node[yshift=-0.4cm] {\fontsize{\FX}{\FY}$p_1+\delta\xi_1$} node[yshift=0cm] {$\bullet$} (8,0) node[xshift=0cm,yshift=0.6cm, black] {\fontsize{\FX}{\FY}$\mathcal{I}_7^\xi$} ; \draw [decorate,decoration={brace,mirror,raise=5pt},thick] (-2.5,0) -- (-5,0); \draw [decorate,decoration={brace,mirror,raise=5pt},thick] (-5,0) -- (-7.5,0); \draw [decorate,decoration={brace,mirror,raise=5pt},thick] (7.5,0) -- (5,0); \draw [decorate,decoration={brace,mirror,raise=5pt},thick] (5,0) -- (2.5,0); \end{tikzpicture} \vskip-0.15in \captionof{figure}{$\xi$-intervals} \label{fig:s-neg-xi-axis} \end{center} \end{minipage} \vskip0.05in \noindent Now, we see that our change of variables makes sense in each one of these intervals. Thus, making the change of variables $\mu=\mu(\xi)=d_{\alpha}(\xi,\xi_1)$ and defining $\mathcal{I}_k^\mu$ be the range of $\mu(\xi)$ for $\xi\in \mathcal{I}_k^\xi$, we obtain % \begin{align} \label{s-neg-theta2-est-no2} \Theta_2 \lesssim \sum\limits_{k=1}^7 J_k \text{ with } J_k \doteq \frac{1}{(1+|\tau_1-\alpha\xi_1^{3}|)^{2b'}} \int_{\mathcal{I}_{k}^{\mu}} \frac{ \chi_{E_{II}}(\xi,\tau,\xi_1,\tau_1) \, |\xi_1(\xi-\xi_1)|^{-2s} \xi^2 (1+|\xi|)^{2s} d\mu }{(1+|\tau_1-\alpha\xi_1^3+\mu|)^{4b'-1} \quad |\mu'(\xi)|}. \end{align} {\bf Estimation near critical points.} Since $p_1, p_2$ are like $\xi_1$, and $\xi$ is near $p_1$ or $p_2$, we have $|\xi|\simeq |\xi_1|$ and $|\xi-\xi_1|\lesssim |\xi_1|$, which give us that $|\xi_1(\xi-\xi_1)|^{-2s} \xi^2 (1+|\xi|)^{2s}\lesssim |\xi_1|^{2-2s}$. Using this, we get \begin{align*} J_k(\xi_1,\tau_1) \lesssim \frac{|\xi_1|^{2-2s}}{(1+|\tau_1-\alpha\xi_1^{3}|)^{2b'}} \int_{\mathcal{I}_{k}^{\mu}} \frac{ \chi_{E_{II}}(\xi,\tau,\xi_1,\tau_1) }{(1+|\tau_1-\alpha\xi_1^3+\mu|)^{4b'-1}} \frac{1}{|\mu'(\xi)|} d\mu, \quad k=2,3,5,6. \end{align*} \underline{Estimation for $J_2$ and $J_3$.} Like estimate \eqref{s-0-mu-der-est}, for $\xi\in I_2^{\xi}\cup I_3^{\xi}$, we get $ |\mu'(\xi)| \gtrsim |\xi_1|^{1/2} \sqrt{ |\mu(\xi)-\mu(p_2)| }. $ Using this estimate and making the change of variables $\mu_1=\tau_1-\alpha\xi_1^3+\mu$, we obtain \begin{align} \label{s-neg-theta2-est-no3} J_k(\xi_1,\tau_1) \lesssim \frac{|\xi_1|^{3/2-2s}}{(1+|\tau_1-\alpha\xi_1^{3}|)^{2b'}} \int_{\mathbb{R}} \frac{ \chi_{E_{II}}(\xi,\tau,\xi_1,\tau_1) }{(1+|\mu_1|)^{4b'-1}} \frac{1}{\sqrt{ |\mu_1-(\tau_1-\alpha\xi_1^3)-\mu(p_2)| }} d\mu_1, \quad k=2,3. \end{align} Furthermore, using comparison property \eqref{d-comparison}, we have $|\mu_1|\lesssim |\tau_1-\alpha\xi_1^3|$. For the $\mu_1$-integral in \eqref{s-neg-theta2-est-no3}, applying estimate \eqref{eq:calc_4} with $2(1-\ell)=4b'-1$, $a=\tau_1-\alpha\xi_1^3+\mu(p_2)$ and $c=|\tau_1-\alpha\xi_1^3|$, we get \begin{align} \label{s-neg-theta2-est-no4} J_k(\xi_1,\tau_1) \lesssim \frac{|\xi_1|^{3/2-2s}}{(1+|\tau_1-\alpha\xi_1^{3}|)^{2b'}} \frac{(1+|\tau_1-\alpha\xi_1^{3}|)^{2-4b'}}{(1+|\tau_1-\alpha\xi_1^3+\mu(p_2)|)^{\frac12}} \lesssim \frac{|\xi_1|^{3/2-2s}}{ (1+|\tau_1-\alpha\xi_1^{3}|)^{6b'-2} }, \quad k=2,3. \end{align} Moreover, using $|\tau_1-\alpha\xi_1^3|\ge \frac13|d_\alpha|$, estimate \eqref{d-bound-xi1} and $|\xi|\simeq |\xi_1|$ we get $ |\tau_1-\alpha\xi_1^3| \gtrsim |\xi| \xi_1^2 \simeq |\xi_1|^3. $ Combining this estimate with \eqref{s-neg-theta2-est-no4}, we get $ J_k(\xi_1,\tau_1) \lesssim |\xi_1|^{15/2-2s-18b'} $ ($k=2,3$), which is bounded if $ 15/2-2s-18b' \le 0 $ or $b'\ge \frac{15-4s}{36}$. For $b'<\frac12$, it suffices to have $ s>-\frac34. $ This completes the estimation near critical points. \vskip0.05in \noindent \underline{Estimation for $J_5$ and $J_6$.} Since this estimate is like that for $J_2$ and $J_3$, we omit it here. \vskip0.05in \noindent {\bf Estimation away from critical points.} Using property \eqref{d-comparison}, we get $|\tau_1-\alpha\xi_1^3+\mu|\lesssim |\tau_1-\alpha\xi_1^3|$, which implies that % $ |\tau_1-\alpha\xi_1^3+\mu|/|\tau_1-\alpha\xi_1^3| \lesssim 1. $ Moving $\frac{1}{(1+|\tau_1-\alpha\xi_1^{3}|)^{2b'}}$ inside $\tau$-integral and also dividing the integrand by $ (|\tau_1-\alpha\xi_1^3+\mu|/|\tau_1-\alpha\xi_1^3|)^{\varepsilon} $ for $\varepsilon>0$, to be chosen later, from \eqref{s-neg-theta2-est-no2} we get \begin{align} \label{s-neg-case2-theta-2-fin-1} J_k(\xi_1,\tau_1) \lesssim& \int_{\mathcal{I}_k^\mu} \frac{1 }{(1+|\tau_1-\alpha\xi_1^3|)^{2b'-\varepsilon}} \frac{ \chi_{E_{II}}(\xi,\tau,\xi_1,\tau_1) \, |\xi_1(\xi-\xi_1)|^{-2s} \xi^2 (1+|\xi|)^{2s} d\mu }{(1+|\tau_1-\alpha\xi_1^3+\mu|)^{4b'-1+\varepsilon} \quad |\mu'(\xi)|}, \quad k=1,4,7. \end{align} Using comparison property \eqref{d-comparison} and adding estimates \eqref{d-bound-xi}, \eqref{d-bound-xi1} up we get $|\tau_1-\alpha\xi_1^3|\gtrsim |\xi|(\xi^2+\xi_1^2)$. Also, when $\xi$ is away from the critical points $p_1$ and $p_2$, by using formula \eqref{d-partial-xi} and by using elementary inequality of Lemma \ref{dist-lem}, we have a lower bound for $|\mu'(\xi)|$, that is $|\mu'(\xi)|\gtrsim \xi^2+\xi_1^2$. Furthermore, for $s<0$, we have $(1+|\xi|)^{2s}\lesssim1$. Combining these estimates with \eqref{s-neg-case2-theta-2-fin-1}, we get \begin{align} \label{s-neg-case2-theta-2-fin-2} J_k(\xi_1,\tau_1) \lesssim \int_{\mathcal{I}_k^\mu} \frac{|\xi_1(\xi-\xi_1)|^{-2s}|\xi|^{2+\varepsilon-2b'}}{(\xi^2+\xi_1^2)^{2b'-\varepsilon+1}} \frac{ \chi_{E_{II}}(\xi,\tau,\xi_1,\tau_1) }{(1+|\tau_1-\alpha\xi_1^3+\mu|)^{4b'-1+\varepsilon}} d\mu, \quad k=1,4,7. \end{align} Finally, combining the elementary facts $|\xi|\le(\xi^2+\xi_1^2)^{1/2}$, $|\xi(\xi-\xi_1)|\lesssim (\xi^2+\xi_1^2)$ with \eqref{s-neg-case2-theta-2-fin-2}, we get \begin{align*} J_k(\xi_1,\tau_1) \lesssim \int_{\mathbb{R}} \frac{1}{(\xi^2+\xi_1^2)^{2b'-\varepsilon+1-(1+\varepsilon/2-b')+2s}} \frac{ \chi_{E_{II}}(\xi,\tau,\xi_1,\tau_1) }{(1+|\tau_1-\alpha\xi_1^3+\mu|)^{4b'-1+\varepsilon}} d\mu, \quad k=1,4,7, \end{align*} which is bounded if $2b'-\varepsilon+1-(1+\varepsilon/2-b')+2s\ge 0$ and $4b'-1+\varepsilon\ge 1$. Combining these two estimates, we get $ b' \ge (3-2s)/9. $ For $b'<1/2$, it suffices to have $ s>-3/4. $ This completes the estimate for all $J_k$ and the proof of Lemma \ref{s-neg-lem2}. \,\, $\square$ \subsection{$s\ge \frac34$ with $\alpha=4$} First, we observe that to prove the bilinear estimate \eqref{bi-est-X-1} with $\alpha=4$, i.e. $ \| \partial_x(fg) \|_{X^{s,-b,\theta-1}_{1}} \le c_2 \| f \|_{X^{s,b',\theta'}_{4}} \| g \|_{X^{s,b',\theta'}_{4}}, $ it suffices to prove its $L^2$ formulation \eqref{bilinear-est-L2-form-no1}. By symmetry (in convolution writing), we assume that $ |\xi-\xi_1| \leq |\xi_1|. $ Also, like the case $\alpha\neq 4$, we decompose $Q'(\xi,\tau,\xi_1,\tau_1)$ as the sum of three functions $ Q'(\xi,\tau,\xi_1,\tau_1) = Q_1(\xi,\tau,\xi_1,\tau_1) + Q_2(\xi,\tau,\xi_1,\tau_1) + Q_3(\xi,\tau,\xi_1,\tau_1), $ where $ Q_1(\xi,\tau,\xi_1,\tau_1) \doteq \chi_{|\xi_1|< 1} \cdot \chi_{|\xi-\xi_1|< 1} \cdot Q'(\xi,\tau,\xi_1,\tau_1), $ $ Q_2(\xi,\tau,\xi_1,\tau_1) \doteq \chi_{|\xi_1|\ge 1} \cdot \chi_{|\xi-\xi_1|<1} \cdot Q'(\xi,\tau,\xi_1,\tau_1) $ and \begin{align} \label{u4-def-Q3} &Q_3(\xi,\tau,\xi_1,\tau_1) \doteq \chi_{|\xi_1|\ge 1} \cdot \chi_{|\xi-\xi_1|\ge 1} \cdot Q'(\xi,\tau,\xi_1,\tau_1) \nonumber \\ =& \frac{|\xi|}{(1+|\tau-\xi^{3}|)^{b'}} \frac{(1+|\xi|)^s}{ (1+|\xi_1|)^{s} (1+|\xi-\xi_1|)^{s} } \frac{ \chi_{|\xi_1|\ge 1} }{ (1+|\tau_1-4\xi_1^3|)^{b'} } \frac{ \chi_{|\xi-\xi_1|\ge 1} } { (1+|\tau-\tau_1-4(\xi-\xi_1)^3|)^{b'} }. \end{align} Now, to prove the bilinear estimate \eqref{bilinear-est-L2-form-no1} with $\alpha=4$, it suffices to show that for $\ell = 1,2,3$ we have \begin{align} \label{u4-bilinear-est-l} \Big\| \int_{\mathbb{R}^2} Q_\ell(\xi,\tau,\xi_1,\tau_1) c_{f,4}(\xi-\xi_1,\tau-\tau_1) c_{g,4}(\xi_1,\tau_1) d\xi_1 d\tau_1 \Big\|_{L^2_{\xi,\tau}} \lesssim \big\|c_{f,4}\big\|_{L^2_{\xi,\tau}} \big\|c_{g,4}\big\|_{L^2_{\xi,\tau}}. \end{align} \vskip0.05in \noindent \underline{\bf Proof for multipliers $Q_1$ and $Q_2$.} For $s\ge 0$, we have $ \frac{(1+|\xi|)^s}{ (1+|\xi_1|)^{s} (1+|\xi-\xi_1|)^{s} } \lesssim 1. $ Using this estimate, $Q_1$ and $Q_2$ are reduced to the $Q_1$ and $Q_2$ defined by \eqref{u-s-0-Q1} and \eqref{u-s-0-Q2} respectively. Also, we notice that Lemmas \ref{s-0-theta-1-lemma}--\ref{s-0-theta-3-lemma} hold for $\alpha=4$. Therefore, we get the desired estimate \eqref{u4-bilinear-est-l} for $Q_1$ and $Q_2$. \vskip.1in \noindent \underline{\bf Proof for multiplier $Q_3$.} By symmetry (in convolution writing), we assume that $ |\tau-\tau_1-4(\xi-\xi_1)^{3}| \leq |\tau_1-4\xi_1^{3}|. $ Also, we consider the following two microlocalizations: \vskip0.05in \noindent {\bf $\bullet$ Microlocalization I: $|\tau_1-4\xi_1^{3}|\leq|\tau-\xi^{3}|$}. In this situation we define the domain $B_I$ to be \begin{align*} B_I \doteq \big\{ (\xi,\tau,\xi_1,\tau_1) \in{\mathbb{R}}^4: |\tau-\tau_1-4(\xi-\xi)^{3}|\leq|\tau_1-4\xi_1^{3}|\leq|\tau-\xi^{3}|, |\xi_1|\ge1, |\xi-\xi_1|\ge1 \big\}. \end{align*} \vskip0.05in \noindent {\bf $\bullet$ Microlocalization II: $|\tau-\xi^{3}|\leq|\tau_1-4\xi_1^{3}|$}. In this case we define the domain $B_{II}$ to be \begin{align*} \hskip-0.1in B_{II} \doteq \big\{(\xi,\tau,\xi_1,\tau_1)\in{\mathbb{R}}^4: \max\{|\tau-\tau_1-4(\xi-\xi)^{3}|, |\tau-\xi^{3}| \}\leq|\tau_1-4\xi_1^{3}|, |\xi_1| \hskip-0.01in \ge1, |\xi-\xi_1| \hskip-0.01in \ge1 \big\}. \end{align*} {\bf Proof of bilinear estimate in microlocalization I.} In this situation, using the Cauchy--Schwarz inequality with respect to $(\xi_1,\tau_1)$, and taking the supremum over $(\xi,\tau)$ we arrive at \begin{align*} & \Big\| \int_{\mathbb{R}^2} (\chi_{B_I} Q_3)(\xi,\tau,\xi_1,\tau_1) c_{f,4}(\xi-\xi_1,\tau-\tau_1) c_{g,4}(\xi_1,\tau_1) d\xi_1 d\tau_1 \Big\|_{L^2_{\xi,\tau}} \nonumber \\ & \lesssim \big\|c_{f,4}\big\|_{L^2_{\xi,\tau}} \big\|c_{g,4}\big\|_{L^2_{\xi,\tau}} \Big\| \int_{\mathbb{R}^2} (\chi_{B_{I}} Q_3^2)(\xi,\tau,\xi_1,\tau_1) d\xi_1 d\tau_1 \Big\|_{L^{\infty}_{\xi,\tau}}^{1/2}. \end{align*} Now, to prove bilinear estimate \eqref{u4-bilinear-est-l} for $Q_3$, it suffices to show the following result for $Q_3$ as in \eqref{u4-def-Q3}. \begin{lemma} \label{u4-bi-lem-1} If $\frac{1}{3}< b'<1/2$ and $s\ge \frac34$, then for $\xi,\tau\in\mathbb{R}$ \begin{align} \label{u4-theta1} \hskip-0.05in \Theta_1(\xi,\tau) \hskip-0.05in \doteq& \frac{\xi^2}{(1+|\tau-\xi^{3}|)^{2b'}} \int_{\mathbb{R}^2} \hskip-0.05in \frac{(1+|\xi|)^{2s}}{ (1+|\xi_1|)^{2s} (1+|\xi-\xi_1|)^{2s} } \frac{ \chi_{B_I}(\xi,\tau,\xi_1,\tau_1) \quad d\tau_1 d\xi_1 }{(1+|\tau-\tau_1-4(\xi-\xi_1)^{3}|)^{2b'}(1+|\tau_1-4\xi_1^{3}|)^{2b'}} \nonumber \\ \lesssim& 1. \end{align} \end{lemma} \vskip0.05in \noindent {\bf Proof of bilinear estimate in microlocalization II.} In this case, using duality and applying the Cauchy--Schwarz inequality first in $(\xi_1, \tau_1)$ and then in $(\xi, \tau)$, we get \begin{align*} & \Big\| \int_{\mathbb{R}^2} (\chi_{B_{II}} Q_3)(\xi,\tau,\xi_1,\tau_1) c_{f,4}(\xi-\xi_1,\tau-\tau_1) c_{g,4}(\xi_1,\tau_1) d\xi_1 d\tau_1 \Big\|_{L^2_{\xi,\tau}} \\ \lesssim& \|c_{f,4}\|_{L^2_{\xi,\tau}}\|c_{g,4}\|_{L^2_{\xi,\tau}} \Big\| \int_{\mathbb{R}^2} (\chi_{B_{II}} Q_3^2)(\xi,\tau,\xi_1,\tau_1)d\xi d\tau \Big\|_{L^{\infty}_{\xi_1,\tau_1}}^{1/2}. \end{align*} Now, to prove bilinear estimate \eqref{u4-bilinear-est-l} for $Q_3$, it suffices to prove next result with $Q_3$ as in \eqref{u4-def-Q3}. \begin{lemma} \label{u4-bi-lem-2} If $\frac{1}{3}< b'<1/2$ and $s\ge \frac34$, then for $\xi_1,\tau_1\in\mathbb{R}$ \begin{align} \label{u4-theta2} \Theta_2(\xi_1,\tau_1) \doteq& \frac{1}{(1+|\tau_1-4\xi_1^{3}|)^{2b'}} \int_{\mathbb{R}^2} \frac{\xi^2(1+|\xi|)^{2s}}{ (1+|\xi_1|)^{2s} (1+|\xi-\xi_1|)^{2s} } \frac{ \chi_{B_{II}}(\xi,\tau,\xi_1,\tau_1) \quad d\tau d\xi }{(1+|\tau-\tau_1-4(\xi-\xi_1)^{3}|)^{2b'}(1+|\tau-\xi^{3}|)^{2b'}} \nonumber \\ \lesssim& 1. \end{align} \end{lemma} \noindent {\bf Proof of Lemma \ref{u4-bi-lem-1}.} For the $\tau_1$-integral in \eqref{u4-theta1}, applying estimate \eqref{eq:calc_5} with $\ell=\ell'=b'>\frac14$, $a=\tau-4(\xi-\xi_1)^3$ and $c=4\xi_1^3$, we get \begin{align} \label{u4-theta1-est} \Theta_1(\xi,\tau) \lesssim \frac{\xi^2}{(1+|\tau-\xi^{3}|)^{2b'}} \int_{\mathbb{R}} \frac{(1+|\xi|)^{2s}}{ (1+|\xi_1|)^{2s} (1+|\xi-\xi_1|)^{2s} } \frac{ \chi_{B_I}(\xi,\tau,\xi_1,\tau_1) \, d\xi_1 }{(1+|\tau-\xi^3-d_{4}(\xi,\xi_1)|)^{4b'-1}}, \end{align} where we recall that $ d_{4}(\xi,\xi_1) = -\xi^3+4\xi_1^3+4(\xi-\xi_1)^3 = 12\xi(\xi_1-\xi/2)^2. $ Furthermore, in this microlocalization, using property \eqref{d-comparison} we get $|\tau-\xi^3|\ge\frac13|d_{4}(\xi,\xi_1)|$, which implies that $ |\tau-\xi^3-d_{4}(\xi,\xi_1)| \lesssim |\tau-\xi^3|. $ This gives us $ |\tau-\xi^3-d_{4}(\xi,\xi_1)|/ |\tau-\xi^3| \lesssim 1. $ Moving $\frac{1}{(1+|\tau-\xi^{3}|)^{2b' }}$ inside $\xi_1$-integral in \eqref{u4-theta1-est} and also dividing the integrand by $ (|\tau-\xi^3-d_4(\xi,\xi_1)|/|\tau-\xi^3|)^{2b'} $, we have \begin{align} \label{u4-theta1-est-no1} \Theta_1(\xi,\tau) \lesssim \xi^2 \int_{\mathbb{R}} \frac{(1+|\xi|)^{2s}}{ (1+|\xi_1|)^{2s} (1+|\xi-\xi_1|)^{2s} } \frac{ \chi_{B_I} (\xi,\tau,\xi_1,\tau_1) d\xi_1 }{(1+|\tau-\xi^3-d_{4}(\xi,\xi_1)|)^{6b'-1}}. \end{align} \begin{minipage}{0.65\linewidth} Now, our strategy for estimating the above $\xi_1$-integral is to make the change of variables, $ \mu=\mu(\xi_1)=d_{4}(\xi,\xi_1). $ Using formula \eqref{d-partial-xi1} with $\alpha=4$, i.e. $ \partial d_{4}/\partial\xi_1 = 24 \xi(\xi_1-\xi/2), $ we find the critical point $\xi/2$ and we need to split the $\xi_1$-integral at this point, so that this change of variables makes sense. In the case that $\xi>0$, the graph of $\mu=\mu(\xi_1)=d_{4}(\xi,\xi_1)$ looks as in Figure \ref{fig:a-4-xi1}. \end{minipage} \hskip-0.2in \begin{minipage}{0.45\linewidth} \begin{center} \begin{tikzpicture}[yscale=0.5, xscale=0.8] \newcommand\X{0}; \newcommand\Y{0}; \newcommand\FX{8}; \newcommand\FY{8}; \newcommand\R{0.6}; \newcommand*{\TickSize}{2pt}; \draw[line width=1pt,-{Latex[length=2mm]}] (-0.3,0) -- (3,0) node[above] {\fontsize{\FX}{\FY} $\xi_1$} ; \draw[line width=1pt,-{Latex[length=2mm]}] (0,-0.2) -- (0,2.9) node[xshift=0.5cm] {\fontsize{\FX}{\FY} $\mu(\xi_1)$}; \draw[red, line width=1pt, domain=-0.5:2.5,variable=\x] plot ({\x},{(\x-1)^2}) ; \draw[black,dashed] (1,0) node[yshift=-0.3cm] {\fontsize{\FX}{\FY}$ \xi/2$}; \draw[black] (0,0) node[xshift=-0.2cm,yshift=-0.2cm] {\fontsize{\FX}{\FY} $0$} ; \end{tikzpicture} \vskip-0.15in \captionof{figure}{$\xi>0$} \label{fig:a-4-xi1} \end{center} \end{minipage} \vskip0.05in \noindent Now, using the $\xi_1$-intervals $ \mathcal{I}_1^{\xi_1} \doteq (-\infty, \frac14\xi), $ $ \mathcal{I}_2^{\xi_1} \doteq (\frac14\xi, \frac12\xi), $ $ \mathcal{I}_3^{\xi_1} \doteq (\frac12\xi, \frac34\xi) $ and $ \mathcal{I}_4^{\xi_1} \doteq (\frac34\xi, \infty), $ we obtain \begin{align} \label{a-4-theta1-est-deco} \Theta_1 \lesssim \sum\limits_{k=1}^4 J_k \text{ with } J_k(\xi,\tau) \doteq \xi^2 \int_{I_k^{\xi_1}} \frac{(1+|\xi|)^{2s}}{ (1+|\xi_1|)^{2s} (1+|\xi-\xi_1|)^{2s} } \frac{ \chi_{B_I} (\xi,\tau,\xi_1,\tau_1) d\xi_1 }{(1+|\tau-\xi^3-d_{4}(\xi,\xi_1)|)^{6b'-1}}. \end{align} {\bf Estimation away from critical points.} On each one of the intervals $\mathcal{I}_1^{\xi_1}$ and $\mathcal{I}_4^{\xi_1}$, making the change of variables $\mu=\mu(\xi_1)=\tau-\xi^3-d_{4}(\xi,\xi_1)$ and using formula \eqref{d-partial-xi1} with $\alpha=4$, we get \begin{align} \label{u4-theta1-est-no2} J_k(\xi,\tau) \lesssim \xi^2 \int_{\mathcal{I}_k^\mu} \frac{(1+|\xi|)^{2s}}{ (1+|\xi_1|)^{2s} (1+|\xi-\xi_1|)^{2s} } \frac{ \chi_{B_I} (\xi,\tau,\xi_1,\tau_1) }{(1+|\mu|)^{6b'-1}} \frac{1}{|\xi||\xi_1-\xi/2|} d\mu, \quad k=1,4. \end{align} For $\xi_1\le \frac14\xi$ or $\xi_1\ge 3/4\xi$, we get $|\xi_1-\xi/2|\ge \frac14|\xi|\gtrsim |\xi|$. Also, using the triangle inequality, we get $1+|\xi|\le (1+|\xi_1|)(1+|\xi-\xi_1|)$, which implies that $\frac{(1+|\xi|)^{2s}}{ (1+|\xi_1|)^{2s} (1+|\xi-\xi_1|)^{2s} }\lesssim 1$ for $s\ge 0$. Combining these estimates with \eqref{u4-theta1-est-no2}, we obtain $ J_k(\xi,\tau) \lesssim \int_{\mathcal{I}_k^{\mu}} \frac{ \chi_{B_I} (\xi,\tau,\xi_1,\tau_1) }{(1+|\mu|)^{6b'-1}} d\mu $ ($k=1,4$), which is bounded if $6b'-1>1$ or $b'>1/3$. This completes the estimate for $J_1$ and $J_4$. \vskip0.05in \noindent {\bf Estimation near critical points.} Since the estimate for $J_3$ is same to the estimate of $J_2$, here we only provide the estimate for $J_2$. For $1/4\xi\le \xi_1\le 1/2\xi$, we have $1\le |\xi_1|\simeq |\xi|\simeq |\xi-\xi_1|$, which implies that $\frac{(1+|\xi|)^{2s}}{ (1+|\xi_1|)^{2s} (1+|\xi-\xi_1|)^{2s} }\lesssim |\xi|^{-2s}$. Using this estimate, from \eqref{a-4-theta1-est-deco} we obtain $ J_2(\xi,\tau) \lesssim |\xi|^{2-2s} \int_{1/4\xi}^{1/2\xi} \frac{ 1 }{(1+|\tau-\xi^3-d_{4}(\xi,\xi_1)|)^{6b'-1}} d\xi_1. $ In addition, we split $J_2$ as $ J_2 = J_{21} + J_{22}, $ with $$ J_{2k} \doteq |\xi|^{2-2s} \int_{\mathcal{I}_{2k}^{\xi_1}} \frac{ 1 }{(1+|\tau-\xi^3-d_{4}(\xi,\xi_1)|)^{6b'-1}} d\xi_1, \quad k=1,2, $$ where $\mathcal{I}_{21}^{\xi_1}=(\frac14\xi,\frac12\xi -\frac{1}{\sqrt{|\xi|}})$ and $\mathcal{I}_{22}^{\xi_1}=(\frac12\xi -\frac{1}{\sqrt{|\xi|}}, \frac12\xi)$ . \vskip0.05in \noindent \underline{Estimate for $J_{21}$.} Making the change of variables $\mu=\mu(\xi_1)=\tau-\xi^3-d_{4}(\xi,\xi_1)$, we get \begin{align} \label{u4-theta1-B2-est} &J_{21} \lesssim |\xi|^{2-2s} \int_{\mathcal{I}_{21}^{\mu}} \frac{ 1 }{(1+|\tau-\xi^3-\mu|)^{6b'-1}} \frac{1}{|\mu'|} d\mu. \end{align} Now, using formula \eqref{d-partial-xi1} with $\alpha=4$, we get the lower bound for $|\mu'(\xi_1)|$, that is $|\mu'(\xi_1)|=|24\xi(\xi_1-\xi/2)|\gtrsim |\xi| \frac{1}{\sqrt{|\xi|}}=\sqrt{|\xi|}$. Combining this estimate with \eqref{u4-theta1-B2-est}, for $6b'-1>1$ or $b'>1/3$ we get \begin{align} \label{u4-theta1-J21-est} J_{21}(\xi,\tau) \lesssim |\xi|^{3/2-2s} \int_{\mathcal{I}_{21}^{\mu}} \frac{ 1 }{(1+|\tau-\xi^3-\mu|)^{6b'-1}} d\mu \lesssim |\xi|^{3/2-2s}. \end{align} \underline{Estimate for $J_{22}$.} For $6b'-1\ge 0$ or $b'\ge \frac16$ we get \begin{align} \label{u4-theta1-J22-est} J_{22}(\xi,\tau) \lesssim |\xi|^{2-2s} \int_{\frac12\xi -\frac{1}{\sqrt{|\xi|}}}^{\frac12\xi} \frac{1}{1} d\xi_1 \lesssim |\xi|^{2-2s} \frac{1}{\sqrt{|\xi|}} = |\xi|^{3/2-2s}. \end{align} Combining estimates \eqref{u4-theta1-J21-est} with \eqref{u4-theta1-J22-est}, we get $ J_2(\xi,\tau) \lesssim |\xi|^{3/2-2s}. $ Since $|\xi|\gtrsim 1$, $J_{2}$ is bounded if $3/2-2s\le 0$ or $s\ge \frac34$. This completes the proof of Lemma \ref{u4-bi-lem-1}.\,\, $\square$ \vskip0.05in \noindent {\bf Proof of Lemma \ref{u4-bi-lem-2}.} For the $\tau$-integral in \eqref{u4-theta2}, applying estimate \eqref{eq:calc_5} with $\ell=\ell'=b'>\frac14$, $a=\tau_1+4(\xi-\xi_1)^3$ and $c=\xi^3$, we get \begin{align} \label{u4-theta2-est} \Theta_2(\xi_1,\tau_1) \lesssim \frac{1}{(1+|\tau_1-4\xi_1^{3}|)^{2b'}} \int_{\mathbb{R}} \frac{\xi^2(1+|\xi|)^{2s}}{ (1+|\xi_1|)^{2s} (1+|\xi-\xi_1|)^{2s} } \frac{ \chi_{B_{II}}(\xi,\tau,\xi_1,\tau_1) d\xi }{(1+|\tau_1-4\xi_1^3+d_{4}(\xi,\xi_1)|)^{4b'-1}} d\xi, \end{align} where $d_{4}=-\xi^3+4\xi_1^3+4(\xi-\xi_1)^3$. Like \eqref{u4-theta1-est-no1}, using $|\tau_1-4\xi_1^{3}|\gtrsim |\tau_1-4\xi_1^3+d_{4}(\xi,\xi_1)|$, we obtain \begin{align} \label{u4-theta2-est-no1} \Theta_2(\xi_1,\tau_1) \lesssim \int_{\mathbb{R}} \frac{\xi^2(1+|\xi|)^{2s}}{ (1+|\xi_1|)^{2s} (1+|\xi-\xi_1|)^{2s} } \frac{ \chi_{B_{II}} }{(1+|\tau_1-4\xi_1^3+d_{4}(\xi,\xi_1)|)^{6b'-1}} d\xi. \end{align} Next, we estimate the $\xi$-integral for $\xi$ near the critical point of $d_{4}(\xi,\xi_1)$ and for $\xi$ away from the critical point of $d_{4}(\xi,\xi_1)$. Since these estimates are similar to the ones that we present in Lemma \ref{u4-bi-lem-1}, we omit them here completing the proof for Lemma \ref{u4-bi-lem-2}. \,\, $\square$ \subsection{Proof of $v$-equation Bilinear Estimates \eqref{bi-est-X-2} } \setcounter{equation}{0} In its $L^2$ formulation this estimate reads \begin{align} \label{v-bilinear-est-L2-form} \Big\| \int_{\mathbb{R}^2} Q(\xi,\tau,\xi_1,\tau_1) c_{f,\alpha}(\xi-\xi_1,\tau-\tau_1) c_{g,1}(\xi_1,\tau_1) d\xi_1 d\tau_1 \Big\|_{L^2_{\xi,\tau}} \lesssim \big\|c_{f,\alpha}\big\|_{L^2_{\xi,\tau}} \big\|c_{g,1}\big\|_{L^2_{\xi,\tau}}, \end{align} where $Q$ is the multiplier defined by \begin{align*} Q(\xi,\tau,\xi_1,\tau_1) \doteq& |\xi| \cdot \Big[ \frac{ (1+|\xi|)^s }{ (1+|\tau-\alpha\xi^{3}|)^{b} } + \frac{ \chi_{|\xi|< 1} } { (1+|\tau|)^{1-\theta} } \Big] \cdot \frac{1}{ (1+|\xi_1|)^{s} (1+|\tau_1-\xi_1^3|)^{b'} + \chi_{|\xi_1|< 1}(1+|\tau_1|)^{\theta'} } \\ \times& \frac{1}{ (1+|\xi-\xi_1|)^{s} (1+|\tau-\tau_1-\alpha(\xi-\xi_1)^3|)^{b'} + \chi_{|\xi-\xi_1|< 1}(1+|\tau-\tau_1|)^{\theta'} }. \end{align*} The corresponding Bourgain quantity is \begin{align} \label{v-d3-quantity} \widetilde{d}_{\alpha}(\xi,\xi_1) \doteq (\tau-\alpha\xi^3)-(\tau_1-\xi_1^3)-[\tau-\tau_1-\alpha(\xi-\xi_1)^3] = -\alpha\xi^3+\xi_1^3+\alpha(\xi-\xi_1)^3. \end{align} Since $\widetilde{d}_{\alpha}(\xi,\xi_1)=-d_{\alpha}(\xi_1,\xi)$, where $d_{\alpha}(\xi,\xi_1)$ is the Bourgain quantity for $u$-equation, the proof for the bilinear estimate \eqref{bi-est-X-2} is similar to the proof for the bilinear estimate \eqref{bi-est-X-1}. In fact, we have similar microlocalizations, which follows from the new comparison property: $ \max\{ |\tau-\alpha\xi^3|, |\tau_1-\xi_1^3|, |\tau-\tau_1-\alpha(\xi-\xi_1)^3| \} \ge \frac13 |\widetilde{d}_{\alpha}(\xi,\xi_1)|. $ The main difference between the proof of bilinear estimate \eqref{bi-est-X-1} and the proof of bilinear estimate \eqref{bi-est-X-2} is that the Bourgain quantity $\widetilde{d}_{\alpha}(\xi,\xi_1)$ is a quadratic function of $\xi$ and a cubic function of $\xi_1$. \section{ Proof of Bilinear Estimates in $Y^{s,b}$} \label{sec:Y-bilinear-est} \setcounter{equation}{0} The temporal bilinear estimate \eqref{bi-est-Y-1} for the nonlinearity of the $u$-equation can be reduced to the corresponding estimates for the KdV equation, whose proof can be found in \cite{h2006}. In fact, for $s\ge 0$, in the $L^2$ formulation, if $|\tau|\lesssim |\xi|^3$, then we have $\|\partial_x(f,g)\|_{Y^{s,-b}_1}\lesssim \|\partial_x(f,g)\|_{X^{s,-b}_1}$, which will be reduced to the bilinear estimate in Bourgain spaces. Also, for $|\tau|\gg|\xi|^3$, we get $|\tau-\xi^3|\simeq |\tau-\alpha\xi^3|$, which reduces estimate \eqref{bi-est-Y-1} to the corresponding estimates for the KdV equation. For $s<0$, working similarly we can reduce it to the corresponding estimates for the KdV equation. Now, we do the proof of the temporal bilinear estimate for $v$, i.e. estimate \eqref{bi-est-Y-2}. Here we consider the case $\max\{0, s_{c}(\alpha)\}\le s<3$ and $\alpha\ne 1$, which is most relevant for the Majda-Biello system. The case $-3/4<s<0$ and $\alpha>4$ is similar for $\alpha=1$ we refer to \cite{h2006}. We begin by defining a domain $A$ in which $\tau\gg |\xi|^3$, that is \begin{equation} \label{Y-bi-domain-A} A \doteq \Big\{ (\xi,\tau)\in\mathbb{R}^2 : |\tau|> (10+10\alpha)^7\Big[2\big|\frac{\sqrt{\alpha}}{\sqrt{\alpha}-1}\big| + 2 \big| \frac{3\alpha}{\alpha-1} \big| + 2\Big]^3|\xi|^3 \Big\}. \end{equation} Then, for $s\ge 0$ we have \begin{align} \label{v-Y-est-1} \| w_{fg} \|_{Y^{s,-b}_{\alpha}}^2 \lesssim \int_{\mathbb{R}^2} \chi_{A} (1+|\tau|)^{\frac{2s}{3}} (1+|\tau-\alpha\xi^3|)^{-2b} |\widehat{w}_{fg}(\xi,\tau)|^2 d\xi d\tau + \|w_{fg}\|_{X^{s,-b}_\alpha}^2. \end{align} Thus, to prove bilinear estimate \eqref{bi-est-Y-2}, it suffices to prove that \begin{align} \label{v-bi-est-Y-reduced} \Big( \int_{\mathbb{R}^2} \chi_{A} (1+|\tau|)^{\frac{2s}{3}} (1+|\tau-\alpha\xi^3|)^{-2b} |\widehat{w}_{fg}(\xi,\tau)|^2 d\xi d\tau \Big)^{1/2} \lesssim \|f\|_{X^{s,b'}_{\alpha}} \|g\|_{X^{s,b'}_{1}}. \end{align} Using $ c_{h,\alpha}(\xi,\tau) \doteq (1+|\xi|)^{s} (1+|\tau-\alpha\xi^3|)^{b'} |\widehat{h}(\xi,\tau)| $, the bilinear estimate \eqref{v-bi-est-Y-reduced} reads as follows \begin{align} \label{v-bilinear-est-L2-form-Y} \Big\| \int_{\mathbb{R}^2} Q(\xi,\tau,\xi_1,\tau_1) c_{f,\alpha}(\xi-\xi_1,\tau-\tau_1) c_{g,1}(\xi_1,\tau_1) d\xi_1 d\tau_1 \Big\|_{L^2_{\xi,\tau}} \lesssim \|c_{f,\alpha}\|_{L^2_{\xi,\tau}} \|c_{g,1}\|_{L^2_{\xi,\tau}}, \end{align} where the multiplier $Q=Q(\xi,\tau,\xi_1,\tau_1)$ is given by \begin{align*} Q \doteq& \frac{ |\xi|\, \chi_{A}(\xi,\tau) } { (1+|\tau-\alpha\xi^3|)^{b} } \frac{ (1+|\tau|)^{\frac{s}{3}} } {(1+|\xi_1|)^{s} (1+|\xi-\xi_1|)^{s} } \frac{1}{ (1+|\tau_1-\xi_1^3|)^{b'} } \, \frac{1}{ (1+|\tau-\tau_1-\alpha(\xi-\xi_1)^3|)^{b'} }. \end{align*} To make further simplification, we consider the following two microlocalizations: \vskip0.05in \noindent $\bullet$ Microlocalization I: $|\tau|< (10+10\alpha)|\xi_1|^3$ \qquad $\bullet$ Microlocalization II: $|\tau|\ge (10+10\alpha)|\xi_1|^3$. \vskip0.05in \noindent {\bf Estimate in microlocalization I.} Since $|\tau|\le (10+10\alpha)|\xi_1|^3$ and $s\ge 0$, we have $ \frac{(1+|\tau|)^{s/3}}{ (1+|\xi_1|)^{s}(1+|\xi-\xi_1|)^{s} } \lesssim 1, $ which gives us $ Q(\xi,\tau,\xi_1,\tau_1) \lesssim Q_1(\xi,\tau,\xi_1,\tau_1), $ where the multiplier $Q_1$ is defined as follows \begin{align*} Q_1(\xi,\tau,\xi_1,\tau_1) \doteq \frac{ |\xi| \, \chi_{A}(\xi,\tau) } { (1+|\tau-\alpha\xi^3|)^{b} } \, \frac{\chi_{|\tau|<(10+10\alpha)|\xi_1|^3}}{ (1+|\tau_1-\xi_1^3|)^{b'} } \, \frac{1}{ (1+|\tau-\tau_1-\alpha(\xi-\xi_1)^3|)^{b'} }. \end{align*} To show bilinear estimate \eqref{v-bilinear-est-L2-form-Y} in this situation, using the Cauchy--Schwarz inequality with respect to $(\xi_1,\tau_1)$, and taking the supremum over $(\xi,\tau)$, we get \begin{align*} \Big\| \int_{\mathbb{R}^2} Q_1(\xi,\tau,\xi_1,\tau_1) c_{f,\alpha}(\xi - \xi_1,\tau - \tau_1) c_{g,1}(\xi_1,\tau_1) d\xi_1 d\tau_1 \Big\|_{L^2_{\xi,\tau}} \le \| \Theta_1 \|_{L^{\infty}_{\xi,\tau}}^{1/2} \|c_{f,\alpha}\|_{L^2_{\xi,\tau}} \|c_{g,1}\|_{L^2_{\xi,\tau}} , \end{align*} which shows that the proof of the bilinear estimate \eqref{v-bilinear-est-L2-form-Y} follows from the next result. \begin{lemma} \label{Y-lem-1} Let $\alpha>0$ and $\alpha\ne 1$. If $\frac13<b'\le b<\frac12$, then we have \begin{align} \label{Y-theta1} \Theta_1(\xi,\tau) \doteq \frac{ \xi^2 \, \chi_{A}(\xi,\tau) } { (1+|\tau-\alpha\xi^3|)^{2b} } \int_{\mathbb{R}^2} \frac{\chi_{|\tau|<(10+10\alpha)|\xi_1|^3}}{ (1+|\tau_1-\xi_1^3|)^{2b'} } \, \frac{d\tau_1 d\xi_1}{ (1+|\tau-\tau_1-\alpha(\xi-\xi_1)^3|)^{2b'} } \lesssim 1. \end{align} \end{lemma} \vskip0.05in \noindent {\bf Estimate in microlocalization II.} The multiplier $Q(\xi,\tau,\xi_1,\tau_1)$ is reduced to $Q_2$, where \begin{align*} Q_2(\xi,\tau,\xi_1,\tau_1) \doteq \frac{|\xi| \, \chi_{A}(\xi,\tau) }{(1+|\tau-\alpha\xi^{3}|)^{b}} \frac{\chi_{|\tau|>(10+10\alpha)|\xi_1|^3}(1+|\tau|)^{s/3}}{ (1+|\xi_1|)^{s}(1+|\xi-\xi_1|)^{s} } \frac{1} { (1+|\tau-\tau_1-\alpha(\xi-\xi_1)^{3}|)^{b'} (1+|\tau_1-\xi_1^{3}|)^{b'} }. \end{align*} Again, applying the Cauchy--Schwarz inequality with respect to $(\xi_1,\tau_1)$, and taking the supremum over $(\xi,\tau)$, we arrive at \begin{align*} \Big\| \int_{\mathbb{R}^2} Q_2(\xi,\tau,\xi_1,\tau_1) c_{f,\alpha}(\xi - \xi_1,\tau - \tau_1) c_{g,1}(\xi_1,\tau_1) d\xi_1 d\tau_1 \Big\|_{L^2_{\xi,\tau}} \le \| \Theta_2 \|_{L^{\infty}_{\xi,\tau}}^{1/2} \|c_{f,\alpha}\|_{L^2_{\xi,\tau}} \|c_{g,1}\|_{L^2_{\xi,\tau}}, \end{align*} which shows that the proof of the bilinear estimate \eqref{v-bilinear-est-L2-form-Y} follows from the next result. \begin{lemma} \label{Y-lem-2} Let $\alpha>0$ and $\alpha\ne 1$. If $0\le s< 3$ and $\max\{\frac{2s+3}{18},\frac{4}{9}\}<b'\le b<\frac12$, then we have \begin{align} \label{Y-theta2} \Theta_2(\xi,\tau) \doteq& \frac{ |\xi|^2(1+|\tau|)^{2s/3} \, \chi_{A}(\xi,\tau) }{(1+|\tau-\alpha\xi^{3}|)^{2b}} \\ \times &\int_{\mathbb{R}^2} \frac{\chi_{|\tau|\ge(10+10\alpha)|\xi_1|^3}}{ (1+|\xi_1|)^{2s}(1+|\xi-\xi_1|)^{2s} } \frac{1} { (1+|\tau-\tau_1-(\xi-\xi_1)^{3}|)^{2b'} (1+|\tau_1-\xi_1^{3}|)^{2b'} } d\xi_1 d\tau_1 \lesssim 1. \nonumber \end{align} \end{lemma} \vskip.05in \noindent {\bf Proof of Lemma \ref{Y-lem-1}.} For the $\tau_1$-integral in \eqref{Y-theta1}, applying calculus estimate \eqref{eq:calc_5} with $\ell=\ell'=b'$, $a=\tau-\alpha(\xi-\xi_1)^3$, $c=\xi_1^3$ we arrive at the following estimate \begin{align} \label{theta1-est-Y} \Theta_1(\xi,\tau) \lesssim \frac{ |\xi|^2 \chi_{A}(\xi,\tau)}{(1+|\tau-\alpha\xi^{3}|)^{2b}} \int_{\mathbb{R}} \frac{\chi_{|\tau|<(10+10\alpha)|\xi_1|^3}} { (1+|\tau-\alpha\xi^3-\widetilde{d}_{\alpha}(\xi,\xi_1)|)^{4b'-1} } d\xi_1, \end{align} where $\widetilde{d}_{\alpha}(\xi,\xi_1)$ is the Bourgain quantity defined in \eqref{v-d3-quantity}, that is $ \widetilde{d}_{\alpha}(\xi,\xi_1) \doteq -\alpha\xi^3+\xi_1^3+\alpha(\xi-\xi_1)^3. $ Now, our strategy is to split the $\xi_1$ integral at the critical points of $\mu(\xi_1)=\widetilde{d}_{\alpha}(\xi,\xi_1)$. Differentiating we get \begin{align} \label{v-d-partial-xi} \frac{\partial \widetilde{d}_{\alpha}(\xi,\xi_1)}{\partial\xi_1} = 3(1-\alpha)(\xi_1-\widetilde{p}_1)(\xi_1-\widetilde{p}_2), \,\, \text{with} \,\, \widetilde{p}_1 = \frac{\sqrt{\alpha}}{\sqrt{\alpha}-1}\xi, \,\, \widetilde{p}_2 = \frac{\sqrt{\alpha}}{\sqrt{\alpha}+1}\xi, \,\, \alpha>0 \,\, \text{and} \,\, \alpha\neq 1. \end{align} Furthermore, in this microlocalization $\xi_1$ is away from the critical points. In fact, we have $ |\tau| > (10+10\alpha)^7\Big[2\big|\frac{\sqrt{\alpha}}{\sqrt{\alpha}-1}\big| + 2 \big| \frac{3\alpha}{\alpha-1} \big| + 2\Big]^3|\xi|^3 $ and $ |\tau|<(10+10\alpha)|\xi_1|^3$, which implies that $ (10+10\alpha)|\xi_1|^3 > (10+10\alpha)^7\Big[2\big|\frac{\sqrt{\alpha}}{\sqrt{\alpha}-1}\big| + 2 \big| \frac{3\alpha}{\alpha-1} \big| + 2\Big]^3|\xi|^3, $ or \begin{equation} \label{Y-s-0-xi1-away} |\xi_1| > N|\xi|, \quad \text{with} \quad N \doteq (10+10\alpha)^2\Big[2\big|\frac{\sqrt{\alpha}}{\sqrt{\alpha}-1}\big| + 2 \big| \frac{3\alpha}{\alpha-1} \big| + 2\Big]|\xi|. \end{equation} Thus, using the two $\xi_1$-intervals $ \mathcal{I}_1^{\xi_1} \doteq (-\infty,-N|\xi|) $ and $ \mathcal{I}_2^{\xi_1} \doteq (N|\xi|, \infty), $ from \eqref{theta1-est-Y} we have \begin{equation*} \Theta_1 = J_1+J_2 \text{ with } J_k(\xi,\tau) \doteq \frac{|\xi|^2 \chi_{A}(\xi,\tau)}{(1+|\tau-\alpha\xi^{3}|)^{2b}} \int_{\mathcal{I}_k^{\xi_1}} \frac{\chi_{|\tau|<(10+10\alpha)|\xi_1|^3}} { (1+|\tau-\alpha\xi^3-\widetilde{d}_{\alpha}(\xi,\xi_1)|)^{4b'-1} } d\xi_1. \end{equation*} In addition, for each one of the intervals $\mathcal{I}_1^{\xi_1}$, $\mathcal{I}_2^{\xi_1}$ we do further split. Using $\xi_1$-intervals $ \mathcal{I}_{k,1}^{\xi_1} \doteq \big\{ \xi_1\in \mathcal{I}_{k}^{\xi_1}; \,\, |\tau-\alpha\xi^3|\ge \frac12 |\widetilde{d}_{\alpha}(\xi,\xi_1)| \big\} $ and $ \mathcal{I}_{k,2}^{\xi_1} \doteq \big\{ \xi_1\in \mathcal{I}_{k}^{\xi_1}; \,\, |\tau-\alpha\xi^3|< \frac12 |\widetilde{d}_{\alpha}(\xi,\xi_1)| \bigg\}, $ for $k=1,2$ we have \begin{equation} \label{Y-theta1-est-Jk} J_k = J_{k1}+J_{k2} \text{ with } J_{kj}(\xi,\tau) \doteq \frac{|\xi|^2 \chi_{A}(\xi,\tau)}{(1+|\tau-\alpha\xi^{3}|)^{2b}} \int_{\mathcal{I}_{kj}^{\xi_1}} \frac{\chi_{|\tau|<(10+10\alpha)|\xi_1|^3}} { (1+|\tau-\alpha\xi^3-\widetilde{d}_{\alpha}(\xi,\xi_1)|)^{4b'-1} } d\xi_1. \end{equation} {\bf Estimate for $J_{k1}$.} Using $|\tau-\alpha\xi^3|\ge \frac12 |\widetilde{d}_{\alpha}(\xi,\xi_1)|$, we get $ |\tau-\alpha\xi^3| \gtrsim |\tau-\alpha\xi^3-\widetilde{d}_{\alpha}(\xi,\xi_1)|, $ which gives \begin{align} \label{Y-theta1-est-Jk-no1} J_{k1}(\xi,\tau) \lesssim \int_{\mathcal{I}_{k1}^{\xi_1}} \frac{\chi_{A}(\xi,\tau)\, \chi_{|\tau|<(10+10\alpha)|\xi_1|^3}\,\,\, |\xi|^2} { (1+|\tau-\alpha\xi^3-\widetilde{d}_{\alpha}(\xi,\xi_1)|)^{2b+4b'-1} } d\xi_1 , \quad k=1,2. \end{align} Now making the change of variables $\mu=\mu(\xi_1)=\tau-\alpha\xi^3-\widetilde{d}_{\alpha}(\xi,\xi_1)$ and using the property \eqref{v-d-partial-xi}, we get $|\mu'|\gtrsim \big| \xi_1-\frac{\sqrt{\alpha}}{\sqrt{\alpha}-1}\xi \big| \big| \xi_1-\frac{\sqrt{\alpha}}{\sqrt{\alpha}+1}\xi \big|$, which combined with estimate \eqref{Y-theta1-est-Jk-no1} implies that \begin{align} \label{Y-theta1-est-Jk-no2} J_{k1}(\xi,\tau) \lesssim \int_{\mathcal{I}_{k1}^{\mu}} \frac{\chi_{A}(\xi,\tau) \,\chi_{|\tau|<(10+10\alpha)|\xi_1|^3}} { (1+|\mu|)^{2b+4b'-1} } \frac{|\xi|^2}{ \big| \xi_1-\frac{\sqrt{\alpha}}{\sqrt{\alpha}-1}\xi \big| \big| \xi_1-\frac{\sqrt{\alpha}}{\sqrt{\alpha}+1}\xi \big|} d\mu, \quad k=1,2. \end{align} Now, using estimate \eqref{Y-s-0-xi1-away}, i.e. $|\xi_1|\gg |\xi|$, we get $\big| \xi_1-\frac{\sqrt{\alpha}}{\sqrt{\alpha}-1}\xi \big| \big| \xi_1-\frac{\sqrt{\alpha}}{\sqrt{\alpha}+1}\xi \big|\gtrsim \xi^2$, which combined with \eqref{Y-theta1-est-Jk-no2} gives $ J_{k1}(\xi,\tau)(\xi,\tau) \lesssim \int_{\mathbb{R}} \frac{1} { (1+|\mu|)^{2b+4b'-1} } d\mu $ ($ k=1,2 $ ). This integral is bounded if $2b+4b'-1>1$. It suffices to have $ 1/3<b'\le b. $ \vskip.05in \noindent {\bf Estimate for $J_{k2}$.} Using that $ |\tau-\alpha\xi^3|< \frac12 |\widetilde{d}_{\alpha}(\xi,\xi_1)| $ we get $ |\tau-\alpha\xi^3-\widetilde{d}_{\alpha}(\xi,\xi_1)|\gtrsim |\widetilde{d}_{\alpha}(\xi,\xi_1)| $, which combined with \eqref{Y-theta1-est-Jk} implies that \begin{align} \label{Y-s-0-Jk2} J_{k2}(\xi,\tau) \lesssim \frac{\chi_{A}(\xi,\tau) |\xi|^2}{(1+|\tau-\alpha\xi^{3}|)^{2b}} \int_{\mathcal{I}_{k2}^{\xi_1}} \frac{\chi_{|\tau|<(10+10\alpha)|\xi_1|^3}} { (1+|\widetilde{d}_{\alpha}(\xi,\xi_1)|)^{4b'-1} } d\xi_1, \quad k=1,2. \end{align} Furthermore, using estimate \eqref{Y-s-0-xi1-away}, i.e. $|\xi_1|\gg |\xi|$, and the following factorization \begin{equation} \label{v-d-le-4-xi} \widetilde{d}_{\alpha}(\xi,\xi_1) = (1-\alpha)\xi_1 \Big[\xi_1-\frac{3\alpha+\sqrt{3\alpha(4-\alpha)}}{2(\alpha-1)}\xi\Big] \Big[\xi_1-\frac{3\alpha-\sqrt{3\alpha(4-\alpha)}}{2(\alpha-1)}\xi\Big] , \quad 0<\alpha\le 4 \,\, \text{and} \,\, \alpha\neq 1, \end{equation} we get $ |\widetilde{d}_{\alpha}(\xi,\xi_1)| \gtrsim |\xi_1|^3 $ for $0<\alpha\le 4$ and $\alpha\neq 1$. Also for $ \alpha>4, $ we have $ |\widetilde{d}_{\alpha}(\xi,\xi_1)| \ge \frac{\alpha-4}{4} |\xi_1|^3. $ In addition, for $(\xi,\tau)\in A$, we have $|\tau-\alpha\xi^3|\gtrsim |\tau|\gtrsim |\xi|^3$. Combining these estimates with \eqref{Y-s-0-Jk2}, we get \begin{align*} J_{k2}(\xi,\tau) \lesssim \frac{|\xi|^2}{(1+|\xi^{3}|)^{2b}} \int_{\mathbb{R}} \frac{1} { (1+|\xi_1^3|)^{4b'-1} } d\xi_1 \lesssim \frac{1}{(1+|\xi|)^{6b-2}} \int_{\mathbb{R}} \frac{1} { (1+|\xi_1|)^{12b'-3} } d\xi_1, \quad k=1,2. \end{align*} For $\frac{1}{(1+|\xi|)^{6b-2}}\lesssim1 $, we need $6b-2\ge 0$ or $b\ge 1/3$. For the integral of $\xi_1$ to be bounded, we need $12b'-3>1$ or $b'>1/3$. This completes the proof of Lemma \ref{Y-lem-1}.\,\, $\square$ \vskip.05in \noindent {\bf Proof of Lemma \ref{Y-lem-2}.} For the $\tau_1$-integral in \eqref{Y-theta2}, applying calculus estimate \eqref{eq:calc_5} with $\ell=\ell'=b'$, $a=\tau-\alpha(\xi-\xi_1)^3$, $c=\xi_1^3$, we arrive at the following estimate \begin{align} \label{Y-theta2-est} \Theta_2(\xi,\tau) \lesssim& \frac{(1+|\tau|)^{2s/3}|\xi|^2}{(1+|\tau-\alpha\xi^{3}|)^{2b}} \int_{\mathbb{R}} \frac{ \chi_{A}(\xi,\tau) \chi_{|\tau|\ge(10+10\alpha)|\xi_1|^3}}{ (1+|\xi_1|)^{2s}(1+|\xi-\xi_1|)^{2s} } \cdot \frac{1} { (1+|\tau-\alpha(\xi-\xi_1)^{3}-\xi_1^3|)^{4b'-1} } d\xi_1. \end{align} Using $|\tau|>(10+10\alpha)|\xi_1|^3$ and $(\xi,\tau)\in A$, i.e. $ |\tau|> (10+10\alpha)^7\big[2\big|\frac{\sqrt{\alpha}}{\sqrt{\alpha}-1}\big| + 2 \big| \frac{3\alpha}{\alpha-1} \big| + 2\big]^3|\xi|^3, $ we get \begin{equation} \label{Y-theat2-xi-est} |\tau-\alpha\xi^3| \simeq |\tau-\alpha(\xi-\xi_1)^{3}-\xi_1^3| \simeq |\tau| \gtrsim |\xi|^3+|\xi_1|^3, \end{equation} which combined with \eqref{Y-theta2-est} implies that \begin{align} \label{Y-theta2-est-no1} \Theta_2(\xi,\tau) \lesssim \frac{(1+|\tau|)^{2s/3}|\xi|^2}{(1+|\tau|)^{2b+4b'-1}} \int_{\mathbb{R}} \frac{ \chi_{A}(\xi,\tau) \chi_{|\tau|\ge(10+10\alpha)|\xi_1|^3}}{ (1+|\xi_1|)^{2s}(1+|\xi-\xi_1|)^{2s} } d\xi_1. \end{align} Next, we consider the following two cases. \vskip.05in \noindent $\bullet$ Case 1: $0\le s\le 1$ \quad $\bullet$ Case 2: $1< s<3$ \vskip0.05in \noindent {\bf Proof in Case 1.} Using estimate \eqref{Y-theat2-xi-est}, we get $|\xi|\lesssim |\tau|^{1/3}$ and $|\xi_1|\lesssim |\tau|^{1/3}$, which helps us do the $\xi_1$-integration in \eqref{Y-theta2-est-no1}. We have $ \Theta_2 \lesssim \frac{(1+|\tau|)^{2s/3}|\xi|^2}{(1+|\tau|)^{2b+4b'-1}} \int_{|\xi_1|\lesssim |\tau|^{1/3}} 1 d\xi_1 \lesssim \frac{1}{(1+|\tau|)^{2b+4b'-2s/3-2}}, $ which is bounded if $ 2b+4b'-2s/3-2 \ge 0 $ or $ s \le 3(b+2b'-1). $ For $s\le 1$, it suffices to have $4/9\le b'\le b$. This completes the proof in Case 1. \vskip0.05in \noindent {\bf Proof in Case 2.} Using $|\xi|\lesssim\max\{|\xi_1|, |\xi-\xi_1|\}$ and $s>1$, we get $ \frac{|\xi|^2 }{ (1+|\xi_1|)^{2s}(1+|\xi-\xi_1|)^{2s} } $ $ \lesssim $ $ \max\{ \frac{1}{(1+|\xi_1|)^{2s}}, $ $ \frac{1}{(1+|\xi-\xi_1|)^{2s}} \}, $ which implies that $ \int_\mathbb{R} \frac{|\xi|^2 }{ (1+|\xi_1|)^{2s}(1+|\xi-\xi_1|)^{2s} } d\xi_1 \lesssim 1. $ Combining this with \eqref{Y-theta2-est-no1}, we get \begin{align*} \Theta_2(\xi,\tau) \lesssim \frac{(1+|\tau|)^{2s/3}}{(1+|\tau|)^{2b+4b'-1}} \int_\mathbb{R} \frac{|\xi|^2 }{ (1+|\xi_1|)^{2s}(1+|\xi-\xi_1|)^{2s} } d\xi_1 \lesssim \frac{(1+|\tau|)^{2s/3}}{(1+|\tau|)^{2b+4b'-1}} = \frac{1}{(1+|\tau|)^{2b+4b'-1-2s/3}}, \end{align*} which is bounded if $2b+4b'-1-2s/3\ge 0$. For this, it suffices to have $ b \ge b'> \frac{3+2s}{18}. $ For $b'\le b<\frac12$, we need $s< 3$. This completes the proof Lemma \ref{Y-lem-2}. \,\,$\square$ \section{Counterexamples for bilinear estimates} \label{sec:u-bi-counter} \setcounter{equation}{0} In this section we provide counterexamples for estimate \eqref{bi-est-X-1}, which corresponds to the nonlinearity of the $u$-equation. We do this in the three cases: $\bullet$ $\alpha=4$; \quad $\bullet$ $0<\alpha<4$ and $\alpha\neq 1$; \quad $\bullet$ $\alpha>4$ or $\alpha=1$. \subsection{Counterexample for $\alpha=4$} We will show that estimate \eqref{bi-est-X-1} fails for $s<\frac34$, if $\alpha=4$. In fact, we have the following result. \begin{lemma} \label{u4-counter-example-b-small} Let $\alpha=4$. If $s<\frac34$, then the bilinear estimate \eqref{bi-est-X-1} (with $b'=b$) fails for any $b\in\mathbb{R}$. \end{lemma} \noindent {\bf Proof of Lemma \ref{u4-counter-example-b-small}.} Using the notation given by \eqref{eq:c_u}, i.e. $$ c_{f,\alpha}(\xi,\tau) \doteq \Big[ (1+|\xi|)^{s} (1+|\tau-\alpha\xi^3|)^{b'} + \chi_{|\xi|< 1}(1+|\tau|)^{\theta'} \Big] |\widehat{f}(\xi,\tau)|, $$ we see that the $L^2$ formulation \eqref{bilinear-est-L2-form} of bilinear estimate \eqref{bi-est-X-1} when $f=g$, $\text{supp}\, c_{f,\alpha}\subset\{(\xi_1,\tau_1)\in\mathbb{R}^2: |\xi_1|\ge 1\}$ and dropping $\chi_{|\xi|<1}(1+|\tau|)^{\theta-1}$, reads as follows \begin{align} \label{u4-counter-1st-estimate} \hskip-0.15in \Big\| \frac{\xi(1+|\xi|)^s}{(1+|\tau-\xi^3|)^{b}} \hskip-0.05in \int_{\mathbb{R}^2} \hskip-0.09in \frac{ (1+|\xi-\xi_1|)^{-s} (1+|\xi_1|)^{-s} c_{f,4}(\xi-\xi_1,\tau-\tau_1) c_{f,4}(\xi_1,\tau_1) d\xi_1 d\tau_1 }{ (1+|\tau-\tau_1-4(\xi-\xi_1)^{3}|)^{b}(1+|\tau_1-4\xi_1^{3}|)^{b}} \Big\|_{L^2_{\xi,\tau}} \hskip-0.05in \hskip-0.07in \lesssim \hskip-0.03in \big\|c_{f,4}\big\|_{L^2_{\xi_1,\tau_1}}^2. \end{align} We will show that if bilinear estimate \eqref{u4-counter-1st-estimate} holds, then we must have $s\ge\frac 34$. Since the Bourgain quantity $d_{4}(\xi,\xi_1)=12\xi(\xi_1-\xi/2)^2$ has a double zero at $\xi_1=\xi/2$, in our counterexample $\xi_1\simeq \xi/2$. In fact, for $N\in \mathbb{Z}^+$ we define $ c_{f,4}(\xi_1,\tau_1) \doteq \chi_{A^+_4}(\xi_1,\tau_1), $ where $ A^+_4 \doteq \big\{ (\xi_1,\tau_1) \in \mathbb{R}^2 : N-N^{-\frac{1}{2}} \le \xi_1 \le N+N^{-\frac{1}{2}}, \,\, |\tau_1-4\xi_1^3| \le 10\cdot 5^3 \big\}. $ Also, we define the $(\xi,\tau)$-domain $\widetilde{A}_1^+$ as follows $ \widetilde{A}^+_1 \doteq \big\{ (\xi,\tau) \in \mathbb{R}^2 : 2N-(2N)^{-\frac{1}{2}} \le \xi \le 2N+(2N)^{-\frac{1}{2}}, \,\, |\tau-\xi^3| \le 10\cdot 5^3 \big\}. $ Therefore, we get \begin{align} \label{u4-L2-norm-cf} \|c_{f,4}\|_{L^2(\mathbb{R}^2)}^2 =& \int_{A^+_4} 1^2 d\xi_1d\tau_1 = \int_{\xi_1=N-N^{-\frac{1}{2}}}^{N+N^{-\frac{1}{2}}}\int_{\tau_1=4\xi_1^3-10\cdot 5^3}^{4\xi_1^3+10\cdot 5^3} 1 d\tau_1d\xi_1 = 2\cdot10\cdot 5^3 \cdot N^{-\frac{1}{2}}. \end{align} Next, defining the quantity in the $L^2$-norm of \eqref{u4-counter-1st-estimate} \begin{align} \label{u4-def-theta} \Theta(\xi,\tau) \doteq \frac{\xi(1+|\xi|)^s}{(1+|\tau-\xi^3|)^{b}} \int_{\mathbb{R}^2} \frac{ (1+|\xi-\xi_1|)^{-s} (1+|\xi_1|)^{-s} c_{f,4}(\xi-\xi_1,\tau-\tau_1) c_{f,4}(\xi_1,\tau_1) d\xi_1 d\tau_1 }{ (1+|\tau-\tau_1-4(\xi-\xi_1)^{3}|)^{b}(1+|\tau_1-4\xi_1^{3}|)^{b}}, \end{align} we derive the following key estimate \begin{align} \label{u4-counter-example-bounded-from-below} \| \Theta \|_{L^2_{\xi,\tau}} \gtrsim N^{-s}N^{1/4}. \end{align} We prove estimate \eqref{u4-counter-example-bounded-from-below} later. Now, combining it with \eqref{u4-L2-norm-cf}, we see that if the bilinear estimate \eqref{u4-counter-1st-estimate} holds, then we would have $ N^{-s}N^{1/4} \lesssim N^{-\frac{1}{2}}. $ Since $N\gg 1$, we must have $ -s+\frac14 \le -\frac12 $ or $ s \ge \frac34. $ This completes the proof of Lemma \ref{u4-counter-example-b-small}. \,\, $\square$ \noindent \begin{minipage}{0.5\linewidth} \center \begin{tikzpicture}[yscale=1, xscale=3,every node/.style={scale=1}] \newcommand\X{0}; \newcommand\Y{0}; \newcommand\FX{9}; \newcommand\FY{9}; \newcommand\R{0.6}; \newcommand*{\TickSize}{2pt}; \newcommand*{\Num}{4}; \newcommand*{2}{2} \newcommand*{\Dist/\Num}{2/\Num} \draw[line width=1pt,-{Latex[length=2mm]}] (0.35,0) -- (2.3,0) node[above] {\fontsize{\FX}{\FY} $\xi_1$} ; \draw[line width=1pt,-{Latex[length=2mm]}] (1,0) -- (1,3.5) node[right] {\fontsize{\FX}{\FY} $\tau_1$}; \draw[red, line width=1pt, domain=1:1.5,variable=\x] plot ({\x},{(\x)^3}) ; \draw[DarkGreen, line width=1pt, domain=1:1.5,variable=\x] plot ({\x},{3*\x-2}) ; \draw[DarkGreen, line width=1pt, domain=1:1.5,variable=\x] plot ({\x},{3*\x+1.5^3-4.5}) ; \draw[black, line width=0.4pt,dashed] (1,0) node[xshift=-0.4cm, yshift=-0.2cm] {\fontsize{\FX}{\FY} $N$} (1.5,0) node[xshift=0.4cm,yshift=-0.3cm] {\fontsize{\FX}{\FY} $N+\frac{1}{10^3}N^{-\frac{1}{2}}$} (1.5,1.5^3) node[xshift=-0.5cm] {\fontsize{\FX}{\FY}\color{red} $C^*$} (1,1) node[below left] {\fontsize{\FX}{\FY}\color{red} $E^*$} ; \draw[blue, line width=1pt,dashed] (1.5,0) -- (1.5,1.5^3) ; \draw[DarkGreen, line width=1pt, domain=1.23:1.5,variable=\x] plot ({\x},{-1/3*\x+3}) ; \draw[DarkGreen, line width=1pt, domain=1:1.27,variable=\x] plot ({\x},{-1/3*\x+2.2}) ; \draw[] (1.5,1.35^3) node[right] {\fontsize{\FX}{\FY}\color{DarkGreen} $B^+$} (1.25,1.35^3+0.1) node[left] {\fontsize{\FX}{\FY}\color{DarkGreen} $C^+$} (1,{2.2-1/3}) node[left] {\fontsize{\FX}{\FY}\color{DarkGreen} $D^+$} (1.27,{2.2-1.27/3}) node[right] {\fontsize{\FX}{\FY}\color{DarkGreen} $E^+$} (1.7,1) node[right] {\fontsize{\FX}{\FY}\color{red} $\boxed{\tau_1=4\xi_1^3}$}; \draw [decorate,decoration={brace,amplitude=10pt},xshift=1pt,yshift=0pt] (1.5,1.5^3)--(1.5,2.5) node [black,midway,xshift=0.7cm] {\footnotesize $\le 1$}; \draw [decorate,decoration={brace,amplitude=10pt},xshift=-2pt,yshift=0pt] (1,1)--(1,{2.2-1/3}) node [black,midway,xshift=-0.7cm] {\footnotesize $\le 1$}; \end{tikzpicture} \vskip-0.15in \captionof{figure}{Rectangle in $A_4^+$} \label{fig:rec-A4} \end{minipage} \begin{minipage}{0.5\linewidth} \center \begin{tikzpicture}[yscale=1, xscale=3,every node/.style={scale=1}] \newcommand\X{0}; \newcommand\Y{0}; \newcommand\FX{9}; \newcommand\FY{9}; \newcommand\R{0.6}; \newcommand*{\TickSize}{2pt}; \newcommand*{\Num}{4}; \newcommand*{2}{2} \newcommand*{\Dist/\Num}{2/\Num} \draw[line width=1pt,-{Latex[length=2mm]}] (0.35,0) -- (2.3,0) node[above] {\fontsize{\FX}{\FY} $\xi$} ; \draw[line width=1pt,-{Latex[length=2mm]}] (1,0) -- (1,3.5) node[right] {\fontsize{\FX}{\FY} $\tau$}; \draw[red, line width=1pt, domain=1:1.5,variable=\x] plot ({\x},{(\x)^3}) ; \draw[DarkGreen, line width=1pt, domain=1:1.5,variable=\x] plot ({\x},{3*\x-2}) ; \draw[DarkGreen, line width=1pt, domain=1:1.5,variable=\x] plot ({\x},{3*\x+1.5^3-4.5}) ; \draw[black, line width=0.4pt,dashed] (1,0) node[xshift=-0.4cm, yshift=-0.2cm] {\fontsize{\FX}{\FY} $2N$} (1.5,0) node[xshift=0.4cm,yshift=-0.3cm] {\fontsize{\FX}{\FY} $2N+\frac{1}{10^3}(2N)^{-\frac{1}{2}}$} (1.5,1.5^3) node[xshift=-0.5cm] {\fontsize{\FX}{\FY}\color{red} $\widetilde{C}^*$} (1,1) node[below left] {\fontsize{\FX}{\FY}\color{red} $\widetilde{E}^*$} ; \draw[blue, line width=1pt,dashed] (1.5,0) -- (1.5,1.5^3) ; \draw[DarkGreen, line width=1pt, domain=1.23:1.5,variable=\x] plot ({\x},{-1/3*\x+3}) ; \draw[DarkGreen, line width=1pt, domain=1:1.27,variable=\x] plot ({\x},{-1/3*\x+2.2}) ; \draw[] (1.5,1.35^3) node[right] {\fontsize{\FX}{\FY}\color{DarkGreen} $\widetilde{B}^+$} (1.25,1.35^3+0.1) node[left] {\fontsize{\FX}{\FY}\color{DarkGreen} $\widetilde{C}^+$} (1,{2.2-1/3}) node[left] {\fontsize{\FX}{\FY}\color{DarkGreen} $\widetilde{D}^+$} (1.27,{2.2-1.27/3}) node[right] {\fontsize{\FX}{\FY}\color{DarkGreen} $\widetilde{E}^+$} (1.7,1) node[right] {\fontsize{\FX}{\FY}\color{red} $\boxed{\tau=\xi^3}$}; \draw [decorate,decoration={brace,amplitude=10pt},xshift=1pt,yshift=0pt] (1.5,1.5^3)--(1.5,2.5) node [black,midway,xshift=0.7cm] {\footnotesize $\le 1$}; \draw [decorate,decoration={brace,amplitude=10pt},xshift=-2pt,yshift=0pt] (1,1)--(1,{2.2-1/3}) node [black,midway,xshift=-0.7cm] {\footnotesize $\le 1$}; \end{tikzpicture} \vskip-0.15in \captionof{figure}{Rectangle in $\widetilde{A}_1^+$} \label{fig:rec-A1} \end{minipage} \vskip.1in \noindent {\bf Proof of \eqref{u4-counter-example-bounded-from-below}.} Following \cite{kpv1996}, we can show that there is rectangle with dimension $c_1N^{-2}\times c_2N^{3/2}$, where $c_1$,$c_2$ are appropriate constants, in the domain $A^+_4$. In fact, as shown in Figure \ref{fig:rec-A4}, we denote this rectangle by $B^+C^+D^+E^+$, where $B^+E^+$ is on the tangent line of $\tau=4\xi^3$ at $E^*=(N,4N^3)$. The coordinate for $B^+$ is $(N+\frac{1}{10^3}N^{-1/2}, 4 N^3+\frac{12}{10^3} N^{\frac32})$ and the coordinate for $D^+$ is $(N, 4(N+\frac{N^{-\frac12}}{10^3})^3 - \frac{12}{10^3}N^{\frac32})$. This rectangle in in $A_4^+$. Similarly, as shown in Figure \ref{fig:rec-A1}, we have a rectangle with dimension $c_1N^{-2}\times c_2N^{3/2}$ in the domain $\widetilde{A}^+_1$ and we denote it by $\widetilde{B}^+\widetilde{C}^+\widetilde{D}^+\widetilde{E}^+$. Next, we prove that if $(\xi,\tau)\in \widetilde{B}^+\widetilde{C}^+\widetilde{D}^+\widetilde{E}^+$ and $(\xi_1,\tau_1)\in B^+C^+D^+E^+$, then $(\xi-\xi_1,\tau-\tau_1)\in A^+_4$. For $(\xi,\tau)\in \widetilde{B}^+\widetilde{C}^+\widetilde{D}^+\widetilde{E}^+$, we get \begin{align} \label{u4-counter-xi-tau-est} 2N\le \xi\le 2N+\frac{1}{10^3}(2N)^{-\frac{1}{2}} \quad \text{and} \quad |\tau-\xi^3|\le 1. \end{align} Also, for $(\xi_1,\tau_1)\in B^+C^+D^+E^+$, we have \begin{align} \label{u4-counter-xi1-tau1-est} N\le \xi_1\le N+\frac{1}{10^3}N^{-\frac{1}{2}} \quad \text{and} \quad |\tau_1-4\xi_1^3|\le 1. \end{align} Using estimates \eqref{u4-counter-xi-tau-est} and \eqref{u4-counter-xi1-tau1-est}, for $(\xi,\tau)\in \widetilde{B}^+\widetilde{C}^+\widetilde{D}^+\widetilde{E}^+$ and $(\xi_1,\tau_1)\in B^+C^+D^+E^+$ we obtain \begin{align} \label{u4-counter-xi-xi1-est} N-\frac{1}{10^3} N^{-\frac{1}{2}} \le \xi-\xi_1 \le N+\frac{1}{10^3}(2N)^{-\frac{1}{2}} \quad \text{ and } \quad -\frac12 \frac{1}{10^3} (2N)^{-\frac{1}{2}} \le \xi_1-\frac{1}{2}\xi \le \frac{1}{10^3} N^{-\frac{1}{2}}, \end{align} which combined with triangle inequality gives us that \begin{align} \label{u4-counter-xi-xi1-tau-tau_1-est} |\tau-\tau_1-4(\xi-\xi_1)^3| \le& |\tau-\xi^3| + |\tau_1-4\xi_1^3| + |d_4(\xi,\xi_1)| \nonumber \\ =& |\tau-\xi^3| + |\tau_1-4\xi_1^3| + |12\xi(\xi_1-\xi/2)^2| \le 3. \end{align} Estimates \eqref{u4-counter-xi-xi1-est} and \eqref{u4-counter-xi-xi1-tau-tau_1-est} implies that $(\xi-\xi_1,\tau-\tau_1)\in A^+_4$. Now, letting $(\xi,\tau)\in \widetilde{B}^+\widetilde{C}^+\widetilde{D}^+\widetilde{E}^+$ and $(\xi_1,\tau_1)\in B^+C^+D^+E^+$, using $c_f(\xi-\xi_1,\tau-\tau_1)=1$ and $c_g(\xi_1,\tau_1)=1$, from \eqref{u4-def-theta} we have \begin{align} \label{u4-counter-theta-est} &\| \Theta \|_{L^2_{\xi,\tau}} \ge \Big\|\chi_{(\xi,\tau)\in \widetilde{B}^+\widetilde{C}^+\widetilde{D}^+\widetilde{E}^+} \frac{\xi(1+|\xi|)^s}{(1+|\tau-\xi^3|)^{b}} \\ \times& \int_{(\xi_1,\tau_1)\in B^+C^+D^+E^+}\frac{(1+|\xi-\xi_1|)^{-s}(1+|\xi_1|)^{-s}}{(1+|\tau-\tau_1-4(\xi-\xi_1)^{3}|)^{b}(1+|\tau_1-4\xi_1^{3}|)^{b}}d\xi_1 d\tau_1 \Big\|_{L^2_{\xi,\tau}}. \nonumber \end{align} Since the area of rectangles $B^+C^+D^+E^+$, $\widetilde{B}^+\widetilde{C}^+\widetilde{D}^+\widetilde{E}^+$ are $c N^{-1/2}$, using estimates \eqref{u4-counter-xi-tau-est}--\eqref{u4-counter-theta-est}, we get \begin{align*} \| \Theta \|_{L^2_{\xi,\tau}} \ge& \Big\| \frac{N(1+N)^{s}}{1} \int_{(\xi_1,\tau_1)\in B^+C^+D^+E^+} \frac{(1+N)^{-2s}}{1} d\xi_1 d\tau_1 \cdot \chi_{(\xi,\tau)\in \widetilde{B}^+\widetilde{C}^+\widetilde{D}^+\widetilde{E}^+} \Big\|_{L^2_{\xi,\tau}} \gtrsim N^{-s}N^{\frac14}, \end{align*} which is the desired estimate \eqref{u4-counter-example-bounded-from-below}. \,\, $\square$ \subsection{Counterexample for $0<\alpha<4$ and $\alpha\neq 1$.} In this subsection, we prove the following result \begin{lemma} \label{u0-counter-example-b-small} Let $0<\alpha<4$ and $\alpha\neq 1$. If $s<0$, then the bilinear estimate \eqref{bi-est-X-1} (with $b'=b$) fails for any $b\in\mathbb{R}$. \end{lemma} \noindent {\bf Proof of Lemma \ref{u0-counter-example-b-small}.} Using the notation $c_{f,\alpha}$, $c_{g,\alpha}$ defined in \eqref{eq:c_u}, we see that the $L^2$ formulation \eqref{bilinear-est-L2-form} of bilinear estimate \eqref{bi-est-X-1} when $\text{supp}\, c_{f,\alpha}\subset \{(\xi_2,\tau_2)\in\mathbb{R}^2 : |\xi_2|\ge 1\}$, $\text{supp}\, c_{g,\alpha}\subset \{(\xi_1,\tau_1)\in\mathbb{R}^2 : |\xi_1|\ge 1\}$ and dropping $\chi_{|\xi|<1}(1+|\tau|)^{\theta-1}$, reads as follows \begin{align} \label{u0-counter-1st-estimate} & \Big\| \frac{\xi(1+|\xi|)^s}{(1+|\tau-\xi^3|)^{b}} \int_{\mathbb{R}^2}\frac{ (1+|\xi-\xi_1|)^{-s}(1+|\xi_1|)^{-s} c_{f,\alpha}(\xi-\xi_1,\tau-\tau_1) c_{g,\alpha}(\xi_1,\tau_1)}{(1+|\tau-\tau_1-\alpha(\xi-\xi_1)^{3}|)^{b}(1+|\tau_1-\alpha\xi_1^{3}|)^{b}}d\xi_1 d\tau_1 \Big\|_{L^2_{\xi,\tau}} \nonumber \\ \lesssim& \big\|c_{f,\alpha}\big\|_{L^2_{\xi,\tau}} \big\|c_{g,\alpha}\big\|_{L^2_{\xi,\tau}}. \end{align} Like in the counterexample for $\alpha=4$, in this counterexample $\xi_1$ is near the zero of the Bourgain quantity $ d_{\alpha}(\xi,\xi_1) = \xi(\xi_1-r_1\xi)(\xi_1-r_2\xi), $ where $ r_1 = \frac12-\frac{\sqrt{-3+12\alpha^{-1}}}{6} $ and $ r_2 = \frac12+\frac{\sqrt{-3+12\alpha^{-1}}}{6} $ (see property \eqref{d-le-4-xi1}). In fact, letting $N\in \mathbb{Z}^+$, we define $ c_{f,\alpha}(\xi_2,\tau_2) \doteq \chi_{A_\alpha}(\xi_2,\tau_2), $ where $ A_\alpha \doteq \big\{ (\xi_2,\tau_2) \in \mathbb{R}^2 : (1-r_2)N-2N^{-2} \le \xi_2 \le (1-r_2)N+2N^{-2}, \alpha [(1-r_2)N]^3 - 10^3 \le \tau_2 \le \alpha [(1-r_2)N]^3 + 10^3 \big\}. $ Also, we define $ c_{g,\alpha}(\xi_1,\tau_1) \doteq \chi_{\widetilde{A}_\alpha}(\xi_1,\tau_1),$% where $ \widetilde{A}_\alpha \doteq \big\{ (\xi_1,\tau_1) \in \mathbb{R}^2 : r_2N-\frac{1}{(10+|r_1|+|r_2|)^3} N^{-2} \le \xi_1 \le r_2N+\frac{1}{(10+|r_1|+|r_2|)^3} N^{-2}, \alpha(r_2N)^3 - 1 \le \tau_2 \le \alpha(r_2N)^3 + 1 \big\}. $ Furthermore, we define the domain for $(\xi,\tau)$ as follows $ \Delta = \big\{ (\xi,\tau)\in\mathbb{R}^2 : N-\frac{1}{(10+|r_1|+|r_2|)^3}N^{-2}<\xi<N+\frac{1}{(10+|r_1|+|r_2|)^3} N^{-2}, N^3-1 \le \tau\le N^3+ 1 \big\}. $ All domains $A_\alpha$, $\widetilde A_\alpha$ and $\Delta$ are right rectangle with dimensions $\frac{\varepsilon}{N^2}\times c$, where $\varepsilon$ is a small number related to the zeros of Bourgain quantity $d_{\alpha}$ and $c$ is a constant. And, the centers of these rectangles are at $((1-r_2)N, \alpha[(1-r_2)N]^3)$, $(r_2N, \alpha (r_2N)^3)$, $(N, N^3)$, respectively. In addition, we have \begin{align} \label{u0-L2-norm-cf} \|c_f\|_{L^2_{\xi_2,\tau_2}}^2 \lesssim N^{-2} \quad \text{and} \quad \|c_g\|_{L^2_{\xi_1,\tau_1}}^2 \lesssim N^{-2}. \end{align} Next, denoting the quantity in the $L^2$-norm of estimate \eqref{u0-counter-1st-estimate} by \begin{align} \label{u0-counter-def-theta} \Theta(\xi,\tau) \doteq& \frac{\xi(1+|\xi|)^s}{(1+|\tau-\xi^3|)^{b}} \int_{\mathbb{R}^2}\frac{ (1+|\xi-\xi_1|)^{-s}(1+|\xi_1|)^{-s} c_{f,\alpha}(\xi-\xi_1,\tau-\tau_1) c_{g,\alpha}(\xi_1,\tau_1)}{(1+|\tau-\tau_1-\alpha(\xi-\xi_1)^{3}|)^{b}(1+|\tau_1-\alpha\xi_1^{3}|)^{b}}d\xi_1 d\tau_1, \end{align} we obtain the following key estimate for $\Theta$ \begin{align} \label{u0-counter-example-bounded-from-below} \| \Theta \|_{L^2_{\xi,\tau}} \gtrsim N^{-s-2}. \end{align} We prove estimate \eqref{u0-counter-example-bounded-from-below} later. Now, combining estimate \eqref{u0-counter-example-bounded-from-below} with \eqref{u0-L2-norm-cf}, we see that if the bilinear estimate \eqref{u0-counter-1st-estimate} holds, then we must have $ N^{-s-2} \lesssim N^{-2}. $ Since $N\gg 1$, we must have $ -s-2 \le -2 $ or $s\ge 0$. This completes the proof of Lemma \ref{u0-counter-example-b-small}, once we prove estimate \eqref{u0-counter-example-bounded-from-below}. \,\, $\square$ \vskip0.05in \noindent {\bf Proof of Estimate \eqref{u0-counter-example-bounded-from-below}.} First, we prove that if $(\xi,\tau)\in \Delta$ and $(\xi_1,\tau_1)\in \widetilde{A}_{\alpha}$, then we have $(\xi-\xi_1,\tau-\tau_1)\in A_{\alpha}$. In fact, for $(\xi,\tau)\in \Delta$ and $(\xi_1,\tau_1)\in \widetilde{A}_{\alpha}$ we have \begin{align} \label{u0-counter-xi-xi1-est} (1-r_2)N - \frac{2}{(10+|r_1|+|r_2|)^3 }N^{-2} \le \xi-\xi_1 \le (1-r_2)N + \frac{2}{(10+|r_1|+|r_2|)^3} N^{-2}. \end{align} Also, we have $\tau-\tau_1-\alpha(\xi-\xi_1)^3 = (\tau-\xi^3)-(\tau_1-\alpha\xi_1^3)- d_{\alpha}(\xi,\xi_1)$. Using the triangle inequality and the fact that $\xi_1$ is near the zero of $d_\alpha(\xi,\xi_1)$, we get $ |\tau-\tau_1-\alpha(\xi-\xi_1)^3| \le 10^3, $ which combined with estimate \eqref{u0-counter-xi-xi1-est} implies that $(\xi-\xi_1,\tau-\tau_1)\in A_{\alpha}$. Therefore, for $(\xi,\tau)\in \Delta$ and $(\xi_1,\tau_1)\in \widetilde{A}_{\alpha}$ we have $c_{f,\alpha}(\xi-\xi_1,\tau-\tau_1)=1$ and $c_{g,\alpha}(\xi_1,\tau_1)=1$. Thus, from \eqref{u0-counter-def-theta} we get \begin{align*} \| \Theta(\xi,\tau) \|_{L^2_{\xi,\tau}} \ge& \Big\| \frac{\xi (1+|\xi|)^s}{(1+|\tau-\xi^3|)^{b}} \int_{\widetilde{A}_\alpha}\frac{ (1+|\xi-\xi_1|)^{-s}(1+|\xi_1|)^{-s} }{(1+|\tau-\tau_1-\alpha(\xi-\xi_1)^{3}|)^{b}(1+|\tau_1-\alpha\xi_1^{3}|)^{b}}d\xi_1 d\tau_1 \cdot \chi_{ (\xi,\tau)\in \Delta} \Big\|_{L^2_{\xi,\tau}} \\ \gtrsim& \Big\| \frac{N(1+N)^s}{1} \int_{\widetilde{A}_\alpha} \frac{(1+N)^{-2s}}{1} d\xi_1d\tau_1 \cdot \chi_{ (\xi,\tau)\in \Delta} \Big\|_{L^2_{\xi,\tau}} \gtrsim N^{-2-s}, \end{align*} since the area of the rectangles $\Delta$ and $\widetilde{A}_\alpha$ are $c N^{-2}$. This is the desired estimate \eqref{u0-counter-example-bounded-from-below}. \,\, $\Box$ \subsection{Counterexample for $\alpha>4$ or $\alpha=1$.} We prove that bilinear estimate \eqref{bi-est-X-1} fails for $s<-\frac34$. More precisely, we have the following result. \begin{lemma} \label{counter-example-b-small} Let $\alpha>0$. If $s<-\frac34$ and the bilinear estimate \eqref{bi-est-X-1} holds (with $b'=b$), then $b>\frac12$. \end{lemma} \noindent {\bf Proof of Lemma \ref{counter-example-b-small}.} Using the notation $c_{f,\alpha}(\xi,\tau)$ given by \eqref{eq:c_u} we see that the $L^2$ formulation \eqref{bilinear-est-L2-form} of bilinear estimate \eqref{bi-est-X-1} when $f=g$, $\text{supp}\, c_{f,\alpha}\subset\{(\xi_1,\tau_1)\in\mathbb{R}^2 : |\xi_1|\ge 1\}$ and dropping $\chi_{|\xi|<1}(1+|\tau|)^{\theta-1}$, reads as follows \begin{align} \label{counter-1st-estimate} \hskip-0.17in \Big\| \frac{\xi(1+|\xi|)^s}{(1+|\tau-\xi^3|)^{b}} \hskip-0.05in \int_{\mathbb{R}^2} \hskip-0.09in \frac{ (1+|\xi-\xi_1|)^{-s} (1+|\xi_1|)^{-s} c_{f,\alpha}(\xi-\xi_1,\tau-\tau_1) c_{f,\alpha}(\xi_1,\tau_1) d\xi_1 d\tau_1 }{ (1+|\tau-\tau_1-\alpha(\xi-\xi_1)^{3}|)^{b}(1+|\tau_1-\alpha\xi_1^{3}|)^{b}} \Big\|_{L^2_{\xi,\tau}} \hskip-0.05in \hskip-0.07in \lesssim \hskip-0.03in \big\|c_{f,\alpha}\big\|_{L^2_{\xi_1,\tau_1}}^2. \end{align} We will show that if $s<-\frac 34$ and bilinear estimate \eqref{counter-1st-estimate} holds, then we must have $b>\frac12$. Let $N\in \mathbb{Z}^+$ and $c_{f,\alpha}$ is defined by $ c_{f,\alpha}(\xi_1,\tau_1) \doteq \chi_{A^+_\alpha}(\xi_1,\tau_1)+\chi_{A^-_\alpha}(\xi_1,\tau_1) \in L^2_{\xi_1,\tau_1}, $ where $\chi_{A^+_\alpha}(\cdot)$ is the characteristic function of the set $A^+_\alpha$ given by $ A^+_\alpha \doteq \big\{ (\xi_1,\tau_1) \in \mathbb{R}^2 : N-N^{-\frac{1}{2}} \le \xi_1 \le N+N^{-\frac{1}{2}}, \,\, |\tau_1-\alpha\xi_1^3| \le 10(1+\alpha)^3 \big\} $ and $ A^-_\alpha = -A^+_\alpha = \big\{ (\xi_1,\tau_1) \in \mathbb{R}^2 : (-\xi_1,-\tau_1)\in A^{+}_\alpha \big\}. $ By a straightforward computation we get $c_{f,\alpha} \in L^2_{\xi_1,\tau_1}$. In fact, we have \begin{align} \label{L2-norm-cf} \|c_{f,\alpha}\|_{L^2}^2 = \int_{A^+_\alpha\cup A^-_\alpha} 1^2 d\xi_1d\tau_1 = 2\int_{A^+_\alpha} 1 d\xi_1d\tau_1 = 2\int_{N-N^{-\frac{1}{2}}}^{N+N^{-\frac{1}{2}}}\int_{\alpha\xi_1^3-10(1+\alpha)^3}^{\alpha\xi_1^3+10(1+\alpha)^3} 1 d\tau_1d\xi_1 \lesssim N^{-\frac{1}{2}}. \end{align} Next, following the arguments in \cite{kpv1996} we restrict $(\xi_1, \tau_1)$ in an appropriate rectangle contained in $A_\alpha^+$, and $(\xi, \tau)$ in a similar rectangle centered at the origin, so that $(\xi-\xi_1,\tau-\tau_1)\in A_\alpha^-$. Then, we bound the left-hand side of \eqref{counter-1st-estimate} by a quantity which is bigger that $N^{-2s-\frac{3}{2}b-5/4}$, thus obtaining the estimate \begin{align} \label{counter-example-bounded-from-below} \hskip-0.15in \Big\| \frac{\xi(1 \hskip-0.03in + \hskip-0.03in |\xi|)^s}{(1 \hskip-0.03in + \hskip-0.03in |\tau-\xi^3|)^{b}} \hskip-0.05in \int_{\mathbb{R}^2} \hskip-0.09in \frac{ (1+|\xi \hskip-0.02in - \hskip-0.02in \xi_1|)^{-s} (1+|\xi_1|)^{-s} c_{f,\alpha}(\xi \hskip-0.02in - \hskip-0.02in \xi_1,\tau \hskip-0.02in - \hskip-0.02in \tau_1) c_{f,\alpha}(\xi_1,\tau_1) d\xi_1 d\tau_1 }{ (1+|\tau-\tau_1-\alpha(\xi-\xi_1)^{3}|)^{b}(1+|\tau_1-\alpha\xi_1^{3}|)^{b}} \Big\|_{L^2_{\xi,\tau}} \hskip-0.12in \gtrsim \hskip-0.03in N^{-2s-\frac{3}{2}b-5/4}. \end{align} Using estimates \eqref{L2-norm-cf} and \eqref{counter-example-bounded-from-below} we see that if the bilinear estimate \eqref{counter-1st-estimate} holds, then we would have $ N^{-2s-\frac{3}{2}b-5/4} \lesssim N^{-\frac{1}{2}}. $ Since $N\gg 1$, we must have $ -2s-\frac{3}{2}b-\frac{5}{4} \le -\frac12 $ or $ b\ge -\frac12-\frac43s. $ So, if $s<-\frac34$, then $ b > \frac12. $ This completes the proof of Lemma \ref{counter-example-b-small}. \,\, $\square$ \section{Derivation of Fokas UTM formula for the Dirichlet Problem } \label{sec:utm-deriv} \setcounter{equation}{0} In this section, we provide an outline of the Fokas method for solving ibvp \eqref{LKdV-v}, which we restate as follows by using a more standard notation % \begin{subequations} \label{L-alpha-KdV} \begin{align} \label{LKdV eqn} &\partial_tu+\alpha\partial_x^3u = f, \quad 0<x<\infty, \,\, 0<t<T, \\ \label{LKdV iv} &u(x,0) = u_0(x), \quad 0<x<\infty, \\ \label{LKdV bc} &u(0,t) = g_0(t), \quad 0<t<T. \end{align} \end{subequations} Utilizing the exponential solutions $\widetilde{u}=e^{-i\xi x-i\alpha\xi^3t}$ ($\xi\in \mathbb{C}$) to the adjoint equation % $ \partial_t \widetilde{u} + \alpha\partial^3_x \widetilde{u} = 0 $ and doing some manipulations we obtain the divergence form \begin{align} \label{divergence form} (e^{-i\xi x-i\alpha\xi^3t}u)_t+\alpha(e^{-i\xi x-i\alpha\xi^3t}[\partial_x^2 u+i\xi\partial_x u-\xi^2 u])_x = e^{-i\xi x-i\alpha\xi^3t}f. \end{align} Integrating the divergence form \eqref{divergence form} from $x=0$ to $\infty$ (assuming vanishing at $\infty$) gives \begin{align} \label{tode} (e^{-i\alpha\xi^3t}\hat u(\xi,t))_t = e^{-i\alpha\xi^3t}\hat f(\xi,t) + \alpha e^{-i\alpha\xi^3t}g(\xi,t), \end{align} where the half-line Fourier transforms $\hat u(\xi,t)$, $\hat f(\xi,t)$ are defined by \eqref{half-line-FT-ic}, and $ g(\xi,t) \doteq \partial_x^2u(0,t)+i\xi\partial_xu(0,t)-\xi^2u(0,t). $ Integrating \eqref{tode} from $0$ to $t$, $0< t< T$, we find the following global relation: \begin{align} \label{global relation} e^{-i\alpha\xi^3t}\hat u(\xi,t) = \hat u_0(\xi)+ \alpha[\widetilde g_2(\xi^3,t)+i\xi\widetilde g_1(\xi^3,t) -\xi^2\widetilde g_0(\xi^3,t)] + F(\xi,t), \quad {\rm Im}\xi\leq 0, \end{align} where $F$ is given by \eqref{time-trans-F2} and $ \widetilde g_j(\xi,t) \doteq \int_0^te^{-i\alpha\xi\tau}\partial_x^j u(0,\tau)d\tau. $ Inverting equation \eqref{global relation} we find the following integral representation for the solution to the forced ibvp \eqref{L-alpha-KdV} \begin{align} \label{sln-repr} u(x,t) = \frac{1}{2\pi}\int_{-\infty}^\infty e^{i\xi x+i\alpha\xi^3t} [\hat u_0(\xi)+F(\xi,t)]d\xi + \frac{\alpha}{2\pi}\int_{-\infty}^\infty e^{i\xi x+i\alpha\xi^3t} \widetilde{g}(\xi^3,t)d\xi, \end{align} where $ \widetilde{g} \doteq \widetilde g_2(\xi^3,t)+i\xi\widetilde g_1(\xi^3,t) -\xi^2\widetilde g_0(\xi^3,t). $ Next, we notice that the integral representation \eqref{sln-repr} includes the time transforms $\widetilde g_1$ and $\widetilde g_2$ of the unknown data $\partial_xu(0,t)$ and $\partial_x^2u(0,t)$, which we can not remove if the $\xi$-integral is over the real line. So, following Fokas method (see \cite{f1997}), we use the analyticity of the half-line Fourier transform to deform the $\xi$-integration from the real line to $\partial D^+$, where $D^+$ is the domain shown in Figure \ref{kdv-domain}. Then, the integral representation \eqref{sln-repr} becomes % \begin{align} \label{sln-defrom} u(x,t) = \frac{1}{2\pi}\int_{-\infty}^\infty e^{i\xi x+i\alpha\xi^3t} [\hat u_0(\xi)+F(\xi,t)]d\xi + \frac{\alpha}{2\pi}\int_{\partial D^+} e^{i\xi x+i\alpha\xi^3t} \widetilde g(\xi^3,t)d\xi. \end{align} Now, we are able to remove the unknown data. In fact, using the symmetry transformation $\xi \mapsto \sigma \xi$ and $\xi \mapsto \sigma^2 \xi$, where $\sigma=e^{\frac{2\pi}{3}i}$, from the global relation \eqref{global relation} we get \begin{align} \label{glo-1} e^{-i\alpha\xi^3t}\hat u(\sigma \xi,t) = \hat u_0(\sigma\xi)+F(\sigma\xi,t) &+ \alpha [\widetilde g_2(\xi^3,t)+i\sigma\xi\widetilde g_1(\xi^3,t) -\sigma^2\xi^2\widetilde g_0(\xi^3,t)], \quad {\rm Im}(\sigma\xi)\leq 0, \\ \label{glo-2} e^{-i\alpha\xi^3t}\hat u(\sigma^2 \xi,t) = \hat u_0(\sigma^2 \xi)+F(\sigma^2 \xi,t) &+ \alpha [\widetilde g_2(\xi^3,t)+i\sigma^2 \xi\widetilde g_1(\xi^3,t) -\sigma\xi^2\widetilde g_0(\xi^3,t)], \quad {\rm Im}(\sigma^2\xi)\leq 0. \end{align} Since $1+\sigma+\sigma^2=0$, multiplying equation \eqref{glo-1} by $\sigma$, equation \eqref{glo-2} by $\sigma^2$, and adding them to the equation $\alpha\widetilde g(\xi^3,t) = \alpha[\widetilde g_2(\xi^3,t)+i\xi\widetilde g_1(\xi^3,t) -\xi^2\widetilde g_0(\xi^3,t)]$ we get the relation \begin{align} \label{global-solv} \alpha \widetilde g(\xi^3,t) &= \sigma[\hat u_0(\sigma\xi)+F(\sigma\xi,t)]+\sigma^2[\hat u_0(\sigma^2 \xi)+F(\sigma^2 \xi,t)]-3 \alpha \xi^2\widetilde g_0(\xi^3,t) \nonumber \\ &- \sigma e^{-i\alpha\xi^3t}\hat u(\sigma\xi,t) -\sigma^2e^{-i\alpha\xi^3t}\hat u(\sigma^2 \xi,t), \qquad \xi\in \partial D^+. \end{align} Substituting relation \eqref{global-solv} into the integral representation \eqref{sln-defrom} and using the Cauchy Theorem, we remove the last two terms and obtain the first version of the UTM solution formula for ibvp \eqref{L-alpha-KdV} \begin{align} \label{kdv-utm-der} & u(x,t) = S_{\alpha}\big[u_0,g_0;f\big](x, t) \doteq \frac{1}{2\pi}\int_{-\infty}^\infty e^{i\xi x+ i\alpha\xi^3t } [\widehat {u}_0(\xi)+F(\xi,t)]d\xi \\ +& \frac{1}{2\pi}\int_{\partial D^+} e^{i\xi x+ i\alpha\xi^3t } \big\{ \sigma[\widehat u_0(\sigma \xi) + F(\sigma \xi,t)]+\sigma^2[\widehat u_0(\sigma^2 \xi)+F(\sigma^2 \xi,t)] - 3 \alpha \xi^2 \tilde g_0(\xi^3,t) \big\}d\xi. \nonumber \end{align} Finally, using the Cauchy Theorem, again, we replace in formula \eqref{kdv-utm-der} the term $ \int_{\partial D^+} e^{i\xi x+i\alpha \xi^3t}\xi^2 \widetilde g_0(\xi^3,t)d\xi $ by $ \int_{\partial D^+} e^{i\xi x+i\alpha\xi^3t} $ $ \xi^2 \widetilde g_0(\xi^3,T)d\xi, $ and get the desired UTM solution formula \eqref{kdv-utm-v}, after going back to the original ibvp notation. \,\, $\square$ \vskip0.15in \noindent {\bf Acknowledgements.} The first author was partially supported by a grant from the Simons Foundation (\#524469 to Alex Himonas). \vskip0.15in \noindent \noindent {\bf Disclosure statement} \noindent The authors declare that they have no conflict of interest. \vskip0.15in \noindent \noindent {\bf Funding} \noindent Himonas was partially supported by Simons Foundation grant \#524469.
\section{INTRODUCTION} According to the laws of reflection in geometric optics, one knows that the incident point is always the same as the point where the light beam is reflected back at a sharp interface. However, due to the wave nature of photons, these law should be revised in certain cases and a light beam can experience an anomalous spatial shift under reflection, namely, there exists a shift between the incident and the reflected beams at the interface~\cite{Bliokh_2013}. Generally, the spatial shift is divided into longitudinal and transverse components with respect to the incident plane, known as the Goos-H\"{a}nchen shift~\cite{Goos1947,Renard1964} and Imbert-Fedorov shift~\cite{IF1955,IF1972,Onoda2004}, respectively. Since the wave-particle duality is a foundational concept in physics and holds for all particles, the anomalous spatial shift can also be found in many other particles, such as electrons~\cite{Miller1972,Beenakker2009,Chen2013,Wu2011,Yu2019}, atoms~\cite{JH2008} and neutrons~\cite{Haan2010}. In electronic systems, the valence and conduction bands can cross around Fermi level, leading to non-trivial band degeneracy~\cite{Chiu2016,Armitage2018,Wan2011,yu2016,Weng2015,Wu2018,Soluyanov2015,Lix2021,2Lix2021}. The band degeneracies in three-dimensional (3D) topological semimetals have many different types, and can be classified as 0D nodal point, 1D nodal line and 2D nodal surface~\cite{yu2022,Guibin2022,Zeying2022}. Remarkably, in the interface constructed by topological semimetals and other systems, both longitudinal and transverse shift effects are generally significant, due to strong (pseudo-)spin-orbit coupling in topological semimetals~\cite{Beenakker2009,Jiang2015,Yang2015,Yao2019,Feng2020}. Such significant anomalous spatial shift can lead to various physical consequences, such as chirality-dependent Hall effect~\cite{Yang2015} and modifying the dispersion of the confined waveguide modes~\cite{Beenakker2009}. Moreover, the behavior of the longitudinal and transverse shifts in these systems has a strong dependence on the species of the band degeneracies~\cite{Jiang2015,Yang2015,Yao2019,Feng2020}. For example, when a beam comes from normal metal onto the interface with topological Weyl semimetals, there will exist quantum vortices in the vector field of the spatial shift in the interface momentum space, and the number of the quantum vortices is determined by the topological charge of the Weyl points~\cite{Yliu2020}. The anomalous shifts can also be realized in Andreev reflection, during which the incident particle changes its identity from electron to hole~\cite{Yliu2017,1Yliu2018,Yu2018,2Yliu2018}. Similarly, the shifts strongly depend on the pair potential of the superconductors, which in turn can be used to probe the superconducting states. Currently, the standard and the most general approach used to study the anomalous shifts in electronic systems is the quantum scattering approach under linear approximation~\cite{Yu2019}. In this approach, the incident beam is modeled by wave packet $\Psi$, which is constructed by the incident basis states $\psi^{i}(\boldsymbol{k})$ and is confined in both real and momentum spaces ($\boldsymbol{r}^{c}, \boldsymbol{k}^{c}$). During scattering, the wave packet would be reconstructed, as each incident basis state $\psi^{i}(\boldsymbol{k})$ is scattered into reflected basis state $\psi^{r}(\boldsymbol{k})$ with certain reflection amplitude. The anomalous shifts then are obtained by comparing the center position of the incident and reflected beams. In practice, one generally chooses the wave-packet profile to have a Gaussian form, and in such case, the anomalous shifts can be analytically obtained by expanding the phases of the relevant scattering basis states [$\psi^{i}(\boldsymbol{k})$ and $\psi^{r}(\boldsymbol{k})$] and reflection amplitudes to the linear order around $\boldsymbol{k}^{c}$. The linear approximation is valid for most cases and gives accurate analytical results, which are helpful for gaining insight into the physics of the shifts. However, for a class of normal cases, the linear approximation leads to a divergence of the anomalous shifts in reflection at certain incident angles, even when the corresponding reflection possibility is finite~\cite{Beenakker2009,Jiang2015,Yu2018}. Then two important questions arise: \emph{Under what conditions, does the linear approximation not apply? And how to resolve the divergence of the shifts?} In this work, we show that the divergence of the shifts in linear approximation are closely related to an abrupt change of the number of propagating states. In scattering, while the number of the scattering states is fixed, the number of the propagating states is not, and may abruptly changes when some critical parameters like incident angle or Fermi energy change. This abrupt change would lead to a singularity in reflection amplitude or its derivative, which in the framework of linear approximation inevitably results in divergent anomalous shifts. We show this divergence can be resolved by calculating the centre position of the incident and reflected beams beyond the linear approximation. We explicitly demonstrate our idea by calculating the longitudinal (Goos-H\"{a}nchen) and transverse (Imbert-Fedorov) shifts on two representative models. Our work will be beneficial for clarifying the scope of application of the linear approximation in the study of anomalous spatial shifts. \section{Quantum scattering approach} \label{SecII} Consider a general model which contains two media respectively described by Hamiltonian $H_1$ and $H_2$, and a flat interface between these two media, as illustrated in Fig.~\ref{fig1}(a). We also assume that the junction model is extended along $y$ and $z$ directions, indicating that $k_y$ and $k_z$ are conserved quantities during scattering. A beam of particles is incoming from the region of $x<0$ ($H_1$) and is scattered at the interface residing at $x=0$ plane. Besides, there is a rotation angle $\alpha$ between the incident plane and the $y$ axis, as shown in Fig.~\ref{fig1}(b). To define the anomalous spatial shift, the incident beam should be modeled by a wave packet, which is required to be confined in both real and momentum spaces. We choose the wave-packet profile to have a Gaussian form. Then, an incident wave packet centred at $\boldsymbol{k}^c=(k_y^c,k_z^c)$ can be written as \cite{Beenakker2009,Yu2019} \begin{equation}\label{i beam} \Psi^{i}(\boldsymbol{r},\boldsymbol{k}^c)=\int w\left(\boldsymbol{k}-\boldsymbol{k}^c\right) \psi^{i}(\boldsymbol{k}) d \boldsymbol{k}, \end{equation} where $\psi^{i}(\boldsymbol{k})=e^{i\boldsymbol{k} \cdot \boldsymbol{r}}|u^i(\boldsymbol{k})\rangle$ is the Bloch eigenstate of the incident medium and $|u^i(\boldsymbol{k})\rangle$ is the cell-periodic part of the eigenstate. The wave-packet profile $w$ reads \begin{equation} w(\boldsymbol{k})=\prod \limits_{i=y,z}\left(\sqrt{2 \pi} W_{i}\right)^{-1} e^{-k_{i}^{2} /\left(2 W_{i}^{2}\right)}, \end{equation} where $W_{i}$ denotes the Gaussian width for the $i$-th component, controlling the beam width in momentum space. The centre position of the incident beam can be written as~\cite{Luo2011,Ling2021} \begin{eqnarray} \boldsymbol{r}_{i}^{c}(\boldsymbol{k}^{c})=\frac{\int\boldsymbol{r}|\Psi^{i}(\boldsymbol{r},\boldsymbol{k}^{c})|^{2}d\boldsymbol{r}}{\int|\Psi^{i}(\boldsymbol{r},\boldsymbol{k}^{c})|^{2}d\boldsymbol{r}}. \end{eqnarray} \begin{figure}[t] \includegraphics[width=8.7cm]{fig1.pdf} \caption{(a) Schematic figure showing the anomalous spatial shift $\boldsymbol{\ell}$ in interface scattering. (b) Top view of the $y$-$z$ plane in (a). \label{fig1}} \end{figure} When the incident beam hits the interface, each partial wave $\psi^{i}(\boldsymbol{k})$ is scattered into reflected basis state $\psi^{r}(\boldsymbol{k})$ with certain $\boldsymbol{k}$-dependent reflection amplitude $A_r(\boldsymbol{k})$. The reflection amplitude here is obtained by the standard quantum scattering approach. Then, the reflected beam also is a wave packet and can be expressed as \begin{equation}\label{i beam} \Psi^{r}(\boldsymbol{r},\boldsymbol{k}^c)=\int w\left(\boldsymbol{k}-\boldsymbol{k}^c\right) A_r(\boldsymbol{k}) \psi^{r}(\boldsymbol{k}) d \boldsymbol{k}, \end{equation} and its centre position is \begin{eqnarray} \boldsymbol{r}_{r}^{c}(\boldsymbol{k}^{c})=\frac{\int\boldsymbol{r}|\Psi^{r}(\boldsymbol{r},\boldsymbol{k}^{c})|^{2}d\boldsymbol{r}}{\int|\Psi^{r}(\boldsymbol{r},\boldsymbol{k}^{c})|^{2}d\boldsymbol{r}}. \end{eqnarray} By comparing the centre position of incident and reflected beam, the anomalous shift in reflection is obtained as \begin{eqnarray} \label{exact_1} \boldsymbol{\ell}(\boldsymbol{k}^{c})=\boldsymbol{r}_{r}^{c}(\boldsymbol{k}^{c})-\boldsymbol{r}_{i}^{c}(\boldsymbol{k}^{c}), \end{eqnarray} which is a vector and forms a vector field in the interface momentum space. However, it should be noticed that based on Eq.~(\ref{exact_1}), while one always can numerically obtain $\boldsymbol{\ell}(\boldsymbol{k}^{c})$, it is impossible to obtain an analytical expression for $\boldsymbol{\ell}(\boldsymbol{k}^{c})$, which prevents a deep understanding of the physics underlying the shifts. To resolve this problem, one has to resort to linear approximation, as it can give an analytical expression of $\boldsymbol{\ell}(\boldsymbol{k}^{c})$ in many cases. The Bloch eigenstate of the incident medium may include multiple ($N$) components, i.e. $|u^{i(r)}(\boldsymbol{k})\rangle=(u^{i(r)}_1,\cdots u^i_N)^T$, then the wave packets $\Psi^{i(r)}$ should also have $N$ components. The $n$-th component of $\Psi^{i}$ and $\Psi^{r}$ are respectively expressed as \begin{eqnarray}\label{int_Psi} \Psi^{i}_{n}(\boldsymbol{r},\boldsymbol{k}^c)&=&\int w\left(\boldsymbol{k}-\boldsymbol{k}^c\right) e^{i\boldsymbol{k} \cdot \boldsymbol{r}} |u^i_n(\boldsymbol{k})| e^{i \phi^{i}_n(\boldsymbol{k})} d \boldsymbol{k}, \end{eqnarray} and \begin{eqnarray}\label{ref_Psi} \Psi^{r}_{n}(\boldsymbol{r},\boldsymbol{k}^c)&=&\int w\left(\boldsymbol{k}-\boldsymbol{k}^c\right) |A_r| e^{i \varphi(\boldsymbol{k})} e^{i\boldsymbol{k} \cdot \boldsymbol{r}} |u^r_n(\boldsymbol{k})| e^{i \phi^{r}_n(\boldsymbol{k})} d \boldsymbol{k}, \nonumber \\ \end{eqnarray} with $\phi^{i(r)}_n(\boldsymbol{k})=\arg [u^{i(r)}_n(\boldsymbol{k})]$ and $\varphi(\boldsymbol{k})=\arg [A_r(\boldsymbol{k})]$. In the framework of linear approximation, the two phases $\phi^{i(r)}_n(\boldsymbol{k})$ and $\varphi(\boldsymbol{k})$ in Eq. (\ref{int_Psi}) and Eq. (\ref{ref_Psi}) are replaced by the first order Taylor series expanded around $\boldsymbol{k}^c$, \begin{eqnarray}\label{phase1} \phi^{i(r)}_n(\boldsymbol{k})&=&\phi^{i(r)}_n(\boldsymbol{k}^c)+(\boldsymbol{k}-\boldsymbol{k}^c)\cdot \partial_{\boldsymbol{k}}\phi^{i(r)}_n|_{\boldsymbol{k}=\boldsymbol{k}^c}, \\ \varphi(\boldsymbol{k})&=&\varphi(\boldsymbol{k}^c)+(\boldsymbol{k}-\boldsymbol{k}^c)\cdot \partial_{\boldsymbol{k}}\varphi|_{\boldsymbol{k}=\boldsymbol{k}^c}. \end{eqnarray} With the linear approximation, one can find that Eqs.~(\ref{int_Psi}) and~(\ref{ref_Psi}) will take the following forms \begin{eqnarray} \Psi^{i}_{n}(\boldsymbol{r},\boldsymbol{k}^c)& \propto& e^{-\sigma_y^2 (y+\partial_{k_y}\phi^{i}_n|_{\boldsymbol{k}=\boldsymbol{k}^c})^2 /2} \nonumber \\ &&\times e^{-\sigma_z^2 (z+\partial_{k_z}\phi^{i}_n|_{\boldsymbol{k}=\boldsymbol{k}^c})^2/2},\\ \Psi^{r}_{n}(\boldsymbol{r},\boldsymbol{k}^c)& \propto& e^{-\sigma_y^2 (y+\partial_{k_y}(\phi^{r}_n+\varphi)|_{\boldsymbol{k}=\boldsymbol{k}^c})^2 /2} \nonumber \\ &&\times e^{-\sigma_z^2 (z+\partial_{k_z}(\phi^{r}_n+\varphi)|_{\boldsymbol{k}=\boldsymbol{k}^c})^2 /2}, \end{eqnarray} indicating that $\Psi^{i}_{n}$ and $\Psi^{r}_{n}$ are centred at $-\partial_{\boldsymbol{k}}\phi^{i}_n|_{\boldsymbol{k}=\boldsymbol{k}^c}$ and $-\partial_{\boldsymbol{k}}(\phi^{r}_n+\varphi)|_{\boldsymbol{k}=\boldsymbol{k}^c}$, respectively. The centre position of incident and reflected beams are the average of all components, written as \begin{eqnarray} \boldsymbol{r}^{c}_i& =& -\sum_{n} w_n^{i} \partial_{\boldsymbol{k}}\phi^{i}_n|_{\boldsymbol{k}=\boldsymbol{k}^c}\\ \boldsymbol{r}^{c}_r& =& -\sum_{n} w_n^{r} \partial_{\boldsymbol{k}}(\phi^{r}_n+\varphi)|_{\boldsymbol{k}=\boldsymbol{k}^c}, \end{eqnarray} with $w_n^{i(r)}$ the weight of the $n$-th component of $|u^{i(r)}\rangle$, satisfying $\sum_n (w_n^{i(r)})^2=1$. Hence, the anomalous shift from linear approximation can be analytically expressed as the difference between the two centre positions, \begin{eqnarray} \label{ellLA} \boldsymbol{\ell}^{LA}& =& \sum_{n} [w_n^{i} \partial_{\boldsymbol{k}}\phi^{i}_n|_{\boldsymbol{k}=\boldsymbol{k}^c}-w_n^{r} \partial_{\boldsymbol{k}}(\phi^{r}_n+\varphi)|_{\boldsymbol{k}=\boldsymbol{k}^c}]. \end{eqnarray} By analyzing the above derivation, we find that there two prerequisites for application of the linear approximation. (1) After scattering, the reflected beams should be still centred at $\boldsymbol{k}^{c}$ in momentum space. (2) The reflection amplitude $A_r(\boldsymbol{k})$ should be an analytic function in the neighbourhood of $\boldsymbol{k}^{c}$, as it is a prerequisite for the Taylor expansion of $\arg [A_r(\boldsymbol{k})]$. These two conditions can be satisfied for most cases. Generally, condition (1) is always satisfied except that the reflection probability is vanishing at $\boldsymbol{k}=\boldsymbol{k}^{c}$. But, in such case, the anomalous shift would be irrelevant for physical observations, as no particle is reflected back and then the anomalous shift will not happen. In contrast, we show that the condition (2) does not hold at certain incident angles and model parameters, beyond which the number of the scattered propagating states changes. This abrupt change generally leads to divergent shifts [obtained from linear approximation (\ref{ellLA})] at the critical parameters, which apparently are not correct. Hence, to obtain correct results, we have to calculate the anomalous shifts via Eq.~ (\ref{exact_1}). We find that at the critical parameters, the anomalous shifts obtained from Eq.~(\ref{exact_1}) are completely different from that obtained from linear approximation ~(\ref{ellLA}), and are not divergent. Away from the critical parameters, the anomalous shifts obtained from both approaches are almost the same. Besides, the anomalous shifts around (away from) the critical parameters have a strong (negligible) dependence on the beam width $W$. In the following, we use two representative examples to demonstrate our ideas. \section{Longitudinal shift in graphene model} \label{SecIII} In the first case, we consider a graphene junction model. This model is simple and features a divergent longitudinal spatial shift with finite reflection probability~\cite{Beenakker2009}. However, the origin of the divergence has not been discussed. Here, we will show the divergence is caused by an abrupt change of scattering environment. According to the setup in Fig.~\ref{fig1}, we assume the junction model is lied on the $x$-$y$ plane. Notice that the $z$-direction here is a dummy degree of freedom, as graphene is a 2D system and the longitudinal shift is within the scattering plane. The Hamiltonian of the junction model is given as \begin{equation}\label{Model1} \mathcal{H}= \begin{cases} v k_x\sigma_x +v k_y\sigma_y, & x < 0, \\ v k_x\sigma_x +v k_y\sigma_y+V, & x>0,\end{cases} \end{equation} where $v$ is the fermi velocity, $\mathbf{\sigma}$ is the Pauli matrix and $V$ denotes a potential energy applied on the $x>0$ region. We plot the band structure of the graphene model in both $x<0$ and $x>0$ regions in Fig.~\ref{fig2}(a) and the corresponding equienergy contours in Fig.~\ref{fig2}(b). The possible incident and reflected electron states are also marked in Fig. \ref{fig2}(a). One can find that for a fixed Fermi energy $E_F>0$ (measured from the Dirac point) and a finite $V$ satisfying $0<V<2E_F$, there exists two critical incident angle $\pm \theta_c$, beyond which there is no propagating mode for transmitted state [see Fig.~\ref{fig2}(b)]. The critical angle is given as \begin{equation} \theta_c=\arcsin \left|\frac{V-E_F}{E_F}\right|. \end{equation} When the incident angle $\theta=\arctan (k_y/k_x)$ is smaller than the critical angle $|\theta|<\theta_c$, an incident electron from $x<0$ region can be reflected (transmitted) as a propagating state in $x<0$ ($x>0$) region. However, the number of transmitted propagating states varies from one to zero when $|\theta|>\theta_c$, indicating an abrupt change of scattering environment. As discussed in Ref.~{\cite{Ma2018}}, this change generally results in a discontinuity in the derivative of the reflection amplitude. As a consequence, the Taylor expansion of the phase of the reflection amplitude around the critical incident angles $\pm\theta_c$ will be meaningless, making the anomalous spatial shifts obtained by linear approximation inaccurate. \begin{figure}[t] \includegraphics[width=8.7cm]{fig2.pdf} \caption{(a) The band structure of incident medium ($x<0$) and transmitted medium ($x>0$) in model (\ref{Model1}). The spheres denotes the incident, reflected and transmitted electron state, and the arrows indicate their moving directions. (b) The Fermi surfaces of both $x<0$ (blue circle) and $x>0$ (red circle) medium with the label of the critical angel $\theta_c$. (c) $|A_r|^2$ and its derivative and (d) the phase $\varphi=\arg (A_r)$ and its derivative vs incident angle $\theta$. In the calculation, we choose $E_F=100\ \rm{meV}$, $V=150\ \rm{meV}$ and $v=10^6\ \rm{m/s}$. \label{fig2}} \end{figure} To directly show this, we proceed to solve the scattering states of the graphene junction model (\ref{Model1}), which can be written as \begin{equation} \psi(\boldsymbol{k})= \begin{cases} \psi^{i}(\boldsymbol{k})+A_r \psi^{r}(\boldsymbol{k}), & x < 0, \\ A_t \psi^{t}(\boldsymbol{k}), & x>0,\end{cases} \end{equation} where $A_{r(t)}$ is the reflection (transmission) amplitude, and $\psi^{i}$, $\psi^{r}$ and $\psi^{t}$ are the basis state for incident, reflected and transmitted states, respectively. Explicitly, the basis states read \begin{eqnarray} \psi^{i}(\boldsymbol{k})&=&\frac{1}{\sqrt{2}}\left(\begin{array}{c} e^{-i \theta / 2} \\ e^{i \theta / 2} \end{array}\right) e^{i k_{i} x+i k_{y} y}, \\ \psi^{r}(\boldsymbol{k})&=&\frac{1}{\sqrt{2}}\left(\begin{array}{c} -ie^{i \theta / 2} \\ i e^{-i \theta / 2} \end{array}\right) e^{-i k_{i} x+i k_{y} y},\\ \psi^{t}(\boldsymbol{k})&=&\frac{1}{\sqrt{2}|E_F-V|}\left(\begin{array}{c} E_F-V \\ v (k_t+ i k_y) \end{array}\right) e^{i k_{t} x+i k_{y} y}. \end{eqnarray} Here $k_i=v^{-1}\sqrt{E_F-v^2 k_y^2}$, $\theta=\arctan{(k_y/k_i)}$ is the incident angle, $k_t=v^{-1}\text{sgn}(E_F-V)\sqrt{(E_F-V)^2-v^2 k_y^2}$ for $|\theta|<\theta_c$ and $k_t=i\kappa$ for $|\theta|>\theta_c$, where $\kappa=v^{-1}\sqrt{v^2 k_y^2-(E_F-V)^2}$. For the graphene junction model here, the boundary condition at the interface is \begin{equation} \psi(x=0^-)=\psi(x=0^+), \end{equation} with which the reflection amplitude $A_r$ is obtained as \begin{equation} A_r=\frac{v(\kappa+k_y)+ i e^{i\theta }(E_F-V)}{v e^{i\theta }(i \kappa+i k_y)+(E_F-V)}, \end{equation} The square of the module of $A_r$ ($|A_r|^2$) and the phase $\varphi=\arg (A_r)$ as functions of the incident angle are plotted in Fig.~\ref{fig2}(c) and Fig.~\ref{fig2}(d), respectively. One observes that for $|\theta|<\theta_c$, $A_r$ is a finite real number with $\varphi=0$, and for $|\theta|>\theta_c$, $A_r$ becomes a complex number with $|A_r|^2=1$, indicating the appearance of total reflection. This is consistent with the fact that when $|\theta|>\theta_c$, there no longer exists a propagating mode for transmitted state. Importantly, while both $|A_r|^2$ and $\varphi$ are continuous functions, their derivative are discontinuous at the critical angle $\pm\theta_c$ [see Fig.~\ref{fig2}(c) and (d)], corresponding to an abrupt change of the scattering condition, namely, the disappearance of the transmitted propagating mode for $|\theta|>\theta_c$. Based on the expression of $A_r$, the longitudinal shift under linear approximation is obtained as \begin{equation} \label{LAy_G} \ell_y^{LA}=2\frac{\sin ^2 \theta+1-V / E_F}{\kappa \sin 2\theta }. \end{equation} As discussed above, the accuracy of the anomalous shift obtained from linear approximation requires $A_r$ to be an analytic function. But $A_r$ is not an analytic function in the neighbourhood of $\theta=\pm\theta_c$. Hence, Eq. (\ref{LAy_G}) may be inaccurate around $\pm \theta_c$. \begin{figure}[t] \includegraphics[width=8.7cm]{fig3.pdf} \caption{The anomalous longitudinal shift in model (\ref{Model1}). (a) The results obtained with linear approximation $\ell_y^{LA}$ (dashed line) and that obtained without approximation $\ell_y$ (solid line) vs incident angle. (b) $\ell_y$ vs $\theta$ for different beam width $W$. The box in (a) denotes the range of $\theta$ in (b). In the calculation, we choose $E_F=100\ \rm{meV}$, $V=150\ \rm{meV}$, $v=10^6\ \rm{m/s}$. \label{fig3}} \end{figure} In Fig.~\ref{fig3}(a), we plot the typical behavior of the longitudinal shift $\ell_y^{LA}$ from Eq.~(\ref{LAy_G}), along with the shift $\ell_y$ obtained from Eq.~(\ref{exact_1}) beyond linear approximation. We have checked that the wave packet of the reflected beam still features a Gaussian-type profile and is centred at same momentum with the incident wave packet. Hence, the shift obtained from Eq.~(\ref{exact_1}) should be accurate. From Fig. \ref{fig3}(a), one observes that the $\ell_y^{LA}$ has two discontinuity points at $\pm \theta_c$. Specifically, it is zero for $|\theta|<\theta_c$, diverges abruptly at $\pm \theta_c$ and becomes finite when moving away from $\pm \theta_c$. In contrast, $\ell_y$ obtained from Eq.~(\ref{exact_1}) is always continuous for any incident angle. Particularly, it is not divergent at $\pm \theta_c$, indicating the non-physical divergent results from linear approximation is resolved by using Eq.~(\ref{exact_1}) to calculate the anomalous shift. Besides, there are several other observations. (i) At critical angle $\pm \theta_c$, while $\ell_y$ is not divergent, it still is very large and can reach few tens of nanometer with reasonable parameters. (ii) Away from $\pm \theta_c$, $\ell_y^{LA}$ and $\ell_y$ share similar behavior and are almost identical, as shown in Fig.~\ref{fig3}(a). The anomalous shifts~(\ref{LAy_G}) obtained from linear approximation are always independent of the beam width ($\sim W=|\bm{W}|$). However, in optics, it has been demonstrated that the anomalous shifts around the critical parameters strongly depend on the beam width \cite{Lai1986,Wang2013,Qiu2015}. Here, we also calculate the longitudinal shift $\ell_y$ from Eq.~(\ref{exact_1}) for different $W$. The obtained results are shown in Fig.~\ref{fig3}(b), from which one can find that the maximum value of $\ell_y$ indeed varies with $W_y$, consistent with the results in optics. Again, when moving away from $\pm \theta_c$, $\ell_y$ is not sensitive to the value of $W$. \section{Transverse shift in Andreev reflection} In the second case, we consider transverse shift in Andreev reflection~\cite{Yliu2017,Yu2018}. In electronic systems, besides ordinary electron scattering, Andreev reflection is another intriguing scattering process that occurs at the interface between metal and superconductor and is described by the Bogoliubov-de Gennes (BdG) equation. The junction model here is of a 3D electron gas interfaced with a $d$-wave superconductor. The corresponding BdG equation can be written as \begin{equation}\label{AFHam} H(x)\psi=\varepsilon \psi, \end{equation} with $\varepsilon$ the excitation energy \begin{equation} H=\left[\begin{array}{cc} -\frac{1}{2 m} \nabla^{2}-E_{F} & 0 \\ 0 & -\mathcal{T} (-\frac{1}{2 m} \nabla^{2}) \mathcal{T}^{-1}+E_{F} \end{array}\right], \end{equation} for normal metal region ($x<0$), and \begin{equation} H=\left[\begin{array}{cc} H_{0}+V-E_{F} & \Delta(k_{\|}) \\ \Delta^{*}(k_{\|}) & -\mathcal{T} H_{0} \mathcal{T}^{-1}-V+E_{F} \end{array}\right], \end{equation} for the superconductor region ($x>0$). Besides, the interface barrier potential $h \delta(x)$ is considered. Here, $m$ denotes the electron mass, $E_F$ is the Fermi energy, $\mathcal{T}$ is the time reversal operator, $H_{0}=-\frac{1}{2 m} \left(\partial_{z}^{2}+\partial_{y}^{2}\right)-\frac{1}{2 m_{x}} \partial_{x}^{2}$, $\Delta(k_y,k_z)=\Delta_0 \cos(2 \phi_k)$ represents a $d_{y^2-z^2}$ pairing with $\phi_k=\arctan(k_y/k_z)$, and $V$ is a potential energy ensuring $E_F-V\gg \Delta_0$. According to the setup in Fig.~\ref{fig1}, the rotation angle is identical to $\phi_k$, namely, $\alpha=\phi_k$. This model has been used to show that transverse shift can be solely induced by the unconventional pairing, and it is found that by varying rotation angle $\alpha$ [see Fig.~ \ref{fig1}(b)], the transverse shift becomes divergent at certain critical angles. Here, we will show that the divergence is also caused by the change in the number of transmitted propagating states at the critical angles. \begin{figure}[t] \includegraphics[width=8.7cm]{fig4.pdf} \caption{Band structure of the BdG Hamiltonian in model (\ref{AFHam}). (a), (b) show the BdG spectrum in different incident planes. (c) denotes the band gap $E_g$ of the BdG spectrum. (d) The BdG Fermi surfaces with different excitation energy. In the calculation, we choose $\varepsilon=10\ \rm{meV}$, $\Delta_0=20\ \rm{meV}$, $E_F=0.4\ \rm{eV}$, $V=0.2\ \rm{eV}$, $h=0.3\ \rm{eV}\cdot\rm{nm}$ and the incident angle $\theta=\pi/12$. We take the $\varepsilon_1=10\ \rm{meV}$, $\varepsilon_2=25\ \rm{meV}$ in (c), (d). \label{fig4}} \end{figure} The scattering states of Eq.~(\ref{AFHam}) can be written as~\cite{Yu2018} \begin{equation} \psi(\boldsymbol{k})= \begin{cases} \psi^{i}(\boldsymbol{k})+r_e \psi^{r}_e(\boldsymbol{k})+r_h \psi^{r}_h(\boldsymbol{k}), & x < 0, \\ t_1 \psi_1^{t}(\boldsymbol{k})+t_2 \psi_2^{t}(\boldsymbol{k}), & x>0,\end{cases} \end{equation} where $r_{e(h)}$ is the amplitude for the normal (Andreev) reflection, and $t_{1(2)}$ is the transmission amplitude, and the $\psi$ are the corresponding basis states, expressed as \begin{eqnarray} \psi^{r}_e(\boldsymbol{k})&=&\left(\begin{array}{l} 1 \\ 0 \end{array}\right)e^{-i k_x^e x+i k_y y+i k_z z}, \\ \psi^{r}_h(\boldsymbol{k})&=& \left(\begin{array}{l} 0 \\ 1 \end{array}\right)e^{i k_x^h x+i k_y y+i k_z z}, \\ \psi_{\pm}^{t}(\boldsymbol{k})&=& \left(\begin{array}{c} 1 \\ \eta_{\pm} \end{array}\right)e^{i k_S^{\pm} x+i k_y y+i k_z z}, \end{eqnarray} where $\eta_{\pm}=\frac{\Delta_{\boldsymbol{k}_{\pm}}}{\varepsilon\pm\sqrt{\varepsilon^{2}-\Delta_{k_{S}^{\pm}}^{2}}}$ with $\Delta_{\boldsymbol{k}_{\pm}}=\boldsymbol{\Delta}\left(k_{\pm}^{\mathrm{S}}, k_y, k_z\right)$, $k_\|=\sqrt{k_y^2+k_z^2}$, $k_x^{e / h}=\sqrt{2 m E_{F}-k^2_\|}$, and $k_{S}^{\pm}=\pm\sqrt{2m_x(E_f-U- k^2_\|/2 m)}$. Before processing to the concrete calculations of the scattering amplitudes and the anomalous shifts, we discuss the influences of rotation angle and the value of excitation energy on the scattering in the interface. Since the $d$-wave superconductor is anisotropic in $k_y$-$k_z$ plane, the band structure of the superconductor in different incident planes (determined by the rotation angle $\alpha$) will be different, as shown in Fig.~\ref{fig4}(a) and~\ref{fig4}(b), indicating the transverse shift is sensitive to the rotation angle $\alpha$ and $\phi_k$. We also plot the band gap $E_{\text{gap}}=|\Delta_{\boldsymbol{k}}|$ of the superconductor as a function of $\phi_k$ in Fig.~\ref{fig4}(c), showing the superconductor becomes gapless at $\phi_k=\pm \pi/4, \ \pm 3\pi/4$. Then, a key observation is that for any excitation energy satisfying $|\varepsilon|<\Delta_0$, the two transmitted states ($\psi_{1}^{t}$ and $\psi_{2}^{t}$) are propagating modes for $|\cos 2\phi|<\varepsilon/\Delta_0$ ($|\varepsilon|>E_{\text{gap}}$) and are evanescent modes for $|\cos 2\phi|>\varepsilon/\Delta_0$ ($|\varepsilon|<E_{\text{gap}}$), as illustrated in Fig. \ref{fig4}(c). In contrast, the two transmitted states are always propagating modes when $|\varepsilon|>\Delta_0$, as $|\varepsilon|>E_{\text{gap}}$ for any $\phi_k$ [see Fig. \ref{fig4}(d)]. Similarly, one can expect that the critical rotation angles for divergent transverse shifts in Ref. {\cite{Yu2018}.} satisfy $|\cos 2\phi_c|=\varepsilon/\Delta_0$ with $|\varepsilon|<\Delta_0$. Besides, when $|\varepsilon|>\Delta_0$, the transverse shifts obtained from linear approximation will be accurate and consistent with that obtained from Eq.~(\ref{exact_1}). With the boundary conditions, \begin{eqnarray} \psi(x=0^-)&=&\psi(x=0^+),\\ \frac{1}{m}\partial_x\psi (x=0^-)&=&\frac{1}{m_x}\partial_x\psi (x=0^+)-h\psi (0), \end{eqnarray} the Andreev reflection amplitude $r_h$ is obtained as \begin{equation} r_h=\frac{-4 \eta_{-} \eta_{+} \Gamma}{\eta_{+} \left(Z-2 \Gamma\right)-\eta_{-} \left(Z+2 \Gamma\right)}, \end{equation} with $Z=4 \frac{mh}{k_{e}}^{2}+1+\Gamma^{2}$ and $\Gamma=\frac{mk_{s}^{+}}{m_{1}k_{e}}$. \begin{figure}[t] \includegraphics[width=8.7cm]{fig5.pdf} \caption{ (a,b) The phase $\varphi_h=\arg (r_h)$ and its derivative and (c,d) $|r_h|^2$ and its derivative vs $\phi_k$ in the cases of $|\varepsilon|<\Delta_0$ and $|\varepsilon|>\Delta_0$. Here, we choose $\Delta_0=20\ \rm{meV}$, $E_F=0.4\ \rm{eV}$, $V=0.2\ \rm{eV}$, $h=0.3\ \rm{eV}\cdot\rm{nm}$ and $\theta=\pi/12$. We take the $\varepsilon=10\ \rm{meV}$ in (a), (c) and $\varepsilon=30\ \rm{meV}$ in (b), (d). \label{fig5}} \end{figure} In Fig.~\ref{fig5}, we plot the obtained $|r_h|^2$ and $\varphi_h=\arg (r_h)$ as functions of the rotation angle $\phi_k$ for $|\varepsilon|<\Delta_0$ and $|\varepsilon|>\Delta_0$. We find that the derivative of $|r_h|^2$ and $\varphi_h=\arg (r_h)$ exhibit eight discontinuity points at $\phi_c=\pm [\arccos (\varepsilon/\Delta_0)]/2$ when $|\varepsilon|<\Delta_0$, but are smooth functions when $|\varepsilon|>\Delta_0$, consistent with the analysis of the band structure of the junction model. Interestingly, $r_h$ is a pure real number when $|\varepsilon|>\Delta_0$. We then study the dependence of anomalous transverse shift on the rotation angle and $\phi_k$. \begin{figure}[t] \includegraphics[width=8.7cm]{fig6.pdf} \caption{ The anomalous transverse shift in model (\ref{AFHam}). (a) The results obtained with linear approximation $\ell_T^{LA}$ (dashed line) and that obtained without approximation $\ell_T$ (solid line) vs $\phi_k$. (b) $\ell_T$ vs $\phi_k$ for different beam width $W$. The box in (a) denotes the range of $\phi_k$ in (b). Here, we choose $\varepsilon=10\ \rm{meV}$, $\Delta_0=20\ \rm{meV}$, $E_F=0.4\ \rm{eV}$, $V=0.2\ \rm{eV}$, $h=0.3\ \rm{eV}\cdot\rm{nm}$ and $\theta=\pi/12$. \label{fig6}} \end{figure} Under the linear approximation, the anomalous transverse shift in Andreev reflection is established as \begin{eqnarray}\label{TLA} \ell_T^{LA}&=&-\frac{1}{k_\parallel}\partial_{\phi_k}\varphi_h \nonumber\\ &=&-\frac{\rho \Lambda \Delta_0^2 \sin (4 \phi_k)}{k_{\|} \varepsilon^2\left(1+\Lambda^2 / \rho^2\right)} \Theta\left(\left|\Delta_0 \cos 2 \phi_k\right|-\varepsilon\right) \end{eqnarray} with $\rho=\varepsilon/\sqrt{\Delta_0^2 \cos ^2(2 \phi_k)-\varepsilon^2}$ and $\Lambda=Z/(2 \Gamma)$. According to Eq. (\ref{TLA}), we find the transverse shift obtained from linear approximation $\ell_T^{LA}$ indeed is divergent at $\phi_c$ when $|\varepsilon|<\Delta_0$, as shown Fig. \ref{fig6}. For $\varepsilon>\Delta_0$, the transverse shift will be zero, as $r_h$ is a real number with $\varphi_h=0$. The numerical results of the transverse shifts $\ell_T$ obtained from Eq.~(\ref{exact_1}) with $|\varepsilon|<\Delta_0$ and different beam width also are plotted in Fig.~\ref{fig6}. We have checked that the wave packets of the reflected hole beam still can be well defined and exhibit a Gaussian-type profile, indicating the calculated anomalous shift would be reliable. One observes that for all the beam widths, the transverse shifts are not divergent at the critical angles $\phi_c$. Similar to the first case, we find that (i) the anomalous shift indeed is significant at the critical angles and can reach few tens of nanometer with reasonable parameters, (ii) $\ell_T$ and $\ell_T^{LA}$ are almost identical away from the critical angle $\phi_c$ and (iii) the anomalous shift is sensitive to the beam width when and only when $\phi_k$ is close to $\alpha_c$. Besides, when $|\varepsilon|/\Delta_0>1$, the transverse shifts $\ell_T$ obtained from Eq. ~(\ref{exact_1}) is negligible, consistent with the results from linear approximation. \section{Conclusions} In this work, we study the anomalous shift in interface electronic reflection based on the quantum scattered approach with and without linear approximation. We find that for a large case of junction models, the propagating modes of scattering states may be changed by varying certain parameters like incident angle. Around the critical parameters, the linear approximation is invalid and leads to divergent anomalous shifts in scattering. In contrast, the quantum scattered approach without linear approximation always gives accurate results, which are significant but not divergent around the critical parameters. Moreover, we show the anomalous shifts around the critical parameters decrease when increasing the width of the incident beam. This means that the narrower the incident beam, the more pronounced the anomalous shift. Away from the critical parameters, the anomalous shifts obtained from the quantum scattered approach with and without linear approximation are similar and not sensitive to the beam width. \section{Acknowledgement} The authors thank J. Xun for helpful discussions. This work was supported by the National Key R\&D Program of China (Grant No. 2020YFA0308800), the NSF of China (Grants Nos. 12234003, 12061131002 and 12004035), and the National Natural Science Fund for Excellent Young Scientists Fund Program (Overseas) and Beijing Institute of Technology Research Fund Program for Young Scholars. \section{INTRODUCTION} According to the laws of reflection in geometric optics, one knows that the incident point is always the same as the point where the light beam is reflected back at a sharp interface. However, due to the wave nature of photons, these law should be revised in certain cases and a light beam can experience an anomalous spatial shift under reflection, namely, there exists a shift between the incident and the reflected beams at the interface~\cite{Bliokh_2013}. Generally, the spatial shift is divided into longitudinal and transverse components with respect to the incident plane, known as the Goos-H\"{a}nchen shift~\cite{Goos1947,Renard1964} and Imbert-Fedorov shift~\cite{IF1955,IF1972,Onoda2004}, respectively. Since the wave-particle duality is a foundational concept in physics and holds for all particles, the anomalous spatial shift can also be found in many other particles, such as electrons~\cite{Miller1972,Beenakker2009,Chen2013,Wu2011,Yu2019}, atoms~\cite{JH2008} and neutrons~\cite{Haan2010}. In electronic systems, the valence and conduction bands can cross around Fermi level, leading to non-trivial band degeneracy~\cite{Chiu2016,Armitage2018,Wan2011,yu2016,Weng2015,Wu2018,Soluyanov2015,Lix2021,2Lix2021}. The band degeneracies in three-dimensional (3D) topological semimetals have many different types, and can be classified as 0D nodal point, 1D nodal line and 2D nodal surface~\cite{yu2022,Guibin2022,Zeying2022}. Remarkably, in the interface constructed by topological semimetals and other systems, both longitudinal and transverse shift effects are generally significant, due to strong (pseudo-)spin-orbit coupling in topological semimetals~\cite{Beenakker2009,Jiang2015,Yang2015,Yao2019,Feng2020}. Such significant anomalous spatial shift can lead to various physical consequences, such as chirality-dependent Hall effect~\cite{Yang2015} and modifying the dispersion of the confined waveguide modes~\cite{Beenakker2009}. Moreover, the behavior of the longitudinal and transverse shifts in these systems has a strong dependence on the species of the band degeneracies~\cite{Jiang2015,Yang2015,Yao2019,Feng2020}. For example, when a beam comes from normal metal onto the interface with topological Weyl semimetals, there will exist quantum vortices in the vector field of the spatial shift in the interface momentum space, and the number of the quantum vortices is determined by the topological charge of the Weyl points~\cite{Yliu2020}. The anomalous shifts can also be realized in Andreev reflection, during which the incident particle changes its identity from electron to hole~\cite{Yliu2017,1Yliu2018,Yu2018,2Yliu2018}. Similarly, the shifts strongly depend on the pair potential of the superconductors, which in turn can be used to probe the superconducting states. Currently, the standard and the most general approach used to study the anomalous shifts in electronic systems is the quantum scattering approach under linear approximation~\cite{Yu2019}. In this approach, the incident beam is modeled by wave packet $\Psi$, which is constructed by the incident basis states $\psi^{i}(\boldsymbol{k})$ and is confined in both real and momentum spaces ($\boldsymbol{r}^{c}, \boldsymbol{k}^{c}$). During scattering, the wave packet would be reconstructed, as each incident basis state $\psi^{i}(\boldsymbol{k})$ is scattered into reflected basis state $\psi^{r}(\boldsymbol{k})$ with certain reflection amplitude. The anomalous shifts then are obtained by comparing the center position of the incident and reflected beams. In practice, one generally chooses the wave-packet profile to have a Gaussian form, and in such case, the anomalous shifts can be analytically obtained by expanding the phases of the relevant scattering basis states [$\psi^{i}(\boldsymbol{k})$ and $\psi^{r}(\boldsymbol{k})$] and reflection amplitudes to the linear order around $\boldsymbol{k}^{c}$. The linear approximation is valid for most cases and gives accurate analytical results, which are helpful for gaining insight into the physics of the shifts. However, for a class of normal cases, the linear approximation leads to a divergence of the anomalous shifts in reflection at certain incident angles, even when the corresponding reflection possibility is finite~\cite{Beenakker2009,Jiang2015,Yu2018}. Then two important questions arise: \emph{Under what conditions, does the linear approximation not apply? And how to resolve the divergence of the shifts?} In this work, we show that the divergence of the shifts in linear approximation are closely related to an abrupt change of the number of propagating states. In scattering, while the number of the scattering states is fixed, the number of the propagating states is not, and may abruptly changes when some critical parameters like incident angle or Fermi energy change. This abrupt change would lead to a singularity in reflection amplitude or its derivative, which in the framework of linear approximation inevitably results in divergent anomalous shifts. We show this divergence can be resolved by calculating the centre position of the incident and reflected beams beyond the linear approximation. We explicitly demonstrate our idea by calculating the longitudinal (Goos-H\"{a}nchen) and transverse (Imbert-Fedorov) shifts on two representative models. Our work will be beneficial for clarifying the scope of application of the linear approximation in the study of anomalous spatial shifts. \section{Quantum scattering approach} \label{SecII} Consider a general model which contains two media respectively described by Hamiltonian $H_1$ and $H_2$, and a flat interface between these two media, as illustrated in Fig.~\ref{fig1}(a). We also assume that the junction model is extended along $y$ and $z$ directions, indicating that $k_y$ and $k_z$ are conserved quantities during scattering. A beam of particles is incoming from the region of $x<0$ ($H_1$) and is scattered at the interface residing at $x=0$ plane. Besides, there is a rotation angle $\alpha$ between the incident plane and the $y$ axis, as shown in Fig.~\ref{fig1}(b). To define the anomalous spatial shift, the incident beam should be modeled by a wave packet, which is required to be confined in both real and momentum spaces. We choose the wave-packet profile to have a Gaussian form. Then, an incident wave packet centred at $\boldsymbol{k}^c=(k_y^c,k_z^c)$ can be written as \cite{Beenakker2009,Yu2019} \begin{equation}\label{i beam} \Psi^{i}(\boldsymbol{r},\boldsymbol{k}^c)=\int w\left(\boldsymbol{k}-\boldsymbol{k}^c\right) \psi^{i}(\boldsymbol{k}) d \boldsymbol{k}, \end{equation} where $\psi^{i}(\boldsymbol{k})=e^{i\boldsymbol{k} \cdot \boldsymbol{r}}|u^i(\boldsymbol{k})\rangle$ is the Bloch eigenstate of the incident medium and $|u^i(\boldsymbol{k})\rangle$ is the cell-periodic part of the eigenstate. The wave-packet profile $w$ reads \begin{equation} w(\boldsymbol{k})=\prod \limits_{i=y,z}\left(\sqrt{2 \pi} W_{i}\right)^{-1} e^{-k_{i}^{2} /\left(2 W_{i}^{2}\right)}, \end{equation} where $W_{i}$ denotes the Gaussian width for the $i$-th component, controlling the beam width in momentum space. The centre position of the incident beam can be written as~\cite{Luo2011,Ling2021} \begin{eqnarray} \boldsymbol{r}_{i}^{c}(\boldsymbol{k}^{c})=\frac{\int\boldsymbol{r}|\Psi^{i}(\boldsymbol{r},\boldsymbol{k}^{c})|^{2}d\boldsymbol{r}}{\int|\Psi^{i}(\boldsymbol{r},\boldsymbol{k}^{c})|^{2}d\boldsymbol{r}}. \end{eqnarray} \begin{figure}[t] \includegraphics[width=8.7cm]{fig1.pdf} \caption{(a) Schematic figure showing the anomalous spatial shift $\boldsymbol{\ell}$ in interface scattering. (b) Top view of the $y$-$z$ plane in (a). \label{fig1}} \end{figure} When the incident beam hits the interface, each partial wave $\psi^{i}(\boldsymbol{k})$ is scattered into reflected basis state $\psi^{r}(\boldsymbol{k})$ with certain $\boldsymbol{k}$-dependent reflection amplitude $A_r(\boldsymbol{k})$. The reflection amplitude here is obtained by the standard quantum scattering approach. Then, the reflected beam also is a wave packet and can be expressed as \begin{equation}\label{i beam} \Psi^{r}(\boldsymbol{r},\boldsymbol{k}^c)=\int w\left(\boldsymbol{k}-\boldsymbol{k}^c\right) A_r(\boldsymbol{k}) \psi^{r}(\boldsymbol{k}) d \boldsymbol{k}, \end{equation} and its centre position is \begin{eqnarray} \boldsymbol{r}_{r}^{c}(\boldsymbol{k}^{c})=\frac{\int\boldsymbol{r}|\Psi^{r}(\boldsymbol{r},\boldsymbol{k}^{c})|^{2}d\boldsymbol{r}}{\int|\Psi^{r}(\boldsymbol{r},\boldsymbol{k}^{c})|^{2}d\boldsymbol{r}}. \end{eqnarray} By comparing the centre position of incident and reflected beam, the anomalous shift in reflection is obtained as \begin{eqnarray} \label{exact_1} \boldsymbol{\ell}(\boldsymbol{k}^{c})=\boldsymbol{r}_{r}^{c}(\boldsymbol{k}^{c})-\boldsymbol{r}_{i}^{c}(\boldsymbol{k}^{c}), \end{eqnarray} which is a vector and forms a vector field in the interface momentum space. However, it should be noticed that based on Eq.~(\ref{exact_1}), while one always can numerically obtain $\boldsymbol{\ell}(\boldsymbol{k}^{c})$, it is impossible to obtain an analytical expression for $\boldsymbol{\ell}(\boldsymbol{k}^{c})$, which prevents a deep understanding of the physics underlying the shifts. To resolve this problem, one has to resort to linear approximation, as it can give an analytical expression of $\boldsymbol{\ell}(\boldsymbol{k}^{c})$ in many cases. The Bloch eigenstate of the incident medium may include multiple ($N$) components, i.e. $|u^{i(r)}(\boldsymbol{k})\rangle=(u^{i(r)}_1,\cdots u^i_N)^T$, then the wave packets $\Psi^{i(r)}$ should also have $N$ components. The $n$-th component of $\Psi^{i}$ and $\Psi^{r}$ are respectively expressed as \begin{eqnarray}\label{int_Psi} \Psi^{i}_{n}(\boldsymbol{r},\boldsymbol{k}^c)&=&\int w\left(\boldsymbol{k}-\boldsymbol{k}^c\right) e^{i\boldsymbol{k} \cdot \boldsymbol{r}} |u^i_n(\boldsymbol{k})| e^{i \phi^{i}_n(\boldsymbol{k})} d \boldsymbol{k}, \end{eqnarray} and \begin{eqnarray}\label{ref_Psi} \Psi^{r}_{n}(\boldsymbol{r},\boldsymbol{k}^c)&=&\int w\left(\boldsymbol{k}-\boldsymbol{k}^c\right) |A_r| e^{i \varphi(\boldsymbol{k})} e^{i\boldsymbol{k} \cdot \boldsymbol{r}} |u^r_n(\boldsymbol{k})| e^{i \phi^{r}_n(\boldsymbol{k})} d \boldsymbol{k}, \nonumber \\ \end{eqnarray} with $\phi^{i(r)}_n(\boldsymbol{k})=\arg [u^{i(r)}_n(\boldsymbol{k})]$ and $\varphi(\boldsymbol{k})=\arg [A_r(\boldsymbol{k})]$. In the framework of linear approximation, the two phases $\phi^{i(r)}_n(\boldsymbol{k})$ and $\varphi(\boldsymbol{k})$ in Eq. (\ref{int_Psi}) and Eq. (\ref{ref_Psi}) are replaced by the first order Taylor series expanded around $\boldsymbol{k}^c$, \begin{eqnarray}\label{phase1} \phi^{i(r)}_n(\boldsymbol{k})&=&\phi^{i(r)}_n(\boldsymbol{k}^c)+(\boldsymbol{k}-\boldsymbol{k}^c)\cdot \partial_{\boldsymbol{k}}\phi^{i(r)}_n|_{\boldsymbol{k}=\boldsymbol{k}^c}, \\ \varphi(\boldsymbol{k})&=&\varphi(\boldsymbol{k}^c)+(\boldsymbol{k}-\boldsymbol{k}^c)\cdot \partial_{\boldsymbol{k}}\varphi|_{\boldsymbol{k}=\boldsymbol{k}^c}. \end{eqnarray} With the linear approximation, one can find that Eqs.~(\ref{int_Psi}) and~(\ref{ref_Psi}) will take the following forms \begin{eqnarray} \Psi^{i}_{n}(\boldsymbol{r},\boldsymbol{k}^c)& \propto& e^{-\sigma_y^2 (y+\partial_{k_y}\phi^{i}_n|_{\boldsymbol{k}=\boldsymbol{k}^c})^2 /2} \nonumber \\ &&\times e^{-\sigma_z^2 (z+\partial_{k_z}\phi^{i}_n|_{\boldsymbol{k}=\boldsymbol{k}^c})^2/2},\\ \Psi^{r}_{n}(\boldsymbol{r},\boldsymbol{k}^c)& \propto& e^{-\sigma_y^2 (y+\partial_{k_y}(\phi^{r}_n+\varphi)|_{\boldsymbol{k}=\boldsymbol{k}^c})^2 /2} \nonumber \\ &&\times e^{-\sigma_z^2 (z+\partial_{k_z}(\phi^{r}_n+\varphi)|_{\boldsymbol{k}=\boldsymbol{k}^c})^2 /2}, \end{eqnarray} indicating that $\Psi^{i}_{n}$ and $\Psi^{r}_{n}$ are centred at $-\partial_{\boldsymbol{k}}\phi^{i}_n|_{\boldsymbol{k}=\boldsymbol{k}^c}$ and $-\partial_{\boldsymbol{k}}(\phi^{r}_n+\varphi)|_{\boldsymbol{k}=\boldsymbol{k}^c}$, respectively. The centre position of incident and reflected beams are the average of all components, written as \begin{eqnarray} \boldsymbol{r}^{c}_i& =& -\sum_{n} w_n^{i} \partial_{\boldsymbol{k}}\phi^{i}_n|_{\boldsymbol{k}=\boldsymbol{k}^c}\\ \boldsymbol{r}^{c}_r& =& -\sum_{n} w_n^{r} \partial_{\boldsymbol{k}}(\phi^{r}_n+\varphi)|_{\boldsymbol{k}=\boldsymbol{k}^c}, \end{eqnarray} with $w_n^{i(r)}$ the weight of the $n$-th component of $|u^{i(r)}\rangle$, satisfying $\sum_n (w_n^{i(r)})^2=1$. Hence, the anomalous shift from linear approximation can be analytically expressed as the difference between the two centre positions, \begin{eqnarray} \label{ellLA} \boldsymbol{\ell}^{LA}& =& \sum_{n} [w_n^{i} \partial_{\boldsymbol{k}}\phi^{i}_n|_{\boldsymbol{k}=\boldsymbol{k}^c}-w_n^{r} \partial_{\boldsymbol{k}}(\phi^{r}_n+\varphi)|_{\boldsymbol{k}=\boldsymbol{k}^c}]. \end{eqnarray} By analyzing the above derivation, we find that there two prerequisites for application of the linear approximation. (1) After scattering, the reflected beams should be still centred at $\boldsymbol{k}^{c}$ in momentum space. (2) The reflection amplitude $A_r(\boldsymbol{k})$ should be an analytic function in the neighbourhood of $\boldsymbol{k}^{c}$, as it is a prerequisite for the Taylor expansion of $\arg [A_r(\boldsymbol{k})]$. These two conditions can be satisfied for most cases. Generally, condition (1) is always satisfied except that the reflection probability is vanishing at $\boldsymbol{k}=\boldsymbol{k}^{c}$. But, in such case, the anomalous shift would be irrelevant for physical observations, as no particle is reflected back and then the anomalous shift will not happen. In contrast, we show that the condition (2) does not hold at certain incident angles and model parameters, beyond which the number of the scattered propagating states changes. This abrupt change generally leads to divergent shifts [obtained from linear approximation (\ref{ellLA})] at the critical parameters, which apparently are not correct. Hence, to obtain correct results, we have to calculate the anomalous shifts via Eq.~ (\ref{exact_1}). We find that at the critical parameters, the anomalous shifts obtained from Eq.~(\ref{exact_1}) are completely different from that obtained from linear approximation ~(\ref{ellLA}), and are not divergent. Away from the critical parameters, the anomalous shifts obtained from both approaches are almost the same. Besides, the anomalous shifts around (away from) the critical parameters have a strong (negligible) dependence on the beam width $W$. In the following, we use two representative examples to demonstrate our ideas. \section{Longitudinal shift in graphene model} \label{SecIII} In the first case, we consider a graphene junction model. This model is simple and features a divergent longitudinal spatial shift with finite reflection probability~\cite{Beenakker2009}. However, the origin of the divergence has not been discussed. Here, we will show the divergence is caused by an abrupt change of scattering environment. According to the setup in Fig.~\ref{fig1}, we assume the junction model is lied on the $x$-$y$ plane. Notice that the $z$-direction here is a dummy degree of freedom, as graphene is a 2D system and the longitudinal shift is within the scattering plane. The Hamiltonian of the junction model is given as \begin{equation}\label{Model1} \mathcal{H}= \begin{cases} v k_x\sigma_x +v k_y\sigma_y, & x < 0, \\ v k_x\sigma_x +v k_y\sigma_y+V, & x>0,\end{cases} \end{equation} where $v$ is the fermi velocity, $\mathbf{\sigma}$ is the Pauli matrix and $V$ denotes a potential energy applied on the $x>0$ region. We plot the band structure of the graphene model in both $x<0$ and $x>0$ regions in Fig.~\ref{fig2}(a) and the corresponding equienergy contours in Fig.~\ref{fig2}(b). The possible incident and reflected electron states are also marked in Fig. \ref{fig2}(a). One can find that for a fixed Fermi energy $E_F>0$ (measured from the Dirac point) and a finite $V$ satisfying $0<V<2E_F$, there exists two critical incident angle $\pm \theta_c$, beyond which there is no propagating mode for transmitted state [see Fig.~\ref{fig2}(b)]. The critical angle is given as \begin{equation} \theta_c=\arcsin \left|\frac{V-E_F}{E_F}\right|. \end{equation} When the incident angle $\theta=\arctan (k_y/k_x)$ is smaller than the critical angle $|\theta|<\theta_c$, an incident electron from $x<0$ region can be reflected (transmitted) as a propagating state in $x<0$ ($x>0$) region. However, the number of transmitted propagating states varies from one to zero when $|\theta|>\theta_c$, indicating an abrupt change of scattering environment. As discussed in Ref.~{\cite{Ma2018}}, this change generally results in a discontinuity in the derivative of the reflection amplitude. As a consequence, the Taylor expansion of the phase of the reflection amplitude around the critical incident angles $\pm\theta_c$ will be meaningless, making the anomalous spatial shifts obtained by linear approximation inaccurate. \begin{figure}[t] \includegraphics[width=8.7cm]{fig2.pdf} \caption{(a) The band structure of incident medium ($x<0$) and transmitted medium ($x>0$) in model (\ref{Model1}). The spheres denotes the incident, reflected and transmitted electron state, and the arrows indicate their moving directions. (b) The Fermi surfaces of both $x<0$ (blue circle) and $x>0$ (red circle) medium with the label of the critical angel $\theta_c$. (c) $|A_r|^2$ and its derivative and (d) the phase $\varphi=\arg (A_r)$ and its derivative vs incident angle $\theta$. In the calculation, we choose $E_F=100\ \rm{meV}$, $V=150\ \rm{meV}$ and $v=10^6\ \rm{m/s}$. \label{fig2}} \end{figure} To directly show this, we proceed to solve the scattering states of the graphene junction model (\ref{Model1}), which can be written as \begin{equation} \psi(\boldsymbol{k})= \begin{cases} \psi^{i}(\boldsymbol{k})+A_r \psi^{r}(\boldsymbol{k}), & x < 0, \\ A_t \psi^{t}(\boldsymbol{k}), & x>0,\end{cases} \end{equation} where $A_{r(t)}$ is the reflection (transmission) amplitude, and $\psi^{i}$, $\psi^{r}$ and $\psi^{t}$ are the basis state for incident, reflected and transmitted states, respectively. Explicitly, the basis states read \begin{eqnarray} \psi^{i}(\boldsymbol{k})&=&\frac{1}{\sqrt{2}}\left(\begin{array}{c} e^{-i \theta / 2} \\ e^{i \theta / 2} \end{array}\right) e^{i k_{i} x+i k_{y} y}, \\ \psi^{r}(\boldsymbol{k})&=&\frac{1}{\sqrt{2}}\left(\begin{array}{c} -ie^{i \theta / 2} \\ i e^{-i \theta / 2} \end{array}\right) e^{-i k_{i} x+i k_{y} y},\\ \psi^{t}(\boldsymbol{k})&=&\frac{1}{\sqrt{2}|E_F-V|}\left(\begin{array}{c} E_F-V \\ v (k_t+ i k_y) \end{array}\right) e^{i k_{t} x+i k_{y} y}. \end{eqnarray} Here $k_i=v^{-1}\sqrt{E_F-v^2 k_y^2}$, $\theta=\arctan{(k_y/k_i)}$ is the incident angle, $k_t=v^{-1}\text{sgn}(E_F-V)\sqrt{(E_F-V)^2-v^2 k_y^2}$ for $|\theta|<\theta_c$ and $k_t=i\kappa$ for $|\theta|>\theta_c$, where $\kappa=v^{-1}\sqrt{v^2 k_y^2-(E_F-V)^2}$. For the graphene junction model here, the boundary condition at the interface is \begin{equation} \psi(x=0^-)=\psi(x=0^+), \end{equation} with which the reflection amplitude $A_r$ is obtained as \begin{equation} A_r=\frac{v(\kappa+k_y)+ i e^{i\theta }(E_F-V)}{v e^{i\theta }(i \kappa+i k_y)+(E_F-V)}, \end{equation} The square of the module of $A_r$ ($|A_r|^2$) and the phase $\varphi=\arg (A_r)$ as functions of the incident angle are plotted in Fig.~\ref{fig2}(c) and Fig.~\ref{fig2}(d), respectively. One observes that for $|\theta|<\theta_c$, $A_r$ is a finite real number with $\varphi=0$, and for $|\theta|>\theta_c$, $A_r$ becomes a complex number with $|A_r|^2=1$, indicating the appearance of total reflection. This is consistent with the fact that when $|\theta|>\theta_c$, there no longer exists a propagating mode for transmitted state. Importantly, while both $|A_r|^2$ and $\varphi$ are continuous functions, their derivative are discontinuous at the critical angle $\pm\theta_c$ [see Fig.~\ref{fig2}(c) and (d)], corresponding to an abrupt change of the scattering condition, namely, the disappearance of the transmitted propagating mode for $|\theta|>\theta_c$. Based on the expression of $A_r$, the longitudinal shift under linear approximation is obtained as \begin{equation} \label{LAy_G} \ell_y^{LA}=2\frac{\sin ^2 \theta+1-V / E_F}{\kappa \sin 2\theta }. \end{equation} As discussed above, the accuracy of the anomalous shift obtained from linear approximation requires $A_r$ to be an analytic function. But $A_r$ is not an analytic function in the neighbourhood of $\theta=\pm\theta_c$. Hence, Eq. (\ref{LAy_G}) may be inaccurate around $\pm \theta_c$. \begin{figure}[t] \includegraphics[width=8.7cm]{fig3.pdf} \caption{The anomalous longitudinal shift in model (\ref{Model1}). (a) The results obtained with linear approximation $\ell_y^{LA}$ (dashed line) and that obtained without approximation $\ell_y$ (solid line) vs incident angle. (b) $\ell_y$ vs $\theta$ for different beam width $W$. The box in (a) denotes the range of $\theta$ in (b). In the calculation, we choose $E_F=100\ \rm{meV}$, $V=150\ \rm{meV}$, $v=10^6\ \rm{m/s}$. \label{fig3}} \end{figure} In Fig.~\ref{fig3}(a), we plot the typical behavior of the longitudinal shift $\ell_y^{LA}$ from Eq.~(\ref{LAy_G}), along with the shift $\ell_y$ obtained from Eq.~(\ref{exact_1}) beyond linear approximation. We have checked that the wave packet of the reflected beam still features a Gaussian-type profile and is centred at same momentum with the incident wave packet. Hence, the shift obtained from Eq.~(\ref{exact_1}) should be accurate. From Fig. \ref{fig3}(a), one observes that the $\ell_y^{LA}$ has two discontinuity points at $\pm \theta_c$. Specifically, it is zero for $|\theta|<\theta_c$, diverges abruptly at $\pm \theta_c$ and becomes finite when moving away from $\pm \theta_c$. In contrast, $\ell_y$ obtained from Eq.~(\ref{exact_1}) is always continuous for any incident angle. Particularly, it is not divergent at $\pm \theta_c$, indicating the non-physical divergent results from linear approximation is resolved by using Eq.~(\ref{exact_1}) to calculate the anomalous shift. Besides, there are several other observations. (i) At critical angle $\pm \theta_c$, while $\ell_y$ is not divergent, it still is very large and can reach few tens of nanometer with reasonable parameters. (ii) Away from $\pm \theta_c$, $\ell_y^{LA}$ and $\ell_y$ share similar behavior and are almost identical, as shown in Fig.~\ref{fig3}(a). The anomalous shifts~(\ref{LAy_G}) obtained from linear approximation are always independent of the beam width ($\sim W=|\bm{W}|$). However, in optics, it has been demonstrated that the anomalous shifts around the critical parameters strongly depend on the beam width \cite{Lai1986,Wang2013,Qiu2015}. Here, we also calculate the longitudinal shift $\ell_y$ from Eq.~(\ref{exact_1}) for different $W$. The obtained results are shown in Fig.~\ref{fig3}(b), from which one can find that the maximum value of $\ell_y$ indeed varies with $W_y$, consistent with the results in optics. Again, when moving away from $\pm \theta_c$, $\ell_y$ is not sensitive to the value of $W$. \section{Transverse shift in Andreev reflection} In the second case, we consider transverse shift in Andreev reflection~\cite{Yliu2017,Yu2018}. In electronic systems, besides ordinary electron scattering, Andreev reflection is another intriguing scattering process that occurs at the interface between metal and superconductor and is described by the Bogoliubov-de Gennes (BdG) equation. The junction model here is of a 3D electron gas interfaced with a $d$-wave superconductor. The corresponding BdG equation can be written as \begin{equation}\label{AFHam} H(x)\psi=\varepsilon \psi, \end{equation} with $\varepsilon$ the excitation energy \begin{equation} H=\left[\begin{array}{cc} -\frac{1}{2 m} \nabla^{2}-E_{F} & 0 \\ 0 & -\mathcal{T} (-\frac{1}{2 m} \nabla^{2}) \mathcal{T}^{-1}+E_{F} \end{array}\right], \end{equation} for normal metal region ($x<0$), and \begin{equation} H=\left[\begin{array}{cc} H_{0}+V-E_{F} & \Delta(k_{\|}) \\ \Delta^{*}(k_{\|}) & -\mathcal{T} H_{0} \mathcal{T}^{-1}-V+E_{F} \end{array}\right], \end{equation} for the superconductor region ($x>0$). Besides, the interface barrier potential $h \delta(x)$ is considered. Here, $m$ denotes the electron mass, $E_F$ is the Fermi energy, $\mathcal{T}$ is the time reversal operator, $H_{0}=-\frac{1}{2 m} \left(\partial_{z}^{2}+\partial_{y}^{2}\right)-\frac{1}{2 m_{x}} \partial_{x}^{2}$, $\Delta(k_y,k_z)=\Delta_0 \cos(2 \phi_k)$ represents a $d_{y^2-z^2}$ pairing with $\phi_k=\arctan(k_y/k_z)$, and $V$ is a potential energy ensuring $E_F-V\gg \Delta_0$. According to the setup in Fig.~\ref{fig1}, the rotation angle is identical to $\phi_k$, namely, $\alpha=\phi_k$. This model has been used to show that transverse shift can be solely induced by the unconventional pairing, and it is found that by varying rotation angle $\alpha$ [see Fig.~ \ref{fig1}(b)], the transverse shift becomes divergent at certain critical angles. Here, we will show that the divergence is also caused by the change in the number of transmitted propagating states at the critical angles. \begin{figure}[t] \includegraphics[width=8.7cm]{fig4.pdf} \caption{Band structure of the BdG Hamiltonian in model (\ref{AFHam}). (a), (b) show the BdG spectrum in different incident planes. (c) denotes the band gap $E_g$ of the BdG spectrum. (d) The BdG Fermi surfaces with different excitation energy. In the calculation, we choose $\varepsilon=10\ \rm{meV}$, $\Delta_0=20\ \rm{meV}$, $E_F=0.4\ \rm{eV}$, $V=0.2\ \rm{eV}$, $h=0.3\ \rm{eV}\cdot\rm{nm}$ and the incident angle $\theta=\pi/12$. We take the $\varepsilon_1=10\ \rm{meV}$, $\varepsilon_2=25\ \rm{meV}$ in (c), (d). \label{fig4}} \end{figure} The scattering states of Eq.~(\ref{AFHam}) can be written as~\cite{Yu2018} \begin{equation} \psi(\boldsymbol{k})= \begin{cases} \psi^{i}(\boldsymbol{k})+r_e \psi^{r}_e(\boldsymbol{k})+r_h \psi^{r}_h(\boldsymbol{k}), & x < 0, \\ t_1 \psi_1^{t}(\boldsymbol{k})+t_2 \psi_2^{t}(\boldsymbol{k}), & x>0,\end{cases} \end{equation} where $r_{e(h)}$ is the amplitude for the normal (Andreev) reflection, and $t_{1(2)}$ is the transmission amplitude, and the $\psi$ are the corresponding basis states, expressed as \begin{eqnarray} \psi^{r}_e(\boldsymbol{k})&=&\left(\begin{array}{l} 1 \\ 0 \end{array}\right)e^{-i k_x^e x+i k_y y+i k_z z}, \\ \psi^{r}_h(\boldsymbol{k})&=& \left(\begin{array}{l} 0 \\ 1 \end{array}\right)e^{i k_x^h x+i k_y y+i k_z z}, \\ \psi_{\pm}^{t}(\boldsymbol{k})&=& \left(\begin{array}{c} 1 \\ \eta_{\pm} \end{array}\right)e^{i k_S^{\pm} x+i k_y y+i k_z z}, \end{eqnarray} where $\eta_{\pm}=\frac{\Delta_{\boldsymbol{k}_{\pm}}}{\varepsilon\pm\sqrt{\varepsilon^{2}-\Delta_{k_{S}^{\pm}}^{2}}}$ with $\Delta_{\boldsymbol{k}_{\pm}}=\boldsymbol{\Delta}\left(k_{\pm}^{\mathrm{S}}, k_y, k_z\right)$, $k_\|=\sqrt{k_y^2+k_z^2}$, $k_x^{e / h}=\sqrt{2 m E_{F}-k^2_\|}$, and $k_{S}^{\pm}=\pm\sqrt{2m_x(E_f-U- k^2_\|/2 m)}$. Before processing to the concrete calculations of the scattering amplitudes and the anomalous shifts, we discuss the influences of rotation angle and the value of excitation energy on the scattering in the interface. Since the $d$-wave superconductor is anisotropic in $k_y$-$k_z$ plane, the band structure of the superconductor in different incident planes (determined by the rotation angle $\alpha$) will be different, as shown in Fig.~\ref{fig4}(a) and~\ref{fig4}(b), indicating the transverse shift is sensitive to the rotation angle $\alpha$ and $\phi_k$. We also plot the band gap $E_{\text{gap}}=|\Delta_{\boldsymbol{k}}|$ of the superconductor as a function of $\phi_k$ in Fig.~\ref{fig4}(c), showing the superconductor becomes gapless at $\phi_k=\pm \pi/4, \ \pm 3\pi/4$. Then, a key observation is that for any excitation energy satisfying $|\varepsilon|<\Delta_0$, the two transmitted states ($\psi_{1}^{t}$ and $\psi_{2}^{t}$) are propagating modes for $|\cos 2\phi|<\varepsilon/\Delta_0$ ($|\varepsilon|>E_{\text{gap}}$) and are evanescent modes for $|\cos 2\phi|>\varepsilon/\Delta_0$ ($|\varepsilon|<E_{\text{gap}}$), as illustrated in Fig. \ref{fig4}(c). In contrast, the two transmitted states are always propagating modes when $|\varepsilon|>\Delta_0$, as $|\varepsilon|>E_{\text{gap}}$ for any $\phi_k$ [see Fig. \ref{fig4}(d)]. Similarly, one can expect that the critical rotation angles for divergent transverse shifts in Ref. {\cite{Yu2018}.} satisfy $|\cos 2\phi_c|=\varepsilon/\Delta_0$ with $|\varepsilon|<\Delta_0$. Besides, when $|\varepsilon|>\Delta_0$, the transverse shifts obtained from linear approximation will be accurate and consistent with that obtained from Eq.~(\ref{exact_1}). With the boundary conditions, \begin{eqnarray} \psi(x=0^-)&=&\psi(x=0^+),\\ \frac{1}{m}\partial_x\psi (x=0^-)&=&\frac{1}{m_x}\partial_x\psi (x=0^+)-h\psi (0), \end{eqnarray} the Andreev reflection amplitude $r_h$ is obtained as \begin{equation} r_h=\frac{-4 \eta_{-} \eta_{+} \Gamma}{\eta_{+} \left(Z-2 \Gamma\right)-\eta_{-} \left(Z+2 \Gamma\right)}, \end{equation} with $Z=4 \frac{mh}{k_{e}}^{2}+1+\Gamma^{2}$ and $\Gamma=\frac{mk_{s}^{+}}{m_{1}k_{e}}$. \begin{figure}[t] \includegraphics[width=8.7cm]{fig5.pdf} \caption{ (a,b) The phase $\varphi_h=\arg (r_h)$ and its derivative and (c,d) $|r_h|^2$ and its derivative vs $\phi_k$ in the cases of $|\varepsilon|<\Delta_0$ and $|\varepsilon|>\Delta_0$. Here, we choose $\Delta_0=20\ \rm{meV}$, $E_F=0.4\ \rm{eV}$, $V=0.2\ \rm{eV}$, $h=0.3\ \rm{eV}\cdot\rm{nm}$ and $\theta=\pi/12$. We take the $\varepsilon=10\ \rm{meV}$ in (a), (c) and $\varepsilon=30\ \rm{meV}$ in (b), (d). \label{fig5}} \end{figure} In Fig.~\ref{fig5}, we plot the obtained $|r_h|^2$ and $\varphi_h=\arg (r_h)$ as functions of the rotation angle $\phi_k$ for $|\varepsilon|<\Delta_0$ and $|\varepsilon|>\Delta_0$. We find that the derivative of $|r_h|^2$ and $\varphi_h=\arg (r_h)$ exhibit eight discontinuity points at $\phi_c=\pm [\arccos (\varepsilon/\Delta_0)]/2$ when $|\varepsilon|<\Delta_0$, but are smooth functions when $|\varepsilon|>\Delta_0$, consistent with the analysis of the band structure of the junction model. Interestingly, $r_h$ is a pure real number when $|\varepsilon|>\Delta_0$. We then study the dependence of anomalous transverse shift on the rotation angle and $\phi_k$. \begin{figure}[t] \includegraphics[width=8.7cm]{fig6.pdf} \caption{ The anomalous transverse shift in model (\ref{AFHam}). (a) The results obtained with linear approximation $\ell_T^{LA}$ (dashed line) and that obtained without approximation $\ell_T$ (solid line) vs $\phi_k$. (b) $\ell_T$ vs $\phi_k$ for different beam width $W$. The box in (a) denotes the range of $\phi_k$ in (b). Here, we choose $\varepsilon=10\ \rm{meV}$, $\Delta_0=20\ \rm{meV}$, $E_F=0.4\ \rm{eV}$, $V=0.2\ \rm{eV}$, $h=0.3\ \rm{eV}\cdot\rm{nm}$ and $\theta=\pi/12$. \label{fig6}} \end{figure} Under the linear approximation, the anomalous transverse shift in Andreev reflection is established as \begin{eqnarray}\label{TLA} \ell_T^{LA}&=&-\frac{1}{k_\parallel}\partial_{\phi_k}\varphi_h \nonumber\\ &=&-\frac{\rho \Lambda \Delta_0^2 \sin (4 \phi_k)}{k_{\|} \varepsilon^2\left(1+\Lambda^2 / \rho^2\right)} \Theta\left(\left|\Delta_0 \cos 2 \phi_k\right|-\varepsilon\right) \end{eqnarray} with $\rho=\varepsilon/\sqrt{\Delta_0^2 \cos ^2(2 \phi_k)-\varepsilon^2}$ and $\Lambda=Z/(2 \Gamma)$. According to Eq. (\ref{TLA}), we find the transverse shift obtained from linear approximation $\ell_T^{LA}$ indeed is divergent at $\phi_c$ when $|\varepsilon|<\Delta_0$, as shown Fig. \ref{fig6}. For $\varepsilon>\Delta_0$, the transverse shift will be zero, as $r_h$ is a real number with $\varphi_h=0$. The numerical results of the transverse shifts $\ell_T$ obtained from Eq.~(\ref{exact_1}) with $|\varepsilon|<\Delta_0$ and different beam width also are plotted in Fig.~\ref{fig6}. We have checked that the wave packets of the reflected hole beam still can be well defined and exhibit a Gaussian-type profile, indicating the calculated anomalous shift would be reliable. One observes that for all the beam widths, the transverse shifts are not divergent at the critical angles $\phi_c$. Similar to the first case, we find that (i) the anomalous shift indeed is significant at the critical angles and can reach few tens of nanometer with reasonable parameters, (ii) $\ell_T$ and $\ell_T^{LA}$ are almost identical away from the critical angle $\phi_c$ and (iii) the anomalous shift is sensitive to the beam width when and only when $\phi_k$ is close to $\alpha_c$. Besides, when $|\varepsilon|/\Delta_0>1$, the transverse shifts $\ell_T$ obtained from Eq. ~(\ref{exact_1}) is negligible, consistent with the results from linear approximation. \section{Conclusions} In this work, we study the anomalous shift in interface electronic reflection based on the quantum scattered approach with and without linear approximation. We find that for a large case of junction models, the propagating modes of scattering states may be changed by varying certain parameters like incident angle. Around the critical parameters, the linear approximation is invalid and leads to divergent anomalous shifts in scattering. In contrast, the quantum scattered approach without linear approximation always gives accurate results, which are significant but not divergent around the critical parameters. Moreover, we show the anomalous shifts around the critical parameters decrease when increasing the width of the incident beam. This means that the narrower the incident beam, the more pronounced the anomalous shift. Away from the critical parameters, the anomalous shifts obtained from the quantum scattered approach with and without linear approximation are similar and not sensitive to the beam width. \section{Acknowledgement} The authors thank J. Xun for helpful discussions. This work was supported by the National Key R\&D Program of China (Grant No. 2020YFA0308800), the NSF of China (Grants Nos. 12234003, 12061131002 and 12004035), and the National Natural Science Fund for Excellent Young Scientists Fund Program (Overseas) and Beijing Institute of Technology Research Fund Program for Young Scholars.
\section{Introduction} Today's Internet is supported by large cloud providers that include Google, Amazon, and Microsoft. These providers support a wide variety of web services that operate at a large scale serving huge numbers of users scattered throughout the World. Nevertheless, this paradigm forces application providers to fully rely and trust on centralized cloud infrastructure that are susceptible to attacks\,\cite{cloudattack1,cloudattack2} and dictate the terms of service with little to no competition. Moreover, in most application scenarios the control of user data is relinquished in some way to these operators, which is undesirable (and being targeted by legislation such as the European GDPR). To address this, and partially achieved by the increased popularity and use cases enabled by blockchain technologies\,\cite{eth,bitcoin}, the concept of Web3\,\cite{web3} emerged. Web3 aims at decentralizing web technologies to improve user security and privacy as well as providing guaranteed ownership of content, through the use of existing novel peer-to-peer protocols\,\cite{p2p,leitao:msc}. However, Web3 is still in its early stages and is yet to become competitive with modern cloud infrastructures, in terms of flexibility, application development, security and privacy, and performance. This is due to the current Web3 main technology enablers: blockchain, that maintains and replicates the system state; libp2p\,\cite{libp2p}, that is used to develop decentralized applications (dApps) and their support; and IPFS\,\cite{_ipfs,ipfs}, that is used as an entry-point to most dApps, that are still restricted to the domains of content creation and sharing\,\cite{fleek,nftstorage}, decentralized financing\,\cite{uniswap}, decentralized communication\,\cite{berty,discussify}, among a few others. This is because, blockchain, although important for decentralization, also limits the amount of interactions applications can have, as these are mostly made through the blockchain. Furthermore, IPFS still has a large space for performance improvements, as recent studies show that searching for content in IPFS can take up to $2,5$ hours\,\cite{consenSysMesurments}. Most of these technologies rely on peer-to-peer protocols that have been the subject of a large body of research in the past. However, most Web3 technology either are unaware of this research (such is the case for most blockchains that resort to flood dissemination\,\cite{blockchainflood} instead of a more efficient gossip dissemination\,\cite{plumtree} to disseminate mined blocks) or leverage it using similar configurations as described in the research, and sometimes experience performance issues (such is the case of the DHT in IPFS). However, it a non-trivial task to understand the causes for performance issues and how to mitigate them on a decentralized large-scale distribute system, as there is no single node that holds the entire view over the state of the system. Hence, it is paramount to devise techniques and to analyze data obtained from such systems to understand the current environment, workload, and system distribution, to then guide research and optimization for Web3 support\,\cite{pkad}. In this paper we present an in-depth analysis of the workload on IPFS. We have gathered two weeks worth of logs of one of the most popular IPFS gateways located in North America. These logs contained the (access) requests made from IPFS users across the World to large amounts of content stored in IPFS. We analyzed these logs and performed the same (valid) requests that were observed in the logs to fetch the information regarding the providers of the requested content. This allowed two things: first to correlate which and how many providers provided which and how many requested content. Second, and through the use of the MaxMind\,\cite{maxmind} database that matches IP addresses to geo-location information, to find the relation of the location of the origin of requests and location of providers of content to those requests. With this data, we analyzed the IPFS workload and found that most content is provided only by a few providers that are located on North America and Europe. The remainder of the paper is structured as follows: In Section~\ref{sec:ipfs} we provide a brief description of the IPFS network and how it operates. In Section~\ref{sec:meth} we detail our methodology to gather and analyze the data. In Section~\ref{sec:res} we describe our results, providing insights on the workload of the IPFS network. In Section~\ref{sec:related} we discuss related work. Finally, Section~\ref{sec:con} concludes the paper with final remarks and directions for future work. \section{IPFS}\label{sec:ipfs} IPFS is large scale peer-to-peer distributed system that aims at connecting computing devices through a shared file system. To enable this, IPFS relies on libp2p\,\cite{libp2p} to handle networking aspects. To connect peers in the network, libp2p relies on a distributed hash table (DHT), implemented as a variant of the Kademlia protocol\,\cite{kad}. IPFS leverages this DHT to distribute and search content and peers in the system. Content in IPFS is immutable, having each content associated an identifier (\emph{cId}) that is a multi-hash\,\footnote{A multi-hash encodes not only the hash of the data, but also hashes of metadata about the hashing process and data type.} of the content. Similarly, each peer in IPFS also has an identifier (\emph{peerId}) that is a multi-hash of the peer's public key. Peers organize themselves in the DHT according to a SHA-256 hash of their peerId and store content pointers according to the SHA-256 hash of the cId. Furthermore, each peer has associated to it a list of multiaddresses, that describe the internet addresses of the peer (this can be ipv4, ipv6, dns, or other kind of address). Note that peers do not store the content itself but only a pointer to the peer providing the content. As such, for a peer to publish content on IPFS, the operation the peer effectively performs is to announce that it provides the content by publishing on IPFS a \emph{provider record}. A provider record contains a mapping of a cId to peerIds -- its providers. As per the Kademlia operation, this provider record will be stored in the $k$ closest peers to the hash of the cId on the DHT. In IPFS $k$ has a value of $20$. Note that the same content can be provided by multiple peers. To fetch content IPFS uses a protocol named \emph{Bitswap}\,\cite{bitswap} that performs both discovery and data transfer. For Bitswap to discover content it begins to perform a local one-hop flood request for the cId. This will send a message to all neighboring peers asking if they have the cId locally. If the answer is positive, Bitswap begins transferring the content with a process akin to BitTorrent\,\cite{bittorrent}. If the response is negative and the content cannot be found on a neighboring peer, it resorts to the DHT to find the provider records of the cId. Once Bitswap has obtain one provider record, it will start to try to transfer the content from providers on that record. IPFS has two modes of operating: as a server or as a client node. Server nodes are (usually) publicly reachable in the Internet and kept in the DHT to enable routing among peers and serve content to the network. Client nodes connect to the DHT, but do not maintain the DHT, meaning that client nodes can only perform requests to the DHT and do not help in the routing process. Additionally, an IPFS peer can also act as a gateway, in which the IPFS node also runs a web server that grants access to IPFS via a browser interface to user. In more detail, a gateway node is able to transform an HTTP request into a valid IPFS request, that will either trigger a Bitswap and/or DHT operation. Furthermore, not all IPFS nodes are publicly reachable. This is the case for nodes that are behind a NAT. In this case, an IPFS node can request a publicly reachable IPFS node to relay traffic for that node. \section{Methodology}\label{sec:meth} In this section we provide a detailed description of our methodology to study and characterize the IPFS workload. In summary, we collected two weeks worth (from March 7th to March 21th of 2022) of logs from one of the most popular IPFS gateway -- \emph{ipfs.io} -- that is located in North America. These logs were produced by an nginx HTTP server that logged every HTTP request made. As such, each entry in the log contains an HTTP request made by a user to the IPFS gateway. To process these logs, we filtered all non-valid HTTP requests (e.g., \textsc{POST} operations, out of format entries), and extracted the cId in each valid HTTP request. From this, we fetch all the available provider records from IPFS for each cId. To obtain geo-location information from both the requests and providers, we matched the IP addresses we found against the MaxMind GeoLite2 Free Geolocation Database\,\cite{maxmind}. Finally, we matched both datasets on the requested and provided cId to produce a global view that shows where content is requested and where that content is served. In the following, we describe this process in more detail. \subsection{Processing the requests} The first step in analyzing the IPFS workload is to extract the requested cIds. To do this, we parse the gateway logs into a structured data format that can be easily processed. The gateway logs are generated by an nginx server, that effectively acts as a reverse proxy for an IPFS server node that acts as an IPFS gateway. Each log entry contains information about the received HTTP request by the IPFS gateway. In particular, we are interested in the following information of the HTTP requests: the IP address of the requester, to extract geo-location information; the HTTP operation and the HTTP status, to filter unwanted HTTP requests for our study (e.g., \textsc{POST} operations and $400$ \textsc{GET} operation status); and the HTTP target and the HTTP host, that effectively contain the requested cId. We begin by filtering logs that are out of format. This amounts to $0.001\%$ of all requests and include requests that have unparsable HTTP targets which contained hexadecimal codes in this field. Next, we remove all requests that are not \textsc{GET} HTTP requests, as these are the only ones that actually make requests to IPFS. This filters about $19\%$ of all requests contained in the logs, leaving almost $81\%$ of log entries with only \textsc{GET} operations. However, not all \textsc{GET} operations are of interest to process the workload. Such is the case for \textsc{GET} operations that did not succeed (i.e., where the reply had a HTTP status code of $400$) or that do not contain a cId in their request. We filter \textsc{GET} operations that did not succeed due to these having a high probability that the content is either invalid (i.e., it was never in IPFS) or the content was no longer available at the time of the request. As for the cIds in requests, these appear in the full \texttt{url} of the request that is obtained by concatenating the HTTP host field with the HTTP target field. Note that the HTTP host in this case can be \texttt{ipfs.io} (i.e., the gateway host), in which case the cId will appear on the HTTP target; or can be in the form of \texttt{$<$cId$>$.ipfs.dweb.link}, in which case the cId is in the HTTP host part. Note as well, these \texttt{url} contain a file system path to the requested content however, the cId might represent a folder in that path or the file. In the case a \texttt{url} contains multiple cIds, we only consider the root cId (i.e., the cId that is in the beginning of the file system path), as effectively, it is most likely that all cIds found under a root cId are also provided by the same provider peer. This also groups requests to cIds found under a root cId to the root cId, which does not alter the frequency of requests made to a cId, as the root cId always encompasses the remainder cIds. With this filter, we filter out $41\%$ of all \textsc{GET} operations, where $17\%$ of these were \textsc{GET} operations that did not succeed and $24\%$ are requests that did not contain a cId. With this, $47\%$ of the total requests remained as valid \textsc{GET} operations, which were the ones consider for our study. Table~\ref{tab:reqs} summarizes the requests we processed for our study. \begin{table}[t!] \centering \caption{Requests processed summary.} \begin{tabular}{ l | c | r } \toprule & Number of entries & Percentage\\ \midrule Total & $123,959,912$ & $100\%$ \\ Out of Format & $2,165$ & $0.001\%$ \\ Not GETs & $24,298,396$ & $19.602\%$ \\ All GETs & $82,439,744$ & $80.396\%$\\ Valid GETs & $58,869,788$ & $47.491\%$\\ \bottomrule \end{tabular} \label{tab:reqs} \end{table} \subsection{Locating the content providers} The second step in studying and characterizing the IPFS workload is to gather information on the providers of the requested content, as to understand where and by how many peers is the content served. To achieve this, we developed a simple libp2p program that connects to IPFS and requests all providers of a given cId. Our program leverages the fact that IPFS uses the same networking software stack and DHT provided by libp2p, which by default connects to the IPFS network, to perform \textsc{FindProviders} API calls to libp2p's DHT to fetch the providers of cIds. Out of the $58,869,788$ valid \textsc{GET} operations, a total of $4,009,575$ different cIds were requested. We requested the providers of all these cIds through our libp2p program. We found we were unable to locate the providers of $54\%$ of all cIds. This can be due to the fact that the content was no longer available on the network (note that this study was perform some months after the requests were recorded by the gateway). From the cIds with providers we discovered $55,830$ different providers however, $59\%$ of these did not have any addressing information associated to them. This means that the peers storing the provider record did not receive any update on the provider (from any kind of traffic) over a $30$ minute window, as such, the peers storing the provider record assumed the provider might have moved and has a different address, thus forgetting the provider's multiaddress. To fetch the multiaddress in these cases, we queried again the DHT for the multiaddress of the provider, and managed to find the multiaddress of $4,024$ more providers ($7\%$ more providers we found initially). Table~\ref{tab:provs} summarizes the numbers of processed cIds and found providers. \begin{table}[t!] \centering \caption{Providers processed summary.} \begin{tabular}{ l | c | r } \toprule & Number of entries & Percentage\\ \midrule Total cIds & $4,009,575$ & $100\%$ \\ cIds w/out provider & $2,175,608$ & $54.26\%$ \\ cIds w/ provider & $1,833,967$ & $45.74\%$ \\ \midrule Providers & $55,830$ & $100\%$\\ Providers w/out address & $32,968$ & $59\%$\\ Providers w/ address & $22,862$ & $41\%$\\ Providers w/ address after find & $26,886$ & $48\%$\\ \bottomrule \end{tabular} \label{tab:provs} \end{table} \subsection{Analyzing the data} The final step to study and characterize the IPFS workload is to join both request and providers data, to map from where in the World are requests being performed and where in the World is the content provided/available. This required us to extract geo-locality data from the gathered data. To this end, we use the MaxMind GeoLite2 Free Geolocation Database\,\cite{maxmind}, that provides the geo-location of a vast collection of public IP addresses. However, this database is not complete and may have IP addresses whose geo-location is unknown. Fortunately, for the request data all IP addresses had geo-locality information. On the other hand, only $88\%$ of providers with addresses had geo-locality information. Note that a provider is identified by a peerId and has multiple multiaddresses. To get the geo-location information of a provided we had to extract the (public) IP address of multiaddresses. For multiaddresses that contained protocols \texttt{ip4} and \texttt{ip6} this procedure is straightforward. This amounts to $98\%$ all observed multiaddress (excluding local address, such as \texttt{127.0.0.1} and \texttt{::1}); $0.6\%$ of multiaddresses were DNS addresses, that we resolved with local DNS resolvers; and the remainder $1.4\%$ of multiaddress were relay multiaddresses, and hence the provider did not have a public reachable IP address, which we ignored in this study. For providers that showed to have multiple locations (probably due to VPN services), we considered the last observed location. These were just a few cases that do not affect our study. We have inserted both datasets into a PostgreSQL database for ease of analysis. This database has $2$ tables, one containing the requests and another containing the providers. The requests table stores a request identifier (reqId), the timestamp the request was originally made to the gateway, the cId requested, and the location information of the requester. The requests table has as key the reqId, that is an hash of the request log entry, to avoid processing duplicate request entries from the log. The providers table stores: the cId provided, the peerId of the provider, and the location information of the provider. The provider table has as key the cId and peerId. This uniquely identifies each provider entry, since each cId can have multiple providers, and a provider can provide multiple cIds. Note as well that the cId in the providers table is a foreign key of the cId in the requests table. By performing a join over the requests and providers table we can compute a mapping from where requests are performed to where they are provided. Before presented the results in the next section, we follow by providing some implementation details to process and find the providers data. \subsection{Implementation details} The code and scripts that were used to process the data for this study can be found in \url{https://github.com/pedroAkos/IPFS-location-requested-content}. The processing of data required fine tuning of the parallelization of queries to IPFS to become timely. This was required because IPFS can take some time to retrieve the provider records from the DHT; from our study the average latency was about $6$ seconds, with the maximum latency reaching up to $1.5$ hours; we made parallel queries to IPFS to fetch provider records. However, libp2p can be extremely taxing on the network, as a libp2p node can maintain hundreds of connections and perform thousands of requests. To put this in perspective, a process executing $100$ queries in parallel to find providers would produce almost $10,000$ packets per minute. The process to resolve all $4,009,575$ distinct cIds took around $40$ hours. \iffalse \paragraph{Continuous measurements.} Ideally, the code and scrips we designed for this study would be a part of a continuous monitoring infrastructure to enable the analysis of the IPFS workload in near real-time (as there are natural delays in the processing of the data). This would enable a continuous study to understand when to roll-out changes to the IPFS nodes that better adjust to the evolving workload. In fact, the code we provide in our repository is already prepared for this task, featuring a full containerized and tunable architecture, capable of receiving log entries as a stream from a message queue broker (e.g., rabbitmq, kafka, etc). As opposed to our study, a continuous monitoring of the workload would require multiple requests for finding providers due to content popularity. To avoid this, we keep memory of the providers fetched for a period of time, and update the database only when was a provider peer last seen. This enable to study the evolution of providers over time of any given requested cId. Fine tuning this architecture will be one of the focuses of future work. \fi \section{Results}\label{sec:res} In this section we analyze the results from our study to characterize the IPFS workload. In particular we are interested in answering the following questions: \begin{enumerate} \item \emph{How many requests are made to IPFS on average per day?} \item \emph{How is the request frequency distributed over different cIds in the system?} \item \emph{How are providers geo-distributed in the system?} \item \emph{How is provided content distributed across providers in the system?} \item \emph{How does the location of requested content correlate with the location of providers for requested content?} \end{enumerate} To answer these question, we analyze the data first from the point of view of requests by analyzing the requests data extracted from the gateway logs (Section.~\ref{sec:res:reqs}). We then analyze the data from the point of view of providers using the data we extracted directly from IPFS (Section~\ref{sec:res:provs}). Finally, we analyze both requests and providers data to produce a correlation between the location of requests' origins and content providers (Section~\ref{sec:res:loc}). \subsection{Requests}\label{sec:res:reqs} In this section we analyze the results from the perspective of content fetchers. With this, we aim to answer the first two questions of our analysis. \emph{How many requests are made to IPFS on average per day?} and \emph{How is the request frequency distributed over different cIds in the system?} We begin by answering the first question. Figure~\ref{fig:reqs} represents the client requests processed by the gateway per hour. Notice that Figure~\ref{fig:reqs:all} captures all requests made during the period of two weeks (x axis), Figure~\ref{fig:reqs:cont} captures the same requests but characterized by continent, and Figure~\ref{fig:reqs:cont:day} focuses on the requests characterized by continent for only the first $3$ days of the analysis period, with the night hours shaded on the gateway's timezone (GMT-7). \begin{figure}[t!] \centering \subcaptionbox{All.\label{fig:reqs:all}}{ \includegraphics[width=1\linewidth]{python/res/requests_by_hour.pdf}} \subcaptionbox{Per continent.\label{fig:reqs:cont}}{ \includegraphics[width=1\linewidth]{python/res/requests_by_hour_by_continent.pdf}} \subcaptionbox{Three days.\label{fig:reqs:cont:day}}{ \includegraphics[width=1\linewidth]{python/res/requests_day_by_hour_by_continent.pdf}} \caption{Requests over time. \label{fig:reqs}} \end{figure} Figure~\ref{fig:reqs:all} shows that, on average, more than $150,000$ requests per hour are made to the IPFS gateway, reaching a maximum of almost $275,000$ requests per hour. Notice that on day $2022$-$03$-$14$ the requests suddenly drop. We verified this, and indeed the logs we have from that day abruptly stop after a few hours (just before the $5$ hour mark). Most likely, this was due to an issue with the gateway that day that made it unreachable for about $9$ hours, which after then resumed processing requests regularly. From Figure~\ref{fig:reqs:cont} we can see that most of the gateway traffic is split from North America (NA) and Asia (AS) with more than an average of $75,000$ requests per hour with origin on each region. The third region with the most requests per hour is Oceania (OC) with an average of around $2,500$ requests per hour. This is followed by Europe (EU) with an average of around $85$ requests per hour, Africa (AF) with an average of around $57$ requests per hour, and South America (SA) with an average of only $3$ requests per hour. From these results we conclude that this IPFS gateway handles predominantly traffic from North America and Asia with a high volume of requests. Note that there are other public gateways located in other regions although, of the most popular ones, most are located in North America with some located in Europe\footnote{A full list of public IPFS gateways can be found in \url{https://ipfs.github.io/public-gateway-checker/}}. To understand if this high volume of traffic has a day/night pattern, on Figure~\ref{fig:reqs:cont:day} we plot the requests per day of the first $3$ days of our analysis, and shaded the areas of the plot that represent the night cycle. Note that the time on the x axis, represents the time at the gateway (on the North American GMT-7 timezone). From these results, it is not obvious that there exists a day/night pattern for the North American traffic. However, there is a slight tendency towards having more traffic during the night, although marginal. On the other hand, we also noticed that if we shifted the timezone, the Asian traffic would also not follow the day/night pattern clearly. What is clear, is that the Asian and North American traffic exhibit somewhat symmetric patterns over time, whose variations cancel each other maintaining a high and almost constant load of traffic on the gateway at all times. This effectively shows that the IPFS network is never idle. \begin{figure}[t!] \centering \subcaptionbox{ECDF.\label{fig:cids:all:ecdf}}{ \includegraphics[width=0.45\linewidth]{python/res/requests_cid_popularity_ecdf.pdf}} \subcaptionbox{Distribution.\label{fig:cids:all:scatter}}{ \includegraphics[width=0.45\linewidth]{python/res/requests_cid_popularity.pdf}} \caption{All requested cIds frequency. \label{fig:cids:all}} \end{figure} \begin{figure}[t!] \centering \subcaptionbox{ECDF.\label{fig:cids:cont:ecdf}}{ \includegraphics[width=0.45\linewidth]{python/res/requests_cid_popularity_by_continent_ecdf.pdf}} \subcaptionbox{Distribution.\label{fig:cids:cont:scatter}}{ \includegraphics[width=0.45\linewidth]{python/res/requests_cid_popularity_by_continent.pdf}} \caption{Per continent requested cIds frequency. \label{fig:cids:cont}} \end{figure} Figures~\ref{fig:cids:all}~and~\ref{fig:cids:cont} represent the frequency of requests performed for a cId (i.e., how many times was a cId requested from the gateway by a user). These results serve to answer question $\#2$: \emph{How is the request frequency distributed over different cIds in the system?} Figure~\ref{fig:cids:all:ecdf} shows an ECDF for all requested cIds. Notice that the x axis (representing the frequency of requests) is in logarithmic scale. The y axis captures the proportion of requested cIds with at most that amount of accesses. We notice that almost half of all cIds are only requested once. After that, the frequency increases with decreasing increments on the proportion of cIds, where we that about $90\%$ of all cIds are requested at most $10$ times and about $99\%$ of all cIds are requested at most $100$ times. Figure~\ref{fig:cids:all:scatter} complements the ECDF showing the distributions of frequency of requests (shown on the y axis) over the number of cIds (shown on the x axis). Each point in this distribution represents how many cIds where requested how many times. Note that both axis of this figure are in logarithmic scale. From this figure we can see the tendency on the frequency of requests over the number of cIds, which resembles a typical Zipf distribution. Table~\ref{tab:top10} summarizes the frequency of the top $10$ requested cIds. We can further add, that most of these top $10$ most requested cIds were Non-Fungible Tokens (NFT) related data, suggesting that this is a primary use case for IPFS. Figure~\ref{fig:cids:cont} shows the same information but characterized by the following regions: Africa (AF), Asia (AS), Europe (SA), North America (NA), Oceania (OC), and South America (SA). Figure~\ref{fig:cids:cont:ecdf} shows an ECDF for the frequency of requested cIds (on the x axis in logarithmic scale) over the proportion of requests (on the y axis), discriminated by region. We notice that almost $60\%$ of requests originating from Asia, request at most the same cId thrice, whereas $60\%$ of requests originating from North America request the same cId only once. This shows that content requested from Asia has a higher popularity (i.e., the same cIds are requested more often) than in the remainder of regions. Figure~\ref{fig:cids:cont:scatter} complements the ECDF with the distributions of frequency of requests (shown on the y axis in logarithmic scale) over the number of cIds (shown on the x axis in logarithmic). However, it shows that all regions seem to present a similar Zipf distribution albeit, with different proportions, that is proportional to the request rate originating from each region. \begin{table}[t!] \centering \caption{Top 10 summary of data in descending order. The first column represents the amount of requests to each cIds. The second column represents the amount of replicas of each cIds. The third column represents the amount of different cIds provided by each provider node. Each column is independent, encoding different cIds and providers.} \begin{tabular}{ c | c | c } \toprule Requested cIds & Replicated cIds & cIds per Provider \\ \midrule $482,620$ & $12,610$ & $869,734$ \\ $290,485$ & $5,274$ & $213,837$ \\ $254,132$ & $4,663$ & $202,947$ \\ $213,019$ & $2,047$ & $200,373$ \\ $209,913$ & $1,876$ & $176,180$ \\ $203,510$ & $1,822$ & $174,803$ \\ $199,628$ & $1,404$ & $173,315$ \\ $198,500$ & $1,372$ & $144,422$ \\ $193,432$ & $1,283$ & $108,023$ \\ $138,084$ & $1,272$ & $107,885$ \\ \bottomrule \end{tabular} \label{tab:top10} \end{table} \subsection{Providers}\label{sec:res:provs} In this section we analyze the results from the perspective of providers. With this, we aim to answer questions $\#3$ and $\#4$ of our analysis. \emph{How are providers geo-distributed in the system?} and \emph{How is provided content distributed across providers in the system?} The first question is answered by the results presented in Table~\ref{tab:provs:cont}. which shows the number of providers per continent. Notice that North America (NA) has almost as many providers as Europe (EU) and Asia (AS) together. This shows, that North America composes the largest portion of the content providers on the IPFS system (which is corroborated with previous studies\,\cite{studyipfs1, studyipfs2}). Furthermore, notice the last two columns in the table, that represent providers that only had a relay address (labeled as Rl), meaning they where behind a NAT without a public address; and providers whose location information was unknown (labeled as Un), meaning there was no entry on the MaxMind database for those providers public IP address. As the location of Rl nodes is also unknown, from this point on all Rl nodes are considered as belonging to the Un category. \begin{table}[t!] \centering \small \caption{Providers geo-distribution.} \begin{tabular}{ l | c | c | c | c | c | c | c | c | c } \toprule & AF & AS & EU & NA & OC & SA & AN & Rl & Un \\ \midrule Providers & $40$ & $4959$ & $5789$ & $10983$ & $431$ & $104$ & $1$ & $2473$ & $689$ \\ \bottomrule \end{tabular} \label{tab:provs:cont} \end{table} To answer question $\#4$: \emph{How is provided content distributed across providers in the system?} we analyze both the amount of content replication in the system (Figure~\ref{fig:cid_replica}) and the amount of (different) content provided by each individual provider node in the system (Figure~\ref{fig:prov}). Figure~\ref{fig:cid_replica} analyzes the amount of replicated content over different providers. Figure~\ref{fig:cid_replica:all} shows an ECDF that captures the amount of replicas (on the x axis in logarithmic scale) that were found for the proportion of cIds in the system (on the y axis). We note that almost $70\%$ of all cIds in the system are replicated at most twice (i.e., provided by at most two different provider nodes in the system). Only a very small proportion of cIds are replicated by a large number of providers. Table~\ref{tab:top10} summarizes the amount of replicas of the top $10$ replicated cIds, where, after looking into these cIds, we found that most of them are IPFS manual pages. We verified if theses highly replicated cIds where also the most requested cIds and found that this was not the case. In fact, the top $10$ requested cIds are not very replicated in the system, having only a few providers (only $3$ of these cIds have more than $10$ providers, with the most provided being by $29$ and $28$ peers). Figure~\ref{fig:cid_replica:cont} breaks down the cId replicas by region. Here we notice that Africa has the most replicas of cIds although, this does not represent a large number as there are only a few providers in that region. Although it is not visible in the plot, there is a small percentage of cIds that is highly replicated in North America. This is not surprising, as North America has the largest number of content providers. Nevertheless, these results suggest that there is a very limited high availability of provided content through replication in the system. This can be mostly explained by the way content is replicated, where there needs to be an explicit (re)provide action by the user after fetching a copy of the content from other provider(s). \begin{figure}[t!] \centering \subcaptionbox{All.\label{fig:cid_replica:all}}{ \includegraphics[width=0.45\linewidth]{python/res/cid_replicas.pdf}} \subcaptionbox{Per continent.\label{fig:cid_replica:cont}}{ \includegraphics[width=0.45\linewidth]{python/res/cid_replicas_per_continent.pdf}} \caption{cId replicas. \label{fig:cid_replica}} \end{figure} Figure~\ref{fig:prov} shows the amount of different cIds each provider provides. Figure~\ref{fig:prov:all} presents an ECDF of the proportion of providers (on the y axis) that provide different amounts of cIds (on the x axis in logarithmic scale), here we can see that $60\%$ of providers only provide a single cId. We also note that less than $10\%$ of providers provide at least $10$ cIds, with a very small proportion of providers providing at least $1,000$ cIds. The providers that provide more cIds amount to the largest part of provided cIds, meaning that most cIds are provided by the same small set of providers. This is not surprising, as there are pinning services for IPFS content (services that hosts content for users on IPFS in servers controlled by the pinning service provider for a fee). Table~\ref{tab:top10} summarizes the top $10$ providers with the most cIds. Some of these providers had DNS multiaddress, which we verified pointed to DNS records suggesting these providers belonged to \texttt{nft.storage}, which is a popular storage service for NFT content in IPFS. Figure~\ref{fig:prov:cont} analyzes the proportion of providers (on the y axis) that provide different amounts of cIds (on the x axis in logarithmic scale) categorized by continent, which shows that the large providers are mostly located in North America (NA), Europe (EU), and Oceania (OC). The fact that the biggest portion of cIds is provided only by a small set of providers suggests that although IPFS is a decentralized content network system, the content stored in IPFS presents a hight degree of centralization in this small set of provider peers. \begin{figure}[t!] \centering \subcaptionbox{All.\label{fig:prov:all}}{ \includegraphics[width=0.45\linewidth]{python/res/cid_per_provider.pdf}} \subcaptionbox{Per continent.\label{fig:prov:cont}}{ \includegraphics[width=0.45\linewidth]{python/res/cid_per_provider_per_continent.pdf}} \caption{cIds per provider. \label{fig:prov}} \end{figure} \subsection{Requested content vs. provided content}\label{sec:res:loc} Finally, in this section we combine gathered data from the requests and the providers to obtain a global view of the workload, and to answer the last question: \emph{How does the location of requested content correlate with the location of providers for requested content?} To this end, we matched the request's origin location to the providers location, generating a heatmap (presented in Figure~\ref{fig:heatmap}) that matches the location from where each request was made to the location of provider(s) that had the requested content. On Figure~\ref{fig:heatmap} the rows represent the location of the origin of requests while the columns present the location of providers. Note that a single request can be served by multiple locations, as per the cId replication factor we discussed previously. We normalized the requests per region to eliminate the disparity in quantity of requests, showing on the heatmap the percentage of all requests made from one region to any other region (including itself). By analyzing the heatmap, we notice that vast majority of all requests from all regions are either provided by providers in North America or in Europe. This is not surprising as the vast majority of content is located in these regions. Furthermore, from this heatmap we can conclude that the North American region contains the most popular cIds, which from the previous observation that requests follow a Zipf distribution, we may also conclude that the Zipf is not independent per region. Finally, one important observation that can be extracted from this, is that IPFS is indeed a planetary-scale distributed service, used by users to share content that is not mostly local, otherwise we should observe a large majority of content being accessed by users to be served by providers in the same region (i.e., the heat would be concentrated mostly on the diagonal of the heatmap) \begin{figure}[t!] \centering \includegraphics[width=0.6\linewidth]{python/res/heatmap.pdf} \caption{Request locality. \label{fig:heatmap}} \end{figure} \section{Related Work}\label{sec:related} Measuring and understanding the behavior of large scale and decentralized systems has always been an important task, with a vast amount of studies being made for peer-to-peer systems in the early $2000$'s. In particular we highlight two studies over peer-to-peer systems, one that also analyzes the traffic of large scale systems, and a second that characterizes the workload of BitTorrent. The first\,\cite{studyp2p1} analyzes the peer-to-peer traffic across large networks such as FastTrack, Gnutella, and DirectConnect, from the point of view of a single ISP. Their findings are similar to ours in the sense that they also observe most of the traffic being generated by a very small amount of hosts. The second study\,\cite{studyp2p2} analyzes the popular BitTorrent peer-to-peer file-sharing system. In this study, the authors perform active measurements in the systems to obtain data related to upload and download speeds. On the other hand, our study focuses on other aspects of the system such as the distribution and popularity of content being published and accessed through the system and access patterns to that content. More recent studies on peer-to-peer systems include blockchain systems such as Bitcoin and Ethereum. Here we highlight two studies\,\cite{studyblockchain1,studyblockchain2}, that focus on the transactions made within Bitcoin and Ethereum blockchains. These studies characterize the performance of blockchain systems but fail to provide insights over system network properties, such as the number of peers per region or workload distribution over peers. Our study complements these by focussing on IPFS, an increasingly relevant solution of the Web3 ecosystem. Finally, we highlight two more studies\,\cite{studyp2p1,studyp2p2} over IPFS that are complementary to our own study. The first study\,\cite{studyp2p1} aims at mapping IPFS, to understand the distribution of peers over regions. Our own study confirms the findings from this work and complements it with a characterization on the popularity of content made available by providers. The second study\,\cite{studyp2p2} focuses on the characterization of Bitswap traffic inside the system and how does it affect privacy. Our study focuses on traffic generated outside the system through the main public IPFS gateway. However, complementing our study with observations extracted from Bitswap traffic is a goal for future work. \section{Conclusion}\label{sec:con} In this paper we presented a study over the traffic processed by one of the most popular IPFS gateways to help guide the design of optimizations for future Web3 systems. The traffic showed the amount of requests to IPFS content from various locations in the World, although mainly from North America and Asia. We collected the requests and performed searches on the IPFS system to find the providers, and their location, for each requested content. We analyzed both datasets and found requests follow a Zipf distribution, where the most popularly requested content is only provided by a few providers. This means that IPFS is not well balanced, which may lead to these popular provider nodes to become overly saturated with requests. From our observations, we propose a research agenda to improve IPFS with the following points: \begin{itemize} \item IPFS needs to remove the load on highly popular providers. To achieve this, new incentive mechanism are required to incentivize peers that fetch content to also replicate the content. \item Because IPFS publishes provider records on the DHT, the load on the DHT will not be balanced by an increased number of providers replicating content. This is because the records will still be stored in the same peers of the DHT, which suggests that a DHT presents a sub-optimal design for load balancing IPFS workload. \item Monitoring large scale systems is an important task that needs to be done continuously, as user and application patterns might shift. It is essential to complement these types of studies with more observations from systems operating in the wild. However, to achieve this, robust telemetry protocols are required to be integrated in these Web3 systems. \end{itemize} \bibliographystyle{plain}
\section{#1}\setcounter{equation}{0}} \renewcommand{\theequation}{\thesection.\arabic{equation}} \newcommand{{\rm e}}{{\rm e}} \newcommand{{\mathsf{i}}}{{\mathsf{i}}} \newcommand{{\rm d}}{{\rm d}} \newcommand{\nonumber \\}{\nonumber \\} \newcommand{\wt}[1]{\widetilde{#1}} \newcommand{\wh}[1]{\widehat{#1}} \newcommand{\wb}[1]{\overline{#1}} \newcommand{\epsilon_1}{\epsilon_1} \newcommand{\epsilon_2}{\epsilon_2} \newcommand{\und}[1]{\underline{#1}} \newcommand{\omega}{\omega} \newcommand{\mathfrak{so}}{\mathfrak{so}} \newcommand{\mathfrak{su}}{\mathfrak{su}} \newcommand{\mathfrak{so}}{\mathfrak{so}} \newcommand{\mathfrak{su}}{\mathfrak{su}} \newcommand{\mathfrak{sp}}{\mathfrak{sp}} \newtheorem{theorem}{Theorem} \newtheorem{lemma}[theorem]{Lemma} \newtheorem{prop}[theorem]{Proposition} \theoremstyle{definition} \newtheorem{definition}[theorem]{Definition} \newtheorem{example}[theorem]{Example} \newtheorem{xca}[theorem]{Exercise} \newtheorem{corollary}{Corollaire}[section] \newtheorem{proposition}[theorem]{Proposition} \newtheorem{remark}[theorem]{Remark} \newtheorem{rappel}[theorem]{{\bf Rappel}} \newtheorem{conj}[theorem]{Conjecture} \title{Twisted Elliptic Genera} \author[a]{Kimyeong Lee,} \author[b]{Kaiwen Sun,} \author[b]{Xin Wang} \affiliation[a]{School of Physics, Korea Institute for Advanced Study,\\Hoegiro 85, Seoul 02455, Korea} \affiliation[b]{Quantum Universe Center, Korea Institute for Advanced Study,\\Hoegiro 85, Seoul 02455, Korea} \emailAdd{<EMAIL>, <EMAIL>, <EMAIL>} \preprint{KIAS-Q22012} \abstract{We study the twisted elliptic genera of 2d $(0,4)$ SCFTs associated with the BPS strings in the twisted circle compactification of 6d rank-one $(1,0)$ SCFTs. Such objects can arise when the 6d gauge algebra allows outer automorphism, thus are classified by twisted affine Lie algebras. We study several fascinating aspects of the twisted elliptic genera including 2d localization, twisted elliptic blowup equations, Higgsing and spectral flow symmetry. We derive a recursion formula with respect to the number of strings to exactly compute the twisted elliptic genera. We also investigate the modular bootstrap of twisted one-string elliptic genera and find the modularity of congruence subgroups $\Gamma_1(N)$ naturally appears with possible $N=2,3,4$. Geometrically, our study solves the refined BPS partition functions of the underlying genus-one fibered Calabi-Yau threefolds with $N$-section.} \begin{document} \maketitle \section{Introduction} The classification of superconformal field theories (SCFTs) and supersymmetric gauge theories in various dimensions has been a major subject in the study of supersymmetry in the recent decades. Given Nahm's classification on superconformal algebras \cite{Nahm:1977tg}, the highest dimension in which a nontrivial SCFT can exist is six. It is now well-known that the 6d $(2,0)$ SCFTs admit an ADE classification \cite{Witten:1995zh, Strominger:1995ac}, while the 6d $(1,0)$ SCFTs admit an ``atomic classification" with certain generalized quiver structures \cite{Heckman:2015bfa}. See an excellent review \cite{Heckman:2018jxk}. More recently, much progress has been made in the understanding of the compactification of 6d SCFTs to lower dimensions. In particular, the compactification to 5d Kaluza-Klein (KK) theories is mostly understood and results in a conjectural classification on 5d SCFTs by decoupling 5d hypermultiplets from the KK theories \cite{Jefferson:2017ahm,Jefferson:2018irk,Bhardwaj:2018yhy,Bhardwaj:2018vuu,Bhardwaj:2019fzv}. Besides the straightforward circle compactification, it was observed in \cite{Bhardwaj:2019fzv} that when a 6d SCFT has a discrete global symmetry, one can do {\it twisted circle compactification} to a new 5d KK theory. This process brings in a large class of highly nontrivial 5d KK theories, many of which have fascinating 5d Lagrangian descriptions \cite{Bhardwaj:2020gyu}. There exist two possibilities for the 6d discrete global symmetry: the first kind comes when the gauge algebra allows outer automorphism, in which case the twisted circle compactification means to fold the 6d vector multiplets; the second kind comes when the quiver structure has a discrete symmetry, in which case one folds the 6d tensor multiplets. In the current work, we are interested in the first kind of twisted circle compactification of 6d $(1,0)$ SCFTs as it is classified by {\it twisted affine Lie algebras} and related to the modularity of congruence subgroups $\Gamma_1(N)$. The second kind of twisted circle compactification for 6d $(2,0)$ SCFTs has been studied in \cite{Duan:2021ges}. The 6d $(1,0)$ SCFTs can be geometrically engineered by F-theory compactified on non-compact elliptic Calabi-Yau threefolds. More precisely, such Calabi-Yau geometry $M$ is an elliptic fibration over a non-compact base surface $B$ in which all curves are simultaneously shrinkable to zero volume. The $\dim H^{1,1}(B,\mathbb{Z})$ gives the dimension of the tensor branch, i.e., the rank of the 6d $(1,0)$ SCFT. We are particularly interested in the rank one case, where the non-compact base $B$ is just $\mathcal{O}_{\mathbb{P}^1}(-\mathfrak{n})$ for $\mathfrak{n}=1,2,3,\dots,8,12$. The geometric engineering suggests that when a 6d $(1,0)$ SCFT is put on the 6d Nekrasov Omega background $\mathbb{C}^2_{\epsilon_1,\epsilon_2}\times T^2$, the partition function should be equal to the refined topological string partition function on Calabi-Yau $M$. On the other hand, 6d $(1,0)$ SCFTs contain the BPS strings or the so-called self-dual strings with worldsheet theory as 2d $(0,4)$ SCFTs. From the viewpoint of worldsheet, the elliptic genera of the 2d theories should also be equal to the 6d partition function upon suitable expansion by the number of strings. Along with the circle compactification to 5d KK theory, these yield the well established relation chain \begin{equation}\label{eq:chain1} \mathbb{E}^{\textrm{2d } (0,4) \textrm{ SCFT}}=Z_{\mathbb{R}^4\times T^2}^{\textrm{6d } (1,0) \textrm{ SCFT}}=Z_{\mathbb{R}^4\times S^1}^{\textrm{5d KK}}=Z^{\textrm{ref. top.}}_{\textrm{non-compact elliptic CY3}}. \end{equation} In the case of twisted circle compactification, the non-compact elliptic Calabi-Yau threefolds are generalized to non-compact genus-one fibered Calabi-Yau threefolds, with additional rational sections or just $N$-sections. The genus-one fibered Calabi-Yau geometries and their role in F-theory compactification have drawn lots of attention in recent years \cite{Morrison:2014era,Braun:2014oya,Anderson:2018heq,Cota:2019cjx,Anderson:2019kmx,Oehlmann:2019ohh,Kimura:2019bzv,Knapp:2021vkm,Schimannek:2021pau,Dierigl:2022zll}. In our situation, the number of sections is naturally reflected by the type of twists: \begin{equation} N=\left\{ \begin{array}{cl} 2,\phantom{=} & A_{2r-1}^{(2)},D_r^{(2)},E_6^{(2)}, \\ 3,\phantom{=} & D_4^{(3)}, \\ 4,\phantom{=} & A_{2r}^{(2)}. \end{array} \right. \end{equation} The geometric engineering of these special genus-one fibered Calabi-Yau threefolds produces the twisted compactification of 6d $(1,0)$ SCFTs. The BPS strings of the 6d SCFTs on the torus $T^2=S^1\times S^1$ also get twisted along one $S^1$ in the sixth direction such that the elliptic genera now have fractional $q^{1/N}$ orders. Although both the 6d SCFTs and the 2d worldsheet theories are in twisted circle compactification, one can still look from 6d and 2d to keep the modularity manifest. Notably, the modularity is no longer the $SL(2,\mathbb{Z})$ of ordinary elliptic genera, but the congruence subgroups $\Gamma_1(N)$ of $SL(2,\mathbb{Z})$. In summary, we expect the following twisted version of the relation chain \eqref{eq:chain1} as \begin{equation} {\mathbb{E}^{\textrm{2d } (0,4) \textrm{ SCFT}}_{\rm twisted}}=Z_{\mathbb{R}^4\times S^1\times S^1, \textrm{twisted }}^{\textrm{6d } (1,0) \textrm{ SCFT}}=Z_{\mathbb{R}^4\times S^1}^{\textrm{5d KK}}=Z^{\textrm{ref. top.}}_{\textrm{non-compact genus-one fibered CY3}}. \end{equation} We are interested in the \emph{twisted elliptic genera} arising here. It should be noted that this term actually has already been used in a different context for 2d $\mathcal{N}=(2,2)$ SCFTs such as the twisted elliptic genus of K3 surface, see e.g. \cite{Kawai:2009ci,Eguchi:2010fg}. The twist in our term comes from the same twist as in twisted affine Lie algebras and is specifically for 2d $\mathcal{N}=(0,4)$ SCFTs, thus should not be confused. For the second kind of twist, one can also study the associated twisted elliptic genera, which for the 6d $(2,0)$ cases have been studied in \cite{Duan:2021ges}. However, those are not related to twisted affine Lie algebras, thus are not the concern of the current paper. Some typical examples of twisted circle compactification include the $\mathbb{Z}_2$ twist of 6d $(1,0)$ pure $\mathfrak{su}(3)$ SCFT which compactifies to the 5d $\mathfrak{su}(3)$ gauge theory with Chern-Simons level 9, and the $\mathbb{Z}_3$ twist of 6d $(1,0)$ pure $\mathfrak{so}(8)$ SCFT which compactifies to 5d $\mathfrak{su}(4)$ gauge theory with Chern-Simons level 8. The 5d KK theories are not necessarily gauge theories. For example, the $\mathbb{Z}_2$ twist of 6d $(1,0)$ pure $\mathfrak{so}(8)$ SCFT is known to be a 5d non-Lagrangian theory. We will study the twisted elliptic genera for all these examples in this paper. In the following, we summarize several approaches to the twisted elliptic genera. \begin{itemize} \item Localization of 2d $(0,4)$ SCFTs. Elliptic genera of some special 2d theories can be exactly computed by 2d localization, i.e., Jeffrey-Kirwan residue, analogous to the ADHM construction in 0d \cite{Benini:2013nda,Benini:2013xpa}. This approach can be generalized to some special $\mathbb{Z}_2$ twisted theories \cite{Kim:2021cua}. In general, this method when applicable is the most efficient way to compute (twisted) elliptic genera to arbitrary number of strings. Two known examples are the $\mathfrak{n}=3,$ $\mathfrak{su}(3)^{(2)}$ theory and the $\mathfrak{n}=4,$ $\mathfrak{so}({2r+8})^{(2)}$ theories which we will review in Section \ref{sec:2dquiver}. \item $\Gamma_1(N)$ modular ansatz. The modular ansatz method exploits the modularity of elliptic genera \cite{DelZotto:2016pvm,Gu:2017ccq,DelZotto:2017mee,DelZotto:2018tcj,Kim:2018gak}, inspired by the early work on compact elliptic Calabi-Yau threefolds \cite{Huang:2015sta}. In particular, the $SL(2,\mathbb{Z})$ modular ansatz for the one-string elliptic genera of rank-one 6d $(1,0)$ SCFTs has been extensively studied in \cite{DelZotto:2018tcj}. On the other hand, the modular ansatz of congruence subgroups $\Gamma_0(N)$ and $\Gamma_1(N)$ has been investigated in \cite{Cota:2019cjx,Knapp:2021vkm,Schimannek:2021pau} for topological strings on genus-one fibered Calabi-Yau threefolds with $N$-section. Recently, the genus-one fibered Calabi-Yau threefolds associated with twisted affine Lie algebras were discussed in \cite{paultalk}. We combine these results together to propose a suitable $\Gamma_1(N)$ modular ansatz for the one-string twisted elliptic genera and successfully fix the ansatz for almost all rank-one twisted theories. Interestingly, we find that for almost all rank-one twisted theories, the modular group is enhanced from $\Gamma_1(N)$ to $\Gamma_0(N)$. \item Brane webs and topological vertex. Many 6d $(1,0)$ SCFTs allow brane-web interpretations. When the brane-web construction exists, one can use the (refined) topological vertex to compute the 6d partition function. This method can be cleverly extended to some $\mathbb{Z}_2$ twisted theories by including O5-planes \cite{Hayashi:2020hhb,Kim:2021cua,Kim:2022dbr}. For example, the 5d $\mathfrak{su}(3)_9$ partition function can be computed by an extension of topological vertex called O-vertex \cite{Hayashi:2020hhb,Nawata:2021dlk}. \item Twisting from Higgsing. It has been noticed that some 6d twisted theories can be obtained by the Higgsing from 6d untwisted theories \cite{Kim:2019dqn,Hayashi:2021pcj}. This generalizes the known Higgsing trees for 6d $(1,0)$ SCFTs, see e.g. \cite{DelZotto:2018tcj}. Most known examples of twisting from Higgsing come from $\mathfrak{so}({2r})^{(2)}$ type of theories with $\mathfrak{n}=2,3,4$ \cite{Kim:2019dqn,Hayashi:2021pcj}. We will systematically study the twisting from Higgsing phenomenon for all rank-one theories, including the Higgsing from both untwisted theories and twisted ones. We will also propose a simple algebraic method to determine the precise Higgsing conditions based on representation decompositions. \item Twisted elliptic blowup equations and the recursion formula. This will be the main computational method in the current paper. In a series of works \cite{Gu:2018gmy,Gu:2019dan,Gu:2019pqj,Gu:2020fem}, the elliptic blowup equations have been established for the elliptic genera of all 6d $(1,0)$ SCFTs, which generalized Nakajima-Yoshioka's blowup equations in 4d and 5d \cite{Nakajima:2003pg,Nakajima:2005fg,Gottsche:2006bm,Nakajima:2009qjc,Keller:2012da,Kim:2019uqw}. Now we further generalize these very efficient and universal functional equations to all 6d rank-one twisted theories, both unity and vanishing blowup equations. We focus on the elliptic form, rather than the 5d form or geometric form of blowup equations, such that the twisted elliptic genera can be directly computed. Some unity blowup equations for some simple twisted theories have been studied in \cite{Kim:2020hhh}. \end{itemize} This paper is organized as follows. In Section \ref{sec:gen}, we give an overview on some salient features of 6d $(1,0)$ SCFTs and their twisted circle compactification. We will define twisted elliptic genera of the BPS strings and describe a fundamental quantity -- the modular index. In Section \ref{sec:blowup}, we generalize the elliptic blowup equations in previous works to the twisted cases and derive a recursive formula to compute the twisted elliptic genera efficiently. In Section \ref{sec:spectralflow}, we focus on twisted one-string elliptic genera and study their universal features. In particular, we generalize the spectral flow symmetry of the one-string elliptic genera of 2d $(0,4)$ theories discovered by Del Zotto and Lockhart \cite{DelZotto:2016pvm,DelZotto:2018tcj} to the twisted cases. In Section \ref{sec:MA}, we exploit the modularity of twisted elliptic genera, and propose the proper modular ansatz with modular group $\Gamma_1(N)$ with $N=2,3,4$. In Section \ref{sec:higgsing}, we discuss the Higgsing relations among untwisted/twisted 6d $(1,0)$ SCFTs. In Section \ref{sec:outlook}, we summarize our results and point out some further directions. Our conventions for simple Lie algebras and affine Lie algebras are the same with \cite{Gu:2020fem}, see Appendix A therein. We often use $\mathfrak{su},\mathfrak{so}$ and $\mathfrak{sp}$ for classical gauge algebras where $\mathfrak{sp}(r) $ is equivalent to $C_r$. We will also use $A,B,C,D$ for more algebraic contexts. We frequently use $q=e^{2\pi i \tau}$, $v=e^{2\pi i \epsilon_+}$ and $x=e^{2\pi i \epsilon_-} $ as multiplicative variables following \cite{DelZotto:2018tcj}, where $\epsilon_\pm=(\epsilon_1\pm \epsilon_2)/2$. \section{General theory}\label{sec:gen} \subsection{Review of rank one 6d $(1,0)$ SCFTs} In this section, we briefly review some known results on the rank-one 6d $(1,0)$ SCFTs established in \cite{Morrison:2012np,Heckman:2013pva,Heckman:2015bfa}. More extensive reviews can be found in e.g. \cite{Heckman:2018jxk,DelZotto:2018tcj,Gu:2020fem}. The rank-one 6d $(1,0)$ SCFTs on the tensor branch are the natural elliptic lift of 4d $\mathcal{N}=2$ and 5d $\mathcal{N}=1$ gauge theories with 8 supercharges. They are geometrically engineered by compactifying F-theory on certain elliptic non-compact Calabi-Yau threefolds \cite{Morrison:1996na,Morrison:1996pp}. To be precise, these Calabi-Yau threefolds can be realized as elliptic fibration over some non-compact base surfaces $\mathcal{O}(-{\mathfrak{n}})\to \mathbb{P}^1$. The self-intersection number $-\mathfrak{n}$ of the base curve $\mathbb{P}^1$ can only take values from 1 to 8 and 12. This $\mathfrak{n}$ is also called the tensor coefficient. The Kodaira and Tate singularity type of the elliptic fibration gives the 6d gauge algebra ${G}$ which is supported on the $(-\mathfrak{n})$ base curve. The 6d global flavor symmetry ${F}$ on the other hand is supported on a non-compact curve intersecting with the $(-\mathfrak{n})$-curve. The 6d matters, i.e., hypermultiplets in representation ${{R}}$ sit at the intersection point between curves \cite{Katz:1996xe}. The ${(\mathfrak{n},G,{R})}$ together are highly constrained by the {Calabi-Yau condition}. All possibilities have been classified in \cite{Morrison:2012np,Heckman:2013pva,Heckman:2015bfa}. For example, there exist in total six pure gauge theories shortly denoted by $\mathfrak{n}_G$ as $3_{\mathfrak{su}(3)},4_{\mathfrak{so}(8)},5_{F_4},6_{E_6},8_{E_7}$ and $12_{E_{8}}$. Together with a $(7,{E_7},\frac12\bf56)$ theory, these are the rank-one non-Higgsable clusters which serve as the ``atoms" to be linked together to build higher rank 6d $(1,0)$ SCFTs such as conformal matter theories \cite{DelZotto:2014hpa}. Notably, the $4_{\mathfrak{so}(8)}$ theory can be extended to an infinite series of 6d $(1,0)$ SCFTs with $\mathfrak{n}=4$ which are the $\mathfrak{so}(r+8)+r\bf V$ theories. The full list of rank-one 6d $(1,0)$ SCFTs with ${(\mathfrak{n},G,F,{R})}$ can be found in e.g. \cite[Tables 20, 21]{DelZotto:2018tcj}. We collect those whose gauge algebra allows an outer automorphism i.e. type $A,D$ and $E_6$ in Table \ref{tb:rk1-1}, which will be our starting theories to perform twisted circle compactification. Interestingly, it was noticed in \cite{Gu:2020fem} that all rank-one 6d $(1,0)$ SCFTs with tensor coefficient $\mathfrak{n}$, gauge algebra $G$ and $N_i$ number of matters in representation $R_i^G$ satisfy the following constraint \begin{equation}\label{eq:c} c= \frac{h_G^{\vee}}{6}-\sum_i\frac{N_i}{12}\mathrm{Ind}(R_i^G)=\frac{\mathfrak{n}-2}{2}. \end{equation} Here $\mathrm{Ind}$ is the quadratic index of a representation. The identity shows that the combination in the left hand side depends only on the self-intersection number $-\mathfrak{n}$ of the base curve. This value will be called {\it the $c$ constant} in the current paper. The physical meaning of $-c$ is the left-moving Casimir energy in the Ramond sector of one BPS string. It also has a geometric meaning in elliptic non-compact Calabi-Yau threefolds and can be computed from the intersection theory \cite{Cota:2019cjx}. Later we will also propose an interesting generalization of the $c$ constant for the twisted theories. \begin{table}[h] \centering \begin{tabular}{|c|l|l|c|}\hline $\mathfrak{n}$ &$G$ &$F$ & $(R_G,R_F)$ \\ \hline 6&$E_6$&$-$&$-$ \\\hline \rowcolor{gray!10} 5&$E_6$&$\mathfrak{u}(1)_6$ & $\mathbf{27}_{-1}\oplus c.c.$ \\\hline 4&$\mathfrak{so}(8)$&$-$&$-$ \\ 4&$\mathfrak{so}(N\geq 9)$&$\mathfrak{sp}(N-8)_1$ & $(\mathbf{N},\mathbf{2(N-8)})$ \\ 4 &$E_6$&$\mathfrak{su}(2)_{6}\times \mathfrak{u}(1)_{12}$ & $({\bf 27},\wb{\mathbf 2})_{-1}\oplus c.c.$ \\\hline 3&$\mathfrak{su}(3)$&$-$& $-$ \\ 3&$\mathfrak{so}(8)$&$\mathfrak{sp}(1)_1^a\times \mathfrak{sp}(1)_1^b\times \mathfrak{sp}(1)_1^c$ & $(\mathbf 8_v\oplus\mathbf 8_c\oplus\mathbf 8_s,\mathbf 2)$ \\ \rowcolor{gray!10} 3&$\mathfrak{so}(10)$&$\mathfrak{sp}(3)_1^a\times (\mathfrak{su}(1)_4\times \mathfrak{u}(1)_4)^b$ & $(\mathbf{10},\mathbf 6^a)\oplus[(\mathbf{16}_s)^b_1\oplus c.c.]$ \\ \rowcolor{gray!10} 3&$\mathfrak{so}(12)$&$\mathfrak{sp}(5)_1$ & $(\mathbf{12},\mathbf{10})\oplus(\mathbf{32}_s,\mathbf{1})$ \\ \rowcolor{gray!10} 3 &$E_6$&$\mathfrak{su}(3)_{6}\times \mathfrak{u}(1)_{18}$ & $({\bf 27},\wb{\mathbf 3})_{-1}\oplus c.c.$ \\ \hline 2&$\mathfrak{su}(1)$&$\mathfrak{su}(2)_1$&$-$ \\ 2&$\mathfrak{su}(2)$&$\mathfrak{so}(7)_1\times\text{Ising}$ & $(\mathbf 2,\mathbf 8_s\times \mathbf 1_s)$ \\ 2&$\mathfrak{su}(N\geq 3)$&$\mathfrak{su}(2N)_1$ & $(\mathbf N,\wb{2\mathbf N})\oplus c.c.$ \\ 2&$\mathfrak{so}(8)$&$\mathfrak{sp}(2)_1^a\times \mathfrak{sp}(2)_1^b\times \mathfrak{sp}(2)_1^c$ & $(\mathbf 8_v,\mathbf 4^a)\oplus (\mathbf 8_s,\mathbf 4^b)\oplus (\mathbf 8_c,\mathbf 4^c)$ \\ 2&$\mathfrak{so}(10)$&$\mathfrak{sp}(4)_1^a\times (\mathfrak{su}(2)_4\times \mathfrak{u}(1)_{8})^b$ & $(\mathbf{10},\mathbf 8^a)\oplus[(\mathbf{16}_s,\mathbf 2^b)_1\oplus c.c.]$ \\ \rowcolor{gray!10} 2&$\mathfrak{so}(12)_a$&$\mathfrak{sp}(6)_1^a\times \mathfrak{so}(2)_8 $ & $(\mathbf{12},\mathbf{12}^a)\oplus(\mathbf{32}_s,\mathbf 2^b)$ \\ 2&$\mathfrak{so}(12)_b$&$\mathfrak{sp}(6)_1^a\times \text{Ising}^b\times \text{Ising}^c$ & $(\mathbf{12},\mathbf{12}^a)\oplus(\mathbf{32}_s,\mathbf 1^b_s)\oplus(\mathbf{32}_c,\mathbf 1_s^c)$ \\ 2 &$E_6$&$\mathfrak{su}(4)_{6}\times \mathfrak{u}(1)_{24}$ & $(\mathbf{27},\wb{\mathbf 4})_{-1}\oplus c.c.$ \\\hline 1&$\mathfrak{sp}(0)$&$(E_8)_1$ & $-$ \\ 1&$\mathfrak{su}(2)$&$\mathfrak{so}(20)_1$ & $(\mathbf{2},\mathbf{20})$ \\ 1&$\mathfrak{su}(3)$&$\mathfrak{su}(12)_1$ & $(\mathbf 3,\wb{\mathbf{12}})_1\oplus c.c.$ \\ \rowcolor{gray!10} 1&$\mathfrak{su}(4)$&$\mathfrak{su}(12)_1^a\times \mathfrak{su}(2)_1^b$ & $[(\mathbf 4,\wb{\mathbf{12}}_1^a)\oplus c.c.]\oplus (\mathbf 6,\mathbf 2^b)$ \\ \rowcolor{gray!10} 1 &$\mathfrak{su}(N\geq 5)$&$\mathfrak{su}(N\!+\!8)_1\!\times\! \mathfrak{u}(1)_{2N(N-1)(N+8)}$ &$[(\mathbf{N},\wb{\mathbf{N+8}})_{-N+4}\oplus(\mathbf{\Lambda}^2,\mathbf{1})_{N+8}]\oplus c.c.$ \\ \rowcolor{gray!10} 1&$\mathfrak{su}(6)_*$&$\mathfrak{su}(15)_1$ & $[(\mathbf{6},\overline{\mathbf{15}})\oplus c.c.]\oplus (\mathbf{20},\mathbf{1})$ \\ 1&$\mathfrak{so}(8)$&$\mathfrak{sp}(3)_1^a\times \mathfrak{sp}(3)_1^b\times \mathfrak{sp}(3)_1^c$ & $(\mathbf{8}_v,\mathbf{6}^a)\oplus(\mathbf{8}_s,\mathbf{6}^b)\oplus(\mathbf{8}_c,\mathbf{6}^c)$ \\ \rowcolor{gray!10} 1&$\mathfrak{so}(10)$&$\mathfrak{sp}(5)_1^a\times (\mathfrak{su}(3)_4\times \mathfrak{u}(1)_{12})^b$ & $(\mathbf{10},\mathbf{10}^a)\oplus[(\mathbf{16}_s,\mathbf{3}^b)_1\oplus c.c.]$ \\ \rowcolor{gray!10} 1&$\mathfrak{so}(12)_a$&$\mathfrak{sp}(7)_1^a\times \mathfrak{so}(3)_8^b$ & $(\mathbf{12},\mathbf{14}^a)\oplus(\mathbf{32}_s,\mathbf{3}^b)$ \\ \rowcolor{gray!10} 1&$\mathfrak{so}(12)_b$&$\mathfrak{sp}(7)_1^a\times ?^b\times ?^c$ & $(\mathbf{12},\mathbf{14}^a)\oplus(\mathbf{32}_s,\mathbf{2}^b)\oplus(\mathbf{32}_c,\mathbf{1}^c)$ \\ \rowcolor{gray!10} 1 &$E_6$&$\mathfrak{su}(5)_{6}\times \mathfrak{u}(1)_{30}$ & $(\mathbf{27},\overline{\mathbf{5}})_{-1}\oplus c.c.$ \\\hline \end{tabular} \caption{Gauge, flavor symmetries and matter contents of all rank-one 6d SCFTs \cite{DelZotto:2018tcj} with gauge algebra allowing an outer automorphism. The subscript in a flavor symmetry indicates the level $k_F$ of the associated current algebra $F$. Matters are presented as the gauge and flavor representations of the half-hypermultiplets. The theories in gray have unpaired matter content upon $\mathbb{Z}_2$ twist.} \label{tb:rk1-1} \end{table} The 6d $(1,0)$ SCFTs contain tensionless strings which we call BPS strings resembling the features of instantons in 5d $\mathcal{N}=1$ and 4d $\mathcal{N}=2$ gauge theories. Simple examples include E-strings which are realized by M2-branes stretched between a M5-brane and a M9-brane in the Horava-Witten picture of M-theory on $S^1/\mathbb{Z}_2$. The worldsheet theories on $k$ E-strings can be realized as a series of 2d $(0,4)$ $O(k)$ quiver gauge theories \cite{Kim:2014dza}. The E-string theory is the simplest 6d $(1,0)$ SCFTs, which has no gauge symmetry but a $E_8$ flavor symmetry. It can be geometrically engineered by compactifying F-theory on local half-K3 Calabi-Yau threefolds. The E-string theory can be extended to two infinite series of 6d $(1,0)$ SCFTs with $\mathfrak{n}=1$ which are $\mathfrak{sp}(N)+(2N+8)\bf F$ and $\mathfrak{su}(N)+(N+8)\mathbf{F}+\bf\Lambda^2$ theories. Another simple example of BPS strings is the M-strings which are realized by M2-branes stretched between two M5-branes \cite{Haghighat:2013gba}. In this case, the 6d supersymmetry is enhanced to $(2,0)$ and the worldsheet theories become $(0,8)$. The worldsheet theories of $k$ M-strings can also be realized as a series of 2d quiver gauge theories \cite{Haghighat:2013gba}. The M-string theory can be extended to an infinite series of 6d $(1,0)$ SCFTs with $\mathfrak{n}=2$ which are $\mathfrak{su}(N)+2N\bf F$ theories. In general, the BPS strings in a 6d $(1,0)$ SCFT have worldsheet theories as rather nontrivial 2d $(0,4)$ SCFTs. Only in some special cases, these exist known 2d quiver gauge theory constructions. These include the four infinite series of 6d $(1,0)$ SCFTs with $\mathfrak{n}=1,2,4$ mentioned earlier. The 6d $(1,0)$ SCFTs usually contain three types of supermultiplets: the tensor, vector and hyper multiplets. As we are only interested in rank-one 6d $(1,0)$ SCFTs in the current work, there is always only one tensor multiplet with tensor coefficients $\mathfrak{n}$. For all rank-one 6d $(1,0)$ SCFTs except E-string theory, there is a nontrivial gauge algebra $G$ and the vector multiplets are in the adjoint representation $\bf Adj$ of $G$. When there is nontrivial matter content, the hypermultiplets are in the representation $R$ of $G$. If we take into consideration the flavor symmetry $F$, the matter representations are often denoted as $(R^G,R^F)$ of the half-hypermultiplets. The partition function of 6d $(1,0)$ SCFTs contains three parts: the classical part, the one-loop part and the elliptic genera of BPS strings. The first two parts can be directly written down once the data $(n,G,R)$ are known, while the elliptic genera are much more nontrivial and difficult to compute. One main task in the study of 6d SCFTs is to compute the elliptic genera of the 2d $(0,4)$ worldsheet theories of the BPS strings. In the past decade, a huge amount of effort has been made and plenty of methods have been developed, see the summaries in e.g. \cite{Gu:2019dan,Gu:2020fem}. Nevertheless, there still remain quite some rank-one 6d SCFTs whose elliptic genera we could not compute to the extent we would like. The existing major approaches include 2d localization, modular bootstrap, elliptic blowup equations, topological vertex and brane webs and so on. Each has their merits and limitations. For example, 2d localization is the most efficient method for arbitrary number of strings yet only applicable to those cases with known 2d quiver gauge theory descriptions. Elliptic blowup equations imply recursion formulas for elliptic genera or BPS invariants yet only applicable to the cases without half-hyper. All these approaches have counterparts for twisted elliptic genera, which we will discuss in detail later. The circle reduction of 6d $(1,0)$ SCFTs produces the 5d $\mathcal{N}=1$ gauge theories with the same gauge group and matter content. For 6d $(1,0)$ SCFTs with $\mathfrak{n}\ge 3$, by sending $\tau\to i\infty$, i.e., $q\to 0$, the $k$ string elliptic genera of 6d SCFTs exactly reduce to the $k$ instanton Nekrasov partition function of the 5d gauge theories. For the $\mathfrak{n}=1,2$ cases, there are some subtitles for the circle reduction such that the limit of elliptic genera and 5d Nekrasov partition function can have some small differences, which we refer to the discussion in \cite[Section 7]{DelZotto:2018tcj}. The circle reduction should not be confused with the circle compactification where all KK modes are kept. The circle compactification leads to 5d KK theories which are not necessarily gauge theories, while circle reduction leads to 5d gauge theories as deformation of 5d SCFTs. \subsection{Twisted circle compactification} It was conjectured in \cite{Jefferson:2018irk} that all 5d SCFTs can be obtained by RG flows from 5d Kaluza-Klein (KK) theories, while the KK theories can be obtained from the compactifications of 6d SCFTs. When a 6d SCFT is compactified on a circle, one can turn on non-trivial discrete holonomies for the gauge fields from the discrete global symmetries, which are realized in \cite{Bhardwaj:2019fzv} as combinations of the outer automorphisms of gauge algebras $G$ and permutations of tensor multiplets. Such a circle compactification is usually called the twisted circle compactification \cite{Bhardwaj:2019fzv}. In this paper, we are interested in the twisted circle compactification of rank-one 6d $(1,0)$ SCFTs, with a single tensor multiplet which is invariants under any kind of discrete global symmetries, so the outer automorphism of the gauge algebra $G$ determines the possible types of twist. In fact, such automorphisms have been classified in the study of twisted affine Lie algebras \cite{kac1990infinite}. Denote $\mathcal{O}^{(r_{\mathrm{out}})}$ as the order $r_{\mathrm{out}}$ outer automorphism. Then $G=A_{2r-1},D_r,E_6$ admit order two outer automorphisms while $G=D_4$ admits an order-three outer automorphism which act on the simple roots in patterns as described in Figure \ref{fig:dynkins}. \begin{figure}[h] \centering \begin{tikzpicture} \centering \node (b) at (3,1.5){}; \draw (0,2) node{\underline{$A_{2}^{(1)},\mathcal{O}_2$}:}; \dynkin[edge length=.75cm, involution/.style={red,stealth-stealth}, involutions={12},extended,at=(b)]{A}{2}; \draw (8,2) node{\underline{$A_{2}^{(2)}$}:}; \node (a) at (9+1.8,2){}; \dynkin[edge length=.75cm,involutions={},extended,at=(a)]A[2]2; \node (b) at (1.1,0){}; \draw (0,0) node{\underline{$A_{2l}^{(1)},\mathcal{O}_2$}:}; \dynkin[edge length=.75cm, involution/.style={red,stealth-stealth}, involutions={16;25;34},extended,at=(b)]{A}{*.****.*}; \draw (8,0) node{\underline{$A_{2l}^{(2)}$}:}; \node (a) at (9,0){}; \dynkin[edge length=.75cm,involutions={},extended,at=(a)]A[2]{even}; \node (b) at (1.4,-2){}; \draw (8,-2) node{\underline{$A_{2l-1}^{(2)}$}:}; \draw (0,-2) node{\underline{$A_{2l-1}^{(1)},\mathcal{O}_2$}:}; \dynkin[edge length=.75cm, involution/.style={red,stealth-stealth}, involutions={15;24},extended,at=(b)]{A}{*.***.*}; \draw (8,-4) node{\underline{$D_{l+1}^{(2)}$}:}; \node (a) at (9.2,-2){}; \dynkin[edge length=.75cm,involutions={},extended,at=(a)]A[2]{odd}; \node (b) at (2.5,-4){}; \draw (0,-4) node{\underline{$D_{l+1}^{(1)},\mathcal{O}_2$}:}; \dynkin[edge length=.75cm, involution/.style={red,stealth-stealth}, involutions={54},extended,at=(b)]{D}{**.***}; \node (a) at (9+0.3,-4){}; \dynkin[edge length=.75cm,involutions={},extended,at=(a)]D[2]{**.***}; \draw (8,-6) node{\underline{$D_{4}^{(3)}$}:}; \node (b) at (3.0,-6){}; \draw (0,-6) node{\underline{$D_{4}^{(1)},\mathcal{O}_3$}:}; \dynkin[edge length=.75cm, involution/.style={red,stealth-stealth}, involutions={13;43;14},extended,at=(b)]{D}{4}; \node (a) at (9+1.5,-6){}; \dynkin[edge length=.75cm,involutions={},extended,at=(a)]D[3]4; \draw (8,-8.5) node{\underline{$E_{6}^{(2)}$}:}; \node (b) at (2.,-8.5){}; \draw (0,-8.5) node{\underline{$E_{6}^{(1)},\mathcal{O}_2$}:}; \dynkin[edge length=.75cm, involution/.style={red,stealth-stealth}, involutions={16;35},extended,at=(b)]{E}{6}; \node (a) at (9+1,-8.5){}; \dynkin[edge length=.75cm,involutions={},extended,at=(a)]E[2]6; \end{tikzpicture} \caption{Dynkin diagrams}\label{fig:dynkins} \end{figure} Upon twisted circle compactification, the gauge algebra of affine Lie type $G^{(1)}$ in the tensor branch effectively becomes the twisted affine Lie algebra $G^{(r_{\mathrm{out}})}$. The vector multiplets are in the representation described by the roots of the twisted affine algebra, which are described by the representations of the finite dimensional subalgebra $\mathring{G}$ obtained from outer automorphism folding of $G$ with KK charge $\tau$. The Dynkin diagram of $\mathring{G}$ is obtained by simply removing the affine node of the Dynkin diagram of $G^{(r_{\mathrm{out}})}$. Denote $n_G$ as the rank of the automorphism of $G$, for $G=A_{2r-1},D_{r},E_6$, the inner automorphism is trivial, such that $n_G$ is equal to the rank of outer automorphism. The roots of $G^{(n_G)}$ are \begin{align} \Delta=\Delta^{\mathrm{im}}\cup \Delta^{\mathrm{re}}, \end{align} where \begin{align} \Delta^{\mathrm{im}}&=\left\{\frac{k}{n_G}\tau|k\in\mathbb{Z},k\neq 0\right\},\\ \Delta^{\mathrm{re}}&=\left\{\alpha+\frac{k}{n_G}\tau|k\in\mathbb{Z},\alpha\in \mathring{\Delta}_s\right\}\cup \left\{\alpha+{k}\tau|k\in\mathbb{Z},\alpha\in \mathring{\Delta}_l\right\}, \end{align} where $\mathring{\Delta}_s$ and $\mathring{\Delta}_l$ are the sets of short roots and long roots of $\mathring{G}$. When $G=A_{2l}$, there is a nontrivial inner automorphism such that the whole rank of the automorphism is $n_G=4$, the roots of $A_{2r}^{(2)}$ are \begin{align} \Delta=\Delta^{\mathrm{im}}\cup \Delta^{\mathrm{re}}, \end{align} where \begin{align}\label{A2r_root} \Delta^{\mathrm{im}}&=\left\{\frac{k}{2}\tau|k\in\mathbb{Z},k\neq 0\right\},\\ \Delta^{\mathrm{re}}&=\left\{\frac{1}{2}\alpha+\frac{1}{4}(2k-1)\tau|k\in\mathbb{Z},\alpha\in \mathring{\Delta}_l\right\}\cup \left\{\alpha+\frac{1}{2}{k}\tau|k\in\mathbb{Z},\alpha\in \mathring{\Delta}_s\right\}\nonumber\\ &\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\ \,\cup \left\{\alpha+{k}\tau|k\in\mathbb{Z},\alpha\in \mathring{\Delta}_l\right\}, \end{align} where $\mathring{\Delta}_s$ and $\mathring{\Delta}_l$ are the sets of short roots and long roots of $C_r$. We summarize all KK-momentum shifts of adjoint representations under twist in Table \ref{tb:adj}. \begin{table}[h] \def1.1{1.1} \centering \begin{tabular}{|c|c|c|c|rcl|} \hline $ G $ & $ \mathring{G} $ & $r_{\mathrm{out}}$ & $n_G$ & $ R $ & $ \to $ & $ \mathring{R} $ \\ \hline $ A_{2r}^{(2)} $ & $ C_r $ & $2$ & $ 4$ & $ \mathbf{Adj} $ & $ \to $ & $ \mathbf{Adj}_0 \oplus \mathbf{F}_{1/4} \oplus \mathbf{\Lambda}^2_{1/2} \oplus \mathbf{1}_{1/2} \oplus \mathbf{F}_{3/4} $ \\ \hline $ A_{2r-1}^{(2)} $ & $ C_r $ & $2$ &$2$ & $ \mathbf{Adj} $ & $ \to $ & $ \mathbf{Adj}_0 \oplus \mathbf{\Lambda}^2_{1/2} $ \\ \hline $ D_{r+1}^{(2)} $ & $ B_r $ & $2$ &$2$ & $ \mathbf{Adj} $ & $ \to $ & $ \mathbf{Adj}_0 \oplus \mathbf{F}_{1/2} $ \\ \hline $ E_6^{(2)} $ & $ F_4 $ & $2$ & $2$ & $ \mathbf{Adj} $ & $ \to $ & $ \mathbf{Adj}_0 \oplus \mathbf{F}_{1/2} $ \\ \hline $ D_4^{(3)} $ & $ G_2 $ & $3$ & $3$ & $ \mathbf{Adj} $ & $ \to $ & $ \mathbf{Adj}_0 \oplus \mathbf{F}_{1/3} \oplus \mathbf{F}_{2/3} $ \\ \hline \end{tabular} \caption{Data of twisted affine Lie algebras and the KK-momentum shifts of the adjoint representations.} \label{tb:adj} \end{table} We collect all 6d $(1,0)$ rank-one twisted theories with {\it{paired matter}} content in Table \ref{tb:main0a}. Here by paired we mean that the twisted matter content is invariant upon KK-charge shift by $1/r_{\mathrm{out}}$. For example, consider the $\mathfrak{n}=4,$ $E_6+2\bf F$ theory upon $\mathbb{Z}_2$ twist, twisted matter content is $\mathbf{F}_0\oplus\mathbf{F}_{1/2}\oplus\mathbf{1}_0\oplus\mathbf{1}_{1/2}$ for $F_4$, which apparently is invariant under KK-charge shift by $1/2$. However, for $\mathfrak{n} =5,$ $E_6+\bf F$ theory upon $\mathbb{Z}_2$ twist, obviously one cannot make such an arrangement for the twisted matter content, thus we say unpaired. For the cases with unpaired matter content, we refer to the discussion in \cite{Bhardwaj:2020kim}. Those cases normally result in 5d KK theories with half-hypermultiplets. \begin{table}[h] \centering \begin{tabular}{|c|l|l|l|l|c|}\hline $\mathfrak{n}$ &$G$ & $\mathring{G}$ &$\mathring{R}$ & $\mathring{F}$ & $c$ \\ \hline 6&$E_6^{(2)}$& $F_4$ & $-$ & $-$ & 5/4 \\ \hline 4&$D_4^{(3)}$& $G_2$ & $-$ & $-$ & 5/9 \\ 4&$D_{r+4}^{(2)}$& $\!\!B_{r+3}\!\!$ &$2r( \mathbf{V}_0\oplus\mathbf{1}_{1/2})$ & $\mathfrak{sp}(2r)$ & 3/4 \\ 4 &$E_6^{(2)}$& $F_4$ & $\mathbf{F}_0\oplus\mathbf{F}_{1/2}\oplus\mathbf{1}_0\oplus\mathbf{1}_{1/2}$ & $\mathfrak{sp}(1)$ & 1 \\ \hline 3&$A_2^{(2)}$ & $C_1$ &$-$ & $-$ & 5/16 \\ 3&$D_4^{(2)}$& $B_3$ & $\mathbf{V}_0\oplus\mathbf{1}_{1/2}\oplus\mathbf{S}_0\oplus\mathbf{S}_{1/2}$ & $\mathfrak{sp}(1)\times\mathfrak{sp}(1)$ & 1/2 \\ 3& $D_4^{(3)}$& $G_2$ &$\mathbf{F}_0\oplus\mathbf{F}_{1/3}\oplus\mathbf{F}_{2/3}\oplus\mathbf{1}_0\oplus\mathbf{1}_{1/3}\oplus\mathbf{1}_{2/3} $ & $\mathfrak{sp}(1)$ & 1/2 \\ \hline 2& $A_{2r}^{(2)}$&$C_r$ & $(2r+1)(\mathbf{F}_{0}\oplus \mathbf{F}_{1/2}\oplus \mathbf{1}_{1/4}\oplus \mathbf{1}_{3/4})$ & $\mathfrak{so}(4r+2)$ & $3/16$ \\ 2&$A_{2r-1}^{(2)}$&$C_r$ & $2r(\mathbf{F}_{0}\oplus \mathbf{F}_{1/2})$ & $\mathfrak{so}(4r)$ & 1/4 \\ 2&$D_4^{(2)}$& $B_3$ & $2(\mathbf{V}_0\oplus\mathbf{1}_{1/2}\oplus\mathbf{S}_0\oplus\mathbf{S}_{1/2})$ & $\mathfrak{sp}(2)\times\mathfrak{sp}(2)$ & 1/4 \\ 2& $D_4^{(3)}$& $G_2$ &$2(\mathbf{F}_0\oplus\mathbf{F}_{1/3}\oplus\mathbf{F}_{2/3}\oplus\mathbf{1}_0\oplus\mathbf{1}_{1/3}\oplus\mathbf{1}_{2/3}) $ & $\mathfrak{sp}(2)$ & 4/9 \\ 2&$D_5^{(2)}$ & $B_4$ & $4(\mathbf{V}_0\oplus\mathbf{1}_{1/2})\oplus \mathbf{S}_0\oplus \mathbf{S}_{1/2}$ & $\mathfrak{sp}(4)\times \mathfrak{sp}(1)$ & 1/4 \\ 2&$D_6^{(2)}$& $B_5$ & $6( \mathbf{V}_0\oplus\mathbf{1}_{1/2})\oplus{ \frac12\mathbf{S}_0\oplus \frac12\mathbf{S}_{1/2}}$ & $\mathfrak{sp}(6)$ & 1/4 \\ 2 &$E_6^{(2)}$& $F_4$ & $2(\mathbf{F}_0\oplus\mathbf{F}_{1/2}\oplus\mathbf{1}_0\oplus\mathbf{1}_{1/2})$ & $\mathfrak{sp}(2)$ & $3/4$ \\ \hline 1& $A_2^{(2)}$ & $C_1$ & $6(\mathbf{F}_{0}\oplus \mathbf{F}_{1/2}\oplus \mathbf{1}_{1/4}\oplus \mathbf{1}_{3/4})$ & $\mathfrak{so}(12)$ & 1/16 \\ 1&$D_4^{(2)}$& $B_3$ & $3(\mathbf{V}_0\oplus\mathbf{1}_{1/2}\oplus\mathbf{S}_0\oplus\mathbf{S}_{1/2})$ & $\mathfrak{sp}(3)\times\mathfrak{sp}(3)$ & 0 \\ 1&$D_4^{(3)}$& $G_2$ &$3(\mathbf{F}_0\oplus\mathbf{F}_{1/3}\oplus\mathbf{F}_{2/3}\oplus\mathbf{1}_0\oplus\mathbf{1}_{1/3}\oplus\mathbf{1}_{2/3}) $ & $\mathfrak{sp}(3)$& 7/18 \\ \hline \end{tabular} \caption{Gauge algebra, matter representation and effective flavor symmetry for all twisted 6d $(1,0)$ rank-one theories with paired matter contents. Here $\mathring{R}=(\mathring{R}_{\mathring{G}},\mathring{R}_{\mathring{F}})$ and we only write down $\mathring{R}_{\mathring{G}}$ for short. The important value $c$ will be discussed later. } \label{tb:main0a} \end{table} For 6d SCFTs with hypermultiplets in the representations of the flavor algebra $F$, the representations have integer KK charges for a circle compactification without twist. For twisted circle compactifications, the hypermultiplets are in the representations of the sub flavor algebra $\mathring{F}$, with fractional KK charges. We refer to the Reference A of \cite{Kim:2020hhh} for a detailed discussion. The twisted matter representations for all twisted 6d $(1,0)$ rank-one theories with paired matter contents are summarized in Table \ref{tb:main0a}. For a twisted theory with gauge group $G$ and non-trivial matter representations, they always take the form \begin{align} \bigoplus_i N_i(\mathring{R}_{i,0}\oplus \mathring{R}_{i,1/n^G_i}\oplus\cdots\oplus \mathring{R}_{i,(n^G_i-1)/n^G_i}), \end{align} where $n^G_i$ is either the rank of outer automorphism $r_{\mathrm{out}}$ or $1$. We denote a representation with zero KK charge $R_{i,0}$ as $R_i$, and $N_i$ is the number of matters in the representation $R_i$. \subsection{Twisted prepotential and one-loop free energy} The prepotential, which is also the classical part of the genus zero free energy of the corresponding topological strings, contains the tree-level and one-loop level contributions \begin{align}\label{eq:F00} \mathcal{F}^{\mathrm{cls}}_{(0,0)}=\mathcal{F}^{\text{tree}}+\mathcal{F}^{\text{1-loop}}. \end{align} The tree level contribution contains the information of tensor multiplet, which should not be changed for the twisted circle compactification of rank-one theories. Under $\mathcal{O}^{(r_{\mathrm{out}})}$ action, we expect that \begin{align} \mathcal{F}^{\text{tree}}&=\frac{t_{\text{ell}}}{2\mathfrak{n}}\bigg(-\mathfrak{n} \mathcal{O}^{(r_{\mathrm{out}})}(m_G\cdot m_G)+ \mathcal{O}^{(r_{\mathrm{out}})}\sum_i(k_{F_i}m_{F_i}\cdot m_{F_i})\bigg)-\frac{1}{2\mathfrak{n}}t_{\text{ell}}^2\tau\nonumber\\ &=\frac{t_{\text{ell}}}{2\mathfrak{n}}\bigg(-\mathfrak{n} m_{\mathring{G}}\cdot m_{\mathring{G}}+\sum_i k_{\mathring{F}_i} m_{\mathring{F}_i}\cdot m_{\mathring{F}_i}\bigg)-\frac{1}{2\mathfrak{n}}t_{\text{ell}}^2\tau, \end{align} where the $\mathcal{O}^{(r_{\mathrm{out}})}$ acts on the bilinear form $m\cdot m$ by identifying the masses in the orbit of $\mathcal{O}^{(r_{\mathrm{out}})}$, such that it becomes the bilinear form of the algebra $\mathring{G}/\mathring{F}$. The $\mathcal{O}^{(r_{\mathrm{out}})}$ acts on $k_{F_i}$ by multiplying it to $k_{\mathring{F}_i}=n^G_ik_{F_i}$, which can be understood as follows. For the case without twist, $k_F$ is the intersection number of the non-compact curve and the base curve \cite{Gu:2020fem}. When we do the outer automorphism twist, the non-compact curves that along the obit of the action $\mathcal{O}^{(r_{\mathrm{out}})}$ should be identified, which naturally changes the intersection number from $k_{F_i}$ to $k_{\mathring{F}_i}=n^G_ik_{F_i}$. As suggested in \cite{Kim:2020hhh}, the one-loop prepotential can be evaluated from the zeta regularization of the summation over infinite roots or weights of the twisted affine algebra. For ${G}^{(r_{\mathrm{out}})}$ not of type $A_{2r}^{(2)}$, we have $n_G=r_{\mathrm{out}}$, and the one loop prepotential can be formally written as \begin{align} \mathcal{F}^{1\text{-loop}}=&-\frac{1}{12}\sum_{k\in \mathbb{Z}}\sum_{\alpha\in \mathring{\Delta}_l}|\alpha\cdot m_{\mathring{G}}+k\tau|^3-\frac{1}{12}\sum_{k\in \mathbb{Z}}\sum_{\alpha\in \mathring{\Delta}_s}|\alpha\cdot m_{\mathring{G}}+k\tau/{n_G}|^3\nonumber\\ &+\frac{1}{12}\sum_{k\in\mathbb{Z}}\sum_{i,f_i}\sum_{w_{\mathring{G}}\in \mathring{R}_{i}^{\mathring{G}}}|w_{\mathring{G}}\cdot m_{\mathring{G}}+k\tau/n^G_i+m_{f_i}|^3, \end{align} where $\mathring{R}_{i}^{\mathring{G}}$ are the representations of the matter contents with KK charge zero. Using the zeta regularization\footnote{The formal definition of zeta function $\zeta(s)=\sum_{k=1}^{\infty}\frac{1}{n^s}$ for $\mathrm{Re}(s)>1$ can be extended to the whole complex plane via analytic continuation.} \begin{align} \sum_{k=1}^{\infty}1=\zeta(0)=-\frac{1}{2}, \quad\quad \sum_{k=1}^{\infty}k=\zeta(-1)=-\frac{1}{12}, \quad\quad \sum_{k=1}^{\infty}k^2=\zeta(-2)=0, \end{align} the relevant parts in the one-loop prepotential become \begin{align} &-\frac{1}{12}\sum_{k\in \mathbb{Z}}\sum_{\alpha\in \mathring{\Delta}_l}|\alpha\cdot m_{\mathring{G}}+k\tau|^3\sim-\frac{1}{6}\sum_{\alpha\in \mathring{\Delta}_l^+}(\alpha\cdot m_{\mathring{G}})^3+\frac{1}{24}\tau\sum_{\alpha\in \mathring{\Delta}_l}(\alpha\cdot m_{\mathring{G}})^2,\\ &-\frac{1}{12}\sum_{k\in \mathbb{Z}}\sum_{\alpha\in \mathring{\Delta}_s}|\alpha\cdot m_{\mathring{G}}+k \tau/{n_G}|^3\sim-\frac{1}{6}\sum_{\alpha\in \mathring{\Delta}_s^+}(\alpha\cdot m_{\mathring{G}})^3+\frac{1}{24n_G}\tau\sum_{\alpha\in \mathring{\Delta}_s}(\alpha\cdot m_{\mathring{G}})^2,\\ &\frac{1}{12}\sum_{k\in\mathbb{Z}}\sum_{i,f_i}\sum_{w_{\mathring{G}}\in \mathring{R}_{i}^{\mathring{G}}}|w_{\mathring{G}}\cdot m_{\mathring{G}}+k\tau/n^G_i+m_{f_i}|^3 \nonumber\\ &\quad\quad\sim\frac{1}{12}\sum_{k\in\mathbb{Z}}\sum_{i}\sum_{w\in \mathring{R}_{i}^{+}}(w_{\mathring{G}}\cdot m_{\mathring{G}}+w_{\mathring{F}}\cdot m_{\mathring{F}})^3-\sum_i\frac{N_i}{24 n^G_i}\tau\cdot\sum_{w_{\mathring{G}}\in \mathring{R}_{i,r_i}^{\mathring{G}}}(w_{\mathring{G}}\cdot m_{\mathring{G}})^2. \end{align} Then the total one-loop prepotential becomes \begin{equation}\label{eq:Foneloop} \begin{aligned} \mathcal{F}^{1\text{-loop}}&=-\frac{1}{6}\sum_{\alpha\in \mathring{\Delta}^+}(\alpha\cdot m_{\mathring{G}})^3+\frac{1}{12}\sum_{k\in\mathbb{Z}}\sum_i\sum_{w\in \mathring{R}_{i}^{+}}(w_{\mathring{G}}\cdot m_{\mathring{G}}+w_{\mathring{F}}\cdot m_{\mathring{F}})^3\\ &\phantom{=}+\frac{1}{24}\tau\sum_{\alpha\in \mathring{\Delta}}(\alpha\cdot m_{\mathring{G}})^2+\frac{1-n_G}{24n_G}\tau\sum_{\alpha\in \Delta_s}(\alpha\cdot m_{\mathring{G}})^2-\sum_i\frac{N_i}{24 n^G_i}\tau\cdot\sum_{w_{\mathring{G}}\in \mathring{R}_{i,r_i}^G}(w_{\mathring{G}}\cdot m_{\mathring{G}})^2\\ &=-\frac{1}{6}\sum_{\alpha\in \mathring{\Delta}^+}(\alpha\cdot m_{\mathring{G}})^3+\frac{1}{12}\sum_{k\in\mathbb{Z}}\sum_{i}\sum_{w\in \mathring{R}_{i}^{+}}(w_{\mathring{G}}\cdot m_{\mathring{G}}+w_{\mathring{F}}\cdot m_{\mathring{F}})^3+c\tau m_{\mathring{G}}\cdot m_{\mathring{G}}. \end{aligned} \end{equation} Here we define the positive weights as \begin{align} \mathring{R}_{i}^{+}=\{w_{\mathring{G}}\in \mathring{R}_{i}^{\mathring{G}},w_{\mathring{F}}\in \mathring{R}_{i}^{\mathring{F}}\,\big|\,w_{\mathring{G}}\cdot m_{\mathring{G}}+w_{\mathring{F}}\cdot m_{\mathring{F}}> 0\}, \end{align} and the constant $c$ as \begin{align} c=\frac{h_{\cirG}^\vee}{6}-\frac{n_G-1}{12 n_G}\mathrm{Ind}(R_i^{\mathring{G}})-\sum_i\frac{N_i}{12 n^G_i}\mathrm{Ind}(\mathring{R}_{i}^{\mathring{G}}). \end{align} For the $A_{2r}^{(2)}$ cases, as described in \eqref{A2r_root}, there are additional ``shortest" roots taking the KK-charge $n+\frac{1}{4}$ and $n+\frac{3}{4}$. They contribute an additional term \begin{align}\label{eq:A2lcterm} -\frac{1}{12}\times 2\times 3 \times \left(\zeta(-1,\frac{1}{4})+\zeta(-1,\frac{3}{4})\right)\tau\sum_{\alpha\in \Delta_l^+}\left(\frac{\alpha\cdot t}{2}\right)^2=-\frac{1}{96}\tau\sum_{\alpha\in \Delta_l^+}\left(\frac{\alpha\cdot t}{2}\right)^2, \end{align} which contributes to $c$ by $-\frac{1}{96}\times2\,\mathrm{Ind}(\mathbf{F})=-\frac{1}{48}$. Therefore, for $A_{2r}^{(2)}$ theory with $N$ KK zero mode matter in the fundamental representation, the one-loop prepotential takes the form of the last line in \eqref{eq:Foneloop} with \begin{align} c=\frac{r+1}{6}-\frac{1}{12}(r-1)-\frac{1}{48}-\frac{N}{24}\times 1 =\frac{1}{48} (11 + 4 r) - \frac{1}{24} N. \end{align} Here we have used that for $G=C_r$, $h_G^\vee=r+1$, $\mathrm{Ind}(\mathbf{F})=1$ and $\mathrm{Ind}(\mathbf{\Lambda}^2)=2(r-1)$. By explicit computation for all twisted theories, we observe the following interesting identities of the $c$ constant. For all the cases with twist coefficients $n_G=2,3,4$ in Table \ref{tb:main0a}, \begin{equation}\label{goldall1} \boxed{ c= \left\{\begin{array}{l} \frac{\mathfrak{n}}{2n_G}-\frac{1}{(n_G)^2}, \qquad \mathring{G}={B_r,C_r}, \\ \frac{\mathfrak{n}}{2(n_G)^2}+\frac{1}{n_G},\qquad \mathring{G}={G_2,F_4}. \end{array} \right.} \end{equation} The physical meaning of the constant $c$ is (the negative of) the left-moving Casimir energy in the twisted Ramond sector which will be discussed later. In geometry, $c$ can be absorbed by the base K\"ahler parameter. A similar shift of the base K\"ahler parameters has been discussed in \cite{Cota:2019cjx}, which is closely related to the intersection number of the divisors in the genus-one fibered Calabi-Yau threefolds. It is interesting to construct the geometry explicitly and reproduce the identity \eqref{goldall1}. In order to make connection to the blowup equation in Section \ref{sec:blowup}, we need the information about the classical part of the genus one free energies $\mathcal{F}^{\mathrm{cls}}_{(0,1)}$ and $\mathcal{F}^{\mathrm{cls}}_{(1,0)}$. As described in Section 2 of \cite{Gu:2020fem}, these two functions only contain bilinear forms of the gauge and flavor algebra and the part related to the tensor multiplet. The action of the automorphism twist maps the bilinear forms to the bilinear forms of the folded algebras directly and leaves the tensor part unchanged. We expect that \begin{align} \mathcal{F}^{\mathrm{cls}}_{(0,1)}&=-\frac{1}{12}\sum_{\alpha\in\mathring{\Delta}^+}\alpha\cdot m_{\mathring{G}}+\frac{1}{24}\sum_i\sum_{w\in \mathring{R}_{i}^{+}}(w_{\mathring{G}}\cdot m_{\mathring{G}}+w_{\mathring{F}}\cdot m_{\mathring{F}})+\frac{\mathfrak{n}-2}{2\mathfrak{n}}t_{\mathrm{ell}},\label{eq:F01}\\ \mathcal{F}^{\mathrm{cls}}_{(1,0)}&=\frac{1}{12}\sum_{\alpha\in\mathring{\Delta}^+}\alpha\cdot m_{\mathring{G}}+\frac{1}{24}\sum_i\sum_{w\in \mathring{R}_{i}^{+}}(w_{\mathring{G}}\cdot m_{\mathring{G}}+w_{\mathring{F}}\cdot m_{\mathring{F}})+\frac{\mathfrak{n}-2-h^{\vee}_{G^{(r)}}}{4\mathfrak{n}}t_{\mathrm{ell}}.\label{eq:F10} \end{align} Notice that the dual Coxeter number $h_G^\vee$ in \eqref{eq:F10} is the number for the original group $G$ or the twisted group $G^{(r)}$, according to the identity \begin{align}\label{dualCox} h^{\vee}_{G^{(r)}}=h^{\vee}_{G^{(1)}}=h_G^\vee. \end{align} This is easy to understand because the dual Coxeter number is the summation of all comarks of the affine Dynkin diagrams and the comark of each node of twisted affine Lie algebra just comes from the summation of the comarks of the nodes folded together. \subsection{Twisted elliptic genera of BPS strings}\label{sec:2dquiver} The Ramond-Ramond (R-R) elliptic genus of the BPS strings in 6d $(1,0)$ SCFTs is defined as the trace over the Hilbert space of the R-R sector of the 2d $(0,4)$ worldsheet theory: \begin{equation}\label{RRdef} \mathbb{E}(q,v,x,m)=\mathrm{Tr}_{\rm RR}(-1)^{F_L+F_R}e^{2\pi i \tau H_L} e^{2\pi i \bar{\tau} H_R}x^{J_L^3}v^{J_R^3+J_I^3}\prod e^{2\pi i m\cdot K} , \end{equation} where $m$ and $K$ are the fugacities and the Cartan generators associated to the 2d global symmetry, which is composed of 6d gauge and flavor symmetries. The $J_L^3,J_R^3$ and $J_I^3$ are the usual Cartan generators of the little group $\mathfrak{so}(4)=\mathfrak{su}(2)_L\times \mathfrak{su}(2)_R$ and the R-symmetry group $\mathfrak{su}(2)_I$ of the 6d $(1,0)$ SCFT. It is common to refer to the R-R elliptic genera as just \emph{elliptic genera}. One can also consider the trace over the Hilbert space of the Neveu-Schwarz-Ramond (NS-R) sector of the 2d theory, in which case the above definition gives the NS-R elliptic genera. This type of elliptic genera will also be used in later sections when we discuss the spectral flow symmetry. In the case of twisted circle compactification of 6d SCFTs, the 2d worldsheet theories also get twisted circle compactified on one circle of the torus. We can formally define the twisted elliptic genera by replacing the Hilbert space in \eqref{RRdef} to the Hilbert space of the 2d states appearing in the twisted circle compactification. The Hamiltonians $H_L$ now have fractional eigenvalues due to the twist. For the twist coefficient $n_G=2,3,4$, the gap between energy eigenvalues becomes $1/n_G$. This brings in many new fascinating features for the twisted elliptic genera. We find the primary feature of $d$-string twisted elliptic genera is \begin{equation}\label{eq:dc} \mathbb{E}_d(q,v,x,m_{\mathring{G}},m_{\mathring{F}})= q^{-dc}\Big(Z_d^{5d}(v,x,m_{\mathring{G}},m_{\mathring{F}})+ \mathcal{O}(q^{1/n_G}) \Big). \end{equation} Here $ Z_d^{5d}$ is the $d$-instanton Nekrasov partition function of the circle reduction, i.e., the 5d low energy theory of the twisted 6d $(1,0)$ SCFT. Such a 5d theory has gauge group $\mathring{G}$ and the 5d matter content taken from the KK-charge 0 part of the 6d twisted matter content. When the 2d $(0,4)$ worldsheet theory has a known 2d quiver gauge theory construction, the above definition can be explicitly computed by 2d localization, also known as Jeffrey-Kirwan residue \cite{Benini:2013nda,Benini:2013xpa}. However, this good situation happens very rarely. In most cases, it is very hard or impossible to construct a 2d gauge theory for the worldsheet theory of BPS strings. For the twisted cases, this is even hard and rare. In this section, we review the 2d localization formulas for 6d $\mathfrak{so}({2r+8})^{(2)}$ theories with $\mathfrak{n}=4$ and pure $\mathfrak{su}(3)^{(2)}$ theory with $\mathfrak{n}=3$, which were first established in \cite{Kim:2021cua}. As far as we know, these are the only two types of twisted theories, for which the twisted elliptic genera can be computed directly. \paragraph{\underline{$\mathfrak{so}({2r+8})$ theory with $\mathbb{Z}_2$ twist}} The instanton partition function of the $\mathfrak{so}({2r+8})^{(2)}$ theory can be obtained from the $\mathbb{Z}_2$ twist of 6d $\mathfrak{so}({2r+8})$ theory with $2r$ fundamental flavors. In the 2d $\mathcal{N}=(0,4)$ quiver gauge theory description of the 6d $\mathfrak{so}({2r+8})$ theory, at $k$-strings, the resulting theory is a $\mathfrak{sp}(k)$ gauge theory coupled to the bulk $\mathfrak{so}(2r+8)$ gauge group and the $\mathfrak{sp}(2r)$ flavor group as follows \begin{align} \raisebox{-.5\height}{ \begin{tikzpicture} \tikzstyle{gauge} = [circle, draw,inner sep=3pt]; \tikzstyle{flavour} = [regular polygon,regular polygon sides=4,inner sep=3pt, draw]; \node (g1) [gauge,label=below:{$\mathfrak{sp}(k)$}] {}; \node (f1) [flavour,above of=g1, label=above:{$\mathfrak{so}(2r+8)$}] {}; \node (f2) [flavour,right of=g1, label=right:{$\mathfrak{sp}(2r)$}] {}; \draw (g1)--(f1); \draw[dashed] (g1)--(f2); \draw (g1) to [out=140,in=220,looseness=10] (g1); \node at (-1,0) {\small{asym}\phantom{1} }; \end{tikzpicture} } \label{eq:2d_quiver} \end{align} Here solid/dashed lines denote 2d hypermultiplets/Fermi multiplets respectively. Under the $\mathbb{Z}_2$ outer automorphism twist, the $\mathfrak{sp}(k)$ gauge algebra and $\mathfrak{sp}(2r)$ flavor algebra keep invariant, so we only need to take care of the bulk gauge group $\mathfrak{so}(2r+8)$. In the 2d description, the bulk gauge group serves as a flavor group and it couples with the gauge group $\mathfrak{sp}(k)$ in the fundamental representation. Under $\mathbb{Z}_2$ twist, the fundamental representation of $\mathfrak{so}(2r+8)$ is split into the fundamental representation of $\mathfrak{so}(2r+7)$ with KK charge zero and a trivial representation of $\mathfrak{so}(2r+7)$ with KK charge one half. The 6d partition function turns out to be \cite{Kim:2021cua,Chen:2021rek} \begin{align} Z_{\text{str}}^{\rm{6d}}=\sum_{k=0}^{\infty}{q}_{\phi}^k \,\mathbb{E}_k, \end{align} where $\mathbb{E}_k$ is the $k$-string elliptic genus \begin{align} \mathbb{E}_k=\frac{1}{2^kk!}\oint \prod_{I=1}^k\frac{{\rm d} u_I}{2\pi i}\cdot Z_{k,1-\text{loop}}^{\rm{6d}}(u_I), \end{align} with the integrand to be \begin{equation} \begin{aligned} Z_{k,1-\text{loop}}^{\rm{6d}}(u_I)= &\left(-\frac{\vartheta _1\left(2 \epsilon _+\right)}{\vartheta _1\left(\epsilon_{1,2}\right)}\right)^k \cdot \prod _{I=1}^k \vartheta_1\left(\pm 2 u_I\right) \vartheta _1\left(2 \epsilon _+\pm 2 u_I\right)\\ &\cdot\prod _{I<J}^k \frac{\vartheta _1\left(\pm u_I\pm u_J\right) \vartheta _1\left(2 \epsilon _+\pm u_I\pm u_J\right)}{\vartheta _1\left(\epsilon _1\pm u_I\pm u_J\right) \vartheta _1\left(\epsilon _2\pm u_I\pm u_J\right)}\\ &\cdot \left(\prod _{I=1}^k \frac{\prod _{l=1}^{2 r} \vartheta_1\left(\pm u_I+m_l\right)}{\vartheta _1\left(\epsilon _+\pm u_I\right)\vartheta _4\left(\epsilon _+\pm u_I\right)\prod _{i=1}^{r+3} \vartheta _1\left(\epsilon _+\pm u_I\pm \alpha_i\right)}\right)\, , \end{aligned} \end{equation} where we define the variant theta functions $\vartheta_i(z)= {\theta_i(z,\tau)}/{\eta(\tau)},i=1,\cdots,4$. Here the $\vartheta_4$ in the last line comes from the trivial representation of $\mathfrak{so}(2r+7)$ with $\frac{1}{2}$ KK charge. \paragraph{\underline{$\mathfrak{su}(3)$ theory with $\mathbb{Z}_2$ twist}} It was realized in \cite{Kim:2021cua} from brane webs that the $\mathbb{Z}_2$ twisted circle compactification of 6d pure $\mathfrak{su}(3)$ can be obtained from Higgsing of 6d $G_2$ gauge theory with one fundamental flavor. The 2d description of 6d $G_2$ theory with one fundamental has been constructed in \cite{Kim:2018gjo}, where the theory is written from the $G_2$ subalgebra $\mathfrak{su}(3)$. Note the $G_2$ algebra contains a subalgebra $\mathfrak{su}(2)\times \mathfrak{su}(2)$. Denote $\alpha,\alpha^{\prime}$ the Coulomb parameters for the $\mathfrak{su}(2)$'s, and $m$ the mass for the fundamental flavor in the 6d $G_2$ theory, we have the following tuning of parameters for the Higgsing \begin{align}\label{eq:higgsG2A2} \alpha\rightarrow \alpha,\quad \alpha^{\prime}\rightarrow \frac{\tau}{4},\quad m\rightarrow \epsilon_+-\frac{\tau}{2}. \end{align} Apply the reparametrization \eqref{eq:higgsG2A2}, we have the $k$-string elliptic genus of 6d $\mathfrak{su}(3)$ theory with $\mathbb{Z}_2$ twist as \begin{align} Z_{\text{str}}^{\rm{6d}}=\sum_{k=0}^{\infty}{q}_{\phi}^k \,\mathbb{E}_k, \end{align} where $\mathbb{E}_k$ is the $k$-string elliptic genus \begin{align} \mathbb{E}_k=\frac{1}{k!}\oint \prod_{I=1}^k\frac{{\rm d} u_I}{2\pi i}\cdot Z_{k,1-\text{loop}}^{\rm{6d}}(u_I), \end{align} with the integrand in the elliptic form to be \begin{equation} \begin{aligned} &Z_{k,1-\text{loop}}^{\rm{6d}}(u_I)=\prod_{I=1}^k\frac{d{u}_I}{2\pi i}\cdot \frac{\prod_{I\neq J}\vartheta_1({u_{IJ}})\cdot \prod_{I,J}\vartheta_1({2\epsilon_+-{u}_{IJ}})} {\prod_{I=1}^k\prod_{i=1}^2 {\vartheta_1}({\epsilon_+\pm({u}_I-\alpha_i)}) \cdot\prod_{I,J}\vartheta_1({\epsilon_{1,2}+{u}_{IJ}})}\\ &\quad\times\frac{\prod_I\!\big( \vartheta_4^{[\frac{3}{4}]}({\epsilon_++{u}_I})\cdot\prod_{I\leq J}\big(\vartheta_4({{u}_I+{u}_J}) \cdot \vartheta_4({{u}_I+{u}_J-2\epsilon_+})\big)} {\prod_I\!\big( \vartheta_4^{[\frac{3}{4}]}(\epsilon_+-{u}_I) \vartheta_4^{[\mp\frac{1}{4}]}({\epsilon_+\pm{u}_I})\prod_{i=1}^2 \vartheta_4({\epsilon_+-{u}_I-\alpha_i}) \big) \cdot\prod_{I<J}\vartheta_4({\epsilon_{1,2}-{u}_I-{u}_J})}, \\ \end{aligned} \end{equation} where $\alpha_1=-\alpha_2=\alpha$. The residue sum can be labeled by $\mathfrak{su}(2)$ colored Young diagrams, then we have \begin{equation}\label{su3z2Ed} \begin{aligned} \mathbb{E}_k =&\,\sum_{\vec{Y};|\vec{Y}|=k}\prod_{i=1}^2\prod_{s\in Y_i} \frac{\vartheta_4(2{u}(s))\cdot \vartheta_4(2\epsilon_+-2{u}(s))} {\prod_{j=1}^2\left(\vartheta_1({E_{ij}(s)})\cdot \vartheta_1({E_{ij}(s)-2\epsilon_+})\right)}\\ &\prod_{i=1}^2\prod_{s\in Y_i} \frac{\vartheta_4^{[\frac{3}{4}]}(\epsilon_++u(s))}{\vartheta_4^{[\frac{3}{4}]}(\epsilon_+-u(s))\vartheta_4^{[\mp\frac{1}{4}]}(\epsilon_+\pm u(s))\cdot\prod_{j=1}^2 \vartheta_4({\epsilon_+-{u}(s)-\alpha_j})} \\ &\cdot\prod_{i\leq j}^2\prod_{s_{i,j}\in Y_{i,j};s_i<s_j} \frac{\vartheta_4({{u}(s_i)+{u}(s_j)})\cdot \vartheta_4({{u}(s_i)+{u}(s_j)-2\epsilon_+})} {\vartheta_4({\epsilon_{1,2}-{u}(s_i)-{u}(s_j)})}, \end{aligned} \end{equation} where \begin{equation} {u}(s)=\alpha_i-\epsilon_+-(n-1)\epsilon_1-(m-1)\epsilon_2,\quad s=(m,n)\in Y_i, \end{equation} and \begin{equation} E_{ij}(s)= \alpha_i-\alpha_j-\epsilon_1 h_i(s)+\epsilon_2(v_j(s)+1), \end{equation} Here $s_i\!<\!s_j$ means ($i<j$) or ($i\!=\!j$ and $m_i\!<\!m_j$) or ($i\!=\!j$ and $m_i\!=\!m_j$ and $n_i\!<\!n_j$). The $h_i(s)$ denotes the distance from $s$ to the right end of the diagram $Y_i$ by moving right and the $v_j(s)$ denotes the distance from $s$ to the bottom of the diagram $Y_j$ by moving down. \subsection{Anomaly and modular index} Elliptic genera $\mathbb{E}$ of 2d $(0,4)$ SCFTs in general are weight zero Jacobi forms of multi elliptic variables on $SL(2,\mathbb{Z})$. They are equipped with an important quantity -- the modular index $\mathrm{Ind}\, \mathbb{E}$, as a quadratic form of the elliptic variables. Under modular transformation of the torus, the elliptic genera transform as \begin{equation} \mathbb{E}_d\Big(-\frac{1}{\tau},\frac{\epsilon_1}{\tau},\frac{\epsilon_2}{\tau},\frac{m_G}{\tau},\frac{m_F}{\tau}\Big)=\exp{\Big(\frac{2\pi i}{\tau} \mathrm{Ind}\,\mathbb{E} \Big)} \mathbb{E}(\tau,\epsilon_1,\epsilon_2,m_G,m_F). \end{equation} Equivalently, one can write as \begin{equation} \partial_{E_2} \log\mathbb{E} = -\frac{1}{12}(\mathrm{Ind}\, \mathbb{E}). \end{equation} Here $E_2(\tau)$ is the weight-two Eisenstein series that measures the modular anomaly. For 6d rank-one $(1,0)$ theories, the modular index of the elliptic genera can be derived from the anomaly polynomials for the 2d $(0,4)$ SCFTs on the worldsheet of the BPS strings \cite{Ohmori:2014pca,Ohmori:2014kda,Shimizu:2016lbw}. To be precise, for a 6d $(1,0)$ theory with tensor coefficient $\mathfrak{n}$, gauge group $G$ and flavor group $F$, the modular index of the $d$-string elliptic genus can be uniformly written as \begin{equation} \label{eq:Ed-index} \begin{aligned} \mathrm{Ind}\, \mathbb{E}_d(\epsilon_1,\epsilon_2,m_G,m_F) = &-\Big(\frac{\epsilon_1+\epsilon_2}{2}\Big)^2(2-\mathfrak{n}+h_G^\vee)d + \frac{\epsilon_1\epsilon_2}{2}(\mathfrak{n} d^2 +(2-\mathfrak{n})d) \\ & +\frac{d}{2} (- \mathfrak{n}\,m_G\cdot m_G + k_F\,m_F\cdot m_F ) \ . \end{aligned} \end{equation} The modularity for twisted elliptic genera is more complicated. Though from the viewpoint of twisted circle compactification, it is convenient to discuss the fractional KK-charges, which brings in the fractional $q^{1/n_G}$ orders in twisted elliptic genera, where $n_G=2,3,4$. From the geometric viewpoint, it is more suitable to scale $q$ to $q^{n_G}$ such that we are still in the integral bases of curves. After such scaling, it is natural to expect that the twisted elliptic genera behave as weight zero Jacobi forms of some congruence subgroups of $SL(2,\mathbb{Z})$. We propose that in general the congruence subgroup should be $\Gamma_1(n_G)$, though in many cases, we notice that the twisted elliptic genera satisfy a bigger modular symmetry that is $\Gamma_0(n_G)$. These are consistent with the geometric observation in \cite{Cota:2019cjx} for multi-section Calabi-Yau threefolds. We collect the definition of various congruence subgroups of $SL(2,\mathbb{Z})$ in Appendix \ref{app:B}. The index quadratic form does not really depend on the modular groups. For $\mathcal{O}^{(r_{\mathrm{out}})}$ twisted compactification of rank-one SCFTs, the tensor multiplet is invariant under the twist, the gauge and flavor algebras become their twisted versions due to the identification of the masses in the same orbits of $\mathcal{O}^{(r_{\mathrm{out}})}$. This indicates that the modular index of twisted elliptic genus can be directly deduced from its untwisted origin by identifying the masses of the particles of the hyper and vector multiplets in the same orbits of $\mathcal{O}^{(r_{\mathrm{out}})}$. Thus we have the following uniform formula for the index of $d$-string twisted elliptic genus: \begin{equation}\label{eq:twistedEd-index} \begin{aligned} \mathrm{Ind}\, \mathbb{E}_d(\epsilon_1,\epsilon_2,m_{\cirG},m_{\cirF}) = &-\Big(\frac{\epsilon_1+\epsilon_2}{2}\Big)^2(2-\mathfrak{n}+h_G^\vee)d + \frac{\epsilon_1\epsilon_2}{2}(\mathfrak{n} d^2 +(2-\mathfrak{n})d) \\ & +\frac{d}{2} (- \mathfrak{n}\,m_{\cirG}\cdot m_{\cirG} + k_{\mathring{F}}\,m_{\cirF}\cdot m_{\cirF} ) . \end{aligned} \end{equation} One can see that only the second line changes from \eqref{eq:Ed-index}. It should be emphasized that the dual Coxeter number $h_G^\vee$ here does not change upon the twist, as was explained in the identity \eqref{dualCox}. \section{Twisted elliptic blowup equations}\label{sec:blowup} \subsection{Elliptic blowup equations and their twists}\label{sec:ellipticblowup} For refined topological strings on a non-compact Calabi-Yau threefold $X$, the general form of blowup equations was proposed in \cite{Huang:2017mis}: \begin{equation}\label{blowupgeom} \begin{aligned} \Lambda(\epsilon_1,&\,\epsilon_2,m_i) Z\left(\epsilon_1,\epsilon_2,t_i+\pi {\mathsf{i}} B_i\right)\\ =\sum_{\mathbf{k}\in \mathbb{Z}^{b_4}} &(-1)^{|\mathbf{k}|}Z\left(\epsilon_1,\epsilon_2-\epsilon_1,t_i+(C_{ij}k_j+B_i/2)\epsilon_1+\pi {\mathsf{i}} B_i\right)\\[-3.6mm] &\phantom{--,}\times Z\left(\epsilon_1-\epsilon_2,\epsilon_2,t_i+(C_{ij}k_j+B_i/2)\epsilon_2+\pi {\mathsf{i}} B_i\right), \end{aligned} \end{equation} as a generalization of the K-theoretic blowup equations for 5d gauge theories in \cite{Nakajima:2005fg}. Here $b_4$ is the Betti number which counts the number of compact divisors of $X$. The $t_i$ is the K\"ahler parameter which is the volume of the curve class in $H_2(X;\mathbb{Z})$ and $C_{ij}$ is the intersection numbers of divisors and curves in $X$. The $B_i$ is the flux for the corresponding K\"ahler parameter, where the value can be determined from the classical prepotential of the topological strings on $X$ \cite{Huang:2017mis}. The $\Lambda(\epsilon_1,\epsilon_2,m_i)$ is a function that can be fixed from the fluxes $B_i$ and the classical prepotential, and it only depends on the mass parameters of the theory. In a series of works \cite{Gu:2018gmy,Gu:2019dan,Gu:2019pqj,Gu:2020fem,Duan:2021ges}, elliptic blowup equations have been established for all 6d $(1,0)$ and $(2,0)$ SCFTs. These functional equations serve as very efficient tools to solve the elliptic genera of the BPS strings associated to 6d SCFTs. For example, for rank-one 6d $(1,0)$ SCFTs with $\mathfrak{n}\ge 3$ and no half-hyper, there exist a universal recursive formula for the elliptic genera with respect to the number of strings derived from unity elliptic blowup equations \cite{Gu:2020fem}. In this section, we generalize both the elliptic blowup equations and the recursive formulas to the twisted cases. The partition functions of twisted circle compactification of 6d SCFTs can be written in terms of twisted elliptic genera as \begin{align} Z\left(\epsilon_1,\epsilon_2,t_i\right)=e^{\mathcal{F}^{\mathrm{cls}}}Z_0(\epsilon_1,\epsilon_2,m_{\cirG},m_{\cirF})\bigg(1+\sum_{d=1}^{\infty}e^{d\cdot t_{\mathrm{ell}}} \mathbb{E}_d(\epsilon_1,\epsilon_2,m_{\cirG},m_{\cirF})\bigg), \end{align} where $\mathcal{F}^{\mathrm{cls}}$ is the classical prepotential $\mathcal{F}^{\mathrm{cls}}=\mathcal{F}^{\mathrm{cls}}_{(0,0)}+\mathcal{F}^{\mathrm{cls}}_{(0,1)}+\mathcal{F}^{\mathrm{cls}}_{(1,0)}$ defined by \eqref{eq:F00}, \eqref{eq:F01} and \eqref{eq:F10}. The derivation of twisted elliptic blowup equations from \eqref{blowupgeom} to the elliptic form is exactly parallel to the untwisted cases, by a ``de-affinization procedure", thus we only present the results here. We refer readers interested in the derivation to Section 2.4 of \cite{Gu:2019dan} and Section 3.1 and Appendix D of \cite{Gu:2020fem}. Consider a rank one 6d SCFT with tensor branch coefficient $\mathfrak{n}$, gauge symmetry $G$, flavor symmetry $F$, and half-hypermultiplets transforming in the representations $(R_{G},R_{F})$. The flavor symmetry induces a current algebra of level $k_F$ on the worldsheet of BPS strings. Upon discrete twist, the twisted affine Lie algebra $\widehat{G}^{(n)}$ has truncated part $\mathring{G}$ as low energy 5d gauge symmetry. In the meantime, matter representation becomes $\mathring{R}$ and reduced flavor symmetry becomes $\mathring{F}$. Let $\lambda_0$ be a coweight base of $G$ that is \emph{invariant} upon the twist.\footnote{For example for $\mathfrak{so}(2r)^{(2)}$, the $\lambda_0$ associated to the vector representation is invariant upon the twist, while the one associated to the spinor representation is not.} If $(\lambda_0,\lambda_F)$ gives admissible elliptic blowup equation for the original 6d SCFT, and let $\lambda_{\mathring{F}}$ be the reduction of $\lambda_F$, then we propose the twisted elliptic genera $\mathbb{E}_d(\tau,m_{\mathring{G}},m_{\mathring{F}},\epsilon_{1,2})$ satisfy the following \emph{twisted elliptic blowup equations}: \begin{equation}\label{eq:ebeq} \begin{aligned} \,&\sum_{\lambda_{\cirG}\in\phi_{\lambda_0}(Q^\vee(\mathring{G}))}^{\frac{1}{2}||\lambda_{\cirG}||^2+d'+d''=d+\delta} (-1)^{|\lambda_{\cirG}|}\\ &\phantom{===}\times\theta_{i}^{[a]}(\mathfrak{n}\tau,-\mathfrak{n}\lambda_{\cirG}\cdotm_{\cirG} + k_{\mathring{F}}\lambda_{\cirF}\cdotm_{\cirF}+(y-\small{\frac{\mathfrak{n}}{2}}||\lambda_{\cirG}||^2)(\epsilon_1+\epsilon_2) -\mathfrak{n} d'\epsilon_1-\mathfrak{n} d''\epsilon_2) \\[-1mm] &\phantom{===}\times A_{{V}}^{\mathring{G}}(\tau,m_{\cirG},\lambda_{\cirG}) A_{{V}}^{frac}(\tau,m_{\cirG},\lambda_{\cirG}) A_{{H}}^{\mathring{R}}(\tau,m_{\cirG},m_{\cirF},\lambda_{\cirG},\lambda_{\cirF})\\ &\phantom{===}\times \mathbb{E}_{d'}(\tau,m_{\cirG}+\epsilon_1\lambda_{\cirG},m_{\cirF}+\epsilon_1\lambda_{\cirF},\epsilon_1,\epsilon_2-\epsilon_1) \mathbb{E}_{d''}(\tau,m_{\cirG}+\epsilon_2\lambda_{\cirG},m_{\cirF}+\epsilon_2\lambda_{\cirF},\epsilon_1-\epsilon_2,\epsilon_2)\\ &\phantom{==}=\Lambda(\delta)\, \theta_{i}^{[a]}(\mathfrak{n}\tau,k_F\lambda_{\cirF}\cdotm_{\cirF}+\mathfrak{n} y(\epsilon_1+\epsilon_2)) \mathbb{E}_d(\tau,m_{\cirG},m_{\cirF},\epsilon_1,\epsilon_2),\qquad d=0,1,2,\ldots \end{aligned} \end{equation} where \begin{equation} \Lambda(\delta) = \begin{cases} 1, & \delta =0,\\ 0, & \delta >0. \end{cases} \end{equation} The $\Lambda(\delta)=1$ case is called \emph{unity} blowup equations, while the $\Lambda(\delta)=0$ case \emph{vanishing}. The parameter $y$ is determined in \cite{Gu:2020fem} as \begin{equation}\label{eq:y} y = \frac{\mathfrak{n}-2+h_G^\vee}{4}+\frac{k_F}{2}(\lambda_F\cdot\lambda_F)=\frac{\mathfrak{n}-2+h_G^\vee}{4}+\frac{k_{\mathring{F}}}{2}(\lambda_{\mathring{F}}\cdot\lambda_{\mathring{F}}), \end{equation} which does not change upon twist. The Jacobi theta function $\theta_{i}^{[a]}$ with characteristics $a$ are defined in Appendix \ref{app:A}. It comes from the contribution of the prepotential of 6d twisted theories. The subscript $i$ is 3 if $ \mathfrak{n}$ is even and 4 if $\mathfrak{n}$ is odd. For twist coefficient $n_G=2,3$, the characteristic $a$ of the theta function can be one of the following $\mathfrak{n}$ numbers \begin{equation}\label{eq:a} 2\mathfrak{n} a = h^\vee_{\mathring{G}}-\frac12\sum_i {N_i}\mathrm{Ind}(R_i^{\mathring{G}}) - 2k,\quad k =0,1,\ldots,\mathfrak{n}-1. \end{equation} Recall $N_i$ are the number of hypers in $R_i^{\mathring{G}}$ with KK-charge zero. This formula means that only the KK-charge 0 part is relevant for the characteristic $a$, which is required for the 5d limit of twisted elliptic blowup equations to be consistent with the 5d blowup equations with matters \cite{Kim:2019uqw}. For twist coefficient $n_G=4$, the low energy gauge group $\mathring{G}=C_r$ which needs special care. When there is no KK-charge 0 matter, the $C_r$ allows another possibility called the $\theta=\pi$ theory, in which case the $h^\vee_{\mathring{G}}$ in \eqref{eq:a} needs to be replaced as $h^\vee_{\mathring{G}}-1$. This is also consistent with the 5d blowup equations in \cite{Kim:2019uqw}. The one-loop vector-multiplet contribution $A_{{V}}^{\mathring{G}}(\tau,m_{\cirG},\lambda_{\cirG})$ is defined as Equation $(3.7)$ of \cite{Gu:2020fem}, while the fractional part $A_{{V}}^{frac}(\tau,m_{\cirG},\lambda_{\cirG})$ is defined similarly with the fractional KK-charge taken into account. The one-loop hypermultiplet contribution $A_{{H}}^{\mathring{R}}(\tau,m_{\cirG},m_{\cirF},\lambda_{\cirG},\lambda_{\cirF})$ is defined similar with Equation $(3.8)$ of \cite{Gu:2020fem} with KK-charges taken into account. We collect the relevant formulas in Appendix \ref{app:A}. We summarize all admissible unity twisted elliptic blowup equations in Table \ref{tb:u}. We also collect some simple vanishing ones in Table \ref{tb:v}. It can be expected that there will be more vanishing blowup equations for some theories. Besides, we will focus on the twisted theories with paired matter content here. The blowup equations and twisted elliptic genera for theories with unpaired matter content are more subtle, we leave the discussion in Appendix \ref{app:D}. \begin{table}[h] \centering \begin{tabular}{|c|l|l|l|l|c|c|c|c|}\hline $\mathfrak{n}$ &$G$ & $\mathring{G}$ & $\mathring{F}$ &$\#$ &$y$ &$\lambda_{\cirF}$ \\ \hline 6&$E_6^{(2)}$& $F_4$ & $-$ & 1 & 4 & $\emptyset$ \\ \hline 4&$D_4^{(3)}$& $G_2$ & $-$ & 1 & 2 & $\emptyset$ \\ 4&$D_{r+4}^{(2)}$& $\!B_{r+3}\!$ & $\mathfrak{sp}(2r)$ & $2^{2r}$ & $r+2$ & $(0\ldots01)$ \\ 4 &$E_6^{(2)}$& $F_4$ & $\mathfrak{sp}(1)$ & 2 & 5 & $(1)$ \\ \hline 3&$A_2^{(2)}$ & $C_1$ & $-$ & 1 & 1 & $\emptyset$ \\ 3&$D_4^{(2)}$& $B_3$ & $\mathfrak{sp}(1)\times\mathfrak{sp}(1)$ & 4 & 5/2 & (1),(1) \\ 3& $D_4^{(3)}$& $G_2$ & $\mathfrak{sp}(1)$ & 2 & 5/2 & (1) \\ \hline 2& $A_{2r}^{(2)}$&$C_r$ & $\mathfrak{so}(4r+2)$ & $2^{2r+1}$ & $r+\frac12$ & $(0\ldots01)$ \\ 2&$A_{2r-1}^{(2)}$&$C_r$ & $\mathfrak{so}(4r)$ & $2^{2r}$ & $r$ & $(0\ldots01)$ \\ 2&$D_4^{(2)}$& $B_3$ & $\mathfrak{sp}(2)\times\mathfrak{sp}(2)$ & 16 & 3 & (01),(01) \\ 2& $D_4^{(3)}$& $G_2$ & $\mathfrak{sp}(2)$ & 4 & 3 & (01) \\ 2&$D_5^{(2)}$ & $B_4$ & $\mathfrak{sp}(4)\times\mathfrak{sp}(1)$ & 32 & 4 & (0001), (1) \\ 2 &$E_6^{(2)}$& $F_4$ & $\mathfrak{sp}(2)$ & 4 & 6 & $(01)$ \\ \hline 1& $A_2^{(2)}$ & $C_1$ & $\mathfrak{so}(12)$ & 64 & 2 & $(0\ldots01)$ \\ 1&$A_3^{(2)}$ & $C_2$ & $\mathfrak{so}(12)\times \mathfrak{sp}(1)$ & 128 & 5/2 & $\!(0\ldots01),(1)\!$ \\ 1&$D_4^{(2)}$& $B_3$ & $\mathfrak{sp}(3)\times\mathfrak{sp}(3)$ & 64 & 7/2 & (001),(001) \\ 1&$D_4^{(3)}$& $G_2$ & $\mathfrak{sp}(3)$ & 8 & 7/2 & (001) \\ \hline \end{tabular} \caption{The parameters $y, \lambda_{\cirF}$ of unity twisted elliptic blowup equations for rank one models. The \# is the number of unity equations with a fixed characteristic $a$.} \label{tb:u} \end{table} \begin{table}[h] \centering \begin{tabular}{|c|l|l|l|l|c|c|c|}\hline $\mathfrak{n}$ &$G$ & $\mathring{G}$ & $\mathring{F}$ &$\#$ &$y$ &$\lambda_{\cirF}$ \\ \hline 4&$D_{r+4}^{(2)}$& $\!B_{r+3}\!$ & $\mathfrak{sp}(2r)$ & $2^{2r}$ & $r+2$ & $(0\ldots01)$ \\ \hline 3&$D_4^{(2)}$& $B_3$ & $\mathfrak{sp}(1)\times\mathfrak{sp}(1)$ & 2 & $3$ & (1),(0) \\ \hline 2&$A_{2r-1}^{(2)}$&$C_r$ & $\mathfrak{so}(4r)$ & $1$ & $1 $ & $(0\ldots0)$ \\ 2&$D_4^{(2)}$& $B_3$ & $\mathfrak{sp}(2)\times\mathfrak{sp}(2)$ & 4 & $4$ & (01),(00) \\ 2&$D_5^{(2)}$ & $B_4$ & $\mathfrak{sp}(4)\times\mathfrak{sp}(1)$ & 16 &$5$& (0001), (0) \\ 2&$D_6^{(2)}$ & $B_5$ & $\mathfrak{sp}(6)$ & 64 & $6$ & (000001) \\ \hline 1&$D_4^{(2)}$& $B_3$ & $\mathfrak{sp}(3)\times\mathfrak{sp}(3)$ & 8 & $5$ & (001),(000) \\ \hline \end{tabular} \caption{The parameters $y, \lambda_{\cirF}$ of vanishing twisted elliptic blowup equations for rank-one models. The \# is the number of vanishing equations with fixed characteristics $a$.} \label{tb:v} \end{table} To solve blowup equations, four methods have been presented in Section 4 of \cite{Gu:2020fem}, which are recursion formula and Weyl orbit expansion for elliptic blowup equations, and refined BPS expansion and $\epsilon_1,\epsilon_2$ expansion for general local Calabi-Yau threefolds. All four methods apply to the current twisted cases as well. In Section \ref{sec:recursion}, we will explicitly present the recursion formula for twisted elliptic genera, which is the most efficient approach but only works for $\mathfrak{n}\ge 3$ theories. We also use the Weyl orbit expansion to solve the twisted elliptic genera of many $\mathfrak{n}=1,2$ theories. Both methods utilize the unity part of \eqref{eq:ebeq}. The vanishing part of \eqref{eq:ebeq} is less useful in solving twisted elliptic genera, but still gives some interesting vanishing theta identities which will be discussed in Section \ref{sec:vanish}. Blowup equations can even shed new light on the structure of 6d $(1,0)$ SCFTs itself. As mentioned earlier, it was found in \cite{Gu:2020fem} that for the modularity of elliptic blowup equations for 6d $(1,0)$ SCFTs to hold, the following constraint on tensor coefficient $\mathfrak{n}$, gauge algebra $G$ and matter representations $R$ need to be satisfied: \begin{equation} \frac{h_G^{\vee}}{6}-\sum_i\frac{N_i}{12}\mathrm{Ind}(R_i^G)=\frac{\mathfrak{n}-2}{2}. \end{equation} Simply speaking, this constraint comes from the consistency requirement when converting the blowup equations of refined topological strings on non-compact Calabi-Yau threefolds to the elliptic form. For twisted elliptic blowup equations, we find there exists similar constraints depending on the type of twists. For $\mathbb{Z}_2$ twist with $n_G=2$, we find\footnote{The $\mathfrak{n}=1,\mathfrak{su}(2)+10\bf F$ theory is not included.} \begin{equation}\label{gold} \frac{h^\vee_{\mathring{G}}}{6}-\frac{1}{24}\mathrm{Ind}(V^{frac}_{1/2})-\sum_i\frac{N_i}{12n^G_i}\mathrm{Ind}(R_i^{\mathring{G}})=\left\{\begin{array}{cc} \frac{\mathfrak{n}}{4}-\frac14, & \quad \mathfrak{so}(2r)^{(2)}, \\ \frac{\mathfrak{n}}{8}+\frac{1}{2}, & \quad E_6^{(2)}. \end{array} \right. \end{equation} Here $N_i$ is the number of hypers $R_i^{\mathring{G}}$ with KK-charge 0, with a twist coefficient $n^G_i$. We checked (\ref{gold}) is true for all $\mathfrak{n}=4,\mathfrak{so}(2N)^{(2)}$ theories\footnote{Since $\mathring{G}=\mathfrak{so}(2N-1)$, we have $\frac{2N-3}{6}-\frac{2}{24}-\frac{2N-8}{12}\times 2=\frac{3}{4} $.}, $\mathfrak{n}=1,2,3,4,G=\mathfrak{so}(8)^{(2)}$ theories, $\mathfrak{n}=2,G=\mathfrak{so}(10),\mathfrak{so}(12)$ theories, $\mathfrak{n}=2,G=\mathfrak{su}(2N)$ theories\footnote{Since $\mathring{G}=\mathfrak{sp}(N)$, we have $\frac{N+1}{6}-\frac{2N-2}{24}-\frac{2N\times 1}{24}=\frac{1}{4}.$} and $\mathfrak{n}=1,G=\mathfrak{su}(4)$ theories. For $\mathbb{Z}_3$ twist, we have \begin{equation}\label{gold2} \frac{h^\vee_{\mathring{G}}}{6}-\frac{1}{18}\mathrm{Ind}(V^{frac}_{1/3})-\frac{N}{36}\mathrm{Ind}(R^{\mathring{G}})=\frac{\mathfrak{n}}{18}+\frac{1}{3}. \end{equation} Here $N$ is the number of hypers $R^{G_2}$ with twist coefficient 3. We checked (\ref{gold2}) is true for $\mathfrak{n}=1,2,3,4,G=\mathfrak{so}(8)^{(3)}$ theories. For $n^G=4$, we find \begin{equation}\label{gold3} \frac{h^\vee_{\mathring{G}}}{6}-\frac{1}{24}\mathrm{Ind}(V^{frac}_{1/2})-\frac{1}{48}\mathrm{Ind}(V^{frac}_{1/4})-\frac{N}{24}\mathrm{Ind}(R^{\mathring{G}})=\frac{\mathfrak{n}}{8}-\frac{1}{16}. \end{equation} Here $N$ is the number of fundamental hypers $R=\bf F$ of $\mathring{G}=\mathfrak{sp}(r)$. We checked (\ref{gold3}) is true for $\mathfrak{n}=1,2,3,G=\mathfrak{su}(3)^{(2)}$ theories and $\mathfrak{n}=2,G=\mathfrak{su}(2r+1)^{(2)}$ theories\footnote{Since $\mathring{G}=\mathfrak{sp}(N)$, we have $\frac{N+1}{6}-\frac{2N-2}{24}-\frac{1}{48}-\frac{(2N+1)\times 1}{24}=\frac{3}{16}.$}. Notice that these interesting constraints exactly give the $c$ constants discussed in \eqref{goldall1}. In summary, denote $s$ as all fractional KK charges, we have for all paired theories, \begin{equation}\label{goldall} c=\frac{h^\vee_{\mathring{G}}}{6}-\sum_{s}\zeta(-1,s)\mathrm{Ind}(V^{frac}_{s})-\sum_i\frac{N_i}{12r_i^{\rm out}}\mathrm{Ind}(R_i^{\mathring{G}})= \left\{\begin{array}{l} \frac{\mathfrak{n}}{2n_G}-\frac{1}{(n_G)^2}, \\ \frac{\mathfrak{n}}{2(n_G)^2}+\frac{1}{n_G}. \end{array} \right. \end{equation} Here $n_G=1,2,3,4$. The two possibilities here perhaps are related to the different types of multi-section Calabi-Yau geometries. \subsection{Modularity} The modularity of all elliptic blowup equations for rank-one 6d SCFTs has been proved in the Section 3.2 of \cite{Gu:2020fem}. The modularity of twisted elliptic blowup equations actually inherits from its untwisted origin, that is the index of each part is directly reduced from its untwisted origin. For example, as we have mentioned, the modular index of twisted elliptic genera can be reduced from the modular index of untwisted ones. Therefore, we will be brief and only show one example here. Consider the pure $\mathfrak{so}(8)^{(3)}$ theory with $\mathfrak{n}=4$. From the general formula \eqref{eq:ebeq}, we have the following unity twisted elliptic blowup equations for the twisted elliptic genera: \begin{equation} \begin{aligned} \sum_{\frac{1}{2}||\alpha^\vee||^2_{G_2}+d'+d''=d}& (-1)^{|\alpha^\vee|} \theta_{3}^{[a]}(4\tau,-4m_{\alpha^\vee} +(2-2||\alpha^\vee||^2)(\epsilon_1+\epsilon_2) -4 d'\epsilon_1-4 d''\epsilon_2)\nonumber \\[-3.3mm] &\times A_{{V}}^{G_2}(\tau,m,\alpha^\vee) A^{\mathbf{7}_{1/3} \oplus \mathbf{7}_{2/3}}_V(\tau,m,\alpha^\vee)\nonumber \\ &\times \mathbb{E}_{d'}(\tau,m+\epsilon_1\alpha^\vee,\epsilon_1,\epsilon_2-\epsilon_1) \mathbb{E}_{d''}(\tau,m+\epsilon_2\alpha^\vee,\epsilon_1-\epsilon_2,\epsilon_2)\nonumber \\ =&\, \theta_{3}^{[a]}(4\tau, 2(\epsilon_1+\epsilon_2)) \mathbb{E}_d(\tau,m,\epsilon_1,\epsilon_2),\qquad d=0,1,2,\ldots \label{eq:ebeq2} \end{aligned} \end{equation} Here the characteristic $a=0,\pm\frac14,\frac12$. Note the $B$ field of the base $(-4)$-curve is even, which was already observed in \cite[Section 6.1]{Kim:2020hhh}. We now show how to prove the modularity of twisted elliptic blowup equations (\ref{eq:ebeq2}). Denote $d_0=\frac{1}{2}||\alpha^\vee||^2_{G_2}$. The classical part contributes to the index quadratic form as \begin{equation} \mathrm{Ind}_{\rm cl}=2(-\alpha^{\vee}\cdot m_{G_2} + (1/2 - d_0) (\epsilon_1 + \epsilon_2) - d' \epsilon_1 - d'' \epsilon_2)^2. \end{equation} The $\Lambda$ factor $ \theta_{3}^{[a]}(4\tau, 2(\epsilon_1+\epsilon_2))$ contributes index with $\mathrm{Ind}_{\Lambda}=\frac{1}{2}(\epsilon_1 + \epsilon_2)^2$. The following identities for the coroot lattice of $G_2$ are useful when computing the index from vector multiplets contribution: $\forall \alpha^{\vee}\in Q^{\vee}_{G_2}$, \begin{align} \sum_{\beta\in \Delta_+(G_2)}(m\cdot \beta)(\alpha^{\vee}\cdot \beta)&=4 m\cdot\alpha^{\vee},\\ \sum_{\beta\in \Delta_+(G_2)}(m\cdot \beta)(\alpha^{\vee}\cdot \beta)^3&=10d_0m\cdot\alpha^{\vee}=5(\alpha^{\vee}\cdot\alpha^{\vee})(m\cdot\alpha^{\vee}),\\ \sum_{\beta\in \Delta_+(G_2)}(m\cdot \beta)^2(\alpha^{\vee}\cdot \beta)^2&= \frac{10}{3}(m\cdot\alpha^{\vee})^2+\frac{5}{3}(m\cdot m) (\alpha^{\vee}\cdot\alpha^{\vee}). \end{align} Then by the definition in Appendix \ref{app:B}, we find the $G_2$ vector multiplet $A_{{V}}^{G_2}(\tau,m,\alpha^\vee)$ contributes to index as \begin{equation} \begin{aligned} \mathrm{Ind}_{V}^{G_2}=&-\frac{5}{3}\((\alpha^{\vee}\cdot m_{G_2})^2+d_0( m_{G_2}\cdot m_{G_2})\)-\frac{10d_0-4}{3}(\epsilon_1+\epsilon_2)\alpha^{\vee}\cdot m_{G_2}\\& -\frac{d_0}{3}\(5d_0-2\)(\epsilon_1^2+\epsilon_1\epsilon_2+\epsilon_2^2). \end{aligned} \end{equation} To compute the index contribution from the fractional vector multiplets, we still need the following useful formulas for $G_2$ orbit $\mathcal{O}_{1,6}\subset \bf 7$: $\forall \alpha^{\vee}\in Q^{\vee}_{G_2}$, \begin{align} \sum_{w\in \mathcal{O}_{1,6}}(m\cdot w)(\alpha^{\vee}\cdot w)&=2 m\cdot\alpha^{\vee},\\ \sum_{w\in \mathcal{O}_{1,6}}(m\cdot w)(\alpha^{\vee}\cdot w)^3&=2d_0m\cdot\alpha^{\vee}=(\alpha^{\vee}\cdot\alpha^{\vee})(m\cdot\alpha^{\vee}),\\ \sum_{w\in \mathcal{O}_{1,6}}(m\cdot w)^2(\alpha^{\vee}\cdot w)^2&= \frac{2}{3}(m\cdot\alpha^{\vee})^2+\frac{1}{3}(m\cdot m) (\alpha^{\vee}\cdot\alpha^{\vee}). \end{align} Then by the definition in Appendix \ref{app:B}, we find the KK charge $1/3$ and $2/3$ parts $A^{\mathbf{7}_{1/3} \oplus \mathbf{7}_{2/3}}_V(\tau,m,\alpha^\vee)$ contribute to index as \begin{equation} \begin{aligned} \mathrm{Ind}^{\mathbf{7}_{1/3} \oplus \mathbf{7}_{2/3}}_V= &-\frac{1}{3}\Big((\alpha^{\vee}\cdot m_{G_2})^2+d_0( m_{G_2}\cdot m_{G_2})\Big)-\frac{2d_0-2}{3}(\epsilon_1+\epsilon_2)\alpha^{\vee}\cdot m_{G_2}\\& -\frac{d_0(d_0-1)}{3}(\epsilon_1^2+\epsilon_1\epsilon_2+\epsilon_2^2). \end{aligned} \end{equation} From \eqref{eq:twistedEd-index} we know the $d$-string twisted elliptic genus has index \begin{equation} \mathrm{Ind}_{\mathbb{E}}(d,m_{G_2},\epsilon_1,\epsilon_2)=-d({\epsilon_1+\epsilon_2})^2+(2d^2-d)\epsilon_1\epsilon_2-2dm_{G_2}\cdot m_{G_2}. \end{equation} All together, we checked that given $d=d_0+d'+d''$, the modularity of twisted elliptic blowup equation (\ref{eq:ebeq2}) holds, i.e., \begin{equation} \begin{aligned} \,&\mathrm{Ind}_{\rm cl}+\mathrm{Ind}_V^{G_2}+\mathrm{Ind}^{\mathbf{7}_{1/3} \oplus \mathbf{7}_{2/3}}_V+\mathrm{Ind}_{\mathbb{E}}(d',m_{G_2}+\epsilon_1\alpha^\vee,\epsilon_1,\epsilon_2-\epsilon_1)\\&+\mathrm{Ind}_{\mathbb{E}}(d'',m_{G_2}+\epsilon_2\alpha^\vee,\epsilon_1-\epsilon_2,\epsilon_2) =\mathrm{Ind}_{\Lambda}+\mathrm{Ind}_{\mathbb{E}}(d,m_{G_2},\epsilon_1,\epsilon_2). \end{aligned} \end{equation} \subsection{Recursion formula for twisted elliptic genera}\label{sec:recursion} In general, for $\mathfrak{n}\ge 3$ and paired matter content, there exist a sufficient number of unity blowup equations which together give a recursion formula for the elliptic genera with respect to the string number $d$. For the untwisted situation, this has been discussed extensively in Section 4.1 of \cite{Gu:2020fem}. For the current twisted situation, the recursion formula is very similar. We omit the derivation and only state the results here. It should be noted that for $\mathfrak{n}=1,2$, although there is no explicit recursion formula, the elliptic genera still can be solved for many theories, see Section 4.2 of \cite{Gu:2020fem}. For simplicity, in this subsection, we first discuss the four pure gauge twisted theories, then move to the theories with matters. For the pure gauge twisted theories $G^{(n)}=\mathfrak{su}(3)^{(2)},\mathfrak{so}(8)^{(2)},\mathfrak{so}(8)^{(3)},E_6^{(2)}$, let us use the following shorthand notation for the classical term in blowup equations: \begin{equation}\label{eq:classicalthetapure} \theta_{i,\{d_0,d_1,d_2\}}^{[a]}= \theta^{[a]}_i\(\mathfrak{n}\tau, -\mathfrak{n} m_{\alpha^{\vee}} +(\mathfrak{n}-2)(\epsilon_1+\epsilon_2)-\mathfrak{n}((d_0+d_1)\epsilon_1+(d_0+d_2)\epsilon_2)\) \,, \end{equation} where $m_{\alpha^\vee} = {m}\cdot \alpha^\vee$ and $m$ is the gauge fugacity for $\mathring{G}$. Furthermore, we define \begin{equation}\label{eq:Dd} D_d=\det\left( \begin{array}{ccc} \theta_{i,\{0,d,0\}}^{[a_1]} &\ \theta_{i,\{0,0,d\}}^{[a_1]} &\ \theta_{i,\{0,0,0\}}^{[a_1]}\\ \theta_{i,\{0,d,0\}}^{[a_2]} &\ \theta_{i,\{0,0,d\}}^{[a_2]} &\ \theta_{i,\{0,0,0\}}^{[a_2]}\\ \theta_{i,\{0,d,0\}}^{[a_3]} &\ \theta_{i,\{0,0,d\}}^{[a_3]} &\ \theta_{i,\{0,0,0\}}^{[a_3]}\\ \end{array} \right), \end{equation} as well as \begin{equation}\label{eq:Dda} D_{\{d_0,d_1,d_2\}}^{\alpha^{\vee}}=\det\left( \begin{array}{ccc} \theta_{i,\{0,d,0\}}^{[a_1]} &\ \theta_{i,\{0,0,d\}}^{[a_1]} &\ \theta_{i,\{d_0,d_1,d_2\}}^{[a_1]}\\ \theta_{i,\{0,d,0\}}^{[a_2]} &\ \theta_{i,\{0,0,d\}}^{[a_2]} &\ \theta_{i,\{d_0,d_1,d_2\}}^{[a_2]}\\ \theta_{i,\{0,d,0\}}^{[a_3]} &\ \theta_{i,\{0,0,d\}}^{[a_3]} &\ \theta_{i,\{d_0,d_1,d_2\}}^{[a_3]}\\ \end{array} \right). \end{equation} Note that $D_d=D_{\{0,0,0\}}^{\alpha^{\vee}}$ does not depend on $\alpha^{\vee}$. Then the recursion formula of $d$-string twisted elliptic genera $\mathbb{E}_d(m,\epsilon_1,\epsilon_2)$ read \begin{equation}\label{recursionZd} \begin{aligned} \mathbb{E}_d= \sum_{d_0=\tfrac{1}{2}||\alpha^{\vee}||^2,\,d_{1,2}<d}^{d_0+d_1+d_2=d} & (-1)^{|\alpha^{\vee}|} \frac{D^{\alpha^{\vee}}_{\{d_0,d_1,d_2\}}}{D_d} A_{V}^{\mathring{G}}( m,\alpha^{\vee})A_{V}^{frac}( m,\alpha^{\vee})\\[-3mm] &\ \times \mathbb{E}_{d_1}(m+\epsilon_1 {\alpha^{\vee}},\epsilon_1,\epsilon_2-\epsilon_1) \mathbb{E}_{d_2}( m+\epsilon_2 {\alpha^{\vee}},\epsilon_1-\epsilon_2,\epsilon_2). \end{aligned} \end{equation} Specializing to $d=1$, we obtain the following elegant formula for the twisted one-string elliptic genera of all four pure gauge twisted theories: \begin{equation}\label{Z1} \mathbb{E}_1=\sum_{\alpha\in\Delta^\vee_l} \frac{D^{\alpha^{\vee}}_{\{1,0,0\}}}{D_1} \frac{\eta^4} {\theta_1(m_{\alpha}) \theta_1(m_{\alpha}-\epsilon_{1,2}) \theta_1(m_{\alpha}-2\epsilon_+)} \prod_{\displaystyle \substack{\beta\in \Delta\\ \alpha \cdot \beta= 1}} \frac{\eta}{\theta_1(m_{\beta})}\prod^k_{\displaystyle \substack{\gamma\in \Delta_s\\ \alpha \cdot \gamma= 1}} \frac{\eta}{\theta_1^{[k]}(m_{\gamma})}. \end{equation} Recall $\Delta_s$ denotes the set of short roots, while $k$ denotes all fractional KK-charges of $\bf F$ appearing in the twist of adjoint representation. For example, for $\mathfrak{so}(8)^{(3)}$, $k$ takes values $1/3,2/3$. For twisted theories with paired matters, we just need to add the hypermultiplet contribution to the above formulas. The classical term in \eqref{eq:classicalthetapure} is replaced as \begin{equation} \theta_{i}^{[a]}(\mathfrak{n}\tau,-\mathfrak{n} m_{\alpha^{\vee}}^{\mathring{G}} + k_{\mathring{F}} m_{\lambda}^{\mathring{F}}+(y-\mathfrak{n} d_0)(\epsilon_1+\epsilon_2) -\mathfrak{n} d'\epsilon_1-\mathfrak{n} d''\epsilon_2), \end{equation} with a fixed unity $\lambda=\lambda_{\mathring{F}}$. Then $D_d$ and $D_{\{d_0,d_1,d_2\}}^{\alpha^{\vee}}$ are defined the same with the pure gauge cases \eqref{eq:Dd}, \eqref{eq:Dda}. The universal recursion formula for twisted $d$-string elliptic genera $\mathbb{E}_d(m_{\cirG},m_{\cirF},\epsilon_1,\epsilon_2)$ read \begin{align}\label{recursionZdmatter}\nonumber \mathbb{E}_d= \sum_{d_0=\tfrac{1}{2}||\alpha^{\vee}||^2,\,d_{1,2}<d}^{d_0+d_1+d_2=d} & (-1)^{|\alpha^{\vee}|} \frac{D^{\alpha^{\vee}}_{\{d_0,d_1,d_2\}}}{D_d} A_{V}^{\mathring{G}}( m_{\cirG},\alpha^{\vee})A_{V}^{frac}( m_{\cirG},\alpha^{\vee})A_{{H}}^{\mathring{R}}(m_{\cirG},m_{\cirF},\alpha^{\vee},\lambda)\\[-3mm]\nonumber &\ \times \mathbb{E}_{d_1}(m_{\cirG}+\epsilon_1 {\alpha^{\vee}},m_{\cirF}+\epsilon_1\lambda ,\epsilon_1,\epsilon_2-\epsilon_1)\\ &\ \times \mathbb{E}_{d_2}( m_{\cirG}+\epsilon_2 {\alpha^{\vee}},m_{\cirF}+\epsilon_2\lambda,\epsilon_1-\epsilon_2,\epsilon_2). \end{align} Specializing to $d=1$, we obtain the following universal formula for the twisted one-string elliptic genera: \begin{equation}\label{Z1m} \begin{aligned} \mathbb{E}_1=\sum_{\alpha\in\Delta^\vee_l}& \frac{D^{\alpha^{\vee}}_{\{1,0,0\}}}{D_1} \frac{\eta^4} {\theta_1(m_{\alpha}) \theta_1(m_{\alpha}-\epsilon_{1,2}) \theta_1(m_{\alpha}-2\epsilon_+)}\\ &\times \prod_{\displaystyle \substack{\beta\in \Delta\\ \alpha \cdot \beta= 1}} \frac{\eta}{\theta_1(m_{\beta})}\prod_{\displaystyle \substack{\gamma\in \Delta_s\\ \alpha\cdot \gamma= 1}}^k \frac{\eta}{\theta_1^{[k]}(m_{\gamma})} \prod_{\displaystyle \substack{w \in R\\ \alpha \cdot w= 1/2}} \frac{\theta_1^{[k']}(m_{w}+m_f+\epsilon_+)}{\eta}. \end{aligned} \end{equation} Here $k'$ are the KK-charges of the twisted matter content, and the $w$ are the weights of $\mathring{G}$ and $m_f$ are the flavor fugacities. We use this formula to compute the twisted one-string elliptic genera of lots of 6d twisted theories. In most cases, our results are new. Though by the recursion formula, one can compute the elliptic genera to arbitrary number of strings, we are particular interested in the \emph{reduced twisted one-string elliptic genera} defined by \begin{equation}\label{eq:defred} \mathbb{E}_1^{\rm red}(\tau,\epsilon_+)=\frac{\theta_1(\tau,\epsilon_1)\theta_1(\tau,\epsilon_2)}{\eta(\tau)^2}\mathbb{E}_1(\tau,\epsilon_1,\epsilon_2). \end{equation} The prefactor here comes from the well-known center of motion contribution in $\mathbb{C}_{\epsilon_1,\epsilon_2}^2$, see e.g. \cite{DelZotto:2016pvm,DelZotto:2018tcj}. The simplicity of $\mathbb{E}_1^{\rm red}$ lies in that it only depends on $\epsilon_+$ but not on $\epsilon_-$. Since there is no room for confusion, in the following we often omit the term ``reduced", and just say twisted one-string elliptic genera. The reduced twisted one-string elliptic genera exhibit many fascinating properties such as $\Gamma_1(N)$ modularity and spectral flow symmetry, which will be discussed later. \subsection{Vanishing equations and vanishing theta identities}\label{sec:vanish} The vanishing elliptic blowup equations, although less constraining for elliptic genera than the unity ones, are still rather non-trivial functional equations. In particular, the leading degree of vanishing elliptic blowup equations does not involve contribution from elliptic genera, but only the classical and one-loop parts. Therefore, the leading degree equations usually give some interesting vanishing theta identities depending on the root and weight lattices of the 6d gauge algebras $G$, see many examples in \cite{Gu:2019dan,Gu:2020fem}. In the twisted cases, we find many similar identities depending on the root and weight lattices of the truncated algebras $\mathring{G}$. In this subsection, we will explicitly show some leading degree identities for the vanishing twisted elliptic blowup equations given in Table \ref{tb:v}. We have checked these identities to sufficient high orders in the $q$ expansions. Let us first study the $\mathfrak{so}(8)^{(2)}$ cases, where $\mathring{G}=\mathfrak{so}(7)$ and the vanishing $\lambda_{\mathfrak{so}(7)}$ can take value in the dominant orbit $\mathcal{O}_{1,6}$ of vector representation $\bf 7$. For pure $\mathfrak{so}(8)^{(2)}$ theory with $\mathfrak{n}=4$, we derive the following leading degree vanishing theta identity: \begin{equation} \sum_{w\in\mathcal{O}_{1,6}}(-1)^{|w|}\frac{\theta_3^{[a]}(4\tau,4m_w)}{\theta_4(\tau,m_w)}{\prod_{\alpha\in\Delta(B_3)}^{w\cdot\alpha=1}\theta_1(\tau,m_{\alpha})^{-1}}=0. \end{equation} Here $a=\pm 1/8,\pm 3/8$. It is easy to check for each $w\in\mathcal{O}_{1,6}$, the summand has index $\frac42m_w^2-\frac12m_w^2-\frac52m_w^2=-m_w^2$ which is invariant for the whole Weyl orbit. We checked this identity to high $q$ orders. For $\mathfrak{n}=3$, we have one vector hypermultiplet with mass $m_v$ and two spinor hypermultiplets with mass $m_s$. Note $\forall w\in\mathcal{O}_{1,6}$ and $w'\in \mathbf{8_s}$, $w\cdot w'=\pm1/2$. Thus the spinor hypermultiplets do not contribute to the leading degree vanishing theta identity. We then have \begin{equation} \sum_{w\in\mathcal{O}_{1,6}}(-1)^{|w|}\frac{\theta_4^{[a]}(3\tau,-3m_w+y)\theta_1(\tau,m_w+y)}{\theta_4(\tau,m_w)}{\prod_{\alpha\in\Delta(B_3)}^{w\cdot\alpha=1}\theta_1(\tau,m_{\alpha})^{-1}}=0. \end{equation} Here $y=m_f+\epsilon_+$ and $a=0,\pm 1/3$. It is easy to check for each $w$, the summand has index $\frac32(m_w-\frac13y)^2+\frac12(m_w+y)^2-\frac12m_w^2-\frac52m_w^2=-m_w^2+\frac23y^2$ which is invariant for the whole Weyl orbit. We also checked this identity for general $y$ to high $q$ orders. In fact, for 6d $(1,0)$ $\mathfrak{so}(8)^{(2)}$ theories with $\mathfrak{n}=1,2,3,4$, we find the following unified formula for the leading degree vanishing theta identities: \begin{equation} \sum_{w\in\mathcal{O}_{1,6}}(-1)^{|w|}\frac{\theta_i^{[a]}(\mathfrak{n}\tau,-\mathfrak{n} m_w+\sum y_j)\prod_{j=1}^{4-\mathfrak{n}}\theta_1(\tau,m_w+y_j)}{\theta_4(\tau,m_w)}{\prod_{\alpha\in\Delta(B_3)}^{w\cdot\alpha=1}\theta_1(\tau,m_{\alpha})^{-1}}=0. \end{equation} Recall $i=3$ for even $n$ and $i=4$ for odd $n$. Consider the $\mathfrak{so}(2r+8)^{(2)}$ theories with $\mathfrak{n}=4$, where $\mathring{G}=\mathfrak{so}(2r+7)$ and the vanishing $\lambda_{B_{r+3}}$ can take value in the dominant orbit $\mathcal{O}_{1,2(r+3)}$ of the vector representation. In these cases, the vector hypermultiplets can contribute to the leading degree of vanishing blowup equations. To be precise, we find the following leading degree vanishing theta identity for general $r$: \begin{equation} \sum_{w\in\mathcal{O}_{1,2(r+3)}}(-1)^{|w|}\frac{\theta_4^{[a]}(4\tau,-4m_w+\sum y_j)}{\theta_4(\tau,m_w)}{\prod_{\alpha\in\Delta(B_{r+3})}^{w\cdot\alpha=1}\theta_1(\tau,m_{\alpha})^{-1}}\prod_{j=1}^{2r}\theta_1(\tau,m_w+y_j)=0. \end{equation} Here $a=\pm 1/8,\pm 3/8$ and $y_i=m_{f_i}+\epsilon_+$. We checked this identity for various $r$ up to high $q$ orders. More $\mathfrak{so}$ type examples with $\mathbb{Z}_2$ twist include the $\mathfrak{so}(10)^{(2)}$ theory with $\mathfrak{n}=2$, for which we find the following leading degree vanishing theta identities: \begin{equation} \sum_{w\in\mathcal{O}_{1,8}}(-1)^{|w|}\frac{\theta_3^{[a]}(2\tau,-2m_w+\sum y_i)\prod_{i=1}^{4}\theta_1(\tau,m_w+y_i)}{\theta_4(\tau,m_w)}{\prod_{\alpha\in\Delta(B_4)}^{w\cdot\alpha=1}\theta_1(\tau,m_{\alpha})^{-1}}=0. \end{equation} Here $a=\pm1/4$. Besides, for $\mathfrak{so}(12)^{(2)}$ theories with $\mathfrak{n}=2$, we find the following leading degree vanishing theta identities: \begin{equation} \sum_{w\in\mathcal{O}_{1,10}}(-1)^{|w|}\frac{\theta_3^{[a]}(2\tau,-2m_w+\sum y_i)\prod_{i=1}^{6}\theta_1(\tau,m_w+y_i)}{\theta_4(\tau,m_w)}{\prod_{\alpha\in\Delta(B_5)}^{w\cdot\alpha=1}\theta_1(\tau,m_{\alpha})^{-1}}=0. \end{equation} We checked all these identities for general $y_i$ up to high $q$ orders. Now consider the $\mathfrak{su}({2r})^{(2)}$ theories with $\mathfrak{n}=2$ where $\mathring{G}=\mathfrak{sp}(r)$. First, for $\mathfrak{su}(2)^{(2)}$ theory, the leading vanishing identity is trivial. For $\mathfrak{su}({4})^{(2)}$ theory, the leading degree vanishing identity is for $C_2$: \begin{equation} \sum_{w\in\mathcal{O}_{1,4}}(-1)^{|w|}\frac{\theta_3^{[a]}(2\tau,-2m_w)}{\theta_4(\tau,m_w)}{\prod_{\alpha\in\Delta(C_2)}^{w\cdot\alpha=1}\theta_1(\tau,m_{\alpha})^{-1}}=0, \end{equation} where $a=\pm1/4$ and $\mathcal{O}_{1,4}$ is the dominant Weyl orbit in $\bf 5$. We checked this identity to high $q$ orders. For arbitrary $r$, it is easy to find the leading degree vanishing theta identities for $C_r$ can be uniformly written as \begin{equation}\label{n2sunvanish} \sum_{w\in\mathcal{O}_{1,2r}}(-1)^{|w|}{\theta_3^{[a]}(2\tau,-2m_w)}{\prod_{\alpha\in\Delta(C_r)}^{w\cdot\alpha=1}\theta_1(\tau,m_{\alpha})^{-1}}{\prod_{\beta\in \mathbf{\Lambda}^2}^{w\cdot\beta=1}\theta_4(\tau,m_{\alpha})^{-1}}=0. \end{equation} Again $a=\pm1/4$ and the $ \mathcal{O}_{1,2r}$ is the dominant Weyl orbit in the $\mathbf{\Lambda}^r$ representation of $C_r$. Note each $w\in\mathcal{O}_{1,2r}$ intersect with all weights of $\mathbf{\Lambda}^2$ by $r(r-1)/2$ number of $1$, $r(r-1)/2$ number of $-1$, while the rest intersection numbers are zero. We have checked identity \eqref{n2sunvanish} for $r=2,3,4,5$ to high $q$ orders. \section{Structure of twisted elliptic genera}\label{sec:spectralflow} We use the twisted elliptic blowup equations and the recursion formula \eqref{Z1} introduced in the last section to compute the twisted one-string elliptic genera of all twisted 6d $(1,0)$ SCFTs. These data enable us to study some universal features of the twisted elliptic genera. Many of these features are the generalization of those of the ordinary $(0,4)$ elliptic genera observed by del Zotto and Lockhart in \cite{DelZotto:2016pvm,DelZotto:2018tcj}. According to the universal formula \eqref{eq:dc} and \eqref{eq:defred}, the reduced twisted one-string R-R elliptic genera have the following form \begin{equation}\label{eq:dc1} \mathbb{E}_1(q,v,x,m_{\mathring{G}},m_{\mathring{F}})= q^{\frac16-c}\Big(Z_1^{5d}(v,x,m_{\mathring{G}},m_{\mathring{F}})+ \mathcal{O}(q^{1/n_G}) \Big), \end{equation} where $Z_1^{5d}$ is the reduced one-instanton partition function of the 5d circle reduction theory. \subsection{Spectral flow symmetry}\label{subsec:sfs} Spectral flow is a characteristic feature of 2d $\mathcal{N}=(2,2)$ SCFTs, see e.g. \cite[Chapter 5.4]{Blumenhagen:2009zz}. The different sectors of 2d SCFTs are interpolated by a spectral flow parameter $\eta$. When $\eta\in \mathbb{Z}+\frac12$, the spectral flow interpolates the NS sector with half-integer modes and the R sector with integer modes. For chiral primary $|h,q\rangle$ of $(2,2)$ SCFT, the conformal weight $h$ and charge $q$ transform under spectral flow with general $\eta$ as \begin{equation} h_{\eta}=h-\eta q+\frac{\eta^2}{6}c',\qquad q_\eta=q-\frac{c'}{3}\eta. \end{equation} Here the $c'$ is the central charge of the 2d SCFT. We are interested in the $\eta=\frac12$ case. Using $h=q/2$, the spectral flow induces transformation \begin{equation} \Big|\frac{q}{2},q\Big\rangle_{\rm NS}\rightarrow \Big|\frac{c'}{24},q-\frac{c'}{6}\Big\rangle_{\rm R}. \end{equation} Note the weight $\frac{c'}{24}$ indicates the ground state of the R sector. This phenomenon suggests an interesting transformation between NS-R elliptic genera and R-R elliptic genera. Similar phenomena appear in 2d $(0,4)$ SCFTs as well \cite{DelZotto:2016pvm,DelZotto:2018tcj}. Let us focus on the 2d $(0,4)$ SCFTs of \emph{one} BPS string in 6d $(1,0)$ SCFTs, possibly with twisted compactification. In general, the spectral flow from R-R sector to NS-R sector for the \emph{same} 6d $(1,0)$ theory possibly with a twist is induced by the following transformation: \begin{equation}\boxed{ \mathbb{E}_{\mathrm{NS-R}}^{\mathring{R}_{\mathrm{KK}}}\Big(q,v\Big)=\pm\Big(\frac{q^{1/4}}{v}\Big)^{\mathfrak{n}-h_G^{\vee}}\mathbb{E}_{\mathrm{R-R}}^{\mathring{R}_{\mathrm{KK}}}\Big(q,\frac{q^{1/2}}{v}\Big).} \end{equation} On the other hand, from the viewpoint of $(0,4)$ NLSM, the NS-R elliptic genera are obtained by imposing anti-periodicity on the 2d chiral fermions. This suggests the following elegant phenomenon for the twisted one-string elliptic genera: the spectral flow transformation shifts the KK charges of all hypermultiplets by half. To be precise, we find that for twisted one-string elliptic genera of different sectors: \begin{equation} \boxed{ \mathbb{E}_{\mathrm{NS-R}}^{\mathring{R}_{\mathrm{KK}\phantom{+1}}}(q,v)=\mathbb{E}_{\mathrm{R-R}}^{\mathring{R}_{\mathrm{KK}+1/2}}(q,v).} \end{equation} Note this is even true for the untwisted cases, which explains the NS-R elliptic genera in \cite{DelZotto:2018tcj} have simple low energy behaviors as 5d pure gauge theories. With this understanding, we know that the NS-R elliptic genera have similar expansion as \eqref{eq:dc1}, as long as both the $c$ and $Z_1^{5d}$ are derived from the twisted matter content with all KK-charges shifted by half. When the twisted matter content is invariant under KK-charge shift by half,\footnote{For pure gauge theories, this is automatically satisfied.} the above two properties induce a nontrivial symmetry for the R-R elliptic genus itself, i.e., \begin{equation}\label{sfgeneral} \boxed{\mathbb{E}_1\Big(q,\frac{q^{1/2}}{v}\Big)=\Big(-\frac{q^{1/4}}{v}\Big)^{\mathfrak{n}-h_G^{\vee}}\,\mathbb{E}_1(q,v).} \end{equation} We have checked this symmetry for all admissible twisted theories. The prefactor on the right hand side does not involve any information on the twist. This means that \emph{the spectral flow symmetry is preserved upon twisted compactification}. \subsection{The pure gauge cases} We first discuss the four pure gauge cases $\mathfrak{su}(3)^{(2)}$, $\mathfrak{so}(8)^{(2)}$, $\mathfrak{so}(8)^{(3)}$ and $E_6^{(2)}$. Denote $\theta$ and $f$ as the weight generating the adjoint and fundamental representation respectively. We find that for 6d $(1,0)$ pure gauge $G^{(n)}$ twisted theories with twist coefficient $N=2,3,4$, the reduced twisted one-string elliptic genera have the following universal expansion \begin{equation} \begin{aligned} \mathbb{E}_1^{G^{(n)}}=q^{\frac16-c}v^{h^\vee_{\mathring{G}}-1}\bigg(\sum_{n=0}^{\infty}\chi^{\mathring{G}}_{k\theta}v^{2n} +q^{{\frac{1}{N}}}(1+v^2)\sum_{n=0}^{\infty}\chi^{\mathring{G}}_{k\theta+f}v^{2n}+O(q^{\frac{2}{N}})\bigg). \end{aligned} \end{equation} For the $N=2$ cases, we further find that the $q^1$ term in the above expansion is $\chi^{\mathring{G}}_{2f}+\chi^{\mathring{G}}_{\theta}+2+\mathcal{O}(v^2)$. We also find the following interesting \emph{spectral flow symmetry}: \begin{equation}\label{sfpure} \mathbb{E}_1^{G^{(n)}}\Big(q,\frac{q^{1/2}}{v}\Big)=\Big(-\frac{q^{1/2}}{v^2}\Big)^{\mathfrak{n}-3}\,\mathbb{E}_1^{G^{(n)}}(q,v), \end{equation} as a special case of \eqref{sfgeneral}. This resembles the spectral flow symmetry for the reduced one-string elliptic genera associated to untwisted 6d $(1,0)$ SCFTs studied in \cite{DelZotto:2016pvm}. \subsubsection{$\mathfrak{su}(3)^{(2)}$}\label{sec:su3z2} The 6d $(1,0)$ pure $\mathfrak{su}(3) $ SCFT enjoys a series of fascinating 2d quiver constructions for the worldsheet theories of the BPS strings such that the elliptic genera are exactly computable to arbitrary number of strings \cite{Kim:2018gjo}. The $\mathbb{Z}_2$ twisted circle compactification gives the 5d $\mathfrak{su}(3) $ gauge theory with Chern-Simons level 9 \cite{Jefferson:2017ahm}. The blowup equations for this twisted theory have been studied before in \cite[Section 3.2.3]{Kim:2020hhh}, which are consistent with our universal elliptic form. As we have reviewed, this twisted theory can be Higgsed from 6d $(1,0)$ $G_2+\bf F$ theory \cite{Kim:2021cua}, thus the twisted elliptic genera are also exactly computable to arbitrary number of strings. Here we provide a new observation that is the spectral flow symmetry of its twisted one-string elliptic genus. For $\mathfrak{su}(3)^{(2)}$, the low energy gauge algebra is $\mathring{G}=\mathfrak{su}(2)$. Let us denote the reduced twisted one-string elliptic genus as \begin{equation} \mathbb{E}_1=q^{-\frac{7}{48}}\sum_{i=n}^{\infty}q^n g_n\left(v,m_{\mathfrak{su}(2)}\right)=q^{-\frac{7}{48}}\sum_{i=0}^{\infty}b_{ij}q^i v^{-2i+j},\qquad 4n\in\mathbb{Z}. \end{equation} We calculate $g_n$ up to $n=4$ from the unity twisted elliptic blowup equations with characteristics $a=0,\pm1/3$. The results are in perfect agreement with the computations in \cite{Kim:2020hhh,Kim:2021cua,Hayashi:2020hhb}. For example, when turning off the $\mathfrak{su}(2)$ fugacity, we have \begin{align} g_0&=\frac{v(v^2+1)}{\left(v^2-1\right)^2},\qquad g_{\frac14}=\frac{2 v (v^2+1)}{\left(v^2-1\right)^2},\qquad g_{\frac12}=\frac{ (v^6+2 v^4+2 v^2+1)}{v \left(v^2-1\right)^2}, \\ g_{\frac34}&=\frac{2 (v^6+2 v^4+2 v^2+1)}{v \left(v^2-1\right)^2},\qquad g_1=\frac{ \left(4 v^6+9 v^4+9 v^2+4\right)}{v \left(v^2-1\right)^2}. \end{align} With the $\mathfrak{su}(2)$ fugacity, we find \begin{align} g_0&=v\sum_{n=0}^{\infty}\chi^{A_1}_{n\theta}v^{2n}=v+\mathbf{3}v^3+\mathbf{5}v^5+\mathbf{7}v^7+\dots,\\ g_{\frac14}&=v(1+v^2)\sum_{n=0}^{\infty}\chi^{A_1}_{f+n\theta}v^{2n}=\mathbf{2}v+(\mathbf{2}+\mathbf{4})v^3+(\mathbf{4}+\mathbf{6})v^5+(\mathbf{6}+\mathbf{8})v^7+\dots,\\ g_{\frac12}&=v^{-1}(1+v^2+v^4)\sum_{n=0}^{\infty}\chi^{A_1}_{n\theta}v^{2n}=v^{-1}+(\mathbf{1}+\mathbf{3})v+(\mathbf{1}+\mathbf{3}+\mathbf{5})v^3 +\dots,\\ g_{\frac34}&=v^{-1}(1+2v^2+2v^4+v^6)\sum_{n=0}^{\infty}\chi^{A_1}_{f+n\theta}v^{2n}=\mathbf{2}v^{-1}+(2\times\mathbf{2}+\mathbf{4})v +\dots. \end{align} The $g_0$ result shows that the leading $q$ order of the twisted one-string elliptic genus gives the one $\mathfrak{su}(2)$ instanton Hilbert series \cite{Benvenuti:2010pq}, which is expected since the circle reduction of the 6d $\mathfrak{su}(3)^{(2)}$ theory should be a pure $\mathfrak{su}(2)$ theory with $\theta$ angle $0$. We also have the following Table \ref{tab:bijsu3z2} for the coefficients $b_{ij}$. The manifest symmetry of the coefficient matrix suggests the following spectral flow symmetry of the twisted one-string elliptic genus \begin{equation}\label{spectralflowA2} \mathbb{E}_1^{\mathfrak{su}(3)^{(2)}}(q,{q^{1/2}}/{v})= \mathbb{E}_1^{\mathfrak{su}(3)^{(2)}}(q,v). \end{equation} This resembles the spectral flow symmetry of the one-string elliptic genus of untwisted 6d $\mathfrak{su}(3)$ theory observed in \cite{DelZotto:2016pvm}. It is actually easy to prove this identity from the exact formula of $\mathbb{E}_1$ in \eqref{su3z2Ed}. \begin{table}[h] \begin{center} $\begin{tabu}{c|ccccccccccccccccccc} q\backslash v & 0 & & 1 & & 2 & & 3 & & 4 & & 5 & & 6 & & 7 & & 8 \\ \hline 0 & \phantom{.}0\phantom{.} & 0 & \color{orange}1 & 0 & 0 & 0 & \color{orange}3 & 0 & 0 & 0 & \color{orange}5 & 0 & 0 & 0 & \color{orange}7 & 0 & 0 \\ 1/4& 0 & 0 & 0 & 2 & 0 & 0 & 0 & 6 & 0 & 0 & 0 & 10 & 0 & 0 & 0 & 14 & 0 \\ 1/2& \color{orange}1 & 0 & 0 & 0 & 4 & 0 & 0 & 0 & 9 & 0 & 0 & 0 & 15 & 0 & 0 & 0 & 21 \\ 3/4& 0 & 2 & 0 & 0 & 0 & 8 & 0 & 0 & 0 & 18 & 0 & 0 & 0 & 30 & 0 & 0 & 0 \\ 1& 0 & 0 & 4 & 0 & 0 & 0 & 17 & 0 & 0 & 0 & 39 & 0 & 0 & 0 & 65 & 0 & 0 \\ 5/4& 0 & 0 & 0 & 8 & 0 & 0 & 0 & 30 & 0 & 0 & 0 & 66 & 0 & 0 & 0 & 110 & 0 \\ 3/2& \color{orange}3 & 0 & 0 & 0 & 17 & 0 & 0 & 0 & 51 & 0 & 0 & 0 & 105 & 0 & 0 & 0 & 170 \\ 7/4& 0 & 6 & 0 & 0 & 0 & 30 & 0 & 0 & 0 & 86 & 0 & 0 & 0 & 174 & 0 & 0 & 0 \\ 2& 0 & 0 & 9 & 0 & 0 & 0 & 51 & 0 & 0 & 0 & 147 & 0 & 0 & 0 & 297 & 0 & 0 \\ 9/4& 0 & 0 & 0 & 18 & 0 & 0 & 0 & 86 & 0 & 0 & 0 & 236 & 0 & 0 & 0 & 468 & 0 \\ 5/2& \color{orange}5 & 0 & 0 & 0 & 39 & 0 & 0 & 0 & 147 & 0 & 0 & 0 & 370 & 0 & 0 & 0 & 708 \\ 11/4& 0 & 10 & 0 & 0 & 0 & 66 & 0 & 0 & 0 & 236 & 0 & 0 & 0 & 576 & 0 & 0 & 0 \\ 3& 0 & 0 & 15 & 0 & 0 & 0 & 105 & 0 & 0 & 0 & 370 & 0 & 0 & 0 & 896 & 0 & 0 \\ \end{tabu}$ \caption{The coefficient matrix $b_{ij}$ for the $\mathbb{E}_1$ of 6d pure $\mathfrak{su}(3)^{(2)}$ theory.} \label{tab:bijsu3z2} \end{center} \end{table} Interestingly, we notice that the twisted elliptic blowup equations for $\mathfrak{su}(3)^{(2)}$ allow another solution for the twisted one-string elliptic genera if we set the characteristic $a=1/2,\pm 1/6$. We call this as the $\mathfrak{sp}(1)_{\pi}$ case, as the low energy limit gives the one-instanton partition function of 5d $\mathcal{N}=1$ pure $\mathfrak{sp}(1)_{\pi}$ theory. In this case, combining together the twisted elliptic blowup equations and modular ansatz which will be discussed later, we solve the twisted one-string elliptic genus with the $\mathfrak{sp}(1)$ fugacity turned off. Let us denote the reduced twisted one-string elliptic genus as \begin{equation} \mathbb{E}_1^{\pi}(q,v)=q^{-\frac{7}{48}}\sum_{i=0}^{\infty}q^n g_n^{\pi}\left(v,m_{\mathfrak{su}(2)}\right)=q^{-\frac{7}{48}}\sum_{i=0}^{\infty}b_{ij}^{\pi}q^i v^{-2i+j},\qquad 4n\in\mathbb{Z}. \end{equation} We calculate $g_n^{\pi}$ up to $n=4$. For example, \begin{equation} \begin{aligned} g_0^{\pi}&=\frac{2v^2}{\left(v^2-1\right)^2},\qquad g_{\frac14}^{\pi}=\frac{4 v^2 }{\left(v^2-1\right)^2},\qquad g_{\frac12}^{\pi}=\frac{ 6v^2}{ \left(v^2-1\right)^2}, \\ g_{\frac34}^{\pi}&=\frac{12v^2}{ \left(v^2-1\right)^2},\qquad g_1^{\pi}=\frac{ 2(v^8+11 v^4+1)}{v^2 \left(v^2-1\right)^2}. \end{aligned} \end{equation} With the gauge $\mathfrak{su}(2)$ fugacity, we find \begin{equation} \begin{aligned} g_0^{\pi}=v^2\sum_{n=0}^{\infty}\chi^{\mathfrak{su}(2)}_{n\theta+f}v^{2n}=\mathbf{2}v^2+\mathbf{4}v^4+\mathbf{6}v^6+\dots. \end{aligned} \end{equation} This shows the leading $q$ order of twisted elliptic genus $\mathbb{E}_1^{\pi}$ is indeed the 5d one $\mathfrak{sp}(1)_{\pi}$ instanton partition function. We also have the Table \ref{tab:bijsu3z2pi} for the coefficients $b_{ij}^\pi$. The manifest symmetry of the coefficient matrix shows that the solution $\mathbb{E}_1^{\pi}$ also satisfies the spectral flow symmetry \eqref{spectralflowA2}. We regard this as further evidence that this serves as a good elliptic completion of 5d one $\mathfrak{sp}(1)_{\pi}$ instanton partition function. However, to push forward to two-strings, we meet some inconsistency when solving the blowup equations. It is not clear to us whether there would exist a $\mathbb{Z}_2$ twist of the two-string elliptic genus of 6d $(1,0)$ pure $\mathfrak{su}(3)$ theory that has low energy limit as 5d two $\mathfrak{sp}(1)_{\pi}$ instantons. \begin{table}[h] \begin{center} $\begin{tabu}{c|ccccccccccccccccccc} q\backslash v & 0 & & 1 & & 2 & & 3 & & 4 & & 5 & & 6 & & 7 & & 8 \\ \hline 0& \phantom{.}0\phantom{.} & 0 & 0 & 0 & \color{orange}2 & 0 & 0 & 0 & \color{orange}4 & 0 & 0 & 0 & \color{orange}6 & 0 & 0 & 0 & \color{orange}8 \\ 1/4& 0 & 0 & 0 & 0 & 0 & 4 & 0 & 0 & 0 & 8 & 0 & 0 & 0 & 12 & 0 & 0 & 0 \\ 1/2& 0 & 0 & 0 & 0 & 0 & 0 & 6 & 0 & 0 & 0 & 12 & 0 & 0 & 0 & 18 & 0 & 0 \\ 3/4& 0 & 0 & 0 & 0 & 0 & 0 & 0 & 12 & 0 & 0 & 0 & 24 & 0 & 0 & 0 & 36 & 0 \\ 1& \color{orange}2 & 0 & 0 & 0 & 4 & 0 & 0 & 0 & 28 & 0 & 0 & 0 & 52 & 0 & 0 & 0 & 78 \\ 5/4& 0 & 4 & 0 & 0 & 0 & 8 & 0 & 0 & 0 & 48 & 0 & 0 & 0 & 88 & 0 & 0 & 0 \\ 3/2& 0 & 0 & 6 & 0 & 0 & 0 & 12 & 0 & 0 & 0 & 74 & 0 & 0 & 0 & 136 & 0 & 0 \\ 7/4& 0 & 0 & 0 & 12 & 0 & 0 & 0 & 24 & 0 & 0 & 0 & 124 & 0 & 0 & 0 & 224 & 0 \\ 2& \color{orange}4 & 0 & 0 & 0 & 28 & 0 & 0 & 0 & 52 & 0 & 0 & 0 & 220 & 0 & 0 & 0 & 388 \\ 9/4& 0 & 8 & 0 & 0 & 0 & 48 & 0 & 0 & 0 & 88 & 0 & 0 & 0 & 348 & 0 & 0 & 0 \\ 5/2& 0 & 0 & 12 & 0 & 0 & 0 & 74 & 0 & 0 & 0 & 136 & 0 & 0 & 0 & 520 & 0 & 0 \\ 11/4& 0 & 0 & 0 & 24 & 0 & 0 & 0 & 124 & 0 & 0 & 0 & 224 & 0 & 0 & 0 & 804 & 0 \\ 3& \color{orange}6 & 0 & 0 & 0 & 52 & 0 & 0 & 0 & 220 & 0 & 0 & 0 & 388 & 0 & 0 & 0 & 1272 \\ \end{tabu}$ \caption{The coefficient matrix $b_{ij}$ for the $\mathbb{E}_1^{\pi}$ of 6d pure $\mathfrak{su}(3)^{(2)}$ theory.} \label{tab:bijsu3z2pi} \end{center} \end{table} \subsubsection{$\mathfrak{so}(8)^{(2)}$}\label{sec:so8z2} The $\mathbb{Z}_2$ twisted circle compactification of 6d $(1,0)$ $\mathfrak{so}(8)$ SCFT gives a non-Lagrangian 5d KK theory. The twisted elliptic genera can be exactly computed to an arbitrary number of strings by 2d localization \cite{Kim:2021cua}. The unity blowup equations for this twisted theory have been studied before in \cite[Section 6.2]{Kim:2020hhh}, which are consistent with our elliptic form. Using our universal $\mathbb{E}_1$ formula (\ref{Z1}), we calculate the twisted one-string elliptic genus for this $\mathfrak{so}(8)^{(2)}$ theory and find it in complete agreement with the 2d localization results. Let us denote the reduced twisted one-string elliptic genus of $\mathfrak{so}(8)^{(2)}$ as \begin{equation} \mathbb{E}_1=q^{-\frac{7}{12}}\sum_{n=0}^{\infty}q^n g_n(v,m_{\mathfrak{so}(7)})=q^{-\frac{7}{12}}\sum_{i,j=0}^{\infty}b_{ij}q^{{i}} v^{-2i+j},\qquad 2n\in \mathbb{Z}. \end{equation} When turning off the $\mathfrak{so}(7)$ fugacities, we obtain \begin{align} g_0=&\,\frac{v^4 \left(v^8+13 v^6+28 v^4+13 v^2+1\right)}{\left(1-v^2\right)^8},\\ g_{\frac12}=&\,\frac{7 v^4 \left(v^2+1\right)^2 \left(v^4+6 v^2+1\right)}{\left(1-v^2\right)^8},\\ g_1=&\,\frac{2 v^4 \left(25 v^8+189 v^6+300 v^4+189 v^2+25\right)}{\left(1-v^2\right)^8}. \end{align} With the $\mathfrak{so}(7)$ gauge fugacities, we have \begin{equation} g_0=v^4\sum_{n=0}^{\infty}\chi_{n\theta}^{\mathfrak{so}(7)}v^{2n}=v^4+\mathbf{21}v^6+ \mathbf{168} v^8 + \mathbf{825} v^{10} + \mathbf{3003} v^{12} + \dots. \end{equation} This is exactly the one $\mathfrak{so}(7)$ instanton Hilbert series \cite{Benvenuti:2010pq}, thus agrees with the expectation that the circle reduction of the twisted theory should be a 5d pure $\mathfrak{so}(7)$ gauge theory. Besides, we have \begin{equation}\nonumber g_{\frac12}=v^4(1+v^2)\sum_{n=0}^{\infty}\chi^{\mathfrak{so}(7)}_{f+n\theta}v^{2n}=\mathbf{7} v^4+({\mathbf{105}+\mathbf{7}}) v^6+(\mathbf{798}+\mathbf{105}) v^8+(\mathbf{3696}+\mathbf{798}) v^{10}+\dots \end{equation} and $g_{1}=(\mathbf{27}+\mathbf{21}+2) v^4+\dots$. We also have the Table \ref{tab:bijso8z2} for the Fourier coefficients $b_{ij}$. The representations $\chi_{n\theta}^{\mathfrak{so}(7)}$ are colored in orange. The manifest anti-symmetric coefficient matrix implies the following {spectral flow symmetry} \begin{equation} \mathbb{E}_1^{\mathfrak{so}(8)^{(2)}}(q,{q^{1/2}}/{v})=-q^{1/2}v^{-2}\,\mathbb{E}_1^{\mathfrak{so}(8)^{(2)}}(q,v). \end{equation} \begin{table}[h] \begin{center} $\begin{tabu}{c|cccccccccccc} q\backslash v& 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10& 11\\ \hline 0& 0 & 0 & 0 & \color{orange}1 & 0 & \color{orange}21 & 0 & \color{orange}168 & 0 & \color{orange}825 & 0 \\ 1/2 & 0 & 0 & 0 & 0 & 7 & 0 & 112 & 0 & 798 & 0 & 3696 \\ 1& 0 & 0 & 0 & 0 & 0 & 50 & 0 & 778 & 0 & 5424 & 0 \\ 3/2& \color{orange}-1 & 0 & 0 & 0 & 1 & 0 & 238 & 0 & 3206 & 0 & 20860 \\ 2& 0 & -7 & 0 & -1 & 0 & 7 & 0 & 1101 & 0 & 14225 & 0 \\ 5/2& \color{orange}-21 & 0 & -50 & 0 & -7 & 0 & 50 & 0 & 4242 & 0 & 49756 \\ 3& 0 & -112 & 0 & -238 & 0 & -50 & 0 & 238 & 0 & 15802 & 0 \\ 7/2& \color{orange}-168 & 0 & -778 & 0 & -1101 & 0 & -238 & 0 & 1101 & 0 & 52900 \\ 4& 0 & -798 & 0 & -3206 & 0 & -4242 & 0 & -1101 & 0 & 4221 & 0 \\ 9/2& \color{orange}-825 & 0 & -5424 & 0 & -14225 & 0 & -15802 & 0 & -4221 & 0 & 15690 \\ 5& 0 & -3696 & 0 & -20860 & 0 & -49756 & 0 & -52900 & 0 & -15690 & 0 \\ \end{tabu}$ \caption{The coefficient matrix $b_{ij}$ for the $\mathbb{E}_1$ of 6d pure $\mathfrak{so}(8)^{(2)}$ theory.} \label{tab:bijso8z2} \end{center} \end{table} \subsubsection{$\mathfrak{so}(8)^{(3)}$}\label{sec:so8z3} The $\mathbb{Z}_3$ twisted circle compactification of 6d $(1,0)$ $\mathfrak{so}(8)$ SCFT gives the 5d $\mathfrak{su}(4) $ gauge theory with Chern-Simons level 8 \cite{Jefferson:2017ahm}. The circle reduction on the other hand gives a 5d pure $G_2$ gauge theory. The worldsheet theories of the BPS strings for 6d $\mathfrak{so}(8)^{(3)}$ theory do not have 2d quiver descriptions, thus the computation of elliptic genera is quite nontrivial. The blowup equations for this twisted theory have been studied before in \cite[Section 6.1]{Kim:2020hhh}, which are consistent with our elliptic form. There are in total four unity blowup equations and no vanishing one. Let us denote the reduced twisted one-string elliptic genus as \begin{equation} \mathbb{E}_1=q^{-\frac{7}{18}}\sum_{n=0}^{\infty}q^n g_n(v,m_{G_2})=q^{-\frac{7}{18}}\sum_{i,j=0}^{\infty}b_{ij}q^{{i}} v^{-2i+j},\qquad 3n\in\mathbb{Z}. \end{equation} From our universal $\mathbb{E}_1$ formula (\ref{Z1}), we calculate $g_n$ up to $n=4$. For example, turning off the $G_2$ fugacities, we have \begin{equation} \begin{aligned} g_0=&\,\frac{v^9+8 v^7+8 v^5+v^3}{\left(1-v^2\right)^6}=v^3+14 v^5+77 v^7+273 v^9+\dots,\\ g_{\frac13}=&\,\frac{v^3 \left(v^2+1\right) \left(7 v^4+22 v^2+7\right)}{\left(1-v^2\right)^6}=7 v^3+71 v^5+350 v^7+\dots,\\ g_{\frac23}=&\,\frac{7 v^3 \left(v^2+1\right) \left(5 v^4+8 v^2+5\right)}{\left(1-v^2\right)^6}=35 v^3+301 v^5+1372 v^7+\dots. \end{aligned} \end{equation} Keeping the $G_2$ gauge fugacities, we find the following exact formulas by the infinite summations of $G_2$ characters \begin{equation}\nonumber \begin{aligned} g_{0}&= v^3\sum_{n=0}^{\infty}\chi_{n\theta}^{G_2}v^{2n}, \qquad\quad g_{\frac13}= v^3(1+v^2)\sum_{n=0}^{\infty}\chi^{G_2}_{f+n\theta}v^{2n} ,\\ g_{\frac23}&=\sum_{n=0}^{\infty}(\chi^{G_2}_{2f+n\theta}+\chi^{G_2}_{f+n\theta}+\chi^{G_2}_{n\theta})v^{2n+3}+\sum_{n=0}^{\infty}(\chi^{G_2}_{2f+n\theta}+\chi^{G_2}_{f+n\theta})v^{2n+5}+\sum_{n=0}^{\infty}\chi^{G_2}_{2f+n\theta}v^{2n+7}. \end{aligned} \end{equation} The $g_0$ formula shows that the circle reduction of 6d $\mathfrak{so}(8)^{(3)}$ theory is indeed a 5d pure $G_2$ theory. We also have the Table \ref{tab:bijso8z3} for the coefficients $b_{ij}$, $i,j=0,1,2,\dots$, where the coefficients $\chi_{n\theta}^{G_2}$ in $g_0$ in colored orange. From the obvious anti-symmetry coefficient matrix, we find the following {spectral flow symmetry} \begin{equation} \mathbb{E}_1^{\mathfrak{so}(8)^{(3)}}(q,{q^{1/2}}/{v})=-q^{1/2}v^{-2}\,\mathbb{E}_1^{\mathfrak{so}(8)^{(3)}}(q,v). \end{equation} \begin{table}[h] \begin{center} $\begin{tabu}{c|ccccccccccccc} q\backslash v & 1 & & & 3 & & & 5 & & & 7 & & \\ \hline 0& 0 & 0 & 0 & \color{orange}1 & 0 & 0 & \color{orange}14 & 0 & 0 & \color{orange}77 & 0 & 0 \\ 1/3& 0 & 0 & 0 & 0 & 7 & 0 & 0 & 71 & 0 & 0 & 350 & 0 \\ 2/3& 0 & 0 & 0 & 0 & 0 & 35 & 0 & 0 & 301 & 0 & 0 & 1372 \\ 1& \color{orange}-1 & 0 & 0 & 0 & 0 & 0 & 141 & 0 & 0 & 1127 & 0 & 0 \\ 4/3& 0 & -7 & 0 & 0 & 0 & 0 & 0 & 497 & 0 & 0 & 3648 & 0 \\ 5/3& 0 & 0 & -35 & 0 & 0 & 0 & 0 & 0 & 1582 & 0 & 0 & 10836 \\ 2& \color{orange}-14 & 0 & 0 & -141 & 0 & 0 & 0 & 0 & 0 & 4650 & 0 & 0 \\ 7/3& 0 & -71 & 0 & 0 & -497 & 0 & 0 & 0 & 0 & 0 & 12838 & 0 \\ 8/3& 0 & 0 & -301 & 0 & 0 & -1582 & 0 & 0 & 0 & 0 & 0 & 33621 \\ 3& \color{orange}-77 & 0 & 0 & -1127 & 0 & 0 & -4650 & 0 & 0 & 0 & 0 & 0 \\ 10/3& 0 & -350 & 0 & 0 & -3648 & 0 & 0 & -12838 & 0 & 0 & 0 & 0 \\ 11/3& 0 & 0 & -1372 & 0 & 0 & -10836 & 0 & 0 & -33621 & 0 & 0 & 0 \\ \end{tabu}$ \caption{The coefficient matrix $b_{ij}$ for the $\mathbb{E}_1$ of 6d pure $\mathfrak{so}(8)^{(3)}$ theory.} \label{tab:bijso8z3} \end{center} \end{table} \subsubsection{$E_6^{(2)}$}\label{sec:e6z2} The $\mathbb{Z}_2$ twisted circle compactification of 6d $(1,0)$ $E_6$ SCFT gives a non-Lagrangian 5d KK theory, while the circle reduction gives a 5d pure $F_4$ gauge theory. This twisted theory has six unity blowup equations and no vanishing one. The twisted elliptic genera of this theory have not been computed before. We use the universal $\mathbb{E}_1$ formula (\ref{Z1}) to compute the twisted one-string elliptic genus. Denote the reduced twisted elliptic genus as \begin{equation} \mathbb{E}_1=q^{-\frac{13}{12}}\sum_{n=0}^{\infty}q^n g_n(v,m_{F_4})=q^{-\frac{13}{12}} \sum_{i,j=0}^{\infty}b_{ij}q^{{i} } v^{-2i+j}, \qquad 2n\in\mathbb{Z}. \end{equation} Turning off the $F_4$ fugacities, we obtain \begin{equation} \begin{aligned} g_0=&\,\frac{v^8 (v^{16}+36 v^{14}+341 v^{12}+1208 v^{10}+1820 v^8+1208 v^6+341 v^4+36 v^2+1)}{(1-v^2)^{16}},\\ g_{\frac12}=&\,\frac{13 v^8 \left(v^2+1\right)^2 \left(2 v^{12}+47 v^{10}+274 v^8+506 v^6+274 v^4+47 v^2+2\right)}{\left(1-v^2\right)^{16}},\\ g_1=&\,\frac{2 v^8 }{\left(1-v^2\right)^{16}}\big(189 v^{16}+3931 v^{14}+24233 v^{12}+64761 v^{10}+88332 v^8+64761 v^6\\ &\phantom{-----}+24233 v^4+3931 v^2+189\big). \end{aligned} \end{equation} When keeping the $F_4$ fugacities, we have \begin{equation} g_0=v^8\sum_{n=0}^{\infty}\chi_{n\theta}^{F_4}v^{2n}=v^8+\mathbf{52} v^{10}+\mathbf{1053} v^{12}+\mathbf{12376} v^{14}+\dots. \end{equation} This is exactly the one $F_4$ instanton Hilbert series \cite{Benvenuti:2010pq}, thus agrees with the expectation that the circle dimension reduction should be a 5d pure $F_4$ gauge theory. Besides, we find \begin{equation} g_{\frac12}=v^8(1+v^2)\sum_{n=0}^{\infty}\chi^{F_4}_{n\theta+f}v^{2n}=\mathbf{26} v^8+({\mathbf{1053}+\mathbf{26}}) v^{10}+(\mathbf{17901}+\mathbf{1053}) v^{12} +\dots \end{equation} and $g_{1}=(\mathbf{324}+\mathbf{52}+2) v^8+\dots$. We also have the Table \ref{tab:bijE6z2} for the coefficients $b_{ij}$. From the anti-symmetric coefficient matrix, we observe the following {spectral flow symmetry} \begin{equation} \mathbb{E}_1^{E_6^{(2)}}(q,{q^{1/2}}/{v})=-q^{3/2}v^{-6}\,\mathbb{E}_1^{E_6^{(2)}}(q,v). \end{equation} \begin{table}[h] \begin{center} $\begin{tabu}{c|ccccccccccc} q\backslash v& 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13\\ \hline 0& 0 & 0 & 0 & 0 & 0 & \color{orange}1 & 0 & \color{orange}52 & 0 & \color{orange}1053 & 0 \\ 1/2& 0 & 0 & 0 & 0 & 0 & 0 & 26 & 0 & 1079 & 0 & 18954 \\ 1& 0 & 0 & 0 & 0 & 0 & 0 & 0 & 378 & 0 & 13910 & 0 \\ 3/2& 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 4056 & 0 & 134342 \\ 2& 0 & 0 & 0 & 0 & 0 & -1 & 0 & 0 & 0 & 35362 & 0 \\ 5/2& \color{orange}-1 & 0 & 0 & 0 & \phantom{-}1\phantom{-} & 0 & -26 & 0 & 0 & 0 & 264576 \\ 3& 0 & -26 & 0 & 0 & 0 & 26 & 0 & -378 & 0 & 0 & 0 \\ 7/2& \color{orange}-52 & 0 & -378 & 0 & 0 & 0 & 378 & 0 & -4004 & 0 & 0 \\ 4& 0 & -1079 & 0 & -4056 & 0 & 0 & 0 & 4004 & 0 & -34283 & 0 \\ 5/2& \color{orange}-1053& 0& -13910& 0& -35362& 0& 0& 0& 34283& 0& \!-250666\!\\ 5& 0& -18954& 0& \!-134342\!& 0& \!-264576\!& 0& 0& 0& 250666& 0 \\ \end{tabu}$ \caption{The coefficient matrix $b_{ij}$ for the $\mathbb{E}_1$ of 6d pure $E_6^{(2)}$ theory.} \label{tab:bijE6z2} \end{center} \end{table} \subsection{Universal features with matters} In this section, we discuss the universal features of the reduced twisted one-string elliptic genera for twisted 6d theories with matters. Most of our observations are the twisted generalization of those in \cite{DelZotto:2018tcj}. These include the spectral flow symmetry and the precise spectrum of the twisted R-R vacuum, NS-R vacuum and possibly the excited states with fractional KK-charges above the NS-R vacuum. For all reduced twisted one-string elliptic genera we solved from blowup equations, we analyze these features in the $(q,v)$ expansion: \begin{equation} \mathbb{E}_1(q,v)=q^{\frac{1}{6}-c}\sum_{i,j=0}^{\infty}c_{ij}q^{{i}} v^{j}=q^{\frac{1}{6}-c}\sum_{i,j=0}^{\infty}b_{ij}q^{{i}} v^{-2i+j},\qquad Ni,j\in\mathbb{Z}, \end{equation} where $N$ is twist coefficient. All coefficients $c_{ij}$ should be integers as they represent the states in the 2d worldsheet theories, in particular form representations of $\mathring{G}$ and $\mathring{F}$ when turning on the fugacities. The $b_{ij}$ coefficients are slightly shifted from the $c_{ij}$ coefficients. As we have seen in the pure gauge cases, the $b_{ij}$ coefficients are very useful to show explicitly the spectral flow symmetry. Therefore, we will show the $b_{ij}$ coefficient matrix for all examples in the following. \subsubsection{$\mathfrak{n}=4,\mathfrak{so}{(2r+8)}^{(2)}$} The $\mathbb{Z}_2$ twist of 6d $(1,0)$ $\mathfrak{so}{(2r+8)}+2r\bf V$ theory has low energy gauge algebra $\mathring{G}=\mathfrak{so}{(2r+7)}$ and twisted matter content $2r\mathbf{V}_0$. The circle reduction gives a 5d $\mathcal{N}=1$ $\mathfrak{so}{(2r+7)}+2r\bf F$ theory whose 5d Nekrasov partition function is exactly computable by localization. On the other hand, the circle reduction of the NS-R sector gives a 5d $\mathcal{N}=1$ pure $\mathfrak{so}{(2r+7)}$ theory. For all $\mathfrak{n}=4,\mathfrak{so}{(2r+8)}^{(2)}$ theories with $r\ge 0$, we use the recursion formula \eqref{Z1m} to compute the one-string elliptic genera and find complete agreement with the 2d localization formulas. Let us study the following expansion for the reduced twisted one-string elliptic genera \begin{equation} \mathbb{E}_1^{\mathfrak{so}{(2r+8)}^{(2)}}(q,v)=q^{-\frac{7}{12}}\sum_{i,j=0}^{\infty}c_{ij}q^{{i}} v^{j}=q^{-\frac{7}{12}}\sum_{i,j=0}^{\infty}b_{ij}q^{{i}} v^{-2i+j}. \end{equation} We observe the following patterns for the Fourier coefficients $c_{ij}$: \begin{itemize} \item $c_{0,j}=0$ for $j<2r+4$. This is consistent with the fact that the reduced one-instanton partition function of 5d $ \mathfrak{so}{(2r+7)}+2r\bf F$ theory has $v$ expansion starting from $v^{2r+4}$. The $v$ expansion coefficients are colored orange in the Tables \ref{tab:bijn4so10z2}, \ref{tab:bijn4so12z2} and \ref{tab:bijn4so14z2}. \item $c_{\frac32+n,-2-2n}=\chi^{\mathfrak{so}{(2r+7)}}_{n\theta}$ and $c_{2+n,-3-2n}=0$. This shows that the leading $q$ order of the NS-R twisted elliptic genera indeed gives the 5d one $\mathfrak{so}{(2r+7)}$ instanton Hilbert series \cite{Benvenuti:2010pq}. The coefficients are colored red in the Tables \ref{tab:bijn4so10z2}, \ref{tab:bijn4so12z2} and \ref{tab:bijn4so14z2}. \item $c_{\frac52+n,-1-2n}=-\chi^{\mathfrak{so}{(2r+7)}}_{f+n\theta}\chi^{\mathfrak{sp}{(2r)}}_f$. These are the first excited states with integer modes and a half KK-charge above the NS-R vacuum. The coefficients are colored blue in the Tables \ref{tab:bijn4so10z2}, \ref{tab:bijn4so12z2} and \ref{tab:bijn4so14z2}. \item $c_{2+n,-2-2n}=\chi^{\mathfrak{so}{(2r+7)}}_{f+n\theta}+\chi^{\mathfrak{so}{(2r+7)}}_{f+(n-1)\theta}$. These are the first excited states with half-integer modes and a half KK-charge above the NS-R vacuum. The coefficients are colored cyan in the Tables \ref{tab:bijn4so10z2}, \ref{tab:bijn4so12z2} and \ref{tab:bijn4so14z2}. \item $c_{2+n,-1-2n}=-\chi^{\mathfrak{sp}{(2r)}}_{f}$. These are the second excited states with half-integer modes and KK-charge 1 above the NS-R vacuum. \item $c_{\frac52,-2}=\chi^{\mathfrak{so}{(2r+7)}}_{\theta}+\chi^{\mathfrak{so}{(2r+7)}}_{2f}+\chi^{\mathfrak{sp}{(2r)}}_{2f}+2$. These are the second excited states with integer modes and KK-charge 1 above the NS-R vacuum. The coefficients are colored purple in the Tables \ref{tab:bijn4so10z2}, \ref{tab:bijn4so12z2} and \ref{tab:bijn4so14z2}. \end{itemize} \paragraph{\underline{$\mathfrak{n}=4$, $\mathfrak{so}(10)^{(2)}$}} From the recursion formula \eqref{Z1m}, we compute the twisted one-string elliptic genus to $q$ order $4$ and find complete agreement with the 2d quiver formula. In particular, we obtain the coefficients $b_{ij}$ in Table \ref{tab:bijn4so10z2}. We checked that the coefficients satisfy all universal behaviors summarized earlier with $r=1$. \begin{table}[h] \begin{center} $\begin{tabu}{c|cccccccccc} q\backslash v & 1 &2 &3 &4 &5 &6 &7 & 8 & 9 & 10 \\ \hline 0 & 0 & 0& 0& 0& 0 & \color{orange}-5 & \color{orange}36 & \color{orange}-224 & \color{orange}924 & \color{orange}-3385 \\ 1/2& 0 & 0 & 0 & 0 & 0 & 4 & -54 & 324 & -1596 & 5940 \\ 1& 0 & 0 & 0 & 0 & 0 & 0 & 36 & -506 & 3132 & -15568 \\ 3/2& \red1 & 0 & 0 & 0 & -1 & -4 & 0 & 348 & -3498 & 19368 \\ 2& 0 & \cyan9 & -4 & 0 & 4 & -4 & -36 & 0 & 2208 & -21438 \\ 5/2& \red{36} & \blue{-36} & \color{purple}92 & -36 & 0 & 36 & -38 & -312 & -36 & 13624 \\ 3& 0 & \cyan{240} & -324 & 642 & -348 & 0 & 312 & -136 & -1884 & -240 \\ 7/2& \red{495} & \blue{-924} & 2776 & -3132 & 4236 & -2208 & 0 & 1884 & -738 & -10492 \\ 4& 0 & \cyan{2805} & -5940 &15744 & -19368 & 23838 & -13624 & 224 & 10492 & -2400 \\ 9/2& \red{4004} & \blue{-10296} & 35240 & -59004 & 106468 & -118080 & 124392 & -69372 & 1596 & 50004 \\ \end{tabu}$ \caption{The coefficient matrix $b_{ij}$ for the $\mathbb{E}_1$ of 6d $\mathfrak{so}(10)^{(2)}$ theory with $\mathfrak{n}=4$.} \label{tab:bijn4so10z2} \end{center} \end{table} \paragraph{\underline{$\mathfrak{n}=4,\mathfrak{so}(12)^{(2)}$}} From the recursion formula \eqref{Z1m}, we compute the twisted one-string elliptic genus to $q$ order $4$. We obtain the following Fourier coefficients $b_{ij}$ in the $(q,v)$ expansion in Table \ref{tab:bijn4so12z2}. We checked that the coefficients satisfy all universal behaviors summarized earlier with $r=2$. \begin{table}[h] \begin{center} $\begin{tabu}{c|cccccccccc} q\backslash v & 1 &2 &3 &4 &5 &6 &7 & 8 & 9 & 10 \\ \hline 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \color{orange}-42 & \color{orange}528 & \color{orange}-4065 \\ 1/2& 0 & 0 & 0 & 0 & 0 & 0 & 0 & 48 & -759 & 6328 \\ 1& 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 528 & -8748 \\ 3/2& \color{red}1 & 0 & 0 & 0 & -1 & 0 & 0 & -48 & 0 & 6792 \\ 2& 0 & \color{cyan}11 & -8 & 0 & 8 & -11 & 0 & 42 & -528 & 0 \\ 5/2& \color{red}55 & \color{blue}-88 & \color{purple}158 & -88 & 0 & 88 & -158 & 88 & 704 & -6792 \\ 3& 0 & \color{cyan}440 & -968 & 1606 & -1144 & 0 & 1144 & -1606 & 440 & 8308 \\ 7/2& \color{red}1144 & \color{blue}-3432 & 8630 & -12584 & 14501 & -9152 & 0 & 9152 & -14501 & 6256 \\ 4& 0 & \color{cyan}7579 & -26312 & 65230 & -101152 & 115434 & -76192 & 0 & 76192 & -111369 \\ 9/2& \color{red}13650 & \color{blue}-57200 & 180372 & -378136 & 640565 & -814352 & 800642 & -493416 & 0 & 493416 \\ \end{tabu}$ \caption{The coefficient matrix $b_{ij}$ for the $\mathbb{E}_1$ of 6d $\mathfrak{so}(12)^{(2)}$ theory with $\mathfrak{n}=4$.} \label{tab:bijn4so12z2} \end{center} \end{table} \paragraph{\underline{$\mathfrak{n}=4,\mathfrak{so}(14)^{(2)}$}} From the recursion formula \eqref{Z1m}, we compute the twisted one-string elliptic genus to $q$ order $4$. We obtain the following coefficients $b_{ij}$ in the $(q,v)$ expansion in Table \ref{tab:bijn4so14z2}. We checked that the coefficients satisfy all universal behaviors summarized earlier with $r=3$. \begin{table}[h] \begin{center} $\begin{tabu}{c|cccccccccc} q\backslash v & 1 &2 &3 &4 &5 &6 &7 & 8 & 9 & 10 \\ \hline 0& 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \color{orange}-429 \\ 1/2& 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 572 \\ 1& 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 3/2& \color{red}1 & 0 & 0 & 0 & -1 & 0 & 0 & 0 & 0 & -572 \\ 2& 0 & \color{cyan}13 & -12 & 0 & 12 & -13 & 0 & 0 & 0 & 429 \\ 5/2& \color{red}78 & \color{blue}-156 & \color{purple}248 & -156 & 0 & 156 & -248 & 156 & -78 & 0 \\ 3& 0 & \color{cyan}728 & -2028 & 3354 & -2612 & 0 & 2612 & -3354 & 2028 & -728 \\ 7/2& \color{red}2275 & \color{blue}-8580 & 21476 & -33956 & 38456 & -25376 & 0 & 25376 & -38456 & 33956 \\ 4& 0 & \color{cyan}17290 & -76440 & 200824 & -340028 & 396643 & -271984 & 0 & 271984 & -396643 \\ \end{tabu}$ \caption{The coefficient matrix $b_{ij}$ for the $\mathbb{E}_1$ of 6d $\mathfrak{so}(14)^{(2)}$ theory with $\mathfrak{n}=4$.} \label{tab:bijn4so14z2} \end{center} \end{table} \subsubsection{$\mathfrak{n}=2,\mathfrak{su}(2r)^{(2)}$} The $\mathbb{Z}_2$ twist of 6d $(1,0)$ $\mathfrak{su}(2r)+4r\bf F$ theory has low energy gauge algebra $\mathring{G}=\mathfrak{sp}(r)$ and twisted matter content $2r(\mathbf{F}_0+\mathbf{F}_{1/2})$ which is invariant under the KK-charge shift by $1/2$. The circle reduction gives a 5d $\mathcal{N}=1$ $\mathfrak{sp}(r)+2r\bf F$ theory whose 5d Nekrasov partition function is exactly computable by localization. However, the twisted elliptic genera, albeit the simple look, do not to our knowledge have a 2d quiver gauge theory description. We utilize the blowup equations to compute the twisted one-string elliptic genera. For arbitrary $r\ge1$, the twisted elliptic blowup equations can have two possibilities for the characteristics $a=\pm1/4$. From the unity twisted elliptic blowup equations, we solve the one-string twisted elliptic genera for $r=1,2,3,4$. We find the reduced twisted one-string elliptic genus has the following spectral flow symmetry \begin{equation} \mathbb{E}^{\mathfrak{su}(2r)^{(2)}}_1\Big(q,\frac{\sqrt{q}}{v}\Big)=-\Big(\frac{\sqrt{q}}{v^2}\Big)^{r-1}\mathbb{E}^{\mathfrak{su}(2r)^{(2)}}_1(q,{v}). \end{equation} We also find the following compact formula for the twisted one-string elliptic genus when turning off all gauge and flavor fugacities: \begin{equation} \mathbb{E}^{\mathfrak{su}(2r)^{(2)}}_1(\tau,\epsilon_+)=\frac{2^{2r-1}\eta(\tau)^{8r-3}}{\eta(\frac{\tau}{2})^{4r-2}}\frac{\theta_4(\tau,2\epsilon_+)}{(\theta_2(\tau,\epsilon_+)\theta_3(\tau,\epsilon_+))^{2r}}. \end{equation} It is easy to prove the spectral flow symmetry from this expression. In the following, we explicitly show the results for $r=1,2,3$. \paragraph{\underline{$\mathfrak{n}=2,\mathfrak{su}(2)^{(2)}$}} From the unity twisted elliptic blowup equations, we calculate the twisted one-string elliptic genus to $q$ order $5$. We can also use the 2d localization to compute the twisted elliptic genus in this case as the $\mathbb{Z}_2$ twist for the gauge algebra $\mathfrak{su}(2)$ is trivial. We only need to fold the four fundamentals. For one-string, we have \begin{equation}\label{localizationn2su2z2} \mathbb{E}_1=\frac{\prod_{i=1}^2\theta_1(a+\epsilon_+-m_i)\theta_4(a+\epsilon_++m_i)}{\eta^2\theta_1(2a)\theta_1(2a+2\epsilon_+)}+(a\rightarrow -a), \end{equation} We checked this agrees with our results solved from blowup equations to high $q$ orders. We also obtain the coefficients $b_{ij}$ in Table \ref{tab:bijn2su2z2}. The spectral flow symmetry manifests as expected. We also checked the spectral flow symmetry with all gauge and flavor parameters turned on. Notice the leading orders of both R-R and NS-R elliptic genera give the one-instanton partition function of 5d $\mathfrak{su}(2)+2\bf F$. With gauge and flavor fugacities turned on, we have the following exact formula for the $v$ expansion: \begin{equation} Z_1^{5d}=\sum_{n=0}^{\infty}\Big(-\chi^b_{(1)}\chi^{\mathfrak{su}(2)}_{n\theta}v^{1+2n}+\chi^a_{(1)}\chi^{\mathfrak{su}(2)}_{f+n\theta}v^{2+2n}\Big). \end{equation} Here the truncated flavor symmetry $\mathfrak{so}(4)\sim \mathfrak{su}(2)_a\times \mathfrak{su}(2)_b$. \begin{table}[h] \begin{center} $\begin{tabu}{c|cccccccc} q\backslash v & 0 & 1 & 2 & 3 & 4 & 5 & 6 &7 \\ \hline 0& 0 & \color{orange}-2 & \color{orange}4 & \color{orange}-6 & \color{orange}8 & \color{orange}-10 & \color{orange}12 & \color{orange}-14 \\ 1/2& \color{orange}2 & 0 & -6 & 16 & -24 & 32 & -40 & 48 \\ 1& \color{orange}-4 & 6 & 0 & -22 & 52 & -84 & 112 & -140 \\ 3/2& \color{orange}6 & -16 & 22 & 0 & -58 & 144 & -234 & 320 \\ 2& \color{orange}-8 & 24 & -52 & 58 & 0 & -152 & 368 & -606 \\ 5/2& \color{orange}10 & -32 & 84 & -144 & 152 & 0 & -352 & 864 \\ 3& \color{orange}-12 & 40 & -112 & 234 & -368 & 352 & 0 & -796 \\ 7/2& \color{orange}14 & -48 & 140 & -320 & 606 & -864 & 796 & 0 \\ \end{tabu}$ \caption{The coefficient matrix $b_{ij}$ for the $\mathbb{E}_1$ of 6d $\mathfrak{su}(2)^{(2)}$ theory with $\mathfrak{n}=2$.} \label{tab:bijn2su2z2} \end{center} \end{table} \paragraph{\underline{$\mathfrak{n}=2,\mathfrak{su}(4)^{(2)}$}} From the unity twisted elliptic blowup equations, we compute the twisted one-string elliptic genus to $q$ order $5$. We obtain the coefficients $b_{ij}$ in Table \ref{tab:bijn2su4z2}. The obvious anti-symmetric coefficient matrix shows the self-duality under spectral flow as expected. The leading orders of both R-R and NS-R elliptic genera should give the one-instanton partition function of 5d $\mathfrak{sp}(2)+4\bf F$. From ADHM construction, we obtain the following exact formula for the $v$ expansion: \begin{equation} Z_{1}^{ \mathfrak{sp}(2)+4\bf F}=\sum_{n=0}^{\infty}\Big(\chi^{\mathfrak{so}(8)}_{S}\chi^{\mathfrak{sp}(2)}_{n\theta}v^{2+2n}-\chi^{\mathfrak{so}(8)}_{C}\chi^{\mathfrak{sp}(2)}_{f+n\theta}v^{3+2n}\Big) . \end{equation} where $\mathfrak{so}(8)$ is the pertubative 5d flavor symmetry. The Fourier coefficients completely agree with the orange numbers in Table \ref{tab:bijn2su4z2}. \begin{table}[h] \begin{center} $\begin{tabu}{c|cccccccc} q\backslash v & 1 & 2 & 3 & 4 & 5 & 6 &7 & 8 \\ \hline 0& 0 & \color{orange}-8 & \color{orange}32 & \color{orange}-80 & \color{orange}160 & \color{orange}-280 & \color{orange}448 & \color{orange}-672 \\ 1/2& \color{orange}8 & 0 & -96 & 384 & -960 & 1920 & -3360 & 5376 \\ 1& \color{orange}-32 & 96 & 0 & -752 & 2848 & -7008 & 13920 & -24272 \\ 3/2& \color{orange}80 & -384 & 752 & 0 & -4464 & 16256 & -39296 & 77440 \\ 2& \color{orange}-160 & 960 & -2848 & 4464 & 0 & -22152 & 78048 & -185552 \\ 5/2& \color{orange}280 & -1920 & 7008 & -16256 & 22152 & 0 & -96320 & 330112 \\ 3& \color{orange}-448 & 3360 & -13920 & 39296 & -78048 & 96320 & 0 & -378096 \\ 7/2& \color{orange}672 & -5376 & 24272 & -77440 & 185552 & -330112 & 378096 & 0 \\ \end{tabu}$ \caption{The coefficient matrix $b_{ij}$ for the $\mathbb{E}_1$ of 6d $\mathfrak{su}(4)^{(2)}$ theory with $\mathfrak{n}=2$.} \label{tab:bijn2su4z2} \end{center} \end{table} \paragraph{\underline{$\mathfrak{n}=2,\mathfrak{su}(6)^{(2)}$}} From the unity twisted elliptic blowup equations, we calculate the twisted one-string elliptic genus to $q$ order $5$. We obtain the coefficients $b_{ij}$ in Table \ref{tab:bijn2su6z2}. The obvious anti-symmetric coefficient matrix shows the self-duality under spectral flow. The leading orders of both R-R and NS-R elliptic genera give the one-instanton partition function of 5d $\mathfrak{sp}(3)+6\bf F$. From ADHM construction, we find the following exact formula for the $v$ expansion: \begin{equation} Z_{1}^{ \mathfrak{sp}(3)+6 \bf F}=\sum_{n=0}^{\infty}\Big(\chi^{\mathfrak{so}(12)}_{S}\chi^{\mathfrak{sp}(3)}_{n\theta}v^{1+2n}-\chi^{\mathfrak{so}(12)}_{C}\chi^{\mathfrak{sp}(3)}_{f+n\theta}v^{2+2n}\Big) . \end{equation} where $\mathfrak{so}(12)$ is the pertubative 5d flavor symmetry. We checked that these coefficients completely agree with the orange numbers in Table \ref{tab:bijn2su6z2}. \begin{table}[h] \begin{center} $\begin{tabu}{c|cccccccc} q\backslash v & 2 & 3 & 4 & 5 & 6 &7 & 8 \\ \hline 0& 0 & \color{orange}-32 & \color{orange}192 & \color{orange}-672 & \color{orange}1792 & \color{orange}-4032 & \color{orange}8064 \\ 1/2& \color{orange}32 & 0 & -800 & 4352 & -14560 & 37888 & -84000 \\ 1& \color{orange}-192 & 800 & 0 & -11104 & 55424 & -177184 & 449024 \\ 3/2& \color{orange}672 & -4352 & 11104 & 0 & -109760 & 512512 & -1574720 \\ 2& \color{orange}-1792 & 14560 & -55424 & 109760 & 0 & -862848 & 3819200 \\ 5/2& \color{orange}4032 & -37888 & 177184 & -512512 & 862848 & 0 & -5727648 \\ 3& \color{orange}-8064 & 84000 & -449024 & 1574720 & -3819200 & 5727648 & 0 \\ \end{tabu}$ \caption{The coefficient matrix $b_{ij}$ for the $\mathbb{E}_1$ of 6d $\mathfrak{su}(6)^{(2)}$ theory with $\mathfrak{n}=2$.} \label{tab:bijn2su6z2} \end{center} \end{table} \subsubsection{$\mathfrak{n}=2,\mathfrak{su}(2r+1)^{(2)}$}\label{sec:n2su2r1} The $\mathbb{Z}_2$ twist of 6d $(1,0)$ $\mathfrak{su}(2r+1)+2(2r+1)\bf F$ theory has low energy gauge algebra $\mathring{G}=\mathfrak{sp}(r)$ and twisted matter content $(2r+1)(\mathbf{F}_0+\mathbf{F}_{1/2})$ which is invariant under the KK-charge shift by $1/2$. The circle reduction gives 5d $\mathcal{N}=1$ $\mathfrak{sp}(r)+(2r+1)\bf F$ gauge theories whose 5d Nekrasov partition function is exactly computable by localization. The twisted circle compactification gives 5d $\mathcal{N}=1$ $\mathfrak{so}(2r+3)+(2r+1)\bf V$ KK theories \cite{Hayashi:2015vhy}. To our knowledge, there is no 2d quiver gauge theory description in the current situation. Therefore, it is important to use blowup equations to solve the twisted elliptic genera and study their properties. Indeed, we successfully solve the twisted one-string elliptic genera for $r=1,2,3,4$ to high $q$ orders. We find the reduced twisted one-string elliptic genus has the following spectral flow symmetry \begin{equation} \mathbb{E}^{\mathfrak{su}(2r+1)^{(2)}}_1\Big(q,\frac{\sqrt{q}}{v}\Big)=-\Big(\frac{{q}^{1/4}}{v}\Big)^{2r-1}\mathbb{E}^{\mathfrak{su}(2r+1)^{(2)}}_1(q,{v}). \end{equation} We also manage to find the following compact formula for the twisted one-string elliptic genus for arbitrary $r$: \begin{equation} \mathbb{E}_1^{\mathfrak{su}(2r+1)^{(2)}}(\tau,\epsilon_+)=\frac{\eta(\frac{\tau}{4})^2\theta_4(\frac{\tau}{2},\epsilon_+)}{\eta(\frac{\tau}{2})^2\theta_4(\frac{\tau}{2})}\Big(\frac{2\theta_1(\tau,\epsilon_+)\theta_4(\tau,\epsilon_+)}{\theta_1(\tau,2\epsilon_+)\theta_4(\tau)}\Big)^{2r}. \end{equation} We checked this formula for $r=1,2,3,4$ against the twisted elliptic genera solved from blowup equations and found perfect agreement. It is easy to prove the spectral flow symmetry from this expression. It is interesting to remark that the twisted elliptic blowup equations also allow nice solutions for the twisted matter content $(2r+1)(\mathbf{F}_{1/4}+\mathbf{F}_{3/4})$. This choice of the KK-charges of the hypermultiplets $\bf F$ has its merit in that they coincide with those of the $\bf F$ in the twist of vector multiplet, i.e. $\mathbf{Adj}_0+\mathbf{F}_{1/4}+\mathbf{F}_{3/4}+\mathbf{\Lambda}^2_{1/2}$. This brings in some simplification that the $B$ field of the tensor parameter becomes integral. In fact, there are two possibilities for such $B$ field -- even and odd, corresponding to two non-equivalent circle reductions to 5d $\mathcal{N}=1$ pure $\mathfrak{sp}(r)_0$ or $\mathfrak{sp}(r)_\pi$ theory. We leave the discussion for these situations in Appendix \ref{app:C}. \paragraph{\underline{$\mathfrak{n}=2,\mathfrak{su}(3)^{(2)}$}} The $\mathbb{Z}_2$ twisted circle compactification of 6d $(1,0)$ $\mathfrak{su}(3)+6\bf F$ theory gives a 5d rank-3 KK theory which has gauge theory description as 5d $\mathfrak{sp}(2)+3\bf \Lambda^2$ or 5d $\mathfrak{so}(5)+3\bf V$ theory \cite{Hayashi:2015vhy}. From the unity twisted elliptic blowup equations, we compute the twisted one-string elliptic genus to $q$ order $5$. The coefficients $b_{ij}$ are listed in Table \ref{tab:bijn2su3z2F0}. The obvious anti-symmetric coefficient matrix shows the self-duality under spectral flow. For the low energy limit, the 5d one-instanton partition function of $\mathfrak{su}(2)+3\bf F$ theory can be computed by localization as \begin{equation} Z_{1}^{ \mathfrak{su}(2)+3\bf F}=\sum_{n=0}^{\infty}\Big(\chi^{\mathfrak{so}(6)}_{S}\chi^{\mathfrak{su}(2)}_{n\theta}v^{1+2n}-\chi^{\mathfrak{so}(6)}_{C}\chi^{\mathfrak{su}(2)}_{f+n\theta}v^{2+2n}\Big). \end{equation} where $\mathfrak{so}(6)$ is the pertubative 5d flavor symmetry. It is easy to check that the $v$ expansion coefficients are consistent with the orange numbers in Table \ref{tab:bijn2su3z2F0}. \begin{table}[h] \begin{center} $\begin{tabu}{c|ccccccccc} q\backslash v & & 1 & & 2 & & 3 & & 4 \\ \hline 0& 0 & \color{orange}4 & 0 & \color{orange}-8 & 0 & \color{orange}12 & 0 & \color{orange}-16 & 0 \\ 1/4& \color{orange}-4 & 0 & 8 & 0 & -16 & 0 & 24 & 0 & -32 \\ 1/2& 0 & -8 & 0 & 36 & 0 & -72 & 0 & 108 & 0 \\ 3/4& \color{orange}8 & 0 & -36 & 0 & 80 & 0 & -144 & 0 & 216 \\ 1& 0 & 16 & 0 & -80 & 0 & 224 & 0 & -416 & 0 \\ 5/4& \color{orange}-12 & 0 & 72 & 0 & -224 & 0 & 472 & 0 & -812 \\ 3/2& 0 & -24 & 0 & 144 & 0 & -472 & 0 & 1092 & 0 \\ 7/4& \color{orange}16 & 0 & -108 & 0 & 416 & 0 & -1092 & 0 & 2168 \\ 2& 0 & 32 & 0 & -216 & 0 & 812 & 0 & -2168 & 0 \\ \end{tabu}$ \caption{The coefficient matrix $b_{ij}$ for the $\mathbb{E}_1$ of 6d $\mathfrak{su}(3)^{(2)}$ theory with $\mathfrak{n}=2$.} \label{tab:bijn2su3z2F0} \end{center} \end{table} \paragraph{\underline{$\mathfrak{n}=2,\mathfrak{su}(5)^{(2)}$}} The $\mathbb{Z}_2$ twisted circle compactification of 6d $(1,0)$ $\mathfrak{su}(5)+10\bf F$ theory gives a 5d rank-4 KK theory which has gauge theory description as 5d $\mathfrak{so}(7)+5\bf V$ theory \cite{Hayashi:2015vhy}. From the unity twisted elliptic blowup equations, we compute the twisted one-string elliptic genus to $q$ order $5$. The coefficients $b_{ij}$ are listed in Table \ref{tab:bijn2su5z2F0}. The obvious anti-symmetric coefficient matrix shows the self-duality under spectral flow. The 5d one-instanton partition function of $\mathfrak{sp}(2)+5\bf F$ theory can be computed by localization as \begin{equation} Z_{1}^{ \mathfrak{sp}(2)+5\bf F}=\sum_{n=0}^{\infty}\Big(\chi^{\mathfrak{so}(12)}_{S}\chi^{\mathfrak{sp}(2)}_{n\theta}v^{1+2n}-\chi^{\mathfrak{so}(12)}_{C}\chi^{\mathfrak{sp}(2)}_{f+n\theta}v^{2+2n}\Big) . \end{equation} where $\mathfrak{so}(10)$ is the pertubative 5d flavor symmetry. It is easy to check that the $v$ expansion coefficients are consistent with the orange numbers in Table \ref{tab:bijn2su5z2F0}. \begin{table}[h] \begin{center} $\begin{tabu}{c|ccccccccc} q\backslash v & & 1 & & 2 & & 3 & & 4 \\ \hline 0& 0 & \color{orange}16 & 0 & \color{orange}-64 & 0 &\color{orange} 160 & 0 & \color{orange}-320 & 0 \\ 1/4& \color{orange}-16 & 0 & 64 & 0 & -176 & 0 & 384 & 0 & -720 \\ 1/2& 0 & -64 & 0 & 400 & 0 & -1280 & 0 & 2976 & 0 \\ 3/4& \color{orange}64 & 0 & -400 & 0 & 1344 & 0 & -3376 & 0 & 7040 \\ 1& 0 & 176 & 0 & -1344 & 0 & 5312 & 0 & -14528 & 0 \\ 5/4& \color{orange}-160 & 0 & 1280 & 0 & -5312 & 0 & 15488 & 0 & -36192 \\ 3/2& 0 & -384 & 0 & 3376 & 0 & -15488 & 0 & 48976 & 0 \\ 7/4& \color{orange}320 & 0 & -2976 & 0 & 14528 & 0 & -48976 & 0 & 128768 \\ 2& 0 & 720 & 0 & -7040 & 0 & 36192 & 0 & -128768 & 0 \\ \end{tabu}$ \caption{The coefficient matrix $b_{ij}$ for the $\mathbb{E}_1$ of 6d $\mathfrak{su}(5)^{(2)}$ theory with $\mathfrak{n}=2$.} \label{tab:bijn2su5z2F0} \end{center} \end{table} \subsubsection{Other examples} \paragraph{\underline{$\mathfrak{n}=4,E_6^{(2)}$}} The $\mathbb{Z}_2$ twist of 6d $(1,0)$ $E_6+2\bf F$ theory has low energy gauge algebra $\mathring{G}=F_4$ and twisted matter content $\mathbf{26}_0+\mathbf{26}_{1/2}$ which is invariant under the KK-charge shift by $1/2$. The twisted partition function has not been computed before. From the recursion formula \eqref{Z1m}, we compute the twisted one-string elliptic genus to $q$ order $5$. We summarize the coefficients $b_{ij}$ in Table \ref{tab:bijn4E6z2}. Notice the obvious anti-symmetric coefficient matrix, this shows that the twisted theory has self-dual spectral flow symmetry, albeit the nontrivial matter content. The leading $q$ order of $\mathbb{E}_1$ should give the one-instanton Nekrasov partition function of 5d $F_4+\bf F$ theory, whose exact $v$ expansion formula can be found in \cite[Equation (H.36)]{DelZotto:2018tcj}. For example, when turning off all fugacities, \begin{equation} \begin{aligned} Z_1^{F_4+\bf F}(v)=\,&\frac{v^7}{(v-1)^{10} (v+1)^{16}} (v^{12}+10 v^{11}-49 v^{10}+266 v^9-549 v^8+1068 v^7\\ &-1110 v^6+1068 v^5-549 v^4+266 v^3-49 v^2+10 v+1)\\ =\,& v^7+4 v^8-78 v^9+754 v^{10}-4433 v^{11}+21060 v^{12}+\dots \end{aligned} \end{equation} We have checked they are in complete agreement. The $v$ expansion coefficients of 5d $Z_1^{F_4+\bf F}$ are colored in orange in Table \ref{tab:bijn4E6z2}. \begin{table}[h] \begin{center} $\begin{tabu}{c|ccccccccc} q\backslash v & 4 & 5&6 &7 &8 &9 & 10 & 11 & 12 \\ \hline 0& 0 & 0 & 0 & \color{orange}-1 & \color{orange}-4 & \color{orange}78 & \color{orange}-754 & \color{orange}4433 & \color{orange}-21060 \\ 1/2& 0 & 0 & 0 & 2 & -27 & -108 & 2509 & -21654 & 124956 \\ 1& 0 & 0 & 0 & 3 & 54 & -512 & -1736 & 43680 & -363866 \\ 3/2& \color{orange}1 & -2 & -3 & 0 & 86 & 874 & -7436 & -19680 & 552578 \\ 2& \color{orange}4 & 27 & -54 & -86 & 0 & 1437 & 10756 & -88505 & -178544 \\ 5/2& \color{orange}-78 & 108 & 512 & -874 & -1437 & 0 & 16930 & 113530 & -895387 \\ 3& \color{orange}754 & -2509 & 1736 & 7436 & -10756 & -16930 & 0 & 154075 & 1072946 \\ 7/2& \color{orange}-4433 & 21654 & -43680 & 19680 & 88505 & -113530 & -154075 & 0 & 1117564 \\ 4& \color{orange}21060 & -124956 & 363866 & -552578 & 178544 & 895387 & -1072946 & -1117564 & 0 \\ \end{tabu}$ \caption{The coefficient matrix $b_{ij}$ for the $\mathbb{E}_1$ of 6d $E_6^{(2)}$ theory with $\mathfrak{n}=4$.} \label{tab:bijn4E6z2} \end{center} \end{table} \paragraph{\underline{$\mathfrak{n}=3,\mathfrak{so}(8)^{(2)}$}} The $\mathbb{Z}_2$ twist of 6d $(1,0)$ $\mathfrak{so}(8)+\bf V+S+C$ theory has low energy gauge algebra $\mathring{G}=\mathfrak{so}(7)$ and twisted matter content $\mathbf{7}_0+\mathbf{8}_{0}+\mathbf{8}_{1/2}$. From the recursion formula \eqref{Z1m}, we computed the twisted one-string elliptic genus to $q$ order $5$. We obtain the Fourier coefficients $b_{ij}$ in the $(q,v)$ expansion in Table \ref{tab:bijn3so8z2}. \begin{table}[h] \begin{center} $\begin{tabu}{c|ccccccccc} q\backslash v & 1& 2& 3 & 4 & 5 & 6 & 7 & 8 & 9 \\ \hline 0& 0 & 0 & 0 & \color{orange}4 & \color{orange}-30 & \color{orange}132 & \color{orange}-434 & \color{orange}1184 & \color{orange}-2826 \\ 1/2& 0 & 0 & 0 & 0 & 40 & -272 & 1152 & -3696 & 9936 \\ 1& \color{red}2 & 0 & -2 & -4 & 0 & 324 & -2168 & 8868 & -27860 \\ 3/2& \color{red}-8 & 16 & 0 & -16 & -32 & 0 & 1936 & -12416 & 49464 \\ 2& \color{red}42 & -108 & 142 & 0 & -112 & -216 & -42 & 10392 & -64496 \\ 5/2& \color{red}-112 & 432 & -848 & 848 & 0 & -576 & -1088 & -432 & 48448 \\ 3& \color{red}336 & -1428 & 3606 & -5528 & 4814 & -132 & -2646 & -4864 & -3606 \\ 7/2& \color{red}-720 & 3712 & -10976 & 21744 & -29312 & 23056 & -1152 & -10640 & -19024 \\ 4& \color{red}1650 & -8964 & 29700 & -68096 & 115992 & -140732 & 103936 & -8868 & -39006 \\ 9/2& \color{red}-3080 & 18800 & -68256 & 176608 & -349888 & 534816 & -603264 & 424864 & -49464 \\ \end{tabu}$ \caption{The coefficient matrix $b_{ij}$ for the $\mathbb{E}_1$ of 6d $\mathfrak{so}(8)^{(2)}$ theory with $\mathfrak{n}=3$.} \label{tab:bijn3so8z2} \end{center} \end{table} We find the leading $q$ order of the R-R sector, i.e., the orange coefficients gives the one-instanton Nekrasov partition function of 5d $\mathfrak{so}(7)+\bf V+S$ theory, while the leading $q$ order of the NS-R sector, i.e., the red coefficients gives the one of 5d $\mathfrak{so}(7)+\bf S$ theory. For 5d $\mathfrak{so}(7)+\bf S$ theory, the ADHM description has been studied in \cite{Kim:2018gjo}. For example, the reduced one-instanton partition function is given by \begin{equation} Z_1^{\mathfrak{so}(7)+\bf S}(u_i,m)= \sum_{i=1}^4\frac{\sinh(4\epsilon_+-2u_i) \sinh(m\pm(u_i-\epsilon_+))} {\prod_{j(\neq i)}\sinh(u_{ij})\sinh(2\epsilon_+-u_{ij}) \sinh(2\epsilon_+-u_i-u_j)}. \end{equation} Here $u_i$ satisfying $u_1+u_2+u_3+u_4=0$ are the fugacities of $\mathfrak{su}(4)$ embedded in $\mathfrak{so}(7)$. From this formula, we find \begin{equation} Z_1^{\mathfrak{so}(7)+\bf S}(v)=\frac{2 v^4 \left(v^6-2 v^5+8 v^4-6 v^3+8 v^2-2 v+1\right)}{(v-1)^6 (v+1)^8}. \end{equation} \begin{equation} Z_1^{\mathfrak{so}(7)+\bf S}(v,m_{\mathfrak{so}(7)},m_{\mathfrak{sp}(1)})=\sum_{n=0}^{\infty}\chi^{\mathfrak{so}(7)}_{n\theta}\chi^{\mathfrak{sp}(1)}_{(1)}v^{2n+4}-\chi^{\mathfrak{so}(7)}_{n\theta+s}v^{2n+5}. \end{equation} This perfectly agrees with the leading $q$ order of the NS-R twisted elliptic genus. For $\mathfrak{so}(7)+\bf V+ S$ theory, we can compare with the reduced one-instanton partition function of 5d $\mathfrak{so}(7)+{\bf V}+4\bf S$ theory given in (H.15) of \cite{DelZotto:2018tcj}. After decoupling three $\bf S$, we find the resulting 5d partition function is \begin{equation} \begin{aligned} Z_1^{\mathfrak{so}(7)+\bf V+ S}(v,m_{\mathfrak{so}(7)},m_{v},m_s)=\sum_{n=0}^{\infty}&\chi^{\mathfrak{so}(7)}_{n\theta}\chi^{\mathfrak{sp}(1)}_{(1)_v}\chi^{\mathfrak{sp}(1)}_{(1)_s}v^{2n+4}+\chi^{\mathfrak{so}(7)}_{n\theta+v+s}v^{2n+6}\\ & -\left(\chi^{\mathfrak{so}(7)}_{n\theta+v}\chi^{\mathfrak{sp}(1)}_{(1)_s}+\chi^{\mathfrak{so}(7)}_{n\theta+s}\chi^{\mathfrak{sp}(1)}_{(1)_v}\right)v^{2n+5}. \end{aligned} \end{equation} This perfectly agrees with the leading $q$ order of the R-R twisted elliptic genus that is when turning off all gauge and flavor fugacities: \begin{equation} Z_1^{\mathfrak{so}(7)+\bf V+ S}(v)=\frac{2 v^4 \left(2 v^2-3 v+2\right)}{(v-1)^2 (v+1)^8}. \end{equation} \paragraph{\underline{$\mathfrak{n}=3,\mathfrak{so}(8)^{(3)}$}} The $\mathbb{Z}_3$ twist of 6d $(1,0)$ $\mathfrak{so}(8)+\bf V+S+C$ theory has low energy gauge algebra $\mathring{G}=G_2$ and twisted matter content $\mathbf{7}_0+\mathbf{7}_{1/3}+\mathbf{7}_{2/3}$. From the recursion formula \eqref{Z1}, we compute the twisted one-string elliptic genus to $q$ order $11/3$. In particular, we obtain the coefficients $b_{ij}$ in Table \ref{tab:bijn3so8z3}. We observe the leading $q$ order of R-R elliptic genus gives the one-instanton partition function of 5d $G_2+\bf F$ theory \cite{DelZotto:2018tcj}: \begin{equation} Z_1^{G_2+\bf F}= \sum_{n=0}\chi^{G_2}_{n\theta}\chi^{\mathfrak{sp}(1)}_{(1)}v^{2n+3}- \sum_{n=0}\chi^{G_2}_{f+n\theta}v^{2n+4}. \end{equation} Besides, the leading order of NS-R elliptic genus colored red has coefficients $\chi^{G_2}_{n\theta}$ as the one $G_2$ instanton Hilbert series. The subleading order of NS-R elliptic genus colored blue has coefficients $-\chi^{G_2}_{f+n\theta}\chi^{\mathfrak{sp}(1)}_{(1)}$, which are the excited states over NS-R vacuum with KK-charge $1/3$. The subsubleading order of NS-R elliptic genus colored cyan has coefficients $(\chi^{G_2}_f+\chi^{\mathfrak{sp}(1)}_{(2)})\chi^{G_2}_{n\theta}$, which are the excited states over NS-R vacuum with KK-charge $2/3$. \begin{table}[h] \begin{center} $\begin{tabu}{c|cccccccccc} q\backslash v &\ 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 \\ \hline 0&\ 0 & \color{orange}2 & \color{orange}-7 & \color{orange}28 &\color{orange}-64 & \color{orange}154 & \color{orange}-286 & \color{orange}546 & \color{orange}-896 & \color{orange}1496 \\ 1/3& 0 & -1 & 16 & -70 & 224 & -563 & 1232 & -2412 & 4368 & -7413 \\ 2/3& \ \red{1}\ & -2 & -10 & 104 & -420 & 1260 & -3070 & 6566 & -12680 & 22722 \\ 1& 0 & \textcolor{cyan}{10} & -16 & -60 & 528 & -2016 & 5824 & -13812 & 29120 & -55488 \\ 4/3& 0 & \blue{-14} & 67 & -90 & -288 & 2270 & -8344 & 23198 & -54112 & 112056 \\ 5/3& 0 & \red{14} & -112 & 358 & -416 & -1192 & 8720 & -30820 & 83216 & -190402 \\ 2& 0 & 0 & \cyan{140} & -630 & 1598 & -1668 & -4412 & 30566 & -104388 & 275170 \\ 7/3& 0 & 0 & \blue{-128} & 840 & -2912 & 6288 & -6032 & -15004 & 99296 & -329752 \\ 8/3& 0 & 0 & \red{77} & -870 & 4032 & -11676 & 22508 & -20150 & -47592 & 303454 \\ 3 &0 & 0 & 0 & \cyan{770} & -4528 & 16611 & -42096 & 74444 & -62896 & -142378 \\ 10/3& 0 & 0 & 0 & \blue{-572} & 4438 & -19694 & 60998 & -140026 & 230718 & -185756 \\ 11/3& 0 & 0 & 0 & \red{273} & -3680 & 20356 & -74720 & 205436 & -435408 & 677190 \\ \end{tabu}$ \caption{The coefficient matrix $b_{ij}$ for the $\mathbb{E}_1$ of 6d $\mathfrak{su}(8)^{(3)}$ theory with $\mathfrak{n}=3$.} \label{tab:bijn3so8z3} \end{center} \end{table} \paragraph{\underline{$\mathfrak{n}=2,\mathfrak{so}(8)^{(2)}$}} The $\mathbb{Z}_2$ twist of 6d $(1,0)$ $\mathfrak{so}(8)+2(\bf V+S+C)$ theory has low energy gauge algebra $\mathring{G}=\mathfrak{so}(7)$ and twisted matter content $2(\mathbf{7}_0+\mathbf{8}_{0}+\mathbf{8}_{1/2})$. From the unity twisted elliptic blowup equations, we compute the twisted one-string elliptic genus $\mathbb{E}_1$ to $q^7$ order. In particular, we obtain the following coefficients $b_{ij}$ in Table \ref{tab:bijn2so8z2}. \begin{table}[h] \begin{center} $\begin{tabu}{c|cccccccc} q\backslash v & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 \\ \hline 0& 0 & \color{orange}-1 & \color{orange}-4 & \color{orange}-18 & \color{orange}300 & \color{orange}-1603 & \color{orange}5768 & \color{orange}-16548 \\ 1/2& \color{red}5 & 4 & -12 & -68 & -152 & 3460 & -18980 & 68796 \\ 1& \color{red}-32 & 50 & 100 & -110 & -780 & -1340 & 31516 & -169674 \\ 3/2& \color{red}140 & -524 & 426 & 1004 & -620 & -6840 & -6896 & 212152 \\ 2& \color{red}-448 & 2413 & -5060 & 2332 & 8440 & -3452 & -46800 & -35810 \\ 5/2& \color{red}1218 & -8232 & 25172 & -38908 & 12255 & 54640 & -14240 & -279572 \\ 3& \color{red}-2880 & 22724 & -86492 & 195414 & -245816 & 50690 & 315700 & -61000 \\ 7/2& \color{red}6204 & -54888 & 242564 & -681100 & 1265024 & -1377048 & 206878 & 1592400 \\ \end{tabu}$ \caption{The coefficient matrix $b_{ij}$ for the $\mathbb{E}_1$ of 6d $\mathfrak{so}(8)^{(2)}$ theory with $\mathfrak{n}=2$.} \label{tab:bijn2so8z2} \end{center} \end{table} Our results are consistent with the 5d limits in both R-R and NS-R sectors. The leading $q$ order of the NS-R sector gives the 5d $\mathfrak{so}(7)+2\bf S$ theory whose 5d partition function can be computed by localization \cite{Kim:2018gjo} or by 5d blowup equations \cite{Kim:2019uqw}. We use the localization formula in \cite{Kim:2018gjo} to compute the 5d one-instanton partition function as \begin{equation} Z_{1}^{ \mathfrak{so}(7)+2\bf S}=\frac{v^4 \left(5 v^4-12 v^3+22 v^2-12 v+5\right)}{(v-1)^4 (v+1)^8}=5 v^4-32 v^5+140 v^6-448 v^7+\dots. \end{equation} One can see the coefficients are in agreement with the red numbers in Table \ref{tab:bijn2so8z2}. One can also turn on the gauge and flavor fugacities, in which cases the $Z_1$ formula as $v$ expansion can be found in \cite[Equation (H.27)]{DelZotto:2018tcj}. The leading $q$ order of the R-R sector should give the 5d $\mathfrak{so}(7)+2\mathbf{V}+2\bf S$ theory whose partition function to our knowledge has not been computed before. Luckily we can compare with the reduced one-instanton partition function of 5d $\mathfrak{so}(7)+2{\bf V}+6\bf S$ theory given in \cite[Equation (E.2)]{Gu:2020fem}. After decoupling four $\bf S$, we find the resulting 5d partition function is \begin{equation} \begin{aligned} Z_1^{\mathfrak{so}(7)+2\mathbf{V}+2\mathbf{S}}=&\,v^2+\chi^{\mathfrak{sp}(2)}_{(10)_v}v^3-\chi^{\mathfrak{so}(7)}_{(100)}v^4+\sum_{n=0}^{\infty}\chi^{\mathfrak{so}(7)}_{n\theta}\chi^{\mathfrak{sp}(2)}_{(01)_v}\chi^{\mathfrak{sp}(2)}_{(01)_s}v^{2n+4}\\ &-\left(\chi^{\mathfrak{so}(7)}_{(1n0)}\chi^{\mathfrak{sp}(2)}_{(10)_v}\chi^{\mathfrak{sp}(2)}_{(01)_s}+\chi^{\mathfrak{so}(7)}_{(0n1)}\chi^{\mathfrak{sp}(2)}_{(01)_v}\chi^{\mathfrak{sp}(2)}_{(10)_s}\right)v^{2n+5}\\ &+\left(\chi^{\mathfrak{so}(7)}_{(2n0)}\chi^{\mathfrak{sp}(2)}_{(01)_s}+ \chi^{\mathfrak{so}(7)}_{(1n1)}\chi^{\mathfrak{sp}(2)}_{(10)_v}\chi^{\mathfrak{sp}(2)}_{(10)_s}+\chi^{\mathfrak{so}(7)}_{(0n2)}\chi^{\mathfrak{sp}(2)}_{(01)_v}\right)v^{2n+6}\\ &-\left(\chi^{\mathfrak{so}(7)}_{(2n1)}\chi^{\mathfrak{sp}(2)}_{(10)_s}+\chi^{\mathfrak{so}(7)}_{(1n2)}\chi^{\mathfrak{sp}(2)}_{(10)_v}\right)v^{2n+7}+ \chi^{\mathfrak{so}(7)}_{(2n2)}v^{2n+8}. \end{aligned} \end{equation} We checked that this completely agrees with leading $q$ order of the R-R elliptic genus up to an overall minus sign: \begin{equation}\nonumber Z_1^{\mathfrak{so}(7)+2\mathbf{V}+2\mathbf{S}}(v)= \frac{v^2 \left(v^4+12 v^3+78 v^2+12 v+1\right)}{(v+1)^8}=v^2+4 v^3+18 v^4-300 v^5+\dots \end{equation} \paragraph{\underline{$\mathfrak{n}=2,\mathfrak{so}(8)^{(3)}$}} The $\mathbb{Z}_3$ twist of 6d $(1,0)$ $\mathfrak{so}(8)+2(\bf V+S+C)$ theory has low energy gauge algebra $\mathring{G}=G_2$ and twisted matter content $2(\mathbf{7}_0+\mathbf{7}_{1/3}+\mathbf{7}_{2/3})$. From the unity twisted elliptic blowup equations, we compute the twisted one-string elliptic genera $\mathbb{E}_1$ to the order $q^{16/3}$. We summarize the coefficients $b_{ij}$ in Table \ref{tab:bijn2so8z3}. The leading $q$ order of the R-R elliptic genus should give the 5d partition function of $G_2+2\bf F$ theory. We compute the 5d one-instanton partition function of $G_2+2\bf F$ theory from the localization formula in \cite{Kim:2018gjo} as \begin{equation} Z_{1}^{ G_2+2\bf F}=-\frac{v^3 \left(5 v^6-28 v^5+67 v^4-88 v^3+67 v^2-28 v+5\right)}{\left(1-v^2\right)^6}. \end{equation} We checked that the Fourier coefficients here are in agreement with the orange numbers in Table \ref{tab:bijn2so8z3}. The leading order of NS-R elliptic genus colored red has coefficients $\chi^{G_2}_{n\theta}$ as expected, since the circle reduction of the NS-R sector should be a 5d pure $G_2$ theory. We find the subleading order of NS-R elliptic genus colored blue has coefficients $-\chi^{G_2}_{f+n\theta}\chi^{\mathfrak{sp}(2)}_{(10)}$, which represent the first excited states with KK-charge $1/3$ above the NS-R vacuum. Interestingly, we notice the diagonal elements in Table \ref{tab:bijn2so8z3} are always zero, but we could not find an explanation for it. \begin{table}[h] \begin{center} $\begin{tabu}{c|ccccccccc} q\backslash v & \,2& 3 & 4 & 5 & 6 & 7 & 8 &9&10\\ \hline 0& \,0 & \color{orange}-5 & \color{orange}28 & \color{orange}-97 & \color{orange}256 & \color{orange}-574 & \color{orange}1144 & \color{orange}-2094 & \color{orange}3584 \\ 1/3& \,\red{1} & 0 & -57 & 336 & -1159 & 3072 & -6881 & 13728 & -25119 \\ 2/3& \,0 & 17 & 0 & -455 & 2488 & -8349 & 21760 & -48293 & 95728 \\ 1& \,0 & \color{blue}-28 & 170 & 0 & -2802 & 14400 & -46814 & 119808 & -262906 \\ 4/3& \,0 & \red{14} & -336 & 1157 & 0 & -14386 & 70388 & -222392 & 559616 \\ 5/3& \,0 & 0 & 373 & -2488 & 6466 & 0 & -64869 & 303888 & -935643 \\ 2& \,0 & 0 & \color{blue}-256 & 3240 & -14400 & 31001 & 0 & -263943 & 1191224 \\ 7/3& \,0 & 0 & \red{77} & -3072 & 20251 & -70388 & 132353 & 0 & -987985 \\ 8/3& \,0 & 0 & 0 & 2254 & -21760 & 103822 & -303888 & 515468 & 0 \\ 3& \,0 & 0 & 0 & \color{blue}-1144 & 18935 & -119808 & 462279 & -1191224 & 1861127 \\ 10/3& \,0 & 0 & 0 & \red{273} & -13728 & 115465 & -559616 & 1850023 & -4316352 \\ \end{tabu}$ \caption{The coefficient matrix $b_{ij}$ for the $\mathbb{E}_1$ of 6d $\mathfrak{so}(8)^{(3)}$ theory with $\mathfrak{n}=2$.} \label{tab:bijn2so8z3} \end{center} \end{table} \paragraph{\underline{$\mathfrak{n}=2,\mathfrak{so}(10)^{(2)}$}} The $\mathbb{Z}_2$ twist of 6d $(1,0)$ $\mathfrak{so}(10)+4{\bf V}+2\bf S$ theory has low energy gauge algebra $\mathring{G}=\mathfrak{so}(9)$ and twisted matter content $4\mathbf{V}_0+\mathbf{S}_{0}+\mathbf{S}_{1/2}$. From the unity twisted elliptic blowup equations, we compute the twisted one-string elliptic genus $\mathbb{E}_1$ to $q^7$ order. In particular, we obtain the Fourier coefficients $b_{ij}$ in the $(q,v)$ expansion in Table \ref{tab:bijn2so10z2}. The leading $q$ order of the NS-R sector should give the 5d $\mathfrak{so}(9)+\bf S$ theory. To our knowledge, 5d $\mathfrak{so}(9)+\bf S$ theory does not have an ADHM construction. Luckily, the exact $v$ expansion formula of the one-instanton partition function of 5d $\mathfrak{so}(9)+2\mathbf{V}+\bf S$ theory has been found in \cite[Equation (H.29)]{DelZotto:2018tcj}. By decoupling the two $\bf V$, we obtain the following exact $v$ expansion formula \begin{equation} \begin{aligned} Z_1^{\mathfrak{so}(9)+\mathbf{S}}=\sum_{n=0}^{\infty}\chi^{\mathfrak{so}(9)}_{n\theta}\chi^{\mathfrak{sp}(1)}_{(2)_s}v^{2n+6}-\chi^{\mathfrak{so}(7)}_{(0n01)}\chi^{\mathfrak{sp}(1)}_{(1)_s}v^{2n+7}+\chi^{\mathfrak{so}(7)}_{(0n10)}v^{2n+8}. \end{aligned} \end{equation} This is in complete agreement with our leading $q$ order of the NS-R elliptic genus whose coefficients are colored red in Table \ref{tab:bijn2so10z2}. Utilizing the Weyl dimension formula, we further find the following rational expression of $v$ with all gauge and flavor fugacities turned off: \begin{equation} Z_1^{\mathfrak{so}(9)+\mathbf{S}}(v)=\frac{v^6 \left(3 v^8-20 v^7+58 v^6-116 v^5+134 v^4-116 v^3+58 v^2-20 v+3\right)}{(v-1)^8 (v+1)^{12}}. \end{equation} On the other hand, the leading $q$ order of the R-R sector should give the 5d $\mathfrak{so}(9)+4\bf V+ S$ theory. The exact $v$ expansion formula of the one-instanton partition function of 5d $\mathfrak{so}(9)+4\mathbf{V}+3\bf S$ theory has been found in \cite[Equation (E.6)]{Gu:2020fem}. By decoupling two $\bf S$, we find the resulting 5d partition function is in agreement with the leading $q$ order of the one-string R-R elliptic genus: \begin{equation}\nonumber \begin{aligned} Z_1^{\mathfrak{so}(9)+4\mathbf{V}+\mathbf{S}}(v)=-\frac{v^2 \left(v^8+12 v^7+66 v^6+268 v^5+954 v^4+268 v^3+66 v^2+12 v+1\right)}{(v+1)^{12}}, \end{aligned} \end{equation} up to an overall sign. The Fourier coefficients are colored orange in Table \ref{tab:bijn2so10z2}. \begin{table}[h] \begin{center} $\begin{tabu}{c|cccccccc} q\backslash v & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 \\ \hline 0& 0 & \color{orange}-1 & 0 & 0 & \color{orange}-48 & \color{orange}117 & \color{orange}2288 & \color{orange}-23760 \\ 1/2& \color{red}3 & 8 & -10 & -24 & -12 & -264 & 66 & 31448 \\ 1& \color{red}-32 & 30 & 112 & -82 & -96 & -184 & -5344 & 4314 \\ 3/2& \color{red}192 & -600 & 150 & 1352 & -500 & -1344 & -472 & -42496 \\ 2& \color{red}-864 & 4346 & -7664 & 1260 & 11520 & -6583 & -1056 & 16448 \\ 5/2& \color{red}3135 & -20664 & 57492 & -72752 & 2499 & 96792 & -60738 & -11760 \\ 3& \color{red}-9856 & 78646 & -286704 & 586292 & -616336 & 27138 & 701296 & -625918 \\ 7/2& \color{red}27456 & -252120 & 1101390 & -2917296 & 4860776 & -4412640 & 15894 & 4855392 \\ \end{tabu}$ \caption{The coefficient matrix $b_{ij}$ for the $\mathbb{E}_1$ of 6d $\mathfrak{so}(10)^{(2)}$ theory with $\mathfrak{n}=2$.} \label{tab:bijn2so10z2} \end{center} \end{table} \paragraph{\underline{$\mathfrak{n}=2,E_6^{(2)}$}} The $\mathbb{Z}_2$ twist of 6d $(1,0)$ $E_6+4\bf F$ theory has low energy gauge algebra $\mathring{G}=F_4$ and twisted matter content $2(\mathbf{26}_0+\mathbf{26}_{1/2})$ which is invariant under the KK-charge shift by $1/2$. From the unity twisted elliptic blowup equations, we compute the twisted one-string elliptic genera $\mathbb{E}_1$ to the $q^{3}$ order. We summarize the coefficients $b_{ij}$ in the $(q,v)$ expansion in Table \ref{tab:bijn2e6z2}. From the obvious anti-symmetric coefficient matrix, we recognize that the $\mathbb{E}_1$ is anti self-dual upon the spectral flow. Besides, the leading $q$ order of $\mathbb{E}_1$ should give the one-instanton Nekrasov partition function of 5d $F_4+2\bf F$ theory, which as $v$ expansion can be found in \cite[Equation (H.34)]{DelZotto:2018tcj}. We have checked they are in complete agreement. The $v$ expansion coefficients in 5d are colored in orange in Table \ref{tab:bijn2e6z2}. \begin{table}[h] \begin{center} $\begin{tabu}{c|ccccccc} q\backslash v & 5&6 &7 &8 &9 & 10 & 11 \\ \hline 0& 0 & \color{orange}-5 & \color{orange}-20 & \color{orange}282 & \color{orange}-52 & \color{orange}-14377 & \color{orange}133136 \\ 1/2& \color{orange}5 & 0 & -160 & -848 & 11354 & -8144 & -491872 \\ 1& \color{orange}20 & 160 & 0 & -4490 & -18476 & 263092 & -322556 \\ 3/2& \color{orange}-282 & 848 & 4490 & 0 & -94702 & -273520 & 4456372 \\ 2& \color{orange}52 & -11354 & 18476 & 94702 & 0 & -1598277 & -3093340 \\ 5/2& \color{orange}14377 & 8144 & -263092 & 273520 & 1598277 & 0 & -21992316 \\ 3& \color{orange}-133136 & 491872 & 322556 & -4456372 & 3093340 & 21992316 & 0 \\ \end{tabu}$ \caption{The coefficient matrix $b_{ij}$ for the $\mathbb{E}_1$ of 6d $E_6^{(2)}$ theory with $\mathfrak{n}=2$.} \label{tab:bijn2e6z2} \end{center} \end{table} \paragraph{\underline{$\mathfrak{n}=1,\mathfrak{su}(3)^{(2)}$}} The $\mathbb{Z}_2$ twist of 6d $(1,0)$ $\mathfrak{su}(3)+12\bf F$ theory has twisted matter content $6\mathbf{F}_0\oplus 6\mathbf{F}_{1/2}$ which is invariant under KK-charge shift by $1/2$. The circle reduction should give a 5d $\mathfrak{su}(2)+6\bf F$ theory. The twisted circle compactification gives a highly nontrivial 5d KK theory with several 5d gauge theory descriptions which are 5d $\mathfrak{su}(3)_4 +6\bf F$, $G_2 +6\bf F$ and $\mathfrak{sp}(2)+2\mathbf{\Lambda}^2 +4\bf F$ theories \cite{Jefferson:2018irk}. To our knowledge, there is no 2d quiver gauge theory description for the twisted elliptic genera in this case. From the unity twisted elliptic blowup equations, we compute its twisted one-string elliptic genus $\mathbb{E}_1$ to the order $q^{4}$. We obtain the coefficients $b_{ij}$ in Table \ref{tab:bijn1su3z2}. The symmetry coefficient matrix indicates the self-dual spectral flow symmetry as expected. The 5d one-instanton partition function of $\mathfrak{su}(2)+6\bf F$ theory can be computed as \begin{equation} Z_{1}^{ \mathfrak{su}(2)+6\bf F}=\sum_{n=0}^{\infty}\Big(\chi^{\mathfrak{so}(12)}_{S}\chi^{\mathfrak{su}(2)}_{n\theta}v^{1+2n}-\chi^{\mathfrak{so}(12)}_{C}\chi^{\mathfrak{su}(2)}_{f+n\theta}v^{2+2n}\Big). \end{equation} where $\mathfrak{so}(12)$ is the pertubative 5d flavor symmetry and $S$ and $C$ are the spinor and conjugate spinor representations which both have dimension 32. One can see these coefficients are in total agreement with the orange numbers in Table \ref{tab:bijn1su3z2}. \begin{table}[h] \begin{center} $\begin{tabu}{c|ccccccccc} q\backslash v & 1 & & 2 & & 3 & & 4 & \\ \hline 0& \color{orange}32 & 0 & \color{orange}-64 & 0 & \color{orange}96 & 0 & \color{orange}-128 \\ 1/4& 0 & 64 & 0 & -128 & 0 & 192 & 0 \\ 1/2& \color{orange}-64 & 0 & 480 & 0 & -960 & 0 & 1440 \\ 3/4& 0 & -128 & 0 & 960 & 0 & -1920 & 0 \\ 1& \color{orange}96 & 0 & -960 & 0 & 4160 & 0 & -8128 \\ 5/4& 0 & 192 & 0 & -1920 & 0 & 8192 & 0 \\ 3/2& \color{orange}-128 & 0 & 1440 & 0 & -8128 & 0 & 27040 \\ \end{tabu}$ \caption{The coefficient matrix $b_{ij}$ for the $\mathbb{E}_1$ of 6d $\mathfrak{su}(3)^{(2)}$ theory with $\mathfrak{n}=1$.} \label{tab:bijn1su3z2} \end{center} \end{table} \paragraph{\underline{$\mathfrak{n}=1,\mathfrak{so}(8)^{(2)}$}} The $\mathbb{Z}_2$ twist of 6d $(1,0)$ $\mathfrak{so}(8)+3(\bf V+S+C)$ theory has low energy gauge algebra $\mathring{G}=\mathfrak{so}(7)$ and twisted matter content $3(\mathbf{V}_0+\mathbf{S}_{0}+\mathbf{S}_{1/2})$. From the unity twisted elliptic blowup equations, we compute its twisted one-string elliptic genus $\mathbb{E}_1$ to the order $q^{7}$. We summarize the Fourier coefficients $b_{ij}$ in Table \ref{tab:bijn1so8z2}. \begin{table}[h] \begin{center} $\begin{tabu}{c|ccccccccc} q\backslash v & 1&2& 3 & 4 & 5 & 6 \\ \hline 0& \color{red}14 & \color{orange}44 & \color{orange}42 &\color{orange} -168 & \color{orange}-2490 & \color{orange}18564 \\ 1/2& \color{red}-112 & 128 & 896 & 896 & -5376 & -29568 \\ 1& \color{red}504 & -2212 & -224 & 10768 & 12152 & -66528 \\ 3/2& \color{red}-1680 & 11648 & -24416 & -16000 & 98672 & 130048 \\ 2& \color{red}4620 & -41496 & 148526 & -198688 & -212310 & 751104 \\ 5/2&\color{red} -11088 & 118272 & -557088 & 1380736 & -1323168 & -1918080 \\ 3& \color{red}24024 & -290136 & 1629600 & -5386024 & 10423952 & -7603608 \\ \end{tabu}$ \caption{The coefficient matrix $b_{ij}$ for the $\mathbb{E}_1$ of 6d $\mathfrak{so}(8)^{(2)}$ theory with $\mathfrak{n}=1$.} \label{tab:bijn1so8z2} \end{center} \end{table} The leading $q$ order of the NS-R sector should give the 5d $\mathfrak{so}(7)+3\bf S$ theory whose 5d partition function can be computed by localization \cite{Kim:2018gjo} or 5d blowup equations \cite{Kim:2019uqw}. We use the localization formula in \cite{Kim:2018gjo} to compute the 5d one-instanton partition function as \begin{equation} Z_{1}^{ \mathfrak{so}(7)+3\bf S}=\frac{14 v^4}{(v+1)^8}=14v^4-112 v^5+504 v^6-1680 v^7+4620 v^8 -\dots \end{equation} One can see these coefficients are in agreement with the red numbers in Table \ref{tab:bijn1so8z2}. The leading $q$ order of the R-R elliptic genus should give the on-instanton partition function of 5d $\mathfrak{so}(7)+3\mathbf{V}+3\bf S$ theory whose $v$ expansion coefficients are colored orange. We are not aware that any other method can compute the partition function of 5d $\mathfrak{so}(7)+3\mathbf{V}+3\bf S$ theory. \paragraph{\underline{$\mathfrak{n}=1,\mathfrak{so}(8)^{(3)}$}} The $\mathbb{Z}_3$ twist of 6d $(1,0)$ $\mathfrak{so}(8)+3(\bf V+S+C)$ theory has low energy gauge algebra $\mathring{G}=G_2$ and twisted matter content $3(\mathbf{7}_0+\mathbf{7}_{1/3}+\mathbf{7}_{2/3})$. The circle reduction gives the 5d $G_2+3\bf F$ theory. From the unity twisted elliptic blowup equations, we compute its twisted one-string elliptic genus $\mathbb{E}_1$ to the order $q^{16/3}$. We summarize the Fourier coefficients $b_{ij}$ in $(q,v)$ expansion in Table \ref{tab:bijn1so8z3}. The leading $q$ order of the R-R elliptic genus should give the 5d partition function of $G_2+3\bf F$ theory. We compute the 5d one-instanton partition function of $G_2+3\bf F$ theory from the localization formula in \cite{Kim:2018gjo} as \begin{equation}\nonumber \begin{aligned} Z_{1}^{ G_2+3\bf F}&=\frac{-v^{12}+7 v^{10}+14 v^9-119 v^8+274 v^7-350 v^6+274 v^5-119 v^4+14 v^3+7 v^2-1}{\left(1-v^2\right)^6}\\ &=-1+v^2+14 v^3-98 v^4+358 v^5-973 v^6+2212 v^7-4452 v^8+8196 v^9-\dots \end{aligned} \end{equation} One can see these Fourier coefficients are in agreement with the orange numbers in Table \ref{tab:bijn1so8z3} up to the first gauge singlet $1$. On the other hand, the leading $q$ order of the NS-R elliptic genus gives the 5d one $G_2$ instanton Hilbert series, as shown from the red numbers which are the $\chi_{n\theta}^{G_2}$ characters. The subleading $q$ order of the NS-R elliptic genus has coefficients $-\chi^{G_2}_{f+n\theta}\chi^{\mathfrak{sp}(3)}_{(100)}$ colored in blue in Table \ref{tab:bijn1so8z3}. These are the first excited states with KK charge $1/3$ above the NS-R vacuum. \begin{table}[h] \begin{center} $\begin{tabu}{c|ccccccccc} q\backslash v & \phantom{,}2& 3 & 4 & 5 & 6 & 7 & 8 &9 \\ \hline 0& \phantom{,}\color{red}1 & \color{orange}14 & \color{orange}-98 & \color{orange}358 & \color{orange}-973 & \color{orange}2212 & \color{orange}-4452 & \color{orange}8196 \\ 1/3& \phantom{,}0 & 28 & 176 & -1448 & 5488 & -15148 & 34720 & -70224 \\ 2/3& \phantom{,}0 & \color{blue}-42 & 308 & 1498 & -12712 & 48230 & -133028 & 304682 \\ 1& \phantom{,}0 & \color{red}14 & -784 & 2472 & 10304 & -85456 & 319712 & -874888 \\ 4/3& \phantom{,}0 & 0 & 770 & -7630 & 16226 & 59970 & -480164 & 1763734 \\ 5/3& \phantom{,}0 & 0 & \color{blue}-384 & 9793 & -54080 & 91168 & 306432 & -2363200 \\ 2& \phantom{,}0 & 0 & \color{red}77 & -8246 & 79058 & -316218 & 452881 & 1409772 \\ 7/3& \phantom{,}0 & 0 & 0 & 4802 & -79856 & 497280 & -1603616 & 2035490 \\ 8/3& \phantom{,}0 & 0 & 0 & \color{blue}-1716 & 62083 & -557458 & 2643312 & -7287124 \\ 3& \phantom{,}0 & 0 & 0 & \color{red}273 & -38304 & 498064 & -3169600 & 12400754 \\ \end{tabu}$ \caption{The coefficient matrix $b_{ij}$ for the $\mathbb{E}_1$ of 6d $\mathfrak{so}(8)^{(3)}$ theory with $\mathfrak{n}=1$.} \label{tab:bijn1so8z3} \end{center} \end{table} \section{Modular bootstrap of the twisted elliptic genera}\label{sec:MA} In this section, we utilize the modularity of elliptic genera to obtain some all order results beyond the $q$ expansion. This compensates the results of twisted elliptic genera for $\mathfrak{n}=1,2$ twisted theories where from elliptic blowup equations we can only solve $\mathbb{E}_1$ as $q$ expansion but cannot have a compact formula. The modular bootstrap approach views the elliptic genera as Jacobi forms on certain modular groups, and utilizes the finite generation property of modular forms and Jacobi forms to obtain a compact modular expression of elliptic genera which works for all $q$ orders. \subsection{The modular ansatz for twisted elliptic genera} For a 6d $(1,0)$ SCFT with gauge group $G$ and tensor coefficient $\mathfrak{n}$, the modular ansatz for its reduced one-string elliptic genus was proposed by Del Zotto and Lockhart in \cite{DelZotto:2018tcj} as \begin{equation}\label{MADL} \mathbb{E}_1(\tau,\epsilon_+)=\frac{ \mathcal{N}(\tau,\epsilon_+)}{\eta^{12(\mathfrak{n}-2)-4+24\delta_{\mathfrak{n},1}}\phi_{-2,1}(\tau,2\epsilon_+)^{h^\vee_{G}-1}}. \end{equation} Here all gauge and flavor fugacities are turned off, and only $\epsilon_+$ serves as the elliptic parameter of the Jacobi form. The $\delta_{\mathfrak{n},1}$ comes from the special phenomenon of $\mathfrak{n}=1$ theories, where the leading $q$ order of elliptic genus is always trivial, and the 5d theory information only emerges from the subleading $q$ order. Utilizing several other constraints, mostly from the universal features of the leading order of R-R and NS-R elliptic genera, \cite{DelZotto:2018tcj} successfully determined the modular ansatz for most rank-one theories. The modular ansatz for several remaining theories was determined in \cite{Gu:2020fem} with the help of elliptic blowup equations. We would like to find a generalization of \eqref{MADL} for the reduced twisted one-string elliptic genera. An inspiration comes from the recent study on the modularity of topological strings on $N$-section Calabi-Yau threefolds \cite{Cota:2019cjx,Knapp:2021vkm,Schimannek:2021pau}. The modular ansatz for the topological string partition function on such geometries was first proposed in \cite{Cota:2019cjx}. Combining \eqref{MADL} and the results in \cite{Cota:2019cjx} together, we propose the following modular ansatz for the reduced one-string elliptic genus for twisted 6d (1,0) theories with twist coefficient $N=2,3,4$: \begin{equation}\label{MA} \boxed{ \mathbb{E}_1(\tau,\epsilon_+)=\frac{ \mathcal{N}(\tau,\epsilon_+)}{\eta^{12(\mathfrak{n}-2)-4+24\delta_{\mathfrak{n},1}}\Delta_{2N}(\frac{\tau}{N})^{s}\phi_{-2,1}(\tau,2\epsilon_+)^{h^\vee_{\mathring{G}}-1}},} \end{equation} with \begin{equation}\label{eq:s} \boxed{s=\frac{N}{N-1}\Big(c-\frac{\mathfrak{n}-2}{2}-\delta_{\mathfrak{n},1}\Big).} \end{equation} Recall the $c$ is the $c$ constant of twisted theories defined in \eqref{goldall1} that depends only on the tensor coefficient $\mathfrak{n}$ and twist coefficient $N$. The $\Delta_{2N}$ are some $\Gamma_0(N)$ cusp forms defined in Appendix \ref{app:B}. The numerator $\mathcal{N}(\tau,\epsilon_+)$ is of weight $6(\mathfrak{n}-2)+2Ns+12\delta_{\mathfrak{n},1}-2h^\vee_{\mathring{G}}$ and index $4({h^\vee_{\mathring{G}}-1})+\mathfrak{n}-h_G^{\vee} $. The $\mathcal{N}(\tau,\epsilon_+)$ usually has fractional $q^{1/N}$ orders thus it is convenient to scale $q ^{1/N}$ to $q$. Then we expect $\mathcal{N}(N\tau,\epsilon_+)$ to be a $\Gamma_1(N)$ weak Jacobi form with positive integer index. By the finite generation property of weak Jacobi forms \cite{eichler1985theory}:, we have \begin{equation} \mathcal{N}(N\tau,\epsilon_+)\in M_{\star}(N)[\phi_{-2,1}(N\tau,\epsilon_+),\phi_{0,1}(N\tau,\epsilon_+)]. \end{equation} Here $M_{\star}(N)$ denotes the ring of modular forms on $\Gamma_1(N)$. The $\phi_{-2,1}(\tau,z)$ and $\phi_{0,1}(\tau,z)$ are the well-known Eichler-Zagier generators for weak Jacobi forms whose expressions are collected in Appendix \ref{app:B}. The $s$ here measure the difference between the twisted $c$ constant and the untwisted one and is related to a geometric quantity $r_{\beta}=N s$ which is always integral \cite{Cota:2019cjx}. Interestingly, we find that except for the $\mathfrak{n}=1,\mathfrak{so}(8)^{(3)}$ twisted theory, the modular ansatz of all twisted one-string elliptic genera encountered in the current paper satisfy a bigger congruence subgroup that is $\Gamma_0(N)$. We collect the definition and modular generators for $\Gamma_0(N)$ and $\Gamma_1(N)$ in Appendix \ref{app:B}. Some more explanation for the $N=4$ cases are needed. We notice that for some theories with twist coefficients $4$, it is possible that besides the $\Gamma_1(4)$ elements from $\Delta_8$, there can be extra $\Gamma_1(2)$ elements. In such case, the $\Delta_8(\frac{\tau}{4})^{s}$ in \eqref{MA} need to be extended to $\Delta_8(\frac{\tau}{4})^{s_1}\Delta_4(\frac{\tau}{4})^{s_2}$. This suggests that the associated Calabi-Yau geometries contain both 4-section and 2-section components. We collect in Table \ref{tb:mainMA1} the relevant data for the modular ansatz for all rank-one twisted theories. The $\#$ means the number of independent parameters to be fixed in the numerator $\mathcal{N}$. The $\mathfrak{n}=2,\mathfrak{so}(12)^{(2)}$ theory is marked with $*$ because we do not have enough data to fix the modular ansatz, as it involves half-hyper. Except for this theory, we successfully fix its modular ansatz for all other theories in Table \ref{tb:mainMA1} and check the ansatz against the results from twisted elliptic blowup equations to high $q$ orders. \begin{table}[h] \centering \begin{tabular}{|c|l|l|c|c|c|c|c|c|}\hline $\mathfrak{n}$ &$G$ & $\mathring{G}$ & $N$ & $c$ & $s$ & weight & index & \# \\ \hline 6&$E_6^{(2)}$& $F_4$ & 2 & 5/4 & $-3/2$ & 0 & 26 & 196 \\ \hline 5 &$E_6^{(2)}$& $F_4$ &2& 3/2 & 0 & 0 & 25 & 182 \\ & & & 2 & 3/4 & $-3/2$ & $-6$ & 25 & 144 \\ \hline 4&$D_4^{(3)}$& $G_2$ & 3& 5/9 & $-2/3$ & 0 & 10 & 44 \\ 4&$D_{4}^{(2)}$& $B_{3}$ & 2 & 3/4 & $-1/2$ & 0 & 14 & 64 \\ 4&$D_{5}^{(2)}$& $B_{4}$ & 2 & 3/4 & $-1/2$ & $-4$ & 20 & 100 \\ 4&$D_{6}^{(2)}$& $B_{5}$& 2 & 3/4 & $-1/2$ & $-8$ & 26 & 144 \\ 4&$D_{7}^{(2)}$& $B_{6}$ & 2 & 3/4 & $-1/2$ & $-12$ & 32 & 196 \\ 4&$D_{r+4}^{(2)}$& $\!\!B_{r+3}\!\!$ & 2 & 3/4 & $-1/2$ & $-4r$ & $14+6r$ & $\cdots$\\ 4 &$E_6^{(2)}$& $F_4$ & 2 & 1 & 0 & $-6$ & 24 & 132 \\ \hline 3&$A_2^{(2)}$ & $C_1$& 4 & 5/16 & $-1/4$ & 0 & 4 & 15 \\ 3&$D_4^{(2)}$& $B_3$ & 2& 1/2 & 0 & $-4$ & 13 & 42 \\ 3& $D_4^{(3)}$& $G_2$ & 3 & 1/2 & 0 & $-2$ & 9 & 30 \\ \hline 2&$A_{1}^{(2)}$&$C_1$& 2 & 1/4 & 1/2 & $-2$ & 4 & 6 \\ 2& $A_{2}^{(2)}$&$C_{1}$ & 4 & $3/16$ & $1/4$ & $-2$ & $3$ & $ 6$ \\ & &$C_{1,\theta=0/\pi}$\!\! & 4 & 3/8 & 1/2 & 0 & $3$ & 10 \\ 2&$A_{3}^{(2)}$&$C_2$& 2 & 1/4 & 1/2 & $-4$ & 6 & 9 \\ 2& $A_{4}^{(2)}$&$C_{2}$ & 4 & $3/16$ & $1/4$ & $-4$ & $5$ & $ 10$ \\ & & $C_{2,\theta=0/\pi}$ & 4 & 1/2 & $(1/2,1/2)$ & 0 & $5$ & 21 \\ 2&$A_{5}^{(2)}$&$C_3$& 2 & 1/4 & 1/2 & $-6$ & $8$ & 12 \\ 2&$A_{2r-1}^{(2)}$&$C_{r}$& 2 & 1/4 & 1/2 & $-2r$ & $2r+2$ & $\cdots$ \\ 2& $A_{2r}^{(2)}$&$C_{r}$ & 4 & $3/16$ & $1/4$ & $-2r$ & $2r+1$ & $\cdots$ \\ & &$C_{r,\theta=0/\pi}$\!\! & 4 & $\frac{r}{8}+\frac{1}{4} $ & $(\frac12,\frac{r-1}{2}) $ & 0 & $2r+1$ & $\cdots$ \\ 2&$D_4^{(2)}$& $B_3$& 2 & 1/4 & 1/2 & $-8$ & 12 & 25 \\ 2& $D_4^{(3)}$& $G_2$& 3 & 4/9 & 2/3 & $-4$ & 8 & 19 \\ 2&$D_5^{(2)}$ & $B_4$& 2 & 1/4 & 1/2 & $-12$ & 18 & 49 \\ 2&$D_6^{(2)}$& $B_5$ & 2 & 1/4 & 1/2 & $-16$ & 24 & $81^*$ \\ 2 &$E_6^{(2)}$& $F_4$ & 2& $3/4$ & 3/2 & $-12$ & 22 & 81 \\ \hline 1& $A_0^{(2)}$ & $C_0$ &2 & 0 & $-1$ & 0 & 0 & 1 \\ 1& $A_2^{(2)}$ & $C_1$ & 4 & 1/16 & $(-5/4,2)$ & 0& 2& 6 \\ 1&$D_4^{(2)}$& $B_3$ & 2& 0 & $-1$ & $-8$ & 11 & 20 \\ 1&$D_4^{(3)}$& $G_2$ &3 & 7/18 & $-1/6$ & $-3$ & 7 & 15\\ \hline \end{tabular} \caption{Data of $\Gamma_1(N)$ modular ansatz for the twisted one-string elliptic genera of twisted 6d $(1,0)$ rank-one theories. For $N=4$, the $(s_1,s_2)$ means that the denominator contains $\Delta_8(\frac{\tau}{4})^{s_1}\Delta_4(\frac{\tau}{4})^{s_2}$ and only one $s$ means the $(s,0)$.} \label{tb:mainMA1} \end{table} \subsection{Computational results} We pick some interesting theories to explicitly show the modular ansatz results. The results for other theories in Table \ref{tb:mainMA1} can be shared to interested readers upon request. \paragraph{\underline{$\mathfrak{n}=3,\mathfrak{su}(3)^{(2)}$}} For 6d pure $\mathfrak{su}(3)^{(2)}$ theory studied in Section \ref{sec:su3z2}, let us first discuss the $\mathfrak{sp}(1)_{0}$ case. From the general formula \eqref{MA}, we have the following modular ansatz for its reduced twisted one-string elliptic genus \begin{equation}\label{MAsu3z2} \mathbb{E}_1(\tau,\epsilon_+)=\frac{\Delta_8(\tau/4)^{\frac{1}{4}}\mathcal{N}(\tau,\epsilon_+)}{\eta(\tau)^{8}\phi_{-2,1}(\tau,2\epsilon_+)}. \end{equation} Here $\mathcal{N}(\tau,\epsilon_+)$ is of weight 0 and index 4. Interestingly, we notice that in this case the $\Delta_8(\tau/4)^{\frac{1}{4}}$ has taken care of all the $\Gamma_0(4)$ elements such that $\mathcal{N}(\tau,\epsilon_+)$ contains no $q^{1/4+n/2}$ orders, i.e., $\mathcal{N}(2\tau,\epsilon_+)$ is a $\Gamma_0(2)$ Jacobi form. Using the generators $E_2(\tau)^{(2)},E_4(2\tau)$ and $\phi_{-2,1}(2\tau,\epsilon_+),\phi_{0,1}(2\tau,\epsilon_+)$ given in Appendix \ref{app:B}, there are 9 parameters to fix the ansatz of $\mathcal{N}(2\tau,\epsilon_+)$. We find the ansatz can be determined by the known Fourier coefficients of $q^{0,1,2}$ of $\mathcal{N}(2\tau,\epsilon_+)$ as \begin{align}\nonumber \mathcal{N}(2\tau,\epsilon_+)&=\frac{1}{10368}\Big( \big(-4 (E_2^{(2)})^4+18 E_4 (E_2^{(2)})^2-9 E_4^2\big)\phi_{-2}^4+2 E_2^{(2)} \big(2 (E_2^{(2)})^2-9 E_4\big)\phi_{-2}^3\phi_0\\ &\phantom{=\frac{1}{10368}\Big(} -6 \big((E_2^{(2)})^2-3 E_4\big)\phi_{-2}^2\phi_0^2-2 E_2^{(2)}\phi_{-2}\phi_0^3-\phi_0^4 \Big) . \end{align} We then check the modular ansatz results to $q^{8}$ order. Here $\phi_{-2},\phi_0$ are the short notation of $\phi_{-2,1}(2\tau,\epsilon_+),\phi_{0,1}(2\tau,\epsilon_+)$. On the other hand, if we regard $\mathcal{N}(4\tau,\epsilon_+)$ as a $\Gamma_0(4)$ Jacobi form, there will be 15 coefficients to fix $\mathcal{N}(4\tau,\epsilon_+)$ using $E_2^{(2)}$ and $E_2^{(4)}$ given in Appendix \ref{app:B} as modular generators. For the $\mathfrak{sp}(1)_{\pi}$ case, the modular ansatz takes the same form as \eqref{MAsu3z2} and the $\mathcal{N}(\tau,\epsilon_+)$ is still of weight 0 and index 4. Amusingly, we find in this case the $\mathcal{N}(2\tau,\epsilon_+)$ is again a $\Gamma_0(2)$ Jacobi form which we determine to be \begin{equation} \mathcal{N}(2\tau,\epsilon_+)=-\frac{1}{10368}\Big(\big(2(E_2^{(2)})^2-3 E_4\big)\phi_{-2}^2 +2E_2^{(2)}\phi_{-2}\phi_0 -\phi_{0}^2\Big)^2 . \end{equation} This numerator is still fixed by the known Fourier coefficients of $q^{0,1,2}$ and then checked to $q^8$ order against the twisted elliptic blowup equations. \paragraph{\underline{$\mathfrak{n}=4,\mathfrak{so}(8)^{(2)}$}} For 6d pure $\mathfrak{so}(8)^{(2)}$ theory, from the general formula \eqref{MA}, we have the following modular ansatz for its reduced twisted one-string elliptic genus \begin{equation} \mathbb{E}_1(\tau,\epsilon_+)=\frac{\Delta_4(\tau/2)^{\frac{1}{2}}\mathcal{N}(\tau,\epsilon_+)}{\eta(\tau)^{20}\phi_{-2,1}(\tau,2\epsilon_+)^4}. \end{equation} Here $\mathcal{N}(\tau,\epsilon_+)$ is of weight 0 and index 14. Based on the relation between twists and modularity, the $\mathcal{N}(2\tau,\epsilon_+)$ should be a $\Gamma_0(2)$ Jacobi form. Again using the generators $E_2(\tau)^{(2)},E_4(2\tau)$ and $\phi_{-2,1}(2\tau,\epsilon_+),\phi_{0,1}(2\tau,\epsilon_+)$, we find there are 64 coefficients to fix $\mathcal{N}(2\tau,\epsilon_+)$. They can be fixed from the known Fourier coefficients up to $q^7$. We have \begin{align}\nonumber \mathcal{N}(2\tau,\epsilon_+)=&\,-\frac{1}{160489808068608}\Big(\big(2(E_2^{(2)})^2-3 E_4\big)\phi_{-2}^2 +2E_2^{(2)}\phi_{-2}\phi_0 -\phi_{0}^2\Big)\Big((64 (E_2^{(2)})^{12}\\ \nonumber &-672 E_4 (E_2^{(2)})^{10}+3024 E_4^2 (E_2^{(2)})^8-9072 E_4^3 (E_2^{(2)})^6+17982 E_4^4 (E_2^{(2)})^4\\ \nonumber &-15066 E_4^5 (E_2^{(2)})^2+5103 E_4^6)\phi_{-2}^{12}+6 E_2^{(2)} \big(64 (E_2^{(2)})^{10}-800 E_4 (E_2^{(2)})^8\\ \nonumber &+3456 E_4^2 (E_2^{(2)})^6-5616 E_4^3 (E_2^{(2)})^4+2268 E_4^4 (E_2^{(2)})^2-1053 E_4^5\big)\phi_{-2}^{11}\phi_0\\ \nonumber &-18 \big(64 (E_2^{(2)})^{10}-720 E_4 (E_2^{(2)})^8+2544 E_4^2 (E_2^{(2)})^6-2340 E_4^3 (E_2^{(2)})^4\\ \nonumber &-1836 E_4^4 (E_2^{(2)})^2+513 E_4^5\big)\phi_{-2}^{10}\phi_0^2+2 E_2^{(2)} \big(1696 (E_2^{(2)})^8-18000 E_4 (E_2^{(2)})^6\\ \nonumber &+64368 E_4^2 (E_2^{(2)})^4-77760 E_4^3 (E_2^{(2)})^2+1701 E_4^4\big)\phi_{-2}^{9}\phi_0^3-9 \big(80 (E_2^{(2)})^8\\ \nonumber &-1648 E_4 (E_2^{(2)})^6+8316 E_4^2 (E_2^{(2)})^4-12276 E_4^3 (E_2^{(2)})^2-945 E_4^4\big)\phi_{-2}^{8}\phi_0^4\\ \nonumber & +108 E_2^{(2)} \big(8 (E_2^{(2)})^6-72 E_4 (E_2^{(2)})^4+332 E_4^2 (E_2^{(2)})^2-597 E_4^3\big)\phi_{-2}^{7}\phi_0^5\\ \nonumber & +12 \big(128 (E_2^{(2)})^6-690 E_4 (E_2^{(2)})^4+846 E_4^2 (E_2^{(2)})^2+675 E_4^3\big) \phi_{-2}^{6}\phi_0^6\\ \nonumber & +36 E_2^{(2)} \big(8 (E_2^{(2)})^4+8 E_4 (E_2^{(2)})^2-63 E_4^2\big) \phi_{-2}^{5}\phi_0^7+135 \big(2 (E_2^{(2)})^4-6 E_4 (E_2^{(2)})^2\\ \nonumber &+7 E_4^2\big) \phi_{-2}^{4}\phi_0^8 +2 E_2^{(2)} \big(52 (E_2^{(2)})^2-123 E_4\big)\phi_{-2}^{3}\phi_0^9 +6 \big(8 (E_2^{(2)})^2-19 E_4\big) \phi_{-2}^{2}\phi_0^{10}\\ &+18 E_2^{(2)} \phi_{-2}\phi_0^{11} +7\phi_{0}^{12}\Big). \end{align} We then check the modular ansatz results to $q^{16}$ against the 2d localization formula and find perfect agreement. \paragraph{\underline{$\mathfrak{n}=4,\mathfrak{so}(8)^{(3)}$}} For 6d pure $\mathfrak{so}(8)^{(3)}$ theory, from the general formula \eqref{MA}, we have the following modular ansatz for its reduced twisted one-string elliptic genus \begin{equation} \mathbb{E}_1(\tau,\epsilon_+)=\frac{\Delta_6(\tau/3)^{\frac{2}{3}}\mathcal{N}(\tau,\epsilon_+)}{\eta(\tau)^{20}\phi_{-2,1}(\tau,2\epsilon_+)^3}. \end{equation} Here $\mathcal{N}(\tau,\epsilon_+)$ is of weight 0 and index 10. The $\mathcal{N}(3\tau,\epsilon_+)$ should be a $\Gamma_0(3)$ Jacobi form. Using the generators $E_2(\tau)^{(3)},E_4(3\tau),E_6(3\tau)$ and $\phi_{-2,1}(3\tau,\epsilon_+),\phi_{0,1}(3\tau,\epsilon_+)$ given in Appendix \ref{app:B}, we find there are 67 coefficients to fix $\mathcal{N}(3\tau,\epsilon_+)$. We find they can be fixed from the data up to $q^7$ up to the vanishing relation \eqref{relationgen3}, which involve in total 44 independent parameters. We obtain \begin{align}\nonumber \mathcal{N}(3\tau,\epsilon_+)=&\,\frac{1}{10319560704}\Big(E_2^{(3)}\big(2268 (E_2^{(3)})^9-14661 E_4 (E_2^{(3)})^7+20880 E_6 (E_2^{(3)})^6\\ \nonumber &-25560 E_4 E_6 (E_2^{(3)})^4+22176 E_6^2 (E_2^{(3)})^3-7488 E_4 E_6^2 E_2^{(3)}+2560 E_6^3\big)\phi_{-2}^{10}\\ \nonumber &+\! 12 \big(39 (E_2^{(3)})^9-252 E_4 (E_2^{(3)})^7+300 E_6 (E_2^{(3)})^6-54 E_4 E_6 (E_2^{(3)})^4\!-96 E_6^2 (E_2^{(3)})^3\\ \nonumber &+96 E_4 E_6^2 E_2^{(3)}-128 E_6^3\big)\phi_{-2}^9\phi_{0} + 27 \big(39 (E_2^{(3)})^8-252 E_4 (E_2^{(3)})^6+344 E_6 (E_2^{(3)})^5\\ \nonumber &-336 E_4 E_6 (E_2^{(3)})^3+256 E_6^2 (E_2^{(3)})^2+64 E_4 E_6^2\big)\phi_{-2}^8\phi_{0}^2 +24 E_2^{(3)} \big(18 (E_2^{(3)})^6\\ \nonumber &-117 E_4 (E_2^{(3)})^4+93 E_6 (E_2^{(3)})^3+234 E_4 E_6 E_2^{(3)}-416 E_6^2\big)\phi_{-2}^7\phi_{0}^3-126 \big(6 (E_2^{(3)})^6\\ \nonumber &-39 E_4 (E_2^{(3)})^4+48 E_6 (E_2^{(3)})^3-28 E_4 E_6 E_2^{(3)}-16 E_6^2\big) \phi_{-2}^6\phi_{0}^4 -1512 E_4 E_6\phi_{-2}^5\phi_{0}^5\\ \nonumber &+42 E_2^{(3)} \big(3 (E_2^{(3)})^3-18 E_4 E_2^{(3)}+20 E_6\big) \phi_{-2}^4\phi_{0}^6+ 72 (E_2^{(3)} E_4-E_6)\phi_{-2}^3\phi_{0}^7\\ & + 27 E_4\phi_{-2}^2\phi_{0}^8-4 E_2^{(3)}\phi_{-2}\phi_{0}^9 -3 \phi_{0}^{10} \Big). \end{align} Here $\phi_{-2},\phi_0$ are short for $\phi_{-2,1}(3\tau,\epsilon_+),\phi_{0,1}(3\tau,\epsilon_+)$. We then check the modular ansatz results to $q^{16}$ against the twisted elliptic genera solved from the recursion formula. \paragraph{\underline{$\mathfrak{n}=6, E_6^{(2)}$}} For 6d pure $E_6^{(2)}$ theory, the general formula \eqref{MA} gives the following modular ansatz for its reduced twisted one-string elliptic genus \begin{equation} \mathbb{E}_1(\tau,\epsilon_+)=\frac{\Delta_4(\tau/2)^{\frac{3}{2}}\mathcal{N}(\tau,\epsilon_+)}{\eta(\tau)^{44}\phi_{-2,1}(\tau,2\epsilon_+)^8}. \end{equation} Here $\mathcal{N}(\tau,\epsilon_+)$ is of weight 0 and index 26. The $\mathcal{N}(2\tau,\epsilon_+)$ should be a $\Gamma_0(2)$ Jacobi form. Using the generators $E_2(\tau)^{(2)},E_4(2\tau)$ and $\phi_{-2,1}(2\tau,\epsilon_+),\phi_{0,1}(2\tau,\epsilon_+)$, we find there are 196 coefficients to fix $\mathcal{N}(2\tau,\epsilon_+)$. Indeed we find they can be fixed from the data up to $q^{13}$. We then check the modular ansatz results against the twisted elliptic genera solved from the recursion formula to $q^{14}$. The explicit formula for $\mathcal{N}(2\tau,\epsilon_+)$ is too long to show here. \paragraph{\underline{E-string}} The elliptic genera of E-strings have been studied in \cite{Haghighat:2014pva,Kim:2014dza,Cai:2014vka,Kim:2015fxa,Duan:2018sqe}. For a 6d theory with trivial gauge group in the tensor branch, there is no discrete symmetry from the automorphism of the gauge algebra. However, one can still consider discrete symmetries of the flavor algebra. A typical example is the E-string theory, where the flavor symmetry is the exceptional group $E_8$, for which we may find a rich class of discrete subgroups. The twisted circle compactification with such a discrete symmetry shall lead to a theory whose partition function is the same as the partition function of E-strings on a circle with a special choice of the Wilson line parameters. At first glance, it looks like these theories are boring, but as have been studied in \cite{Cota:2019cjx,Knapp:2021vkm}, their geometries, which are genus-one fibrations with $N$-sections, have very rich structures. Thus it is worthy to have a study on them. For example, let us do a $\mathbb{Z}_2$ twist to E-string theory formally. The twisted one-string elliptic genus is just \begin{equation} \mathbb{E}_1(\tau,\epsilon_+,m_i)=\frac{1}{2}\sum_{(r,s)=(1,4),(4,1)}^{(2,3),(3,2)}\prod_{i=1}^4\prod_{j=5}^8\frac{\theta_r(m_i)\theta_s(m_j)}{\eta^2} . \end{equation} Turning off the flavor parameters, the reduced twisted one-string elliptic genus is independent from $\epsilon_+$ and has the following nice modular ansatz as a special case of our general formula \eqref{MA}: \begin{equation} \mathbb{E}_1(\tau,\epsilon_+)=\frac{\theta_2^4\theta_3^4}{\eta^8}=\frac{16\Delta_4(\frac{\tau}{2})}{\eta^8} . \end{equation} It is easy to prove this identity. This has been also studied in the setting of Calabi-Yau threefolds with 2-sections in \cite{Cota:2019cjx}. \paragraph{\underline{$\mathfrak{n}=2,\mathfrak{su}(2)^{(2)}$}} This case is similar to the E-string theory, where the $\mathbb{Z}_2$ twist is only performed on the flavor parameters. From the general formula \eqref{MA}, we find the following modular ansatz \begin{equation}\label{MA:n2su2} \mathbb{E}_1(\tau,\epsilon_+)=\frac{ \mathcal{N}(\tau,\epsilon_+)}{\eta(\tau)^{-4}\Delta_4(\frac{\tau}{2})^{\frac{1}{2}}\phi_{-2,1}(\tau,2\epsilon_+)}. \end{equation} Here $\mathcal{N}(\tau,\epsilon_+)$ is of weight $-2$ and index 4. In the case, the $\mathcal{N}(2\tau,\epsilon_+)$ is a $\Gamma_0(2)$ Jacobi form. We fix it to be \begin{equation} \mathcal{N}(2\tau,\epsilon_+)=\frac{\phi _{-2}}{864} \big(E^{(2)}_2 \phi _{-2}-\phi _0\big) \left(2 (E^{(2)}_2)^2 \phi _{-2}^2-3 E_4 \phi _{-2}^2+2 E^{(2)}_2 \phi _0 \phi _{-2}-\phi _0^2\right). \end{equation} Recall $\phi_{-2}$ and $\phi_0$ are short for $\phi_{-2,1}(2\tau,\epsilon_+),\phi_{0,1}(2\tau,\epsilon_+)$. We have checked this modular ansatz against the localization formula \eqref{localizationn2su2z2} to $\mathcal{O}(q^{20})$. In fact, we find an even simpler form for the numerator: \begin{equation} \mathcal{N}(2\tau,\epsilon_+)=2\phi_{-2}(\epsilon_+)h(\epsilon_+)^2h(2\epsilon_+),\qquad h(\tau,z)=\frac{\theta_4(2\tau,z)}{\theta_4(2\tau)}. \end{equation} Here we notice that \begin{equation} E^{(2)}_2 \phi _{-2}-\phi _0=-12h(\epsilon_+)^2,\\ \end{equation} \begin{equation} 2 (E^{(2)}_2)^2 \phi _{-2}^2-3 E_4 \phi _{-2}^2+2 E^{(2)}_2 \phi _0 \phi _{-2}-\phi _0^2=-144h(2\epsilon_+). \end{equation} In summary, we find the following compact formula for the twisted one-string elliptic genus: \begin{equation} \mathbb{E}_1(\tau,\epsilon_+)=\frac{\theta_2(\tau)\theta_3(\tau)\eta(\tau)\theta_4(\tau,2\epsilon_+)}{\theta_2(\tau,\epsilon_+)^2\theta_3(\tau,\epsilon_+)^2}=\frac{2\eta(\tau)^5}{\eta(\frac{\tau}{2})^2}\frac{\theta_4(\tau,2\epsilon_+)}{\theta_2(\tau,\epsilon_+)^2\theta_3(\tau,\epsilon_+)^2} \end{equation} \paragraph{\underline{$\mathfrak{n}=2,\mathfrak{su}(3)^{(2)}$}} From the general formula \eqref{MA}, we have the following modular ansatz for its reduced twisted one-string elliptic genus \begin{equation}\label{MAn2su3z2} \mathbb{E}_1(\tau,\epsilon_+)=\frac{\mathcal{N}(\tau,\epsilon_+)}{\eta(\tau)^{-4}\Delta_8(\tau/4)^{\frac{1}{4}}\phi_{-2,1}(\tau,2\epsilon_+)}. \end{equation} Here $\mathcal{N}(\tau,\epsilon_+)$ is of weight $-2$ and index 3. We find that unlike the pure $\mathfrak{su}(3)^{(2)}$ case, now the $\mathcal{N}(\tau,\epsilon_+)$ does contain quarter $q$ orders. Therefore, there is no longer simplification to $\Gamma_0(2)$, i.e., the $\mathcal{N}(4\tau,\epsilon_+)$ should be a genuine $\Gamma_0(4)$ Jacobi form. Using the $\Gamma_0(4)$ modular generators $E_2(\tau)^{(2)},E_2^{(4)}(\tau)$ and $\phi_{-2,1}(4\tau,\epsilon_+),\phi_{0,1}(4\tau,\epsilon_+)$ given in Appendix \ref{app:B}, we find there are 6 parameters to fix the modular ansatz. By the known coefficients of $\mathcal{N}(4\tau,\epsilon_+)$ up to $q^6$, we determine it to be \begin{equation} \mathcal{N}(4\tau,\epsilon_+)=\frac{1}{288}\phi_{-2} \big( (E_2^{(2)}+3E_2^{(4)})\phi_{-2}-4\phi_{0} \big)\big( (E_2^{(2)}-3E_2^{(4)})\phi_{-2}+2\phi_{0} \big) . \end{equation} Here $\phi_{-2}$ and $\phi_0$ are short for $\phi_{-2,1}(4\tau,\epsilon_+),\phi_{0,1}(4\tau,\epsilon_+)$. We then check the modular ansatz against the results from blowup equations to $q^{16}$. In fact, we observe an even simpler form for the numerator: \begin{equation} \mathcal{N}(4\tau,\epsilon_+)=-4\phi_{-2,1}(4\tau,\epsilon_+)h(2\tau,\epsilon_+)^2h(\tau,\epsilon_+),\qquad h(\tau,z)=\frac{\theta_4(2\tau,z)}{\theta_4(2\tau)}. \end{equation} Here we notice that \begin{equation} (E_2^{(2)}-3E_2^{(4)})\phi_{-2}+2\phi_{0} =24h(2\tau,\epsilon_+)^2,\\ \end{equation} \begin{equation} (E_2^{(2)}+3E_2^{(4)})\phi_{-2}-4\phi_{0}=-48h(\tau,\epsilon_+). \end{equation} In summary, we find the following compact formula for the twisted one-string elliptic genus: \begin{equation} \mathbb{E}_1(\tau,\epsilon_+)=\frac{4\eta(\frac{\tau}{4})^2\theta_4(\frac{\tau}{2},\epsilon_+)}{\eta(\frac{\tau}{2})^2\theta_4(\frac{\tau}{2})}\Big(\frac{\theta_1(\tau,\epsilon_+)\theta_4(\tau,\epsilon_+)}{\theta_1(\tau,2\epsilon_+)\theta_4(\tau)}\Big)^2. \end{equation} \paragraph{\underline{$\mathfrak{n}=2,\mathfrak{su}(5)^{(2)}$}} From the general formula \eqref{MA}, we have the following modular ansatz for its reduced twisted one-string elliptic genus \begin{equation}\label{MAn2su5z2} \mathbb{E}_1(\tau,\epsilon_+)=\frac{\mathcal{N}(\tau,\epsilon_+)}{\eta(\tau)^{-4}\Delta_8(\tau/4)^{\frac{1}{4}}\phi_{-2,1}(\tau,2\epsilon_+)^2}. \end{equation} Here $\mathcal{N}(\tau,\epsilon_+)$ is of weight $-4$ and index 5. We find the $\mathcal{N}(4\tau,\epsilon_+)$ should be a $\Gamma_0(4)$ Jacobi form. Using the $\Gamma_0(4)$ modular generators $E_2(\tau)^{(2)},E_2^{(4)}(\tau)$ and $\phi_{-2,1}(4\tau,\epsilon_+),\phi_{0,1}(4\tau,\epsilon_+)$, we find there are 10 parameters to fix the modular ansatz. By the known coefficients of $\mathcal{N}(4\tau,\epsilon_+)$ up to $q^4$, we determine it to be \begin{equation} \mathcal{N}(4\tau,\epsilon_+)=-\frac{1}{1728}\phi_{-2}^2 \big( (E_2^{(2)}+3E_2^{(4)})\phi_{-2}-4\phi_{0} \big)\big( (E_2^{(2)}-3E_2^{(4)})\phi_{-2}+2\phi_{0} \big)^2 . \end{equation} Here $\phi_{-2}$ and $\phi_0$ are short for $\phi_{-2,1}(4\tau,\epsilon_+),\phi_{0,1}(4\tau,\epsilon_+)$. We then check the modular ansatz against the results from blowup equations to $q^{12}$. \paragraph{\underline{$\mathfrak{n}=1,\mathfrak{su}(3)^{(2)}$}} The twisted one-string elliptic genus has been solved from blowup equations in early sections and the Fourier coefficients have been shown in Table \ref{tab:bijn1su3z2}. From the general formula \eqref{MA}, we have the following modular ansatz \begin{equation}\label{MA:n1su3} \mathbb{E}_1(\tau,\epsilon_+)=\frac{\Delta_8^{\frac{5}{4}}({\tau}/{4}) \mathcal{N}(\tau,\epsilon_+)}{\eta^{8}\Delta_4^2({\tau}/{4})\phi_{-2,1}(\tau,2\epsilon_+)}. \end{equation} Here $\mathcal{N}(\tau,\epsilon_+)$ is of weight $0$ and index 2. Note there are both $\Delta_8$ and $\Delta_4$ which indicates that both $\Gamma_0(4)$ and $\Gamma_0(2)$ play a role. The $\mathcal{N}(4\tau,\epsilon_+)$ is a genuine $\Gamma_0(4)$ Jacobi form. Using the $\Gamma_0(4)$ modular generators $E_2(\tau)^{(2)},E_2^{(4)}(\tau)$ and $\phi_{-2,1}(4\tau,\epsilon_+),\phi_{0,1}(4\tau,\epsilon_+)$ given in Appendix \ref{app:B}, we find there are 6 parameters to fix for the modular ansatz of $\mathcal{N}(4\tau,\epsilon_+)$. Indeed, they are fixed by the known $q^{0,1,2}$ coefficients. We have \begin{equation} \mathcal{N}(4\tau,\epsilon_+)=\frac43 E_2^{(4)}\phi_{-2}\big( (E_2^{(2)}-3E_2^{(4)})\phi_{-2}+2\phi_{0} \big) . \end{equation} Here $\phi_{-2}$ and $\phi_0$ are short for $\phi_{-2,1}(4\tau,\epsilon_+),\phi_{0,1}(4\tau,\epsilon_+)$. We then check the modular ansatz against the twisted elliptic genera solved from blowup equations to $q^{16}$ order. \paragraph{\underline{$\mathfrak{n}=1,\mathfrak{so}(8)^{(3)}$}} In the end we show one example of $\mathbb{Z}_3$ twist which is the only case we encounter in the current work that the modular group must be $\Gamma_1(N)$ instead of $\Gamma_0(N)$. This is the $\mathfrak{so}(8)^{(3)}$ theory with $\mathfrak{n}=1$. The general formula \eqref{MA} gives the following modular ansatz for its reduced twisted one-string elliptic genus \begin{equation} \mathbb{E}_1(\tau,\epsilon_+)=\frac{\Delta_6(\tau/3)^{\frac{1}{6}}\mathcal{N}(\tau,\epsilon_+)}{\eta(\tau)^{8}\phi_{-2,1}(\tau,2\epsilon_+)^3}. \end{equation} Here $\mathcal{N}(\tau,\epsilon_+)$ is of weight $-3$ and index 7. Due to the odd weight, the $\mathcal{N}(3\tau,\epsilon_+)$ must be a $\Gamma_1(3)$ Jacobi form instead of a $\Gamma_0(3)$ one. Using the generators $E_2(\tau)^{(3)}$, $E_4(3\tau)$, $E_3^{(a)}(\tau)$, $E_3^{(b)}(\tau)$ and $\phi_{-2,1}(3\tau,\epsilon_+),\phi_{0,1}(3\tau,\epsilon_+)$ given in Appendix \ref{app:B}, we find there are 26 coefficients to fix $\mathcal{N}(3\tau,\epsilon_+)$. Indeed they can be fixed from the data up to $q^3$ up to the vanishing relations \eqref{relationgen3a}. We have \begin{align}\nonumber \mathcal{N}(3\tau,\epsilon_+)=&-\frac{\phi_{-2}^3}{186624}\Big( E_2^{(3)} \big(19 (E_2^{(3)})^3 E_3^{(a)}\!+450 (E_2^{(3)})^3 E_3^{(b)}\!-45 E_4 E_2^{(3)} E_3^{(a)}\!-64 (E_3^{(a)})^3\big)\phi_{-2}^4\\ \nonumber &\ +6 \big(17 (E_2^{(3)})^3 E_3^{(a)}-342 (E_2^{(3)})^3 E_3^{(b)}+45 E_4 E_2^{(3)} E_3^{(a)}+16 (E_3^{(a)})^3\big) \phi_{-2}^3\phi_0\\ \nonumber &\ -27 \big(21 (E_2^{(3)})^2 E_3^{(a)}-72 (E_2^{(3)})^2 E_3^{(b)}+11 E_4 E_3^{(a)}\big) \phi_{-2}^2\phi_0^2+36 E_2^{(3)} (19 E_3^{(a)}\\ &\ +69 E_3^{(b)})\phi_{-2}\phi_0^3 -18 (11 E_3^{(a)}+189 E_3^{(b)})\phi_0^4 \Big). \end{align} We then checked it to $q^{11}$ order against the twisted elliptic blowup equations and found perfect agreement. \subsection{Full modular ansatz with gauge fugacities} It is also interesting to consider the full modular ansatz with gauge fugacities. For untwisted 6d $(1,0)$ SCFTs, this has been studied in \cite{DelZotto:2017mee} for pure $\mathfrak{su}(3)$ and $\mathfrak{so}(8)$ theories, see also \cite{Kim:2018gak,Duan:2020imo}. The denominator of the modular ansatz of reduced one-string elliptic genus involves the block \begin{equation} \prod_{\alpha\in\Delta_l^+(G)}\theta_1(m_{\alpha}\pm2\epsilon_+). \end{equation} This is natural as all the poles of elliptic genera are associated to the 5d states related to the long roots of $G$. Analogously for twisted theories, given the understanding on 5d circle reduction theory, it is reasonable to expect the the denominator of the modular ansatz for twisted one-string elliptic genera involves the block \begin{equation} \prod_{\alpha\in\Delta_l^+(\mathring{G})}\theta_1(m_{\alpha}\pm2\epsilon_+), \end{equation} where $\Delta_l^+$ is the long positive roots of $\mathring{G}$. More precisely, we propose the following full modular ansatz for the reduced one-string twisted elliptic genera: \begin{equation}\label{MAfull} \mathbb{E}_1(\tau,\epsilon_+,m_{\mathring{G}},m_{\mathring{F}})=\frac{ \mathcal{N}(\tau,\epsilon_+,m_{\mathring{G}},m_{\mathring{F}})}{\eta^{12(\mathfrak{n}-2)-4+24\delta_{\mathfrak{n},1}}\Delta_{2N}(\frac{\tau}{N})^{s}\prod_{\alpha\in\Delta_l^+(\mathring{G})}\phi_{-1,1/2}(m_{\alpha}\pm2\epsilon_+)}, \end{equation} where the $s$ is defined the same as in \eqref{eq:s}. The $\phi_{-1,1/2}(\tau,z):=\phi_{-2,1}(\tau,z)^{1/2}$ is a Jacobi form with weight $-1$ and index $1/2$. The weight and index of $\mathcal{N}(\tau,\epsilon_+,m_{\mathring{G}},m_{\mathring{F}})$ should be coordinated with the weight 0 and index \eqref{eq:twistedEd-index} of the $\mathbb{E}_1(\tau,\epsilon_+,m_{\mathring{G}},m_{\mathring{F}})$. In general, for twist coefficient $N$, the $\mathcal{N}(N\tau,\epsilon_+,m_{\mathring{G}},m_{\mathring{F}})$ should be a $\Gamma_1(N)$ Jacobi form of multi elliptic variables. In principle, one can fix the numerator by the $M_*(N)$ modular generators, the $\phi_{-2,1}(N\tau,\epsilon_+),\phi_{0,1}(N\tau,\epsilon_+)$ generators, the generators of $\mathring{G}$ Weyl invariant weak Jacobi forms and the generators of $\mathring{F}$ Weyl invariant weak Jacobi forms all together. We give a simple example here, which is the pure $\mathfrak{su}(3)^{(2)}$ theory with $\mathfrak{n}=3$. The low energy algebra is $\mathring{G}=\mathfrak{sp}(1)$. We have the following anstaz for the reduced one-string elliptic genus with $\mathfrak{sp}(1)$ fugacity $m$ as \begin{equation}\label{MAsu3z2f} \mathbb{E}_1(\tau,\epsilon_+,m)=\frac{\Delta_8(\tau/4)^{\frac{1}{4}}\mathcal{N}(\tau,\epsilon_+,m)}{\eta(\tau)^{2}\theta_1(2m\pm2\epsilon_+)}. \end{equation} Here $\mathcal{N}(\tau,\epsilon_+,m)$ has weight 0 and index 4 for $\epsilon_+$ and index 1 for $m$. We find the $\mathcal{N}(4\tau,\epsilon_+,m)$ is a $\Gamma_0(4)$ Jacobi form with two elliptic variables. Using the $\Gamma_0(4)$ modular generators $E_2(\tau)^{(2)},E_2^{(4)}(\tau)$ and $\phi_{-2,1}(4\tau,\epsilon_+),\phi_{0,1}(4\tau,\epsilon_+)$ and $\phi_{-2,1}(4\tau,m),\phi_{0,1}(4\tau,m)$ given in Appendix \ref{app:B}, we find there are 35 parameters to fix for the modular ansatz of $\mathcal{N}(4\tau,\epsilon_+,m)$. Indeed, they are fixed by the known coefficients up to $q^5$. We have \begin{align}\nonumber \mathcal{N}(4\tau,\epsilon_+,m)= &\,\frac{1}{127401984} \Big((5E_2^{(2)}-9E_2^{(4)}) \varphi_{-2}+4\varphi_0 \Big)\Big( \big((E_2^{(2)})^4+636 E_2^{(4)} (E_2^{(2)})^3\\ \nonumber &-3834 (E_2^{(4)})^2 (E_2^{(2)})^2+8316 (E_2^{(4)})^3 E_2^{(2)}-6399 (E_2^{(4)})^4\big) \phi_{-2}^4 -16 \big((E_2^{(2)})^3\\ \nonumber &-117 E_2^{(4)} (E_2^{(2)})^2+567 (E_2^{(4)})^2 E_2^{(2)}-675 (E_2^{(4)})^3\big) \phi_{-2}^3\phi_{0} +96 \big((E_2^{(2)})^2\\ \nonumber &+30 E_2^{(4)} E_2^{(2)}-63 (E_2^{(4)})^2\big) \phi_{-2}^2\phi_{0}^2 -256 (E_2^{(2)}-3 E_2^{(4)}) \phi_{-2}\phi_{0}^3+256 \phi _{0}^4 \Big). \end{align} Here $\varphi_{-2},\varphi_0$ are short for $\phi_{-2,1}(4\tau,m),\phi_{0,1}(4\tau,m)$, while $\phi_{-2},\phi_0$ are short for $\phi_{-2,1}(4\tau,\epsilon_+)$ and $\phi_{0,1}(4\tau,\epsilon_+)$. We then check the modular ansatz against the twisted elliptic genera from 2d localization formula to $q^{10}$ order. Note in $\mathcal{N}(4\tau,\epsilon_+,m)$ the $m$ and $\epsilon_+$ dependence naturally factorizes. This is expected as there is no $m\epsilon_+$ term in its index quadratic form. \section{Twisting from Higgsing}\label{sec:higgsing} Many twisted 6d $(1,0)$ SCFTs can be Higgsed from untwisted 6d $(1,0)$ SCFTs \cite{Kim:2019dqn,Hayashi:2021pcj}. Most previously known examples are recognized from brane webs. In particular, many examples of twisting from Higgsing of $\mathfrak{so}$ type with $\mathfrak{n}=2,3,4$ were discussed in \cite{Kim:2019dqn}. In this section, we systematically study all possible twisting from Higgsing among rank-one theories and propose a simple method to obtain the precise Higgsing condition that does not rely on brane webs, but only on Lie algebra representations and their decompositions. A primary condition to establish a Higgsing is that the two theories must have the same tensor coefficients $\mathfrak{n}$. Suppose we want to establish a Higgsing from an untwisted theory with gauge group $\mathcal{G}$ to a twisted theory $G^{(n)}$ with low energy gauge group $\mathring{G}$. Our trick is to perform the decomposition \begin{equation} \mathcal{G}\to \mathring{G}\times H_{res}. \end{equation} Here the residue group $H_{res}$ is either $\mathfrak{su}(2)$ or $\mathfrak{so}(2)$ for $\mathbb{Z}_2$ twist, or $\mathfrak{su}(3)$ for $\mathbb{Z}_3$ twist. The Higgsing to twisted theory can be achieved by discretizing $H_{res}$, i.e., to take its continuous fugacities as some fractions of $\tau$. In the meantime, some mass parameters of the hypermulitplets of the untwisted theory must be taken as some delicate linear combinations of $\epsilon_+$ and $\tau$ to produce the correct one-loop partition function of the twisted theory. We find all previously known examples of twisting from Higgsing fall into this paradigm. For example, the $\mathbb{Z}_2$ twisted pure $\mathfrak{su}(3)$ can be obtained from Higgsing of $G_2+\bf F$ theory. Here we show this from a purely algebraic viewpoint. Consider the decomposition $G_2\to\mathfrak{su}(2)\times \mathfrak{su}(2)$, we have the following representation decompositions \begin{align} & \mathbf{14}\rightarrow (\mathbf{2},\mathbf{4})+(\mathbf{3},\mathbf{1})+(\mathbf{1},\mathbf{3}),\qquad\mathbf{7}\rightarrow (\mathbf{1},\mathbf{3})+(\mathbf{2},\mathbf{2}). \end{align} The Higgsing process can be realized by simply discretizing the second $\mathfrak{su}(2)$, which we have presented in \eqref{eq:higgsG2A2}. To check the one-loop part, it is only necessary to study the function $f(\epsilon_+,m_{G},m_F,q)$ inside the vector multiplet partition function \begin{equation} \mathrm{PE}\left(\frac{f(\epsilon_+,m_{G},m_F,q)}{\big(q_1^{1/2}-q_1^{-1/2}\big)\big(q_2^{1/2}-q_2^{-1/2}\big)(1-q)}\right). \end{equation} Under analytic continuations, we have \begin{equation}\nonumber \begin{aligned} &\phantom{=}\left(-v\chi_{\bf 14}^{G_2}+e^{m}\chi_{\bf 7}^{G_2}\right)\Big|_{Higgsing}\\ &\sim -v\left(\chi_{\bf 3}^{A_1}+\chi_{\bf 2}^{A_1}(q^{3/4}+q^{1/4}+q^{-1/4}+q^{-3/4}) \right)+vq^{-1/2}\left(\chi_{\bf 2}^{A_1}(q^{1/4}+q^{-1/4}) \right) ,\\ &= -v\left(\chi_{\bf 3}^{A_1}+\chi_{\bf 2}^{A_1}q^{1/4}+\chi_{\bf 2}^{A_1}q^{3/4} \right) . \end{aligned} \end{equation} Here we have dropped those gauge singlets by $\sim$. This computation shows that the Higgsing indeed gives the required one-loop part of the twisted $\mathfrak{su}(3)^{(2)}$ theory. A known infinite series of twisting from Higgsing is from $\mathfrak{so}(2k+9)+(2k+1)\mathbf{V} $ to the $\mathbb{Z}_2$ twist of $\mathfrak{so}(2k+8)+2k\mathbf{V}$ with $k=0,1,2,\dots$. This type of Higgsing has been discussed from the viewpoint of brane webs in Section 5 of \cite{Kim:2019dqn}. Since the low energy gauge algebra of $\mathfrak{so}(2k+8)^{(2)}$ is $\mathfrak{so}(2k+7)$, we can consider the decomposition $\mathfrak{so}(2k+9)\to \mathfrak{so}(2k+7)\times \mathfrak{so}(2)$. Let us just regard the $\mathfrak{so}(2)$ as $\mathfrak{u}(1)$. It is useful to remark the following representation decompositions \begin{equation} \bf Adj\to (Adj+1)_{0}+V_{\pm2} ,\qquad V\to V_{0}+1_{\pm2}. \end{equation} To be precise, we find the Higgsing condition is \begin{equation} m_{\mathfrak{u}(1)}\to \frac{\tau}{4},\qquad m_{j}\to m_{j},\ m_{j+k}\to m_{j}+\frac{\tau}{2},\ j=1,2,\dots,k,\quad m_{{\mathbf V}_{2k+1}}\to \epsilon_+-\frac{\tau}{2}. \end{equation} Here we have used the orthogonal bases of $\mathfrak{so}(2n+1)$ algebras such that the character of vector represention is $\chi_{\bf V}=1+\sum_{i=1}^nQ_i^{\pm 1}$. During the decomposition $m_{\mathfrak{u}(1)}=2\log(Q_{k+4})$. For the one-loop function, we have \begin{align}\nonumber &\phantom{=}\bigg(-v\chi_{\bf Adj}^{\mathfrak{so}(2k+9)}+\chi_{\bf V}^{\mathfrak{so}(2k+9)}\sum_{i=1}^{2k+1}e^{m_i}\bigg)\Big|_{Higgsing}\\ \nonumber &\sim -v\left(\chi_{\bf Adj}^{\mathfrak{so}(2k+7)}+\chi_{\bf V}^{\mathfrak{so}(2k+7)}(q^{-1/2}+q^{1/2}) \right)+vq^{-1/2}\chi_{\bf V}^{\mathfrak{so}(2k+7)}+ \chi_{\bf V}^{\mathfrak{so}(2k+7)}(1+q^{1/2})\sum_{i=1}^k e^{m_i} ,\\ &= -v\left(\chi_{\bf Adj}^{\mathfrak{so}(2k+7)}+\chi_{\bf V}^{\mathfrak{so}(2k+7)}q^{1/2} \right)+ \chi_{\bf V}^{\mathfrak{so}(2k+7)}(1+q^{1/2})\sum_{i=1}^k e^{m_i} . \end{align} This shows that the above Higgsing indeed produces the correct one-loop part of the $\mathfrak{so}(2k+8)^{(2)}$ twisted theory. It is also easy to check the elliptic genera obtained from the above Higgsing is precisely the same with expression from 2d localization. The Higgsing trees for $\mathbb{Z}_2$ twisted $\mathfrak{so}$ theories with $\mathfrak{n}=2,3,4$ have been mostly studied in \cite{Kim:2019dqn} using brane webs. We find more examples by our algebraic procedure, and collect the $\mathfrak{n}=4$ Higgsing tree in Figure \ref{higgsingtree4}, $\mathfrak{n}=3$ Higgsing tree in Figure \ref{higgsingtree3} and $\mathfrak{n}=2$ Higgsing tree in Figure \ref{higgsingtree2}. For $\mathbb{Z}_2$ twisted $\mathfrak{so}$ theories with $\mathfrak{n}=1$, it is not easy to find the brane webs. We use our new method to propose the $\mathfrak{n}=1$ Higgsing tree in Figure \ref{higgsingtree1}. \begin{figure}[h] \centering \hspace{-0.3cm} \begin{tikzpicture} \tikzset{block/.style={draw, align=center, inner sep=0.7mm}}; \node (SO11) [block] { $\,\mathfrak{so}(11)+3\mathbf{V}\!\!$ }; \node (SO12b) [block, above = 0.5cm of SO11] { $\,\mathfrak{so}(12)+4\mathbf{V}\!\!$ }; \node (SO12bZ2) [block, right = 1.5cm of SO12b] { $(\mathfrak{so}(12)+4\mathbf{V})/\mathbb{Z}_2\!\!$ }; \node (SO13) [block, above = 0.5cm of SO12b] { $\,\mathfrak{so}(13)+5\mathbf{V}\!\!$ }; \node (SOn) [block, above = 0.5cm of SO13] { $\,\mathfrak{so}(8+m)+m\mathbf{V}\!\!$ }; \node (SO10) [block, below = 0.5cm of SO11] { $\,\mathfrak{so}(10)+2\mathbf{V}\!\!$ }; \node (SO10Z2) [block, right = 3.5cm of SO10] { $(\mathfrak{so}(10)+2\mathbf{V})/\mathbb{Z}_2\!\!$ }; \node (E7) [block, left = 0.9cm of SO11] { $E_7+2\bf F\!\!$ }; \node (SO9) [block, below = 0.5cm of SO10] { $\,\mathfrak{so}(9)+\mathbf{V}\!\!$ }; \node (E6) [block, left = 0.5cm of SO10] { $E_6+2\bf F\!\!$ }; \node (SO8) [block, below = 0.5cm of SO9] { $\,\mathfrak{so}(8)\!\!$ }; \node (F4) [block, left = 0.3cm of SO9] { $F_4+{\bf F}\!\!$ }; \node (E6Z2) [block, right = 0.8cm of SO10] { $(E_6+2{\bf F})/\mathbb{Z}_2\!\!$ }; \node (SO8Z2) [block, right = 1.75cm of SO8] { $\,\mathfrak{so}(8)/\mathbb{Z}_2\!\!$ }; \node (SO8Z3) [block, right = 1.7cm of SO8Z2] { $\,\mathfrak{so}(8)/\mathbb{Z}_3\!\!$ }; \draw[-latex](SO11) -- (SO10); \draw[-latex](SO11) -- (SO10Z2); \draw[-latex](SO12b) -- (SO11); \draw[-latex](SO10) -- (SO9); \draw[-latex](E7) -- (E6); \draw[-latex](E6) -- (F4); \draw[-latex](F4) -- (SO8); \draw[-latex](SO9) -- (SO8); \draw[-latex](SO9) -- (SO8Z2); \draw[-latex](E6) -- (SO8Z3); \draw[-latex](SOn) -- (SO13); \draw[-latex](SO13) -- (SO12b); \draw[-latex](SO13) -- (SO12bZ2); \draw[-latex](SO12bZ2) -- (SO10Z2); \draw[-latex](SO10Z2) -- (SO8Z2); \draw[-latex](E6Z2) -- (SO8Z2); \draw[-latex](E7) -- (E6Z2); \end{tikzpicture} \caption{Higgsing tree for untwisted/twisted 6d $(1,0)$ SCFTs on with $\mathfrak{n}=4$. } \label{higgsingtree4} \end{figure} \begin{figure}[] \centering \hspace{-0.3cm} \begin{tikzpicture} \tikzset{block/.style={draw, align=center, inner sep=0.7mm}}; \node (SO11) [block] { $\,\mathfrak{so}(11)+4\mathbf{V}+\frac12\bf S\!\!$ }; \node (SO12b) [block, above = 0.5cm of SO11] { $\,\mathfrak{so}(12)+5\mathbf{V}+\frac12\mathbf{S}\!\!$ }; \node (SO10) [block, below = 0.5cm of SO11] { $\,\mathfrak{so}(10)+3\mathbf{V}+\bf S\!\!$ }; \node (SO10Z2) [block, right = 3.4cm of SO10] { $(\mathfrak{so}(10)+3\mathbf{V}+{\bf S})/\mathbb{Z}_2\!\!$ }; \node (E7) [block, left = 0.9cm of SO11] { $E_7+\frac52\bf F\!\!$ }; \node (SO9) [block, below = 0.5cm of SO10] { $\,\mathfrak{so}(9)+2\mathbf{V}+\bf S\!\!$ }; \node (E6) [block, left = 0.5cm of SO10] { $E_6+3\bf F\!\!$ }; \node (SO8) [block, below = 0.5cm of SO9] { $\,\mathfrak{so}(8)\!+\!\mathbf{V}\!+\!{\bf S}\!+\!{\bf C}\!\!$ }; \node (F4) [block, left = 0.3cm of SO9] { $F_4+2{\bf F}\!\!$ }; \node (E6Z2) [block, right = 0.8cm of SO10] { $(E_6+3{\bf F})/\mathbb{Z}_2\!\!$ }; \node (SO8Z2) [block, right = 0.5cm of SO8] { $(\mathfrak{so}(8)\!+\!\mathbf{V}\!+\!{\bf S}\!+\!{\bf C})/\mathbb{Z}_2\!\!$ }; \node (SO8Z3) [block, right = 0.2cm of SO8Z2] { $(\mathfrak{so}(8)\!+\!\mathbf{V}\!+\!{\bf S}\!+\!{\bf C})/\mathbb{Z}_3\!\!$ }; \node (SO7) [block, below = 0.5cm of SO8] { $\,\mathfrak{so}(7)+2\mathbf{S}\!\!$ }; \node (G2) [block, below = 0.5cm of SO7] { $\,G_2+\mathbf{F}\!\!$ }; \node (SU3) [block, below = 0.5cm of G2] { $\,\mathfrak{su}(3)\!\!$ }; \node (SU3Z2) [block, right = 2.6cm of SU3] { $\,\mathfrak{su}(3)/\mathbb{Z}_2\!\!$ }; \draw[-latex](SO11) -- (SO10); \draw[-latex](SO11) -- (SO10Z2); \draw[-latex](SO12b) -- (SO11); \draw[-latex](SO10) -- (SO9); \draw[-latex](E7) -- (E6); \draw[-latex](E6) -- (F4); \draw[-latex](F4) -- (SO8); \draw[-latex](SO9) -- (SO8); \draw[-latex](SO9) -- (SO8Z2); \draw[-latex](SO8) -- (SO7); \draw[-latex](SO7) -- (G2); \draw[-latex](G2) -- (SU3); \draw[-latex](G2) -- (SU3Z2); \draw[-latex](E6) -- (SO8Z3); \draw[-latex](SO10Z2) -- (SO8Z2); \draw[-latex](SO8Z2) -- (SU3Z2); \draw[-latex](E6Z2) -- (SO8Z2); \draw[-latex](E7) -- (E6Z2); \end{tikzpicture} \caption{Higgsing tree for untwisted/twisted 6d $(1,0)$ SCFTs on with $\mathfrak{n}=3$. } \label{higgsingtree3} \end{figure} \begin{figure}[] \centering \hspace{-0.3cm} \begin{tikzpicture} \tikzset{block/.style={draw, align=center, inner sep=0.7mm}}; \node (SO11) [block] { $\,\mathfrak{so}(11)+5\mathbf{V}+\bf S\!\!$ }; \node (SO12b) [block, above = 0.5cm of SO11] { $\,\mathfrak{so}(12)+6\mathbf{V}+\frac12\mathbf{S}+\frac12\bf C\!\!$ }; \node (SO12bZ2) [block, right = 1.0cm of SO12b] { $(\mathfrak{so}(12)+6\mathbf{V}+\frac12\mathbf{S}+\frac12{\bf C})/\mathbb{Z}_2\!\!$ }; \node (SO13) [block, above = 0.5cm of SO12b] { $\,\mathfrak{so}(13)+7\mathbf{V}+\frac12\mathbf{S}\!\!$ }; \node (SO12a) [block, left = 0.1cm of SO12b] { $\,\mathfrak{so}(12)+6\mathbf{V}+\bf S\!\!$ }; \node (SO10) [block, below = 0.5cm of SO11] { $\,\mathfrak{so}(10)+4\mathbf{V}+2\bf S\!\!$ }; \node (SO10Z2) [block, right = 3.4cm of SO10] { $(\mathfrak{so}(10)+4\mathbf{V}+2{\bf S})/\mathbb{Z}_2\!\!$ }; \node (E7) [block, left = 0.9cm of SO11] { $E_7+3\bf F\!\!$ }; \node (SO9) [block, below = 0.5cm of SO10] { $\,\mathfrak{so}(9)+3\mathbf{V}+2\bf S\!\!$ }; \node (E6) [block, left = 0.5cm of SO10] { $E_6+4\bf F\!\!$ }; \node (F4) [block, left = 0.1cm of SO9] { $F_4+3{\bf F}\!\!$ }; \node (SO8) [block, below = 0.5cm of F4] { $\,\mathfrak{so}(8)+2\mathbf{V}+2{\bf S}+2{\bf C}\!\!$ }; \node (E6Z2) [block, right = 0.7cm of SO10] { $(E_6+4{\bf F})/\mathbb{Z}_2\!\!$ }; \node (SO8Z2) [block, right = 0.3cm of SO8] { $(\mathfrak{so}(8)+2\mathbf{V}+2{\bf S}+2{\bf C})/\mathbb{Z}_2\!\!$ }; \node (SO8Z3) [block, right = 0.3cm of SO8Z2] { $(\mathfrak{so}(8)+2\mathbf{V}+2{\bf S}+2{\bf C})/\mathbb{Z}_3\!\!$ }; \node (SO7) [block, below = 1.5cm of SO9] { $\,\mathfrak{so}(7)+\mathbf{V}+4{\bf S}\!\!$ }; \node (G2) [block, below = 0.5cm of SO7] { $G_2+4\mathbf{F}\!\!$ }; \node (SUNZ2) [block, right = 3.5cm of SO7] { $(\mathfrak{su}(N)+2N\mathbf{F})/\mathbb{Z}_2\!\!$ }; \node (SU4) [block, left = 0.5cm of G2] { $\,\mathfrak{su}(4)+8\mathbf{F}\!\!$ }; \node (SUN) [block, left = 0.7cm of SO7] { $\mathfrak{su}(N)+2N\mathbf{F}\!\!$ }; \node (SU3) [block, below = 0.5cm of G2] { $\,\mathfrak{su}(3)+6\mathbf{F}\!\!$ }; \node (SU4Z2) [block, right = 3.0cm of G2] { $(\mathfrak{su}(4)+8\mathbf{F})/\mathbb{Z}_2\!\!$ }; \node (SU3Z2) [block, below = 0.5cm of SU4Z2] { $(\mathfrak{su}(3)+6\mathbf{F})/\mathbb{Z}_2\!\!$ }; \node (Sp1) [block, below = 0.5cm of SU3] { $\,\mathfrak{su}(2)+4\mathbf{F}\!\!$ }; \node (SU2Z2) [block, below = 0.5cm of SU3Z2] { $(\mathfrak{su}(2)+4\mathbf{F})/\mathbb{Z}_2\!\!$ }; \node (E) [block, below = 0.5cm of Sp1] { \ M-string }; \draw[-latex](SO11) -- (SO10); \draw[-latex](SO11) -- (SO10Z2); \draw[-latex](SO12a) -- (SO11); \draw[-latex](SO12b) -- (SO11); \draw[-latex](SO10) -- (SO9); \draw[-latex](E7) -- (E6); \draw[-latex](E6) -- (F4); \draw[-latex](F4) -- (SO8); \draw[-latex](SO9) -- (SO8); \draw[-latex](SO9) -- (SO8Z2); \draw[-latex](SO8) -- (SO7); \draw[-latex](SO7) -- (G2); \draw[-latex](SO7) -- (SU4); \draw[-latex](SO7) -- (SU4Z2); \draw[-latex](G2) -- (SU3); \draw[-latex](SU4) -- (SU3); \draw[-latex](SUN) -- (SU4); \draw[-latex](G2) -- (SU3Z2); \draw[-latex](SU3) -- (Sp1); \draw[-latex](Sp1) -- (E); \draw[-latex](SO13) -- (SO12b); \draw[-latex](SO13) -- (SO12bZ2); \draw[-latex](SO12bZ2) -- (SO10Z2); \draw[-latex](SO10Z2) -- (SO8Z2); \draw[-latex](SO8Z2) -- (SU4Z2); \draw[-latex](SU4Z2) -- (SU3Z2); \draw[-latex](SUNZ2) -- (SU4Z2); \draw[-latex](SU3Z2) -- (SU2Z2); \draw[-latex](E6Z2) -- (SO8Z2); \draw[-latex](E7) -- (E6Z2); \draw[-latex](E6) -- (SO8Z3); \end{tikzpicture} \caption{Higgsing tree for untwisted/twisted 6d $(1,0)$ SCFTs with $\mathfrak{n}=2$. } \label{higgsingtree2} \end{figure} \begin{figure}[] \centering \hspace{-0.3cm} \begin{tikzpicture} \tikzset{block/.style={draw, align=center, inner sep=0.7mm}}; \node (SO11) [block] { $\,\mathfrak{so}(11)+6\mathbf{V}+\frac{3}{2}\bf S$ }; \node (SO12a) [block, above = 0.5cm of SO11] { $\,\mathfrak{so}(12)+7\mathbf{V}+\frac32\bf S$ }; \node (SO12b) [block, right = 0.2cm of SO12a] { $\,\mathfrak{so}(12)+7\mathbf{V}+\mathbf{S}+\frac12\bf C$ }; \node (SO10) [block, below = 0.5cm of SO11] { $\,\mathfrak{so}(10)+5\mathbf{V}+3\bf S$ }; \node (E6) [block, left = 0.4cm of SO10] { $E_6+5\bf F\!\!$ }; \node (E6Z2) [block, right = 0.2cm of SO10] { $(E_6+5{\bf F})/\mathbb{Z}_2\!\!$ }; \node (E7) [block, left = 0.5cm of SO11] { $E_7+\frac{7}{2}\bf F\!\!$ }; \node (SO10Z2) [block, right = 3.3cm of SO10] { $(\mathfrak{so}(10)+5\mathbf{V}+3{\bf S})/\mathbb{Z}_2$ }; \node (SO9) [block, below = 0.5cm of SO10] { $\,\mathfrak{so}(9)+4\mathbf{V}+3\bf S\!\!$ }; \node (F4) [block, left = 0.1cm of SO9] { $F_4+4{\bf F}\!\!$ }; \node (SO8) [block, below = 0.5cm of F4] { $\,\mathfrak{so}(8)+3\mathbf{V}+3{\bf S}+3{\bf C}\!\!$ }; \node (SO8Z2) [block, right = 0.4cm of SO8] { $(\mathfrak{so}(8)+3\mathbf{V}+3{\bf S}+3{\bf C})/\mathbb{Z}_2\!\!$ }; \node (SO8Z3) [block, right = 0.4cm of SO8Z2] { $(\mathfrak{so}(8)+3\mathbf{V}+3{\bf S}+3{\bf C})/\mathbb{Z}_3\!\!$ }; \node (SO7) [block, below = 1.5cm of SO9] { $\,\mathfrak{so}(7)+2\mathbf{V}+6{\bf S}$ }; \node (G2) [block, below = 0.5cm of SO7] { $\,G_2+7\mathbf{F}$ }; \node (SU3) [block, below = 0.5cm of G2] { $\,\mathfrak{su}(3)+12\mathbf{F}$ }; \node (SU3Z2) [block, right = 2.5cm of SU3] { $(\mathfrak{su}(3)+12\mathbf{F})/\mathbb{Z}_2$ }; \node (Sp1) [block, below = 0.5cm of SU3] { $\,\mathfrak{sp}(1)+10\mathbf{F}$ }; \node (E) [block, below = 0.5cm of Sp1] { E-string }; \node (EZ2) [block, below = 1.5cm of SU3Z2] { E-string$/\mathbb{Z}_2\!\!$ }; \draw[-latex](SO11) -- (SO10); \draw[-latex](SO11) -- (SO10Z2); \draw[-latex](SO12a) -- (SO11); \draw[-latex](SO12b) -- (SO11); \draw[-latex](SO10) -- (SO9); \draw[-latex](SO9) -- (SO8); \draw[-latex](SO9) -- (SO8Z2); \draw[-latex](SO8) -- (SO7); \draw[-latex](SO7) -- (G2); \draw[-latex](G2) -- (SU3); \draw[-latex](G2) -- (SU3Z2); \draw[-latex](SU3) -- (Sp1); \draw[-latex](Sp1) -- (E); \draw[-latex](SO10Z2) -- (SO8Z2); \draw[-latex](SO8Z2) -- (SU3Z2); \draw[-latex](SU3Z2) -- (EZ2); \draw[-latex](E7) -- (E6); \draw[-latex](E6) -- (F4); \draw[-latex](F4) -- (SO8); \draw[-latex](E7) -- (E6Z2); \draw[-latex] (E6Z2) -- (SO8Z2); \draw[-latex](E6) -- (SO8Z3); \end{tikzpicture} \caption{Higgsing tree for untwisted/twisted 6d $(1,0)$ SCFTs on with $\mathfrak{n}=1$. } \label{higgsingtree1} \end{figure} Our method can also be used to rule out some potential Higgsing. For example, we notice that the $\mathfrak{n}=2$, $\mathfrak{su}(N)$ theory cannot be Higgsed to $\mathfrak{n}=2$, $\mathfrak{su}(N-1)^{(2)}$ twisted theory. The reason is that the $\bf Adj$ and $\bf \Lambda^2$ of $\mathfrak{su}(N)$ always have the same KK charge $0$ under representation decompositions, thus can not produce the required one-loop function of the $\mathfrak{su}(N-1)^{(2)}$ twisted theory. The Higgsing of elliptic blowup equations for 6d $(1,0)$ SCFTs have been discussed in Section 3.3 of \cite{Gu:2020fem}. For the twisted cases, the Higgsing is just similar. The Higgsing conditions can be taken directly in the elliptic genera as well as the (twisted) elliptic blowup equations, at least for the unity ones. It is easy to check that the characteristic $a$ and value $y$ of elliptic blowup equations are consistent with the Higgsing. In the following, we pick some interesting examples of twisting from Higgsing to show our algebraic approach and give the precise Higgsing conditions. \subsection{Higgsing from untwisted to twisted theories} \subsubsection{$E_7\to E_6^{(2)}$} A series of interesting examples of twisting from Higgising is the $E_7\to E_6^{(2)}$ type for $\mathfrak{n}=6,5,4,3,2,1$. Let us start with the simplest case $\mathfrak{n}=6$, i.e., Higgsing $E_7+\mathbf{F}\rightarrow E_6^{(2)}.$ The flavor algebra of $E_7+\mathbf{F}$ theory is $\mathfrak{so}(2)_{12}$. To write down the precise Higgsing condition, we first decompose $E_7\to F_4\times \mathfrak{su}(2)$. It is useful to remark the following representation decompositions \begin{equation} \mathbf{133}\to \bf (1,3)+(26,3)+(52,1),\qquad 56\to (1,4)+(26,2). \end{equation} We find the Higgsing can be taken by discretizing the $\mathfrak{su}(2)$ into $\mathbb{Z}_2$: \begin{equation}\label{higgsE7} m_{\mathfrak{su}(2)}\to \frac{\tau}{2},\quad m_{\mathfrak{so}(2)}\to\epsilon_+-\frac{\tau}{4}. \end{equation} It is easy to see that upon this condition the elliptic genera index of $E_7+\mathbf{F}$ from \eqref{eq:Ed-index} \begin{equation} \mathbb{E}_d(\epsilon_1,\epsilon_2,m_{E_7},m_{\mathfrak{so}(2)})=-14d\epsilon_+^2+\epsilon_1\epsilon_2(3d^2-2d)+d\left(-3(m,m)_{E_7}+6m_{\mathfrak{so}(2)}^2\right) \end{equation} indeed goes to the index of twisted elliptic genera of $E_6^{(2)}$ theory from \eqref{eq:twistedEd-index} \begin{equation} \mathbb{E}_d(\epsilon_1,\epsilon_2,m_{F_4})=-8d\epsilon_+^2+\epsilon_1\epsilon_2(3d^2-2d)+d(-3(m,m)_{F_4}) . \end{equation} To check the one-loop function, we have \begin{equation} \begin{aligned} &\phantom{=}\left(-v\chi_{\bf 133}^{E_7}+e^{m_{\mathfrak{so}(2)}}\chi_{\bf 56}^{E_7}\right)\Big|_{Higgsing}\\ &\sim -v\left(\chi_{\bf 52}^{F_4}+\chi_{\bf 26}^{F_4}(q^{1/2}+1+q^{-1/2}) \right) +vq^{-1/4}\left(\chi_{\bf 26}^{F_4}(q^{1/4}+q^{-1/4}) \right) ,\\ &= -v\left(\chi_{\bf 52}^{F_4}+\chi_{\bf 26}^{F_4}q^{1/2} \right) . \end{aligned} \end{equation} Here we have droped those gauge singlets. For $\mathfrak{n}=4$, we can Higgs $E_7+2\mathbf{F}\rightarrow (E_6+2\mathbf{F})/\mathbb{Z}_2.$ The Higgsing condition is precisely \eqref{higgsE7} combined with $m'_{\mathfrak{so}(2)}=m_{\mathfrak{sp}(1)}+\tau/4$. For the one-loop function, we have \begin{equation} \begin{aligned} &\phantom{=}\left(-v\chi_{\bf 133}^{E_7}+e^{m_{\mathfrak{so}(2)}}\chi_{\bf 56}^{E_7}+e^{m'_{\mathfrak{so}(2)}}\chi_{\bf 56}^{E_7}\right)\Big|_{Higgsing}\\ &\sim -v\left(\chi_{\bf 52}^{F_4}+\chi_{\bf 26}^{F_4}(q^{1/2}+1+q^{-1/2}) \right) +(vq^{-1/4}+e^{m_{\mathfrak{sp}(1)}}q^{1/4})\left(\chi_{\bf 26}^{F_4}(q^{1/4}+q^{-1/4}) \right),\\ &= -v\left(\chi_{\bf 52}^{F_4}+\chi_{\bf 26}^{F_4}q^{1/2} \right) +e^{m_{\mathfrak{sp}(1)}}\left(\chi_{\bf 26}^{F_4}(1+q^{1/2}) \right) . \end{aligned} \end{equation} The same applies to all Higgsing \begin{equation} E_7+\frac{8-\mathfrak{n}}{2}\mathbf{F}\rightarrow (E_6+(6-\mathfrak{n})\mathbf{F})/\mathbb{Z}_2,\qquad \mathfrak{n}=6,4,2. \end{equation} For odd $\mathfrak{n}$, the Higgsing is a bit unorthodox as the twisted theory has unpaired matter content. Under the above procedure, the $\frac12\bf 56$ with zero mass should produce a $\bf 26$ with a quarter KK-charge and zero mass. As a final remark, some 6d $E_6^{(2)}$ theories can also be Higgsed from conformal matter theories. For example, it was found in \cite{Hayashi:2021pcj} that the $\mathfrak{n}=2,E_6^{(2)}$ theory can be obtained from a special Higgsing of the minimal $(E_7,E_7)$ conformal matter theory, while the $\mathfrak{n}=5,E_6^{(2)}$ theory can be obtained from a special Higgsing of extended $(E_7,\und{E_7})$ theory. \subsubsection{$E_6\to \mathfrak{so}(8)^{(3)}$} One more interesting example of twisting from Higgsing is for the $\mathbb{Z}_3$ twisted theories. In \cite{Hayashi:2021pcj}, it was found that the $\mathfrak{n}=4,\mathfrak{so}(8)^{(3)}$ theory can be obtained from a special Higgsing of the minimal $(E_6,E_6)$ conformal matter theory, while the $\mathfrak{n}=2,\mathfrak{so}(8)^{(3)}$ theory can be obtained from a special Higgsing of non-minimal $(E_6,E_6)_2$ conformal matter theory. We notice that in general, the rank-one $\mathfrak{so}(8)^{(3)}$ theory can be Higgsed from the rank-one $E_6$ theory with the same tensor coefficient $\mathfrak{n}$. Let us first consider the $\mathfrak{n}=4$ case, i.e. Higgsing $E_6+2\mathbf{F}$ to pure $\mathfrak{so}(8)^{(3)}$. To write down the precise Higgsing condition, it is useful to consider decomposition $E_6\to \mathfrak{su}(3)\times G_2$. Remark that \begin{equation} \mathbf{78}\to \bf (8,1)+(8,7)+(1,14),\qquad 27\to (\bar6,1)+(3,7). \end{equation} We then observe that the Higgsing to twisting can be achieved by discretizing the $\mathfrak{su}(3)$ into $\mathbb{Z}_3$ by the following condition \begin{equation}\label{higgsE6} m_{1,2,3}^{\mathfrak{su}(3)}\to 0,\pm\frac{\tau}{3},\qquad m_{1,2}\to \epsilon_+,\epsilon_+-\frac{\tau}{3}. \end{equation} It is easy to see that upon this condition the elliptic genera index of $E_6+2\mathbf{F}$ from \eqref{eq:Ed-index} \begin{equation} \mathbb{E}_d(\epsilon_1,\epsilon_2,m_{E_6},m_{1,2})=-14d\epsilon_+^2+\epsilon_1\epsilon_2(3d^2-2d)+d\left(-3(m,m)_{E_6}+6m_{\mathfrak{so}(2)}^2\right) \end{equation} indeed goes to the index of twisted elliptic genera of $\mathfrak{so}(8)^{(3)}$ theory from \eqref{eq:twistedEd-index} \begin{equation} \mathbb{E}_d(\epsilon_1,\epsilon_2,m_{G_2})=-8d\epsilon_+^2+\epsilon_1\epsilon_2(3d^2-2d)+d(-3(m,m)_{G_2}) . \end{equation} For the one-loop function, we have \begin{equation} \begin{aligned} &\phantom{=}\left(-v\chi_{\bf 78}^{E_6}+(e^{m_{1}} +e^{m_{2}})\chi_{\bf 27}^{E_6}\right)\Big|_{Higgsing}\\ &\sim -v\left(\chi_{\bf 14}^{G_2}+\chi_{\bf 7}^{G_2}(2+2q^{\pm1/3}+q^{\pm2/3}) \right)+(vq^{-1/3} +v)\left(\chi_{\bf 7}^{G_2}(q^{1/3}+1+q^{-1/3}) \right) ,\\ &= -v\left(\chi_{\bf 14}^{G_2}+\chi_{\bf 7}^{G_2}(q^{1/3} +q^{2/3}) \right) . \end{aligned} \end{equation} This shows that the Higgsing indeed produces the correct one-loop function of pure $\mathfrak{so}(8)^{(3)}$ theory. For $\mathfrak{n}=3$, we can Higgs $E_6+3\mathbf{F}\rightarrow (\mathfrak{so}(8)+\mathbf{V}+\mathbf{S}+\mathbf{C})/\mathbb{Z}_3.$ The Higgsing condition is precisely \eqref{higgsE6} combined with $m_{3}=m_{\mathfrak{sp}(1)}+\tau/3$. For the one-loop part, we have \begin{equation}\nonumber \begin{aligned} &\phantom{=}\left(-v\chi_{\bf 78}^{E_6}+(e^{m_{1}} +e^{m_{2}}+e^{m_{3}})\chi_{\bf 27}^{E_6}\right)\Big|_{Higgsing}\\ &\sim -v\left(\chi_{\bf 14}^{G_2}+\chi_{\bf 7}^{G_2}(2+2q^{\pm1/3}+q^{\pm2/3}) \right)+(vq^{-1/3} +v+e^{m_{\mathfrak{sp}(1)}}q^{1/3})(q^{1/3}+1+q^{-1/3}) \chi_{\bf 7}^{G_2},\\ &= -v\left(\chi_{\bf 14}^{G_2}+\chi_{\bf 7}^{G_2}(q^{1/3} +q^{2/3}) \right) + e^{m_{\mathfrak{sp}(1)}}\chi_{\bf 7}^{G_2}(1+q^{1/3}+q^{2/3}) . \end{aligned} \end{equation} The same applies to all Higgsing to twisting \begin{equation} E_6+(6-\mathfrak{n})\mathbf{F}\rightarrow (\mathfrak{so}(8)+(4-\mathfrak{n})(\mathbf{V}+\mathbf{S}+\mathbf{C}))/\mathbb{Z}_3,\qquad \mathfrak{n}=4,3,2,1. \end{equation} \subsubsection{$\mathfrak{so}(7)\to \mathfrak{su}(4)^{(2)}$} Consider the $\mathfrak{n}=2$ Higgsing from $\mathfrak{so}(7)+\bf V+4S$ to the $\mathbb{Z}_2$ twist of $\mathfrak{su}(4)+8\bf F$. This twisting from Higgsing has been found in \cite{Kim:2019dqn} from brane webs. Here we adopt a purely algebraic approach. Let us consider the decomposition $\mathfrak{so}(7)\to \mathfrak{sp}(2)\times \mathfrak{so}(2)$. Regarding the $\mathfrak{so}(2)$ as $\mathfrak{u}(1)$. We have the following representation decompositions \begin{equation} \mathbf{21}\to \bf 1_0+5_2+5_{-2}+10_0,\qquad 7\to 1_2+1_{-2}+5_0 ,\qquad 8\to 4_1+4_{-1}. \end{equation} We find the Higgsing to twisting can be achieved by discretizing the $\mathfrak{u}(1)$ by the following condition \begin{equation} m_{\mathfrak{u}(1)}\to \frac{\tau}{4},\quad m_{\bf 7}\to \epsilon_+-\frac{\tau}{2},\quad m_{i,\bf 8}\to m_{i,\bf 4}+\frac{\tau}{4},\ i=1,2,3,4. \end{equation} For the one-loop part, we have \begin{equation}\nonumber \begin{aligned} &\phantom{=}\bigg(-v\chi_{\bf 21}^{\mathfrak{so}(7)}+e^{m_{\bf 7}}\chi_{\bf 7}^{\mathfrak{so}(7)}+\chi_{\bf 8}^{\mathfrak{so}(7)}\sum_{i=1}^4 e^{m_{i,\bf 8}}\bigg)\bigg|_{Higgsing}\\ &\sim -v\left(\chi_{\bf 10}^{\mathfrak{sp}(2)}+\chi_{\bf 5}^{\mathfrak{sp}(2)}q^{\pm1/2} \right)+vq^{-1/2}\chi_{\bf 5}^{\mathfrak{sp}(2)}+(q^{-1/4}+q^{1/4}) \chi_{\bf 4}^{\mathfrak{sp}(2)}\sum_{i=1}^4q^{1/4}e^{m_{i,\bf 4}},\\[-2mm] &= -v\left(\chi_{\bf 10}^{\mathfrak{sp}(2)}+\chi_{\bf 5}^{\mathfrak{sp}(2)}q^{1/2} \right)+\left(\chi_{\bf 4}^{\mathfrak{sp}(2)}+\chi_{\bf 4}^{\mathfrak{sp}(2)}q^{1/2} \right) \sum_{i=1}^4e^{m_{i,\bf 4}} . \end{aligned} \end{equation} Thus we successfully reach the one-loop function of the $\mathbb{Z}_2$ twist of $\mathfrak{n}=2$, $\mathfrak{su}(4)+8\bf F$ theory. \subsection{Higgsing from twisted to twisted theories} Let us consider a chain of Higgsing $\mathfrak{n}=2$, $\mathfrak{su}(N)^{(2)}\to \mathfrak{su}(N-1)^{(2)}$. From \eqref{eq:twistedEd-index}, we can easily write down the modular indices of the $\mathfrak{su}(N)^{(2)}$ theories. For both $N=2r+1$ and $N=2r$ cases, we have \begin{equation}\label{n2sunindex} \mathbb{E}_d(\epsilon_1,\epsilon_2,m_{\mathfrak{sp}(r)},m_{\mathfrak{sp}(N)})=-Nd\epsilon_+^2+d^2\epsilon_1\epsilon_2 +d\bigg(-(m,m)_{\mathfrak{sp}(r)}+\sum_{i=1}^{N}m_{i,\bf N}^2\bigg). \end{equation} Consider the Higgsing from $\mathfrak{su}(2r+1)^{(2)}\to \mathfrak{su}(2r)^{(2)}$. The low energy gauge group $\mathfrak{sp}(r)$ remains the same upon the Higgsing. However, the number of fundamentals gets reduced. We propose the Higgsing condition to be \begin{equation} m_{2r+1}\to\epsilon_++\frac{\tau}{4},\qquad m_i\to m_i,\quad i=1,2,\dots,2r. \end{equation} Obviously, this Higgsing condition gives the correct modular index in \eqref{n2sunindex}. For the one-loop function, we have \begin{equation}\nonumber \begin{aligned} &\phantom{=}\bigg(-v\left(\chi_{\bf Adj}^{\mathfrak{sp}(r)}+\chi_{\bf F}^{\mathfrak{sp}(r)}(q^{1/4}+q^{3/4})+\chi_{\bf \Lambda^2}^{\mathfrak{sp}(r)}q^{1/2} \right) + \chi_{\bf F}^{\mathfrak{sp}(r)}(1+q^{1/2})\sum_{i=1}^{2r+1}e^{m_{i}} \bigg)\Big|_{Higgsing}\\ &=-v\left(\chi_{\bf Adj}^{\mathfrak{sp}(r)}+\chi_{\bf \Lambda^2}^{\mathfrak{sp}(r)}q^{1/2} \right) + \chi_{\bf F}^{\mathfrak{sp}(r)}(1+q^{1/2})\sum_{i=1}^{2r}e^{m_{i}} . \end{aligned} \end{equation} This gives exactly the one-loop function of $\mathfrak{su}(2r)^{(2)}$ twisted theory. Now consider the Higgsing from $\mathfrak{su}(2r)^{(2)}\to \mathfrak{su}(2r-1)^{(2)}$. The low energy gauge group reduces from $C_{r}$ to $C_{r-1}$. Let us consider the natural decomposition $C_{r}\to C_{r-1}\times \mathfrak{su}(2)$. It is useful to remark the following representation decompositions \begin{equation}\nonumber \bf Adj\to (Adj,1)+(F,2)+(1,3),\quad F\to (F,1)+(1,2),\quad \Lambda^2\to (\Lambda^2,1)+(F,2)+(1,1). \end{equation} We find the Higgsing can be taken by discretizing the $\mathfrak{su}(2)$ into $\mathbb{Z}_2$: \begin{equation}\label{higgsSUZ2} m_{\mathfrak{su}(2)}\to\frac{\tau}{4},\quad m_{2r }\to\epsilon_+-\frac{\tau}{4},\quad m_{i}\to m_i,\ i=1,2,\dots,2r-1. \end{equation} Obviously, this Higgsing condition also gives the correct modular index in \eqref{n2sunindex}. For the one-loop function, we have \begin{equation}\nonumber \begin{aligned} &\phantom{=}\bigg(-v\left(\chi_{\bf Adj}^{\mathfrak{sp}(r)}+\chi_{\bf \Lambda^2}^{\mathfrak{sp}(r)}q^{1/2} \right) + \chi_{\bf F}^{\mathfrak{sp}(r)}(1+q^{1/2})\sum_{i=1}^{2r}e^{m_{i}} \bigg)\bigg|_{Higgsing}\\ &\sim -v\left(\chi_{\bf Adj}^{\mathfrak{sp}(r-1)}+\chi_{\bf F}^{\mathfrak{sp}(r-1)}(q^{-1/4}+2q^{1/4}+q^{3/4})+\chi_{\bf \Lambda^2}^{\mathfrak{sp}(r-1)}q^{1/2} \right)+ \chi_{\bf F}^{\mathfrak{sp}(r)}(1+q^{1/2})vq^{-1/4}\\ &\phantom{\sim}\ + \chi_{\bf F}^{\mathfrak{sp}(r-1)}(1+q^{1/2})\sum_{i=1}^{2r-1}e^{m_{i}}\\[-2mm] &=-v\left(\chi_{\bf Adj}^{\mathfrak{sp}(r-1)}+\chi_{\bf F}^{\mathfrak{sp}(r-1)}(q^{1/4}+q^{3/4})+\chi_{\bf \Lambda^2}^{\mathfrak{sp}(r-1)}q^{1/2} \right) + \chi_{\bf F}^{\mathfrak{sp}(r-1)}(1+q^{1/2})\sum_{i=1}^{2r-1}e^{m_{i}} . \end{aligned} \end{equation} This gives exactly the one-loop function of $\mathfrak{su}(2r-1)^{(2)}$ twisted theory. \section{Summary and outlook}\label{sec:outlook} In this paper we studied the 2d $(0,4)$ SCFTs of BPS strings associated with the twisted circle compactification of all 6d rank-one $(1,0)$ SCFTs. The twisted elliptic genera of such 2d theories exhibit many extraordinary properties, which above all are classified by twisted affine Lie algebras. We established the functional equations of the twisted elliptic genera, called twisted elliptic blowup equations, which are the generalization of elliptic blowup equations developed in recent years. This powerful tool enables us to calculate twisted elliptic genera for most rank-one theories from twisted compactification. Although we focused on the one-string case, the recursion formula from twisted elliptic blowup equation allows us to compute the twisted elliptic genera of arbitrary number of strings. We also investigated the modular ansatz of the twisted one-string elliptic genera and found there is naturally a $\Gamma_1(N)$ modular structure, where $N=2,3,4$ is just the twist coefficients of the twisted affine Lie algebras. This is directly connected to the underlying $N$-section Calabi-Yau geometries, which are some genus-one fibered Calabi-Yau threefolds, whose blowup equations after converting to gauge theory language are just the twisted elliptic blowup equations. Our blowup equations can also solve the refined BPS invariants of these Calabi-Yau geometries. We further studied the generalization of spectral flow symmetry proposed in \cite{DelZotto:2016pvm,DelZotto:2018tcj} to the twisted case. We found the spectral flow between R-R and NS-R elliptic genera of one BPS string nicely fits into the twisted situation where the KK charges are naturally shifted by half. In many cases such as the four pure gauge cases, this implies an extra symmetry of the twisted elliptic genera. For theories with 2d localization formulas such as all $\mathfrak{n}=4,\mathfrak{so}(2r+8)^{(2)}$ theories, such spectral flow symmetry can be derived explicitly. In \cite{DelZotto:2016pvm}, Del Zotto and Lockhart conjectured a surprising relation between the one-string elliptic genera of 6d $(1,0)$ pure gauge ${G}$ SCFTs and the Schur indices of 4d $\mathcal{N}=2$ $H_{G}$ SCFTs for ${G}=\mathfrak{su}(3),\mathfrak{so}(8),F_4,E_{6,7,8}$. Though still mysterious, this relation has also been shown to exist to some extent for multi-string cases \cite{Gu:2019dan}. It is intriguing to consider whether the twisted elliptic genera of the four pure gauge cases discussed in the current work, i.e., $\mathfrak{su}(3)^{(2)},\mathfrak{so}(8)^{(2)},\mathfrak{so}(8)^{(3)},E_6^{(2)}$ are related to the Schur indices of some 4d SCFTs, possibly with defects. This relies on certain decompositions of the twisted elliptic genera as infinite copies of certain simpler functions, similar with those in \cite{DelZotto:2016pvm}. Besides, by SCFT/VOA correspondence, the Schur indices of $H_{G}$ SCFTs are equivalent to the vacuum characters of VOA $(G)_{-h_G^{\vee}/6-1}$. Thus we suspect in the twisted case, the VOA $(G^{(n)})_{-h_G^{\vee}/6-1}$ will also play a role. Notably, the VOA $(\mathfrak{su}(3)^{(2)})_{-3/2}$ has been recently discussed in \cite{kanade}. One more fascinating structure of the one-string elliptic genera of 6d $(1,0)$ SCFTs with tensor coefficient $\mathfrak{n}$ and gauge group $G$ (possibly with matter content) is an elegant decomposition found in \cite{DelZotto:2018tcj} involving the characters of affine Lie algebra $G^{(1)}$ at negative level $-\mathfrak{n}$, see the Equations (1.6) and (1.7) there and some recent results in \cite{Duque:2022tub}. Presumably, the twisted elliptic genera we investigated in the current paper should have an analogous decomposition involving the characters of twisted affine Lie algebras at negative levels. We hope to address this issue in the future. In this paper, we have limited ourselves to the twisted compactification by folding vector multiplets in gauge algebra $G$, which is closely related to twisted affine Lie algebras. As mentioned earlier, it is well-known that there exists another type of twist, that is folding tensor multiplets. This can happen when a higher-rank 6d SCFT exhibits some discrete symmetry in its quiver structure. This type of twisted compactification also gives many interesting 5d KK theories. It should be interesting to study as well the twisted elliptic genera in this setting. In particular, for 6d $(2,0)$ SCFTs, this kind of twisted elliptic genera has been studied in \cite{Duan:2021ges}. Besides, one can even consider the twisted elliptic genera associated to the twisted circle compactification of 6d little string theories which has drawn some interests recently \cite{DelZotto:2020sop,Bhardwaj:2022ekc,DelZotto:2022xrh}. We expect many methods developed in the current work can be extended to the twisted elliptic genera of little string theories. We can also study 6d SCFTs with defects. There are two types of defects with codimension two and codimension four, which play important roles in the study of the elliptic quantum Seiberg-Witten curves \cite{Chen:2020jla,Chen:2021ivd,Chen:2021rek}. See \cite{Nazzal:2018brc,Razamat:2018zel,Nazzal:2021tiu} for other approaches to the elliptic quantum Hamiltonians. The blowup equations for Wilson loops/surfaces and codimension four defect partition functions have been proposed in \cite{Kim:2021gyj} for generic 5d/6d theories on $\mathbb{R}^4\times S^1$ and $\mathbb{R}^4\times T^2$. It is also interesting to extend the (elliptic) blowup equation to theories with codimension two defects, and study the modular expressions of the (twisted) elliptic genera. See \cite{Nekrasov:2020qcq,Jeong:2020uxz} for the blowup equation for codimension two defects in 4d. The solution of the defect partition functions would help to bootstrap new elliptic quantum Seiberg-Witten curves that are corresponding to 6d gauge theories with and without twist. \section*{Acknowledgements} We would like to thank Lakshya Bhardwaj, Cesar Fierro Cota, Michele Del Zotto, Zhihao Duan, Amir-Kian Kashani-Poor, Hee-Cheol Kim, Minsung Kim, Sung-Soo Kim, Albrecht Klemm, Guglielmo Lockhart, Paul-Konstantin Oehlmann, Thorsten Schimannek, Cumrun Vafa, Haowu Wang and Rui-Dong Zhu for useful discussions. We thank Hee-Cheol Kim for the hospitality in POSTECH where part of this work was done. KS would also like to thank the hospitality of Institut Mittag-Leffler during the workshop ``Enumerative Invariants, Quantum Fields and String Theory Correspondences''. KL, KS and XW are supported by KIAS Grants PG006904, QP081001 and QP079201, respectively. KL is also supported in part by the National Research Foundation of Korea (NRF) Grant funded by the Korea government (MSIT) (No.2017R1D1A1B06034369).
\section{Introduction} Muons are a crucial component of the physics programme of the ATLAS experiment~\cite{PERF-2007-01} at the Large Hadron Collider (LHC)~\cite{Evans:2008zzb}. The discovery of the Higgs boson~\cite{HIGG-2012-27,CMS-HIG-12-028} and the measurement of its properties~\cite{HIGG-2021-23}, precision tests of the Standard Model~\cite{STDM-2014-18}, and searches for physics processes beyond the Standard Model~\cite{EXOT-2018-08,EXOT-2018-30} al strongly rely on the performance of muon identification and measurement with the ATLAS detector. During its second data-taking campaign (Run~2; 2015--2018), ATLAS collected 139~\ifb{} of $pp$ collisions at a centre-of-mass energy of $\sqrt{s}=13$~\TeV{}, a data sample of unprecedented size. A recent publication presented the performance of the new and optimised muon reconstruction and identification techniques developed for the analysis of the full Run~2 data sample~\cite{MUON-2018-03}. The muon momentum measurement was previously published for early Run~2 data, corresponding to 3.2~\ifb{} collected in 2015~\cite{PERF-2015-10}. This paper describes the methods used to calibrate the momentum measurement of muons reconstructed by the ATLAS detector for the full Run~2 data sample. First, the potential charge-dependent bias on the scale of the muon momentum measurement, introduced by the imperfect knowledge of the real detector geometry, is measured in reconstructed collision data with a sample of ${Z\to\mu\mu}$ events.\footnote{Charges of decay products are omitted in the following for simplicity.} A dedicated correction is derived and applied to the data. Then, $\Jmm$ and ${Z\to\mu\mu}$ decays are selected in data and used to measure the resolution and scale of the muon momentum, which are compared with those predicted by simulation. A calibration procedure is applied to simulated events, to improve the agreement between the simulation and the data. Finally, a validation procedure of this calibration is performed using $\Jmm$ and ${Z\to\mu\mu}$ events, in addition to an independent sample of $\Upsmm$ decays. In contrast to previous publications, this paper presents a completely new methodology to determine the charge-dependent bias, sensitive to global shifts in the detectors' positions, which could not be measured with previous techniques. Furthermore, the inclusion of new $\Jmm$ data collected with dedicated trigger strategies, the development of new fitting techniques with better convergence properties, and the significantly larger data sample result in an unprecedented precision of the momentum calibration procedure. In addition to the calibrations developed separately for the tracks measured in the inner detector and in the muon spectrometer of the ATLAS detector, for the first time a dedicated calibration for tracks obtained by combining information from both sub-detectors is derived. The validation of the calibration procedure is performed using $\Upsmm$ events as well as $\Jmm$ and ${Z\to\mu\mu}$ events in regions with finer granularity than those used in the calibration procedure. This paper is structured as follows: the ATLAS detector is described in \refS{sec:detector}; the simulated and real data samples used for the measurements are presented in \refS{sec:Datasets}; the identification of muon candidates is discussed in \refS{sec:MuonReco}; the methodologies for measuring the muon scale and momentum corrections are presented in \refS{sec:Resolution}; the results of the measurement and the validation of the data-driven corrections derived for simulated samples are presented in \refS{sec::validation}; final conclusions are provided in \refS{sec:conclusion}. \FloatBarrier \section{ATLAS detector} \label{sec:detector} \newcommand{\AtlasCoordFootnote}{ ATLAS uses a right-handed coordinate system with its origin at the nominal interaction point (IP) in the centre of the detector and the \(z\)-axis along the beam pipe. The \(x\)-axis points from the IP to the centre of the LHC ring, and the \(y\)-axis points upwards. Cylindrical coordinates \((r,\phi)\) are used in the transverse plane, \(\phi\) being the azimuthal angle around the \(z\)-axis. The pseudorapidity is defined in terms of the polar angle \(\theta\) as \(\eta = -\ln \tan(\theta/2)\). Angular distance is measured in units of \(\Delta R \equiv \sqrt{(\Delta\eta)^{2} + (\Delta\phi)^{2}}\).} The ATLAS detector~\cite{PERF-2007-01} at the LHC covers nearly the entire solid angle around the collision point.\footnote{\AtlasCoordFootnote} It consists of an inner tracking detector surrounded by a thin superconducting solenoid, electromagnetic and hadron calorimeters, and a muon spectrometer incorporating three large superconducting air-core toroidal magnets. The inner detector system (ID) is immersed in a \qty{2}{\tesla} axial magnetic field (bending the tracks of charged particles in the transverse plane) and provides charged-particle tracking in the range of $|\eta| < 2.5$. The high-granularity silicon pixel detector covers the vertex region and typically provides four measurements per track. The first hit is normally found in the insertable B-layer (IBL) installed before Run~2~\cite{ATLAS-TDR-19,PIX-2018-001}. It is followed by the silicon microstrip tracker (SCT), which typically provides eight measurements per track. These silicon detectors are complemented by the transition radiation tracker (TRT), which enables radially extended track reconstruction up to $|\eta| = 2.0$, typically providing 30 measurements per track. The TRT also provides electron identification information based on the fraction of hits above a higher energy-deposit threshold corresponding to transition radiation. The calorimeter system covers the pseudorapidity range $|\eta| < 4.9$. In the region $|\eta| < 3.2$, electromagnetic calorimetry is provided by barrel and endcap high-granularity lead/liquid-argon (LAr) calorimeters, with an additional thin LAr presampler covering $|\eta| < 1.8$ to correct for energy loss in material upstream of the calorimeters. Hadron calorimetry is provided by the steel/scintillator-tile calorimeter, segmented into three barrel structures with $|\eta| < 1.7$, and two copper/LAr hadron endcap calorimeters. The solid angle coverage is completed with forward copper/LAr and tungsten/LAr calorimeter modules optimised for electromagnetic and hadronic energy measurements respectively. The muon spectrometer (MS) comprises separate trigger and high-precision tracking chambers measuring the deflection of muons in a magnetic field generated by the superconducting air-core toroidal magnets, which bend charged particles tracks in the $r$--$z$ plane, i.e. in the plane formed by the muon momentum vector and the beam axis. The field integral of the toroids ranges between \num{2.0} and \SI{6.0}{\tesla\metre} across most of the detector. Three layers of precision chambers, each consisting of layers of monitored drift tubes, cover the region $|\eta| < 2.7$, complemented by cathode-strip chambers in the forward region, where the background is highest. The muon trigger system covers the range $|\eta| < 2.4$ with resistive-plate chambers in the barrel, and thin-gap chambers in the endcap regions. Events are selected by the first-level trigger system implemented in custom hardware, followed by selections made by algorithms implemented in software in the high-level trigger~\cite{TRIG-2016-01}. The first-level trigger accepts events from the \SI{40}{\MHz} bunch crossings at a rate below \SI{100}{\kHz}, which the high-level trigger further reduces to record events to disk at about \SI{1}{\kHz}. An extensive software suite~\cite{ATL-SOFT-PUB-2021-001} is used in data simulation, in the reconstruction and analysis of real and simulated data, in detector operations, and in the trigger and data acquisition systems of the experiment. \section{Data and Monte Carlo samples} \label{sec:Datasets} \subsection{Data sample} The analysis is performed using the $\sqrt{s}=$13~\TeV{} $pp$ collision data sample recorded by the ATLAS detector between 2015 and 2018. Only events collected in stable beam conditions and with all relevant ATLAS magnets and detector subsystems fully operational are used in the analysis. A combination of single-muon trigger algorithms (for ${Z\to\mu\mu}$ events) and trigger algorithms dedicated to $\Jmm$ and $\Upsmm$ topologies~\cite{TRIG-2018-01} were used. Starting from the middle of 2016, due to the increasing instantaneous luminosity of the LHC, events associated with $\Jmm$ and $\Upsmm$ triggers were collected with a dedicated data acquisition stream for $B$-physics and low-mass final states, separated from the main physics stream so that their reconstruction could be delayed if the availability of processing resources was limited~\cite{TRIG-2019-04}. This additional stream is analysed for a muon momentum calibration for the first time in this paper, significantly increasing the number of $\Jmm$ and $\Upsmm$ events available. For the data sample used in this analysis a procedure to calibrate the muon detectors was applied, as described in Ref.~\cite{MDET-2018-01}. The analysed data corresponds to an integrated luminosity of 139~\ifb{} after trigger and data-quality requirements, with an average number of $pp$ collisions per bunch crossing $<\mu>=33.7$. \subsection{Simulated samples} \label{sec:simulation} Samples of Monte Carlo (MC) simulated inclusive prompt production of $\Jmm$ and $\Psi(2S)\to\mu\mu$ events were generated at leading-order (LO) accuracy using \PYTHIA[8.186]~\cite{Sjostrand:2007gs}, for matrix element (ME) calculations, and for the modelling of the parton shower, hadronisation, and the underlying event. The \CTEQ[6L1]~\cite{Pumplin:2002vw} parton density function (PDF) set and the A14~\cite{ATL-PHYS-PUB-2014-021} set of tuned generator parameters were used. The effect of QED final-state radiation was simulated with \PHOTOSpp{}~\cite{Golonka:2005pn,Davidson:2010ew}. To increase the effective number of events for the analysis, the generated events were filtered, requiring at least one muon in the event to satisfy $\pt>6$~\GeV{} and $|\eta|<2.5$. Samples of $\Ups{1}$, $\Ups{2}$, and $\Ups{3}$ simulated events with subsequent decays into two muons were generated with a similar configuration to that of the $\Jmm$ samples, though the filter required at least two muons with $\pt>4$~\GeV{} and $|\eta|<2.7$ in the event. The samples of ${Z\to\mu\mu}$, $\Ztt$, $\Wmn$, and \mbox{$Z^{*}/\gamma^{*}(\rightarrow\mu\mu)$} events were simulated using the \POWHEGBOX[v1]~\cite{Nason:2004rx,Frixione:2007vw,Alioli:2010xd,Alioli:2008gx} generator at next-to-leading-order (NLO) accuracy in perturbative QCD, interfaced to \PYTHIA[8.186] with the \AZNLO \cite{STDM-2012-23} set of tuned generator parameters. The \CT[10nlo] PDF set~\cite{Lai:2010vv} was used for the hard-scattering processes, whereas the \CTEQ[6L1] PDF set was used for the modelling of the parton showering, hadronisation, and underlying event. The effect of QED final-state radiation was simulated with \PHOTOSpp{}. The \EVTGEN[1.2.0] program~\cite{Lange:2001uf} was used to decay bottom and charm hadrons. To improve the agreement with the data, the simulated $Z$ samples are reweighted to reproduce the muon-pair tranverse momentum and rapidity distributions measured in data. A configuration similar to the one used for the $Z$ samples described above was used to simulate diboson processes decaying into final states containing muons, \mbox{$(ZZ, WZ, WW$)}, using \POWHEGBOX[v2] and \PYTHIA[8.210]~\cite{Sjostrand:2014zea} in this case. The production of \ttbar events was modelled using the \POWHEGBOX[v2]~\cite{Frixione:2007nw,Nason:2004rx,Frixione:2007vw,Alioli:2010xd} generator at NLO with the \NNPDF[3.0nlo]~\cite{Ball:2014uwa} PDF set and the \hdamp parameter\footnote{The \hdamp parameter is a re-summation damping factor and one of the parameters that controls the matching of \POWHEG MEs to the parton shower and thus effectively regulates the high-\pT radiation against which the \ttbar system recoils.} set to 1.5\,\mtop~\cite{ATL-PHYS-PUB-2016-020}. The events were interfaced to \PYTHIA[8.230] with the A14 set of tuned generator parameters and using the \NNPDF[2.3lo] PDF set~\cite{Ball:2012cx}. The decays of bottom and charm hadrons were performed by \EVTGEN[1.6.0]. An alternative sample of ${Z\to\mu\mu}$ events was simulated with the \SHERPA[2.2.1]~\cite{Bothmann:2019yzt} generator using NLO ME for up to two partons, and LO ME for up to four partons calculated with Comix~\cite{Gleisberg:2008fv} and \OPENLOOPS~\cite{Buccioni:2019sur,Cascioli:2011va,Denner:2016kdg}. They were matched to the \SHERPA parton shower~\cite{Schumann:2007mg} using the \MEPSatNLO prescription~\cite{Hoeche:2011fd,Hoeche:2012yf,Catani:2001cc,Hoeche:2009rj} using the set of tuned parameters developed by the \SHERPA authors. The \NNPDF[3.0nnlo] PDF set~\cite{Ball:2014uwa} was used and the samples were normalised to a next-to-next-to-leading-order (NNLO) prediction~\cite{Anastasiou:2003ds}. The re-weighting procedure applied to the nominal ${Z\to\mu\mu}$ events sample is also applied to this alternative sample. The effect of multiple interactions in the same and neighbouring bunch crossings (\pileup) was modelled by overlaying the simulated hard-scattering event with inelastic proton--proton (\(pp\)) events generated with \PYTHIA[8.186]~\cite{Sjostrand:2007gs} using the \NNPDF[2.3lo] PDF set~\cite{Ball:2012cx} and the A3 set of tuned parameters~\cite{ATL-PHYS-PUB-2016-017}. The MC events were weighted to reproduce the distribution of the average number of interactions per bunch crossing observed in the data. The detector response was simulated using the \GEANT{} toolkit and reconstructed with the same algorithms as used for real data~\cite{Agostinelli:2002hh,SOFT-2010-01}. The detector simulation assumes perfect alignment for the ID and MS sub-detectors. Dedicated simulated samples with misaligned detector geometry are used for the validation of the calibration procedure. These include samples with a rotation of the ID layers with a linear dependence on the radius~\cite{IDTR-2019-05} and a perfect geometry for the MS\@. They also include samples with the positions of the middle layer of the MS chambers shifted by amounts corresponding to the residual alignment precision~\cite{ATL-MUON-PUB-2021-002}. \section{Muon reconstruction, identification and event selection} \label{sec:MuonReco} \subsection{Muon reconstruction and identification} The muon reconstruction is described in detail in Ref.~\cite{MUON-2018-03}; only a brief summary is provided here. Muons are reconstructed using information from the ID and/or MS sub-detectors, which provide two independent measurements of muons crossing the ATLAS detector. In this analysis, the following reconstruction algorithms are used. \begin{itemize} \item ID tracks: tracks reconstructed using ID hits only. \item Standalone tracks (SA): muon candidates obtained using MS hits only; to define kinematic quantities at the interaction point, SA tracks are extrapolated to the beam-spot taking into account energy loss and multiple scattering in the material upstream of the muon spectrometer. \item Combined tracks (CB): muon candidates obtained by starting from a MS track and matching it to an ID track. A combined fit to the hits, taking into account energy loss in the calorimeters and multiple scattering in the spectrometer, is performed. \end{itemize} Several working points (WPs) are introduced in Ref.~\cite{MUON-2018-03}, defining sets of quality cuts applied to reconstructed muons. The \mediumwp{} WP is the baseline for this analysis; this algorithm only selects CB muons in $|\eta|<2.5$ and applies a set of requirements to reject poorly reconstructed tracks. The \highptwp{} WP applies tighter cuts on CB muons to ensure an optimal muon reconstruction for analyses interested in the very high \pt{} regime, with a better momentum resolution. Other working points target either lower background rates, at the expense of a lower efficiency, or higher efficiency but with a lower purity for muon identification; these WPs have a momentum resolution performance similar to the \mediumwp{} one. The individual ID and SA tracks associated with the CB muons are still accessible and used in the analysis, as discussed in the following. For simplicity, muon candidates reconstructed using the ID, MS or combined ID+MS information are referred to as ID, MS or CB muons, respectively. \subsection{Event selection} Proton--proton collision vertices are constructed from reconstructed trajectories of charged particles in the ID with transverse momentum $\pt> 500~\MeV$. Events are required to have at least one collision vertex. The vertex with the highest $\sum{\pt^2}$ of reconstructed tracks is selected as the primary vertex of the hard interaction. The data are subjected to quality requirements to reject events in which detector components were not operating correctly~\cite{DAPR-2018-01}. Events are required to be selected by a combination of the following trigger chains: \begin{itemize} \item For ${Z\to\mu\mu}$ candidate events, unprescaled single-muon trigger chains with the lowest kinematic threshold available in each data sample are used. \begin{itemize} \item Data collected in 2015: at least one muon with $\pt>20~\GeV$ and passing a loose isolation requirement based on the scalar sum of the \pt{} of tracks in a cone around the muon candidate track. Events are also retained if selected by a second chain requiring at least one muon with $\pt>40~\GeV$ without any isolation requirement. \item Data collected in 2016, 2017, 2018: a similar strategy as the one used in 2015 was employed, but with the first chain requiring a muon with $\pt>26~\GeV$ passing a tighter isolation requirement, and the second chain requiring at least one muon with $\pt>50~\GeV$. \end{itemize} \item For $\Jmm$ and $\Upsmm$ candidate events, trigger chains requiring at least two muons in the event were used. The trigger algorithms also performed common vertex fits to pairs of oppositely charged muon candidates, requiring at least one of the fitted vertices to satisfy fit quality criteria and have an invariant mass consistent with that of a \jpsi or $\Upsi$ resonance~\cite{TRIG-2018-01}. The last requirement is significantly looser than that applied by the offline analysis, to avoid introducing a bias. The trigger algorithms applied the following kinematic requirements on the muons associated with the candidate resonance: \begin{itemize} \item Data collected in 2015: both muons must satisfy $\pt>4~\GeV$. \item Data collected in 2016: both muons must satisfy $\pt>6~\GeV$. \item Data collected in 2017 and 2018: both muons must satisfy $\pt>6~\GeV$. Additional requirements were also applied on the angular distance between the two muons associated with the vertex and on the displacement of the fitted vertex in the transverse plane. Events were also selected using auxiliary trigger algorithms requiring the leading (sub-leading) muon to have $\pt>11~\GeV$ ($\pt>6~\GeV$) but without any additional requirement. \end{itemize} \end{itemize} Events are required to have two oppositely charged CB muons satisfying the \mediumwp{} WP requirements and spatially matched with the muon candidates reconstructed by the respective trigger chains. Further kinematic requirements are applied to ensure that selected muons are in the regions where the triggers used for the analysis were fully efficient: \begin{itemize} \item For ${Z\to\mu\mu}$ candidate events, the leading muon must satisfy $\pt>27~\GeV$. \item For $\Jmm$ and $\Upsmm$ candidate events, both muons must satisfy $\pt>6.25~\GeV$. For events selected only by the auxiliary trigger chain in the 2017 and 2018 data samples, the requirement on the leading muon is changed to $\pt>11.25~\GeV$. \end{itemize} For each muon, requirements are also applied on the transverse ($d_0$) and longitudinal ($z_0$) impact parameters. The $d_0$ of a charged-particle track is defined in the plane transverse to the beam as the distance from the primary vertex to the track's point of closest approach. The $z_0$ is the distance in the $z$ direction between this track point and the primary vertex; this distance is represented by $z_0 \sin{\theta}$ in the longitudinal projection. The candidate muons are required to satisfy: \begin{itemize} \item $\frac{|d_{0}|}{\sigma(d_{0})}<3$, with $\sigma(d_{0})$ representing the uncertainty in the measured $d_{0}$ value; \item $|z_0 \sin{\theta}|<$0.5~mm. \end{itemize} After application of these selections, the non-prompt component of $\Jmm$ production is reduced to less than 0.5\%. Finally the invariant mass of the muon pair is required to satisfy: \begin{itemize} \item $2.6<m_{\mu\mu}<3.5~\GeV$ for $\Jmm$ candidate events; \item $7<m_{\mu\mu}<14~\GeV$ for $\Upsmm$ candidate events; \item $70<m_{\mu\mu}<130~\GeV$ for ${Z\to\mu\mu}$ candidate events. \end{itemize} \section{Momentum scale corrections} \label{sec:Resolution} The muon momentum scale and resolution are studied using $\Jmm$ and ${Z\to\mu\mu}$ decays in data and simulated samples. While dedicated procedures are applied to correct the detector alignment~\cite{PERF-2007-01,IDTR-2019-05,ATL-MUON-PUB-2021-002}, residual misalignments introduce a charge-dependent bias in the momentum measurement. Studies of this effect are discussed in \refS{Sec:SagittaBias}, together with the determination of an appropriate set of corrections for the data. Simulated samples assume ideal detector alignment and thus do not require these corrections. Although the simulation contains an accurate description of the ATLAS detector, the level of detail is not sufficient to reach the accuracy of 0.1\% on the muon momentum scale and the percent level precision on the resolution measured in data. The analysis of this sample improves upon the excellent simulated description of the ATLAS detector and its interaction with muons, encompassing the best knowledge of the detector geometry, material distribution, and physics modelling at the time of event simulation. \refS{Sec:CorrectionExtraction} details the measurement of momentum scale and resolution in data and simulation, and the determination of corresponding corrections for the simulated samples. Validation studies for the corrections are presented in \refS{sec::validation}. \subsection{Charge-dependent momentum scale calibration in data}\label{Sec:SagittaBias} After dedicated detector alignment procedures are applied, residual effects can still introduce a bias in the momentum measurement of the muon. These effects arise from both the ID and the MS sub-detectors. The ID alignment is derived by a global $\chi^2$ minimisation of the track-hit residuals~\cite{IDTR-2019-05}. Residual detector displacements relative to the nominal detector geometry may however still be present, the {\em weak modes}, that are not fully corrected for by the current alignment procedures. ID alignment studies of these modes are periodically performed and data is reconstructed with an improved description of the detector geometry. Nevertheless, residual effects after this correction procedure still prevent the best possible precision being attained, motivating the study discussed in the following. For the MS, the alignment procedures are less sensitive to charge-dependent biases, though residual effects may remain due to the limited precision of the procedure. An optical alignment system~\cite{PERF-2007-01} monitors the position of the muon chambers relative to each other and relative to fiducial marks in the detector. The system compensates for chamber position variations as the data is collected. However, several aspects limit the accuracy of this system, including access shafts for detector operations and construction precision in some detector regions. Additionally, the analysis of dedicated data runs, either collecting cosmic-ray data or in proton--proton collisions with the magnetic field generated by the toroid systems switched off, allows the precision of the relative position of the muon chambers to be further constrained. This leads to a precision at the level of tens of micrometers on the sagitta of the muon track, and up to 120--130~$\mathrm{\mu m}$ in specific detector regions~\cite{ATL-MUON-PUB-2021-002}. This residual uncertainty in the alignment system manifests as charge-dependent effects in the muon spectrometer reconstruction procedure. The precision of the muon momentum reconstruction can be further improved with a dedicated correction procedure accounting for the ID weak modes and MS alignment system uncertainties, which would otherwise degrade the momentum resolution. The charge-dependent bias can be approximated as: \begin{equation} \frac{q}{\hat{p}}=\frac{q}{p} + q \cdot \delta_s, \label{eq:bias_definition} \end{equation} where $q=\pm 1$ is the charge of the muon, $p$ and $\hat{p}$ are the corrected and uncorrected momentum of the muon, respectively, and $\delta_s$ is the strength of the bias. This parameterisation forms the basis for developing a correction to the data, recovering the residual bias and improving the momentum resolution. To estimate (and later correct) the bias, the large sample of $Z\rightarrow\mu\mu$ decays is used. The mass of the dimuon system, $m_{\mu\mu}$, can be expressed as a function of the positively and negatively charged muons' transverse momenta $\pt^+$ and $\pt^-$, respectively: \begin{equation} m_{\mu\mu}^{2} = 2 \cdot \pt^+\pt^- \cdot (\text{cosh}(\Delta\eta) - \text{cos}(\Delta\phi)), \end{equation} \noindent where $\Delta\eta$ and $\Delta\phi$ are the differences between the pseudorapidity and azimuthal angles of the two muons. The bias is parameterised as a function of a grid of 48$\times$48 equal-sized $\eta$--$\phi$ detector regions, a granularity chosen to ensure that the measurement is not affected by large statistical fluctuations while still correctly reflecting local biases or deformations. This high granularity allows the transverse momentum \pt{} of the measurement to be used instead of $p$, which is necessary when comparing ID and MS results, since the two sub-detectors have different bending planes due to their respective magnet systems. Combining the previous two equations, the biased invariant mass $\hat{m}_{\mu\mu}^{2}$ can be expressed as: \begin{equation}\label{eq:masSagitta2} \hat{m}_{\mu\mu}^{2} = \frac{m_{\mu\mu}^{2}}{(1+\delta_{s} \pt^+)(1-\delta_{s} \pt^-)}. \end{equation} \noindent Assuming the bias is small, \refE{eq:masSagitta2} can be approximated as: \begin{equation} m_{\mu\mu}^{2} = \hat{m}_{\mu\mu}^{2}(1+\delta_{s}(\eta,\phi) \pt^+ - \delta_{s}(\eta,\phi) \pt^-). \label{eq:masSagitta3} \end{equation} Since $\pt^{+}\sim\pt^{-}$ in $Z$ boson decays, charge-dependent biases largely cancel in the expression of $m_{\mu\mu}^{2}$, hence do not impact the average dimuon mass over all detector regions, but only broaden the resolution of the $Z\rightarrow\mu\mu$ peak. Therefore, the reconstructed invariant mass $m_{\mu\mu}$ distribution defined in \refE{eq:masSagitta3} is sensitive to the bias through its impact on the variance of the distribution. The values of the sagitta biases $\hat{\delta}_{s}(\eta,\phi)$ are evaluated by minimising the variance of the invariant mass distributions; then, the biased momentum of the muon $\hat{\pt}$ is corrected using the following equation: \begin{equation} \label{eq:sgcorr} \pt = \frac{\hat{\pt}}{ 1 - q \hat{\delta}_{s}(\eta,\phi)\hat{\pt}}. \end{equation} Finally, the updated \pt{} values are used to recalculate the invariant mass distribution and a new iteration is started. Given the large number of degrees of freedom induced by the dependence of the biases on $\eta$ and $\phi$, a direct solution of the equation becomes impractical. Instead, an iterative approach is chosen. At each iteration the values of $\hat{\delta}_{s}(\eta,\phi)$ obtained from the previous iteration are used as an input to $\hat{\pt}$ of the next. A complementary method to estimate this bias is also defined by approximating the average $\pt$ of the muon to half the invariant mass of the dimuon pair. In this case, the bias can be approximated by: \begin{equation} \label{eq:detaqM} \delta_s (\eta,\phi) = 4\cdot \frac{q (\hat{m}_{\mu\mu}(\eta,\phi) - \langle m_{\mu\mu} \rangle)}{\langle m_{\mu\mu} \rangle^2}, \end{equation} where $\langle m_{\mu\mu} \rangle$ is the average of the invariant mass of the dimuon pairs used to derive the correction, while $\hat{m}_{\mu\mu}(\eta,\phi)$ is the average invariant mass of the dimuon pairs when the muon with the highest transverse momentum is in the given $(\eta,\phi)$ region. Both methods additionally assume that the kinematic properties of positively and negatively charged muons produced by $Z$ decays are symmetrical. In addition to the small asymmetry introduced by the weak mixing angle, this assumption breaks down due to the detector acceptance and selection requirements restricting the phase space of the selected muon pairs. The impact of these acceptance and kinematic restrictions can be estimated by applying the same procedure to events simulated with ideal detector alignment, obtaining a residual bias term $\delta_{s}^{\text{MC}}$. The $\delta_{s}^{\text{data}}$ measured in data can be corrected by subtracting the values measured in MC simulation, $\delta_{s}^{\text{MC}}$, to define the final corrections: \begin{equation} \delta_{s}(\eta,\phi) = \delta_{s}^{\text{data}}(\eta,\phi)-\delta_{s}^{\text{MC}}(\eta,\phi). \end{equation} Typical values for $\delta_{s}^{\text{MC}}(\eta,\phi)$ range from up to $0.01~\TeV^{-1}$ in the central pseudorapidity region to up to about $0.05~\TeV^{-1}$ in the forward pseudorapidity region, after event selection. The procedure is applied separately for the muon momentum measured using the CB, ID, and MS information, and dedicated corrections for each measurement are derived. Both procedures target a residual $\delta_{s}$ of less than $10^{-3}~\TeV{}^{-1}$ through simultaneous iterative updates on the ID, MS, and CB momenta. The convergence is achieved once the target is reached for all momenta. For the first method this happens after five iterations on average, while the second typically requires 25 iterative updates. In both methods, the angular correlations between the two muons have a small impact on the estimate of $\delta_s$, given the fine granularity chosen in $\eta\times\phi$. \refF{fig:sgBefore} shows the measured sagitta corrections evaluated on CB momenta, with biases up to 0.4~$\TeV{}^{-1}$. To avoid introducing a bias in the measurement due to the value assumed for $m_{Z}$, the unbiased value of $m_{\mu\mu}$ is taken from the data when integrating over all $\eta$ and $\phi$ bins for both methods. Results from the two methods, which rely on different assumptions, are compared. For the first method, a comparable bias for the leading and subleading $\pt$ is assumed, while for the second method the approximation of $\pt^{+} \simeq \pt^{-}$ is less precise at high $\eta$ values. The $\delta_s (\eta,\phi)$ corrections obtained with the two methods have a correlation close to 100\%, with an agreement between the two methods at the level of $0.01~\TeV{}^{-1}$ or better, well within the systematic uncertainties of either method. Results for the second method are given in \refA{app:sagitta}. \begin{figure*}[!htb] \centering \subfloat[ ]{\includegraphics[width=0.45\linewidth]{fig_01a.pdf}} \subfloat[ ]{\includegraphics[width=0.45\linewidth]{fig_01b.pdf}} \\ \subfloat[ ]{\includegraphics[width=0.45\linewidth]{fig_01c.pdf}} \caption{Charge-dependent biases on the muon \pt\ as evaluated on data for CB momenta after alignment and before applying the dedicated corrections. The biases are shown separately for the three data-taking periods, (a) years 2015 and 2016, (b) 2017, and (c) 2018. The bias is defined in Eq.~(\ref{eq:bias_definition}).} \label{fig:sgBefore} \end{figure*} Using the derived bias results, the transverse momenta of the muon are corrected based on \refE{eq:sgcorr} using the $\hat{\delta}_{s}$ derived after the last iteration. The biases are re-evaluated after the application of the corrections and the results are shown in \refF{fig:sgAfterCorr} for CB momenta. Both methods address relative differences between nearby $\eta, \phi$ regions, as well as biases that are constant across full sub-detector regions. The biases are reduced to less than $2\cdot10^{-4}~\TeV{}^{-1}$ in all regions of the detector, validating the method (`closure') to several orders of magnitude better than the typical size of the correction. To validate the correction procedure, simulated samples with misaligned detector configurations, as described in \refS{sec:simulation}, were used. The injected biases were produced by a rotation of the ID detector layers with a linear dependence on the radial distance from the interaction point. The sizes of these biases in the simulation are the same as those observed in data from ${Z\to\mu\mu}$ decays before applying the correction procedure. \refF{fig:truth} uses these biased detector geometry samples to compare the reconstructed and generated momentum distributions, as evaluated before and after the correction, plotted separately for positive and negative muons. The application of the correction reduces the differences between the positively and negatively charged muons, improving the reconstructed \pt\ resolution. Further closure tests are performed using simulated samples with distorted geometry on $H\rightarrow ZZ\rightarrow \mu\mu\mu\mu$ and hypothetical narrow resonances decaying into two muons with masses greater than $500~\gev$, to estimate the impact of the correction in muon momentum regimes far from that of muons originating from $Z$ decays. Closure is observed at the same level of precision. \begin{figure*}[!htb] \centering \subfloat[ ]{\includegraphics[width=0.45\linewidth]{fig_02a.pdf}} \subfloat[ ]{\includegraphics[width=0.45\linewidth]{fig_02b.pdf}} \\ \subfloat[ ]{\includegraphics[width=0.45\linewidth]{fig_02c.pdf}} \caption{Residual charge-dependent biases on the muon \pt\ as evaluated on data for CB momenta after alignment and after application of the correction procedure. The residual biases are shown separately for the three data-taking periods, (a) years 2015 and 2016, (b) 2017, and (c) 2018. The bias is defined in Eq.~(\ref{eq:bias_definition}).} \label{fig:sgAfterCorr} \end{figure*} \begin{figure*}[!htb] \centering \subfloat[ ]{\includegraphics[width=0.45\linewidth]{fig_03a.pdf}} \subfloat[ ]{\includegraphics[width=0.45\linewidth]{fig_03b.pdf}} \caption{The bias of the transverse momentum measured in simulated data. The upper panels show the leading muon in the event ($\pt^\textrm{lead}$) compared with its true value separately for positive muons and negative muons, (a) for $-1.05<\eta<0$ and (b) for $0<\eta<1.05$. The dotted lines correspond to the momentum bias as evaluated on a simulation with a biased geometry, for positive and negative muons. The markers correspond to the bias evaluated with the same simulation after the application of the correction procedures. The lower panels show the ratios of positive to negative muons before and after correction.} \label{fig:truth} \end{figure*} Several sources of systematic uncertainty associated with the correction procedure are studied. They relate to both the accuracy of the measurement of $\delta_{s}$ and the assumptions used in the correction procedure. The systematic uncertainty originating from the residual non-closure of the correction compared with a perfectly aligned detector simulation is evaluated as follows. First, the $\delta_{s}$ value obtained after the last iteration on data is used to bias the $\pt$ in a perfectly aligned simulation. This is done using \refE{eq:sgcorr}, by flipping the sign of $\delta_{s}$, and using the same granularity in $\eta$ and $\phi$ as used for deriving the correction. The resulting $\pt$ is compared with the unbiased momentum and the difference is taken as a systematic uncertainty. A second component of the residual non-closure is estimated in simulation by injecting a set of constant known biases and by taking the difference of $\delta_{s}$ between the injected and measured $\delta_{s}$. The injected biases range from percent fractions up to twice those observed in the data at the first iteration of the correction procedure; the largest resulting $\delta_{s}$ difference is taken as the uncertainty for all bins. Both methods show very good closure for the full range of injected biases. The uncertainties originating from the non-closures amount to about 0.02~$\TeV{}^{-1}$, depending on the pseudorapidity region. A second contribution to the systematic uncertainties arises from extrapolations to momenta outside the phase-space region covered by $Z$ decays. In fact, the relative contribution of the ID and MS detectors on the CB momentum measurement may vary in a non-trivial way. This may lead to biases on the estimate of $\delta_{s}$ and of the correction. In this case, the residual bias is evaluated as the difference between simulation and data and as a function of $\eta$ and $\pt$ using the alternative method of \refE{eq:detaqM}. The difference compared with the simulation is used to account for the kinematic dependencies of the $\delta_{s}$ estimate. The resulting uncertainty is small, compared with the non-closure described previously, in the central regions of pseudorapidity. However, in the forward pseudorapidity regions, it becomes sizeable and evolves as $2~\times10^{-4}~\TeV{}^{-2}~\times (\pt\ - 0.045~\TeV)$. The statistical uncertainties due to the observed and simulated number of $Z$ decays are also taken into account. These are approximately an order of magnitude smaller than the first two components, but in the forward region they reach up to 0.02~$\TeV^{-1}$. Given the lack of sufficient ${Z\to\mu\mu}$ decays above $450~\GeV$ in data to validate the methodology, the correction is not extrapolated beyond this value. Instead, an uncertainty accounting for the charge-dependent biases before any correction is assigned to the simulated momenta. This is estimated by biasing the simulated muon momenta in a perfectly aligned simulation, according to \refE{eq:sgcorr}, using the values of $\delta_{s}$ as measured before any correction. As done for the non-closure uncertainty, the uncertainty is derived by injecting bias into simulated events and taking the difference between the biased and the non-biased muon momentum values, resulting in an uncertainty of up to 0.4~$\TeV^{-1}$ as shown in \refF{fig:sgBefore}. \subsection{Muon momentum calibration procedure in simulation}\label{Sec:CorrectionExtraction} In the following, the \textit{muon momentum calibration} is defined as the procedure used to identify the corrections to the reconstructed muon transverse momenta in simulation in order to match the measurement of the same quantities in data. This procedure is performed after correcting for the charge-dependent bias discussed in the previous section. The transverse momenta of the ID and MS tracks associated with a CB muon, referred to as $\pt^{\textrm{ID}}$ and $\pt^{\textrm{MS}}$, respectively, are used in addition to the transverse momentum of the CB track, referred to as $\pt^{\textrm{CB}}$. The corrected transverse momentum after applying the calibration procedure, $\pt^{\textrm{Cor,Det}}$ (Det$=$ CB, ID, MS), is described as: \begin{eqnarray}\label{eq:pt_cor} \pt^{\textrm{Cor,Det}} &=& \frac{\pt^{\textrm{MC,Det}} + \sum\limits^{1}_{n=0} s^\mathrm{Det}_{n}(\eta,\phi)\left(\pt^{\textrm{MC,Det}}\right)^{n}}{1+\sum\limits^{2}_{m=0} \Delta r^\mathrm{Det}_{m}(\eta,\phi)\left(\pt^{\textrm{MC,Det}}\right)^{m-1}g_{m}}, \end{eqnarray} where $\pt^{\textrm{MC,Det}}$ is the uncorrected transverse momentum in simulation, $g_{m}$ are normally distributed random variables with zero mean and unit width, and the terms $\Delta r_{m}^{\textrm{Det}}(\eta,\phi)$ and $s_n^{\textrm{Det}}(\eta, \phi)$ describe the momentum resolution smearing and scale corrections respectively, applied in a specific ($\eta$, $\phi$) detector region. A possible $s_2^{\textrm{Det}}(\eta, \phi)$ term in the numerator is neglected because it would model effects already corrected in data with the procedure described in \refS{Sec:SagittaBias}. The corrections described in \refE{eq:pt_cor} are defined in $\eta$--$\phi$ detector regions homogeneous in detector technology and performance. All corrections are divided into 18 pseudorapidity regions. In addition, the CB and MS corrections are divided into two $\phi$ bins separating the two types of MS sectors: those that include the magnet coils ({\em small sectors}) and those between two coils ({\em large sectors}). The small and large MS sectors are subjected to independent alignment techniques and cover detector areas with different material distribution, leading to scale and resolution differences. The numerator of \refE{eq:pt_cor} describes the momentum scales. The $s_1^\mathrm{Det}(\eta, \phi)$ term corrects for inaccuracy in the description of the magnetic field integral and the dimension of the detector in the direction perpendicular to the magnetic field. The $s^\mathrm{Det}_0(\eta, \phi)$ term models the effect on the CB and MS momentum from the inaccuracy in the simulation of the energy loss in the calorimeter and other material between the interaction point and the exit of the MS. As the energy loss between the interaction point and the ID is negligible, $s^\mathrm{ID}_0(\eta)$ is set to zero~\cite{PERF-2015-10}. The denominator of \refE{eq:pt_cor} describes the momentum smearing that broadens the relative \pt\ resolution in simulation, $\sigma(\pt)/ \pt$, to properly describe the data. The corrections to the resolution assume that the relative \pt\ resolution can be parameterized as follows: \begin{equation}\label{eq:qoverpt_reso} \frac{ \sigma(\pt)}{\pt} = r_0/\pt \oplus r_1 \oplus r_2\cdot \pt\textrm{,} \end{equation} with $\oplus$ denoting a sum in quadrature. In \refE{eq:qoverpt_reso}, the first term ($r_0$) mainly accounts for fluctuations of the energy loss in the traversed material; the second term ($r_1$) mainly accounts for multiple scattering, uncertainties related to, and inhomogeneities in, the modelling of the local magnetic field, and length-scale radial expansions of the detector layers; and the third term ($r_2$) mainly describes intrinsic resolution effects caused by the spatial resolution of the hit measurements and residual misalignments between the different detector elements. The energy loss term has a negligible impact on the muon resolution in the momentum range considered, and therefore $\Delta r^\mathrm{Det}_{0}$ is set to zero. In a second step, to cross-check the validity of the corrections obtained directly for the CB tracks, the corrected combined momenta from ID and MS measurements $\pt^{\textrm{Corr ID+MS}}$ is also obtained by combining the ID and MS corrected momenta with a weighted average: \begin{equation} \pt^{\textrm{Cor,ID+MS}} = f\cdot \pt^{\textrm{Cor,ID}} + (1 - f)\cdot \pt^{\textrm{Cor, MS}}\textrm{.} \end{equation} The weight $f$ is calculated by solving the following linear equation: \begin{equation} \pt^{\textrm{MC,CB}} = f\cdot \pt^{\textrm{MC,ID}} + (1 - f)\cdot \pt^{\textrm{MC, MS}}\textrm{,} \end{equation} which assumes that the relative contribution of the two sub-detectors to the combined track remains unchanged before and after momentum corrections. \subsubsection{Determination of the \pt\ calibration constants} The CB, ID, and MS correction parameters contained in \refE{eq:pt_cor} are extracted from data using a fitting procedure that compares the invariant mass distributions for $\Jmm$ and ${Z\to\mu\mu}$ candidates in data and simulation, selected as discussed in \refS{sec:MuonReco}. When extracting correction parameters, muons are assigned to $\eta$--$\phi$ regions of fit (ROFs), which are defined separately for the ID and the MS. The values of $\Delta r^\mathrm{ID}_{0}$, $ \Delta r^\mathrm{MS}_{0}$, $ \Delta r^\mathrm{CB}_{0}$, and $s^\mathrm{ID}_0$, are set to zero as previously discussed, while $ \Delta r^\mathrm{MS}_{2}$ is determined from alignment studies using cosmic-ray data and special runs with the toroidal magnetic field turned off~\cite{ATL-MUON-PUB-2021-002}, and from detector calibration procedures~\cite{MDET-2018-01}. The corrections are extracted using the distributions of the dimuon invariant mass, $m_{\mu\mu}^\mathrm{Det}$. When fitting a specific ROF, one muon is required to belong to the ROF and the other can be anywhere in the detector. To enhance the sensitivity to $\pt$-dependent correction effects, the dimuon pair is classified according to the $\pt$ of the muons. For $\Jmm$ decays, the fit is performed in two exclusive categories defined by the subleading muon transverse momentum: $6.25 < \pt^{\textrm{Det,sublead}} < 9~\GeV$ and $\pt^{\textrm{Det,sublead}} > 9~\GeV$. For ${Z\to\mu\mu}$ decays the two categories are defined by the leading muon transverse momentum: $ 20< \pt^{\textrm{Det,lead}} < 50~\GeV$ and $\pt^{\textrm{Det,lead}}> 50~\GeV$. Templates for the $m_{\mu\mu}^{\textrm{Det}}$ variables are built using $\Jmm$ and ${Z\to\mu\mu}$ simulated signal samples. The first step in the fitting procedure consists of estimating the contribution of the background processes. For the ${Z\to\mu\mu}$ selection, the small background component (approximately 0.1\%) is extracted from simulation and added to the templates. A much larger (up to 15\%) non-resonant background from decays of light and heavy hadrons and from continuum Drell--Yan production is present for events selected in the $\Jmm$ channel, estimated with a data-driven approach as this background is difficult to simulate. The dimuon invariant mass distribution in data is fitted in each ROF using a Crystal Ball function~\cite{Crystal} with an exponential background distribution. This background model is then combined with the simulated signal templates used in the fit. To estimate the scale and smearing parameters, a multi-stage procedure is used. A two-step random walk minimisation is first performed where the parameters are sampled within a specified range. The parameter configuration that leads to the best agreement for the invariant mass distribution between simulation and data is kept. In the first step, the best agreement is defined by a simplified metric where the compatibility between the means and standard deviations of the distributions is compared. In the second step, a binned $\chi^2$ is computed that compares the dimuon mass spectrum in simulation to that of data. Around this best-agreement parameter configuration, signal templates are then generated at discrete intervals and interpolated using moment morphing~\cite{Baak:2014fta}. Using this signal model, a full minimisation using the binned $\chi^2$ is performed. This procedure is iteratively repeated, where the second muon outside the ROF definition is calibrated using results from the previous iteration, until the change of each parameter stays within the root mean squared of its values as estimated from the last five iterations. This happens after 16 iterations. Each calibration parameter's values from the last five iterations are averaged to produce their final value. The calibration parameters obtained from the fits to the data are summarised in Tables~\ref{tab:id_cor}, ~\ref{tab:ms_cor}, and ~\ref{tab:cb_cor}, averaged over three $\eta$ regions. The sums in quadrature of the statistical and systematic uncertainties are shown, with the latter dominating. All sources of uncertainties are evaluated by varying the parameters of the template fit. The higher uncertainty for $\Delta r_1^\mathrm{ID}$ in the second bin is associated with the region of the ID with the largest amount of material, corresponding to the transition between the barrel and endcap region of its subdetectors. The increase in uncertainty as a function of $|\eta|$ for $s_1^\mathrm{ID}$ is due to the decrease of the magnetic field integral of the solenoid as a function of $|\eta|$. The larger uncertainties for some of the MS terms in the $1.05\le |\eta|<2.0$ region are associated with the low bending power of the magnet system of the MS in part of that region. The main contributions to the final systematic uncertainty are: \begin{itemize} \item $J/\psi$ only and $Z$ only fit: The fit is repeated using only the $\Jmm$ or ${Z\to\mu\mu}$ decays with only $s_1^\mathrm{Det}$ left as a free parameter and the other parameters fixed to their nominal fitted value. The resulting uncertainty is defined by taking the difference relative to the nominal fitted $s_1^\mathrm{Det}$ and accounts for the extrapolation from the regions dominated by either the $\Jmm$ or the ${Z\to\mu\mu}$ in their respective \pt\ spectra. \item $Z$ kinematic reweighting: As discussed in \refS{sec:simulation}, the reweighting maps are derived separately for each simulated sample. To evaluate the impact of the reweighting on the analysis, new templates of $m_{\mu\mu}^\mathrm{ID}$, $m_{\mu\mu}^\mathrm{CB}$, and $m_{\mu\mu}^\mathrm{MS}$ are produced. The results obtained when using the different ${Z\to\mu\mu}$ samples with their respective reweighting scheme and the non-reweighted results for the nominal ${Z\to\mu\mu}$ samples are used to derive the uncertainty. This systematic uncertainty impacts the overall $Z$ lineshape by changing the relative weight of various momentum regimes and, by extension, the contributions of their dedicated corrections in the final fit. \item Decay modelling and final state radiation modelling: The nominal simulated sample of ${Z\to\mu\mu}$ events, of which the QED final-state radiation is handled by \PHOTOSpp{}, is compared with ${Z\to\mu\mu}$ events simulated with the \SHERPA[2.2.1] sample which uses an alternative radiative modelling. The impact of the uncertainties in the decay modelling are significantly smaller than those originating from the components discussed above, partially due to the already discussed kinematic reweighting. \item $J/\psi$ and $Z$ \pt template range: The \pt ranges of the $J/\psi$ and $Z$ templates are varied. For $J/\psi$, the ranges of the two nominal \pt\ templates are $\pt^{J/\psi, \textrm{nom}} \in [6.25, 9]~\GeV$ and $\pt^{J/\psi, \textrm{nom}} \in [9, 20]~\GeV$. For $Z$, the ranges of two templates are $\pt^{Z, \textrm{nom}} \in~[20, 50]~\GeV$ and $\pt^{Z, \textrm{nom}} \in [50, 300]~\GeV$. The boundary of the two templates for $J/\psi$ is varied from 9 to 8 and 12~\GeV, and for $Z$ is varied from 50 to 40 and 80~\GeV. This preserves the numbers of events, and covers any additional \pt dependencies. \item Mass binning of $J/\psi$ and $Z$: The number of bins for the $m_{\mu \mu}$ templates are reduced from 200 to 150 for $Z$, and from 90 to 60 for $J/\psi$. This systematic uncertainty covers any binning effect in generating templates. \item $Z$ mass window: New templates of $m_{\mu \mu}$ are generated for the ${Z\to\mu\mu}$ sample changing the $m_{Z}$ window selection to $75 < m_{\mu\mu} < 115~\GeV$ for all track types. The high and low mass regions away from the resonant pole of the $Z$ are more sensitive to initial- and final-state radiation contributions, the running of $\alpha^\text{EM}_{Z}$, and other specific choices of the MC generators used in the ${Z\to\mu\mu}$ simulation. \item $J/\psi$ mass window: The same approach as in the case of the $Z$ is applied, changing the invariant mass window selection to $2.75 < m_{\mu\mu} < 3.4~\GeV$ for all track types. The region furthest from the $m_{J/\psi}$ peak is more sensitive to the shape variation of the combinatorial background, and the specific choices of the MC generators used in the $\Jmm$ simulation. \item $J/\psi$ background: New $m_{\mu \mu}$ templates are generated for the $\Jmm$ samples using a background parameterisation different from the exponential function. For this systematic uncertainty, background parameterisations including a combination of two Crystal ball functions and a Chebyshev function are used. \item Closure test and statistical uncertainty: The root mean squared of the last five iterations of each calibration parameter is used as the statistical uncertainty of the method. This accounts for any instabilities in the fit, and the correlations between different parameters. \end{itemize} For muons with transverse momenta of about $45~\GeV$, the largest component of the total uncertainty in the momentum scale originates from the comparison of the $\Jpsi$ and $Z$ only fits. The remaining components are smaller by about a factor of two. For the resolution smearing terms, in the same kinematic regime, the largest uncertainty comes from the $\Jpsi$ and $Z$ \pt\ template fit range. At significantly higher momenta the uncertainty in the $\Jpsi$ and $Z$ \pt\ template fit range still dominates the resolution uncertainty in $\pt^{\text{Cor,CB}}$. \begin{table*}[t] \caption{Summary of ID muon momentum resolution and scale corrections used in \refE{eq:pt_cor}, averaged over the three main detector regions. The corrections are derived in 18 pseudorapidity regions, as described in \refS{sec:Resolution}, and averaged, with each region assigned a weight proportional to its $\eta$ width. The uncertainties represent the sum in quadrature of the statistical and systematic uncertainties.} \label{tab:id_cor} \centering \begin{tabular}{c r@{}l r@{}l r@{}l} \toprule Region & \multicolumn{2}{c}{$\Delta r_1^{\textrm{ID}}(\times 10^{-3})$} & \multicolumn{2}{c}{$\Delta r_2^{\textrm{ID}}$ [\TeV$^{-1}$]} & \multicolumn{2}{c}{$s_1^{\textrm{ID}}(\times 10^{-3})$}\\ \midrule $|\eta|<1.05$ & $4.4$ & $\phantom{}^{+3.0}_{-2.7}$ & $0.12$ & $\phantom{}^{+0.03}_{-0.03}$ & $-0.82$ & $\phantom{}^{+0.19}_{-0.06}$ \\[2mm] $1.05\le |\eta|<2.0$ & $6.7$ & $\phantom{}^{+19.5}_{-3.1}$ & $0.31$ & $\phantom{}^{+0.03}_{-0.03}$ & $-0.86$ & $\phantom{}^{+0.36}_{-0.21}$ \\[2mm] $|\eta|\ge 2.0$ & $9.4$ & $\phantom{}^{+3.6}_{-5.3}$ & $0.08$ & $\phantom{}^{+0.02}_{-0.02}$ & $-0.45$ & $\phantom{}^{+1.19}_{-0.55}$ \\ \bottomrule \end{tabular} \end{table*} \begin{table*}[t] \caption{Summary of MS momentum resolution and scale corrections for small and large MS sectors, averaged over three main detector regions. The corrections for large and small MS sectors are derived in 18 pseudorapidity regions, as described in \refS{sec:Resolution}, and averaged, with each region assigned a weight proportional to its $\eta$ width. The uncertainties represent the sum in quadrature of the statistical and systematic uncertainties. The larger uncertainties for some terms in the $1.05\le |\eta|<2.0$ region are associated with the low bending power of the magnet system of the MS in part of that region.} \label{tab:ms_cor} \centering \begin{tabular}{cr@{}l r@{}l r@{}l r@{}l r@{}l} \toprule Region & \multicolumn{2}{c}{$\Delta r_0^{\textrm{MS}}$ [\MeV]} & \multicolumn{2}{c}{$\Delta r_1^{\textrm{MS}} (\times 10^{-3})$} & \multicolumn{2}{c}{$\Delta r_2^{\textrm{MS}}$ [\TeV$^{-1}$]} & \multicolumn{2}{c}{$s_0^{\textrm{MS}}$ [\MeV]} & \multicolumn{2}{c}{$s_1^{\textrm{MS}} (\times 10^{-3})$}\\ \midrule $|\eta|<1.05$ (large) & $71$ & $\phantom{}^{+41}_{-10}$ & $13.5$ & $\phantom{}^{+3.1}_{-2.6}$ & $0.11$ & $\phantom{}^{+0.02}_{-0.02}$ & $-27$ & $\phantom{}^{+18}_{-14}$ & $2.33$ & $\phantom{}^{+0.61}_{-0.61}$ \\[2mm] $|\eta|<1.05$ (small) & $63$ & $\phantom{}^{+35}_{-23}$ & $17.2$ & $\phantom{}^{+2.3}_{-3.6}$ & $0.12$ & $\phantom{}^{+0.02}_{-0.02}$ & $-18$ & $\phantom{}^{+14}_{-24}$ & $-1.51$ & $\phantom{}^{+1.15}_{-0.45}$ \\[2mm] $1.05\le |\eta|<2.0$ (large) & $42$ & $\phantom{}^{+401}_{-53}$ & $26.7$ & $\phantom{}^{+19.5}_{-2.8}$ & $0.14$ & $\phantom{}^{+0.02}_{-0.02}$ & $-29$ & $\phantom{}^{+43}_{-57}$ & $-0.9$ & $\phantom{}^{+2.8}_{-1.9}$ \\[2mm] $1.05\le |\eta|<2.0$ (small) & $44$ & $\phantom{}^{+437}_{-59}$ & $29.2$ & $\phantom{}^{+8.2}_{-1.5}$ & $0.18$ & $\phantom{}^{+0.02}_{-0.02}$ & $-28$ & $\phantom{}^{+39}_{-43}$ & $-1.3$ & $\phantom{}^{+2.0}_{-1.6}$ \\[2mm] $|\eta|\ge 2.0$ (large) & $61$ & $\phantom{}^{+48}_{-27}$ & $16.8$ & $\phantom{}^{+3.2}_{-4.3}$ & $0.11$ & $\phantom{}^{+0.02}_{-0.02}$ & $-1$ & $\phantom{}^{+43}_{-29}$ & $1.7$ & $\phantom{}^{+1.3}_{-1.4}$ \\[2mm] $|\eta|\ge 2.0$ (small) & $47$ & $\phantom{}^{+32}_{-40}$ & $17.8$ & $\phantom{}^{+1}_{-1.9}$ & $0.16$ & $\phantom{}^{+0.02}_{-0.02}$ & $-8$ & $\phantom{}^{+14}_{-12}$ & $1.94$ & $\phantom{}^{+0.76}_{-0.54}$ \\ \bottomrule \end{tabular} \end{table*} \begin{table*}[t] \caption{Summary of CB momentum resolution and scale corrections for small and large MS sectors, averaged over three main detector regions. The corrections for large and small MS sectors are derived in 18 pseudorapidity regions, as described in \refS{sec:Resolution}, and averaged, with each region assigned a weight proportional to its $\eta$ width. The energy loss term $\Delta r_0^{\textrm{CB}}$ is negligible and therefore fixed to zero in the fit for all $\eta$. The uncertainties represent the sum in quadrature of the statistical and systematic uncertainties. } \label{tab:cb_cor} \centering \begin{tabular}{cr@{}l r@{}l r@{}l r@{}l} \toprule Region & \multicolumn{2}{c}{$\Delta r_1^{\textrm{CB}} (\times 10^{-3})$} & \multicolumn{2}{c}{$\Delta r_2^{\textrm{CB}}$ [\TeV$^{-1}$]} & \multicolumn{2}{c}{$s_0^{\textrm{CB}}$ [\MeV]} & \multicolumn{2}{c}{$s_1^{\textrm{CB}} (\times 10^{-3})$}\\ \midrule $|\eta|<1.05$ (large) & $6.7$ & $\phantom{}^{+1.4}_{-0.9}$ & $0.08$ & $\phantom{}^{+0.04}_{-0.05}$ & $-5.0$ & $\phantom{}^{+2.9}_{-4.0}$ & $0.35$ & $\phantom{}^{+0.24}_{-0.22}$ \\[2mm] $|\eta|<1.05$ (small) & $6.5$ & $\phantom{}^{+1.3}_{-1.0}$ & $0.11$ & $\phantom{}^{+0.05}_{-0.05}$ & $-0.9$ & $\phantom{}^{+2.5}_{-3.6}$ & $-0.83$ & $\phantom{}^{+0.25}_{-0.14}$ \\[2mm] $1.05\le |\eta|<2.0$ (large) & $10.3$ & $\phantom{}^{+2.6}_{-2.7}$ & $0.24$ & $\phantom{}^{+0.10}_{-0.07}$ & $-2.0$ & $\phantom{}^{+5.7}_{-6.7}$ & $-0.83$ & $\phantom{}^{+0.39}_{-0.30}$ \\[2mm] $1.05\le |\eta|<2.0$ (small) & $8.9$ & $\phantom{}^{+1.7}_{-2.7}$ & $0.29$ & $\phantom{}^{+0.08}_{-0.03}$ & $-3.0$ & $\phantom{}^{+3.3}_{-4.0}$ & $-0.80$ & $\phantom{}^{+0.26}_{-0.21}$ \\[2mm] $|\eta|\ge 2.0$ (large) & $10.6$ & $\phantom{}^{+2.2}_{-2.7}$ & $0.21$ & $\phantom{}^{+0.10}_{-0.07}$ & $2.3$ & $\phantom{}^{+13}_{-9.3}$ & $0.80$ & $\phantom{}^{+1.09}_{-0.42}$ \\[2mm] $|\eta|\ge 2.0$ (small) & $11.5$ & $\phantom{}^{+2.2}_{-2.1}$ & $0.26$ & $\phantom{}^{+0.08}_{-0.06}$ & $-12.6$ & $\phantom{}^{+8.2}_{-9.7}$ & $1.59$ & $\phantom{}^{+0.47}_{-0.43}$ \\ \bottomrule \end{tabular} \end{table*} As an additional check, the value of $\pt^{\textrm{Cor,ID+MS}}$ is compared with $\pt^{\textrm{Cor,CB}}$. Results from both methods are in agreement within their respective systematic uncertainties. The comparison is performed on simulated samples with a biased alignment of the MS on muons with momenta ranging from few tens of \GeV\ to about 1 \TeV. The uncertainties in the momentum scale of $\pt^{\textrm{Cor,CB}}$ are found to be smaller than those of $\pt^{\textrm{Cor, ID+MS}}$ with a slightly larger uncertainty increase in the resolution as a function of the transverse momentum, as shown in \refA{app:results}. At high momenta the dominant uncertainty in $\pt^{\text{Cor,ID+MS}}$ originates from the residual muon spectrometer misalignment. \begin{figure*}[!t] \centering \subfloat[ ]{\includegraphics[width=0.45\linewidth]{fig_04a.pdf}} \subfloat[ ]{\includegraphics[width=0.45\linewidth]{fig_04b.pdf}} \caption{Resolution of the muon \pt\ as obtained from simulation after derivation and application of all correction constants. Muons are selected using the \highptwp{} WP\@. The resolution is shown as a function of the true \pt\ of the muon for a range from 1 \gev\ to 2.5 \tev, (a) for muons with $|\eta|<1.05$ and (b) for muons with $|\eta|>1.05$. The resolution lines are obtained by interpolating between points sampled in steps of $\pt$. The continuous lines correspond to the CB momentum, while the dashed lines to that from the ID, and the dotted lines to that of the MS\@. Statistical fluctuations, due to the simulated sample size result in small fluctuations on the interpolation between measured values.} \label{fig:MCresol} \end{figure*} The resolution as a function of the muon momentum is shown in \refF{fig:MCresol}, (a) for muons in the barrel region ($|\eta|<1.05$) and (b) for all other muons ($|\eta|>1.05$). The resolution is estimated by taking half of the smallest interval containing the 68\% of the distribution of the relative difference between the corrected and the generated single muon momentum in simulation for muons satisfying the \highptwp{} WP\@. The resolution is approximately 2\% (3\%) at \pt\ values of 45~\GeV{} in the $|\eta|<1.05$ ($|\eta|>1.05$) region and increases with \pt. The resulting CB track momentum resolution is always better than that of the individual measurements in the ID or the MS\@. At low \pt\, the ID dominates while in the intermediate regime of few tens of \gev\ to a few hundreds of \gev\ both detector systems contribute equally to the measurement. At \pt\ values higher than few hundred \gev\, the resolution is dominated by the MS\@. The resolution is approximately 14\% (19\%) at 1~\TeV{} in the $|\eta|<1.05$ ($|\eta|>1.05$) region. \section{Performance studies} \label{sec::validation} The samples of $\Jmm$, $\Upsmm$, and ${Z\to\mu\mu}$ decays are used to validate the momentum corrections obtained with the template fit method described in the previous sections and measure the muon momentum reconstruction performance. The detector segmentation applied to $\Jmm$ and ${Z\to\mu\mu}$ decays is chosen to be at least twice as fine as that used for deriving the simulation corrections. Furthermore, the momentum requirements used in both cases are looser than those used for deriving the corrections. The combination of the finer segmentation and looser requirements allows the data-driven validation of the correction methods both within the bins assumed in the template fits and extrapolated in \pt\ beyond the range of the calibration procedure. To complete the data-driven validation and performance measurements, an additional study is performed using $\Upsmm$ decays, which are statistically fully independent of the samples used to derived the calibration corrections. The invariant mass distributions for the $\Jmm$ and ${Z\to\mu\mu}$ candidates are shown in \refF{fig:Calib_InvMass} and compared with corrected simulation. The lineshapes of the two resonances in simulation agree with the data within the systematic uncertainties, demonstrating the overall effectiveness of the \pt\ calibration. \begin{figure*}[th] \centering \subfloat[ ]{\includegraphics[width=0.49\linewidth]{fig_05a.pdf}} \subfloat[ ]{\includegraphics[width=0.49\linewidth]{fig_05b.pdf}} \caption{Dimuon invariant mass distribution of (a) $\Jmm$ and (b) ${Z\to\mu\mu}$ candidate events reconstructed with CB muons. The upper panels show the invariant mass distribution for data and for the signal simulation plus the background estimate. The points show the data. The continuous line corresponds to the simulation with the MC momentum corrections applied. Background estimates are added to the signal simulation. The bands represent the effect of the systematic uncertainties in the MC momentum corrections. The lower panels show the ratios of the data to the MC simulation. In the $Z$ sample, the MC background samples are added to the signal sample according to their expected cross-sections. In the \jpsi sample, the background is estimated from a fit to the data as described in the text. The sum of background and signal MC distributions is normalised to the data.} \label{fig:Calib_InvMass} \end{figure*} When the two muons have similar momentum resolution and angular effects are neglected, the relative mass resolution, $\sigma_{\mu\mu}/m_{\mu\mu}$, is directly proportional to the relative muon momentum resolution, $\sigma_{p_{\mu}}/p_{\mu}$: \begin{equation} \frac{\sigma_{\mu\mu}}{m_{\mu\mu}} \, = \, \frac{1}{\sqrt{2}} \frac{\sigma_{p_{\mu}}}{p_{\mu}}. \label{eq:dmom} \end{equation} Similarly, the total muon momentum scale, defined as $s = \langle (p^\mathrm{meas} - p^\mathrm{true})/ p^\mathrm{true} \rangle$, is directly related to the dimuon mass scale, defined as $ s_{\mu\mu} = \langle (m_{\mu\mu}^\mathrm{meas} - m_{\mu\mu}^\mathrm{true})/ m_{\mu\mu}^\mathrm{true} \rangle$: \begin{equation} s_{\mu\mu} = \sqrt{s_{\mu_1}s_{\mu_2}}, \end{equation} where $s_{\mu_1}$ and $s_{\mu_2}$ are the momentum scales of the two muons. The effectiveness of the momentum calibration is also measured by comparing the mean value $m_{\mu\mu}$, and resolution $\sigma(m_{\mu\mu})$ of the dimuon mass resonances. To measure such quantities, fully analytical fit functions are created for each resonance modelling both the signal and the background. Using the same definition of the resolution function for all resonances, this methodology allows a direct comparison of the resolution quantities as extracted separately for each resonance. In turn, this allows a precise measurement of the momentum reconstruction performance across a wide kinematic regime. The fitting procedures used to measure the mean value and resolution quantities are optimised, subsequently, for each resonance. In $\Jmm$ decays, the intrinsic width of the resonance is negligible compared with the experimental resolution. In contrast to \refS{Sec:CorrectionExtraction}, the mass window for the $\Jmm$ validation fits is modified to $2.8<m_{\mu\mu}<3.9~\GeV$. The lower bound is raised to remove the abrupt spectrum sculpting due to the trigger criteria, which is difficult to model well analytically. The upper bound is extended to include the $\Psi(2S)$ resonance and add a lever arm to constrain the estimation of the resolution. The resonant peak of the $\jpsi$ is modelled by a double-sided Crystal Ball function; the four parameters modelling the tails are extracted from simulation, and subsequently fixed in the fits to data. A secondary double-sided Crystal Ball function models the $\Psi(2S)$ resonance that follows the $1s$ resonance in the $\jpsi$ validation mass window. Similarly to the $1S$ resonance, the parameters modelling the tails are extracted from simulation and kept fixed when fitting to data. The mean value parameter of the resolution function is kept free floating for the $\Psi(2S)$ resonance for fits on simulated and real data, while the resolution parameter is constrained to scale linearly with the resolution parameter of the $1S$ resonance using the ratio of the mean parameters. The non-resonant background or the background from mis-identified muons is described by an exponential function. \\ In ${Z\to\mu\mu}$ decays, the fits use a convolution of the true lineshape (modelled by a Breit--Wigner function) with an experimental resolution function (a double-sided Crystal Ball). A fit range of $75<m_{\mu\mu}<105~\GeV$ is used. Similarly to the \jpsi, the non-resonant background is described by an exponential function. The peak position and width of the Crystal Ball function are used as estimators for the $m_{\mu\mu}$ and $\sigma(m_{\mu\mu})$ variables in each of the $\eta$ and \pt\ bins. \refF{fig:mass_eta} shows the position of the mean value of the invariant mass distribution, $m_{\mu\mu}$, obtained from the fits to the $Z$ boson and \jpsi samples as a function of the pseudorapidity of the highest-$\pt$ muon for each decay. The distributions are shown for data and corrected simulation, with the ratios of the two in the lower panels. The simulation is in good agreement with the data. Minor deviations are within the momentum scale systematic uncertainties of $0.05\%$ in the barrel region increasing with $|\eta|$ to $0.15\%$ for $\Jmm$ decays, and to $0.05\%$ in the barrel region increasing with $|\eta|$ to $0.1\%$ for ${Z\to\mu\mu}$ decays. The systematic uncertainties shown in the plots include the effects of the uncertainties in the calibration constants described in \refS{Sec:CorrectionExtraction}. The observed level of agreement demonstrates that the \pt\ calibration for combined muon tracks described above provides an accurate description of the momentum scale in all $\eta$ regions, over a wide \pt\ range. Similar levels of data/MC agreement are observed for the ID and MS components of the combined tracks. \begin{figure*}[!hbt] \centering \subfloat[ ]{\includegraphics[width=0.49\linewidth]{fig_06a.pdf}} \subfloat[ ]{\includegraphics[width=0.49\linewidth]{fig_06b.pdf}} \caption{Fitted mean mass of the dimuon system for CB muons for (a) $\Jmm$ and (b) ${Z\to\mu\mu}$ events for data and corrected simulation as a function of the pseudorapidity of the highest-$\pt$ muon. The upper panels show the fitted mean mass value for data and corrected simulation. The small variations of the invariant mass estimator as a function of pseudorapidity are due to imperfect energy loss corrections and magnetic field description in the muon reconstruction. Both effects are well reproduced in the simulation. The lower panels show the ratios of the data to the MC simulations. The error bars represent the statistical uncertainty; the shaded bands represent the systematic uncertainty in the correction and the systematic uncertainty in the extraction method added in quadrature.} \label{fig:mass_eta} \end{figure*} \begin{figure*}[!hbt] \centering \subfloat[ ]{\includegraphics[width=0.49\linewidth]{fig_07a.pdf}} \subfloat[ ]{\includegraphics[width=0.49\linewidth]{fig_07b.pdf}} \caption{ Dimuon invariant mass resolution for CB muons for (a) $\Jmm$ and (b) ${Z\to\mu\mu}$ events for data and corrected simulation as a function of the pseudorapidity of the highest-$\pt$ muon. The upper panels show the fitted resolution value for data and corrected simulation. The lower panels show the ratios of the data to the MC simulations. The error bars represent the statistical uncertainty; the shaded bands represent the systematic uncertainty in the correction and the systematic uncertainty in the extraction method added in quadrature. For the ${Z\to\mu\mu}$ the estimator shown in the plot is only sensitive to the detector resolution and not to the natural width of the $Z$ boson, as discussed in the text. } \label{fig:width_eta} \end{figure*} \refF{fig:width_eta} displays the dimuon mass resolution $\sigma(m_{\mu\mu})$ as a function of the leading-muon $\eta$ for the two resonances. The dimuon mass resolution is about 1.3\% and 1.6\% at small $\eta$ values for the \jpsi and $Z$ bosons, respectively, and increases to 2.1\% and 2.4\% in the endcaps. This corresponds to a relative muon \pt\ resolution of 1.8\% and 2.3\% in the centre of the detector and 3.0\% and 3.4\% in the endcaps for \jpsi and $Z$ boson decays, respectively. Uncertainties in the dimuon mass resolution range between 2\% and 5\% for the \jpsi and between 3\% and about 6\% for the $Z$ boson, depending on the detector region. \begin{figure*}[!htb] \begin{center} \includegraphics[width=0.49\linewidth]{fig_08.pdf} \end{center} \caption{Dimuon invariant mass distribution of $\Upsmm$ candidate events reconstructed with CB muons. The upper panels show the invariant mass distribution for data and for the signal simulation plus the background estimate. The points show the data. The continuous line corresponds to the simulation with the MC momentum corrections applied. The band represents the effect of the systematic uncertainties in the MC momentum corrections. The lower panel shows ratio of the data to the MC simulations. The background is estimated from a fit to the data as described in the text. The sum of background and signal MC distributions is normalised to the data.} \label{fig:UpsilonMass} \end{figure*} Using the same methodologies as for the $\Jmm$ decays, the measurement of the scale dependence and resolution is repeated on the fully independent set of data from $\Upsmm$ decays. The same approach as for the $\jpsi$ resonances models the $2S$ and $3S$ resonances of the $\Upsilon$. This entails constraining the resolution parameter of the $3S$ resonance to scale linearly with that of the $2S$ resonance and that of the $2S$ resonance to scale linearly with that of the $1S$ resonance. The mean parameters of the resolution models of the $2S$ and $3S$ are kept free independently in data and simulation, similarly to what is done for the $\jpsi$ resonance. The background is, however, modelled using a polynomial function derived from data. \refF{fig:UpsilonMass} shows the data and simulation agreement after applying the momentum corrections on simulation for the invariant mass distributions of the three resonances of the $\Upsmm$. As done for the $\Jmm$ and ${Z\to\mu\mu}$ decays, the momentum scale dependency and the resolution are extracted as a function of the pseudorapidity of the leading muon in the event. \refF{fig:YScaleAndResolution} compares the data and simulation after all corrections. The data agree with the simulation within the systematic uncertainties. The uncertainty in the momentum scale is up to 0.05\% in the central region and up to 0.1\% in the forward region. Similarly, the extracted resolution is in agreement within about 3\%. Good agreement between the dimuon mass resolution measured in data and simulation is also observed when deriving the corrections independently for the ID and MS components of the combined tracks, as shown in \refA{app:results}. \begin{figure*}[!htb] \centering \subfloat[ ]{\includegraphics[width=0.49\linewidth]{fig_09a.pdf}} \subfloat[ ]{\includegraphics[width=0.49\linewidth]{fig_09b.pdf}} \caption{ (a) Fitted mean mass of the dimuon system for CB muons for $\Upsmm$ events in data and corrected simulation as a function of the pseudorapidity of the highest-$\pt$ muon. (b) Dimuon invariant mass resolution for CB muons for $\Upsmm$ events for data and corrected simulation as a function of the pseudorapidity of the highest-$\pt$ muon. The upper panels show the results obtained on data and simulation after all corrections. The lower panels show the ratios of the data to the MC simulation. The error bars represent the statistical uncertainty; the shaded bands represent the systematic uncertainty in the correction and the systematic uncertainty in the extraction method added in quadrature.} \label{fig:YScaleAndResolution} \end{figure*} The relative dimuon mass resolution $\sigma_{\mu\mu}/m_{\mu\mu}$ is approximately proportional to the average momentum of the muons, as shown in \refE{eq:dmom}. A direct comparison of the momentum resolution function determined with \jpsi{}, $\Upsilon$, and $Z$ boson decays can therefore be performed. To remove the effect of the correlation between the measurement of the dimuon mass resolution and the $\pt$ of the muons, the following definition of transverse momentum is used: \begin{equation} \pt^{*} = \hat{m} \sqrt{ \frac{\sin{\theta_1}\sin{\theta_2}}{2 (1-\cos \alpha_{12})}}, \end{equation} \noindent where $\hat{m}$ is a fixed value, corresponding to the best known value of the mass of the $Z$ boson, the $\jpsi$, and the $\Upsilon$, respectively. The variables $\theta_1$ and $\theta_2$ are the polar angles of the two muons, and $\alpha_{12}$ is the opening angle of the muon pair. The relative dimuon mass resolution from $\Jmm$, $\Upsmm$, and ${Z\to\mu\mu}$ events measured in data is compared with that obtained from calibrated simulation as a function of of $\pt^{*}$ in \refF{f:resol_vs_pt}. The resolutions are in good agreement. Due to the larger number of events, the $\Jmm$ measurement extends to higher momenta than the $\Upsmm$ one. \begin{figure*}[!htb] \begin{center} \includegraphics[width=0.49\linewidth]{fig_10.pdf} \end{center} \caption{ The upper panel shows the dimuon invariant mass resolution divided by the dimuon invariant mass for CB muons measured from $\Jmm$, $\Upsmm$ and ${Z\to\mu\mu}$ events as a function of the $ \pt^{*}$ variable defined in the text. To account for the resolution differences induced by the different pseudorapidity distributions among muons from the three resonances, the data and simulations are re-weighted according to the pseudorapidity distribution of the muon with the highest momentum from $\Upsmm$ decays. The lower panel shows the ratio of the data to the MC simulation. The error bars represent the statistical uncertainty, while the bands show the systematic uncertainties. } \label{f:resol_vs_pt} \end{figure*} \FloatBarrier \section{Conclusion} \label{sec:conclusion} The momentum performance of the ATLAS muon reconstruction is measured using 139~\ifb{} of data from $pp$ collisions at $\sqrt{s} = 13$~\TeV\ recorded during the second run of LHC between 2015 and 2018. Events from the ${Z\to\mu\mu}$ process are used to correct the reconstructed data for a charge-dependent bias in the muon momentum measurement associated with detector alignment effects. This bias is reduced on average from up to 0.4~$\TeV{}^{-1}$ to $2\cdot10^{-4}~\TeV{}^{-1}$ for muons with $\pt<450~\GeV$ after the corrections are applied, with associated uncertainty at the level of 0.03~$\TeV{}^{-1}$ for muons with transverse momentum of about $45~\GeV$. The scale and resolution of the muon momentum measurement is studied in detail using $\Jmm$ and ${Z\to\mu\mu}$ decays. These studies are used to correct the simulation, improving the agreement with the data and reducing the systematic uncertainties related to the muon calibration in physics analyses. The improvements in the \pt\ correction methods described in this paper and the substantial number of $\Jmm$ and ${Z\to\mu\mu}$ decays collected in the Run~2 data sample together improve the precision of the momentum scale by up to a factor of two relative to the previous publication based on 3.2 \ifb{} of collected data~\cite{PERF-2015-10}. For ${Z\to\mu\mu}$ decays, the uncertainty in the momentum scale varies from a minimum of $0.05\%$ for \mbox{$|\eta| <1$} to a maximum of \mbox{$0.15\%$} for \mbox{$|\eta|\sim 2.5$}. The dimuon mass resolution is about 1.3\% (1.6\%) at small values of pseudorapidity for \jpsi ($Z$) decays, and increases up to 2.1\% (2.4\%) in the endcaps. This corresponds to a relative muon \pt\ resolution of 1.8\% (2.3\%) at small values of pseudorapidity and 3.0\% (3.4\%) in the endcaps for \jpsi ($Z$) decays. After applying momentum corrections, the \pt\ resolution in data and simulation agree within the quoted uncertainties, which are at the level of, or better than, 5\% (6\%) for \jpsi ($Z$) decays depending on the $\eta$ range. Validation studies performed with ${Z\to\mu\mu}$ and $\Jmm$ show that the corrections applied to the simulation bring the agreement with the data to the level of their estimated uncertainties. An additional, statistically independent validation performed using $\Upsmm$ decays confirms the correctness of the correction procedure. \clearpage
\section{Introduction} \label{sec:intro} The ESO-VLT Multi-Instrument Kinematic Survey (hereafter the MIKiS survey; \citealt{ferraro+18a, ferraro+18b}) has been specifically designed to characterize the kinematical properties of a representative sample of Galactic globular clusters (GGCs) in different dynamical evolutionary stages. The approach proposed in MIKiS is to derive both the velocity dispersion and the rotation profiles from the line-of-sight velocities of a statistically significant sample of individual stars distributed over the entire radial extension of each investigated stellar system. To this end, the spectroscopic capabilities of different instruments located at the ESO Very Large Telescope (VLT) are used: the survey was designed to take advantage of the adaptive-optics (AO) assisted integral-field spectrograph SINFONI, the multi-object integral-field spectrograph KMOS, and the multi-object fiber-fed spectrograph FLAMES/GIRAFFE, and it has been recently complemented with a series of specific proposals and an ongoing Large Program (106.21N5, PI: Ferraro) which exploits the remarkable performances of the AO-assisted integral-field spectrograph MUSE. In particular, the powerful combination of the two AO-assisted integral-field spectrographs SINFONI and MUSE allows an unprecedented exploration of the kinematics of the innermost GGC core regions, reaching a spatial resolution comparable with that obtained from Hubble Space Telescope (HST) observations. Indeed the central portions of collisional stellar systems like the GGCs are the most intriguing regions where recurrent stellar interactions are expected to generate exotic objects, like interacting binaries, blue stragglers, millisecond pulsars \citep{bailyn95, pooley+03, ransom+05, ferraro+97, ferraro+01, ferraro+18c}. Moreover, even the long-sought intermediate-mass black holes \citep[IMBHs; e.g.][]{portegies+04,giersz+15} might populate the central regions of GCs according to the extrapolation of the ``Magorrian relation'' \citep{magorrian+98}. The MIKiS survey is part of a long-term project (Cosmic-Lab) aimed at performing a comprehensive study of a sample of representative GGCs. Thus, the kinematical information provided by MIKiS is combined with additional key properties of each system derived from complementary observations as: (1) plane-of-the-sky kinematics obtained from the stellar proper motions measured with HST and GAIA \citep[see, e.g.,][]{raso+20,leanza+22}; (2) updated structural parameters obtained from high-quality density profiles derived from star counts, instead of surface brightness \citep[e.g.,][]{miocchi+13, lanzoni+07, lanzoni+10, lanzoni+19, pallanca+21}; (3) properties of the populations of stellar exotica \citep{ferraro+01, ferraro+03, ferraro+15, ferraro+16, pallanca+10, pallanca+13, pallanca+14, pallanca+17, cadelano+17, cadelano+18, cadelano+20} and their connection with the dynamical evolution of the parent cluster \citep[see][]{ferraro+06, ferraro+09a, ferraro+12,ferraro+18a, ferraro+19, lanzoni+16}. In principle, this approach can provide the full characterization of the investigated stellar systems. In this paper, we present the velocity dispersion profile and the detection of internal rotation for NGC 6440, a massive, metal-rich ([Fe/H]$\sim -0.56$, \citealt{origlia+97,origlia+08}), and highly extincted \citep[$E(B-V)=1.15$,][see also \citealt{pallanca+19}]{valenti+04,valenti+07} GC, located in the Milky Way bulge, 1.3 kpc away from the center of the Galaxy \citep[][]{harris+96}. This system has been subject to a detailed analysis by our group because it was suspected \citep{mauro+12} to have properties similar to those detected in Terzan 5 and Liller 1, two massive clusters in the bulge direction that are suspected to be the relics of the primordial assembling process of the Galactic bulge and define a new class of stellar systems named ``Bulge Fossil Fragments'' \citep[see][]{ferraro+09b, ferraro+16, ferraro+21}. Those studies allowed us to re-determine with an improved level of accuracy the overall characteristics of NGC 6440, thus redesigning a sort of new identity card of the cluster. A high-resolution extinction map has been obtained \citep[see][]{pallanca+19} and used to correct the effects of the strong differential reddening in the direction of the cluster. This allowed us to derive a high-precision, differential reddening-corrected, proper motion-selected color-magnitude diagram (CMD), from which a new determination of the cluster age has been obtained \citep[see][]{pallanca+21}. This dataset has also been used to derive an accurate star density profile from which new structural parameters and characteristic relaxation times have been derived \citep[see][]{pallanca+21}. With regard to the study of the exotic populations, we provided the identification of the optical companion to an accreting millisecond X-ray pulsar \citep[see][]{cadelano+17}. The present paper is organized as follows. In Section \ref{sec:obs} we present the observations and describe the procedures performed for the data reduction. In Section \ref{sec:analysis} we discuss the selection of the samples, the methods to determine the radial velocities (RVs), and the strategy adopted to homogenize the different datasets available. The results are presented in Section \ref{sec:results}, while Section \ref{sec:discussion} is devoted to the discussion and conclusions. \section{Observations and data reduction} \label{sec:obs} To characterize the internal kinematics of NGC 6440, we measured the RVs of resolved, individual stars distributed over the entire radial extension of the system by using a multi-instrument approach. \begin{itemize} \item{\it MUSE -} The spectra of the stars in the innermost cluster regions were acquired with the AO-assisted integral-field spectrograph MUSE in the Narrow Field Mode (NFM) configuration \citep{bacon+10}, as part of the NFM science verification run (program ID: 60.A-9489(A), PI: Ferraro, see Table \ref{tab:data}). MUSE is located on the Yepun (VLT-UT4) telescope at the ESO Paranal Observatory. It consists of 24 identical Integral Field Units (IFUs) and it is available in two configurations, Wide Field Mode (WFM) and NFM, the latter providing a higher spatial resolution. MUSE/NFM is equipped with the GALACSI-AO module \citep{Arsenault+08, Strobele+12} and covers a $7.5\arcsec\times 7.5\arcsec$ field of view with a spatial sampling of $0.025\arcsec$/pixel. The spectral range samples from $4800$ \AA\ to $9300$ \AA\ with a resolving power R $\sim3000$ at $\lambda\sim8700$ \AA. Our MUSE dataset consists of a mosaic of four MUSE/NFM pointings centered within $15 \arcsec$ from the cluster center \citep{pallanca+21}. For each pointing, multiple exposures, usually three, were acquired with a small dithering pattern and a rotation offset of $90 \arcdeg$ between consecutive exposures, in order to remove possible systematic effects and resolution differences between the individual IFUs. Each exposure has been acquired with an exposure time of 850 s, and the DIMM seeing during the observations ranged from $0.45\arcsec$ to $0.8\arcsec$. The MUSE/NFM dataset was reduced by using the standard MUSE pipeline \citep{Weilbacher+20}. In a first step, the pipeline applies the bias subtraction, flat fielding, and wavelength calibration for each individual IFU, and, in a second step, it uses these pre-processed data of each IFU to perform the sky subtraction and flux and astrometric calibration. Also, all the data are corrected for the heliocentric velocity. Then, the data from all 24 IFUs are combined into a single datacube. As the last step, the pipeline provides a final datacube by combining the datacubes of the multiple exposures of each pointing, taking into account the offsets and rotations among the different exposures. The mosaic of the reconstructed $I$-band images from the stacking of MUSE datacubes is shown in the left panel of Figure \ref{fig:mosaico}. Each pointing is labeled with a name according to its position with respect to the cluster center (``C'', ``S'', ``E'', and ``N'' standing for central, southern, eastern, and northern pointing, respectively). \item{\it SINFONI - } The MUSE/NFM data analysis in the innermost cluster regions has been complemented using additional AO-assisted integral-field observations, performed with the spectrograph SINFONI \citep{Eisenhauer+03} at the ESO-VLT, in the near-infrared range $1.1 - 2.45 \mu$m. The observations were conducted under ESO proposals 093.D-0319(A), PI: Lanzoni, and ID:195.D-0750(A), PI: Ferraro (see Table \ref{tab:data}), by using the $K-$band grating, providing a spectral resolution R $\sim$ 4000 and sampling the $1.95 - 2.45 \ \mu$m wavelength range. The dataset covers a region within $\sim16\arcsec$ from the cluster center, and consists of 7 pointings acquired by adopting the spatial scale of $0.25\arcsec$/spaxel corresponding to a field of view of $8\arcsec\times 8\arcsec$ (hereafter named ``LR'' for low resolution), and 3 pointings with the spatial scale of $0.1\arcsec$/spaxel and a $3\arcsec\times 3\arcsec$ field of view (hereafter, ``HR'' for high resolution). Multiple exposures (usually 6 for the LR pointings, and 12 for the HR fields) of 20-30 s each were performed on the target and, for background subtraction purposes, on a sky position located $\sim 165\arcsec$ from the center, following the target-sky sky-target sequence. The observations have been executed under an average DIMM seeing of $\sim 0.8\arcsec$, leading to a Strehl ratio between 10 and 40. The data reduction was performed by using esorex (3.13.6) following the workflow 3.3.2 under the EsoReflex environment \citep{Freudling+13}. The pipeline first corrects all target and sky exposures for darks, flats, geometrical distortions, and differential atmospheric refraction. Then, the sky background is subtracted by using the sky exposures, the wavelength calibration is performed through the observations of a Th-Ar reference arc lamp, and, the datacubes are built for each exposure by combining the corrected target frames. The right panel of Figure \ref{fig:mosaico} shows the reconstructed image of the SINFONI pointings obtained by stacking the datacubes in the wavelength range $2.15 - 2.18 \mu$m. Clearly, some stars are in common with the MUSE dataset, but the SINFONI pointings, in spite of a worse angular resolution, also sample the west and south-west regions around the cluster center that remained uncovered by MUSE (see Figure \ref{fig:pointings}). In Figure \ref{fig:confronto_instruments} we compare the same cluster region as seen in the reconstructed MUSE and SINFONI images (central and right panels, respectively) and in the HST observations (left panels). This well illustrates the exceptional resolving capabilities of the AO systems used in the SINFONI (especially in the HR setput) and, even more, in the MUSE observations, which are mandatory to obtain large samples of RVs of individual stars in the high-density core of dense stellar systems like NGC 6440. \item{ KMOS -} To investigate the cluster kinematics at intermediate distances from the center, we have used the integral-field spectrograph KMOS \citep{Sharples+13} at ESO-VLT, which is equipped with 24 IFUs that can be allocated within a 7.2$\arcmin$ diameter field of view. Each IFU covers a projected area on the sky of about $2.8\arcsec \times 2.8\arcsec$, with a spatial sampling of $0.2\arcsec$/pixel. We have used the YJ grating covering the 1.025-1.344 $\mu$m spectral range at a resolution R $\sim$ 3400, corresponding to a spectral sampling of $\sim 1.75$ \AA/pixel. The data have been collected as part of the ESO Large Program ID: 193.D-0232(A). These consist in 12 pointings within $\sim 6\arcmin$ from center, each one obtained with three sub-exposures 30 s long. Every IFU is typically centered on one star, selected at $J < 14$ along the red giant branch (RGB) of the cluster from the near-infrared SOFI catalog available at the web site \url{http://www.bo.astro.it/~GC/ir_archive/} \citep{valenti+04,valenti+07} and a 2MASS catalog in the $J$, $H$, and $Ks$ filters sampling the outer regions. The KMOS data reduction has been performed by using the dedicated pipeline\footnote{\label{note1}http://www.eso.org/sci/software/pipelines/} executing background subtraction, flat field correction, and wavelength calibration. \item{ FLAMES -} The external regions of NGC 6440 have been sampled out to $\sim 12\arcmin$ from the center by using the fiber-fed multi-object spectrograph FLAMES \citep{Pasquini+02} in the GIRAFFE/MEDUSA mode. This configuration consists of 132 fibers, each one with an aperture of 1.2$\arcsec$ on the sky, that can be allocated over a field of view of 25$\arcmin$ in diameter. As for KMOS, also the FLAMES observations have been performed within the MIKiS survey under the ESO Large Program 193.D-0232(B). The spectra were acquired with the HR21 grating setup, which provides a resolving power $R\sim 18000$ between 8484 and 9001 \AA. Five pointings have been performed, each one securing two exposures of 2700 s. The targets are RGB stars brighter than $J = 14$ selected from the same photometric SOFI catalog used for the KMOS targets and from the 2MASS catalog. The dataset has been reduced with the dedicated ESO pipelines\footnote{http://www.eso.org/sci/software/pipelines/}, including bias subtraction, flat-fielding correction, wavelength calibration, and extraction of one-dimensional spectra. For each spectrum, the sky background has been subtracted, using a master sky spectrum obtained from the sky exposures acquired with 15-20 dedicated fibers in each pointing. \end{itemize} \begin{deluxetable*}{clcCC} \tablecaption{Spectroscopic datasets for NGC 6440.} \tablewidth{0pt} \setlength{\tabcolsep}{10pt} \renewcommand{\arraystretch}{1} \tablehead{ \colhead{ Name } & \colhead{} & \colhead{Date} & \colhead{N$_{\rm exp}$} & \colhead{$t_{\rm exp}$ [s]} } \startdata \hline \multicolumn{5}{c}{MUSE/NFM}\\ \hline C & & 2018-09-14 & 3 & 850\\ E & & 2018-09-14 & 3 & 850\\ N & & 2018-09-12 & 3 & 850\\ S & & 2018-09-13 & 2 & 850\\ \hline \multicolumn{5}{c}{SINFONI}\\ \hline HR & & 2014-08-16 & 5 & 20\\ LRNE & & 2014-08-14 & 5 & 20\\ LRSE & & 2014-08-14 & 4 & 20\\ HRC & & 2015-06-24 & 6 & 30\\ & & 2016-07-21 & 6 & 30\\ HRE & & 2015-06-25 & 6 & 20\\ & & 2016-07-29 & 6 & 20\\ LRE & & 2016-07-30 & 6 & 30\\ LRN & & 2016-06-30 & 6 & 30\\ LRS & & 2016-07-30 & 6 & 30\\ LRSW & & 2015-07-17 & 6 & 30\\ LRW & & 2016-07-29 & 6 & 30\\ \hline \multicolumn{5}{c}{KMOS}\\ \hline kmos\rule{.5em}{.3pt}{}1 & & 2014-05-10 & 3 & 30 \\ kmos\rule{.5em}{.3pt}{}2 & & 2014-07-13 & 3 & 30 \\ kmos\rule{.5em}{.3pt}{}3 & & 2014-07-04 & 3 & 30 \\ kmos\rule{.5em}{.3pt}{}4 & & 2014-07-13 & 3 & 30 \\ kmos\rule{.5em}{.3pt}{}5 & & 2014-07-13 & 3 & 30 \\ kmos\rule{.5em}{.3pt}{}6 & & 2014-07-13 & 3 & 30 \\ kmos\rule{.5em}{.3pt}{}7 & & 2014-07-13 & 3 & 30 \\ kmos\rule{.5em}{.3pt}{}8 & & 2014-07-13 & 3 & 30 \\ kmos\rule{.5em}{.3pt}{}9 & & 2014-07-13 & 3 & 30 \\ kmos\rule{.5em}{.3pt}{}10 & & 2014-07-13 & 3 & 30 \\ kmos\rule{.5em}{.3pt}{}external\rule{.5em}{.3pt}{}1 & & 2014-07-20 & 3 & 30 \\ kmos\rule{.5em}{.3pt}{}external\rule{.5em}{.3pt}{}2 & & 2014-07-20 & 3 & 30 \\ \hline \multicolumn{5}{c}{FLAMES}\\ \hline flames\rule{.5em}{.3pt}{}1 & & 2014-06-19 & 2 & 2700 \\ flames\rule{.5em}{.3pt}{}2 & & 2014-06-20/23 & 2 & 2700 \\ flames\rule{.5em}{.3pt}{}3 & & 2014-06-23/2014-07-08 & 2 & 2700 \\ flames\rule{.5em}{.3pt}{}alt\rule{.5em}{.3pt}{}1 & & 2014-07-08 & 2 & 2700 \\ flames\rule{.5em}{.3pt}{}alt\rule{.5em}{.3pt}{}2 & & 2014-07-08 & 2 & 2700 \\ \hline \enddata \tablecomments{Name, observation date, number of exposures (N$_{\rm exp}$), and exposure time ($t_{\rm exp}$, in seconds) of each exposure for the MUSE/NFM, SINFONI, KMOS and FLAMES pointings analyzed in this paper. In the name of the SINFONI pointings, LR and HR indicate the two different instrument configurations used here (low and high resolution, respectively).} \label{tab:data} \end{deluxetable*} \begin{figure}[ht!] \centering \includegraphics[width=18cm, height=7.8cm]{6440_mosaico_MUSE_SINFONI_2.pdf} \centering \caption{{\it Left:} Reconstructed $I$-band images of the MUSE/NFM pointings. The circle is centered on the cluster center (red cross, from \citealp{pallanca+21}) and has a radius of $10\arcsec$. {\it Right:} Reconstructed mosaic of the SINFONI/LR fields (each sampling $8\arcsec\times 8\arcsec$ on the sky) and SINFONI/HR pointings (with a $3\arcsec\times 3\arcsec$ field of view). The red cross and the circle are as in the left panel. In both panels the names of the pointings are labelled.} \label{fig:mosaico} \end{figure} \begin{figure}[ht!] \centering \includegraphics[width=9.5cm, height=9.5cm]{6440_mosaico_comb_2.pdf} \centering \caption{HST/WFC3 image of the central region of NGC 6440 with the areas sampled by the spectroscopic observations overplotted: the blue squares show the fields of the four MUSE/NFM pointings ($\sim 8\arcsec\times 8\arcsec$ on the sky), the red large squares are the SINFONI/LR fields ($\sim 8\arcsec\times 8\arcsec$), and the small red squares are the SINFONI/HR pointings ($\sim 3\arcsec\times 3\arcsec$). The black circle has a radius of $10\arcsec$ and is centered on the cluster center (yellow cross, from \citealp{pallanca+21}).} \label{fig:pointings} \end{figure} \begin{figure}[ht!] \centering \includegraphics[width=12.2cm, height=9.1cm]{POINTINGS_LAST.pdf} \centering \caption{\textit{Upper panels}: comparison among the HST/WFC3 image (left panel), the reconstructed $I$-band image of a MUSE/NFM pointing (central panel) and the stack image of a SINFONI/LR pointing (right panel), of a central area of NGC 6440. In the left panel, the blue square marks the MUSE/NFM field of view ($\sim 8\arcsec\times 8\arcsec$ on the sky), as in the central panel, and the red region indicates the SINFONI/LR pointing ($\sim 8\arcsec\times 8\arcsec$) shown in the left panel, while, in all the panels, the yellow dashed lines mark the common area among the three images. \textit{Bottom panels}: comparison among the images of the same area of the cluster (bounded by the red square, $\sim 3\arcsec\times 3\arcsec$ on the sky) obtained using HST/WFC3 (left), MUSE/NFM (central), and the stack image of a SINFONI/HR pointing (right). The blue square in the left panel marks the area of MUSE/NFM field ($\sim 8\arcsec\times 8\arcsec$ on the sky) shown in the central panel.} \label{fig:confronto_instruments} \end{figure} \section{Analysis} \label{sec:analysis} To properly analyze the four datasets, each one acquired with a different instrument, we have performed specific analyses. They are fully described in dedicated papers and briefly summarized below. \subsection{MUSE/NFM dataset}\label{muse} For the extraction of the spectra from the MUSE/NFM datacubes we used the code PampelMuse presented in \citet{kamann+13}. This is a software dedicated to the extraction of individual stellar spectra from MUSE data in crowded regions of the sky, such as GC cores, by performing a source deblending via wavelength-dependent point spread function (PSF) fitting. While all the details can be found in \citet{kamann+13}, in the following we briefly describe the main steps of the procedure. Besides the spectroscopic datacube, PamelMuse needs in input a photometric reference catalog providing the coordinates and magnitudes of all the stars across the field of view. To ensure high photometric completeness and astrometric accuracy, we have used the HST/WFC3 catalog presented in \citet{pallanca+21}, and, to properly include also, the brightest stars ($I<16$), which are saturated in those long-exposures used to build the catalog above, we analyzed the HST/WFC3 images acquired under the proposal GO15232 in the F555W and F814W filters (hereafter, $V$ and $I$, respectively). The photometric analysis of this dataset has been performed following the procedures described in \citet{anderson_king_2006}, using the publicly available program img2xym\rule{.5em}{.3pt} WFC.09x10. To place the instrumental coordinates onto the absolute astrometric system, and to calibrate the instrumental magnitudes we have used the stars in common with the catalog of \citet{pallanca+21}. For source deblending purposes, PampelMuse also needs in input an analytical PSF model. We thus selected the MAOPPY function \citep{fetick+19}, which is already implemented in the code \citep[see][]{gottgens+21} and is designed to accurately reproduce the typical double-component (core and halo) shape of the AO-corrected PSF in MUSE/NFM observations. Once setting the inputs, the spectra are extracted from the observed datacubes through subsequent steps. First, a sub-sample of isolated stars, on which the PSF will be modelled, is selected according to several criteria, including: signal-to-noise ratio higher than a certain threshold (S/N$>5$), relative contribution from neighboring sources negligible in region where the PSF is modelled, and no bright stars within a distance equal to 1.5 $\times$ the PSF definition radius. The S/N is mainly estimated from the magnitudes in the input catalog and an initial guess on the PSF parameters. In the second step, the PSF fitting procedure is applied to the selected sub-sample of stars in each individual slice of the datacube, providing, as output, the wavelength dependencies of the PSF parameters and of the source coordinates. Finally, these wavelength dependencies are adopted in the PSF-fitting procedure that is performed through the slices of the datacube, to extract the spectra of all the sources present in the MUSE field of view. Among all the extracted spectra, we selected only those marked as ``good'' by PampelMuse, which correspond to individual stars with S/N $\geq 10$. The RVs of the target stars have been measured from the Doppler shifts of the Calcium Triplet lines in the wavelength range $8450-8750$ \AA. To this end, the extracted spectra have been normalized to the continuum (estimated through a spline fitting in the $7300 - 9300$ \AA \ range). Then, a library of template synthetic spectra has been computed with the SYNTHE code (\citealt{Sbordone+04} and \citealt{kurucz+05}), assuming an $\alpha-$enhanced chemical mixture and the cluster metallicity ([$\alpha$/Fe]$=0.34$ dex and [Fe/H]$=-0.56$ dex; \citealt{origlia+08}), and adopting a set of atmospheric parameters (effective temperature and gravity) appropriate for the evolutionary stage of the target stars, as derived from the CMD. The template spectra have been convolved with a Gaussian profile to reproduce the spectral resolution of MUSE, and re-sampled at the same pixel size of the observed spectra. The procedure adopted to measure the target RV computes the residuals between the observation and each template spectrum of the library shifted in velocity in steps of 0.1 km s$^{-1}$. The distribution of the residuals showing the smallest standard deviation ($\sigma_{\rm min}$) provides the best-fit synthetic spectrum (hence, the best estimate of the stellar atmospheric parameters), and from the minimum of this distribution the RV of the target is derived. A value of S/N independent of that obtained by PampelMuse has been computed for each spectrum as the ratio between the average of the counts and their standard deviation in the wavelength range $8000 - 9000$ \AA. We will use this S/N estimate in the following analysis.\\ The uncertainties on the RV measures have been estimated by means of Monte Carlo simulations. By adding different amounts of Poisson noise to the adopted synthetic templates, we simulated $\sim 9000$ observed spectra with S/N ratios ranging from 10 to 90, in step of 10, running 100 simulations for every considered value of S/N. Then, this sample has been analyzed as for real observations, computing the residuals between the simulations and each synthetic spectrum of the library progressively shifted in velocity, as described above. For each synthetic spectrum we selected the distribution of residuals showing the smallest standard deviation ($\sigma_{\rm min}$) and we adopted the corresponding value of RV. This allowed us to plot the difference between the output and the input RVs ($\Delta$RV) as a function of $\sigma_{\rm min}$, from which a polynomial relation between the two parameters has been obtained, with the values of $\Delta$RV increasing for increasing $\sigma_{\rm min}$ (hence, for decreasing S/N ratios). Finally, knowing the value of $\sigma_{\rm min}$ of the observed spectra, we used this relation to determine the corresponding value of $\Delta$RV, which has been adopted as RV uncertainty. The typical RV errors are $\sim 2$ km s$^{-1}$ for the brightest stars ($I<16$), and they increase up to $\sim 8$ km s$^{-1}$ for the faintest targets, as shown in the top-left panel of Figure \ref{fig:err_mag}. To check that the measured RVs were homogeneous among the different MUSE pointings, we compared the values obtained for the stars in common between the two overlapping fields (the central and the east ones), and the average RV value obtained in each pointing, always finding a good agreement within the errors. In the case of multiple exposures for the same star, we adopted as the final RV the weighted mean of all the measures, by using the individual errors as weights. The final MUSE catalog consists of 1128 individual RV measures for stars located between $\sim 0.1\arcsec$ and $\sim 18\arcsec$ from the cluster center, in the magnitude range $13< I < 22$ (see Table \ref{tab:catalogo}). The position of the stars on the plane of the sky is shown in the right panel of Figure \ref{fig:mappa} (blue triangles), while the first panel on the left of Figure \ref{fig:cmd} shows the corresponding CMD. \begin{figure}[ht!] \centering \includegraphics[width=17cm, height=8.7cm]{plot_eRV_mag_LASTnew.pdf} \centering \caption{RV uncertainty ($\epsilon_{\rm RV}$) as a function of the star magnitude for the observed targets in the MUSE/NFM, SINFONI, FLAMES, and KMOS samples (top-left, bottom-left, top-right, and bottom-right panels, respectively, see labels).} \label{fig:err_mag} \end{figure} \subsection{SINFONI dataset} \label{sec:sinfo} A forthcoming paper (Cristina Pallanca et al., 2023, in preparation) will be specifically devoted to the detailed description of the procedure adopted for the analysis of the SINFONI spectra. Here we just summarize the main key points. First of all, in each observed datacube, we selected all the spaxels with photon counts above a threshold of $10 \sigma$ the background level. Setting the threshold level to such a high value guantantees the selection of only the spaxels acquired at the largest S/N ratio. A value of RV has been measured from the 1D spectrum extracted from each selected spaxel, applying a procedure analogous to that adopted for the MUSE/NFM data, using the Doppler shift of the $^{12}C^{16}O$ band-heads, instead of the Calcium Triplet lines. More specifically, the observed spectra have been compared with synthetic templates progressively shifted in velocity, computed with the SYNTHE code \citep{Sbordone+04, kurucz+05} in the appropriate NIR wavelength range and at the SINFONI spectral resolution. We used synthetic spectra computed for 10 pairs of effective temperature and surface gravity properly sampling the entire RGB of the cluster, with iron and $\alpha-$element abundances measured by \citet{origlia+08}, plus 7 additional models with appropriate carbon-depletion [C/Fe]$=-0.36$ dex \citep{origlia+08} for stars above the RGB bump. This is to take into account the fact that the deepness of the CO band-heads depends on both the temperature and the chemical abundance, and the stars above the RGB bump could be depleted in carbon. The best estimates of the RV and its uncertainty have been evaluated as in the case of the MUSE data, from the distribution of the residuals between the observed and the synthetic spectra showing the smallest standard deviation, and from Monte Carlo simulations, respectively. The RV errors are of the order of 2 km s$^{-1}$ and their trend as a function of the star magnitude is shown in the bottom-left panel of Figure \ref{fig:err_mag}. From the cross-correlation with the HST catalog described above we finally identified the resolved stars in each SINFONI datacube. To enhance the quality of the dataset, for each source we used only the RV measured from the central spaxel (with the largest S/N ratio). By comparing the values obtained from repeated observations of the same stars (which are available especially in the HR fields), and the average RVs of each field, we verified that no relevant offsets in the RV zero points are present, the average differences being about 2 km s$^{-1}$, which is consistent with the value of the standard deviation. Hence, the final RV catalog has been generated by averaging the values measured in different datacubes in case of multiple exposures of the same star, using the estimated errors as weights. If a star was sampled both in an HR and in a LR pointing, we kept the value measured in the former for the higher spatial resolution of this instrumental setup. As discussed below, to reliably investigate the internal kinematics of NGC 6440 we restricted the sample of RVs to the safest measures only. The SINFONI data sample the cluster core where stellar crowding is critical, but the procedure used to extract the spectra includes no source deblending algorithms. Hence, the derived RVs might be affected by the presence of brighter neighboring stars, and this can impact the final results in terms of the cluster velocity dispersion and systemic rotation. To address this issue and select only the spectra contributed by the light of individual stars, we applied the procedure described in \citet{leanza+22}, which is briefly summarized here. Using as inputs the list of detected stars from the HST catalog and the PSF model adopted in the SINFONI data reduction, the procedure computes the contamination parameter ($C$) as the ratio between the fraction of light contributed by the first contaminant and that of the target under analysis, where the first contaminant is the neighboring source providing the second largest contribution of light to the central spaxel, after the target itself. For the final SINFONI sample we selected only the safest targets, with negligible contamination from neighboring sources, by including only the stars with contamination parameter lower than 3\% ($C<0.03$). The final catalog consists of 138 RVs for individual stars located between $1.1\arcsec$ and $15.0\arcsec$ from the cluster center (red circles in the right panel of Figure \ref{fig:mappa}), in the magnitude range $13< I < 18$ (see Table \ref{tab:catalogo}). The CMD of the targets is shown in the second panel from the left of Figure \ref{fig:cmd}. \begin{deluxetable*}{cCCC} \tablecaption{Summary of the different datasets used in this work.} \tablewidth{0pt} \setlength{\tabcolsep}{10pt} \renewcommand{\arraystretch}{1} \tablehead{ \colhead{ Dataset } & \colhead{ Number of stars } & \colhead{Radial region in arcsec} & \colhead{Magnitude range}} \startdata MUSE/NFM & 1128 & 0.1 - 18.0 & 13.0<I<22.0 \\ SINFONI & 138 & 1.1 - 15.0 & 13.0 < I < 18.0 \\ KMOS & 258 & 1.1 - 407.3 & 9.2< J < 13.5 \\ FLAMES & 448 & 22.0 - 778.5 & 8.6 < J < 13.5 \\ \enddata \tablecomments{For each dataset, the columns list the name of the instrument, the number of stars with RV measured, the sampled radial region expressed as the distance from the center in arcsec, and the magnitude range of the target stars.} \label{tab:catalogo} \end{deluxetable*} \subsection{KMOS and FLAMES datasets} \label{sec:kmos_flames} The procedures adopted to measure the RVs of the KMOS and FLAMES targets are fully described in \citet{ferraro+18a,ferraro+18b}, where the MIKis survey is presented. Briefly, for the KMOS observations, the 1D spectra have been extracted manually by visually inspecting each IFU and selecting the most exposed spaxel, which corresponds to the stellar centroid. Then, after correction for heliocentric velocity, both KMOS and FLAMES spectra have been cross-correlated with template spectra following the procedure described in \citet{tonry_davis_79}, which is implemented in the FXCOR task under the software IRAF. To verify that using two different methods does not introduce systematic effects in the RV measurements, we applied the cross correlation of IRAF to the MUSE spectra, obtaining results in perfect agreement with those obtained with the method described in Section \ref{muse}. As in the cases of the other datasets, the template spectra have been computed with the SYNTHE code \citep{Sbordone+04, kurucz+05} in the appropriate wavelength range, adopting the cluster metallicity and RGB atmospheric parameters, and applying a convolution with a Gaussian profile to reproduce the instrument spectral resolutions. For KMOS observations, the RV has been obtained from the cross-correlation with individual near-IR features in the sampled wavelength range, and the RV uncertainties have been derived using Monte Carlo simulations similar to those used for MUSE and SINFONI. For the FLAMES targets, the RV has been measured in three different regions of the spectrum, each including a large number of atomic lines, and the final value and its uncertainty have been obtained, respectively, as the average of the three measures, and their dispersion divided by the square root of 3. The typical RV errors are of the order of 1-5 km s$^{-1}$ for the KMOS targets, while they decrease to $\sim 0.1$-0.3 km s$^{-1}$ for the FLAMES measures (bottom-right and the top-right panels of Figure \ref{fig:err_mag}, respectively). The final KMOS and FLAMES samples consist of 258 and 448 RV measures, respectively (see Table \ref{tab:catalogo}). The left panel of Figure \ref{fig:mappa} shows the position of the stars on the plane of the sky with orange triangles and green crosses for the FLAMES and KMOS samples, respectively, while the corresponding CMDs are shown in the third (KMOS) and fourth panels (FLMAES) from the left of Figure \ref{fig:cmd}. \begin{figure}[ht!] \centering \includegraphics[width=17.6cm, height=8.4cm]{mappa_RVwe_final.pdf} \centering \caption{Maps on the plane of the sky, with respect to the adopted cluster center (black cross), of the stars with measured RV for each dataset. The left panel shows the external portion of the cluster sampled by the FLAMES (orange triangles) and the KMOS (green crosses) datasets. The two circles mark distances of 100$\arcsec$ and 481.4$\arcsec$ (corresponding to the truncation radius of the cluster, see \citealt{pallanca+21}) from the center. The right panel is focused on the central region covered by the MUSE (blue triangles) and SINFONI (red circles) samples. A few KMOS targets are also visible (green cross). The two circles mark distances of 5$\arcsec$ and $10\arcsec$ from the center.} \label{fig:mappa} \end{figure} \begin{figure}[ht!] \centering \includegraphics[width=17cm, height=10.2cm]{CMD_Rvwe_final.jpg} \centering \caption{CMDs of NGC 6440 with the star having measured RV highlighted. \textit{Left panels}: the gray dots show the ($I, V-I$) CMD obtained from the photometric catalog discussed in \citet{pallanca+21}, with overplotted the MUSE (left) and SINFONI (right) samples. The blue triangles on the left and the red circles on the right mark, respectively, the MUSE and SINFONI targets after all the membership and quality selections described in Sections \ref{membership} and \ref{sec:results}, respectively, while the black dots are the rejected targets. \textit{Right panels}: ($J, J-K$) CMD obtained from the reference SOFI/2MASS catalog (gray dots in both the panels; see Section \ref{sec:obs}), with the KMOS and FLAMES datasets highlighted on the left and on the right, respectively. The green crosses on the left and the orange triangles on the right correspond to the KMOS and FLAMES samples selected for the kinematic analysis, respectively (see Section \ref{membership} and \ref{sec:results}). The black dots indicate the rejected stars. Note that in each panel, the targets observed by two or more instruments are also included.} \label{fig:cmd} \end{figure} \subsection{Final combined catalog}\label{comb_catalog} Before combining all the RV measurements in a single final catalog, we have checked for possible systematic offsets among the different catalogs. These could be due to the different instrumental setups, including the wavelength range used to derive the RVs, and also the different spectral resolution of each spectrograph. To this aim, we compared the RVs of the stars in common between two datasets, using only reliable RV measures (i.e., high S/N and small RV uncertainty) and adopting the values obtained from the FLAMES observations as reference, due to the highest spectral resolution of this instrument. From the stars in common between FLAMES and KMOS, we found an average offset of $-5.2$ km s$^{-1}$, which was then applied to the KMOS measures for realigning this sample with the reference one. Unfortunately, no stars are in common between the FLAMES dataset and the MUSE and SINFONI ones, since they sample very different regions of the cluster. Moreover, no reliably enough RV measures from the KMOS observations have been found in common with the MUSE and SINFONI datasets. Therefore, to realign the innermost samples with the reference catalog, we compared, after excluding the obvious outliers, the average velocities obtained from the FLAMES and the MUSE catalogs finding a good agreement within the errors ($-67.5 \pm 1.1$ km s$^{-1}$ and $-67.7 \pm 0.5$ km s$^{-1}$, respectively). As last step, a very small residual offset of $-1.0$ km s$^{-1}$ was detected between the RVs of the stars in common between the MUSE and the SINFONI datasets. Hence, this offset was applied to the SINFONI RVs to realign this sample with all other catalogs. To create the final catalog, we combined the four datasets (summarize in Table 2) by performing a weighted mean of the RV measures by using the individual errors as weights, for the targets observed by more than one instrument. The final catalog consists of 1831 RV measurements of individual stars \footnote{The final catalog including the identification number, right ascension, declination, RV measure and its error for each star is available for free download at: \url{http://www.cosmic-lab.eu/Cosmic-Lab/MIKiS_Survey.html}} sampling the entire radial extension of the cluster, from $0.1\arcsec$, out to $778\arcsec$ (corresponding to $\sim 1.6$ times the truncation radius $r_t=481.4\arcsec$, and $\sim 15$ times the three-dimensional half-mass radius $r_h=50.2\arcsec$; see \citealt{pallanca+21}) from the cluster center, as shown in Figure \ref{fig:mappa}, and covering a wide magnitude range ($13<I<22$, see Figure \ref{fig:cmd}). \subsection{Cluster membership} \label{membership} Being a GC in the bulge direction, the contamination from field stars of the population of NGC 6440 is not negligible. For this reason, a thoughtful and accurate analysis was performed to properly address the issue of cluster membership of the measured stars. For the external sample (FLAMES and KMOS), we took advantage of the proper motions (PMs) provided in the Gaia EDR3 \citep{gaiaEDR3}: we selected as cluster members the stars with PMs within 0.9 mas yr$^{-1}$ from the absolute motion of NGC 6440 \citep{vasiliev+21} in the vector-point diagram (VPD, see the top-left panel of Figure \ref{fig:members}), this value corresponding to $\sim 3$ times the central velocity dispersion of NGC 6440 (see Section \ref{sec:2ndv}), assuming a distance of $8.3$ kpc \citep{pallanca+21}. The same could not be done for the internal sample (mostly MUSE and SINFONI) because they either have no measured PM, or the measures are not reliable, due to the limited capabilities of Gaia in the very central regions of dense GCs like NGC 6440. Therefore, to identify the cluster members in the innermost samples, we used the same criteria based on the relative HST PMs presented in \citet{pallanca+19}. The VPD and the member selection of the internal sample are shown in the top-right panel of Figure \ref{fig:members}. The bottom panel of the figure shows the measured RVs as a function of the distance from the center, with the PM-selected member stars highlighted as large, colored circles. As apparent, the RVs of the bulk of cluster members are centered at about $-67$ km s$^{-1}$, while field stars have significantly different (especially, larger) RVs and become dominant in the most external regions. The residual field contamination that appears to be still present in the PM-selected sample, especially at large distances from the center, will be easily removed in the following analysis by means of a $\sigma$-clipping procedure aimed at excluding the obvious outliers (see Section \ref{sec:results}). \begin{figure}[ht!] \centering \includegraphics[width=14.5cm, height=10.5cm]{6440_members_LOS_RVwe_final.jpg} \centering \caption{\textit{Top-left panel}: VPD of the Gaia EDR3 dataset (gray dots) with the targets of the external sample selected as member stars marked with blue circles. The black dots show the targets rejected as field stars. The black cross marks the absolute motion of NGC 6440 \citep{vasiliev+21}. {\it Top-right panel}: VPD of the relative HST PMs obtained in \citet[][gray dots]{pallanca+19}. The red circles mark the member stars selected from the internal sample, while the black circles are the targets considered as non-member stars. {\it Bottom panel}: RVs of the final catalog as a function of the distance from the cluster center. The large circles show the targets selected as cluster members, color-coded as in the top panels. The targets rejected as field stars are marked with gray circles.} \label{fig:members} \end{figure} \section{Results} \label{sec:results} To properly explore the internal kinematics of NGC 6440, in the following analysis we have used only stars with the most reliable RV measures, selected by adopting the following criteria. Among the PM-selected cluster members, only the targets with S/N $>15$ and RV error $<5$ km s$^{-1}$ have been considered. After applying these selections to the targets of the combined catalog (see Section \ref{comb_catalog}), we obtained a total sample of 704 targets. Figure \ref{fig:cmd} shows the positions of the selected targets in the appropriate CMDs. This is the sample of RV measurements that we used to determine the systemic velocity and the velocity dispersion profile, and to detect possible signatures of rotation. \subsection{Systemic velocity} \label{sec:vsys} The measured RVs as a function of the distance from the center are plotted in the left panel of Figure \ref{fig:rv_dist}, and the corresponding RV distribution is shown in the right panel. The gray dots and empty histogram refer to the entire final catalog (1831 RV measures), and the apparent well defined peak indicates the cluster systemic velocity ($V_{\rm sys}$). For the measure of $V_{\rm sys}$ only, in order to minimize the risk of a residual contamination from field stars, from the confident sample of stars selected as described above, we considered only those with distances within $200\arcsec$ ($\sim 4 \times r_h$) from the center and with RVs in the range $-92$ km s$^{-1}<$RV$<-42$ km s$^{-1}$, and we applied a $3\sigma$-clipping procedure to remove the obvious outliers. The resulting sample of 625 RVs is shown in the left panel of Figure \ref{fig:rv_dist} as black circles, while its distribution is plotted as a gray histogram in the right panel. Hence, under the assumption that the RV distribution of the selected stars is Gaussian, the value of $V_{\rm sys}$ and its uncertainty have been computed through a Maximum-Likelihood method \citep{Walker+06}. We obtained $V_{\rm \rm sys} = -67.5 \pm 0.4$ km s$^{-1}$. This estimate is in good agreement with the previous result published in \citet[][$-67.8 \pm 1.0$ km s$^{-1}$]{Baumgardt+18}, while it disagrees with the value quoted in \citet[][$-76.6 \pm 2.7$ km s$^{-1}$]{harris+96}. In the following, we will indicate as $V_r = {\rm RV} - V_{\rm sys}$ the RVs referred to the cluster systemic velocity. \begin{figure}[ht!] \centering \includegraphics[width=16.5cm, height=6.2cm]{RVwe_dist_6440_final.pdf} \centering \caption{{\it Left panel:} RVs of the final catalog (gray dots) as a function of the distance from the cluster center, with the 625 RVs used to determine the cluster systemic velocity (solid line) highlighted as black circles. {\it Right panel:} Number distributions of the final catalog (empty histogram) and of the targets used for the determination of $V_{\rm sys}$ (gray histogram).} \label{fig:rv_dist} \end{figure} \subsection{Second velocity moment profile} \label{sec:2ndv} As discussed in previous papers \citep[e.g.,][]{lanzoni+18a,leanza+22} the second velocity moment profile ($\sigma_{II}(r)$) derived from the measured RVs represents a very good approximation of the projected velocity dispersion profile $\sigma_P(r)$, in the case of no or negligible systemic rotation, according to the relation: \begin{equation} \sigma^2_P(r) = \sigma^2_{II}(r) - A^2_{\rm rot}(r), \end{equation} where $A_{\rm rot}$ is the amplitude of the rotation curve. For this cluster no evident signatures of rotation have been clearly detected in previous works. Therefore, we first compute the second velocity moment profile to compare it with the previous results, and then, in Section \ref{sec_vrot}, we complete the kinematic analysis of the cluster investigating the possible presence of internal rotation. To determine the second velocity moment profile, starting from the RVs sample selected as described is Section \ref{sec:results}, we have adopted the standard approach already used in previous works (see \citealt{ferraro+18a, lanzoni+18a, lanzoni+18b, leanza+22}): the RV sample is divided into radial bins using a set of concentric annuli, which are selected at increasing distance from the cluster center and provide a good compromise between fine radial sampling and statistically significant numbers of stars (at least 30) in each bin. A 3$\sigma-$clipping procedure is performed on the RVs in each radial bin to exclude the obvious outliers from the analysis. Then, we applied a Maximum-Likelihood method \citep[][see also \citealp{Martin_2007}; \citealt{sollima+09}]{Walker+06} to compute the dispersion of the $V_r$ values of the selected stars in each bin. The uncertainties are estimated following the procedure described in \citet[][]{pryor+93}. The resulting $\sigma_{II}(r)$ profile of NGC 6440 is shown in Figure \ref{fig:vdp} (black circles) and listed in Table \ref{tab:2ndv_01}. It nicely follows the King model (red line) that best fits the observed star density profile of the cluster \citep{pallanca+21}. We have estimated the central velocity dispersion as the value that minimizes the residuals between the observed velocity dispersion profile and the adopted King model finding $\sigma_0 = 12.0 \pm 0.4$ km s $^{-1}$. The $1\sigma$ uncertainty has been obtained from the solutions of the $\chi^2$ test for which $\chi^2 = \chi^2_{min} \pm 1$. In Figure \ref{fig:vdp} we also compare our result with the observed profile obtained by \citet[][empty triangles]{Baumgardt+18} from RV measures at intermediate and large radii from the center. Formally, the two outermost points of \citet{Baumgardt+18} are larger than ours, possibly due to a different membership selection applied in the two works, or an effect of residual field star contamination in the former. The difference, however, is not significant (the error bars are just $1\sigma$), but we verified that the King model that best fits the observed density distribution would be unable to reproduce a velocity dispersion profile obtained by combining our innermost four points and the three measures by \citet{Baumgardt+18}, while it is well consistent with the determination provided in this work (solid circles and red line in Figure \ref{fig:vdp}). \begin{deluxetable*}{RRRRCC} \tablecaption{Second velocity moment profiles obtained for NGC 6440.} \tablewidth{0pt} \tablehead{ \colhead{ $r_i$ } & \colhead{ $r_e$ } & \colhead{$r_m$} & \colhead{$N$} & \colhead{$\sigma_{II}$} & \colhead{$\epsilon_{\sigma_{II}}$} \\ \colhead{ [arcsec] } & \colhead{ [arcsec] } & \colhead{[arcsec]} & \colhead{ } &\colhead{km s$^{-1}$ } & \colhead{ km s$^{-1}$} } \startdata 0.01 & 2.50 & 1.75 & 58 & 12.20 & 1.19 \\ 2.50 & 4.50 & 3.47 & 96 & 11.20 & 0.86 \\ 4.50 & 7.50 & 6.05 & 130 & 11.50 & 0.76 \\ 7.50 & 13.00 & 9.79 & 228 & 11.80 & 0.59 \\ 13.00 & 50.00 & 24.49 & 79 & 11.00 & 0.94 \\ 50.00 & 100.00 & 74.23 & 37 & 7.30 & 1.01 \\ 100.00 & 250.00 & 157.22 & 30 & 5.60 & 0.82 \\ \enddata \tablecomments{The first three columns list the internal, external, and mean radii of each adopted radial bin ($r_i$, $r_e$ and $r_m$, respectively), with the mean radius computed as the average distance from the center of all the stars in the bin ($N$, fourth column). The last two columns list the second velocity moment and its uncertainty in each bin, respectively.} \label{tab:2ndv_01} \end{deluxetable*} \begin{figure}[ht!] \centering \includegraphics[width=12cm, height=10cm]{VDP_6440_RVwe_final.pdf} \centering \caption{Second velocity moment profile of NGC 6440 obtained from the measured individual RVs (solid circles). The empty triangles show the profile derived by \citet{Baumgardt+18}. The red solid line represents the King model that best fits the star density profile of the cluster \citep{pallanca+21}.} \label{fig:vdp} \end{figure} \subsection{Systemic rotation} \label{sec_vrot} In previous kinematics analysis \citep[e.g.,][]{sollima+19, vasiliev+21} no unambiguous signals of rotation have been detected in the external regions of NGC 6440. However, thanks to the large sample of MUSE and SINFONI data presented here, we have the opportunity to perform the very first exploration of the central region of the cluster searching for evidence of systemic rotation. To this purpose, we used the method fully described in previous works \citep[e.g., see][]{cote+95, lane+09, bellazzini+12, lanzoni+13} and adopted in several papers \citep{bianchini+13, boberg+17, ferraro+18b, lanzoni+18a, lanzoni+18b, leanza+22}. Following this method, the RV sample is split into two sub-samples by a line passing through the cluster center, varying the position angle (PA) of the line from $0\arcdeg$ (North direction) to $180\arcdeg$ (South direction), by steps of $10\arcdeg$ and with PA $=90\arcdeg$ corresponding to the East direction. For each value of PA, the difference between the mean velocity of the two RV sub-samples ($\Delta V_{\rm mean}$) is computed. In the presence of systemic rotation, $\Delta V_{\rm mean}$ would show a coherent sinusoidal variation as a function of PA. The maximum/minimum absolute value of this curve provides twice the rotation amplitude ($A_{\rm rot}$) and the position angle of the rotation axis (PA$_0$). In addition, if the cluster is rotating, the stellar distribution in a diagram showing the velocity $V_r$ as a function of the projected distances from the rotation axis (XR) shows an asymmetry, with two diagonally opposite quadrants being more populated than the other two. Moreover, the sub-samples of stars on each side of the rotation axis are expected to also show different cumulative $V_r$ distributions. Three estimators have been used to quantify the statistical significance of the detected differences: the probability that the RV distributions of the two sub-samples are extracted from the same parent family is estimated by means of a Kolmogorov-Smirnov test, while the statistical significance of the difference between the two sample means are evaluated with both the Student's t-test and a Maximum-Likelihood approach. Of course, by construction, the method can be used only in the case of a RV sampling symmetrically distributed in the plane of the sky. Thus in order to avoid some heavy under-sampled regions, we were forced to limit our analysis to the innermost $5\arcsec$ portion (approximately covering the core radius of the cluster $r_c=6.4\arcsec$, \citealt{pallanca+21}), where the combination of the MUSE and SINFONI samples offers a reasonably symmetric coverage of the cluster (see Figure \ref{fig:mappa}). We thus performed the analysis over the entire region ($r<5\arcsec$) and in two radial annuli around the cluster center ($r<3\arcsec$ and $<3\arcsec<r<5\arcsec$). The results are plotted in Figure \ref{fig:fig_vrot_bin} and listed in Table \ref{tab_vrot_bin}. The diagnostic plots show the characteristics of systemic rotation in the considered regions: a sinusoidal behavior of $\Delta V_{\rm mean}$ as a function of PA (left-hand panels), asymmetric distributions of $V_r$ as a function of XR (central panels), and well distinct cumulative $V_r$ distributions for the two samples on either side of the rotation axis (right-hand panels). Hence, we can reasonably (at $\sim 2\sigma$ statistical significance) conclude that the core region within $5\arcsec$ of NGC 6440 is rotating, with an average position angle of the rotation axis PA$_0\sim 132 \pm 2 \arcdeg$, and an amplitude of $\sim 2.8 \pm 0.2$ km s$^{-1}$. Unfortunately, the non-uniform coverage of the intermediate region of the cluster does not allow us to assess of the exact radial extension of the rotation signal. Moreover, we have searched for signatures of systemic rotation in outermost part of the cluster by applying the same procedure to the regions covered by KMOS and FLAMES. In this case, no significant evidence of rotation was found, in agreement with previous studies \citep[]{sollima+19, vasiliev+21}. \begin{deluxetable*}{rrrrccccc}[ht!] \tablecaption{Rotation signature detected in the core of NGC 6440 in three circular annuli around the cluster center.} \tablewidth{0pt} \renewcommand{\arraystretch}{1.2} \tablehead{ \colhead{$r_i$ } & \colhead{ $r_e$ } & \colhead{ $r_m$ } & \colhead{ $N$} & \colhead{PA$_0$} & \colhead{ $A_{\rm rot}$} & \colhead{ $P_{\rm KS}$} & \colhead{ $P_{\rm Stud}$} & \colhead{n-$\sigma_{\rm ML}$} } \startdata 0.01 & 3.00 & 2.10 & 85 & $131 \pm 4$ & $2.2 \pm 0.3$ & $3.2\times 10^{-1}$ & $<90.0$ & 2.2 \\ 3.00 & 5.00 & 3.90 & 86 & $134 \pm 2$ & $3.4 \pm 0.3$ & $7.8\times 10^{-2}$ & $>95.0$ & 3.3 \\ 0.01 & 5.00 & 3.00 & 171 & $132 \pm 2$ & $2.8 \pm 0.2$ & $4.9\times 10^{-2}$ & $>95.0$ & 3.6 \\ \enddata \tablecomments{The table lists: inner ($r_i$), outer ($r_e$) and mean radius ($r_m$) in arcseconds, the number of stars in the bin ($N$), the position angle of the rotation axis (PA$_0$) and its 1$\sigma$ error in degree, the rotation amplitude (A$_{\rm rot}$) and its error in km s$^{-1}$, the Kolmogorov-Smirnov probability that the two samples on each side of the rotation axis are drawn from the same parent distribution ($P_{\rm KS}$), the t-Student probability that the two RV samples have different means ($P_{\rm Stud}$), and the significance level (in units of n-$\sigma$) that the two means are different following a Maximum-Likelihood approach (n-$\sigma_{\rm ML}$).} \label{tab_vrot_bin} \end{deluxetable*} \begin{figure}[ht!] \includegraphics[width=20cm, height=12cm]{vrot_6440_RVwe_final.pdf} \centering \caption{Diagnostic diagrams of the rotation signature detected in three concentric radial bins in the core of the cluster at different distances from the center (see labels in the top-left corner of each row). For each bin, the {\it left panels } show the difference between the mean RV on each side of a line passing through the center with a given PA, as a function of PA itself. The continuous line is the sine function that best fits the observed patterns and the red shaded region marks the confidence level at 3$\sigma$. The {\it central panels} show the distribution of the velocities $V_r$ as a function of the projected distances from the rotation axis (XR) in arcseconds. The value of PA$_0$ is labeled in each panel. The red dashed lines are the least square fits the data. The {\it right panels} show the cumulative $V_r$ distributions for the stars with XR$<0$ (solid line) and for those with XR$>0$ (dotted line). The Kolmogorov-Smirnov probability that the two samples are extracted from the same parent distribution is also labelled.} \label{fig:fig_vrot_bin} \end{figure} \subsection{Ellipticity} \label{sec_ellip} From previous analyses, NGC 6440 shows a low global ellipticity \citep[see][0.01]{harris+96}, as expected for a non-rotating system. However, because of the rotation signal detected in the core, we have explored the morphology of the innermost region of the cluster to check for a possible flattening of the system in the direction perpendicular to the rotation axis, as expected from theoretical models \citep[e.g.,][]{Chandrasekhar+69, varri+12}. We thus determined the 2D stellar density map of the inner $\sim 50\arcsec \times 50\arcsec$ area, by using the stars with $I<20.5$ (to avoid incompleteness effects) in the photometric catalog of \citet{pallanca+21}. By applying a Gaussian kernel to the stellar distribution \citep[see][]{dalessandro+15}, we obtained the smoothed 2D surface density map shown in Figure \ref{fig:ellipticity}. The gray solid lines represent the best-fit ellipses to the isodensity contours, and show that the system is slightly flattened in the center, and it acquirers a more spherical symmetric for increasing radii. Indeed, the resulting ellipticity (defined as $\epsilon = 1 - b/a$ with $a$ and $b$ being the major and minor axes, respectively) achieves its maximum value ($0.18 \pm 0.02$) at $r \sim 3\arcsec$ and gradually decreases at larger radii ($\epsilon = 0.04 \pm 0.02$ at $r \sim 45\arcsec$). Where the ellipticity is maximum, the ellipses major axis has an orientation of $\sim 15 \arcdeg$ from North to East. Although the direction of the major axis is not exactly perpendicular to the rotation axis (PA$_0$ $ \sim 132 \pm 2 \arcdeg$), the presence and the orientation of the detected flattening are qualitatively consistent with the systemic rotation signal found in the inner $5\arcsec$ of the system. \begin{figure}[ht!] \includegraphics[width=10.5cm, height=9cm]{map_dens_6440_new2_99.pdf} \centering \caption{Projected stellar density map of the central region of NGC 6440. The solid gray lines are the best-fit ellipses to the isodensity curves and the gray dashed line marks the estimated direction of the rotation axis (PA$_0 \sim 132 \pm 2\arcdeg$; see Section \ref{sec_vrot}) with the 1$\sigma$ error shown by the shaded area.} \label{fig:ellipticity} \end{figure} \section{Discussion and Conclusions} \label{sec:discussion} As part of the ESO-VLT MIKiS Survey \citep{ferraro+18a, ferraro+18b}, here we presented the velocity dispersion profile and the detection of a core rotation for the bulge GC NGC 6440. Thanks to a combination of different spectroscopic datasets acquired with appropriate spatial resolution, we measured the RV of $\sim$1800 individual stars sampling the entire radial extension, beyond $r_t$ of the cluster. Using only the sample of member stars properly selected with the most reliable RV measures, we have derived the velocity dispersion profile of the system from its innermost ($\sim 0.1\arcsec$) to the outer regions of the cluster ($\sim 250\arcsec$), covering about $5 \times r_h$ from the center. We also detected a rotation signal in the innermost $\sim 5\arcsec$ of the cluster, while no conclusions can be drawn for larger distances because of a non homogeneous sampling of the more external areas. The present work complements the detailed photometric study of the cluster recently performed by our group \citet{pallanca+19, pallanca+21}, which provided a high-resolution extinction maps in the direction of the cluster, a new determination of the average reddening, a new star density profile, and updated values of the structural parameters, distance modulus and age of the cluster. Adopting some of these quantities and the resulting value of $\sigma_0$ ($12.0 \pm 0.4$ km s $^{-1}$, see Section \ref{sec:2ndv}), we have verified that the adopted King model reproduces reasonably well also the velocity dispersion profile of the cluster (see Figure \ref{fig:vdp}). Compared to \citet{Baumgardt+18}, our profile samples a much inner region of the cluster, and our estimate of $\sigma_0$ is significantly smaller (12 km s $^{-1}$, in place of 15.8 km s $^{-1}$). This difference could be ascribed to an effect of energy equipartition and mass segregation, which implies a lower velocity dispersion for RGB stars, compared to the average, less massive, cluster members. Indeed, based on its age and current half-mass relaxation time \citep[$t=13$ Gyr and $t_{rh} = 1$ Gyr, respectively;][see also \citealt{Baumgardt+18}]{pallanca+21}, NGC 6440 has undergone about 13 relaxations so far, and likely is mass-segregated. Consistently, the value of $\sigma_0$ estimated in this work (which has been obtained mainly from giant stars) is smaller than the mass-weighted central velocity dispersion determined by \citet{Baumgardt+18} from the comparison with N-body simulations. According to equation (1), in the presence of rotation, the velocity dispersion is expected to be smaller than the second velocity moment. However, in the case of NGC 6440 the contribution of the detected rotation signal is small compared to the measured second velocity moment, thus we can conclude that the cluster is, with a reasonable approximation, a pressure-supported system, dominated by non-ordered motions. These considerations make the approximation that the cluster is well represented by single-mass, spherical, isotropic, and non-rotating \citep{king+66} models well acceptable. Hence, we can use the derived value of $\sigma_0$ to estimate the total mass of the system. To this end, we used equation (3) of \citet{Majewski+03}, deriving $\mu$ as in \citet{Djorgovski+93} and assuming $\beta = 1/\sigma_0^2$ \citep[see][]{Richstone+86}. We then estimated the total mass uncertainty by running 1000 Monte Carlo simulations, extracting the values of $c$, $r_0$ and $\sigma_0$ from a appropriate normal distributions for each parameter \citep[see][]{leanza+22}. The result obtained for NGC 6440 is $M = 2.66_{-0.24}^{+0.27} \times 10^5 M_\odot$. We emphasize, however, that this value likely underestimates the true total mass of the system, because the adopted central velocity dispersion has been measured from giant stars (see above). This is qualitatively in agreement with the larger mass ($4.42 \pm 0.64 \times 10 ^5$ M$_\odot$) estimated by \citet{Baumgardt+18} from the mass-weighted value of $\sigma_0$. Although no evidence of systemic rotation have been detected in previous analyses \citep[see][]{sollima+19, vasiliev+21}, and although in the present work we could not derive a rotation curve for reasons of non-uniform sampling, a not negligible signal of ordered rotation has been found in the core of NGC 6440 (see Section \ref{sec_vrot}). By assuming that the maximum peak of the rotation is $\sim 3.4 \pm 0.3$ km s$^{-1}$ between $3\arcsec$ and $5\arcsec$ from the center, as found in the present work, we can derive the value of $V_{rot}/\sigma_0 = 0.3$, similarly to what has been done in other works \citep{bianchini+13, fabricius+14, boberg+17, dalessandro+21}. Nevertheless, since the non-uniform sampling prevents the exploration of the rotation signal at larger radii, we cannot exclude that the rotation peak is higher for $r>5\arcsec$. Despite this, it is interesting to note that such a central rotation is a rare feature in GCs and only two similar cases are known to date in the literature, namely M 15 \citep{vandenBosch+06,usher+21} and NGC 6362 \citep{dalessandro+21}. Interestingly, $N$-body simulations \citep{tiongco+17} show that such central ($<r_h$) velocity signals are expected only in very dynamically evolved systems that lost a significant amount of their mass because of both two-body relaxation effects and interactions with the host galaxy potential. However, we stress that this result deserves further investigation and additional analysis at larger radii to see if the rotation signal extends beyond the core region. \vskip1truecm S.L. warmly thanks S. Kamann for useful suggestions about PampelMuse. E.V. acknowledges the Excellence Cluster ORIGINS Funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) under Germany's Excellence Strategy – EXC-2094 – 390783311. This work is part of the project {\it Cosmic-Lab} at the Physics and Astronomy Department "A. Righi" of the Bologna University (http://www.cosmic-lab.eu/ Cosmic-Lab/Home.html). The research was funded by the MIUR throughout the PRIN-2017 grant awarded to the project {\it Light-on-Dark} (PI:Ferraro) through contract PRIN-2017K7REXT. \newpage
\section{Introduction} The intense emission of 511 keV gamma-rays from the Galactic center \cite{sieg} and within active terrestrial thunderstorms \cite{abc} has been observed. It seems quite natural to attribute both observations to the formation of clouds of parapositronia, each decaying into two gamma-quanta with energy 511 keV. Moreover, one is tempted to relate these facts to the well known in experimental particle physics excess \cite{skl} of soft dileptons and photons over their calculated supply from all well established sources. Characteristic gamma-ray emission from the Galaxy's interstellar medium with a line at 511 keV has been observed with the spectrometer SPI on ESA's INTEGRAL observatory \cite{sieg}. It registered bright emission from an extended bulge-like region, while emission from the disk is faint. Terrestrial gamma-ray flashes are usually observed by spacecraft in low-Earth orbit, but have also been observed by aircrafts \cite{abc} and on the ground \cite{chub1, chub2, chil} during active thunderstorms. Their energy spectra are consistent with a source mostly composed of positron annihilation gamma-rays, with a prominent 511 keV line clearly visible in the data. It is reasonable to assume that electromagnetic fields are responsible for this effect. The outcome of a collision of two charged objects (two nuclei, in particular) is especially soft if they do not come very close to one another but pass at large distances (impact parameters) and only their electromagnetic fields interact. These processes are named ultraperipheral because of the large spatial extension of electromagnetic forces compared to the much lower range of strong nuclear interactions. It is shown here that very soft dielectrons and photons are produced in these grazing collisions \cite{dr1, dr2}. \section{Sources of positrons and positronia} The main problem of the hypothesis about positronia' clouds charged for emission of the 511 keV photon peak is the rate of parapositronium production. Electrons are very abundant as main ingredients of atoms while positrons must be produced in some interactions. Electromagnetic and weak forces must be responsible for their production. Parapositronia and unbound electron-positron pairs can be created by electromagnetic fields of any moving charged objects with energy exceeding the threshold of their production. Weak forces are active in radioactive nuclear decays and decays of unstable particles created in strong interactions. Astrophysicists analyze intensively the objects in the Universe which could be responsible for these effects. The long list of candidates has been proposed. It includes radioactive decay of unstable isotopes produced in nucleosynthesis sources throughout the Galaxy \cite{dieh}, accreting binary systems (microquasars) \cite{takh}, old neutron stars (former pulsars) \cite{isto}, various sources inside the supermassive black hole in our Galaxy's center \cite{dogi, cai, takh}, dark matter decay or annihilation \cite{farz, cai}, as dark matter would be gravitationally concentrated in the inner Galaxy etc. Quantitative estimates of their contributions leave considerable uncertainties. The puzzle still remains, and no conclusive candidate has emerged. Other complexities arise because, once ejected from their sources, the positrons may travel far from their origins to the surrounding interstellar gas. Kinetic equations are often used to show that processes of Coulomb collisions are effective enough to cool down these relativistic positrons and to thermalize them before their annihilation. Positrons slow down to energies of a few eV and annihilation may occur. Here, we do not enter in the detailed discussion of these problems but propose the mechanism of direct electromagnetic creation of parapositronia and low-mass electron-positron pairs in ultraperipheral collisions of heavy ions. The results can be confronted to forthcoming experimental data of NICA collider and their relevance to the above findings established. \section{Ultraperipheral nuclear collisions at NICA collider} Production of $e^+e^-$-pairs in electromagnetic fields of colliding heavy ions was first considered by Landau and Lifshitz in 1934 \cite{lali}. It was shown that the total cross section of this process rapidly increases with increasing energy $E$ as $\ln ^3E$ in asymptotics. This is still the strongest energy dependence in particle physics. The cross sections of strong nuclear interactions can not increase faster than $\ln ^2E$ according to the Froissart theorem \cite{froi}. Moreover, the numerical factor $Z^4\alpha ^4$ compensates in the total cross section the effect of the small electromagnetic coupling $\alpha $ for heavy ions with large charge $Ze$. Therefore, the ultraperipheral production of $e^+e^-$-pairs (as well as $\mu ^+\mu ^-$ etc.) in ion collisions can become the dominant mechanism at very high energies \cite{dr3}. It is already widely studied at colliders. At the same time, it is desirable to learn these processes at conditions closest to astrophysics requirements. In particular, the energies of NICA collider are above the threshold of dielectrons production but lower than the threshold for dimuons \cite{ijmp}. That is why we demonstrate here the properties of positronia (and 511 keV photons) and dielectrons just in this energy interval from 5 GeV to 11 GeV per nucleon in the center of mass system. We show that the heuristic knowledge of these processes is helpful in understanding some astrophysical phenomena as well. Abundant creation of pairs with rather low masses is the typical feature of ultraperipheral interactions \cite{dr1}. Unbound lepton pairs and parapositronia are produced in grazing collisions of interacting ions where two photons from their electromagnetic clouds interact. Two-photon fusion production of lepton pairs has been calculated with both the equivalent photon approximation proposed in \cite{wei, wil} and via full lowest-order QED calculations \cite{rac, bgms} reviewed recently in \cite{drufn}. According to the equivalent photon approximation, the spectra of dileptons created in ultraperipheral collisions can be obtained from the general expression for the total cross section \begin{equation} \sigma _{up}(X)= \int dx_1dx_2\frac {dn}{dx_1}\frac {dn}{dx_2}\sigma _{\gamma \gamma }(X). \label{e2} \end{equation} Feynman diagrams of ultraperipheral processes contain the subgraphs of two-photon interactions leading to production of some final states $X$ (e.g., $e^+e^-$ pairs). These blobs can be represented by the cross sections of these processes. Therefore, $\sigma _{\gamma \gamma }(X)$ in (\ref{e2}) denotes the total cross section of production of the state $X$ by two photons from the electromagnetic clouds surrounding colliding ions and $dn/dx_i$ describe the densities of photons carrying the share $x_i$ of the ion energy. The~distribution of equivalent photons with a fraction of the nucleon energy $x$ generated by a moving nucleus with the charge $Ze$ can be denoted as \begin{equation} \frac {dn}{dx}=\frac {2Z^2\alpha }{\pi x}\ln \frac {u(Z)}{x} \label{flux} \end{equation} if integrated over the transverse momentum up to some value (see, e.g., \cite{blp}). The physical meaning of the ultraperipherality parameter $u(Z)$ is the ratio of the maximum adoptable transverse momentum to the nucleon mass as the only massless parameter of the problem. Its value is determined by the form factors of colliding ions (see, e.g., \cite{vyzh}). It is clearly seen from Eq. (\ref{flux}) that soft photons with small fractions $x$ of the nucleon energy dominate in these fluxes. The cross section $\sigma _{\gamma \gamma }(X)$ usually inserted in (\ref{e2}) in case of creation of the unbound dielectrons $X=e^+e^-$ is calculated in the lowest order perturbative approach and looks \cite{blp,brwh} as \begin{equation} \sigma _{\gamma \gamma }(X)=\frac {2\pi \alpha ^2}{M^2} [(3-v^4)\ln \frac {1+v}{1-v}-2v(2-v^2)], \label{mM} \end{equation} where $v=\sqrt {1-\frac {4m^2}{M^2}}$ is the velocity of the pair components in the pair rest system, $m$ and $M$ are the electron and dielectron masses, correspondingly. The cross section tends to 0 at the threshold of pair production $M=2m$ and decreases as $\frac {1}{M^2}\ln M$ at very large $M$. The distribution of masses $M$ of dielectrons is obtained after inserting Eqs (\ref{flux}), (\ref{mM}) into (\ref{e2}) and leaving free one integration there. One gets \cite{dr1} \begin{equation} \frac {d\sigma }{dM}=\frac {128 (Z\alpha )^4}{3\pi M^3} [(1+\frac {4m^2}{M^2}-\frac {8m^4}{M^4}) \ln \frac {1+\sqrt {1-\frac {4m^2}{M^2}}}{1-\sqrt {1-\frac {4m^2}{M^2}}}- (1+\frac {4m^2}{M^2})\sqrt {1-\frac {4m^2}{M^2}}] \ln ^3\frac {u\sqrt {s_{nn}}}{M}, \label{sM} \end{equation} where $\sqrt {s_{nn}}$ is the c.m.s. energy per a nucleon pair. The dielectron distribution (\ref{sM}) is shown in Fig. 1 for three NICA energies ranging from 11 GeV to 8 GeV and 6.45 GeV per nucleon. The parameter $u$=0.02 has been chosen in accordance with its value obtained in Ref. \cite{vyzh} where careful treatment of nuclei form factors is done. The total cross section of ultraperipheral production of unbound pairs is \begin{equation} \sigma (ZZ(\gamma \gamma )\rightarrow ZZe^+e^-)=\frac {28}{27} \frac {Z^4\alpha ^4}{\pi m^2}\ln^3\frac {u^2s_{nn}}{4m^2}. \label{vz} \end{equation} \begin{figure} \centerline{\includegraphics[width=16cm, height=14cm]{terz1++.pdf}} Fig. 1. The distribution of masses of dielectrons produced in ultraperipheral collisions at NICA energies $\sqrt {s_{nn}}$=11 GeV (blue, upper), 8 GeV (red, middle), 6.45 GeV (green, lower). \end{figure} The sharp peak at low masses $M$ in Fig. 1 demonstrates the most important feature of ultraperipheral processes - the abundant production of soft dielectrons with masses of the order of several electron masses $m=0.511$ MeV (effectively, less than 5 MeV). Moreover, the non-perturbative effects drastically enlarge production of unbound pairs with extremely low masses. The perturbative expression for the cross section $\sigma _{\gamma \gamma }(X)$ of (\ref{mM}) can be generalized to include the non-perturbative effects crucial near the pair production threshold $M=2m$. It happens to be possible for Coulomb interaction governing the behavior of the components of a pair. At the production point, the components of pairs with low masses close to 2$m$ move very slowly relative to one another. They are strongly influenced by the attractive Coulomb forces. In the non-relativistic limit, these states are transformed by mutual interactions of the components to effectively form a composite state whose wave function is a solution of the relevant Schroedinger equation. The normalization of Coulomb wave functions plays an especially important role at low velocities. It differs from the normalization of free motion wave functions used in the perturbative derivation of Eq. (\ref{mM}). The amplitude $R_C$ of the process $\gamma\gamma\to e^+e^-$ with account of the interaction between leptons is connected to the amplitude $R_0$ without the final state interaction by the relation \begin{equation} R_C=\int \Psi_f(r)R_0(r)d^3r \label{rc} \end{equation} where $\Psi_f(r)$ is the wave function for bound (parapositronium) or unbound lepton pairs in the coordinate representation. For lepton pairs in $S$-state (the orbital momentum $l$=0) the characteristic distances of the pair production are $~1/m$, whereas the Coulomb interaction between leptons acts over the much larger distances $~1/{m\alpha}$ in the bound state production and $~1/k$ for the unbound states where $k$ is the relative momentum. Therefore, the wave function can be considered as constant in (\ref{rc}) and one gets \begin{equation} R_C= \Psi_{kS}(r=0)\int R_0(r)d^3r= \Psi_{kS}(r=0) R_0(p=0). \label{rc0} \end{equation} This relation is valid not only for bound states, but also for the creation of the unbound lepton pairs if $kr_s\ll 1$. Such factorization of matrix elements has been widely used in the dimesoatoms production. It is useful for any process where the characteristic distances of pair production and of final state interactions are substantially different. The normalization of the unbound pair wave function reads \cite{llqm} \begin{equation} |\psi_{kS}(\vec r=0)|^2 =\frac{\pi\xi}{sh(\pi\xi)}e^{\pi\xi} =\frac{2\pi\xi}{1-e^{-2\pi\xi}};~~~\xi=\frac{2\pi\alpha m}{k}. \label{psi} \end{equation} This is the widely used Sommerfeld-Gamow-Sakharov (SGS) factor \cite{som, gam, somm, sakh} which unites the non-perturbative and perturbative matrix elements. It results in the so-called "$\frac {1}{v}$-law" of the enlarged outcome of the reactions with extremely low-mass pairs produced. This factor is described in the standard textbooks on non-relativistic quantum mechanics (see, e.g., \cite{llqm}) and used in various publications (e.g., \cite{baier, ieng, cass, arko}). The Sakharov recipe of its account for production of $e^+e^-$-pairs desctibed in \cite{sakh} consists in direct multiplication of the differential distribution of Eq. (\ref{sM}) by the SGS-factor written as \begin{equation} T=\frac {2\pi \alpha}{v(1-\exp (-2\pi \alpha/v))}. \label{sgs} \end{equation} It enhances the contribution of the low-mass (low-$v$) pairs. Thus the proper distribution of dielectron masses in ultraperipheral processes is \begin{eqnarray} \frac {d\sigma }{dM^2}&=&\frac {128 (Z\alpha )^4}{3M^4} \frac {\alpha }{\sqrt {1-\frac {4m^2}{M^2}} (1-\exp (-2\pi \alpha/\sqrt {1-\frac {4m^2}{M^2}}))}\times\nonumber \\ & &\left[(1+\frac {4m^2}{M^2}-\frac {8m^4}{M^4}) \ln \frac {1+\sqrt {1-\frac {4m^2}{M^2}}}{1-\sqrt {1-\frac {4m^2}{M^2}}}- (1+\frac {4m^2}{M^2})\sqrt {1-\frac {4m^2}{M^2}}\right] \ln ^3\frac {u\sqrt {s_{nn}}}{M}, \nonumber \\ \label{sM2} \end{eqnarray} The distribution of the relative (in $e^+e^-$ rest system) velocity $v$ is like \begin{equation} \frac {d\sigma }{dv^2}=\frac {16(Z\alpha )^4}{3m^2} [(3-v^4)\ln \frac {1+v}{1-v}-2v(2-v^2)] \frac {\alpha}{v(1-\exp (\frac {-2\pi \alpha}{v}))} \ln^3 \frac {u\sqrt {s_{nn}(1-v^2)}}{2m}. \label{sv2} \end{equation} Let us remind that the velocity $v$ is related to the velocity of the positron $v_+$ in the electron rest system as \begin{equation} v^2=\frac {1-\sqrt {1-v_+^2}}{1+\sqrt {1-v_+^2}} \label{vv} \end{equation} so that $v_+=2v$ at $v\rightarrow 0$ and both $v$ and $v_+$ tend to 1 in the ultrarelativistic limit. The relative velocities $v$ and $v_+$ are the relativistic invariants represented by the Lorentz-invariant masses $m$ and $M$. It is shown in Fig. 1 that the cross section of creation of unbound $e^+e^-$-pairs tends to zero at the threshold $M=2m$ if the perturbative expression Eq. (\ref{mM}) is used. Account of the non-perturbative SGS-factor (\ref{sgs}) in Eqs (\ref{sM2}) and (\ref{sv2}) changes the situation, drastically increasing the yield of pairs at low masses $M$, i.e. with small velocities $v$. In Figs 2 and 3, we compare the yields of pairs with (curves a - (\ref{sM2}), (\ref{sv2})) and without (curves b - (\ref{sM})) account of the SGS-factor at NICA energy 11 GeV as functions of masses $M$ and velocities $v$. \begin{figure} \includegraphics[width=\textwidth]{dSdM2.pdf} Fig. 2. The distribution of masses of dielectrons produced in ultraperipheral collisions at NICA energy $\sqrt {s_{nn}}$=11 GeV with (a) and without (b) account of the SGS-factor. Their difference (a-b) is shown by the dashed line. The region of small masses is shown in the right-hand side at the enlarged scale. Note the factor $10^{-6}$ at the abscissa scale which reduces it to MeVs. \end{figure} \begin{figure} \centerline{\includegraphics[width=\textwidth]{dSdV2.pdf}} Fig. 3. The distribution of the relative velocities in dielectrons produced in ultraperipheral collisions at NICA energy $\sqrt {s_{nn}}$=11 GeV with (a) and without (b) account of the SGS-factor. Their difference (a-b) is shown by the dashed line. The velocities for the region of small masses are shown in the right-hand side. Note the factor $10^{-3}$ at the abscissa scale. \end{figure} The cross sections of ultraperipheral production of unbound $e^+e^-$-pairs are especially strongly enhanced at low masses $M$ (at low relative velocities $v$) compared to their perturbative values (marked by b). It is clearly seen in the righthand sides of Figs 2 and 3 which demonstrate the region near the threshold $M=2m$. Surely, the cross section would tend to zero at the threshold $M=2m$ due to the energy-momentum conservation laws not fully respected by the simplified SGS-recipe. However, it must happen in the tiny region near the threshold and can be neglected in integral estimates. At the same time, the overall contribution due to the correction is not high. It amounts to about 4.6 percents at the peak of the $M^2$ distribution and 2.5 percents at the peak of the $v^2$ distribution. The integral contributions differ by 3.4 percents only. Beside unbound pairs, parapositronia can be directly produced in two-photon interactions \cite{dr4}. The total cross section (\ref{e4}) is written as \begin{equation} \sigma_{Ps}=\frac {16Z^4\alpha ^2\Gamma }{3m^3}\ln ^3\frac {u\sqrt {s_{nn}}}{m}. \label{e4} \end{equation} It is much lower than the cross section for creation of unbound pairs (\ref{vz}). The energy distribution of gamma-quanta from decays of parapositronia produced in ultraperipheral collisions at NICA energies is shown in Fig. 4. \begin{figure} \centerline{\includegraphics[width=16cm, height=14cm]{terz2++.pdf}} Fig. 4. The energy distribution of gamma-quanta from decays of parapositronia produced in ultraperipheral collisions at NICA energies $\sqrt {s_{nn}}$=11 GeV (blue, upper), 8 GeV (red, middle), 6.45 GeV (green, lower). \end{figure} It is obtained from Eq. (\ref{e2}) by omitting one of the integrations there and inserting the resonance cross section for $\sigma _{\gamma \gamma }(X)$ (see, e.g., \cite{drufn}). For Au-Au collisions at NICA one gets \begin{equation} \omega \frac {d\sigma }{d\omega }=\frac {4Z^4\alpha ^2\Gamma }{m^3} (\ln ^2\frac {u\sqrt {s_{nn}}}{m}-\ln^2\frac {\omega }{m}), \label{gam} \end{equation} where $\Gamma \approx 5.2\cdot 10^{-15}$ GeV is the decay width of the parapositronium. This distribution (\ref{gam}) is shown in Fig. 4 as $\omega d\sigma /d\omega $ for three energies of NICA ranging from 11 GeV to 8 GeV and 6.45 GeV per nucleon. Again, the parameter $u$=0.02 is chosen in accordance with its value obtained in Ref. \cite{vyzh}. As expected, the photon spectra are concentrated near the electron mass 511 keV and they are rather wide. The motion of parapositronia produced in ultraperipheral collisions at high enough energies of NICA is responsible for the broadened spectra in Fig. 4. In general, the direct ultraperipheral production of parapositronia is about million times less effective than the creation of dielectrons as estimated from Eqs (\ref{vz}), (\ref{e4}). Positrons move non-relativistically relative to electrons in pairs with low masses. They can annihilate with high probability. Thus the pairs with masses near 2$m$ in Figs 2 and 3 can create additional gamma-quanta with energies near 511 keV especially in astrophysical surroundings. \section{From colliders to astrophysics} Studies at particle accelerators demonstrate that dileptons are abundantly produced in ultraperipheral collisions. However, the spectra of gamma-quanta shown in Fig. 4 are much wider than those observed from Galaxy and within thunderstorms. It implies that kinetic energies of parapositronia are not small in collider studies. At the same time, the small measured width of the galactic 511 keV line indicates that parapositronia must be almost at rest there. Therefore, the way to use collider data for astrophysics and terrestrial events is not a direct one. One must point out the reliable sources of positrons and describe the mechanism of their cooling down to thermal energies suitable for formation of positronia at rest. An attempt of this kind was published in Ref. \cite{dogi}. It was stated: "We assume the black hole is a source of high energy protons generated by star accretion. The galactic black hole could be a powerful source of relativistic protons. Secondary positrons produced by pp collisions at energies 30 MeV are cooled down to thermal energies by Coulomb collisions, and annihilate in the warm neutral and ionized phases of the interstellar medium with temperatures about several eV, because the annihilation cross-section reaches its maximum at these temperatures. From kinetic equations we shall show that processes of Coulomb collisions are effective enough to cool down these relativistic positrons and to thermalize them before their annihilation, which can explain the origin of the annihilation emission from the Galactic center." Here, it is demonstrated that the heavy nuclei are $Z^4$ times more effective in production of positrons and direct positronia than protons. Existence of the Fe-component in cosmic rays indicates the presence of heavy nuclei in the Galaxy. Moreover, the spectra of unbound pairs are much softer than those assumed in \cite{dogi}, especially if the Sommerfeld-Gamow-Sakharov-factor is properly accounted. Therefore, positrons will become thermalized easier and create parapositronia decaying to two 511 keV gamma-rays. \section{Conclusions} Electromagnetic fields created by fast moving charged particles are responsible for emission of the 511 keV gamma-rays from the Galactic center and within the terrestrial thunderstorms. Studies at NICA collider can help in understanding main parameters of the ultraperipheral collisions of protons and heavy ions. {\bf Acknowledgments} This work was supported by the RFBR project 18-02-40131. \vspace{6pt} The author declares no conflicts of interest.
\section{Appendix} We discuss more details and different hyperparameters for {\large S}EED during distillation. \subsection{Pseudo-Implementations} \label{sup:code} We provide pseudo-code of the {\large S}EED distillation in \textit{Py}Torch~\cite{paszke2019pytorch} style:\\ \lstset{ language={python}, backgroundcolor=\color{backcolour}, commentstyle=\color{codegray}, keywordstyle=\color{magenta}, numberstyle=\tiny\color{codegray}, stringstyle=\color{codepurple}, basicstyle=\ttfamily\footnotesize, breakatwhitespace=false, breaklines=true, captionpos=b, keepspaces=true, numbers=left, numbersep=5pt, showspaces=false, showstringspaces=false, showtabs=false, tabsize=2, moredelim=**[is][\color{maroon}]{<}{>}, moredelim=**[is][\color{blue}]{--}{--}, moredelim=**[is][\color{p}]{---}{---}, } \begin{lstlisting} ```--Q:-- maintaining queue of previous representations: (---N--- X ---D---) --T:-- Cumbersome encoder as Teacher. --S:-- Target encoder as Student. --temp_T, temp_S:-- temperatures of the Teacher & Student. ``` # activate evaluation mode for Teacher to freeze BN and updation. T.<eval>() for images in enumerate(loader): # Enumerate single crop-view # augment image to get one identical view images = <aug>(images) # Batch-size B = images.<shape>[0] # extract embedding from S: 1 X D X_S = S(images) X_S = torch.<norm>(X_S, p=2, dim=1) # use the gradient-free mode with torch.<no_grad>(): X_T = T(image) # embedding from T: 1 X D X_T = torch.<norm>(X_T, p=2, dim=1) # insert the current batch embedding from T <enqueue>(Q, X_T) # probability scores distribution for T, S: B X (N + 1) S_Dist = torch.<einsum>('bd, dn -> bn', [X_S], Q.<t>().<clone>().<detach>()) T_Dist = torch.<einsum>('bd, dn -> bn', [X_T], Q.<t>().<clone>().<detach>()) # Apply temperatures for soft-labels S_Dist /= temp_S T_Dist = <SoftMax>(T_Dist/temp_T, dim=1) # loss computation, use log_softmax for stable computation loss = -torch.<mul>(T_Dist, Log_SoftMax(S_Dist, dim=1)).<sum>()/B # update the random sample queue <dequeue>(Q, B) # pop-out earliest B instances # SGD updation loss.<backward>() <update>(S.params) \end{lstlisting} \clearpage \subsubsection{Data Augmentations} \label{sup:dataaug} Both our teacher pre-training and distillation adopt the data augmentations as follows: \begin{enumerate}[\indent {\;\;\;\;\;\;\;\;\;\;}] \item \textit{Random Resized Crop}: The image is randomly resized with a scale of \{0.2, 1.0\}, then cropped to the size of 224$\times$224. \item \textit{Random Color Jittering}: with brightness to be \{0.4, 0.4, 0.4, 0.1\} with probability at 0.8. \item \textit{Random Gray Scale} transformation: with probability at 0.2. \item \textit{Random Gaussian Blur} transformation: with $\sigma$ = \{0.1, 0.2\} and probability at 0.5. \item \textit{Horizontal Flip}: Horizontal flip is applied with probability at 0.5. \end{enumerate} \subsubsection{Pre-training and Distillation on MobileNet and EfficientNet} \label{sup:small} MobileNet~\citep{howard2017mobilenets} and EfficientNet~\citep{tan2019efficientnet} have been considered as the smaller counterparts with larger models, \emph{i.e.}, ResNet-50 (with supervised training, {EfficientNet-B0} hits 77.2\% {Top-1} Acc., and {MobileNet-V3-large} reaches 72.2\% on ImageNet testing split). Nevertheless, un-matched performances are observed in the task of self-supervised contrastive pre-training: \emph{i.e.}, Self-Supervised Learning (MoCo-V2) on {MobileNet-V3} only yields 36.3\% Top-1 Acc. on ImageNet. We conjecture that several reasons might lead to this dilemma: \begin{enumerate} \item The inability of models with less parameters for handling large volume of categories and data, which exists also in other domains, \emph{i.e.}, face recognition~\citep{guo2016ms,zhang2017range}. \item Less possibility for optimum parameters to be chosen when transferring to downstream tasks: models with more parameters after pre-training might produce a plenty cornucopia of optimum parameters for fine-tuning. \end{enumerate} To narrow the dramatic performance gap between smaller architectures using contrastive \textit{SSL} with the larger, we explore with architectural manipulations and training hyper-parameters. In specific, we find that by adding a deeper projection head largely improves the representation quality, \emph{a.k.a.}, better performances on linear evaluation. We experiment with adding one additional linear projection head on the top of convolutional backbones. Similarly, we also expand the MLP projection head on {EfficientNet-b0}. Though recent work shows that fine-tuning from a middle layer of the projection head can produce a largely different result~\citep{chen2020big}, we consistently just use the representations from convolutional trunk \textbf{without adding extra layers} during the phase of linear evaluation. As shown in Table~\ref{tbl:mlp_smallernet}, pre-training with a deeper projection head dramatically helps the improvement on linear evaluations, adding 17\% Top-1. Acc. for {Mobile-v3-large}, and we report the improved baselines in the main paper (see the first row in Table 1 of the main paper). We keep most of the hyper-parameters as the distillation on ResNet except reducing the weight-decay of them to 1e-5, following~\citep{tan2019efficientnet, sandler2018mobilenetv2}. \begin{table}[!htb] \centering \medskip \setlength{\tabcolsep}{3.4pt} \caption{\small Linear evaluations on ImageNet of EfficientNet and MobileNet pre-trained using MoCo-v2. A deeper projection head largely boosts the linear evaluation performances on smaller architectures.} \begin{tabular}{cccc} \toprule \textbf{Model} & Deeper MLPs & Top-1 Acc. & Top-5 Acc.\\ \midrule {EfficientNet-b0} & \xmark & 39.1 & 64.6 \\ {EfficientNet-b0} & \checkmark & 42.2 & 68.5 \\ {Mobile-v3-large} & \xmark & 19.0 & 41.3 \\ {Mobile-v3-large} & \checkmark & 36.3 & 62.2 \\ \toprule \end{tabular} \vspace{2mm} \label{tbl:mlp_smallernet} \end{table} \begin{table}[h] \setlength{\tabcolsep}{6.pt} \begin{center} \renewcommand{\arraystretch}{1.1} { \caption{ {Before and after distillation Top-1/5 test \emph{accuracy} (\%) on ImageNet of EfficientNet-b0 and MobileNet-large without deeper MLPs. }} \begin{tabular}{cccc} \toprule \\[-2.8ex] \multirow{1}{*}{\textbf{Student}} & \multirow{1}{*}{\textbf{Teacher}} & Top-1 & Top-5\\ \\[-3.1ex] \midrule \multirow{4}{*}{ EfficientNet-b0}& \xmark & 39.1 & 64.6 \\ & ResNet-50 & 59.2 & 81.2 \\ & ResNet-101 & 62.8 & 84.7 \\ & ResNet-152 & 63.3 & 85.6\\[.2ex] \hdashline \\[-1.9ex] \multirow{4}{*}{ MobileNet-v3}& \xmark & 19.0 & 41.3\\ & ResNet-50 & 50.9 & 77.7\\ & ResNet-101 & 57.6 & 82.6 \\ & ResNet-152 & 58.3 & 82.9\\[.2ex] \toprule \end{tabular} } \label{tbl:imgnet_more} \end{center} \end{table} \begin{table}[t] \setlength{\tabcolsep}{8.0pt} \begin{center} \renewcommand{\arraystretch}{1.07} \caption{ ImageNet-1k test \emph{accuracy} (\%) under \textit{K}NN and linear classification on ResNet-50 encoder with \emph{deeper}, MoCo-V2/{\normalsize S}WAV pre-trained teacher architectures. \xmark\, denotes MoCo-V2 self-supervised learning baselines before distillation. * indicates using a stronger teacher encoder pre-trained by {\normalsize S}WAV with additional small-patches during distillation. } \scalebox{0.94}{ \begin{tabular}{cccccc} \toprule \\[-2.8ex] \multirow{2}{*}{\backslashbox{\textbf{Teac.}}{\textbf{Stud.}}} & & \multicolumn{3}{c}{\textbf{ResNet-50}} \\ & Epoch &\textit{K}NN & Top-1 & Top-5 \\ \hline \\[-2.0ex] \xmark & 200 & 46.1 & 67.4 & 87.8 \\[.2ex] \hdashline \\[-1.9ex] \multirow{1}{*}{\textbf{ResNet-50}} & \multirow{2}{*}{200} & 46.1 & 67.5 & 87.8 \\[-.8ex] {\tiny $\Delta$} & & {\tiny \textbf{+0.0}} & {\tiny \textbf{+0.1}} & {\tiny \textbf{+0.0}} \\[.2ex] \hdashline \\[-1.9ex] \multirow{1}{*}{\textbf{ResNet-101}} & \multirow{2}{*}{200} & 52.3 & 69.1 & 88.7 \\[-.8ex] {\tiny $\Delta$} & & {\tiny ${darkgreen}{\textbf{+6.2}}$} & {\tiny ${darkgreen}{\textbf{+1.7}}$} & {\tiny $ {\tiny \textbf{+0.9}} $} \\[.2ex] \hdashline \\[-1.9ex] \multirow{1}{*}{\textbf{ResNet-152}}& \multirow{2}{*}{200} & 53.2 & 70.4 & 90.5 \\[-.8ex] {\tiny $\Delta$} & & {\tiny${darkgreen}{\textbf{+7.1}}$} & {\tiny${darkgreen}{\textbf{+3.0}}$} & {\tiny${darkgreen}{\textbf{+2.7}}$} \\[.2ex] \hdashline \\[-1.9ex] \multirow{1}{*}{\textbf{ResNet-50{\tiny $\times$2}$^{*}$}} & \multirow{2}{*}{800} & 59.0 & 74.3 & 92.2 \\[-.8ex] {\tiny $\Delta$} & & {\tiny{darkgreen}{\textbf{+12.9}}} & {\tiny{darkgreen}{\textbf{+6.9}}} & {\tiny{darkgreen}{\textbf{+4.4}}}\\ \bottomrule \end{tabular}} \label{tbl:imgnet_res50} \vspace{1mm} \end{center} \end{table} \subsection{Additional Details of Evaluations} \label{sup:eval} We list additional details regarding our evaluation experiments in this section. \noindent \textbf{ImageNet-1k Semi-Supervised Linear Evaluation.} Following~\cite{zhai2019s4l,chen2020simple}, we train the FC layers on the basis of our student encoder after distillation using a fraction of labeled ImageNet-1k dataset (1\% and 10\%), and evaluate it on the whole test split. The fraction of labeled dataset is constructed in a class-balanced way, with roughly 12 and 128 images per class\footnote{The full image ids for semi-supervised evaluation on ImageNet-1k can be found at \url{https://github.com/google-research/simclr/tree/master/imagenet_subsets}.}. We use SGD optimizer and set initial learning rate to be 30 with a multiplier $=$ BatchSize/256 without weight decaying for 100 epochs. We use the step-wise scheduler for the learning rate updating with 5 warm-up epochs, and the learning rate is reduced by 10 at 60 and 80 epochs. On smaller architectures like EfficientNet and MobileNet, we reduce the initial learning rate to 3. During training, the image is center-cropped to the size of 224$\times$224 with just Random Horizontal Flip as the data augmentation. For testing, we first resize the image to 256$\times$256 and use the center cropped 224$\times$224 for pre-processing. In Table~\ref{tbl:imgnet_res50}, we show the distillation results on a larger encoder (ResNet-550) when using different teacher networks. \begin{table}[t] \setlength{\tabcolsep}{2.5pt} \begin{center} \renewcommand{\arraystretch}{1.2} \caption{Object detection and instance segmentation fine-tuned on VOC07: bounding-box AP (AP$^{bb}$) and mask AP (AP$^{mk}$) evaluated on VOC07-val. The first row shows the baseline from MoCo-v2 backbones without distillation. } \begin{tabular}{ccccc} \toprule \\[-3.5ex] \multirow{2}{*}{\textbf{Student}} & \multirow{2}{*}{\textbf{Teacher}} & \multicolumn{3}{c}{\textbf{VOC Object Detection}} \\ \cmidrule(lr){3-5} \\[-3.5ex] & & AP$^{\text{bb}}$ & AP$^\text{bb}_{50}$ & AP$^\text{bb}_{75}$ \\ \\[-3.5ex] \midrule \multirow{4}{*}{{ResNet-34}} & \xmark & 53.6 & 79.1 & 58.7 \\ & ResNet-50 & 53.7 {\scriptsize (+0.1)}& 79.4 {\scriptsize ${darkgreen}{(\textbf{+0.3})}$} & 59.2 {\scriptsize ${darkgreen}{(\textbf{+0.5})}$}\\ & ResNet-101 & 54.1 {\scriptsize ${darkgreen}{(\textbf{+0.5})}$} & 79.8 {\scriptsize ${darkgreen}{(\textbf{+0.7})}$} & 59.1 {\scriptsize ${darkgreen}{(\textbf{+0.4})}$}\\ & ResNet-152 & 54.4 {\scriptsize ${darkgreen}{(\textbf{+0.8})}$} & 80.1 {\scriptsize ${darkgreen}{(\textbf{+1.0})}$} & 59.9 {\scriptsize ${darkgreen}{(\textbf{+1.2})}$} \\ \hdashline \\[-3ex] \multirow{4}{*}{{ResNet-50}} & \xmark & 57.0 & 82.4 & 63.6 \\ & ResNet-50 & 57.0 {\scriptsize (+0.0)} & 82.4 {\scriptsize (+0.0)}& 63.6 {\scriptsize (+0.0)} \\ & ResNet-101 & 57.1 {\scriptsize (+0.1)} & 82.8 {\scriptsize ${darkgreen}{(\textbf{+0.4})}$} & 63.8 {\scriptsize (+0.2)}\\ & ResNet-152 & 57.3 {\scriptsize ${darkgreen}{(\textbf{+0.3})}$} & 82.8 {\scriptsize ${darkgreen}{(\textbf{+0.4})}$} & 63.9 {\scriptsize ${darkgreen}{(\textbf{+0.3})}$}\\ \toprule \end{tabular} \label{tbl:voc_more} \end{center} \end{table} \begin{table}[t] \setlength{\tabcolsep}{4pt} \begin{center} \renewcommand{\arraystretch}{1.2} \caption{ Object detection and instance segmentation fine-tuned on COCO: bounding-box AP (AP$^{bb}$) and mask AP (AP$^{mk}$) evaluated on COCO-val2017. The first several rows show the baselines from unsupervised backbones without distillation. } \begin{tabular}{ccccccccccc} \toprule \\[-3.5ex] \multirow{2}{*}{\textbf{Student}} & \multirow{2}{*}{\textbf{Teacher}} & \multicolumn{3}{c}{\textbf{Object Detection}} & \multicolumn{3}{c}{\textbf{Instance Segmentation}} \\ \cmidrule(lr){3-5}\cmidrule(lr){6-8} \cmidrule(lr){9-11}\\[-3.5ex] & & AP$^{\text{bb}}$ & AP$^\text{bb}_{50}$ & AP$^\text{bb}_{75}$ & AP$^{\text{mk}}$ & AP$^\text{mk}_{50}$ & AP$^\text{mk}_{75}$\\ \\[-3.5ex] \midrule \multirow{4}{*}{{ResNet34}} & \xmark & 38.1 & 56.8 & 40.7 & 33.0 & 53.2 & 35.3 \\ &ResNet50 & 38.4 {\scriptsize ${darkgreen}{(\textbf{+0.3})}$} & 57.0 {\scriptsize (\textbf{+0.2})} & 41.0 {\scriptsize ${darkgreen}{(\textbf{+0.3})}$} & 33.3 {\scriptsize ${darkgreen}{(\textbf{+0.3})}$} & 53.6 {\scriptsize ${darkgreen}{(\textbf{+0.4})}$} & 35.4 {\scriptsize (\textbf{+0.1})} \\ & ResNet101 & 38.5 {\scriptsize ${darkgreen}{(\textbf{+0.4})}$} & 57.3 {\scriptsize ${darkgreen}{(\textbf{+0.5})}$} & 41.4 {\scriptsize ${darkgreen}{(\textbf{+0.7})}$} & 33.6 {\scriptsize ${darkgreen}{(\textbf{+0.6})}$} & 54.1 {\scriptsize ${darkgreen}{(\textbf{+0.9})}$} & 35.6 {\scriptsize ${darkgreen}{(\textbf{+0.3})}$}\\ & ResNet152 & 38.4 {\scriptsize ${darkgreen}{(\textbf{+0.3})}$} & 57.0 {\scriptsize ${black}{(\textbf{+0.2})}$} & 41.0 {\scriptsize ${darkgreen}{(\textbf{+0.3})}$} & 33.3 {\scriptsize ${darkgreen}{(\textbf{+0.3})}$} & 53.7 {\scriptsize ${darkgreen}{(\textbf{+0.5})}$} & 35.3 {\scriptsize ${black}{(\textbf{+0.0})}$}\\ \toprule \end{tabular} \label{tbl:coco_more} \end{center} \end{table} \noindent \textbf{Transfer Learning.} We test the transferability of the representations learned from self-supervised distillation by conducting the linear evaluations using offline features on several other datasets. Specifically, a single layer logistic classifier is trained following~\citep{chen2020simple,grill2020bootstrap} using SGD optimizer without weight decay and momentum parameter at 0.9. We use CIFAR-10, CIFAR-100~\citep{krizhevsky2009learning} and SUN-397~\citep{xiao2010sun} as our testing beds. \begin{enumerate}[\indent {\;\;\;\;\;}] \item {{CIFAR}}: As the size for CIFAR dataset is 32$\times$32, we resize all images to 224$\times$224 pixels along the shorter side using bicubic interpolation method, followed by a center crop operation. We set the learning rate at 1e-3 constantly and train it for 120 epochs. Different with~\cite{chen2020simple}, we find that an obvious performance drop if using the re-sampled CIFAR images on the smaller architectures (ResNet-18 and EfficientNet). Thus, we conduct one more round of self-supervised distillation on CIFAR dataset using the interpolated images in the size of 224$\times$224 before extracting their representations for evaluation. This gives better performances than directly applying the model trained on ImageNet. The hyper-parameters are searched using 10 fold cross-validation on the train split and report its final top-1 accuracy on the test split. \item {{SUN-397}}: We further extend our transferring evaluation to the scene dataset SUN-397 for a more diverse testing. The official dataset specifies 10 different train/test splits, with each contains 50 images per category covering 397 different scenes. We follow~\citep{chen2020simple,grill2020bootstrap} and use the first train/test split. For the validation set, we randomly pick 10 images (yielding 20\% of the dataset), with identical optimizer parameters as CIFAR. \end{enumerate} \noindent \textbf{Object Detection and Instance Segmentation.} \label{sup:detection} As indicated by~\citep{he2020momentum}, features produced by self-supervised pre-training have divergent distributions in downstream tasks, thus resulting the supervised pre-training picked hyper-parameters not applicable. To relieve this, ~\cite{he2020momentum} uses feature normalization during the fine-tuning phase and train the BN layers. Different from previous transferring and linear evaluations where we exploit only offline features, model for detection and segmentation is trained with all parameters tuned. For this reason, annotations on COCO for segmentation gives much higher influence for the backbone model than the VOC dataset (see Table~\ref{tbl:voc_more}), and gives an offset to the pre-training difference (see Table~\ref{tbl:coco_more}). Thus, this makes the performance boosting by pre-training less obvious, and leads to trivial AP differences before and after distillation. \begin{enumerate}[\indent {\;\;\;\;\;}] \item {{Object Detection on PASCAL VOC-07}}: We train a C4~\citep{he2017mask} based Faster R-CNN~\citep{ren2015faster} as the detector with different ResNet architectures (ResNet-18, ResNet-34 and ResNet-50) for evaluating the transferability of features for object detection tasks. We use Detectron2~\citep{wu2019detectron2} for the implementations. We train our detector for 48k iterations with a batch size of 32 (8 images per GPU). The base learning rate is set to 0.01 with 200 warm-up iterations. We set the scale of images for training as [400, 800] and 800 at inference. \item {{Object Detection and Segmentation on COCO}}: We use Mask R-CNN~\citep{he2017mask} with the C4 backbone for the object detection and instance segmentation task on COCO dataset, with 2$\times$ schedule. Similar to the VOC detection, we tune the BN layers and all parameters. The model is trained for 180k iterations with initial learning rate set to 0.02. We set the scale of images for training as [600, 800] and 800 at inference. \end{enumerate} \subsection{Single Crop v.s. Multi-Crops View(s) for Distillation} \label{sup:multiview} In contrary with most contrastive \textit{SSL} methods where two different augmented views of an image are utilized as the positive samples (see Figure~\ref{fig:view}{\color{red} -a}), {\large S}EED uses an identical view for each image (see Figure~\ref{fig:view}{\color{red} -b}) during distillation and yields better performances, as is shown in Table.~\ref{tbl:view}. In addition, we have also experimented with two strategies of using small patches. To be specific, we follow the set-up in SWAV~\citep{caron2020unsupervised}, that 6 small patches of the size 96$\times$96 are sampled at the scale of (0.05, 0.14). Then, we apply the same augmentations as introduced previously as data pre-processing. Figure.~\ref{fig:view}{\color{red} -c} shows the way that is similar in {\large S}WAV for small-patch learning, where both large and 6 small patches are fed into the student encoder, with the learning target ($\mathbf{z}^T$) to be the embedding of large view from the teacher encoder. Figure.~\ref{fig:view}{\color{red} -d} is the strategy we use during distillation, that both views are fed into student and teacher to produce the embeddings for small-views ($\mathbf{z}_s^S$, $\mathbf{z}_s^T$) and large views ($\mathbf{z}_l^S$, $\mathbf{z}_l^T$). Based on that, the distillation is formulated separately on the small and large views. Notably, we maintain two independent queues for storing historical data samples for the large and small views. \begin{table}[t] \centering \medskip \setlength{\tabcolsep}{3.4pt} \caption{\small Linear evaluations on ImageNet of ResNet-18 after distillation from the {\large S}WAV pre-trained ResNet-50 using either single view, cross-views, or small patch views.} \begin{tabular}{lccc} \toprule \textbf{Method} & \textbf{Multi-View(s)} & \textbf{Top-1 Acc.} & \textbf{Top-5 Acc.}\\ \midrule Identical-View & 1$\times$224 & 61.7 & 84.2\\ Cross-Views & 2$\times$224 & 58.2 & 81.7 \\ Multi-Crops + Cross-Views & 1$\times$224 + 6$\times$96$\times$96 & 61.9 & 84.4 \\ Multi-Crops + Identical-View & 1$\times$224 + 6$\times$96$\times$96& \cellcolor{cellcolor}\textbf{62.6} & \cellcolor{cellcolor}\textbf{84.8} \\ \toprule \end{tabular} \vspace{2mm} \label{tbl:view} \end{table} \begin{figure}[t] \centering \includegraphics[width=1.\textwidth]{images/views.pdf} \caption{\small We experiment with different strategies of using views during distillation, which include: (a). Identical view for distillation. (b). Cross view distillation. (c). Large-small cross view distillation. (d). Large-small identical view distillation.} \label{fig:view} \end{figure} \subsection{Strategies for Other Distillation Methods} \label{sup:loss} We compare the effect of distillation using different strategies with {\large S}EED. \noindent \textbf{\textit{l2}-Distance:} We train the student encoder by minimizing the squared \textit{l2}-distance of representations from student ($\mathbf{z}^S_i$) and teacher ($\mathbf{z}^T_i$) for an identical view $\mathbf{x}_i$. \noindent \textbf{\textit{K}-Means:} We experiment with the \textit{K}-Means clustering method to retrieve pseudo class labels for distillation. Specifically, we first extract offline image features using the \textit{SSL} pre-trained Teacher network without any image augmentations. Based on this, we conduct our \textit{K}-Means clustering with 4k and 16k unique centroids. Then the final centroids are used to produce pseudo labels for unlabelled instances. With that, we carry out the distillation by training the model on a classification task using the produced labels as the ground-truth. To avoid trivial solutions that the majority of images are assigned to a few clusters, we sample images based on a uniform distribution over pseudo-labels as clustering proceeds. We observe very close results when adjusting numbers of centroids. \noindent \textbf{Online-Clustering:} With \textit{K}-Means for pseudo-label generation training, it does not lead to satisfying results (51.0\% on ResNet-18 with ResNet-50 as Teacher) as instances might have not been accurately categorized by limited frozen centroids. Similar to~\citep{caron2018deep,li2020prototypical}, we resort to the ``in-batch'' and dynamical clustering to substitute the frozen \textit{K}-Means method. We conduct \textit{K}-Means clustering within a batch and continuously update the centroid based on the teacher feature representation as distillation goes on. This alleviates the above problems and yields a substantial performance improvement on ResNet-18 to 56.4\%. \noindent \textbf{Binary Contrastive Loss:} We resort to CRD~\citep{tian2019contrastive} and adopt an \textit{info-NCE} loss-alike training objective in unsupervised distillation tasks. Specifically, we treat representation features from Teacher and Student for instance $\mathbf{x}_i$ as positive pairs, and random instances from $\mathbf{D}$ as negative samples: \begin{equation} \begin{aligned} \hat{\theta}_{S} &= \argmin_{\theta_{S}} \sum_i^N \log h(\mathbf{z}^S_i, \mathbf{z}^T_i) + K \cdot[\log h(1-h(\mathbf{z}^S_i, \mathbf{d}^T_j))], \end{aligned} \end{equation} where $\mathbf{d}^T_j \in \mathbf{D}$, $h(\cdot)$ is any family of functions that satisfy $h$: \{$\mathbf{z}$, $\mathbf{d}$\} $\rightarrow$ [0, 1], \textit{e.g.}, cosine similarity. \subsection{Discussions on {\large S}EED} \label{sup:ssd} Our proposed learning objective for {\large S}EED is composed of two goals, that is to align the encoding $\mathbf{z}^S$ by the student model with $\mathbf{z}^T$ produced by the teacher model; meanwhile, $\mathbf{z}^S$ also softly contrasts with random samples maintained in the $\mathbf{D}$. This can be formulated more directly as minimizing the \textit{l2} distance of $\mathbf{z}^T$, $\mathbf{z}^S$, together with the cross-entropy computed using $\mathbf{D}$: \begin{equation} \begin{aligned} \mathcal{L} &=\frac{1}{N}\sum_i^N\bigg\{\lambda_a\cdot\mathlarger{\mathlarger{\mathlarger{\mathlarger{\Big|}}}}\Big|\ \mathbf{z}^T_i-\mathbf{z}^S_i\ \Big|\mathlarger{\mathlarger{\mathlarger{\mathlarger{\Big|}}}}_2-\lambda_b\cdot\mathbf{p}^T(\mathbf{x}_i;\theta_T, \mathbf{D})\cdot\log\mathbf{p}^{S}(\mathbf{x}_i;\theta_S,\mathbf{D})\bigg\} \\&=\sum_i^N\bigg\{-\lambda_a\!\cdot\!\mathbf{z}_i^T\!\cdot\!\mathbf{z}^S_i-\lambda_b\!\cdot\! \sum_j^{K}\frac{\exp(\mathbf{z}_i^T\cdot\mathbf{d}_j/\tau^T)}{\sum_{\mathbf{d}\sim\mathbf{D}}\exp(\mathbf{z}_i^T\cdot\mathbf{d}/\tau^T)}\cdot\log\frac{\exp(\mathbf{z}_i^S\cdot\mathbf{d}_j/\tau^S)}{\sum_{\mathbf{d}\sim\mathbf{D}}\exp(\mathbf{z}_i^S\cdot\mathbf{d}/\tau^S)}\bigg\}, \end{aligned} \label{eq:ssd} \end{equation} Directly optimizing \emph{Eq.}~\ref{eq:ssd} can lead to apparent difficulty in searching optimal hyper-parameters ($\lambda_a, \lambda_b, \tau^T$ and $\tau^S$). Our proposed objective on $\mathbf{D}^+$ indeed is an approximated upper-bound of the above objectiveness however much simplified: \begin{equation} \begin{aligned} \mathcal{L}_{\text{{\small S}EED}} &= \frac{1}{N}\sum_i^N-\mathbf{p}^T(\mathbf{x}_i;\theta_T, \mathbf{D}^+)\cdot\log\mathbf{p}^{S}(\mathbf{x}_i;\theta_S,\mathbf{D}^+) \\&= \sum_i^N\sum_j^{K+1}-\underbrace{\frac{\exp(\mathbf{z}_i^T\cdot\mathbf{d}_j/\tau^T)}{\sum_{\mathbf{d}\sim\mathbf{D}^+}\exp(\mathbf{z}_i^T\cdot\mathbf{d}/\tau^T)}}_{\mathbf{w}^i_j}\cdot\log\frac{\exp(\mathbf{z}_i^S\cdot\mathbf{d}_j/\tau^S)}{\sum_{\mathbf{d}\sim\mathbf{D}^+}\exp(\mathbf{z}_i^S\cdot\mathbf{d}/\tau^S)}, \end{aligned} \label{eq:ssd2} \end{equation} where we let $\mathbf{w}^i_j$ denote the weighting term regulated under $\tau^T$. Since the ($K+1$)th element in $\mathbf{D}^+$ is our supplemented vector $\mathbf{z}^T_i$, the above objective can be expanded into: \begin{equation} \begin{aligned} \mathcal{L}_{\text{{\small S}EED}} =&\frac{1}{N} \sum_i^N\Big\{\mathbf{w}_{K+1}^i\cdot\big(-\mathbf{z}_i^S\cdot\mathbf{z}_i^T/\tau^S+\log\!\!\sum_{\mathbf{d}\sim\mathbf{D}^+}\!\!\exp(\mathbf{z}^S_i\cdot\mathbf{d}/\tau^S)\big) \\&+ \sum_{j=1}^{K}\mathbf{w}^i_j\cdot\big(-\mathbf{z}_i^S\!\cdot\mathbf{d}_j/\tau^S+\log\!\!\sum_{\mathbf{d}\sim\mathbf{D}^+}\!\exp(\mathbf{z}^S_i\!\cdot\mathbf{d}/\tau^S)\big)\Big\} \end{aligned} \end{equation} Note that the LSE term in the first line is strictly non-negative as the range of inner product for $\mathbf{z}^S$ and $\mathbf{d}$ lies between $\big[$-1, +1$\big]$: \begin{equation} \text{LSE}(\mathbf{D}^+, \mathbf{z}^S_i) \geq \log \big(M\!\cdot\!\exp(-1/\tau^S)\big) = \log\big( M\!\cdot\exp(-5)\big)> 0, \end{equation} where $M$ denotes the cardinality of the maintained queue $\mathbf{D}^+$ and is set to 65,536 in our experiment with $\tau^S=0.2$ constantly. Meanwhile, the LSE term in the second line satisfies the following inequality: \begin{equation} \text{LSE}(\mathbf{D}^+, \mathbf{z}^S_i) \geq \text{LSE}(\mathbf{D}, \mathbf{z}^S_i). \end{equation} Thus, this demonstrates that the objective for {\large S}EED as \emph{Eq.}~\ref{eq:ssd2} is equivalent to minimizing a weakened upper-bound of ~\emph{e.q.}~\ref{eq:ssd}: \begin{equation} \begin{aligned} \mathcal{L}_{\text{{\small S}EED}} &=\frac{1}{N} \sum_i^N-\mathbf{p}^T(\mathbf{x}_i;\theta_T, \mathbf{D}^+)\cdot\log\mathbf{p}^{S}(\mathbf{x}_i;\theta_S,\mathbf{D}^+) \\&\geq \frac{1}{N}\sum_i^N\Big\{\mathbf{w}_{K+1}^i\cdot(-\mathbf{z}_i^S\cdot\mathbf{z}_i^T/\tau^S)+ \sum_{j=1}^{K}\mathbf{w}^i_j\cdot\big(-\mathbf{z}_i^S\!\cdot\mathbf{d}_j/\tau^S+\log\!\!\sum_{\mathbf{d}\sim\mathbf{D}}\!\exp(\mathbf{z}^S_i\!\cdot\mathbf{d}/\tau^S)\big)\Big\} \\&=\frac{1}{N}\sum_i^N\bigg\{-\frac{\mathbf{w}^i_{K+1}}{\tau^S}\cdot\mathbf{z}_i^S\cdot\mathbf{z}_i^T- \mathbf{p}^T(\mathbf{x}_i;\theta_T, \mathbf{D})\cdot\log\mathbf{p}^{S}(\mathbf{x}_i;\theta_S,\mathbf{D})\bigg\} \end{aligned} \end{equation} This proves that our $\mathcal{L}_{\text{{\small S}EED}}$ directly relates to a more intuitive distillation formulation as \textit{Eq.}~\ref{eq:ssd} (\textit{l2} + cross entropy loss), and it implicitly contains the objective of aligning and contrasting. However, our training objective is much simplified. During practice, we find by regulating $\tau^T$, both training losses produce equal results. \subsection{Discussion on the Relationship of {\large S}EED with Info-NCE} \label{sup:infonce} The objective of distillation can be considered as a soft version of Info-NCE~\citep{oord2018representation}, with the only difference to be that {\large S}EED learns from the negative samples with probabilities instead of treating them all strictly as negative samples. To be more specific, following Info-NCE, the ``hard'' style contrastive distillation can be expressed as aligning with representations from the Teacher encoder and contrasting with all random instances: \begin{equation} \begin{aligned} \hat{\theta}_{S} &= \argmin_{\theta_{S}}\mathcal{L}_{NCE} =\argmin_{\theta_{S}}\sum_i^N-\log\frac{\exp(\mathbf{z}^T_i\cdot\mathbf{z}^S_i/\tau)}{\sum_{\mathbf{d}\sim\mathbf{D}}\exp(\mathbf{z}^S_i\cdot\mathbf{d}/\tau)} \end{aligned} \end{equation} which can be further deduced with two sub-terms consisting of positive sample alignment and contrasting with negative instances: \begin{equation} \mathcal{L}_{NCE} = \sum^N_i\Big\{\underbrace{-\mathbf{z}^S_i\cdot\mathbf{z}^T_i/\tau}_{alignment}+\underbrace{\log\sum_{\mathbf{d}\sim\mathbf{D}}\exp(\mathbf{z}^S_i\cdot\mathbf{d}/\tau)}_{contrasting}\Big\}. \label{eq:infonce} \end{equation} Similarly, the objective of {\large S}EED can be dissembled into the weighted form of alignment and contrasting terms: \begin{equation} \begin{aligned} \mathcal{L}_{\text{{\small S}EED}} &=\frac{1}{N*M} \sum_i^N\sum_j^{K+1}-\frac{\exp(\mathbf{z}_i^T\cdot\mathbf{d}_j/\tau^T)}{\sum_{\mathbf{d}\sim\mathbf{D}^+}\exp(\mathbf{z}_i^T\cdot\mathbf{d}/\tau^T)}\cdot\log\frac{\exp(\mathbf{z}_i^S\cdot\mathbf{d}_j/\tau^S)}{\sum_{\mathbf{d}\sim\mathbf{D}^+}\exp(\mathbf{z}_i^S\cdot\mathbf{d})/\tau^S} \\&= \frac{1}{N*M}\sum_i^N\sum_j^{K+1}\underbrace{\frac{\exp(\mathbf{z}_i^T\cdot\mathbf{d}_j/\tau^T)}{\sum_{\mathbf{d}\sim\mathbf{D}^+}\exp(\mathbf{z}_i^T\cdot\mathbf{d}/\tau^T)}}_{\mathbf{w}^i_j}\cdot(\underbrace{-\mathbf{z}_i^S\cdot\mathbf{z}_i^T/\tau^S}_{alignment}+\underbrace{\log\sum_{\mathbf{d}\sim\mathbf{D}}\exp(\mathbf{z}^S_i\cdot\mathbf{d}/\tau^{S})}_{contrasting})), \end{aligned} \end{equation} where the normalization term can be considered as soft labels, $\mathbf{W}^i = \left[\mathbf{w}^i_{1} \dots \mathbf{w}^i_{K+1}\right]$, which can weight the above loss as: \begin{equation} \mathcal{L}_{\text{{\small S}EED}} = \frac{1}{N*M} \sum_i^N\sum_j^{K+1}\mathbf{w}^i_j\cdot\Big\{-\mathbf{z}_i^S\cdot\mathbf{z}_i^T/\tau^S+\log\sum_{\mathbf{d}\sim\mathbf{D}}\exp(\mathbf{z}^S_i\cdot\mathbf{d}/\tau^{S}))\Big\}, \end{equation} When tuning hyper-parameter $\tau^T$ towards 0, $\mathbf{W}^i$ can be altered into the format of one-hot vector with $\mathbf{w}^i_{K+1}=1$, which is then degraded to the case of contrastive distillation as in \eqref{eq:infonce}. In practice, the choice of an optimal $\tau^T$ can be dataset-specific. We show that the higher $\tau^T$ (with labels be more `soft') can actually yield better results on other datasets, \emph{e.g.}, CIFAR-10~\citep{krizhevsky2009learning}. \subsection{Compatibility with Supervised Distillation} {\large S}EED conducts self-supervised distillation at the pre-training phase for the representation learning. However, we verify that {\large S}EED is compatible with traditional supervised distillation that happened during fine-tuning phrase at downstream, and can even produce better results. We begin with the \textit{SSL} pre-training on a larger architecture (ResNet-152) using MoCo-V2 and train it for 200 epochs as the teacher network. As images in CIFAR-100 are in the size of 32$\times$32, we modify the first $conv$ layer in ResNet with kernel size = 3 and stride = 1. We then compare the Top-1 accuracy of a smaller ResNet-18 on CIFAR-100 when using different distillation strategies when all parameters are trainable. First, we use {\large S}EED to pre-train ResNet-18 with Res-152 as the teacher model, and then evaluate in on the test split of CIFAR-100 using linear fine-tuning task. As we keep all parameters trainable during the fine-tuning phase, distillation on the pre-training only yields a trivial boost: 75.4\% \textit{v.s.} 75.2\%. Then, we adopt the traditional distillation method, \textit{e.g.},~\citep{hinton2015distilling}, to first fine-tune the ResNet-152 model, and then use its output class probability to facilitate the linear classification task on ResNet-18 in the fine-tuning phrase. This improves the linear classification accuracy on ResNet-18 to 76.0\%. At the end, we initialize the ResNet-18 with our {\large S}EED pre-trained ResNet-18, and equip it with the supervised classification distillation during fine-tuning. With that, we find that the performance of ResNet-18 is further boosted to 78.1\%. We can conclude that our {\large S}EED is compatible with traditional supervised distillation that mostly happened at downstream for specific tasks, \textit{e.g.}, classification, object detection. \begin{table}[h] \centering \medskip \setlength{\tabcolsep}{3.4pt} \caption{\small CIFAR-100 Top-1 \textit{Accuracy}(\%) of ResNet-18 with (or without) distillation at different phase: self-supervised pre-training stage, and supervised classification fine-tuning. All backbone parameters of ResNet-18 are trainable in experiments. } \begin{tabular}{ccc} \toprule {Pre-training Distill.} & Fine-tuning Distill. & Top-1 Acc\\ \midrule \xmark & \xmark & 75.2 \\ \checkmark & \xmark & 75.4\\ \xmark & \checkmark & 76.0 \\ \checkmark & \checkmark & 78.1 \\ \toprule \end{tabular} \vspace{2mm} \label{tbl:supervised_distill} \end{table} \begin{figure}[h] \centering \includegraphics[width=1.\textwidth]{images/ablation_queue.pdf} \caption{ Linear evaluation \textit{accuracy} (\%) of distillation between ResNet-18 (as the Student) and ResNet-50 (as the Teacher) using different size of queue when LR=0.03 and weight decay=1e-6. Note the axis is the log($\cdot$) value of queue lengths.} \label{fig:queue} \end{figure} \begin{table}[t] \begin{minipage}{.46\linewidth} { \centering \medskip \setlength{\tabcolsep}{3.4pt} \caption{Linear evaluation \textit{accuracy} (\%) of distillation between ResNet-18 (as the Student) and ResNet-50 (as the Teacher) using different learning rates when the queue size is 65,536 and weight decay=1e-6.} \begin{tabular}{ccc} \toprule {\textbf{LR}} & {Top-1 Acc.} & {Top-5 Acc.}\\ \midrule 1 & 58.9 & 83.1\\ 0.1 & 62.9 & 85.3 \\ 0.03 & \cellcolor{cellcolor}\textbf{63.3} & \cellcolor{cellcolor}\textbf{85.4} \\ 0.01 & 62.6 & 85.0 \\ \toprule \end{tabular} \vspace{2mm} \label{tbl:lr} } \end{minipage}\hfill \begin{minipage}{.5\linewidth} { \centering \medskip \setlength{\tabcolsep}{3.4pt} \caption{Linear evaluation \textit{accuracy} (\%) of distillation between ResNet-18 (as the Student) and ResNet-50 (as the Teacher) using different weight decays when the queue size is 65,536 and LR=0.03.} \begin{tabular}{ccc} \toprule {\textbf{WD}} & {Top-1 Acc.} & {Top-5 Acc.}\\ \midrule 1e-2 & 11.8 & 27.7\\ 1e-3 & 62.3 & 84.7\\ 1e-4 & 61.9 & 84.4\\ 1e-5 & 61.6 & 84.2\\ 1e-6 & \cellcolor{cellcolor}\textbf{63.3} & \cellcolor{cellcolor}\textbf{85.4} \\ \toprule \end{tabular} \vspace{2mm} \label{tbl:wd} } \end{minipage} \vspace{-2mm} \end{table} \subsection{Additional Ablation Studies} \label{sup:ablation} We study effects of different hyper-parameters to distillation using a ResNet-18 (as Student) and a {\large S}WAV pre-trained ResNet-50 (as Teacher) with small patch views. In specific, we list the Top-1 Acc. on validation split of ImageNet-1k using different lengths of queue ($K$=128, 512, 1,024, 4,096, 8,192, 16,384, 65,536) in Figure.~\ref{fig:queue}. With the increasing of random data samples, the distillation boosts the accuracy of learned representations, however within a limited range: +1.5 when the queue size is 65,536 compared with 256. Furthermore, Table.~\ref{tbl:lr} and~\ref{tbl:wd} summarize the linear evaluation accuracy under different learning rates and weight decays. \section{Experiment} \label{sec:exp} \subsection{Pre-training} \noindent \textbf{Self-Supervised Pre-training of Teacher Network.} \; By default, we use MoCo-V2~\citep{chen2020improved} to pre-train the teacher network. Following~\citep{chen2020simple}, we use ResNet as the network backbone with different depths/widths and append a multi-layer-perceptron (MLP) layer (two linear layers and one \textit{ReLU}~\citep{nair2010rectified} activation layer in between) at the end of the encoder after average pooling. The dimension of the last feature dimension is 128. All teacher networks are pre-trained for 200 epochs due to the computational limitation unless explicitly specified. As our distillation is independent with the teacher pre-training algorithm, we also show results with other self-supervised pre-trained models for teacher network, \textit{e.g.}, {\large S}WAV~\citep{caron2020unsupervised}, SimCLR~\citep{chen2020simple}. \noindent \textbf{Self-Supervised Distillation on Student Network.} \; We choose multiple smaller networks with fewer learnable parameters as the student network: MobileNet-v3-Large~\citep{howard2017mobilenets}, EfficientNet-B0~\citep{tan2019efficientnet}, and smaller ResNet with fewer layers (ResNet-18, 34). Similar to the pre-training for teacher network, we add one additional MLP layer on the basis of the student network. Our distillation is trained with a standard SGD optimizer with momentum 0.9 and a weight decay parameter of 1e-4 for 200 epochs. The initial learning rate is set as 0.03 and updated by a cosine decay scheduler~\citep{nair2010rectified} with 5 warm-up epochs and batch size 256. In \textit{Eq.}~\ref{eq:finalloss}, the teacher temperature is set as $\tau^T=0.01$ and the student temperature is $\tau^S=0.2$. The queue size of $K$ is 65,536. In the following subsections and appendix, we also show results with different hyper-parameter values, \textit{e.g.}, for $\tau^T$ and $K$. \subsection{Fine-tuning and evaluation} In order to validate the effectiveness of self-supervised distillation, we choose to assess the performance of representations of the student encoder on several downstream tasks. We first report its performances of linear evaluation and semi-supervised linear evaluation on the ImageNet ILSVRC-2012~\citep{deng2009imagenet} dataset. To measure the feature transferability brought by distillation, we also conduct evaluations on other tasks, which include object detection and segmentation on the VOC07~\citep{pascal-voc-2007} and MS-COCO~\citep{lin2014microsoft} datasets. At the end, we compare the transferability of the features learned by distillation with ordinary self-supervised contrastive learning on the tasks of linear classification on datasets from different domains. \noindent \textbf{Linear and \textit{K}NN Evaluation on ImageNet.} \; We conduct the supervised linear classification on ImageNet-1K, which contains $\sim$1.3M images for training, and 50,000 images for validation, spanning 1,000 categories. Following previous works in~\citep{he2020momentum,chen2020simple}, we train a single linear layer classifier on top of the frozen network encoder after self-supervised pre-training/distillation. SGD optimizer is used to train the linear classifier for 100 epochs with weight decay to be 0. The initial learning rate is set as 30 and is then reduced by a factor of 10 at 60 and 80 epochs (similar as in ~\cite{tian2019contrastive}). Notably, when training the linear classifier for MobileNet and EfficientNet, we reduce the initial learning rate to 3. The results are reported in terms of Top-1 and Top-5 accuracy. We also perform classification using \textit{K}-Nearest Neighbors (\textit{K}NN) based on the learned 128d vector from the last MLP layer. The sample is classified by taking the most frequent label of its $K$ ($K=10$) nearest neighbors. Table~\ref{tbl:imgnet} shows the results with various teacher networks and student networks. We list the baseline of contrastive self-supervised pre-training using MoCo-V2~\citep{chen2020improved} in the first row for each student architecture. We can see clearly that smaller networks perform rather worse. For example, MobileNet-V3 can only reach 36.3\%. This aligns well with previous conclusions from~\citep{chen2020simple,chen2020big} that bigger models are desired to perform better in contrastive-based self-supervised pre-training. We conjecture that this is mainly caused by the inability of smaller network to discriminate instances in a large-scale dataset. The results also clearly demonstrate that the distillation from a larger network helps boosting the performances of small networks, and show obvious improvement. For instance, with MoCo-V2 pre-trained ResNet-152 (for 400 epochs) as the teacher network, the Top-1 accuracy of MobileNet-V3-Large can be significantly improved from 36.3\% to 61.4\%. Furthermore, we use ResNet-50${\times2}$ (provided in~\cite{caron2020unsupervised}) as the teacher network and adopt the multi-crop trick (see~\ref{sup:eval} for details). The accuracy can be further improved to 68.2\% (last row of Table~\ref{tbl:imgnet}) for MobileNet-V3-Large with 800 epochs of distillation. We note that the gain benefited from distillation becomes more distinct on smaller architectures and we further study the effect of various teacher models in ablations. \input{tables/distill_imgnet} \begin{figure}[t] \centering \includegraphics[width=.95\textwidth]{images/semi.pdf} \caption{\small ImageNet-1k Top-1 \textit{accuracy} for semi-supervised evaluations using 1\% (red line), 10\% (blue line) of the annotations for linear fine-tuning, in comparison with the fully supervised (green line) linear evaluation baseline for SEED. For the points whose Teacher's number of parameters is at 0, we show the semi-supervised linear evaluation results of MoCo-V2 without any distillation. The Student models tend to perform better on the semi-supervised tasks after distillation from larger Teachers. } \label{fig:semi} \vspace{-4mm} \end{figure} \noindent \textbf{Semi-Supervised Evaluation on ImageNet.} \;\; Following~\citep{oord2018representation,kornblith2019better,kolesnikov2019revisiting}, we evaluate the representation on the semi-supervised task, where a fixed 1\% or 10\% subsets of ImageNet training data~\citep{chen2020simple} are provided with the annotations. After the self-supervised learning with and without distillation, we also train a classifier on top of the representation. The results are shown in Figure~\ref{fig:semi}, where the baseline without distillation is depicted when teacher parameters are 0. As we can see, the accuracy is also improved remarkably with {\large S}EED distillation, and a stronger teacher network with more parameters leads to a better performed student network. \noindent \textbf{Transferring to Classification.} To further study whether the improvement of the learned representations by distillation is confined to ImageNet, we evaluate on additional classification datasets to study the generalization and transferability of the feature representation. We follow the linear evaluation and fine-tuning settings as~\citep{kornblith2019better, chen2020simple, grill2020bootstrap}, that a linear layer is trained on the basis of frozen features. We report Top-1 Accuracy of models before and after distillation from various architectures on CIFAR-10, CIFAR-100~\citep{krizhevsky2009learning}, SUN-397~\citep{xiao2010sun} datasets (see Figure~\ref{fig:sun397}). More details regarding pre-processing and training can be found in~\ref{sup:small}. Notably, we observe that our distillation surpasses contrastive self-supervised pre-training consistently on all benchmarks, verifying the effectiveness of {\large S}EED. This also proves the generalization ability of the learned representations from distillation to a wide range of data domain and different classes. \noindent \textbf{Transferring to Detection and Segmentation.} We conduct two downstream tasks here. The first is Faster R-CNN~\citep{ren2015faster} model for object detection trained on VOC-07+12 train+val set and evaluated on VOC-07 test split. The second is Mask R-CNN~\citep{he2017mask} model for the object detection and instance segmentation on COCO 2017 dataset~\citep{lin2014microsoft}. The pre-trained model serves as the initial weight and following~\cite{he2020momentum}, we fine-tune all the layers of the model. More experiment settings can be found in~\ref{sup:detection}. The results are illustrated in Table~\ref{tbl:voc}. As we can see, on VOC, the distilled pre-trained model achieves a large improvement. With ResNet-152 as the teacher network, the Resnet18-based Faster R-CNN model shows +0.7 point improvement on AP, +1.4 improvement on AP$_{50}$ and +1.6 on AP$_{75}$. On COCO, the improvement is relatively minor and the reason could be that COCO training set has $\sim$118k training images while VOC has only $\sim$16.5k training images. A larger training set with more fine-tuning iterations reduces the importance of the initial weights. \input{tables/voc_det} \begin{figure}[t] \centering \includegraphics[width=1.\textwidth]{images/CLS.pdf} \vspace{-6mm} \caption{\small ImageNet-1k \emph{Accuracy} (\%) of student network (EfficientNet-B0 and ResNet-18) transferred to other domains (CIFAR-10, CIFAR-100, SUN-397 datasets) with and without distillation from lager architectures (ResNet-50/101/152). } \label{fig:sun397} \vspace{-3mm} \end{figure} \input{tables/distill_imgnet_wider} \subsection{Ablation Study} We now explore the effects of distillation using different Teacher architectures, Teacher Pre-training algorithms, various distillation strategies and hyper-parameters. \noindent \textbf{Different Teacher Networks.} Figure~\ref{fig:wider} summarizes the accuracy of ResNet-18 and EfficientNet-B0 distilled from wider and deeper ResNet architectures. We see clear performance improvement as depth and width of teacher network increase: compared to ResNet-50, deeper (ResNet-101) and wider (ResNet-50$\times$2) substantially improve the accuracy. However, further architectural enlargement has relatively limited effects, and we suspect the accuracy might be limited by the student network capacity in this case. \noindent \textbf{Different Teacher Pre-training Algorithms.} In Table~\ref{tbl:variants}, we show the Top-1 accuracy of ResNet-18 distilled from ResNet-50 with different pre-training algorithms, \textit{i.e.}, MoCo-V1~\citep{he2020momentum}, MoCo-V2~\citep{chen2020improved}, SimCLR~\citep{chen2020simple}, and {\large S}WAV~\citep{caron2020unsupervised}). Notably, the aforementioned methods all unanimously adopt contrastive-based pre-training except {\large S}WAV, which is based upon online clustering. We find that our {\large S}EED is agnostic to pre-training approaches, making it easy to use any self-supervised models (including clustering-based approach like {\large S}WAV) in self-supervised distillation. In addition, we observe that more training epochs for both teacher \textit{SSL} and distillation epochs can bring beneficial gain. \noindent \textbf{Other Distillation Strategies.} We explore several alternative distillation strategies. \textit{l2-Distance}: where the \textit{l2}-distance of teacher \& student's embeddings are minimized, motivated by~\cite{romero2014fitnets}. \textit{$K$-Means}: we exploit \textit{K}-Means clustering to assign a pseudo-label based on the teacher network's representation. \textit{Online Clustering}: we continuously update the clustering centers during distillation for pseudo-label generation. \textit{Binary Contrastive Loss}: we adopt an Info-NCE alike loss for contrastive distillation~\citep{tian2019contrastive}. We provide details for other strategies in~\ref{sup:loss}. Table~\ref{tbl:loss} shows the results for each method on ResNet-18 (student) distilled from ResNet-50. From the results, the simple \textit{l2}-distance minimizing approach can achieve a decent accuracy, which demonstrates the effectiveness of applying the distillation idea to the self-supervised learning. Beyond that, we study the effect of the original \textit{SSL} (MoCo-V2) supervision as supplementary loss to {\large S}EED and find it does not bring additional benefits to distillation. We find close results from these two strategies (Top-1 linear Acc.), {\large S}EED achieves 57.9\%, while SEED + MoCo-V2 achieves 57.6\%. This implies that the loss of {\large S}EED can to a large extent cover the original \textit{SSL} loss, and it is not necessary to conduct \textit{SSL} any further during distillation. Meanwhile, our proposed SEED outperforms these alternatives with highest accuracy, which shows the superiority of aligning the student towards the teacher and contrasting with the irrelevant samples. \noindent \textbf{Other Hyper-Parameters.} Table~\ref{tbl:negtive} summarizes the distillation performances on multiple datasets using different temperature $\tau^{T}$. We observe a better performance when decreasing $\tau^{T}$ to 0.01 for ImageNet-1k and CIFAR-10 dataset, and to 1e-3 for CIFAR-100 datasets. When $\tau$ is large, the softmax-normalized similarity score of $p_j^T$ between $\mathbf{z}_i^T$ and instance $\mathbf{d}_j$ in the queue $\mathbf{D}^+$ also becomes large, which means the student's feature should be less discriminative with the features of other images to some extent. When $\tau^{T}$ is 0, the teacher model will generate a one-hot vector, which only treats $\mathbf{z}_i^T$ as a positive instance and all others in the queue as negative. Thus, the best $\tau$ is a trade-off depending on the data distribution. We further compare effect of different hyper-parameters in~\ref{sup:ablation}. \input{tables/distill_loss} \section{Related Work} Among the recent literature in self-supervised learning, contrastive based approaches show prominent results on downstream tasks. Majority of the techniques along this direction are stemming from noise-contrastive estimation~\citep{gutmann2010noise} where the latent distribution is estimated by contrasting with randomly or artificially generated noises. ~\cite{oord2018representation} first proposed Info-NCE to learn image representations by predicting the future using an auto-regressive model for unsupervised learning. Follow-up works include improving the efficiency~\citep{henaff2019data}, and using multi-view as positive samples~\citep{tian2019contrastive1}. As these approaches can only have the access to limited negative instances,~\cite{wu2018unsupervised} designed a memory-bank to store the previously seen random representations as negative samples, and treat each of them as independent categories (instance discrimination). However, this approach also comes with a deficiency that the previously stored vectors are inconsistent with the recently computed representations during the earlier stage of pre-training. ~\cite{chen2020simple} mitigate this issue by sampling negative samples from a large batch. Concurrently,~\cite{he2020momentum} improve the memory-bank based method and propose to use the momentum updated encoder for the remission of representation inconsistency. Other techniques include~\cite{misra2020self} that combines the pretext-invariant objective loss with contrastive learning, and ~\cite{wang2020understanding} that decomposes contrastive loss into alignment and uniformity objectiveness. Knowledge distillation~\citep{hinton2015distilling} aims to transfer knowledge from a cumbersome model to a smaller one without losing too much generalization power, which is also well investigated in model compression~\citep{bucilua2006model}. Instead of mimicking the teacher's output logit, attention transfer~\citep{zagoruyko2016paying} formulates knowledge distillation on attention maps. Similarly, works in ~\citep{ahn2019variational,yim2017gift,koratana2019lit,huang2017like} have utilized different learning objectives including consistency on feature maps, consistency on probability mass function, and maximizing the mutual information. CRD~\citep{tian2019contrastive}, which is derived from CMC~\citep{tian2019contrastive1}, optimizes the student network by a similar objective to~\cite{oord2018representation} using a derived lower bound on mutual information. However, the aforementioned efforts all focus on task-specific distillation (\textit{e.g.}, image classification) during the fine-tuning phase rather than a task-agnostic distillation in the pre-training phase for the representation learning. Several works on natural language pre-training proposed to leverage knowledge distillation for a smaller yet stronger small models. For instances, DistillBert~\citep{sanh2019distilbert}, TinyBert~\citep{jiao2019tinybert}, and MobileBert~\citep{sun2020mobilebert}, have used knowledge distillation for model compression and shown their validity on multiple downstream tasks. Similar works also emphasize the value of smaller and faster models for language representation learning by leveraging knowledge distillation~\citep{turc2019well, sun2019patient}. These works all demonstrate the effectiveness of knowledge distillation for language representation learning in small models, while are not extended to the pre-training for visual representations. Notably, a recent concurrent work CompRess~\citep{abbasi2020compress} also point out the importance to develop better \textit{SSL} method for smaller models. {\large S}EED closely relates to the above techniques but aims to facilitate \textbf{visual representation learning during pre-training phase using distillation technique for small models}, which as far as we know has not yet been investigated. \section{introduction} \setlength{\epigraphwidth}{.8\columnwidth} \renewcommand{\epigraphflush}{center} \renewcommand{\textflush}{flushepinormal} \begin{wrapfigure}{r}{0.44\textwidth} \vspace{-5mm} \begin{center} \includegraphics[width=.44\textwidth]{images/abstract.pdf} \end{center} \vspace{-3mm} \caption{\small {\large S}EED vs. MoCo-V2~\citep{chen2020improved}) on ImageNet-1K linear probe accuracy. The vertical axis is the top-1 accuracy and the horizontal axis is the number of learnable parameters for different network architectures. Directly applying self-supervised contrastive learning (MoCo-V2) does not work well for smaller architectures, while our method ({\large S}EED) leads to dramatic performance boost. Details of the setting can be found in Section~\ref{sec:exp}. } \vspace{-3mm} \label{fig:intro} \end{wrapfigure} \footnotetext{This work was done while Zhiyuan Fang was an intern at Microsoft.} The burgeoning studies and success on self-supervised learning (\textit{SSL}) for visual representation are mainly marked by its extraordinary potency of learning from unlabeled data at scale. Accompanying with the \textit{SSL} is its phenomenal benefit of obtaining task-agnostic representations while allowing the training to dispense with prohibitively expensive data labeling. Major ramifications of visual \textit{SSL} include pretext tasks~\citep{noroozi2016unsupervised,zhang2016colorful,gidaris2018unsupervised,zhang2019aet,feng2019self}, contrastive representation learning~\citep{wu2018unsupervised, he2020momentum, chen2020simple}, online/offline clustering~\citep{yang2016joint,caron2018deep,li2020prototypical,caron2020unsupervised,grill2020bootstrap}, etc. Among them, several recent works \citep{he2020momentum, chen2020simple, caron2020unsupervised} have achieved comparable or even better accuracy than the supervised pre-training when transferring to downstream tasks, \textit{e.g.} semi-supervised classification, object detection. The aforementioned top-performing \textit{SSL} algorithms all involve large networks (\textit{e.g.}, ResNet-50~\citep{he2016deep} or larger), with, however, little attention on small networks. Empirically, we find that existing techniques like contrastive learning do not work well on small networks. For instance, the linear probe top-1 accuracy on ImageNet using MoCo-V2~\citep{chen2020improved} is only 36.3\% with MobileNet-V3-Large (see Figure~\ref{fig:intro}), which is much lower compared with its supervised training accuracy 75.2\%~\citep{howard2019searching}. For EfficientNet-B0, the accuracy is 42.2\% compared with its supervised training accuracy 77.1\%~\citep{tan2019efficientnet}. We conjecture that this is because smaller models with fewer parameters cannot effectively learn instance level discriminative representation with large amount of data. To address this challenge, we inject knowledge distillation (KD)~\citep{bucilua2006model, hinton2015distilling} into self-supervised learning and propose self-supervised distillation (dubbed as {\large S}EED) as a new learning paradigm. That is, train the larger, and distill to the smaller both in self-supervised manner. Instead of directly conducting self-supervised training on a smaller model, {\large S}EED first trains a large model (as the teacher) in a self-supervised way, and then distills the knowledge to the smaller model (as the student). Note that the conventional distillation is for supervised learning, while the distillation here is in the self-supervised setting without any labeled data. Supervised distillation can be formulated as training a student to mimic the probability mass function over classes predicted by a teacher model. In unsupervised knowledge distillation setting, however, the distribution over classes is not directly attainable. Therefore, we propose a simple yet effective self-supervised distillation method. Similar to~\citep{he2020momentum,wu2018unsupervised}, we maintain a queue of data samples. Given an instance, we first use the teacher network to obtain its similarity scores with all the data samples in the queue as well as the instance itself. Then the student encoder is trained to mimic the similarity score distribution inferred by the teacher over these data samples. The simplicity and flexibility that {\large S}EED brings are self-evident. 1) It does not require any clustering/prototypical computing procedure to retrieve the pseudo-labels or latent classes. 2) The teacher model can be pre-trained with any advanced \textit{SSL} approach, \textit{e.g.}, MoCo-V2~\citep{chen2020improved}, SimCLR~\citep{chen2020simple}, {\large S}WAV~\citep{caron2020unsupervised}. 3) The knowledge can be distilled to any target small networks (either shallower, thinner, or totally different architectures). To demonstrate the effectiveness, we comprehensively evaluate the learned representations on series of downstream tasks, \textit{e.g.}, fully/semi-supervised classification, object detection, and also assess the transferability to other domains. For example, on ImageNet-1k dataset, {\large S}EED improves the linear probe accuracy of EfficientNet-B0 from 42.2\% to 67.6\% (a gain over 25\%), and MobileNet-V3 from 36.3\% to 68.2\% (a gain over 31\%) compared to MoCo-V2 baselines, as shown in Figure~\ref{fig:intro} and Section~\ref{sec:exp}. Our contributions can be summarized as follows: \begin{itemize} \item We are the first to address the problem of self-supervised visual representation learning for small models. \item We propose a self-supervised distillation ({\large S}EED) technique to transfer knowledge from a large model to a small model without any labeled data. \item With the proposed distillation technique ({\large S}EED), we significantly improve the state-of-the-art \textit{SSL} performance on small models. \item We exhaustively compare a variety of distillation strategies to show the validity of {\large S}EED under multiple settings. \end{itemize} \input{relatedwork.tex} \section{Method} \subsection{Preliminary on Knowledge Distillation} Knowledge distillation~\citep{hinton2015distilling,bucilua2006model} is an effective technique to transfer knowledge from a strong teacher network to a target student network. The training task can be generalized as the following formulation: \begin{equation} \hat{\theta}_{S} = \argmin_{\theta_{S}}\sum_{i}^{N} \mathcal{L}_{\text{sup}}(\mathbf{x}_i, \theta_{S}, y_i) + \mathcal{L}_{{\text{distill}}}(\mathbf{x}_i, \theta_{S}, \theta_{T}), \label{eq:supervised_distill} \end{equation} where $\mathbf{x}_i$ is an image, $y_i$ is the corresponding annotation, $\theta_S$ is the parameter set for the student network, and $\theta_{T}$ is the set for the teacher network. The loss $\mathcal{L}_{\text{sup}}$ is the alignment error between the network prediction and the annotation. For example in image classification task~\citep{mishra2017apprentice, shen2020meal,polino2018model,cho2019efficacy}, it is normally a cross entropy loss. For object detection~\citep{liu2019structured, chen2017learning}, it includes bounding box regression as well. The loss of $\mathcal{L}_{\text{distill}}$ is the mimic error of the student network towards a pre-trained teacher network. For example in~\citep{hinton2015distilling}, the teacher signal comes from the softmax prediction of multiple large-scale networks and the loss is measured by the \textit{Kullback–Leibler} divergence. In~\cite{romero2014fitnets}, the task is to align the intermediate feature map values and to minimize the squared $l2$ distance. The effectiveness has been well demonstrated in the supervised setting with labeled data, but remains unknown for the unsupervised setting, which is our focus. \subsection{Self-Supervised Distillation for Visual Representation} Different from supervised distillation, {\large S}EED aims to transfer knowledge from a large model to a small model without requiring labeled data, so that the learned representations in small model can be used for downstream tasks. Inspired by contrastive \textit{SSL}, we formulate a simple approach for the distillation on the basis of instance similarity distribution over a contrastive instance queue. Similar to~\cite{he2020momentum}, we maintain an instance queue for storing data samples' encoding output from the teacher. Given a new sample, we compute its similarity scores with all the samples in the queue using both the teacher and the student models. We require that the similarity score distribution computed by the student matches with that computed by the teacher, which is formulated as minimizing the cross entropy between the student and the teacher's similarity score distributions (as illustrated in Figure~\ref{fig:arch}). \begin{figure}[t] \centering \includegraphics[width=1.\textwidth]{./images/arch.pdf} \caption{\small Illustration of our self-supervised distillation pipeline. The teacher encoder is pre-trained by \textit{SSL} and kept frozen during the distillation. The student encoder is trained by minimizing the cross entropy of probabilities from teacher \& student for an augmented view of an image, computed over a dynamically maintained queue.} \label{fig:arch} \end{figure} Specifically, for a randomly augmented view $\mathbf{x}_i$ of an image, it is first mapped and normalized into feature vector representations $\mathbf{z}_i^T$ = $f^{T}_\theta(\mathbf{x}_i)/||f^{T}_\theta(\mathbf{x}_i)||_2$, and $\mathbf{z}_i^S$ = $f^{S}_\theta(\mathbf{x}_i)/||f^{S}_\theta(\mathbf{x}_i)||_2$, where $\mathbf{z}_i^T, \mathbf{z}_i^S\in\mathbb{R}^{D}$, and $f^{T}_\theta$ and $f^{S}_\theta$ denote the teacher and student encoders, respectively. Let $\mathbf{D}=[\mathbf{d}_1 ... \mathbf{d}_K]$ denote the instance queue where $K$ is the queue length and $\mathbf{d}_j$ is the feature vector obtained from the teacher encoder. Similar to the contrastive learning framework, $\mathbf{D}$ is progressively updated under the ``\textit{first-in first-out}'' strategy as distillation proceeds. That is, we en-queue the visual features of the current batch inferred by the teacher and de-queue the earliest seen samples at the end of iteration. Note that the maintained samples in queue $\mathbf{D}$ are mostly random and irrelevant to the target instance $\mathbf{x}_i$. Minimizing the cross entropy between the similarity score distribution computed by the student and teacher based on $\mathbf{D}$ softly contrasts $\mathbf{x}_i$ with randomly selected samples, without directly aligning with the teacher encoder. To address this problem, we add the teacher's embedding ($\mathbf{z}_i^T$) into the queue and form $\mathbf{D}^+=[\mathbf{d}_1 ... \mathbf{d}_K, \mathbf{d}_{K+1}]$ with $\mathbf{d}_{K+1}=\mathbf{z}_i^T$. Let $\mathbf{p}^T(\mathbf{x}_i;\theta_T;\mathbf{D}^+)$ denote the similarity score between the extracted teacher feature $\textbf{z}_i^T$ and $\mathbf{d}_j$'s ($j=1,...,K+1$) computed by the teacher model. $\mathbf{p}^T(\mathbf{x}_i;\theta_T;\mathbf{D}^+)$ is defined as \begin{equation} \mathbf{p}^{T}(\mathbf{x}_i;\theta_T,\mathbf{D}^+) = \mathlarger{[}\,{p}^{T}_1 \,...\, {p}^{T}_{K+1}\mathlarger{]}\,,\;\;\;\;\;\;\;\; {p}^{T}_j = \frac{\text{exp}(\mathbf{z}_i^{T}\cdot\mathbf{d}_j/\tau^T)}{\sum_{\mathbf{d}\sim \mathbf{D}^+}\text{exp}(\mathbf{z}_i^{T}\cdot\mathbf{d}/\tau^T)}, \end{equation} and $\tau^T$ is a temperature parameter for the teacher. Note, we use $()^T$ to represent the feature from the teacher network and use $(\cdot)$ to represent the inner product between two features. Similarly let $\mathbf{p}^{S}(x_i;\theta_S,\mathbf{D}^+)$ denote the similarity score computed by the student model, which is defined as \begin{equation} \mathbf{p}^{S}(\mathbf{x}_i;\theta_S,\mathbf{D}^+) = \mathlarger{[}\,{p}^{S}_1 \,...\, {p}^{S}_{K+1}\mathlarger{]}\,,\;\;\;\;\;\;\;\;\text{where } {p}^{S}_j = \frac{\text{exp}(\mathbf{z}_i^{S}\cdot\mathbf{d}_j/\tau^S)}{\sum_{\mathbf{d}\sim \mathbf{D}^+}\text{exp}(\mathbf{z}_i^{S}\cdot\mathbf{d}/\tau^S)}, \end{equation} and $\tau^S$ is a temperature parameter for the student. Our self-supervised distillation can be formulated as minimizing the cross entropy between the similarity scores of the teacher, $\mathbf{p}^T(\mathbf{x}_i;\theta_T, \mathbf{D}^+)$, and the student, $\mathbf{p}^{S}(\mathbf{x}_i;\theta_S,\mathbf{D}^+)$, over all the instances $\mathbf{x}_i$, that is, \begin{equation} \begin{aligned} \hat{\theta}_{S} &= \argmin_{\theta_{S}} \sum_i^N-\mathbf{p}^T(\mathbf{x}_i;\theta_T, \mathbf{D}^+)\cdot\log\mathbf{p}^{S}(\mathbf{x}_i;\theta_S,\mathbf{D}^+) \\&=\argmin_{\theta_{S}} \sum_i^N\sum_j^{K+1}-\frac{\exp(\mathbf{z}_i^T\cdot\mathbf{d}_j/\tau^T)}{\sum_{\mathbf{d}\sim\mathbf{D}^+}\exp(\mathbf{z}_i^T\cdot\mathbf{d}/\tau^T)}\cdot\log\frac{\exp(\mathbf{z}_i^S\cdot\mathbf{d}_j/\tau^S)}{\sum_{\mathbf{d}\sim\mathbf{D}^+}\exp(\mathbf{z}_i^S\cdot\mathbf{d}/\tau^S)}. \end{aligned} \label{eq:finalloss} \end{equation} Since the teacher network is pre-trained and frozen, the queued features are consistent during training \textit{w.r.t.} the student network. The higher the value of $p_j^T$ is, the larger weight will be laid on $p_j^S$. Due to the $l2$ normalization, similarity score between $\mathbf{z}_i^T$ and $\mathbf{d}_{K+1}$ remains constant $\mathbb{1}$ before softmax normalization, which is the largest among $p_j^T$. Thus, the weight for $p^S_{K+1}$ is the largest and can be adjusted solely by tuning the value of $\tau^T$. By minimizing the loss, the feature of $\mathbf{z}_i^S$ can be aligned with $\mathbf{z}_i^T$ and meanwhile contrasts with other unrelated image features in $\mathbf{D}$. We further discuss the relation of these two goals with our learning objective in Appendix~\ref{sup:ssd}. \noindent \textbf{Relations with \textit{Info-NCE} loss.} When $\tau^T$ $\rightarrow 0$, the softmax function for $\mathbf{p}^T$ smoothly approaches to a one-hot vector, where $p_{K + 1}^T$ equals 1 and all others 0. In this extreme case, the loss becomes \begin{equation} \begin{aligned} \mathcal{L}_\textit{{{NCE}}} =\sum_i^N-\log\frac{\exp(\mathbf{z}^T_i\cdot\mathbf{z}^S_i/\tau)}{\sum_{\mathbf{d}\sim\mathbf{D}^+}\exp(\mathbf{z}^S_i\cdot\mathbf{d}/\tau)}, \end{aligned} \end{equation} which is similar to the widely-used \textit{Info-NCE} loss~\citep{oord2018representation} in contrastive-based \textit{SSL} (see discussion in Appendix~\ref{sup:infonce}. \input{experiment.tex} \vspace{-2mm} \section{Conclusions} Self-Supervised Learning is acknowledged for its remarkable ability in learning from unlabeled, and large scale data. However, a critical impedance for the \textit{SSL} pre-training on smaller architecture comes from its low capacity of discriminating enormous number of instances. Instead of directly learning from unlabeled data, we proposed {\large S}EED as a novel self-supervised learning paradigm, which learns representation by self-supervised distillation from a bigger \textit{SSL} pre-trained model. We show in extensive experiments that {\large S}EED effectively addresses the weakness of self-supervised learning for small models and achieves state-of-the-art results on various benchmarks of small architectures. \bibliographystyle{iclr2020_conference} \section{Method} \section{Appendix} We discuss more details and different hyperparameters for {\large S}EED during distillation. \subsection{Pseudo-Implementations} \label{sup:code} We provide pseudo-code of the {\large S}EED distillation in \textit{Py}Torch~\cite{paszke2019pytorch} style:\\ \lstset{ language={python}, backgroundcolor=\color{backcolour}, commentstyle=\color{codegray}, keywordstyle=\color{magenta}, numberstyle=\tiny\color{codegray}, stringstyle=\color{codepurple}, basicstyle=\ttfamily\footnotesize, breakatwhitespace=false, breaklines=true, captionpos=b, keepspaces=true, numbers=left, numbersep=5pt, showspaces=false, showstringspaces=false, showtabs=false, tabsize=2, moredelim=**[is][\color{maroon}]{<}{>}, moredelim=**[is][\color{blue}]{--}{--}, moredelim=**[is][\color{p}]{---}{---}, } \begin{lstlisting} ```--Q:-- maintaining queue of previous representations: (---N--- X ---D---) --T:-- Cumbersome encoder as Teacher. --S:-- Target encoder as Student. --temp_T, temp_S:-- temperatures of the Teacher & Student. ``` # activate evaluation mode for Teacher to freeze BN and updation. T.<eval>() for images in enumerate(loader): # Enumerate single crop-view # augment image to get one identical view images = <aug>(images) # Batch-size B = images.<shape>[0] # extract embedding from S: 1 X D X_S = S(images) X_S = torch.<norm>(X_S, p=2, dim=1) # use the gradient-free mode with torch.<no_grad>(): X_T = T(image) # embedding from T: 1 X D X_T = torch.<norm>(X_T, p=2, dim=1) # insert the current batch embedding from T <enqueue>(Q, X_T) # probability scores distribution for T, S: B X (N + 1) S_Dist = torch.<einsum>('bd, dn -> bn', [X_S], Q.<t>().<clone>().<detach>()) T_Dist = torch.<einsum>('bd, dn -> bn', [X_T], Q.<t>().<clone>().<detach>()) # Apply temperatures for soft-labels S_Dist /= temp_S T_Dist = <SoftMax>(T_Dist/temp_T, dim=1) # loss computation, use log_softmax for stable computation loss = -torch.<mul>(T_Dist, Log_SoftMax(S_Dist, dim=1)).<sum>()/B # update the random sample queue <dequeue>(Q, B) # pop-out earliest B instances # SGD updation loss.<backward>() <update>(S.params) \end{lstlisting} \clearpage \subsubsection{Data Augmentations} \label{sup:dataaug} Both our teacher pre-training and distillation adopt the data augmentations as follows: \begin{enumerate}[\indent {\;\;\;\;\;\;\;\;\;\;}] \item \textit{Random Resized Crop}: The image is randomly resized with a scale of \{0.2, 1.0\}, then cropped to the size of 224$\times$224. \item \textit{Random Color Jittering}: with brightness to be \{0.4, 0.4, 0.4, 0.1\} with probability at 0.8. \item \textit{Random Gray Scale} transformation: with probability at 0.2. \item \textit{Random Gaussian Blur} transformation: with $\sigma$ = \{0.1, 0.2\} and probability at 0.5. \item \textit{Horizontal Flip}: Horizontal flip is applied with probability at 0.5. \end{enumerate} \subsubsection{Pre-training and Distillation on MobileNet and EfficientNet} \label{sup:small} MobileNet~\citep{howard2017mobilenets} and EfficientNet~\citep{tan2019efficientnet} have been considered as the smaller counterparts with larger models, \emph{i.e.}, ResNet-50 (with supervised training, {EfficientNet-B0} hits 77.2\% {Top-1} Acc., and {MobileNet-V3-large} reaches 72.2\% on ImageNet testing split). Nevertheless, un-matched performances are observed in the task of self-supervised contrastive pre-training: \emph{i.e.}, Self-Supervised Learning (MoCo-V2) on {MobileNet-V3} only yields 36.3\% Top-1 Acc. on ImageNet. We conjecture that several reasons might lead to this dilemma: \begin{enumerate} \item The inability of models with less parameters for handling large volume of categories and data, which exists also in other domains, \emph{i.e.}, face recognition~\citep{guo2016ms,zhang2017range}. \item Less possibility for optimum parameters to be chosen when transferring to downstream tasks: models with more parameters after pre-training might produce a plenty cornucopia of optimum parameters for fine-tuning. \end{enumerate} To narrow the dramatic performance gap between smaller architectures using contrastive \textit{SSL} with the larger, we explore with architectural manipulations and training hyper-parameters. In specific, we find that by adding a deeper projection head largely improves the representation quality, \emph{a.k.a.}, better performances on linear evaluation. We experiment with adding one additional linear projection head on the top of convolutional backbones. Similarly, we also expand the MLP projection head on {EfficientNet-b0}. Though recent work shows that fine-tuning from a middle layer of the projection head can produce a largely different result~\citep{chen2020big}, we consistently just use the representations from convolutional trunk \textbf{without adding extra layers} during the phase of linear evaluation. As shown in Table~\ref{tbl:mlp_smallernet}, pre-training with a deeper projection head dramatically helps the improvement on linear evaluations, adding 17\% Top-1. Acc. for {Mobile-v3-large}, and we report the improved baselines in the main paper (see the first row in Table 1 of the main paper). We keep most of the hyper-parameters as the distillation on ResNet except reducing the weight-decay of them to 1e-5, following~\citep{tan2019efficientnet, sandler2018mobilenetv2}. \begin{table}[!htb] \centering \medskip \setlength{\tabcolsep}{3.4pt} \caption{\small Linear evaluations on ImageNet of EfficientNet and MobileNet pre-trained using MoCo-v2. A deeper projection head largely boosts the linear evaluation performances on smaller architectures.} \begin{tabular}{cccc} \toprule \textbf{Model} & Deeper MLPs & Top-1 Acc. & Top-5 Acc.\\ \midrule {EfficientNet-b0} & \xmark & 39.1 & 64.6 \\ {EfficientNet-b0} & \checkmark & 42.2 & 68.5 \\ {Mobile-v3-large} & \xmark & 19.0 & 41.3 \\ {Mobile-v3-large} & \checkmark & 36.3 & 62.2 \\ \toprule \end{tabular} \vspace{2mm} \label{tbl:mlp_smallernet} \end{table} \begin{table}[h] \setlength{\tabcolsep}{6.pt} \begin{center} \renewcommand{\arraystretch}{1.1} { \caption{ {Before and after distillation Top-1/5 test \emph{accuracy} (\%) on ImageNet of EfficientNet-b0 and MobileNet-large without deeper MLPs. }} \begin{tabular}{cccc} \toprule \\[-2.8ex] \multirow{1}{*}{\textbf{Student}} & \multirow{1}{*}{\textbf{Teacher}} & Top-1 & Top-5\\ \\[-3.1ex] \midrule \multirow{4}{*}{ EfficientNet-b0}& \xmark & 39.1 & 64.6 \\ & ResNet-50 & 59.2 & 81.2 \\ & ResNet-101 & 62.8 & 84.7 \\ & ResNet-152 & 63.3 & 85.6\\[.2ex] \hdashline \\[-1.9ex] \multirow{4}{*}{ MobileNet-v3}& \xmark & 19.0 & 41.3\\ & ResNet-50 & 50.9 & 77.7\\ & ResNet-101 & 57.6 & 82.6 \\ & ResNet-152 & 58.3 & 82.9\\[.2ex] \toprule \end{tabular} } \label{tbl:imgnet_more} \end{center} \end{table} \begin{table}[t] \setlength{\tabcolsep}{8.0pt} \begin{center} \renewcommand{\arraystretch}{1.07} \caption{ ImageNet-1k test \emph{accuracy} (\%) under \textit{K}NN and linear classification on ResNet-50 encoder with \emph{deeper}, MoCo-V2/{\normalsize S}WAV pre-trained teacher architectures. \xmark\, denotes MoCo-V2 self-supervised learning baselines before distillation. * indicates using a stronger teacher encoder pre-trained by {\normalsize S}WAV with additional small-patches during distillation. } \scalebox{0.94}{ \begin{tabular}{cccccc} \toprule \\[-2.8ex] \multirow{2}{*}{\backslashbox{\textbf{Teac.}}{\textbf{Stud.}}} & & \multicolumn{3}{c}{\textbf{ResNet-50}} \\ & Epoch &\textit{K}NN & Top-1 & Top-5 \\ \hline \\[-2.0ex] \xmark & 200 & 46.1 & 67.4 & 87.8 \\[.2ex] \hdashline \\[-1.9ex] \multirow{1}{*}{\textbf{ResNet-50}} & \multirow{2}{*}{200} & 46.1 & 67.5 & 87.8 \\[-.8ex] {\tiny $\Delta$} & & {\tiny \textbf{+0.0}} & {\tiny \textbf{+0.1}} & {\tiny \textbf{+0.0}} \\[.2ex] \hdashline \\[-1.9ex] \multirow{1}{*}{\textbf{ResNet-101}} & \multirow{2}{*}{200} & 52.3 & 69.1 & 88.7 \\[-.8ex] {\tiny $\Delta$} & & {\tiny ${darkgreen}{\textbf{+6.2}}$} & {\tiny ${darkgreen}{\textbf{+1.7}}$} & {\tiny $ {\tiny \textbf{+0.9}} $} \\[.2ex] \hdashline \\[-1.9ex] \multirow{1}{*}{\textbf{ResNet-152}}& \multirow{2}{*}{200} & 53.2 & 70.4 & 90.5 \\[-.8ex] {\tiny $\Delta$} & & {\tiny${darkgreen}{\textbf{+7.1}}$} & {\tiny${darkgreen}{\textbf{+3.0}}$} & {\tiny${darkgreen}{\textbf{+2.7}}$} \\[.2ex] \hdashline \\[-1.9ex] \multirow{1}{*}{\textbf{ResNet-50{\tiny $\times$2}$^{*}$}} & \multirow{2}{*}{800} & 59.0 & 74.3 & 92.2 \\[-.8ex] {\tiny $\Delta$} & & {\tiny{darkgreen}{\textbf{+12.9}}} & {\tiny{darkgreen}{\textbf{+6.9}}} & {\tiny{darkgreen}{\textbf{+4.4}}}\\ \bottomrule \end{tabular}} \label{tbl:imgnet_res50} \vspace{1mm} \end{center} \end{table} \subsection{Additional Details of Evaluations} \label{sup:eval} We list additional details regarding our evaluation experiments in this section. \noindent \textbf{ImageNet-1k Semi-Supervised Linear Evaluation.} Following~\cite{zhai2019s4l,chen2020simple}, we train the FC layers on the basis of our student encoder after distillation using a fraction of labeled ImageNet-1k dataset (1\% and 10\%), and evaluate it on the whole test split. The fraction of labeled dataset is constructed in a class-balanced way, with roughly 12 and 128 images per class\footnote{The full image ids for semi-supervised evaluation on ImageNet-1k can be found at \url{https://github.com/google-research/simclr/tree/master/imagenet_subsets}.}. We use SGD optimizer and set initial learning rate to be 30 with a multiplier $=$ BatchSize/256 without weight decaying for 100 epochs. We use the step-wise scheduler for the learning rate updating with 5 warm-up epochs, and the learning rate is reduced by 10 at 60 and 80 epochs. On smaller architectures like EfficientNet and MobileNet, we reduce the initial learning rate to 3. During training, the image is center-cropped to the size of 224$\times$224 with just Random Horizontal Flip as the data augmentation. For testing, we first resize the image to 256$\times$256 and use the center cropped 224$\times$224 for pre-processing. In Table~\ref{tbl:imgnet_res50}, we show the distillation results on a larger encoder (ResNet-550) when using different teacher networks. \begin{table}[t] \setlength{\tabcolsep}{2.5pt} \begin{center} \renewcommand{\arraystretch}{1.2} \caption{Object detection and instance segmentation fine-tuned on VOC07: bounding-box AP (AP$^{bb}$) and mask AP (AP$^{mk}$) evaluated on VOC07-val. The first row shows the baseline from MoCo-v2 backbones without distillation. } \begin{tabular}{ccccc} \toprule \\[-3.5ex] \multirow{2}{*}{\textbf{Student}} & \multirow{2}{*}{\textbf{Teacher}} & \multicolumn{3}{c}{\textbf{VOC Object Detection}} \\ \cmidrule(lr){3-5} \\[-3.5ex] & & AP$^{\text{bb}}$ & AP$^\text{bb}_{50}$ & AP$^\text{bb}_{75}$ \\ \\[-3.5ex] \midrule \multirow{4}{*}{{ResNet-34}} & \xmark & 53.6 & 79.1 & 58.7 \\ & ResNet-50 & 53.7 {\scriptsize (+0.1)}& 79.4 {\scriptsize ${darkgreen}{(\textbf{+0.3})}$} & 59.2 {\scriptsize ${darkgreen}{(\textbf{+0.5})}$}\\ & ResNet-101 & 54.1 {\scriptsize ${darkgreen}{(\textbf{+0.5})}$} & 79.8 {\scriptsize ${darkgreen}{(\textbf{+0.7})}$} & 59.1 {\scriptsize ${darkgreen}{(\textbf{+0.4})}$}\\ & ResNet-152 & 54.4 {\scriptsize ${darkgreen}{(\textbf{+0.8})}$} & 80.1 {\scriptsize ${darkgreen}{(\textbf{+1.0})}$} & 59.9 {\scriptsize ${darkgreen}{(\textbf{+1.2})}$} \\ \hdashline \\[-3ex] \multirow{4}{*}{{ResNet-50}} & \xmark & 57.0 & 82.4 & 63.6 \\ & ResNet-50 & 57.0 {\scriptsize (+0.0)} & 82.4 {\scriptsize (+0.0)}& 63.6 {\scriptsize (+0.0)} \\ & ResNet-101 & 57.1 {\scriptsize (+0.1)} & 82.8 {\scriptsize ${darkgreen}{(\textbf{+0.4})}$} & 63.8 {\scriptsize (+0.2)}\\ & ResNet-152 & 57.3 {\scriptsize ${darkgreen}{(\textbf{+0.3})}$} & 82.8 {\scriptsize ${darkgreen}{(\textbf{+0.4})}$} & 63.9 {\scriptsize ${darkgreen}{(\textbf{+0.3})}$}\\ \toprule \end{tabular} \label{tbl:voc_more} \end{center} \end{table} \begin{table}[t] \setlength{\tabcolsep}{4pt} \begin{center} \renewcommand{\arraystretch}{1.2} \caption{ Object detection and instance segmentation fine-tuned on COCO: bounding-box AP (AP$^{bb}$) and mask AP (AP$^{mk}$) evaluated on COCO-val2017. The first several rows show the baselines from unsupervised backbones without distillation. } \begin{tabular}{ccccccccccc} \toprule \\[-3.5ex] \multirow{2}{*}{\textbf{Student}} & \multirow{2}{*}{\textbf{Teacher}} & \multicolumn{3}{c}{\textbf{Object Detection}} & \multicolumn{3}{c}{\textbf{Instance Segmentation}} \\ \cmidrule(lr){3-5}\cmidrule(lr){6-8} \cmidrule(lr){9-11}\\[-3.5ex] & & AP$^{\text{bb}}$ & AP$^\text{bb}_{50}$ & AP$^\text{bb}_{75}$ & AP$^{\text{mk}}$ & AP$^\text{mk}_{50}$ & AP$^\text{mk}_{75}$\\ \\[-3.5ex] \midrule \multirow{4}{*}{{ResNet34}} & \xmark & 38.1 & 56.8 & 40.7 & 33.0 & 53.2 & 35.3 \\ &ResNet50 & 38.4 {\scriptsize ${darkgreen}{(\textbf{+0.3})}$} & 57.0 {\scriptsize (\textbf{+0.2})} & 41.0 {\scriptsize ${darkgreen}{(\textbf{+0.3})}$} & 33.3 {\scriptsize ${darkgreen}{(\textbf{+0.3})}$} & 53.6 {\scriptsize ${darkgreen}{(\textbf{+0.4})}$} & 35.4 {\scriptsize (\textbf{+0.1})} \\ & ResNet101 & 38.5 {\scriptsize ${darkgreen}{(\textbf{+0.4})}$} & 57.3 {\scriptsize ${darkgreen}{(\textbf{+0.5})}$} & 41.4 {\scriptsize ${darkgreen}{(\textbf{+0.7})}$} & 33.6 {\scriptsize ${darkgreen}{(\textbf{+0.6})}$} & 54.1 {\scriptsize ${darkgreen}{(\textbf{+0.9})}$} & 35.6 {\scriptsize ${darkgreen}{(\textbf{+0.3})}$}\\ & ResNet152 & 38.4 {\scriptsize ${darkgreen}{(\textbf{+0.3})}$} & 57.0 {\scriptsize ${black}{(\textbf{+0.2})}$} & 41.0 {\scriptsize ${darkgreen}{(\textbf{+0.3})}$} & 33.3 {\scriptsize ${darkgreen}{(\textbf{+0.3})}$} & 53.7 {\scriptsize ${darkgreen}{(\textbf{+0.5})}$} & 35.3 {\scriptsize ${black}{(\textbf{+0.0})}$}\\ \toprule \end{tabular} \label{tbl:coco_more} \end{center} \end{table} \noindent \textbf{Transfer Learning.} We test the transferability of the representations learned from self-supervised distillation by conducting the linear evaluations using offline features on several other datasets. Specifically, a single layer logistic classifier is trained following~\citep{chen2020simple,grill2020bootstrap} using SGD optimizer without weight decay and momentum parameter at 0.9. We use CIFAR-10, CIFAR-100~\citep{krizhevsky2009learning} and SUN-397~\citep{xiao2010sun} as our testing beds. \begin{enumerate}[\indent {\;\;\;\;\;}] \item {{CIFAR}}: As the size for CIFAR dataset is 32$\times$32, we resize all images to 224$\times$224 pixels along the shorter side using bicubic interpolation method, followed by a center crop operation. We set the learning rate at 1e-3 constantly and train it for 120 epochs. Different with~\cite{chen2020simple}, we find that an obvious performance drop if using the re-sampled CIFAR images on the smaller architectures (ResNet-18 and EfficientNet). Thus, we conduct one more round of self-supervised distillation on CIFAR dataset using the interpolated images in the size of 224$\times$224 before extracting their representations for evaluation. This gives better performances than directly applying the model trained on ImageNet. The hyper-parameters are searched using 10 fold cross-validation on the train split and report its final top-1 accuracy on the test split. \item {{SUN-397}}: We further extend our transferring evaluation to the scene dataset SUN-397 for a more diverse testing. The official dataset specifies 10 different train/test splits, with each contains 50 images per category covering 397 different scenes. We follow~\citep{chen2020simple,grill2020bootstrap} and use the first train/test split. For the validation set, we randomly pick 10 images (yielding 20\% of the dataset), with identical optimizer parameters as CIFAR. \end{enumerate} \noindent \textbf{Object Detection and Instance Segmentation.} \label{sup:detection} As indicated by~\citep{he2020momentum}, features produced by self-supervised pre-training have divergent distributions in downstream tasks, thus resulting the supervised pre-training picked hyper-parameters not applicable. To relieve this, ~\cite{he2020momentum} uses feature normalization during the fine-tuning phase and train the BN layers. Different from previous transferring and linear evaluations where we exploit only offline features, model for detection and segmentation is trained with all parameters tuned. For this reason, annotations on COCO for segmentation gives much higher influence for the backbone model than the VOC dataset (see Table~\ref{tbl:voc_more}), and gives an offset to the pre-training difference (see Table~\ref{tbl:coco_more}). Thus, this makes the performance boosting by pre-training less obvious, and leads to trivial AP differences before and after distillation. \begin{enumerate}[\indent {\;\;\;\;\;}] \item {{Object Detection on PASCAL VOC-07}}: We train a C4~\citep{he2017mask} based Faster R-CNN~\citep{ren2015faster} as the detector with different ResNet architectures (ResNet-18, ResNet-34 and ResNet-50) for evaluating the transferability of features for object detection tasks. We use Detectron2~\citep{wu2019detectron2} for the implementations. We train our detector for 48k iterations with a batch size of 32 (8 images per GPU). The base learning rate is set to 0.01 with 200 warm-up iterations. We set the scale of images for training as [400, 800] and 800 at inference. \item {{Object Detection and Segmentation on COCO}}: We use Mask R-CNN~\citep{he2017mask} with the C4 backbone for the object detection and instance segmentation task on COCO dataset, with 2$\times$ schedule. Similar to the VOC detection, we tune the BN layers and all parameters. The model is trained for 180k iterations with initial learning rate set to 0.02. We set the scale of images for training as [600, 800] and 800 at inference. \end{enumerate} \subsection{Single Crop v.s. Multi-Crops View(s) for Distillation} \label{sup:multiview} In contrary with most contrastive \textit{SSL} methods where two different augmented views of an image are utilized as the positive samples (see Figure~\ref{fig:view}{\color{red} -a}), {\large S}EED uses an identical view for each image (see Figure~\ref{fig:view}{\color{red} -b}) during distillation and yields better performances, as is shown in Table.~\ref{tbl:view}. In addition, we have also experimented with two strategies of using small patches. To be specific, we follow the set-up in SWAV~\citep{caron2020unsupervised}, that 6 small patches of the size 96$\times$96 are sampled at the scale of (0.05, 0.14). Then, we apply the same augmentations as introduced previously as data pre-processing. Figure.~\ref{fig:view}{\color{red} -c} shows the way that is similar in {\large S}WAV for small-patch learning, where both large and 6 small patches are fed into the student encoder, with the learning target ($\mathbf{z}^T$) to be the embedding of large view from the teacher encoder. Figure.~\ref{fig:view}{\color{red} -d} is the strategy we use during distillation, that both views are fed into student and teacher to produce the embeddings for small-views ($\mathbf{z}_s^S$, $\mathbf{z}_s^T$) and large views ($\mathbf{z}_l^S$, $\mathbf{z}_l^T$). Based on that, the distillation is formulated separately on the small and large views. Notably, we maintain two independent queues for storing historical data samples for the large and small views. \begin{table}[t] \centering \medskip \setlength{\tabcolsep}{3.4pt} \caption{\small Linear evaluations on ImageNet of ResNet-18 after distillation from the {\large S}WAV pre-trained ResNet-50 using either single view, cross-views, or small patch views.} \begin{tabular}{lccc} \toprule \textbf{Method} & \textbf{Multi-View(s)} & \textbf{Top-1 Acc.} & \textbf{Top-5 Acc.}\\ \midrule Identical-View & 1$\times$224 & 61.7 & 84.2\\ Cross-Views & 2$\times$224 & 58.2 & 81.7 \\ Multi-Crops + Cross-Views & 1$\times$224 + 6$\times$96$\times$96 & 61.9 & 84.4 \\ Multi-Crops + Identical-View & 1$\times$224 + 6$\times$96$\times$96& \cellcolor{cellcolor}\textbf{62.6} & \cellcolor{cellcolor}\textbf{84.8} \\ \toprule \end{tabular} \vspace{2mm} \label{tbl:view} \end{table} \begin{figure}[t] \centering \includegraphics[width=1.\textwidth]{images/views.pdf} \caption{\small We experiment with different strategies of using views during distillation, which include: (a). Identical view for distillation. (b). Cross view distillation. (c). Large-small cross view distillation. (d). Large-small identical view distillation.} \label{fig:view} \end{figure} \subsection{Strategies for Other Distillation Methods} \label{sup:loss} We compare the effect of distillation using different strategies with {\large S}EED. \noindent \textbf{\textit{l2}-Distance:} We train the student encoder by minimizing the squared \textit{l2}-distance of representations from student ($\mathbf{z}^S_i$) and teacher ($\mathbf{z}^T_i$) for an identical view $\mathbf{x}_i$. \noindent \textbf{\textit{K}-Means:} We experiment with the \textit{K}-Means clustering method to retrieve pseudo class labels for distillation. Specifically, we first extract offline image features using the \textit{SSL} pre-trained Teacher network without any image augmentations. Based on this, we conduct our \textit{K}-Means clustering with 4k and 16k unique centroids. Then the final centroids are used to produce pseudo labels for unlabelled instances. With that, we carry out the distillation by training the model on a classification task using the produced labels as the ground-truth. To avoid trivial solutions that the majority of images are assigned to a few clusters, we sample images based on a uniform distribution over pseudo-labels as clustering proceeds. We observe very close results when adjusting numbers of centroids. \noindent \textbf{Online-Clustering:} With \textit{K}-Means for pseudo-label generation training, it does not lead to satisfying results (51.0\% on ResNet-18 with ResNet-50 as Teacher) as instances might have not been accurately categorized by limited frozen centroids. Similar to~\citep{caron2018deep,li2020prototypical}, we resort to the ``in-batch'' and dynamical clustering to substitute the frozen \textit{K}-Means method. We conduct \textit{K}-Means clustering within a batch and continuously update the centroid based on the teacher feature representation as distillation goes on. This alleviates the above problems and yields a substantial performance improvement on ResNet-18 to 56.4\%. \noindent \textbf{Binary Contrastive Loss:} We resort to CRD~\citep{tian2019contrastive} and adopt an \textit{info-NCE} loss-alike training objective in unsupervised distillation tasks. Specifically, we treat representation features from Teacher and Student for instance $\mathbf{x}_i$ as positive pairs, and random instances from $\mathbf{D}$ as negative samples: \begin{equation} \begin{aligned} \hat{\theta}_{S} &= \argmin_{\theta_{S}} \sum_i^N \log h(\mathbf{z}^S_i, \mathbf{z}^T_i) + K \cdot[\log h(1-h(\mathbf{z}^S_i, \mathbf{d}^T_j))], \end{aligned} \end{equation} where $\mathbf{d}^T_j \in \mathbf{D}$, $h(\cdot)$ is any family of functions that satisfy $h$: \{$\mathbf{z}$, $\mathbf{d}$\} $\rightarrow$ [0, 1], \textit{e.g.}, cosine similarity. \subsection{Discussions on {\large S}EED} \label{sup:ssd} Our proposed learning objective for {\large S}EED is composed of two goals, that is to align the encoding $\mathbf{z}^S$ by the student model with $\mathbf{z}^T$ produced by the teacher model; meanwhile, $\mathbf{z}^S$ also softly contrasts with random samples maintained in the $\mathbf{D}$. This can be formulated more directly as minimizing the \textit{l2} distance of $\mathbf{z}^T$, $\mathbf{z}^S$, together with the cross-entropy computed using $\mathbf{D}$: \begin{equation} \begin{aligned} \mathcal{L} &=\frac{1}{N}\sum_i^N\bigg\{\lambda_a\cdot\mathlarger{\mathlarger{\mathlarger{\mathlarger{\Big|}}}}\Big|\ \mathbf{z}^T_i-\mathbf{z}^S_i\ \Big|\mathlarger{\mathlarger{\mathlarger{\mathlarger{\Big|}}}}_2-\lambda_b\cdot\mathbf{p}^T(\mathbf{x}_i;\theta_T, \mathbf{D})\cdot\log\mathbf{p}^{S}(\mathbf{x}_i;\theta_S,\mathbf{D})\bigg\} \\&=\sum_i^N\bigg\{-\lambda_a\!\cdot\!\mathbf{z}_i^T\!\cdot\!\mathbf{z}^S_i-\lambda_b\!\cdot\! \sum_j^{K}\frac{\exp(\mathbf{z}_i^T\cdot\mathbf{d}_j/\tau^T)}{\sum_{\mathbf{d}\sim\mathbf{D}}\exp(\mathbf{z}_i^T\cdot\mathbf{d}/\tau^T)}\cdot\log\frac{\exp(\mathbf{z}_i^S\cdot\mathbf{d}_j/\tau^S)}{\sum_{\mathbf{d}\sim\mathbf{D}}\exp(\mathbf{z}_i^S\cdot\mathbf{d}/\tau^S)}\bigg\}, \end{aligned} \label{eq:ssd} \end{equation} Directly optimizing \emph{Eq.}~\ref{eq:ssd} can lead to apparent difficulty in searching optimal hyper-parameters ($\lambda_a, \lambda_b, \tau^T$ and $\tau^S$). Our proposed objective on $\mathbf{D}^+$ indeed is an approximated upper-bound of the above objectiveness however much simplified: \begin{equation} \begin{aligned} \mathcal{L}_{\text{{\small S}EED}} &= \frac{1}{N}\sum_i^N-\mathbf{p}^T(\mathbf{x}_i;\theta_T, \mathbf{D}^+)\cdot\log\mathbf{p}^{S}(\mathbf{x}_i;\theta_S,\mathbf{D}^+) \\&= \sum_i^N\sum_j^{K+1}-\underbrace{\frac{\exp(\mathbf{z}_i^T\cdot\mathbf{d}_j/\tau^T)}{\sum_{\mathbf{d}\sim\mathbf{D}^+}\exp(\mathbf{z}_i^T\cdot\mathbf{d}/\tau^T)}}_{\mathbf{w}^i_j}\cdot\log\frac{\exp(\mathbf{z}_i^S\cdot\mathbf{d}_j/\tau^S)}{\sum_{\mathbf{d}\sim\mathbf{D}^+}\exp(\mathbf{z}_i^S\cdot\mathbf{d}/\tau^S)}, \end{aligned} \label{eq:ssd2} \end{equation} where we let $\mathbf{w}^i_j$ denote the weighting term regulated under $\tau^T$. Since the ($K+1$)th element in $\mathbf{D}^+$ is our supplemented vector $\mathbf{z}^T_i$, the above objective can be expanded into: \begin{equation} \begin{aligned} \mathcal{L}_{\text{{\small S}EED}} =&\frac{1}{N} \sum_i^N\Big\{\mathbf{w}_{K+1}^i\cdot\big(-\mathbf{z}_i^S\cdot\mathbf{z}_i^T/\tau^S+\log\!\!\sum_{\mathbf{d}\sim\mathbf{D}^+}\!\!\exp(\mathbf{z}^S_i\cdot\mathbf{d}/\tau^S)\big) \\&+ \sum_{j=1}^{K}\mathbf{w}^i_j\cdot\big(-\mathbf{z}_i^S\!\cdot\mathbf{d}_j/\tau^S+\log\!\!\sum_{\mathbf{d}\sim\mathbf{D}^+}\!\exp(\mathbf{z}^S_i\!\cdot\mathbf{d}/\tau^S)\big)\Big\} \end{aligned} \end{equation} Note that the LSE term in the first line is strictly non-negative as the range of inner product for $\mathbf{z}^S$ and $\mathbf{d}$ lies between $\big[$-1, +1$\big]$: \begin{equation} \text{LSE}(\mathbf{D}^+, \mathbf{z}^S_i) \geq \log \big(M\!\cdot\!\exp(-1/\tau^S)\big) = \log\big( M\!\cdot\exp(-5)\big)> 0, \end{equation} where $M$ denotes the cardinality of the maintained queue $\mathbf{D}^+$ and is set to 65,536 in our experiment with $\tau^S=0.2$ constantly. Meanwhile, the LSE term in the second line satisfies the following inequality: \begin{equation} \text{LSE}(\mathbf{D}^+, \mathbf{z}^S_i) \geq \text{LSE}(\mathbf{D}, \mathbf{z}^S_i). \end{equation} Thus, this demonstrates that the objective for {\large S}EED as \emph{Eq.}~\ref{eq:ssd2} is equivalent to minimizing a weakened upper-bound of ~\emph{e.q.}~\ref{eq:ssd}: \begin{equation} \begin{aligned} \mathcal{L}_{\text{{\small S}EED}} &=\frac{1}{N} \sum_i^N-\mathbf{p}^T(\mathbf{x}_i;\theta_T, \mathbf{D}^+)\cdot\log\mathbf{p}^{S}(\mathbf{x}_i;\theta_S,\mathbf{D}^+) \\&\geq \frac{1}{N}\sum_i^N\Big\{\mathbf{w}_{K+1}^i\cdot(-\mathbf{z}_i^S\cdot\mathbf{z}_i^T/\tau^S)+ \sum_{j=1}^{K}\mathbf{w}^i_j\cdot\big(-\mathbf{z}_i^S\!\cdot\mathbf{d}_j/\tau^S+\log\!\!\sum_{\mathbf{d}\sim\mathbf{D}}\!\exp(\mathbf{z}^S_i\!\cdot\mathbf{d}/\tau^S)\big)\Big\} \\&=\frac{1}{N}\sum_i^N\bigg\{-\frac{\mathbf{w}^i_{K+1}}{\tau^S}\cdot\mathbf{z}_i^S\cdot\mathbf{z}_i^T- \mathbf{p}^T(\mathbf{x}_i;\theta_T, \mathbf{D})\cdot\log\mathbf{p}^{S}(\mathbf{x}_i;\theta_S,\mathbf{D})\bigg\} \end{aligned} \end{equation} This proves that our $\mathcal{L}_{\text{{\small S}EED}}$ directly relates to a more intuitive distillation formulation as \textit{Eq.}~\ref{eq:ssd} (\textit{l2} + cross entropy loss), and it implicitly contains the objective of aligning and contrasting. However, our training objective is much simplified. During practice, we find by regulating $\tau^T$, both training losses produce equal results. \subsection{Discussion on the Relationship of {\large S}EED with Info-NCE} \label{sup:infonce} The objective of distillation can be considered as a soft version of Info-NCE~\citep{oord2018representation}, with the only difference to be that {\large S}EED learns from the negative samples with probabilities instead of treating them all strictly as negative samples. To be more specific, following Info-NCE, the ``hard'' style contrastive distillation can be expressed as aligning with representations from the Teacher encoder and contrasting with all random instances: \begin{equation} \begin{aligned} \hat{\theta}_{S} &= \argmin_{\theta_{S}}\mathcal{L}_{NCE} =\argmin_{\theta_{S}}\sum_i^N-\log\frac{\exp(\mathbf{z}^T_i\cdot\mathbf{z}^S_i/\tau)}{\sum_{\mathbf{d}\sim\mathbf{D}}\exp(\mathbf{z}^S_i\cdot\mathbf{d}/\tau)} \end{aligned} \end{equation} which can be further deduced with two sub-terms consisting of positive sample alignment and contrasting with negative instances: \begin{equation} \mathcal{L}_{NCE} = \sum^N_i\Big\{\underbrace{-\mathbf{z}^S_i\cdot\mathbf{z}^T_i/\tau}_{alignment}+\underbrace{\log\sum_{\mathbf{d}\sim\mathbf{D}}\exp(\mathbf{z}^S_i\cdot\mathbf{d}/\tau)}_{contrasting}\Big\}. \label{eq:infonce} \end{equation} Similarly, the objective of {\large S}EED can be dissembled into the weighted form of alignment and contrasting terms: \begin{equation} \begin{aligned} \mathcal{L}_{\text{{\small S}EED}} &=\frac{1}{N*M} \sum_i^N\sum_j^{K+1}-\frac{\exp(\mathbf{z}_i^T\cdot\mathbf{d}_j/\tau^T)}{\sum_{\mathbf{d}\sim\mathbf{D}^+}\exp(\mathbf{z}_i^T\cdot\mathbf{d}/\tau^T)}\cdot\log\frac{\exp(\mathbf{z}_i^S\cdot\mathbf{d}_j/\tau^S)}{\sum_{\mathbf{d}\sim\mathbf{D}^+}\exp(\mathbf{z}_i^S\cdot\mathbf{d})/\tau^S} \\&= \frac{1}{N*M}\sum_i^N\sum_j^{K+1}\underbrace{\frac{\exp(\mathbf{z}_i^T\cdot\mathbf{d}_j/\tau^T)}{\sum_{\mathbf{d}\sim\mathbf{D}^+}\exp(\mathbf{z}_i^T\cdot\mathbf{d}/\tau^T)}}_{\mathbf{w}^i_j}\cdot(\underbrace{-\mathbf{z}_i^S\cdot\mathbf{z}_i^T/\tau^S}_{alignment}+\underbrace{\log\sum_{\mathbf{d}\sim\mathbf{D}}\exp(\mathbf{z}^S_i\cdot\mathbf{d}/\tau^{S})}_{contrasting})), \end{aligned} \end{equation} where the normalization term can be considered as soft labels, $\mathbf{W}^i = \left[\mathbf{w}^i_{1} \dots \mathbf{w}^i_{K+1}\right]$, which can weight the above loss as: \begin{equation} \mathcal{L}_{\text{{\small S}EED}} = \frac{1}{N*M} \sum_i^N\sum_j^{K+1}\mathbf{w}^i_j\cdot\Big\{-\mathbf{z}_i^S\cdot\mathbf{z}_i^T/\tau^S+\log\sum_{\mathbf{d}\sim\mathbf{D}}\exp(\mathbf{z}^S_i\cdot\mathbf{d}/\tau^{S}))\Big\}, \end{equation} When tuning hyper-parameter $\tau^T$ towards 0, $\mathbf{W}^i$ can be altered into the format of one-hot vector with $\mathbf{w}^i_{K+1}=1$, which is then degraded to the case of contrastive distillation as in \eqref{eq:infonce}. In practice, the choice of an optimal $\tau^T$ can be dataset-specific. We show that the higher $\tau^T$ (with labels be more `soft') can actually yield better results on other datasets, \emph{e.g.}, CIFAR-10~\citep{krizhevsky2009learning}. \subsection{Compatibility with Supervised Distillation} {\large S}EED conducts self-supervised distillation at the pre-training phase for the representation learning. However, we verify that {\large S}EED is compatible with traditional supervised distillation that happened during fine-tuning phrase at downstream, and can even produce better results. We begin with the \textit{SSL} pre-training on a larger architecture (ResNet-152) using MoCo-V2 and train it for 200 epochs as the teacher network. As images in CIFAR-100 are in the size of 32$\times$32, we modify the first $conv$ layer in ResNet with kernel size = 3 and stride = 1. We then compare the Top-1 accuracy of a smaller ResNet-18 on CIFAR-100 when using different distillation strategies when all parameters are trainable. First, we use {\large S}EED to pre-train ResNet-18 with Res-152 as the teacher model, and then evaluate in on the test split of CIFAR-100 using linear fine-tuning task. As we keep all parameters trainable during the fine-tuning phase, distillation on the pre-training only yields a trivial boost: 75.4\% \textit{v.s.} 75.2\%. Then, we adopt the traditional distillation method, \textit{e.g.},~\citep{hinton2015distilling}, to first fine-tune the ResNet-152 model, and then use its output class probability to facilitate the linear classification task on ResNet-18 in the fine-tuning phrase. This improves the linear classification accuracy on ResNet-18 to 76.0\%. At the end, we initialize the ResNet-18 with our {\large S}EED pre-trained ResNet-18, and equip it with the supervised classification distillation during fine-tuning. With that, we find that the performance of ResNet-18 is further boosted to 78.1\%. We can conclude that our {\large S}EED is compatible with traditional supervised distillation that mostly happened at downstream for specific tasks, \textit{e.g.}, classification, object detection. \begin{table}[h] \centering \medskip \setlength{\tabcolsep}{3.4pt} \caption{\small CIFAR-100 Top-1 \textit{Accuracy}(\%) of ResNet-18 with (or without) distillation at different phase: self-supervised pre-training stage, and supervised classification fine-tuning. All backbone parameters of ResNet-18 are trainable in experiments. } \begin{tabular}{ccc} \toprule {Pre-training Distill.} & Fine-tuning Distill. & Top-1 Acc\\ \midrule \xmark & \xmark & 75.2 \\ \checkmark & \xmark & 75.4\\ \xmark & \checkmark & 76.0 \\ \checkmark & \checkmark & 78.1 \\ \toprule \end{tabular} \vspace{2mm} \label{tbl:supervised_distill} \end{table} \begin{figure}[h] \centering \includegraphics[width=1.\textwidth]{images/ablation_queue.pdf} \caption{ Linear evaluation \textit{accuracy} (\%) of distillation between ResNet-18 (as the Student) and ResNet-50 (as the Teacher) using different size of queue when LR=0.03 and weight decay=1e-6. Note the axis is the log($\cdot$) value of queue lengths.} \label{fig:queue} \end{figure} \begin{table}[t] \begin{minipage}{.46\linewidth} { \centering \medskip \setlength{\tabcolsep}{3.4pt} \caption{Linear evaluation \textit{accuracy} (\%) of distillation between ResNet-18 (as the Student) and ResNet-50 (as the Teacher) using different learning rates when the queue size is 65,536 and weight decay=1e-6.} \begin{tabular}{ccc} \toprule {\textbf{LR}} & {Top-1 Acc.} & {Top-5 Acc.}\\ \midrule 1 & 58.9 & 83.1\\ 0.1 & 62.9 & 85.3 \\ 0.03 & \cellcolor{cellcolor}\textbf{63.3} & \cellcolor{cellcolor}\textbf{85.4} \\ 0.01 & 62.6 & 85.0 \\ \toprule \end{tabular} \vspace{2mm} \label{tbl:lr} } \end{minipage}\hfill \begin{minipage}{.5\linewidth} { \centering \medskip \setlength{\tabcolsep}{3.4pt} \caption{Linear evaluation \textit{accuracy} (\%) of distillation between ResNet-18 (as the Student) and ResNet-50 (as the Teacher) using different weight decays when the queue size is 65,536 and LR=0.03.} \begin{tabular}{ccc} \toprule {\textbf{WD}} & {Top-1 Acc.} & {Top-5 Acc.}\\ \midrule 1e-2 & 11.8 & 27.7\\ 1e-3 & 62.3 & 84.7\\ 1e-4 & 61.9 & 84.4\\ 1e-5 & 61.6 & 84.2\\ 1e-6 & \cellcolor{cellcolor}\textbf{63.3} & \cellcolor{cellcolor}\textbf{85.4} \\ \toprule \end{tabular} \vspace{2mm} \label{tbl:wd} } \end{minipage} \vspace{-2mm} \end{table} \subsection{Additional Ablation Studies} \label{sup:ablation} We study effects of different hyper-parameters to distillation using a ResNet-18 (as Student) and a {\large S}WAV pre-trained ResNet-50 (as Teacher) with small patch views. In specific, we list the Top-1 Acc. on validation split of ImageNet-1k using different lengths of queue ($K$=128, 512, 1,024, 4,096, 8,192, 16,384, 65,536) in Figure.~\ref{fig:queue}. With the increasing of random data samples, the distillation boosts the accuracy of learned representations, however within a limited range: +1.5 when the queue size is 65,536 compared with 256. Furthermore, Table.~\ref{tbl:lr} and~\ref{tbl:wd} summarize the linear evaluation accuracy under different learning rates and weight decays. \section{Experiment} \label{sec:exp} \subsection{Pre-training} \noindent \textbf{Self-Supervised Pre-training of Teacher Network.} \; By default, we use MoCo-V2~\citep{chen2020improved} to pre-train the teacher network. Following~\citep{chen2020simple}, we use ResNet as the network backbone with different depths/widths and append a multi-layer-perceptron (MLP) layer (two linear layers and one \textit{ReLU}~\citep{nair2010rectified} activation layer in between) at the end of the encoder after average pooling. The dimension of the last feature dimension is 128. All teacher networks are pre-trained for 200 epochs due to the computational limitation unless explicitly specified. As our distillation is independent with the teacher pre-training algorithm, we also show results with other self-supervised pre-trained models for teacher network, \textit{e.g.}, {\large S}WAV~\citep{caron2020unsupervised}, SimCLR~\citep{chen2020simple}. \noindent \textbf{Self-Supervised Distillation on Student Network.} \; We choose multiple smaller networks with fewer learnable parameters as the student network: MobileNet-v3-Large~\citep{howard2017mobilenets}, EfficientNet-B0~\citep{tan2019efficientnet}, and smaller ResNet with fewer layers (ResNet-18, 34). Similar to the pre-training for teacher network, we add one additional MLP layer on the basis of the student network. Our distillation is trained with a standard SGD optimizer with momentum 0.9 and a weight decay parameter of 1e-4 for 200 epochs. The initial learning rate is set as 0.03 and updated by a cosine decay scheduler~\citep{nair2010rectified} with 5 warm-up epochs and batch size 256. In \textit{Eq.}~\ref{eq:finalloss}, the teacher temperature is set as $\tau^T=0.01$ and the student temperature is $\tau^S=0.2$. The queue size of $K$ is 65,536. In the following subsections and appendix, we also show results with different hyper-parameter values, \textit{e.g.}, for $\tau^T$ and $K$. \subsection{Fine-tuning and evaluation} In order to validate the effectiveness of self-supervised distillation, we choose to assess the performance of representations of the student encoder on several downstream tasks. We first report its performances of linear evaluation and semi-supervised linear evaluation on the ImageNet ILSVRC-2012~\citep{deng2009imagenet} dataset. To measure the feature transferability brought by distillation, we also conduct evaluations on other tasks, which include object detection and segmentation on the VOC07~\citep{pascal-voc-2007} and MS-COCO~\citep{lin2014microsoft} datasets. At the end, we compare the transferability of the features learned by distillation with ordinary self-supervised contrastive learning on the tasks of linear classification on datasets from different domains. \noindent \textbf{Linear and \textit{K}NN Evaluation on ImageNet.} \; We conduct the supervised linear classification on ImageNet-1K, which contains $\sim$1.3M images for training, and 50,000 images for validation, spanning 1,000 categories. Following previous works in~\citep{he2020momentum,chen2020simple}, we train a single linear layer classifier on top of the frozen network encoder after self-supervised pre-training/distillation. SGD optimizer is used to train the linear classifier for 100 epochs with weight decay to be 0. The initial learning rate is set as 30 and is then reduced by a factor of 10 at 60 and 80 epochs (similar as in ~\cite{tian2019contrastive}). Notably, when training the linear classifier for MobileNet and EfficientNet, we reduce the initial learning rate to 3. The results are reported in terms of Top-1 and Top-5 accuracy. We also perform classification using \textit{K}-Nearest Neighbors (\textit{K}NN) based on the learned 128d vector from the last MLP layer. The sample is classified by taking the most frequent label of its $K$ ($K=10$) nearest neighbors. Table~\ref{tbl:imgnet} shows the results with various teacher networks and student networks. We list the baseline of contrastive self-supervised pre-training using MoCo-V2~\citep{chen2020improved} in the first row for each student architecture. We can see clearly that smaller networks perform rather worse. For example, MobileNet-V3 can only reach 36.3\%. This aligns well with previous conclusions from~\citep{chen2020simple,chen2020big} that bigger models are desired to perform better in contrastive-based self-supervised pre-training. We conjecture that this is mainly caused by the inability of smaller network to discriminate instances in a large-scale dataset. The results also clearly demonstrate that the distillation from a larger network helps boosting the performances of small networks, and show obvious improvement. For instance, with MoCo-V2 pre-trained ResNet-152 (for 400 epochs) as the teacher network, the Top-1 accuracy of MobileNet-V3-Large can be significantly improved from 36.3\% to 61.4\%. Furthermore, we use ResNet-50${\times2}$ (provided in~\cite{caron2020unsupervised}) as the teacher network and adopt the multi-crop trick (see~\ref{sup:eval} for details). The accuracy can be further improved to 68.2\% (last row of Table~\ref{tbl:imgnet}) for MobileNet-V3-Large with 800 epochs of distillation. We note that the gain benefited from distillation becomes more distinct on smaller architectures and we further study the effect of various teacher models in ablations. \input{tables/distill_imgnet} \begin{figure}[t] \centering \includegraphics[width=.95\textwidth]{images/semi.pdf} \caption{\small ImageNet-1k Top-1 \textit{accuracy} for semi-supervised evaluations using 1\% (red line), 10\% (blue line) of the annotations for linear fine-tuning, in comparison with the fully supervised (green line) linear evaluation baseline for SEED. For the points whose Teacher's number of parameters is at 0, we show the semi-supervised linear evaluation results of MoCo-V2 without any distillation. The Student models tend to perform better on the semi-supervised tasks after distillation from larger Teachers. } \label{fig:semi} \vspace{-4mm} \end{figure} \noindent \textbf{Semi-Supervised Evaluation on ImageNet.} \;\; Following~\citep{oord2018representation,kornblith2019better,kolesnikov2019revisiting}, we evaluate the representation on the semi-supervised task, where a fixed 1\% or 10\% subsets of ImageNet training data~\citep{chen2020simple} are provided with the annotations. After the self-supervised learning with and without distillation, we also train a classifier on top of the representation. The results are shown in Figure~\ref{fig:semi}, where the baseline without distillation is depicted when teacher parameters are 0. As we can see, the accuracy is also improved remarkably with {\large S}EED distillation, and a stronger teacher network with more parameters leads to a better performed student network. \noindent \textbf{Transferring to Classification.} To further study whether the improvement of the learned representations by distillation is confined to ImageNet, we evaluate on additional classification datasets to study the generalization and transferability of the feature representation. We follow the linear evaluation and fine-tuning settings as~\citep{kornblith2019better, chen2020simple, grill2020bootstrap}, that a linear layer is trained on the basis of frozen features. We report Top-1 Accuracy of models before and after distillation from various architectures on CIFAR-10, CIFAR-100~\citep{krizhevsky2009learning}, SUN-397~\citep{xiao2010sun} datasets (see Figure~\ref{fig:sun397}). More details regarding pre-processing and training can be found in~\ref{sup:small}. Notably, we observe that our distillation surpasses contrastive self-supervised pre-training consistently on all benchmarks, verifying the effectiveness of {\large S}EED. This also proves the generalization ability of the learned representations from distillation to a wide range of data domain and different classes. \noindent \textbf{Transferring to Detection and Segmentation.} We conduct two downstream tasks here. The first is Faster R-CNN~\citep{ren2015faster} model for object detection trained on VOC-07+12 train+val set and evaluated on VOC-07 test split. The second is Mask R-CNN~\citep{he2017mask} model for the object detection and instance segmentation on COCO 2017 dataset~\citep{lin2014microsoft}. The pre-trained model serves as the initial weight and following~\cite{he2020momentum}, we fine-tune all the layers of the model. More experiment settings can be found in~\ref{sup:detection}. The results are illustrated in Table~\ref{tbl:voc}. As we can see, on VOC, the distilled pre-trained model achieves a large improvement. With ResNet-152 as the teacher network, the Resnet18-based Faster R-CNN model shows +0.7 point improvement on AP, +1.4 improvement on AP$_{50}$ and +1.6 on AP$_{75}$. On COCO, the improvement is relatively minor and the reason could be that COCO training set has $\sim$118k training images while VOC has only $\sim$16.5k training images. A larger training set with more fine-tuning iterations reduces the importance of the initial weights. \input{tables/voc_det} \begin{figure}[t] \centering \includegraphics[width=1.\textwidth]{images/CLS.pdf} \vspace{-6mm} \caption{\small ImageNet-1k \emph{Accuracy} (\%) of student network (EfficientNet-B0 and ResNet-18) transferred to other domains (CIFAR-10, CIFAR-100, SUN-397 datasets) with and without distillation from lager architectures (ResNet-50/101/152). } \label{fig:sun397} \vspace{-3mm} \end{figure} \input{tables/distill_imgnet_wider} \subsection{Ablation Study} We now explore the effects of distillation using different Teacher architectures, Teacher Pre-training algorithms, various distillation strategies and hyper-parameters. \noindent \textbf{Different Teacher Networks.} Figure~\ref{fig:wider} summarizes the accuracy of ResNet-18 and EfficientNet-B0 distilled from wider and deeper ResNet architectures. We see clear performance improvement as depth and width of teacher network increase: compared to ResNet-50, deeper (ResNet-101) and wider (ResNet-50$\times$2) substantially improve the accuracy. However, further architectural enlargement has relatively limited effects, and we suspect the accuracy might be limited by the student network capacity in this case. \noindent \textbf{Different Teacher Pre-training Algorithms.} In Table~\ref{tbl:variants}, we show the Top-1 accuracy of ResNet-18 distilled from ResNet-50 with different pre-training algorithms, \textit{i.e.}, MoCo-V1~\citep{he2020momentum}, MoCo-V2~\citep{chen2020improved}, SimCLR~\citep{chen2020simple}, and {\large S}WAV~\citep{caron2020unsupervised}). Notably, the aforementioned methods all unanimously adopt contrastive-based pre-training except {\large S}WAV, which is based upon online clustering. We find that our {\large S}EED is agnostic to pre-training approaches, making it easy to use any self-supervised models (including clustering-based approach like {\large S}WAV) in self-supervised distillation. In addition, we observe that more training epochs for both teacher \textit{SSL} and distillation epochs can bring beneficial gain. \noindent \textbf{Other Distillation Strategies.} We explore several alternative distillation strategies. \textit{l2-Distance}: where the \textit{l2}-distance of teacher \& student's embeddings are minimized, motivated by~\cite{romero2014fitnets}. \textit{$K$-Means}: we exploit \textit{K}-Means clustering to assign a pseudo-label based on the teacher network's representation. \textit{Online Clustering}: we continuously update the clustering centers during distillation for pseudo-label generation. \textit{Binary Contrastive Loss}: we adopt an Info-NCE alike loss for contrastive distillation~\citep{tian2019contrastive}. We provide details for other strategies in~\ref{sup:loss}. Table~\ref{tbl:loss} shows the results for each method on ResNet-18 (student) distilled from ResNet-50. From the results, the simple \textit{l2}-distance minimizing approach can achieve a decent accuracy, which demonstrates the effectiveness of applying the distillation idea to the self-supervised learning. Beyond that, we study the effect of the original \textit{SSL} (MoCo-V2) supervision as supplementary loss to {\large S}EED and find it does not bring additional benefits to distillation. We find close results from these two strategies (Top-1 linear Acc.), {\large S}EED achieves 57.9\%, while SEED + MoCo-V2 achieves 57.6\%. This implies that the loss of {\large S}EED can to a large extent cover the original \textit{SSL} loss, and it is not necessary to conduct \textit{SSL} any further during distillation. Meanwhile, our proposed SEED outperforms these alternatives with highest accuracy, which shows the superiority of aligning the student towards the teacher and contrasting with the irrelevant samples. \noindent \textbf{Other Hyper-Parameters.} Table~\ref{tbl:negtive} summarizes the distillation performances on multiple datasets using different temperature $\tau^{T}$. We observe a better performance when decreasing $\tau^{T}$ to 0.01 for ImageNet-1k and CIFAR-10 dataset, and to 1e-3 for CIFAR-100 datasets. When $\tau$ is large, the softmax-normalized similarity score of $p_j^T$ between $\mathbf{z}_i^T$ and instance $\mathbf{d}_j$ in the queue $\mathbf{D}^+$ also becomes large, which means the student's feature should be less discriminative with the features of other images to some extent. When $\tau^{T}$ is 0, the teacher model will generate a one-hot vector, which only treats $\mathbf{z}_i^T$ as a positive instance and all others in the queue as negative. Thus, the best $\tau$ is a trade-off depending on the data distribution. We further compare effect of different hyper-parameters in~\ref{sup:ablation}. \input{tables/distill_loss} \section{introduction} \setlength{\epigraphwidth}{.8\columnwidth} \renewcommand{\epigraphflush}{center} \renewcommand{\textflush}{flushepinormal} \begin{wrapfigure}{r}{0.44\textwidth} \vspace{-5mm} \begin{center} \includegraphics[width=.44\textwidth]{images/abstract.pdf} \end{center} \vspace{-3mm} \caption{\small {\large S}EED vs. MoCo-V2~\citep{chen2020improved}) on ImageNet-1K linear probe accuracy. The vertical axis is the top-1 accuracy and the horizontal axis is the number of learnable parameters for different network architectures. Directly applying self-supervised contrastive learning (MoCo-V2) does not work well for smaller architectures, while our method ({\large S}EED) leads to dramatic performance boost. Details of the setting can be found in Section~\ref{sec:exp}. } \vspace{-3mm} \label{fig:intro} \end{wrapfigure} \footnotetext{This work was done while Zhiyuan Fang was an intern at Microsoft.} The burgeoning studies and success on self-supervised learning (\textit{SSL}) for visual representation are mainly marked by its extraordinary potency of learning from unlabeled data at scale. Accompanying with the \textit{SSL} is its phenomenal benefit of obtaining task-agnostic representations while allowing the training to dispense with prohibitively expensive data labeling. Major ramifications of visual \textit{SSL} include pretext tasks~\citep{noroozi2016unsupervised,zhang2016colorful,gidaris2018unsupervised,zhang2019aet,feng2019self}, contrastive representation learning~\citep{wu2018unsupervised, he2020momentum, chen2020simple}, online/offline clustering~\citep{yang2016joint,caron2018deep,li2020prototypical,caron2020unsupervised,grill2020bootstrap}, etc. Among them, several recent works \citep{he2020momentum, chen2020simple, caron2020unsupervised} have achieved comparable or even better accuracy than the supervised pre-training when transferring to downstream tasks, \textit{e.g.} semi-supervised classification, object detection. The aforementioned top-performing \textit{SSL} algorithms all involve large networks (\textit{e.g.}, ResNet-50~\citep{he2016deep} or larger), with, however, little attention on small networks. Empirically, we find that existing techniques like contrastive learning do not work well on small networks. For instance, the linear probe top-1 accuracy on ImageNet using MoCo-V2~\citep{chen2020improved} is only 36.3\% with MobileNet-V3-Large (see Figure~\ref{fig:intro}), which is much lower compared with its supervised training accuracy 75.2\%~\citep{howard2019searching}. For EfficientNet-B0, the accuracy is 42.2\% compared with its supervised training accuracy 77.1\%~\citep{tan2019efficientnet}. We conjecture that this is because smaller models with fewer parameters cannot effectively learn instance level discriminative representation with large amount of data. To address this challenge, we inject knowledge distillation (KD)~\citep{bucilua2006model, hinton2015distilling} into self-supervised learning and propose self-supervised distillation (dubbed as {\large S}EED) as a new learning paradigm. That is, train the larger, and distill to the smaller both in self-supervised manner. Instead of directly conducting self-supervised training on a smaller model, {\large S}EED first trains a large model (as the teacher) in a self-supervised way, and then distills the knowledge to the smaller model (as the student). Note that the conventional distillation is for supervised learning, while the distillation here is in the self-supervised setting without any labeled data. Supervised distillation can be formulated as training a student to mimic the probability mass function over classes predicted by a teacher model. In unsupervised knowledge distillation setting, however, the distribution over classes is not directly attainable. Therefore, we propose a simple yet effective self-supervised distillation method. Similar to~\citep{he2020momentum,wu2018unsupervised}, we maintain a queue of data samples. Given an instance, we first use the teacher network to obtain its similarity scores with all the data samples in the queue as well as the instance itself. Then the student encoder is trained to mimic the similarity score distribution inferred by the teacher over these data samples. The simplicity and flexibility that {\large S}EED brings are self-evident. 1) It does not require any clustering/prototypical computing procedure to retrieve the pseudo-labels or latent classes. 2) The teacher model can be pre-trained with any advanced \textit{SSL} approach, \textit{e.g.}, MoCo-V2~\citep{chen2020improved}, SimCLR~\citep{chen2020simple}, {\large S}WAV~\citep{caron2020unsupervised}. 3) The knowledge can be distilled to any target small networks (either shallower, thinner, or totally different architectures). To demonstrate the effectiveness, we comprehensively evaluate the learned representations on series of downstream tasks, \textit{e.g.}, fully/semi-supervised classification, object detection, and also assess the transferability to other domains. For example, on ImageNet-1k dataset, {\large S}EED improves the linear probe accuracy of EfficientNet-B0 from 42.2\% to 67.6\% (a gain over 25\%), and MobileNet-V3 from 36.3\% to 68.2\% (a gain over 31\%) compared to MoCo-V2 baselines, as shown in Figure~\ref{fig:intro} and Section~\ref{sec:exp}. Our contributions can be summarized as follows: \begin{itemize} \item We are the first to address the problem of self-supervised visual representation learning for small models. \item We propose a self-supervised distillation ({\large S}EED) technique to transfer knowledge from a large model to a small model without any labeled data. \item With the proposed distillation technique ({\large S}EED), we significantly improve the state-of-the-art \textit{SSL} performance on small models. \item We exhaustively compare a variety of distillation strategies to show the validity of {\large S}EED under multiple settings. \end{itemize} \input{relatedwork.tex} \section{Method} \subsection{Preliminary on Knowledge Distillation} Knowledge distillation~\citep{hinton2015distilling,bucilua2006model} is an effective technique to transfer knowledge from a strong teacher network to a target student network. The training task can be generalized as the following formulation: \begin{equation} \hat{\theta}_{S} = \argmin_{\theta_{S}}\sum_{i}^{N} \mathcal{L}_{\text{sup}}(\mathbf{x}_i, \theta_{S}, y_i) + \mathcal{L}_{{\text{distill}}}(\mathbf{x}_i, \theta_{S}, \theta_{T}), \label{eq:supervised_distill} \end{equation} where $\mathbf{x}_i$ is an image, $y_i$ is the corresponding annotation, $\theta_S$ is the parameter set for the student network, and $\theta_{T}$ is the set for the teacher network. The loss $\mathcal{L}_{\text{sup}}$ is the alignment error between the network prediction and the annotation. For example in image classification task~\citep{mishra2017apprentice, shen2020meal,polino2018model,cho2019efficacy}, it is normally a cross entropy loss. For object detection~\citep{liu2019structured, chen2017learning}, it includes bounding box regression as well. The loss of $\mathcal{L}_{\text{distill}}$ is the mimic error of the student network towards a pre-trained teacher network. For example in~\citep{hinton2015distilling}, the teacher signal comes from the softmax prediction of multiple large-scale networks and the loss is measured by the \textit{Kullback–Leibler} divergence. In~\cite{romero2014fitnets}, the task is to align the intermediate feature map values and to minimize the squared $l2$ distance. The effectiveness has been well demonstrated in the supervised setting with labeled data, but remains unknown for the unsupervised setting, which is our focus. \subsection{Self-Supervised Distillation for Visual Representation} Different from supervised distillation, {\large S}EED aims to transfer knowledge from a large model to a small model without requiring labeled data, so that the learned representations in small model can be used for downstream tasks. Inspired by contrastive \textit{SSL}, we formulate a simple approach for the distillation on the basis of instance similarity distribution over a contrastive instance queue. Similar to~\cite{he2020momentum}, we maintain an instance queue for storing data samples' encoding output from the teacher. Given a new sample, we compute its similarity scores with all the samples in the queue using both the teacher and the student models. We require that the similarity score distribution computed by the student matches with that computed by the teacher, which is formulated as minimizing the cross entropy between the student and the teacher's similarity score distributions (as illustrated in Figure~\ref{fig:arch}). \begin{figure}[t] \centering \includegraphics[width=1.\textwidth]{./images/arch.pdf} \caption{\small Illustration of our self-supervised distillation pipeline. The teacher encoder is pre-trained by \textit{SSL} and kept frozen during the distillation. The student encoder is trained by minimizing the cross entropy of probabilities from teacher \& student for an augmented view of an image, computed over a dynamically maintained queue.} \label{fig:arch} \end{figure} Specifically, for a randomly augmented view $\mathbf{x}_i$ of an image, it is first mapped and normalized into feature vector representations $\mathbf{z}_i^T$ = $f^{T}_\theta(\mathbf{x}_i)/||f^{T}_\theta(\mathbf{x}_i)||_2$, and $\mathbf{z}_i^S$ = $f^{S}_\theta(\mathbf{x}_i)/||f^{S}_\theta(\mathbf{x}_i)||_2$, where $\mathbf{z}_i^T, \mathbf{z}_i^S\in\mathbb{R}^{D}$, and $f^{T}_\theta$ and $f^{S}_\theta$ denote the teacher and student encoders, respectively. Let $\mathbf{D}=[\mathbf{d}_1 ... \mathbf{d}_K]$ denote the instance queue where $K$ is the queue length and $\mathbf{d}_j$ is the feature vector obtained from the teacher encoder. Similar to the contrastive learning framework, $\mathbf{D}$ is progressively updated under the ``\textit{first-in first-out}'' strategy as distillation proceeds. That is, we en-queue the visual features of the current batch inferred by the teacher and de-queue the earliest seen samples at the end of iteration. Note that the maintained samples in queue $\mathbf{D}$ are mostly random and irrelevant to the target instance $\mathbf{x}_i$. Minimizing the cross entropy between the similarity score distribution computed by the student and teacher based on $\mathbf{D}$ softly contrasts $\mathbf{x}_i$ with randomly selected samples, without directly aligning with the teacher encoder. To address this problem, we add the teacher's embedding ($\mathbf{z}_i^T$) into the queue and form $\mathbf{D}^+=[\mathbf{d}_1 ... \mathbf{d}_K, \mathbf{d}_{K+1}]$ with $\mathbf{d}_{K+1}=\mathbf{z}_i^T$. Let $\mathbf{p}^T(\mathbf{x}_i;\theta_T;\mathbf{D}^+)$ denote the similarity score between the extracted teacher feature $\textbf{z}_i^T$ and $\mathbf{d}_j$'s ($j=1,...,K+1$) computed by the teacher model. $\mathbf{p}^T(\mathbf{x}_i;\theta_T;\mathbf{D}^+)$ is defined as \begin{equation} \mathbf{p}^{T}(\mathbf{x}_i;\theta_T,\mathbf{D}^+) = \mathlarger{[}\,{p}^{T}_1 \,...\, {p}^{T}_{K+1}\mathlarger{]}\,,\;\;\;\;\;\;\;\; {p}^{T}_j = \frac{\text{exp}(\mathbf{z}_i^{T}\cdot\mathbf{d}_j/\tau^T)}{\sum_{\mathbf{d}\sim \mathbf{D}^+}\text{exp}(\mathbf{z}_i^{T}\cdot\mathbf{d}/\tau^T)}, \end{equation} and $\tau^T$ is a temperature parameter for the teacher. Note, we use $()^T$ to represent the feature from the teacher network and use $(\cdot)$ to represent the inner product between two features. Similarly let $\mathbf{p}^{S}(x_i;\theta_S,\mathbf{D}^+)$ denote the similarity score computed by the student model, which is defined as \begin{equation} \mathbf{p}^{S}(\mathbf{x}_i;\theta_S,\mathbf{D}^+) = \mathlarger{[}\,{p}^{S}_1 \,...\, {p}^{S}_{K+1}\mathlarger{]}\,,\;\;\;\;\;\;\;\;\text{where } {p}^{S}_j = \frac{\text{exp}(\mathbf{z}_i^{S}\cdot\mathbf{d}_j/\tau^S)}{\sum_{\mathbf{d}\sim \mathbf{D}^+}\text{exp}(\mathbf{z}_i^{S}\cdot\mathbf{d}/\tau^S)}, \end{equation} and $\tau^S$ is a temperature parameter for the student. Our self-supervised distillation can be formulated as minimizing the cross entropy between the similarity scores of the teacher, $\mathbf{p}^T(\mathbf{x}_i;\theta_T, \mathbf{D}^+)$, and the student, $\mathbf{p}^{S}(\mathbf{x}_i;\theta_S,\mathbf{D}^+)$, over all the instances $\mathbf{x}_i$, that is, \begin{equation} \begin{aligned} \hat{\theta}_{S} &= \argmin_{\theta_{S}} \sum_i^N-\mathbf{p}^T(\mathbf{x}_i;\theta_T, \mathbf{D}^+)\cdot\log\mathbf{p}^{S}(\mathbf{x}_i;\theta_S,\mathbf{D}^+) \\&=\argmin_{\theta_{S}} \sum_i^N\sum_j^{K+1}-\frac{\exp(\mathbf{z}_i^T\cdot\mathbf{d}_j/\tau^T)}{\sum_{\mathbf{d}\sim\mathbf{D}^+}\exp(\mathbf{z}_i^T\cdot\mathbf{d}/\tau^T)}\cdot\log\frac{\exp(\mathbf{z}_i^S\cdot\mathbf{d}_j/\tau^S)}{\sum_{\mathbf{d}\sim\mathbf{D}^+}\exp(\mathbf{z}_i^S\cdot\mathbf{d}/\tau^S)}. \end{aligned} \label{eq:finalloss} \end{equation} Since the teacher network is pre-trained and frozen, the queued features are consistent during training \textit{w.r.t.} the student network. The higher the value of $p_j^T$ is, the larger weight will be laid on $p_j^S$. Due to the $l2$ normalization, similarity score between $\mathbf{z}_i^T$ and $\mathbf{d}_{K+1}$ remains constant $\mathbb{1}$ before softmax normalization, which is the largest among $p_j^T$. Thus, the weight for $p^S_{K+1}$ is the largest and can be adjusted solely by tuning the value of $\tau^T$. By minimizing the loss, the feature of $\mathbf{z}_i^S$ can be aligned with $\mathbf{z}_i^T$ and meanwhile contrasts with other unrelated image features in $\mathbf{D}$. We further discuss the relation of these two goals with our learning objective in Appendix~\ref{sup:ssd}. \noindent \textbf{Relations with \textit{Info-NCE} loss.} When $\tau^T$ $\rightarrow 0$, the softmax function for $\mathbf{p}^T$ smoothly approaches to a one-hot vector, where $p_{K + 1}^T$ equals 1 and all others 0. In this extreme case, the loss becomes \begin{equation} \begin{aligned} \mathcal{L}_\textit{{{NCE}}} =\sum_i^N-\log\frac{\exp(\mathbf{z}^T_i\cdot\mathbf{z}^S_i/\tau)}{\sum_{\mathbf{d}\sim\mathbf{D}^+}\exp(\mathbf{z}^S_i\cdot\mathbf{d}/\tau)}, \end{aligned} \end{equation} which is similar to the widely-used \textit{Info-NCE} loss~\citep{oord2018representation} in contrastive-based \textit{SSL} (see discussion in Appendix~\ref{sup:infonce}. \input{experiment.tex} \vspace{-2mm} \section{Conclusions} Self-Supervised Learning is acknowledged for its remarkable ability in learning from unlabeled, and large scale data. However, a critical impedance for the \textit{SSL} pre-training on smaller architecture comes from its low capacity of discriminating enormous number of instances. Instead of directly learning from unlabeled data, we proposed {\large S}EED as a novel self-supervised learning paradigm, which learns representation by self-supervised distillation from a bigger \textit{SSL} pre-trained model. We show in extensive experiments that {\large S}EED effectively addresses the weakness of self-supervised learning for small models and achieves state-of-the-art results on various benchmarks of small architectures. \bibliographystyle{iclr2020_conference} \section{Method} \section{Related Work} Among the recent literature in self-supervised learning, contrastive based approaches show prominent results on downstream tasks. Majority of the techniques along this direction are stemming from noise-contrastive estimation~\citep{gutmann2010noise} where the latent distribution is estimated by contrasting with randomly or artificially generated noises. ~\cite{oord2018representation} first proposed Info-NCE to learn image representations by predicting the future using an auto-regressive model for unsupervised learning. Follow-up works include improving the efficiency~\citep{henaff2019data}, and using multi-view as positive samples~\citep{tian2019contrastive1}. As these approaches can only have the access to limited negative instances,~\cite{wu2018unsupervised} designed a memory-bank to store the previously seen random representations as negative samples, and treat each of them as independent categories (instance discrimination). However, this approach also comes with a deficiency that the previously stored vectors are inconsistent with the recently computed representations during the earlier stage of pre-training. ~\cite{chen2020simple} mitigate this issue by sampling negative samples from a large batch. Concurrently,~\cite{he2020momentum} improve the memory-bank based method and propose to use the momentum updated encoder for the remission of representation inconsistency. Other techniques include~\cite{misra2020self} that combines the pretext-invariant objective loss with contrastive learning, and ~\cite{wang2020understanding} that decomposes contrastive loss into alignment and uniformity objectiveness. Knowledge distillation~\citep{hinton2015distilling} aims to transfer knowledge from a cumbersome model to a smaller one without losing too much generalization power, which is also well investigated in model compression~\citep{bucilua2006model}. Instead of mimicking the teacher's output logit, attention transfer~\citep{zagoruyko2016paying} formulates knowledge distillation on attention maps. Similarly, works in ~\citep{ahn2019variational,yim2017gift,koratana2019lit,huang2017like} have utilized different learning objectives including consistency on feature maps, consistency on probability mass function, and maximizing the mutual information. CRD~\citep{tian2019contrastive}, which is derived from CMC~\citep{tian2019contrastive1}, optimizes the student network by a similar objective to~\cite{oord2018representation} using a derived lower bound on mutual information. However, the aforementioned efforts all focus on task-specific distillation (\textit{e.g.}, image classification) during the fine-tuning phase rather than a task-agnostic distillation in the pre-training phase for the representation learning. Several works on natural language pre-training proposed to leverage knowledge distillation for a smaller yet stronger small models. For instances, DistillBert~\citep{sanh2019distilbert}, TinyBert~\citep{jiao2019tinybert}, and MobileBert~\citep{sun2020mobilebert}, have used knowledge distillation for model compression and shown their validity on multiple downstream tasks. Similar works also emphasize the value of smaller and faster models for language representation learning by leveraging knowledge distillation~\citep{turc2019well, sun2019patient}. These works all demonstrate the effectiveness of knowledge distillation for language representation learning in small models, while are not extended to the pre-training for visual representations. Notably, a recent concurrent work CompRess~\citep{abbasi2020compress} also point out the importance to develop better \textit{SSL} method for smaller models. {\large S}EED closely relates to the above techniques but aims to facilitate \textbf{visual representation learning during pre-training phase using distillation technique for small models}, which as far as we know has not yet been investigated.
\section{Introduction} \PARstart{R}{adial} medical imaging methods were first used in X-ray computerized tomography (CT) where data is acquired on radial projections. These projections correspond to radial lines in frequency space, a fact that inspired the first magnetic resonance imaging (MRI) acquisitions to also occur on radial lines\cite{Lauterbur}. These 2D imaging methods are also known as projection-reconstruction (PR) and projection acquisition (PA). Radial imaging also refers to 3D acquisition techniques such as 3D PR, as well as 3D cones \cite{IrarrazabalCones, GurneyCones}. Radial MRI is used for dynamic imaging applications because it is inherently robust to motion \cite{GloverPR} and flow \cite{NishimuraFlow}. It is used in angiography\cite{PetersPRMRA}, with applications such as contrast-enhanced angiography\cite{BargerVIPR, LuMultiechoPR} and time-resolved angiography\cite{VigenPRTRICKS}. Radial MRI readouts can support very short repetition times (TRs) and echo times (TEs). Short TRs are useful for steady-state free precession (SSFP) imaging, particularly if high resolution is required or for quadrature fat/water separation. Both the short TRs and robustness to motion and flow have been taken advantage of in balanced SSFP coronary artery imaging \cite{StehningCoronaryFFE, Stehning3DPRNav}. Short TEs are required for ultra-short echo time (UTE) MRI, which can image collagen-rich tissues such as tendons, ligaments and menisci, as well as calcifications, myelin, periosteum and cortical bone \cite{GateByd, RobsonJCAT}. In addition to 2D acquisitions, 3D radial imaging techniques, such as 3D PR \cite{Rahmer3DUTE} and 3D cones \cite{LarsonT2supp}, have been applied to UTE. 3D PR has also been used for the Vastly undersampled Isotropic Projection Reconstruction (VIPR) imaging method \cite{BargerVIPR} for MR angiography and efficient phase-contrast flow imaging \cite{GuPC-VIPR}. The isotropic resolution of 3D PR is advantageous for multiplanar and 3D reformats. VIPR uses undersampled acquisitions because the number of projections required for fully-sampled 3D PR is prohibitively large. The undersampling is tolerated because of the diffuse aliasing properties of radial trajectories \cite{BargerVIPR}. Another solution to the often prohibitively large number of projections required by 3D PR is to use conical trajectories \cite{IrarrazabalCones, GurneyCones}. These sample in a spiral pattern along cones with various projection angles, allowing for significantly faster volumetric coverage than 3D PR. In 2D and 3D PR trajectories, as well as 3D cones, a critical number of projection lines must be acquired to support a given field-of-view (FOV) -- also referred to as a region-of-support or region-of-interest. The lines are normally acquired with equiangular spacing, resulting in only circular and spherical FOV shapes. Many imaging applications, however, have anisotropic dimensions and would benefit from anisotropic FOVs. In this paper we introduce a new method to simply and easily design radial imaging trajectories for anisotropic FOVs. One previous method applied several varying angular density functions to obtain anisotropic 2D FOVs \cite{SchefflerNUPR, SchefflerRFOV}. Our method also utilizes non-uniform angular spacing, and is able to exactly match the sampling to the desired FOV shape. Design algorithms for 2D and 3D PR, as well as 3D cones are presented. Tailoring the FOV for non-circular objects or regions-of-interest allows for scan time reductions without introducing aliasing artifacts. In undersampled applications, this tailoring will reduce the occurrence of aliasing artifacts. Additionally, our algorithms support anisotropic projection lengths, and, equivalently, resolution. This is useful for reducing gradient slew rate demands in 3D cones, and could also be used for reducing gradient distortion artifacts by favoring the more homogeneous or powerful axes. It can also be used to trade image resolution in certain dimensions for acquisition time. \section{Theory} In radial imaging, the raw data is acquired on radial lines in frequency space, referred to as ``k-space'' in MRI. A discrete number of these lines, also known as projections or spokes, are sampled during data acquisition. Sampling theory tells us that the sample separation determines the FOV. Cartesian samples are generally equally spaced, and the FOV is equal to the inverse of the sample spacing, $\frac{1}{\Delta k}$. In radial imaging, the spacing between adjacent projections in k-space varies radially, and is most sparse at the end of the projections. The sample spacing along the projections must also be considered, although in MRI this usually does not limit the FOV as much as the distance between projections. We will investigate how this projection separation determines the FOV and resolution. Further discussion of radial sampling theory can be found in~\cite{LauzonPolarSampling}. \subsection{FOV vs. PSF} \label{sec:fov_vs_psf} The FOV of a given sampling pattern is characterized by its Fourier transform (\ensuremath{\mathcal{FT}}), known as the point spread function (PSF). Since the sampling pattern is multiplied by the frequency data, the PSF is convolved with the image data. The central lobe of the PSF introduces a blurring, and thus determines the resolution of the resulting image. Aliasing lobes in the PSF are outside this central lobe and determine the FOV of the resulting image. In radial imaging, the distinct shape of the aliasing lobe determines the FOV, but they are not always the same shape. Convexity of the aliasing lobe shape in the PSF will ensure that the FOV shape is exactly the same. Polygons, rectangles, cuboids, ellipsoids, and ovals are some examples of convex shapes useful for medical imaging. While there are concave PSF shapes that will support concave FOVs, such as a ``plus''-sign shape, we will assume convexity since this includes most objects and regions-of-interest in medical imaging. \begin{figure} \begin{center} \includegraphics[width=\columnwidth]{larso01} \caption{ Sampling in 2D radial imaging. (a) Approximation of adjacent projections by parallel sampled lines. (b) Parallel lines PSF illustration. The gray lines show the spatial variation derived in Eq.~\ref{eq:psflines}. Aliasing lobes appear at $\frac{1}{\ensuremath{\Delta k_\phi}}$. With additional projections, the aliasing lobes become much sharper that the cosine shown. (c) Isotropic PR trajectory with constant angular spacing and extent. (d) Isotropic PR PSF illustration. (e) PR trajectory with variable angular spacing and extent. (f) Angularly varying PR PSF illustration. } \label{fig:sampling_approx} \end{center} \end{figure} \subsection{2D Sampling} The FOV of a 2D radial imaging trajectory can be analyzed by decomposition into adjacent spokes. A pair of adjacent spokes can be approximated as two parallel lines, shown in Fig.~\ref{fig:sampling_approx}a and described mathematically as \begin{equation} \label{eq:paralines}P(k_x,k_y) = [ \delta(k_y - \frac{\ensuremath{\Delta k_\phi}}{2}) + \delta(k_y + \frac{\ensuremath{\Delta k_\phi}}{2}) ] \cdot \ensuremath{{\rm rect}}(\frac{k_x}{2\ensuremath{k_{\rm max}}}), \end{equation} where $\ensuremath{\Delta k_\phi}$ is the separation at the end of the projections and $\ensuremath{k_{\rm max}}$ is the length of the projections. The PSF of Eq.~\ref{eq:paralines}, illustrated in Fig.~\ref{fig:sampling_approx}b, is: \begin{equation} \label{eq:psflines}\ensuremath{\mathcal{FT}}\{P(k_x,k_y)\} = C \cos(\pi \ensuremath{\Delta k_\phi} y) \cdot \ensuremath{{\rm sinc}}(2\ensuremath{k_{\rm max}} x), \end{equation} where $C$ includes all scaling factors. The peaks of $| \cos(\pi \ensuremath{\Delta k_\phi} y) |$ will introduce aliasing when convolved with the object, thus limiting the FOV perpendicularly to the direction of the lines to $\frac{1}{\ensuremath{\Delta k_\phi}}$. The actual PSF is much more peaked than a cosine because the sample spacings in $k_y$ from other projections introduce phase variations that cause the aliasing to cancel out along $y$ between $0$ and $\pm\frac{1}{\ensuremath{\Delta k_\phi}}$, as is shown in the ``Results'' section. This is analogous to Cartesian sampling where the PSF of two parallel lines is also a cosine but phase variations from the other sampling lines cause sharp aliasing peaks. The resolution is limited to a minimum of $\frac{1}{2\ensuremath{k_{\rm max}}}$ due the $\ensuremath{{\rm sinc}}(2\ensuremath{k_{\rm max}} x)$ term. If all projections are equally spaced, as shown in Fig.~\ref{fig:sampling_approx}c, the alias-free FOV and resolution, \ensuremath{res}, are: \begin{eqnarray} \ensuremath{FOV} &=& \frac{1}{\ensuremath{\Delta k_\phi}} \approx \frac{1}{\ensuremath{k_{\rm max}}\ensuremath{\Delta \Theta}} = \frac{N}{\pi\ensuremath{k_{\rm max}}}, \\ \ensuremath{res} &=& \frac{1}{2\ensuremath{k_{\rm max}}}, \end{eqnarray} where $\ensuremath{\Delta \Theta}$ is the angular spacing between spokes in radians, $N$ is the number of full projections acquired, and $\ensuremath{k_{\rm max}}$ is the extent of the spokes in k-space (Fig.~\ref{fig:sampling_approx}d). Here we have used the approximation that $\sin(\ensuremath{\Delta \Theta}) \approx \ensuremath{\Delta \Theta}$ for small \ensuremath{\Delta \Theta}. From Fourier theory, rotation of the parallel lines rotates their \ensuremath{\mathcal{FT}}, thus the angular spacing between spokes can be varied to produce anisotropic FOV shapes. Similarly, if $\ensuremath{k_{\rm max}}$ is varied, the resolution size changes angularly. Equation~\ref{eq:psflines} tells us that the sample spacing at angle $\phi$ determines the perpendicular FOV, while $\ensuremath{k_{\rm max}}$ at $\phi$ determines the resolution at $\phi$. This is shown in Fig.~\ref{fig:sampling_approx}e and f, and is formally expressed as, \begin{eqnarray} \label{eq:vFOV} \ensuremath{FOV}(\phi+\ensuremath{\frac{\pi}{2}})& =& \frac{1}{\ensuremath{\Delta k_\phi}(\phi)} \approx \frac{1}{\ensuremath{k_{\rm max}}(\phi)\ensuremath{\Delta \Theta}(\phi)}, \\ \label{eq:vres} \ensuremath{res}(\phi)& =& \frac{1}{2\ensuremath{k_{\rm max}}(\phi)}. \end{eqnarray} Discrete sampling along the parallel lines results in repetition of the \ensuremath{\mathcal{FT}}~pattern (Eq.~\ref{eq:psflines}) in this sampling direction ($x$ in Eq.~\ref{eq:psflines} and Fig.~\ref{fig:sampling_approx}a). Radial sample spacing of \ensuremath{\Delta k_r}~results in repetitions at $\frac{1}{\ensuremath{\Delta k_r}}$. These aliasing lobes are often eliminated in MRI because of low-pass filters applied during the readout. These filters will, however, limit the FOV in the projection direction to $\frac{1}{\ensuremath{\Delta k_r}}$ because they are matched to the sample spacing. Therefore, the maximum radial sampling spacing must be \begin{equation} \label{eq:maxspace} \ensuremath{\Delta k_r} \le \frac{1}{\max(\ensuremath{FOV}(\phi))} \end{equation} to ensure there is no aliasing or FOV restrictions due to the sampling along the projections. \subsection{3D Sampling} Radial sampling in 3D can be analyzed with the same principles as in 2D. Again, approximating adjacent spokes as a set of parallel lines, we now have: \begin{eqnarray} P(k_x,k_y,k_z) & = & [ \delta(k_y - \frac{\ensuremath{\Delta k_\phi}}{2}) + \delta(k_y + \frac{\ensuremath{\Delta k_\phi}}{2}) ] \cdot \nonumber \\ \label{eq:paralines3} & & \ensuremath{{\rm rect}}(\frac{k_x}{2\ensuremath{k_{\rm max}}}) \cdot \delta(k_z). \end{eqnarray} The PSF is then the same as Eq.~\ref{eq:psflines}: \begin{equation} \label{eq:psflines3}\ensuremath{\mathcal{FT}}\{P(k_x,k_y,k_z)\} = K \cos(\pi \ensuremath{\Delta k_\phi} y) \cdot \ensuremath{{\rm sinc}}(2\ensuremath{k_{\rm max}} x). \end{equation} This aliasing pattern is the same as illustrated in Fig.~\ref{fig:sampling_approx}b, but with an infinite extent in $z$. \begin{figure} \begin{center} \includegraphics[width=\columnwidth]{larso02} \caption{ Sampling in 3D radial imaging. (a) Approximation of adjacent cones by rotated parallel lines. (b) PSF illustration of adjacent cones model, which is the parallel lines PSF (Fig.~\ref{fig:sampling_approx}b) rotated around the $z$-axis. (c) Adjacent projections on two different cones. (d) PSF illustrations for the adjacent projections. The top illustration shows the intersection of the PSF with the $x$-$y$ plane, which is approximately identical for the projections on both cones. The bottom illustration shows the planes which contain the aliasing lobes. These planes are perpendicular to the $y'$ axis at $y' = \pm 1/\ensuremath{\Delta k_\phi}$, and the lobes extend and different angles depending on the cone angle. } \label{fig:3Dsampling_approx} \end{center} \end{figure} A set of adjacent cones can be modeled by rotating a pair of parallel lines about the $k_z$-axis, as shown in Fig.~\ref{fig:3Dsampling_approx}a, which rotates the PSF of these parallel lines about the $z$-axis. The resulting PSF pattern is circularly symmetric about the $z$-axis and with polar deflection of the aliasing lobe of $\theta + \ensuremath{\frac{\pi}{2}}$ for a cone deflection of $\theta$, shown in Fig.~\ref{fig:3Dsampling_approx}b. We are using the spherical coordinate notation where $\theta$, the polar angle, is the deflection from the positive $z$-axis and $\phi$, the azimuthal angle, is the rotation from the positive $x$-axis. Adjacent projections on a cone produce aliasing patterns that are rotations of the PSF in Eq.~\ref{eq:psflines3}, as illustrated in Fig.~\ref{fig:3Dsampling_approx}c and d. The aliasing lobes are the nearest to the origin in the $x$-$y$ plane at an azimuthal angle $\phi+\ensuremath{\frac{\pi}{2}}$ and at a distance of $1/\ensuremath{\Delta k_\phi}$ They extend in a direction that is determined by the cone deflection angle, as shown in Fig.~\ref{fig:3Dsampling_approx}d. Combining these results, we find that the sampling along a cone limits the FOV azimuthally in the $x$-$y$ plane while the sampling of different cones limits the FOV in the polar direction. Mathematically, \begin{eqnarray} \label{eq:FOVtheta} \ensuremath{FOV}_\theta(\theta + \ensuremath{\frac{\pi}{2}},\phi)& =& \frac{1}{\ensuremath{\Delta k_\theta}(\theta)} \\ \label{eq:FOVphi} \ensuremath{FOV}_\phi(\theta = \ensuremath{\frac{\pi}{2}}, \phi + \ensuremath{\frac{\pi}{2}})& =& \frac{1}{\ensuremath{\Delta k_\phi}(\phi)} \\ \label{eq:res3D} \ensuremath{res}(\theta, \phi)& =& \frac{1}{2\ensuremath{k_{\rm max}}(\theta,\phi)}, \end{eqnarray} where the variables are all illustrated in Fig.~\ref{fig:3Dsampling_approx}. The resolution is determined by the projection extents. The samples along the projection must again satisfy Eq.~\ref{eq:maxspace}. \section{Methods} \subsection{2D Projection-Reconstruction} Two-dimensional radial imaging trajectories can be defined by the projection angles, projection lengths, and the sampling pattern along the projections. Our algorithm designs a set of projection angles, $\Theta[n]$, and projection lengths, $\ensuremath{K_{\rm max}}[n]$, for a desired FOV pattern. The sampling pattern along the projections is not designed, and should be chosen to meet the condition in Eq.~\ref{eq:maxspace}. \begin{figure} \begin{center} \framebox{ \begin{minipage}[t]{.95\columnwidth} \newcounter{Lcount} \begin{list}{\arabic{Lcount}.}{\usecounter{Lcount} \setlength{\leftmargin}{5pt} } \item Initialize $\Theta[1] = \phi_0$ and $n = 1$ \item \label{2Dalg:calc} Calculate: \begin{gather*} \ensuremath{\Delta \Theta_\est} = \frac{\textstyle 1}{\textstyle \ensuremath{k_{\rm max}}(\Theta[n]) \ensuremath{FOV}(\Theta[n] + \ensuremath{\frac{\pi}{2}})} \\ \ensuremath{\Delta \Theta} = \frac{\textstyle 1}{\textstyle \ensuremath{k_{\rm max}}(\Theta[n] + \frac{\ensuremath{\Delta \Theta_\est}}{2}) \ensuremath{FOV}(\Theta[n] +\frac{\ensuremath{\Delta \Theta_\est}}{2} + \ensuremath{\frac{\pi}{2}})} \\ \Theta[n+1] = \Theta[n] + \ensuremath{\Delta \Theta} \end{gather*} and increment $n$ \item Repeat previous step until $\Theta[n] > \phi_0 + \ensuremath{\phi_{\rm width}}$ \item \label{2Dalg:choose} Choose a scaling factor, $S$, and the number of projections returned, $N$, as follows: \\ If $\Theta[n] - (\phi_0 + \ensuremath{\phi_{\rm width}}) < (\phi_0 + \ensuremath{\phi_{\rm width}}) - \Theta[n-1] $ \\ \hspace*{15pt}choose $S = \frac{\textstyle \ensuremath{\phi_{\rm width}}}{\textstyle \Theta[n]-\phi_0}$ and $N = n-1 $ \\ Else \\ \hspace*{15pt}$S = \frac{\textstyle \ensuremath{\phi_{\rm width}}}{\textstyle \Theta[n-1]-\phi_0}$ and $N = n-2 $ \\ \item \label{2Dalg:scale} Scale the set of angles \\ $\Theta[1, \ldots, N] = S \cdot (\Theta[1, \ldots, N] - \phi_0) + \phi_0$ \item \label{2Dalg:kmax} Calculate $\ensuremath{K_{\rm max}}[n] = \ensuremath{k_{\rm max}}(\Theta[n])$ \end{list} \end{minipage} } \end{center} \caption{Generalized 2D anisotropic FOV radial imaging algorithm} \label{fig:2Dalg} \end{figure} The algorithm is shown in Fig.~\ref{fig:2Dalg}. The desired FOV must be specified as a function of angle, $\ensuremath{FOV}(\phi)$, and must be $\pi$-periodic ($\ensuremath{FOV}(\phi) = \ensuremath{FOV}(\phi + \pi)$). The desired projection lengths can be specified as $\ensuremath{k_{\rm max}}(\phi)$, and also must be $\pi$-periodic. An initial angle of $\phi_0$ may be specified, although the default of $\phi_0 = 0$ is appropriate for most applications. The angular width of the resulting angles, \ensuremath{\phi_{\rm width}}, may also be specified, and will be $\pi$ for most applications, including full-projection PR. One application of varying this width is half-projection PR, where $\ensuremath{\phi_{\rm width}} = 2\pi$ could be used. These parameters are also useful for designing 3D PR trajectories - see Section~\ref{sec:3DPR}. After initialization, the relationship derived in Eq.~\ref{eq:vFOV} is used to sequentially calculate a set of projection angles in step~\ref{2Dalg:calc} of the algorithm. The projection separation is first estimated, \ensuremath{\Delta \Theta_\est}, and then the actual projection separation is then calculated using the angle $\Theta[n] + \frac{\ensuremath{\Delta \Theta_\est}}{2}$. Without this estimation, the resulting FOV will be very slightly rotated and distorted because the projection separation is centered between $\Theta[n]$ and $\Theta[n+1]$. Since $\Theta[n+1]$ is unknown, $\Theta[n] + \frac{\ensuremath{\Delta \Theta_\est}}{2}$ provides a good estimate of the middle angle, especially compared to using $\Theta[n]$. Additional iterations for increased accuracy are possible but provide little additional benefit. The sequential nature of the algorithm and the required periodicity of the projection angles results in an undesired angle spacing at the end of the design. Steps~\ref{2Dalg:choose} and~\ref{2Dalg:scale} correct for this by scaling the set of projection angles to the chosen \ensuremath{\phi_{\rm width}}. The scaling slightly distorts the resulting FOV shape so the scaling factor, $S$, is chosen by step~\ref{2Dalg:choose} to be as close to 1 as possible This step could also be modified to require that the number of projections be even, odd, or a scalar multiple for acquisition strategies such as multi-echo PR~\cite{LuMultiechoPR} The computation cost of this algorithm is small since it involves simple calculations and requires no iterations or large matrix operations. \subsection{3D Cones} The 2D design algorithm can directly be applied to designing 3D cones imaging trajectories. The 3D FOV shapes that are achievable are circularly symmetric about one axis, which we define to be the $z$-axis, corresponding to cones wrapping around the $k_z$-axis as shown in Fig.~\ref{fig:3Dsampling_approx}a and b. These shapes can be described by $\ensuremath{FOV}(\theta, \phi) = \ensuremath{\FOV_\theta}(\theta)$, as is illustrated in Fig.~\ref{fig:3DPR_design}a and b. For example, a rectangular-shaped $\ensuremath{\FOV_\theta}(\theta)$ will yield a cylindrical FOV, while an elliptical $\ensuremath{FOV}(\theta)$ yields an ellipsoid. For anisotropic 3D cones design, the 2D PR algorithm is used with inputs of $\ensuremath{FOV}(\theta)$ and $\ensuremath{k_{\rm max}}(\theta)$ (optional), $\ensuremath{\phi_{\rm width}} = \pi$, and $\phi_0 = \frac{1}{2\ensuremath{k_{\rm max}}(0)\ensuremath{FOV}(\ensuremath{\frac{\pi}{2}})}$. This $\phi_0$ ensures that no cones are just a single projection. The resulting set of projection angles and extents describe the set of cones to be used, where the angles, $\Theta[n]$, represent the deflection from the $k_z$-axis. Sampling within each cone and generation of appropriate gradient waveforms are described in~\cite{GurneyCones}. \begin{figure}[b!] \begin{center} \includegraphics[width=\columnwidth]{larso04} \caption{ 3D radial trajectory design (cones-based). (a) Cones designed with 2D algorithm. (b) Sampling of cones introduces $\ensuremath{\FOV_\theta}$, which is circularly symmetric about the $z$-axis. (c) Projections on each cone designed with 2D algorithm using a random starting angle $\phi_0$. (d) Sampling along cones introduces $\ensuremath{\FOV_\phi}$, which is approximately independent of $z$. (e) 3D PR trajectory resulting from sampling in (a) and (c). (f) The 3D PR FOV is the minimum of $\ensuremath{\FOV_\theta}$ (b) and $\ensuremath{\FOV_\phi}$ (d). } \label{fig:3DPR_design} \end{center} \end{figure} \subsection{3D Projection-Reconstruction} \label{sec:3DPR} We have created two methods for designing 3D PR trajectories with anisotropic FOVs. One samples a set of cones, the ``cones-based'' method, while the other designs and samples a spiraling path, the ``spiral-based'' method. Figure~\ref{fig:cones_vs_spiral} shows two resulting sampling patterns for both the cones-based and spiral-based design methods. \begin{figure}[b] \begin{center} \includegraphics[width=.9\columnwidth]{larso05} \caption{ 3D PR trajectories. (a) Cones-based design, and (b) Spiral-based design for uniform sampling, resulting in a spherical FOV. (c) Cones-based design, and (d) Spiral-based design of an ellipsoid FOV with, non-uniform sampling in both the azimuthal and polar directions. } \label{fig:cones_vs_spiral} \end{center} \end{figure} \subsubsection{Cones-based Design} This method designs 3D projections for an anisotropic FOV by first designing a set of cones and then appropriately sampling on each cone. Isotropic sampling in these two dimensions will result in a spherical FOV, with the number of projections per cone proportional to $\sin(\theta)$~\cite{GloverBoron}, where $\theta$ is the polar angle of the cone. Equations~\ref{eq:FOVtheta} and~\ref{eq:FOVphi}, illustrated in Fig.~\ref{fig:3Dsampling_approx}, tell us that the cones sampled will define a limiting FOV that is circularly symmetric about the $z$-axis, $\ensuremath{\FOV_\theta}(\theta,\phi) = \ensuremath{\FOV_\theta}(\theta)$, while the samples on each cone define a maximum FOV that is approximately invariant in $z$, $\ensuremath{\FOV_\phi}(\theta, \phi) \approx \ensuremath{\FOV_\phi}(x,y)$ (Fig.~\ref{fig:3DPR_design}a-d). We will describe $\ensuremath{\FOV_\phi}$ using the deflection angle in cylindrical coordinates, $\phi_c$, resulting in the simple notation $\ensuremath{\FOV_\phi}(x,y) = \ensuremath{\FOV_\phi}(\phi_c)$. Both sampling patterns limit the FOV, resulting in \begin{equation} \label{eq:3DFOV} \ensuremath{FOV} = \min ( \ensuremath{\FOV_\theta}(\theta), \ensuremath{\FOV_\phi}(\phi_c) ), \end{equation} as illustrated in Fig.~\ref{fig:3DPR_design}e and f. This method takes inputs of $\ensuremath{\FOV_\theta}$ and $\ensuremath{\FOV_\phi}$, with \begin{equation} \label{eq:FOVp}\ensuremath{\FOV_\phi}(\phi_c) \le \ensuremath{\FOV_\theta}(\ensuremath{\frac{\pi}{2}}) \end{equation} to ensure that the cone spacing does not introduce aliasing inside $\ensuremath{\FOV_\phi}$ in the $x$-$y$ plane. $\ensuremath{k_{{\rm max},\theta}}(\theta)$ can also be used. Varying $\ensuremath{k_{{\rm max},\phi}}$ has not been incorporated into our algorithm because it causes the polar angle spacing to vary azimuthally, resulting in distortion of the supported FOV. The cones are designed using the 2D PR algorithm with $\ensuremath{\FOV_\theta}(\theta)$, $\ensuremath{k_{{\rm max},\theta}}(\theta)$, $\theta_0 = 0$, and $\ensuremath{\theta_{\rm width}} = \ensuremath{\frac{\pi}{2}}$. The resulting $\Theta[n]$ and $\ensuremath{K_{\rm max}}[n]$, where $n = 1, \ldots, N_{cones}$, are then sampled, also using the 2D PR design algorithm. The spokes covering each cone are designed with $\ensuremath{\FOV_\phi}(\phi_c)$ and $\ensuremath{\phi_{\rm width}} = 2\pi$. For cone $n$, $\ensuremath{k_{{\rm max},\phi}} = \ensuremath{K_{\rm max}}[n] \cdot \sin(\Theta[n])$ to adjust for the circumference of the cone. The initial angle $\phi_0$ on each cone is chosen at random uniformly in the interval $[0, \frac{1}{\ensuremath{K_{\rm max}}[n] \cdot \sin(\Theta[n]) \cdot \ensuremath{FOV}_\phi(\ensuremath{\frac{\pi}{2}})}]$. This randomization reduces coherent aliasing artifacts that are introduced when $\phi_0=0$ for each cone (see Fig.~\ref{fig:coherent_aliasing}). Note that the first cone ($n=1$) is just a single projection along the $k_z$-axis. The result is a set of $\Phi[m_n]$ for $m_n = 1, \ldots, M_n$ and $n = 1, \ldots, N_{cones}$, where $M_n$ is the number of projections within cone $n$. To complete the full-projection design, an additional cone is added in the $k_x$-$k_y$ plane ($\theta = \ensuremath{\frac{\pi}{2}}$) that is only azimuthally sampled along half of the circumference. The 2D PR design algorithm is used, with $\ensuremath{\FOV_\phi}(\phi_c)$, $\ensuremath{k_{{\rm max},\phi}} = \ensuremath{k_{{\rm max},\theta}}(\ensuremath{\frac{\pi}{2}})$, a randomized $\phi_0$, and $\ensuremath{\phi_{\rm width}} = \pi$. For half-projection designs, the additional half-sampled cone is not needed and $\ensuremath{\theta_{\rm width}} = \pi$ is used for the cone design. \subsubsection{Spiral-based Design} This method of 3D PR design is inspired by a method that isotropically samples the unit sphere on a spiral path \cite{WongRoos}. The design is similar to the cones-based method, taking the same inputs of $\ensuremath{\FOV_\theta}$ and $\ensuremath{\FOV_\phi}$, with $\ensuremath{\FOV_\theta}(\ensuremath{\frac{\pi}{2}}) = {\rm max}(\ensuremath{\FOV_\phi}(\phi_c))$, and, optionally, $\ensuremath{k_{{\rm max},\theta}}$. This method is best suited for half-projections, and an extension to full-projection design is described in Appendix~\ref{app:spiral_full}. It also results in a more diffuse aliasing pattern (see Fig.~\ref{fig:coherent_aliasing}). First, a set of polar sampling angles is designed with the 2D PR algorithm exactly as in the cones-based method for half-projections, with $\ensuremath{\FOV_\theta}$, $\ensuremath{k_{{\rm max},\theta}}$, $\theta_0 = 0$, and $\ensuremath{\theta_{\rm width}} = \pi$, yielding $\ensuremath{\hat{\Theta}}[n]$ and $\ensuremath{\hat{K}_{\rm max}}[n]$ for $n = 1, \ldots, N_{polar}$. To create a continuous sample sample path in the longitudinal direction, these sets are linearly interpolated to final samples of $\ensuremath{\hat{\Theta}}[N_{polar}+1] = \pi$ and $\ensuremath{\hat{K}_{\rm max}}[N_{polar}+1] = \ensuremath{k_{{\rm max},\theta}}(\pi)$. The interpolation uses the number of projections required, which is found by estimation using the required number of azimuthal samples on a cone at $\theta=\ensuremath{\frac{\pi}{2}}$, $N_{\phi,{\rm est}}$, as well as $\ensuremath{\hat{\Theta}}[n]$ and $\ensuremath{\hat{K}_{\rm max}}[n]$. The 2D PR algorithm with $\ensuremath{\FOV_\phi}$, $\ensuremath{k_{{\rm max},\phi}} = \ensuremath{k_{{\rm max},\theta}}(\ensuremath{\frac{\pi}{2}})$, $\phi_0 = 0$, and $\ensuremath{\phi_{\rm width}} = 2\pi$ is used to compute $N_{\phi,{\rm est}}$. The number of projections between $\ensuremath{\hat{\Theta}}[n]$ and $\ensuremath{\hat{\Theta}}[n+1]$ will be approximately \begin{eqnarray} N_{n,{\rm est}} &=& N_{\phi,{\rm est}} \sin(\frac{\ensuremath{\hat{\Theta}}[n] +\ensuremath{\hat{\Theta}}[n+1]}{2}) \nonumber \\ & & \times \frac{\ensuremath{\hat{K}_{\rm max}}[n] +\ensuremath{\hat{K}_{\rm max}}[n+1]}{2\ensuremath{k_{{\rm max},\phi}}}. \end{eqnarray} The total number of projections is chosen to be \begin{equation} N = \sum_{n=1}^{N_{polar}} N_{n,{\rm est}}. \end{equation} The linear interpolation is done such that there are $N_{n,{\rm est}}$ projections between $\ensuremath{\hat{\Theta}}[n]$ and $\ensuremath{\hat{\Theta}}[n+1]$. This is done by using a parametrization, $\theta(t)$, where $\theta(t_n) = \ensuremath{\hat{\Theta}}[n]$, $t_{n+1} - t_n = N_{n,{\rm est}}$, and $t_1 = 1$. The polar projection angles are computed by sampling the linear interpolation of this parametrization as $\Theta[m] = \theta(m)$ for $m = 1, \ldots, N$. If variable extents are used, the interpolation of $k(t)$, where $k(t_n) = \ensuremath{\hat{K}_{\rm max}}[n]$, is sampled as $\ensuremath{K_{\rm max}}[m] = k(m)$. The azimuthal sampling, $\Phi[m]$, is then computed similarly to step~\ref{2Dalg:calc} in Fig.~\ref{fig:2Dalg}, with an additional scaling factor also used in the cones-based design to compensate the cone circumference: \begin{gather} \ensuremath{\Delta \Phi_\est} = \frac{1}{\ensuremath{K_{\rm max}}[m]\sin(\Theta[m]) \ensuremath{\FOV_\phi}(\Phi[m] + \ensuremath{\frac{\pi}{2}})} \\ \Delta \Phi = \frac{1}{\ensuremath{K_{\rm max}}[m]\sin(\Theta[m]) \ensuremath{\FOV_\phi}(\Phi[m] + \frac{\ensuremath{\Delta \Phi_\est}}{2} + \ensuremath{\frac{\pi}{2}}) } \\ \Phi[m+1] = \Phi[m] + \Delta \Phi, \end{gather} with the initial angle of $\Phi[1] = 0$. This results in a set of projection angles, $\Phi[m]$, $\Theta[m]$, and extents, $\ensuremath{K_{\rm max}}[m]$ yielding the anisotropic FOV described in Eq.~\ref{eq:3DFOV}. \subsection{Reconstruction} All images were reconstructed with the gridding algorithm \cite{BeattyGridding}, and PSFs were calculated by gridding data of all ones. Each data point is multiplied by a density compensation factor (dcf) to correct for the unequal sample spacing, which results in coloring of the noise and an intrinsic loss in the signal-to-noise ratio (SNR) efficiency~\cite{TsaiVdens}. The dcf can be separated into a radial and angular components, where the angular component accounts for the anisotropic projection spacing. The angular dcf is chosen so that the same radial dcf can be used on each projection, provided they all have an equal number of identically distributed radial samples. When the samples are equally spaced this radial component is linear for 2D PR and quadratic for 3D PR. The 2D angular dcf (\ensuremath{\dcf_\theta}) is proportional to the projection separation, \ensuremath{\Delta k_\phi}, given from Eq.~\ref{eq:vFOV}. For a separable dcf, $\ensuremath{\dcf_\theta}$ must also be proportional to the projection length because the scaling of the radial sample spacing by $\ensuremath{k_{\rm max}}$ cannot be described in a single radial dcf. The resulting 2D PR angular dcf is \begin{equation} \label{eq:2d_dcf} \ensuremath{\dcf_\theta}(\Theta[n]) = \ensuremath{K_{\rm max}}[n] \cdot \ensuremath{\Delta k_\phi} = \frac{\ensuremath{K_{\rm max}}[n]}{\ensuremath{FOV}(\Theta[n] + \ensuremath{\frac{\pi}{2}})}. \end{equation} For anisotropic 3D cones, this compensation factor is applied to each cone by dividing Eq. 10 in reference~\cite{GurneyCones} by \ensuremath{\dcf_\theta}. In 3D PR, the density compensation for a given projection is found by multiplying the compensation factors for the polar and azimuthal sampling: \begin{multline} \label{eq:3d_dcf} \ensuremath{D}_{3D}(\Theta[n],\Phi[m_n]) = \ensuremath{\dcf_\theta}(\Theta[n])\times \ensuremath{\dcf_\phi}(\Phi[m_n]) \\ = \frac{\ensuremath{K_{\rm max}}[n]}{\ensuremath{\FOV_\theta}(\Theta[n] + \ensuremath{\frac{\pi}{2}}) \times \ensuremath{\FOV_\phi}(\Phi[m_n] + \ensuremath{\frac{\pi}{2}})}. \end{multline} For the full-projection spiral-based design, this dcf is slightly modified as described in Appendix~\ref{app:spiral_full}. \subsection{Design Functions} The anisotropic FOVs were designed in Matlab 7.0 (The Mathworks, Natick, MA, USA). The design functions for 2D PR, 3D cones, and both 3D PR methods, along with accompanying documentation are available for general use at \url{http://www-mrsrl.stanford.edu/~peder/radial_fovs}. \begin{figure}[b!] \begin{center} \includegraphics[width=\columnwidth]{larso06} \caption{ Projection sampling patterns (left column) and PSFs (middle column), with plots along $x$ (black, dashed line) and $y$ (gray line) axes in the right column. FOV shapes: (a) Circle, (b) Ellipse, (c) Rectangle, (d) Oval, and (e) Diamond. The inset PSF images are windowed narrowly to show the low-level aliasing (arrows) within the desired FOV (dashed lines). The plots show the aliasing peaks and the isotropic resolution in the central lobes. Small FOVs are used for visualization of the variable angular density. } \label{fig:2Dpsfs} \end{center} \end{figure} \subsection{MRI Experiments} A GE Excite 1.5T scanner with gradients capable of 40 mT/m amplitude and 150 T/m/s slew rate (GE Healthcare, Milwaukee, WI) was used for all experiments. The 2D PR images were acquired with a UTE sequence using half-projection acquisitions, 5 mm slice thickness, TE = 500 $\mu$s, TR = 100 ms, 30$^\circ$ flip angle, 512 samples per projection, and 1 mm resolution with a transmit/receive extremity coil. The 3D PR images were acquired with a spoiled gradient-recalled echo (SPGR) sequence using full-projection acquisitions with TE = 3 ms and TR = 10 ms. The bottle phantom images used a 15$^\circ$ flip angle, 256 samples per projection, and 1 mm isotropic resolution with a transmit/receive head coil. The in vivo images used a 30$^\circ$ flip angle, 3 cm slab-selective RF excitation, 192 samples per projection, a body coil, and were acquired in a single 25 second breath-hold. Both fully-sampled and undersampled cylindrical FOVs with 3 and 2 mm isotropic resolution, respectively, are compared to isotropic FOVs requiring the same number of projections. \section{Results} \subsection{2D PSFs} Figure~\ref{fig:2Dpsfs} shows some sampling patterns designed with the 2D anisotropic FOV algorithm and their corresponding PSFs, showing that the desired FOV shapes are achieved. They have isotropic resolution, as shown in the PSF central lobes. There is some low-level aliasing introduced inside the desired FOV for the anisotropic shapes, shown in the inset PSF images. See Section~\ref{sec:discussion} for a full discussion. \begin{figure}[b!] \begin{center} \includegraphics[width=\columnwidth]{larso07} \caption{ Number of projections for elliptical and rectangular FOV shapes versus the resulting FOV (shape) area. All the FOVs have 1 pixel isotropic resolution. There is no loss in efficiency by using anisotropic shapes, and in fact they are slightly more efficient than the isotropic case. This increase in efficiency comes at the cost of low-level aliasing within the FOV, seen in Fig.~\ref{fig:2Dpsfs}. } \label{fig:area} \end{center} \end{figure} Figure~\ref{fig:area} shows the relationship between the number of projections and the FOV area for elliptical and rectangular FOV shapes. The relationship is quadratic for a circular FOV, and the other shapes are also approximately quadratic. The anisotropic shapes are slightly more efficient, with efficiency increasing as the shapes become narrower. This is due to the low-level aliasing seen in Fig.~\ref{fig:2Dpsfs}, which is larger for narrower shapes (see Section~\ref{sec:discussion}). \begin{figure}[h!] \begin{center} \includegraphics[width=\columnwidth]{larso08} \caption{ Variable $\ensuremath{k_{\rm max}}$ sampling patterns (left column) and PSFs (middle column, plots in right column), with enlarged views of the central lobe inset. The black, dashed line plot is along the $x$-axis, and the gray line is along the $y$-axis in (b), (c), and (e), and along $x=y$ in (a) and (d). FOV/\ensuremath{k_{\rm max}} { }shapes: (a) Circle/Star, (b) Ellipse/Ellipse, (c) Rectangle/Rectangle, (d) Diamond/Diamond, and (e) Oval/Ellipse. All the combinations have a minimum resolution size of 1 pixel, with maximum resolutions 2 pixels in (a), (b), and (e), 1.72 pixels in (c), and 1.33 pixels in (d). The shape combinations in (b), (c), and (d) have no low-level aliasing inside the FOV shape, unlike (a) and (e), and the isotropic resolution projections in Fig.~\ref{fig:2Dpsfs}. Small FOVs are used for visibility of the variable angular density. } \label{fig:2Dpsfs_kmax} \end{center} \end{figure} Some sampling patterns with variable $\ensuremath{k_{\rm max}}$ patterns and their corresponding PSFs are shown in Figure~\ref{fig:2Dpsfs_kmax}. The angularly varying projection lengths results in anisotropic resolution, seen in the main lobe of the PSFs. There is again some low-level aliasing introduced inside the desired FOV in Fig.~\ref{fig:2Dpsfs_kmax}a and e, but there is none of this aliasing in b, c, and d. For these three sampling patterns, $\ensuremath{k_{\rm max}}$ is the dual of the FOV shape, or $\ensuremath{k_{\rm max}}(\phi) \propto \ensuremath{FOV}(\phi+\ensuremath{\frac{\pi}{2}})$. In this case, the width of the aliasing lobes is inversely proportional to the FOV and the angular density compensation, $\ensuremath{\dcf_\theta}$, is uniform (Eq.~\ref{eq:2d_dcf}). See Section~\ref{sec:discussion} for more discussion of the dual shapes. Reducing the resolution also reduces the number of projections required. For the same FOV shapes with isotropic resolution, the trajectories in Fig.~\ref{fig:2Dpsfs_kmax} require between 13 and 36\% less projections, demonstrating the trade-off that can be made between resolution in a given dimension and acquisition time. Animations of how the PSF evolves as the algorithm progresses are available at \url{http://www-mrsrl.stanford.edu/~peder/radial_fovs}. The principles of the sampling approximations used (Fig.~\ref{fig:sampling_approx}) are visible in the movies. \subsection{3D PSFs} \label{sec:3DPSFs} The PSFs for 3D cones trajectories are 2D PR PSFs rotated about one axis, as is illustrated in Fig.~\ref{fig:3DPR_design}a and b. \begin{figure}[t] \begin{center} \includegraphics[width=1.0\columnwidth]{larso09} \caption{ PSFs for 3D PR trajectories with anisotropic FOVs using the spiral-based design. FOVs: (a) Oval $\ensuremath{\FOV_\theta}$ and ellipse $\ensuremath{\FOV_\phi}$, (b) Cylinder, (c) Cuboid, and (d) Ellipsoid with an ellipsoid $\ensuremath{k_{{\rm max},\theta}}$ shape, shrunk in the $k_z$ direction. The top row for each shape shows the PSF in the $y=0$ and $x=0$ planes, and the bottom row shows the $z=0$ plane and a 3-plane view. Similarly to the 2D case, there is some low-level aliasing (arrows) inside the desired FOV shapes (dashed lines), which is particularly visible in (b). } \label{fig:3Dpsfs} \end{center} \end{figure} Figure~\ref{fig:3Dpsfs} shows some PSFs for spiral-based 3D PR sampling patterns. For the variety of shapes and dimensions, the desired FOV is achieved, and using an oval for $\ensuremath{\FOV_\theta}$ and ellipse for $\ensuremath{\FOV_\phi}$ (Fig.~\ref{fig:3Dpsfs}a) results in three different FOV dimensions. There are low-level aliasing artifacts present in these PSFs (arrows in Fig.~\ref{fig:3Dpsfs}a and b). The cuboid (Fig.~\ref{fig:3Dpsfs}c) has sharp corners in all three dimensions, and is also well-defined at non-zero $z$-values, demonstrating that the azimuthal sampling aliasing shape, $\ensuremath{\FOV_\phi}$, is invariant in $z$, as assumed in Eq.~\ref{eq:3DFOV}. The PSF of an ellipsoid FOV with an ellipsoid $\ensuremath{k_{{\rm max},\theta}}$ is shown in Fig.~\ref{fig:3Dpsfs}d, demonstrating that variable $\ensuremath{k_{{\rm max},\theta}}$ is feasible. This trajectory has a 50\% reduction in Z-gradient strength requirements compared to the other trajectories because $\ensuremath{k_{{\rm max},\theta}}$ limits the projection extents in $k_z$. This halves the resolution in $z$, but requires 33\% less projections than the same FOV shape with 1 pixel isotropic resolution. \begin{figure} \begin{center} \includegraphics[width=\columnwidth]{larso10} \caption{ PSFs for various 3D PR design methods. (a) Cones-based design without randomized $\phi_0$. (b) Cones-based design with randomized $\phi_0$. (c) Spiral-based design. The $x=0$ plane for the shape in Fig.~\ref{fig:3Dpsfs}a is shown, and the images are identically windowed. The arrows indicate coherent streaking artifacts, all of which are eliminated when using the spiral-based design. } \label{fig:coherent_aliasing} \end{center} \end{figure} Coherent aliasing lines are introduced when using the cones-based design, as shown in Fig.~\ref{fig:coherent_aliasing}. The use of a random $\phi_0$ in the cones-based design eliminates the coherent line in the $x$-$y$ plane. A line along the $z$-axis remains because the polar projection spacings around $\theta = \ensuremath{\frac{\pi}{2}}$ are all identical. The tilt of the spiral in $k_z$ diffuses the line in the spiral-based design. These coherent lines would not affect fully-sampled acquisitions. In undersampled applications, which take advantage of the diffuse 3D PR aliasing, this could cause artifacts, making the spiral-based design advantageous. \begin{figure} \begin{center} \includegraphics[width=0.9\columnwidth]{larso11} \caption{ Number of projections for 3D anistropic FOV shapes, with ratios of $x$:$y$:$z$ lengths, versus the shape volume. All FOVs have 1 pixel isotropic resolution, and the curves shown are for both the cones-based and spiral-based design methods. Most of the anisotropic shapes are actually more efficient than the sphere, but at the cost of low-level aliasing within the FOV, seen in Fig.~\ref{fig:3Dpsfs}. } \label{fig:vol} \end{center} \end{figure} The scan volume efficiency for some 3D anisotropic FOV shapes is shown in Fig.~\ref{fig:vol}. The anisotropic shapes are generally more efficient, although there is more variation in efficiency than in the 2D case (Fig.~\ref{fig:area}). The increased efficiency is at the expense of some low-level aliasing inside the FOV. The 1:1:2 ($x$:$y$:$z$) shapes only have anisotropy in the polar sampling, and they are more efficient than the 1:2:2 shapes that also have azimuthal sampling anisotropy. This difference is caused by the anisotropic $\ensuremath{\FOV_\phi}$ cutting off portions of $\ensuremath{\FOV_\theta}$, which can be seen in Fig.~\ref{fig:3DPR_design}. \begin{figure} \begin{center} \includegraphics[width=.8\columnwidth]{larso12} \caption{ 2D PR Lower leg images with various FOV shapes, shown by the dashed lines. (a) 25 cm circular FOV requiring 393 projections, (b) 7.5 x 25 cm elliptical FOV requiring 197 projections, (c) 6.5 x 24 cm rectangular FOV requiring 195 projections, (d) 12.5 cm circular FOV requiring 196 projections. The non-circular FOV images (b,c) show no increase in aliasing artifacts or loss of resolution but were acquired with half the projections. The circular FOV acquired with half the projections (d) results in significant aliasing artifacts. } \label{fig:leg_images} \end{center} \end{figure} \subsection{MRI Experiments} In vivo 2D PR leg images acquired with isotropic and anisotropic FOVs are shown in Fig.~\ref{fig:leg_images}. The reduced FOV images (b-d) were acquired with half the number of projections as the full FOV image (a). The isotropic reduced FOV (d) results in significant streaking aliasing artifacts, while using anisotropic reduced FOVs tailored to the shape of the leg (b,c) results in no increase in artifact compared to the full isotropic FOV image. The images without aliasing (a-c) are all slightly undersampled, as shown by the overlaid FOV shapes, but no aliasing is visible due to the relatively diffuse aliasing pattern of PR. \begin{figure}[h] \begin{center} \includegraphics[width=.8\columnwidth]{larso13} \caption{ 3D PR phantom images, all acquired with the same number of projections. Isotropic FOV using the (a) cones-based method and (b) spiral-based method. Cylindrical FOV using the (c) cones-based method and (d) spiral-based method. The top images are all windowed identically to show the aliasing artifacts outside the bottle (white arrows). The bottom images are also identically windowed to show the aliasing artifacts within the bottle for the undersampled, isotropic FOVs (black arrows). The dashed lines indicate the supported FOV. } \label{fig:bottle} \end{center} \end{figure} Figure~\ref{fig:bottle} shows a representative slice from 3D PR acquisitions of a water bottle phantom using different FOVs, each with the same number of projections. In the isotropic FOV acquisitions, streaking artifacts are visible within the bottle and emanate from the edge of the bottle (arrows in Fig.~\ref{fig:bottle}a and b) because the FOV is not large enough. These artifacts have a peak amplitude of 23.2\% of the signal for the cones-based design and 11.5\% for the spiral-based design. By using a fully-sampled cylindrical FOV that matches the bottle's shape, these streaks are completely shifted outside of the bottle. (arrows in Fig.~\ref{fig:bottle}c and d). The differences in aliasing diffusivity between the two 3D PR design methods, shown in the PSFs in Fig.~\ref{fig:coherent_aliasing}, can also be seen in the images. There is a single, prominent aliasing streak when using the cones-based design (long, thin arrows), which is diffused with the spiral-based design (short, fat arrows), and the peak aliasing amplitudes also reflect this difference. In vivo 3D PR images of a 3 cm abdomen slab acquired in a single breath-hold are shown in Figs.~\ref{fig:abdomen} and~\ref{fig:abdomen_2mm}. The isotropic FOV images have significant streaking artifacts within the abdomen (arrows in Fig.~\ref{fig:abdomen}a and~\ref{fig:abdomen_2mm}a) because of the high undersampling ratios. Using a thin, squished cylindrical FOV tailored to the anatomy and the excited slab eliminates these streaking artifacts, as shown in Fig.~\ref{fig:abdomen}b. A small degree of undersampling in this tailored FOV is also tolerated, as evidenced by the lack of streaking artifacts in Fig.~\ref{fig:abdomen_2mm}b. The isotropic FOV streaking also results in a higher level of signal outside of the body in the axial images. More streaking is seen just outside the slab in the coronal images with the anisotropic FOV (arrows in Fig.~\ref{fig:abdomen}b). This is expected because of the smaller superior-inferior dimension with the anisotropic FOV relative to the spherical FOV, for which the streaks in this dimension are outside of the displayed region. Acquiring a fully-sampled 36 cm isotropic FOV at 3 mm isotropic resolution requires 22656 projections, while an undersampled 19.6 cm FOV at 2 mm resolution requires 14744 projections, both of which are prohibitively large for single breath-hold imaging. \begin{figure*} \begin{center} \includegraphics[width=1.8\columnwidth]{larso14} \caption{ Axial (top) and coronal (bottom) slices from a thin-slab 3D PR abdomen data-set with 3 mm isotropic resolution acquired in a single breath-hold. (a) Isotropic 11.4 cm FOV requiring 2303 projections. (b) Cylindrical 36 x 23 x 3 cm FOV requiring 2368 projections. Both trajectories were designed using the spiral-based method. Streaking artifacts result from the high axial undersampling of the isotropic FOV (arrows in (a)). The tailored FOV eliminates these artifacts by reducing FOV in the slab dimension. This leads to the streaks in the coronal slice (arrows in (b)), but these are outside of the imaging volume. } \label{fig:abdomen} \end{center} \end{figure*} \begin{figure*} \begin{center} \includegraphics[width=1.8\columnwidth]{larso15} \caption{ Same as Fig.~\ref{fig:abdomen}, except with 2 mm isotropic resolution and increased undersampling. (a) Isotropic 8 cm FOV requiring 2519 projections. (b) Cylindrical 19.6 x 12.2 x 2.8 cm FOV requiring 2529 projections. The undersampled cylindrical FOV has no noticeable streaking artifacts (arrows), which obscure the anatomy with the isotropic FOV. } \label{fig:abdomen_2mm} \end{center} \end{figure*} \section{Discussion} \label{sec:discussion} The algorithms presented are designed with fully-sampled FOV parameters, but will also be beneficial for undersampled radial imaging applications, as demonstrated in Fig.~\ref{fig:abdomen_2mm}. For undersampled applications like VIPR~\cite{BargerVIPR}, the desired FOV shape and size should be a scaled down version of the region-of-interest for equivalent undersampling factors in every dimension. The anisotropic FOV projections can also be applied to the highly constrained backprojection (HYPR) method for time-resolved MRI~\cite{MistrettaHYPR} because they can be reconstructed by filtered backprojection. Exam-specific FOVs can be used in all applications because the computation time of the design algorithms is small. Using an initial localizing scan, the desired FOV could be drawn or automatically detected and the acquisition tailored appropriately. For some FOV and $\ensuremath{k_{\rm max}}$ shapes, the resulting PSFs have low-level aliasing within the desired FOV. This is due to the finite width of the aliasing lobes, as shown in Fig.~\ref{fig:sampling_approx}b, which is not accounted for in our design algorithms. The projection angles are designed based on the peak at the center of these aliasing lobes, leaving the potential for up to half of the lobe to overlap inside the FOV. Overlap is more likely to occur as the radial separation of neighboring lobes increases, and thus is correlated with $\left | \frac{d\ensuremath{FOV}(\phi)}{d\phi} \right |$. The online animations of the PSFs show how the origin of the low-level aliasing is primarily along the longer edges where this derivative is the largest. This aliasing does not originate from minima or maxima of the FOV where the angular derivative is zero. Narrower shapes, which have a larger angular derivative, have more desirable efficiency curves in Fig.~\ref{fig:area} because they have more low-level aliasing within the FOV. For the shapes in Fig.~\ref{fig:area}, the total low-level aliasing power is approximately 0.60 and 1.3\% of the main lobe power for the 1.5:1 and 2:1 ellipses, respectively, and 0.67, 0.91, and 1.2\% for the 1:1, 1.5:1, and 2:1 rectangles. This confirms that narrower shapes have more low-level aliasing and that, in general, this aliasing is small. There is no low-level aliasing in the dual shape sampling patterns seen in Fig.~\ref{fig:2Dpsfs_kmax}b, c, and d. This suggests that the low-level aliasing may be more correctly correlated with the derivative of $\ensuremath{FOV}(\phi) / \ensuremath{k_{\rm max}}(\phi+\ensuremath{\frac{\pi}{2}})$, which is zero for the dual shapes. This derivative is very large for the FOV and $\ensuremath{k_{\rm max}}$ shapes in Fig.~\ref{fig:2Dpsfs_kmax}e, which has significant aliasing inside the desired FOV. Another observation is that dual ellipse sampling can be formed by scaling an isotropic sampling pattern along one axis. By Fourier theory, this transformation scales the PSF along the corresponding axis by the inverse and introduces no low-level aliasing. It is possible that the other shapes may be formed by some transformation of isotropic case. We have found no derivation confirming this suggested low-level aliasing correlation or any general transformation starting with isotropic sampling. With our method, it is possible to use 3D radial imaging trajectories to image thin slabs with isotropic resolution, as demonstrated in Figs.~\ref{fig:abdomen} and~\ref{fig:abdomen_2mm}. Previously, this was achieved by using stacks of projections~\cite{PetersPRMRA, VigenPRTRICKS}, which lacks some of the benefits of a true 3D radial acquisition, such as ultra-short TEs. Stacking the projections also results in a coherent aliasing streak along the stacking direction, similar to the streak resulting from the cones-based design (see Fig.~\ref{fig:coherent_aliasing}), which may be related to artifacts reported in the stacking dimension with contrast enhancement~\cite{BargerVIPR}. Both methods support one dimension of variable resolution, and stacks of 2D anisotropic FOV projections are also possible. This projection design can also be applied to other centric-based k-space trajectories. It can be directly applied to twisting radial-line (TwiRL) trajectories \cite{JacksonTwirl} by specifying the angular spacing of the different acquisitions. Anisotropic resolution can also be incorporated by adjusting the twist in the radial line to match $\ensuremath{k_{\rm max}}(\phi)$. Interleaved spiral acquisitions can also be adjusted for anisotropic FOVs. The angular spacing of adjacent interleaves can be determined by our algorithm, and spirals with many interleaves will benefit the most from this adjustment. This could also be combined with the previous anisotropic FOV spiral method \cite{KingFOV} which describes the design of the spirals themselves. \section{Conclusion} We have introduced a new method that designs projections for anisotropic FOVs in radial imaging. These FOVs can be precisely tailored to non-circular objects or regions-of-interest in 2D and 3D imaging. This allows for scan time reductions without introducing aliasing artifacts. For undersampled applications, this method allows for reduction of aliasing artifacts. Algorithms have been presented for the design of 2D and 3D PR trajectories, as well as 3D cones. There is no loss in FOV area efficiency when using anisotropic FOVs. The algorithms are very simple and fast, allowing them to be computed on-the-fly. They also support variable trajectory extents which can be used in MRI to favor certain gradients or relax gradient constraints in 3D cones. \appendices \section{Full-projection Spiral-based Design} \label{app:spiral_full} For a spiral-based full-projection design, the spiralling path is sampled for $0 \le \theta \le \ensuremath{\frac{\pi}{2}}$ by using $\ensuremath{\theta_{\rm width}} = \ensuremath{\frac{\pi}{2}}$ for the set of initial polar samples, and interpolating to $\ensuremath{\hat{\Theta}}[N_{polar}+1] = \ensuremath{\frac{\pi}{2}}$ and $\ensuremath{\hat{K}_{\rm max}}[N_{polar}+1] = \ensuremath{k_{{\rm max},\theta}}(\ensuremath{\frac{\pi}{2}})$. Near $\theta = \ensuremath{\frac{\pi}{2}}$, the polar sample spacing is not as desired because the opposite ends of the full-projections are spiralling in opposing directions. The spacing between these opposing turns varies approximately linearly from 1.5 to 0.5 times the desired spacing over each of the final two half-turns of the spiral. This spacing discrepancy also occurs with the isotropic 3D PR spiral design for full-projections\cite{WongRoos}. This undersampling can be compensated for by adding an extra quarter-turn to the spiral. To do this, the interpolation is carried out to additional samples of $\ensuremath{\hat{\Theta}}[N_{polar}+2] = \ensuremath{\frac{\pi}{2}} + \frac{1}{4 \ensuremath{k_{{\rm max},\phi}} \ensuremath{\FOV_\theta}(\pi)}$ and $\ensuremath{\hat{K}_{\rm max}}[N_{polar}+2] = \ensuremath{k_{{\rm max},\theta}}(\ensuremath{\hat{\Theta}}[N_{polar}+2])$, with $N_{N_{polar}+1,{\rm est}} = \frac{N_{\phi,{\rm est}}}{4}$. The density compensation must also be slightly modified to accomodate both the opposing spiral paths and the extra quarter-turn. Based on the 3D spiral geometry, it can be found that the total spacing from adjacent turns decreases approximately linearly between 1 and 0.5 times the desired spacing identically over the two last half-turns. Thus, the dcf from Eq.~\ref{eq:3d_dcf} is weighted over each of the half-turns separately by a linear ramp from 1 to 0.5 as $\theta$ increases. \bibliographystyle{IEEEtran}
\subsection{The feedback model} \label{sec:feedback} Depending on the specific framework at play, the modeling details concerning the feedback received by the players may vary wildly. For example, when modeling congestion in a city, it is reasonable to assume that commuters can estimate the time it would have taken them to get to their destination via a different route \textendash\ \eg by means of a GPS service or an app like GoogleMaps or Waze. By contrast, in applications of online learning to auctions and online advertising, it is not clear how a player could estimate the payoff of actions they did not play. To account for as broad a range of feedback models as possible, we will take a context-agnostic approach and assume that each player receives a ``black-box'' model of their payoff vector of the form \begin{equation} \label{eq:feedback} \npayv_{\run} = \payv\parens{\pstate_{\run}} + \error_{\run} \end{equation} for some abstract error process $\error_{\run} = (\error_{\play,\run})_{\play\in\players}$. To differentiate between random (zero-mean) and systematic (non-zero-mean) errors, we will further decompose $\error_{\run}$ as \( \error_{\run} = \noise_{\run} + \bias_{\run}, \) where \begin{equation} \bias_{\run} = \exof{\error_{\run} \given \filter_{\run}} \quad \text{and} \quad \exof{\noise_{\run} \given \filter_{\run}} = 0 \end{equation} with $\filter_{\run}$ denoting the history of $\state_{\run}$ up to stage $\run$ (inclusive) \footnote{Of course, since the feedback signal is generated only \emph{after} the player chooses a strategy, $\npayv_{\run}$ is not $\filter_{\run}$-measurable in general.}. We may then characterize the input signal $\curr[\npayv]$ by means of the following statistics: \vspace{-\smallskipamount} \begin{subequations} \label{eq:sigbounds} \begin{alignat}{3} \label{eq:bbound} a) \quad &\textit{Bias:} &\hspace{2em} &\exof{\dnorm{\bias_{\run}} \given \filter_{\run}} \leq \bbound_{\run} \\ b) \quad &\textit{Mean square:} &\hspace{2em} &\exof{\dnorm{\npayv_{\run}}^{2} \given \filter_{\run}} \leq \sbound_{\run}^{2} \hspace{15em} \end{alignat} \end{subequations} In the above, $\bbound_{\run}$ and $\sbound_{\run}$ represent deterministic bounds on the bias and variance of the feedback signal $\npayv_{\run}$. For concreteness, we will also make the following blanket assumptions: \begin{enumerate} [left=1ex,label={\upshape({A}\arabic*)}] \item \label{asm:bias} \emph{Bias control:} $\lim_{\run\to\infty} \bbound_{\run} = 0$ and $\sum_{\run} \step_{\run} \bbound_{\run} < \infty$. \item \label{asm:variance} \emph{Variance control:} $\sum_{\run} \step_{\run}^{2} \sbound_{\run}^{2} < \infty$. \item \label{asm:degen} \emph{Generic observation errors at equilibrium:} For every mixed \acl{NE} $\eq$ of $\fingame$ and for all $\run=\running$, there exists a player $\play\in\players$ and strategies $a,b\in\supp(\eq_{\play})$ such that \begin{equation} \probof{\abs{\npayv_{\play a,\run}-\npayv_{\play b,\run}}\geq \noiselb \given \filter_{\run}} > 0 \quad \text{for all sufficiently small $\noiselb > 0$}. \end{equation} \end{enumerate} The formulation of these hypotheses has been kept intentionally abstract because we have not made any modeling assumptions for how the players' payoff signals are generated. In this regard, they are to be construed as an ``inexact model'' that allows for a wide variety of settings; as an application, we illustrate below how these assumptions are verified in two widely used learning frameworks. \begin{model} [Oracle-based feedback] \label{semibandit feedback} Assume that each player chooses an action based on a given mixed strategy. Then, once this procedure has been completed, an oracle reveals to each player the payoffs corresponding to their pure strategies given the other players' chosen strategies \textpar{in the congestion example, this oracle could be Waze or a GPS device}. Formally, at each round $\run$, every player $\play\in\players$ picks an action $\currplay[\pure]\in\pures_{\play}$ based on $\currplay\in\strats_{\play}$ and observes the pure payoff vector $\payv_{\play}\parens{\pure_{\run}}\equiv \parens{\pay_{\play}\parens{\pure_\play;\pure_{-\play,\run}}}_{\pure_\play\in\pures_{\play}}$. Then the player's feedback signal is $\npayv_{\play,\run} = \payv_{\play}\parens{\pure_{\run}}$, which is a special case of the model \eqref{eq:feedback} with $\noise_{\run} = \payv\parens{\pstate_{\run}} - \payv\parens{\pure_{\run}}$ and $\bias_{\run} = 0$. In more detail, we have: \begin{itemize}[topsep=.5ex,leftmargin=\parindent] \setlength{\itemsep}{0pt} \setlength{\parskip}{.2ex} \item \ref{asm:bias} is trivial because $\bias_{\run} =0$. \item \ref{asm:variance} is satisfied as long as $\sum_{\run}\step_{\run}^{2} <\infty$ \textpar{because $\sup_{\run}\exof{\dnorm{\npayv_{\run}}^{2}} \leq \max_{\strat} \dnorm{\payv(\strat)}^{2} < \infty$}. \item \ref{asm:degen} is proved in \cref{appendix instability}. \end{itemize} \end{model} \begin{model} [Payoff-based feedback] \label{bandit feedback} Assume that each player picks an action based on some mixed strategy as above; however, players now only observe their realized payoffs $\pay_{\play}\parens{\pure_{\play,\run};\pure_{-\play,\run}}$. This is the standard model for \aclp{MAB} \cite{CBL06,BCB12}, and it is also known as the ``bandit feedback'' setting. In this case, players can estimate their payoff vectors by means of the \acl{IWE}: \begin{equation} \label{eq:IWE} \tag{IWE} \npayv_{\play\pure_{\play},\run} = \frac{\oneof{\pure_{\play,\run} = \pure_{\play}}}{\estate_{\play\pure_{\play,\run}}} \pay_{\play}(\pure_{\run}) \end{equation} where $\estate_{\play,\run} = \parens{1-\epar_{\run}}\pstate_{\play,\run} + \epar_{\run}/\abs{\pures_{\play}}$ is the mixed strategy of the $\play$-th player at stage $\run$. Compared to $\state_{\play,\run}$, the player's actual sampling strategy is recalibrated by an explicit exploration parameter $\epar_{\run}\to0$ whose role is to stabilize the learning process by controlling the variance of \eqref{eq:IWE}. The idea is that even if a strategy has zero probability to be chosen under $\state_{\run}$, it will still be sampled with positive probability thanks to the mixing factor $\epar_{\run}$. A standard calculation \textpar{that we defer to \cref{appendix instability}} shows that \eqref{eq:IWE} can be recast in the general form \eqref{eq:feedback} with $\bbound_{\run} = \bigoh(\epar_{\run})$ and $\sbound_{\run}^{2} = \bigoh(1/\epar_{\run})$. We then have: \begin{itemize}[topsep=.5ex,leftmargin=\parindent] \setlength{\itemsep}{0pt} \setlength{\parskip}{.2ex} \item \ref{asm:bias} is satisfied as long as $\epar_{\run}\to0$ and $\sum_{\run} \step_{\run}\epar_{\run} < \infty$. \item \ref{asm:variance} is satisfied as long as $\sum_{\run} \step_{\run}^{2} / \epar_{\run} < \infty$. \item \ref{asm:degen} is proved in \cref{appendix instability}. \end{itemize} \end{model} \begin{remark*} The above conditions for the method's learning rate and exploration parameters can be achieved by using schedules of the form $\step_{\run} \propto 1/\run^{\pexp}$ and $\epar_{\run} \propto 1/\run^{\qexp}$ with $\pexp+\qexp>1$ and $2\pexp-\qexp > 1$. A popular choice is $\pexp = 2/3 + \delta$ and $\qexp = 1/3 + \delta$ for some arbitrarily small $\delta>0$ \textendash\ or $\delta=0$ and including an extra logarithmic factor, \cf \cite{Sli19} and references therein. \end{remark*} \subsection{Regularization} \label{sec:regularizers} The second component of the \ac{FTRL} method is the players' ``choice map'' $\mirror_{\play}\from\dspace_{\play}\to\strats_{\play}$. Because the players' score variables $\dstate_{\play,\run}$ essentially represent an estimate of each strategy's cumulative payoff over time, $\mirror_{\play}$ is defined as a ``regularized'' version of the best-response correspondence $\dpoint_{\play} \mapsto \argmax_{\strat_{\play}\in\strats_{\play}}\braces{\inner{\dpoint_{\play}}{\strat_{\play}}}$ (the regularization being necessary to avoid prematurely committing to a strategy). On that account, we will consider \emph{regularized best responses} of the general form \begin{equation} \label{eq:choice} \mirror_{\play}(\dpoint_{\play}) = \argmax_{\strat_{\play}\in\strats_{\play}} \braces{ \inner{\dpoint_{\play}}{\strat_{\play}} - \hreg_{\play}(\strat_{\play}) }. \end{equation} In the above, each player's \emph{regularizer} $\hreg_{\play}\from\strats_{\play}\to\R$ is defined as $\hreg_{\play}(\strat_{\play}) = \sum_{\pure_{\play}\in\pures_{\play}} \theta_{\play}(\point_{\play})$ for some ``kernel function'' $\theta_{\play}\from[0,1]\to\R$ with the following properties: \begin{enumerate*}[(\itshape i\hspace*{.5pt}\upshape)] \item \manuallabel{h properties}{reguralizer's properties} $\theta_{\play}$ is \emph{continuous} on $[0,1]$; \item $C^{2}$-smooth on $(0,1]$; and \item $\inf_{[0,1]} \theta''_{\play} >0$. \end{enumerate*} Of course, different regularizers give rise to different instances of \eqref{eq:FTRL}; for concreteness, we present below two prototypical examples thereof. \begin{example} [Multiplicative/Exponential weights update] \label{MWU} A popular choice of regularizer is the \textpar{negative} entropy $\hreg_i\parens{x} = \sum_{i}x_i\log x_i$, which leads to the \emph{logit choice} map $\Lambda_i\parens{y} = \exp\parens{y_i}/\sum_j \exp\parens{y_j}$ and the algorithm known as \emph{multiplicative weights update} \textpar{MWU}, \cf \cite{Vov90,LW94,ACBFS95,AHK12,SS11}. \end{example} \begin{example}[Euclidean projection] \label{Projection} Another popular regularizer is the quadratic penalty $\hreg_i\parens{x} = \sum_i{x_i}^{2}/2$, which yields the \emph{payoff projection} choice map $\Eucl_i\parens{y} = \argmin_{x\in \Delta}\norm{y-x}^{2}$, \cf \cite{Zin03,LS08}. \end{example} \section{Introduction} \label{sec:introduction} \input{introduction.tex} \section{Preliminaries} \label{sec:prelims} \input{prelims.tex} \section{Regret minimization and regularized learning} \label{sec:FTRL} \input{FTRL.tex} \section{Analysis and Results} \label{sec:results} \input{results.tex} \subsection{Proofs of assumptions for \cref{bandit feedback}, \cref{semibandit feedback}} Below we provide a proof for our claim in \cref{bandit feedback} that $\bias_\round = \bigoh\parens{\epar_\round}$, $\sbound_\round^2 =\bigoh\parens{1/\epar_\round}$. Focusing on one player $\play\in\players$, notice that \begin{equation}\label{eq:mean bandit} \exof{\npayv_{\play,\round}\given\filter_\round} = \sum_{\pure_{-\play}\in\pures_{-\play}}\estate_{-\play,\round} \parens{\pay_\play\parens{\pure_{\play,1};\pure_{-\play}},\hdots,\pay_\play\parens{\pure_{\play,\abs{\pures_\play}};\pure_{-\play}}} = \payv_\play\parens{\estate_\round} \end{equation} Having this in mind $\npayv_{\play,\round}$ can be viewed as \begin{equation} \npayv_{\play,\round} = \payv_{\play}\parens{\pstate_\round}+\noise_{\play,\round} +\bias_{\play,\round} \end{equation} where $\noise_{\play,\round} = \npayv_{\play,\round} - \exof{\npayv_{\play,\round}\given\filter_\round} = \npayv_{\play,\round} - \payv_\play\parens{\estate_\round}$ and $\bias_{\play,\round} = \payv_\play\parens{\estate_\round} - \payv_\play\parens{\pstate_\round}$. Thus, since $\payv_\play\parens{x}$ is multi-linear in $x$ and $\estate_{\play,\round} = \parens{1-\epar_\round}\pstate_{\play,\round} + \epar_\round/\abs{\pures_\play}$ it follows that $\bias_\round = \bigoh\parens{\epar_\round}$. Finally, similarly to \eqref{eq:mean bandit} we can conclude that $\sbound_\round^2 =\bigoh\parens{1/\epar_\round}$.\\ We continue by proving that assumption \ref{asm:degen} is indeed satisfied for both \cref{semibandit feedback}, \cref{bandit feedback}. This is due to the genericity of the game. Actually in the following lemma and corollaries we show that there exist player $\play\in\players$, strategies $a,b\in\supp\parens{\eq_\play}$ and pure strategy profile $\pure_{-\play}\in\supp\parens{\eq_{-\play}}$, where $\eq$ is a mixed Nash equilibrium such that $\abs{\pay_\play\parens{a;\pure_{-\play}}-\pay_\play\parens{b;\pure_{-\play}}}\geq \noiselb$ for some $\noiselb > 0$. % In order to acquire the exact statement of \ref{asm:degen}, we have to take into account the round in which the game is evolved. Let $\round >0$ be this round, then when examining the stochastic asymptotic stability of a mixed Nash equilibrium $\eq$, the sequence of play is contained in a neighborhood of $\eq$ and thus all of the strategies belonging to the support of $\eq$ have strictly positive probability to be chosen, verifying the statement of \ref{asm:degen}. \begin{lemma}\label{lem:not equal payoffs} If the game is generic and has a mixed Nash equilibrium $\eq$, then there exist player $\play\in\players$, pure strategies $a,b\in\supp\parens{\eq_\play}$ ($a\neq b$) and pure strategy profile $\pure_{-\play}\in\supp\parens{\eq_{-\play}}$ such that $\pay_\play\parens{a;\pure_{-\play}} \neq \pay_\play\parens{b;\pure_{-\play}}$. \end{lemma} \begin{proof} Assume that for all players $\play\in\players$, pure strategy profiles $\pure_{-\play}\in\supp\parens{\eq_{-\play}}$ and pure strategies $a,b\in\supp\parens{\eq_\play}$ it is \begin{equation} \pay_\play\parens{a;\pure_{-\play}} = \pay_\play\parens{b;\pure_{-\play}} \end{equation} Then for each player $\play$, this implies that all of the payoffs corresponding to pure strategy profiles, which consists of the support of the equilibrium, are equal. Then each pure strategy profile $\parens{\pure_\play;\pure_{-\play}}\in\supp\parens{\eq}$ is a pure Nash equilibrium, which is a contradiction to the genericity of the game. \end{proof} \noindent Immediate implications of \cref{lem:not equal payoffs} are: \begin{corollary}\label{cor:non zero payoff} There exists player $\play\in\players$ and pure strategy profile $\parens{\pure_\play;\pure_{-\play}}\in\supp\parens{\eq}$, such that $\pay_\play\parens{\pure_\play;\pure_{-\play}}\neq 0$. \end{corollary} \begin{corollary}\label{cor:payoffs bounded} There exist $\paybound >0$, player $\play$, strategies $a,b\in\supp\parens{\eq_\play}$ and pure strategy profile $\pure_{-\play}\in\supp\parens{\eq_{-\play}}$ such that $\abs{\pay_\play\parens{a;\pure_{-\play}} -\pay_\play\parens{b;\pure_{-\play}}}\geq \paybound$. There also exist $\paybound' >0$ and $\parens{\pure_\play;\pure_{-\play}}\in \supp\parens{\eq}$ such that $\abs{\pay_\play\parens{\pure_\play;\pure_{-\play}}}\geq\paybound'$. \end{corollary} \begin{figure}[!ht] \input{tikz_plots/polar} \caption{The polar cone corresponding to different points of the simplex. For an interior point this is a line perpendicular to the simplex. For a point of the boundary, it is a plane perpendicular to the simplex tangential to the point of the boundary. For an edge the polar cone corresponds to a cone.} \label{fig: polar cone} \end{figure} \subsection{Deferred proof of \cref{theorem:only-if}} Before moving on our proof we first provide some intuition derived from the notion of the polar cone (\cref{ss:polar cone}). Looking at \cref{fig: polar cone}, the polar cone corresponding to \emph{fully mixed} or \emph{mixed} Nash equilibria has a key difference with the one corresponding to \emph{strict} Nash equilibria. The latter, in contrast to the former, is fully dimensional. Thus intuitively, considering a sufficiently small neighborhood of a \emph{mixed} Nash equilibrium, the slightest perturbation in the dual space of the payoffs, will lead to instability of the system. Our result is based on this intuition; we prove by contradiction that there exists a sufficiently small neighborhood of a \emph{mixed} Nash equilibrium, from which the sequence of play will escape with strictly positive probability. The decomposability assumption of the regularizers ensures that the proof holds also for steep regularizers (See \cref{ss:steep vs non-steep}). Below, leveraging the definition of the polar cone in simplex, we prove a useful property for the difference of the aggregated payoffs of FTRL for a sequence of play that shares common pure strategies. \begin{lemma}\label{lem:Useful Expression} Let $\pstate_{\play} = \mirror\parens{\dstate_\play}\in \pspace_\play$ be a mixed strategy profile and $a,b\in\supp\parens{\pstate_\play}$ be two pure strategies, for some player $\play\in\players$. Then it holds: \begin{equation*} \inner{\dstate_\play}{\bvec_a-\bvec_b} = \inner{\nabla \hreg_\play\parens{\pstate_\play}}{\bvec_a-\bvec_b} \end{equation*} Additionally, if \eqref{eq:FTRL} is run then for a sequence of play $\pstate_{\play,\round_1},\hdots,\pstate_{\play,\round_2}$ that maintains in its support both pure strategies $a,b\in\pures_\play$ it holds \begin{equation*} \inner{\dstate_{\play,\subround_1} -\dstate_{\play,\subround_2}}{\bvec_a-\bvec_b} = \inner{\nabla \hreg_{\play}\parens{\pstate_{\play,\subround_1}} - \nabla\hreg_{\play}\parens{\pstate_{\play,\subround_2}}}{\bvec_a-\bvec_b} \ \forall \subround_1,\subround_2\in \{\round_1,\hdots,\round_2\} \end{equation*} \begin{comment} Let $\eq\in\pspace$ be a mixed Nash equilibrium and pure strategies $a,b\in\supp\parens{\eq_\play}$ for some player $\play\in\players$. If \eqref{eq:FTRL} is run and the sequence of play, is contained in a neighborhood of $\eq$, then for the corresponding aggregate payoffs $\currplay[\dstate],\nextplay[\dstate]$ we have: \begin{equation*} \inner{\nextplay[\dstate] -\currplay[\dstate]}{\bvec_a-\bvec_b} = \inner{\nabla \hreg_{\play}\parens{\nextplay} - \nabla\hreg_{\play}\parens{\currplay}}{\bvec_a-\bvec_b} \end{equation*} \end{comment} \end{lemma} \begin{proof} From \cref{prop:y in subgradient}, $\dstate_\play$ can be analyzed as $\dstate_\play = \nabla\hreg_\play\parens{\pstate_\play}+ \PCsym$, $\PCsym\in \pcone\parens{\pstate_\play}$. Notice that $\nabla\hreg_\play\parens{\pstate_\play} = \parens{\theta_\play\parens{\pstate_{\play,\pure_1}},\hdots,\theta_\play\parens{\pstate_{\play,\pure_{\abs{\pures_\play}}}}}$. Since $\pstate_\play$ assigns positive probability to both $a,b$, by definition of the polar cone it is $\PCsym_{a} = \PCsym_{b}$. Thus, \begin{align} \inner{\dstate_\play}{\bvec_a-\bvec_b} &= \PCsym_a + {\theta}'_\play\parens{\pstate_{\play,a}} - \PCsym_b - {\theta}'_\play\parens{\pstate_{\play,b}}\\ &= \inner{\nabla\hreg_\play\parens{\pstate_\play}}{\bvec_a-\bvec_b}\label{eq1 lemma3} \end{align} For the second part, by applying \eqref{eq1 lemma3} for both cases of $\dstate_{\play,\subround_1},\dstate_{\play,\subround_2}$ we have: \begin{align} \inner{\dstate_{\play,\subround_1}}{\bvec_a-\bvec_b} &= \inner{\nabla\hreg_\play\parens{\pstate_{\play,\subround_1}}}{\bvec_a-\bvec_b}\\ \inner{\dstate_{\play,\subround_2}}{\bvec_a-\bvec_b} &= \inner{\nabla\hreg_\play\parens{\pstate_{\play,\subround_2}}}{\bvec_a-\bvec_b} \end{align} From the subtraction of the above equations, we derive the desideratum: \begin{equation} \inner{\dstate_{\play,\subround_1}-\dstate_{\play,\subround_2}}{\bvec_a-\bvec_b} = \inner{\nabla\hreg_\play\parens{\pstate_{\play,\subround_1}}-\nabla\hreg_\play\parens{\pstate_{\play,\subround_2}}}{\bvec_a-\bvec_b} \end{equation} \end{proof} \begin{theorem}[Restatement of \cref{theorem:only-if} ]\label{th:theorem 1} \input{theorems-proofs/th_mixed_non_stable} \end{theorem} \begin{proof} \input{theorems-proofs/mixed_non_stable} \end{proof} \subsection{Bregman divergence}\label{ss:Bregman} Bregman divergence provides a way to measure the distance of two points that belong to the simplex. Its properties render it a useful tool to prove convergence results. Below we state its definition and prove these properties that would be crucial in the establishment of our proof. Given a fixed point $p\in\pspace$ then the Bregman divergence of a function $\hreg$ is defined for all points $x\in\pspace$ as \begin{equation}\label{eq:Bregman} \breg_\hreg\parens{p,x} = \hreg\parens{p} - \hreg\parens{x} - \hreg'\parens{x;p-x} \text{ for all }p,x \in\pspace \end{equation} where $\hreg'\parens{x;p-x}$ is the one-sided derivative \begin{equation} \hreg'\parens{x;p-x}\equiv \lim_{t\to 0^+} t^{-1} \bracks{\hreg\parens{x+t\parens{p-x}} -\hreg\parens{x}} \end{equation} Notice that this definition of the Bregman divergence permits to work also with points on the boundary. It is possible that the limit of $\breg_\hreg$ attains the value of $+\infty$ if $\hreg'\parens{x;p-x} = -\infty$, as $x\to p$, where $p$ is a point of the boundary. However, the condition below ensures that this is not the case. \begin{equation}\label{eq:Bregman reciprocity}\tag{Reciprocity} \breg_\hreg\parens{p;x} \to 0 \text{ whenever }x\to p \end{equation} This is known as the reciprocity condition. What this property actually means is that the sublevel sets of $\breg\parens{p,\cdot}$ are neighborhoods of $p$. This is illustrated in \cref{level sets of KL}, when the function employed is the negative Shannon-entropy and the induced Bregman divergnce the Kullback–Leibler divergence. % Notice that for most decomposable functions $\hreg$, this property holds. Below we present a proof of this statement. \begin{proposition}\label{prop:rec Bregman} If $\hreg\parens{x} = \sum_i\theta\parens{x_i}$, with $\theta$ having the properties described in \eqref{h properties} and furthermore it holds that $\theta'\parens{x} = o\parens{1/x}$ for $x$ close to $0$, then $\breg_\hreg\parens{p;x}\to 0 $ whenever $x\to p$ for all $x,p\in\pspace$. \end{proposition} \begin{proof} It is sufficient to prove that $\lim_{x\to 0}\parens{\theta\parens{0} - \theta\parens{x} - \theta'\parens{x}\parens{0-x}} = 0$. The difference of the first two terms is obviously gives zero. Now, for the last term notice that if $\theta'\parens{x} = o\parens{1/x}$ for $x$ close to $0$, then $\lim_{x\to0}x\theta'\parens{x} = 0$ and the proof is completed. \end{proof} \noindent Additionally, Bregman divergence satisfies the properties described below. \begin{proposition}\label{prop:Prop Bregman} Let $\hreg$ be a $\stcon$-strongly convex function defined on the simplex $\pspace = \Delta\parens{\pures}$, that has the properties described in \ref{h properties} and let $\Delta_{p}$ be the union of the relative interiors of the faces of $\pspace$ that contain $p$ \ie \begin{equation} \Delta_{p} = \braces{x\in\pspace : \supp\parens{p}\subseteq\supp\parens{x}} = \braces{x\in\pspace: x_a >0 \text{ whenever }p_a>0} \end{equation} Then \begin{enumerate} \item $\breg_\hreg\parens{p,x}< \infty$ whenever $x\in\Delta_{p}$. \item $\breg_\hreg\parens{p,x}\geq 0$ for all $x\in\pspace$, with equality if and only if $p = x$, more particularly \begin{equation} \breg_\hreg\parens{p,x} \geq \dfrac{1}{2}\stcon\norm{x-p}^2\text{ for all }x\in\pspace \end{equation} \end{enumerate} \end{proposition} \begin{proof} For the first part, if $x\in\Delta_p$ then $\hreg\parens{x+t\parens{x-p}}$ is finite and smooth in a neighborhood of $0$ and thus $\breg\parens{p,x}$ is also finite.\\ The second part of the proposition, let $z=x-p$ then strong convexity yields \begin{align*} \hreg\parens{x + tz}\leq t\hreg\parens{p} +\parens{1-t}\hreg\parens{x} - \dfrac{1}{2}\stcon t\parens{1-t}\norm{x-p}^2&\\ t^{-1}\parens{\hreg\parens{x + tz} - \hreg\parens{x}} \leq \hreg\parens{p} -\hreg\parens{x} - \dfrac{1}{2}\parens{1-t}\stcon \norm{x-p}^2&\\ \hreg\parens{p} -\hreg\parens{x} - t^{-1}\parens{\hreg\parens{x + tz} - \hreg\parens{x}} \geq \dfrac{1}{2}\parens{1-t}\stcon \norm{x-p}^2& \end{align*} And by taking $t\to 0$, we obtain the result. \end{proof} We mention at this point that from \eqref{h properties}, since for each $\play\in\players$: $\inf_{\in[0,1]}\theta_\play''>0$, there exists $\stcon_\play >0$ such that for all $x,y\in[0,1]$ and $t\in[0,1]$ \begin{equation} \theta_\play\parens{tx+(1-t)y}\leq t\theta_\play\parens{x} + \parens{1-t}\theta_\play\parens{y} - \dfrac{\stcon_\play}{2}t\parens{1-t}\abs{x-y}^2 \end{equation} \noindent In all the proofs $\hreg$ symbolizes the aggregate function of all the regularizers \ie $\hreg\parens{x}=\sum_{\play}\hreg_{\play}\parens{x_{\play}}$, with strong convexity parameter $\stcon\equiv \min_{\play}\stcon_{\play}$. \subsection{Steep vs non-steep}\label{ss:steep vs non-steep} In this section we elaborate in detail the dichotomy of the properties of different regularizers mentioned in \cref{stability remark}. As we mentioned players may have different regularizers $\hreg_\play$ employed in their choice maps $\mirror_\play\parens{y}=\argmax_{x\in\pspace_\play}\left\{\inner{x}{y}-\hreg_\play\parens{x}\right\}$. Depending on the regularizer chosen, FTRL dynamics may differ significantly. To formally express this difference, it is convenient to consider that $\hreg$ is an extended-real valued function $\hreg:\mathcal{V}\to\R\cup\braces{\infty}$ with value $\infty$ outside of the simplex $\pspace$. Then the subdifferential of $\hreg$ at $x\in\mathcal{V}$ is defined as: \begin{equation} \partial\hreg\parens{x} = \braces{y\in {\mathcal{V}}^* : \hreg\parens{{x}'}\geq \hreg\parens{x} +\inner{y}{{x}'-x} \; \forall {x}'\in \mathcal{V}} \end{equation} If $\partial\hreg\parens{x}$ is nonempty, then $\hreg$ is called subdifferentiable at $x\in\pspace$. When $x\in\relint\parens{\pspace}$ then $\partial\hreg\parens{x}$ is always non-empty or $\relint\parens{\pspace}\subseteq \dom\partial\hreg\equiv \braces{x\in\pspace:\partial\hreg\parens{x}\neq \emptyset}$. Notice that when the gradient of $\hreg$ exists, then its subgradient always contains it. With these in mind, we present a typical separation between the different regularizers. On the one hand, \emph{steep} regularizers like the negative Shannon-entropy become infinitely steep as $x$ approaches the boundary or $\norm{\nabla h\parens{x}}\to\infty$. On the other hand, \emph{non-steep} are everywhere differentiable, like the Euclidean, allowing the sequence of play to transfer between the different faces of the simplex. In the dual space of payoffs, steepness implies that the choice map is not surjective (since it cannot map all payoff vectors to points of the boundary), it is however injective (it maps a payoff vector plus a multiple of $(1,1,\ldots,1)$ to the same strategy). Non-steep regularizers give rise to surjective maps, which are not injective, not even up to a multiple of $\parens{1,1,\hdots,1}$, to the boundary. Focusing on the more simple case of decomposable regularizers, the kernel of a steep one is differentiable on $(0,1]$ while for non-steep the kernel is differentiable in all of $[0,1]$. As a result, when a steep regularizer is employed the mirror map $\mirror:\dspace\to\pspace$ cannot return any point of the boundary. In other words, the points of the boundary are infeasible not only as initial conditions but also as part of the sequence of play. \begin{remark} This dichotomy is important for our analysis since we study the stochastic asymptotic stability of Nash equilibria, which may lie on the boundary, and we seek a neighborhood of initial conditions such that the equilibrium to be stable and attracting. Thus, instead of demanding the existence of a neighborhood $\nhd$ of an equilibrium $\eq$, such that whenever $X_0\in \nhd$, $\eq$ is stable and attracting; we demand the existence of a neighborhood $U$ of $\eq$ such that whenever $X_0\in \nhd\cap\im\mirror$ then $\eq$ is stable and attracting. \end{remark} \subsection{Polar cone}\label{ss:polar cone} The notion of the polar cone is tightly connected with the notion of duality. Given a finite dimensional vector space $\mathcal{V}$, a convex set $\mathcal{C}\subseteq\mathcal{V}$ and a point $x\in\mathcal{C}$ the tangent cone $\tcone_{\mathcal{C}}\parens{x}$ is the closure of the set of all rays emanating from $x$ and intersecting $\mathcal{C}$ in at least one other point. The dual of the tangent cone is the polar cone $\pcone_{\mathcal{C}}\parens{x} = \braces{y\in\mathcal{V}^*:\inner{y}{z}\leq 0 \text{ for all } z\in\tcone_{\mathcal{C}}\parens{x}}$. \\ When the under consideration convex set is the simplex of the players' strategies, the polar cone corresponding to the boundary differs significantly from the one corresponding to the interior. Formally, the polar cone at a point $x$ of the simplex is \begin{equation} \pcone\parens{x} = \braces{y\in\dspace: y_a \geq y_b \text{ for all } a,b\in\pures}\footnote{It is always $y_a=y_b$ whenever $a,b\in\supp\parens{x}$.} \end{equation} An illustration of this is depicted in \cref{fig: polar cone}. When \eqref{eq:FTRL} is run, the notion of the polar cone emerges from the choice map $\mirror:\dspace\to\pspace$, connecting the primal space of the strategies with the dual space of the payoffs. The proposition below presents this exact connection. \begin{proposition}\label{prop:y in subgradient} Let $\hreg$ be a strong convex regularizer that satisfies the properties described in \ref{h properties} and let $\mirror:\dspace\to\pspace$ be the induced choice map then % \begin{enumerate} \item $x=\mirror\parens{y}\Leftrightarrow y\in\partial\hreg\parens{x}$ \item $\partial\hreg\parens{x}= \nabla\hreg\parens{x} + \pcone\parens{x}$ for all $x\in\pspace$. \end{enumerate} \end{proposition} \subsection{Fenchel coupling}\label{ss:Fenchel} Even though Bregman divergence is a useful tool, \eqref{eq:FTRL} evolves in the dual space of payoffs. Thus dually to the above the Fenchel coupling\footnote{The term is due to \cite{MS16}.} is defined, $\fench_\hreg:\pspace\times \dspace \to \R$ \begin{equation} \fench_\hreg\parens{p,y} = \hreg\parens{p} + \hreg^*\parens{y} -\inner{y}{p} \text{ for all } p\in\pspace, y\in\dspace \end{equation} where $\hreg^*: \dspace \to \R$ is the convex conjugate of $\hreg$: $\hreg^*\parens{y} = \sup_{x\in\pspace}\braces{\inner{y}{x} -\hreg\parens{x}}$. The fenchel conjugate is differentiable on $\dspace$ and it holds that \begin{equation} \nabla\hreg^*\parens{y} = \mirror\parens{y} \text{ for all } y\in \dspace \end{equation} Fenchel coupling is also a measure that connects the primal with the dual space. As we mentioned above, \eqref{eq:FTRL} evolves in the dual space and thus we use Fenchel coupling to trace its convergence properties. As the next proposition states, whenever Fenchel coupling $\fench\parens{p,y}$ is bounded from above so does $\norm{\mirror\parens{y}-p}$. This proposition in its entity, is critical for our proof, since we first need to find a neighborhood $U$ of attractness (See \cref{stability}). For this step, Bregman divergence is necessary in order to define the aforementioned neighborhood since $\norm{\mirror\parens{y}-p}< c$ for some constant $c$ is not necessarily a neighborhood of $p$ (See \cref{ss:steep vs non-steep}). \begin{proposition}\label{prop:Prop Fenchel} Let $\hreg$ be a $\stcon$-strongly convex function on $\pspace$ and has the propertied described in \ref{h properties}. Let $p\in\pspace$, then \begin{enumerate} \item $\fench_\hreg\parens{p,y}\geq \dfrac{1}{2}\stcon\norm{\mirror\parens{y}-p}^2$ for all $y\in\dspace$ and whenever $\fench_\hreg\parens{p,y}\to 0$, $\mirror\parens{y}\to p$. \item $\fench_\hreg\parens{p,y} = \breg_\hreg\parens{p,x}$ whenever $\mirror\parens{y}=x$ and $x\in\Delta_{p}$. \item $\fench_\hreg\parens{p,{y}'}\leq \fench_\hreg\parens{p,y}+\inner{{y}'-y}{\mirror\parens{y}-p} + \dfrac{1}{2\stcon}\norm{{y}'-y}_*^2$. \end{enumerate} \end{proposition} \begin{remark} Notice that the first part of the proposition is not implied by the second one, since it is possible that $\im\mirror = \dom\partial \hreg$ is not always contained in $\Delta_p$ (see \cref{ss:steep vs non-steep}). \end{remark} \begin{proof} For the first part, let $x=\mirror\parens{y}$ then $\hreg^*\parens{y} = \inner{y}{x} - \hreg\parens{x}$ \begin{equation} \fench_\hreg\parens{p,y} = \hreg\parens{p} - \hreg\parens{x} - \inner{y}{p-x} \end{equation} Since $y\in\partial \hreg\parens{x}$ (\cref{prop:y in subgradient}), it is \begin{equation}\label{eq 1} \hreg\parens{x+t\parens{p-x}} \geq \hreg\parens{x} + t\inner{y}{p-x} \end{equation} and by strong convexity of $\hreg$, we have \begin{equation}\label{eq 2} \hreg\parens{x+t\parens{p-x}}\leq t\hreg\parens{p} +\parens{1-t}\hreg\parens{x} -\dfrac{1}{2}\stcon t\parens{1-t}\norm{p-x}^2 \end{equation} Thus by combining \eqref{eq 1},\eqref{eq 2} and taking $t\to 0$ we get \begin{equation} \fench_\hreg\parens{p,y} \geq \hreg\parens{p} -\hreg\parens{x} -\hreg\parens{p} +\hreg\parens{x} + \dfrac{\stcon}{2}\norm{p-x}^2 \geq \dfrac{\stcon}{2}\norm{p-x}^2 \end{equation} For the second part of the proposition, notice that $x+t\parens{p-x}$ lies in the relative interior of some face of $\pspace$ for $t$ in a neighborhood of $0$ and thus $\hreg\parens{x+t\parens{p-x}}$ is smooth and finite. So, $\hreg$ admits a two-sided derivative along $x-p$ and since $y\in\partial\hreg\parens{x}$, $\inner{y}{p-x} = \hreg'\parens{x;p-x}$ and our claim naturally follows.\\ Finally for the last part of the proposition, we have \begin{align*} \fench_\hreg\parens{p,y'} &= \hreg\parens{p} +\hreg^*\parens{y'} -\inner{y'}{p}\\ &\leq \hreg\parens{p} + \hreg^*\parens{y} + \inner{y'-y}{\nabla\hreg^*\parens{y}} +\dfrac{1}{2\stcon}\norm{y'-y}^2_* -\inner{y'}{p}\\ &= \fench_\hreg\parens{p,y} + \inner{y'-y}{\mirror\parens{y} - p} +\dfrac{1}{2\stcon}\norm{y'-y}^2_* \end{align*} where the second inequality follows from the fact that $\hreg^*$ is $1/\stcon$ strongly smooth \cite{RW98}. \end{proof} In terms of Fenchel coupling our reciprocity assumption can be written as \begin{equation}\label{eq: Fenchel reciprocity}\tag{Reciprocity} \fench_\hreg\parens{p,y}\to 0 \text{ whenever } \mirror\parens{y}\to p \end{equation} Again for most of $\hreg$ decomposable, the assumption is turned into a property as we prove below. \begin{proposition}\label{prop:rec Fencel} If $\hreg\parens{x} = \sum_i\theta\parens{x_i}$, with $\theta$ having the properties described in \eqref{h properties} and furthermore it holds that $\theta'\parens{x} = o\parens{1/x}$ for $x$ close to $0$, then $\fench_\hreg\parens{p,y}\to 0 $ whenever $\mirror\parens{y}\to p$ for all $p\in\pspace$. \end{proposition} \begin{proof} Again it is sufficient to prove that whenever $\mirror\parens{y}=x\to 0$ then $\fench_\hreg\parens{p,y}\to 0$. Notice that from \cref{prop:Prop Fenchel} $\fench_\hreg\parens{p,y} =\breg_\hreg\parens{p,x}$ whenever $x=\mirror\parens{y}$ and $x\in\Delta_p$. Thus by \cref{prop:rec Bregman} $\mirror\parens{y}=x\to 0$ implies that $\fench_\hreg\parens{p,y}\to0$. \end{proof} \subsection{Variational stability} \label{ss:variational stability} \begin{definition}[Variational stability] A point $\eq\in\pspace$ is said to be \emph{variationally stable} if there exists neighborhood $\nhd$ of $\eq$ such that \begin{equation}\label{eq:variational stability}\tag{VS} \inner{\payv\parens{x}}{x-\eq}\leq 0 \text{ for all } x\in \nhd \end{equation}with equation if and only if $x=\eq$. \end{definition} \noindent What this property actually states is that in a neighborhood of $\eq$, it strictly dominates over all other strategies. Interestingly, strict Nash equilibria hold this property: \begin{proposition}\label{prop:strict variational stable}For finite games in normal form, the following are equivalent: \begin{enumerate}[i)] \item $\eq$ is a strict Nash equilibrium. \item $\inner{\payv\parens{\eq}}{z}\leq 0$ for all $z\in\tcone\parens{\eq}$ with equality if and only if z=0. \item $\eq$ is variationally stable. \end{enumerate} \end{proposition} \begin{figure}[h!] \centering \input{tikz_plots/vs_plot} \caption{\eqref{eq:variational stability} states that the payoff vectors are pointing "towards" the equilibrium } \end{figure} \begin{proof} We will first prove that $i)\Rightarrow ii)\Rightarrow iii)\Rightarrow i)$.\\ $i)\Rightarrow ii)$ Since $\eq$ is a Nash equilibrium by definition it holds for each player $\play$ that \begin{equation} \inner{\payv\parens{\eq}}{x-\eq}\leq 0 \text{ for all }x\in\pspace \end{equation} For the strict part of the inequality, by definition of strict Nash equilibria it holds that $\inner{\payv_\play\parens{\eq}}{x_\play-\eq_\play} <0$ whenever $x_\play\neq \eq_\play$ and thus \begin{equation} \inner{\payv\parens{\eq}}{z} = \sum_{\play=1}^{N}\inner{\payv_\play\parens{\eq}}{x_\play-\eq_\play} <0 \text{ if } x_\play\neq \eq_\play \text{ for some } \play \text { or }z\neq 0 \end{equation} $ii)\Rightarrow iii)$ By definition of the polar cone, we have that $\payv\parens{\eq}$ belongs to the interior of $\pcone\parens{\eq}$\footnote{Indeed if it belonged to the boundary then the equality in $ii)$ would not hold only for $z=0$.}. Thus by continuity there exists some neighborhood of $\eq$ such that $\payv\parens{x}$ also belongs to the polar cone of $\pcone\parens{\eq}$ or $\eq$ is variationally stable.\\ $iii)\Rightarrow i)$ Assume now that $\eq$ is variationally stable but not strict, then there exist for some player $\play$ $a$,$b\in\pures_\play$ such that $\pay_{\play}\parens{a;\eq_{-\play}} = \pay_{\play}\parens{b;\eq_{-\play}}$. Then for $x_\play = \eq_\play +\lambda\parens{\bvec_a - \bvec_b}$ and $x_{-\play} =\eq_{-\play}$ we have \begin{equation} \inner{\payv\parens{\eq}}{x -\eq} = \inner{\payv_\play\parens{\eq}}{\lambda\parens{\bvec_a - \bvec_b}} = 0 \end{equation} which is a contradiction. \end{proof} \subsection{Martingale limit theory} Our analysis leverages tools from martingale limit theory. Below we first present a simple fact for the reader to keep in mind, followed by the main theorems that we utilize in the main body of our proofs \begin{fact}\label{fact: submartingale} Let $R_\round = \sum_{\subround =1}^\round r_\subround$, where $r_\subround$ is a positive random variable for all $\subround = 0,1,\hdots$ attached to the filtration $\filter_{\subround-1}$. Then $R_\round$ is a submartingale. \end{fact} \noindent We begin with the strong law of large numbers for martingale difference sequences: \begin{theorem}\label{law of large numbers} Let $R_\round =\sum_{\subround =1}^\round r_\subround$ be a martingale with respect to an underlying stochastic basis $\parens{\Omega,\filter,\parens{\filter_\round}_{\round=1}^\infty,\prob}$ and let $\parens{\tau_\round}_{\round=1}^\infty$ be a nondecreasing sequence of positive numbers with $\lim_{\round \to\infty}\tau_\round = \infty$. If $\sum_{\round =1}^\infty \tau_\round^{-p}\exof{\abs{r_\round}^p\given\filter_{\round-1}}<\infty$ for some $p\in[1,2]$ almost surely, then \begin{equation} \lim_{\round\to\infty}\tau_\round^{-1} R_\round = 0 \text{ almost surely} \end{equation} \end{theorem} \noindent The second important result for our analysis is Doob's martingale convergence theorem: \begin{theorem}\label{Doob's convergence} If $R_\round$ is a submartingale that is bounded in $L_1$ (\ie $\sup_\round \exof{\abs{R_\round}}<\infty$), $R_\round$ converges almost surely to a random variable $R$ with $\exof{R}<\infty$. \end{theorem} \noindent Finally, we use the known as Doob's maximal inequality and one of its variants, presented below: \begin{theorem}\label{Max inequality submartingales} Let $R_\round$ be a non-negative submartingale and fix some $\eps > 0$. Then: \begin{equation} \probof{\sup_\round R_\round \geq \eps}\leq \dfrac{\exof{R_\round}}{\eps} \end{equation} \end{theorem} \begin{theorem}\label{Max inequality martingales} Let $R_\round$ be a martingale and fix some $\eps >0$. Then: \begin{equation} \probof{\sup_\round \abs{R_\round} \geq \eps}\leq \dfrac{\exof{R_\round^2}}{\eps^2} \end{equation} \end{theorem} \noindent Proofs of all these results can be found in \cite{HH80}. \subsection{Deferred Proof of \cref{theorem:if}} \label{sec:deferred proofs-of main lemmas} In the following preliminary result, we focus on the case of \eqref{eq:FTRL} with payoff feedback as described in \cref{sec:feedback} and we show that if $\eq$ is a \emph{strict} Nash equilibrium, there exists a subsequence of $\parens{\pstate_\round}_{\round=0}^\infty$ that converges to it. In order to achieve this convergence result, it is necessary to assume that the sequence $\parens{\pstate_\round}_{\round=0}^\infty$ is contained in a neighborhood of $\eq$, in which \eqref{eq:variational stability} holds. % Here, we outline the basic steps below: \begin{enumerate} \item[Step 0:] By contradiction, assume that there exists a neighborhood, in which $\pstate_\round$ is not contained for all sufficiently large $\round$ and assume without loss of generality that holds for all $\round = 0,1,\hdots$. \item[Step 1:]We start by showing that the terms of the RHS of the third property described in \cref{prop:Prop Fenchel} are converging almost surely to finite values, except for one. This term, which is a consequence of $\eq$ being variational stable, goes to $-\infty$ as $\round\to\infty$ . \item[Step 2:] The next crucial observation is that the Fenchel coupling is bounded from below by $0$, thanks to the first property in \cref{prop:Prop Fenchel}, which gives us the contradiction. \end{enumerate} \begin{remark*} For the interested reader, the assumption \ref{asm:variance}, $\sum_{\run} \step_{\run}^{2} \sbound_{\run}^{2} < \infty$, that we use in the preliminary lemma and in \cref{theorem:if} could be relaxed by using the H\"{o}lder inequality to $\sum_{\run} \step_{\run}^{1+q/2} \sbound_{\run}^{q}<\infty$ for any $q\in [2,\infty)$. \end{remark*} \begin{lemma}\label{lem:strict remain to neighborhood} \input{theorems-proofs/lem_strict_remain} \end{lemma} \begin{proof} \input{theorems-proofs/strict_remain} \end{proof} \begin{theorem}[Restatement of \cref{theorem:if} ]\label{th:strict are stable} \input{theorems-proofs/th_strict_stable} \end{theorem} \begin{proof} \input{theorems-proofs/strict_stable} \end{proof} \section{Introduction} \label{sec:introduction} \input{introduction.tex} \section{Preliminaries} \label{sec:prelims} \input{prelims.tex} \section{Regret minimization and regularized learning} \label{sec:FTRL} \input{FTRL.tex} \section{Analysis and Results} \label{sec:results} \input{results.tex} \subsection{Asymptotic Stability} \label{sec:stability} \AGmargincomment{Changed the paragraph} To address this question the precise definition of stability is sine qua non. % First observe that global stability results are not of interest, since FTRL's time evolution depends on its initialization and a game may admit several Nash equilibria. % Thus, we focus on the notion of \emph{asymptotic stability}, the standard criterion in the literature for the characterization of local stability. % Roughly speaking, a point is asymptotically stable if, whenever the sequence of play starts "close enough", remains "close enough" and finally converges to it \AGmargincomment{Not sure about this sentence}. However, in stochastic algorithms stability guarantees become more intricate; if the players’ payoff information is incomplete, a single unlucky estimation could drive $\pstate_\run$ away from the basin of a \acl{NE}, possibly never to return. As a result, any local convergence result under uncertainty must be probabilistic in nature. % For getting around this negative result "almost surely" is turned into "with arbitrarily high probability" leading to the definition of stochastic asymptotic stability. \begin{definition}[Stochastic Asymptotic Stability]\label{stability} Fix a confidence level $\conlevel >0$. We say that $\eq\in\pspace$ is: \begin{enumerate}[topsep=.5ex,leftmargin=\parindent] \setlength{\itemsep}{0pt} \setlength{\parskip}{.2ex} \item \emph{Stable}: For each neighborhood $V$ of $\eq$, there exists neighborhood $U$ of $\eq$, such that with probability at least $1-\conlevel$, $\pstate_\run \in V$ for all $\run \geq 0$, whenever $\pstate_0 \in U\cap \im\mirror$. Equivalently, if $\pstate_0\in U \cap\im\mirror$ then \begin{equation} \probof{\pstate_\run\in V\;\; \forall \run\geq 0 }\geq 1-\conlevel \end{equation} \item \emph{Attracting}: There exists neighborhood $U$ of $\eq$ such that whenever $\pstate_0 \in U\cap\im\mirror$ then \begin{equation} \probof{\lim_{\run\to\infty}\curr =\eq}\geq 1-\conlevel \end{equation} \item \emph{Stochastically Asymptotically Stable}: if it is stable and attracting. \end{enumerate} \end{definition} \begin{remark}\label{stability remark} In the definition above, we demand $\pstate_0 \in U\cap \im\mirror$ to pinpoint that some points of the boundary may be infeasible as initial states. Looking at the two examples, \cref{MWU,Projection} there is a dichotomy in the properties of the corresponding mirror maps. On the one hand, the kernel of the Euclidean/quadratic regularizer is differentiable in all of $[0,1]$. On the other hand, the derivative of the kernel of the negative Shannon-entropy goes to $\infty$ as $x$ goes to $0$. % This means that in the latter the boundaries are off the limits and inevitably some initial conditions do not belong in $\im\mirror$. This dichotomy is extensively discussed in \cref{ss:steep vs non-steep}. \end{remark} \noindent We are now ready to state our main results: \subsection{Main Results}% \label{sec:statements} \begin{theorem}\label{theorem:if} Let $\eq$ be a strict \acl{NE}. If \eqref{eq:FTRL} is run with payoff feedback that satisfies assumptions \ref{asm:bias}-\ref{asm:variance} % then $\eq$ is stochastically asymptotically stable. \end{theorem} \begin{theorem}\label{theorem:only-if} Let $\eq$ be a mixed \acl{NE}. If \eqref{eq:FTRL} is run with payoff feedback that satisfies assumption \ref{asm:degen} then $\eq$ is not stochastically asymptotically stable for any choice of the parameters of the algorithm. \end{theorem} \begin{center} \begin{tcolorbox}[enhanced,width=0.95\textwidth, drop fuzzy shadow southwest, boxrule=0.4pt,colframe=black!80!black,colback=black!10]\label{main theorem} \vspace{0.1cm} {\textbf{Main Theorem.}\emph{ Let $\eq$ be a Nash equilibrium. Then % % under assumptions \ref{asm:bias}-\ref{asm:degen} $\eq$ is stochastically asymptotically stable $\Leftrightarrow$ $\eq$ is a strict Nash equilibrium.}} \end{tcolorbox} \end{center} \begin{corollary}\AGmargincomment{Think here we have to put $\sum_n\step_n^2 <\infty$, since it is needed to osatisfy the assumptions.} If \eqref{eq:FTRL} is run with feedback described in \cref{semibandit feedback} % and the game is generic, then a \acl{NE} is stochastically asymprotically stable, if and only if it is a strict \acl{NE}. \end{corollary} \begin{corollary} If \eqref{eq:FTRL} is run with feedback described in \cref{bandit feedback} with % $\sum_\run \step_\run^2/\epar_\run <\infty$, $\sum_\run \step_\run \epar_\run <\infty$ and the game is generic, then a \acl{NE} is stochastically asymptotically stable, if and only if it is a strict \acl{NE}. \end{corollary} \noindent To the best of our knowledge our result is the first one to provide stability guarantees for the bandit framework in general $N-$players games. \section{Our Techniques}\label{sec:Proof Techniques} We begin by giving a high level overview of \Cref{theorem:if}, namely the necessary conditions that \eqref{eq:FTRL} should satisfy such that strict Nash equilibria are stochastically asymptotically stable. Having established our first stability result, then we explore the main ideas behind instability of mixed Nash equilibria \Cref{theorem:only-if} and its associated proof of correctness. \subsection{The Stochastic Asymptotic Stability of Strict Nash Equilibria}\label{sec:Stability:Proof Techniques} At the highest level, the standard tool in FTRL dynamics for questions pertaining to asymptotic stability of strict \aclp{NE} is the construction of a potential function, well-known as \emph{Second Lyapunov's method}. However, the analysis and the underlying structural results are considerably more involved when we shift from the continuous dynamics to discrete algorithms and more importantly in a stochastic framework with incomplete feedback information. Still, to built intuition we first recall the continuous and deterministic analogue. \subparagraph{The continuous time.} In prior work \citep{HS75,Wei00,Har11}, multiple instantiations of Bregman functions, like the KL-divergence have been employed as a potent tool for understanding \emph{replicator \& population dynamics}, which are the continuous analogues of MWU/EW (\cref{MWU}). Unfortunately, Bregman functions are insufficient to cover the full spectrum of regularizers studied in this work. % % This limitation has been sidesteped in \cite{MS16} by exploiting the information of the dual space $\dspace$ of the payoff scores, via the Fenchel coupling: % \begin{equation} \fench_\hreg\parens{x,y} = \hreg\parens{x} + \hreg^*\parens{y} -\inner{y}{x} \text{ for all } x\in\pspace, y\in\dspace \end{equation} where $\hreg^*: \dspace \to \R$ is the convex conjugate of $\hreg$: $\hreg^*\parens{y} = \sup_{x\in\pspace}\braces{\inner{y}{x} -\hreg\parens{x}}$. Indeed,\AGmargincomment{Changed it see how it looks} % $\fench_\hreg\parens{\eq,y}\ge 0$ where equality holds if and only if $\eq=Q(y)$ (\cref{prop:Prop Fenchel}). Therefore, for the continuous FTRL dynamics $\dot{y}(t)=v(x(t)), x(t)=Q(y(t))$, it remains to show that the time derivative of the Lyapunov-candidate-function $L_{\eq}(y(t))=\fench_\hreg\parens{\eq,y(t)}$ is negative. % This last key ingredient for the strict Nash equilibria is derived by their \emph{variational stability} property. \noindent Formally, a point $\eq$ is \emph{variationally stable} if there exists a neighborhood $U$ of $\eq$ such that \begin{equation}\label{variational stability-main} \inner{\payv\parens{x}}{x-\eq}\leq 0 \text{ for all }x\in U \tag{VS} \end{equation} with equality if and only if $x=\eq$. Roughly speaking, this property states that the payoff vectors are pointing ``towards'' the equilibrium in question since in a neighborhood of $\eq$, it strictly dominates over all other strategies. Thus by applying the chain rule, \eqref{variational stability-main} implies that ${\mathrm{d} L_{\eq}(y(t))}/{\mathrm{d} t}\leq 0$ \footnote{Analytically, $\dfrac{\mathrm{d} L_{\eq}(y(t))}{\mathrm{d} t}=\dfrac{\mathrm{d}{\hreg^*\parens{y(t)}}}{\mathrm{d} t} -\inner{\dot{y}(t)}{\eq}= \inner{\dot{y}(t)}{\nabla\hreg^*\parens{y}} -\inner{\dot{y}(t)}{\eq}= \inner{\payv\parens{x(t)}}{x(t)-\eq}\leq 0. $% }. \noindent Given their usefulness also in the discrete time stochastic case, we present all the aformentioned properties in detail in the paper’s supplement (\cref{ss:Bregman}-\ref{ss:variational stability}). \subparagraph{The discrete time.} The core elements of the continuous time proof do not trivially extend to the discrete time case. Even though we are not able to show that $\parens{\fench_\hreg\parens{\eq,\dstate_\subround}}_{\subround=1}^{\infty}$ is a decreasing sequence, due to the discretization and the uncertainty involved, we prove that $ \fench_\hreg\parens{\eq,\dstate_\subround} \to 0$. This immediately implies that FTRL algorithm converges to $\eq$, since from \cref{prop:Prop Fenchel} $\fench_\hreg\parens{\eq,\dstate_\subround}\ge \frac{1}{2\stcon_\hreg}\norm{\eq-\pstate_\subround}$. To exploit again the Fenchel coupling as a Lyapunov function, successive differences have to be taken among $\fench_\hreg\parens{\eq,\dstate_{\round+1}}, \ldots, \fench_\hreg\parens{\eq,\dstate_{0}}$. In contrast to the continuous time analysis, since the chain rule no longer applies, we can only do a second order Taylor expansion of the Fenchel coupling. Additionally, let us recall that in our stochastic feedback model, the payoff vector $\npayv_\round= \payv\parens{\pstate_\round}+\noise_\round + \bias_\round$ including possibly either random zero-mean noise or systematic biased noise. Combining \cref{prop:Prop Fenchel}, definition of $\npayv_\round$ and \eqref{eq:FTRL}, we can create the following upper-bound of Fenchel coupling at each round: \begin{equation}\label{fenchel-telescopic-main} \fench_\hreg\parens{\eq,\dstate_{\round+1}} \leq \fench_\hreg\parens{\eq,\dstate_0} + \sum_{\subround =0}^\round \step_\subround(\rvdrift_\subround+\rvnoise_\subround+\rvbias_\subround) + \dfrac{1}{2\stcon_\hreg}\sum_{\subround =0 }^\round \step_\subround^2\norm{\npayv_\subround}_*^2 \tag{$\star$} \end{equation} \smallskip where $\rvdrift_\subround=\inner{\payv\parens{\pstate_\subround}}{\pstate_\subround - \eq}, \rvnoise_\subround=\inner{{\noise_\subround}}{\pstate_\subround - \eq}, \rvbias_\subround=\inner{{\bias_\subround}}{\pstate_\subround - \eq} $ are the related terms with the drift of the actual payoff, the zero-mean noise and the bias correspondingly. When $\pstate_\round$ lies in a variationally stable region $U_{\ref{variational stability-main}}$ of $\eq$, the first-order term of $\rvdrift_\subround$, which also appears in the continuous time, corresponds actually to the negative ``drift'' of the variational stability which attracts Fenchel coupling to zero. Having settled the basic framework, we split the proof sketch of \Cref{theorem:if} into two parts: \emph{stochastic stability} \& \emph{convergence}. Our analysis relies heavily on tools from the convex analysis and martingale limit theory to control the influence of the stochastic terms in the aforementioned bound. \smallskip \noindent\textbf{Step 1: \emph{Stability}.} Let $U_\eps = \braces{x: \breg_\hreg\parens{\eq,x}<\eps}$ and $U_\eps^* = \left\{y\in\dspace: \fench_\hreg\parens{\eq,y} < \eps\right\}$ be the $\eps-$sublevel sets of Bregman function and Fenchel coupling respectively. Our first observation is that for all ``natural'' decomposable regularizers, it holds the so-called ``reciprocity condition'' (\cref{prop:rec Bregman,prop:rec Fencel}): essentially, this posits that $U_\eps$ and $Q(U_\eps^*)$ are neighborhoods of $\eq$ in $\strats$. Additionally, since $\fench_\hreg\parens{\eq,y} = \breg_\hreg\parens{\eq,x}$ whenever $\mirror\parens{y}=x$ and $\supp\parens{x}$ contains $\supp\parens{\eq}$, from \cref{prop:Prop Fenchel}, it holds that $\mirror\parens{U_\eps^*}\subseteq U_\eps$ and $\mirror^{-1}\parens{U_\eps}= U_\eps^*$. Thus, we conclude that whenever $y\in U_\eps^*$, $x=\mirror\parens{y}\in U_\eps$. \begin{comment} To proceed, fix a confidence level $\conlevel$ and $\eps$ sufficiently small such that \eqref{variational stability-main} holds for all $x \in U_{\eps}$. Using Doob's maximal inequalities % for (sub)martingales (\cref{Max inequality martingales,Max inequality submartingales}) we can prove that \begin{enumerate*}[(a)]\item ${\displaystyle\sup_{\round\in \mathbb{N}}}\{\sum_{\subround =0}^\round \step_\subround\rvnoise_\subround\}$, \item ${\displaystyle\sup_{\round\in \mathbb{N}}}\{\sum_{\subround =0}^\round \step_\subround\rvbias_\subround\}$ and \item ${\displaystyle\sup_{\round\in \mathbb{N}}} \{\frac{1}{2\stcon_\hreg}\sum_{\subround =0 }^\round \step_\subround^2\norm{\npayv_\subround}_*^2\}$\end{enumerate*} are greater or equal $\eps/4$ with probability less than $\delta/3$. \smallskip \noindent Thus, with probability $1-\delta$ it holds that \begin{enumerate*}[(a)]\item % $\sum_{\subround =0}^\round \step_\subround\rvnoise_\subround<\eps/4$, \item % $\sum_{\subround =0}^\round \step_\subround\rvbias_\subround<\eps/4$ and \item % $\frac{1}{2\stcon_\hreg}\sum_{\subround =0 }^\round \step_\subround^2\norm{\npayv_\subround}_*^2<\eps/4$\end{enumerate*},for all $\round\ge 0$. Then, martingale bounds are applied by demanding step-size such that $ \sum_{\subround=0}^\infty\step_\subround^2\sbound_\subround^2\leq \bigoh\parens{\eps^2\conlevel}$ and $\sum_{\subround=0}^\infty\step_\subround\bbound_\subround \leq \bigoh\parens{\eps\conlevel} $. For concision, we defer the full proof to the supplement of the paper in \cref{sec:deferred proofs-of main lemmas}. \smallskip \end{comment} To proceed, fix a confidence level $\conlevel$ and $\eps$ sufficiently small such that \eqref{variational stability-main} holds for all $x \in U_{\eps}$. Using Doob's maximal inequalities % for (sub)martingales (\cref{Max inequality martingales,Max inequality submartingales}) we can prove that with probability at least $1-\delta$, \begin{enumerate*}[(a)]\item\label{item:noise} $\{\sum_{\subround =0}^\round \step_\subround\rvnoise_\subround\}$, \item \label{item:bias}$ \{\sum_{\subround =0}^\round \step_\subround\rvbias_\subround\}$ and \item \label{item:discrete-error}$ \{\frac{1}{2\stcon_\hreg}\sum_{\subround =0 }^\round \step_\subround^2\norm{\npayv_\subround}_*^2\}$\end{enumerate*} are less than $\eps/4$ for all $\round\ge 0$. For concision, we defer the full proof to the supplement of the paper in \cref{sec:deferred proofs-of main lemmas}. For the rest of this part, we condition on this event and rewrite \eqref{fenchel-telescopic-main} as $\fench_\hreg\parens{\eq,\dstate_{\round+1}} < \sum_{\subround =0}^\round \step_\subround\rvdrift_\subround+\eps$. \medskip \noindent Following the definition of stability (\cref{stability}), we prove inductively that if $\pstate_0$ belongs a smaller neighborhood, namely if $\pstate_0 \in U_{\eps/4}\cap \im\mirror$, then $\pstate_\round$ never escapes $U_\eps$, $\pstate_\round\in U_\eps$ for all $\round\geq 0$. \begin{itemize}[topsep=.5ex,leftmargin=\parindent] \setlength{\itemsep}{0pt} \setlength{\parskip}{.2ex} \item Induction Basis/Hypothesis: Since $\pstate_0 \in U_{\eps/4}\cap \im\mirror$, apparently $\fench_\hreg\parens{\eq,\dstate_0} <\eps/4$ and $\pstate_0 \in U_{\eps}$. Assume that $\pstate_\subround \in U_{\eps}$ for all $0\leq \subround\leq \round$. \item Induction Step: We will prove that $\dstate_{\round +1}\in U_{\eps}^*$ and consequently $\pstate_{\round+1}\in U_{\eps}$. Since $U_{\eps}$ is a neighborhood of $\eq$ in which \eqref{eq:variational stability} holds we have that $\rvdrift_\subround\leq 0$ for all $0\leq\subround\leq\round $. Consequently $\fench_\hreg\parens{\eq,\dstate_{\round+1}} < \eps$ which implies that $\dstate_{\round+1} \in U_{\eps}^*$ or equivalently $\pstate_{\round+1} \in U_{\eps}$. \end{itemize} \smallskip \noindent\textbf{Step 2: \emph{Convergence}.} A tandem combination of stochastic Lyapunov and variational stability is the following lemma: \begin{lemma}[Informal statement of \cref{lem:strict remain to neighborhood}] Let $\eq\in \pures$ be a strict Nash equilibrium. If $\curr[\pstate]$ does not exit a neighborhood $R$ of $\eq$, in which variational stability holds, then there exists a subsequence $\pstate_{\round_\subround}$ of $\state_\round$ that converges to $\eq$ almost surely. \end{lemma} \noindent Indeed, if $\state_\round$ is entrapped in a variationally stable region $U_\eps$ of $\eq$ without converging to $\eq$, we can show that $\sum_{\subround=0}^\infty \step_\subround \rvdrift_k \to -\infty$, while comparatively by the law of the large numbers for martingales (\cref{law of large numbers}), the contribution of \ref{item:noise},\ref{item:bias},\ref{item:discrete-error} is negligible. Thus, in limit \eqref{fenchel-telescopic-main} implies that $0\leq \liminf \fench_\hreg\parens{\eq,\dstate_{\round}}\le -\infty $, which is a contradiction. Our final ingredient to complete the proof is that $\parens{\fench_\hreg\parens{\eq,\dstate_\subround}}_{\subround=1}^{\infty}$ behaves like an almost supermartingale when it is entrapped in a variationally stable region $U_\eps$ of $\eq$. So, by convergence theorem for (sub)-martingales (\cref{Doob's convergence}), $\parens{\fench_\hreg\parens{\eq,\dstate_\subround}}_{\subround=1}^{\infty}$ actually converges to a random finite variable. Inevitably though, $\liminf_{\round\to\infty}\fench_\hreg\parens{\eq,\dstate_\round} = \lim_{\round\to\infty} \fench_\hreg\parens{\eq,\dstate_\round} = 0$ and by \cref{prop:Prop Fenchel}, $\mirror\parens{\dstate_\round} = \curr \to \eq$. \subsection{The Stochastic Instability of Mixed Nash Equilibria}\label{sec:Instability:Proof Techniques} For the proof of \cref{theorem:only-if}, it is worth mentioning that in this case stability fails for any choice of step-size. We start by focusing on the assumption of non-degeneracy \ref{asm:degen} of theorem's statement.% \begin{itemize}[topsep=.5ex,leftmargin=\parindent] \setlength{\itemsep}{0pt} \setlength{\parskip}{.2ex} \item From a game-theoretic perspective, \ref{asm:degen} actually demands that with non-zero probability, % when players receive the payoffs corresponding to pure strategy profiles, there exists at least one player for whom at least two strategies of the equilibrium have distinct payoff signal. % Note that if for each player, the payoffs corresponding to two different strategies of $\supp (\eq)$ were all equal \footnote{ when all other players' also employ strategies of the equilibrium} immediately implies a non-generic game with pure \aclp{NE}. \item To illustrate this assumption in our generic feedback model, suppose that this error term $\error_{\run}$ is standard normal random noise $\xi_{\run}$. Indeed, the requirement of \ref{asm:degen} is satisfied since $\probof{\abs{ \payv_{\play, a}\parens{\pstate_{\run}} +\xi_{\play a,\run}-\payv_{\play,b}\parens{\pstate_{\run}}-\xi_{\play b,\run}}\geq 1/|\players| }> 1-\bigoh\left(\exp(-1/|\players|^2)\right)$. Such kind of property can be derived actually for any per-coordinate independent noise since actually the event of two independent coordinates to be exactly equal has zero measure. \end{itemize} For the bandit models \cref{semibandit feedback}, \cref{bandit feedback} of the previous section, we show that \ref{asm:degen} is satisfied in \cref{cor:non zero payoff,cor:payoffs bounded} of \cref{appendix instability}. Moving on to the proof of \Cref{theorem:only-if}, we start our analysis by connecting the difference of the payoff signal between two pure strategies, with the difference of the changes in the output of the regularizers' kernels, $\theta_\play$: \begin{lemma}[Informal Statement of \Cref{lem:Useful Expression}]\label{Main:Useful Expression} Let $\pstate_{\play,\round}$ be the sequence of play in \eqref{eq:FTRL} \ie $\pstate_{\play,\round} =\mirror\parens{\dstate_{\play,\round}}\in\pspace_\play$ of player $\play\in\players$; and for some round $\round \geq 0$ let $a,b\in\supp\parens{\pstate_{\play,\round}}$ be two pure strategies of player $\play\in\players$. Then it holds: \begin{equation*} \parensnew{{\theta}'_\play\parens{\pstate_{\play a,\round+1 }} - {\theta}'_\play\parens{\pstate_{\play a,\round }}} - \parensnew{{\theta}'_\play\parens{\pstate_{\play b,\round+1}} - {\theta}'_\play\parens{\pstate_{\play b,\round}}} = \step_\round\parens{\npayv_{\play a,\round}-\npayv_{\play b,\round}} \end{equation*} \end{lemma} \noindent Assume ad absurdum that a mixed \acl{NE} $\eq$ is stochastically asymptotically stable. First, since $\eq$ is a mixed strategy profile, there exist at least two pure actions $a,b\in\supp(\eq)$. Second, the stochastic stability implies that for all $\eps,\conlevel >0$ if $\pstate_0$ belongs to an initial neighborhood $U_{\eps}$, then $\norm{\curr -\eq} <\eps$ for all $\round \geq 0$, with probability at least $1-\conlevel$. Third, by the triangle inequality for two consecutive instances of the sequence of play $\pstate_{\play,\round},\pstate_{\play,\round+1}$ for any player $\play\in\players$ it holds: \begin{equation}\label{eq:closeness-per-round} |\pstate_{\play a,\round+1 } -\pstate_{\play a,\round }|+|\pstate_{\play b,\round+1 } -\pstate_{\play b,\round }|< \bigoh(\eps) \text{ with probability } 1-\conlevel \end{equation} Consider $\eps$ sufficiently small, such that the probabilities of the strategies that belong to the support of the equilibrium are bounded away from $0$, for all the points of the neighborhood. Since $\theta_\play$ is continuously differentiable in $(0,1]$, the differences described in \cref{Main:Useful Expression} are bounded from $\bigoh\parens{\eps}$ due to \cref{eq:closeness-per-round}. Thus, if the sequence of play $\curr$ is contained to an $\eps-$neighborhood of $\eq$, then the difference of the feedback, for any player $\play\in\players$, to two strategies of the equilibrium is $\bigoh\parens{\eps/\step_\round}$ with probability at least $1-\conlevel$: \[ \probof{ \abs{\npayv_{\play a,\round} - \npayv_{\play b,\round}}= \bigoh\parens{\eps/\step_\round}\given\filter_\round} \geq 1-\conlevel \] However, from assumption \ref{asm:degen} for a fixed round $\round$ and some player $\play\in\players$, there exist $\noiselb,\problb>0$ such that: \[ \probof{\abs{\npayv_{\play a,\round} - \npayv_{\play b,\round}}\geq \noiselb\given\filter_\round} = \problb>0 \] Thus by choosing $\eps=\bigoh(\noiselb \step_\round )$ and $\delta=\problb/2$, we obtain a contradiction and our proof is complete. \section{Discussion} Our result addresses the stability properties of \aclp{NE} under discrete no-regret algorithms, while taking into account the stochastic nature of real world applications. Predictive power is ensured for the case of bandit learning, where the information is extremely limited; but the \AGmargincomment{Alternative} Our result addresses the asymptotic behavior of discrete non-deterministic no-regret learning concerning all \aclp{NE}. \subsection{Asymptotic Stability} \label{sec:stability} The first thing to note in this general context is that a game may admit several \aclp{NE}, both mixed and pure. As a result, global convergence to an equilibrium from all initializations is not possible; for this reason, we will focus on the notion of (\emph{stochastic}) \emph{asymptotic stability} \cite{HS98,San10,Kha12}. Heuristically, an equilibrium is \emph{stochastically stable} if any sequence of play that begins close enough to the equilibrium in question, remains close enough with high probability; in addition, if the sequence of play eventually converges to said equilibrium, then we say that it is stochastically asymptotically stable. Formally, we have the following definition. \begin{definition} \label{stability} Fix some arbitrary confidence level $\conlevel>0$. Then $\eq\in\strats$ is said to be \begin{enumerate} [topsep=.5ex,label={\bfseries \arabic*.}] \item \textbf{Stochastically stable} if, for every neighborhood $\nhd$ of $\eq$ in $\strats$, there exists a neighborhood $\nhd_{\start}$ of $\eq$ such that whenever $\state_{\start} = \mirror(\dstate_{\start}) \in \nhd_{\start}$, we have \begin{equation} \probof{ \text{$\state_{\run}\in\nhd$ for all $\run=\running$} } \geq 1-\conlevel \end{equation} whenever $\state_{\start} = \mirror(\dstate_{\start}) \in \nhd_{\start}$. \item \textbf{Attracting} if there exists a neighborhood $\nhd_{0}$ of $\eq$ such that \begin{equation} \probof{ \text{$\lim\nolimits_{\run\to\infty} \state_{\run} = \eq$}} \geq 1-\conlevel \end{equation} whenever $\state_{0} = \mirror(\dstate_{0}) \in \nhd_{\start}$. \item \textbf{Stochastically asymptotically stable} if it is stochastically stable and attracting. \end{enumerate} \end{definition} \noindent \Cref{stability} will be the mainstay of our analysis and results, so some remarks are in order. \begin{remark} A first intricate detail in the above definition is the high probability requirement: indeed, under uncertainty, a single unlucky estimation of the players' payoff vector could drive $\state_{\run}$ away from any neighborhood of $\eq$, possibly never to return. In this regard, local stability results cannot be expected to hold with probability $1$, hence the requirement to hold with some arbitrary confidence level in the definition above. \end{remark} \begin{remark} \label{stability remark} Another remark worth making is the requirement $\state_{\start} = \mirror(\dstate_{\start}) \in \nhd_{\start}$ that indicates that some strategies in $\strats$ are not admissible as initial states. Going back to the two archetypal examples of \eqref{eq:FTRL}, \cref{MWU,Projection}, there is a dichotomy in the properties of the corresponding mirror maps. On the one hand, the kernel of the Euclidean/quadratic regularizer is differentiable on all of $[0,1]$. On the other hand, the derivative of the kernel of the negative Shannon-entropy goes to $-\infty$ as $x$ goes to $0$. This means that in the latter the boundaries are off the limits and inevitably some initial conditions do not belong in $\im\mirror$. We discuss this dichotomy extensively in \cref{ss:steep vs non-steep}. \end{remark} \subsection{Main Results}% \label{sec:statements} We are now in a position to state our main results. The informal version is as follows. \begin{center} \begin{tcolorbox}[enhanced,width=0.99\textwidth, drop fuzzy shadow southwest, boxrule=0.4pt,colframe=black!80!black,colback=black!10]\label{main theorem} \vspace{0.1cm} \centering \textbf{Main Theorem.} Suppose that Assumptions \ref{asm:bias}\textendash \ref{asm:degen} hold. Then: \\ $\eq$ is a strict \acl{NE} $\iff$ $\eq$ is stochastically asymptotically stable under \eqref{eq:FTRL} \end{tcolorbox} \end{center} Formally, we get the following precise statements and corollaries for the specific feedback models described in \cref{sec:feedback}. \begin{theorem} \label{theorem:if} Let $\eq\in\strats$ be a strict \acl{NE} of $\fingame$. If \eqref{eq:FTRL} is run with inexact payoff feedback satisfying Assumptions \ref{asm:bias} and \ref{asm:variance}, then $\eq$ is stochastically asymptotically stable. \end{theorem} \begin{theorem} \label{theorem:only-if} Let $\eq$ be a mixed \acl{NE} of $\fingame$. If \eqref{eq:FTRL} is run with inexact payoff feedback satisfying assumption \ref{asm:degen}, then $\eq$ is not stochastically asymptotically stable. \end{theorem} \begin{corollary} Suppose that \eqref{eq:FTRL} is run in a generic game with oracle-based feedback as in \cref{semibandit feedback} and a sufficiently small step-size $\step_{\run}$ with $\sum_{\run} \step_{\run}^{2} < \infty$. Then, a \acl{NE} is stochastically asymprotically stable if and only if it is strict. \end{corollary} \begin{corollary} Suppose that \eqref{eq:FTRL} is run in a generic game with bandit feedback as in \cref{bandit feedback} and sufficiently small step-size and explicit exploration paramters with $\sum_\run \step_\run^2/\epar_\run <\infty$, $\sum_\run \step_\run \epar_\run <\infty$. Then, a \acl{NE} is stochastically asymprotically stable if and only if it is strict. \end{corollary} These results \textendash\ and, in particular, the implications for the bandit case \textendash\ provide a learning justification to the abundance of arguments that have been made in the refinement literature against selecting mixed \aclp{NE} \citep{vD87,FT91,DF90}. In the rest of our paper, we present an outline of the main proof ideas and defer the details to the appendix. \section{Our Techniques} \label{sec:Proof Techniques} \subsection{The Stochastic Asymptotic Stability of Strict Nash Equilibria}\label{sec:Stability:Proof Techniques} At a high level, the standard tool in FTRL dynamics for questions pertaining to asymptotic stability of strict \aclp{NE} is the construction of a potential \textendash\ or \emph{Lyapunov} \textendash\ function. However, the analysis and the underlying structural results are considerably more involved when we shift from the continuous dynamics to discrete algorithms and more importantly in a stochastic framework with incomplete feedback information. Still, to build intuition we first recall the continuous and deterministic analogue. \subparagraph{The continuous-time case.} In prior work \citep{HS75,Wei00,Har11}, multiple instantiations of Bregman functions, like the KL-divergence have been employed as a potent tool for understanding \emph{replicator \& population dynamics}, which are the continuous analogues of MWU/EW (\cref{MWU}). Unfortunately, Bregman functions are insufficient to cover the full spectrum of regularizers studied in this work. % % This limitation has been sidesteped in \cite{MS16} by exploiting the information of the dual space $\dspace$ of the payoff scores, via the Fenchel coupling: % \begin{equation} \fench_\hreg\parens{x,y} = \hreg\parens{x} + \hreg^*\parens{y} -\inner{y}{x} \text{ for all } x\in\pspace, y\in\dspace \end{equation} where $\hreg^*: \dspace \to \R$ is the convex conjugate of $\hreg$: $\hreg^*\parens{y} = \sup_{x\in\pspace}\braces{\inner{y}{x} -\hreg\parens{x}}$. Indeed, % $\fench_\hreg\parens{\eq,y}\ge 0$ where equality holds if and only if $\eq=Q(y)$ (\cref{prop:Prop Fenchel}). Therefore, for the continuous FTRL dynamics $\dot{y}(t)=v(x(t)), x(t)=Q(y(t))$, it remains to show that the time derivative of the Lyapunov-candidate-function $L_{\eq}(y(t))=\fench_\hreg\parens{\eq,y(t)}$ is negative. % This last key ingredient for the strict Nash equilibria is derived by their \emph{variational stability} property. \noindent Formally, a point $\eq$ is \emph{variationally stable} if there exists a neighborhood $U$ of $\eq$ such that \begin{equation}\label{variational stability-main} \inner{\payv\parens{x}}{x-\eq}\leq 0 \text{ for all }x\in U \tag{VS} \end{equation} with equality if and only if $x=\eq$. Roughly speaking, this property states that the payoff vectors are pointing ``towards'' the equilibrium in question since in a neighborhood of $\eq$, it strictly dominates over all other strategies. Thus by applying the chain rule, \eqref{variational stability-main} implies that ${\mathrm{d} L_{\eq}(y(t))}/{\mathrm{d} t}\leq 0$ \footnote{Analytically, $\dfrac{\mathrm{d} L_{\eq}(y(t))}{\mathrm{d} t}=\dfrac{\mathrm{d}{\hreg^*\parens{y(t)}}}{\mathrm{d} t} -\inner{\dot{y}(t)}{\eq}= \inner{\dot{y}(t)}{\nabla\hreg^*\parens{y}} -\inner{\dot{y}(t)}{\eq}= \inner{\payv\parens{x(t)}}{x(t)-\eq}\leq 0. $% }. \noindent Given their usefulness also in the discrete time stochastic case, we present all the aformentioned properties in detail in the paper’s supplement (\cref{ss:Bregman}-\ref{ss:variational stability}). \subparagraph{The discrete time.} The core elements of the continuous time proof do not trivially extend to the discrete time case. Even though we are not able to show that $\parens{\fench_\hreg\parens{\eq,\dstate_\subround}}_{\subround=1}^{\infty}$ is a decreasing sequence, due to the discretization and the uncertainty involved, we prove that $ \fench_\hreg\parens{\eq,\dstate_\subround} \to 0$. This immediately implies that FTRL algorithm converges to $\eq$, since from \cref{prop:Prop Fenchel} $\fench_\hreg\parens{\eq,\dstate_\subround}\ge \frac{1}{2\stcon_\hreg}\norm{\eq-\pstate_\subround}$. To exploit again the Fenchel coupling as a Lyapunov function, successive differences have to be taken among $\fench_\hreg\parens{\eq,\dstate_{\round+1}}, \ldots, \fench_\hreg\parens{\eq,\dstate_{0}}$. In contrast to the continuous time analysis, since the chain rule no longer applies, we can only do a second order Taylor expansion of the Fenchel coupling. Additionally, let us recall that in our stochastic feedback model, the payoff vector $\npayv_\round= \payv\parens{\pstate_\round}+\noise_\round + \bias_\round$ including possibly either random zero-mean noise or systematic biased noise. Combining \cref{prop:Prop Fenchel}, definition of $\npayv_\round$ and \eqref{eq:FTRL}, we can create the following upper-bound of Fenchel coupling at each round: \begin{equation}\label{fenchel-telescopic-main} \fench_\hreg\parens{\eq,\dstate_{\round+1}} \leq \fench_\hreg\parens{\eq,\dstate_0} + \sum_{\subround =0}^\round \step_\subround(\rvdrift_\subround+\rvnoise_\subround+\rvbias_\subround) + \dfrac{1}{2\stcon_\hreg}\sum_{\subround =0 }^\round \step_\subround^2\norm{\npayv_\subround}_*^2 \tag{$\star$} \end{equation} \smallskip where $\rvdrift_\subround=\inner{\payv\parens{\pstate_\subround}}{\pstate_\subround - \eq}, \rvnoise_\subround=\inner{{\noise_\subround}}{\pstate_\subround - \eq}, \rvbias_\subround=\inner{{\bias_\subround}}{\pstate_\subround - \eq} $ are the related terms with the drift of the actual payoff, the zero-mean noise and the bias correspondingly. When $\pstate_\round$ lies in a variationally stable region $\nhd_{\ref{variational stability-main}}$ of $\eq$, the first-order term of $\rvdrift_\subround$, which also appears in the continuous time, corresponds actually to the negative ``drift'' of the variational stability which attracts Fenchel coupling to zero. Having settled the basic framework, we split the proof sketch of \Cref{theorem:if} into two parts: \emph{stochastic stability} \& \emph{convergence}. Our analysis relies heavily on tools from the convex analysis and martingale limit theory to control the influence of the stochastic terms in the aforementioned bound. \smallskip \noindent\textbf{Step 1: \emph{Stability}.} Let $\nhd_\eps = \braces{x: \breg_\hreg\parens{\eq,x}<\eps}$ and $\nhd_\eps^* = \left\{y\in\dspace: \fench_\hreg\parens{\eq,y} < \eps\right\}$ be the $\eps-$sublevel sets of Bregman function and Fenchel coupling respectively. Our first observation is that for all ``natural'' decomposable regularizers, it holds the so-called ``reciprocity condition'' (\cref{prop:rec Bregman,prop:rec Fencel}): essentially, this posits that $\nhd_\eps$ and $Q(\nhd_\eps^*)$ are neighborhoods of $\eq$ in $\strats$. Additionally, since $\fench_\hreg\parens{\eq,y} = \breg_\hreg\parens{\eq,x}$ whenever $\mirror\parens{y}=x$ and $\supp\parens{x}$ contains $\supp\parens{\eq}$, from \cref{prop:Prop Fenchel}, it holds that $\mirror\parens{\nhd_\eps^*}\subseteq \nhd_\eps$ and $\mirror^{-1}\parens{\nhd_\eps}= \nhd_\eps^*$. Thus, we conclude that whenever $y\in \nhd_\eps^*$, $x=\mirror\parens{y}\in \nhd_\eps$. \begin{comment} To proceed, fix a confidence level $\conlevel$ and $\eps$ sufficiently small such that \eqref{variational stability-main} holds for all $x \in \nhd_{\eps}$. Using Doob's maximal inequalities % for (sub)martingales (\cref{Max inequality martingales,Max inequality submartingales}) we can prove that \begin{enumerate*}[(a)]\item ${\displaystyle\sup_{\round\in \mathbb{N}}}\{\sum_{\subround =0}^\round \step_\subround\rvnoise_\subround\}$, \item ${\displaystyle\sup_{\round\in \mathbb{N}}}\{\sum_{\subround =0}^\round \step_\subround\rvbias_\subround\}$ and \item ${\displaystyle\sup_{\round\in \mathbb{N}}} \{\frac{1}{2\stcon_\hreg}\sum_{\subround =0 }^\round \step_\subround^2\norm{\npayv_\subround}_*^2\}$\end{enumerate*} are greater or equal $\eps/4$ with probability less than $\delta/3$. \smallskip \noindent Thus, with probability $1-\delta$ it holds that \begin{enumerate*}[(a)]\item % $\sum_{\subround =0}^\round \step_\subround\rvnoise_\subround<\eps/4$, \item % $\sum_{\subround =0}^\round \step_\subround\rvbias_\subround<\eps/4$ and \item % $\frac{1}{2\stcon_\hreg}\sum_{\subround =0 }^\round \step_\subround^2\norm{\npayv_\subround}_*^2<\eps/4$\end{enumerate*},for all $\round\ge 0$. Then, martingale bounds are applied by demanding step-size such that $ \sum_{\subround=0}^\infty\step_\subround^2\sbound_\subround^2\leq \bigoh\parens{\eps^2\conlevel}$ and $\sum_{\subround=0}^\infty\step_\subround\bbound_\subround \leq \bigoh\parens{\eps\conlevel} $. For concision, we defer the full proof to the supplement of the paper in \cref{sec:deferred proofs-of main lemmas}. \smallskip \end{comment} To proceed, fix a confidence level $\conlevel$ and $\eps$ sufficiently small such that \eqref{variational stability-main} holds for all $x \in \nhd_{\eps}$. Using Doob's maximal inequalities % for (sub)martingales (\cref{Max inequality martingales,Max inequality submartingales}) we can prove that with probability at least $1-\delta$, \begin{enumerate*}[(a)]\item\label{item:noise} $\{\sum_{\subround =0}^\round \step_\subround\rvnoise_\subround\}$, \item \label{item:bias}$ \{\sum_{\subround =0}^\round \step_\subround\rvbias_\subround\}$ and \item \label{item:discrete-error}$ \{\frac{1}{2\stcon_\hreg}\sum_{\subround =0 }^\round \step_\subround^2\norm{\npayv_\subround}_*^2\}$\end{enumerate*} are less than $\eps/4$ for all $\round\ge 0$. For concision, we defer the full proof to the supplement of the paper in \cref{sec:deferred proofs-of main lemmas}. For the rest of this part, we condition on this event and rewrite \eqref{fenchel-telescopic-main} as $\fench_\hreg\parens{\eq,\dstate_{\round+1}} < \sum_{\subround =0}^\round \step_\subround\rvdrift_\subround+\eps$. \medskip \noindent Following the definition of stability (\cref{stability}), we prove inductively that if $\pstate_0$ belongs a smaller neighborhood, namely if $\pstate_0 \in \nhd_{\eps/4}\cap \im\mirror$, then $\pstate_\round$ never escapes $\nhd_\eps$, $\pstate_\round\in \nhd_\eps$ for all $\round\geq 0$. \begin{itemize}[topsep=.5ex,leftmargin=\parindent] \setlength{\itemsep}{0pt} \setlength{\parskip}{.2ex} \item Induction Basis/Hypothesis: Since $\pstate_0 \in \nhd_{\eps/4}\cap \im\mirror$, apparently $\fench_\hreg\parens{\eq,\dstate_0} <\eps/4$ and $\pstate_0 \in \nhd_{\eps}$. Assume that $\pstate_\subround \in \nhd_{\eps}$ for all $0\leq \subround\leq \round$. \item Induction Step: We will prove that $\dstate_{\round +1}\in \nhd_{\eps}^*$ and consequently $\pstate_{\round+1}\in \nhd_{\eps}$. Since $\nhd_{\eps}$ is a neighborhood of $\eq$ in which \eqref{eq:variational stability} holds we have that $\rvdrift_\subround\leq 0$ for all $0\leq\subround\leq\round $. Consequently $\fench_\hreg\parens{\eq,\dstate_{\round+1}} < \eps$ which implies that $\dstate_{\round+1} \in \nhd_{\eps}^*$ or equivalently $\pstate_{\round+1} \in \nhd_{\eps}$. \end{itemize} \smallskip \noindent\textbf{Step 2: \emph{Convergence}.} A tandem combination of stochastic Lyapunov and variational stability is the following lemma: \begin{lemma}[Informal statement of \cref{lem:strict remain to neighborhood}] Let $\eq\in \pures$ be a strict Nash equilibrium. If $\curr[\pstate]$ does not exit a neighborhood $R$ of $\eq$, in which variational stability holds, then there exists a subsequence $\pstate_{\round_\subround}$ of $\state_\round$ that converges to $\eq$ almost surely. \end{lemma} \noindent Indeed, if $\state_\round$ is entrapped in a variationally stable region $\nhd_\eps$ of $\eq$ without converging to $\eq$, we can show that $\sum_{\subround=0}^\infty \step_\subround \rvdrift_k \to -\infty$, while comparatively by the law of the large numbers for martingales (\cref{law of large numbers}), the contribution of \ref{item:noise},\ref{item:bias},\ref{item:discrete-error} is negligible. Thus, in limit \eqref{fenchel-telescopic-main} implies that $0\leq \liminf \fench_\hreg\parens{\eq,\dstate_{\round}}\le -\infty $, which is a contradiction. Our final ingredient to complete the proof is that $\parens{\fench_\hreg\parens{\eq,\dstate_\subround}}_{\subround=1}^{\infty}$ behaves like an almost supermartingale when it is entrapped in a variationally stable region $\nhd_\eps$ of $\eq$. So, by convergence theorem for (sub)-martingales (\cref{Doob's convergence}), $\parens{\fench_\hreg\parens{\eq,\dstate_\subround}}_{\subround=1}^{\infty}$ actually converges to a random finite variable. Inevitably though, $\liminf_{\round\to\infty}\fench_\hreg\parens{\eq,\dstate_\round} = \lim_{\round\to\infty} \fench_\hreg\parens{\eq,\dstate_\round} = 0$ and by \cref{prop:Prop Fenchel}, $\mirror\parens{\dstate_\round} = \curr \to \eq$. \subsection{The Stochastic Instability of Mixed Nash Equilibria}\label{sec:Instability:Proof Techniques} For the proof of \cref{theorem:only-if}, it is worth mentioning that in this case stability fails for any choice of step-size. We start by focusing on the assumption of non-degeneracy \ref{asm:degen} of theorem's statement.% \begin{itemize}[topsep=.5ex,leftmargin=\parindent] \setlength{\itemsep}{0pt} \setlength{\parskip}{.2ex} \item From a game-theoretic perspective, \ref{asm:degen} actually demands that with non-zero probability, % when players receive the payoffs corresponding to pure strategy profiles, there exists at least one player for whom at least two strategies of the equilibrium have distinct payoff signal. % Note that if for each player, the payoffs corresponding to two different strategies of $\supp (\eq)$ were all equal \footnote{ when all other players' also employ strategies of the equilibrium} immediately implies a non-generic game with pure \aclp{NE}. \item To illustrate this assumption in our generic feedback model, suppose that this error term $\error_{\run}$ is standard normal random noise $\xi_{\run}$. Indeed, the requirement of \ref{asm:degen} is satisfied since $\probof{\abs{ \payv_{\play, a}\parens{\pstate_{\run}} +\xi_{\play a,\run}-\payv_{\play,b}\parens{\pstate_{\run}}-\xi_{\play b,\run}}\geq 1/|\players| }> 1-\bigoh\left(\exp(-1/|\players|^2)\right)$. Such kind of property can be derived actually for any per-coordinate independent noise since actually the event of two independent coordinates to be exactly equal has zero measure. \end{itemize} For the bandit models \cref{semibandit feedback}, \cref{bandit feedback} of the previous section, we show that \ref{asm:degen} is satisfied in \cref{cor:non zero payoff,cor:payoffs bounded} of \cref{appendix instability}. Moving on to the proof of \Cref{theorem:only-if}, we start our analysis by connecting the difference of the payoff signal between two pure strategies, with the difference of the changes in the output of the regularizers' kernels, $\theta_\play$: \begin{lemma}[Informal Statement of \Cref{lem:Useful Expression}]\label{Main:Useful Expression} Let $\pstate_{\play,\round}$ be the sequence of play in \eqref{eq:FTRL} \ie $\pstate_{\play,\round} =\mirror\parens{\dstate_{\play,\round}}\in\pspace_\play$ of player $\play\in\players$; and for some round $\round \geq 0$ let $a,b\in\supp\parens{\pstate_{\play,\round}}$ be two pure strategies of player $\play\in\players$. Then it holds: \begin{equation*} \parensnew{{\theta}'_\play\parens{\pstate_{\play a,\round+1 }} - {\theta}'_\play\parens{\pstate_{\play a,\round }}} - \parensnew{{\theta}'_\play\parens{\pstate_{\play b,\round+1}} - {\theta}'_\play\parens{\pstate_{\play b,\round}}} = \step_\round\parens{\npayv_{\play a,\round}-\npayv_{\play b,\round}} \end{equation*} \end{lemma} \noindent To proceed with the proof of \cref{theorem:only-if} assume ad absurdum that a mixed \acl{NE} $\eq$ is stochastically asymptotically stable. Since $\eq$ is mixed, there exist $a,b\in\supp(\eq)$. Second, the stochastic stability implies that for all $\eps,\conlevel >0$ if $\pstate_0$ belongs to an initial neighborhood $\nhd_{\eps}$, then $\norm{\curr -\eq} <\eps$ for all $\round \geq 0$, with probability at least $1-\conlevel$. Third, by the triangle inequality for two consecutive instances of the sequence of play $\pstate_{\play,\round},\pstate_{\play,\round+1}$ for any player $\play\in\players$ it holds: \begin{equation}\label{eq:closeness-per-round} |\pstate_{\play a,\round+1 } -\pstate_{\play a,\round }|+|\pstate_{\play b,\round+1 } -\pstate_{\play b,\round }|< \bigoh(\eps) \text{ with probability } 1-\conlevel \end{equation} Consider $\eps$ sufficiently small, such that the probabilities of the strategies that belong to the support of the equilibrium are bounded away from $0$, for all the points of the neighborhood. Since $\theta_\play$ is continuously differentiable in $(0,1]$, the differences described in \cref{Main:Useful Expression} are bounded from $\bigoh\parens{\eps}$ due to \cref{eq:closeness-per-round}. Thus, if the sequence of play $\curr$ is contained to an $\eps-$neighborhood of $\eq$, then the difference of the feedback, for any player $\play\in\players$, to two strategies of the equilibrium is $\bigoh\parens{\eps/\step_\round}$ with probability at least $1-\conlevel$: \[ \probof{ \abs{\npayv_{\play a,\round} - \npayv_{\play b,\round}}= \bigoh\parens{\eps/\step_\round}\given\filter_\round} \geq 1-\conlevel \] However, from assumption \ref{asm:degen} for a fixed round $\round$ and some player $\play\in\players$, there exist $\noiselb,\problb>0$ such that: \( \probof{\abs{\npayv_{\play a,\round} - \npayv_{\play b,\round}}\geq \noiselb\given\filter_\round} = \problb>0. \) Thus by choosing $\eps=\bigoh(\noiselb \step_\round )$ and $\delta=\problb/2$, we obtain a contradiction and our proof is complete. \section{Discussion} The equivalence between strict \aclp{NE} and stable attracting states of feedback-limited \eqref{eq:FTRL} implies that any equilibrium that exhibits payoff-indiffirence between different strategies is inherently unstable. This fragility has already been remarked from an epistemic viewpoint \cite{vD87}, and our results provide a complementary justification based on realistic models of learning. In the converse direction, the generality of the feedback models considered also provides a template for proving stochastic asymptotic stability results in more demanding learning environments. A particular case of interest arises in online ad auctions where payoffs are observed with delay (or are dropped completely): depending on the delay, the estimation of the player's payoff could exhibit a bias relative to the sampling strategy, and our generic conditions provide an estimate of how large the delays can be before convergence breaks down. This opens the door to an array of fruitful research directions that we intend to pursue in the future.
\section{Introduction} Radiation processes are critical in many aspects of the evolution of astrophysical objects such as stellar atmospheres, magnetospheres and discs. Electromagnetic radiation carries the history of the emitting object to the observer at which point the object is analysed. Through spectroscopy we can deduce fundamental parameters, abundances and unveil the complex atmospheric dynamics of many stellar objects, often via comparison with numerical models. These numerical models require the solution of the radiative transport equation in complex and different plasma conditions. In many astrophysical applications matter and radiation are coupled : This is the so-called non-local thermodynamic equilibrium (non-LTE) line formation problem. At non-LTE, the atomic level populations are computed from a set of statistical equilibrium equations where radiation plays the central role. In turn, knowledge of emission and absorption processes, which depends on the level populations, is needed to solve for radiation. Therefore, the radiative transport equation must be solved simultaneously with statistical equilibrium equations. This makes the solution of the non-LTE problem challenging. Identifying the best solution to that problem depends mainly on the nature of the simulated plasma and many types of solutions exist \citep[e.g.][]{Zadelhoff2002}. In this paper, we present MCFOST-art, a code for the solution of the non-LTE problem for multilevel atomic systems. The code is embedded in the 3D radiative transfer code MCFOST \citep{Pinte2006,Pinte2009} and can be applied to a wide range of astrophysical problems in different geometries. Our main motivation for developing such a code is to address the line formation in the close environment of young stellar objects (YSO). In particular, the evolution of classical T Tauri stars depends on the interaction between the young star and its accretion disc, on distances of a few stellar radii. This complex interaction leads to stellar winds and magnetospheric accretion and ejection processes. These processes have a strong impact on spectral lines and disentangling their typical radiative signatures is a challenging task. Previous modelling of the environment of T Tauri stars, their magnetosphere \citep{Hartmann94, Muzerolle2001}, stellar wind, and disc wind regions \citep{Lima2010, Kurosawa2011} show the difficulty to account for all observational signatures of these stars, from their variability to the shape of emission lines. Even a detailed modelling of a specific T~Tauri star, with the most updated magneto-hydrodynamics (MHD) models, results in a marginal agreement between synthetic observables and observations \citep{Alencar2012}. Most of magnetospheric emission lines synthesis used the Sobolev approximation \citep{Sobolev57,Rybicki78} to solve the radiative transfer equation. This approximation is applicable when large velocity gradients (i.e. large compared to the intrinsic width of atomic lines) are encountered in a plasma. It greatly simplifies the solution of the transfer equation. However, in the case of magnetospheres, the required conditions for the Sobolev approximation to hold are not always met, ultimately impacting the level populations. In our code, we use an accelerated $\Lambda$-iteration method \citep{ali_fundation} with a preconditioning of the statistical equilibrium equations \citep{RybickiHummer1991} to solve the coupled radiative transfer and statistical equilibrium equations. Unlike the Sobolev approximation, our approach does not make any assumptions about the local conditions in the plasma. We tested MCFOST-art on 1D spherically symmetric models including a range of thermodynamic quantities to capture a variety of physical conditions existing in stellar plasma. In \S \ref{physical_model} we give the details of the physical problem and how it is solved. In \S \ref{impl_mcfost} we describe the implementation of our code in MCFOST, and in \S \ref{benchmarks} we test the accuracy and precision of our code against benchmark cases. Finally, we give our conclusions in \S \ref{conclusion}. \section{Non-NLTE radiative transfer problem}\label{physical_model} In multilevel non-LTE problems, the main difficulty is to find a self-consistent solution of the equations for the atomic level populations with a solution of the transport equation for radiation. In this section we describe the coupling between these equations. \subsection{Radiative transfer equation}\label{sect:RTE} The unpolarised radiative transfer equation along a ray of length $ds$ in the direction $\mathbf{n}$ is written as \begin{equation}\label{eq:RTE} \dfrac{dI ({\nu},\mathbf{n})}{ds} = -\chi ({\nu},\mathbf{n}) I ({\nu},\mathbf{n}) + \eta ({\nu},\mathbf{n}) \end{equation} where, $I ({\nu},\mathbf{n})$ is the specific intensity at a frequency $\nu$ in the direction $\mathbf{n}$, $\chi$ is the total (line and continuum) opacity (true absorption and scattering $\sigma$), and $\eta$ is the emissivity. We use the formulation of \cite{RybickiHummer92b} to express the radiative transfer equation, and we define the radiative transfer coefficients $U_{\l \lprime}$ and $V_{\l \lprime}$ as \begin{equation}\label{eq:RTCl} \left. \begin{array}{l} U_{\l \lprime}(\nu, \mathbf{n}) = \dfrac{h\nu}{4\pi} A_{\l \lprime} \psi (\nu, \mathbf{n}) \text{~if~$\l>\lprime$} \\\\ V_{\l \lprime}(\nu, \mathbf{n}) = \dfrac{h\nu}{4\pi} B_{\l \lprime} \phi (\nu, \mathbf{n}) \end{array} \right. \text{,} \end{equation} where $A_{\l \lprime}$ and $B_{\l \lprime}$ are the Einstein's coefficients and $\phi (\nu, \mathbf{n})$ and $\psi (\nu, \mathbf{n})$ the absorption and the emission profiles, respectively, for the transition $i \to j$\footnotemark. We further assume complete frequency redistribution, implying an equivalence between the absorption coefficient appearing in $V_{\l \lprime}$ and the emission coefficient appearing in $U_{\l \lprime}$, that is $\psi (\nu, \mathbf{n})= \phi(\nu, \mathbf{n})$. For a continuum transition the radiative transfer coefficients are given by \footnotetext{We adopt the following convention: $j$ and $i$ refer to the upper and lower levels of a transition, respectively. For atomic levels ordered by increasing energies, $E_{\ell}$, this implies $E_{j} > E_{i}$. In other cases, when the ordering of levels is unimportant, we use the indexes $\l,\,\lprime,\, \lprimeprime$...} \begin{equation}\label{eq:RTCc} \left. \begin{array}{l} U_{\l \lprime} = \alpha_{\l \lprime} (\nu) (\dfrac{n_{\lprime}^\ast}{n_\l^\ast}) \dfrac{2h\nu^3}{c^2}e^{-h\nu/kT} \text{~if~$\l>\lprime$} \\\\ V_{\l \lprime} = \alpha_{\l \lprime} (\nu) (\dfrac{n_{\lprime}^\ast}{n_\l^\ast})e^{-h\nu/kT} \text{~if~$\l>\lprime$}\\\\ V_{\l \lprime} = \alpha_{\l \lprime} \text{~if~$\l<\lprime$} \end{array} \right. \text{,} \end{equation} where $\alpha(\nu)$ is the photoionisation cross-section, $T$ the gas temperature, and $n_{\l}^\ast$ the population (number density) of level $\l$, evaluated at local thermodynamic equilibrium (LTE). Finally, the emissivity $\eta_{ij}$ and the opacity $\chi_{ij}$ for a transition between an upper level $j$ and a lower level $i$ are written as \begin{equation}\label{eq:opacity} \left. \begin{array}{l} \chi_{ij}(\nu, \mathbf{n}) = n_i V_{ij}(\nu, \mathbf{n}) - n_j V_{ij}(\nu, \mathbf{n})\\ \eta_{ij}(\nu, \mathbf{n}) = n_j U_{ji}(\nu, \mathbf{n}) \end{array} \right. \text{,} \end{equation} where $n_i$ and $n_j$ are the lower and upper level populations, respectively. The total opacity and emissivity for all transitions of all atoms and other sources of opacity add up to the total opacity $ \chi(\nu, \mathbf{n})$ and emissivity $ \eta(\nu, \mathbf{n})$, \begin{equation}\label{eq:opacityTot} \left. \begin{array}{l} \chi(\nu, \mathbf{n}) = \displaystyle\sum \limits_{j, i<j} n_i V_{ij}(\nu, \mathbf{n}) - n_j V_{ij}(\nu, \mathbf{n}) + \chi_c\\ \eta(\nu, \mathbf{n}) = \displaystyle\sum \limits_{j, i<j} n_j U_{ji}(\nu, \mathbf{n}) + \eta_c \end{array} \right. \text{,} \end{equation} where $\eta_c$ and $\chi_c$ are the sources of continuous emissivity and opacity evaluated at LTE (the background opacity, see \S \ref{backgr_opac}). The solution of Eq. \ref{eq:RTE} along a ray of length $ds$ is straight forward if $\chi$, $\eta$, the populations $n$, and the properties of the atmosphere (temperature, velocity fields, etc...) are known. Defining the optical depth $\tau \coloneqq \tau(\nu, \mathbf{n}; s)$ as $d\tau (\nu, \mathbf{n}) = -\chi(\nu, \mathbf{n}; s)\,ds$ it reads: \begin{equation}\label{eq:RTEsol} I(\nu, \mathbf{n}; \tau_{2}) = I(\nu, \mathbf{n}; \tau_{1}) e{^{-(\tau_2 - \tau_1)}} + \displaystyle\int\limits_{\tau_1}^{\tau_2} S(\nu, \mathbf{n};\tau)\,e{^{-(\tau-\tau_1)}} d\tau \text{,} \end{equation} where $S(\nu, \mathbf{n}; \tau) = \dfrac{\eta (\nu, \mathbf{n}; \tau)}{\chi (\nu, \mathbf{n}; \tau)}$ is the source function at optical depth $\tau$, at the frequency $\nu$ in the direction $\mathbf{n}$. In general, the emissivity and opacity depend on the level populations which in turn depend on the intensity. Therefore, a self-consistent solution of the radiative transfer equation with a solution of statistical equilibrium equations is required, the so-called non-LTE problem. \subsection{$\Lambda -$iteration} The solution of Eq. \ref{eq:RTE} can be recast as \begin{equation}\label{eq:Lambda1} I(\nu, \mathbf{n}) = \Psi(\nu, \mathbf{n}) [\eta (\nu, \mathbf{n})]\text{,} \end{equation} where $\Psi$\footnotemark is a matrix operator whose elements depend on the level populations \citep[for more details see e.g. ][hereafter, HM14]{HubenyMihalas2014}. \footnotetext{It is common in radiative transfer problems to see the $\Lambda$ operator when it comes to "$\Lambda -$iteration". The relation between the $\Psi$ and $\Lambda$ operators is given in \cite{RybickiHummer1991} as $\Psi = \Lambda / \chi$.} This equation gives the solution of the intensity if all elements of the $\Psi$ operator, which are functions of the atomic populations, are known. However, in practice, building the full $\Psi$ operator is never affordable and the emissivity appearing in Eq. \ref{eq:Lambda1} is substituted by an old value $\eta^{\dagger}$ evaluated from a known estimate of the level populations (i.e. old values obtained with a previous iteration). The new intensity obtained by the application of the operator on the old emissivity is then used to compute a new value of the level populations and of the emissivity, which are used to compute a new value of the intensity. This iterative process, between old and new values of the populations, is known as $\Lambda-$iteration and it is repeated until convergence. Although $\Lambda-$iteration is very efficient in an optically thin region, it suffers convergence problems in very optically thick regions. This drawback of classical $\Lambda-$iteration can be overcome by a slight modification of Eq. \ref{eq:Lambda1} \citep[see][]{Cannon73a,Cannon73b,Scharmer81,ali_fundation}, that is recasting Eq. \ref{eq:Lambda1} in \begin{equation}\label{eq:Lambda2} I(\nu, \mathbf{n}) = (\Psi(\nu, \mathbf{n}) - \Psi^{\ast}(\nu, \mathbf{n})) [\eta^{\dagger} (\nu, \mathbf{n})] + \Psi^{\ast}(\nu, \mathbf{n}) [\eta (\nu, \mathbf{n})] \text{,} \end{equation} with an approximate operator $\Psi^{\ast}(\nu, \mathbf{n})$ built from a subset of the original operator. Equation \ref{eq:Lambda2} improves the convergence of the classical $\Lambda$-iteration method in optically thick regions and has been named ALI for accelerated $\Lambda$-iteration (after the work of \citet{Hamann85} and \citet{WernerHusfeld85}). In most applications, the diagonal of the full operator is used, although other studies recommended a tri-diagonal approximate operator \citep[see for instance ][]{Hennicker2018}. Higher order approximate operators can improve the convergence of the radiative transfer problem at the price of computational time and memory storage. For 2D radiative transfer problems, \cite{Auer94} suggested to use the diagonal part of the operator in combination with an algorithm to accelerate the convergence (see \S \ref{acceleration}). In our code, we use the diagonal part of the full operator as a compromise between speed and accuracy. \subsection{Statistical equilibrium equations}\label{sect:SEE} The level populations of an atom in a stellar plasma is a function of the rates of transitions populating or depopulating a given level. These rates in turn are a function of level populations, collisions, and radiation. The statistical equilibrium equations (SEE) for level $\l$ is given by\footnotemark \begin{equation}\label{eq:SEE} \displaystyle\sum \limits_{\lprime}^{} n_\lprime (C_{\lprime \l} + R_{\lprime \l}) = n_\l \displaystyle\sum \limits_{\lprimeprime}^{} (C_{\l \lprimeprime} + R_{\l \lprimeprime}) \text{,} \end{equation} where $n_{\l}$ is the population of level $\l$, and $C_{\lprime \l}$, and $R_{\lprime \l}$ the collisional and radiative rates for a transition between level $\lprime$ and $\l$, respectively. \footnotetext{We neglect both the advective and non-stationary terms as they are in general negligible for non-relativistic flows.} \subsubsection{Radiative rates} Unlike collisional rates, radiative rates are a product of the radiative transfer code. These rates can be expressed in terms of the radiative transfer coefficients and are written as \begin{equation}\label{eq:RR} R_{\l \lprime}= \displaystyle\int d\Omega \displaystyle\int \dfrac{d\nu}{h\nu} \{ U_{\l \lprime}(\nu,\mathbf{n}) + V_{\l \lprime}(\nu,\mathbf{n}) I(\nu,\mathbf{n})\} \text{,} \end{equation} where the integration is carried out over frequency $\nu$ and all solid angles $\Omega$. For line transitions these rates are written as \begin{equation}\label{eq:RRl} \left. \begin{array}{l} R_{ij}= B_{ij} \mathcal{\overline{J}} \\ R_{ji}= A_{ji} + B_{ji} \overline{\mathcal{J}} \\ \end{array} \right. \text{,} \end{equation} where $B_{ij}$, $B_{ji}$, and $A_{ji}$ are the Einstein's coefficients, and $\overline{\mathcal{J}} $ the mean intensity integrated over the line given by \begin{equation}\label{eq:Jbar} \overline{\mathcal{J}} = \displaystyle\int \dfrac{d\Omega}{4\pi} \displaystyle\int d\nu\, I(\nu, \mathbf{n})\phi (\nu, \mathbf{n}) \text{,} \end{equation} where $\phi (\nu, \mathbf{n})$ is the line absorption profile, also appearing in Eq. \ref{eq:RTCl}. For continuum transitions they are as follows: \begin{equation}\label{eq:RRc} \left. \begin{array}{l} R_{ij}= \dfrac{4\pi}{h} \displaystyle\int d\nu\, \alpha_{ij} (\nu) \mathcal{J}(\nu)\\ R_{ji}= \dfrac{4\pi}{h}\dfrac{n_{i}^{\ast}}{n_{j}^{\ast}} \displaystyle\int d\nu\, \alpha_{ij}(\nu) e^{-h\nu/kT} \{\dfrac{2h\nu^3}{c^2} + \mathcal{J}(\nu)\}\\ \end{array} \right. \text{,} \end{equation} where $\mathcal{J}(\nu)$ is the mean radiation field given by \begin{equation}\label{eq:Jmean} \mathcal{J}(\nu) = \displaystyle\int \dfrac{d\Omega}{4\pi} \, I(\nu, \mathbf{n}) \end{equation} \subsubsection{Matrix form of the SEE} Starting from Eq. \ref{eq:SEE}, passing the right-hand side term on the left-hand side and noticing that $n_l = \displaystyle\sum \limits_{\lprime}^{} n_\lprime \delta_{\l \lprime}$ with $\delta_{\l \lprime}$ non-zero only for $\lprime=\l$, we can factorise out $\displaystyle\sum \limits_{\lprime}^{} n_\lprime$ and write the SEE as \begin{equation}\label{eq:SEE2} \displaystyle\sum \limits_{\lprime}^{} n_\lprime \Gamma_{\lprime \l} = 0 \text{,} \end{equation} where the rate matrix $\Gamma_{\lprime \l}$ is \begin{equation}\label{eq:Gamma} \Gamma_{\lprime \l} = R_{\lprime \l} + C_{\lprime \l} - \delta_{\l \lprime} \displaystyle\sum \limits_{\lprimeprime}^{} \{ R_{\l \lprimeprime} + C_{\l \lprimeprime} \} \end{equation} \subsection{MALI method} Multilevel radiative transfer is a complex problem to solve because of the dependence of the radiation field on the populations, and of the populations on the radiation field. Using Eqs.\ref{eq:Lambda2} and \ref{eq:RR} the rate matrix in Eq. \ref{eq:Gamma} for a multilevel atom reads: \begin{equation}\label{eq:Gamma1} \begin{split} \Gamma_{\lprime \l} = C_{\lprime \l} + \displaystyle\int d\Omega \displaystyle\int \dfrac{d\nu}{h\nu} \{ U_{\lprime \l} + V_{\lprime \l}I_{\rm eff} (\nu, \mathbf{n}) \} \\ - \delta_{\l \lprime} \displaystyle\sum \limits_{\lprimeprime}^{} [ C_{\l \lprimeprime} + \displaystyle\int d\Omega \displaystyle\int \dfrac{d\nu}{h\nu}\{ U_{\l \lprimeprime} + V_{\l \lprimeprime}I_{\rm eff} (\nu, \mathbf{n})\}] \\ - \displaystyle\int d\Omega \displaystyle\int \dfrac{d\nu}{h\nu} \displaystyle\sum\limits_{j>l}^{} (n_{l}V_{lj} - n_{j} V_{jl} ) \displaystyle\sum\limits_{i<\lprime}^{} \Psi^{\ast}(\nu, \mathbf{n})U_{\lprime i} \text{,} \end{split} \end{equation} where $I_{\rm eff} (\nu, \mathbf{n}) = I^{\dagger}(\nu, \mathbf{n}) - \Psi^{\ast}(\nu, \mathbf{n}) \eta^{\dagger}(\nu, \mathbf{n}) $ is an effective radiation field built with known quantities (old values). In Eq. \ref{eq:Gamma1} we assumed that background opacities are constant within subsequent iterations. The system of equations \ref{eq:SEE2} is nonlinear in the new populations as it involves the product of the form $ \propto n_{\l} \times n_{\lprime}$ in Eq. \ref{eq:Gamma1}. The multilevel accelerated lambda iteration method (hereafter, MALI) proposed by \cite{RybickiHummer1991}, latter improved by \cite{Uitenbroek2001}, uses the operator splitting method and a full preconditioning to make Eqs. \ref{eq:SEE2} and \ref{eq:Gamma1} linear in the new populations. The coupled equations of statistical equilibrium with the radiation field are finally written as follows: \begin{equation}\label{eq:Gamma2} \begin{split} \displaystyle\sum \limits_{\lprime}^{} n_\lprime C_{\lprime \l} + \displaystyle\sum \limits_{\lprime}^{} n_\lprime \displaystyle\int d\Omega \displaystyle\int \dfrac{d\nu}{h\nu} \{ U_{\lprime \l}^{\dagger} + V_{\lprime \l}^{\dagger}I_{\rm eff} (\nu, \mathbf{n}) \} \\ - \displaystyle\sum \limits_{\lprime}^{} n_\lprime \delta_{\l \lprime} \displaystyle\sum \limits_{\lprimeprime}^{} [ C_{\l \lprimeprime} + \displaystyle\int d\Omega \displaystyle\int \dfrac{d\nu}{h\nu}\{ U_{\l \lprimeprime}^{\dagger} + V_{\l \lprimeprime}^{\dagger}I_{\rm eff} (\nu, \mathbf{n})\}] \\ - \displaystyle\sum \limits_{\lprime}^{} n_\lprime \displaystyle\int d\Omega \displaystyle\int \dfrac{d\nu}{h\nu} \displaystyle\sum\limits_{j}^{} (n_{l}^{\dagger}V_{lj}^{\dagger} - n_{j}^{\dagger} V_{jl}^{\dagger} ) \displaystyle\sum\limits_{i<\lprime}^{} \Psi^{\ast}(\nu, \mathbf{n})U_{\lprime i}^{\dagger} = 0 \end{split} \end{equation}% The last term in Eq. \ref{eq:Gamma2}, which disappears in the classic $\Lambda$-iteration \cite[][]{RybickiHummer92b,Uitenbroek2001} is called the cross-coupling term. From Eq. \ref{eq:opacity} the term $\displaystyle\sum\limits_{j}^{} (n_{l}^{\dagger}V_{lj}^{\dagger} - n_{j}^{\dagger} V_{jl}^{\dagger} )$ represents a summation over all opacities of all transitions with a plus sign if $l < j$ or a minus sign if $l>j$, that is $\displaystyle\sum\limits_{j>l}^{} \chi_{lj}^{\dagger} - \displaystyle\sum\limits_{j<l}^{} \chi_{jl}^{\dagger}$. \subsection{Coherent electron scattering}\label{cohes} In some cases electron scattering is a dominant source of opacity and its effect on both the continuum and spectral lines has to be taken into account \citep{Hillier91}. However, the evaluation of the scattering emissivity involves the calculation of a scattering integral whose expression in the observer's frame is not trivial \citep{RybickiHummer94}. We evaluate the electron scattering emissivity by setting it to the mean intensity (coherent approximation), which is in turn determined iteratively through classical $\Lambda$-iterations, as suggested by \cite{RybickiHummer92b}. This method is accurate enough for the main range of applications of the code, but becomes inaccurate for hot stellar wind where the electron density is very high and the ratio of scattering to true absorption is large. \subsection{Level dissolution and occupation probability} To do reliable radiative transfer simulations it is necessary to allow for line overlap and merging close to series limits. The MALI formulation of the non-LTE problem is already capable of dealing with overlapping lines, and we include the formalism of occupation probabilities of \cite{HummerMihala88} to allow for lines to merge at the series limits. Because of the presence of perturbers, each bound state $i$ of an atom has a probability $w(i)$, with respect to the same state of a similar isolated atom, to remain bound. Conversely, $1-w(i)$ represents the probability of state i to be dissolved, in other words, to belong to the continuum states. Dissolved states contribute to a pseudo-continuum opacity beyond the series limits. Our implementation of the occupation probabilities formalism is similar to that of \cite{Hubeny94}, based on the work of \cite{Dappen87}, and summarised in \cite{HillierMiller98}. We further assume, as in \cite{HillierMiller98}, that if $w(i)$ is the probability of level $i$ to be undissolved and $w(j)$ this probability for level $j$, then if $j$ is undissolved, $i$ is necessarily undissolved as it lies in a lower energy state. Therefore, all upward rates in the statistical equilibrium equations have to be multiplied by $w(j)/w(i)$, the probability that the upper level $j$ is undissolved given $i$ is undissolved. In \S \ref{star_continuum} the impact of level dissolution on stellar continua is shown. \subsection{Acceleration of the convergence}\label{acceleration} To speed up the MALI method we implemented the method of acceleration of \cite{Ng_acc} with general orders as defined in \cite{Auer94} and \cite{Uitenbroek2001}. This method uses $N_{sol} + 2$ previous solutions and accumulated iteration after iteration to extrapolate the new value of the solution by minimising the residual between the previous iterations. The latter step is called Ng's iteration. When using Ng's accelerations, it is important to impose a delay before accumulating solutions, as extrapolating the new solution too early may result in negative or inconsistent values. Following \cite{Auer94}, we recommend doing some MALI iterations between each extrapolation to let the solution settle down. Therefore, after $N_{start}$ MALI iterations (i.e. without acceleration), we start accumulating $N_{sol} + 2$ solutions up to the Ng's iteration. We repeat this process every $N_{pending}$ MALI iterations. In our tests, we use $N_{sol} = 2$, $N_{start} = 5$ and $N_{pending} = 5$. We note that setting $N_{pending}$ to 0 mainly results in extra overhead due to the matrix inversion required in the minimisation procedure \citep[see for instance][]{Uitenbroek2001}. The main drawback of Ng's acceleration for multidimensional models is the memory required to store $N_{sol} + 2$ solutions for each atom treated in non-LTE. Following \cite{Auer94}, using a diagonal operator in addition to Ng's iterations is a good compromise between speed (of convergence) and memory requirements in multidimensional models. Whereas in 1D geometry memory storage is usually not a limitation, we discuss the practicability of Ng's acceleration scheme in multidimensional models in a future paper. \section{Implementation in MCFOST }\label{impl_mcfost} The formulation of the non-LTE line transfer of \cite{RybickiHummer92b}, although developed for 1D grids, can be easily adapted for multidimensional models. \cite{Auer94} applied the MALI method to a 2D Cartesian grid, while \cite{HB14_3Dnlte} applied it to a 3D spherical grid. Recently, \cite{DeCeuster2020} applied the method to an unstructured grid. MCFOST-art, which stands for MCFOST atomic radiative transitions, is an ensemble of modules implemented in MCFOST \citep{Pinte2006,Pinte2009}. A 3D radiative transfer code, MCFOST is written in modern Fortran, dedicated to the modelling of dust emission and molecular lines in the environment of young stars (e.g. protoplanetary discs, circumstellar envelopes). This code has been coupled with SPH codes \citep[e.g.][]{Price2018} and MHD codes \citep[e.g.][]{coupling_mcfost_pluto1}. Currently MCFOST handles three types of grids: a cylindrical grid dedicated to the modelling of discs, a spherical grid, and an unstructured grid based on a Voronoi tessellation \citep[see e.g.][]{Camps2013}. The solution of the line transfer equation is done by ray-tracing: several rays are propagated in specific directions along which Eq. \ref{eq:RTE} is solved for each wavelength simultaneously. In our new modules, we propagated rays from each cell centre (spatial grid units in 2D and 3D geometries) in directions defined by the angular quadrature scheme (see below). Cells represent the smallest resolution elements of the code and all quantities are constant within them. If the model has a non-zero velocity field, the velocity is projected in the direction of propagation of the ray. When velocity fields are present, it is important to maintain a proper spatial discretisation to prevent nonphysical features due to large velocity gradients \citep{Ibgui2013}. The MCFOST code detects if the projected velocity between two grid points is too large and linearly interpolates the projected velocity accordingly. To produce images, we solved the intensity out of each pixel by integrating Eq. \ref{eq:RTE} along rays centred on each pixel. The solution of Eq. \ref{eq:RTE} along a ray, specified by a vector direction $\mathbf{n}$, is written as \begin{equation}\label{eq:RTEmcfost} I_{0} (\nu, \mathbf{n}) = I_{b} (\nu, \mathbf{n})\,e^{-\tau_{tot}(\nu, \mathbf{n})} + \displaystyle\sum\limits_{k}^{} S_{k} (\nu, \mathbf{n}) \, (1 - e^{-d\tau_{k}(\nu, \mathbf{n})})\, e^{-\tau_{k}(\nu, \mathbf{n})} \text{,} \end{equation} where $I_{0} (\nu, \mathbf{n})$ is the emerging specific intensity in a given direction; $I_{b} (\nu, \mathbf{n})$ is the intensity at the inner boundary of the model, typically this is the stellar radiation if a ray intersects the star; $\tau_{tot}$ is the total optical depth from the boundary to the observer; $S_k$ the source function for cell k; and $\tau_{k}$ the optical depth at the inner (entrance) boundary of a cell. In Eq.~\ref{eq:RTEmcfost}, the sum represents the contribution of each cell, along the ray path, to the outgoing radiation. The term $d\tau_k = \tau_{k+1} - \tau_{k} = \chi_k \, s$ is the optical depth accumulated by the ray as it travels a distance $s$ inside a cell of opacity $\chi_k$. The intensity outgoing in direction $\mathbf{n}$ from a specific cell, after travelling a distance $s(k+1) - s(k)$ in the cell is written as \begin{equation}\label{eq:RTEcell} \begin{split} I_{k+1} (\nu, \mathbf{n}) = I_{k} (\nu, \mathbf{n}) \,+ S_{k} (\nu, \mathbf{n}) \,(1 - e^{-d\tau_{k}(\nu, \mathbf{n})})\, e^{-\tau_{k}(\nu, \mathbf{n})} \text{,} \end{split} \end{equation} The approximate operator $\Psi^{\ast}$ appearing in eqs. \ref{eq:Lambda2} and \ref{eq:Gamma2} is evaluated by solving the transfer equation with a source function, which is 1 at cell k and 0 elsewhere, that is $S_k = \delta(\tau - \tau_k)$. According to Eq. \ref{eq:RTEcell}, this is given by \begin{equation}\label{eq:PsiOpk} \Psi^{\ast}_k (\nu, \mathbf{n}) = (1 - e^{-d\tau_{k}(\nu, \mathbf{n})})\,/\, \chi_{k}^{\dagger}(\nu, \mathbf{n}) \text{,} \end{equation} where the numerator is the diagonal of the $\Lambda$ operator, that is \begin{equation}\label{eq:lambdaOpk} \Lambda^{\ast}_k (\nu, \mathbf{n}) = (1 - e^{-d\tau_{k}(\nu, \mathbf{n})}) \end{equation} This satisfies the following conditions in the two extreme cases: in optically thin regions it is 0, which corresponds to classical $\Lambda$-iterations, and it approaches 1 in optically thick regions. Although this method allows for fast integration of the radiative transfer equation, it depends on the numerical resolution, compared to other methods that use linear or cubic interpolations between grid points. The part of the code that handles the propagation within the grid is presented in \cite{Pinte2006}. In the following, we present in some detail the solution of the non-LTE atomic line formation problem in the code. \subsection{Initial solution}\label{initial_cond} In MCFOST-art, there are currently two choices for the initialisation of the level populations of the non-LTE problem: populations are evaluated at LTE and populations are obtained by solving the SEE with the radiation field set to zero. The choice of the initial solution is the critical point of the non-LTE problem. If the initial guess is too far from the solution, the convergence can be slowed down or even fail. In the eventuality that none of these choices lead to convergence, we implemented the collisional-radiative switching method of \cite{Hummer_Voels88}. This method allows for a smooth transition between a collision dominated initial solution (i.e. at LTE) to a non-LTE initial solution. Alternatively, the populations from a previous calculation are given. \subsection{Line profiles} The absorption profile for each atomic bound-bound transition can either have a Gaussian or a Voigt shape. The choice of the shape of the absorption profile depends on the line and the problem. The width of the absorption profile, $v_{D}$, is given by the sum of the line thermal width and the microturbulence $\xi$ as follows: \begin{equation}\label{eq:vd} v_D = \sqrt{2 k_b T / m + \xi^2} \text{,} \end{equation} where $k_b$ is the Boltzmann constant, $T$ the temperature, and $m$ the mass of the atomic species. The damping parameter is the sum of the radiative damping and Van Der Waals and Stark broadenings. The radiative damping of a line transition $j \to i$, $\Gamma_j$, is computed by summing the Einstein $A_{ji}$ coefficients for all (allowed) transitions for which $j$ is an upper level as follows: \begin{equation}\label{eq:NaturalDamping} \Gamma_j = \displaystyle\sum\limits_{i<j} A_{ji} \end{equation} In the latter expression, we neglected the effect of stimulated emission. Pressure broadening takes into account van der Waals and Stark (linear and quadratic) broadenings computed in the Lindholm theory. We computed interaction constants using the Uns\"old formula \citep{Unsold1955} and evaluated the quadratic Stark broadening following \citet[][Eq. 11.33]{Gray2008}. Linear Stark broadening was computed following \cite{Sutton1978}. The treatment of the Stark broadening, especially for hydrogen lines is approximate and is only accurate for the first lines of each series. In the future, we plan to add a more accurate treatment of the Stark broadening \citep[see e.g.][]{Stehle99}. \subsection{Wavelength grid}\label{waves_grid} The wavelength grid used for non-LTE calculations was built from individual atomic transitions. Firstly, we set up a grid of continuum transitions at a moderate resolution. This continuum grid was used to solve the continuum radiative transfer equation. Secondly, lines were gathered in groups depending on their bounds (i.e. overlapping regions). Line bounds range from $-V$ to $+V$, where $V$ is a multiple of the line Doppler width (Eq. \ref{eq:vd}). The line bounds represent the interaction zone of the line with the radiation field. Since in moving atmosphere a line feels the radiation from different regions, the line bounds include the maximum shift in frequency due to the velocity fields. However, the local (i.e. in the co-moving frame) line profile is not affected by velocity fields. Each group of lines was sampled with a constant resolution in kilometers per second. Once wavelength grids for each group were determined, they were merged and continuum points from the continuum grid were added outside line groups. \subsection{Background opacity}\label{backgr_opac} Opacity and emissivity of transitions were computed for each atom using Eqs. \ref{eq:opacity}, \ref{eq:RTCl}, and \ref{eq:RTCc}. The photoionisation cross-section of hydrogen-like ions was computed using Kramer's formula with correction from quantum mechanics (HM14, Eq. 7.92). For non-hydrogen-like ions, the photoionisation cross-section was directly read from the atomic file and interpolated on the wavelength grid of MCFOST. We took the photoionisation data from TOPbase\footnotemark \citep{topbase}. \footnotetext{\url{http://cdsweb.u-strasbg.fr/topbase/topbase.html}} We also included continuum transitions from other sources which add up in $\chi_c$. These are Thomson scattering on free electrons, hydrogen free-free (HM14, Eq. 7.100), and \textsc{H$^{{\rm-}}$} free-free and bound-free transitions from \cite{John1988}. \subsection{Non-LTE loop}\label{nonLTE_loop} The main module of our code deals with solving Eq. \ref{eq:SEE2} simultaneously with Eq. \ref{eq:RTE} via the non-LTE loop. Figure \ref{fig:flowchart} shows the main steps leading to the solution of the non-LTE problem with MCFOST-art. We stress that even if Eq. \ref{eq:SEE2} is solved locally (i.e. within each cell) it is coupled with other cells through Eq. \ref{eq:RTE}. Firstly, the code reads abundances for the atomic species under consideration, the corresponding atomic data (e.g. energy levels $E_i$ and the oscillator strength $f_{ij}$), and an atmospheric model (temperature, densities, and velocity fields). The electron density is evaluated at LTE if not present in the model (for more detail on electron density loop, see sect. \ref{sect:electron}). Secondly, MCFOST-art initialises the level populations of each atom as described above. Finally, we evaluate continuous background opacities. In models in which electron scattering is an important source of opacity, the continuum mean intensity and the corresponding Thomson scattering emissivity are computed with the ALI method (for more details, see chapter 13 of HM14). Once background opacities have been evaluated, the non-LTE loop starts. It computes a self-consistent solution for level populations and radiative transfer equations. For each cell, the rate matrix $\Gamma_{\lprime \l}$ is built for a set of rays, for all wavelengths simultaneously. Once the rate matrix is known, a new value of the level populations is determined. Electron densities can be evaluated with the new values of the non-LTE populations. To avoid convergence issues, the evaluation of the electron density can be done every N iterations of the non-LTE loop. The new populations are then compared to the previous populations using the following criterion of convergence: \begin{equation}\label{eq:convergence} \dfrac{\delta n}{n} = \| 1 - \dfrac{n^{\dagger}}{n} \| < \epsilon \text{,} \end{equation} where $\epsilon$ is a user defined convergence threshold. The threshold $\epsilon$ is usually chosen between 10$^{-3}$ - 10$^{-4}$. If the maximum relative changes for each cell and each atom is below the convergence threshold the non-LTE loop stops. Otherwise, a new iteration starts with the previously computed populations. Excitation and ionisation temperatures for each transition of each atom are also checked for convergence. In general, transition temperatures converge faster than level populations. \begin{figure*} \centering \includegraphics[width=0.8\textwidth]{flowchart.pdf} \caption{Flow chart of MCFOST-art. See \S \ref{nonLTE_loop} for more details. The green arrows indicate the main iterative loop. The double grey arrow indicates that the electron density loop is iterated within the main iterative loop and with the current estimates of the non-LTE populations.} \label{fig:flowchart} \end{figure*} \subsection{Electron density}\label{sect:electron} Electron densities for a gas mixture of hydrogen and metals cannot be determined analytically. The populations of atomic levels rely on the knowledge of the electron densities (for instance, through the Saha-Boltzmann equation at LTE). In turn, the electron density is a function of the population of atomic levels through their ionisation fraction. Therefore, electron densities have to be determined iteratively. Starting from an initial guess for the electron density, the populations of atomic levels are derived and the new ionisation fractions $f_{is}$ for level $i$ in the ionisation stage $s$ for each electron donors are evaluated. Then, from the new ionisation fractions, electron densities are computed. This iterative procedure is repeated until the relative change in electron densities drops below $10^{-6}$. In our code we use a linearisation procedure similar to Eq. 17.88 of HM14. The initial guess for the electron density is given by the ionisation of hydrogen plus one metal (M) $n_e^0 = n_e(\textsc{H}) + n_e(\textsc{M})$. Hydrogen ionisation yields \begin{equation}\label{eq:neH} n_e(\textsc{H}) = (\sqrt{n_H \,\phi_H + 1}-1)/\phi_H \text{,} \end{equation} and the metal ionisation \begin{equation}\label{eq:neM} n_e(\textsc{M}) = (\sqrt{\alpha_M\, n_H\,\phi_M +\dfrac{1}{4}\,(1+\alpha_M)^2} - \dfrac{1}{2}\,(1+\alpha_M) ) / \phi_M \text{,} \end{equation} where $n_H$ is the total number of hydrogen atoms, $\phi_x$ the Saha-Boltzmann factor for the ion x, and $\alpha_M$ is the abundance of the metal relative to hydrogen. \subsection{Collisional rates}\label{sect:Collision} The evaluation of the collisional rates appearing in the SEE (Eq. \ref{eq:SEE}) is cumbersome. It generally requires collision calculations with quantum mechanics for which look-up tables of collisional rates are available now \citep{Barklem2016a}. However, analytical and semi-analytical recipes exist for faster evaluation of the collision matrix $C_{ji}$ (which is proportional to the collisional rates within a factor). We consider collisional excitation and ionisation by electrons for hydrogen atoms using \cite{Johnson1972}. For collisional excitation of metals (and helium) by electrons we use van Regemorter's fomula \citep{Regemorter1962} and the impact parameter method \citep{Seaton1962}. For ions, we follow Eq. 34 of \cite{Landolt-Bornstein-v2} and, for neutrals, we follow \cite{Seaton1962}. For collisional ionisation by electrons, we use Eq. 9.60 of HM14 and for collisions with hydrogen atoms, we use Drawin's formula (Eq. 9.62 of HM14). \subsection{Quadratures}\label{angle_quad} One of the cornerstones in solving the SEE is the evaluation of the integrals appearing in Eq. \ref{eq:RR}. In the following, we describe how we performed wavelength and angular integrations. Angular quadrature for molecular lines transfer in MCFOST is done with the Monte Carlo method. For atomic lines, we used a set of fixed directions and weights uniformly distributed on the unit sphere such that integration over the sphere gives $4 \pi$. We used the directions and weights of type A quadratures from B. Carlson (whose calculations are described in \cite{Bruls99}) and the directions and weights from \cite{Stepan2020} for unpolarised radiation. These two types of quadrature points give similar results. By default we used type A quadrature of Carlson with 80 points sampling $4 \pi$ steradians \citep{Ibgui2013}. \cite{DeCeuster2020} used a similar angular quadrature method but with the quadrature points and weights determined by the HEALPix algorithm \citep{HEALPix}. For each cell of a model, starting from the centre of the cell (hereafter one point quadrature), the transfer equation is solved for all directions, while the radiative rates and the mean intensity are accumulated. Integrating the transfer equation from the centre of each cell may underestimate angular means and introduce some inaccuracy in the level populations because it only gives the mean intensity at that position. However, we do not know beforehand whether this inaccuracy is significant or not. Thus, we implemented two options to deal with this issue: first, several starting points for the angular quadrature scheme can be selected for each cell; and, second, Monte Carlo iterations can be done to properly sample each cell, in addition to the one point angular quadrature described above. In \S \ref{accurate_pops}, we discuss these two options. We replace the double integral appearing in Eq. \ref{eq:Jbar} by a sum over wavelength points and directions as follows: \begin{equation} \displaystyle\int \dfrac{d\Omega}{4\pi} \displaystyle\int d\nu\, I(\nu, \mathbf{n})\,\phi (\nu, \mathbf{n}) \equiv \displaystyle\sum\limits_{{\rm ray}} \omega_{{\rm ray}} \displaystyle\sum\limits_{\lambda} \omega_{\lambda} I(\lambda, {\rm ray})\,\phi (\lambda, {\rm ray} )\text{,} \end{equation} where $\omega_{{\rm ray}}$ is the weight of the angular quadrature for a given direction (or ray) and $\omega_{\lambda}$ the weight of a trapezoidal wavelength quadrature. In the case of a line transition, $\omega_{\lambda}$ includes the normalisation of the line profile. \section{Benchmarking the code}\label{benchmarks} The MCFOST code is intrinsically 3D, but in this paper we focus on 1D models that test the core of the method and allow us to validate our implementation with well-established 1D codes. While this is not the main application intended for our code, it also illustrates that MCFOST can now be used to generate a variety of stellar spectra. We will devote a forthcoming paper to the applications of our code to 2D and 3D geometries, with a particular emphasis on stellar magnetospheres. We used the codes TURBOspectrum \citep{turbospeccode} and RH \citep{Uitenbroek2001} as references for testing. The code MCFOST does not include a dedicated grid for 1D models, and we used the spherical grid instead. However, the spherical grid of MCFOST is log-scaled in the radial direction and cannot efficiently map the non-uniform grid from the 1D models. Therefore, for our benchmarks, we directly read the grid from the input models as RH and TURBOspectrum do. In that case, a cell is defined as the distance between two consecutive grid points. Because Eq. \ref{eq:RTE} is solved in MCFOST by summing up the intensity of each cell (i.e. spatial grid unit) weighted by the optical depth (see Eq. \ref{eq:RTEmcfost}), the solution is more dependent on the grid resolution (i.e. on the size of cells). On the contrary, RH and TURBOspectrum formal solvers typically interpolate the source function in the initial grid, resulting in a solution that is highly accurate. To mitigate the impact of a lack of resolution on the accuracy of the solution, we decreased the size of the cells by adding more points between each point of the initial models. The TURBOspectrum code is used to model spectra from cool evolved stars \citep{turbospectrum1,turbospectrum2} in synergy with the model atmosphere code MARCS \citep{MARCS2008}. This code works only at LTE but includes a wide library of molecules, the occupation probabilities formalism, and a proper treatment of hydrogen line broadening. To match the capabilities of our code, we slightly modified TURBOspectrum and removed molecular opacities, although, at the coolest temperature, neutral hydrogen density is dependent on the formation of molecules, such as \textsc{H}$_2$. The radiative transfer code RH is mainly used to model line formation in non-LTE conditions using the MALI method. Recent versions of RH have been used to model spectral lines taking into account the Zeeman effect and partial frequency redistribution in 3D cubes of the solar photosphere \citep{rh_stic}. Recently, \cite{Criscuoli2020} benchmarked the RH code and showed its ability to model the solar irradiance with a good agreement with observations. The RH and MCFOST codes use similar treatment of background opacities and both employ the MALI method to solve for level populations. We compared our treatment of background opacities and level dissolution at LTE with TURBOspectrum. We used RH for benchmarking the MALI method on the non-LTE formation of hydrogen lines. We used the (1D) spherically symmetric grid of TURBOspectrum and RH for all tests. \begin{table*} \centering \begin{tabular}{cccccc} \hline \hline Model ID & ${\rm T_{eff}}$ (K) & ${\rm \log g \, (cm\,s^{-2})}$ & radius (${\rm R_{\odot}}$) & ${\rm \xi \, (km\,s^{-1})}$ & LTE \\ \hline \\ sun & 5777 & 4.44 & 1.00 & 1 & yes \\ s8000 & 8000 & 2.50 & 9.34 & 1 & yes \\ s3500 & 3500 & 3.50 & 2.95 & 2 & yes \\ \\ C & 5777 & 4.44 & 1.00 & variable & no \\ \\ \hline \end{tabular} \caption{Stellar atmosphere models used for the benchmarking of our code. Models are taken from the MARCS database and correspond to the photosphere, except the model C taken from \cite{FALC}. The first column indicates the designation of the model; the second, third, and fourth are the effective temperature, log surface gravity, and radius of the star, respectively. The fifth column gives the constant microturbulence, except for the FAL-C model, which has a depth varying microturbulence. The last column indicates if the model is computed assuming LTE.} \label{tab:models_para} \end{table*} \subsection{Stellar photospheres} To test our opacity modules and background opacity calculations, we used LTE models of stellar photospheres from the MARCS database\footnotemark \citep{MARCS2008}. \footnotetext{\url{https://marcs.astro.uu.se/}} The summary of each model is given in Table \ref{tab:models_para}. The first model, $sun$, is the standard solar photosphere model from the MARCS code. The last two models, $s8000$ and $s3500$, are representative of the photospheres of hot and cool giants, respectively. All models have standard chemical composition and are computed assuming spherical symmetry, except for the solar model, which was computed using the plane-parallel approximation. \subsubsection{Continuum radiation}\label{star_continuum} We compared the stellar continuum computed by the three codes for the stellar photosphere models (see Table \ref{tab:models_para}). Figure \ref{fig:cont_fluxes} shows the continuum flux and the discrepancy function $\delta F/F$ for each model. The agreement between RH and MCFOST is excellent, being at or below 1\% at most wavelengths. For models $sun$ (Fig. \ref{fig:cont_fluxes}a) and $s3500$ (Fig. \ref{fig:cont_fluxes}e), the largest discrepancies are due to interpolation errors at the shortest wavelengths. For the model $s8000$ (Fig. \ref{fig:cont_fluxes}c) the agreement between RH and MCFOST is also at the percent level, except at the Balmer jump (about 350 nm), where differences are larger (again owing to the steep slope of the emission), but remain below 30\%. Discrepancies between MCFOST and TURBOspectrum are of the same order as those between MCFOST and RH. The largest discrepancy for the model $s3500$, of the order of 10\%, is due to the \textsc{H}$^-$ continuum. In TURBOspectrum, the \textsc{H}$^-$ density is self-consistently determined by solving chemical equilibrium equations including hydrogen in its atomic and molecular forms, leading to a slightly different value than in RH and MCFOST. For the model $s8000$, the largest discrepancy occurs at the Balmer jump and is of the order of 40\%. As the largest discrepancy with RH occurs at the same location we might not exclude numerical resolution problems. The agreement between RH and TURBOspectrum is of the same order as MCFOST and TURBOspectrum. Furthermore, we note that for this model, continuum scattering becomes non-negligible and is automatically included in TURBOspectrum\footnotemark, but not in MCFOST, thereby impacting the shape of the continuum. \footnotetext{Continuum scattering cannot be removed easily in TURBOspectrum to benchmark further the codes, but it is negligible for all models but the hotter model.} The agreement between MCFOST and TURBOspectrum remains excellent when level dissolution is taken into account (Fig. \ref{fig:cont_fluxes} right panels). The impact of level dissolution is clearly visible at the Balmer jump where it smoothes the abrupt discontinuity towards redder wavelengths. The shallower spectrum results in an improved agreement between TURBOspectram and MCFOST for model $s8000$ around the Balmer jump. \begin{figure*}[hbtp!] \begin{subfigure}{0.5\textwidth} \centering \includegraphics[width=1\textwidth]{sun_flux_nodiss.pdf} \caption{Solar photosphere without level dissolution.} \end{subfigure} \begin{subfigure}{0.5\textwidth} \centering \includegraphics[width=1\textwidth]{sun_flux_diss.pdf} \caption{Solar photosphere with level dissolution.} \end{subfigure} \newline \begin{subfigure}{.5\textwidth} \centering \includegraphics[width=1\textwidth]{s8000_flux_nodiss.pdf} \caption{$s8000$ model without level dissolution.} \end{subfigure} \begin{subfigure}{.5\textwidth} \centering \includegraphics[width=1\textwidth]{s8000_flux_diss.pdf} \caption{$s8000$ model with level dissolution.} \end{subfigure} \newline \begin{subfigure}{.5\textwidth} \centering \includegraphics[width=1\textwidth]{s3500_flux_nodiss.pdf} \caption{$s3500$ model without level dissolution.} \end{subfigure} \begin{subfigure}{.5\textwidth} \centering \includegraphics[width=1\textwidth]{s3500_flux_diss.pdf} \caption{$s3500$ model with level dissolution.} \end{subfigure} \caption{Continuum flux as a function of wavelengths for the photospheric models without (left panels) and with (right panels) level dissolution. In each panel, the upper window shows the flux from RH, TURBOspectrum, and MCFOST in cyan (thin line), orange (dashed), and black (thick line), respectively. The lower window shows the difference between RH and MCFOST (thick dark grey lines), and between TURBOspectrum and MCFOST (dashed light grey lines). As RH does not include level dissolution, it is not shown in the right figures. In figure 2c, the continuum flux computed by RH stops at about 800 nm, leading to incorrect evaluation of the error at this edge point. } \label{fig:cont_fluxes} \end{figure*} \subsubsection{Velocity fields} Although the impact of velocity fields on line formation will be addressed in a forthcoming paper, in this section we show an example of a solar photosphere with a radial velocity $V_r$ given by \begin{equation}\label{eq:wind} V_{r} = v_{0} + (V_{\inf} - v_{0} ) \, (1 - r_{0}/r)^{\beta} \text{,} \end{equation} where $v_{0}$ is the velocity at the inner point (bottom of the photosphere), $V_{\inf}$ a velocity such that ${\rm max(V_r) = 500\, km\,s^{-1}}$, and $\beta$ the exponent of the velocity law. In our calculations, ${\rm v_{0} = 9\,km\,s^{-1}}$ and $\beta = 0.5$. We compared the result of our code with RH since TURBOspectrum does not deal with macroscopic velocity fields. For comparison, we implemented a solver for the velocity field in RH because the spherically symmetric version does not handle velocity fields. However, unlike MCFOST, the velocity fields between two points are not interpolated. Figure \ref{fig:flux_sun_vel} shows the difference between MCFOST and RH for the solar photosphere when a velocity field is included. While the continuum radiation is similar to that of Fig. \ref{fig:cont_fluxes}a, lines are impacted significantly by the large velocity gradient, as expected. The differences between the two codes are negligible, although the lack of resolution in RH is noticeable. \begin{figure}[H] \includegraphics[width=1\columnwidth]{flux_wind.pdf} \caption{Flux for a solar photospheric model with velocity gradient given by Eq. \ref{eq:wind}. The flux from MCFOST is shown in black and from RH in cyan. A zoom-in around Ly$\beta$ and \textsc{H}$\alpha$ is also shown.} \label{fig:flux_sun_vel} \end{figure} We also tested the treatment of the same model with no radial velocity but a constant rotational velocity of 300 ${\rm km\,s^{-1}}$ instead. Figure \ref{fig:flux_sun_rot} shows the \textsc{H}$\alpha$ line flux as a function of inclination. As expected, the impact of rotation on the line shape increases with inclination, from no effect when the star is seen pole-on to maximum broadening when the star is equator-on. \begin{figure}[H] \includegraphics[width=1\columnwidth]{flux_rot.pdf} \caption{\textsc{H}$\alpha$ flux variation with inclination for a solar photospheric model with rotation. The flux at inclinations of $0^{\circ}$, $45^{\circ}$, and $90^{\circ}$ are shown in black, green, and red, respectively. An inclination of $0^{\circ}$ means that the star is seen pole on.} \label{fig:flux_sun_rot} \end{figure} \subsection{Solar atmosphere model}\label{solar_atm} Although a LTE model of the solar photosphere is adequate to model most solar lines, it fails to reproduce lines formed beyond the photosphere. The upper solar atmosphere is a high temperature and low-density region above the photosphere where non-LTE effects dominate the line formation. In the following we focus on the Lyman $\alpha$ (Ly$\alpha$) and \textsc{H}$\alpha$ lines as they form in the upper atmosphere \citep[e.g. Figure 1 of][]{Vernazza81} and are thus impacted by non-LTE effects. We used a 6-level hydrogen atom, with five bound levels and one continuum level, which is the ground state of \textsc{H} II. Energy levels and transition frequencies are from \cite{Johnson1972}. Bound-free cross-sections are computed using Kramer's formula and collisional rates are evaluated following \cite{Johnson1972}. For the Lyman $\alpha$ and \textsc{H}$\alpha$ lines, the absorption profiles are given by a Voigt function. For the other lines, we used a Gaussian profile. We used model C of \cite{FALC} as a standard model of the solar atmosphere including the chromosphere and transition region. Overall, the agreement between RH and MCFOST is excellent. Figure \ref{fig:pops_falc_b} shows the ratio $b$ between non-LTE and LTE populations in model C. In the photosphere (below the temperature minimum), the populations are mostly at LTE with a $b$ ratio of a few. In the deep photosphere, $b$ is close to 1. From the temperature minimum to the transition region (the chromosphere), the populations start to depart from their LTE values. In the lower corona, the populations are very far from LTE, with a $b$ factor greater than $10^{6}$ for the ground state of \textsc{H}I (level 1 in Fig. \ref{fig:pops_falc_b}). The formation regions of the two lines are consistent with the earlier work of \cite{Vernazza81}. Contribution functions (i.e. regions of formation) of the Ly$\alpha$ and \textsc{H}$\alpha$ lines are shown in Figure \ref{fig:contrib_functions}. \begin{figure*}[hbtp!] \centering \includegraphics[width=\textwidth]{b.pdf} \caption{Ratio of non-LTE to LTE populations (departure coefficient b) of a 6-level hydrogen atom as a function of density ($\rho$). RH populations are indicated with cyan dots. MCFOST populations are shown with full colour lines, where darker (lighter) red shades mean lower (higher) energy levels. For clarity, the first three atomic levels and the continuum level (ground state of \textsc{H}II) are labelled explicitly in the insert. The different layers of the solar atmosphere are shown with vertical dashed lines. Typical heights above the solar radius are also indicated.} \label{fig:pops_falc_b} \end{figure*} \begin{figure*}[hbtp!] \begin{subfigure}{0.5\textwidth} \centering \includegraphics[width=1.1\textwidth]{dyn_656.pdf} \caption{\textsc{H}$\alpha$ line.} \end{subfigure} \begin{subfigure}{0.5\textwidth} \centering \includegraphics[width=1.1\textwidth]{dyn_121.pdf} \caption{Ly$\alpha$ line.} \end{subfigure} \caption{Line contribution function, $\dfrac{dI}{dh}$ (response function to height variation), at disc centre. The contribution function is drawn as a function of the density in the atmosphere and distance from line centre (in nm). Lighter areas show where the contribution function peaks. We indicate the different layers of the solar atmosphere in each panel.} \label{fig:contrib_functions} \end{figure*} Figure \ref{fig:flux_falc} shows the solar flux computed in model C with RH and MCFOST, at non-LTE (a) and LTE (b). The impact of non-LTE effects on spectral lines is clearly visible. At LTE all lines are in emission, whereas at non-LTE most of the lines are seen in absorption. For comparison, disc-integrated observations of the Sun show that most of the hydrogen lines are in absorption, except for strong chromospheric lines (e.g. Ly$\alpha$). \begin{figure}[H] \begin{subfigure}{1\columnwidth} \centering \includegraphics[width=1\columnwidth]{flux_nlte_all.pdf} \caption{Non-LTE flux.} \end{subfigure} \begin{subfigure}{1\columnwidth} \centering \includegraphics[width=1\columnwidth]{flux_lte_all.pdf} \caption{LTE flux.} \end{subfigure} \caption{Solar flux for the model C. RH is shown with the thin cyan and MCFOST with the thick black line. Below each panel the discrepancy between the two codes is shown.} \label{fig:flux_falc} \end{figure} \begin{figure}[H] \begin{subfigure}{\columnwidth} \centering \includegraphics[width=\textwidth]{Ly_alpha.pdf} \caption{Ly$\alpha$ line.} \end{subfigure} \begin{subfigure}{\columnwidth} \centering \includegraphics[width=\textwidth]{H_alpha.pdf} \caption{ \textsc{H}$\alpha$ line.} \end{subfigure} \caption{Zoom-in on solar lines flux. The discrepancy between RH and MCFOST is shown below each panel.} \label{fig:flux_falc_lines} \end{figure} At all wavelengths, the discrepancy is below 1\%, except in the core of some lines where it reaches 5\%. In the figures, interpolation errors create glitches in the discrepancy functions. However, real differences exist in the core of strong lines, such as the Ly$\alpha$ line, where the mismatch can reach 20\%-25\%. Figure \ref{fig:flux_falc_lines} shows the non-LTE flux of the Ly$\alpha$ line (top panel) and the flux of the \textsc{H}$\alpha$ line (bottom panel). Although these differences are not critical, using one of the two options discussed in \S \ref{angle_quad} to improve the angular quadrature leads to a better agreement between the Lyman $\alpha$ line computed by RH and MCFOST. \subsection{Discussion on the angular quadrature}\label{accurate_pops} In \S \ref{angle_quad}, we presented the method we used to perform angular quadratures. These quadratures are important since they are used to evaluate the radiative rates, which in turn determine the level populations. As stated earlier, angular quadratures are performed for a set of fixed rays (i.e. directions) starting from each cell centre. In the following, we test option (i) of \S \ref{angle_quad}, that is performing the angular quadrature not only from cell centres but also at N random positions in the cells. As in section \ref{solar_atm}, we compute the non-LTE Ly$\alpha$ line flux in model C. Further, we use the original grid of the 1D model, that is without additional points. We randomly chose 99 additional positions in each cell. We then kept these positions fixed during the non-LTE loop to avoid introducing Monte Carlo noise in the solution. For each of these 100 positions, the angular quadrature was performed for 80 rays resulting in a total of 8\,000 rays. Thus, for each cell, we obtained 100 values of the mean intensity and radiative rates, each at a different location inside the cell. The mean intensity and the radiative rates in each cell is just the arithmetic mean of these values. \\ Finally, we interpolated the level populations on the same grid used in \S \ref{solar_atm} (i.e. with a higher resolution). Because now we have a better estimation of the radiative rates for each cell, the error in the numerical integration of Eq. \ref{eq:RTE} dominates the discrepancy between RH and MCFOST. \\ In figure \ref{fig:flux_lyalpha_comp} we show the Ly$\alpha$ flux computed with this method compared to the profile shown in in Fig. \ref{fig:flux_falc_lines}a. The agreement between RH and MCFOST is substantially improved, with a maximum discrepancy below 5\%, five times better than with only one position for the angular quadrature. Still we note that, even if the core is better reproduced, the wings are not, although the maximum error is small. Similar results are obtained by performing a purely Monte Carlo step after the one point quadrature, that is we randomly selected 1000 positions and directions (\S \ref{angle_quad}, option (ii)). The main difference between \S \ref{angle_quad} option (i) and \S \ref{angle_quad} option (ii) lies in the execution time of the code. The latter approach is eight times faster than the former for an equivalent accuracy. However, the populations computed with \S \ref{angle_quad} option (ii) have Monte Carlo noise. \begin{figure}[H] \centering \includegraphics[width=1\columnwidth]{Ly_alpha_comp2.pdf} \caption{Evolution of Ly$\alpha$ flux with angular quadrature methods. The black and cyan lines are the flux computed by MCFOST and RH, respectively, from Fig. \ref{fig:flux_falc_lines}a. The dotted red line and the pink triangles are the flux computed using option (i) and (ii) of \S \ref{angle_quad}, respectively. The bottom panel shows the discrepancy between RH and MCFOST, from Fig. \ref{fig:flux_falc_lines}a (dark grey line), option (i) (light grey dotted line), and option (ii) (grey triangles).} \label{fig:flux_lyalpha_comp} \end{figure} \section{Conclusions}\label{conclusion} In this paper, we tested our code against spherically symmetric models of stellar atmospheres, representing a range of physical plasma conditions. We tested background opacity calculations with lines merging close to series limits using the occupation probabilities formalism. The agreement between MCFOST-art and both TURBOspectrum and RH is excellent, of the order of 1\% or below at most wavelengths. Still, a few discrepancies are present, arising from the different treatment of opacities at a few critical wavelengths (e.g. at the Balmer jump or at the \text{H}$^-$ minimum). The code has also been successfully tested with vertical and rotational velocities. The proper behaviour of all spectral lines is recovered in models with non-zero velocity fields. We performed non-LTE calculations of the solar Lyman $\alpha$ and H$\alpha$ lines formation. These calculations were compared with calculations performed with the RH code. Line formation regions and non-LTE effects are reproduced well by our code compared to earlier studies and observations. While the discrepancy in the flux between RH and MCFOST can reach 25\% in the core of Ly$\alpha$, the discrepancy drops below 1\% around the H$\alpha$ line and for most other wavelengths in the spectrum. Furthermore, we showed that improving the accuracy of the angular quadrature scheme decreases this discrepancy by a factor of five. Although we only tested the code against 1D models, the opacity modules and the non-LTE loop are geometry independent. These modules are therefore applicable to multidimensional models. The MCFOST code is 3D in essence and the solution of the radiative transfer equation is fully performed in 3D. Further applications of this new code to 2D and 3D geometries will be discussed in a forthcoming paper with a particular focus on stellar magnetospheres. \begin{acknowledgements} We are thankful to Dr. Bertrand Plez for providing and maintaining a publicly available version of TURBOspectrum. B Tessore is grateful to Dr. Han Uitenbroek for providing a version of RH. We thank the anonymous referee for his comments, which helped to improve the manuscript. B. Tessore is also thankful to the french minister of Europe and foreign affairs and the minister of superior education, research and innovation (MEAE and MESRI) for research funding through FASIC partnership. This project has received funding from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (grant agreement No 742095; {\it SPIDI}: Star-Planets-Inner Disk-Interactions, \url{http://www.spidi-eu.org}). C. Pinte acknowledges funding from the Australian Research Council via FT170100040 and DP180104235. \end{acknowledgements} \bibliographystyle{aa}
\section{Introduction} Tent-based numerical methods for hyperbolic equations stratify a spacetime simulation region in an unstructured manner, by tent-shaped subregions, and advance solutions across them progressively in time. The partitioning into tents provides a rational design for local time stepping, maintaining high order accuracy in both space and time, and without any ad hoc projection or extrapolation steps, an advantage that has been and continues to be effectively leveraged by many researchers~\cite{AbediHaber18, AbediPetraHaber06, FalkRicht99, MonkRicht05, PerugSchobStock20, Richt94, YinAcharSobh00}. Nevertheless, a drawback of tents is that they are not tensor products of a spatial domain with a time interval, necessitating development of new tent (spacetime) discretizations coupling too many spatiotemporal unknowns. In~\cite{GopalSchobWinte17}, we overcame this drawback by using a mapping technique that transforms spacetime tents to tensor product spacetime cylinders. This opened avenues to use standard techniques like the discontinuous Galerkin (DG) discretizations for spatial discretization, together with efficient matrix-free time stepping schemes, on the mapped tents. Such methods, referred to as {\em Mapped Tent Pitching} (MTP) schemes, have been applied to solve a variety of linear and nonlinear hyperbolic systems~\cite{GopalHochsSchob20, GopalSchobWinte17, GopalSchobWinte20}. This is the first paper to provide convergence theorems for MTP schemes. Although the scope of the analysis here is limited to linear hyperbolic systems, we identify what we consider to be the basic ingredients for error analysis of MTP schemes, such as a norm in which stability on spacetime fronts can be obtained. We use techniques to bound the propagation of error through layers of tents similar to those in~\cite{FalkRicht99, MonkRicht05}. However, a number of new tools are needed to overcome difficulties arising from a time-dependent mass matrix generated due to the mapping. As we already noted in \cite{GopalHochsSchob20}, the use of classical explicit Runge-Kutta time stepping on these mapped systems leads to loss of higher orders of convergence due to the complications created by the map. We outlined an algorithmic solution in~\cite{GopalHochsSchob20}, namely the {\em Structure-Aware Taylor} (SAT) time stepping scheme, that accounts for the specific structure of the time-dependent mass matrix. Here we shall provide {\it a priori} error bounds for these as well as a few other schemes. Our analysis is divided into the next three sections. First, we borrow a spatial DG discretization framework from~\cite{BurmaErnFerna10, ErnGuerm06} which permits the treatment of many important examples of symmetric hyperbolic systems and many boundary condition choices, all at once. The application of this framework to the mapped equation (the pull back of the hyperbolic system from the physical tent to the spacetime cylinder), is detailed in Section~\ref{sec:model-probl}. We then combine it with a semidiscrete analysis in Section~\ref{sec:semidisc}. While the analysis in that section ignores errors due to time discretization that are undoubtedly present in practice, it immediately clarifies in what norms one may expect stability on spacetime advancing fronts, and what error bounds might be provable after time discretization. The main result of this section is that under the conditions spelled out later, we may expect the error in the numerical solution at the final time to be $O(h^{p+1/2})$ where $h$ represents a spatial mesh size parameter and $p$ denotes the spatial polynomial degree (used in the spatial DG discretization). In this form, the result is comparable to \cite[Theorem~5.1]{MonkRicht05} that provides the same rate for their spacetime DG method using spacetime polynomials of degree $p$ on tents. In Section~\ref{sec:fully-discr}, we discuss several fully discrete schemes that combine the spatial DG discretization on a mapped tent with SAT or other time stepping. We find that proving stability of the fully discrete schemes requires some trickery. Ever since the classical work of~\cite{LevyTadmo98}, we know that stability regions and ``naive spectral stability analysis based on scalar eigenvalues arguments may be misleading.'' Many researchers have since pursued energy-type arguments to prove stability of time stepping schemes with spatial DG discretizations \cite{BurmaErnFerna10, CockbShu98, SunShu17, ZhangShu04}. However, we are not able to directly apply existing techniques due to the nonstandard nature of the system we obtain after mapping the hyperbolic equation. Therefore, we start afresh, beginning with the most basic scheme and proceeding to more complicated cases. Namely, in \S\ref{ssec:lowest-order-tent-implicit} we prove unconditional strong stability for a lowest order tent-implicit scheme. Then, we proceed to analyze a lowest order ``iterated'' explicit scheme in \S\ref{ssec:lowest-order-expl}, constructed as an iterative solver for the implicit scheme, for which we prove a nonstandard conditional stability. Then, in \S\ref{ssec:arbitrary-order-sat}, we proceed to an $s$-stage SAT scheme and show that its local error in a tent is $O(h^s)$, which is comparable to the $s$th power of the time step since the amount of local time advance in tents is tied to its spatial mesh size. We are able to prove, in one case, stability under a traditional Courant-Friedrichs-Levy (CFL) condition, by which we mean that the amount of {\em local} time advance within a tent is limited by a constant multiple of the {\em local} spatial mesh size. In another case, we prove stability under a ``3/2 CFL'' condition. In some non-tent-based DG methods, others have encountered a similar (4/3 CFL) limitation in stability analyses~\cite{BurmaErnFerna10}. We offer the above-mentioned cases not as the last word on stability, but rather to spur further research into this interesting topic. In the remainder of this section, we establish notation and the lingua franca of tents that we use throughout. Consider a cylindrical domain ${\varOmega} \times (0,T)$ in the physical spacetime, where the spatial domain ${\varOmega}$ is an open bounded subset of $\mathbb{R}^N$. We assume that ${\varOmega}$ is subdivided by a simplicial mesh ${\varOmega_h}$. The subscript $h$ denotes the maximal element diameter of the spatial mesh ${\varOmega_h}$. Spacetime tents are built atop this spatial mesh, using the algorithms in~\cite{GopalSchobWinte17} or~\cite{ErickGuoySulli05}. We start by viewing the spatial mesh ${\varOmega_h}$ at time $t=0$ as the initial advancing front. When one mesh vertex ${\mathtt{v}}$ is moved forward in time, while keeping all other vertices fixed, the advancing front is updated to the piecewise planar surface formed by connecting the raised ${\mathtt{v}}$ to its neighboring vertices. The new front differs from the old by a tent-shaped region, which we denote by ${T^\vtx}$. Its projection onto ${\varOmega}$ gives the vertex patch ${\varOmega^{\vtx}}$ of all spatial simplices connected to the vertex ${\mathtt{v}}$. We shall refer to this process as {\em pitching} the tent ${T^\vtx}$. For concurrency, one pitches multiple tents simultaneously at vertices whose vertex patches do not have a mesh element in their pairwise intersections, as in Figure~\ref{fig:tents:L1}. The canopies of these spacetime tents can be represented as the graph of $\varphi_1(x)$, a continuous function that is piecewise linear with respect to the mesh ${\varOmega_h}$ (whose value is zero in locations where tents are not yet erected). These canopies together form the next advancing front: $C_1 = \{ (x, \varphi_1(x)): x \in {\varOmega}\}$. Note that the time coordinate of a point in $C_1$ is never less than that of the corresponding point in the first front $C_0 = {\varOmega} \times \{0\}$. This process is repeated by pitching tents atop $C_1$, and later atop the subsequent advancing fronts that result from each step (as illustrated in Figures~\ref{fig:tents:L2}--\ref{fig:tents:Lall}). Reiterating, the {\em advancing front} at step $i$ is the graph of a lowest-order Lagrange finite element function $\varphi_i(x)$: \begin{equation} \label{eq:Ci} C_i = \{ (x, \varphi_i(x)): x \in {\varOmega}\}. \end{equation} We shall refer to the region between two successive advancing fronts as a {\em layer}, i.e., \begin{equation} \label{eq:Li} L_i = \{ (x, t) \in {\varOmega} \times (0, T): \; \varphi_{i-1}(x) \le t \le \varphi_i(x) \} \end{equation} denotes the $i$th layer for $i=1, 2, \ldots, m.$ The layer $L_i$ (see Figure~\ref{fig:tents}) is made above $C_{i-1}$ by pitching tents atop vertex patches associated with a subset of mesh vertices of ${\varOmega_h}$, which form the {\em pitch locations} at that stage. Let $V_{i}$ denote the collection of such vertices identifying the pitch locations on $C_{i-1}$. Then $ L_{i} = \mathop{\bigcup}_{{\mathtt{v}} \in V_i} {T^\vtx}. $ The spacetime will generally contain multiple tents pitched at the same vertex ${\mathtt{v}}$ at different time coordinates. Although referring to a tent by its spatial pitch location alone, as in ${T^\vtx}$ above, is generally ambiguous, it will not confuse us since we will usually be occupied with analyzing one tent at a time. A tent can be expressed as \begin{equation} \label{eq:Tv} {T^\vtx} = \{ (x, t): x \in {\varOmega^{\vtx}}, \; \varphi_{\mathrm{bot}}^{\mathtt{v}}(x) \le t \le \varphi_{\mathrm{top}}^{\mathtt{v}}(x)\} \end{equation} where $\varphi_{\mathrm{bot}}^{\mathtt{v}}$ and $\varphi_{\mathrm{top}}^{\mathtt{v}}$ are continuous functions on ${\varOmega^{\vtx}}$ that are piecewise linear with respect to the mesh elements forming the vertex patch ${\varOmega^{\vtx}}.$ The function $\delta^{\mathtt{v}}(x) = \varphi_{\mathrm{top}}^{\mathtt{v}}(x) - \varphi_{\mathrm{bot}}^{\mathtt{v}}(x)$ on ${\varOmega^{\vtx}}$ will feature often in the sequel. It arises as a weight in transformed integrals and is degenerate at the points where tent top meets tent bottom. \begin{figure} \centering \subcaptionbox{Spatial mesh ${\varOmega}_h$. \label{fig:tents:mesh}}{ \includegraphics[trim=60 340 470 150, clip, % width=0.3\linewidth]{figs/mesh.png}% } \subcaptionbox{ The region in blue is the layer $L_1$. Tent canopies form part of the advancing front~$C_1$. \label{fig:tents:L1} }{ \frame{ \includegraphics[trim=60 400 500 150, clip, width=0.3\linewidth]{figs/C1.png}% }} \; \subcaptionbox{ Green tents form layer $L_2$. Top canopies (blue and green) are part of the front~$C_2$. \label{fig:tents:L2} }{ \frame{ \includegraphics[trim=60 400 500 150, clip, width=0.3\linewidth]{figs/C2.png}% }} \subcaptionbox{$L_3$ and $C_3$.}{ \frame{ \includegraphics[trim=60 400 500 150, clip, width=0.3\linewidth]{figs/C3.png}% }}\; \subcaptionbox{$L_4$ and $C_4$. \label{fig:tents:L4}}{ \frame{ \includegraphics[trim=60 400 500 150, clip, width=0.3\linewidth]{figs/C4.png}% }}\; \subcaptionbox{Layers filling ${\varOmega} \times (0, t_{\mathrm{slab}})$. \label{fig:tents:Lall}}{ \frame{ \includegraphics[trim=60 400 500 150, clip, width=0.3\linewidth]{figs/C_all.png}% }} \subcaptionbox{An initial pulse. \label{fig:tents:sol0}}{ \frame{ \includegraphics[trim=270 200 270 300, clip, width=0.3\linewidth]{figs/sol1.png}} } \subcaptionbox{Solution at $t =t_{\mathrm{slab}}$. \label{fig:tents:sol1}}{ \frame \includegraphics[trim=270 200 270 300, clip, width=0.3\linewidth]{figs/sol2.png}} } \subcaptionbox{Solution at $t =3t_{\mathrm{slab}}$. \label{fig:tents:sol3}}{ \frame \includegraphics[trim=270 200 270 300, clip, width=0.3\linewidth]{figs/sol4.png}} } \caption{Tents, layers, advancing fronts, and solution snapshots from an acoustic wave simulation using the MTP scheme of \S\ref{ssec:arbitrary-order-sat}: Figures~\ref{fig:tents:L1}--\ref{fig:tents:L4} show successive layers of tents, viewed at an angle to show where small and large features meet (and time $t$ is in the vertical direction). Figure~\ref{fig:tents:Lall} shows how tents asynchronously enable both large and small time advances within a spacetime slab ${\varOmega} \times (0, t_{\mathrm{slab}})$. Plots of a time evolving wave solution at $t = 0, t_{\mathrm{slab}},$ and $3t_{\mathrm{slab}}$, computed using the tents in Figure~\ref{fig:tents:Lall}, are shown in Figures~\ref{fig:tents:sol0},~\ref{fig:tents:sol1}, and~\ref{fig:tents:sol3}, respectively.} \label{fig:tents} \end{figure} One reason for working with tents is the ease by which {\em causality} can be imposed, simply by adjusting the height of the {\em tent pole}, the line segment connecting $({\mathtt{v}}, \varphi_{\mathrm{bot}}^{\mathtt{v}}({\mathtt{v}}))$ to $({\mathtt{v}}, \varphi_{\mathrm{top}}^{\mathtt{v}}({\mathtt{v}}))$. By the definition of hyperbolicity, the maximal wave speed $c$ is finite. When each spacetime tent encloses the domain of dependence of all its points, causality holds. In other words, if \[ \| (\mathop{\mathrm{grad}_x} \varphi_i) (x)\|_2 < \frac{1}{c}, \qquad x \in {\varOmega}, \] on all advancing fronts, then causality holds. In this paper, in place of the strict inequality, we assume we are given a strict upper bound $\hat{c} $ for the maximal wave speed $c$ and that our mesh of spacetime tents is constructed so that \begin{equation} \label{eq:causalitycondition} \| (\mathop{\mathrm{grad}_x} \varphi_i) (x)\|_2 \le \frac{1}{\hat{c}} < \frac{1}{c} \qquad x \in {\varOmega}. \end{equation} We will refer to~\eqref{eq:causalitycondition} as the {\em causality condition}. Algorithms for constructing tent meshes satisfying~\eqref{eq:causalitycondition} can be found in \cite{ErickGuoySulli05, GopalSchobWinte17}. They terminate filling the spacetime ${\varOmega} \times (0, T)$ with tents so that the first and the last advancing fronts, $C_0$ and $C_m$, are flat, i.e., $\varphi_0(x) \equiv 0$ and $\varphi_m(x) \equiv T$. In practice, we often select (as in Figure~\ref{fig:tents}) a $t_{\mathrm{slab}}<T$ such that $T = n_{\mathrm{slabs}} t_{\mathrm{slab}}$, run the tent meshing algorithm to fill the subregion ${\varOmega} \times (0, t_{\mathrm{slab}})$, and then translate the same mesh to reuse it $n_{\mathrm{slabs}}-1$ times to cover the full spacetime domain ${\varOmega} \times (0, T)$ without further meshing overhead. However, for the ensuing analysis, we ignore this extra subdivision into smaller spacetime slabs (so $t_{\mathrm{slab}}=T$ henceforth). With this background in mind, we proceed to show how to map tents and construct an MTP scheme after fixing a model problem. \section{A model problem for analysis} \label{sec:model-probl} In this section, we describe a model symmetric linear hyperbolic system and its MTP discretization that we shall be occupied with. Although MTP schemes can be applied much more generally (as shown in~\cite{GopalSchobWinte17, GopalSchobWinte20}), we restrict to this model for transparently presenting the essential new ideas needed for a convergence analysis. \subsection{A symmetric linear hyperbolic system} Let $L$ be a positive integer (and let $N$, as before, denote the spatial dimension). Suppose that $\Lc j: {\varOmega} \to \mathbb{R}^{L \times L}$, for $j=1,\ldots, N$ and $\mathcal{G}: {\varOmega} \to \mathbb{R}^{L \times L}$ are symmetric bounded matrix-valued functions and suppose $\mathcal{G}$ is uniformly positive definite in $\bar{\varOmega}$. Our model problem is the following linear hyperbolic system of $L$ equations, in $L$ unknowns, denoted by $u(x, t)$, or in terms of scalar components, by $u_k(x, t)$: \begin{equation} \label{eq:34} \mathop{\partial_t} g(u) + \mathop{\mathrm{div}_x} f(u) = 0, \end{equation} with \[ [g(u)]_l = \sum_{k=1}^L \mathcal{G}_{lk} u_k, \qquad [f(u)]_{lj} = \sum_{k=1}^L \Lc j_{lk} u_k. \] We have restricted ourselves to time-independent coefficients, and shall do so also for boundary conditions, which are expressed using a matrix field $\mathcal{B}: \partial {\varOmega} \to \mathbb{R}^{L \times L}$. Boundary conditions are considered in the form studied by Friedrichs~\cite{Fried58}, namely, \begin{equation} \label{eq:FreidrichsBC} (\mathcal{D} - \mathcal{B}) u = 0 \qquad \text { on } \partial {\varOmega} \end{equation} where \begin{equation} \label{eq:D} \mathcal{D} = \sum_{j=1}^N n_j \Lc j. \end{equation} Note that $\mathcal{D}$, in general, depends on the point $x \in \partial{\varOmega}$ as well as on $n(x)$, the spatial unit outward normal at $x$, and when we wish to emphasize these dependencies, we shall denote it by $\mathcal{D}^{(n)}$, $\mathcal{D}(x)$, or $\mathcal{D}(x)^{(n)}$. Note that later in the sequel $n$ (or $n(x)$) will also be used to generically denote the outward unit normal on boundaries of other domains (such as mesh elements). Of course, the hyperbolic system~\eqref{eq:34} must also be supplemented with an initial condition, \begin{equation} \label{eq:ic} u(x, 0) = u^0(x) \qquad x \in {\varOmega} \end{equation} at time $t=0$ for some given initial data $u^0$. Friedrichs~\cite{Fried58} identified conditions on the operator $\mathcal{B}$ for obtaining well-posed boundary value problems. We shall borrow the same conditions and impose them pointwise on $\partial {\varOmega} \times (0, T)$. In particular, at each $x \in \partial{\varOmega}$ and $t \in (0, T)$, we assume $\ker( \mathcal{D} - \mathcal{B} ) + \ker (\mathcal{D} + \mathcal{B}) = \mathbb{R}^L$ and $ \mathcal{B} + \mathcal{B}^t \ge 0.$ (The latter is to be interpreted as $(\mathcal{B}(x) + \mathcal{B}(x)^t) y \cdot y = 2\mathcal{B}(x) y \cdot y \ge 0$ for all vectors $y \in \mathbb{R}^L$ at any $x \in \partial{\varOmega}$.) To simplify the analysis, we shall also assume that \begin{equation} \label{eq:divL0} \sum_{j=1}^N \partial_j \Lc j = 0 \end{equation} in the sense of distributions (so jumps in $\Lc j (x)$ are allowed so long as~\eqref{eq:divL0} holds) and \begin{equation} \label{eq:G_L_const} \mathcal{G} \text{ and } \Lc j \text{ are constant on each mesh element } K \in {\varOmega_h}. \end{equation} Across a mesh facet $F$ of normal $n_F$, it is easy to see that~\eqref{eq:divL0} implies the continuity of $\mathcal{D}^{(n_F)}.$ As long as we obtain this normal continuity (which is needed in our analysis), assumption~\eqref{eq:divL0} can be relaxed to other forms (such as what is suggested in~\cite[equation (A.4)]{ErnGuerm06}), at the expense of a few additional technicalities. Assumption~\eqref{eq:G_L_const} allows us to zero out some projection error terms instead of tracking such small terms in error estimates. \subsection{Mapping tents} Consider a tent expressed as in~\eqref{eq:Tv}. We map to a tent ${T^\vtx}$ from a cylindrical tensor product domain ${\hat{T}^\vtx} = {\varOmega^{\vtx}} \times (0, 1)$ using the map $\varPhi^{\mathtt{v}}(x, \hat t) = (x, \varphi^{\mathtt{v}}(x, \hat t))$ where \[ \varphi^{\mathtt{v}}(x, \hat t) = (1- \hat t) \varphi_{\mathrm{bot}}^{\mathtt{v}}(x) + \hat t\varphi_{\mathrm{top}}^{\mathtt{v}}(x) = \varphi_{\mathrm{bot}}^{\mathtt{v}}(x) + \hat t\, \delta^{\mathtt{v}}(x) \] (see \cite[Fig.~2]{GopalSchobWinte17} for an illustration of this map). We will drop the superscript ${\mathtt{v}}$ when it is obvious from context. Clearly, $\varPhi ({\hat{T}^\vtx}) = {T^\vtx}$ and the interior of ${\hat{T}^\vtx}$ is mapped one-to-one onto the interior of ${T^\vtx}$ (but the map is not one-to-one from the boundary of ${\hat{T}^\vtx}$ to the boundary of ${T^\vtx}$). The coordinate $\hat t$ in ${\hat{T}^\vtx}$ will be referred to as the {\em pseudotime} coordinate. Note that the time coordinate $t$ in the physical spacetime twists space and pseudotime together since it is given by $t = \varphi(x, \hat t)$. The Jacobian matrix of the map $\varPhi$ is easily computed: \begin{equation} \label{eq:gradxtPhi} \mathop{\mathrm{grad}_{x\hat{t}}} \varPhi = \begin{bmatrix} I & 0 \\ (\mathop{\mathrm{grad}_x}\varphi)^T &\delta \end{bmatrix} \end{equation} Using it in a Piola transformation, it can be shown \cite[Theorem~2]{GopalSchobWinte17} that the mapped hyperbolic solution $\hat u = u \circ \varPhi$ satisfies \begin{equation} \label{eq:1} \mathop{\partial_{\hat{t}}} \left[ g({\hat{u}}) - f({\hat{u}}) \mathop{\mathrm{grad}_x} \varphi \right]+ \mathop{\mathrm{div}_x} \big[ \delta f({\hat{u}})\big] = 0,\qquad \text{ in } {\hat{T}^\vtx}, \end{equation} whenever $u$ solves~\eqref{eq:34}. MTP schemes proceed by solving~\eqref{eq:1} by various discretization strategies (particularly those that leverage the tensor product nature of space and pseudotime in ${\hat{T}^\vtx}$) and then pulling back the computed solution to the physical spacetime. We now proceed to discuss a discretization strategy that uses a DG spatial discretization on ${\varOmega^{\vtx}}$. We will combine it with pseudotime discretizations later (in Section~\ref{sec:fully-discr}). \subsection{Spatial discretization on mapped tents} The mapped equation~\eqref{eq:1} can be approximated by any standard scheme that allows for a time dependent mass matrix. Our focus is on discontinuous Galerkin (DG) discretizations. Since there are numerous flavors of DG schemes and numerical fluxes, for efficiently covering various choices, we use the framework of~\cite{ErnGuerm06} (see also~\cite{BurmaErnFerna10}), a simplified version of which, adapted to our purposes, is described next. Their framework is motivated by the previously mentioned early work of Friedrichs~\cite{Fried58}, and other previous authors have also been similarly motivated while considering boundary conditions, notably~\cite{FalkRicht99} and~\cite{MonkRicht05} in the context of tents and spacetime methods. We assume that ${\varOmega_h}$ is a shape regular conforming simplicial mesh of domain ${\varOmega}$. We use $a \lesssim b$ to indicate that there is a constant $C>0$ such that $a \le C b $ and that the value of $C$ may be chosen independently of any spatial mesh chosen from the shape regular family. The value of the generic constant $C$ in ``$\lesssim$'' may differ at different occurrences and is allowed to depend on the wave speed, material coefficients, spatial polynomial degree, etc. Let $P_p(K)$ denote the space of polynomials of degree at most $p$ restricted to the domain $K$ and let $V_h = \{ v : v|_K \in P_p(K)^L$ for any mesh element $K \in {\varOmega_h}\}$. Let ${\varOmega_h^{\vtx}}$ denote the collection of elements in the vertex patch ${\varOmega^{\vtx}}$ of a mesh vertex~$v$. Let $V_h^\vtx$ denote the restriction of the spatial DG space on ${\varOmega^{\vtx}}$ and let $\psi_j(x)$ denote a basis for $V_h^\vtx$. The semidiscrete approximation of ${\hat{u}}$ is of the form \[ {\hat{u}}_h(x, {\hat{t}}) = \sum_j U_j({\hat{t}}) \psi_j(x). \] We consider a DG semidiscretization of~\eqref{eq:1} of the form displayed next in~\eqref{eq:DG}. In the spatial integrals there and throughout, we do not explicitly indicate the measure (volume or boundary measure) as it will be understood from context. For each fixed $0 < \hat t\le 1$, the function ${\hat{u}}_h(\cdot, \hat t)$ satisfies \begin{equation} \label{eq:DG} \int_{\varOmega^{\vtx}} \mathop{\partial_{\hat{t}}} \big[ g({\hat{u}}_h) - f({\hat{u}}_h) \mathop{\mathrm{grad}_x} \varphi\big] \cdot v = \sum_{K \in {\varOmega_h^{\vtx}}} \bigg[ \int_K \delta f({\hat{u}}_h) : \mathop{\mathrm{grad}_x} v - \int_{\partial K} \delta \hat{F}^n_{{\hat{u}}_h} \cdot v \bigg], \end{equation} for all $ v \in V_h^\vtx,$ where the numerical flux $\hat{F}^n_{{\hat{u}}_h}$ on an element boundary $\partial K$ is defined using the values of ${\hat{u}}_h$ from the element $K$ as well as from the neighboring element $K_o$, as follows. For any $w \in V_h^\vtx$, at a point $x \in \partial K \cap \partial K_o$, letting $w_o = w|_{K_o}$, define \[ \{ w \}(x) = \frac 1 2 ( w + w_o), \qquad \jmp{w}(x) = w - w_o. \] Then, $\hat{F}^n_w$ is assumed to take the form \begin{equation} \label{eq:NumFlux} \hat{F}^n_w = \begin{cases} \mathcal{D} \{ w \} + S} %{\mathcal{S} \jmp{w} & \text{ on } \partial K \setminus \partial {\varOmega}, \\ \frac 1 2 (\mathcal{D} + B) w & \text{ on } \partial K \cap \partial {\varOmega}. \end{cases} \end{equation} Here, $\mathcal{D}$ is defined by~\eqref{eq:D}, with the vector $n$ now denoting the outward unit normal on~$\partial K$, $ S} %{\mathcal{S}: \mathcal{F}_i \to \mathbb{R}^{L \times L} $ denotes a stabilization matrix on interior facets of $\mathcal{F}_i = \bigcup\{ \partial K \setminus \partial{\varOmega}: \; K \in {\varOmega_h^{\vtx}} \}$, and $B: \partial {\varOmega} \to \mathbb{R}^{L \times L}$, is used to model the exact boundary condition $\mathcal{B}$ with any needed extra stabilization on boundary facets. Note that $S$ is single-valued on $\mathcal{F}_i$ (while $\mathcal{D}$ is multivalued and depends on the sign of the normal on an element boundary). Let $\| \cdot \|_2$ denote the Euclidean norm (of a vector, or the induced norm for a matrix) and let $|y|_S = (S y \cdot y)^{1/2}$ and $| y |_B = (B y \cdot y)^{1/2}$. We assume that \begin{subequations} \label{eq:DGdesign} \begin{align} \label{eq:kernelB} \ker\left(\mathcal{D}(x) - \mathcal{B}(x)\right)\, & \subseteq\, \ker\left(\mathcal{D}(x) - B(x)\right) && x \in \partial{\varOmega}, \\ \label{eq:Bpd} B(x) + B(x)^t & \ge 0, \qquad \| B(x) \|_2 \lesssim 1, && x \in \partial{\varOmega}, \\ \label{eq:12} \left(\mathcal{D}(x) + B(x)\right) y \;\cdot z \; & \lesssim\; \| y \|_2\; |z|_B, && x \in \partial{\varOmega}, \; y, z \in \mathbb{R}^L, \\ \label{eq:Spd} S(x) + S(x)^t & \ge 0, \qquad \| S(x) \|_2 \lesssim 1, && x \in \mathcal{F}_i, \\ \label{eq:Sbound} S(x) y \cdot z \; & \lesssim\; | y|_S \;|z |_S, && x \in \mathcal{F}_i, \; y, z \in \mathbb{R}^L. \\ \label{eq:11} \mathcal{D}(x) y \cdot z\; & \lesssim\; \| y\|_2 \;|z |_S, && x \in \mathcal{F}_i, \; y, z \in \mathbb{R}^L. \end{align} \end{subequations} These form a subset of the ``design conditions for DG methods'' in~\cite{ErnGuerm06} that we shall need for our analysis in the next section. \subsection{Examples} \label{ssec:examples} The following examples show a variety of equations, boundary conditions, and their well-known discretizations that conform to the framework introduced above. We will work out the first example in some detail and describe the rest telegraphically since similar examples can be found in the literature~\cite{BurmaErnFerna10, ErnGuerm06, FalkRicht99, MonkRicht05}. \begin{example}[Maxwell equations with impedance boundary conditions] \label{eg:MaxwellImpedance} Suppose we are given electric permittivity ${\varepsilon}(x)$ and magnetic permeability $\mu(x)$ as positive functions on ${\varOmega}$ and let $Z>0$. The Maxwell system for the electric field $E(x, t)$ and magnetic field $H(x, t)$, with impedance boundary conditions, consists of \begin{subequations} \begin{align} \label{eq:36} {\varepsilon} \mathop{\partial_t} E - \mathop{\text{curl}} H = 0, \quad\quad \mu \mathop{\partial_t} H + \mathop{\text{curl}} E & =0, && \text{ in } {\varOmega} \times (0, T), \\ \label{eq:35} n \times E - Z n \times (H \times n)& = 0, && \text{ on } \partial{\varOmega} \times (0, T). \end{align} \end{subequations} To fit this into the prior setting, we put $ N=3,$ $ L=6,$ and \begin{align*} u = \begin{bmatrix} E \\ H \end{bmatrix}, \quad \Lc j = \begin{bmatrix} 0 & [\epsilon^j] \\ [\epsilon^j]^t & 0 \end{bmatrix}, \quad \mathcal{G} = \begin{bmatrix} {\varepsilon} I & 0 \\ 0 & \mu I \end{bmatrix}, \quad \mathcal{B} = \begin{bmatrix} 0 & \mathcal{N} \\ \mathcal{N} & -2Z \mathcal{N}^t \mathcal{N} \end{bmatrix}, \end{align*} where $\epsilon^j$ is the $3 \times 3$ matrix whose $(l,m)$th entry equals the value of the Levi-Civita alternator $\epsilon_{jlm}$ and $\mathcal{N} = \sum_{j=1}^3 n_j \epsilon^j \in \mathbb{R}^{3 \times 3}$. Noting that $ \mathcal{N}^t = -\mathcal{N},$ $\mathcal{N} E = E \times n,$ and $ \mathcal{N}^t \mathcal{N} H = n \times (H \times n),$ it is easy to see that \begin{equation} \label{eq:37} \mathcal{D} = \begin{bmatrix} 0 & \mathcal{N} \\ \mathcal{N}^t & 0 \end{bmatrix}, \quad (\mathcal{D} - \mathcal{B}) \begin{bmatrix} E \\ H \end{bmatrix} = 2 \begin{bmatrix} 0 \\ n \times E - Z n \times (H \times n) \end{bmatrix}, \end{equation} so that~\eqref{eq:FreidrichsBC} indeed imposes the impedance boundary condition~\eqref{eq:35}. Next, for the DG discretization, set \[ B = \frac{1}{1+Z} \begin{bmatrix} 2\mathcal{N} \mathcal{N}^t & (1-Z)\mathcal{N} \\ (1-Z)\mathcal{N} & 2Z\mathcal{N} \mathcal{N}^t \end{bmatrix}, \quad S = \begin{bmatrix} \mathcal{N}^t\mathcal{N} & 0 \\ 0 & \mathcal{N}^t\mathcal{N} \end{bmatrix}. \] Since $\| n \times (E \times n) \|_2^2 = \| \mathcal{N} E\|_2^2$, setting $b = n \times E - Z n\times (H \times n)$, it is easy to see that \begin{equation} \label{eq:38} (\mathcal{D} - B) \begin{bmatrix} E \\ H \end{bmatrix} = \frac{2}{1+Z} \begin{bmatrix} n \times b \\ b \end{bmatrix}, \quad \left| \begin{bmatrix} E \\ H \end{bmatrix} \right|_B^2 = \frac{2 }{1+Z} \left( \| n \times E \|_2^2 + Z \| n \times H\|_2^2 \right), \end{equation} and the latter shows~\eqref{eq:Bpd} since $Z>0$. The first identity of~\eqref{eq:38}, together with~\eqref{eq:37} implies \eqref{eq:kernelB}. Similar computations establish~\eqref{eq:12}. Finally, noting that $\left| [\begin{smallmatrix} E \\ H \end{smallmatrix} ]\right|_S^2 = \| n \times E \|_2^2 + \| n \times H \|_2^2,$ the remaining properties~\eqref{eq:Spd} and~\eqref{eq:11}, are easily established. Note that if the above $S$ is scaled by 1/2, then the conditions of~\eqref{eq:DGdesign} continue to hold and we get the ``classic upwind'' flux~\cite[p. 434]{HW08} for Maxwell equations. \end{example} \begin{example}[Maxwell equations with perfect electric boundary conditions] \label{eg:MaxwellPEC} Reconsider Example~\ref{eg:MaxwellImpedance} with $Z=0$. This yields a Dirichlet boundary condition modeling the electrical isolation by a perfect electric conductor. Substituting $Z=0$ in previous choices of $\mathcal{B}, B, $ and $S$, one can show that all conditions of~\eqref{eq:DGdesign} continue to hold even though the $|\cdot |_B$ seminorm is now weaker: $\left| [\begin{smallmatrix} E \\ H \end{smallmatrix} ]\right|_B^2 = 2\| n \times E \|_2^2$ from~\eqref{eq:38}. \end{example} \begin{example}[Advection] \label{eg:advection} The advection problem with inflow boundary conditions, \[ \mathop{\partial_t} u + \mathop{\mathrm{div}_x} ( b u)= 0\quad \text{ in }{\varOmega} \times (0, T), \qquad u = 0 \quad \text{ on } {\partial_{\text{in}}} {\varOmega} \times (0, T), \] where $b : {\varOmega} \to \mathbb{R}^N,$ is some given vector field, fits the above setting with $L=1$ (keeping the spatial dimension $N$ arbitrary), $\Lc j = b_j \in \mathbb{R}^{1 \times 1},$ $\mathcal{G} =1$ and $\mathcal{D} = b \cdot n$. Examples of $b$ that satisfy~\eqref{eq:divL0} and~\eqref{eq:G_L_const} are offered by divergence-free functions in the lowest order Raviart-Thomas finite element space. The inflow boundary condition is recovered by setting $\mathcal{B} = |b\cdot n|$. The choices \[ B = |b\cdot n|, \qquad S} %{\mathcal{S} = \frac 1 2 | b \cdot n|, \] are easily seen to verify~\eqref{eq:DGdesign} and yield the classical upwind DG discretization. \end{example} \begin{example}[Wave equation with Dirichlet boundary conditions] \label{eg:WaveDirichlet} Rewriting \begin{equation} \label{eq:39} \partial_{tt} \phi - \Delta \phi=0, \quad \text{ in }{\varOmega} \times (0, T), \qquad \phi = 0 \quad \text{ on } \partial{\varOmega} \times (0, T), \end{equation} as a first order hyperbolic system for $L=N+1$ variables using the flux $q = -\mathop{\mathrm{grad}_x} \phi$ and $\mu = \mathop{\partial_t} \phi$, we match the prior framework. Put $u = [ \begin{smallmatrix} q \\ \mu \end{smallmatrix} ]$, $\mathcal{G}$ to identity, and $\Lc j = e_j e_{N+1}^t + e_{N+1} e_j^t$ (using the standard unit basis vectors $e_j$ of $\mathbb{R}^{N+1}$). The Dirichlet boundary conditions on $\phi$ can be imposed by requiring that $\mu=0$ on $\partial{\varOmega} \times (0, T)$, which is what~\eqref{eq:FreidrichsBC} yields with \[ \mathcal{B} = \sum_{j=1}^N n_j (e_{N+1} e_j^t - e_j e_{N+1}^t) + 2 e_{N+1} e_{N+1}^t = \begin{bmatrix} 0 & -n \\ n^t & 2 \end{bmatrix}. \] All conditions of~\eqref{eq:DGdesign} are satisfied by setting \[ B = \mathcal{B}, \qquad S} %{\mathcal{S} = \begin{bmatrix} n n^t & 0 \\ 0 & 1 \end{bmatrix}. \] These choices yield the DG discretization with upwind-like fluxes for the wave equation. \end{example} \begin{example}[Wave equation with Robin boundary conditions] \label{eg:WaveRobin} We reconsider Example~\ref{eg:WaveDirichlet} after replacing the boundary condition in~\eqref{eq:39} by $\partial \phi/ \partial n + \rho \partial_t \phi = 0$ for some $\rho > 0$, or equivalently, in terms of the variables $q, \mu$ introduced there, \begin{equation} \label{eq:40} n \cdot q - \rho \mu =0, \quad \text{ on } \partial{\varOmega} \times (0, T). \end{equation} Keeping the same $S$ and changing \[ \mathcal{B} = \begin{bmatrix} 0 & n \\ -n^t & 2 \rho \end{bmatrix}, \quad B = \begin{bmatrix} \rho^{-1} n n^t & 0 \\ 0 & \rho \end{bmatrix}, \] all conditions of~\eqref{eq:DGdesign} are satisfied. \end{example} \begin{example}[Wave equation with Neumann boundary conditions] \label{eg:WaveNeumann} This is the boundary condition obtained when $\rho=0$ in~\eqref{eq:40}. The boundary condition as well as the conditions of~\eqref{eq:DGdesign} are verified with \[ \mathcal{B} = \begin{bmatrix} 0 & n \\ -n^t & 0 \end{bmatrix}, \quad B = \begin{bmatrix} n n^t & n \\ -n^t & 0 \end{bmatrix}, \] keeping $S$ unchanged. \end{example} \section{Analysis of semidiscretization} \label{sec:semidisc} In this section, we prove stability of the DG semidiscretization~\eqref{eq:DG} on the advancing fronts. When combined with standard finite element approximation estimates, this leads to the main result of this section, namely the error estimate of Theorem~\ref{thm:semidiscrete} below. \subsection{Preparatory observations} Let $H^1({\varOmega_h^{\vtx}})$ denote the broken Sobolev space isomorphic to $\Pi_{K\in {\varOmega_h^{\vtx}}} H^1(K)$. Since our variables have $L$ unknown components, we will need $L$ copies of this space. To ease notation, we abbreviate $H_h^{{\mathtt{v}}} = H^1({\varOmega_h^{\vtx}})^L,$ $H^{{\mathtt{v}}} = H^1({\varOmega^{\vtx}})^L$, and $L^{{\mathtt{v}}} = L^2({\varOmega^{\vtx}})^L$. Since the traces of a $w \in H_h^{{\mathtt{v}}}$ on element boundaries are square integrable, the following definition of the bilinear form $a: H_h^{{\mathtt{v}}}\times H_h^{{\mathtt{v}}} \to \mathbb{R}$, with the numerical fluxes $\hat{F}^n_w$ from~\eqref{eq:NumFlux}, makes sense: \begin{align} \nonumber a(w, v) & = \sum_{K \in {\varOmega_h^{\vtx}}} \bigg[ \int_K \delta f(w) : \mathop{\mathrm{grad}_x} v - \int_{\partial K} \delta \hat{F}^n_w \cdot v\bigg]. \end{align} Let $(w, v)_D$ denote the inner product in $L^2(D)$, or its Cartesian products, for any domain $D$, and let $\| w\|_D = (w, w)_D^{1/2}$. Using this notation, we may alternately write $a(\cdot, \cdot)$ as \begin{equation} \label{eq:6} a(w, v) = \sum_{K \in {\varOmega_h^{\vtx}}} \left[ \sum_{j=1}^N (\delta \Lc j w, \partial_j v)_K - (\delta \hat{F}^n_w, v)_{\partial K} \right]. \end{equation} When the domain is the often used vertex patch ${\varOmega^{\vtx}}$, we use the abbreviated notation $ (w, v)_{\mathtt{v}} = (w, v)_{\varOmega^{\vtx}} = \int_{\varOmega^{\vtx}} w \cdot v. $ Using it, we define ${M_0}} %{{\mathcal{M}_0}: L^{{\mathtt{v}}} \to L^{{\mathtt{v}}}$, and $M_1} %\mathcal{M}_1}: L^{{\mathtt{v}}} \to L^{{\mathtt{v}}}$ by \begin{align} \label{eq:M0} ({M_0}} %{{\mathcal{M}_0} w, v)_{\mathtt{v}} & = (\mathcal{G} w, v)_{\mathtt{v}} - \sum_{j=1}^N ((\partial_j \varphi_{\mathrm{bot}})\, \Lc j w, v)_{\mathtt{v}}, \\ \label{eq:M1} (M_1} %\mathcal{M}_1} w, v)_{\mathtt{v}} & = \sum_{j=1}^N ( (\partial_j \delta)\, \Lc j w, v)_{\mathtt{v}} \end{align} for all $w, v \in L^{{\mathtt{v}}}$. Let $M(\tau) = M_0 - \tau M_1$. (We will often abbreviate $M(\tau)$ to simply $M$.) Using these definitions, we may now rewrite~\eqref{eq:DG} succinctly as $(\partial_{\hat t} (M(\hat t) \hat u_h), v)_{\mathtt{v}} = a( \hat u_h, v).$ Let $\| v \|_{\mathtt{v}} = (v, v)_{\mathtt{v}}^{1/2},$ and for any operator $\mathcal{O}$ on $L^{{\mathtt{v}}}$, let \begin{equation} \label{eq:20} \| \mathcal{O}\|_{\mathtt{v}} = \sup_{v, w \in L^{{\mathtt{v}}}} \frac{(\mathcal{O} v, w)_{\mathtt{v}}}{ \| v \|_{\mathtt{v}} \| w \|_{{\mathtt{v}}}}. \end{equation} \begin{lemma} \label{lem:Mspd} The causality condition implies that $M(\tau)$ is a selfadjoint positive definite operator on $L^{{\mathtt{v}}}$ for any $0 \le \tau \le 1$ and that there is a mesh-independent constant $C_{\mathcal{L}, c}$ (depending on $\Lc j$ and $c$) such that \begin{equation} \label{eq:23} \left(1 - \frac{c}{\hat{c}} \right) (\mathcal{G} w, w)_{\mathtt{v}} \le (M w, w)_{\mathtt{v}} \le C_{\mathcal{L}, c} (\mathcal{G} w, w)_{\mathtt{v}} \end{equation} holds for all $w \in L^{{\mathtt{v}}}$. Moreover, \[ \max\big(\| M_0\|_{\mathtt{v}}, \| M_0^{-1}\|_{\mathtt{v}}, \| M_1\|_{\mathtt{v}}, \|M\|_{\mathtt{v}}, \|M^{-1}\|_{\mathtt{v}} \big) \lesssim 1. \] \end{lemma} \begin{proof} Let $\varphi = \tau \varphi_{\mathrm{top}} + (1- \tau) \varphi_{\mathrm{bot}}$. Since \begin{equation} \label{eq:3} (M(\tau) v, w)_{\mathtt{v}} = (\mathcal{G} v, w)_{\mathtt{v}} - \sum_{j=1}^N ((\partial_j \varphi)\, \Lc j v, w)_{\mathtt{v}} \end{equation} and $\partial_j \varphi$ is constant on each element, the selfadjointness is immediate from the symmetry of $\Lc j$ and $\mathcal{G}$. It remains to prove the stated positive definiteness. In accordance with~\eqref{eq:D}, let $\mathcal{D}^{(\nu)} = \sum_{j=1}^N \nu_j \Lc j.$ Recall~\cite[p.~53]{Dafer10} that hyperbolicity implies the existence of real eigenvalues $\lambda_i$ and accompanying eigenvectors $e_i$ (forming a complete set) satisfying $ \mathcal{D}^{(\nu)} e_i = \lambda_i \mathcal{G} e_i $ for any unit vector $\nu \in \mathbb{R}^N$. Since $\mathcal{D}^{(\nu)} $ and $\mathcal{G}$ are symmetric, it is easy to see that the eigenvectors $e_i$ must be orthogonal in the $\ip{x, y}_\mathcal{G} = \mathcal{G} x \cdot y$ inner product. Expanding any vector $v \in \mathbb{R}^L$ in the eigenbasis $e_i$ as follows, \[ v = \sum_{j=1}^L v_i e_i \quad \text{ with } v_i = \ip{v, e_i}_\mathcal{G}, \] and recalling that the maximal wave speed $c$ is the maximum of all such $|\lambda_i|$, \begin{align*} \mathcal{D}^{(\nu)} v \cdot v & = \sum_{i=1}^L v_i \lambda_i \mathcal{G} e_i \cdot v = \sum_{i=1}^L \lambda_i \, |v_i|^2 \le c \sum_{i=1}^L |v_i|^2 = c \,\ip{v, v}_\mathcal{G}. \end{align*} Using this inequality with $\nu = (\mathop{\mathrm{grad}_x} \varphi) / \| \mathop{\mathrm{grad}_x} \varphi \|_2$, we have \begin{align} \nonumber \mathcal{G} v \cdot v - \sum_{j=1}^N (\partial_j \varphi) \Lc j v \cdot v & = \mathcal{G} v \cdot v - \|\mathop{\mathrm{grad}_x} \varphi\|_2 \; \mathcal{D}^{(\nu)} v \cdot v \\ \label{eq:4} & \ge \left( 1 - \|\mathop{\mathrm{grad}_x} \varphi\|_2 \,c \right) \; \mathcal{G} v \cdot v. \end{align} Since $\varphi$ is a convex combination of $\varphi_{\mathrm{bot}}$ and $\varphi_{\mathrm{top}}$, both of which satisfy the causality condition~\eqref{eq:causalitycondition}, we have $\| \mathop{\mathrm{grad}_x} \varphi \|_2 \le 1/\hat{c}$. Applying this, after using~\eqref{eq:4} in~\eqref{eq:3}, the proof of the lower bound of~\eqref{eq:23} is finished. The upper bound is a consequence of the boundedness of the $\Lc j$ and $\mathcal{G}$. Finally, the stated operator norm bounds on $M(\tau),$ $M_0 = M(0)$, and their inverses follow immediately from~\eqref{eq:23}. The estimate for the operator norm of $M_1$ also follows easily since $|\partial_j \delta| \lesssim 1$. \end{proof} Let $\mathcal{F}^{\mathtt{v}}$ denote the set of facets (i.e., $(N-1)$-subsimplices) of the simplicial mesh ${\varOmega_h^{\vtx}}$ of the vertex patch ${\varOmega^{\vtx}}.$ This set is partitioned into the collection of facets on the boundary $\partial {\varOmega^{\vtx}}$ of the vertex patch, denoted by ${\Fc^\vtx_b}$, and the remainder, denoted by ${\Fc^\vtx_i}$, the set of interior facets of ${\varOmega_h^{\vtx}}$. We assume that each facet $F$ of the entire spatial mesh ${\varOmega_h}$ is endowed with a unit normal $n_F$ whose orientation is arbitrarily fixed, unless if $F$ is contained in the global boundary $\partial{\varOmega}$, in which case it points outward. Then, for any $x \in F$, set $\jmp{u}_F(x) = \lim_{{\varepsilon} \to 0} u( x + {\varepsilon} n_F) - u(x - {\varepsilon} n_F)$. Note that $\jmp{u}_F$ agrees with the previously defined jump $\jmp{u}$ on element boundaries, except possibly for a sign. Let \[ d(w, v) = -\left[ a(w, v) + a(v, w) + (M_1 w, v)_{\mathtt{v}} \right] \] for $w, v \in {H_h^{{\mathtt{v}}}}$. The first identity of the next lemma shows that $d(w, w) \ge 0$ due to~\eqref{eq:Bpd} and \eqref{eq:Spd}. \begin{lemma} \label{lem:intgparts} For all $v, w \in {H_h^{{\mathtt{v}}}}$, \begin{align} \label{eq:8} d(w, w) & = \sum_{F \in {\Fc^\vtx_i}} 2 \big(\delta\, S} %{\mathcal{S} \jmp{w}_F, \jmp{w}_F\big)_F + \sum_{F \in {\Fc^\vtx_b}} (\delta \,B w, w)_F, \\ \label{eq:2} -a(v, w) & = \sum_{K \in {\varOmega_h^{\vtx}}} ( \mathop{\mathrm{div}_x}( \delta f(v)), w)_K \\\nonumber & + \sum_{F \in {\Fc^\vtx_i}} \left[ (\delta \mathcal{D}^{(n_F)} \jmp{v}_F, \{ w\})_F + (\delta S \jmp{v}_F, \jmp{w}_F)_F\right] \\ \nonumber & - \sum_{F \in {\Fc^\vtx_b}} \frac 1 2 (\delta (\mathcal{D} - B) v, w)_F. \end{align} \end{lemma} \begin{proof} Integrating by parts on an element $K \in {\varOmega_h^{\vtx}}$, \[ \sum_{j=1}^N (\delta\, \Lc j w, \partial_j w)_K = (\delta \mathcal{D} w, w)_{\partial K} - \sum_{j=1}^N (\partial_j (\delta \Lc j w), w)_K. \] Applying the product rule to expand the derivative in the last term, using \eqref{eq:divL0}, and the symmetry of $\Lc j$, we obtain \begin{equation} \label{eq:5} 2 \sum_{j=1}^N (\delta \Lc j w, \partial_j w)_K = -\sum_{j=1}^N ( w, (\partial_j \delta) \Lc j w)_K + (\delta w, \mathcal{D} w)_{\partial K}. \end{equation} Using this in the first term of the definition of $a(w,w)$, we have \begin{align*} d(w, w) & = -2 \,a(w, w) - \sum_{j=1}^N (\partial_j \delta\; \Lc j w , w)_{\mathtt{v}} && \hspace{-4em}\text{by~\eqref{eq:M1}}, \\ & = \sum_{K \in {\varOmega_h^{\vtx}}} \big[ -( \delta \, w, \mathcal{D} w)_{\partial K} + 2 (\delta \,w, \hat{F}^n_w)_{\partial K}\big] && \hspace{-4em}\text{by~\eqref{eq:6} and~\eqref{eq:5},} \\ & = \sum_{K \in {\varOmega_h^{\vtx}}} \big[-(\delta \, w, \mathcal{D} w) _{\partial K \cap \partial{\varOmega}} + (\delta \,w, (\mathcal{D} + B) w)_{\partial K \cap \partial{\varOmega}} \big] \\ & + \sum_{K \in {\varOmega_h^{\vtx}}} \big[ -(\delta \, w, \mathcal{D} w)_{\partial K \setminus \partial{\varOmega}} +( \delta \, w, 2\mathcal{D} \{ w \} + 2S} %{\mathcal{S} \jmp{w} )_{\partial K \setminus \partial{\varOmega}}\big], \end{align*} where we used the definition of the numerical flux in \eqref{eq:NumFlux}, splitting the right hand side sum into two to accomodate the two cases in \eqref{eq:NumFlux}. The first sum, when rewritten using boundary facets, immediately yields the last term of~\eqref{eq:8} since $\delta=0$ on $\partial{\varOmega^{\vtx}} \setminus \partial{\varOmega}$. The second sum can be rearranged to a sum over interior facets $F \in {\Fc^\vtx_i}$, where $\jmp{\mathcal{D}^{(n_F)}}_F=0$ due to~\eqref{eq:divL0}, which allows for further simplifications, eventually yielding the other term on the right hand side of~\eqref{eq:8}. The proof of~\eqref{eq:2} involves a similar integration by parts starting from~\eqref{eq:6} and a similar rearrangement of sums over element boundaries to sums over facets. \end{proof} We use $C^s(0, \tau, X)$, for some Banach space $X$, to denote the $X$-valued function $w: [0, \tau] \to X$ that is $s$ times continuously differentiable. For any $v, w \in C^1(0, 1, {H_h^{{\mathtt{v}}}})$, define \[ b_\tau(v, w) = \int_0^\tau \big(\mathop{\partial_{\hat{t}}} [ M(\hat t) v(\hat t)], w({\hat t})\big)_{\mathtt{v}} \; d\hat t \;- \int_0^\tau a(v({\hat{t}}), w({\hat{t}})) \; d\hat t. \] Note that the temporal snapshots $w(\hat t)$ and $v(\hat t)$ used above, being in $H_h^{{\mathtt{v}}}$, are admissible as arguments of the form $a$. For any $z \in L^{{\mathtt{v}}}$, define $ \| z \|_{M(\tau)} = \left(M(\tau) z, z \right)_{\mathtt{v}}^{1/2}. $ This is a norm due to Lemma~\ref{lem:Mspd}. \begin{lemma} \label{lem:bdiag} For all $w \in C^1(0, 1, {H_h^{{\mathtt{v}}}})$, \[ 2\, b_\tau(w, w) = \| w (\tau)\|_{M(\tau)}^2 - \| w (0) \|_{M(0)}^2 + \int_0^\tau d(w({\hat{t}}), w({\hat{t}}))\; d\hat t. \] \end{lemma} \begin{proof} The proof relies on a simple but key identity, which is best expressed writing $M$ for $M(\hat t) = M_0 - \hat t M_1$, as follows: \begin{align*} \frac{d }{d \hat t} \int_{{\varOmega^{\vtx}}} M w \cdot w = \int_{\varOmega^{\vtx}} 2 \frac{\partial }{\partial \hat t}(M w) \cdot w - \int_{\varOmega^{\vtx}} \frac{d M}{d\hat t} w \cdot w. \end{align*} It implies $ 2\left( \mathop{\partial_{\hat{t}}} [M(\hat t) w], w\right)_{\mathtt{v}} = \mathop{\partial_{\hat{t}}} ( M(\hat t) w, w)_{\mathtt{v}} - (M_1 w, w)_{\mathtt{v}}.$ Using this in the definition of $b_\tau$, we obtain \begin{align*} 2 b_\tau(w, w) & = \int_0^\tau \left[ \frac{d }{d \hat t}\, \big( M(\hat t) w({\hat{t}}), w({\hat{t}})\big)_{\mathtt{v}} - \big(M_1 w({\hat{t}}), w({\hat{t}})\big)_{\mathtt{v}} - 2\,a(w({\hat{t}}), w({\hat{t}}))\right] d\hat t \\ & = (M(\tau) w, w)_{\mathtt{v}} - (M(0) w, w)_{\mathtt{v}} - \int_0^\tau \left[ 2\,a(w({\hat{t}}), w({\hat{t}})) + (M_1 w({\hat{t}}), w({\hat{t}})) \right]\, d\hat t \end{align*} so the result follows from the definition of $d(\cdot, \cdot)$. \end{proof} \subsection{Stability on spacetime surfaces} We will first establish a bound on the exact solution on spacetime tents (Proposition~\ref{prop:exact_stability}), which will then serve as motivation for our approach to proving stability (Lemma~\ref{lem:stability_semidiscrete}). Let $\partial_{\mathrm{top}} {T^\vtx}, \partial_{\mathrm{bot}} {T^\vtx}$ and $\partial_{\mathrm{bdr}} {T^\vtx}$ denote the top, bottom, and boundary parts, respectively, of the boundary of a tent ${T^\vtx}$, i.e., \begin{gather*} \partial_{\mathrm{top}} {T^\vtx} = \{ (x, t) \in \partial{T^\vtx}: \; t = \varphi_{\mathrm{top}}(x) \}, \qquad \partial_{\mathrm{bot}} {T^\vtx} = \{ (x, t) \in \partial {T^\vtx}: \; t = \varphi_{\mathrm{bot}}(x) \} \\ \partial_{\mathrm{bdr}} {T^\vtx} = \{ (x, t) \in \partial {T^\vtx}: \; (x, t) \text{ is neither in } \partial_{\mathrm{top}}{T^\vtx} \text{ nor in } \partial_{\mathrm{bot}}{T^\vtx} \}. \end{gather*} Note that $\partial_{\mathrm{bdr}} {T^\vtx} $ is empty whenever $\partial{\varOmega^{\vtx}}$ does not intersect $\partial{\varOmega}$. The next result shows that the solution on $\partial_{\mathrm{top}} {T^\vtx}$ can be bounded, in a tent-specific norm, by that on $\partial_{\mathrm{bot}}{T^\vtx}$. Specifically, defining \begin{equation} \label{eq:41} \| w \|_{\partial_{\tb} {T^\vtx}}^2 = \int_{\varOmega^{\vtx}} \big[ g( w(x, \varphi_{\tb}(x))) - f(w(x, \varphi_{\tb}(x)))\, \mathop{\mathrm{grad}_x}\varphi_{\tb} \big] \cdot w(x, \varphi_{\tb}(x)), \end{equation} for ${\mathrm{t\!b}} \in \{\mathrm{top}, \mathrm{bot}\}$, it follows from the next result that $\| u \|_{\partial_{\mathrm{top}} {T^\vtx}} \le \| u \|_{\partial_{\mathrm{bot}} {T^\vtx}}$ (because $\| u \|_{\partial_{\mathrm{top}} {T^\vtx}} $ and $\| u \|_{\partial_{\mathrm{bot}} {T^\vtx}}$ coincide with $\| {\hat{u}} \|_{M(1)}$ and $\| {\hat{u}} \|_{M(0)},$ respectively). \begin{proposition} \label{prop:exact_stability} On a spacetime tent ${T^\vtx}$ satisfying causality, suppose a solution $u$ of \begin{subequations} \label{eq:tenteqforu} \begin{align} \mathop{\partial_t} g(u) + \mathop{\mathrm{div}_x} f(u) & = 0 && \text{ in } {T^\vtx}, \\ \label{eq:7} (\mathcal{D} - \mathcal{B}) u & = 0 &&\text{ on } \partial_{\mathrm{bdr}} {T^\vtx}, \end{align} \end{subequations} is smooth enough for $\hat u = u \circ \varPhi$ to be in $C^1(0, 1, {H^{{\mathtt{v}}}})$. Then $\hat u = u \circ \varPhi$ at pseudotime~$\tau,$ for any $0 \le \tau \le 1,$ satisfies \[ \| \hat u (\tau)\|_{M(\tau)} \le \| \hat u (0) \|_{M(0)}. \] \end{proposition} \begin{proof} Since $\hat u$ satisfies the mapped equation $\mathop{\partial_{\hat{t}}} (g(\hat u) - f(\hat u) \mathop{\mathrm{grad}_x} \varphi) + \mathop{\mathrm{div}_x}\big[\delta f(\hat u)\big]=0$, we have $ (\mathop{\partial_{\hat{t}}} [M(\hat t) \hat u], v)_{\mathtt{v}} + (\mathop{\mathrm{div}_x}(\delta f(\hat u)), v)_{\mathtt{v}} = 0 $ for all $v \in {H^{{\mathtt{v}}}}$. Now, observe that \[ -a(\hat u({\hat{t}}), v) = \big(\mathop{\mathrm{div}_x}\big[\delta f(\hat u({\hat{t}}))\big], v\big)_{\mathtt{v}} \] by Lemma~\ref{lem:intgparts}: indeed, the jumps in \eqref{eq:2} of the lemma vanish when applied to $\hat u({\hat{t}})$ since $\hat u({\hat{t}}) \in {H^{{\mathtt{v}}}}$, and moreover, the last term of \eqref{eq:2} also vanishes due to \eqref{eq:7} and \eqref{eq:kernelB}. Thus, \[ (\mathop{\partial_{\hat{t}}} [M(\hat t) \hat u], v)_{\mathtt{v}} - a(\hat u({\hat{t}}), v) = 0 \] for all $v \in {H^{{\mathtt{v}}}}$ and each $0 \le \hat t\le 1$. Integrating over $\hat t$ from 0 to $\tau$, we obtain \begin{equation} \label{eq:exactu-bform} b_\tau(\hat u, w) = 0, \end{equation} for all $w \in C^1(0, 1, {H^{{\mathtt{v}}}}).$ Choosing $w = \hat u$ and applying Lemma~\ref{lem:bdiag}, we have \[ \| \hat u (\tau)\|_{M(\tau)}^2 - \| \hat u (0) \|_{M(0)}^2 + \int_0^\tau d(\hat u({\hat{t}}), \hat u({\hat{t}}))\; d\hat t = 0. \] Finally, we apply~\eqref{eq:8} of Lemma~\ref{lem:intgparts}. Noting that $\jmp{\hat u({\hat{t}})}_F = 0$ on all interior facets $F$ and recalling the positivity assumption~\eqref{eq:Bpd} on $B$, we complete the proof. \end{proof} \begin{definition}[Semidiscrete flow: $R^{\mathrm{sem}}_h(\tau)$] \label{def:semidiscrete} For any $0\le \tau \le 1$, define $R^{\mathrm{sem}}_h(\tau): V_h^\vtx \to V_h^\vtx$ as follows. Given a $v_h^0 \in V_h^\vtx$, let $v_h \in C^1(0, 1, V_h^\vtx)$ solve \begin{align} \label{eq:9v} \left( \mathop{\partial_{\hat{t}}}\big[g(v_h) - f(v_h)\mathop{\mathrm{grad}_x} \varphi\big], w\right)_{\mathtt{v}} & = a(v_h(\hat t), w), && 0 < \hat t \le 1, \\ \nonumber v_h( 0) & = v_h^0, && \hat t = 0, \end{align} for all $w \in V_h^\vtx$. Set $R^{\mathrm{sem}}_h(\tau) v_h^0$ to $v_h(\tau)$. (In particular $R^{\mathrm{sem}}_h(0) v_h^0 = v_h(0) = v_h^0$.) \end{definition} \begin{lemma}[Stability of semidiscretization] \label{lem:stability_semidiscrete} For any $0 \le \tau \le 1$, and any $v \in V_h^\vtx$, \[ \| R^{\mathrm{sem}}_h (\tau) v\|_{M(\tau)} \le \| v \|_{M(0)}. \] \end{lemma} \begin{proof} The argument is similar to the proof of Proposition~\ref{prop:exact_stability}. Let $v_h(\tau) = R^{\mathrm{sem}}_h(\tau) v$. We need to bound $v_h(\tau)$ by $v_h(0) = v$. Replacing $w$ in~\eqref{eq:9v} by a time-dependent test function $\tilde v \in C^1(0, 1, V_h^\vtx)$ and integrating over $\hat t$ from $0$ to $\tau$, we have \[ \int_0^\tau \bigg[ (\mathop{\partial_{\hat{t}}} [M(\hat t) v_h], \tilde v)_{\mathtt{v}} - a(v_h({\hat{t}}), \tilde v(\hat t)) \bigg] \, d\hat t= 0, \] or equivalently, $ b_\tau(v_h, \tilde v) = 0, $ for all $ \tilde v \in C^1(0, 1, V_h^\vtx). $ Now, choosing $\tilde v = v_h$ and applying Lemma~\ref{lem:bdiag}, we find that \[ \| v_h (\tau) \|_{M(\tau)}^2 = \| v_h (0) \|_{M(0)}^2 - \int_0^\tau d(v_h({\hat{t}}), v_h({\hat{t}})) \; d\hat t. \] Since $d(v_h ({\hat{t}}), v_h({\hat{t}})) \ge 0$ by \eqref{eq:8} of Lemma~\ref{lem:intgparts}, the proof is complete. \end{proof} \subsection{Local error in a tent} To estimate the error in the semidiscrete solution, we use, like previous authors~\cite{CockbShu98}, the spatial $L^2$ projection into the DG space $V_h^\vtx$. Let $P_h : L^{{\mathtt{v}}} \to V_h^\vtx$ be defined by $(P_h v, w)_{\mathtt{v}} = (v, w)_{\mathtt{v}}$ for all $v \in L^{{\mathtt{v}}} $ and $w \in V_h^\vtx$. Define \[ |v |_d = d(v, v)^{1/2}, \qquad v \in {H_h^{{\mathtt{v}}}}. \] This is a seminorm by \eqref{eq:8} of Lemma~\ref{lem:intgparts} and our assumptions~\eqref{eq:Bpd} and~\eqref{eq:Spd}. Let $h_K = \mathop{\text{diam}} K$ for any spatial element $K$. The next lemma also uses the broken Sobolev space $H^{s}({\varOmega_h^{\vtx}}) = \Pi_{K \in {\varOmega_h^{\vtx}}} H^s(K)$, and \[ h_{{\mathtt{v}}} = \max_{K \in {\varOmega_h^{\vtx}}} h_K, \qquad |w|_{H^s({\varOmega_h^{\vtx}})^L}^2 = \sum_{K\in {\varOmega_h^{\vtx}}} |w|_{H^s(K)^L}^2. \] \begin{lemma} \label{lem:a_proj_bd} If $w \in H^{l}({\varOmega_h^{\vtx}})^L$ for some $1 \le l \le p+1$, then for any $v_h \in V_h^\vtx$, \[ a(w - P_h w, v_h)\, \lesssim\, h_{{\mathtt{v}}}^{l}\, |w|_{H^{l}({\varOmega_h^{\vtx}})^L } |v_h|_d. \] \end{lemma} \begin{proof} Let $e = w - P_hw$. Then the first term on the right hand side of \begin{align*} a(e, v_h) & = \sum_{K \in {\varOmega_h^{\vtx}}} \sum_{j=1}^N (\delta \Lc j e, \partial_j v_h)_K - \sum_{K \in {\varOmega_h^{\vtx}}} (\delta \hat{F}^n_e, v_h)_{\partial K} \end{align*} must vanish, because $\delta \partial_j v_h|_K$ is a polynomial of degree at most $p$ and $\Lc j$ is constant due to assumption~\eqref{eq:G_L_const}. Hence \begin{align*} a(e, v_h) & = -\sum_{K \in {\varOmega_h^{\vtx}}} (\delta (\mathcal{D} \{e\} + S\jmp{e}), v_h)_{\partial K \setminus \partial{\varOmega}} + \frac 1 2 (\delta ( \mathcal{D} + B ) e, v_h)_{\partial K \cap \partial {\varOmega}} \\ & = \sum_{F \in {\Fc^\vtx_i}} (\delta \mathcal{D}^{(n_F)} \{e\}, \jmp{v_h}_F)_F - (\delta S\jmp{e}_F, \jmp{v_h}_F)_F - \sum_{F \in {\Fc^\vtx_b}} \frac 1 2 (\delta ( \mathcal{D} + B ) e, v_h)_F \\ & \lesssim \sum_{F \in {\Fc^\vtx_i}} \int_F \delta \|e \|_2 \,\big|\jmp{v_h}\big|_S + \sum_{F \in {\Fc^\vtx_b}} \int_F \delta \|e \|_2 \,|v_h|_B \end{align*} due to assumptions~\eqref{eq:Sbound}, \eqref{eq:11}, and~\eqref{eq:12}. On any facet $F$ adjacent to an element $K$, by shape regularity and the well-known properties of $L^2$ projectors, $ h_{{\mathtt{v}}}^{1/2} \| e \|_F \lesssim h_{{\mathtt{v}}}^{l} | w |_{H^{l}(K)^L}. $ Since $\delta \lesssim h_{{\mathtt{v}}}$, the result now follows after applying Cauchy-Schwarz inequality and~\eqref{eq:8} of Lemma~\ref{lem:intgparts}. \end{proof} The next lemma provides control of the local error at any pseudotime $\tau$ in terms of the initial error. To measure the regularity of functions $w$ on a tent ${T^\vtx}$, we find it convenient to use (semi)norms computed using the pull back $w \circ \varPhi$ on ${\hat{T}^\vtx}$, defined by \begin{equation} \label{eq:spatialseminorm} |w |_{{\mathtt{v}}, l} = \sup_{0 \le \tau \le 1} | (w \circ \varPhi) (\tau)|_{H^{l}({\varOmega_h^{\vtx}})^L}, \qquad \|w \|_{{\mathtt{v}}, l} = \sup_{0 \le \tau \le 1} \| (w \circ \varPhi) (\tau)\|_{H^{l}({\varOmega_h^{\vtx}})^L}. \end{equation} Clearly, these are bounded when $\hat{w} = w \circ \varPhi$ is in $C^0(0, 1, H^{l}({\varOmega_h^{\vtx}})^L)$. \begin{lemma}[Local error bound] \label{lem:local_semidiscrete_error} Let $u$ be the exact solution of~\eqref{eq:tenteqforu} on a causal tent ${T^\vtx}$, ${\hat{u}} = u \circ \varPhi \in C^1(0, 1, H^{{\mathtt{v}}} \cap H^{p+1}({\varOmega_h^{\vtx}})^L)$, and let ${\hat{u}}_h(\tau) = R^{\mathrm{sem}}_h(\tau) {\hat{u}}_h^0$ for any ${\hat{u}}_h^0 \in V_h^\vtx$. Then \[ \| {\hat{u}} (\tau) - {\hat{u}}_h (\tau) \|_{M(\tau)} \lesssim \| {\hat{u}} (0) - {\hat{u}}_h^0 \|_{M(0)} + h_{{\mathtt{v}}}^{p+1}| u |_{{\mathtt{v}}, p+1}. \] \end{lemma} \begin{proof} Integrating~\eqref{eq:9v} of Definition~\ref{def:semidiscrete}, we see that the semidiscrete solution ${\hat{u}}_h$ satisfies $b_\tau({\hat{u}}_h, w_h) = 0$ for all $w_h \in C^1(0, 1, V_h^\vtx).$ We have also shown that the exact solution ${\hat{u}}$ satisfies a similar identity, namely~\eqref{eq:exactu-bform}. Subtracting these identities, we have \begin{equation} \label{eq:13} b_\tau({\hat{u}} - {\hat{u}}_h, w_h)=0 \qquad \text{for all }w_h \in C^1(0, 1, V_h^\vtx). \end{equation} Let $e_h(x, t)$ in $C^1(0, 1, V_h^\vtx)$ denote the function whose time slices are defined by $e_h (\tau) = {\hat{u}}_h (\tau) - P_h {\hat{u}} (\tau)$ for each $0 \le \tau \le 1.$ Equation~\eqref{eq:13} implies that $b_\tau(e_h, e_h) = b_\tau( {\hat{u}} - P_h {\hat{u}}, e_h)= b_\tau( e, e_h), $ where we have set $e = {\hat{u}} - P_h {\hat{u}}$. Therefore, together with Lemma~\ref{lem:bdiag}, we obtain \begin{align*} \nonumber \frac 1 2 & \left( \| e_h (\tau)\|_{M(\tau)}^2 - \| e_h (0) \|_{M(0)}^2 + \int_0^\tau \big|e_h({\hat{t}})\big|^2_d\; d\hat t \right) = b_\tau( e_h, e_h) = b_\tau( e, e_h) \\ \nonumber & = \int_0^\tau \big[ ( \mathop{\partial_{\hat{t}}}[M(\hat t)e], e_h)_{\mathtt{v}} - a(e({\hat{t}}), e_h({\hat{t}}))\big]\, d\hat t \\ & = (M(\tau) e (\tau), e_h (\tau))_{\mathtt{v}} - (M_0 e (0), e_h (0))_{\mathtt{v}} -\int_0^\tau \Big[ (M(\hat t) e, \mathop{\partial_{\hat{t}}} e_h)_{\mathtt{v}} + a(e({\hat{t}}), e_h({\hat{t}})) \Big]\, d\hat t. \end{align*} Since $ \mathop{\partial_{\hat{t}}} e_h$ is of degree at most $p$ on each element and $ ( M(\hat t) e, \mathop{\partial_{\hat{t}}} e_h)_{\mathtt{v}} = (\mathcal{G} e, \mathop{\partial_{\hat{t}}} e_h)_{\mathtt{v}} - \sum_{j=1}^N((\partial_j \varphi) \,\Lc j e, \mathop{\partial_{\hat{t}}} e_h)_{\mathtt{v}} = 0 $ by~\eqref{eq:G_L_const} and the orthogonality property of the projection error. Applying Lemma~\ref{lem:a_proj_bd} to the last term, \begin{align*} \| e_h &(\tau)\|_{M(\tau)}^2 - \| e_h (0) \|_{M(0)}^2 + \int_0^\tau \big|e_h({\hat{t}})\big|^2_d\; d\hat t \;\lesssim \; \\ & (M(\tau) e (\tau), e_h (\tau))_{\mathtt{v}} - (M(0) e (0), e_h (0))_{\mathtt{v}} + h_{{\mathtt{v}}}^{p+1} \int_0^\tau |{\hat{u}}({\hat{t}})|_{H^{p+1}({\varOmega_h^{\vtx}})^L} |e_h (\hat t)|_d\; d\hat t. \end{align*} By Cauchy-Schwarz inequality in the inner product (see Lemma~\ref{lem:Mspd}) generated by $M(\tau)$, \[ (M(\tau) e (\tau), e_h (\tau))_{\mathtt{v}} \;\lesssim\; h_{{\mathtt{v}}}^{p+1} |{\hat{u}}(\tau)|_{H^{p+1}({\varOmega_h^{\vtx}})^L}\| e_h (\tau) \|_{M(\tau)}, \] which holds also when $\tau=0$. Further applications of Cauchy-Schwarz and Young's inequalities yield \begin{align*} \| e_h &(\tau) \|_{M(\tau)}^2 + \int_0^\tau \big|e_h({\hat{t}})\big|_d^2 \; d\hat t \\ & \lesssim \| e_h (0) \|_{M(0)}^2 \\ & + {h_{{\mathtt{v}}}}^{2(p+1)}\! \left( |{\hat{u}}(0)|_{H^{p+1}({\varOmega_h^{\vtx}})^L}^2 + |{\hat{u}}(\tau)|_{H^{p+1}({\varOmega_h^{\vtx}})^L}^2 + \int_0^\tau \big|{\hat{u}}({\hat{t}})\big|_{H^{p+1}({\varOmega_h^{\vtx}})^L}^2\, d\hat t\right) \\ &\lesssim \| e_h (0) \|_{M(0)}^2 + {h_{{\mathtt{v}}}}^{2(p+1)}| u |_{{\mathtt{v}}, p+1}^2. \end{align*} Finally, using the well known error bounds for the $L^2$ projection and the triangle inequality, we obtain the result of the lemma. \end{proof} \subsection{Global error bound} Recall the advancing front $C_i$ defined by~\eqref{eq:Ci} and the layer $L_i$ defined by~\eqref{eq:Li}. We will use the following ``${\mathtt{T2G}}$'' procedure several times in the sequel. \begin{definition}[Tent propagators to global propagators: ${\mathtt{T2G}}$] \label{def:T2G} Suppose we are given a collection of operators $\mathcal{R}$, one for each tent. The element of $\mathcal{R}$ corresponding to a tent ${T^\vtx}$ is an operator $R^{{T^\vtx}}: L^{{\mathtt{v}}} \to L^{{\mathtt{v}}}$, which we refer to as the given {\em tent propagator} on ${T^\vtx}$, or more precisely, on its preimage ${\hat{T}^\vtx}$. We think of $R^{{T^\vtx}}$ as transforming functions given at the bottom of ${\hat{T}^\vtx}$ to functions at the top of ${\hat{T}^\vtx}$ by some specific discrete process or by the exact solution operator. To produce global propagation operators from the collection $\mathcal{R}$, we start by mapping functions on $C_{i-1}$ to functions on $C_i$, or equivalently per the advancing front definition~\eqref{eq:Ci}, by mapping functions of $(x, \varphi_{i-1}(x))$ to functions of $(x, \varphi_{i}(x))$. The {\em layer propagator} of the layer $L_i$ generated by $\mathcal{R}$, denoted by $G^{i, i-1}: L^2(C_{i-1})^L \to L^2(C_i)^L$, is defined by first considering points on the front $C_i$ which have not advanced in time, where $G^{i, i-1} w$ simply coincides with $w$, and then considering the remaining points $(x, \varphi_i(x))$ on $C_i$ which are separated from $(x, \varphi_{i-1}(x))$ on $C_{i-1}$ by a tent, say ${T^\vtx}$, where we use the tent propagator of ${T^\vtx}$ (see Figure~\ref{fig:t2g}). The next formula states this precisely. For any $w \in L^2(C_{i-1})^L$, \[ (G^{i, i-1} w)(x, \varphi_i(x)) = \begin{cases} w(x, \varphi_{i-1}(x)) & \text{ at } x \in {\varOmega} \text{ where } \varphi_i(x) = \varphi_{i-1}(x), \\ (R^{{T^\vtx}} \hat w_{\mathtt{v}}) (x) & \text{ if } x \in {\varOmega^{\vtx}} \text{ for some } {\mathtt{v}} \in V_i, \end{cases} \] where $\hat w_{\mathtt{v}} (x) = w(x, \varphi_{i-1}(x))|_{{\varOmega^{\vtx}}}$. Finally, for a pair $i, j$ with $i>j \ge 0$, the {\em global propagator} generated by $\mathcal{R}$ is the operator $G^{i, j}: L^2(C_j)^L \to L^2(C_i)^L$, defined by \[ G^{i, j} = G^{i, i-1} \circ G^{i-1, i-2} \circ \cdots\circ G^{j+1, j}. \] Let ${\mathtt{T2G}}$ denote this process of producing global propagators from a collection of tent propagators, i.e., we define ${\mathtt{T2G}}(i, j, \mathcal{R})$ to be the $G^{i, j}$ above. \end{definition} \begin{figure} \centering \begin{tikzpicture}[scale=2.5] \begin{scope} \coordinate (a) at (0,0); \coordinate (b) at (0.5,0); \coordinate (c) at (1,0); \coordinate (d) at (1.5,0); \coordinate (e) at (1.8,0); \coordinate (f) at (2,0); \def0.8{0} \def0.5{0} \def0.8{0} \def0.35}%0.35{0} \def0.45{0} \def0.2{0} \draw[<->, gray] ($(a)-(0, 0.22)$)--($(f)-(0, 0.22)$) node[midway, below] {${\varOmega}$}; \draw[<->, gray] ($(b)-(0, 0.18)$)--($(d)-(0, 0.18)$) node[midway, above] {${\varOmega^{\vtx}}$}; \node[above, gray] at (c) {${\mathtt{v}}$}; \draw[mark=|,mark size=0.5pt,mark options={line width=.6pt},-latex] plot (a) -- plot (b) -- plot (c) -- plot (d) -- plot (e) -- plot (f) -- (2.2,0.0) node[right, gray] {\large $x$}; \draw[-latex] (a) -- (0.0,1.0) node[above, gray] {\large $t$}; \def0.5{0.5} \draw[blue, thick] let \p{a}=(a), \p{b}=(b), \p{c}=(c), \p{d}=(d), \p{e}=(e), \p{f}=(f) in plot coordinates {(\x{a},0.8)} -- plot coordinates {(\x{b},0.5)} -- plot coordinates {(\x{c},0.8)} -- plot coordinates {(\x{d},0.35}%0.35)} -- plot coordinates {(\x{e},0.45)} -- plot coordinates {(\x{f},0.2)}; \def0.35{0.35} \draw let \p{c}=(c), \p{d}=(d), \p{e}=(e) in plot (c) -- plot coordinates {(\x{d},0.35}%0.35)} -- plot (e) -- plot coordinates {(\x{d},0.35)} -- cycle; \def0.35}%0.35{0.35 \draw [blue, thick] let \p{a}=(a), \p{b}=(b), \p{c}=(c), \p{d}=(d), \p{e}=(e), \p{f}=(f) in plot coordinates {(\x{a},0.8)} -- plot coordinates {(\x{b},0.5)} -- plot coordinates {(\x{c},0.8)} -- plot coordinates {(\x{d},0.35}%0.35)} -- plot coordinates {(\x{e},0.45)} -- plot coordinates {(\x{f},0.2)}; \def0.2{0.2} \draw let \p{e}=(e), \p{f}=(f) in plot (e) -- plot coordinates {(\x{f},0.2)} -- plot (f) -- cycle; \def0.2{0.2} \draw [blue, thick] let \p{a}=(a), \p{b}=(b), \p{c}=(c), \p{d}=(d), \p{e}=(e), \p{f}=(f) in plot coordinates {(\x{a},0.8)} -- plot coordinates {(\x{b},0.5)} -- plot coordinates {(\x{c},0.8)} -- plot coordinates {(\x{d},0.35}%0.35)} -- plot coordinates {(\x{e},0.45)} -- plot coordinates {(\x{f},0.2)}; \def0.8{0.8} \draw [green!50!blue, thick, fill=green!20, opacity=0.4] let \p{b}=(b), \p{c}=(c), \p{d}=(d) in plot coordinates {(\x{b},0.5)} -- plot coordinates {(\x{c},0.8)} -- plot coordinates {(\x{d},0.35}%0.35)} -- plot coordinates {(\x{c},0.8)} -- cycle; \node at ($(c)+(0,0.4)$) {$T^{\mathtt{v}}$}; \draw[blue, thick, ->] ($(c)+(-0.1,0.12)$) [out=110, in=-110] to ($(c)+(-0.1, 0.72)$); \node at ($(c)+(-0.3,0.5)$) {{$R^{T^{{\mathtt{v}}}}$}}; \def0.8{0.8} \def0.5{0.5} \def0.8{0.8} \def0.45{0.45} \def0.45{0.45} \draw [green!50!blue, dotted, thick] let \p{a}=(a), \p{b}=(b), \p{c}=(c), \p{d}=(d), \p{e}=(e), \p{f}=(f) in plot coordinates {(\x{a},0.8)} -- plot coordinates {(\x{b},0.5)} -- plot coordinates {(\x{c},0.8)} -- plot coordinates {(\x{d},0.35}%0.35)} -- plot coordinates {(\x{e},0.45)} -- plot coordinates {(\x{f},0.2)}; \draw[red, thick] (a)--(f); \node[red] at ($(b)+(-0.3, 0.07)$) {$C_0$}; \node[blue] at ($(b)+(-0.3,0.35)$) {$C_1$}; \node[green!50!blue] at ($(b)+(-0.3,0.78)$) {$C_2$}; \end{scope} \begin{scope}[shift={(2.65,0)}] \coordinate (a) at (0,0); \coordinate (b) at (0.5,0); \coordinate (c) at (1,0); \coordinate (d) at (1.5,0); \coordinate (e) at (1.8,0); \coordinate (f) at (2,0); \def0.8{0} \def0.5{0} \def0.8{0} \def0.35}%0.35{0} \def0.45{0} \def0.2{0} \draw[mark=|,mark size=0.5pt,mark options={line width=.6pt},-latex] plot (a) -- plot (b) -- plot (c) -- plot (d) -- plot (e) -- plot (f) -- (2.2,0.0) node[right, gray] {\large $x$}; \draw[-latex] (a) -- (0.0,1.0) node[above, gray] {\large $t$}; \def0.5{0.5} \draw[blue, thick] let \p{a}=(a), \p{b}=(b), \p{c}=(c), \p{d}=(d), \p{e}=(e), \p{f}=(f) in plot coordinates {(\x{a},0.8)} -- plot coordinates {(\x{b},0.5)} -- plot coordinates {(\x{c},0.8)} -- plot coordinates {(\x{d},0.35}%0.35)} -- plot coordinates {(\x{e},0.45)} -- plot coordinates {(\x{f},0.2)}; \def0.35{0.35} \draw let \p{c}=(c), \p{d}=(d), \p{e}=(e) in plot (c) -- plot coordinates {(\x{d},0.35}%0.35)} -- plot (e) -- plot coordinates {(\x{d},0.35)} -- cycle; \def0.35}%0.35{0.35 \draw [blue, thick] let \p{a}=(a), \p{b}=(b), \p{c}=(c), \p{d}=(d), \p{e}=(e), \p{f}=(f) in plot coordinates {(\x{a},0.8)} -- plot coordinates {(\x{b},0.5)} -- plot coordinates {(\x{c},0.8)} -- plot coordinates {(\x{d},0.35}%0.35)} -- plot coordinates {(\x{e},0.45)} -- plot coordinates {(\x{f},0.2)}; \def0.2{0.2} \draw let \p{e}=(e), \p{f}=(f) in plot (e) -- plot coordinates {(\x{f},0.2)} -- plot (f) -- cycle; \def0.2{0.2} \draw [blue, thick] let \p{a}=(a), \p{b}=(b), \p{c}=(c), \p{d}=(d), \p{e}=(e), \p{f}=(f) in plot coordinates {(\x{a},0.8)} -- plot coordinates {(\x{b},0.5)} -- plot coordinates {(\x{c},0.8)} -- plot coordinates {(\x{d},0.35}%0.35)} -- plot coordinates {(\x{e},0.45)} -- plot coordinates {(\x{f},0.2)}; \def0.8{0.8} \draw [green!50!blue, thick, fill=green!20, opacity=0.4] let \p{b}=(b), \p{c}=(c), \p{d}=(d) in plot coordinates {(\x{b},0.5)} -- plot coordinates {(\x{c},0.8)} -- plot coordinates {(\x{d},0.35}%0.35)} -- plot coordinates {(\x{c},0.8)} -- cycle; \def0.45{0.45} \draw [green!50!blue, thick, fill=green!20, opacity=0.4] let \p{d}=(d), \p{e}=(e), \p{f}=(f) in plot coordinates {(\x{d},0.35}%0.35)} -- plot coordinates {(\x{e},0.45)} -- plot coordinates {(\x{f},0.2)} -- plot coordinates {(\x{e},0.45)} -- cycle; \def0.8{0.8} \def0.5{0.5} \def0.8{0.8} \def0.45{0.45} \def0.45{0.45} \def0.8{0.8} \draw [green!50!blue, thick, fill=green!20, opacity=0.4] let \p{a}=(a), \p{b}=(b) in plot (a) -- plot coordinates {(\x{a},0.8)} -- plot coordinates {(\x{b},0.5)} -- cycle; \draw [green!50!blue, thick] let \p{a}=(a), \p{b}=(b), \p{c}=(c), \p{d}=(d), \p{e}=(e), \p{f}=(f) in plot coordinates {(\x{a},0.8)} -- plot coordinates {(\x{b},0.5)} -- plot coordinates {(\x{c},0.8)} -- plot coordinates {(\x{d},0.35}%0.35)} -- plot coordinates {(\x{e},0.45)} -- plot coordinates {(\x{f},0.2)}; \draw[red, thick] (a)--(f); \node[red] at ($(b)+(-0.3, 0.07)$) {$C_0$}; \node[blue] at ($(b)+(-0.3,0.35)$) {$C_1$}; \node[green!50!blue] at ($(b)+(-0.3,0.78)$) {$C_2$}; \draw[blue, thick, ->] ($(c)+(-0.1,0.12)$) [out=110, in=-110] to ($(c)+(-0.1, 0.72)$); \draw[blue, thick, ->] ($(a)+(0.1,0.12)$) [out=110, in=-110] to ($(a)+(0.1, 0.72)$); \draw[blue, thick, ->] ($(f)+(-0.1,0.12)$) [out=110, in=-110] to ($(f)+(-0.1, 0.3)$); \node at ($(f)+(-0.26,0.3)$) {{$G^{2, 1}$}}; \node at ($(c)+(-0.29,0.5)$) {{$G^{2, 1}$}}; \draw[red, thick, ->] ($(b)+(-0.1, 0.02)$) [out=80, in=-70] to ($(b)+(-0.1, 0.37)$); \draw[red, thick, ->] ($(d)+(-0.15, 0.02)$) [out=80, in=-70] to ($(d)+(-0.15, 0.23)$); \draw[red, thick, ->] ($(f)+(-0.05, 0.02)$) [out=80, in=-70] to ($(f)+(-0.05, 0.13)$); \node at ($(b)+(0.07,0.2)$) {{$G^{1, 0}$}}; \node at ($(d)+(0.01,0.12)$) {{$G^{1, 0}$}}; \end{scope} \end{tikzpicture} \caption{Schematic of a tent propagator (left) and two layer propagators (right).} \label{fig:t2g} \end{figure} For the semidiscretization, the tent propagator on ${T^\vtx}$ is the operator $R^{\mathrm{sem}}_h(1) \circ P_h : L^{{\mathtt{v}}} \to V_h^\vtx \subset L^{{\mathtt{v}}}$, set using the operator $R^{\mathrm{sem}}_h(\tau)$ of Definition~\ref{def:semidiscrete}, evaluated at pseudotime $\tau=1$ (corresponding to the tent top). Collecting these semidiscrete tent propagators into $\mathcal{R}_h$ we use Definition~\ref{def:T2G} to set the corresponding semidiscrete global propagators $R_h^{i, j} = {\mathtt{T2G}}(i, j, \mathcal{R}_h).$ The exact propagator $R^{i, j}$ is defined similarly, replacing $R^{\mathrm{sem}}_h$ by the exact propagator of the hyperbolic system on tents (without projecting tent bottom data), so that if $u(x,t)$ is the global exact solution of the hyperbolic system on ${\varOmega} \times [0, T]$, then \begin{equation} \label{eq:16} R^{i, j}(u|_{C_j}) = u|_{C_i}. \end{equation} The semidiscrete error propagation operators across layers can now be defined by \[ E_h^{i, j} = R^{i, j} - R_h^{i, j}. \] Letting $C_m$ denote the final front and $C_0$ the first, we are interested in bounding the error at the final front, which is simply $E_h^{m, 0} u^0$. Setting $R^{0,0}$ and $R_h^{m, m}$ to the trivial identity operators, we have the following lemma. \begin{lemma} \label{lem:errorpropagation} \quad $ \displaystyle{ E_h^{m, 0} = \sum_{j=1}^m R_h^{m, j} E_h^{j, j-1} R^{j-1, 0}. }$ \end{lemma} \begin{proof} Adding and subtracting $R_h^{m, m-1} \circ R^{m-1, 0}$, \begin{align*} E_h^{m, 0} & = R^{m, 0} - R_h^{m, 0} = R^{m, m-1} \circ R^{m-1, 0} - R_h^{m, m-1} \circ R_h^{m-1, 0} \\ & = (R^{m, m-1} - R_h^{m, m-1}) \circ R^{m-1, 0} + R_h^{m, m-1} \circ (R^{m-1, 0} -R_h^{m-1, 0}), \end{align*} i.e., \[ E_h^{m, 0} = E_h^{m, m-1} R^{m-1, 0} + R_h^{m, m-1} E_h^{m-1, 0}. \] The last term admits a recursive application of the same identity. Doing so $m-1$ times, the lemma is proved. \end{proof} Our global error analysis proceeds in a norm on advancing fronts defined by \[ \| w \|_{C_i}^2 = \int_{\varOmega} \big[ g( w(x, \varphi_i(x))) - f(w(x, \varphi_i(x)))\, (\mathop{\mathrm{grad}_x} \varphi_i)(x) \big] \cdot w(x, \varphi_i(x)). \] Let $\| w \|_{C_i, {\mathtt{v}}}$ be defined by the same equality after replacing the integral over ${\varOmega}$ by integral over ${\varOmega^{\vtx}}$. Since the first and last fronts, $C_0$ and $C_m$, respectively, are flat \begin{equation} \label{eq:14} \| w \|_{C_0}^2 = (\mathcal{G} w(0), w(0))_{\varOmega} \quad \text{ and }\quad \| w \|_{C_m}^2 = (\mathcal{G} w(T), w(T))_{\varOmega}, \end{equation} where, as before, $T$ is the final time. \begin{lemma} \label{lem:Rh_bound} For all $w \in L^2(C_j)^L$ and $i > j$, we have \[ \| R_h^{i, j} w \|_{C_i} \le \| w \|_{C_j}. \] \end{lemma} \begin{proof} First consider the case $j = i-1$ and a ${\mathtt{v}} \in V_i$. Applying Lemma~\ref{lem:stability_semidiscrete} on tent ${T^\vtx}$ in $L_i$, we obtain that $\hat r_h = (R_h^{i, i-1} w) \circ \varPhi$ and $\hat w = w \circ \varPhi$ satisfies \begin{equation} \label{eq:10} \| \hat r_h \|_{M(1)}^2 \le \| P_h \hat w\|_{M(0)}^2. \end{equation} By~\eqref{eq:G_L_const}, \begin{align*} \| P_h \hat w \|_{M(0)}^2 & = (\mathcal{G} P_h \hat w, P_h \hat w)_{\mathtt{v}} - \sum_{j=1}^N (\partial_j \varphi_{\mathrm{bot}} \Lc j P_h \hat w, P_h \hat w)_{\mathtt{v}} \\ & = (M(0) P_h \hat w, \hat w)_{\mathtt{v}} \le \| P_h \hat w \|_{M(0)} \| \hat w \|_{M(0)}, \end{align*} so~\eqref{eq:10} implies that $ \| \hat r_h \|_{M(1)}^2 \le \|\hat w\|_{M(0)}^2,$ which is the same as $ \| R_h^{i, i-1} w \|^2_{C_i, {\mathtt{v}}} \le \| w \|_{C_{i-1}, {\mathtt{v}}}^2. $ Summing over ${\mathtt{v}} \in V_i$, we prove that \begin{equation} \label{eq:9} \| R_h^{i, i-1} w \|_{C_i} \le \| w \|_{C_{i-1}}. \end{equation} Repeatedly applying this inequality on any further layers in between $i-1$ and $j$ proves the lemma. \end{proof} In the subsequent statements of error estimates like in the next theorem, we will tacitly assume that the exact solution is smooth enough for the seminorms on the right hand side to be finite. \begin{theorem}[Error estimate for the semidiscretization] \label{thm:semidiscrete} Suppose ${\varOmega} \times (0, T)$ is meshed by $m$ layers of tents satisfying the causality condition~\eqref{eq:causalitycondition}. At the final time $T$, the difference between the exact solution $u(T)$ and the semidiscrete MTP solution $u_h (T) \in V_h$ satisfies \[ \| u (T) - u_h (T) \|_{\varOmega} \;\lesssim\; \bigg(\sum_{j=1}^m h_j\bigg)^{1/2} \bigg( \sum_{j=1}^m \sum_{{\mathtt{v}} \in V_j} h_{{\mathtt{v}}}^{2p+1} |u|_{{\mathtt{v}}, p+1}^2 \bigg)^{1/2}, \] where $h_j = \max_{{\mathtt{v}} \in V_j} h_{{\mathtt{v}}}$. \end{theorem} \begin{proof} Let $u_j = u |_{C_j}$. Then, per~\eqref{eq:16}, $R^{j-1, 0} u^0 = u_{j-1}$. Therefore, \begin{align} \nonumber \| u (T) - u_h (T) \|_{\varOmega} & \lesssim \| u- u_h \|_{C_m} = \| E_h^{m, 0} u^0 \|_{C_m} && \text{by~\eqref{eq:14}} \\ \nonumber & \le \sum_{j=1}^m \| R_h^{m, j} E_h^{j, j-1} u_{j-1} \|_{C_m} && \text{by Lemma~\ref{lem:errorpropagation}} \\ \label{eq:15} & \le \sum_{j=1}^m \| E_h^{j, j-1} u_{j-1} \|_{C_j} && \text{by Lemma~\ref{lem:Rh_bound}}. \end{align} Since the spatial projection of the support of $E_h^{j, j-1} u_j$ can be subdivided into the union of non-overlapping vertex patches ${\varOmega^{\vtx}}$ for all pitch vertices ${\mathtt{v}} \in V_j$, \[ \| E_h^{j, j-1} u_{j-1}\|_{C_j}^2 = \sum_{{\mathtt{v}} \in V_j} \| E_h^{j, j-1} u_{j-1}\|_{C_j, {\mathtt{v}}}^2. \] On a tent ${T^\vtx}$ with ${\mathtt{v}} \in V_j$, note that $E_h^{j, j-1} u_{j-1}|_{\partial_{\mathrm{top}}{T^\vtx}} = (u_j - R_h^{j, j-1} u_{j-1})|_{\partial_{\mathrm{top}}{T^\vtx}} = u|_{\partial_{\mathrm{top}}{T^\vtx}} - R_h^{{T^\vtx}} (u|_{\partial_{\mathrm{bot}} {T^\vtx}}\circ \Phi^{-1}).$ Putting ${\hat{u}} = u|_{T^\vtx} \circ \varPhi$ and ${\hat{u}}_h = R_h^{{T^\vtx}}{\hat{u}}(0) = R^{\mathrm{sem}}_h(1) \circ P_h {\hat{u}}(0)$, applying Lemma~\ref{lem:local_semidiscrete_error} with $\tau=1$ and ${\hat{u}}_h^0 = P_h {\hat{u}}(0)$ yields \begin{align*} \| E_h^{j, j-1} u_{j-1}\|_{C_j, {\mathtt{v}}} &= \| {\hat{u}}(1) - {\hat{u}}_h(1) \|_{M(1)} \\ & \lesssim \| {\hat{u}}(0) - P_h {\hat{u}}(0)\|_{M(0)} + h_{{\mathtt{v}}}^{p+1} | u|_{{\mathtt{v}}, p+1} \lesssim h_{{\mathtt{v}}}^{p+1} | u|_{{\mathtt{v}}, p+1}. \end{align*} Using this in~\eqref{eq:15}, \begin{align*} \| u (T) - u_h (T) \|_{\varOmega} & \lesssim \sum_{j=1}^m \bigg( \sum_{{\mathtt{v}} \in V_j} h_{{\mathtt{v}}}^{2p+2} | u|_{{\mathtt{v}}, p+1}^2 \bigg)^{1/2} \lesssim \sum_{j=1}^m h_j^{1/2} \bigg( \sum_{{\mathtt{v}} \in V_j} h_{{\mathtt{v}}}^{2p+1} | u|_{{\mathtt{v}}, p+1}^2 \bigg)^{1/2}, \end{align*} so the proof is finished by applying the Cauchy-Schwarz inequality. \end{proof} \begin{remark} Note that $h_j$ may be interpreted as the ``layer height'' of $L_j$ due to the causality condition. Suppose \begin{equation} \label{eq:32} \sum_{i=1}^m h_i \lesssim T. \end{equation} Theorem~\ref{thm:semidiscrete} then yields $O(h^{p+1/2})$-rate of convergence with $h = \max_{\mathtt{v}} h_{{\mathtt{v}}}$. Of course, \eqref{eq:32} can be violated by choosing very sparse layers (e.g., with one tent per layer), but this is not useful to get the best estimate from Theorem~\ref{thm:semidiscrete}, nor is it useful in practice: indeed, a large number of non-interacting tents (such as the tents of the same color in Figures~\ref{fig:tents:L1}--\ref{fig:tents:L4}) in each layer allows for better parallelism. \end{remark} \begin{remark} \label{rem:weaker_stab} Suppose that instead of the operators $R_h^{i,i-1}$ satisfying~\eqref{eq:9}, we are given operators $\tilde{R}_h^{i, i-1}: L^2(C_{i-1})^L \to L^2(C_i)^L$ admitting the weaker stability bound \begin{equation} \label{eq:44} \| \tilde{R}_h^{i, i-1} w\|_{C_i} \le (1 + C_{\mathrm{sta}} h_{i-1})\| w\|_{C_{i-1}} \end{equation} with some mesh and layer independent constant $C_{\mathrm{sta}}>0$ for all $w \in L^2(C_{i-1})^L$. For any $i > j$, consider $ {\tilde{R}_h}^{i, j} = {\tilde{R}_h}^{i, i-1} \circ {\tilde{R}_h}^{i-1, i-2} \circ \cdots\circ {\tilde{R}_h}^{j+1, j}.$ Note that for any $i > j$, using the arithmetic-geometric mean inequality and the inequality $(1+ \alpha)^m \le e^{\alpha m}$, \begin{align*} (1 & +\Cstab h_j) (1 +\Cstab h_{j+1}) \cdots (1+ \Cstab h_i) \le \prod_{i=1}^m (1+\Cstab h_i) \\ & \le \left[\frac 1 m \sum_{i=1}^m (1+\Cstab h_i)\right]^m \le \left[ 1 + \frac{\Cstab}{m} \sum_{i=1}^m h_i\right]^m \le \exp\Big( {\Cstab \sum_{i=1}^m h_i}\Big). \end{align*} Therefore, whenever~\eqref{eq:32} holds, iterative application of~\eqref{eq:44} gives the following layer-uniform bound for any $i> j$: \[ \| \tilde{R}_h^{i, j} w\|_{C_i} \le \,e^{C_{\mathrm{sta}} T}\, \| w \|_{C_j}. \] Using this in place of Lemma~\ref{lem:Rh_bound}, the proof of Theorem~\ref{thm:semidiscrete} can be extended, replacing $R_h^{i, j}$ by $\tilde{R}_h^{i, j}$, $E^{i, j}$ by $\tilde{E}^{i, j} = R^{i, j} - \tilde{R}_h^{i, j}$, and ``$\le$'' in~\eqref{eq:15} by ``$\lesssim$'' subsuming the $T$-dependent constant into the error estimates. \end{remark} \section{Analysis of fully discrete schemes} \label{sec:fully-discr} In this section we use time stepping schemes to arrive at practical fully discrete schemes from the semidiscretization studied in the previous section. Before studying these fully discrete schemes on a mapped tent, it is useful to quickly make a few observations on the time derivatives and Taylor expansion of the exact solution. \subsection{Preparatory observations} The bilinear form $a(\cdot, \cdot)$ defines an operator $A$ from $\Hhv$ to its dual space $(\Hhv)'$ in the usual way: $(Aw)(v) = a(w, v)$ for $w, v \in \Hhv$. Recall the previously defined $L^2$ projector $P_h: L^{{\mathtt{v}}} \to V_h^\vtx$. Since $V_h^\vtx \subset \Hhv$, the projector $P_h$ extends naturally from $L^{{\mathtt{v}}}$ to $(\Hhv)'$, so, e.g., $P_h A : \Hhv \to V_h^\vtx$ satisfies $(P_hA w, v_h)_{\mathtt{v}} = (A w)(v_h) = a(w, v_h)$ for all $w\in \Hhv$ and $v_h \in V_h^\vtx$. While describing fully discrete schemes, $A_h: V_h^\vtx \to V_h^\vtx$, defined by $ (A_h w, v)_{\mathtt{v}} = a(w, v),$ for all $ w, v \in V_h^\vtx$ will be useful. One may also consider $\tilde{A}: {H^{{\mathtt{v}}}} \to L^{{\mathtt{v}}}$ defined by $ (\tilde{A} w, v)_{\mathtt{v}} = (\mathop{\mathrm{div}_x} \big[\delta f(w)\big], v)_{\mathtt{v}},$ for all $ w \in {H^{{\mathtt{v}}}}$ and $v \in L^{{\mathtt{v}}}.$ It is easy to see from~\eqref{eq:2} of Lemma~\ref{lem:intgparts} that $A$ coincides with $\tilde{A}$ on functions $w \in H^{{\mathtt{v}}}$ with $(\mathcal{D} - B )w=0$ on $\partial{\varOmega}$. In particular, on such functions $w$, we may view $Aw $ as a function in $L^{{\mathtt{v}}}$. The pull back ${\hat{u}}$ of the exact hyperbolic solution $u$ from a tent ${T^\vtx}$ to the cylinder ${\hat{T}^\vtx}$ is one such function. Therefore the following equation holds in $L^{{\mathtt{v}}}$: \begin{equation} \label{eq:21} \partial_{\hat t} (M \hat u) = A \hat u, \qquad 0 \le \hat t\le 1. \end{equation} We will proceed assuming that the exact solution $\hat u$ is regular enough to admit the Taylor expansion \begin{equation} \label{eq:u-TaylorExp} {\hat{u}}(\tau) = \sum_{k=0}^{s} \frac{\tau^k}{k!} {\hat{u}}^{(k)}(0) + \rho_{s+1}(\tau), \end{equation} for some $s\ge 1$. Here, ${\hat{u}}^{(k)}(\hat t)$ denotes the $k$th order time derivative $ d^k {\hat{u}} / d \hat t^k$ (which is a function in ${H^{{\mathtt{v}}}}$ when the solution is smooth---see Lemma~\ref{lem:time-derivative-uhat} below), and the remainder term $\rho_{s+1}(\tau)$ can be expressed as the $H^{{\mathtt{v}}}$-valued Riemann integral \begin{equation} \label{eq:33} \rho_{s+1}(\tau) = \frac{\tau^{s+1}}{s!} \int_0^1 (1-\hat t)^s {\hat{u}}^{(s+1)}(\hat t \tau) \; d\hat t. \end{equation} It is well known that the expansion~\eqref{eq:u-TaylorExp} holds for $\tau$ in an interval containing $0$ whenever ${\hat{u}}$ is $s+1$ times continuously differentiable (as an ${H^{{\mathtt{v}}}}$-valued function) in that interval. When applied to a spacetime hyperbolic solution $u$ in the physical domain, the smallness of the higher order terms in~\eqref{eq:u-TaylorExp} (written there in terms of the mapped function $\hat u$), is evident from the following lemma, since $\delta(x) \lesssim h_{{\mathtt{v}}}$. \begin{lemma} \label{lem:time-derivative-uhat} The function $\hat u = u \circ \varPhi$ satisfies \[ {\hat{u}}^{(k)} = (\partial_t^k u \circ \varPhi)\, \delta^k. \] Consequently, at each pseudotime $\hat t$, within each spatial element $K \in {\varOmega_h^{\vtx}}$, as a function of the spatial variable $x$, ${\hat{u}}^{(k)}(\hat t)$ is as smooth as $(\partial_t^k u)(x, \varphi(x, \hat t))$. Moreover, ${\hat{u}}^{(k)}(\hat t)$ is in $H^{{\mathtt{v}}}$ if $\partial_t^k u$ is continuously differentiable in ${T^\vtx}$. \end{lemma} \begin{proof} Let $e$ denote the spacetime unit vector in the time direction i.e., all its components are zero except for the last (time) component which is 1. Then, at some fixed spacetime point $\hat P$ in ${\hat{T}^\vtx}$, we may write $ {\hat{u}}^{(k)}(\hat P) = D^k{\hat{u}}(\hat P) (e, e, \ldots, e), $ where $D^k{\hat{u}}$ is the multilinear form representing the $k$th order Fr\'echet derivative of ${\hat{u}}$, and $e$ is repeated $k$ times in its argument list. Then, letting $P = \varPhi(\hat P)$ denote the mapped point in ${T^\vtx}$, by standard arguments~\cite{Ciarl78} for affine maps, \begin{align*} {\hat{u}}^{(k)}(\hat P) & = D^k ( u\circ \varPhi)(\hat P) (e, e, \ldots, e) \\ & = D^k u (P) ([\mathop{\mathrm{grad}_{x\hat{t}}} \varPhi]e, [\mathop{\mathrm{grad}_{x\hat{t}}} \varPhi]e, \ldots, [\mathop{\mathrm{grad}_{x\hat{t}}} \varPhi]e) \\ & = D^k u(P) (\delta e, \delta e, \ldots, \delta e), \end{align*} where we have used~\eqref{eq:gradxtPhi} in the last step. Since the last term above equals the product of $\delta^k$ and the derivative $\partial^k u/ \partial t^k$ at $P$, the proof is complete. \end{proof} In view of Lemma~\ref{lem:time-derivative-uhat}, when the exact solution is smooth in the physical spacetime, we expect it to have the following (semi)norms finite, in addition to the ones in~\eqref{eq:spatialseminorm}: \begin{equation} \label{eq:seminorms2} \begin{gathered} |w |_{{\mathtt{v}}, l, m} = \sup_{0 \le \tau \le 1} \sum_{k=0}^m \left| \hat w^{(k)}(\tau) \right|_{H^{l}({\varOmega_h^{\vtx}})^L}, \\ \|w \|_{\infty, {\mathtt{v}}} = \sup_{0 \le \tau \le 1} \| \hat w (\tau) \|_{\mathtt{v}}, \qquad \|w \|_{s, \infty, {\mathtt{v}}} = \sum_{\ell=0}^s \| \partial_t^\ell w\|_{\infty, {\mathtt{v}}}. \end{gathered} \end{equation} When $m=0$, the first seminorm coincides with the seminorm in~\eqref{eq:spatialseminorm}. The next result bounds the Taylor remainder term in terms of the mapped time derivative $\partial_t^s u \circ \varPhi$. \begin{lemma} \label{lem:rho-Taylor-remainder} The Taylor remainder term satisfies $ \| \rho_{s} \|_{\mathtt{v}} \lesssim \tau^s h_{{\mathtt{v}}}^{s} \| \partial_t^{s} u \|_{\infty, {\mathtt{v}}}. $ \end{lemma} \begin{proof} Starting from~\eqref{eq:33}, by Fubini's theorem and Cauchy-Schwarz inequality, \begin{align*} \tau^{-2s} \| \rho_{s} \|_{{\mathtt{v}}}^2 &\lesssim \int_0^1 (1 - \hat t)^{2s} \| {\hat{u}}^{(s)}( \hat t \tau) \|_{\mathtt{v}}^2\, d\hat t \le \bigg(\sup_{0 \le \tau \le 1} \| {\hat{u}}^{(s)}( \tau) \|_{\mathtt{v}}^2 \bigg) \int_0^1 (1 - \hat t)^{2s}\, d \hat t \\ & \lesssim \sup_{0 \le \tau \le 1} \| \delta^{s} (\partial_t^{s} u \circ \varPhi)(\tau) \|_{\mathtt{v}}^2, \end{align*} due to Lemma~\ref{lem:time-derivative-uhat}. Since $\delta \lesssim h_{{\mathtt{v}}},$ the result follows. \end{proof} \begin{lemma} \label{lem:exact-time-deriv} For any $k \ge 1,$ whenever the exact time derivative ${\hat{u}}^{(k-1)}(0)$ exists in $H^{{\mathtt{v}}}$, we have $ {\hat{u}}^{(k)}(0) = M_0^{-1} (A + k M_1) \,{\hat{u}}^{(k-1)}(0). $ \end{lemma} \begin{proof} Differentiating both sides of~\eqref{eq:21} $k-1$ times, $(M {\hat{u}})^{(k)} (\hat t) = A {\hat{u}}^{(k-1)}(\hat t)$. Simplifying the left hand side by Leibniz rule and the linearity of $M(\hat t)$, we have \[ M(\hat t) {\hat{u}}^{(k)}(\hat t) - k M_1 {\hat{u}}^{(k-1)}(\hat t) = A {\hat{u}}^{(k-1)}(\hat t). \] Evaluating at $\hat t=0$ and rearranging, the proof is complete. \end{proof} Note that $V_h^\vtx$ is an invariant subspace of the previously defined operators $M_0$ and $M_1$, due to~\eqref{eq:G_L_const}. It will be understood from context whether we consider $M_0, M_1$ as operators on $L^{\mathtt{v}}$ or as operators on $V_h^\vtx$. For operators on $V_h^\vtx$, we define a discrete operator norm, analogous to \eqref{eq:20}, for operators $\mathcal{O}_h$ on $V_h^\vtx$, by \[ \| \mathcal{O}_h\|_{{\mathtt{v}}, h} := \sup_{v_h, w_h \in V_h^\vtx} \frac{( \mathcal{O}_hv_h, w_h)_{\mathtt{v}}}{ \| v_h \|_{\mathtt{v}} \| w_h \|_{{\mathtt{v}}}} \] for all $v_h, w_h \in V_h^\vtx$. \begin{lemma} \label{lem:AXRbounds} We have $ \| A_h\|_{{\mathtt{v}}, h} \lesssim 1, \; \| M_1 \|_{{\mathtt{v}}, h} \lesssim 1, \; \|M \|_{{\mathtt{v}}, h} \lesssim 1, \; \|M^{-1} \|_{{\mathtt{v}}, h} \lesssim 1. $ \end{lemma} \begin{proof} To prove the first inequality, consider the terms that make up $a(v_h, w_h) = ( A_hv_h, w_h)_{\mathtt{v}}$ for any $v_h, w_h \in V_h^\vtx$. On any $K \in {\varOmega_h^{\vtx}}$, since $\Lc j$ is uniformly bounded and $\delta \lesssim h_K$, \[ ( \delta \Lc j v_h, \partial_j w_h)_K \lesssim \| v_h \|_K h_K\| \partial_j w_h \|_K \lesssim \| v_h \|_K \| w_h \|_K \] where we have applied an inverse inequality in the last step. Next, consider an element boundary term in $(A_hv_h, w_h)$, restricted to say a facet $F \subset \partial K$, shared with the boundary of another element $K_o$ in ${\varOmega_h^{\vtx}}$: \[ (\delta\, \mathcal{D} \{v_h\}, w_h|_{\partial K})_F \lesssim \left( h_{K} \| v_h \|_{\partial K}^2 + h_{K_o} \| v_h \|_{\partial K_o}^2 \right)^{1/2} \left( h_{K}^{1/2} \| w_h \|_{\partial K}\right) \lesssim \| v_h \|_{{\varOmega^{\vtx}}} \| w_h \|_K, \] where we have again used $\delta \lesssim h_K$ and local scaling arguments. Continuing to use similar arguments on all the remaining terms that make up $( A_hv_h, w_h)_{\mathtt{v}}$, we obtain $\| A_h \|_{{\mathtt{v}}, h} \lesssim 1$. Finally, Lemma~\ref{lem:Mspd} shows that $\| M_1 \|_{{\mathtt{v}}, h}$, $\|M(\tau)\|_{{\mathtt{v}}, h}$, and $\|M(\tau)^{-1}\|_{{\mathtt{v}}, h}$ also admit mesh-independent bounds. \end{proof} The projector $P_h$ enjoys the commutativity properties \begin{equation} \label{eq:MPcommute} M_1 P_h = P_h M_1, \quad M_0 P_h = P_h M_0, \end{equation} because of~\eqref{eq:G_L_const}. Although a similar commutativity identity cannot be expected of $A_h$, we have the following lemma. \begin{lemma} \label{lem:APcomm} For any $w \in H^{l}({\varOmega_h^{\vtx}})^L$, $1\le l \le p+1$, the function $\eta_h = (A_hP_h - P_h A) w$ satisfies $ \| \eta_h \|_{\mathtt{v}} \,\lesssim\, h_{{\mathtt{v}}}^l \, |w|_{H^l({\varOmega_h^{\vtx}})^L}. $ \end{lemma} \begin{proof} Since $\| \eta_h \|_{\mathtt{v}}^2 = (A_h P_h w, \eta_h)_{\mathtt{v}} - (P_h A w, \eta_h)_{\mathtt{v}} = a(P_h w, \eta_h)_{\mathtt{v}} - a( w, \eta_h)_{\mathtt{v}}$, \begin{align*} \| \eta_h \|_{\mathtt{v}}^2 & = a(P_h w - w, \eta_h) \,\lesssim\, h_{{\mathtt{v}}}^l |w|_{H^l({\varOmega_h^{\vtx}})^L} |\eta_h|_d \end{align*} by Lemma~\ref{lem:a_proj_bd}. By Lemma~\ref{lem:AXRbounds}, $|\eta_h|_d^2 = -((2 A_h+M_1) \eta_h, \eta_h)_{\mathtt{v}} \lesssim \| \eta_h \|_{\mathtt{v}}^2$, so the inequality of the lemma follows. \end{proof} \subsection{Lowest order tent-implicit scheme} \label{ssec:lowest-order-tent-implicit} While the overall MTP strategy is a tent-by-tent time-marching strategy akin to explicit methods, within a mapped tent, one may choose between explicit or implicit schemes. By a ``tent-implicit'' scheme, we mean a method that solves the semidiscretization~\eqref{eq:DG} on a mapped tent using implicit time stepping. Although this requires matrix inversion, the size of the matrix is only as large as the number of spatial degrees of freedom in one tent (much smaller than the size of the global matrix that needs to be inverted in standard implicit schemes for method of lines discretizations). Numerical results using tent-implicit schemes of various orders were reported first in~\cite[\S5.4]{GopalSchobWinte17}. In this subsection, we provide a convergence analysis of the lowest-order case. To derive the lowest order tent-implicit method, we begin by rewriting \eqref{eq:DG} in a form analogous to \eqref{eq:21}, i.e., \[ \partial_{\hat t} (M {\hat{u}}_h ) = A_h {\hat{u}}_h, \quad 0 \le \hat t \le 1. \] Then, putting $y_h = M {\hat{u}}_h$, we have $\partial_{\hat t}\,y_h = A_h M^{-1} y_h$. The implicit Euler method applied to this defines an approximation $y_{h1}(\tau)$ to $y_h(\tau)$ given by $ y_{h1}(\tau) - y_h(0) = \tau A_hM^{-1} y_{h1}(\tau). $ Since ${\hat{u}}_h = M^{-1} y_h$, an approximation to ${\hat{u}}_h(\tau)$ is furnished by $M^{-1} y_{h1}(\tau)$, which after simplification becomes $M^{-1} (I - \tau A_h M^{-1})^{-1} M_0 {\hat{u}}(0). $ This motivates the following definition of the discrete propagator \begin{definition}[Lowest order tent-implicit flow: $R^{\mathrm{imp}}_{h1}(\tau)$] Define $R^{\mathrm{imp}}_{h1}(\tau) : V_h^\vtx \to V_h^\vtx$ by \[ R^{\mathrm{imp}}_{h1}(\tau) = M(\tau)^{-1} (I - \tau A_h M(\tau)^{-1})^{-1} M_0. \] The two inverses required for this definition are both well defined: first, $M$ is invertible by Lemma~\ref{lem:Mspd}; second, $I - \tau A_h M^{-1}$ is invertible because \begin{align*} (I - \tau A_h M^{-1}) M & = M - \tau A_h = (M_0 -\frac {\tau}{2} M_1) - \frac{\tau}{2} (2A_h + M_1), \end{align*} together with Lemmas~\ref{lem:intgparts} and~\ref{lem:Mspd} imply that for any $0 \ne v\in V_h^\vtx$, \[ ( (I - \tau A_h M^{-1}) M v, v)_{\mathtt{v}} \ge \| v\|_{M(\tau/2)}^2 + | v|_d^2 > 0. \] \end{definition} We proceed to prove convergence of the scheme, beginning with the next stability result that closely resembles the inequality of Lemma~\ref{lem:stability_semidiscrete}. \begin{lemma}[Unconditional strong stability] \label{lem:stability-imp} For any $v \in V_h^\vtx$ and any $0 \le \tau \le 1$, \[ \| R^{\mathrm{imp}}_{h1}(\tau) v \|_{M(\tau)}^2 \le \| v \|_{M_0}^2. \] \end{lemma} \begin{proof} Let $v_\tau = R^{\mathrm{imp}}_{h1}(\tau) v$. Then $(M - \tau A_h) v_\tau = M_0 v.$ Taking the inner product with $v_\tau$ on both sides, \begin{align*} \| v_\tau \|_M^2 & = (M_0v, v_\tau)_{\mathtt{v}} + \tau (A_h v_\tau, v_\tau)_{\mathtt{v}} \\ & \le \frac 1 2 \| v \|_{M_0}^2 + \frac 1 2 \| v_\tau \|_{M_0}^2 + \tau (A_h v_\tau, v_\tau)_{\mathtt{v}} \\ & = \frac 1 2 \| v \|_{M_0}^2 + \frac 1 2 \| v_\tau \|_{M}^2 + \frac{\tau}{2} ((2A_h + M_1) v_\tau, v_\tau)_{\mathtt{v}}. \end{align*} Now, since $((2A_h + M_1) v_\tau, v_\tau)_{\mathtt{v}} = - | v_\tau|_d^2$ (see Lemma~\ref{lem:intgparts}), the proof is complete. \end{proof} When using any (spatial) polynomial degree $p \ge 0$, we obtain the following bound for the lowest order method (showing that the rate is limited by the time discretization error), which uses the (semi)norms defined in \eqref{eq:spatialseminorm} and~\eqref{eq:seminorms2}. \begin{lemma}[Local error bound] \label{lem:local-error-implicit} Let ${\hat{u}}$ denote the exact solution on ${\hat{T}^\vtx}$ and let $\hat{u}^{\mathrm{imp}}_{h1}(\tau) = R^{\mathrm{imp}}_{h1}(\tau) {\hat{u}}_h^0$ for some ${\hat{u}}_h^0 \in V_h^\vtx$. Then, \begin{align*} \| {\hat{u}} (\tau) - \hat{u}^{\mathrm{imp}}_{h1} (\tau) \|_{M(\tau)} & \;\lesssim\; \| {\hat{u}}(0) - {\hat{u}}_h^0 \|_{M(0)} + h_{{\mathtt{v}}} \big( \| u\|_{2, \infty, {\mathtt{v}}} + | u |_{{\mathtt{v}}, 1} \big). \end{align*} \end{lemma} \begin{proof} Let $X_h = M_0^{-1}(A_h + M_1)$ and $X = M_0^{-1} (A + M_1)$. By~\eqref{eq:MPcommute}, \begin{equation} \label{eq:18} P_h X - X_h P_h = M_0^{-1}(P_h A - A_h P_h). \end{equation} An alternate expression for the discrete propagator will also be useful: $R^{\mathrm{imp}}_{h1} = M^{-1}(I - \tau A_h M^{-1})^{-1} M_0 = (M- \tau A_h)^{-1} M_0 = (M_0 - \tau(A_h + M_1))^{-1} M_0,$ i.e., \begin{equation} \label{eq:30} R^{\mathrm{imp}}_{h1} (\tau) = (I - \tau X_h)^{-1}. \end{equation} With these preparations, we derive an ``error equation'' for ${\varepsilon}_h = \hat{u}^{\mathrm{imp}}_{h1}(\tau) - P_h {\hat{u}}(\tau)$. Note that ${\varepsilon}_h$ is a function in $V_h^\vtx$ for each $\tau$. Writing \[ {\varepsilon}_h = R^{\mathrm{imp}}_{h1} \big[ {\hat{u}}_h^0 - P_h {\hat{u}}(0)\big] + \phi_h, \] with $ \phi_h = R^{\mathrm{imp}}_{h1} P_h {\hat{u}}(0) - P_h {\hat{u}}(\tau),$ we analyze $\phi_h$ further as follows. \begin{align*} \phi_h & = (I - \tau X_h)^{-1} P_h {\hat{u}}(0) - P_h {\hat{u}}(\tau) && \text{by}~\eqref{eq:30}, \\ & = \big[(I - \tau X_h)^{-1} -I \big]P_h {\hat{u}}(0) - \tau P_h {\hat{u}}^{(1)}(0) - P_h \rho_2 &&\text{by~\eqref{eq:u-TaylorExp},} \\ & = \tau (I-\tau X_h)^{-1} X_h P_h {\hat{u}}(0) - \tau P_h {\hat{u}}^{(1)}(0) - P_h \rho_2 \\ & = \tau (I-\tau X_h)^{-1} \big[P_h X - M_0^{-1}(P_hA - A_h P_h)\big] {\hat{u}}(0) \\ &\quad - \tau P_h {\hat{u}}^{(1)}(0) - P_h \rho_2 &&\text{by~\eqref{eq:18},} \\ & = \tau^2 X_h (I-\tau X_h)^{-1} P_h {\hat{u}}^{(1)}(0) - \tau (I-\tau X_h)^{-1} M_0^{-1} \eta_h - P_h \rho_2 \end{align*} with $\eta_h = (P_hA - A_h P_h) {\hat{u}}(0)$. We have used Lemma~\ref{lem:exact-time-deriv} in the last step. To bound $\phi_h$, first note that by Lemma~\ref{lem:AXRbounds}, $\| X_h\|_{{\mathtt{v}}, h} \lesssim 1.$ Also, by \eqref{eq:30} and Lemma~\ref{lem:stability-imp}, $\|R^{\mathrm{imp}}_{h1}(\tau)\|_{{\mathtt{v}}, h} = \| (I-\tau X_h)^{-1}\|_{{\mathtt{v}}, h} \lesssim 1$, so $\| \phi_h \|_{\mathtt{v}} \lesssim \tau^2 \| {\hat{u}}^{(1)}(0) \|_{\mathtt{v}} + \tau \|\eta_h\|_{{\mathtt{v}}} + \| \rho_2\|_{\mathtt{v}}.$ Now, applying Lemmas~\ref{lem:time-derivative-uhat}, \ref{lem:APcomm} and~\ref{lem:rho-Taylor-remainder}, \begin{align*} \| \phi_h \|_{\mathtt{v}} & \lesssim \tau^2 h_{{\mathtt{v}}} \|\partial_t u \|_{\infty, {\mathtt{v}}} + \tau h_{{\mathtt{v}}} | u |_{{\mathtt{v}}, 1} + \tau^2h_{{\mathtt{v}}}^2 \| \partial_t^2 u \|_{\infty, {\mathtt{v}}}. \end{align*} Together with the stability result of Lemma~\ref{lem:stability-imp}, this proves \[ \| {\varepsilon}_h \|_M \lesssim \| {\hat{u}}_h^0 - P_h {\hat{u}}(0) \|_{M_0} + h_{{\mathtt{v}}} \big( \| \partial_t u\|_{\infty, {\mathtt{v}}} + \| \partial_t^2 u\|_{\infty, {\mathtt{v}}} + | u |_{{\mathtt{v}}, 1} \big). \] Using the triangle inequality, $\| {\hat{u}}(\tau) - \hat{u}^{\mathrm{imp}}_{h1}(\tau) \|_M \le \| {\hat{u}}(\tau) - P_h {\hat{u}}(\tau) \|_M + \| {\varepsilon}_h \|_M,$ and the standard estimate for $L^2$ projection, $\| {\hat{u}}(\tau) - P_h {\hat{u}}(\tau) \|_{\mathtt{v}} \lesssim h_{{\mathtt{v}}} |u|_{{\mathtt{v}}, 1}$, the proof can now be completed. \end{proof} The previous two lemmas lead to a global convergence theorem, as we shall now see. The implicit scheme's tent propagator on ${T^\vtx}$ is the operator $ R^{\mathrm{imp}}_{h1}(1) \circ P_h : L^{{\mathtt{v}}} \to V_h^\vtx,$ set using $R^{\mathrm{imp}}_{h1}(\tau)$ evaluated at pseudotime $\tau=1$ corresponding to the tent top. Letting $\mathcal{R}_h^{\mathrm{imp}}$ denote the collection of such tent propagators over all tents, we use Definition~\ref{def:T2G} to set the global propagator $R_{h, \mathrm{imp}}^{i, j} = {\mathtt{T2G}}(i, j, \mathcal{R}_h^{\mathrm{imp}})$, and consider the discrete solution $u_{h1}^{\mathrm{imp}} = R_{h, \mathrm{imp}}^{m, 0} u^0$ at the final time $T$. \begin{theorem}[Error estimate for the lowest order tent-implicit scheme] \label{thm:lowestimplicit} Under the same conditions as Theorem~\ref{thm:semidiscrete}, for any spatial degree $p \ge 0$, the fully discrete solution $u_{h1}^{\mathrm{imp}}$ satisfies \[ \| u (T) - u_{h1}^{\mathrm{imp}} \|_{\varOmega} \;\lesssim\; \bigg(\sum_{j=1}^m h_j\bigg)^{1/2} \bigg[ \sum_{j=1}^m \sum_{{\mathtt{v}} \in V_j} h_{{\mathtt{v}}} \big( \| u\|_{2, \infty, {\mathtt{v}}} + | u |_{{\mathtt{v}}, 1} \big)^2 \bigg]^{1/2}. \] \end{theorem} \begin{proof} First, due to Lemma~\ref{lem:stability-imp}, we observe that in complete analogy with \\ Lemma~\ref{lem:Rh_bound}, one can prove that for $i> j$, \[ \| R_{h, \mathrm{imp}}^{i, j} w\|_{C_i} \le \| w \|_{C_j}. \] Defining $ E_{h, \mathrm{imp}}^{i, j} = R^{i, j} - R_{h, \mathrm{imp}}^{i, j}, $ in analogy with Lemma~\ref{lem:errorpropagation}, we can show that \[ E_{h, \mathrm{imp}}^{m, 0} = \sum_{j=1}^m R_{h, \mathrm{imp}}^{m, j} E_{h, \mathrm{imp}}^{j, j-1} R^{j-1, 0}. \] Hence the theorem can be proved along the same lines as the proof of Theorem~\ref{thm:semidiscrete}, using Lemma~\ref{lem:local-error-implicit} in place of Lemma~\ref{lem:local_semidiscrete_error}. \end{proof} As before, under the further assumption that~\eqref{eq:32} holds, Theorem~\ref{thm:lowestimplicit} gives an $O(h^{1/2})$ rate of convergence for the solution at the final time. \subsection{Lowest order explicit scheme} \label{ssec:lowest-order-expl} A perhaps nonstandard route to derive an explicit scheme is to view it as an iterative method for solving the equations of an implicit scheme. Pursuing this approach using the tent-implicit scheme of \S\ref{ssec:lowest-order-tent-implicit}, we write $v_\infty = R^{\mathrm{imp}}_{h1} (\tau) v_0$, or equivalently, using the operator $X_h = M_0^{-1}(A_h + M_1)$ in~\eqref{eq:30}, \[ (I - \tau X_h) v_\infty = v_0. \] Hence the Richardson iteration for solving this linear system for $v_\infty$ takes the form \begin{equation} \label{eq:42} v_{\ell +1} = v_\ell + \left(v_0 - (I - \tau X_h) v_\ell\right), \qquad \ell =0, 1, \ldots. \end{equation} \begin{definition}[Lowest order explicit discrete flows: $R^{\mathrm{exp}}_{h1}(\tau)$ and $R^{\mathrm{exp}}_{h1q}(\tau)$] \label{def:lowest-order-explicit} Let $v_0 \in V_h^\vtx$. The result $v_1$ after one iteration of~\eqref{eq:42} defines the operator $R^{\mathrm{exp}}_{h1} (\tau): V_h^\vtx \to V_h^\vtx$: \[ R^{\mathrm{exp}}_{h1} (\tau) v_0 = v_1 = (I+ \tau X_h) v_0. \] The result $v_q$ obtained after performing $q\ge 1$ iterations defines $R^{\mathrm{exp}}_{h1q} (\tau): V_h^\vtx \to V_h^\vtx$ by \[ R^{\mathrm{exp}}_{h1q} (\tau) v_0 = v_q = v_0 + \tau X_h v_{q-1}. \] Note that no matrix inversions are required for conducting these $q$ iterations, except for one local mass matrix inversion ($M_0^{-1}$) per tent. \end{definition} Unlike the tent-implicit scheme, we are now able to obtain stability for the explicit scheme only under further conditions. From Lemma~\ref{lem:AXRbounds}, we know that $\| X_h \|_{M_0} \lesssim 1$. Hence the condition~\eqref{eq:Xhcond} in the next result can be met by performing sufficiently many iterations. \begin{lemma}[Conditional stability] \label{lem:lowest-order-explicit-q-stability} If $q$ is large enough to admit \begin{equation} \label{eq:Xhcond} \| X_h \|_{M_0} \lesssim h_{{\mathtt{v}}}^{1/(q+1)}, \end{equation} then there is a $c_q>0$ independent of $h_{{\mathtt{v}}}$ such that for all $v_0 \in V_h^\vtx$, \[ \| R^{\mathrm{exp}}_{h1q} (\tau) v_0 \|_{M(\tau)} \le (1 + c_q h_{{\mathtt{v}}}) \| v_0 \|_{M_0}. \] \end{lemma} \begin{proof} Recursively expanding $v_q = v_0 + \tau X_h v_{q-1}$, we obtain \[ v_q = \sum_{j=0}^q (\tau X_h)^j v_0. \] Rewriting this, using (\ref{eq:30}), as \begin{equation} \label{eq:43} v_q = (I - \tau X_h)^{-1} \big[I - (\tau X_h)^{q+1}\big] v_0 = R^{\mathrm{imp}}_{h1} \big[1 - (\tau X_h)^{q+1}\big] v_0, \end{equation} we apply Lemma~\ref{lem:stability-imp}. Hence \begin{align*} \| v_q \|_M & \le \left\| v_0 - (\tau X_h)^{q+1} v_0 \right\|_{M_0} \le \| v_0 \|_{M_0} + \| X_h \|_{M_0}^{q+1} \| v_0\|_{M_0} \end{align*} and the result follows using~\eqref{eq:Xhcond}. \end{proof} \begin{lemma}[Local error bound] \label{lem:local-error-explicit} Let ${\hat{u}}$ denote the exact solution on ${\hat{T}^\vtx}$, let $\hat{u}^{\mathrm{exp}}_{h1q}(\tau) = R^{\mathrm{exp}}_{h1q}(\tau) {\hat{u}}_h^0$ for some ${\hat{u}}_h^0 \in V_h^\vtx$, and suppose~\eqref{eq:Xhcond} holds. Then, \begin{align*} \| {\hat{u}} (\tau) - \hat{u}^{\mathrm{exp}}_{h1q} (\tau) \|_{M(\tau)} & \;\lesssim\; \| {\hat{u}}(0) - {\hat{u}}_h^0 \|_{M(0)} + h_{{\mathtt{v}}} \big( \| u\|_{2, \infty, {\mathtt{v}}} + \| u \|_{{\mathtt{v}}, 1} \big). \end{align*} \end{lemma} \begin{proof} Let $e_h = \hat{u}^{\mathrm{imp}}_{h1} (\tau) - \hat{u}^{\mathrm{exp}}_{h1q}(\tau)$. Since ${\hat{u}} (\tau) - \hat{u}^{\mathrm{exp}}_{h1q} (\tau) -e_h = {\hat{u}} (\tau) - \hat{u}^{\mathrm{imp}}_{h1} (\tau)$ can be bounded by Lemma~\ref{lem:local-error-implicit}, it suffices to bound $e_h$. By~\eqref{eq:43}, \begin{align*} e_h & = (I - \tau X_h)^{-1} {\hat{u}}_h^0 - (I - \tau X_h)^{-1}\big[ I - (\tau X_h)^{q+1}] {\hat{u}}_h^0 \\ & = (I - \tau X_h)^{-1} (\tau X_h)^{q+1} {\hat{u}}_h^0. \end{align*} Thus, by Lemma~\ref{lem:stability-imp} and~\eqref{eq:Xhcond}, $\| e_h \|_M \lesssim h_{{\mathtt{v}}} \| {\hat{u}}_h^0\|_{M_0}$. We may further write $ {\hat{u}}_h^0 $ as the sum of ${\hat{u}}_h^0 - {\hat{u}}(0)$ and $ {\hat{u}}(0)$ and apply triangle inequality to obtain the right hand side of the stated bound. \end{proof} Letting $\mathcal{R}^{\mathrm{exp}}_{h1q}$ denote the collection of explicit tent propagator operators $R^{\mathrm{exp}}_{h1q}(1) \circ P_h : L^{{\mathtt{v}}} \to V_h^\vtx$ on all tents, we use Definition~\ref{def:T2G} to set the global propagators ${\mathtt{T2G}}(i, j, \mathcal{R}^{\mathrm{exp}}_{h1q})$, and consider the discrete solution $u^{\mathrm{exp}}_{h1q} = {\mathtt{T2G}}(m, 0, \mathcal{R}^{\mathrm{exp}}_{h1q}) u^0$ at the final time $T$. \begin{theorem}[Error estimate for iterated lowest order explicit scheme] \label{thm:lowest-explicit-q} Suppose~\eqref{eq:Xhcond}, \eqref{eq:32}, and the conditions of Theorem~\ref{thm:semidiscrete} hold. Then for any spatial degree $p \ge 0$, the fully discrete explicit solution $u^{\mathrm{exp}}_{h1q}$ satisfies \[ \| u (T) - u^{\mathrm{exp}}_{h1q} \|_{\varOmega}^2 \;\lesssim\; \sum_{j=1}^m \sum_{{\mathtt{v}} \in V_j} h_{{\mathtt{v}}} \big( \| u\|_{2, \infty, {\mathtt{v}}} + \| u \|_{{\mathtt{v}}, 1} \big)^2. \] \end{theorem} \begin{proof} The proof proceeds along the lines of the proof of Theorem~\ref{thm:semidiscrete}, replacing the applications of Lemmas~\ref{lem:stability_semidiscrete} and~\ref{lem:local_semidiscrete_error}, respectively, by those of Lemmas~\ref{lem:lowest-order-explicit-q-stability} and~\ref{lem:local-error-explicit} instead. The main difference is that we must now invoke the argument of Remark~\ref{rem:weaker_stab} due to the weaker stability estimate of Lemma~\ref{lem:lowest-order-explicit-q-stability}. \end{proof} The $O(h^{1/2})$ rate of convergence given by Theorem~\ref{thm:lowest-explicit-q} is the same as the rate given by Theorem~\ref{thm:lowestimplicit} for the lowest order tent-implicit scheme. Increasing the iteration number~$q$ can improve stability but does not generally improve the order of convergence. \subsection{Arbitrary order SAT schemes} \label{ssec:arbitrary-order-sat} Letting $\Xh 0$ denote the identity operator on $V_h^\vtx$, recursively define further operators on $V_h^\vtx$ by \begin{equation} \label{eq:Xhrecurse} \Xh k = M_0^{-1} (A_h + k M_1) \Xh {k-1}, \quad k \ge 1. \end{equation} Similarly, let $\X 0 = 1$ and $\X k = M_0^{-1} (A + k M_1) \X {k-1}$ for $ k \ge 1.$ By Lemma~\ref{lem:exact-time-deriv}, the time derivative of the exact solution satisfies ${\hat{u}}^{(k)}(0) = \X k {\hat{u}}(0)$. Hence the expansion~\eqref{eq:u-TaylorExp} may be written as \begin{equation} \label{eq:17} {\hat{u}}(\tau) = \sum_{k=0}^{s} \frac{\tau^k}{k!} \X k {\hat{u}}(0) + \rho_{s+1}(\tau), \end{equation} This motivates us to define the SAT flow by replacing $\X k$ with the discrete operator $\Xh k$ as follows. (A gentler derivation can be found in~\cite{GopalHochsSchob20} and it can be seen easily that the discrete flow defined there coincides with the one in the next definition.) \begin{definition}[Discrete $s$-stage SAT flow: $R^{\mathrm{sat}}_{hs}(\tau)$ for $s\ge 1$] \label{def:sSATflow-Xh} Define $R^{\mathrm{sat}}_{hs}(\tau) : V_h^\vtx \to V_h^\vtx$ by \[ R^{\mathrm{sat}}_{hs}(\tau) v = \sum_{k=0}^{s-1} \frac{\tau^k}{k!} \Xh k v + \frac{\tau^s}{s!} M(\tau)^{-1} M_0 \Xh s v, \qquad v \in V_h^\vtx. \] \end{definition} \begin{lemma} \label{lem:Rsat-ee-0} Let $u$ be the exact solution of~\eqref{eq:tenteqforu} on a causal tent ${T^\vtx}$ and ${\hat{u}} = u \circ \varPhi \in C^{s+1}(0, 1, H^{{\mathtt{v}}} \cap H^{p+1}({\varOmega_h^{\vtx}})^L)$. Then for any $s\ge 1$, \begin{align*} \| R^{\mathrm{sat}}_{hs}(\tau) {\hat{u}}_h^0 - P_h {\hat{u}}(\tau)\|_{M(\tau)} & \lesssim \| {\hat{u}}_h^0 - P_h{\hat{u}} (0) \|_{M(0)} + \tau^s h_{{\mathtt{v}}}^s \| u\|_{s+1, \infty, {\mathtt{v}}} \\ &+ \tau h_{{\mathtt{v}}}^{p+1}| u |_{{\mathtt{v}}, p+1, s-1}. \end{align*} \end{lemma} \begin{proof} Let ${\hat{u}}_{hs}(\tau) = R^{\mathrm{sat}}_{hs}(\tau){\hat{u}}_h^0 $ and let ${\varepsilon}_k = (\Xh k P_h - P_h \X k) {\hat{u}}(0)$. Then projecting and subtracting~\eqref{eq:17} from the expansion defining $R^{\mathrm{sat}}_{hs}(\tau){\hat{u}}_h^0$, we obtain \begin{align*} {\hat{u}}_{hs}(\tau) - P_h {\hat{u}}(\tau) & = \sum_{k=0}^{s-1} \frac{\tau^k}{k!} \big[ \Xh k ({\hat{u}}_h^0 - P_h {\hat{u}}(0) ) + {\varepsilon}_k \big] \\ & + \frac{\tau^s}{s!} M^{-1}M_0 \big[\Xh s({\hat{u}}_h^0 - P_h {\hat{u}}(0))\big] \\ & + \frac{\tau^s}{s!} \big[ (M^{-1}M_0 -I) P_h {\hat{u}}^{(s)}(0) + M^{-1}M_0 {\varepsilon}_s \big] - P_h \rho_{s+1}. \end{align*} Letting $\mu_s = (M^{-1}M_0 -I) P_h {\hat{u}}^{(s)}(0)$, and noting that ${\varepsilon}_0 = 0$, \begin{equation} \label{eq:19} {\hat{u}}_{hs}(\tau) - P_h {\hat{u}} (\tau)= R^{\mathrm{sat}}_{hs}(\tau)\big[{\hat{u}}_h^0 - P_h {\hat{u}}(0) \big] + \sum_{k=1}^{s} \frac{\tau^k}{k!} {\varepsilon}_k + \frac{\tau^s}{s!} \big[ \mu_s + M^{-1}M_0 {\varepsilon}_s \big] - P_h \rho_{s+1}. \end{equation} To estimate the terms on the right hand side, we first use Lemma~\ref{lem:AXRbounds} to conclude that $ \|R^{\mathrm{sat}}_{hs}(\tau)[{\hat{u}}_h^0 - P_h {\hat{u}}(0) ]\|_{M} \lesssim \| {\hat{u}}_h^0 - P_h {\hat{u}}(0) \|_{M_0}. $ By Lemma~\ref{lem:time-derivative-uhat}, $ \| \mu_s\|_{\mathtt{v}} \lesssim h_{{\mathtt{v}}}^s \| \partial_t^s u\|_{\infty, {\mathtt{v}}}. $ To bound ${\varepsilon}_k$, note that \begin{equation} \label{eq:48} {\varepsilon}_k = M_0^{-1} (A_h + k M_1) {\varepsilon}_{k-1} + \eta_{k-1} \end{equation} where $\eta_j = M_0^{-1}(A_h P_h - P_h A) {\hat{u}}^{(j)}(0)$. By Lemma~\ref{lem:APcomm}, $\| \eta_j\|_{\mathtt{v}} \lesssim h_{{\mathtt{v}}}^{p+1} | u|_{{\mathtt{v}}, p+1, j}.$ Hence recursively bounding $ \| {\varepsilon}_k\|_{\mathtt{v}}$ by $ \| {\varepsilon}_{k-1}\|_{\mathtt{v}}$ using~\eqref{eq:48}, and noting that ${\varepsilon}_0=0$, we have $ \| {\varepsilon}_k \|_{M} \lesssim h_{{\mathtt{v}}}^{p+1} | u|_{{\mathtt{v}}, p+1, k-1}. $ The final term in~\eqref{eq:19} can be treated using Lemma~\ref{lem:rho-Taylor-remainder}, which yields $\| P_h\rho_{s+1}(\tau) \|_{\mathtt{v}} \lesssim \tau^{s+1}h_{{\mathtt{v}}}^{s+1} \| \partial_t^{s+1} u \|_{\infty, {\mathtt{v}}}.$ When these estimates are used to bound the terms in the right hand side of~\eqref{eq:19} (and noting that $\tau$ is a common factor in all terms except the first), we obtain the stated inequality. \end{proof} In order to improve the stability of these explicit SAT schemes, we shall now divide each tent into $r$ subtents and apply the SAT scheme in each subtent. \begin{definition}[Subtents] \label{def:subtents} Subdivide a tent ${T^\vtx}$ into $r$ subtents as follows. For $\ell=1, \ldots, r$, define the $\ell$th subtent by \[ {T_\kk^\vtx} = \{(x, t) : x \in {\varOmega^{\vtx}}, \; \varphi^{{[\ell]}}(x) \le t \le \varphi^{{{[\ell+1]}}}(x)\}, \] where $\hat t^{{[\ell]}} = (\ell-1)/r$, $\varphi^{{[\ell]}} = \varphi(x, \hat t^{{[\ell]}}).$ Let $\delta^{{[\ell]}} = \varphi^{{{[\ell+1]}}} - \varphi^{{[\ell]}}.$ Using $\delta^{{[\ell]}}$ in place of $\delta$ in \eqref{eq:6} and \eqref{eq:M1}, we define $a^{{[\ell]}}(w, v)$ and $M_1^{{[\ell]}}$, respectively, and let $A_h^{{[\ell]}}: V_h^\vtx \to V_h^\vtx$ be defined by $(A_h^{{[\ell]}} w, v)_{\mathtt{v}} = a^{{[\ell]}}(w, v)$ for $w, v \in V_h^\vtx$. Finally let $M_0^{{[\ell]}}$ be defined by \eqref{eq:M0} after replacing $\varphi_{\mathrm{bot}}$ there by $\varphi^{{[\ell]}}$ and let $M^{{[\ell]}}(\tau) = M_0^{{[\ell]}} - \tau M_1^{{[\ell]}}$. It is easy to see that $\delta^{{[\ell]}} = \delta /r$ and \begin{equation} \label{eq:subtent-ids} A_h^{{[\ell]}} = \frac 1 r A_h, \quad M_1^{{[\ell]}} = \frac 1 r M_1, \quad M^{{[\ell]}}(0) = M(\hat t^{{[\ell]}}), \quad M^{{[\ell]}}(1) = M(\hat t^{{{[\ell+1]}}}). \end{equation} \end{definition} \begin{definition}[Discrete $s$-stage SAT propagator using $r$ subtents: $R^{\mathrm{sat}}_{rhs}$] \label{def:s-SAT} Define $\Xhl k$ by replacing $A_h, M_1,$ and $M_0,$ by \smash{$A_h^{{[\ell]}}, M_1^{{[\ell]}},$ and $M_0^{{[\ell]}},$} respectively, in~\eqref{eq:Xhrecurse}. Define $R^{\mathrm{sat}}_{{{[\ell]}}, hs}(\tau)$ on a subtent ${T_\kk^\vtx}$ by replacing $M_0, \Xh k$ and $M$ by $M_0^{{[\ell]}}, \Xhl k$ and $M^{{[\ell]}}$, respectively, in Definition~\ref{def:sSATflow-Xh}. Applying on the $r$ subtents successively, we define $ R^{\mathrm{sat}}_{rhs} = R^{\mathrm{sat}}_{[r], hs}(1) \circ R^{\mathrm{sat}}_{[r-1], hs}(1) \cdots\circ R^{\mathrm{sat}}_{[1], hs}(1). $ \end{definition} Note that the constant in ``$\lesssim$'' will not be allowed to depend on $r$ (so that we may admit examples with $h_{{\mathtt{v}}}$-dependent $r$), as emphasized in the next lemma. \begin{lemma}[Local error in a tent] \label{lem:local-err-sat} Let $u$ be the exact solution of~\eqref{eq:tenteqforu} on a causal tent ${T^\vtx}$, ${\hat{u}} = u \circ \varPhi \in C^{s+1}(0, 1, H^{{\mathtt{v}}} \cap H^{p+1}({\varOmega_h^{\vtx}})^L)$, and let ${\hat{u}}_{rhs} = R^{\mathrm{sat}}_{rhs} {\hat{u}}_h^0.$ Then there is a mesh-independent constant $c_{s, p}$ that is also independent of $r$ such that \begin{align*} c_{s, p}\| {\hat{u}}_{rhs} - {\hat{u}} (1) \|_{M(1)} & \le \| {\hat{u}}_h^0 - P_h{\hat{u}} (0) \|_{M(0)} + h_{{\mathtt{v}}}^s \| u\|_{s+1, \infty, {\mathtt{v}}} + h_{{\mathtt{v}}}^{p+1}| u |_{{\mathtt{v}}, p+1, s-1}. \end{align*} \end{lemma} \begin{proof} Denoting the discrete solutions by ${\hat{u}}_{1, hs} = R^{\mathrm{sat}}_{[1], hs} {\hat{u}}_h^0$ and ${\hat{u}}_{\ell, hs} = R^{\mathrm{sat}}_{[\ell], hs} {\hat{u}}_{\ell-1, hs}$ for $1\le \ell \le r$, we compare them with the subtent exact solutions, denoted by ${\hat{u}}_\ell = {\hat{u}}(\hat t^{{{[\ell+1]}}})$. In the pseudotime coordinate of the un-split tent ${T^\vtx}$, the value $\tau=1/r$ corresponds to the top of the first subtent, where the exact solution is ${\hat{u}}_1 = {\hat{u}}(1/r)$. Thus Lemma~\ref{lem:Rsat-ee-0} with $\tau=1/r$ gives \[ \| {\hat{u}}_{1, hs} - P_h {\hat{u}}_1\|_{M(1/r)} \lesssim \| {\hat{u}}_h^0 - P_h {\hat{u}}(0) \|_{M(0)} + \frac 1 r \left( h_{{\mathtt{v}}}^s \| u\|_{s+1, \infty, {\mathtt{v}}} + h_{{\mathtt{v}}}^{p+1}| u |_{{\mathtt{v}}, p+1, s-1}\right). \] Similarly, on the $\ell$th subtent, for $\ell=1, 2, \ldots, r$, \begin{align*} \| {\hat{u}}_{\ell, hs} - P_h {\hat{u}}_\ell\|_{M(\hat t^{{{[\ell+1]}}})} & \lesssim \| {\hat{u}}_{\ell-1, hs} - P_h {\hat{u}}_{\ell-1} \|_{M(\hat t^{{[\ell]}})} \\ &+ \frac 1 r \left( h_{{\mathtt{v}}}^s \| u\|_{s+1, \infty, {\mathtt{v}}} + h_{{\mathtt{v}}}^{p+1}| u |_{{\mathtt{v}}, p+1, s-1}\right). \end{align*} Applying this estimate for $\ell=r, r-1, \ldots, 1$, successively in that order, where at each step the first term on the right hand side is bounded using the next estimate, \[ \| {\hat{u}}_{rhs} - P_h {\hat{u}}(1)\|_{M(1)} \lesssim \| {\hat{u}}_h^0 - P_h {\hat{u}}(0) \|_{M(0)} + \left( h_{{\mathtt{v}}}^s \| u\|_{s+1, \infty, {\mathtt{v}}} + h_{{\mathtt{v}}}^{p+1}| u |_{{\mathtt{v}}, p+1, s-1}\right) \sum_{\ell=1}^r \frac 1 r \] which completes the proof. \end{proof} Letting $\mathcal{R}^{\mathrm{sat}}_{rhs}$ denote the collection of explicit tent propagators $R^{\mathrm{sat}}_{rhs} \circ P_h : L^{{\mathtt{v}}} \to V_h^\vtx$ on all tents, we use Definition~\ref{def:T2G} to set the global propagators ${\mathtt{T2G}}(i, j, \mathcal{R}^{\mathrm{sat}}_{rhs})$, and consider the discrete solution $u^{\mathrm{sat}}_{rhs} = {\mathtt{T2G}}(m, 0, \mathcal{R}^{\mathrm{sat}}_{rhs}) u^0$ at the final time $T$. \begin{theorem}[Error estimate for the SAT scheme] \label{thm:sat-ee} Assume that there is a mesh-independent $C_{\mathrm{sta}} \ge 0$ such that \begin{equation} \label{eq:stability-sat-assume} \| R^{\mathrm{sat}}_{rhs} v \|_{M(1)} \le (1 + C_{\mathrm{sta}} h_{{\mathtt{v}}}) \| v \|_{M(0)} \end{equation} for all $v \in V_h^\vtx$ on all tents ${T^\vtx}$. Suppose also that \eqref{eq:32} and the conditions of Theorem~\ref{thm:semidiscrete} hold. Then the fully discrete explicit $s$-stage SAT solution $u^{\mathrm{sat}}_{rhs}$, obtained using spatial polynomial degree $p$, satisfies \[ \| u (T) - u^{\mathrm{sat}}_{rhs} \|_{\varOmega}^2 \;\lesssim\; \sum_{j=1}^m \sum_{{\mathtt{v}} \in V_j} h_{{\mathtt{v}}}^{2s-1} \| u\|_{s+1, \infty, {\mathtt{v}}}^2 + h_{{\mathtt{v}}}^{2p+1} \| u \|_{{\mathtt{v}}, p+1, s-1}^2. \] \end{theorem} \begin{proof} The proof proceeds along the lines of the extension of the proof of Theorem~\ref{thm:semidiscrete} mentioned in Remark~\ref{rem:weaker_stab}, replacing the application of Lemma~\ref{lem:stability_semidiscrete} by~\eqref{eq:stability-sat-assume}, and replacing the application of Lemma~\ref{lem:local_semidiscrete_error} by Lemma~\ref{lem:local-err-sat}. \end{proof} Theorem~\ref{thm:sat-ee} bounds the error by terms that converge to zero at the same rate, provided the number of stages in the SAT scheme is tied to the spatial degree by $s= p+1$. Then, the convergence rate given by Theorem~\ref{thm:sat-ee} is $O(h^{p+1/2})$, the same rate we obtained for the semidiscretization (in Theorem~\ref{thm:semidiscrete}). In \S\ref{sssec:ratenotimprovable} we show, through a numerical example, that this rate is generally un-improvable. One can solve a local eigenproblem on a tent to computationally check if the stability assumption~\eqref{eq:stability-sat-assume} is satisfied. Since this eigenvalue computation is described in detail in~\cite[\S6.1]{GopalSchobWinte20}, we shall not comment further on this computational avenue for stability verification. In \S\ref{sssec:p=0} and \S\ref{ssec:stab-s=2}, we describe two cases where stability can be proved staying within the framework of the general symmetric linear hyperbolic systems we have been considering. \subsubsection{Numerical observations on the convergence rate} \label{sssec:ratenotimprovable} It is natural to wonder if the convergence rate of $O(h^{p+1/2})$, given by Theorem~\ref{thm:sat-ee} (and Theorem~\ref{thm:semidiscrete}), is improvable. Our numerical experience from computations with various hyperbolic systems suggests that one is likely to observe a higher convergence rate of $O(h^{p+1})$ on generic examples and meshes. Yet, as we show now, there is at least one family of tent meshes in the $N=2$ case where $O(h^{p+1/2})$ rate of convergence is observed. Such tent meshes are created by selecting the spatial mesh ${\varOmega_h}$ from the mesh families described in~\cite{Peterson91}, where it is shown that the standard $O(h^{p+1/2})$ error estimate for the DG method for {\em stationary} advection equation cannot be improved. Building causal tents atop such a mesh, we show that our $O(h^{p+1/2})$ estimate for the time-dependent advection problem also cannot be improved. The structured spatial meshes we borrow from~\cite{Peterson91} consist of horizontal layers of right triangles grouped in vertical bands. As the mesh is refined, the number of vertical bands is controlled by a parameter $\sigma \in [0, 1]$. We used the MTP discretization with polynomial orders $p$ varying from $0$ to $3$, together with SAT time stepping with $r=\max \{1, 2p\}$ and $s=p+1$ to solve the advection problem of Example~\ref{eg:advection} (modified to take a nonhomogeneous inflow boundary condition). The domain ${\varOmega} $ is set to the unit square, the advective vector field $b$ is set to the constant vector $b=[0,1]^t$, so that ${\partial_{\text{in}}} {\varOmega} = \{ (x_1, x_2): 0 \le x_2 \le 1\},$ and the inflow boundary condition is set by $u = x_1^{p+1}$ on ${\partial_{\text{in}}} {\varOmega}$. The initial condition is $u^0(x_1, x_2) \equiv x_1^{p+1}$. At $t = T=1$, the MTP solution approximated the exact solution $u(x_1, x_2, t) = x_1^{p+1}$ at all spatial points $(x_1,x_2) \in {\varOmega}.$ \begin{figure}[htpb] \centering \begin{tikzpicture} \begin{loglogaxis}[ mark repeat={1}, ylabel={$L^2$ error: $\| u(T) - u^{\mathrm{sat}}_{rhs} \|_{\varOmega}$}, xlabel={mesh size $h$}, legend entries={$p=0$, $p=1$, $p=2$, $p=3$, $O(h^{1/2})$, $O(h^{3/2})$, $O(h^{5/2})$, $O(h^{7/2})$}, legend pos=outer north east, ] \foreach \column in {0,...,3}{ \addplot+[] table[x={h},y={l2e_p\column}] {peterson_mesh/table_convect2dconv_SAT.txt}; } \addplot[domain=2/1000:1/10, samples=3, dashed]{.1*x^.5}; \addplot[domain=2/1000:1/10, samples=3, dashdotted]{.02*x^1.5}; \addplot[domain=2/1000:1/10, samples=3, dotted]{.002*x^2.5}; \addplot[domain=2/1000:1/10, samples=3, dashed]{.0003*x^3.5}; \end{loglogaxis} \end{tikzpicture} \caption{Convergence rates observed when solving the advection problem} \label{fig:satcv} \end{figure} We obtained different convergence rates for different choices of $\sigma$, but in all cases, the rates are bounded between $O(h^{p+1/2})$ and $O(h^{p+1})$. We obtained the minimal convergence rate (largest errors) when $\sigma = 3/4$ and $\sigma = 1/2$ for $p \ge 1$ and $p = 0$, respectively. The errors and rates observed for these values of $\sigma$ are plotted in Figure~\ref{fig:satcv}, which clearly show $O(h^{p+1/2})$ rate of convergence. We note that our rate-minimizing $\sigma$-value of $3/4$ is the same value of $\sigma$ used in~\cite{Peterson91} for the $p=1$ case (the only case where numerical results are given there). \subsubsection{Stability verification in the $p=0, \;s=1$ case} \label{sssec:p=0} This case is motivated by the many studies of the $p=0$ case in the DG literature (see e.g.~\cite{BurmaErnFerna10, Despr04, SunShu17}), often called the finite volume case, and is illustrative of why special cases are worth pursuing. We focus on the operator of the SAT scheme, obtained by setting $s=1$ in Definition~\ref{def:sSATflow-Xh}, which can be simplified to \[ R^{\mathrm{sat}}_{h1}(\tau) = I + \tau M(\tau)^{-1}(A_h + M_1), \] and the corresponding operator $R^{\mathrm{sat}}_{rh1}$ obtained using $r$ subtents, per Defintion~\ref{def:s-SAT}. Note that $R^{\mathrm{sat}}_{h1}(\tau)$ differs slightly from the $q=1$ case of Definition~\ref{def:lowest-order-explicit}, namely, $R^{\mathrm{exp}}_{h1}(\tau) = I + \tau M_0^{-1}(A_h + M_1)$. While $R^{\mathrm{exp}}_{h1q}$ only requires one local mass matrix inversion for $q$ iterations within a tent, the application of $R^{\mathrm{sat}}_{rh1}$ requires one local inversion per subtent. However, $R^{\mathrm{sat}}_{rh1}$ admits a stronger stability estimate that we shall prove after making the following observation. \begin{lemma} \label{lem:p0AX} When $p=0$, we have, for all $v, w \in V_h^\vtx$, \begin{align} \label{eq:45} (A_h w, v)_{\mathtt{v}} & \lesssim \| w \|_{\mathtt{v}} |v|_d, \\ \label{eq:46} \| (A_h + M_1) v \|_{{\mathtt{v}}} & \lesssim |v |_d. \end{align} \end{lemma} \begin{proof} When $p=0$, the derivative terms in~\eqref{eq:6} vanish, so \begin{align*} (A_h w, v)_{\mathtt{v}} & = \sum_{K \in {\varOmega_h^{\vtx}}} -(\delta \hat{F}^n_w, v)_{\partial K} \\ & = - \sum_{F \in {\Fc^\vtx_b}} \frac 1 2 (\delta (\mathcal{D}^{(n)} + B) w, v)_F \\ &+ \sum_{F \in {\Fc^\vtx_i}} (\delta \mathcal{D}^{(n_F)} \{ w \}, \jmp{v}_F)_F - (\delta S \jmp{w}_F, \jmp{v}_F)_F \end{align*} where we have rearranged the sum to run over the mesh facets. Now, by Cauchy-Schwarz inequality, \eqref{eq:DGdesign}, and Lemma~\ref{lem:intgparts}, the estimate of~\eqref{eq:45} follows. Of course, \eqref{eq:45} can also be written as $(w, A_h^t v)_{\mathtt{v}} \lesssim \| w \|_{\mathtt{v}} |v|_d$ where $A_h^t$ is the $L^{{\mathtt{v}}}$-adjoint of $A_h$. When this is added to the obvious inequality \[ (-(A_h + A_h^t + M_1)v, w )_{\mathtt{v}} \le (-(2A_h + M_1)v, v)_{\mathtt{v}}^{1/2}(-(2A_h + M_1)w, w)_{\mathtt{v}}^{1/2} = |v|_d |w|_d, \] we obtain $(- (A_h + M_1) v, w)_{\mathtt{v}} \lesssim |v|_d \|w\|_{\mathtt{v}}$, so \[ \| (A_h + M_1) v \|_{{\mathtt{v}}} = \sup_{0 \ne w \in V_h^\vtx} \frac{ ( (A_h + M_1) v, w)_{\mathtt{v}}}{ \| w \|_{\mathtt{v}}} \lesssim |v|_d \] proves~\eqref{eq:46}. \end{proof} Let $K_h$ denote the kernel of $A_h + A_h^t + M_1 : V_h^\vtx \to V_h^\vtx$ and let $K_h^\perp$ denote its $L^{{\mathtt{v}}}$-orthogonal complement in $V_h^\vtx$. Set \begin{equation} \label{eq:kappa} \kappa = \sup_{0 \le \tau \le 1} \,\sup_{\;0 \ne v \in K_h^\perp} \frac{ \| M(\tau)^{-1}(A_h + M_1) v\|_{M(\tau)}^2 } { |v|_d^2}. \end{equation} \begin{proposition}[Conditional strong stability] \label{lem:p0stability-r} In the case $p=0$ and $s=1$, the constant $\kappa$ of~\eqref{eq:kappa} satisfies $\kappa \lesssim 1$. For all \begin{equation} \label{eq:49-cfl} 0 \le \tau \le 1/\kappa \end{equation} and all $v \in V_h^\vtx$, we have \begin{equation} \label{eq:48-srk} \|R^{\mathrm{sat}}_{h1}(\tau) v \|_{M(\tau)} \le \|v \|_{M_0}. \end{equation} Furthermore, if $r \ge \kappa$ subtents are used, then \begin{equation} \label{eq:47} \|R^{\mathrm{sat}}_{rh1} v \|_{M(\tau)} \le \|v \|_{M_0}, \end{equation} i.e., the stability assumption~\eqref{eq:stability-sat-assume} of Theorem~\ref{thm:sat-ee} holds with $C_{\mathrm{sta}}=0$. \end{proposition} \begin{proof} Since $\|M(\tau)^{-1} \|_{{\mathtt{v}}, h} \lesssim 1$ by Lemma~\ref{lem:AXRbounds}, the estimate~\eqref{eq:46} of Lemma~\ref{lem:p0AX} shows that $\kappa \lesssim 1$ whenever $p=0$. Let $v_\tau = R^{\mathrm{sat}}_{h1}(\tau) v = v + \tau M^{-1} (A_h + M_1)v.$ Then expanding $\| v_\tau \|_M^2$, \begin{align*} \| v_\tau \|_M^2 & = \| v \|_{M}^2 + 2\tau( (A_h + M_1) v, v)_{\mathtt{v}} + \tau^2 \| M^{-1} (A_h + M_1) v \|_{M}^2 \\ & = \| v \|_{M_0}^2 + \tau( (2A_h + M_1) v, v)_{\mathtt{v}} + \tau^2 \| M^{-1} (A_h + M_1) v \|_{M}^2 \\ & \le \| v \|_{M_0}^2 - \tau |v|_d^2 + \tau^2 \kappa |v|_d^2 \end{align*} so~\eqref{eq:48-srk} follows when $1- \tau \kappa\ge 0$. Next, consider a subtent ${T_\kk^\vtx}$. By~\eqref{eq:subtent-ids}, $R^{\mathrm{sat}}_{{{[\ell]}}, h1}(1) = I + M^{{[\ell]}}(1)^{-1} (A_h^{{[\ell]}} + M_1^{{[\ell]}}) = I + r^{-1} M(\hat t^{{{[\ell+1]}}}) (A_h + M_1)$, so translating~\eqref{eq:48-srk} with $\tau = 1/r \le 1/\kappa$ to this subtent, we obtain $\|R^{\mathrm{sat}}_{{{[\ell]}}, h1}(1) v \|_{M(t^{{{[\ell+1]}}})} \le \| v \|_{M(t^{{[\ell]}})}$. Successively applying these estimates over all subtents,~\eqref{eq:47} is proved. \end{proof} Note that the inverse of $\kappa$ appearing in~\eqref{eq:49-cfl} will stay away from zero (since $\kappa \lesssim 1$) allowing for a nontrivial advance in $\tau$. One can view~\eqref{eq:49-cfl} as the analogue of a traditional ``CFL condition'' {\em within} a tent. Indeed, the pseudotime restriction~\eqref{eq:49-cfl} may be interpreted as a restriction on time advance in the physical spacetime by a small subtent whose tent pole height is a scalar multiple of $h_{{\mathtt{v}}}$. Even in the event~\eqref{eq:49-cfl} forbids us to reach the tent-top pseudotime (i.e., when $\tau=1$ does not satisfy~\eqref{eq:49-cfl}), splitting the tent into smaller subtents does allow the analogue of~\eqref{eq:49-cfl} to hold throughout every subtent. \subsubsection{Stability verification in the $s=2$ case} \label{ssec:stab-s=2} We will now show how to prove stability under a stronger CFL condition in the two-stage case. Definition~\ref{def:sSATflow-Xh} with $s=2$ yields \[ R^{\mathrm{sat}}_{h2}(\tau) = I + \tau \Xh 1 + \frac{\tau^2}{2} M^{-1}M_0 {\Xh 2}. \] \begin{lemma} \label{lem:SAT2id} For any $v \in V_h^\vtx$, \begin{align*} \| R^{\mathrm{sat}}_{h2}(\tau) v \|_{M(\tau)}^2 & = \| v\|_{M_0}^2 -\tau \left| v + \frac \tau 2 \Xh 1 v\right|_d^2 + \tau^3\, Z(\tau, v), \end{align*} where $Z(\tau, v) = [ 2(M_1 \Xh 1v, \Xh 1v)_{\mathtt{v}} -|\Xh 1 v |_d^2 + \tau \| M(\tau)^{-1} M_0 {\Xh 2}v \|_M^2 ]/4.$ \end{lemma} \begin{proof} Let $w = \tau \Xh 1 v+ (\tau^2/2) M^{-1}M_0 {\Xh 2}v.$ Then $v_\tau = R^{\mathrm{sat}}_{h2}(\tau) v$ can be written as $v_\tau = v + w$. Expanding $\| v + w\|_M^2$, \begin{align*} \| v_\tau \|_M^2 & = \| v\|_{M_0}^2 - \tau (M_1 v,v )_{\mathtt{v}} + 2 (w, v)_M + \| w \|_M^2 \\ & = \| v\|_{M_0}^2 - \tau (M_1 v,v )_{\mathtt{v}} + 2 \tau ((M_0-\tau M_1) \Xh 1 v, v)_{\mathtt{v}} + \tau^2 (M_0{\Xh 2} v, v)_{\mathtt{v}} + \| w \|_M^2 \\ & = \| v\|_{M_0}^2 + \tau ((2A_h + M_1) v,v )_{\mathtt{v}} + \tau^2 (A_h \Xh 1 v, v)_{\mathtt{v}} + \| w \|_M^2. \end{align*} Note that $(A_h \Xh 1 v, v)_{\mathtt{v}} = ( \Xh 1 v, A_h^t v)_{\mathtt{v}} = ( \Xh 1 v, (A_h^t + A_h + M_1) v)_{\mathtt{v}} - \| \Xh 1 v \|_{M_0}^2$. Since $d(y, z) = -((A_h^t + A_h + M_1)y, z)_{\mathtt{v}}$, we have \begin{align*} \| v_\tau\|_M^2 & = \| v \|_{M_0}^2 - \tau | v|_d^2 -\tau^2 d( \Xh 1 v, v) - \tau^2 \| \Xh 1 v\|_{M_0}^2 + \|w \|_M^2. \end{align*} Next, letting $z = (1/2) M^{-1} M_0 {\Xh 2} v$, expanding the last term above $ \|w \|_M^2 = \tau^2\| \Xh 1 v \|_M^2 + \tau^3( \Xh 1 v, M_0 {\Xh 2} v)_{\mathtt{v}} + \tau^4 \| z \|_M^2,$ noting that $M_0{\Xh 2} = (A_h + 2 M_1) \Xh 1 $, and simplifying, \begin{align*} \| v_\tau\|_M^2 & = \| v \|_{M_0}^2 - \tau | v|_d^2 -\tau^2 d( \Xh 1 v, v) + \tau^3((A_h + M_1) \Xh 1 v, \Xh 1 v)_{\mathtt{v}} + \tau^4 \| z \|_M^2 \\ & = \| v \|_{M_0}^2 - \tau \big| v + \frac \tau 2 \Xh 1 v\big|_d^2 + \frac{\tau^3}{4}((2A_h + 3M_1) \Xh 1 v, \Xh 1 v)_{\mathtt{v}} + \tau^4 \| z \|_M^2 \end{align*} from which the stated identity follows. \end{proof} \begin{proposition} \label{prop:sat_s2} Let $v \in V_h^\vtx$ and $r$ be chosen as the smallest integer not smaller than $\kappa_2^{1/3}/ h_{{\mathtt{v}}}^{1/2}$ where $\kappa_2$ is defined using $Z(\tau, v)$ of Lemma~\ref{lem:SAT2id} by \[ \kappa_2 = \sup_{0 \le \tau \le 1} \; \sup_{0 \ne v \in V_h^\vtx} \frac{Z(\tau, v)}{\| v \|_{M_0}^2}. \] Then \[ \| R^{\mathrm{sat}}_{h2}(\tau) v \|_{M(\tau)} \le (1 + h_{{\mathtt{v}}}^{3/2})^{1/2} \| v\|_{M_0} \quad \text{ for all } \tau \le 1/r, \] and $R^{\mathrm{sat}}_{rh2}$ satisfies the stability assumption~\eqref{eq:stability-sat-assume} of Theorem~\ref{thm:sat-ee}. \end{proposition} \begin{proof} By Lemma~\ref{lem:SAT2id} and the definition of $\kappa_2$, \[ \| R^{\mathrm{sat}}_{h2}(\tau) v \|_{M(\tau)}^2 \le \| v\|_{M_0}^2 + \tau^3 \kappa_2 \| v\|_{M_0}^2 \le (1 + h_{{\mathtt{v}}}^{3/2}) \| v \|_{M_0}^2, \] since $\tau^3 \kappa_2 = \kappa_2/r^3 \le h_{{\mathtt{v}}}^{3/2}.$ Applying this successively on each subtent, we obtain \[ \| R^{\mathrm{sat}}_{rh2} v \|_{M(1)} \le (1+ h_{{\mathtt{v}}}^{3/2})^{r/2} \| v \|_{M_0}. \] Next, we use the bound $(1+ h_{{\mathtt{v}}}^{3/2})^{r/2}\le \exp( h_{{\mathtt{v}}}^{3/2} r / 2)$. Since the argument of the exponential is bounded, $ \exp( h^{3/2} r / 2) -1 \lesssim h_{{\mathtt{v}}}^{3/2} r / 2 \lesssim h_{{\mathtt{v}}}$. Thus there is an $h_{{\mathtt{v}}}$-independent constant $C>0$ such that $\| R^{\mathrm{sat}}_{rh2} v \|_{M(1)} \le (1+ Ch_{{\mathtt{v}}}) \| v \|_{M_0}.$ \end{proof} Note that by Lemma~\ref{lem:AXRbounds}, the constant $\kappa_2$ satisfies $\kappa_2 \lesssim 1$. Hence Proposition~\ref{prop:sat_s2} gives stability under a so-called ``3/2-CFL'' condition. The latter term is an adaptation of the terminology on CFL conditions in~\cite{BurmaErnFerna10} for our tents, in view of the fact that our $\tau \le 1/r$ condition, with $r$ as in Proposition~\ref{prop:sat_s2}, implies that the amount of time advance along a tent pole ($\tau\delta$) is limited by $O(h_{{\mathtt{v}}}^{3/2})$. \section{Conclusion} We have developed a convergence theory for MTP schemes for a large class of linear hyperbolic systems, covering the semidiscrete case (\S\ref{sec:semidisc}), as well as a few fully discrete schemes (\S\ref{sec:fully-discr}). The convergence rate for the semidiscretization was established to be $O(h^{p+1/2})$ in Theorem~\ref{thm:semidiscrete} under reasonable assumptions. When the number of stages $s = p+1$, the fully discrete SAT scheme also gave the same convergence rate (Theorem~\ref{thm:sat-ee}) under the stability assumption~\eqref{eq:stability-sat-assume}. Through a selected numerical example, we showed in \S\ref{sssec:ratenotimprovable} that this convergence rate cannot be improved in general. The stability of SAT scheme was verified in \S\ref{sssec:p=0} for the $p=0,$ $s=1$ case and in \S\ref{ssec:stab-s=2} for the (arbitrary $p$) $s=2$ case. Proving the stability of SAT schemes (verifying~\eqref{eq:stability-sat-assume}) for other values of $s$ is currently an open problem. It is however possible to computationally verify stability within each tent by solving a small eigenvalue problem as shown in~\cite{GopalSchobWinte20}. The numerical results there suggest that an estimate of the form $\| R^{\mathrm{sat}}_{rhs} v\|_M \le (1 + C r^{-s}) \| v \|_{M_0}$ might hold for general~$r$ and $s$. If this is provable, then for larger $s$, a slight modification of the argument of Proposition~\ref{prop:sat_s2} would prove stability under a less stringent $(1 + 1/s)$-CFL condition, which limits the amount of time advance by a scalar multiple of $h_{{\mathtt{v}}}^{1+1/s}$. Also, if our analysis in~\S\ref{sssec:p=0} is any indication, it might be a worthwhile future pursuit to seek further special cases where stability holds under even weaker CFL conditions within a tent. The simplest cases of the fully discrete analyses we presented are those of the lowest order tent-implicit scheme in \S\ref{ssec:lowest-order-tent-implicit} and the lowest order iterated explicit scheme in \S\ref{ssec:lowest-order-expl}. The latter was obtained from a nontraditional viewpoint of explicit schemes as iterative solvers for implicit schemes. \bibliographystyle{amsplain}
\chapter{Model-Based Machine Learning for Communications} \contributor{Nir Shlezinger \affiliation{Ben-Gurion University, School of Electrical and Computer Engineering, Be'er-Sheva, Israel}} \contributor{Nariman Farsad \affiliation{Ryerson University, Department of Computer Science, Toronto, Canada}} \contributor{Yonina C. Eldar \affiliation{Weizmann Institute of Science, Faculty of Mathematics and Computer Science, Rehovot, Israel}} \contributor{Andrea J. Goldsmith \affiliation{Stanford University, Department of Electrical Engineering, Palo Alto, CA}} \section{Introduction} Traditional communication systems design is dominated by methods that are based on statistical models. These statistical-model-based algorithms, which we refer to henceforth as {\em model-based methods}, rely on mathematical models that describe the transmission process, signal propagation, receiver noise, interference, and many other components of the system that affect the end-to-end signal transmission and reception. Such mathematical models use parameters that vary over time as the channel conditions, the environment, network traffic, or network topology change. Therefore, for optimal operation, many of the algorithms used in communication systems rely on the underlying mathematical models as well as the estimation of the model parameters. However, there are cases where this approach fails, in particular when the mathematical models for one or more of the system components are highly complex, hard to estimate, poorly understood, do not well-capture the underlying physics of the system, or do not lend themselves to computationally-efficient algorithms. In some other cases, although mathematical models are known, accurate parameter estimation may not be possible. Finally, common hardware limitations, such as the restriction to utilize low-resolution quantizers or non-linear power amplifiers, can significantly increase the complexity of the underlying channel model. An alternative data-driven approach is based on \ac{ml}. \ac{ml} techniques, and in particular, deep learning, have been the focus of extensive research in recent years due to their empirical success in various applications, including computer vision and speech processing \cite{lecun2015deep, hinton2012deep}. The benefits of \ac{ml}-driven methods over traditional model-based approaches are threefold: First, \ac{ml} methods are independent of the underlying stochastic model, and thus can operate efficiently in scenarios where this model is unknown or its parameters cannot be accurately estimated. Second, when the underlying model is extremely complex, \ac{ml} algorithms have demonstrated the ability to extract and disentangle the meaningful semantic information from the observed data \cite{Bengio09learning}, a task which is very difficult to carry out using traditional model-based approaches, even when the model is perfectly known. Finally, the main complexity in utilizing \ac{ml} methods is in the training stage, which is typically carried out offline. Once trained, they tend to implement inference at a lower computational burden and delay compared to their analytical model-based counterparts \cite{gregor2010learning}. Although \ac{ml} has been the focus of significant research attention over the last decade, it has yet to significantly contribute to practical designs in one of the most important technologies of the modern era -- digital communication. The fact that \ac{ml}-based algorithms, which have revolutionized the fields of computer vision and natural language processing, do not yet play a fundamental role in the design of physical layer communication systems, and particularly digital receivers, may be due to one or more of the following reasons: \begin{enumerate} \item The large amount of possible outputs impose a major challenge in efficiently applying \ac{ml} algorithms. In particular, the constellation size of the modulation and the blocklength of the channel code, combined with the time-varying nature of communication channels, leads to an exponentially large number of possible channel outputs that an \ac{ml} receiver algorithm must be trained on. \item {Traditional deep learning techniques require high computational resources, while communication devices, such as wearable devices and mobile phones, are typically limited in hardware and power.} \item To date, conventional communication schemes, which assume a simplified channel model with parameters that are dynamically estimated, have been very successful. \end{enumerate} The third reason is likely to become less relevant as the spectrum congestion of existing cellular standards forces future communication systems to explore new frequency ranges and share spectrum with other application such as radar \cite{zheng2019radar}. As these new frequency bands and spectrum sharing techniques become widespread, the simplified channel, interference, and noise models used in current communication receiver techniques may no longer work well. Moreover, the strict cost, power, and memory constraints imposed on communicating devices lead to the usage of low-resolution \acp{adc} and power amplifiers with dominant non-linearities \cite{singya17PA}. This makes the successful application of model-based techniques significantly more complex. Thus, conventional model-based approaches may no longer be able to meet the performance and throughput demands of future wireless devices, motivating their combination with data-driven approaches based on \ac{ml} such as deep learning. Such techniques must still overcome the challenges identified above with respect to the large computational resources and data sets needed for training. Despite its unprecedented success, deep learning is subject to several challenges which limit its applicability in some important communication scenarios. In particular, \acp{dnn} consist of highly-parameterized systems that can represent a broad range of mappings. As such, massive data sets are typically required to learn a desirable mapping, and the computational burden of training and utilizing these networks may constitute a major drawback. For example, consider the two receivers illustrated in Fig. \ref{fig:SymDetComp1}, which carry out symbol detection using model-based algorithms and model-agnostic \acp{dnn}, respectively. The dynamic nature of wireless channels implies that the receivers should track channel variations in order to reliably detect the transmitted messages over long periods of time. To do so, the model-based receiver in Fig. \ref{fig:SymDetComp1}(a) typically estimates the model parameters imposed on the underlying statistics using periodic pilots. For the same purpose, the \ac{dnn}-based receiver in Fig. \ref{fig:SymDetComp1}(b) should periodically re-train its \ac{dnn} to track channel variations. The fact that doing so requires a large data set leads to a significant decrease of spectral efficiency and increase in computational complexity associated with this training. Furthermore, \acp{dnn} are commonly utilized as black-boxes, and thus do not offer the interpretability, flexibility, versatility, and reliability of model-based techniques. \begin{figure} \centering \includefig{SymDetComp1.png} \caption{Model-based methods versus deep learning for symbol detection: $a)$ a receiver uses its knowledge of the underlying statistical channel model, denoted $\Pdf{\myY|\myS}$, to detect the transmitted symbols for the channel output in a model-based manner; $b)$ a receiver uses a \ac{dnn} trained using the data set $\{\myVec{s}_t, \myVec{y}_t\}$ for recovering the symbols.} \label{fig:SymDetComp1} \end{figure} The limitations associated with model-based methods and black-box deep learning systems gave rise to a set of techniques on the interface of traditional model-based communication and \ac{ml}, attempting to benefit from the best of both worlds \cite{shlezinger2020model}. Such {\em model-based \ac{ml}} systems can be divided into two main categories. The first of the two utilizes model-based methods as a form of domain knowledge in designing a \ac{dnn} architecture, which is then trained and used for inference. The most common example of this strategy is the family of {\em deep unfolded networks} \cite{hershey2014deep, monga2019algorithm}, which design the layers of a \ac{dnn} to imitate the iterations of a model-based optimization algorithm, and has been utilized in various communication-related tasks \cite{balatsoukas2019deep}. The second strategy, which we call {\em \ac{dnn}-aided hybrid algorithms}, uses model-based methods with integrated \acp{dnn} for inference by incorporating \ac{ml} in a manner that makes the system more robust and model-agnostic. Communication receivers designed using \ac{dnn}-aided inference include the data-driven implementations of the Viterbi algorithm \cite{shlezinger2019viterbinet} and the BCJR detector \cite{shlezinger2020data}. In this chapter we present an introduction to model-based \ac{ml} for communication systems. We begin by reviewing existing strategies for combining model-based algorithms and \ac{ml} from a high level perspective in Section~\ref{sec:ModelML}, and compare them to the conventional deep learning approach which utilizes established \ac{dnn} architectures trained in an end-to-end manner. Then, in Section~\ref{sec:SymbolDetection} we focus on symbol detection, which is one of the fundamental tasks of communication receivers. We show how each strategy, i.e., conventional \ac{dnn} architectures, deep unfolding, and \ac{dnn}-aided hybrid algorithms, can be applied to this problem. The last two approaches constitute a middle ground between the purely model-based and the \ac{dnn}-based receivers illustrated in Fig. \ref{fig:SymDetComp1}. By focusing on this specific task, we highlight the advantages and drawbacks of each strategy, and present guidelines to facilitate the design of future model-based deep learning systems for communications. We conclude this chapter with a summary provided in Section~\ref{sec:Summary}. \section{Model-Based Machine Learning} \label{sec:ModelML} We begin by reviewing the leading approaches for combining \ac{ml}, and particularly deep learning, with model-based algorithms. The neural networks in this hybrid-approach are trained in a supervised manner and then used during inference. Then, in Section \ref{sec:SymbolDetection} we focus on symbol detection and provide concrete examples on how this approach can be used to design data-driven detectors. In a broad family of problems, a system is required to map an input variable $\myVec{Y}$ into a prediction of a label variable $\myVec{S}$. \ac{ml} systems learn such a mapping from a training set consisting of $n_t$ pairs of inputs and their corresponding labels, denoted $\{\myVec{s}_t, \myVec{y}_t\}_{t=1}^{n_t}$. Model-based methods carry out such inference based on prior knowledge of the statistical model relating $\myVec{Y}$ and $\myVec{S}$, denoted $\Pdf{\myY|\myS}$. Model-based \ac{ml} systems reviewed in this chapter combine model-based methods with learning techniques, namely, they tune their mapping of the input $\myVec{Y}$ based on both a labeled training set $\{\myVec{s}_t, \myVec{y}_t\}_{t=1}^{n_t}$ as well as some knowledge of the underlying distribution. Such hybrid data-driven model-aware systems can typically learn their mappings from smaller training sets compared to purely model-agnostic \acp{dnn}, and commonly operate without full and accurate knowledge of $\Pdf{\myY|\myS}$, upon which model-based methods are based. We next elaborate on the main strategies of combining \ac{ml} and model-based techniques, beginning with extreme cases of \acp{dnn} that rely solely on data and purely model-based inference algorithms. \subsection{Conventional Deep Learning} \label{subsec:ModelMLDeep} The conventional application of deep learning is to carry out inference using some standard \ac{dnn} architecture. This \ac{dnn} uses the training data to learn how to map a realization of the input $\myVec{Y}= \myVec{y}$ into a prediction $\hat{\myVec{s}}$. Such highly-parameterized networks can effectively approximate any Borel measurable mapping, as it follows from the universal approximation theorem \cite[Ch. 6.4.1]{goodfellow2016deep}. Therefore, by properly tuning their parameters using a {\em sufficiently large} training set, typically using optimization based on some variant of \ac{sgd}, one should be able to obtain the desirable inference rule. While standard \acp{dnn} structures are highly model-agnostic and are commonly treated as black-boxes, one can still incorporate some level of domain knowledge in the selection of the specific network architecture. For instance, when the input is known to exhibit temporal correlation, architectures based on \acp{rnn} or transformers are known to be preferable. Alternatively, in the presence of spatial patterns, one may prefer to utilize convolutional layers. An additional method to incorporate domain knowledge into a black-box \ac{dnn} is by pre-processing of the input via, e.g., feature extraction. Conventional deep learning based on established black-box \acp{dnn} is data-driven, i.e, it requires data representing the problem at hand, possibly combined with a very basic level of domain knowledge to select the specific architecture. A major drawback of using such networks, which is particularly relevant in the context of communication systems, is that learning a large number of parameters requires a massive data set to train. In dynamic environments, even when a sufficiently large data set is available, it is difficult to train a model that performs optimally over the whole range of the dynamically changing system. Moreover, online training as the system dynamics change tends to be computationally expensive because of the large number of parameters. \subsection{Model-Based Methods} \label{subsec:ModelMLModel} Model-based algorithms carry out inference based on prior knowledge of the underlying statistics relating the input $\myVec{Y}$ and the label $\myVec{S}$, i.e., $\Pdf{\myVec{Y} | \myVec{S}}$. A common family of model-based methods is based on iterative algorithms, which allow us to infer with provable performance and controllable complexity in an iterative fashion, as illustrated in Fig. \ref{fig:ModelBasedFlow}(a). This generic family of iterative algorithms consists of some input and output processing stages, with an intermediate iterative procedure. The latter can in turn be divided into a model-based computation, namely, a procedure that is determined by $\Pdf{\myVec{Y} | \myVec{S}}$; and a set of generic mathematical manipulations. These algorithms vary significantly between different statistical models. For instance, for the symbol detection task, model-based methods such as the Viterbi detector \cite{viterbi1967error} or the BCJR algorithm \cite{bahl1974optimal} are valid for finite-memory channels, while for \ac{mimo} detection one may utilize the family of interference cancellation methods \cite{andrews2005interference}. Each such algorithm may be specifically tailored to a given scenario, as opposed to black-box \acp{dnn}, in which the parameterized inference rule is generic, and the unique characteristics of the scenario at hand are encapsulated in the parameters learned during training. Model-based techniques do not rely on data to learn their mapping, though data is often used to estimate unknown model parameters. In practice, accurate knowledge of the statistical model relating the observations and the desired information is typically unavailable, and thus applying such techniques commonly requires imposing some assumptions on the underlying statistics, which in some cases reflects the actual behavior, but often do not. In the presence of inaccurate knowledge of $\Pdf{\myVec{Y} | \myVec{S}}$ due to estimation errors or due to enforcing a model that does not fully capture the environment, the performance of model-based methods tends to degrade considerably. This limits the applicability of model-based algorithms in scenarios where $\Pdf{\myVec{Y} | \myVec{S}}$ is unknown, costly to estimate accurately, or too complex to express analytically. \begin{figure} \centering \includefig{ModelBasedFlow.png} \caption{Illustration of $a)$ model-based iterative algorithm; $b)$ unfolding the algorithm into a \ac{dnn}; $c)$ converting the scheme into a \ac{dnn}-aided method.} \label{fig:ModelBasedFlow} \end{figure} \subsection{Model-Based Deep Learning by Deep Unfolding} \label{subsec:ModelMLUnfolding} Deep unfolding \cite{hershey2014deep,monga2019algorithm}, also referred to as {\em deep unrolling}, is a common strategy to combine deep learning with model-based algorithms. Here, model-based methods are utilized as a form of domain knowledge in designing a \ac{dnn} architecture, which is trained end-to-end and then used for inference. Unlike the application of conventional black-box \acp{dnn} discussed in Section \ref{subsec:ModelMLDeep}, deep unfolding utilizes a unique \ac{dnn} structure designed specifically for the task at hand. The main rationale in deep unfolding is to design the network to imitate the operation of a model-based iterative optimization algorithm corresponding to the considered problem. In particular, each iteration of the model-based algorithm is replaced with a dedicated layer with trainable parameters whose structure is based on the operations carried out during that iteration. An illustration of a neural network obtained by unfolding the model-based iterative model of Fig.~\ref{fig:ModelBasedFlow}(a) is depicted in Fig.~\ref{fig:ModelBasedFlow}(b), where a network with $T$ layers is designed to imitate $T$ iterations of the optimization method. Once the architecture is fixed, the resulting network is trained in an end-to-end manner as in conventional deep learning. { Deep unfolded networks, in which the iterations consist of trainable parameters, are typically capable of inferring with a smaller number of layers compared to the amount of iterations required by the model-based algorithm. Consequently, even when the model-based algorithm is feasible, processing $\myVec{Y}$ through a trained unfolded \ac{dnn} is typically faster than applying the iterative algorithm \cite{gregor2010learning}. Furthermore, converting a model-based algorithm into an unfolded deep network can also improve its performance. For example, iterative algorithms based on some relaxed optimization commonly achieve improved accuracy when unfolded into a \ac{dnn}, due to the ability to learn to overcome the error induced by relaxation in the training stage. The main benefits of deep unfolding over using end-to-end networks stem from its incorporation of domain knowledge in the network architecture. As such, unfolded networks can achieve improved performance at reduced complexity, i.e., when operating with less parameters, compared to conventional end-to-end networks \cite{balatsoukas2019deep}.} Nonetheless, deep unfolded networks are highly parameterized \acp{dnn}, which often require large data sets for training, though usually not as much as the generic \acp{dnn}. Furthermore, deep unfolding typically requires a high level of domain knowledge, such as explicit knowledge of the statistical model $\Pdf{\myVec{Y} | \myVec{S}}$ up to possibly some missing parameters, in order to formulate the optimization algorithm in a manner that can be unfolded. \subsection{Model-Based Deep Learning by \ac{dnn}-Aided Algorithms} \label{subsec:ModelMLAlgorithms} The second strategy for combining model-based methods and deep learning, which we refer to as {\em \ac{dnn}-aided hybrid algorithms}, aims at integrating \ac{ml} into model-based techniques. Such \ac{dnn}-aided systems mainly utilize conventional model-based methods for inference, while incorporating \acp{dnn} to make the resultant system more robust and model-agnostic. This approach builds upon the insight that model-based algorithms typically consist of a set of generic manipulations that are determined by the {\em structure of the statistics}, e.g., whether it obeys a Markovian structure. Beside these generic manipulations, there are also computations that require actual knowledge of $\Pdf{\myVec{Y} | \myVec{S}}$, as illustrated in Fig. \ref{fig:ModelBasedFlow}(a). Consequently, when one has prior knowledge on the structure of the underlying distribution but not of its actual distribution, \ac{ml} can be utilized to fill in the missing components required to carry out the algorithm. In particular, \ac{dnn}-aided hybrid algorithms start with a model-based algorithm that is suitable for inference when the statistics of $\Pdf{\myVec{Y} | \myVec{S}}$ are available. For instance, symbol detection over finite-memory channels can be carried out accurately and with affordable complexity using either the Viterbi algorithm \cite{viterbi1967error} or the BCJR method \cite{bahl1974optimal}, assuming $\Pdf{\myVec{Y} | \myVec{S}}$ is known. Then, \ac{ml}-based techniques, such as dedicated \acp{dnn}, are used to estimate only $\Pdf{\myVec{Y} | \myVec{S}}$ from data. These dedicated \acp{dnn} can be trained individually, {separately from the inference task, or in an end-to-end manner along with the overall algorithm that maps $\myVec{Y}$ into an estimate of $\myVec{S}$}. An illustration of a \ac{dnn}-aided algorithm obtained by integrating \ac{ml} into the iterative methods illustrated in Fig. \ref{fig:ModelBasedFlow}(a) is depicted in Fig. \ref{fig:ModelBasedFlow}(c). \ac{dnn}-aided hybrid algorithms have several advantages: First, they use \acp{dnn} for specific intermediate tasks, such as computing a conditional probability measure, which are much simpler compared to end-to-end inference. Consequently, relatively simple networks that are trainable using small training sets can be used. Furthermore, once trained the system effectively implements the model-based algorithm in a data-driven manner without imposing a model on the underlying distribution and estimating its parameters. Concrete examples of \ac{dnn}-aided symbol detection algorithms are detailed in Section \ref{subsec:SymbolDetectionAlgorithm}. \section{Deep Symbol Detection} \label{sec:SymbolDetection} In digital communication systems, the receiver is required to reliably recover the transmitted symbols from the observed channel output. This task is commonly referred to as {\em symbol detection}. In this section, we present how the strategies for combining \ac{ml} and model-based algorithms detailed in the previous section can be applied for data-driven symbol detection. We first formulate the symbol detection in Section \ref{subsec:SymbolDetectionProblem}, after which we discuss the applications of data-driven receivers based on conventional \ac{dnn} architectures, deep unfolding, and \ac{dnn}-aided algorithms, in Sections \ref{subsec:SymbolDetectionEstablished}-\ref{subsec:SymbolDetectionAlgorithm}, respectively. For each strategy we begin with the main rationale behind this approach, present at least one concrete example, and discuss its pros and cons. Finally, we numerically compare the data-driven receivers to their model-based counterparts in Section \ref{subsec:SymbolDetectionSims}. \subsection{The Symbol Detection Problem} \label{subsec:SymbolDetectionProblem} To formulate the symbol detection problem, we let $\myS_i \in \mySet{S}^K$ be the symbol transmitted at time index $i \in \{1,2,\ldots, \Blklen\}:= \mySet{T}$. Here, $\Blklen$ represents the blocklength and $K$ denotes the number of symbols transmitted at each time instance, e.g., the number of users transmitting simultaneously in the uplink communications channel. Each symbol is uniformly distributed over a set of $\CnstSize$ constellation points, thus $| \mySet{S}| = \CnstSize$. We use $\myY_i\in \mySet{Y}^{N}$ to denote the channel output at time index $i$, where $N$ represents the number of receive antennas. When both $N$ and $K$ are larger than one, the resulting setup corresponds to \ac{mimo} communications. Symbol detection refers to the recovery of $\myS^{\Blklen} := \{\myS_i\}_{i\in \mySet{T}}$ from the observed $\myY^{\Blklen}:= \{\myY_i\}_{i\in \mySet{T}}$. An illustration of the symbol detection problem using a \ac{dnn}-aided receiver is depicted in Fig.~\ref{fig:SymDet2}. \begin{figure} \centering \includefig{SymDet2.png} \caption{Symbol detection illustration.} \label{fig:SymDet2} \end{figure} We focus on finite-memory stationary causal channels, where each $\myY_i $ is given by a stochastic mapping of $\{\myS_l\}_{l=i-\Mem+1}^{i}$, and $\Mem$ is the memory of the channel, assumed to be smaller than the blocklength $\Blklen$. The special case in which $\Mem = 1$ is referred to as {\em flat} or memoryless channel conditions. The conditional \ac{pdf} of the channel output given its input thus satisfies \begin{equation} \label{eqn:ChModel1} \Pdf{\myY^{ \Blklen} | \myS^{ \Blklen}}\left(\myVec{y}^{ \Blklen} | \myVec{s}^{ \Blklen} \right) = \prod\limits_{i\!=\!1}^{\Blklen}\Pdf{\myY_i | \{\myS_l\}_{l=i-\Mem+1}^{i}}\left(\myVec{y}_i |\{\myVec{s}_l\}_{l=i-\Mem+1}^{i}\right), \end{equation} where the lower-case $\myVec{y}_i$ and $\myVec{s}_i$ represent the realizations of the random variables $\myY_i$ and $\myS_i$, respectively. The fact that the channel is stationary implies that the conditional \ac{pdf} $\Pdf{\myY_i | \{\myS_l\}_{l=i-\Mem+1}^{i}}$ does not depend on the index $i$. The symbol detection mapping that minimizes the error rate is the \ac{map} rule, given by \begin{align} \hat{\myVec{s}}_i &= \mathop{\arg \max}\limits_{\myVec{s} \in \mySet{S}^K }\Pdf{\myS_i|\myVec{Y}^\Blklen}(\myVec{s}|\myVec{y}^\Blklen), \qquad i \in \mySet{T}. \label{eqn:MAP} \end{align} For the memoryless case $\Mem=1$, solving \eqref{eqn:MAP} reduces to maximizing $\Pdf{\myS|\myY}(\myVec{s}|\myVec{y}_i)$ over $\myVec{s} \in \mySet{S}^K$. However, when $K$ is large, as is commonly the case in uplink \ac{mimo} systems, solving \eqref{eqn:MAP} may be computationally infeasible, even when the \ac{pdf} $\Pdf{\myS|\myY}$ is perfectly known. The application of deep learning for symbol detection thus has two main motivations: the first is to allow symbol detection to operate in a model-agnostic manner, i.e., without requiring knowledge of $\Pdf{\myS|\myY}$, and the second is to facilitate inference when the computational complexity of \eqref{eqn:MAP} renders solving it infeasible. \subsection{Symbol Detection via Established Deep Networks} \label{subsec:SymbolDetectionEstablished} The first approach to designing data-driven symbol detectors treats the channel as a black-box and relies on well-known deep learning architectures used in computer vision, speech, and language processing for detection. We now describe how conventional deep neural architectures can be used for symbol detection. \subsubsection{Overview of Design Process} Different \ac{dnn} architectures have shown promising results for detection and estimation in applications such as image processing \cite{tian2018deep, wang2020deep, minaee2020image}, speech recognition \cite{hin12, gra14towards, amo16deep}, machine translation \cite{bah14,cho14learning,yang2020survey}, and bioinformatics \cite{li16, lan2018survey}. Some of these neural network architectures can be used to design a symbol detector for channels with unknown models using supervised learning. This process typically consists of the following steps: \begin{enumerate} \item Identify the conventional neural network architectures that are suitable for the channel under consideration, and use these networks as building blocks for designing the detection algorithm. For example, \acp{rnn} are more suitable for sequential detection in channels with memory, while convolutional and fully-connected networks are more suitable for memoryless channels. \item Next, use channel input-output pairs to train the network. Two approaches can be used for training: In the first approach, a model is trained for each channel condition (e.g., each SNR). In the second approach, a large training dataset consisting of various channel conditions is used to train a single neural network detector for detection over a wide-range of channel conditions. The training data can be generated by randomizing the transmitted symbols and generating the corresponding received signal using mathematical models, simulations, experiments, or field measurements. \item Train the overall resulting network in an end-to-end fashion. \end{enumerate} We next demonstrate how this rationale is translated into a concrete data-driven symbol detector architecture for finite-memory channels. \subsubsection{Example: SBRNN for Finite-Memory Channels} The \ac{sbrnn} is a sequence detection algorithm for finite-memory channels proposed in \cite{farsad2018neural}. Generally, sequence detection can be performed using \acp{rnn} \cite{lecun2015deep}, which are well established for sequence estimation in different problems such as neural machine translation \cite{bah14}, speech recognition \cite{hinton2012deep}, or bioinformatics \cite{li16}. For simplicity, we assume in our description that the input cardinality $K$ is $K = 1$. The estimated symbol in this case is given by \begin{align} \label{eq:estForwSeqPMF} \hat{\myVec{s}}_i &= \mathop{\arg \max}\limits_{\myVec{s}_i \in \mySet{S}}P_{\text{RNN}}(\myVec{s}_i|\myVec{y}^i), \qquad i \in \mySet{T}, \end{align} where $P_{\text{RNN}}$ is the probability of estimating each symbol based on the \ac{dnn} model used. One of the main benefits of this detector is that after training, it can perform detection on any data stream as it arrives at the receiver. This is because the observations from previous symbols are summarized as the state of the RNN, which is represented by a vector. Note that the observed signal during the $j$th~transmission, $\myVec{Y}_j$ where $j>k$, may carry information about the $k$th~symbol $\myS_k$ due to the memory of the channel. However, since RNNs are feed-forward only, during the estimation of $\hat{\myS}_k$, the observation signal $\myVec{Y}_j$ is not considered. One way to overcome this limitation is by using bidirectional RNNs (BRNNs). In such networks, a sequence of $B$ received signals are fed once in the forward direction into one RNN cell, and fed once in the backward direction into another RNN cell \cite{sch97}, for some fixed $B$ representing the BRNN length. The two outputs are then concatenated and may be passed to more bidirectional layers. A signal whose blocklength $\Blklen$ is larger than the BRNN length $B$ is divided into multiple distinct subsequences of length $B$. Ideally, the $B$ must be at least the same size as the memory length $\Mem$. However, if this is not known in advance, the BRNN length can be treated as a hyperparameter to be tuned during training. At time instance $i$ belonging to the $k$th~subsequence, the estimated symbol for BRNN is given by \begin{align} \label{eq:estBiDirSeqPMF} \hat{\myVec{s}}_i &= \mathop{\arg \max}\limits_{\myVec{s}_i \in \mySet{S}}P_{\text{BRNN}}(\myVec{s}_i|\myVec{y}_{k}^{k+B-1}), \qquad k-B+1 \leq i \leq k. \end{align} To simplify the notation, we use $\hat{\myVec{p}}_i^{(k)}$ to denote the $\CnstSize\times 1$ matrix whose entries are the \ac{pmf} $P_{\text{BRNN}}(\myVec{s}_i|\myVec{y}_{k}^{k+B-1})$ for each $\myVec{s}_i \in \mySet{S}$. The BRNN architecture ensures that in the estimation of a symbol, future signal observations are taken into account. During training, blocks of $B$ consecutive transmissions are used for training. Once the network is trained, BRNNs detect the stream of incoming data in fixed blocks of length $B$, as shown in the top portion of Fig.~\ref{fig:slidingDetector}. The main drawback here is that the symbols at the end of each block may affect the symbols in the next block, and since each block is treated independently, this relation is not captured in this scheme. Another issue is that the block of $B$ symbols must be received before detection can be performed. The top portion of Figure \ref{fig:slidingDetector} shows this scheme for $B=3$. \begin{figure} \centering \includefig{SlidingBLSTMDetector.pdf} \caption{\label{fig:slidingDetector} The SBRNN detector versus using a BRNN as a block detector.} \vspace{-0.3cm} \end{figure} To overcome these limitations, in the \ac{sbrnn} proposed in \cite{farsad2018neural}, the first $B$ symbols are detected using the BRNN. Then, as each new symbol arrives at the receiver, the subsequence processed by the BRNN slides ahead by one symbol. Let the set $\mathcal{K}_i = \{k \mid k \leq i ~\wedge~ k + B > i \}$ be the set of all valid starting positions for a BRNN detector of length $B$, such that the detector overlaps with the \ith~symbol. For example, if $B=3$ and $i=4$, then $k=1$ is not in the set $\mathcal{K}_i$ since the BRNN detector overlaps with symbol positions 1, 2, and 3, and not the symbol position 4. The estimated \ac{pmf} corresponding to the \ith~symbol is given by the weighted sum of the estimated PMFs for each of the relevant windows: \begin{align} \label{eq:slidingPMF} \hat{\myVec{p}}_i = \sum_{k\in \mathcal{K}_i} \alpha_k \hat{\myVec{p}}_i^{(k)}, \qquad \alpha_k \geq 0 ~\text{and}~ \sum \alpha_k = 1. \end{align} The weighted sum coefficients can be set to $\alpha_k = \frac{1}{|\mathcal{K}_i|}$, as we do in the numerical evaluations in Section \ref{subsec:SymbolDetectionSims}. An illustration of the operation of the SBRNN detector based on \eqref{eq:slidingPMF} is depicted in the bottom portion of Fig.~\ref{fig:slidingDetector}. \subsubsection{Summary} Well-known \ac{dnn} architectures can be trained in an end-to-end manner to perform symbol detection. This approach builds upon the success of existing model-agnostic \ac{dnn} structures, resulting in symbol detectors operating without any knowledge about the underlying channel models. Furthermore, this strategy allows combining some basic level of domain knowledge in the selection of the architecture as well as the preparation of its input. For example, the SBRNN detector detailed above identifies the BRNN architecture as one that is capable of handling temporal correlation in finite-memory channels, while using a sliding subsequence to overcome some of the limitations of BRNN architectures when applied to different blocks independently. Also, \ac{dnn}s can well-capture the nonlinearities that may exist in the channel. For example, the \ac{sbrnn} was used as an autoencoder in \cite{karanov2019end, karanov2020experimental} to achieve state-of-the-art performance over optical channels, outperforming model-based nonlinear equalizers such as Voltera. Finally, these networks can also be computationally more efficient than the optimal maximum-likelihood sequence detector over finite-memory channels, specifically for channels with long memory. The main drawback in using established deep networks for end-to-end symbol detection is that such architectures typically have a very large number of parameters, and thus require massive data sets for training. This renders online training using pilot sequences impractical. {Moreover, when they are trained using data from a large set of channel conditions, the resulting network will not perform optimally for each of those channel conditions individually. Furthermore, even when the data set is extremely large and diverse, it is not likely to capture all expected channel conditions.} Finally, conventional \ac{dnn} architectures are treated as black-boxes, and are in general not interpretable, making it difficult to come up with performance guarantees. \subsection{Symbol Detection via Deep Unfolding} \label{subsec:SymbolDetectionUnfolding} Unlike conventional \acp{dnn}, which utilize established architectures, in deep unfolding the network structure is designed following a model-based algorithm. We next describe how this model-based \ac{ml} technique can be applied for symbol detection, and detail a concrete example for flat Gaussian \ac{mimo} channels. \subsubsection{Overview of Design Process} Deep unfolding is a method for converting an iterative algorithm into a \ac{dnn} by designing each layer of the network to resemble a single iteration. As such, the rationale in applying deep unfolding consists of the following steps: \begin{enumerate} \item Identify an iterative optimization algorithm that is useful for the problem at hand. For instance, recovering the \ac{map} symbol detector for flat \ac{mimo} channels can be tackled using various iterative optimization algorithms, such as projected gradient descent, unfolded into DetNet \cite{samuel2019learning}, as described in the sequel. \item Fix a number of iterations in the optimization algorithm. \item Design the layers to initiate the operation of each iteration in a trainable fashion, as illustrated in Fig. \ref{fig:ModelBasedFlow}. \item Train the overall resulting network in an end-to-end fashion. \end{enumerate} We next demonstrate how this rationale is translated into a concrete data-driven symbol detector architecture for flat \ac{mimo} channels, i.e., \eqref{eqn:ChModel1} with $\Mem=1$. \subsubsection{Example: DetNet for Flat MIMO Channels} DetNet is a deep learning based symbol detector proposed in \cite{samuel2019learning} for flat Gaussian \ac{mimo} channels. To formulate DetNet, we first detail the specific channel model for which it is designed, and then show how it is obtained by unfolding the projected gradient descent method for recovering the \ac{map} estimate. \paragraph{Flat Gaussian MIMO Channel} As we focus on stationary memoryless channels, we drop the subscript $i$ representing the time instance, and write the input-output relationship of a flat Gaussian \ac{mimo} channel as \begin{equation} \label{eqn:Gaussian} \myY = \myMat{H}\myS + \myVec{W}, \end{equation} where $\myMat{H}$ is a known deterministic $N\times K$ channel matrix, and $\myVec{W}$ consists of $N$ i.i.d Gaussian \acp{rv}. Consider the case in which the symbols are generated from a \ac{bpsk} constellation in a uniform i.i.d. manner, i.e., $\mathcal{S}=\{\pm 1\}$. In this case the \ac{map} rule in \eqref{eqn:MAP} given an observation $\myY=\myVec{y}$ becomes the minimum distance estimate, given by \begin{equation} \label{eqn:DetNetObj} \hat{\myVec{s}} = \mathop{\arg \min}\limits_{\myVec{s}\in\{\pm 1\}^K} \|\myVec{y}-\myMat{H}\myVec{s}\|^2. \end{equation} \paragraph{Project Gradient Descent Optimization} While directly solving \eqref{eqn:DetNetObj} involves an exhaustive search over the $2^K$ possible symbol combinations, it can be tackled with affordable computational complexity using the iterative projected gradient descent algorithm. Let $\mySet{P}_{\mySet{S}}(\cdot)$ denote the projection into the $\mySet{S}$ operator, which for \ac{bpsk} constellations is the sign function. The projected gradient descent iteratively refines its estimate, which at iteration index $q+1$ is obtained recursively as \begin{align} \hat{\myVec{s}}_{q + 1} &= \mySet{P}_{\mySet{S}}\left(\hat{\myVec{s}}_{q} - \eta_q \left.\frac{\partial \|\myVec{y}-\myMat{H}\myVec{s}\|^2}{\partial \myVec{s}}\right|_{\myVec{s} = \hat{\myVec{s}}_q} \right) \notag \\ &= \mySet{P}_{\mySet{S}}\left(\hat{\myVec{s}}_{q} - \eta_q\myMat{H}^T\myVec{y} + \eta_q\myMat{H}^T\myMat{H}\hat{\myVec{s}}_{q} \right), \label{eqn:ProjGrad} \end{align} where $\eta_q$ denotes the step size at iteration $q$, and $\hat{\myVec{s}}_0$ is set to some initial guess. \paragraph{Unfolded DetNet} DetNet unfolds the projected gradient descent iterations in \eqref{eqn:ProjGrad} into a \ac{dnn}, which learns to carry out this optimization procedure from data. To formulate DetNet, we first fix a number of iterations $Q$. Next, we design a \ac{dnn} with $Q$ layers, where each layer imitates a single iteration of \eqref{eqn:ProjGrad} in a trainable manner. In particular, DetNet builds upon the observation that each projected gradient descent iteration consists of two stages: gradient descent computation, i.e., $\hat{\myVec{s}}_{q} - \eta_q\myMat{H}^T\myVec{y} + \eta_q\myMat{H}^T\myMat{H}\hat{\myVec{s}}_{q}$, and projection, namely, applying $ \mySet{P}_{\mySet{S}}(\cdot)$. Therefore, each unfolded iteration is represented as two sub-layers: The first sub-layer learns to compute the gradient descent stage by treating the step-size as a learned parameter and applying a conventional fully-connected layer with ReLU activation to the obtained value. For iteration index $q$, this results in \begin{equation} \myVec{z}_{q} = {\rm ReLU}\left(\myMat{W}_{1,q}\left(\hat{\myVec{s}}_{q-1} - \delta_{1,q}\myMat{H}^T\myVec{y} + \delta_{2,q}\myMat{H}^T\myMat{H}\hat{\myVec{s}}_{q-1} \right) + \myVec{b}_{1,q} \right), \label{eqn:Layer1} \end{equation} in which $\{\myMat{W}_{1,q}, \myVec{b}_{1,q}, \delta_{1,q}, \delta_{2,q}\}$ are learnable parameters. The second sub-layer learns the projection operator by approximating the sign operation with a soft sign activation proceeded by a fully-connected layer, leading to \begin{equation} \hat{\myVec{s}}_q = {\rm soft~sign}\left( \myMat{W}_{2,q} \myVec{z}_{q} +\myVec{b}_{2,q} \right). \label{eqn:Layer2} \end{equation} Here, the learnable parameters are $\{\myMat{W}_{2,q}, \myVec{b}_{2,q}\}$. The resulting deep network is depicted in Fig. \ref{fig:DetNet}, in which $\hat{\myVec{s}}_0 $ is set to some initial guess, and the output after $Q$ iterations, denoted $\hat{\myVec{s}}_{Q}$, is used as the estimated symbol vector by taking the sign of each element. Let $\myVec{\theta} = \{\myMat{W}_{1,q}, \myMat{W}_{2,q}, \myVec{b}_{1,q}, \myVec{b}_{2,q}, \delta_{1,q}, \delta_{2,q}\}_{q=1}^Q$ be the trainable parameters of DetNet$^{\footnotemark}$. \footnotetext{The formulation of DetNet in \cite{samuel2019learning} includes an additional sub-layer in each iteration intended to further lift its input into higher dimensions and introduce additional trainable parameters, as well as reweighing of the outputs of subsequent layers. As these operations do not follow directly from unfolding the projected gradient descent method, they are not included in the description here.} To tune $\myVec{\theta}$, the overall network is trained in an end-to-end manner to minimize the empirical weighted $\ell_2$ norm loss over its intermediate layers. In particular, by letting $\{\myVec{s}_t, \myVec{y}_t\}_{t=1}^{n_t}$ denote the training set consisting of channel outputs and their corresponding transmitted symbols, the loss function used for training DetNet is given by \begin{equation} \label{eqn:LossDetNet} \mySet{L}(\myVec{\theta}) = \frac{1}{n_t}\sum_{t=1}^{n_t}\sum_{q=1}^{Q} \log(q)\|\myVec{s}_t - \hat{\myVec{s}}_q(\myVec{y}_t; \myVec{\theta}) \|^2, \end{equation} where $\hat{\myVec{s}}_q(\myVec{y}_t; \myVec{\theta})$ is the output of the $q$th layer of DetNet with parameters $\myVec{\theta}$ and input $\myVec{y}_t$. This loss measure accounts for the interpretable nature of the unfolded network, in which the output of each layer is a further refined estimate of $\myVec{S}$. \begin{figure} \centering \includegraphics[width=\linewidth]{DetNet.png} \caption{Deep unfolded symbol detector illustration. Parameters in red fonts are learned in training, while those in blue fonts are externally provided.} \label{fig:DetNet} \end{figure} \subsubsection{Summary} Deep unfolding incorporates model-based domain knowledge to obtain a dedicated \ac{dnn} design, which follows an iterative optimization algorithm. Compared to the conventional \acp{dnn} discussed in the previous section, unfolded networks are typically interpretable, and tend to have a smaller number of parameters, and can thus be trained quicker \cite{balatsoukas2019deep}. Nonetheless, these deep networks are still highly parameterized, and require a large volume of training data. For instance, DetNet is trained in \cite{samuel2019learning} using approximately $250$ million labeled samples. One of the key properties of unfolded networks is their reliance on model knowledge. For example, the unfolded receiver must know that the channel input-output relationship takes the form \eqref{eqn:Gaussian} in order to formulate the projected gradient iterations \eqref{eqn:ProjGrad}, which in turn are unfolded into DetNet. The model-awareness of deep unfolding has its advantages and drawbacks. When the model is accurately known, deep unfolding essentially incorporates it into the \ac{dnn} architecture, as opposed to conventional \acp{dnn} that must learn this from data. However, this approach does not exploit the model-agnostic nature of deep learning, and thus may achieve degraded performance when the true channel conditions deviate from the model assumed in design, e.g., \eqref{eqn:Gaussian}. In particular, a key advantage of deep unfolding over the model-based optimization algorithm is in inference speed. For instance, DetNet requires fewer layers to reliably detect compared to the number of iterations required for projected gradient descent to converge. { Another important advantage of unfolded networks is their ability to improve the accuracy compared to the iterative optimization algorithm from which they originate. In particular, the set $\{\pm 1\}^{K}$ over which the optimization problem \eqref{eqn:DetNetObj} is formulated is not convex, and thus projected gradient descent is not guaranteed to recover its solution, regardless of the number of iterations. By unfolding the application of projected gradient descent for solving \eqref{eqn:DetNetObj} into a \ac{dnn} with trainable parameters, the resulting network is often able to overcome this difficulty and converge to the true solution of the optimization problem when properly trained, despite the non-convexity. Finally, in the context of receiver design, most unfolded networks to date, including DetNet as well as OAMP-net \cite{he2018model} which unfolds the orthogonal approximate message passing optimization algorithm, require \ac{csi}. For example, knowledge of the matrix $\myMat{H}$ is utilized in the architecture depicted in Fig.~\ref{fig:DetNet}. This implies that additional mechanisms for estimating the channel must be incorporated into the receiver architecture \cite{he2019model}. Nonetheless, while the aforementioned deep unfolding based receivers require \ac{csi}, unfolded networks can be designed without such knowledge \cite{monga2019algorithm}. For example, one can unfold the optimization algorithm assuming \ac{csi} is available, and then treat $\myMat{H}$ which appears in the unfolded network as part of its trainable parameters.} \subsection{Symbol Detection via \ac{dnn}-Aided Algorithms} \label{subsec:SymbolDetectionAlgorithm} \ac{dnn}-aided hybrid algorithms combine domain knowledge in the form of a model-based inference algorithm for the problem at hand. This strategy allows the design of model-based \ac{ml} systems with varying levels of domain knowledge, in which deep learning is used to robustify and remove model-dependence of specific components of the algorithm. In the following we first review the rationale when designing \ac{dnn}-aided symbol detectors, after which we detail three concrete examples arising from different symbol detection algorithms. \subsubsection{Overview of Design Process} \ac{dnn}-aided algorithms aim to carry out model-based inference methods in a data-driven fashion. These hybrid systems thus utilize deep learning not for the overall inference task, but for robustifying and relaxing the model-dependence of established model-based inference algorithms. Consequently, the design of \ac{dnn}-aided hybrid systems consists of the following steps: \begin{enumerate} \item First, a proper inference algorithm is chosen. In particular, the domain knowledge is encapsulated in the selection of the algorithm that is learned from data. For example, the Viterbi algorithm is a natural candidate for symbol detection over finite-memory channels when seeking a symbol detector capable of operating in real-time, or alternatively, the BCJR scheme is the suitable choice for carrying out \ac{map} inference over such channels. When designing receivers for flat \ac{mimo} channels, interference cancellation methods may be the preferable algorithmic approach for symbol detection. We show how these methods are converted into \ac{dnn}-aided algorithms in the sequel. \item Once a model-based algorithm is selected, we identify its model-specific computations, and replace them with dedicated compact \acp{dnn}. \item The resulting \acp{dnn} can be either trained individually, or the overall system can be trained in an end-to-end manner. \end{enumerate} Since the implementation of \ac{dnn}-aided algorithms highly varies with the selection of the learned model-based method, we next present three concrete examples in the context of symbol detection: {\em ViterbiNet}, which learns to carry out Viterbi detection \cite{viterbi1967error}; {\em BCJRNet}, which implements the BCJR algorithm of \cite{bahl1974optimal} in a data-driven fashion; and {\em DeepSIC}, which is based on the soft iterative interference cancellation methods for \ac{mimo} symbol detection \cite{choi2000iterative}. \subsubsection{Example: ViterbiNet for Finite-Memory Channels} ViterbiNet proposed in \cite{shlezinger2019viterbinet} is a data-driven implementation of the Viterbi detection algorithm \cite{viterbi1967error}, which is one of the most common workhorses in digital communications. This \ac{dnn}-aided symbol detection algorithm is suitable for finite-memory channels of the form \eqref{eqn:ChModel1}, without requiring prior knowledge of the channel conditional distributions $\Pdf{\myY_i | \{\myS_l\}_{l=i-\Mem+1}^{i}}$. For simplicity, we assume in our description that the input cardinality $K$ is $K = 1$. As a preliminary step to presenting ViterbiNet, we now briefly review conventional model-based Viterbi detection. \paragraph{The Viterbi Algorithm} The Viterbi algorithm recovers the maximum likelihood sequence detector, i.e., \begin{align} \hat{\myVec{s}}^{ \Blklen}\left( \myVec{y}^{ \Blklen}\right) &:= \mathop{\arg \max}_{\myVec{s}^{ \Blklen} \in \mySet{S}^\Blklen } \Pdf{\myVec{Y}^{ \Blklen} | \myVec{S}^{ \Blklen}}\left( {\myVec{y}^{ \Blklen} | \myVec{s}^{ \Blklen}}\right) \notag \\ & = \mathop{\arg \min}_{\myVec{s}^{ \Blklen} \in \mySet{S}^\Blklen } -\log \Pdf{\myVec{Y}^{ \Blklen} | \myVec{S}^{ \Blklen}}\left( \myVec{y}^{ \Blklen} | \myVec{s}^{ \Blklen}\right) . \label{eqn:ML1} \end{align} Using \eqref{eqn:ChModel1} the optimization problem \eqref{eqn:ML1} becomes \begin{align} \hat{\myVec{s}}^{ \Blklen}\left( \myVec{y}^{ \Blklen}\right) &= \mathop{\arg \min}_{\myVec{s}^{ \Blklen} \in \mySet{S}^\Blklen }\sum\limits_{i=1}^{\Blklen } - \log \Pdf{\myVec{Y}_i | \{\myVec{S}_l\}_{l=i-\Mem+1}^{i}}\left( \myVec{y}_i | \{\myVec{s}_l\}_{l=i-\Mem+1}^{i}\right). \label{eqn:ML3} \end{align} To proceed, we define a state variable $\myState_i := [\myS_{i-\Mem+1},\ldots, \myS_i] \in \mySet{S}^\Mem$. Since the symbols are i.i.d. and uniformly distributed, it follows that $\Pdf{\myState_i|\myState_{i-1}}(\bar{\myVec{s}}_i|\bar{\myVec{s}}_{i-1}) = \CnstSize^{-1}$ when $\bar{\myVec{s}}_i$ is a shifted version of $\bar{\myVec{s}}_{i-1}$, i.e., the first $\Mem-1$ entries of $\bar{\myVec{s}}_i$ are the last $\Mem-1$ entries of $\bar{\myVec{s}}_{i-1}$, and zero otherwise. We can now write \eqref{eqn:ML3} as \begin{align} \hat{\myVec{s}}^{ \Blklen}\left( \myVec{y}^{ \Blklen}\right) &= \mathop{\arg \min}_{\myVec{s}^{ \Blklen} \in \mySet{S}^\Blklen }\sum\limits_{i=1}^{\Blklen } - \log \Pdf{\myVec{Y}_i |\myState_i}\left( \myVec{y}_i | \{\myVec{s}_l\}_{l=i-\Mem+1}^{i}\right). \label{eqn:ML4} \end{align} The optimization problem \eqref{eqn:ML4} can be solved recursively using dynamic programming, by iteratively updating a {\em path cost} $c_i(\bar{\myVec{s}})$ for each state $\bar{\myVec{s}}\in \mySet{S}^{\Mem}$. The resulting scheme, known as the Viterbi algorithm, is given below as Algorithm~\ref{alg:Algo1}, and illustrated in Fig. \ref{fig:ViterbiNet}(a). \begin{algorithm} \caption{ The Viterbi Algorithm \cite{viterbi1967error}} \label{alg:Algo1} \KwData{Fix an initial path $\myVec{p}_{0}\left(s\right) = \varnothing $ and path cost ${c}_{0}\!\left(\bar{\myVec{s}}\right)\! =\! 0$, $\bar{\myVec{s}} \in \mySet{S}^{\Mem}$. } \For{$i=1,2,\ldots,\Blklen$}{ For each state $\bar{\myVec{s}} \in \mySet{S}^{\Mem}$, compute previous state with shortest path, denoted $u_{\bar{\myVec{s}}}$, via \begin{equation} \label{eqn:ViterbiUpdate} u_{\bar{\myVec{s}}} = \mathop{\arg\min}\limits_{\bar{\myVec{s}}' \in \mySet{S}^\Mem: \Pdf{\myState_i|\myState_{i-1}}(\bar{\myVec{s}}|\bar{\myVec{s}}')>0 } \left({c}_{i-1}\left(\bar{\myVec{s}}'\right) - \log \Pdf{\myY_i | \myState_i}\left( \myVec{y}_i |\bar{\myVec{s}}\right) \right). \end{equation}\\ Update cost and path via \begin{equation} \label{eqn:ViterbiUpdate2} {c}_i\left( \bar{\myVec{s}}\right) = {c}_{i-1}\left(u_{\bar{\myVec{s}}} \right) - \log \Pdf{\myY_i | \myState_i}\left( \myVec{y}_i | \bar{\myVec{s}}\right), \end{equation} and $\myVec{p}_{i}\left(\bar{\myVec{s}}\right) = \big[\myVec{p}_{i-1}\left(u_{\bar{\myVec{s}}}\right) , u_{\bar{\myVec{s}}} \big]$\; } \KwOut{$\hat{\myVec{s}}^\Blklen = \myVec{p}_{\Blklen}\left(\bar{\myVec{s}}^*\right)$ where $\bar{\myVec{s}}^* = \arg\min_{\bar{\myVec{s}}} c_\Blklen(\bar{\myVec{s}})$.} \end{algorithm} The Viterbi algorithm has two major advantages: $1)$ It solves \eqref{eqn:ML1} at a computational complexity that is linear in the blocklength $\Blklen$. For comparison, the computational complexity of solving \eqref{eqn:ML1} directly grows exponentially with $\Blklen$; $2)$ The algorithm produces estimates sequentially during run-time. In particular, while in \eqref{eqn:ML1} the estimated output $\hat{\myVec{s}}^{ \Blklen}$ is computed using the entire received block $\myVec{y}^{ \Blklen}$, Algorithm~\ref{alg:Algo1} computes $\hat{\myVec{s}}_i$ once $\myVec{y}_{i + \Mem - 1}$ is received. \begin{figure} \centering \includegraphics[width=\linewidth]{ViterbiNet.png} \caption{An illustration of the operation of the Viterbi algorithm (a) and ViterbiNet (b). Here, the memory length is $\Mem=2$ and the constellation is $\mySet{S} = \{0,1\}$, implying that the number of states is $\CnstSize^\Mem = 4$. The values in blue are the negative log-likelihoods for each state, while the quantities in red represent the updated path loss $c_i(\cdot)$. When multiple paths lead to the same state, as occurs for $i= 3,4$, the path with minimal loss is maintained.} \label{fig:ViterbiNet} \end{figure} \paragraph{ViterbiNet} ViterbiNet proposed in \cite{shlezinger2019viterbinet} learns to implement the Viterbi algorithm from data in a model-agnostic manner. Following the rationale of \ac{dnn}-aided algorithms, this is achieved by identifying the model-based components of the algorithm, which for Algorithm~\ref{alg:Algo1} boils down to the computation of the log-likelihood function $ \log \Pdf{\myY_i | \myState_i}\left( \myVec{y}_i |\bar{\myVec{s}}\right) $. Once this quantity is computed for each $\bar{\myVec{s}} \in \mySet{S}^\Mem$, the Viterbi algorithm only requires knowledge of the memory length $\Mem$. This requirement is much easier to satisfy compared to full \ac{csi}. Since the channel is stationary, it holds that the log-likelihood function depends only on the realizations of $\myVec{y}_i$ and of $\bar{\myVec{s}}$, and not on the time index $i$. Therefore, to implement Algorithm \ref{alg:Algo1} in a data-driven fashion, ViterbiNet replaces the explicit computation of the log-likelihoods with an \ac{ml}-based system that learns to evaluate this function from training data. In this case, the input of the system is the channel output realization $\myVec{y}_i$ and the output is an estimate of $ \log \Pdf{\myY_i | \myState_i}\left( \myVec{y}_i |\bar{\myVec{s}}\right)$ for each $\bar{\myVec{s}}\in\mySet{S}^{\Mem}$. The rest of the Viterbi algorithm remains intact, and the detector implements Algorithm~\ref{alg:Algo1} using the learned log-likelihoods. The proposed architecture is illustrated in Fig.~\ref{fig:ViterbiNet}(b). \begin{figure} \centering {\includegraphics[width=\linewidth]{LearnedFunctionNode_2opts5.png}} \caption{Learned likelihood architectures based on (a) classification and (b) conditional density estimation networks.} \label{fig:LearnedFunctionNode} \end{figure} Two candidate architectures are considered for learning to compute the log likelihood, one based on classification networks and one using density estimation networks. \\ {\bf Learned likelihood using classification networks:} Since $\myVec{y}_i$ is given and may take continuous values while the desired variables take discrete values, a natural approach to evaluate $\Pdf{\myY_i | \myState_i}\left( \myVec{y}_i |\bar{\myVec{s}}\right)$ for each $\bar{\myVec{s}}\in\mySet{S}^{\Mem}$ is to estimate $\Pdf{\myState_i| \myY_i }\left( \bar{\myVec{s}} | \myVec{y}_i\right)$ and then use Bayes rule to obtain \begin{equation} \label{eqn:Bayes} \Pdf{\myY_i | \myState_i}\left( \myVec{y}_i |\bar{\myVec{s}}\right) = \Pdf{\myState_i| \myY_i }\left( \bar{\myVec{s}} | \myVec{y}_i\right) \Pdf{\myY_i }\left( \myVec{y}_i \right) \CnstSize^{\Mem}. \end{equation} A parametric estimate of $\Pdf{\myState_i| \myY_i }\left( \bar{\myVec{s}} | \myVec{y}_i\right)$, denoted $\hat{P}_{\myVec{\theta}}(\bar{\myVec{s}}|\myVec{y}_i)$, is obtained for each $\bar{\myVec{s}}\in\mySet{S}^{\Mem}$ by training classification networks with softmax output layers to minimize the cross entropy loss. Here, for a labeled set $\{\myVec{s}_t, \myVec{y}_t\}_{t=1}^{n_t}$, the loss function is \begin{equation} \label{eqn:LossClass} \mySet{L}(\myVec{\theta}) = \frac{1}{n_t}\sum_{t=1}^{n_t} -\log \hat{P}_{\myVec{\theta}}([\myVec{s}_{t-\Mem+1},\ldots, \myVec{s}_t]|\myVec{y}_t). \end{equation} In general, the marginal \ac{pdf} of $\myY_i$ can be estimated from the training data using mixture density estimation via, e.g., \ac{em} \cite[Ch. 2]{mclachlan2004finite}, or any other finite mixture model fitting method. However, obtaining an accurate density estimation becomes challenging when $\myY_i$ is high-dimensional. Since $ \Pdf{\myY_i }\left(\myVec{y}_i \right)$ does not depend on the variable $\bar{\myVec{s}}$, setting $ \Pdf{\myY_i }\left(\myVec{y}_i \right) \equiv 1$ does not affect the decisions in Algorithm \ref{alg:Algo1} due to the $\arg\min$ arguments, which are invariant to scaling the conditional distribution by a term that does not depend on $\bar{\myVec{s}}$. The resulting structure is illustrated in Fig.~ \ref{fig:LearnedFunctionNode}(a). \\ {\bf Learned likelihood using conditional density networks:} An additional strategy is to directly estimate the conditional $\Pdf{\myY_i | \myState_i}\left( \myVec{y}_i |\bar{\myVec{s}}\right)$ from data. This can be achieved using conditional density estimation networks \cite{bishop1994mixture, rothfuss2019conditional} that are specifically designed to learn such \acp{pdf}, or alternatively, using normalizing flow networks to learn complex densities \cite{kobyzev2019normalizing}. For example, mixture density networks \cite{bishop1994mixture} model the conditional \ac{pdf} $\Pdf{\myY_i | \myState_i}\left( \myVec{y}_i |\bar{\myVec{s}}\right)$ as a Gaussian mixture, and train a \ac{dnn} to estimate its mixing parameters, mean values, and covariances, denoted $w_{k,\myVec{\theta}}(\bar{\myVec{s}} )$, $\myVec{\mu}_{k,\myVec{\theta}}( \bar{\myVec{s}})$ and $\myMat{\Sigma}_{k,\myVec{\theta}}(\bar{\myVec{s}})$, respectively, by maximizing the likelihood $\hat{P}_{\myVec{\theta}}\left(\myVec{y}_i |\bar{\myVec{s}} \right)= \sum_{k} w_{k,\myVec{\theta}}(\bar{\myVec{s}} ) \mathcal{N}\big(\myVec{y}_i | \myVec{\mu}_{k,\myVec{\theta}}(\bar{\myVec{s}}), \myMat{\Sigma}_{k,\myVec{\theta}}(\bar{\myVec{s}})\big)$, as illustrated in Fig. \ref{fig:LearnedFunctionNode}(b). Both approaches can be utilized for learning to compute the likelihood in ViterbiNet. When the channel outputs are high-dimensional, i.e., $N$ is large, directly learning the conditional density is difficult and likely to be inaccurate. In such cases, the classification-based architecture, which avoids the need to explicitly learn the density, may be preferable. When the state cardinality $\CnstSize^\Mem$ is large, conditional density networks are expected to be more reliable. However, the Viterbi algorithm becomes computationally infeasible when $\CnstSize^\Mem$ grows, regardless of whether it is implemented in a model-based or data-driven fashion, making ViterbiNet non-suitable for such setups. \subsubsection{Example: BCJRNet for Finite-Memory Channels} Factor graph methods, such as the sum-product algorithm, exploit the factorization of a joint distribution to efficiently compute a desired quantity \cite{kschischang2001factor}. In particular, the application of the sum-product algorithm for the joint input-output distribution of finite-memory channels allows for computing the \ac{map} rule, an operation whose burden typically grows exponentially with the block size, with complexity that only grows linearly with $\Blklen$. This instance of the sum-product algorithm is exactly the BCJR detector proposed \cite{bahl1974optimal}. In the following we show how the BCJR method can be extended into the \ac{dnn}-aided BCJRNet. As in our description of ViterbiNet, we again focus on the case of $K=1$, and begin by presenting the model-based BCJR algorithm. \paragraph{The BCJR Algorithm} The BCJR algorithm computes the \ac{map} rule in \eqref{eqn:MAP} for finite-memory channels with complexity that grows linearly with the block size. To formulate this method, we recall the definition of $\myState_i$, and define the function \begin{align} f\left(\myVec{y}_i, \bar{\myVec{s}}_i, \bar{\myVec{s}}_{i-1} \right) &:= \Pdf{\myY_i | \myState_i }\left(\myVec{y}_i|\bar{\myVec{s}}_{i} \right) \Pdf{\myState_i | \myState_{i-1}}\left(\bar{\myVec{s}}_{i}| \bar{\myVec{s}}_{i-1}\right) \notag \\ &= \begin{cases} \frac{1}{\CnstSize}\Pdf{\myY_i | \myState_i }\left(\myVec{y}_i|\bar{\myVec{s}}_{i} \right)& (\bar{\myVec{s}}_i)_j = (\bar{\myVec{s}}_{i\!-1})_{j\!-\!1}, \quad \forall j\in\{2,\ldots, \Mem\}, \\ 0 & {\rm otherwise}. \end{cases} \label{eqn:FSC_funcNode} \end{align} Combining \eqref{eqn:FSC_funcNode} and \eqref{eqn:ChModel1}, we obtain a factorizable expression of the joint distribution $\Pdf{\myVec{Y}^\Blklen,\myVec{S}^\Blklen}(\cdot)$, given by \begin{align} \Pdf{\myY^{ \Blklen} , \myS^{ \Blklen}}\left(\myVec{y}^{ \Blklen} , \myVec{s}^{ \Blklen} \right) &= \prod\limits_{i\!=\!1}^{\Blklen}\frac{1}{\CnstSize}\Pdf{\myY_i | \myState_i}\left(\myVec{y}_i |[\myVec{s}_{i-\Mem+1}, \ldots, \myVec{s}_{i}]\right) \notag \\ &= \prod\limits_{i\!=\!1}^{\Blklen} f\left(\myVec{y}_i, [\myVec{s}_{i-\Mem+1}, \ldots, \myVec{s}_{i}], [\myVec{s}_{i-\Mem}, \ldots, \myVec{s}_{i-1}] \right). \label{eqn:ChModel2} \end{align} The factorizable expression of the joint distribution \eqref{eqn:ChModel2} implies that it can be represented as a factor graph with $\Blklen$ function nodes $\{ f\left(\myVec{y}_i, \bar{\myVec{s}}_i, \bar{\myVec{s}}_{i-1} \right) \}$, in which $\{\bar{\myVec{s}}_i\}_{i=2}^{\Blklen-1}$ are edges while the remaining variables are half-edges$^{\footnotemark}$. \footnotetext{Here we use Forney style factor graphs \cite{forney2001codes}, where variables are represented as edges or half-edges. However, it is also possible to represent variables as variables notes.} Using its factor graph representation, one can compute the joint distribution of $\myVec{S}^{\Blklen}$ and $\myVec{Y}^{\Blklen}$ by recursive message passing along this factor graph. In particular, \begin{align} \Pdf{\myState_k,\myState_{k+1}, \myVec{Y}^{\Blklen}}(\bar{\myVec{s}}_k,\bar{\myVec{s}}_{k+1}, \myVec{y}^{\Blklen}) &= \FwdMsg{f_k}{\myState_k}(\bar{\myVec{s}}_k) f({y}_{k+1}, \bar{\myVec{s}}_{k+1}, \bar{\myVec{s}}_k) \BwdMsg{f_{k+2}}{\myState_{k+1}}(\bar{\myVec{s}}_{k+1}), \label{eqn:Recursion1} \end{align} where the forward path messages satisfy \begin{equation} \FwdMsg{f_i}{\myState_i}(\bar{\myVec{s}}_i) = \sum_{\bar{\myVec{s}}_{i-1}} f(\myVec{y}_{i}, \bar{\myVec{s}}_{i}, \bar{\myVec{s}}_{i-1})\FwdMsg{f_{i-1}}{\myState_{i-1}}(\bar{\myVec{s}}_{i-1}), \label{eqn:Recursion1Forwards} \end{equation} for $i = 1, 2,\ldots, k$. Similarly, the backward messages are \begin{equation} \BwdMsg{f_{i\!+\!1}}{ \myState_i}(\bar{\myVec{s}}_i) = \sum_{\bar{\myVec{s}}_{i\!+\!1}} f(\myVec{y}_{i\!+\!1}, \bar{\myVec{s}}_{i\!+\!1}, \bar{\myVec{s}}_{i})\BwdMsg{f_{i\!+\!2} }{ \myState_{i\!+\!1}}(\bar{\myVec{s}}_{i\!+\!1}), \label{eqn:Recursion1Backwards} \end{equation} \begin{figure} \centering {\includefig{SumProduct6.png}} \caption{Message passing over the factor graph of a finite-memory channel.} \label{fig:SumProduct2} \end{figure} for $i = \Blklen-1, \Blklen -2, \ldots, k+1$. This message passing is illustrated in Fig.~\ref{fig:SumProduct2}. The ability to compute the joint distribution in \eqref{eqn:Recursion1} via message passing results in the \ac{map} detector in \eqref{eqn:MAP}, an operation whose burden typically grows exponentially with the block size, with complexity that only grows linearly with $\Blklen$. This is achieved by noting that the \ac{map} estimate satisfies \begin{align} \hat{\myVec{s}}_i\left( \myVec{y}^\Blklen\right) =\mathop{\arg \max}\limits_{\myVec{s} \in \mySet{S}} \sum_{ \bar{\myVec{s}}_{i\! - \!1}\in \mySet{S}^{\Mem}} &\FwdMsg{f_{i\! - \!1}}{\myState_{i\! - \!1}}(\bar{\myVec{s}}_{i\! - \!1}) f(\myVec{y}_{i}, [\myVec{s}_{i\! - \!\Mem\!+\!1}, \ldots, \myVec{s}_{i} ],\bar{\myVec{s}}_{i\! - \!1}) \notag \\ & \times \BwdMsg{f_{i+1}}{\bar{\myVec{s}}_{i}}([\myVec{s}_{i\! - \!\Mem\!+\!1}, \ldots, \myVec{s}_{i} ]), \label{eqn:MAP2} \end{align} for each $i \in \mySet{T}$, where the summands can be computed recursively. When the block size $\Blklen$ is large, the messages may tend to zero, and are thus commonly scaled \cite{loeliger2004introduction}, e.g., $\BwdMsg{f_{i+1}}{\myState_i}(\bar{\myVec{s}})$ is replaced with $\gamma_i \BwdMsg{f_{i+1}}{\myState_i}(\bar{\myVec{s}})$ for some scale factor that does not depend on $\bar{\myVec{s}}$, and thus does not affect the \ac{map} rule. The BCJR algorithm is summarized as Algorithm~\ref{alg:Algo0}. \begin{algorithm} \caption{ The BCJR algorithm} \label{alg:Algo0} \KwData{Fix an initial forward message $\FwdMsg{f_{0}}{\myState_{0}}(\bar{\myVec{s}})= 1$ and a final backward message $\BwdMsg{f_{0}}{\myState_{\Blklen}}(\bar{\myVec{s}})\equiv 1$. } \For{$i=\Blklen-1,\Blklen-2,\ldots,1$}{ For each $\bar{\myVec{s}} \in \mySet{S}^\Mem$, compute backward message $ \BwdMsg{f_{i}}{\myState_{i}}(\bar{\myVec{s}})$ via \eqref{eqn:Recursion1Backwards} } \For{$i=1,2,\ldots,\Blklen$}{ For each $\bar{\myVec{s}}\in \mySet{S}^\Mem$, compute forward message $ \FwdMsg{f_{i}}{\myState_{i}}(\bar{\myVec{s}})$ via \eqref{eqn:Recursion1Forwards} } \KwOut{$\hat{\myVec{s}}^\Blklen = [\hat{\myVec{s}}_1, \ldots, \hat{\myVec{s}}_\Blklen]^T$, each obtained using \eqref{eqn:MAP2} } \end{algorithm} \paragraph{BCJRNet} BCJRNet is a receiver method that learns to implement \ac{map} detection from labeled data. BCJRNet exploits the fact that in order to implement Algorithm~\ref{alg:Algo0}, one must be able to specify the factor graph representing the underlying distribution. In particular, the stationarity assumption implies that the complete factor graph is encapsulated in the single function $f(\cdot)$ \eqref{eqn:FSC_funcNode} {\em regardless of the block size $\Blklen$}. Building upon this insight, BCJRNet utilizes \acp{dnn} to learn the mapping carried out at the function node separately from the inference task. \begin{figure} \centering {\includefig{BCJRNet1.png}} \caption{An illustration of BCJRNet with a learned stationary factor graph.} \label{fig:LeanredSumProduct1} \end{figure} The resulting learned stationary factor graph is then used to recover $\{\myS_i\}$ by message passing, as illustrated in Fig. \ref{fig:LeanredSumProduct1}. As learning a single function node is expected to be a simpler task compared to learning the overall inference method for recovering $\myVec{S}^\Blklen$ from $\myVec{Y}^\Blklen$, this approach allows using relatively compact \acp{dnn}, which in turn can be learned from a relatively small set of labeled data. Furthermore, the learned function node describes the factor graph for different values of $\Blklen$. When the learned function node is an accurate estimate of the true one, BCJRNet effectively implements the \ac{map} detection rule \eqref{eqn:MAP}, and thus approaches the minimal probability of error. The function node that encapsulates the factor graph of stationary finite-memory channels is given in \eqref{eqn:FSC_funcNode}. The formulation in \eqref{eqn:FSC_funcNode} implies that it can be estimated by training an \ac{ml}-based system to evaluate $\Pdf{\myY_i | \myState_i}(\cdot)$ from which the corresponding function node value is obtained via \eqref{eqn:FSC_funcNode}. Once the factor graph representing the channel is learned, symbol recovery is carried out using Algorithm~\ref{alg:Algo0}. As the mapping of Algorithm~\ref{alg:Algo0} is invariant to scaling $f(\myVec{y}_i, \bar{\myVec{s}}_{i}, \bar{\myVec{s}}_{i-1})$ with some factor that does not depend on the states, it follows that a parametric estimate of the function $f(\cdot)$, denoted $\hat{f}_{\myVec{\theta}}(\cdot)$, can be obtained using the same networks utilized for learning the log-likelihood in ViterbiNet. Specifically, the learned log-likelihood is used in \eqref{eqn:FSC_funcNode} to obtain $\hat{f}_{\myVec{\theta}}(\cdot)$. The resulting receiver, referred to as {\em BCJRNet}, thus implements BCJR detection in a data-driven manner. \paragraph{BCJRNet vs. ViterbiNet} The same \ac{dnn} architecture can be applied, once trained, to carry out multiple inference algorithms in a hybrid model-based/data-driven manner, including the BCJR scheme (as BCJRNet) as well as the Viterbi algorithm (via ViterbiNet). Since both BCJRNet and ViterbiNet utilize the same learned models, one can decide which inference system to apply, i.e., BCJRNet or ViterbiNet, by considering the differences in the algorithms from which they are derived, i.e., the BCJR algorithm and the Viterbi algorithm, respectively. The main advantages of Algorithm~\ref{alg:Algo1} over Algorithm~\ref{alg:Algo0}, and thus of ViterbiNet over BCJRNet, are its reduced complexity and real-time operation. In particular, both algorithms implement recursive computations, involving $|\mySet{S}|^{\Mem}$ evaluations for each sample, and thus the complexity of both algorithms grows linearly with the block size $\Blklen$. Nonetheless, the Viterbi scheme computes only a forward recursion and can thus provide its estimations in real time within a given delay from each incoming observation, while the BCJR scheme implements both forward and backward recursions, and can thus infer only once the complete block is observed, while involving twice the computations carried out by the Viterbi detector. The main advantage of Algorithm~\ref{alg:Algo0} over Algorithm~\ref{alg:Algo1}, i.e., of BCJRNet over ViterbiNet, stems from the fact that it implements the \ac{map} rule \eqref{eqn:MAP}, which minimizes the error probability. The Viterbi algorithm is designed to compute the maximum likelihood {\em sequence} detector, i.e., \begin{equation} \label{eqn:MLSeq1} \hat{\myVec{s}}^{ \Blklen}\left( \myVec{y}^{ \Blklen}\right) = \mathop{\arg \max}_{\myVec{s}^{ \Blklen} \in \mySet{S}^\Blklen } \Pdf{\myVec{Y}^{ \Blklen} | \myVec{S}^{ \Blklen}}\left( {\myVec{y}^{ \Blklen} | \myVec{s}^{ \Blklen}}\right), \end{equation} which is not equivalent to the symbol-level \ac{map} rule \eqref{eqn:MAP}. To see this, we focus on the case where the symbols are equiprobable, as in such scenarios the sequence-wise maximum likelihood rule coincides with the sequence-wise \ac{map} detector. Here, the decision rule implemented by the Viterbi algorithm \eqref{eqn:MLSeq1} can be written as \begin{equation} \label{eqn:MLSeq2} \hat{\myVec{s}}^{ \Blklen}\left( \myVec{y}^{ \Blklen}\right) = \mathop{\arg \max}_{\myVec{s}^{ \Blklen} \in \mySet{S}^\Blklen } \Pdf{\myVec{S}^{ \Blklen} | \myVec{Y}^{ \Blklen}}\left( {\myVec{s}^{ \Blklen} | \myVec{y}^{ \Blklen}}\right). \end{equation} For a given realization $\myVec{Y}^{ \Blklen}= \myVec{y}^{ \Blklen}$, the function $\Pdf{\myVec{S}^{ \Blklen} | \myVec{Y}^{ \Blklen}}\left( {\myVec{s}^{ \Blklen} | \myVec{y}^{ \Blklen}}\right)$ maximized by the sequence-wise detector in \eqref{eqn:MLSeq2} is a joint distribution measure. The functions $\{\Pdf{\myVec{S}_i | \myVec{Y}^{ \Blklen}}\left( {\myVec{s}_i | \myVec{y}^{ \Blklen}}\right)\}_{i=1}^{\Blklen}$, which are the individually maximized by the symbol-wise \ac{map} rule computed by the BCJR scheme \eqref{eqn:MAP}, are the marginals of the aforementioned joint distribution. Furthermore, given $\myVec{Y}^{ \Blklen}= \myVec{y}^{ \Blklen}$ the elements of $\myVec{S}^{ \Blklen}$ are statistically dependent in finite-memory channels. As a a result, the maxima of the joint distribution $\Pdf{\myVec{S}^{ \Blklen} | \myVec{Y}^{ \Blklen}}$ is not necessarily the individual maximas of each of its marginals, i.e., the elements of the vector $\hat{\myVec{s}}^{ \Blklen}\left( \myVec{y}^{ \Blklen}\right) $ in \eqref{eqn:MLSeq1} are not necessarily the symbol-wise \ac{map} estimates $\{\hat{\myVec{s}}_i\left( \myVec{y}^{ \Blklen}\right) \}_{i=1}^{\Blklen}$ in \eqref{eqn:MAP}. To conclude, the Viterbi algorithm does not implement the symbol-wise \ac{map} even in the presence of equal priors. This explains the difference in their performance, since, unlike the BCJR scheme, the Viterbi algorithm does not minimize the error probability. \subsubsection{Example: DeepSIC for Flat MIMO Channels} DeepSIC proposed in \cite{shlezinger2019deepSIC} is a \ac{dnn}-aided hybrid algorithm that is based on the iterative \ac{sic} method \cite{choi2000iterative} for symbol detection in flat \ac{mimo} channels. However, unlike its model-based counterpart, and alternative deep \ac{mimo} receivers such as DetNet, it is not tailored for linear Gaussian channels of the form \eqref{eqn:Gaussian}. The only assumption required is that the channel is memoryless, i.e., $\Mem = 1$, and thus we drop the time index subscript in this example. As in our previous \ac{dnn}-aided examples, we first review iterative \ac{sic}, after which we present its \ac{dnn}-aided implementation. \paragraph{Iterative Soft Interference Cancellation} The iterative \ac{sic} algorithm proposed in \cite{choi2000iterative} is a \ac{mimo} detection method that combines multi-stage interference cancellation with soft decisions. The detector operates in an iterative fashion where, in each iteration, an estimate of the conditional \ac{pmf} of $S_k$, which is the $k$th entry of $\myS$, given the observed $\myY = \myVec{y}$, is generated for every symbol $k \in \{1,2,\ldots, K\} :=\mySet{K}$ using the corresponding estimates of the interfering symbols $\{S_l\}_{l \neq k}$ obtained in the previous iteration. Iteratively repeating this procedure refines the conditional distribution estimates, allowing the detector to accurately recover each symbol from the output of the last iteration. This iterative procedure is illustrated in Fig.~\ref{fig:SoftIC1}. \begin{figure} \centering \includegraphics[width = \columnwidth]{SoftIC3.png} \vspace{-0.4cm} \caption{Iterative soft interference cancellation illustration.} \label{fig:SoftIC1} \end{figure} To formulate the algorithm, we consider the flat Gaussian \ac{mimo} channel in \eqref{eqn:Gaussian}. Iterative \ac{sic} consists of $Q$ iterations. Each iteration indexed $q \in \{1,2,\ldots, Q\} \triangleq \mySet{Q}$ generates $K$ distribution vectors $\hat{\myVec{p}}_k^{(q)}$ of size $\CnstSize\times 1$, where $k \in \mySet{K}$. These vectors are computed from the channel output $\myVec{y}$ as well as the distribution vectors obtained at the previous iteration, $\{ \hat{\myVec{p}}_k^{(q-1)}\}_{k=1}^{K}$. The entries of $\hat{\myVec{p}}_k^{(q)}$ are estimates of the distribution of $S_k$ for each possible symbol in $\mathcal{S}$, given the channel output $\myY = \myVec{y}$ and assuming that the interfering symbols $\{S_l \}_{l \neq k}$ are distributed via $\{ \hat{\myVec{p}}_l^{(q-1)}\}_{l \neq k}$. Every iteration consists of two steps, carried out in parallel for each user: {\em Interference cancellation} and {\em soft decoding}. Focusing on the $k$th user and the $q$th iteration, the interference cancellation stage first computes the expected values and variances of $\{S_l\}_{l \neq k}$ based on $\{ \hat{\myVec{p}}_l^{(q-1)}\}_{l \neq k}$. Letting $\{\alpha_j\}_{j=1}^{\CnstSize}$ be the indexed elements of the constellation set $\mySet{S}$, the expected values and variances are computed via $e_l^{(q-1)} = \sum_{\alpha_j \in \mySet{S}} \alpha_j \big( \hat{\myVec{p}}_l^{(q-1)}\big)_j$, and $v_l^{(q-1)} = \sum_{\alpha_j \in \mySet{S}}\big( \alpha_j - e_l^{(q-1)}\big) ^2 \big( \hat{\myVec{p}}_l^{(q-1)}\big)_j$, respectively. The contribution of the interfering symbols from $\myVec{y}$ is then canceled by replacing them with $\{e_l^{(q-1)}\}$ and subtracting their resulting term. Letting $\myVec{h}_l$ be the $l$th column of $\myMat{H}$, the interference canceled channel output is given by \begin{align} \label{eqn:Cancelled1} \myVec{Z}_k^{(q)} &= \myVec{Y} \!- \!\sum\limits_{l \neq k} \myVec{h}_l e_l^{(q-1)} = \myVec{h}_k S_k \!+\! \sum\limits_{l \neq k} \myVec{h}_l (S_l \!-\! e_l^{(q-1)}) \!+\! \myVec{W} . \vspace{-0.2cm} \end{align} Substituting the channel output $\myVec{y}$ into \eqref{eqn:Cancelled1}, the realization of the interference canceled $\myVec{Z}_k^{(q)} $, denoted $\myVec{z}_k^{(q)}$, is obtained. To implement soft decoding, it is assumed that $\tilde{W}_k^{(q)} \triangleq \sum_{l \neq k} \myVec{h}_l (S_l \!- \!e_l^{(q\!-\! 1)}) + \myVec{W} $ obeys a zero-mean Gaussian distribution, independent of $S_k $, and that its covariance is given by $\CovMat{\tilde{W}_k^{(q)}} = \sigma_w^2 \myI_{K} + \sum_{l \neq k}v_l^{(q-1)} \myVec{h}_l \myVec{h}_l^T$, where $\sigma_w^2$ is the noise variance. Combining this assumption with \eqref{eqn:Cancelled1}, the conditional distribution of $\myVec{Z}_k^{(q)}$ given $S_k = \alpha_j$ is multivariate Gaussian with mean value $\myVec{h}_k \alpha_j$ and covariance $\CovMat{\tilde{W}_k^{(q)}}$. Since $\myVec{Z}_k^{(q)} $ is given by a bijective transformation of $\myVec{Y} $, it holds that $\Pdf{S_k | \myY}(\alpha_j | \myVec{y}) = \Pdf{S_k | \myVec{Z}_k^{(q)}}(\alpha_j | \myVec{z}_k^{(q)})$ for each $\alpha_j \in \mySet{S}$ under the above assumptions. Consequently, the conditional distribution of $S_k $ given $\myY $ is approximated from the conditional distribution of $\myVec{Z}_k^{(q)}$ given $S_k $ via Bayes theorem. Since the symbols are equiprobable, this estimated conditional distribution is computed as \begin{align} \left( \hat{\myVec{p}}_k^{(q)}\right)_j % &= \frac{\exp \left\{-\frac{1}{2} \left( \myVec{z}_k^{(q)} - \myVec{h}_k\alpha_j \right)^T\CovMat{\tilde{W}_k^{(q)}}^{-1} \left( \myVec{z}_k^{(q)} - \myVec{h}_k\alpha_j \right) \right\} } { \sum\limits_{\alpha_{j'}\in\mySet{S} }\exp \left\{-\frac{1}{2} \left( \myVec{z}_k^{(q)} - \myVec{h}_k\alpha_{j'} \right)^T\CovMat{\tilde{W}_k^{(q)}}^{-1} \left( \myVec{z}_k^{(q)} - \myVec{h}_k\alpha_{j'} \right) \right\} }. \label{eqn:CondDist2} \end{align} After the final iteration, the symbols are decoded by taking the symbol that maximizes the estimated conditional distribution for each user, i.e., \begin{equation} \label{eqn:HardDet} \hat{s}_k = \mathop{\arg \max}\limits_{j \in \{1,\ldots,\CnstSize\}}\left( \hat{\myVec{p}}_k^{(Q)}\right)_j. \end{equation} The overall joint detection scheme is summarized as Algorithm \ref{alg:Algo1SIC}. The initial estimates $\{\hat{\myVec{p}}_k^{(0)}\}_{k=1}^{K}$ can be arbitrarily set. For example, these may be chosen based on a linear separate estimation of each symbol for $\myVec{y}$, as proposed in \cite{choi2000iterative}. \begin{algorithm} \caption{Iterative Soft Interference Cancellation Algorithm \cite{choi2000iterative}} \label{alg:Algo1SIC} \KwData { Set $q=1$, and generate an initial guess of $\{\hat{\myVec{p}}_k^{(0)}\}_{k =1}^{K}$.} \For{$q=1,2,\ldots,Q$}{ \label{stp:MF1a} Compute the expected values $\{e_k^{(q-1)}\}$ and variances $\{v_k^{q-1}\}$\; \label{stp:IC} {\em Interference cancellation:} For each $k \in \mySet{K}$ compute $\myVec{z}_k^{(q)}$ via \eqref{eqn:Cancelled1} \; \label{stp:SoftDec} {\em Soft decoding:} For each $k \in \mySet{K}$, estimate $\hat{\myVec{p}}_k^{(q)}$ via \eqref{eqn:CondDist2} } \KwOut{ Hard decoded output $\hat{\myVec{s}}$, obtained via \eqref{eqn:HardDet}} \end{algorithm} Iterative \ac{sic} has several advantages {compared to both joint decoding as well as separate decoding}: In terms of computational complexity, it replaces the joint exhaustive search over $\mySet{S}^K$, required by the \ac{map} decoder, with a set of computations carried out separately for each user. Hence, its computational complexity only grows linearly with the number of users \cite{andrews2005interference}, making it feasible with large values of $K$. Unlike conventional separate decoding, in which the symbol of each user is recovered individually while treating the interference as noise, the iterative procedure refines the separate estimates sequentially, and the usage of soft values mitigates the effect of error propagation. Algorithm \ref{alg:Algo1SIC} is thus capable of approaching the performance of the \ac{map} detector, which is only feasible for small values of $K$. \paragraph{DeepSIC} Iterative \ac{sic} is specifically designed for linear channels of the form \eqref{eqn:Gaussian}. In particular, the interference cancellation in Step \ref{stp:IC} of Algorithm \ref{alg:Algo1SIC} requires the contribution of the interfering symbols to be additive. Furthermore, it requires accurate \ac{csi}. To circumvent these limitations in the model-based approach, the \ac{dnn}-aided DeepSIC learns to implement the iterative \ac{sic} from data. {\bf Architecture:} DeepSIC builds upon the observation that iterative \ac{sic} can be viewed as a set of interconnected basic building blocks, each implementing the two stages of interference cancellation and soft decoding, i.e., Steps \ref{stp:IC}-\ref{stp:SoftDec} of Algorithm \ref{alg:Algo1SIC}. While the high level architecture in Fig. \ref{fig:SoftIC1} is ignorant of the underlying channel model, the basic building blocks are channel-model-dependent. In particular, interference cancellation requires the contribution of the interference to be additive, i.e., a linear model channel as in \eqref{eqn:Gaussian}, as well as full \ac{csi}, in order to cancel the contribution of the interference. Soft decoding requires complete knowledge of the channel input-output relationship in order to estimate the conditional probabilities via \eqref{eqn:CondDist2}. Although each of these basic building blocks consists of two sequential procedures that are completely channel-model-based, we note that the purpose of these computations is to carry out a classification task. In particular, the $k$th building block of the $q$th iteration, $k \in \mySet{K}$, $q \in \mySet{Q}$, produces $\hat{\myVec{p}}_k^{(q)}$, which is an estimate of the conditional \ac{pmf} of $S_k $ given $\myY = \myVec{y}$ based on $\{\hat{\myVec{p}}_l^{(q-1)}\}_{l\neq k}$. Such computations are naturally implemented by classification \acp{dnn}, e.g., fully-connected networks with a softmax output layer. Embedding these \ac{ml}-based conditional \ac{pmf} computations into the iterative \ac{sic} block diagram in Fig. \ref{fig:SoftIC1} yields the overall receiver architecture depicted in Fig. \ref{fig:DeepSoftIC1}. The initial estimates $\{\hat{\myVec{p}}_k^{(0)}\}_{k=1}^{K}$ can be set to represent a uniform distribution, i.e., $\big(\hat{\myVec{p}}_k^{(0)}\big)_j \equiv \frac{1}{\CnstSize}$. \begin{figure} \centering \includegraphics[width = \columnwidth]{DeepSoftIC4.png} \vspace{-0.4cm} \caption{Deep\ac{sic} illustration.} \label{fig:DeepSoftIC1} \end{figure} A major advantage of using classification \acp{dnn} as the basic building blocks in Fig. \ref{fig:DeepSoftIC1} stems from the fact that such \ac{ml}-based methods are capable of accurately computing conditional distributions in complex non-linear setups without requiring a-priori knowledge of the channel model and its parameters. Consequently, when these building blocks are trained to properly implement their classification task, the receiver essentially realizes iterative \ac{sic} for arbitrary channel models in a data-driven fashion. {\bf Training Methods:} In order for the \ac{dnn}-aided receiver structure of Fig.~\ref{fig:DeepSoftIC1} to reliably implement joint decoding, its building block classification \acp{dnn} must be properly trained. Here, we consider two possible approaches to train the receiver based on a set of $n_t$ pairs of channel inputs and their corresponding outputs, denoted $\{\myVec{s}_t, \myVec{y}_t \}_{t=1}^{n_t}$: {\em End-to-end training}, and {\em sequential training}. {\em End-to-end training}: The first approach jointly trains the entire network, i.e., all the building block \acp{dnn}. Since the output of the deep network is the set of conditional distributions $\{\hat{\myVec{p}}_k^{(Q)}\}_{k=1}^{K}$, where each $\hat{\myVec{p}}_k^{(Q)}$ is used to estimate $S_k $, we use the sum cross entropy as the training objective. Let $\myVec{\theta}$ be the network parameters, and $\hat{\myVec{p}}_k^{(Q)}(\myVec{y}, \alpha; \myVec{\theta} )$ be the entry of $\hat{\myVec{p}}_k^{(Q)}$ corresponding to $S_k = \alpha$ when the input to the network parameterizd by $\myVec{\theta}$ is $\myVec{y}$. The sum cross entropy loss is \begin{equation} \label{eqn:SumCE} \mathcal{L}_{\rm SumCE} (\myVec{\theta})= \frac{1}{n_t}\sum_{t=1}^{n_t} \sum_{k=1}^{K} -\log \hat{\myVec{p}}_k^{(Q)}\big(\myVec{y}_t, (\myVec{s}_t)_k ; \myVec{\theta}\big). \end{equation} Training the receiver in Fig. \ref{fig:DeepSoftIC1} in an end-to-end manner based on the loss \eqref{eqn:SumCE} jointly updates the coefficients of all the $K \cdot Q$ building block \acp{dnn}. For a large number of users, training so many parameters simultaneously is expected to require a large labeled set. {\em Sequential training}: To allow the network to be trained with a reduced number of training samples, we note that the goal of each building block \ac{dnn} does not depend on the iteration index: The $k$th building block of the $q$th iteration outputs a soft estimate of $S_k $ for each $q \in \mySet{Q}$. Therefore, each building block \ac{dnn} can be trained individually, by minimizing the conventional cross entropy loss. To formulate this objective, let $\myVec{\theta}_{k}^{(q)}$ represent the parameters of the $k$th \ac{dnn} at iteration $q$, and write $\hat{\myVec{p}}_k^{(q)}\big(\myVec{y}, \{\hat{\myVec{p}}_l^{(q-1)}\}_{l\neq k}, \alpha; \myVec{\theta}_{k}^{(q)}\big)$ as the entry of $\hat{\myVec{p}}_k^{(q)}$ corresponding to $S_k = \alpha$ when the \ac{dnn} parameters are $\myVec{\theta}_{k}^{(q)}$ and its inputs are $\myVec{y}$ and $\{\hat{\myVec{p}}_l^{(q-1)}\}_{l\neq k}$. The cross entropy loss is given by \begin{equation} \label{eqn:CE} \mathcal{L}_{\rm CE}(\myVec{\theta}_{k}^{(q)}) = \frac{1}{n_t}\sum_{t=1}^{n_t} -\log \hat{\myVec{p}}_k^{(q)}\big(\tilde{\myVec{y}}_t, \{\hat{\myVec{p}}_{t,l}^{(q-1)}\}_{l\neq k}, (\tilde{\myVec{s}}_t)_k ; \myVec{\theta}_{k}^{(q)}\big), \end{equation} where $\{\hat{\myVec{p}}_{t,l}^{(q-1)}\}$ represent the estimated probabilities associated with $\myVec{y}_i$ computed at the previous iteration. The problem with training each \ac{dnn} individually is that the soft estimates $\{\hat{\myVec{p}}_{t,l}^{(q-1)}\}$ are not provided as part of the training set. This challenge can be tackled by training the \acp{dnn} corresponding to each layer in a sequential manner, where for each layer the outputs of the trained previous iterations are used as the soft estimates fed as training samples. Sequential training uses the $n_t$ input-output pairs to train each \ac{dnn} individually. Compared to the end-to-end training that utilizes the training samples to learn the complete set of parameters, which can be quite large, sequential training uses the same data set to learn a significantly smaller number of parameters, reduced by a factor of $K\cdot Q$, multiple times. Consequently, this approach is expected to require much fewer training samples, at the cost of a longer learning procedure for a given training set, due to its sequential operation, and possible performance degradation as the building blocks are not jointly trained. \subsubsection{Summary} \ac{dnn}-aided algorithms implement hybrid model-based/data-driven inference by integrating \ac{ml} into established model-based methods. As such, it is particularly suitable for digital communications setups, in which a multitude of reliable model-based algorithms exist, each tailored to a specific structure. The implementation of these techniques in a data-driven fashion thus has three main advantages as a model-based \ac{ml} strategy: First, when properly trained, the resulting system effectively implements the model-based algorithm from which it originated, thus benefiting from its proven performance and controllable complexity, while being robust to \ac{csi} uncertainty and operable in complex environments, due to the usage of \acp{dnn}. This behavior is numerically illustrated in the simulation study detailed in Section \ref{subsec:SymbolDetectionSims}. Second, the fact that \ac{dnn}-aided algorithms use \ac{ml} tools as intermediate components in the overall end-to-end inference tasks allows the use of relatively compact networks which can be trained with small training sets. Even when the overall system consists of a large set of \acp{dnn}, as is the case in DeepSIC, their interpretable operation which follows from the model-based method facilitates their training with small data sets, e.g., via sequential training techniques. Finally, \ac{dnn}-aided algorithms can utilize different levels of domain knowledge, depending on what prior information one has on the problem at hand. For example, BCJRNet requires only prior knowledge that the channel has finite memory to learn to carry out \ac{map} detection from data. When additional domain knowledge is available, such as an underlying stationarity or some partial \ac{csi}, it can be incorporated into the number and structure of the learned function nodes, further reducing the number of training data required to tune the receiver. The resulting ability of \ac{dnn}-aided symbol detectors to adapt with small training sets can be exploited to facilitate channel tracking via periodic re-training using existing pilots and other forms of structures present in digital communications protocols, as demonstrated in \cite{shlezinger2019viterbinet,shlezinger2019deepSIC}. \subsection{Numerical Study} \label{subsec:SymbolDetectionSims} In this section, we present a numerical study of the aforementioned symbol detection mechanisms. We begin with considering finite-memory channels, for which we evaluate the data-driven \ac{sbrnn} receiver, ViterbiNet, and BCJRNet, comparing them to the model-based detection methods for such channels. Then we consider memoryless \ac{mimo} channels, where we compare the data-driven DetNet and DeepSIC to model-based detection. \subsubsection{Finite-Memory Channel} We first numerically evaluate the performance of the \ac{dnn}-aided ViterbiNet and BCJRNet, and compare this performance to that of the conventional model-based Viterbi algorithm and BCJR detector, as well as to that of the \ac{sbrnn} receiver detailed in Section \ref{subsec:SymbolDetectionEstablished}. Both ViterbiNet and BCJRNet are implemented using the classification architecture in Fig. \ref{fig:LearnedFunctionNode}(a) with three fully-connected layers: a $1 \times 100$ layer followed by a $100 \times 50$ layer and a $50 \times 16 (=|\CnstSize|^{\Mem})$ layer, using intermediate sigmoid and ReLU activation functions, respectively. For the \ac{sbrnn} receiver, we use BRNN length of $B = 10$ with 3 layers of LSTM cell blocks of size 100, and a dropout rate of 0.1. The networks are trained using $5000$ training samples, which is of the same order and even smaller compared to typical preamble sequences in wireless communication systems. We consider two finite-memory channels: An \ac{awgn} channel and a Poisson channel, both with memory length of $\Mem = 4$. For the \ac{awgn} channel, we let $W[i]$ be a zero-mean unit variance \ac{awgn} independent of $S[i]$, and let $\myVec{h} (\gamma)\in \mySet{R}^\Mem$ be the channel vector obeying an exponentially decaying profile $\left( \myVec{h}\right)_\tau \triangleq e^{-\gamma(\tau-1)}$ for $\gamma > 0$. The input-output relationship is given by \begin{equation} \label{eqn:AWGNCh1} Y[i] = \sqrt{\rho} \cdot\sum\limits_{\tau=1}^{\Mem} \left( \myVec{h}(\gamma)\right)_\tau S[i-\tau + 1] + W[i], \end{equation} where $\rho > 0$ represents the \acs{snr}. The channel input is randomized from a \ac{bpsk} constellation, i.e., $\mySet{S} = \{-1, 1\}$. For the Poisson channel, the symbols represent on-off keying, namely, $\mySet{S} = \{0,1\}$, and the channel output $Y[i]$ is generated via \begin{equation} \label{eqn:PoissonCh1} Y[i] | \myVec{S}^\Blklen\sim \mathbb{P}\left( \sqrt{\rho} \cdot\sum\limits_{\tau=1}^{\Mem} \left( \myVec{h}(\gamma)\right)_\tau S[i-\tau + 1] + 1\right), \end{equation} where $\mathbb{P}(\lambda)$ is the Poisson distribution with parameter $\lambda > 0$, and $X\sim f(X)$ indicates that the random variable $X$ is distributed according to $f(X)$. For each channel, we numerically compute the \ac{ser} for different values of the \acs{snr} parameter $\rho$. For each \acs{snr} $\rho$, the \ac{ser} values are averaged over $20$ different channel vectors $\myVec{h} (\gamma)$, obtained by letting $\gamma$ vary in the range $[0.1, 2]$. For comparison, we numerically compute the \ac{ser} of the Viterbi and BCJR algorithms. \label{txt:Robustness1} In order to study the resiliency of the data-driven detectors to inaccurate training, we also compute the performance when the receiver only has access to a noisy estimate of $\myVec{h}(\gamma)$, and specifically, to a copy of $\myVec{h}(\gamma)$ whose entries are corrupted by i.i.d. zero-mean Gaussian noise with variance $\sigma_e^2$. In particular, we use $\sigma_e^2 = 0.1$ for the Gaussian channel \eqref{eqn:AWGNCh1}, and $\sigma_e^2 = 0.08$ for the Poisson channel \eqref{eqn:PoissonCh1}. We consider two cases: {\em Perfect \ac{csi}}, in which the channel-model-based detectors have accurate knowledge of $\myVec{h}(\gamma)$, while the data-driven receivers are trained using labeled samples generated with the same $\myVec{h}(\gamma)$ used for generating the test data; and {\em \ac{csi} uncertainty}, where the model-based algorithms are implemented with the log-likelihoods (for Viterbi algorithm) and function nodes (for BCJR detection) computed using the noisy version of $\myVec{h}(\gamma)$, while the training data is generated with the noisy version of $\myVec{h}(\gamma)$ instead of the true one. In all cases, the information symbols are uniformly randomized in an i.i.d. fashion from $\mySet{S}$, and the test samples are generated from their corresponding channel with the true channel vector $\myVec{h}(\gamma)$. The numerically computed \ac{ser} values, averaged over $50000$ Monte Carlo simulations, versus $\rho \in [-6,10]$ dB for the \ac{awgn} channel are depicted in Fig. \ref{fig:AWGN}, while the corresponding performance versus $\rho \in [10,30]$ dB for the Poisson channel are depicted in Fig. \ref{fig:Poisson}. Observing Figs. \ref{fig:AWGN}-\ref{fig:Poisson}, we note that the performance of the data-driven receivers approaches that of their corresponding \ac{csi}-based counterparts. We also observe that the \ac{sbrnn} receiver, which was shown in \cite{farsad2018neural} to approach the performance of the \ac{csi}-based Viterbi algorithm when sufficient training is provided, is outperformed by ViterbiNet and BCJRNet here due to the small training set size. These results demonstrate that our \ac{dnn}-aided detectors, which use compact \ac{dnn} structures embedded into model-based algorithms, require significantly less training compared to symbol detectors based on using established \acp{dnn} for end-to-end inference. In the presence of \ac{csi} uncertainty, it is observed in Figs. \ref{fig:AWGN}-\ref{fig:Poisson} that both ViterbiNet and BCJRNet significantly outperform the model-based algorithms from which they originate. In particular, when ViterbiNet and BCJRNet are trained with a variety of different channel conditions, they are still capable of achieving relatively good \ac{ser} performance under each of the channel conditions for which they are trained, while the performance of the conventional Viterbi and BCJR algorithms is significantly degraded in the presence of imperfect \ac{csi}. While the \ac{sbrnn} receiver is shown to be more resilient to inaccurate \ac{csi} compared to the Viterbi and BCJR algorithms, it is outperformed by ViterbiNet and BCJRNet with the same level of uncertainty, and the performance gap is more notable in the \ac{awgn} channel. \begin{figure} \centering \includegraphics[width=0.7\columnwidth]{Gaussian_3.pdf} \caption{Symbol error rate of different receiver structures for the \ac{awgn} channel with exponentially decaying taps.} \label{fig:AWGN} \end{figure} \begin{figure} \centering \includegraphics[width=0.7\columnwidth]{Poisson_1.pdf} \caption{Symbol error rate of different receiver structures for the Poisson channel.} \label{fig:Poisson} \end{figure} Finally, we evaluate the application of ViterbiNet and BCJRNet for practical channel models. To that aim, we generate 10 realizations from the established COST2100 model \cite{liu2012cost}, which is a widely used model for current cellular communication channels. In particular, we use the semi-urban 300MHz line-of-sight configuration evaluated in \cite{zhu2013cost} with a single antenna element. The channel output is corrupted by \ac{awgn}, and the symbol detectors operate assuming that the channel has $\Mem=4$ taps. The remaining simulation parameters are the same as those used in Fig.~\ref{fig:AWGN}. The results, depicted in Fig.~\ref{fig:COST}, demonstrate that the ability of ViterbiNet and BCJRNet to approach their model-based counterparts with perfect \ac{csi}, as well as achieve improved performance in the presence of \ac{csi} uncertainty, holds for practical channel models. \begin{figure} \centering \includegraphics[width=0.7\columnwidth]{COST_semiurban300LOS.pdf} \caption{Symbol error rate of different receiver structures for the \ac{awgn} channel with taps generated from the COST2100 model.} \label{fig:COST} \end{figure} \subsubsection{Memoryless MIMO Channel} Next, we numerically compare DeepSIC and DetNet for symbol detection in memoryless \ac{mimo} channels. In the implementation of the \ac{dnn}-based building blocks of Deep\ac{sic}, we used a different fully-connected network for each training method: For end-to-end training, where all the building blocks are jointly trained, we used a compact network consisting of a $(N + K - 1) \times 60$ layer followed by ReLU activation and a $60 \times \CnstSize$ layer. For sequential training, which sequentially adapts subsets of the building blocks and can thus tune more parameters using the same training set (or, alternatively, requires a smaller training set) compared to end-to-end training, we used three fully-connected layers: An $(N + K - 1) \times 100$ first layer, a $100 \times 50$ second layer, and a $50 \times \CnstSize$ third layer, with a sigmoid and a ReLU intermediate activation functions, respectively. In both iterative \ac{sic} as well as Deep\ac{sic}, we set the number of iterations to $Q = 5$. Following \cite{samuel2019learning}, DetNet is implemented with $Q=90$ layers with a hidden sub-layer size of $8K$. The data-driven receivers are trained with a relatively small data set of $5000$ training samples, and tested over $20000$ symbols. We first consider a linear \ac{awgn} channel as in \eqref{eqn:Gaussian} with a relatively small $K$. Recall that iterative \ac{sic} as well as DetNet are all designed for such channels. Consequently, the following study compares the performance of Deep\ac{sic} and DetNet to that of the model-based iterative \ac{sic} as well as the \ac{map} rule \eqref{eqn:MAP} in a scenario for which all schemes are applicable. The model-based \ac{map} and iterative \ac{sic} detectors, as well as DetNet, all require \ac{csi}, and specifically, accurate knowledge of the channel matrix $\myMat{H}$. Deep\ac{sic} operates without a-priori knowledge of the channel model and its parameters, learning the decoding mapping from a training set sampled from the considered input-output relationship. In order to compare the robustness of the detectors to \ac{csi} uncertainty, we also evaluate them when the receiver has access to an estimate of $\myMat{H}$ with entries corrupted by i.i.d. additive Gaussian noise whose variance is given by $\sigma_e^2$ times the magnitude of the corresponding entry, where $\sigma_e^2 > 0$ is referred to as the {\em error variance}. For Deep\ac{sic}, which is model-invariant, we compute the \ac{ser} under \ac{csi} uncertainty by using a training set whose samples are randomized from a channel in which the true $\myMat{H}$ is replaced with its noisy version. We simulate the $6 \times 6$ linear Gaussian channel, i.e., $K = 6$ users and $N = 6$ receive antennas. The symbols are randomized from a \ac{bpsk} constellation, namely, $\mySet{S} = \{-1, 1\}$ and $\CnstSize = |\mySet{S}| = 2$. The channel matrix $\myMat{H}$ models spatial exponential decay, and its entries are given by $\left( \myMat{H}\right)_{i,k} = e^{-|i-j|}$, for each $i \in \{1,\ldots, N\}$, $ k \in \mySet{K}$. For each channel, the \ac{ser} of the receivers is evaluated for both perfect \ac{csi}, i.e., $\sigma_e^2 = 0$, as well as \ac{csi} uncertainty, for which we use $\sigma_e^2 = 0.1$. The evaluated \ac{ser} versus the \acs{snr}, defined as $1/\sigma_w^2$, is depicted in Fig. \ref{fig:AWGN6}. Observing Fig. \ref{fig:AWGN6}, we note that the performance of Deep\ac{sic} with end-to-end training approaches that of the model-based iterative \ac{sic} algorithm, which is within a small gap of the \ac{map} performance. This demonstrates the ability of Deep\ac{sic} to implement iterative \ac{sic} in a data-driven fashion. The sequential training method, whose purpose is to allow Deep\ac{sic} to train with smaller data sets compared to end-to-end training, also achieves \ac{ser} values comparable to iterative \ac{sic}. DetNet, which trains a large number of parameters in an end-to-end fashion, requires $100$ times more training to approach such performance. In the presence of \ac{csi} uncertainty, Deep\ac{sic} is observed to substantially outperform the model-based iterative \ac{sic} and \ac{map} receivers, as well as DetNet operating with a noisy version of $\myMat{H}$ and trained with a hundred times more samples. In particular, it follows from Fig. \ref{fig:AWGN6} that a relatively minor error of variance $\sigma_e^2 = 0.1$ severely deteriorates the performance of the model-based methods, while Deep\ac{sic} is hardly affected by the same level of \ac{csi} uncertainty. \begin{figure} \centering \includegraphics[width=0.7\columnwidth]{Gaussian_6x6_2.pdf} \caption{Symbol error rate of different receiver structures for the $6\times6$ \ac{awgn} channel.} \label{fig:AWGN6} \end{figure} \begin{figure} \centering \includegraphics[width=0.7\columnwidth]{Poisson_4x4_2.pdf} \caption{Symbol error rate of different receiver structures for the $4\times 4$ Poisson channel.} \label{fig:Poisson4} \end{figure} Next, we consider a Poisson channel. We use $K = 4$ and $N = 4$. Here, the symbols are randomized from an on-off keying for which $\mySet{S} = \{0,1\}$. The entries of the channel output are related to the input via the conditional distribution \begin{equation} \label{eqn:PoissonChannel} \left( \myY[i]\right)_j | \myS[i] \sim \mathbb{P}\left( \frac{1}{\sqrt{\sigma_w^2}}\left( \myMat{H} \myS[i]\right)_j + 1\right), \qquad j \in \{1,\ldots, N\}. \end{equation} As DetNet is designed for linear Gaussian channels, DeepSIC is the only data-driven receiver evaluated for this channel. The achievable \ac{ser} of Deep\ac{sic} versus \acs{snr} under both perfect \ac{csi} as well as \ac{csi} uncertainty with error variance $\sigma_e^2 = 0.1$ is compared to the \ac{map} and iterative \ac{sic} detectors in Fig. \ref{fig:Poisson4}. Observing Fig. \ref{fig:Poisson4}, we again note that the performance of Deep\ac{sic} is only within a small gap of the \ac{map} performance with perfect \ac{csi}, and that the data-driven receiver is more robust to \ac{csi} uncertainty compared to the model-based \ac{map}. In particular, Deep\ac{sic} with sequential training, which utilizes a deeper network architecture for each building block, outperforms here end-to-end training with basic two-layer structures for the conditional distribution estimation components. We conclude that under such non-Gaussian channels, more complex \ac{dnn} models are required to learn to cancel interference and carry out soft detection accurately. Furthermore, iterative \ac{sic}, which is designed for linear Gaussian channels \eqref{eqn:Gaussian} where interference is additive, achieves very poor performance when the channel model is substantially different from \eqref{eqn:Gaussian}. These results demonstrate the ability of Deep\ac{sic} to achieve excellent performance through learning from data for statistical models where model-based interference cancellation is effectively inapplicable. \section{Summary} \label{sec:Summary} Deep learning brings forth capabilities that can substantially contribute to future communications systems in tackling some of their expected challenges. {In particular digital communications systems can significantly benefit from properly harnessing the power of deep learning and its model-agnostic nature. A successful integration of deep learning into communication devices can thus pave the way to reliable and robust communications in various setups, including environments where accurate statistical channel models are scarce or costly to obtain.} However, digital communications setups are fundamentally different from applications in which deep learning has been extremely successful to date, such as computer vision. In particular, digital communication exhibit an extremely large number of possible outputs, as these outputs grow exponentially with the modulation order and the block length. They also have channel conditions that vary dynamically, and require low computation complexity when used on small battery-powered devices. Consequently, in order to achieve the potential benefits of \ac{dnn}-aided communications, researchers and system designers must go beyond the straight-forward application of \acp{dnn} designed for computer vision and natural language processing. A candidate strategy to utilize \acp{dnn} while accounting for the unique characteristics of digital communications setups, as well as the established knowledge of model-based communication methods accumulated over the last decades, is based on model-based \ac{ml}, as detailed in this chapter. We reviewed two main strategies for combining data-driven deep learning with model-based methods for digital communications, as well as discussing the need for such hybrid schemes due to the shortcomings of the extreme cases of purely data-driven and solely model-based methods. For each strategy, we presented the main steps in the design of the data-driven systems, and provided concrete examples, all in the context of the basic communication task of symbol detection. We first discussed how established \ac{dnn} architectures can be utilized as symbol detectors, presenting the \ac{sbrnn} receiver of \cite{farsad2018neural} as an example. Then we detailed how the framework of deep unfolding, which designs \acp{dnn} based on iterative optimization algorithms, can give rise to hybrid model-based/data-driven receivers, presenting DetNet of \cite{samuel2019learning} as an example. We identified that the main drawback of these aforementioned techniques in the context of digital communications stems from their usage of highly-parameterized \acp{dnn} applied in an end-to-end fashion, which directly results in the need for massive data sets for training. Then, we presented \ac{dnn}-aided algorithms, where \acp{dnn} are integrated into existing model-based algorithms. We identified the latter as being extremely suitable for digital communications due to the wide variety of model-based algorithms designed for such setups, combined with its ability to incorporate different levels of domain knowledge as well as utilize compact \acp{dnn} as intermediate components in the inference process. The \ac{dnn}-aided symbol detectors presented as examples here, i.e., ViterbiNet \cite{shlezinger2019viterbinet}, BCJRNet \cite{shlezinger2020data}, and DeepSIC \cite{shlezinger2019deepSIC}, all numerically demonstrated improved performance over competing strategies when a limited amount of training data is available. {In particular, it is demonstrated that these \ac{dnn}-aided symbol detectors, which are designed to operate in a hybrid model-based/data-driven fashion, learn to approach the performance achieved by purely model-based approaches operating with perfect knowledge of the underlying channel model and its parameters. Furthermore, the \ac{dnn}-aided symbol detectors were shown to be notably more resilient to CSI uncertainty compared to model-based schemes, carrying out accurate detection in the presence of inaccurate CSI. Finally, it was demonstrated that model-based deep learning enables \ac{dnn}-aided receivers to learn their mapping from relatively small data sets, making} it an attractive approach to combine with tracking of dynamic channel conditions. \bibliographystyle{IEEEtran}
\section{introduction} One of the most important physical phenomena that have attracted both attention in theoretical physicists and observational astrophysicists is the discovery of gravitational waves (GWs). It is known that, from the merger of black holes by Laser Interferometer Gravitational-Wave Observatory (LIGO) collaboration, GWs usher in a new era in astronomy and cosmology \cite{LIGO}. LIGO detectors are structured in such a way that they operate in high frequency range ($10-10^{3}$ HZ), for detecting sources like compact binary inspirals. Also, to identify lower frequency sources ($10^{-5}-1$ HZ), GWs signals from sources such as Supernovae and eLISA experiment \cite{Klein}, have been proposed. Moreover, some setups including Square Kilometer Array (SKA) \cite{Kramer,Dewdney} and Pulsar Timing Array (PTA) \cite{IPTA} can measure frequency range even lower than $10^{-5}$ Hz (around $10^{-9}$ Hz). These divisions of experiments indicate that although the strongest gravitational waves are generated by events such as colliding black holes, stellar core collapses (supernovae), coalescing neutron stars and etc, there also be a random background of GWs, which is called stochastic gravitational wave (SGW) background, and characterized by sharp frequency component. Detectors of multi-wavelength can assist observation those waves, and the results may play a major role in a deeper understanding of the universe. Although low frequencies are difficult to be observed experimentally, modeling their sources is theoretically very important because they can provide vital information about the early stages of the universe \cite{Anand}. In this regard, we can refer to the SGW background that contains information about the early universe. It is agreed that long-duration first-order cosmological phase transitions could be a potential source of very low-frequency gravitational wave background \cite{Witten,Hogan,Hogan2,Turner}. According to standard particle physics, there are at least two phase transitions, the electroweak phase transition at $T\sim 100$ GeV, which is accompanied by breaking the electroweak symmetry, and the QCD phase transition at $T\sim 0.1$ GeV, which breaks the chiral symmetry. Although it is known that these transitions are done through a smooth crossover, there are models beyond the standard model that can produce strong first-order transition at the electroweak and QCD scales \cite{10,11,12,13,14,15,16,17,18,19,20}. So far no agreement has been reached on the exact critical temperature of these transitions or their nature. The main goal in the study of the hadronization process, relevant to strong QCD phase transition, is to reach the equation of state (EoS) governing two different phases, quark-gluon plasma (QGP) and hadronic gas (HG). According to the recent results of QCD lattice, in the presence of strong interactions, the pressure $P$ is no longer equal to its value in the radiation dominated epoch \cite{DeTar}. This modification is specified in terms of trace anomaly which can lead to some exciting cosmic results such as the prediction of Weakly Interacting Massive Particles (WIMPs), and pure glue lattice QCD calculations \cite{Drees}. Recently, some research has been guided in this direction. The authors in \cite{bc1}, studies the effect of equation of state of relativistic particles along with QCD equation of state, that emerged by parameterization of the pressure due to $u,~d,~s$ quarks and gluons with the energy density that computed from trace anomaly. It is found that the rate of expansion of the universe is decreased, the gravitational wave signal is increased by almost $\textit{50}$ percent and the peak frequency redshift to current time is changed by $\textit{25}$ percent. In \cite{bc2}, a fractional energy density and a peak frequency redshift at current time of SGW is investigated using effective QCD equation of state of three chiral quark flavors $u,~d,~s$ including chemical potential and finite temperature. It is obtained that as the chemical potential increases, the frequency and amplitude of SGW signal that received today, were increased. The effective contribution of the chemical potential of quarks to the wave detection is also discussed. In this paper, we investigate the effect of GUP on the SGW background signal which is emanated from the first order cosmological QCD phase transition in early universe. The entropy of photon gas that modified by the GUP is used in the calculation of temporal evolution of the temperature of the universe as a function of the Hubble parameter. Hubble parameter and the peak frequency of the SGW frequency red shifted with its corresponding value at current time are calculated. Within GUP framework and taking into account bubble wall collisions and turbulent magnetohydrodynamics in plasma as a source of SGW at the epoch of phase transition, a fractional energy density of SGW are investigated. It is found that the GUP effect reduces the SGW signal in comparison to its counterpart in the absence of GUP. These results can shed light on a better understanding of the cosmological QCD phase transition and show the importance of the GUP theory. \section{GUP and photons gas} A different approaches to quantum gravity such as string theory, non-commutative geometry and black hole physics predict existence of a minimal measurable length. This in turn will produce an essential modification of the Heisenberg uncertainty principle to what so called generalized uncertainty principle (GUP) \cite{d1,d2,d3,d4,d5,d6}. According to this approach, it is suggested that \cite{d7} \begin{equation}\label{1} \Delta x_i \Delta p_j\geq\frac{\hbar }{2}{\delta }_{ij}(1+\beta [\left(\Delta p\right)^{2}+ \langle p\rangle^2]~), \end{equation} where $\beta$ is the GUP parameter and defined as $\beta=\frac{\beta_{0}}{m_p^2c^2}$ which $m_p$ is the Planck mass and $\beta_{0}$ is of the order of unity. Then, the absolute minimal measurable length is obtained by saturating the above inequality as $(\Delta x)_{min}=\hbar\sqrt\beta\sqrt{1+\beta \langle p\rangle^2}$ and so $(\Delta x)_{min}=\hbar\sqrt\beta=\sqrt{\beta_0}\ell_p$ for $\langle p\rangle=0$, where $\ell_p$ is the Planck length. It should be noted that $(\Delta x)_{min}$ is not exactly equal to the Planck length but it is at the same order, depending on whether $\beta_0$ is bigger or smaller than one. It is known that, the exact value of $\beta_0$ is not precisely known but it is extensively investigated and expected to be obtained in future experiments. The uncertainty relation (\ref{1}) leads to the following deformed commutation relation, namely \begin{equation}\label{2} \left [x_{i},p_{j}\right]=i\hbar\delta_{ij}\left(1+\beta p^{2}\right), \end{equation} where $p^2=\sum_i p_i^2$. Also, from the Jacobi identity, this equation ensures $\left [x_{i},x_{j}\right]=0$ and $\left [p_{i},p_{j}\right]=0$. Then, as a result of Eq. (\ref{2}), GUP modifies the physical momentum as \begin{equation}\label{3} p_{i}=p_{i0}\left(1+\beta {p_{i0}}^2\right),~~~~~ x_i=x_{i0} \end{equation} while $x_{i0}$ and $p_{i0}$ satisfy the usual canonical commutation relations $[x_{i0}, p_{j0}] =i\hbar\delta_{ij}$. Thus we can consider $p_i$ is the momentum in Planck scale and $p_{i0}$ is the momentum at low scale. On the other hand, according to the Liouville theorem, the number of quantum states inside phase space should not be changed with time evolution within GUP framework. Thus GUP should adjust the density of state to agree with Liouville theorem, which will have an effect on the thermodynamics properties of quantum systems. This way, the number of quantum states should be modified, such that \cite{d8} \begin{equation} \frac{V}{(2\pi)^3} \int_0^{\infty}d^3p \rightarrow \frac{V}{(2\pi)^3} \int_0^{\infty}\frac{d^3p}{(1+\beta p^2)^3}. \end{equation} Within framework of mentioned GUP, thermodynamic properties of photons gas will be investigated. Then we can get the modified entropy of photons due to GUP effect, which is the aim of this section. According to above modified phase space, the grand canonical partition function of photons can be written as \begin{eqnarray} \nonumber \ln{Z} =-\frac{Vg_{\pi}}{2\pi^2}\int_0^{\infty}\ln\left[1-e^{-\frac{p}{T}}\right]\frac{p^2dp}{(1+\beta p^2)^3},~~~~ \\ \simeq-\frac{Vg_{\pi}}{2\pi^2}\int_0^{\infty}\ln\left[1-e^{-\frac{p}{T}}\right](1-3\beta p^2)~p^2dp, \end{eqnarray} where $g_{\pi}$ is the number of degrees of freedom. After some manipulation, we obtain \begin{eqnarray} \nonumber \ln{Z} =\frac{Vg_{\pi}}{2\pi^2}\frac{1}{T}\int_0^{\infty}\frac{1}{e^{\frac{p}{T}}-1}~\left[\frac{1}{3}p^3-\frac{2}{5}\beta p^5\right]~dp \\ =\frac{1}{90}Vg_{\pi}\pi^2T^3- \frac{4}{105}\beta Vg_{\pi}\pi^4T^5.~~~~~~~~~~~ \end{eqnarray} Using the modified partition function, the entropy of photon gas can be written as \begin{equation} S=\frac{\partial}{\partial T}(T\ln{Z})=\frac{2}{45}g_{\pi}\pi^2T^4- \frac{8}{35}\beta g_{\pi}\pi^4T^6. \end{equation} In a good approximation, the entropy expression can be rewritten as \begin{equation} S=\frac{g_{\pi}\frac{2\pi^2}{45}T^3}{1+\frac{37}{7}\pi^2\beta T^2}. \end{equation} In the limit of $\beta\rightarrow0$, we can recover standard form $S=g_{\pi}\frac{2\pi^2}{45}T^3$. \section{Modified stochastic gravitational wave spectrum} It is agreed that the SGW is generated at the epoch of QCD and electroweak phase transition and propagate to the current epoch. Here we interested in SGW that produced at the first order QCD phase transition. To investigate the observable spectrum of SGW, we will use the assumption that the universe has expanded adiabatically which results in the constancy of the entropy per comoving volume, such that $\frac{\dot{S}}{S}=0$. We will use the entropy of photons gas where the photons dominate universe more than baryons. Thus, the entropy can be estimated using the entropy of QGP state in the previous section, i.e. \begin{equation}\label{b1} S\sim a^3 \frac{g_s\frac{2\pi^2}{45}T^3}{1+\frac{37}{7}\pi^2\beta T^2}, \end{equation} where $g_s$ is the effective number of relativistic degrees of freedom involved in the entropy density and $a$ is the scale factor. Employing the adiabatic condition $\frac{\dot{S}}{S}=0$, the formula of time variation of temperature can be obtained \begin{equation}\label{b2} \frac{dT}{dt}=-3H\left(\frac{3}{T}+\frac{1}{g_s}\frac{dg_s}{dT}-\frac{72\pi^2\beta T}{7+36\pi^2\beta T^2}\right)^{-1}, \end{equation} which $H$ is the Hubble parameter. It is clear that the ordinary case is recovered in the limit of $\beta \rightarrow 0$ \cite{bc1}. Also, we can rewrite Eq. (\ref{b2}) in terms of scale factor as \begin{equation}\label{b3} \frac{a_*}{a_0}=\exp{\left[\int_{T_*}^{T_0}\frac{1}{T}\left(1+\frac{T}{3g_s}\frac{dg_s}{dT}-\frac{24\pi^2\beta T^2}{7+36\pi^2\beta T^2}\right)~dT\right]}, \end{equation} where $" * "$ refers to quantities at the epoch of phase transition and $" ~0~ "$ denotes quantities at the current time. Based on the fact that the SGW are ultimately decoupled to the rest of the universe, the energy density of the SGW can satisfy Boltzmann equation $\frac{d}{dt}\left(\rho_{gw}a^4\right)=0$. Applying Eq. (\ref{b3}) and Boltzmann equation, the energy density of SGW at current time reads \begin{eqnarray}\label{b4} \nonumber \rho_{gw}(T_0)=\rho_{gw}(T_*) \left(\frac{a_*}{a_0}\right)^4, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\\ =\rho_{gw}(T_*)~\exp{\left[\int_{T_*}^{T_0}\frac{4}{T}\left(1+\frac{T}{3g_s}\frac{dg_s}{dT}-\frac{24\pi^2\beta T^2}{7+36\pi^2\beta T^2}\right)~dT\right]}. \end{eqnarray} Let us define the density parameter of SGW at phase transition epoch and current time as $\Omega_{gw*}=\frac{\rho_{gw}(T_*)}{\rho_{cr}(T_*)}$ and $\Omega_{gw}=\frac{\rho_{gw}(T_0)}{\rho_{cr}(T_0)}$, respectively, where $\rho_{cr}$ is the critical density. So, using Eq. (\ref{b4}), we obtain \begin{equation}\label{b5} \Omega_{gw}=\Omega_{gw*}\left(\frac{H_*}{H_0}\right)^2~\exp{\left[\int_{T_*}^{T_0}\frac{4}{T}\left(1+\frac{T}{3g_s}\frac{dg_s}{dT}-\frac{24\pi^2\beta T^2}{7+36\pi^2\beta T^2}\right)~dT\right]}, \end{equation} where \begin{equation}\label{b6} \left(\frac{H_*}{H_0}\right)^2=\frac{\rho_{cr}(T_*)}{\rho_{cr}(T_0)}. \end{equation} In order to determine the evaluation of Hubble parameter from phase transition epoch to the current time, we need to use the continuity equation, namely: \begin{equation}\label{b7} \dot{\rho}_t=-3H\rho_t\left(1+\frac{P_t}{\rho_t}\right), \end{equation} where $\rho_t$ and $P_t$ are the total energy density and total pressure density of the universe at cosmic time $t$, respectively and dot denotes the derivative with respect to cosmic time. Now using Eq. (\ref{b2}), Eq. (\ref{b7}) can be written in terms of temperature as \begin{equation}\label{b8} \frac{d\rho_t}{\rho_t}=\frac{3}{T}\left(1+\omega_{eff}\right)\left(1+\frac{T}{3g_s}\frac{dg_s}{dT}-\frac{24\pi^2\beta T^2}{7+36\pi^2\beta T^2}\right)dT, \end{equation} where $\omega_{eff}=\frac{P_t}{\rho_t}$ is the effective equation of state parameter which may depend on temperature. The critical energy density of radiation $\rho_{cr}(T_*)$, at the epoch of phase transition can be obtained by integration from early time $T_r$, where the radiation dominated, to the time of phase transition $T_*$, as \begin{equation}\label{b9} \rho_{cr}(T_*)=\rho_r(T_r)\exp{\left[\int_{T_r}^{T_*}\frac{3(1+\omega_{eff})}{T}\left(1+\frac{T}{3g_s}\frac{dg_s}{dT}-\frac{24\pi^2\beta T^2}{7+36\pi^2\beta T^2}\right)~dT\right]}. \end{equation} Then, putting Eq. (\ref{b9}) into Eq. (\ref{b6}), one can get \begin{equation}\label{b10} \left(\frac{H_*}{H_0}\right)^2=\Omega_{r0}\frac{\rho_r(T_r)}{\rho_r(T_0)}\exp{\left[\int_{T_r}^{T_*}\frac{3(1+\omega_{eff})}{T}\left(1+\frac{T}{3g_s}\frac{dg_s}{dT}-\frac{24\pi^2\beta T^2}{7+36\pi^2\beta T^2}\right)~dT\right]}, \end{equation} where $\Omega_{r0}=\frac{\rho_r(T_0)}{\rho_{cr}(T_0)}$ is the current value of fractional energy density of radiation with the value almost equal $\Omega_{r0}=8.5\times 10^{-5}$. Now, applying Boltzmann equation, it can be proved that $\frac{\rho_r(T_r)}{\rho_r(T_0)}=(\frac{a_0}{a_r})^4$. Hence, Eq. (\ref{b10}) can be rewritten as \begin{equation}\label{b11} \left(\frac{H_*}{H_0}\right)^2=\Omega_{r0}\left(\frac{a_0}{a_r}\right)^4\exp{\left[\int_{T_r}^{T_*}\frac{3(1+\omega_{eff})}{T}\left(1+\frac{T}{3g_s}\frac{dg_s}{dT}-\frac{24\pi^2\beta T^2}{7+36\pi^2\beta T^2}\right)~dT\right]}. \end{equation} Substituting Eq. (\ref{b11}) into Eq. (\ref{b5}), we get \begin{eqnarray}\label{b12} \nonumber \Omega_{gw}=\Omega_{r0} ~\Omega_{gw*} ~\exp{\left[\int_{T_*}^{T_r}\frac{4}{T}\left(1+\frac{T}{3g_s}\frac{dg_s}{dT}-\frac{24\pi^2\beta T^2}{7+36\pi^2\beta T^2}\right)~dT\right]}\times ~~~\\ ~\exp{\left[\int_{T_r}^{T_*}\frac{3(1+\omega_{eff})}{T}\left(1+\frac{T}{3g_s}\frac{dg_s}{dT}-\frac{24\pi^2\beta T^2}{7+36\pi^2\beta T^2}\right)~dT\right]}. \end{eqnarray} At this point, we want to determine the functional form of the effective equation of state, $\omega_{eff}$. It is known that for the ultra-relativistic gas with non-interacting particles, $\omega_{eff}=\frac{1}{3}$. In this case and without GUP effect, the above two relations will be \begin{equation}\label{bb11} \left(\frac{H_*}{H_0}\right)^2=\Omega_{r0}\left(\frac{T_*}{T_0}\right)^4\left[\frac{g(T_*)}{g(T_0)}\right]^{\frac{4}{3}},~~~~~\omega_{eff}=\frac{1}{3}, ~~~~\beta=0. \end{equation} \begin{equation}\label{bb12} \Omega_{gw}=\Omega_{r0} ~\Omega_{gw*},~~~~~\omega_{eff}=\frac{1}{3}, ~~~~\beta=0. \end{equation} However, around $T\sim $ a few hundred MeV, the relation $\omega_{eff}=\frac{1}{3}$ deviates because the effect of QCD interaction comes to play \cite{Anand}. Thus, we will use QCD equation of state that results from the parametrization of the pressure due to the strong interactions between $u,~d,~s$ quarks and gluons, as \cite{b1} \begin{equation}\label{b13} \frac{P}{T^4}=F(T)=\frac{1}{2}\left(1+\tanh{[c_{\tau}(\tau-\tau_0)]}\right) \frac{p_i+\frac{a_n}{\tau}+\frac{b_n}{\tau^2}+\frac{c_n}{\tau^4}}{1+\frac{a_d}{\tau}+\frac{b_d}{\tau^2}+\frac{c_d}{\tau^4}}, \end{equation} where $\tau=\frac{T}{T_c}$ with $T_c=154~MeV$ is the QCD transition temperature and $p_i=\frac{19\pi^2}{36}$ is the ideal gas value of $\frac{P}{T^4}$ for QCD interaction with three massless quarks. It is worth noting that the function $\tanh{x}$ approaches unity for large values of $x$, therefore Eq. (\ref{b13}) approaches the ideal gas law at $T \gg T_c$, i.e. $\tau \gg 1$. Ref. \cite{b2} showed that Eq. (\ref{b13}) matches well with available perturbation calculations at higher temperatures. According to this, the values of numerical coefficients in Eq. (\ref{b13}) which describe the contributions from massless $u,~d,~s$ quarks and gluons for all temperatures above $100~MeV$, are $c_{\tau}=3.6706$, $\tau_0=0.9761$, $a_n=-8.7704$, $b_n=3.9200$, $c_n=0.3419$, $a_d=-1.2600$, $b_d=0.8425$ and $c_d=-0.0475$. Then, we can calculate QCD contribution in the effective equation of state, $\omega_{eff}$, at the temperature range above $100~MeV$, using Eq. (\ref{b13}) with the trace of the energy momentum tensor or called the trace anomaly \cite{b2} \begin{equation}\label{b13b} \frac{\rho-3P}{T^4}=T\frac{d}{dT}\left(\frac{P}{T^4}\right). \end{equation} Thus, the effective equation of state with QCD effect is obtained \begin{equation}\label{b14} \omega_{eff}=\frac{P}{\rho}=\left[\frac{T}{F(T)}\frac{dF(T)}{dT}+3\right]^{-1}. \end{equation} To investigate the results more, we have plotted the effective equation of state function versus transition temperatures $T_{*}$, in Fig. (1). As it is shown in this figure, the trace anomaly matches ideal gas at $\sim5~GeV$. This behaviour indicates that the effect of trace anomaly can not be ignored near QCD transition epoch and it should be taken into account. Then in Fig. (2), we have depicted relative Hubble parameter as a function of transition temperature $T_*$, in case of $\beta=0$, with trace anomaly, shown with solid curve, and without trace anomaly, shown with dashed curve where $\frac{H_*}{H_0}\sim T_*^2$. This figure implies that, under the influence of QCD, Hubble parameter changes slower than $T_*^2$ before $\sim 0.13~GeV$ and then changes faster at higher temperature till matches with $T_*^2$-curve at $\sim 5~GeV$. We have used $T_r=10^4~GeV$. It is clear that the effect of QCD appears at low temperatures, so we will use equation of state of trace anomaly in all our calculations, i.e. Eq. (\ref{b14}). \begin{figure}[!tbp] \centering \begin{minipage}[b]{0.4\textwidth} \includegraphics[width=7cm, height=5cm]{2.eps} \caption{The effective equation of state parameter as a function of transition temperature $T_*$} \end{minipage} \hfill \begin{minipage}[b]{0.5\textwidth} \includegraphics[width=7cm, height=5cm]{3.eps} \caption{$\frac{H_*}{H_0}$ as a function of transition temperature $T_*$ without GUP effect $\beta=0$} \end{minipage} \end{figure} The peak frequency of the SGW frequency redshifted to the corresponding value at current epoch is given by \begin{eqnarray}\label{b15} \nonumber \frac{\nu_{0peak}}{\nu_*}=\frac{a_*}{a_0},~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\\ =\frac{T_0}{T_*}\left[\frac{g_s(T_0)}{g_s(T_*)}\right]^{\frac{1}{3}} \left[\frac{7+36\pi^2\beta T^2_0}{7+36\pi^2\beta T^2_*}\right]^{-\frac{1}{3}}. \end{eqnarray} Fig. (3) shows the frequency received at the current time to that presents at the epoch of transition as a function of the transition temperature. It shows that the effect of GUP increases with increasing transition temperature. We have used the numerical values $T_0=2.725K=2.348\times 10^{-13}GeV$, $g_s(T_*)\in\left[33-37\right]\approx 35$ and $g_s(T_0)=3.4$. According to Eq. (\ref{b3}), the function $\frac{a_0}{a_r}$ can be determined and used into Eq. (\ref{b11}) as \begin{eqnarray}\label{b16} \nonumber \left(\frac{H_*}{H_0}\right)^2=\Omega_{r0}\left(\frac{T_r}{T_0}\right)^4\left[\frac{g_s(T_r)}{g_s(T_0)}\right]^{\frac{4}{3}} \left[\frac{7+36\pi^2\beta T^2_r}{7+36\pi^2\beta T^2_0}\right]^{-\frac{4}{3}}\times ~~~~~~~~~~~~~~~~~~~~~~~~~~\\ \frac{g_s(T_*)^{1+\omega_{eff}(T_*)}}{g_s(T_r)^{1+\omega_{eff}(T_r)}} \exp{\left[\int_{T_r}^{T_*}(1+\omega_{eff})\left(\frac{3}{T}-\frac{72\pi^2\beta T}{7+36\pi^2\beta T^2}\right)~dT\right]}. \end{eqnarray} Fig. (4) shows the ratio between Hubble parameter at the epoch of transition to its counterpart at current epoch as a function of transition time. It is clear that the effect of GUP increases with increasing transition temperature and leads to a decrease in the ratio with temperature. In other words, for high temperature, if $\beta_{1}>\beta_{2}>\beta_{3}$ it is concluded that $\frac{H_*}{H_0}|_{\beta_1}<\frac{H_*}{H_0}|_{\beta_2}<\frac{H_*}{H_0}|_{\beta_3}$. Finally, we can rewrite Eq. (\ref{b12}) as \begin{eqnarray}\label{b17} \nonumber \frac{\Omega_{gw}}{\Omega_{gw*}}=\Omega_{r0} ~ \left(\frac{T_r}{T_*}\right)^4\left[\frac{g_s(T_r)}{g_s(T_*)}\right]^{\frac{4}{3}} \left[\frac{7+36\pi^2\beta T^2_r}{7+36\pi^2\beta T^2_*}\right]^{-\frac{4}{3}}\times ~~~~~~~~~~~~~~~~~~~~~~~~~~\\ \frac{g_s(T_*)^{1+\omega_{eff}(T_*)}}{g_s(T_r)^{1+\omega_{eff}(T_r)}} \exp{\left[\int_{T_r}^{T_*}(1+\omega_{eff})\left(\frac{3}{T}-\frac{72\pi^2\beta T}{7+36\pi^2\beta T^2}\right)~dT\right]}. \end{eqnarray} \begin{figure} \includegraphics[width=7cm, height=5cm]{1.eps} \caption{$\frac{\nu_{0peak}}{\nu_*}=\frac{a_*}{a_0}$ as a function of transition temperature $T_*$ for some values of $\beta$} \end{figure} \begin{figure}[!tbp] \centering \begin{minipage}[b]{0.4\textwidth} \includegraphics[width=7cm, height=5cm]{4.eps} \caption{$\frac{H_*}{H_0}$ as a function of transition temperature $T_*$ using trace anomaly formalism with different values of $\beta$} \end{minipage} \hfill \begin{minipage}[b]{0.5\textwidth} \includegraphics[width=7cm, height=5cm]{5.eps} \caption{$\frac{\Omega_{gw}}{\Omega_{gw*}}$ as a function of transition temperature $T_*$ using trace anomaly formalism with different values of $\beta$ and the dotted dashed line represents the case $\omega_{eff}=\frac{1}{3}$ where $\frac{\Omega_{gw}}{\Omega_{gw*}}=\Omega_{r0}$} \end{minipage} \end{figure} Using trace anomaly formalism, the relative density parameter with different values of $\beta$ and applying equation of states of ultra-relativistic non-interacting gas is depicted in Fig. (5) In the case of using equation of state for ultra-relativistic gas with non-interacting particles, $\omega_{eff}=\frac{1}{3}$, the two integrations in Eq. (\ref{b12}) will cancel each other and the relative density parameter will be constant, i.e. $\frac{\Omega_{gw}}{\Omega_{gw*}}=\Omega_{r0}=8.5\times 10^{-5}$. This shown in Fig. (5) as a straight line. As the QCD equation of state goes to the equation of state of the ultra-relativistic and non-interacting gas, employing the QCD state equation, the relative density parameter also goes to the relative density parameter by using equation of state of ultra-relativistic and noninteracting gas, at $\sim5~GeV$. This behaviour is clearly shown in Fig. (5). Also, we can notice that the relative Hubble parameter and density parameter ratio decrease due to the GUP effect. The reduction is always proportional to the GUP parameter $\beta$ as shown in Figs. (4) and (5). We have used the numerical values $T_r=10^4~GeV$ and $g_s(T_r)=106$. \section{Modified QCD sources of stochastic gravitational wave} In this section, we turn our attention to the density parameter of gravitational wave at the epoch of transition $\Omega_{gw*}=\Omega_{gw}(T_*)$, which is necessary to define the SGW spectrum through Eq. (\ref{b17}). There are many sources that contribute to the SGW background such as solitons and solitons stars \cite{c1}, cosmic strings and domain walls \cite{c2,c3}. Here we are interested in the SGW background that is generated due to the first order phase transition in the early universe. We consider two component sources of bubble percolation that take place after bubble nucleation and its expansion in the QCD first order phase transition, i.e, bubble wall collisions (BWC) and shocks in the plasma \cite{c4,c5,c6,c7,c8,c9}, and turbulent magnetohydrodynamics (MHD) in plasma after bubble collision \cite{c10}. Based on envelope approximation and using numerical simulation, the contribution to the SGW spectrum by bubble collisions is given by \cite{c9,c11,c13} \begin{equation}\label{c1} \Omega^{BWC}_{gw*}(\nu)=\left(\frac{H_*}{\gamma}\right)^2\left(\frac{\kappa_b\alpha}{1+\alpha}\right)^2 \left(\frac{0.11~v^3}{0.24+v^2}\right)S_{BWC}(\nu), \end{equation} where $\gamma^{-1}$ is the time duration of phase transition, $\kappa_b$ is the fraction of the latent heat of the phase transition deposited on the bubble wall, $\alpha$ is the ratio of the vacuum energy density released in the phase transition to that of the radiation and $v$ is the wall velocity. Then, parameterization of the SGW spectrum is given by the function $S_{BWC}(\nu)$, which is determined by fitting simulation and analytically data, as \begin{equation}\label{c2} S_{BWC}(\nu)=\frac{3.8\left(\frac{\nu}{\nu_{BWC}}\right)^{2.8}}{1+2.8\left(\frac{\nu}{\nu_{BWC}}\right)^{3.8}}, \end{equation} \begin{equation}\label{c3} \nu_{BWC}=\frac{62~\gamma}{180-10v+100v^2}\left(\frac{a_*}{a_0}\right). \end{equation} It is worth noting that the frequency $\nu_{BWC}$ is the today peak frequency of the SGW that generated by BWC mechanism during phase transition. At the epoch of phase transition, the kinetic and magnetic Reynolds number of cosmic fluid are increased \cite{c14}, which motivate the bubbles to produce magnetohydrodynamical turbulence in the fully ionized plasm. Then assuming a presence of Kolmogorov-type turbulence, as suggested in \cite{c15}, the contribution to SGW spectrum form magnetohydrodynamical turbulence can be given as \cite{c14,c16} \begin{equation}\label{c4} \Omega^{MHD}_{gw*}(\nu)=\left(\frac{H_*}{\gamma}\right) \left(\frac{\kappa_{MHD}\alpha}{1+\alpha}\right)^{\frac{3}{2}}v~S_{MHD}(\nu), \end{equation} where $\kappa_{MHD}$ is the fraction of latent heat that converted into turbulence, and the formula for the spectrum is given by \begin{equation}\label{c5} S_{MHD}(\nu)=\frac{\left(\frac{\nu}{\nu_{MHD}}\right)^3}{\left(1+\frac{\nu}{\nu_{MHD}}\right)^{\frac{11}{3}}\left[1+8\pi\frac{\nu}{H_*}\left(\frac{a_*}{a_0}\right)^{-1}\right]}, \end{equation} \begin{equation}\label{c6} \nu_{MHD}=\frac{7\gamma}{4v}\left(\frac{a_*}{a_0}\right), \end{equation} where $\nu_{MHD}$ is today's peak frequency of the SGW generated by MHD at the epoch of phase transition. Although parameters $\alpha$ and $\kappa$ play substantial roles in defining the peak position and amplitude of the SGW signal, there is still no surefire way to find $\kappa$. Following \cite{bc1}, we assume $v=0.7$, $\frac{\kappa_b\alpha}{1+\alpha}=\frac{\kappa_{MHD}\alpha}{1+\alpha}=0.05$, $\gamma=nH_*=5H_*$ and we use the following substitutions \cite{bc1,c17} \begin{equation}\label{c7} H_*=\sqrt{\frac{8\pi}{3m_p^2}\rho(T_*)},~~~~T_*=T_c, \end{equation} where \begin{equation}\label{c8} \rho(T_*)=T_*^5\frac{dF(T_*)}{dT_*}+3T_*^4F(T_*). \end{equation} Now, using the above equations, we obtain \begin{equation}\label{c9} \Omega^{BWC}_{gw*}(\nu)=10^{-4} \frac{0.11~v^3}{0.24+v^2}~ \frac{3.8\left(\frac{\nu}{\nu_{BWC}}\right)^{2.8}}{1+2.8\left(\frac{\nu}{\nu_{BWC}}\right)^{3.8}}, \end{equation} \begin{equation}\label{c10} \Omega^{MHD}_{gw*}(\nu)=\frac{0.05^{\frac{3}{2}}}{5} \frac{v\left(\frac{\nu}{\nu_{MHD}}\right)^3}{\left(1+\frac{\nu}{\nu_{MHD}}\right)^{\frac{11}{3}} \left[1+\frac{8\pi\nu}{5}\sqrt{\frac{3m_p^2}{8\pi}\frac{1}{\rho(T_*)}}\left(\frac{a_*}{a_0}\right)^{-1}\right]}, \end{equation} where \begin{equation}\label{c11} \nu_{BWC}=\frac{310}{180-10v+100v^2}\sqrt{\frac{8\pi}{3m_p^2}\rho(T_*)}\left(\frac{a_*}{a_0}\right), \end{equation} \begin{equation}\label{c12} \nu_{MHD}=\frac{35}{4v}\sqrt{\frac{8\pi}{3m_p^2}\rho(T_*)}\left(\frac{a_*}{a_0}\right). \end{equation} Then, we use $\Omega_{gw*}h^2=(\Omega^{BWC}_{gw*}(\nu)+\Omega^{MHD}_{gw*}(\nu))h^2$ into Eq. (\ref{b17}) and take into account Eq. (\ref{b3}). Using the above mentioned numerical values of the parameters, we estimate the SGW spectrum $\Omega_{gw}h^2$, as shown in Fig. (6). It is clear that using QCD equation of state with trace anomaly causes the SGW signal becomes weak with increasing frequency. This effect is enhanced by the presence of quantum gravity effect, where the SGW signal weakens more compared to normal case. Using Eqs. (\ref{c11}) and (\ref{c12}) we obtain the total peak frequency of the SGW signal that can be measured today generated from BWC and MHD mechanism at the epoch of phase transition as \begin{eqnarray} \nonumber \nu_{total}= \nu_{BWC}+\nu_{MHD},~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\\ =\left(\frac{310}{180-10v+100v^2}+\frac{35}{4v}\right) \frac{T_0}{T_*}\left[\frac{g_s(T_0)}{g_s(T_*)}\right]^{\frac{1}{3}} \left[\frac{7+36\pi^2\beta T^2_0}{7+36\pi^2\beta T^2_*}\right]^{-\frac{1}{3}} \sqrt{\frac{8\pi}{3m_p^2}\rho(T_*)}. \end{eqnarray} Fig. (7) shows the influence of GUP on the peak signal of SGW that can be measured today as a function of the transition temperature. This effect becomes significant as the transfer temperature increases or as the GUP parameter increasing. In other words, at high limit $T_*$, if $\beta_{1}<\beta_{2}$ it is concluded that for fixed temperatures, $\nu_{total}(\beta_{1})<\nu_{total}(\beta_{2})$. Also, at this limit, the effects of GUP increases the peak of frequency i.e., $\nu_{total}^{\beta=0}<\nu_{total}^{\beta\neq0}$. These differences become dominant with increasing temperature. It is useful to compare the our result of $\Omega_{gw*}h^2$ in the presence of GUP effect with the possible sensitivities of interferometers designed to probe the stochastic background, such as LIGO-VIRGO or LISA satellites. It is found in \cite{Capozziello:2017vdi} the sensitivity is bounded by the value $10^{-12}$ as set by LIGO-VIRGO. It is also found that old LISA configuration over a year can can detect a white-noise stochastic background at the level of $10 ^{-13}$ \cite{Caprini:2015zlo}. It is clear that these sensitives values would set a stringent abound on the GUP parameter $\beta$ which may signify an intermediate length scale between Planck scale and electroweak scale which may be consistent with that set by the electroweak scale. The stochastic background sensitivity in that sense may have interesting implications with minimal length theories. We hope to study this in details in the near future. \begin{figure}[!tbp] \centering \begin{minipage}[b]{0.4\textwidth} \includegraphics[width=7cm, height=5cm]{6.eps} \caption{Net contribution to the SGW due to bubble wall collision and magnetohydrodynamic turbulence} \end{minipage} \hfill \begin{minipage}[b]{0.5\textwidth} \includegraphics[width=7cm, height=5cm]{7.eps} \caption{Today's net peak frequency of SGW signal arising from BWC and MHD at the epoch of phase transition} \end{minipage} \end{figure} \section{Conclusion} In this paper, we have studied the effects of GUP on the SGW background signal generated at the quark-hadron phase transition, which corresponds to the cosmological first order phase transition. It was agreed that such a cosmological phase transition occurred at the early universe within QCD scale about $t\sim 10^{-5}s$ after the big bang at temperature $T\sim 0.2~GeV$ and the Hubble radius in order $10\sim Km$, which involving a mass about $M_{\odot}$. Within GUP framework, the modified thermodynamical properties of photons gas is investigated. Using the resulting modified entropy, the temporal evolution of the universe temperature calculated as a function of the Hubble parameter. Due to the effects of QCD interaction, at epoch of phase transition, QCD equation of state should be employed. A pressure due to strong interactions among massless $u,~d,~s$ quarks and gluons, with energy density resulting from trace anomaly, was used to formulate the QCD equation of state. Within GUP framework and QCD equation of state, evolution of Hubble parameter and the energy density parameter of stochastic gravitational wave from the epoch of phase transition till current time was investigated. It is found that the presence of GUP leads to decrease in relative Hubble parameter and energy density parameter ratio, and the reduction is always proportional to the value of GUP parameter. A redshift in the peak frequency of the SGW at current epoch was obtained. Results showed that GUP effects caused an increase in the frequency peak which can lead to the better detection of the SGW signal. There are a various mechanism that can produce stochastic gravitational wave at epoch of transition. In this paper we were interested in BWC and MHD as a sources of the gravitational waves. Within GUP framework, the modified expressions of BWC and MHD, that contribute in the SGW spectrum, were calculated. It is found that the SGW signal generated during QCD phase transition became weaker in comparison to its counterpart for $\beta=0$. Today's net peak frequency of SGW signal, which was produced from BWC and MHD at the epoch of phase transition, is investigated. In the presence of GUP, it is found that the frequency of SGW signal is increased in comparison with original case, and the growth in the frequency depends on the GUP parameter. We also found that the sensitivities of interferometers designed to probe the stochastic background could set a stringent bound on the GUP parameter. These results could shed light on increasing the chance of detecting the stochastic gravitational signal created by such a transition in future observations. Moreover, they can lead to decoding of the dynamics of QCD phase transition at the early universe.
\section{Conslusion}\label{sec:conclusion} \section{Training on Cosmological Galaxy Formation Simulations}\label{sec:data} The first step in a supervised ML code is to train the software on known results. To do this, we employ three state-of-the-art cosmological galaxy formation simulations where we know the true physical properties. We then generate mock SEDs from the galaxies in these simulations using stellar population synthesis models and dust radiative transfer; these mock SEDs allow our ML algorithms to develop a highly accurate mapping between input photometry and galaxy physical properties. We train on a set of three galaxy formation simulations: {\sc Simba} \citep{dave_simba}, {\sc Eagle} \citep{schaye_2015_eagle,schaller_2015_eagle,mcalpine_2016_eagle_cat}, and {\sc IllustrisTNG} \citep{vogelsberger2014introducingillustris}. These models provide a large and diverse sample of galaxies with realistic growth histories, and free us from being dependent on any one set of galaxy model assumptions. In the following subsections, we describe each simulation and the galaxy formation models included in each suite as well as our galaxy selection method and computational techniques for generating mock SEDs for each galaxy. \subsection{Cosmological Galaxy Formation Simulations}\label{sec:data_sims} \textbf{\textsc{Simba}} \citep{dave_simba}: The {\sc Simba} galaxy formation model is a descendent of the {\sc Mufasa} model, and uses the {\sc Gizmo} gravity and hydrodynamics code \citep{hopkins_2015_gizmo}. {\sc Simba} uses an H$_2$-based star formation rate (SFR), given by the density of H$_2$ divided by the local dynamical timescale. The H$_2$ density itself relies on the metallicity and local column density \citep{krumholz2014despotic}. The chemical enrichment model tracks $11$ elements from from Type II supernovae (SNe), Type Ia SNe, and asymptotic giant branch (AGB) stars with yields following \cite{nomoto_simba_sne_yields}, \cite{iwamoto_1999_sne_yields}, and \cite{Oppenheimer_2006_agb_yields}, respectively. Sub-resolution models for stellar feedback include contributions from Type II SNe, radiation pressure, and stellar winds. The two-component stellar winds adopt the mass-loading factor scaling from {\sc fire} \citep{angles-alcazar_FIRE} with wind velocities given by \cite{muratov_2015}. Metal-loaded winds are also included, which extract metals from nearby particles to represent the local enrichment by the SNe driving the wind. Feedback via active galactic nuclei (AGN) is implemented as a two-phase jet (high accretion rate ) and radiative (low accretion rate) model, similar to the model used in {\sc IllustrisTNG} described below. Finally, dust is modeled self-consistently, produced by condensation of metals ejected from SNe and AGB stars, and is allowed to grow and erode depending on temperature, gas density, and shocks from local Type II SNe \citep{li2018dark}. The tunable parameters in {\sc Simba} were chosen to reproduce the M$_{BH}$-$\sigma$ relation and the galaxy stellar mass function (SMF) at redshift z $=0$. For our analysis, we use a box with $25/h$ Mpc side length with $512^3$ particles, resulting in a baryon mass resolution of $1.4\times$ $10^6 \: \mathrm{M}_{\odot}$. \textbf{Eagle} \citep{crain_2015_eagle, schaye_2015_eagle, schaller_2015_eagle, mcalpine_2016_eagle_cat}: The Evolution and Assembly of GaLaxies and their Environments ({\sc eagle}) suite of cosmological simulations is based on a modified version of the smoothed particle hydrodynamics (SPH) code {\sc gadget} 3 \citep{springel_2005_gadget}. Star formation occurs via gas particles that are converted into star particles at a rate that is pressure dependent and gas temperature and density limited, following \cite{schaye_2004_eagle_sfr} and \cite{schaye_dallavecchia_2008_eagle_sfr}. The chemical enrichment model tracks $9$ independent elements generated via winds from AGB stars, winds from massive stars, and Type II SNe following \cite{Wiersma_2009_eagle_yields}, \cite{Portinari_1998_eagle_yields}, and \cite{Marigo_2001_eagle_yields}, respectively. Stellar feedback from Type II SNe heats the local ISM, delivering fixed jumps in temperature and a fraction of energy from the SNE, and similarly, a single feedback mode for AGN injects thermal energy proportional to the BH accretion rate at a fixed efficiency into the surrounding gas. Like {\sc simba}, the parameters in {\sc eagle} have been tuned to reproduce the z $=0.1$ galaxy SMF. For our analysis, we use a $50/h$ Mpc box size with $752^3$ particles, resulting in a baryon mass resolution of $1.81\times$ $10^6 \: \mathrm{M}_{\odot}$. \textbf{IllustrisTNG} \citep{weinberger_2017_tng, pillepich_2018_tng1, pillepich_2018_tng2}: {\sc IllustrisTNG} is an updated version of the {\sc illustris} project, based on the {\sc arepo} \citep{springel_2010_arepo} magneto-hydrodynamics code. Star formation occurs in gas above a given density threshold, at a rate following the Kennicutt-Schmidt relation \citep{schmidt_1959_sfr, kennicutt_1989_sfr}. As stars evolve and die, nine elements are tracked via enrichment from Type II SNe and AGB stars following the models and yields of \cite{Wiersma_2009_eagle_yields}, \cite{Portinari_1998_eagle_yields}, and \cite{nomoto_simba_sne_yields}. Star formation also drives galactic scale winds. These hydrodynamically decoupled wind particles are injected isotropically with an initial speed that scales with the the local 1D dark matter velocity dispersion. The galactic winds carry additional thermal energy to avoid spurious artifacts where the wind particles hydrodynamically recouple with the gas. Like {\sc simba}, {\sc IllustrisTNG} features a two-mode feedback model for AGN: thermal energy is injected into the surrounding ISM at high accretion rates, while BH-driven winds are produced at low accretion rates. Tunable parameters were chosen in {\sc IllustrisTNG} to match observations including the SFM, the star formation rate density, and the stellar mass-halo mass relation at z $=0$. We use the TNG100 box with a baryonic mass resolution of $1.4\times$ $10^6 \: \mathrm{M}_{\odot}$. \subsection{Galaxy Selection}\label{sec:data_galaxyselection} Galaxies from each simulation were identified with their respective friends-of-friends (FOF) algorithms. We use the publicly available galaxy catalogues for {\sc eagle} \citep{mcalpine_2016_eagle_cat} and {\sc IllustrisTNG} \citep{nelson_tng_cat} in which subhalo structures are identified by a minimum of 32 particles with the {\sc subfind} algorithm \citep{springel_2001_subfind, dolag_2009_subfind}. For {\sc simba}, we have employed {\sc caesar}\footnote{https://github.com/dnarayanan/caesar} \citep{caesar}, which identifies halos and galaxies in snapshots based on the number of bound stellar particles (a minimum of 32 particles defines a galaxy). To ensure our galaxy sample is robust across the three simulations, we select galaxies from the full subhalo populations that have (i) a stellar mass above the minimum mass found in the z $=0$ {\sc simba} snapshot ($4.4\times$ $10^7 \: \mathrm{M}_{\odot}$) and (ii) have a nonzero gas mass. Due to computational limits, we randomly sample 10,000 galaxies from the $\sim$85,000 previously identified {\sc IllustrisTNG} galaxy sample, though we ensure that this subsample matches the intrinsic SFM of the entire sample. After these selections, we have a total of $1797$, $4697$, and $10000$ from the {\sc Simba}, {\sc Eagle}, and {\sc IllustrisTNG} simulations respectively for redshift $z=0$. For redshift $z=2$, an additional $17,020$ galaxies are included in the training set. \subsection{Mock SEDs from 3D Radiative Transfer}\label{sec:data_radiativetransfer} \begin{figure*} \centering \includegraphics[width=0.99\textwidth]{pd_pipeline.pdf} \caption{Data pipeline for each simulated galaxy. Once galaxies are selected from each simulation, we perform 3D dust radiative transfer with {\sc powderday}, which utilizes {\sc fsps} to generate the stellar SEDs and {\sc hyperion} to propagate the stellar SEDs through a dusty medium dependent. We then sample mock photometry in $33$ filters from the {\sc powderday} SED.} \label{fig:pd_sed} \end{figure*} Our analysis relies on realistic galaxy SEDs as input to predict physical properties including stellar mass and SFR. To produce these SEDs, we perform full 3D dust radiative transfer (RT) for each galaxy in our subsamples. We use the radiative transfer code {\sc powderday}\footnote{https://github.com/dnarayanan/powderday} \citep{pd_2020} to construct the synthetic SEDs by first generating with {\sc fsps} \citep{fsps_1, fsps_2} the dust free SEDs for the star particles within each cell using the stellar ages and metallicities as returned from the cosmological simulations. For these, we assume a \cite{kroupa_initial_2002} stellar IMF and the {\sc mist} stellar isochrones \citep{mist_1, mist_2}. These {\sc fsps} stellar SEDs are then propagated through the dusty ISM. Here, differences in the RT model arise as dust is implemented differently in each simulation. {\sc eagle} and {\sc IllustrisTNG} do not have a native dust model and so we assume a constant dust mass to metals mass ratio of $0.4$ \green{\citep{dwek_1998_dust_to_metals, vladilo_1998_dust_to_metals, watson_2011_dust_to_metals}}. For {\sc simba}, the diffuse dust content is derived from the on-the-fly self-consistent model of \cite{qi_dust}. From there, the dust is treated identically between simulations: it is assumed to have extinction properties following the carbonaceous and silicate mix of \cite{draine_infrared_2007}, that follows the \cite{weingartner_draine} size distribution and the \cite{draine_03} renormalization relative to hydrogen. We assume $R_{\rm V} \equiv A_{\rm V}/E(B-V) = 3.15$. We do not assume further extinction from sub-resolution birth clouds. Polycyclic aromatic hydrocarbons (PAHs) are included following the \citet{robitaille_pahs} model in which PAHs are assumed to occupy a constant fraction of the dust mass (here, modeled as grains with size $a<20$ \AA) and occupying $5.86\%$ of the dust mass. The dust emissivities follow the \citet{draine_infrared_2007} model, though are parameterized in terms of the mean intensity absorbed by grains, rather than the average interstellar radiation field as in the original Draine \& Li model. The radiative transfer propagates through the dusty ISM in a Monte Carlo fashion following the \cite{lucy_rt} algorithm, in order to determine the equilibrium dust temperature in each cell. We iterate until the energy absorbed by $99\%$ of the cells has changed by less than $1\%$. Note, a result of these calculations is that while we assume the \cite{draine_infrared_2007} extinction curve in every cell, the effective {\it attenuation} curve is a function of the star-dust geometry, and therefore varies from galaxy to galaxy \citep{attenuation_araa}. The result of the {\sc powderday} radiative transfer is the UV - FIR spectrum for each galaxy. From there, we sample broadband photometry in $33$ filters, ensuring robust SED coverage. These filters are shown in Table \ref{table:filters}. Our training set for {\sc mirkwood} includes photometry at signal-to-noise ratios (SNR) of 2, 10, and 20. \input{filters_table_long} \subsection{Prospector SED Fitting}\label{sec:data_prospector} We compare our results from {\sc mirkwood} to traditional galaxy SED fitting using the state-of-the-art SED fitting code, {\sc Prospector} \citep{2019ascl.soft05025J, leja_deriving_2017, leja_how_2019}\footnote{https://github.com/bd-j/prospector}. {\sc Prospector} wraps {\sc fsps} stellar modeling with {\sc dynesty} \citep{dynesty} Bayesian inference to provide estimates of galaxy properties given models forms for the galaxy star formation history (SFH), metallicity, and dust content. For the galaxy SFH, we use the nonparametric linear piece-wise function as described in \cite{leja_how_2019} with 6 time bins spaced equally in logarithmic time. The stellar metallicity is tied to the inferred stellar mass of the galaxy, constrained by the \cite{gallazzi_ages_2005} M*-Z relation from SDSS DR7 data. The dust attenuation model follows \cite{kc_law}, in which the strength of the 2175 \AA \ bump is tied to the powerlaw slope. Dust emission follows the \cite{draine_infrared_2007} model. Prior distributions for model components approximately follow those outlined in \cite{lower_stellar_mass} and have been shown to reasonably reproduce {\sc simba} galaxy properties including stellar mass and SFR. We provide the same mock {\sc powderday} broadband SEDs to {\sc prospector} as {\sc mirkwood} with the same SNRs. In all comparisons to {\sc mirkwood}, we report the median value of the posterior distribution from the {\sc prospector} fit for each galaxy property. \begin{table*} \caption{Summary statistics of the five galaxy properties in this paper, for all three hydrodynamical simulations. Each tuple consists of value at z=0 and value at z=2, from left to right respectively.} \label{tab:datasetsummary} \centering \begin{tabular}{ccccc} \toprule & & {\sc Simba} & {\sc Eagle} & {\sc IllustrisTNG} \\ \tableline & Min & (0.0, 2.0) & (0.0, 2.0) & (0.0, 2.0) \\ & Max & (0.0, 2.0) & (0.0, 2.0) & (0.0, 2.0) \\ $z$ & Mean & (0.0, 2.0) & (0.0, 2.0) & (0.0, 2.0) \\ & Median & (0.0, 2.0) & (0.0, 2.0) & (0.0, 2.0) \\ & Std.Dev. & (0.0, 0.0) & (0.0, 2.0) & (0.0, 0.0) \\ \tableline & Min & (7.64, 7.70) & (7.64, 7.64) & (7.70, 6.06) \\ & Max & (12.15, 11.63) & (12.01, 11.01) & (12.19, 11.46) \\ $\log_{10}(\frac{\rm{M}^{\star}}{\rm{M}_{\odot}})$ & Mean & (8.91, 8.37) & (8.71, 8.31) & (8.82, 6.75) \\ & Median & (8.78, 8.16) & (8.50, 8.13) & (8.65, 6.41) \\ & Std.Dev. & (0.86, 0.64) & (0.83, 0.60) & (0.85, 0.82) \\ \tableline & Min & (0.0, 2.41) & (2.81, 4.40) & (4.72, 5.66) \\ & Max & (8.63, 8.99) & (10.5, 8.94) & (10.26, 9.30) \\ $\log_{10}(1+\frac{\rm{M}_{\rm{Dust}}}{\rm{M}_{\odot}})$ & Mean & (5.39, 4.81) & (6.25, 6.21) & (6.82, 6.54) \\ & Median & (5.33, 4.51) & (6.06, 6.05) & (6.72, 6.39) \\ & Std.Dev. & (1.47, 0.98) & (0.86, 0.64) & (0.75, 0.56) \\ \tableline & Min & (-1.61, -1.69) & (-1.05, -1.67) & (-1.27, 0.27) \\ & Max & (0.08, 0.11) & (0.30, 0.35) & (0.17, 0.52) \\ $\log_{10}(\frac{\rm{Z}^{\star}}{\rm{Z}_{\odot}})$ & Mean & (-0.86, -1.2) & (-0.25, -0.80) & (-0.49, 0.46) \\ & Median & (-0.87, -1.24) & (-0.24, -0.80) & (-0.50, 0.46) \\ & Std.Dev. & (0.35, 0.24) & (0.18, 0.21) & (0.28, 0.03) \\ \tableline & Min & (0.0, 0.0) & (0.0, 0.0) & (0.0, 0.0) \\ & Max & (1.35, 2.46) & (1.14, 1.84) & (1.57, 0.16) \\ $\log_{10}(1+\rm{SFR}_{100})$ & Mean & (0.10, 0.15) & (0.05, 0.14) & (0.09, 0.00) \\ & Median & (0.02, 0.03) & (0.01, 0.05) & (0.03, 0.00) \\ & Std.Dev. & (0.18, 0.31) & (0.11, 0.24) & (0.15, 0.00) \\ \tableline \#Samples & & (1,797, 1,797) & (4,697, 4,697) & (10,073, 10,073) \\ \tableline \end{tabular} \end{table*} \section{Discussion and Future Work}\label{sec:discussion} Our work shows that it is possible to reproduce galaxy property measurements with high accuracy in a purely data-driven way by using robust ML algorithms that do not have any knowledge about the physics of galaxy formation or evolution. The biggest caveat here is that the training set must be closely representative of the data of interest, i.e. observations of real galaxies. We also demonstrate the necessity of carefully accounting for both the noise in the data and sparsity of the training set in any given parameter-space of interest. By combining galaxy simulations with disparate physics, we offer a way to better train our model for a real observation. Across all SNRs, we show a considerable improvement over state-of-the-art SED fitting using {\sc Prospector} and non-parametric SFH prior, both in terms of predictions and computing time. A notable result is that we are able to extract galaxy properties from photometries with SNRs as low as 5. We have also shown that it is possible to derive the redshift from purely photometric observations. All these contributions considered together imply indicate that scientifically interesting galaxy properties can be accurately and quickly measured on future datasets from large-scale photometric surveys. Several avenues for future research remain open. The crux of our follow-up efforts will focus on development of {\sc mirkwood} to a higher level of complexity and precision. We identify the following areas for improvement: \begin{enumerate} \item Extensive hyperparameter optimization: In this work we use {\sc NGBoost} models with hyperparameters marginally modified from the prescription of \cite{ren2019rongba_ngboost}. This is an easy avenue for gaining performance boost with respect to reconstruction of galaxy properties -- in future work we will leverage modern Bayesian hyperparameter optimization libraries to this end. \item Managing missing observations: Most real-life observations of galaxies do not contain observations in the same set of filters, nor is the SNR of the data in each filter the same. {\sc mirkwood} can easily accommodate both these complications, and in future work we will explore their impact on model performance. \item Synergistic spectroscopy: While spectroscopic data are considerably more expensive to obtain, there exist targets where photometry and spectra are available simultaneously \citep{carnall2019vandels}. Modeling both modes of data simultaneously can increase the SNR available to any model, and help significantly in reducing uncertainties in derived galaxy properties, thus enabling accurate re-construction of higher resolution ones such as a galaxy's entire star formation history. We will explore inclusion of a convolutional neural network to this end, similar to the work of \cite{lovell2019learning}. \item Probability calibration: This is a post-processing step that has been shown to improve predictions, measured both by deterministic and probabilistic metrics. ML algorithms are often over-confident, and unable to assess the degree of their fallacy -- if given a completely novel input, most commonly used ML algorithms are likely to predict a wrong label for it, instead of just saying, `I do not know the correct answer.' Probability calibration is widely used in the machine learning community \citep{measuring_calibration_in_deep_learning, probability_calibration1, crude_probability_calibration, lakshminarayanan_probability_calibration0}, albeit its adoption in astronomy has been slow. \item Randomized chaining: Here we have considered one particular way of chaining galaxy properties: redshift is considered when predicting stellar mass, redshift and stellar mass are considered when predicting dust mass, and so on all the way till SFR$_{100}$ (see Figure \ref{fig:chaining} for details). However, given the interdependence of all properties, a more justified approach would be to conside multiple such orderings and average the result. For instance, to predict stellar mass, $\rm{model}_1$ will be trained on just the galaxy fluxes, $\rm{model}_2$ on fluxes + redshift, $\rm{model}_3$ on fluxes + dustmass + SFR$_{100}$, and all such permutations. Finally, the predicted stellar mass results will be averaged. \item Redshift as input: It might very well be the case that for a given set of samples, high-confidence spectroscopic redshift is available, but photometry data is present only in a few bands. In such a case, it would be sensible to use redshift as an input rather than an output. We plan on upgrading our network so that {\sc mirkwood} can easily take a redshift as either a fixed input, or take a user-given prior for redshift which it will then aim to improve. \item Semi-supervised learning: In an effort to reduce the `domain gap' -- the difference between the training set(s) and real life data -- several semi-supervised algorithms have been developed and used. These can smoothly combine a computer simulated set of data with high-confidence real life-observations, such as spectra, to more closely approximate reality. \item Outlier detection and elimination: In its current implementation, {\sc mirkwood} is unable to identify and reject outlying inputs. These can result from any of the several data processing pipelines that are used to create scientifically interesting data products can fail and output nonsensical numbers, for example a flux absurdly high as $10^{252}$. This issue becomes even more urgent when dealing with semi-supervised learning, where data from real-life observations form part of the training set. In future we plan on exploring algorithms such as variational auto-encoders \citep{ghosh2016robust_variationalbayesianinference,zellner1988optimal_variationalbayesianinference} to this end. \end{enumerate} Finally, any new algorithm must be validated against known results from literature. Since we have developed {\sc mirkwood} to appeal to observers, we will use it to derive physical properties of galaxies from DR3 of the GAMA survey \citep{gama_driver2009}. In a recent work, \cite{bellstedt2020galaxy} formulated a novel SFH prior, and derived SFH and metallicty posteriors of $\sim 7000$ galaxies in the nearby universe. They were able to recreate the cosmic star formation rate density much better than using other parametric formulations of the SFH. We plan on using this same dataset and comparing our results with the GAMA Team. \section{Introduction}\label{sec:introduction} \subsection{Traditional SED Fitting} Spectral energy distributions (SEDs) of galaxies are crucial in informing our understanding of the most fundamental physical properties, such as their redshifts, stellar population masses, ages, and dust content. The task of extracting these properties by fitting models of the stellar photometry and dust attenuation to observations of galaxies is commonly known as SED fitting, and is one of the most common ways of deriving physical properties of galaxies. In SED fitting, stellar populations are evolved with stellar population synthesis (SPS) models over an assumed star formation history (SFH), with an assumed stellar initial mass function (IMF) and through an assumed dust attenuation curve, to produce a composite spectrum. This resulting spectrum is then compared to the galaxy photometric observation under consideration, and the input assumptions are varied until there is a reasonable match between the two. The best fit model is then used to infer the physical properties of the concerned galaxy (see recent reviews by \citealt{walcher2011fitting, conroy2013modeling}). This technique has been transformational in turning observed data into inferred galaxy physical properties. For instance, we now understand the evolution of the galaxy stellar mass function through z $\sim 7$ \citep{tomczak2014galaxy, grazian2015galaxy, leja2019a}, the diversity in shapes of galaxy SFHs \citep{papovich2011rising, leja2019b}, the nature of the star formation rate--stellar mass (SFR-M$^{\star}$) relation through z = 2 \citep{mobasher2008relation, iyer2018sfr}, the process of inside-out quenching \citep{jung2017evidence}, and the general shapes of galaxy dust attenuation curves at high-z \citep{salmon2016breaking}, all thanks to a combination of high quality data with SED fitting techniques. These developments have spurred -- and in turn have been accelerated by -- the development of modern SED fitting codes such as {\rm CIGALE} \citep{boquien2019cigale}, {\sc Prospector} \citep{leja_deriving_2017}, {\rm FAST} \citep{kriekfast2009}, and {\rm MAGPHYS} \citep{da2008simplemagphys}. These codes rely on Bayesian optimization and Markov Chain Monte Carlo (MCMC) sampling methods to explore the large input base of computer simulated SED templates for close matches with an observed SED, and consequently output its physical properties At the same time, this traditional method of fitting SEDs has been known to introduce potential uncertainties and biases in the derived physical properties of galaxies. At the core of the issue are assumptions regarding the model stellar isochrones, spectral libraries, the IMF, the SFH, and the dust attenuation law. Each of these choices can dramatically impact the derived physical properties. For example, \cite{acquaviva2015simultaneous} evaluated the effects that different modelling assumptions have on the recovered SED parameters, and found that the incorrect parameterizations of the star formation history can significantly impact the derived physical properties. This finding has been confirmed by the works of \citet{wuyts2009color, michalowski2014spatially, sobral2014stellar} and \citet{simha2014parametrising}, who have all found significant impact of SFH on the derived galaxy stellar mass in various observational datasets. Similarly, \cite{iyer2017reconstruction} and \cite{lower_stellar_mass} found that fitting the SFH using simple functional forms leads to a bias of up to 70\% in the recovered total stellar mass. In addition, \cite{carnall2019vandels} demonstrated that such simple functional forms for SFH also impose strong priors on other physical parameters, which in turn bias our inference for fundamental cosmic relations, such as the stellar mass function (SMF) and the cosmic star formation rate density (CSFRD, \cite{ciesla2017sfr, leja_how_2019}), critical for answering crucial questions in the study of galaxy formation and evolution. Even with more complex SFH functions which have been able to better reproduce the CSFRD \citep{gladders2013imacs_lognormal}, individual stellar age estimates have been biased \citep{carnall2019vandels, leja2019a}. In a similar vein to SFH modeling, in their recent review \cite{salim2020dust} found that incorrect assumptions of the dust attenuation law, even within the commonly accepted family of locally-calibrated curves, can drive major uncertainties in the derived galaxy star formation rates. To overcome some of these limitations of traditional SED fitting, two broad approaches have been introduced. The first has been to modify the SFH prior employed during SED fitting. This has been accomplished by either creating new functional, parametric forms for the SFH that result in lower biases in derived posteriors in physical parameters, for instance by being less subject to the `outshining bias' \citep{behroozi2013average, simha2014parametrising}, or by developing parameter-free (\emph{non-parametric}) descriptions of the SFH \citep{tojeiro2007, iyer2017reconstruction, iyer2019nonparametric, leja_how_2019}. The latter are those that allow for a number of flexible bins of star formation to vary in the SED modeling procedure in order to model the more complex star formation histories that likely represent real galaxies \citep{iyer2018sfr, leja2019new}. In \cite{lower_stellar_mass}, the authors used a subset of the hydrodynamical simulations used in this work, to study the biases introduced by various commonly used parametric forms of SFH on the derived stellar masses, and found that some of the most commonly used formulations -- `constant', `delayed-$\tau$' and `delayed-$\tau$ + burst' -- dramatically under-predict the true stellar mass. They then compared the performance against that obtained by using a non-parametric SFH model \citep{leja_deriving_2017}, and found significantly better results. Even so, there were a large number of catastrophic outliers, with errors of up to 40\% (see Figure 3 in their work). This is because SED fitting is inherently a complex task involving several moving parts, and SFH is only one of several model assumptions that go in it. As already mentioned, the assumed dust attenuation law is another factor that can significantly impact the derived galaxy properties (see Figure 2 in \citealt{salim2020dust}) The upshot is that the uncertainties in the galaxy star formation history and star-dust geometry (as manifested in their dust attenuation curves) translate to significant uncertainties in the derived properties from traditional SED fitting techniques \citep{lower_stellar_mass, leja_deriving_2017, leja_how_2019, salim2020dust}. An alternative to SED fitting is to instead derive a mapping between the photometry of a galaxy and the underlying physical properties. In this regard, machine learning techniques can serve as a potential alternative to traditional SED fitting. In this paper, we demonstrate that machine learning is not only a suitable alternative, but potentially more accurate one. \section{Introduction}\label{sec:introduction} \subsection{Traditional SED Fitting} Spectral energy distributions (SEDs) of galaxies are crucial in informing our understanding of the most fundamental physical properties, such as their redshifts, stellar population masses, ages, and dust content. The task of extracting these properties by fitting models of the stellar photometry and dust attenuation to observations of galaxies is commonly known as SED fitting, and is one of the most common ways of deriving physical properties of galaxies. In SED fitting, stellar populations are evolved with over an assumed star formation history (SFH), with an assumed stellar initial mass function (IMF) and through an assumed dust attenuation curve, to produce a composite spectrum. This resulting spectrum is then compared to the galaxy photometric observation under consideration, and the input assumptions are varied until there is a reasonable match between the two. The best fit model is then used to infer the physical properties of the concerned galaxy (see recent reviews by \citealt{walcher2011fitting, conroy2013modeling}). This technique has been transformational in turning observed data into inferred galaxy physical properties. For instance, we now understand the evolution of the galaxy stellar mass function through z $\sim 7$ \citep{tomczak2014galaxy, grazian2015galaxy, leja2019a}, the diversity in shapes of galaxy SFHs \citep{papovich2011rising, leja2019b}, the nature of the star formation rate--stellar mass (SFR-M$^{\star}$) relation through z = 2 \citep{mobasher2008relation, iyer2018sfr}, the process of inside-out quenching \citep{jung2017evidence}, and the general shapes of galaxy dust attenuation curves at high-z \citep{salmon2016breaking}, all thanks to a combination of high quality data with SED fitting techniques. These developments have spurred -- and in turn have been accelerated by -- the development of modern SED fitting codes such as {\rm CIGALE} \citep{boquien2019cigale}, {\sc Prospector} \citep{leja_deriving_2017}, {\rm FAST} \citep{kriekfast2009}, {\rm BAGPIPES} \citep{bagpipes}, and {\rm MAGPHYS} \citep{da2008simplemagphys}. These codes rely on Bayesian optimization and Markov Chain Monte Carlo (MCMC) sampling methods to explore the large input base of computer simulated SED templates for close matches with an observed SED, and consequently output its physical properties At the same time, this traditional method of fitting SEDs has been known to introduce potential uncertainties and biases in the derived physical properties of galaxies. At the core of the issue are assumptions regarding the model stellar isochrones, spectral libraries, the IMF, the SFH, and the dust attenuation law. Each of these choices can dramatically impact the derived physical properties. For example, \cite{acquaviva2015simultaneous} evaluated the effects that different modelling assumptions have on the recovered SED parameters, and found that the incorrect parameterizations of the star formation history can significantly impact the derived physical properties. This finding has been confirmed by the works of \citet{wuyts2009color, michalowski2014spatially, sobral2014stellar} and \citet{simha2014parametrising}, who have all found significant impact of SFH on the derived galaxy stellar mass in various observational datasets. \cite{pacifici_josh} found that the simple assumption of exponentially declining SFH, simple dust law, and no emission-line contribution fails to recover the true stellar mass - star formation rate relationship for star-forming galaxies. Similarly, \cite{iyer2017reconstruction} and \cite{lower_stellar_mass} found that fitting the SFH using simple functional forms leads to a bias of up to 70\% in the recovered total stellar mass. In addition, \cite{carnall2019vandels} demonstrated that such simple functional forms for SFH also impose strong priors on other physical parameters, which in turn bias our inference for fundamental cosmic relations, such as the stellar mass function (SMF) and the cosmic star formation rate density (CSFRD, \cite{ciesla2017sfr, leja_how_2019}), critical for answering crucial questions in the study of galaxy formation and evolution. Even with more complex SFH functions which have been able to better reproduce the CSFRD \citep{gladders2013imacs_lognormal}, individual stellar age estimates have been biased \citep{carnall2019vandels, leja2019a}. In a similar vein to SFH modeling, in their recent review \cite{salim2020dust} found that incorrect assumptions of the dust attenuation law, even within the commonly accepted family of locally-calibrated curves, can drive major uncertainties in the derived galaxy star formation rates. To overcome some of these limitations of traditional SED fitting, two broad approaches have been introduced. The first has been to modify the SFH prior employed during SED fitting. This has been accomplished by either creating new functional, parametric forms for the SFH that result in lower biases in derived posteriors in physical parameters, for instance by being less subject to the `outshining bias' \citep{behroozi2013average, simha2014parametrising}, or by developing parameter-free (\emph{non-parametric}) descriptions of the SFH \citep{tojeiro2007, iyer2017reconstruction, iyer2019nonparametric, leja_how_2019}. The latter are those that allow for a number of flexible bins of star formation to vary in the SED modeling procedure in order to model the more complex star formation histories that likely represent real galaxies \citep{iyer2018sfr, leja2019new}. In \cite{lower_stellar_mass}, the authors used a subset of the hydrodynamical simulations used in this work to study the biases introduced by various commonly used parametric forms of SFH on the derived stellar masses, and found that some of the most commonly used formulations -- `constant', `delayed-$\tau$' and `delayed-$\tau$ + burst' -- dramatically under-predict the true stellar mass. They then compared the performance against that obtained by using a non-parametric SFH model \citep{leja_deriving_2017}, and found significantly better results. Even so, there were a large number of catastrophic outliers, with errors of up to 40\% (see Figure 3 in their work). This is because SED fitting is inherently a complex task involving several moving parts, and SFH is only one of several model assumptions that go in it. As already mentioned, for example, the assumed dust attenuation law is another factor that can significantly impact the derived galaxy properties (see Figure 2 in \citealt{salim2020dust}). The upshot is that the uncertainties in the galaxy star formation history and star-dust geometry (as manifested in their dust attenuation curves) translate to significant uncertainties in the derived properties from traditional SED fitting techniques \citep{lower_stellar_mass, leja_deriving_2017, leja_how_2019, salim2020dust}. An alternative to SED fitting is to instead derive a mapping between the photometry of a galaxy and the underlying physical properties. In this regard, machine learning techniques can serve as a potential alternative to traditional SED fitting. In this paper, we demonstrate that machine learning is not only a suitable alternative, but potentially more accurate one. \subsection{Machine Learning and SED Fitting}\label{sec:related_work} To explore the complex and degenerate parameter space more efficiently, machine learning (ML) has emerged as an alternative tool for deriving the physical parameters of galaxies. Unlike traditional SED fitting procedures, including those utilizing novel non-parametric SFH priors, ML algorithms are able to directly learn the relationships between the input observations (either photometric of spectroscopic) and the galaxy properties of interest without the need for human-specified priors. With ML, the priors themselves become learnable. This is possible because ML algorithms learn from the entire population ensemble, learning not just the mapping between individual galaxy observations and physical properties, but also the distribution of properties \cite{lovell2019learning}) trained convolutional neural networks (CNNs, \cite{krizhevsky2012imagenet_cnn}) to learn the relationship between synthetic galaxy spectra and high resolution SFHs from the \textsc{Eagle} \citep{schaye_2015_eagle} and \textsc{Illustris} \citep{vogelsberger2014introducingillustris} simulations. \cite{stensbo2017sacrificing} estimated specific star formation rates (sSFRs) and redshifts using broad-band photometry from SDSS (Sloan Digital Sky Survey, \cite{sdss_eisenstein2011}). \cite{surana2020predicting} used CNNs with multiband flux measurements from the GAMA (Galaxy and Mass Assembly, \cite{gama_driver2009}) survey to predict galaxy stellar mass, star formation rate, and dust luminosity. \cite{simet2019comparison} used neural networks trained on semi-analytic catalogs tuned to the CANDELS (Cosmic Assembly Near-infrared Deep Extragalactic Legacy Survey, \cite{grogin2011candels}) survey to predict stellar mass, metallicity, and average star formation rate. Owing to their superior ability in capturing non-linearity in data, ML-based models have seen applications in almost every field of astronomical study, including identification of supernovae \citep{disanto2016}, classification of galaxy images \citep{ml_morphology0,ml_morphology1, hausen2020morpheus,ciprijanovic2020deepmerge,barchi2020machine}, and categorization of signals observed in a radio SETI experiment \citep{harp2019}. With the exponential growth of astronomical datasets, ML based models are slowly becoming an integral part of all major data processing pipelines \citep{siemiginowska2019astro2020}. \cite{baron2019machine} provides a comprehensive and current overview of the application of machine learning methodologies to astronomical problems. \iffalse \begin{table*} \caption{Summary statistics of the five galaxy properties in this paper, for all three hydrodynamical simulations. Each tuple consists of value at z=0 and value at z=2, from left to right respectively.} \label{tab:datasetsummary} \centering \begin{tabular}{ccccc} \toprule & & {\sc Simba} & {\sc Eagle} & {\sc IllustrisTNG} \\ \tableline & Min & (7.64, 7.70) & (7.64, 7.64) & (7.70, 6.06) \\ & Max & (12.15, 11.63) & (12.01, 11.01) & (12.19, 11.46) \\ $\log_{10}(\frac{\rm{M}^{\star}}{\rm{M}_{\odot}})$ & Mean & (8.91, 8.37) & (8.71, 8.31) & (8.82, 6.75) \\ & Median & (8.78, 8.16) & (8.50, 8.13) & (8.65, 6.41) \\ & Std.Dev. & (0.86, 0.64) & (0.83, 0.60) & (0.85, 0.82) \\ \tableline & Min & (0.0, 2.41) & (2.81, 4.40) & (4.72, 5.66) \\ & Max & (8.63, 8.99) & (10.5, 8.94) & (10.26, 9.30) \\ $\log_{10}(1+\frac{\rm{M}_{\rm{Dust}}}{\rm{M}_{\odot}})$ & Mean & (5.39, 4.81) & (6.25, 6.21) & (6.82, 6.54) \\ & Median & (5.33, 4.51) & (6.06, 6.05) & (6.72, 6.39) \\ & Std.Dev. & (1.47, 0.98) & (0.86, 0.64) & (0.75, 0.56) \\ \tableline & Min & (-1.61, -1.69) & (-1.05, -1.67) & (-1.27, 0.27) \\ & Max & (0.08, 0.11) & (0.30, 0.35) & (0.17, 0.52) \\ $\log_{10}(\frac{\rm{Z}^{\star}}{\rm{Z}_{\odot}})$ & Mean & (-0.86, -1.2) & (-0.25, -0.80) & (-0.49, 0.46) \\ & Median & (-0.87, -1.24) & (-0.24, -0.80) & (-0.50, 0.46) \\ & Std.Dev. & (0.35, 0.24) & (0.18, 0.21) & (0.28, 0.03) \\ \tableline & Min & (0.0, 0.0) & (0.0, 0.0) & (0.0, 0.0) \\ & Max & (1.35, 2.46) & (1.14, 1.84) & (1.57, 0.16) \\ $\log_{10}(1+\rm{SFR}_{100})$ & Mean & (0.10, 0.15) & (0.05, 0.14) & (0.09, 0.00) \\ & Median & (0.02, 0.03) & (0.01, 0.05) & (0.03, 0.00) \\ & Std.Dev. & (0.18, 0.31) & (0.11, 0.24) & (0.15, 0.00) \\ \tableline \#Samples & & (1,797, 1,797) & (4,697, 4,697) & (10,073, 10,073) \\ \tableline \end{tabular} \end{table*} \fi \begin{table*} \caption{Summary statistics of the five galaxy properties in this paper, for all three hydrodynamical simulations.} \label{tab:datasetsummary} \centering \begin{tabular}{ccccc} \toprule & & {\sc Simba} & {\sc Eagle} & {\sc IllustrisTNG} \\ \tableline & Min & 7.64 & 7.64 & 7.70 \\ & Max & 12.15 & 12.01 & 12.19 \\ $\log_{10}(\frac{\rm{M}^{\star}}{\rm{M}_{\odot}})$ & Mean & 8.91 & 8.71 & 8.82 \\ & Median & 8.78 & 8.50 & 8.65 \\ & Std.Dev. & 0.86 & 0.83 & 0.85 \\ \tableline & Min & 0.0 & 2.81 & 4.72 \\ & Max & 8.63 & 10.5 & 10.26 \\ $\log_{10}(1+\frac{\rm{M}_{\rm{Dust}}}{\rm{M}_{\odot}})$ & Mean & 5.39 & 6.25 & 6.82 \\ & Median & 5.33 & 6.06 & 6.72 \\ & Std.Dev. & 1.47 & 0.86 & 0.75 \\ \tableline & Min & -1.61 & -1.05 & -1.27 \\ & Max & 0.08 & 0.30 & 0.17 \\ $\log_{10}(\frac{\rm{Z}^{\star}}{\rm{Z}_{\odot}})$ & Mean & -0.86 & -0.25 & -0.49 \\ & Median & -0.87 & -0.24 & -0.50 \\ & Std.Dev. & 0.35 & 0.18 & 0.28 \\ \tableline & Min & 0.0 & 0.0 & 0.0 \\ & Max & 1.35 & 1.14 & 1.57 \\ $\log_{10}(1+\rm{SFR}_{100})$ & Mean & 0.10 & 0.05 & 0.09 \\ & Median & 0.02 & 0.01 & 0.03 \\ & Std.Dev. & 0.18 & 0.11 & 0.15 \\ \tableline \#Samples & & 1,797 & 4,697 & 10,073 \\ \tableline \end{tabular} \end{table*} \subsection{This Paper} In this paper we introduce \textsc{mirkwood}, a fully ML-based tool for deriving galaxy physical parameters from multi-band photometry, while robustly accounting for various sources of uncertainty. We compare {\sc mirkwood}'s performance with that of the current state-of-the-art Bayesian SED fitting tool \textsc{Prospector}, by using data from galaxy formation simulations for which we have ground-truth values\footnote{While one could consider using observed photometric data of real galaxies instead, a glaring lack of well-defined ground truth physical parameters -- independent of any inference tool employed -- would make comparisons between results from \textsc{mirkwood} and any traditional SED fitting code difficult.}. To do this, we first create mock SEDs from three different cosmological hydrodynamical simulations (via the procedure discussed in detail in Section \ref{sec:data} and illustrated in Figure \ref{fig:pd_sed}) -- \textsc{Simba}, \textsc{Eagle}, and \textsc{IllustrisTNG}. We then fit GALEX, HST, Spitzer, Herschel, and JWST photometry of these mock SEDs to extract stellar masses, dust masses, stellar metallicities, and instantaneous SFRs (defined as the mean SFR in the past 100 Myrs from the time of observation) using the publicly available SED fitting software {\sc Prospector} \citep{leja_deriving_2017} with the state-of-the-art non-parametric SFH model from \cite{leja_deriving_2017, leja2019a} (Section \ref{sec:data}). We repeat this exercise using \textsc{mirkwood}, and compare both sets of derived galaxy properties to their true values from simulations. The rest of this paper is organized as follows. In Section \ref{sec:data} we describe both our data and the traditional SED fitting technique in significant detail, including the three hydrodynamical simulations (Section \ref{sec:data_sims}), the method to select galaxies of interest from these simulations (Section \ref{sec:data_galaxyselection}), the dust radiative transfer process used to create SEDs (Section \ref{sec:data_radiativetransfer}), and finally the Bayesian code used to fit these SEDs to derive galaxy properties (Section \ref{sec:data_prospector}). In Section \ref{sec:methods_proposed_method} we describe in detail the SED modeling procedure using our proposed model \textsc{mirkwood}. We describe how \textsc{mirkwood} robustly estimates uncertainties in its predictions (uncertainty quantification, Section \ref{sec:methods_uncertainty}), and introduce metrics to quantify performance gains with respect to traditional SED fitting (Section \ref{sec:methods_metrics}). In Section \ref{sec:results}, we investigate the improvement in the determination of the four galaxy properties. Finally, in Section \ref{sec:discussion} we summarize our findings, and suggest possible improvements to both the proposed model and to areas of application. Throughout we assume a Planck 2013 cosmology with the following parameters: $\Omega_m = 0.30$, $\Omega_\lambda = 0.70$, $\Omega_b = 0.048$, $h = 0.68$, $\sigma_8 = 0.82$, and $n_s = 0.97$. \section{Training on Cosmological Galaxy Formation Simulations}\label{sec:data} The first step in a supervised ML code is to train the software on known results. To do this, we employ three state-of-the-art cosmological galaxy formation simulations where we know the true physical properties. We then generate mock SEDs from the galaxies in these simulations using stellar population synthesis models and dust radiative transfer; these mock SEDs allow our ML algorithms to develop a highly accurate mapping between input photometry and galaxy physical properties. We train on a set of three galaxy formation simulations: {\sc Simba} \citep{dave_simba}, {\sc Eagle} \citep{schaye_2015_eagle,schaller_2015_eagle,mcalpine_2016_eagle_cat}, and {\sc IllustrisTNG} \citep{vogelsberger2014introducingillustris}. These models provide a large and diverse sample of galaxies with realistic growth histories, and free us from being dependent on any one set of galaxy model assumptions. In the following subsections, we describe each simulation and the galaxy formation models included in each suite as well as our galaxy selection method and computational techniques for generating mock SEDs for each galaxy. \subsection{Cosmological Galaxy Formation Simulations}\label{sec:data_sims} \textbf{\textsc{Simba}} \citep{dave_simba}: The {\sc Simba} galaxy formation model is a descendent of the {\sc Mufasa} model, and uses the {\sc Gizmo} gravity and hydrodynamics code \citep{hopkins_2015_gizmo}. {\sc Simba} uses an H$_2$-based star formation rate (SFR), given by the density of H$_2$ divided by the local dynamical timescale. The H$_2$ density itself relies on the metallicity and local column density \citep{krumholz2014despotic}. The chemical enrichment model tracks $11$ elements from from Type II supernovae (SNe), Type Ia SNe, and asymptotic giant branch (AGB) stars with yields following \cite{nomoto_simba_sne_yields}, \cite{iwamoto_1999_sne_yields}, and \cite{Oppenheimer_2006_agb_yields}, respectively. Sub-resolution models for stellar feedback include contributions from Type II SNe, radiation pressure, and stellar winds. The two-component stellar winds adopt the mass-loading factor scaling from {\sc fire} \citep{angles-alcazar_FIRE} with wind velocities given by \cite{muratov_2015}. Metal-loaded winds are also included, which extract metals from nearby particles to represent the local enrichment by the SNe driving the wind. Feedback via active galactic nuclei (AGN) is implemented as a two-phase jet (high accretion rate ) and radiative (low accretion rate) model, similar to the model used in {\sc IllustrisTNG} described below. Finally, dust is modeled self-consistently, produced by condensation of metals ejected from SNe and AGB stars, and is allowed to grow and erode depending on temperature, gas density, and shocks from local Type II SNe \citep{qi_dust,li2020}. The tunable parameters in {\sc Simba} were chosen to reproduce the M$_{BH}$-$\sigma$ relation and the galaxy stellar mass function (SMF) at redshift z $=0$. For our analysis, we use a box with $25/h$ Mpc side length with $512^3$ particles, resulting in a baryon mass resolution of $1.4\times$ $10^6 \: \mathrm{M}_{\odot}$. \textbf{Eagle} \citep{crain_2015_eagle, schaye_2015_eagle, schaller_2015_eagle, mcalpine_2016_eagle_cat}: The Evolution and Assembly of GaLaxies and their Environments ({\sc eagle}) suite of cosmological simulations is based on a modified version of the smoothed particle hydrodynamics (SPH) code {\sc gadget} 3 \citep{springel_2005_gadget}. Star formation occurs via gas particles that are converted into star particles at a rate that is pressure dependent and gas temperature and density limited, following \cite{schaye_2004_eagle_sfr} and \cite{schaye_dallavecchia_2008_eagle_sfr}. The chemical enrichment model tracks $9$ independent elements generated via winds from AGB stars, winds from massive stars, and Type II SNe following \cite{Wiersma_2009_eagle_yields}, \cite{Portinari_1998_eagle_yields}, and \cite{Marigo_2001_eagle_yields}, respectively. Stellar feedback from Type II SNe heats the local ISM, delivering fixed jumps in temperature and a fraction of energy from the SNE, and similarly, a single feedback mode for AGN injects thermal energy proportional to the BH accretion rate at a fixed efficiency into the surrounding gas. Like {\sc simba}, the parameters in {\sc eagle} have been tuned to reproduce the z $=0.1$ galaxy SMF. For our analysis, we use a $50/h$ Mpc box size with $752^3$ particles, resulting in a baryon mass resolution of $1.81\times$ $10^6 \: \mathrm{M}_{\odot}$. \textbf{IllustrisTNG} \citep{weinberger_2017_tng, pillepich_2018_tng1, pillepich_2018_tng2}: {\sc IllustrisTNG} is an updated version of the {\sc illustris} project, based on the {\sc arepo} \citep{springel_2010_arepo} magneto-hydrodynamics code. Star formation occurs in gas above a given density threshold, at a rate following the Kennicutt-Schmidt relation \citep{schmidt_1959_sfr, kennicutt_1989_sfr}. As stars evolve and die, nine elements are tracked via enrichment from Type II SNe and AGB stars following the models and yields of \cite{Wiersma_2009_eagle_yields}, \cite{Portinari_1998_eagle_yields}, and \cite{nomoto_simba_sne_yields}. Star formation also drives galactic scale winds. These hydrodynamically decoupled wind particles are injected isotropically with an initial speed that scales with the the local 1D dark matter velocity dispersion. The galactic winds carry additional thermal energy to avoid spurious artifacts where the wind particles hydrodynamically recouple with the gas. Like {\sc simba}, {\sc IllustrisTNG} features a two-mode feedback model for AGN: thermal energy is injected into the surrounding ISM at high accretion rates, while BH-driven winds are produced at low accretion rates. Tunable parameters were chosen in {\sc IllustrisTNG} to match observations including the z $=0$ stellar mass function, the star formation rate density, and the stellar mass-halo mass relation at z $=0$. We use the TNG100 box with a baryonic mass resolution of $1.4\times$ $10^6 \: \mathrm{M}_{\odot}$. \input{filters_table_long} \subsection{Galaxy Selection}\label{sec:data_galaxyselection} Galaxies from each simulation were identified with their respective friends-of-friends (FOF) algorithms. We use the publicly available galaxy catalogues for {\sc eagle} \citep{mcalpine_2016_eagle_cat} and {\sc IllustrisTNG} \citep{nelson_tng_cat} in which subhalo structures are identified by a minimum of 32 particles with the {\sc subfind} algorithm \citep{springel_2001_subfind, dolag_2009_subfind}. For {\sc simba}, we have employed {\sc caesar}\footnote{https://github.com/dnarayanan/caesar} \citep{caesar}, which identifies halos and galaxies in snapshots based on the number of bound stellar particles (a minimum of 32 particles defines a galaxy). To ensure our galaxy sample is robust across the three simulations, we select galaxies from the full subhalo populations that have (i) a stellar mass above the minimum mass found in the z $=0$ {\sc simba} snapshot ($4.4\times$ $10^7 \: \mathrm{M}_{\odot}$) and (ii) have a nonzero gas mass. Due to computational limits, we randomly sample $\sim$10,000 galaxies from the $\sim$85,000 previously identified {\sc IllustrisTNG} galaxy sample, though we ensure that this subsample matches the intrinsic stellar mass function of the entire sample. After these selections, we have a total of $1797$, $4697$, and $10000$ from the {\sc Simba}, {\sc Eagle}, and {\sc IllustrisTNG} simulations respectively for redshift $z=0$ \subsection{Mock SEDs from 3D Radiative Transfer}\label{sec:data_radiativetransfer} \begin{figure*} \centering \includegraphics[width=0.99\textwidth]{pd_pipeline.pdf} \caption{Data pipeline for each simulated galaxy. Once galaxies are selected from each simulation, we perform 3D dust radiative transfer with {\sc powderday}, which utilizes {\sc fsps} to generate the stellar SEDs and {\sc hyperion} to propagate the stellar SEDs through a dusty medium dependent. We then sample mock photometry in $33$ filters from the {\sc powderday} SED.} \label{fig:pd_sed} \end{figure*} Our analysis relies on realistic mock galaxy SEDs as input to predict physical properties including stellar mass and SFR. To produce these synthetic SEDs, we perform full 3D dust radiative transfer (RT) for each galaxy in our subsamples. We use the radiative transfer code {\sc powderday}\footnote{https://github.com/dnarayanan/powderday} \citep{pd_2020} to construct the synthetic SEDs by first generating with {\sc fsps} \citep{fsps_1, fsps_2} the dust free SEDs for the star particles within each cell using the stellar ages and metallicities as returned from the cosmological simulations. For these, we assume a \cite{kroupa_initial_2002} stellar IMF and the {\sc mist} stellar isochrones \citep{mist_1, mist_2}. These {\sc fsps} stellar SEDs are then propagated through the dusty ISM. Here, differences in the RT model arise as dust is implemented differently in each simulation. {\sc eagle} and {\sc IllustrisTNG} do not have a native dust model and so we assume a constant dust mass to metals mass ratio of $0.4$ \green{\citep{dwek_1998_dust_to_metals, vladilo_1998_dust_to_metals, watson_2011_dust_to_metals}}. For {\sc simba}, the diffuse dust content is derived from the on-the-fly self-consistent model of \cite{qi_dust}. From there, the dust is treated identically between simulations: it is assumed to have extinction properties following the carbonaceous and silicate mix of \cite{draine_infrared_2007}, that follows the \cite{weingartner_draine} size distribution and the \cite{draine_03} renormalization relative to hydrogen. We assume $R_{\rm V} \equiv A_{\rm V}/E(B-V) = 3.15$. We do not assume further extinction from sub-resolution birth clouds. Polycyclic aromatic hydrocarbons (PAHs) are included following the \citet{robitaille_pahs} model in which PAHs are assumed to occupy a constant fraction of the dust mass (here, modeled as grains with size $a<20$ \AA) and occupying $5.86\%$ of the dust mass. The dust emissivities follow the \citet{draine_infrared_2007} model, though are parameterized in terms of the mean intensity absorbed by grains, rather than the average interstellar radiation field as in the original Draine \& Li model. The radiative transfer propagates through the dusty ISM in a Monte Carlo fashion using {\sc hyperion} \citep{robitaille_hyperion}, which follows the \cite{lucy_rt} algorithm in order to determine the equilibrium dust temperature in each cell. We iterate until the energy absorbed by $99\%$ of the cells has changed by less than $1\%$. Note, a result of these calculations is that while we assume the \cite{draine_infrared_2007} extinction curve in every cell, the effective {\it attenuation} curve is a function of the star-dust geometry, and therefore varies from galaxy to galaxy \citep{attenuation_araa}. The result of the {\sc powderday} radiative transfer is the UV - FIR spectrum for each galaxy. From there, we sample broadband photometry in $33$ filters, ensuring robust SED coverage. These filters are shown in Table \ref{table:filters}. Our training set for {\sc mirkwood} includes photometry at signal-to-noise ratios (SNR) of 2, 10, and 20. \subsection{Prospector SED Fitting}\label{sec:data_prospector} We compare our results from {\sc mirkwood} to traditional galaxy SED fitting using the state-of-the-art SED fitting code, {\sc Prospector} \citep{2019ascl.soft05025J, leja_deriving_2017, leja_how_2019}\footnote{https://github.com/bd-j/prospector}. {\sc Prospector} wraps {\sc fsps} stellar modeling with {\sc dynesty} \citep{dynesty} Bayesian inference to provide estimates of galaxy properties given models forms for the galaxy star formation history (SFH), metallicity, and dust content. For the galaxy SFH, we use the nonparametric linear piece-wise function as described in \cite{leja_how_2019} with 6 time bins spaced equally in logarithmic time. The stellar metallicity is tied to the inferred stellar mass of the galaxy, constrained by the \cite{gallazzi_ages_2005} M*-Z relation from SDSS DR7 data. The dust attenuation model follows \cite{kc_law}, in which the strength of the 2175 \AA \ bump is tied to the powerlaw slope. Dust emission follows the \cite{draine_infrared_2007} model. Prior distributions for model components approximately follow those outlined in \cite{lower_stellar_mass} and have been shown to reasonably reproduce {\sc simba} galaxy properties including stellar mass and SFR. We provide the same mock {\sc powderday} broadband SEDs to {\sc prospector} as {\sc mirkwood} with the same SNRs. In all comparisons to {\sc mirkwood}, we report the median value of the posterior distribution from the {\sc prospector} fit for each galaxy property. \section{Proposed Method}\label{sec:methods_proposed_method} We now present implementation details of our proposed method. {\sc mirkwood} is a \emph{supervised} learning algorithm, meaning it requires a \emph{training set} consisting of a pairs of inputs and outputs, to be able to learn the mapping from the former to the latter. Each input consists of a set of discrete \emph{features}, or independent variables, whereas the outputs -- also referred to as \emph{labels} -- are the dependent variables. The algorithm learns this mapping by minimizing a user-specified \emph{loss function}. This is similar to the minimization of the mean squared error commonly employed when fitting data in linear regression analysis. In this work, each input $\mathbf{x}$ is a mock SED vector consisting of flux values in 35 bands, and the associated galaxy properties (redshift, stellar mass, dust mass, stellar metallicity, and instantaneous star formation rate) form a vector output of length 5. While certain types of ML algorithms are able to map each input vector to an output vector consisting of multiple labels (for example, neural networks), this is not possible with {\sc mirkwood}. Hence we associate with each input only one galaxy property at a time, and use the model five times. Let us denote by $\mathbf{x}$ an input SED vector, by $y$ a galaxy property, by $n$ the number of SED samples, and by $d$ the number of bands/filters. Then the data set on hand can be mathematically specified as $\mathcal{D}=\left\{\left(\mathbf{x}_{i}^{1:d}, y_{i}\right): i=1, \ldots, n\right\}$. Our aim is to learn a data-driven mapping from the set of all $\mathbf{x}_{i}$s to the set of all $ y_i$s, to be able to predict $y_\mathrm{new}$ for a new, unseen observation $\mathbf{x_\mathrm{new}}$. To solve this \emph{regression} problem\footnote{Classification tasks are those where the goal is to predict discrete labels, e.g. identifying whether an object is a hotdog or not a hotdog. In regression problems we aim to prediction continuous labels, e.g. predicting the price of a stock tomorrow given its price over the past year.}, we employ the \textsc{NGBoost} algorithm \citep{ngboost}. Unlike most commonly used ML algorithms and libraries such as Random Forests \citep{randomforests}, Randomized Trees \citep{extremelyrandomizedtrees}, XGBoost \citep{xgboost} and Gradient Boosting Machines \citep{lightgbm}, \textsc{NGBoost} enables us to easily work in a probabilistic setting, and corresponding to every input galaxy SED, output both a measure of the central tendency (i.e. $\mu$), and a measure of dispersion (i.e. $\sigma$) for the galaxy property of interest. We thus use {\sc NGBoost} as the backbone of {\sc mirkwood}, and use the hyper-parameters suggested by \cite{ren2019rongba_ngboost}\footnote{\cite{ren2019rongba_ngboost} found that their new set of hyperparameters result in faster convergence than the default values supplied by the developers at \url{https://github.com/stanfordmlgroup/ngboost/blob/master/ngboost/ngboost.py}.}. We make the assumption that samples are drawn from Gaussian distributions. Our loss function is the \emph{negative likelihood function} \citep{ngboost}. Consider the case where we have samples from all three simulations. As a reminder, we have 1,797 samples from {\sc Simba}, 4,697 from {\sc Eagle}, and 10,073 from {\sc IllustrisTNG}. To predict any given galaxy property for each of the $n=1,797$ {\sc Simba} galaxies, we proceed as follows. First, we fix the parameters of the {\sc NGBoost} model to those recommended by \cite{ren2019rongba_ngboost}. Then, we divide the $n$ samples into $N_{\rm{CV,1}}=5$ distinct subsets (or \emph{folds}) based on \emph{stratified sampling} -- $y_i$s in each subset are picked such that their distribution closely matches the distribution of the parent sample $y_i$s. The first four subsets taken together form the \emph{training set}, $\mathcal{D_{TRAIN}}$, while the fifth, left-out fold for which we assume output labels are unavailable, is called the \emph{test set}, $\mathcal{D_{TEST}}$. This is the first step show in Figure \ref{fig:mirkwood_pipeline}. We then sub-divide $\mathcal{D_{TRAIN}}$ into $N_{\rm{CV,2}} = 5$ subsets, again in a stratified fashion. The model is trained cyclically on the combination of any distinct four sub-subsets -- referred to as $\mathcal{D_{TRAIN_{TRAIN}}}$, while its predictions on the samples in the left-out sub-subset, $\mathcal{D_{TRAIN_{VAL}}}$, are recorded and stored. Instead of training directly on $\mathcal{D_{TRAIN_{TRAIN}}}$, we use create $N_{\rm bags} = 48$ `bags' by randomly shuffling the data and picking the same number of samples \emph{with replacement}. The {\sc NGBoost} model initialized earlier is trained on all bags, and the respective predictions on $\mathcal{D_{TRAIN_{VAL}}}$ are averaged. The exact method of averaging is expounded upon in Section \ref{sec:methods_uncertainty}. After $N_{\rm{CV,2}}$ rounds we have $N_{\rm{CV,2}}$ non-overlapping $\mathcal{D_{TRAIN_{VAL}}}$ data sets containing distinct samples, which taken together constitute $\mathcal{D_{TRAIN}}$. These together constitute the second and third steps in the pipeline. For each of the 1,797 samples, we compare the predicted galaxy properties with their ground truth values, and note the average negative-log likelihood, $\mathcal{NLL_{\rm{VAL}}}$. We repeat this exercise multiple times, on each iteration tuning {\sc NGBoost}'s hyperparameters so that the $\mathcal{NLL_{\rm{VAL}}}$ is as low as possible. With the optimized set of {\sc NGBoost} hyperparameters thus obtained, we train {\sc mirkwood} on the entire training set $\mathcal{D_{TRAIN}}$, and record its predictions on $\mathcal{D_{TEST}}$. This process of \emph{hyperparameter optimization} is the fourth step in the pipeline. Finally, this process is repeated $N_{\rm{CV,1}}-1$ more times, to obtain predictions on all $n$ samples -- this is the fifth and final step in the pipeline. The entire process is carried out in a \emph{chained} fashion -- the model is first trained to use galaxy flux values to predict stellar mass,, then the predicted masses in conjunction with the original flux values are used to predict dust mass, and so on; this is explained pictorially in Figure \ref{fig:chaining}. We know that galaxy properties can be strongly degenerate (for instance, the well-known age-reddening-metallicity degeneracy); by chaining, we `hack' our model to leverage the inter-dependencies between these parameters. To predict SFR$_{100}$, the galaxy SFR average over the last 100 Myr, for an unseen sample $x_{\textrm{new}}$, for instance, we will use \textsc{NGBoost} to first predict galaxy stellar mass, then galaxy dust mass, then stellar metallicity, and finally SFR$_{100}$. \begin{figure*} \centering \includegraphics[width=.80\textwidth]{mirkwood_overview-2.pdf} \caption{\textbf{Training pipeline for {\sc mirkwood} in five sequential steps.} \emph{\textbf{Step 1:}} We divide the input data set $\mathcal{D}$ into $N_{\rm CV,1} = 4$ cross-validation folds, at any point referring to the collation of $N_{\rm CV,1}-1$ of them as $\mathcal{D_{TRAIN}}$, and the remaining fold as $\mathcal{D_{TEST}}$. We repeat this $N_{\rm CV,1}$ times to cover all samples in $\mathcal{D}$, but depict only one such iteration here for illustration. \emph{\textbf{Step 2:}} We sub-divide $\mathcal{D_{TRAIN}}$ into $N_{\rm CV,2} = 3$ CV folds. Same as before, $N_{\rm CV,2}-1$ folds are collated while the remaining fold, referred to as the validation set $\mathcal{V}$, is set aside. \emph{\textbf{Step 3:}} Each of the $N_{\rm CV,2}$ CV folds is used to create $N_{\rm bags} = 3$ `bags' by randomly shuffling its data and picking the same number of samples with replacement. An \textsc{NGBoost} model with a given set of hyperparameters is copied over $N_{\rm bags}$ times, and each copy is trained on one `bag' of data. The predictions of all $N_{\rm bags}$ models on $\mathcal{V}$ are recorded and averaged according to Equation \ref{eqn:main_averaging_eqn} to obtain the mean, epistemic, and aleatoric uncertainties for $\mathcal{V}$. \emph{\textbf{Step 4:}} This process is repeated 100 times to find better performing hyperparameters for \textsc{NGBoost}; we refer to thus optimized model as {\sc NGBoost$_{\rm{OPT}}$}. \emph{\textbf{Step 5:}} Finally, we train {\sc NGBoost$_{\rm{OPT}}$} on $\mathcal{D_{TRAIN}}$ and predict the output for $\mathcal{D_{TEST}}$.} \label{fig:mirkwood_pipeline} \end{figure*} \subsection{Uncertainty Quantification}\label{sec:methods_uncertainty} Real observations differ from simulations in a number of ways. \begin{itemize} \item It is rarely the case that observers have access to all filters in a survey for every observed galaxy. For example, one might encounter a situation where they are interested in determining a galaxy's mass from its photometry, but do not have access to $K$ and $H$ band information, thus making their task difficult. \item Different filters have differing sensitivities and noise properties, resulting in non-uniform measurement noises across observation bands. Even in an ideal case where observations in UV, optical and IR are equally robust, there is an irreducible Poisson measurement error. \item While modern hydrodynamical simulations have demonstrated a number of successes, there is an inherent, irreducible \emph{domain gap} between their approximation of reality, and actual reality. Imperfect modeling assumptions both about known physical processes, and arising from our sheer lack of knowledge of them, are primary contributors to this gap. Some specific reasons are modeling star formation with a sub-resolution model, divergence of modeled stellar mass functions from observed ones, and incomplete understanding of AGN feedback processes. \item Any supervised ML algorithm is only as good as the data on which it is trained. It might well be the case that an observed galaxy is in a completely different parameter space than any of the galaxies in our training set. \item Even if some particular model, say \textsc{NGBoost}, with a given set of hyperparameters, is able to faithfully and satisfactorily predict galaxy properties, it is very well possible that there exist other models which can also make predictions that are just as accurate. It is also possible that for our chosen model/set of models, a different data pre-processing scheme, choice of hyperparameters (as mentioned in Section \ref{sec:methods_proposed_method}, the chosen set of hyperparameters is locally optimal but is not guaranteed to be globally optimal), or choice of scheme for balancing classes might result in better predictions. \end{itemize} Owing to these factors, a highly desirable behavior of any predictive model would be to not only return a point prediction (per galaxy property under consideration), but also some quantity conveying the model's belief or confidence in its output \citep{kendall2017uncertainties, choi2018uncertainty}. We can break down such \emph{predictive uncertainty} into two parts--\emph{aleatoric} and \emph{epistemic} \cite{kendall2017uncertainties}\footnote{The word epistemic comes from the Greek ``episteme", meaning ``knowledge"; epistemic uncertainty is ``knowledge uncertainty". Aleatoric comes from the Latin ``aleator", meaning ``dice player"; aleatoric uncertainty is the ``dice player's" uncertainty \citep{gal_thesis}}. Aleatoric uncertainty captures the uncertainty in the data generating process -- for example, measurement noise in filters, or the inherent randomness of a coin flipping experiment. It cannot be reduced by collecting more training data\footnote{We know that a fair coin has a 0.5 probability of landing heads, yet we cannot assert with 100\% certainty the outcome of the next flip, no matter how many times we have already flipped the coin.}; however, it can be reduced by collecting more informative features\footnote{Uncertainty in galaxy mass estimation in the absence of H and K band information can be drastically reduced by collecting high quality data in these bands.}. On the other hand, epistemic uncertainty models the ignorance of the predictive model, and can indeed be explained away given a sufficiently large training dataset\footnote{If we are given a biased coin where we do not know the probability $p$ of turning up heads, we can determine it to arbitrary precision by flipping the coin an arbitrarily large number of times and counting the number of times it turns up heads.}. Aleatoric uncertainty is thus \emph{irreducible} or \emph{statistical}, epistemic being its \emph{reducible} or \emph{systematic} cousin. Aleatoric uncertainty covers first three of the five issues above, while epistemic uncertainty subsumes the last two points. High aleatoric uncertainty can be indicative of noisy measurements or missing informative features, while high epistemic uncertainty could be a clue that the observed galaxy is very different that any of the galaxies the model was trained on (such a galaxy is referred to as being \emph{out of distribution}). As previously discussed, the aim for a supervised ML algorithm is to learn the latent data generating mechanism that maps each input sample $\mathbf{x}_{i}$ to its corresponding output label $y_{i}$. This can be represented as follows \[ y_i=f(\mathbf{x}_i)+\eta_{i} \] where $f(\cdot)$ is the \emph{unknown} latent function and a measurement error $\eta$ follows a standard normal distributions distribution with a variance $\sigma_{\eta,i}^{2},$ i.e., $\eta_i \sim \mathcal{N}\left(\mu=0, \sigma_{\eta,i}^{2}\right)$. The variance of $\eta_i$ corresponds to the aleatoric uncertainty, i.e., $\sigma_{\eta,i}^{2}=\sigma_{a,i}^{2}$ where we will denote $\sigma_{a,i}^{2}$ as aleatoric uncertainty associated with the observation $\mathbf{x}_{i}$. Similarly, epistemic uncertainty will be denoted as $\sigma_{e,i}^{2}$. Since $f(\cdot)$ is unknown, by training on the \emph{training set} the model attempts to approximate, or guess, this function as closely as possible. Suppose that we train $\hat{f}(\mathbf{x})$ to approximate $f(\mathbf{x})$ from the samples in the input data set, $\mathcal{D}$. Then, we can see that \[ \begin{aligned} \mathbb{E}\|y_i-\hat{f}(\mathbf{x}_i)\|^{2} &=\mathbb{E}\|y_i-f(\mathbf{x}_i)+f(\mathbf{x}_i)-\hat{f}(\mathbf{x}_i)\|^{2} \\ &=\mathbb{E}\|y_i-f(\mathbf{x}_i)\|^{2}+\mathbb{E}\|f(\mathbf{x}_i)-\hat{f}(\mathbf{x}_i)\|^{2} \\ &=\sigma_{a,i}^{2}+\sigma_{e,i}^{2}, \end{aligned} \] where $\mathbb{E}\|\cdot\|$ is the expectation operator. This indicates the total predictive variance is the sum of aleatoric uncertainty and epistemic uncertainty. The \textsc{NGBoost} algorithm that forms the backbone of {\sc mirkwood} is naturally able to output both the mean $\mu_i$ and the aleatoric uncertainty $\sigma_{a,i}^2$ for a given observation $\mathbf{x}_i$. To obtain the epistemic uncertainty $\sigma_{e,i}^2$, we use \emph{bootstrapping}. This involves creating multiples copies of the same training dataset, each time picking samples \emph{with replacement}, training the same model on all copies, and averaging the results. The goal is to simulate a scenario where a model only has access to limited samples -- and hence limited parameter space -- and to study how this impacts its predictive ability (see Figure \ref{fig:mirkwood_pipeline}, especially \emph{\textbf{Step 3}}). That is, given an \textsc{NGBoost} model, the predicted label for an observation $\mathbf{x}_{i}$ is represented as: \begin{align*} p(\mathbf{y} \mid \mathbf{x}_{i}) &= \mathcal{N}\left(\mu_{i}, \sigma_{a,i}^2\right), \end{align*} Creating $N_{\rm bags}$ bootstrapped bags essentially creates $N_{\rm bags}$ copies of the above equation. To obtain final summary statistics, we combine them as \begin{align} \hat{\mu}_i {=}\sum_{j=1}^{N_{\rm bags}}\mu_{i,j};\;\hat{\sigma}_{i,a}^2 {=} \sum_{j=1}^{N_{\rm bags}} \sigma_{i,a,j}^{2};\;\hat{\sigma}_{i,e}^2 {=} \sum_{j=1}^{N_{\rm bags}} (\mu_{i,j} {-} \hat{\mu}_i)^2 \label{eqn:main_averaging_eqn} \end{align} The upshot of this exercise is that the errors modeled by {\sc mirkwood} encapsulates both the propagated noise due in the input samples, and the uncertainty arising due to the finite size of the training set. The inclusion of the latter source of uncertainty represents a significant advancement over the current state-of-the-art \citep[e.g.][]{lovell2019learning,acquaviva2015simultaneous}, and helps mitigate the over-confidence in predictions that is typical of machine learning models. \begin{table*} \caption{Summary of machine learning terms and variables appearing in this work.} \label{tab:meaningsofterms} \centering \begin{tabular}{p{0.15\linewidth} p{0.80\linewidth}} \toprule Term & Meaning \\ \tableline \emph{Bagging} & Bootstrapped Aggregation. A technique of building several models at a time by randomly sampling with replacement, or bootstrapping, from the original data set. Each bag may or may not be the same size as the parent training data set. \\ \emph{HPO} & Hyperparameter optimization. The task of finding a well performing set of hyperparameters for any given ML algorithm. \\ \emph{Chaining} & Given multiple outputs of interest (dependent variables), the technique of running the regression model in sequence to exploit correlations among them. \\ \emph{Cross validation} & The task of dividing the training set into non-overlapping `folds' for the purpose of hyperparameter optimization. \\ $\mathcal{D}$ & Input training set comprising of all samples from {\sc Simba}, {\sc Eagle}, and {\sc IllustrisTNG}. Each sample consists of input (independent variables)-output(dependent variables) pairs. \\ $\mathcal{D_{TRAIN}}$ & Training set, derived from $\mathcal{D}$. {\sc mirkwood} is trained on this, and used for inference on $\mathcal{D_{TEST}}$. \\ $\mathcal{D_{TRAIN_{TRAIN}}}$ & Training set, derived from $\mathcal{D_{TRAIN}}$. Used for HPO. \\ $\mathcal{D_{TRAIN_{VAL}}}$ & Validation set, derived from $\mathcal{D_{TRAIN}}$. Used for HPO. \\ $\mathcal{D_{TEST}}$ & Test set. \\ $N_{\rm{CV,1}}$ & Number of CV folds that is used to produce $\mathcal{D_{TRAIN}}$ and $\mathcal{D_{TEST}}$ from $\mathcal{D}$. \\ $N_{\rm{CV,2}}$ & Number of CV folds that is used to produce $\mathcal{D_{TRAIN_{TRAIN}}}$ and $\mathcal{D_{TRAIN_{VAL}}}$ from $\mathcal{D_{TRAIN}}$. \\ $\sigma_{e}$ & Epistemic uncertainty. \\ $\sigma_{a}$ & Aleatoric uncertainty. \\ $f(\cdot)$ & Functional representation of {\sc mirkwood}. This acts on a given input vector $\mathbf{x}$ to produce the output $y$. \\ $\mu$ & The mean of a predicted galaxy property, using one bag of training data. \\ $\hat{\mu}$ & The mean of $\mu$s predicted by all $N_{\rm{bags}}$ bags. \\ \tableline \end{tabular} \end{table*} \subsection{Performance Metrics}\label{sec:methods_metrics} As we have discussed, for each input sample {\sc mirkwood} outputs three values: $\mu$, $\sigma_{a}$, and $\sigma_{e}$. As the same time, for each input, {\sc Prospector} outputs two values: $\mu$, and $\sigma$. We quantify the performance of each model by comparing the predicted galaxy properties against the true ones known from simulations. We divide this task into two parts -- comparing just the predicted mean \emph{deterministic predictions} of each galaxy property with its ground truth value, and judging the quality of the entire predicted PDF (probability distribution function; \emph{probabilistic predictions}) by comparing it against the ground truth value. \subsubsection{Metrics for Deterministic Predictions}\label{sec:metrics_det} For determining the `goodness' of the predicted means for the galaxy properties, we adopt the following three performance criteria: \begin{itemize} \item Normalized root-mean-square error (RMSE): \begin{align*} \mathrm{NRMSE}=\sqrt{\frac{1}{n} \sum_{i=1}^{n}\left(\hat{\mu}(i)-Y(i)\right)^{2}} \end{align*} \item Normalized mean absolute error (NMAE): \begin{align*} \mathrm{NMAE}=\frac{1}{n} \sum_{i=1}^{n}\left|\hat{\mu}(i)-Y(i)\right| \end{align*} \item Normalized bias error: \begin{align*} \mathrm{NBE} = \frac{1}{n} \sum_{i=1}^{n} \hat{\mu}(i)-Y(i) \end{align*} \end{itemize} where $Y(i)$ and $\hat{\mu}(i)$ are the true and predicted values of any of the five galaxy properties for the $i^{th}$ sample, while $n$ is the total number of samples. A perfect prediction would result in NRMSE, NMAE, and NBE of 0. These values can be seen in the top-left plots in Figures \ref{fig:mass} through \ref{fig:sfr}. \subsubsection{Metrics for Probabilistic Predictions}\label{sec:metrics_prob} Probabilistic predictions are assessed by constructing Confidence Intervals (CI) and using them in evaluation criteria. In this work, we adopt average coverage area (ACE) and interval sharpness (IS) as our metrics. $\alpha$ is the significance level -- the probability that one will mistakenly reject the null hypothesis when in fact it is true. Specifically, since in this paper we are interested in $+/- 1\sigma$ predictions (CI=68.2\%), we choose $\alpha = 1-\rm{CI} = 0.318$. For {\sc mirkwood} results, $\sigma = \sqrt{\sigma_{a}^2 + \sigma_{e}^2}$, while for {\sc Prospector} results, there is only one $\sigma$ per prediction. For a given sample $i$, if the prediction of any galaxy property, from either {\sc mirkwood} or {\sc Prospector}, is \{$\mu(i)$; $\sigma(i)$\}, then the lower and upper confidence intervals $L_\alpha(i)$ and $U_\alpha(i)$ are given by $\mu(i) - \sigma(i)$ and $\mu(i) + \sigma(i)$, respectively. $l_\alpha(i)$ and $u_\alpha(i)$ correspond to the $u-$values for these: $l_\alpha(i) = 0.5 - \rm{CI}/2 = 0.159$, $u_\alpha(i) = 0.5 + \rm{CI}/2 = 0.841$. $y(i)$ corresponds to the $u-$value of the ground truth value $Y(i)$. If the predicted mean $\hat{\mu}(i)$ for a galaxy property exactly matches $Y(i)$, then $y_\alpha(i)=0.5$; if the predicted mean overshoots or undershoots the ground truth value, then $y_\alpha(i) > 0.5$ or $y_\alpha(i) < 0.5$, respectively. \begin{itemize} \item Average Coverage Error (ACE): \begin{align*} \mathrm{ACE}_{\alpha}=\frac{1}{n} \sum_{i=1}^{n} c_{\alpha}(i) \times 100 \%-100 \times(1-\alpha) \%, \end{align*} where $c_i$ is the indicative function of coverage: \begin{align*} c_{\alpha}(i)=\left\{\begin{array}{l} 1, Y(i) \in\left[L_{\alpha}(i), U_{\alpha}(i)\right] \\ 0, Y(i) \notin\left[L_{\alpha}(i), U_{\alpha}(i)\right] \end{array}\right. \end{align*} ACE is effectively the ratio of target values falling within the confidence interval to the total number of predicted samples. \item Interval Sharpness (IS): \begin{align*} \mathrm{IS}_{\alpha}=\frac{1}{n} \sum_{t=1}^{n}\left\{\begin{array}{ll} -2 \alpha\Delta_{\alpha}(i)\\-4\left[l_{\alpha}(i)-y(i)\right], & y(i)<l_{\alpha}(t) \\ -2 \alpha\Delta_{\alpha}(i)\\-4\left[y(i)-u_{\alpha}(i)\right], & y(i)>u_{\alpha}(t) \\ -2 \alpha\Delta_{\alpha}(i), & \mathrm{otherwise}\end{array}\right. \end{align*} where $\Delta_{\alpha}(i) = u_{\alpha}(i)-l_{\alpha}(i) = 0.682$. As a reminder, corresponding to $+/- 1\sigma$ intervals, $\alpha=0.318$, $l_{\alpha}(i)=0.159$, and $u_{\alpha}(i)=0.841$. \end{itemize} From the equation of ACE, a value close to zero denotes the high reliability of prediction interval. As an infinitely wide prediction interval is meaningless, IS is another indicator contrary to the coverage rate of interval, which measures the accuracy of probabilistic forecasting. $\mathrm{IS}_{\alpha}$ is always $<0$; a great prediction interval obtains high reliability with a narrow width, which has a small absolute value of IS. \begin{figure*} \centering \includegraphics[width=0.98\textwidth]{mirkwood_chaining.png \caption{Chained multi-output regression. From left to right, we train models to sequentially predict galaxy stellar mass, dust mass, stellar metallicity, and SFR$_{100}$. At the first step, we train {\sc mirkwood} on fluxes (as input) and stellar mass (as output) in the training set $\mathcal{D_{TRAIN}}$, and use it to predict stellar mass for samples in the test set ($\mathcal{D_{TEST}}$) using their respective flux values as inputs. In the second step, we append the true stellar masses of samples in $\mathcal{D_{TRAIN}}$ with their fluxes, and append the predicted stellar masses of the samples in $\mathcal{D_{TEST}}$ to theirs. A new model is then trained on the extended training set, and used to predict dust mass mass for samples in the test set. We continue thus until all five properties have been successfully predicted for all samples in the original $\mathcal{D_{TEST}}$.} \label{fig:chaining} \end{figure*} \section{Results}\label{sec:results} \iffalse \begin{figure* \gridline{\leftfig{z_snr=5_20201108.pdf}{0.48\textwidth}{(a)} \rightfig{Calibration_z_snr=5_20201108.pdf}{0.48\textwidth}{(b)} } \gridline{\leftfig{SHAPz0_z_snr=5_20201108.pdf}{0.48\textwidth}{(c)} \rightfig{SHAPz2_z_snr=5_20201108.pdf}{0.48\textwidth}{(d)} } \gridline{\leftfig{Epis_z0_z_snr=5_20201108.pdf}{0.48\textwidth}{(e)} \rightfig{Epis_z2_z_snr=5_20201108.pdf}{0.48\textwidth}{(f)} } \caption{\red{i don't think we should show this figure, ESPECIALLY first. it does'nt really make any sense in panels (a) and (b). if you watn to show it last you can, but given that we only predict 0 and 2, and i'm not sure prospector can predict either, it doesn't really make sense.}{\bf Performance Characteristics of {\sc mirkwood} SED fitting: Galaxy redshifts.} \textbf{(a,b)} \textbf{Validating predicted means and uncertainties, respectively.} In \textbf{(a)} we see that given a test sample, our model is accurately able to predict the mean redshifts of z=0 and z=2 used in this work. The horizontal orange line in \textbf{(b)} indicates that the predicted errors from {\sc mirkwood} are extremely small/tight, and that our assumption of normal distribution of redshifts is incorrect. \textbf{(c,d)}: \textbf{SHAP summary plots for z=0 and z=2, respectively}. These show the relative importance of each feature in predicting the redshift. For instance, in \textbf{(c)}, flux at 1.49$\mu$m has a high and positive impact on the predicted redshift. \textbf{(e,f)} \textbf{Outlier detection, for z=0 and z=2 respectively.} Epistemic uncertainty (on the y-axis) is high when informative features are sparse in the training set. Here we do not see any trends for $\sigma_{e}$ since there are several equally important bands \label{fig:redshift}} \end{figure*} \fi \begin{figure* \gridline{\leftfig{Mass_snr=5_20201218.pdf}{0.48\textwidth}{(a)} \rightfig{Calibration_Mass_snr=5_20201218.pdf}{0.48\textwidth}{(b)} } \gridline{\leftfig{Hist_Mass_snr=5_20201218.pdf}{0.48\textwidth}{(c)} \rightfig{SHAP_Mass_snr=5_20201218.pdf}{0.48\textwidth}{(d)} } \caption{Comparison of predicted v/s true stellar mass -- in terms of both means and uncertainties -- for samples from the {\sc Simba} simulation. \textbf{(a), (c) Predicted mean stellar mass from {\sc mirkwood} v/s {\sc Prospector}:} We can see both qualitatively and quantitatively (via the three metrics normalized root mean square error, normalized mean absolute error, and normalized bias error) that predictions from {\sc mirkwood} are a significant step-up from traditional SED-based results. As a reminder, the smaller the three metrics, the better the predictions. For clearer visualization, we have used scatter points for results from {\sc mirkwood}, and contour lines for results from {\sc Prospector}. In subplot \textbf{(c)}, we employ histograms to demonstrate the radically different bias and variance in predictions from the two models. \textbf{(b) Predicted aleatoric uncertainty in stellar mass from {\sc mirkwood} v/s {\sc Prospector}:} We compare the predicted aleatoric uncertainty from {\sc mirkwood} with the aleatoric uncertainty from traditional SED fitting. Both qualitatively and quantitatively -- by employing the metrics average coverage error, and interval sharpness -- we see that predictions from {\sc mirkwood} are superior. As explained in Section \ref{sec:metrics_prob}, these probabilistic metrics such as ACE and IS are essential to evaluate predicted uncertainties, something that is outside the purview of traditional deterministic metrics such as those used in subplot \textbf{(a)} and expounded upon in Section \ref{sec:metrics_det}. \textbf{(d) Importance of different bands in predicting stellar mass from {\sc mirkwood}:} SHAP values are a way to obtain contribution of each feature (predictive variable) in predicting a model's output. They measure how reactive the output is to changes in the input, and thus they can be thought of as a type of sensitivity measure; see Section \ref{sec:results} and Appendix \ref{sec:shapley_values} for detailed discussion. Here we see that K and H bands are the most important predictors of stellar mass, with higher flux values (red color) corresponding to higher mass values. \label{fig:mass}} \end{figure*} \begin{figure* \gridline{\leftfig{Dust_snr=5_20201218.pdf}{0.48\textwidth}{(a)} \rightfig{Calibration_Dust_snr=5_20201218.pdf}{0.48\textwidth}{(b)} } \gridline{\leftfig{Hist_Dust_snr=5_20201218.pdf}{0.48\textwidth}{(c)} \rightfig{SHAP_Dust_snr=5_20201218.pdf}{0.48\textwidth}{(d)} } \caption{Very similar to Figure \ref{fig:mass}, this figure compares predicted v/s true dust mass -- in terms of both means and uncertainties -- for samples from the {\sc Simba} simulation. \textbf{(a), (c) Predicted dust mass from {\sc mirkwood} v/s {\sc Prospector}:} Just like in Figure \ref{fig:mass}, we see that predictions from {\sc mirkwood} are a significant step-up from traditional SED-based results. \textbf{(b) Predicted aleatoric uncertainty in dist mass from {\sc mirkwood}:} Unlike in Figure \ref{fig:mass}, we only plot the calibration curve for aleatoric uncertainties from {\sc mirkwood}, since in this work we do not have access to uncertainties in dust mass from {\sc Prospector}. \textbf{(d) Importance of different bands in predicting dust mass from {\sc mirkwood}:} We see that the NIR bands are the most predictive of dust mass, with only a tiny contribution from predicted mass. This tracks with our understanding of dust mass properties. \label{fig:dustmass}} \end{figure*} \begin{figure* \gridline{\leftfig{Z_snr=5_20201218.pdf}{0.48\textwidth}{(a)} \rightfig{Calibration_Z_snr=5_20201218.pdf}{0.48\textwidth}{(b)} } \gridline{\leftfig{Hist_Z_snr=5_20201218.pdf}{0.48\textwidth}{(c)} \rightfig{SHAP_Z_snr=5_20201218.pdf}{0.48\textwidth}{(d)} } \caption{Same as Figures \ref{fig:mass} and \ref{fig:dustmass}, but for instantaneous star formation rate metallicity Z. \label{fig:metallicity}} \end{figure*} \begin{figure*}[!tbp] \gridline{\leftfig{SFR_snr=5_20201218.pdf}{0.48\textwidth}{(a)} \rightfig{Calibration_SFR_snr=5_20201218.pdf}{0.48\textwidth}{(b)} } \gridline{\leftfig{Hist_SFR_snr=5_20201218.pdf}{0.48\textwidth}{(c)} \rightfig{SHAP_SFR_snr=5_20201218.pdf}{0.48\textwidth}{(d)} } \caption{Same as Figures \ref{fig:mass}, \ref{fig:dustmass}, and \ref{fig:metallicity} but for instantaneous star formation rate SFR$_{100}$. \label{fig:sfr}} \end{figure*} \iffalse \begin{figure*}[!htb] \gridline{\fig{Barplot_Mass_snr=5_20201101.pdf}{0.98\textwidth}{(a)}} \gridline{\fig{Barplot_Mass_snr=5_20201101.pdf}{0.98\textwidth}{(b)}} \gridline{\fig{Barplot_Mass_snr=5_20201101.pdf}{0.98\textwidth}{(c)}} \gridline{\fig{Barplot_Mass_snr=5_20201101.pdf}{0.98\textwidth}{(d)}} \caption{b} \label{fig:stackedbarplots} \end{figure*} \fi In order to test our proposed model for SED fitting, we compare against fits from the Bayesian SED fitting software {\sc prospector}. {\sc prospector} and {\sc mirkwood} are given the same information in order to infer galaxy properties. This includes broadband photometry in $35$ bands with 5\%, 10\%, and 20\% Gaussian uncertainties (respectively SNRs = 20, 10, and 5). We present here the results from both methods for several galaxy properties including stellar mass, dust mass, star formation rate averaged over the last 100 Myr (SFR$_{100}$), and stellar metallicity. In Figures \ref{fig:mass} through \ref{fig:sfr}, we present {\sc mirkwood's} predictions when trained on the full dataset comprising of simulations from {\sc Simba}, {\sc Eagle}, and {\sc IllustrisTNG}, for SNR=5\footnote{Corresponding plots for SNR=10 and SNR=20, along with our complete code, are available online at \url{https://github.com/astrogilda/mirkwood}}. The training set contains all 10,073 samples from {\sc IllustrisTNG}, 4,697 samples from {\sc Eagle}, and 359 samples from {\sc Simba} selected by stratified 5-fold cross-validation (see Section \ref{sec:methods_proposed_method} for details on implementation), while the test set contains the remaining 1,438 samples from {\sc Simba}. After making inference on all test splits, we collate the results, thus successfully predicting all four galaxy properties for all 1,797 samples from {\sc Simba}. Each predicted output for a physical property contains three values -- the mean $\mu$, the aleatoric uncertainty $\sigma_{\rm a}$, and the epistemic uncertainty $\sigma_{\rm e}$. The first type of uncertainty quantifies the inherent noise in the data, while the second quantifies the confidence of the model in the training data (see Section \ref{sec:methods_uncertainty} for detailed description). The results from traditional SED fitting are a subset of the total training data We present a brief overview of the data sets in Table \ref{tab:datasetsummary}. In subplots (a) of Figures \ref{fig:mass} through \ref{fig:sfr}, we plot the recovered physical properties from {\sc mirkwood} and {\sc prospector} against the true values from the simulations for each of the four modeled properties: stellar mass, dust mass, metallicity, and star formation rate. In each case, the blue contours represent the physical properties derived from traditional SED fitting, while the orange points denote the results from {\sc mirkwood}. Without exception, {\sc mirkwood} provides superior predictions, as evidenced both by a visual inspection, and via a more quantitative approach by using three different metrics (detailed in Section \ref{sec:methods_metrics}). In subplots(b), we plot `calibration diagrams' \citep{crude_probability_calibration}. On the y-axis are the inverse-CDFs (cumulative distribution functions) for predictions from both {\sc mirkwood} and {\sc Prospector}. These are commonly used in ML literature -- the plotting function takes as input a vector consisting of the ground truth value, predicted mean, and predicted standard deviation, and outputs a value between 0 and 1 (see \cite{probability_calibration1} for detailed instructions on constructing these diagrams). We repeat this for all samples in the test set $\mathcal{D_{TEST}}$, sort the resulting vector in ascending order, and plot the curve on the y-axis. For {\sc mirkwood}, the uncertainty used is $\sigma_{\rm a}$, while {\sc Prospector} does not differentiate between the two types of uncertainties and outputs a single value per galaxy sample. A 1:1 line on this curve indicates a perfectly calibrated set of predictions, with deviations farther from it indicative of poorer calibration. Both visually and quantitatively by using the two probabilistic metric (Section \ref{sec:methods_metrics}) average coverage error and interval sharpness, we ascertain that {\sc mirkwood} outperforms traditional SED fitting. In subplots (c) and (d), we plot the histograms for predicted means, and SHAP summary plots for samples in $\mathcal{D_{TEST}}$, respectively. The histograms in subpolots (c) enable us to visualize both bias and variance in predictions from {\sc mirkwood}, and compare the results to those from {\sc Prospector}. As is readily apparent, both these quantities are significantly smaller for predictions from our ML-based model than from traditional SED fitting, for all four galaxy properties. We explain in detail how SHAP values are calculated in Section \ref{sec:shapley_values}. In brief, for a given filter (dotted vertical lines in subplots (d)), an absolute value farther from 0 denotes a larger impact of that feature in affecting the model outcome. SHAP values can thus be thought of as a type of sensitivity -- it controls how reactive the output is to changes in the input (here flux in the filter). Red and blue indicate high and low ends of values per feature/filter. Thus for a given feature, SHAP values $> 0$ with a red hue indicate that the galaxy property increases as that feature increases. Similarly, SHAP values $> 0$ with a blue hue indicate that the galaxy property decreases as the feature value decreases. As an example, in panel (d) of Figure~\ref{fig:mass}, the largest correlations with the $M^{\star}$ of a galaxy are, quite naturally, the $\sim 1-2 \mu$m range In Table \ref{tab:stackedbartable}, we delineate all five metrics from Section \ref{sec:methods_metrics} to quantitatively compare {\sc mirkwood}'s performance with that of traditional SED fitting, across different levels of noise. As we would expect, the results from both models improve with increasing SNR. Across every metric and galaxy property, {\sc mirkwood} demonstrates excellent performance. We also note that the difference in their relative performances increases with increasing noise level. Below a certain SNR, traditional SED fitting stops producing meaningful results (as can also be seen clearly from subplots (a) in Figures \ref{fig:mass} through \ref{fig:sfr} ), whereas our ML-based approach is still able to extract signal from the noisy data. Finally, in Figures \ref{fig:mass_snr_comparison} through \ref{fig:sfr_snr_comparison}, we demonstrate the impact of different training sets on predictions from {\sc mirkwood}, for all three SNRs of 5, 10, and 20. In all figures, `P' stands for results from {\sc Prospector}, `SET' for results from {\sc mirkwood} when the training dataset contains samples from {\sc IllustrisTNG}, {\sc Eagle}, and {\sc Simba}, `ET' for {\sc Eagle} and {\sc IllustrisTNG}, `T' for only {\sc IllustrisTNG}, `E' for only {\sc Eagle}, and `S' for only {\sc Simba}. For `SET' and `S', we use stratified 5-fold cross validation to select non-overlapping samples from {\sc Simba} in the training set. As expected, we obtain the best predictions, as quantified by various deterministic and probabilistic metrics, when the training set consists of samples from all three simulations. This ensures the most diverse coverage in parameter space, and hence offers the highest generalization power. We also notice that prediction quality improves as the SNR improves, something that one would intuitively expect. \begin{figure* \gridline{\fig{ood_Mass_snr=5_20201218.pdf}{0.88\textwidth}{(a) SNR = 5}} \gridline{\fig{ood_Mass_snr=10_20201218.pdf}{0.88\textwidth}{(b) SNR = 10}} \gridline{\fig{ood_Mass_snr=20_20201218.pdf}{0.88\textwidth}{(c) SNR = 20}} \caption{\textbf{Impact of training set on {\sc mirkwood}'s performance on predicting galactic stellar mass:} Using the three deterministic metrics and two probabilistic metrics introduced in \ref{sec:methods_metrics}, we evaluate the impact that different training sets have on predictions of stellar mass from {\sc mirkwood} on galaxy samples from {\sc Simba}. `P' stands for results from {\sc prospector} (traditional SED fitting), `SET' for training set consisting of all {\sc Simba}, {\sc Eagle}, and {\sc IllustrisTNG}, and so on. The test set is always {\sc Simba}. We separate the aleatoric error from the epistemic uncertainty to provide a more granular visualization. As is apparent, at all noise levels, {\sc mirkwood} outperforms traditional SED fitting. Aleatoric uncertainty is generally the lowest when the training set is as diverse as possible, while epistemic uncertainty is always the lowest when the training set samples are drawn from the same simulation as the test set samples ({\sc Simba}). \label{fig:mass_snr_comparison}} \end{figure*} \begin{figure* \gridline{\fig{ood_Dust_snr=5_20201218.pdf}{0.98\textwidth}{(a) SNR = 5}} \gridline{\fig{ood_Dust_snr=10_20201218.pdf}{0.98\textwidth}{(b) SNR = 10}} \gridline{\fig{ood_Dust_snr=20_20201218.pdf}{0.98\textwidth}{(c) SNR = 20}} \caption{Same as Figure \ref{fig:mass_snr_comparison}, but for dust mass. \label{fig:dustmass_snr_comparison}} \end{figure*} \begin{figure* \gridline{\fig{ood_Z_snr=5_20201218.pdf}{0.98\textwidth}{(a) SNR = 5}} \gridline{\fig{ood_Z_snr=10_20201218.pdf}{0.98\textwidth}{(b) SNR = 10}} \gridline{\fig{ood_Z_snr=20_20201218.pdf}{0.98\textwidth}{(c) SNR = 20}} \caption{Same as Figures \ref{fig:mass_snr_comparison} and \ref{fig:dustmass_snr_comparison}, but for metallicity Z. \label{fig:met_snr_comparison}} \end{figure*} \begin{figure* \gridline{\fig{ood_SFR_snr=5_20201218.pdf}{0.98\textwidth}{(a) SNR = 5}} \gridline{\fig{ood_SFR_snr=10_20201218.pdf}{0.98\textwidth}{(b) SNR = 10}} \gridline{\fig{ood_SFR_snr=20_20201218.pdf}{0.98\textwidth}{(c) SNR = 20}} \caption{Same as Figures \ref{fig:mass_snr_comparison}, \ref{fig:dustmass_snr_comparison} and \ref{fig:met_snr_comparison} but for instantaneous star formation rate SFR$_{100}$.\label{fig:sfr_snr_comparison}} \end{figure*} \section{Discussion and Future Work}\label{sec:discussion} Our work shows that it is possible to reproduce galaxy property measurements with high accuracy in a purely data-driven way by using robust ML algorithms that do not have any knowledge about the physics of galaxy formation or evolution. The biggest caveat here is that the training set must be closely representative of the data of interest, i.e. observations of real galaxies. We also demonstrate the necessity of carefully accounting for both the noise in the data and sparsity of the training set in any given parameter-space of interest. By combining galaxy simulations with disparate physics, we offer a way to better train our model for a real observation. Across all SNRs, we show a considerable improvement over state-of-the-art SED fitting using {\sc Prospector} and non-parametric SFH model, both in terms of prediction quality and compute requirements. For comparison, {\sc mirkwood} ran for $\sim$ 24 hours on the first author's home workstation with 12 cores, to derive all four galaxy parameters for $\sim$ 1700 {\sc SIMBA} galaxies; {\sc prospector} required about the same time, but 3,000 cores on the University of Florida HiPerGator supercomputing system. Another notable result is that we are able to extract accurate galaxy properties from photometries with SNRs as low as 5. All these contributions considered together imply that scientifically interesting galaxy properties can be accurately and quickly measured on future datasets from large-scale photometric surveys. Several avenues for future research remain open. The crux of our follow-up efforts will focus on development of {\sc mirkwood} to a higher level of complexity and precision. We identify the following areas for improvement: \begin{enumerate} \item Extensive hyperparameter optimization: In this work we use {\sc NGBoost} models with hyperparameters only slightly modified from the prescription of \cite{ren2019rongba_ngboost}. This is an easy avenue for gaining performance boost with respect to reconstruction of galaxy properties -- in future work we will leverage modern Bayesian hyperparameter optimization libraries to conduct extensive HPO to eke out maximum performance from our models. \item Managing missing observations: Most real-life observations of all galaxies do not contain observations in the same set of filters, nor is the SNR of the data in each filter the same. Currently, {\sc mirkwood} cannot easily accommodate these complications, since {\rm NGBoost} is unable to natively handle missing feature values. In future work we will explore other boosted tree models, such as {\rm CatBoost} \citep{prokhorenkova2018catboost}, to extract galactic properties from real observations. \item Synergistic spectroscopy: While spectroscopic data are considerably more expensive to obtain, there exist targets where photometry and spectra are available simultaneously \citep{carnall2019vandels}. Modeling both modes of data simultaneously can increase the SNR available to any model, and help significantly in reducing uncertainties in derived galaxy properties, thus enabling accurate re-construction of higher resolution ones such as a galaxy's entire star formation history. We will explore inclusion of a convolutional neural network to this end, similar to the work of \cite{lovell2019learning}. \item Probability calibration: This is a post-processing step that has been shown to improve predictions, measured both by deterministic and probabilistic metrics. ML algorithms are often over-confident, and unable to assess the degree of their fallacy -- if given a completely novel input, most commonly used ML algorithms are likely to predict a wrong label for it, instead of just saying, `I do not know the correct answer.' Probability calibration is widely used in the machine learning community \citep{measuring_calibration_in_deep_learning, probability_calibration1, crude_probability_calibration, lakshminarayanan_probability_calibration0}, albeit its adoption in astronomy has been slow. We expect probability calibration would result in more sensible uncertainties in the second through fourth columns of Figures \ref{fig:mass_snr_comparison} through \ref{fig:sfr_snr_comparison}. Specifically, we expect that calibrated aleatoric, epistemic, and total uncertainties would mean the lowest ACE and IS values for the `SET' column, which is not consistently the case in this paper. \item Randomized chaining: Here we have considered one particular way of chaining galaxy properties: only fluxes are used when predicting stellar mass, fluxes and predicted stellar mass are synergistically used to predict dust mass, and so on all the way till SFR$_{100}$ (see Figure \ref{fig:chaining} for details). However, given the interdependence of all properties, a more justified approach would be to consider multiple such orderings and average the result. For instance, to predict stellar mass, $\rm{model}_1$ will be trained on just the galaxy fluxes, $\rm{model}_2$ on fluxes + metallicity, $\rm{model}_3$ on fluxes + dust mass + SFR$_{100}$, and all such permutations. Finally, the predicted stellar mass results will be averaged. We expect this would average out any biases introduced by chaining in any particular order, and we plan to explore this line of research in more detail. \item Redshifts as both input and output: We plan on expanding the training set considerably by incorporating photometries from galaxies a range of redshifts to enable extraction of properties of real galaxies. In this sense, redshift would be the fifth output variable. On the other hand, it might very well be the case that for a given set of samples, high-confidence spectroscopic redshift is available, but photometry data is present only in a few bands. In such a case, it would be sensible to use redshift as an input rather than an output. We plan on upgrading our network so that {\sc mirkwood} can easily take a redshift as either a fixed input, or take a user-given prior for redshift which it will then aim to improve. \item Semi-supervised learning: In an effort to reduce the `domain gap' -- the difference between the training set(s) and real life data -- several semi-supervised algorithms have been developed and used. These can smoothly combine a computer simulated set of data with high-confidence real life-observations, such as spectra, to more closely approximate reality. \item Outlier detection and elimination: In its current implementation, {\sc mirkwood} is unable to identify and reject outlying inputs. These can result from any of the several data processing pipelines that are used to create scientifically interesting data products can fail and output nonsensical numbers, for example a flux absurdly high as $10^{252}$. This issue becomes even more urgent when dealing with semi-supervised learning, where data from real-life observations form part of the training set. In future we plan on exploring algorithms such as variational auto-encoders \citep{ghosh2016robust_variationalbayesianinference,zellner1988optimal_variationalbayesianinference, gilda2020astronomical_neurips_rvae} to this end. \end{enumerate} \subsection{On SED Modeling Priors and Assumptions} A fundamental aspect of SED modeling is the choice of model for each component (e.g. SFH or dust attenuation) and the subsequent priors used to constrain the models. In this work, we have used {\sc prospector} to fit the synthetic SEDs of galaxies from three cosmological simulations, following the model assumptions outlined in \cite{lower_stellar_mass}. There, the model components, namely the non-parametric SFH, were optimized to result in the best possible estimates for stellar mass, mass-weighted stellar age, and recent SFR for the {\sc simba} simulation at $z=0$. However, it is conceivable that these optimizations do not hold true for {\sc eagle} or {\sc illustris TNG}. For instance, in recent work by \cite{iyer_2020_div_sfh}, the above cosmological simulations produce significantly different SFHs depending on the different subgrid models for, e.g., star formation and stellar feedback, which modulate the short and long-timescale variations of a galaxy's SFH. Thus, using the same SFH model to describe the galaxy SFHs from these simulations may not be justified, but is ultimately outside the scope of this paper to fully tune the SFH models for each simulation. Similarly, in future work, we are working to implement physically motivated priors to further improve the results from traditional SED fitting by including variable dust attenuation curves. One advantage of {\sc mirkwood} in this regard is the freedom from choosing a particular SFH model, dust attenuation law, or set of priors to infer galaxy properties from broadband photometry. Combining the input from three cosmological simulations as a training set for {\sc mirkwood} removes the simplifications of modeling galaxy SEDs with relatively simple analytic functions as in traditional SED modeling. This method of inferring galaxy properties can also overcome the biases that affect traditional SED fitting, such as the outshining of older stellar populations by younger, massive stars which generally causes stellar masses to be under-estimated for star forming galaxies \citep{Papovich_2001_outshining} and the generally poor reconstruction of early SFHs due to the non-uniform sensitivity to variations in star formation as a function of time (i.e.that SED fitting is more sensitive to recent star formation and much information about star formation beyond a few Gyr before the observation is lost) \citep{iyer2019nonparametric}. \subsection{Caveats to the Mirkwood Training Set} Though {\sc mirkwood} is trained on a wealth of data from three moderate volume cosmological simulations, we are not yet free from broad assumptions pertaining to stellar population synthesis modeling. {\sc mirkwood} relies on synthetic galaxy SEDs generated by post-process 3D dust radiative transfer modeling via {\sc hyperion} and {\sc fsps}. In practice, we have assumed a universal initial mass function (IMF) for all galaxies as well as one library of stellar spectra and isochrones. Although this method is similar to traditional SED fitting, our training set is tied to these particular models. To understand the magnitude of importance of these assumptions on inferring galaxy properties, we would need to regenerate the synthetic galaxy SEDs for each combination of IMFs, spectral libraries, and isochrones, representing millions of hours of CPU time in addition to the time required to retrain {\sc mirkwood} on each set of SEDs for each redshift. Given the scale this problem requires, this retraining is ultimately outside the scope of this work. \begin{table*}[!htpb] \caption{Comparative performance of {\sc mirkwood} v/s {\sc Prospector} across different noise regimes. The five metrics are the normalized root mean squared error (NRMSE), normalized mean absolute error (NMAE), normalized bias error (NBE), average coverage error (ACE), and interval sharpness (IS). In any given cell, the tuple of values consists of the metric of interest from {\sc mirkwood} and {\sc Prospector}, respectively. A value of `nan' represents lack of predictions from {\sc Prospector}. We do not have predicted error bars from {\sc Prospector} for dust mass, hence ACE and IS values corresponding to this property are `nan's.} \label{tab:stackedbartable} \centering \begin{tabular}{ccccccc} \toprule & SNR & NRMSE & NMAE & NBE & ACE & IS \\ \tableline & 5 & (\textbf{0.198}, 1.003) & (\textbf{0.123}, 1.091) & (\textbf{-0.042}, -0.528) & \textbf{(-0.002}, -0.497) & (\textbf{0.001}, 0.005) \\ Mass & 10 & (\textbf{0.165}, 1.0) & (\textbf{0.118}, 1.088) & (\textbf{-0.035}, -0.518) & (\textbf{-0.021}, -0.502) & (\textbf{0.001}, 0.004) \\ & 20 & (\textbf{0.155}, 1.002) & (\textbf{0.115}, 1.117) & (\textbf{-0.041}, -0.479) & (\textbf{-0.066}, -0.482) & (\textbf{0.001}, 0.033) \\ \tableline & 5 & (\textbf{0.48}, 0.996) & (\textbf{0.339}, 0.998) & (\textbf{-0.219}, -0.905) & (\textbf{0.003}, nan) & (\textbf{0.001}, nan) \\ Dust Mass & 10 & (\textbf{0.456}, 0.996) & (\textbf{0.332}, 0.998) & (\textbf{-0.209}, -0.905) & (\textbf{-0.033}, nan) & (\textbf{0.001}, nan) \\ & 20 & (\textbf{0.475}, 1.263) & (\textbf{0.336}, 1.212) & (\textbf{-0.215}, -0.679) & (-0.076, nan) & (0.001, nan) \\ \tableline & 5 & (\textbf{0.062}, 0.544) & (\textbf{0.06}, 0.478) & (\textbf{-0.011}, -0.297) & (\textbf{-0.024}, 0.046) & (\textbf{0.041}, 0.301) \\ Metallicity & 10 & (\textbf{0.058}, 0.534) & (\textbf{0.055}, 0.464) & (\textbf{-0.01}, -0.275) & (\textbf{-0.032}, 0.041) & (\textbf{0.036}, 0.295) \\ & 20 & (\textbf{0.056}, 0.547) & (\textbf{0.052}, 0.487) & (\textbf{-0.01}, -0.229) & (\textbf{-0.063}, 0.036) & (\textbf{0.032}, 0.302) \\ \tableline & 5 & (\textbf{0.241}, 0.907) & (\textbf{0.205}, 0.99) & (\textbf{-0.069}, -0.687) & (\textbf{0.074}, -0.557) & (7.314,\textbf{ 0.001}) \\ SFR & 10 & (\textbf{0.329}, 0.91) & (\textbf{0.226}, 0.992) & (\textbf{-0.09}, -0.686) & (\textbf{0.048}, -0.564) & (\textbf{1.937}, 0.001) \\ & 20 & (\textbf{0.277}, 1.988) & (\textbf{0.215}, 2.911) & (\textbf{-0.078}, 1.437) & (\textbf{0.035}, -0.547) & (\textbf{0.006}, 0.2) \\ \tableline \end{tabular} \end{table*} \section*{Acknowledgements} SG is grateful to Dr. Sabine Bellstedt (GAMA collaboration, University of Western Australia) for several fruitful discussions, Prof. Viviana Aquaviva (Department of Physics, CUNY NYC College of Technology) for an in-depth review of the first draft, and Dr. Joshua Speagle (University of Toronto) for his helpful comments. D.N. acknowledges support from the US NSF via grants AST-1715206 and AST-1909153, and from the Space Telescope Science Institute via grant HST-AR15043.001-A. S.L. was funded in part by the NSF via AST-1715206. \section{Proposed Method}\label{sec:methods_proposed_method} \input{proposed_method} \input{uncertainty_quantification} \input{performance_metrics} \section{Local Solutions to Global Problems} Shapley values applied to feature imporance, as described in \S\ref{sec:shapley_values}, are defined as the sequential impact on the model's output of observing each input feature's value, averaged over all possible feature orderings. This means for each of all possible orderings, we introduce features one at a time into a conditional expectation of the model's output, then attribute the change in expectation to the feature that was introduced. In theory, however, Shapley values can be computed using any set function, not just conditional expectations. In this work, we use the SHapley Additive exPlanation (SHAP) python package \cite{shap1} (and associated SHAP values), and note that we are using conditional expectations to measure the impact of a set of features on the model. Specifically, we use a local feature attribution method from the SHAP package called TreeExplainer, which is optimized for use with tree-based machine learning models \citep{shap2}. TreeExplainer bridges theory to practice by reducing the complexity of exact Shapley value computation from exponential to polynomial time. Using TreeExplainer allows us to combine \emph{local explanations}--feature importance for each sample/observation--to provide global insight into a model's behavior. This allows us to retain local faithfulness to the model while still capturing global patterns, resulting in richer, more accurate representations of the model's behavior. Each application presented below illustrates how local explanations can be used as building blocks for explainable machine learning. For all experiments we use an ensemble of five NGBoost models \citep{ngboost} since they natively output both the mean and the uncertainty of a prediction (in addition to supporting fast, exact, local explanations through TreeExplainer). \input{shap_summary_plots} \input{metrics_for_prob_preds} \section{Methodology: {\sc mirkwood} Algorithms} \input{intro_to_ml} \input{proposed_method} \input{uncertainty_quantification} \input{calibration} \input{performance_metrics} \section{Shapley Values}\label{sec:shapley_values} Consider a dataset $\textbf{X}$ with $N$ features and $S$ samples $\textbf{X}=\left\{X^{(1)}_{1:S}, \ldots, X^{(N)}_{1:S}\right\},$ and a continuous, real-valued target variable vector $Y_{1:S}$. Given an instance (observation) $x \in \textbf{X} \in \textsc{R}^{1:N},$ a model $v$ forecasts the target as $v(x)$. In addition to this forecasting, we would also like to know if we can attribute the departure of the prediction $v(x)$ from the average value of the target variable $\bar{y} = \bar{Y}_{1:S}$ to each of the features (predictor variables) in the observed instance $x$? In a linear model, the answer is trivial :$v(x)-\bar{y}=\beta_{1} x^{(1)}+\cdots+\beta_{N} x^{(N)}$ (see Fig ()) [\textbf{INSERT CITATION FOR DE PRADO}]. We would like to do a similar local decomposition for any (non-linear) ML model.\footnote{As explained in \S\ref{sec:introduction} and evident from Figure {}, non-linear models provide much better predictions than linear ones.} Shapley values answer this \emph{attribution} problem through game theory \citep{shapley}. Specifically, they originated with the purpose of resolving the following scenario--a group of differently skilled participants are all \emph{cooperating} with each other for a collective reward; how should this reward be \emph{fairly} divided amongst the group? In the context of machine learning, the participants are the features of our input dataset $\textbf{X}$ and the collective \emph{payout} is the \emph{excess} model prediction (i.e., $v(x) - \bar{y}$). Here, we use Shapley values to calculate how much each individual feature \emph{marginally} contributes to the model output--both for the dataset as a whole (\emph{global explainability}) and for each instance (\emph{local explainability}). While a goal of this paper is to explain the contributions of narrow- and broad-bands to various galaxy properties, for the sake of simplicity we chose to explain Shapley values using a toy example. Let us say that we operate a small hedge fund, and our team consists of three people: \emph{\underline{A}lice}, \emph{\underline{B}ob}, and\emph{\underline{C}arol}. On average, they manage to make approximately \$100,000 everyday ($\bar{y} = 100$ (thousand)). At the end of the year, we would like to distribute bonuses to our team members in direct proportion to their contribution to beating the average daily profit. Let us consider one day in particular, when owing partly to market volatility and partly to luck, today they make \$120,000 (i.e., excess income = 20 (thousand) dollars). Below, we delineate the process of determining each person's fair contribution to this number. \begin{enumerate} \item First, we consider the $2^{N=3}$ possible coalitions (interactions) between the players (features), where some players may not participate (i.e., remain at their average value), and other may participate (depart from their average value). See Table \ref{table:coalitions}. \item Second, we use the coalitions table to compute the marginal contribution of each player conditional on the contribution of every other player. The marginal impact of changing \emph{A} after changing \emph{B} may differ from the marginal impact of changing \emph{B} after changing \emph{A}. Accordingly, we must account for all possible $N! = 6$ sequences of conditional effects. See Table \ref{table:marginal_conditional_contribution}. \item Finally, the \emph{Shapley value} of a player is calculated as the average conditional marginal contribution of that player across all the possible $N!$ ways of conditioning the predictive model $v$. See last row of Table \ref{table:marginal_conditional_contribution} and Equation \ref{eq:shapley_main}. \end{enumerate} \begin{table \centering \begin{tabular}{|c|c|c|c|} \hline $\text{Alice} \neq \overline{\text{Alice}}$ & $\text{Bob} \neq \overline{\text{Bob}}$ & $\text{Carol} \neq \overline{\text{Carol}}$ & $v(...) \left(= v[x \mid \ldots]\right)-\bar{y}$ \\ \hline 0 & 0 & 0 & $v(\varnothing) (= v[x \mid 000])-\bar{y} = 0$ \\ \hline 0 & 0 & 1 & $v(C) (= v[x \mid 001])-\bar{y} = 10$ \\ \hline 0 & 1 & 0 & $v(B) (= v[x \mid 010])-\bar{y} = 5$ \\ \hline 0 & 1 & 1 & $v(B,C) (= v[x \mid 011])-\bar{y} = 7$ \\ \hline 1 & 0 & 0 & $v(A) (= v[x \mid 100])-\bar{y} = 2$ \\ \hline 1 & 0 & 1 & $v(A,C) (= v[x \mid 101])-\bar{y} = 8$ \\ \hline 1 & 1 & 0 & $v(A,B) (= v[x \mid 110])-\bar{y} = 10$ \\ \hline 1 & 1 & 1 & $v(A,B,C) (= v[x \mid 111])-\bar{y} = \textcolor{orange}{20}$ \\ \hline \end{tabular} \caption{In a model with 3 features, there are $2^{3}=8$ possible interactions. For each interaction, we compute the departure of the model's forecast from its baseline (average value). We encode as `1' a feature that is not at its average value (it forms part of a \emph{coalition}), and `0' a feature that is at its average value. Thus $v(A,B)=v(B,A)$, $v(B,C)=v(C,A)$, $v(A,C)=v(C,A)$, and $v(A,B,C)=v(B,A,C)=v(A,C,B)$.} \label{table:coalitions} \end{table} \iffalse An attribution of the departure of a model's prediction, $f[x],$ from its average value, $\bar{y}$ Because addition is commutative, the sequence of the effects does not alter the result. Hence, in a linear model, the attribution is invariant to the sequence of effects. \fi \begin{table \centering \begin{tabular}{|l|l|l|l|l|} \hline Combination & \multicolumn{1}{|c|} {Alice} & \multicolumn{1}{|c|} {Bob} & \multicolumn{1}{|c|} {Carol} & Total \\ \hline $\mathrm{A}, \mathrm{B}, \mathrm{C}$ & $v(\mathrm{A})-v(\varnothing) = 2$ & $v(\mathrm{A}, \mathrm{B})-v(\mathrm{A}) = 8$ & $v(\mathrm{A}, \mathrm{B}, \mathrm{C})-v(\mathrm{A}, \mathrm{B}) = 10$ & \textcolor{orange}{20}\\ \hline $\mathrm{A}, \mathrm{C}, \mathrm{B}$ & $v(\mathrm{A})-v(\varnothing) = 2$ & $v(\mathrm{A}, \mathrm{C}, \mathrm{B})-v(\mathrm{A}, \mathrm{C}) = 12$ & $v(\mathrm{A}, \mathrm{C})-v(\mathrm{A}) = 6$ & \textcolor{orange}{20} \\ \hline $\mathrm{B}, \mathrm{A}, \mathrm{C}$ & $v(\mathrm{B}, \mathrm{A})-v(\mathrm{B}) = 5$ & $v(\mathrm{B})-v(\varnothing) = 5$ & $v(\mathrm{B}, \mathrm{A}, \mathrm{C})-v(\mathrm{B}, \mathrm{A}) = 10$ & \textcolor{orange}{20} \\ \hline $\mathrm{B}, \mathrm{C}, \mathrm{A}$ & $v(\mathrm{B}, \mathrm{C}, \mathrm{A})-v(\mathrm{B}, \mathrm{C}) = 13$ & $v(\mathrm{B})-v(\varnothing) = 5$ & $v(\mathrm{B}, \mathrm{C})-v(\mathrm{B}) = 2$ & \textcolor{orange}{20} \\ \hline $\mathrm{C}, \mathrm{A}, \mathrm{B}$ & $v(\mathrm{C}, \mathrm{A})-v(\mathrm{B}) = 3$ & $v(\mathrm{C}, \mathrm{A}, \mathrm{B})-v(\mathrm{C}, \mathrm{A}) = 12$ & $v(\mathrm{C})-v(\varnothing) = 10$ & \textcolor{orange}{20} \\ \hline $\mathrm{C}, \mathrm{B}, \mathrm{A}$ & $v(\mathrm{C}, \mathrm{B}, \mathrm{A})-v(\mathrm{C}, \mathrm{B}) = 13$ & $v(\mathrm{C}, \mathrm{B})-v(\mathrm{C}) = -3$ & $v(\mathrm{C})-v(\varnothing) = 10$ & \textcolor{orange}{20} \\ \hline Average & $6.3$ & $6.5$ & $8$ & \textcolor{orange}{20} \\ \hline \end{tabular} \caption{In a model with 3 features, there are $3! = 6$ possible sequences. We can use the interactions table to derive the marginal contribution of each feature in each sequence. The Shapley values are the averages per column.} \label{table:marginal_conditional_contribution} \end{table} \iffalse \begin{tabular}{l|l|l|l} \multicolumn{1}{c|} { Sequence } & \multicolumn{1}{c|} {$x^{(1)}$} & \multicolumn{1}{c} {$x^{(2)}$} & \multicolumn{1}{c} {$x^{(3)}$} \\ \hline$x^{(1)}, x^{(2)}, x^{(3)}$ & $f[x \mid 100]$ & $f[x \mid 110]$ & $f[x \mid 111]$ \\ & $-f[x \mid 000]$ & $-f[x \mid 100]$ & $-f[x \mid 110]$ \\ \hline$x^{(1)}, x^{(3)}, x^{(2)}$ & $f[x \mid 100]$ & $f[x \mid 111]$ & $f[x \mid 101]$ \\ & $-f[x \mid 000]$ & $-f[x \mid 101]$ & $-f[x \mid 100]$ \\ \hline$x^{(2)}, x^{(1)}, x^{(3)}$ & $f[x \mid 110]$ & $f[x \mid 010]$ & $f[x \mid 111]$ \\ & $-f[x \mid 010]$ & $-f[x \mid 000]$ & $-f[x \mid 110]$ \\ \hline$x^{(2)}, x^{(3)}, x^{(1)}$ & $f[x \mid 111]$ & $f[x \mid 010]$ & $f[x \mid 011]$ \\ & $-f[x \mid 011]$ & $-f[x \mid 000]$ & $-f[x \mid 010]$ \\ \hline$x^{(3)}, x^{(1)}, x^{(2)}$ & $f[x \mid 101]$ & $f[x \mid 111]$ & $f[x \mid 001]$ \\ & $-f[x \mid 001]$ & $-f[x \mid 101]$ & $-f[x \mid 000]$ \\ \hline$x^{(3)}, x^{(2)}, x^{(1)}$ & $f[x \mid 111]$ & $f[x \mid 011]$ & $f[x \mid 001]$ \\ & $-f[x \mid 011]$ & $-f[x \mid 001]$ & $-f[x \mid 000]$ \end{tabular} \fi \textbf{\underline{Eliminating Redundancy}}: As we can appreciate from the numerical exercise in Tables \ref{table:coalitions} and \ref{table:marginal_conditional_contribution}, some calculations are redundant. For example, the marginal contribution of \emph{C} on sequence \emph{(A, B, C)} must be the same as the marginal contribution of \emph{C} on sequence \emph{(B, A, C)}, because (a) in both cases \emph{C} comes in third position, and (b) the permutations of \emph{(A, B)} do not alter that marginal contribution. The Shapley value of a feature $i$ can be derived as the average contribution of $i$ across all possible coalitions $S$, where $S$ does not include feature $i$: \begin{align}\label{eq:shapley_main} \phi_{i}(v)=\sum_{S \subseteq N \backslash\{i\}} \frac{|S| !(|N|-|S|-1) !}{|N| !}(v(S \cup\{i\})-v(S)) \end{align} The above equation describes a \emph{coalitional game} (the scenario described previously) with a set \textbf{N} of $|\textbf{N}|$ players. The function $v$ gives the value (payout) for any subset of those players. For example, if $S$ be a subset of \textbf{N}, then \emph{v(S)} gives us the value of that subset. Thus for a coalitional game (\textbf{N}, \emph{v}) Equation \ref{eq:shapley_main} outputs the value for feature \emph{i}, i.e. its the Shapley value.\footnote{Equation \ref{eq:shapley_main} computes the exact Shapley values by grouping the marginal conditional contributions in terms of coalitions $(S)$. For large $N,$ \cite{shap1} and \cite{shap2} have developed fast algorithms for the estimation of $\phi_{i}$} For ease of explanation, we focus our attention on calculating how many of the excess $20$ (thousand) dollars can be attributed to \emph{C}(arol), i.e. calculating the Shapley value for \emph{C}. We then examine the various components of Equation \ref{eq:shapley_main} and study their significance. \begin{itemize} \item If we relate this back to the parameters of the Shapley value formula we have \textbf{N}$ = \{A, B, C\}$ and $i = C$. The highlighted section in Equation \ref{eq:shapley_highlight_0} (derived from Equation \ref{eq:shapley_main} by re-arranging some terms) says that we need to take our group of people and exclude the person that we are focusing on now. Then, we need to consider all of the possible subsets that can be formed. So if we exclude \emph{C} from the group we are left with \emph{{A, B}}. From this remaining group we can form the following subsets (i.e. these are the sets that \emph{S} can take on): $\varnothing, A, B, AB$. In total, we can construct four unique subsets from the remaining team members, including the null set. \begin{align}\label{eq:shapley_highlight_0} \phi_{i}(v)=\frac{1}{|N|} \sum_{\textcolor{orange}{S \subseteq N \backslash\{i\}}}\left(\begin{array}{c} |N|-1 \\ |S| \end{array}\right)^{-1}(v(S \cup\{i\})-v(S)) \end{align} \item Next, we focus on the highlighted term in Equation \ref{eq:shapley_highlight_1}. \begin{align}\label{eq:shapley_highlight_1} \phi_{i}(v)=\frac{1}{|N|} \sum_{S \subseteq N \backslash\{i\}}\left(\begin{array}{c} |N|-1 \\ |S| \end{array}\right)^{-1}\textcolor{orange}{(v(S \cup\{i\})-v(S))} \end{align} This refers to the \emph{marginal value} of adding player $i$ to the game. Specifically, we want to see the difference in the money earned daily if we add $C$ to each of our four subsets. We denote these four marginal values as: $\Delta v_{C, \varnothing}, \Delta v_{AC, A}, \Delta v_{BC, B}, \Delta v_{A B C, A B}$. Each of these as a different scenario that we need to observe in order to fairly assess how much \emph{C} contributes to the overall profit. This means that we need to observe how much excess money is produced if everyone is working at their average levels (i.e. the empty set $\varnothing$) and compare it to what happens if we only have \emph{C} working at above or below-average productivity. We also need to observe how much profit is earned by \emph{A} and \emph{B} working simultaneously and compare that to the profit earned by \emph{A} and \emph{B} together with \emph{C}, and so on. \item Next, the summation in the Shapley value equation is telling us that we need to add all them together. However, we also need to scale each marginal value before we do that, which we are provided this prescription by the highlighted part in Equation \ref{eq:shapley_highlight_2}. \begin{align}\label{eq:shapley_highlight_2} \phi_{i}(v)=\frac{1}{|N|} \sum_{S \subseteq N \backslash\{i\}}\textcolor{orange}{\left(\begin{array}{c} |N|-1 \\ |S| \end{array}\right)^{-1}}(v(S \cup\{i\})-v(S)) \end{align} It calculates how many permutations of each subset \emph{size} we can have when constructing it out of all remaining team members excluding feature (player) \emph{i}. In other words, given \textbf{$\lvert$N$\rvert$-1} features (players), how many groups of size \textbf{$\lvert$S$\rvert$} can one form with them? We then use this number to divide the marginal contribution of feature (player) $i$ to all groups of size \textbf{$\lvert$S$\rvert$}. For our scenario, we have that \textbf{$\lvert$N$\rvert$-1 = 2}, i.e. these are the remaining team members when we are left with when calculating the Shapley value for \emph{C}. In our case we will use that part of the equation to calculate how many groups we can form of size 0, 1, and 2, since those are only group sizes we can construct with the remaining players. So, for example, if we have that \textbf{$\lvert$S$\rvert$ = 1} then we get that we can construct 2 different groups of this size: \emph{A} and \emph{B}. This means that we should apply the following scaling factors to each of our 4 marginal values: $1\Delta v_{C, \varnothing}, \frac{1}{2}\Delta v_{A C, A}, \frac{1}{2}\Delta v_{B C, B}, 1\Delta v_{A B C, A B}$. By adding this scaling factor we are \emph{averaging out} the effect that the rest of the team members have for each subset size. This means that we are able to capture the \emph{average} marginal contribution of \emph{C} when added to a team of size 0, 1, and 2 \emph{regardless} of the composition of these teams. \item Next, we focus on the remaining term, highlighted in Equation \ref{eq:shapley_highlight_3}. \begin{align}\label{eq:shapley_highlight_3} \phi_{i}(v)=\textcolor{orange}{\frac{1}{|N|}} \sum_{S \subseteq N \backslash\{i\}}\left(\begin{array}{c} |N|-1 \\ |S| \end{array}\right)^{-1}(v(S \cup\{i\})-v(S)) \end{align} So far we have averaged out the effects of the other team members for each subset size, allowing us to express how much \emph{C} contributes to groups of size 0, 1, and 2. The final piece of the puzzle is to \emph{average out} the effect of the group size as well, i.e. how much does \emph{C} contribute \emph{regardless} of the size of the team (number of explanatory features in the data set). For our scenario we do this by dividing with 3 since that is the number of different group sizes that we can consider. With this final step, we arrive at the point where can finally compute the Shapley value for \emph{C}. We have observed how much she marginally contributes to all different coalitions the team that can be formed. We have also averaged out the effects of both team member composition as well as team size which finally allows us to compute the Shapley value for \emph{C}: \begin{align}\label{eq:shapley_final} \phi_{C}(v) &= \frac{1}{3} \sum\left(1\Delta v_{C, \varnothing}, \frac{1}{2} \Delta v_{A C, A}, \frac{1}{2} \Delta v_{B C, B}, 1\Delta v_{ABC, AB}\right) \nonumber \\ &= \frac{1}{3} \sum\left(1\times 10, \frac{1}{2} \times 6, \frac{1}{2} \times 2, 1\times 10\right) \nonumber \\ &= 8 \end{align} Comparing Equation \ref{eq:shapley_final} with the Shapley value for \emph{C} in the last row of Table \ref{table:marginal_conditional_contribution}, we see that they match exactly. \end{itemize} After calculating the Shapley values for the rest of the players, we can then determine their individual contributions to the excess 20 (thousand) dollars earned today, allowing us to fairly divide the bonus amongst all team members: \begin{align} 20 &=v(\{A, B, C\}) \nonumber \\ &=\phi_{A}(v)+\phi_{B}(v)+\phi_{C}(v) \end{align} This is also evident from the last row of Table \ref{table:marginal_conditional_contribution}, where the Shapley values for \emph{A}, \emph{B}, and \emph{C} add to the total of 20. \textbf{\underline{Properties}}: As they apply to local explanations of predictions from machine learning models, Shapley values have some nice uniqueness guarantees \citep{shapley}. As described above, Shapley values are computed by introducing each feature, one at at time, into a conditional expectation function of the model's output, $v_{x}(S) \approx E[v(x) | x_{S}]$, and attributing the change produced at each step to the feature that was introduced; then averaging this process over all possible feature orderings. Shapley values are provably the only possible method in the broad class of \emph{additive feature attribution methods} \cite{shap1} that simultaneously satisfy four important properties of \emph{fair} credit-attribution: \emph{efficiency}, \emph{symmetry}, \emph{missingness}, and \emph{additivity}. \begin{enumerate} \item \emph{Efficiency/ Local Accuracy}: The sum of the Shapley values of all features (players) equals the value of the total coalition. That is, the value of $20$ in the bottom-rightmost corner in Table \ref{table:coalitions} is the same as the $20$ in the bottom-rightmost cell in Table \ref{table:marginal_conditional_contribution}. \item \emph{Missingness}: If a feature (player) never adds any marginal value regardless of the coalition, its payoff (Shapley value $\phi_{i}(v)$) is 0. That is, if: $v(S \cup \{i\}) = v(S) \forall $ subsets of features \emph{S}, then $\phi_{i}(f) = 0$. \item \emph{Symmetry}: All players have a fair chance to join the game. That’s why Table \ref{table:coalitions} lists all the permutations of the players. If two players always add the same marginal value to any subset to which they are added, their payoff portion should be the same. In other words, $\phi_{i} = \phi_{j}$ IIF feature \emph{i} and feature \emph{j} contribute equally to all possible coalitions. \item \emph{Additivity}: A function with combined outputs has as Shapley values the sum of the constituent ones. For any pair of games $v, w$, $\phi(v+w) = \phi(v)+\phi(w)$, where $(v+w)(S)=v(S)+w(S) \forall S$. This property allows us to combine Shapley values from $n$ different models, thus enabling interpretability for ensembles. \end{enumerate} \iffalse \textbf{\underline{Interaction Effects}}: An interaction effect occurs when the effect of one variable on the output depends on the value of another variable. The estimation of interaction effects requires having an accurate attribution of the individual effect of the variables involved. This makes Shapley values particularly useful for estimating these. For $i \neq j$: \begin{align} \phi_{i, j}=\sum_{S \subseteq(X \backslash\{i, j\})} \frac{|S| !(|N|-|S|-2) !}{2(|N|-1) !} \delta_{i, j}(S), \nonumber \\ \delta_{i, j}(S)=v(S \cup\{i, j\})-v(S \cup\{i\})-v(S \cup\{j\})+v(S) \end{align} \fi \iffalse Lloyd Shapley came up with this solution concept for a cooperative game in 1953. Shapley wants to calculate the contribution of each player in a coalition game. Assume there are N players and S is a subset of the N players. Let v(S) be the total value of the S players. When player i join the S players, Player i’s marginal contribution is v(S union {i})- v(S). If we take the average of the contribution over the possible different permutations in which the coalition can be formed, we get the right contribution of player i: \fi \iffalse \begin{align} \phi_{i}(v)=\frac{1}{|N|} \sum_{S \subseteq N \backslash\{i\}}\left(\begin{array}{c} |N|-1 \\ |S| \end{array}\right)^{-1}(v(S \cup\{i\})-v(S)) \end{align} \fi This plot is made of all the dots in the train data. It demonstrates the following information: Feature importance: Variables are ranked in descending order. Impact: The horizontal location shows whether the effect of that value is associated with a higher or lower prediction. Original value: Color shows whether that variable is high (in red) or low (in blue) for that observation. Correlation: A high level of the `alcohol' content has a high and positive impact on the quality rating. The `high' comes from the red color, and the `positive' impact is shown on the X-axis. Similarly, we will say the `volatile acidity' is negatively correlated with the target variable. \subsection{Machine Learning and SED Fitting}\label{sec:related_work} To explore the complex and degenerate parameter space more efficiently, machine learning (ML) has emerged as an alternative tool for deriving the physical parameters of galaxies. Unlike traditional SED fitting procedures, including those utilizing novel non-parametric SFH priors, ML algorithms are able to directly learn the relationships between the input observations (either photometric of spectroscopic) and the galaxy properties of interest without the need for human-specified priors. With ML, the priors themselves become learnable. This is possible because ML algorithms learn from the entire population ensemble, learning not just the mapping between individual galaxy observations and physical properties, but also the distribution of properties \cite{lovell2019learning}) trained convolutional neural networks (CNNs, \cite{krizhevsky2012imagenet_cnn}) to learn the relationship between synthetic galaxy spectra and high resolution SFHs from the \textsc{EAGLE} \citep{schaye_2015_eagle} and \textsc{Illustris} \citep{vogelsberger2014introducingillustris} simulations. \cite{stensbo2017sacrificing} estimated specific star formation rates (sSFRs) and redshifts using broad-band photometry from SDSS (Sloan Digital Sky Survey, \cite{sdss_eisenstein2011}). \cite{surana2020predicting} used CNNs with multiband flux measurements from the GAMA (Galaxy and Mass Assembly, \cite{gama_driver2009}) survey to predict galaxy stellar mass, star formation rate, and dust luminosity. \cite{simet2019comparison} used neural networks trained on semi-analytic catalogs tuned to the CANDELS (Cosmic Assembly Near-infrared Deep Extragalactic Legacy Survey, \cite{grogin2011candels}) survey to predict stellar mass, metallicity, and average star formation rate. Owing to their superior ability in capturing non-linearity in data, ML-based models have seen applications in almost every field of astronomical study, including identification of supernovae \citep{disanto2016}, classification of galaxy images \citep{ml_morphology0,ml_morphology1, hausen2020morpheus,ciprijanovic2020deepmerge,barchi2020machine}, and categorization of signals observed in a radio SETI experiment \citep{harp2019}. With the exponential growth of astronomical datasets, ML based models are slowly becoming an integral part of all major data processing pipelines \citep{siemiginowska2019astro2020}. \cite{baron2019machine} provides a comprehensive and current overview of the application of machine learning methodologies to astronomical problems. \subsection{This Paper} In this paper we introduce \textsc{mirkwood}, a fully ML-based tool for deriving galaxy physical parameters from multi-band photometry, while robustly accounting for various sources of uncertainty. We compare {\sc mirkwood}'s performance with that of the current state-of-the-art Bayesian SED fitting tool \textsc{Prospector}, by using data from galaxy formation simulations for which we have ground-truth values\footnote{While one could consider using observed photometric data of real galaxies instead, a glaring lack of well-defined ground truth physical parameters -- independent of any inference tool employed -- would make comparisons between results from \textsc{mirkwood} and any traditional SED fitting code difficult. }. To do this, we first create mock SEDs from three different cosmological hydrodynamical simulations (via the procedure discussed in detail in Section \ref{sec:data} and illustrated in Figure \ref{fig:pd_sed}) -- \textsc{Simba}, \textsc{EAGLE}, and \textsc{IllustrisTNG}. We then fit GALEX, HST, Spitzer, Herschel, and JWST photometry of these mock SEDs to extract stellar masses, dust masses, stellar metallicities, and instantaneous SFRs (defined as the mean SFR in the past 100 Myrs from the time of observation) using the publicly available SED fitting software {\sc Prospector} \citep{leja_deriving_2017} with the state-of-the-art non-parametric SFH model from \cite{leja_deriving_2017, leja2019a} (Section \ref{sec:data}). We repeat this exercise using \textsc{mirkwood}, and compare both sets of derived galaxy properties to their true values from simulations. The rest of this paper is organized as follows. In Section \ref{sec:data} we describe both our data and the traditional SED fitting technique in significant detail, including the three hydrodynamical simulations (Section \ref{sec:data_sims}), the method to select galaxies of interest from these simulations (Section \ref{sec:data_galaxyselection}), the dust radiative transfer process used to create SEDs (Section \ref{sec:data_radiativetransfer}), and finally the Bayesian code used to fit these SEDs to derive galaxy properties (Section \ref{sec:data_prospector}). In Section \ref{sec:methods_proposed_method} we describe in detail the SED modeling procedure using our proposed model \textsc{mirkwood}. We describe how \textsc{mirkwood} robustly estimates uncertainties in its predictions (uncertainty quantification, Section \ref{sec:methods_uncertainty}), and introduce metrics to quantify performance gains with respect to traditional SED fitting (Section \ref{sec:methods_metrics}). In Section \ref{sec:results}, we investigate the improvement in the determination of the four galaxy properties. Finally, in Section \ref{sec:discussion} we summarize our findings, and suggest possible improvements to both the proposed model and to areas of application. Throughout we assume a Planck 2013 cosmology with the following parameters: $\Omega_m = 0.30$, $\Omega_\lambda = 0.70$, $\Omega_b = 0.048$, $h = 0.68$, $\sigma_8 = 0.82$, and $n_s = 0.97$. \iffalse As we emphasize in Section \ref{sec:introduction}, one of the more dominant yet poorly constrained components of SED fitting is the assumed form of the star formation history (SFH). The most common models for SFHs are parameterized by a simple functional form, and the parameters varied in the SED fit describe that functional form. Hereafter, we refer to these as “parametric” star formation histories. Examples include the τ and delayed-τ models, which model the SFH as exponentially declining with some characteristic e-folding time. Although these models are computationally efficient and match the SFHs of galaxies in a closed box with constant star formation efficiency, the restricted nature of the functional forms does not match the diversity of true galaxy SFHs (Gallagher et al. 1984; Sandage 1986; Lee et al. 2009; Oemler et al. 2013; Simha et al. 2014; Diemer et al. 2017). The assumed SFH and associated priors can also strongly impact the inferred physical properties of galaxies (Simha et al. 2014; Iyer & Gawiser 2017; Salmon et al. 2015; Carnall et al. 2019). For instance, Curtis-Lake et al. (2020) found that the SFR-M∗ relation is sensitive to the priors used in the delayed-τ SFH employed in SED modeling. Michaowski et al. (2012) found that the assumed star formation history model had the largest impact out of all other SED model components on the stellar masses inferred for observations of sub-millimeter galaxies (SMGs). Similarly Dudzeviit et al. (2019) found that the average difference between the stellar masses predicted by the magphys SED model and the true stellar masses for galaxies from the eagle cosmological simulation was close to 0.5 dex. This bias, attributed to the assumed SFH module, is consistent with the earlier results of Michaowski et al. (2012). Parametric SFHs with more complexity have also been explored in the literature (e.g. Pacifici et al. 2012; Simha et al. 2014; Ciesla et al. 2017). An example is a lognormal parametrization, which has been shown to reproduce the evolution of the cosmic star formation rate history (Gladders et al. 2013) and provide a reasonable match to the Illustris galaxy SFHs (Diemer et al. 2017). However, as shown in Carnall et al. (2019) and Leja et al. (2019a), the log-normal parameterization still suffers from similar stellar age biases as the simpler parametric forms. This happens because the SFH is constrained to either have recent star formation or have a population of old stars (Leja et al. 2019a) – a consequence of the rigid exponential functional form. Moreover, Diemer et al. (2017) fit a log-normal SFH directly to the SFHs of the Illustris galaxies instead of via SED modeling where all galaxy properties must be inferred simulatenously, thus biases such as outshining (Papovich et al. 2001) did not affect the fit. Recently, a series of models employing nonparametric forms for galaxy SFHs in SED modeling have been developed in an attempt to minimize the effect of these systematic biases. These nonparametric SFH models have been shown to have the flexibility to reasonably reproduce the variation in SFHs seen in observations and galaxy formation simulations. Some nonparametric SFHs are modeled as a function of families of SFHs that effectively cover the space of all physical SFHs, as developed in Iyer & Gawiser (2017) with the Dense Basis method and improved upon in Iyer et al. (2019) which employs Gaussian Processes rather than parametric SFH families. Other methods model the SFH of a galaxy as a piece-wise function with multiple bins of constant star formation rate. Examples of this type include moped (Reichardt et al. 2001); vespa (Tojeiro et al. 2007); and propsector (Johnson et al. 2019; Leja et al. 2017; Leja et al. 2019a); as well as the SFH models for the Carnegie-Spitzer-IMACS survey (Kelson 2014; Dressler et al. 2016); and grism as used in Morishita et al. (2019). While the aforementioned authors explored the impact of nonparametric star formation histories on observational data sets, the method is yet to be groundtruthed against the true stellar mass of the galaxy. Previous studies, including Leja et al. (2019a), have focused on simple tests of efficacy such as understanding how both nonparametric and traditional parametric SFH models behave when SFH assumptions of the model are violated. Leja et al. (2019b) demonstrated that galaxies selected from the 3D-HST photometry catalog (Skelton et al. 2014) were inferred systematically more massive and older when modeled with nonparametric SFHs in prospector compared to previously published results using parametric SFHs. Comparisons between simulated galaxy properties and the results inferred using SED modeling have primarily been limited by simulation technique or sample size (e.g. Finlator et al. 2007; Hayward & Smith 2015). Iyer & Gawiser (2017) compared results using the Dense Basis method for galaxies from a semi-analytic model (SAM) and a hydrodynamic simulation and found reasonable agreement but did not compare results to SED fits using a simpler parametric model. The two can be broadly divided into two themes -- using non-parametric formalisms of star formation history, and using machine learning models to replace traditional SED fitting entirely. Deep learning networks generally perform very well in capturing the non linearity in data. Convolutional neural network (CNN), a special type of deep learning network, is now witnessing an explosion of applications in various fields of research, including astronomy. Within the last two years, CNNs have been successfully applied for the classification of galaxy and radio galaxy images in Barchi et al. (2019) and Lukic et al. (2018) respectively. CNNs have also been used in categorization of signals observed in a radio SETI experiment (Harp et al. 2019). Lovell et al. (2019) have also trained CNNs to learn the relationship between synthetic galaxy spectra and high resolution SFHs from the EAGLE (Schaye et al. 2015) and Illustris (Vogelsberger et al. 2014) simulations. Deep learning has been successfully applied in astronomy to classification problems. Zhang & Zhao (2006) used Bayesian Belief Networks (BBN), Multilayer Perceptron (MLP) networks and Alternating Decision trees (ADtree) for separating quasars from stars. Abraham et al. (2012) have used a machine learning classifier trained on a subset of spectroscopically confirmed objects, classifying them into stars, galaxies and quasars. D’Isanto et al. (2016) provide a comparison of various machine learning methods for tasks such as identification of cataclysmic variables, separation between galactic and extragalactic objects and identification of supernovae. Brescia et al. (2015) used MLP with Quasi Newton Algorithm to characterize the physical nature of the large number of objects observed by modern multiband digital surveys. Similarly, deep learning has also been successfully used to build regression models. For example, Guill´en et al. (2019) have used deep neural networks for the estimation of the muon content of extensive air showers when measured on the ground. Pearson et al. (2019) have implemented deep learning CNNs for estimating strong gravitational lens mass model parameters. From the diversity of applications mentioned above, it is clear that deep learning approaches have proven useful in tackling a number of astronomical problems. In this work, we attempt to reproduce the capabilities of stellar population synthesis (SPS) models (see Conroy (2013) for a comprehensive review) via a deep learning approach. SPS models combine our understanding of the properties of stars as traced by stellar evolution and star formation histories. The spectral energy distribution of a stellar population in a galaxy is modulated by the presence of dust which tends to absorb or scatter stellar photons at short wavelengths. SPS models are physically well motivated and encapsulate a vast and ever growing literature that provides us with ever more sophisticated models. The complexity and sophistication of such modeling comes at a price - finding the best model within the vast parameter space (consisting of millions of possible models) is a compute intensive process. A machine learning approach holds the promise of leaving the building of this complex non-linear model to a machine suitably trained with a large dataset of examples. In this work, we train a deep learning model to predict what are perhaps the three most basic parameters that are used to characterise the star formation process in galaxies - the current star formation rate (SFR), dust luminosity (DL) and stellar mass (SM). SM is a rough proxy for the integrated star formation in a galaxy throughout its history while the dust luminosity is a measure of the amount of dust in the galaxy. The data we use are from the GAMA (Galaxy And Mass Assembly; Driver et al. (2011)) survey. At its core, GAMA is a spectroscopic survey of ∼300,000 galaxies down to r < 19.8 mag over ∼ 286 deg2, which was carried out using the AAOmega multi-object spectrograph on the AngloAustralian Telescope (AAT). The core spectroscopic survey has been greatly augmented by multiwavelength observations of the GAMA fields with a wide variety of telescopes. We use the GAMA survey Panchromatic Data Release (PDR) catalog (Driver et al. 2016) which includes fluxes in upto 21 broadband filters for 120,114 galaxies. For each galaxy the catalog includes position information (RA/Dec), 21 band flux values along with individual errors, a spectroscopic redshift and stellar mass, star formation rate and dust luminosity. The last three parameters are determined using a stellar population synthesis code viz. magphys. This is one of the most widely used SED fitting codes which has been successfully applied on galaxy samples spannig a wide range of galaxy stellar masses, star formation rates and morphological types (e.g., da Cunha et al. 2010; Berta et al. 2013; Viaene et al. 2014; Chang et al. 2015; Driver et al. 2016; Bait et al. 2017; Driver et al. 2018). Our deep learning models are thus limited by the weaknesses of magphys (for instance, the active galactic nuclei’s contribution to the SED is not modeled in this code). In regions of parameter space where magphys is a poor model of the underlying physical reality, our deep learning model will also be a poor representation of the physical reality. Keeping this caveat in mind, we will proceed with our modeling. For constructing our deep learning model, we used the 21 band data consisting of far ultra-violet (UV) and near UV (from GALEX), the five Sloan Digital Sky Survey bands: ugriz, near infrared bands: X, Y, J, H, K, WISE mid-infrared bands: W1, W2, W3, W4, and the five Herschel bands: P100, P160, S250, S350, S500. The spectroscopic redshift listed in the PDR catalog is used as an additional input parameter for our model. In Section 2, we introduce the deep learning algorithm and the data preprocessing we have carried out. In Section 3, we describe and discuss our results and we conclude in Section 4. The ML techniques are only applicable within the limits of the training data. Any extrapolation of them to a different redshift or mass regime would lead to errors in the final estimate. However, a distinct advantage of ML is that one could incorporate extra information (i.e. morphology, galaxy light profile) within the algorithm. The ML techniques are divided into two categories: supervised and unsupervised. In supervised ML, the input attributes (magnitudes and colors) are provided along with the output (redshift) and directly used for training in the learning process (Lima et al. 2008; Freeman et al. 2009; Gerdes et al. 2010). Here, the learning process is supervised by the input parameters. The unsupervised techniques do not use the desired output values (e.g. spectroscopic redshifts) during the training with only the input attributes used. Due to its limitations, this is not frequently used. We expect that this method will carry systematic uncertainties that are independent of those from SED fitting, so that our results will complement and strengthen the results of these approaches. Another strength of a machine learning-based approach is that the algorithm learns from the population ensemble, learning not only the correspondence between individual spectra and star formation histories, but also which star formation histories are common and which are unlikely, something that would be analogous in Bayesian parameter estimation to learning the SFH prior. The use of ML methods has so far been limited mainly to measuring photometric redshifts of galaxies. This is because the ML algorithms can be more easily trained using the spectroscopic redshifts whereas for other parameters such true and unambiguous estimates are hard to obtain. Detailed comparisons have been performed between different methods and algorithms measuring photometric redshifts (Carrasco Kind & Brunner 2013; Dahlen et al. 2013) and masses (Mobasher et al. 2015) of galaxies. However, except in a few cases where ML techniques are used (MCC and neural net) these were mostly based on different variants of template fitting using observed or model SEDs. In particular, very few studies have performed a comparison of different ML techniques. A recent study has used Bayesian combination of photometric redshift Probability Density Functions (PDFs) using different ML methods to improve estimates of photometric redshifts (Carrasco Kind & Brunner 2014). However, no such study has been performed for other physical parameters of galaxies. In this paper we use different ML techniques to measure the stellar mass and star formation rates of galaxies with available photometric data and photometric redshifts using a training set of semianalytic galaxies from (Lu et al. 2014). The test sample in this study is from the Hubble Space Telescope (HST) Cosmic Assembly Near-infrared Deep Legacy Survey (CANDELS) GOODS-South field. This has imaging data in optical (ACS) and near-infrared (WFC3) wavelengths as well as Spitzer Space Telescope mid-infrared (IRAC) bands. We describe the CANDELS data and semianalytic galaxies in section 2, give an overview of the neural network ML algorithm we use in section 3, test our neural networks with a semianalytic test set in section 4, and finally apply our networks to CANDELS data in section 5, with summary and conclusions in section 6. Throughout the paper, we assume the cosmology of the simulation used to generate the mock catalog and semianalytic galaxies: ΩM = 0.27, ΩΛ = 0.73, Ωb = 0.044, h = 0.7, n = 0.95, and σ8 = 0.82. Here we propose an alternative approach, using supervised machine learning algorithms to ‘learn’ the relationship between the SFH and the SEDs of galaxies. In contrast with SED fitting, where the SFH is built from some ensemble of simple stellar populations to maximise the resemblance in SED space, machine learning directly learns the relationship between the spectra and the entire SFH. We expect that this method will carry systematic uncertainties that are independent of those from SED fitting, so that our results will complement and strengthen the results of these approaches. Another strength of a machine learning-based approach is that the algorithm learns from the population ensemble, learning not only the correspondence between individual spectra and star formation histories, but also which star formation histories are common and which are unlikely, something that would be analogous in Bayesian parameter estimation to learning the SFH prior. A number of recent studies have explored the effect of priors on derived SFHs in SED fitting approaches. Carnall et al. (2019) showed that parametric approaches implicitly impose a strong prior on the SFH that can lead to unrealistically tight posterior constraints on the SFR, and Leja et al. (2019) showed that even non-parametric fits are sensitive to the prior SFH distribution, particularly where the data are poor. Pacifici et al. (2013) proposed using SFHs from a semi-analytic model to generate a library of SEDs to be used in an SED fitting algorithm, and found that these simulation-motivated templates prefer symmetric or rising SFHs at intermediate redshifts (0.2 < z < 1.4), compared to the exponentially declining forms predicted using simple stellar populations. Finally, Wilkins et al. (2013a) show that using simulation-motivated enrichment and starformation histories leads to more accurate stellar mass estimates from colour information only. These studies highlight the importance of the explicitly or implicitly assumed prior distribution of SFHs. Machine learning methods are becoming an increasingly popular tool for Astronomers (Ball & Brunner 2010; Baron 2019). This is particularly the case where there is abundant low quality data for which expensive, higher quality data can be obtained and used for supervised training. However, a supervised machine learning algorithm is only as good as its learning sample. The main challenges to applying these techniques to measure properties such as star formation histories have been the following: assembling a sample of galaxies for which the “true” star formation history is known; and making sure that properties of the ensemble (the distribution of properties and their relationship to one another) are a fair snapshot of the real Universe. However, there has been significant recent progress from multiple independent teams on high-resolution cosmological models of galaxy evolution, which has for the first time provided the potential to test this technique (e.g. Simet et al. 2019). Hydrodynamic cosmological simulations in particular are able to resolve stellar populations, producing realistic, high resolution SFHs by taking into account a number of effects, such as environmental interactions, mergers, and stellar and AGN feedback (Somerville & Dav´e 2015). EAGLE (Schaye et al. 2014) and Illustris (Genel et al. 2014) are two recent hydrodynamic simulations that reproduce a number of key galaxy distribution functions. Both are necessarily tuned to a small number of observational constraints due to their limited resolution, which requires subgrid models to model physical processes below the simulation scale. Despite this, a number of observables not included in the tuning are simultaneously reproduced. Of interest for this study are the distributions of colours and photometric magnitudes, which are well reproduced in both models (Trayford et al. 2015; Torrey et al. 2015). The recent convergence of such detailed models with the observations, and within sufficiently large simulated volumes, has finally enabled them to be used as training sets for machine learning models. \fi \section{Results}\label{sec:results} \begin{figure*}[!htbp] \gridline{\leftfig{z_snr=5_20201108.pdf}{0.48\textwidth}{(a)} \rightfig{Calibration_z_snr=5_20201108.pdf}{0.48\textwidth}{(b)} } \gridline{\leftfig{SHAPz0_z_snr=5_20201108.pdf}{0.48\textwidth}{(c)} \rightfig{SHAPz2_z_snr=5_20201108.pdf}{0.48\textwidth}{(d)} } \gridline{\leftfig{Epis_z0_z_snr=5_20201108.pdf}{0.48\textwidth}{(e)} \rightfig{Epis_z2_z_snr=5_20201108.pdf}{0.48\textwidth}{(f)} } \caption{{\bf Performance Characteristics of {\sc mirkwood} SED fitting: Galaxy redshifts.} \textbf{(a,b)} \textbf{Validating predicted means and uncertainties, respectively.} In \textbf{(a)} we see that given a test sample, our model is accurately able to predict the mean redshifts of z=0 and z=2 used in this work. The horizontal orange line in \textbf{(b)} indicates that the predicted errors from {\sc mirkwood} are extremely small/tight, and that our assumption of normal distribution of redshifts is incorrect. \textbf{(c,d)}: \textbf{SHAP summary plots for z=0 and z=2, respectively}. These show the relative importance of each feature in predicting the redshift. For instance, in \textbf{(c)}, flux at 1.49$\mu$m has a high and positive impact on the predicted redshift. \textbf{(e,f)} \textbf{Outlier detection, for z=0 and z=2 respectively.} Epistemic uncertainty (on the y-axis) is high when informative features are sparse in the training set. Here we do not see any trends for $\sigma_{e}$ since there are several equally important bands \label{fig:redshift}} \end{figure*} \begin{figure*}[!htbp] \gridline{\leftfig{Mass_snr=5_20201108.pdf}{0.48\textwidth}{(a)} \rightfig{Calibration_Mass_snr=5_20201108.pdf}{0.48\textwidth}{(b)} } \gridline{\leftfig{SHAPz0_Mass_snr=5_20201108.pdf}{0.48\textwidth}{(c)} \rightfig{SHAPz2_Mass_snr=5_20201108.pdf}{0.48\textwidth}{(d)} } \gridline{\leftfig{Epis_z0_Mass_snr=5_20201108.pdf}{0.48\textwidth}{(e)} \rightfig{Epis_z2_Mass_snr=5_20201108.pdf}{0.48\textwidth}{(f)} } \caption{\label{fig:mass}} \end{figure*} \begin{figure*}[!htbp] \gridline{\leftfig{Dust_snr=5_20201108.pdf}{0.48\textwidth}{(a)} \rightfig{Calibration_Dust_snr=5_20201108.pdf}{0.48\textwidth}{(b)} } \gridline{\leftfig{SHAPz0_Dust_snr=5_20201108.pdf}{0.48\textwidth}{(c)} \rightfig{SHAPz2_Dust_snr=5_20201108.pdf}{0.48\textwidth}{(d)} } \gridline{\leftfig{Epis_z0_Dust_snr=5_20201108.pdf}{0.48\textwidth}{(e)} \rightfig{Epis_z2_Dust_snr=5_20201108.pdf}{0.48\textwidth}{(f)} } \caption{\label{fig:dustmass}} \end{figure*} \begin{figure*}[!htbp] \gridline{\leftfig{Z_snr=5_20201108.pdf}{0.48\textwidth}{(a)} \rightfig{Calibration_Z_snr=5_20201108.pdf}{0.48\textwidth}{(b)} } \gridline{\leftfig{SHAPz0_Z_snr=5_20201108.pdf}{0.48\textwidth}{(c)} \rightfig{SHAPz2_Z_snr=5_20201108.pdf}{0.48\textwidth}{(d)} } \gridline{\leftfig{Epis_z0_Z_snr=5_20201108.pdf}{0.48\textwidth}{(e)} \rightfig{Epis_z2_Z_snr=5_20201108.pdf}{0.48\textwidth}{(f)} } \caption{\label{fig:metallicity}} \end{figure*} \begin{figure*}[!htbp] \gridline{\leftfig{SFR_snr=5_20201108.pdf}{0.48\textwidth}{(a)} \rightfig{Calibration_sfr_snr=5_20201108.pdf}{0.48\textwidth}{(b)} } \gridline{\leftfig{SHAPz0_sfr_snr=5_20201108.pdf}{0.48\textwidth}{(c)} \rightfig{SHAPz2_sfr_snr=5_20201108.pdf}{0.48\textwidth}{(d)} } \gridline{\leftfig{Epis_z0_sfr_snr=5_20201108.pdf}{0.48\textwidth}{(e)} \rightfig{Epis_z2_sfr_snr=5_20201108.pdf}{0.48\textwidth}{(f)} } \caption{\label{fig:sfr}} \end{figure*} \iffalse \begin{figure*}[!htb] \gridline{\fig{Barplot_Mass_snr=5_20201101.pdf}{0.98\textwidth}{(a)}} \gridline{\fig{Barplot_Mass_snr=5_20201101.pdf}{0.98\textwidth}{(b)}} \gridline{\fig{Barplot_Mass_snr=5_20201101.pdf}{0.98\textwidth}{(c)}} \gridline{\fig{Barplot_Mass_snr=5_20201101.pdf}{0.98\textwidth}{(d)}} \caption{b} \label{fig:stackedbarplots} \end{figure*} \fi \iffalse \begin{figure*}[!htbp] \gridline{\fig{Mass_snr=5_20201015.pdf}{0.48\textwidth}{(a)} \fig{Mass_snr=5_20201015.pdf}{0.48\textwidth}{(b)} } \caption{\emph{Top panels:} Two dimensional kernel density estimate (KDE) plots of the means of galaxy properties. Blue and orange are the predicted means from \textrm{Prospector} using the non-parametric star formation history (SFH) model and \textrm{mirkwood}, v/s the true galaxy properties,respectively. We also show three metrics to quantitatively compare results -- these are the normalized root mean squared error, the normalized mean absolute error, and the normalized bias error (Section ()). As can be clearly seen, \textrm{mirkwood} significantly outperforms non-parametric fitting. \emph{Middle panels:} Bar plots comparing the quality of predicted error bars from non-parametric SED fits, \textrm{mirkwood}, and \textrm{mirkwood} post-processed using CRUDE calibration, in orange, green, and blue, respectively. For each of the three predictions, the top, lighter bars plot the interval sharpness, quantifying the `tightness' of predicted error bars. The lower, darker bars show the fraction of ground-truth galaxy values lying within $1 \sigma$ of their respective predicted error bars; see Section () for their precise definitions. A perfectly sharp set of predictions has IS and ECE of () and 0, respectively. Two things are immediately apparent: \textrm{mirkwood} significantly outperforms \textrm{Prospector}, and calibrating \textrm{mirkwood's} predictions is worth the extra compute time. \emph{Bottom panels:} Feature importance plots, comparing the relative importance of each of the 31 filters in predicting the two galaxy properties. SHAP values $>0$ indicate galaxy property values (mass for (a) and dust mass for (b)) greater than their means in their respective training sets, while red and blue respectively signify high and low flux values. \label{fig:mass,dustmass,snr5} \end{figure*} \begin{figure*}[!htb] \gridline{\fig{Mass_snr=5_20201015.pdf}{0.48\textwidth}{(a)} \fig{Mass_snr=5_20201015.pdf}{0.48\textwidth}{(b)} } \caption{b \label{fig:met,sfr,snr5} \end{figure*} \fi {\sc Prospector} and {\sc mirkwood} are given the same information in order to infer galaxy properties. This includes broadband photometry in $35$ bands with 5\%, 10\%, and 20\% Gaussian uncertainties (respectively SNRs = 20, 10, and 5). We present here the results from both methods for several galaxy properties including stellar mass, dust mass, star formation rate averaged over the last 100 Myr (SFR$_{100}$), and stellar metallicity. In Figures \ref{fig:redshift} through \ref{fig:sfr}, we present {\sc mirkwood's} predictions when trained on the full dataset comprising of simulations from {\sc Simba}, {\sc Eagle}, and {\sc IllustrisTNG}, at both z=0 and z=2, for SNR=5\footnote{Corresponding plots for SNR=10 and SNR=20 are available online at \url{https://github.com/astrogilda/mirkwood}}. The training set contains 33,586 samples, and we use stratified 5-fold cross-validation (see Section \ref{sec:methods_proposed_method} for details on implementation) to split it into train and test sets. After making predictions on all test splits, we collate the results, thus successfully making predictions on all 33,586 samples. Each predicted output for a physical property contains three values -- the mean $\mu$, the aleatoric uncertainty $\sigma_{\rm a}$, and the epistemic uncertainty $\sigma_{\rm e}$. The first type of uncertainty quantifies the inherent noise in the data, while the second quantifies the confidence of the model in the training data (see Section \ref{sec:methods_uncertainty} for detailed description). The results from traditional SED fitting are a subset of the total training data -- for galaxies at z=2, we only fit samples from {\sc Simba} due to computational budget constraints. Thus this dataset consists of 14,258 samples -- 12,287 from all three simulations at z=0, and the rest from {\sc Simba} at z=2. We present a brief overview of the data sets in Table \ref{tab:datasetsummary}. In subplots (a) of Figures \ref{fig:redshift} through \ref{fig:sfr}, we plot the recovered physical properties from {\sc mirkwood} and {\sc prospector} against the true values from the simulations for each of the five modeled properties: redshift, stellar mass, dust mass, metallicity, and star formation rate. In each case, the blue contours represent the physical properties derived from traditional SED fitting, while the orange points denote the results from {\sc mirkwood}. Without exception, {\sc mirkwood} provides superior predictions, as evidenced both by a visual inspection, and via a more quantitative approach by using three different metrics (detailed in Section \ref{sec:methods_metrics}). In subplots(b), we plot `calibration diagrams' \citep{crude_probability_calibration}. On the y-axis are the inverse-CDFs (cumulative distribution functions) for predictions from both {\sc mirkwood} and {\sc Prospector}. These are commonly used in ML literature -- the plotting function takes as input a vector consisting of the ground truth value, predicted mean, and predicted standard deviation, and outputs a value between 0 and 1 (see \cite{probability_calibration1} for detailed instructions on constructing these diagrams). We repeat this for all samples in the test set $\mathcal{D_{TEST}}$, sort the resulting vector in ascending order, and plot the curve on the y-axis. For {\sc mirkwood}, the uncertainty used is $\sigma_{\rm a}$, while {\sc Prospector} does not differentiate between the two types of uncertainties and outputs only a single value per galaxy sample. A 1:1 line on this curve indicates a perfectly calibrated set of predictions, with deviations farther from it indicative of poorer calibration. Both visually and quantitatively by using the two probabilistic metric (Section \ref{sec:methods_metrics}) average coverage error and interval sharpness, we ascertain that {\sc mirkwood} outperforms traditional SED fitting. In subplots (c) and (d), we plot the SHAP summary plots for samples in $\mathcal{D_{TEST}}$, for redshifts 0 and 2 respectively. We explain in detail how SHAP values are calculated in Section \ref{sec:shapley_values}. In brief, for a given filter (dotted vertical lines in subplots (c) and (d)), an absolute value farther from 0 denotes a larger impact of that feature in affecting the model outcome. SHAP value can thus be thought of as a type of sensitivity -- it controls how reactive the output is to changes in the input (here flux in the filter). Red and blue indicate high and low ends of values per feature/filter. Thus for a given feature, SHAP values $> 0$ with a red hue indicate that the galaxy property increases as that feature increases. Similarly, SHAP values $> 0$ with a blue hue indicate that the galaxy property decreases as the feature value decreases. As an example, in panel (c) of Figure~\ref{fig:mass}, the largest correlations with the $M^{\star}$ of a galaxy are, quite naturally, the $\sim 1-2 \mu$m range In subplots (e) and (f), we plot epistemic errors from {\sc mirkwood} against the most informative feature derived from their respective subplots (c) and (d). Over-plotted on these are the scaled histograms for the same feature, from the training and test sets, at these two redshifts\footnote{To be able to plot values differing by orders of magnitude on the same plot, we convert both the $x$ and $y$ axis to log-scale; the addition of the unit vector ensures that small values remain close to 0 after conversion and do not turn negative.}. $\sigma_{\rm e}$ informs us of the degree of confidence the model has in its predictions in a given part of the parameter space; by plotting it against the most informative filter derived from the SHAP plot, we can get a first order visual insight into the model's decision making process. In all Figures from \ref{fig:redshift} through \ref{fig:sfr}, we see a general trend that epistemic uncertainties increase when when the informative features become sparse, just as we would intuitively expect. In Table \ref{tab:stackedbartable}, we delineate all five metrics from Section \ref{sec:methods_metrics} to quantitatively compare {\sc mirkwood}'s performance with that of traditional SED fitting, across different levels of noise. As we would expect, the results from both models improve with increasing SNR. Across every metric and galaxy property, {\sc mirkwood} emerges as the clear winner. We also note that the difference in their relative performances increases with increasing noise level. Below a certain SNR, traditional SED fitting stops producing meaningful results (as can also be seen clearly from subplots (a) in Figures \ref{fig:redshift} through \ref{fig:sfr} ), whereas our ML-based approach is still able to extract signal from the noisy data. \iffalse \subsection{Redshift}\label{sec:results_redshift} We see in Figure \ref{fig:redshift}(a) that even with low quality SNR=5 photometric data, {\sc mirkwood} is able to recover redshifts almost perfectly. Figure \ref{fig:redshift}(b), however, paints a slightly different picture. Instead of getting an ideal 1:1 plot, we get a horizontal curve -- this is because for all samples used in this paper, the probability density function (PDF) for each of the galaxy of the fact that for each of the xxx samples in $\mathcal{D_{TEST}}$, the ground truth redshift effectively lies smack-dab at the median of the Gaussian distribution constructed using predicted $\mu$ and $\sigma_{\rm a}$. In other words, our predicted uncertainties are too small. We suspect this is because for this binary sample, our assumption of Gaussianity is broken, and perhaps a more suitable distribution is the Bernoulli. We leave this to future work. In Figures \ref{fig:redshift}(c) and (d) we see that the most predictive bands are in the UV and NIR to MIR. Since we have broken up $\mathcal{D_{TEST}}$ into two subsets based on the redshift $z$, each of the two plots (c) and (d) contain only 1 $z$ value, and hence the SHAP values are biased in the way they are. \subsection{Stellar Mass}\label{sec:results_stellarmass} We see in Figure \ref{fig:mass}(a) that {\sc mirkwood} is able to almost perfectly recreate the true stellar mass, whereas traditional SED fitting performs very poorly. We emphasize that the values plotted on the $y$-axis are the predicted means from both the models -- this means that even without accounting for uncertainties, the predicted means from {\sc Prospector} are untrustworthy on account of their large spread. In Figure \ref{fig:mass}(b) we see that our proposed model is almost perfectly calibrated, whereas {\sc Prospector} using the non-parametric SFH formulation of \cite{leja2017deriving} is under-confident with its predictions at levels below $\sim 0.3$, and extremely over-confident immediately after. Figures \ref{fig:mass}(b) and (c) provide us several pieces of information. We immediately see that the most information bands are $J$, $H$, and $K$, as expected. Note the disparity between the ranges of SHAP values. At z=0, fluxes have a biased effect on prediction of stellar mass -- a lack of flux (blue color) decreases predicted mass slightly, whereas an excess of flux increases mass much more rapidly. On the other hand, at z=2, the impact of the most informative bands is even with respect to direction of prediction. We also note that at z=2 NIR features are considerably more relevant, which is also something we would expect. \subsection{Impact of SNR}\label{sec:results_SNR} In Table \ref{tab:stackedbartable} we compare {\sc mirkwood}'s predictions with {\sc Prospector}'s, as a function of noise in the input data. We can clearly see that our proposed model retains its edge even at extremely high levels of noise. \fi \iffalse In Figure (), we compare \textrm{mirkwood}'s performance on retrieving $\log (M^{\star}/M_{\odot})$ values (median in the top panel, and $16^{\rm th}$ and $84^{\rm th}$ percentiles in the middle panel) with that of traditional SED fitting using the non-parametric SFH of \cite{lower_stellar_mass}. The input SEDs have been artificially introduced with Gaussian noise such that their signal-to-noise ratio is 5. As can be seen both visually and quantitatively via the various deterministic and probabilistic metrics, our performance is almost an order of magnitude better. In the bottom panel, we see that \textrm{mirkwood} In the absence of noise, our performance on log10 Mstar is reasonable for individual galaxies, with overall biases a few percent or less and uncertainty of the order of 10 per cent, as shown in Table 1. The overall distribution is well reproduced by eye, and likely well reproduced enough for scientific applications, although distribution similarity tests such as the K-S test indicate that the distributions are statistically different. The error as a function of galaxy parameter in Fig. 4 demonstrates that we can train the networks well where there is a high density of points, but we have increased errors towards the tails of the distribution. We now compare our results to stellar mass measurements of mock catalogs. Mobasher et al. (2015) performed a comprehensive study to estimate uncertainties and sources of bias in measuring physical parameters in galaxies. A number of different tests were performed, based on different initial parameters and codes. Here we adopt TEST-2A as our benchmark, as it is closest to our sample. TEST-2A used semianalytic models with a diversity of star formation histories and other parameters, and as with our semianalytic models, used measurements in CANDELS filter bands as their data set. We note that TEST-2A used more CANDELS bands than our measurement here: 13 instead of 8, including U-band, K-band, and Spitzer infrared data in addition to the Hubble optical and near-infrared bands we use, and excluding the F184W (ACS) filter that we use. Comparing to the distribution of biases and uncertainties returned by the individual methods in Mobasher et al. 2015, we find that we easily improve on the bias and have competitive uncertainty in our measurements. However, we expect to have lower bias: different assumptions of initial mass functions, star formation rates, etc were found by Mobasher et al. 2015 to be a source of systematic offsets between different codes, adding a constant bias to every galaxy, whereas we are implicitly assuming the same initial mass function and star formation rate since our samples are drawn from the same mock catalog. Our templates also have varying amounts of dust and varying metallicities, the lack of which has also been found to bias stellar mass estimates (Mitchell et al. 2013). We repeat the analysis with pseudo observational error, either matched to the full uncertainty distribution or matched to the uncertainty distribution of galaxies which have at least a 5σ-detected flux measurement in each band. We show only the best-performing input column set from the noise-free case, after checking that this column choice still performs best when error is added. This additional simulated observational noise causes an increase in bias and a large increase in uncertainty, visible in the right-hand plots of Fig. 4. However, the average bias of −0.019 dex is still smaller by an order of magnitude than any of the biases from Mobasher et al. (2015) (with the same caveat about correct implicit assumptions), and the uncertainty only a little worse than the maximum uncertainty from that comparison, 0.203 dex instead of 0.183 dex. \subsection{Dust Mass}\label{sec:results_dustmass} \subsection{Stellar Metallicity}\label{sec:results_stellarmet} As with stellar mass, we find good performance from our metallicity-predicting neural networks, with small biases and order 10 per cent uncertainty, as shown in Table 2 and Fig. 5. The overall predicted distribution is somewhat more skewed from the original distribution than in the stellar mass case, though again we perform well where the density of training points is high. As with stellar mass, we perform worse when noise is included, but not by a significant amount: an increase of bias by a factor of 2 and uncertainty by a factor of 3. This uncertainty, of 0.2 dex in the full-noise case, is larger than the convolutional neural network machinery of Wu & Boada (2018), who obtained 0.08 dex uncertainty, albeit using substantially more data (3-color 128x128 pixel cutouts, not eight measured magnitudes) and brighter and lowerredshift galaxies (brighter than 25th magnitude). We obtain a similar result to theirs in that low-metallicity galaxies have systematically high metallicity predictions in the presence of noise. This good performance on metallicity requires some discussion. Metallicity is typically the hardest of these properties to measure by traditional methods so it is surprising that we are able to do well. The dominant component of our performance is driven by the relationship between metallicity and stellar mass. There is a strong relationship between these quantities in data and in simulation (Lu et al. 2014, and references therein), and in practice the fact that we can fit stellar mass well means that most of our prediction of metallicity comes from the ability of the network to learn the Mstar −Zstar connection and to predict Mstar from the photometry, as can be seen by the similar shape of the bias-parameter curves in the noisy right-hand columns of in Fig. 4 and Fig. 5. That cannot be the full picture–metallicity performs best when we use colors alone, while stellar mass performs best when we use both magnitudes and colors– but it is a significant contributor to our good results. To illustrate this, we fit a simple quadratic equation to the log10 Mstar − log10 Zstar relationship in the simulations to predict a metallicity for each galaxy assuming no noise, and then we check how much improvement we get from the noise-free neural network when compared to this simple Mstar-based prediction. Fig. 6 shows a 2-D histogram of this improvement, with points above 0 being an improvement on the polynomial fit, and points below 0 having an increased bias. The bulk of our neural network predictions do improve on the simple model, by 1-2σ, but given that our data spans more than 2 orders of magnitude, an improvement of 0.1-0.2 dex indicates that the simple stellar mass-metallicity relationship can explain a good fraction of our predicted metallicities. The additional improvement is also suggested by the fact that the metallicity network performs better without magnitudes, while the stellar mass network performs better with them, meaning that the metallicity network must be learning different information than stellar mass alone. Still, this effect suggests that, for any method, if metallicity is not well-constrained by the data, using a stellar mass-based prior with appropriate uncertainty may produce adequate results. \subsection{Instantaneous Star Formation Rate}\label{sec:results_sfr} For the star formation rate, we have slightly higher bias and uncertainty. The bias of −0.053 dex corresponds to a 12 percent error in linear space, visible in the histogram of Fig. 7 as the blue prediction histogram peaking slightly higher than the true distribution in red. Much of the uncertainty is contributed by points with very low star formation rates. Fig. 7 shows the performance as a function of predicted star formation rate as well as a histogram of true and predicted values. \subsection{Instantaneous Star Formation Rate}\label{sec:results_redshift} None of these networks used redshift as an input, but template-fitting methods generally require it (Mobasher et al. 2015). Do our results improve if we add redshift as an input to the networks trained on the other galaxy properties? We take the best-performing input column set for stellar mass, metallicity, and star formation rate, and add redshift as an input. The results are summarized in Table 4. For stellar mass and star formation rate, the mean bias and the uncertainty both improve. However, the improvement in the uncertainty is generally small, and the change in bias is less than the uncertainty for all three galaxy properties. This is an encouraging result, as it means we can achieve good accuracy without needing to supplement our data with spectroscopic redshifts. \fi \begin{table*} \caption{Comparative performance of {\sc mirkwood} v/s {\sc Prospector} across different noise regimes. The five metrics are the normalized root mean squared error (NRMSE), normalized mean absolute error (NMAE), normalized bias error (NBE), average coverage error (ACE), and interval sharpness (IS). In any given cell, the tuple of values consists of the metric of interest from {\sc mirkwood} and {\sc Prospector}, respectively. A value of `nan' represents lack of predictions from {\sc Prospector}. Since traditional SED fitting hasn't been used to derive the redshift, the second values in all tuples in the `Redshift' field are `nan's. Similarly, we do not have predicted error bars from {\sc Prospector}for dust mass, hence ACE and IS values corresponding to this property are `nan's.} \label{tab:stackedbartable} \centering \begin{tabular}{ccccccc} \toprule & SNR & NRMSE & NMAE & NBE & ACE & IS \\ \tableline & 5 & (0.0, nan) & (0.0, nan) & (-0.0, nan) & (0.317, nan) & (0.0, nan) \\ Redshift & 10 & (0.0, nan) & (0.0, nan) & (-0.0, nan) & (0.317, nan) & (0.0, nan) \\ & 20 & (0.0, nan) & (0.0, nan) & (0.0, nan) & (0.317, nan) & (0.0, nan) \\ \tableline & 5 & (\textbf{0.198}, 1.003) & (\textbf{0.123}, 1.091) & (\textbf{-0.042}, -0.528) & \textbf{(-0.002}, -0.497) & (\textbf{0.001}, 0.005) \\ Mass & 10 & (\textbf{0.165}, 1.0) & (\textbf{0.118}, 1.088) & (\textbf{-0.035}, -0.518) & (\textbf{-0.021}, -0.502) & (\textbf{0.001}, 0.004) \\ & 20 & (\textbf{0.155}, 1.002) & (\textbf{0.115}, 1.117) & (\textbf{-0.041}, -0.479) & (\textbf{-0.066}, -0.482) & (\textbf{0.001}, 0.033) \\ \tableline & 5 & (\textbf{0.48}, 0.996) & (\textbf{0.339}, 0.998) & (\textbf{-0.219}, -0.905) & (\textbf{0.003}, nan) & (\textbf{0.001}, nan) \\ Dust Mass & 10 & (\textbf{0.456}, 0.996) & (\textbf{0.332}, 0.998) & (\textbf{-0.209}, -0.905) & (\textbf{-0.033}, nan) & (\textbf{0.001}, nan) \\ & 20 & (\textbf{0.475}, 1.263) & (\textbf{0.336}, 1.212) & (\textbf{-0.215}, -0.679) & (-0.076, nan) & (0.001, nan) \\ \tableline & 5 & (\textbf{0.062}, 0.544) & (\textbf{0.06}, 0.478) & (\textbf{-0.011}, -0.297) & (\textbf{-0.024}, 0.046) & (\textbf{0.041}, 0.301) \\ Metallicity & 10 & (\textbf{0.058}, 0.534) & (\textbf{0.055}, 0.464) & (\textbf{-0.01}, -0.275) & (\textbf{-0.032}, 0.041) & (\textbf{0.036}, 0.295) \\ & 20 & (\textbf{0.056}, 0.547) & (\textbf{0.052}, 0.487) & (\textbf{-0.01}, -0.229) & (\textbf{-0.063}, 0.036) & (\textbf{0.032}, 0.302) \\ \tableline & 5 & (\textbf{0.241}, 0.907) & (\textbf{0.205}, 0.99) & (\textbf{-0.069}, -0.687) & (\textbf{0.074}, -0.557) & (7.314,\textbf{ 0.001}) \\ SFR & 10 & (\textbf{0.329}, 0.91) & (\textbf{0.226}, 0.992) & (\textbf{-0.09}, -0.686) & (\textbf{0.048}, -0.564) & (\textbf{1.937}, 0.001) \\ & 20 & (\textbf{0.277}, 1.988) & (\textbf{0.215}, 2.911) & (\textbf{-0.078}, 1.437) & (\textbf{0.035}, -0.547) & (\textbf{0.006}, 0.2) \\ \tableline \end{tabular} \end{table*} \subsection{Calibration of Probabilities}\label{sec:calibration} Above, we have described the procedure for obtaining both aleatoric and epistemic errors. However, not all errors are created equal -- in practice, most uncertainty estimates often fail to capture the underlying data distribution \citep{lakshminarayanan_probability_calibration0, probability_calibration1, crude_probability_calibration}. For example, a 95 \% confidence interval generally does not contain the true outcome 95\% of the time (see Figure ()). When this happens, the model is said to be \emph{miscalibrated}. This is typically caused by model overconfidence, if the model is not powerful enough to map the right probability to its confidence interval. Calibration, or lack thereof, is also a function of the loss function the model is trained to minimize. Negative log-likelihood, the loss function we train \textsc{mirkwood} to minimize in this paper (see Section()), is known to result in over-confident predictions \citep{measuring_calibration_in_deep_learning}. Thus, we need to \emph{post hoc} correct the uncalibrated probabilities our model outputs. Here, we use the CRUDE method of \cite{crude_probability_calibration} to re-calibrate our model's predictions \emph{post-hoc}. CRUDE ensures that not only are the post-processed predictions calibrated, but that they are also \emph{sharp} \citep{measuring_calibration_in_deep_learning}. Sharpness refers to the concentration of the predictions. The more peaked (the sharper) the predictions are, the better (provided it is not at the expense of calibration). \subsection{SHAP Interaction Effects}\label{sec:shap_interaction} See the Tree SHAP paper for more details, but briefly, SHAP interaction values are a generalization of SHAP values to higher order interactions. The interaction effect is the additional combined feature effect after accounting for the individual feature effects. This formula subtracts the main effect of the features so that we get the pure interaction effect after accounting for the individual effects. We average the values over all possible feature coalitions S, as in the Shapley value computation. When we compute SHAP interaction values for all features, we get one matrix per instance with dimensions M x M, where M is the number of features. How can we use the interaction index? For example, to automatically color the SHAP feature dependence plot with the strongest interaction: \subsection{What is Machine Learning?}\label{sec:methods_intro_to_ml} \red{NO TEXT HERE?} \subsection{Metrics for Probabilistic Predictions} Probabilistic predictions are assessed by constructing Prediction Intervals (PI) and using corresponding PI evaluation criteria. In this work, we adopt the following four PI criteria: \begin{itemize} \item Average Coverage Area. ACE is an indicator to appraise the reliability of prediction interval, which has the following equation: \begin{align} \mathrm{ACE}_{\alpha}=\frac{1}{n} \sum_{i=1}^{n} c_{i} \times 100 \%-100 \cdot(1-\alpha) \%, \end{align} where $c_i$ is the indicative function of coverage and its calculation equation is as: \begin{align} c_{i}=\left\{\begin{array}{l} 1, y(i) \in\left[l_{\alpha}(i), u_{\alpha}(i)\right] \\ 0, y(i) \notin\left[l_{\alpha}(i), u_{\alpha}(i)\right] \end{array}\right. \end{align} \item Prediction Interval Normalized Average Width (PINAW): \begin{align} \mathrm{PINAW} = \frac{\sum_{i=1}^n U_i - L_i}{nr}, \end{align} where $r = y_{max} - y_{min}$. PINAW is the mean of PI widths normalized by the range of testing targets. \item Interval Sharpness (IS): \begin{align} \mathrm{IS}_{\alpha}=\frac{1}{n} \sum_{t=1}^{n}\left\{\begin{array}{ll} -2 \alpha\Delta_{\alpha}(i)-4\left[l_{\alpha}(t)-y(t)\right], & y(t)<l_{\alpha}(t) \\ -2 \alpha\Delta_{\alpha}(i)-4\left[y(t)-u_{\alpha}(t)\right], & y(t)>u_{\alpha}(t) \\ -2 \alpha\Delta_{\alpha}(i), & \mathrm{otherwise}\end{array}\right. \end{align} where $\Delta_{\alpha}(i) = u_{\alpha}(i)-l_{\alpha}(i)$. \item Continuous Ranked Probability Score (CRPS): \begin{align} \mathrm{CRPS}=\int_{-\infty}^{\infty}(F(y)-\mathbb{1}(y-x))^{2} d y, \end{align} where $F$ is the cumulative distribution function (CDF) associated with the probabilistic forecast, and $\mathbb{1}$ is the Heaviside step function. \end{itemize} From the equation of ACE, a value close to zero denotes the high reliability of prediction interval. As an infinitely wide prediction interval is meaningless, IS is another indicator contrary to the coverage rate of interval, which measures the accuracy of probabilistic forecasting. $\mathrm{IS}_{\alpha}$ is always $<0$; a great prediction interval obtains high reliability with a narrow width, which has a small absolute value of IS. PINAW is the mean of PI widths normalized by the range of testing targets. Our goal is to ensure that PI is not too wide, since that would make it useless as a metric. The CRPS is a measure of the integrated squared difference between the cumulative distribution function of the forecasts and the corresponding cumulative distribution function of the observations. It CRPS generalizes the mean absolute error (MAE), and reduces to it if the forecast is deterministic. It simultaneously considers the reliability and sharpness, and is a commonly used metric to evaluated the performance of the predicted conditional PDF. Note that CRPS is the only metric that uses the raw predicted PDF, and not the predicted intervals obtained by using Equation (). \section{Observational Predictions} -apply mirkwood and prospector to a sample of observations? \section{Outline} \begin{itemize} \item Intro \begin{itemize} \item Introduce SED fitting \item highlight that this is a publicly available package that will be continuously updated \item other stuff (?) \item flow into galaxy properties inferred using ML + crash course in ML \end{itemize} \item Related Work/State-of-the-art \begin{itemize} \item Bayesian fitting codes--Prospector \item emphasize cpu hrs per fit \item \textbf{plots} \item prospector for traditional SED fit comparison \end{itemize} \item Data \begin{itemize} \item brief introduction to SIMBA, EAGLE, TNG. \item differences between them. \item process of generating galaxies from sims \item process of generating SEDs from galaxies. \item galaxy properties we are using \item emphasize we are only using z=0 to show proof-of-concept. \end{itemize} \item Methods \begin{itemize} \item very brief introduction to popular tree based models, including ngboost \item introduce ensembling \item introduce automl \item errors--epistemic vs aleatoric \item metrics--deterministic and probabilistic \item shapley values, and SHAP. \item \textbf{plot}: schematic overview of process \end{itemize} \item Results \begin{itemize} \item galaxy physical properties (mass, SFR, dustmass, Z): mirkwood vs. trad. SED \item \textbf{3 plots x 4} train on sim1, predict on other 2, for each property \item \textbf{plot x 4}: train on all 3. predict on all 3, for each property \item \textbf{plot x 4}: summary plot using mu, for each property \item \textbf{plot x 4}: summary plot using aleatoric sigma, for each property \item \textbf{plot x 4}: feature interaction plot using mu, for each property \item \textbf{plot x 4}: feature interaction plot using aleatoric sigma, for each property \item \textbf{plot}: for outliers \end{itemize} \item Discussion \begin{itemize} \item discussion on assumptions in mirkwood vs. assumptions in SED fitting \item other stuff \end{itemize} \item Differentiate super-learner from stacking (stacked-generalization)/blending, and cite papers for both \item Potential figure explaining stacking--https://machinelearningmastery.com/super-learner-ensemble-in-python/ \item include that paper in bib that proves the importance of using 'max_samples' as a hyper-parameter \item \url{https://arxiv.org/pdf/2002.03578.pdf} \item \url{https://arxiv.org/pdf/1905.08996.pdf} \item \url{https://arxiv.org/pdf/1903.10457.pdf} \item \url{https://www.aanda.org/articles/aa/pdf/2019/02/aa33972-18.pdf} \item \url{https://ui.adsabs.harvard.edu/abs/2020IAUS..341...88A/abstract} \item \url{https://ui.adsabs.harvard.edu/abs/2005MNRAS.362...41G/abstract} % \end{itemize} \subsection{Performance Metrics}\label{sec:methods_metrics} As we have discussed, for each input sample {\sc mirkwood} outputs three values: $\mu$, $\sigma_{a}$, and $\sigma_{e}$. As the same time, for each input, {\sc Prospector} outputs two values: $\mu$, and $\sigma$. We quantify the performance of each model by comparing the predicted galaxy properties against the true ones known from simulations. We divide this task into two parts -- comparing just the predicted mean \emph{deterministic predictions} of each galaxy property with its ground truth value, and judging the quality of the entire predicted PDF (probability distribution function; \emph{probabilistic predictions}) by comparing it against the ground truth value. \subsubsection{Metrics for Deterministic Predictions}\label{sec:metrics_det} For determining the `goodness' of the predicted means for the galaxy properties, we adopt the following three performance criteria: \begin{itemize} \item Normalized root-mean-square error (RMSE): \begin{align*} \mathrm{NRMSE}=\sqrt{\frac{1}{n} \sum_{i=1}^{n}\left(\hat{\mu}(i)-Y(i)\right)^{2}} \end{align*} \item Normalized mean absolute error (NMAE): \begin{align*} \mathrm{NMAE}=\frac{1}{n} \sum_{i=1}^{n}\left|\hat{\mu}(i)-Y(i)\right| \end{align*} \item Normalized bias error: \begin{align*} \mathrm{NBE} = \frac{1}{n} \sum_{i=1}^{n} \hat{\mu}(i)-Y(i) \end{align*} \end{itemize} where $Y(i)$ and $\hat{\mu}(i)$ are the true and predicted values of any of the five galaxy properties for the $i^{th}$ sample, while $n$ is the total number of samples. A perfect prediction would result in NRMSE, NMAE, and NBE of 0. These values can be seen in the top-left plots in Figures \ref{fig:mass} through \ref{fig:sfr}. \subsubsection{Metrics for Probabilistic Predictions}\label{sec:metrics_prob} Probabilistic predictions are assessed by constructing Confidence Intervals (CI) and using them in evaluation criteria. In this work, we adopt average coverage area (ACE) and interval sharpness (IS) as our metrics. $\alpha$ is the significance level -- the probability that one will mistakenly reject the null hypothesis when in fact it is true. Specifically, since in this paper we are interested in $+/- 1\sigma$ predictions (CI=68.2\%), we choose $\alpha = 1-\rm{CI} = 0.318$. For {\sc mirkwood} results, $\sigma = \sqrt{\sigma_{a}^2 + \sigma_{e}^2}$, while for {\sc Prospector} results, there is only one $\sigma$ per prediction. For a given sample $i$, if the prediction of any galaxy property, from either {\sc mirkwood} or {\sc Prospector}, is \{$\mu(i)$; $\sigma(i)$\}, then the lower and upper confidence intervals $L_\alpha(i)$ and $U_\alpha(i)$ are given by $\mu(i) - \sigma(i)$ and $\mu(i) + \sigma(i)$, respectively. $l_\alpha(i)$ and $u_\alpha(i)$ correspond to the $u-$values for these: $l_\alpha(i) = 0.5 - \rm{CI}/2 = 0.159$, $u_\alpha(i) = 0.5 + \rm{CI}/2 = 0.841$. $y(i)$ corresponds to the $u-$value of the ground truth value $Y(i)$. If the predicted mean $\hat{\mu}(i)$ for a galaxy property exactly matches $Y(i)$, then $y_\alpha(i)=0.5$; if the predicted mean overshoots or undershoots the ground truth value, then $y_\alpha(i) > 0.5$ or $y_\alpha(i) < 0.5$, respectively. \begin{itemize} \item Average Coverage Error (ACE): \begin{align*} \mathrm{ACE}_{\alpha}=\frac{1}{n} \sum_{i=1}^{n} c_{\alpha}(i) \times 100 \%-100 \times(1-\alpha) \%, \end{align*} where $c_i$ is the indicative function of coverage: \begin{align*} c_{\alpha}(i)=\left\{\begin{array}{l} 1, Y(i) \in\left[L_{\alpha}(i), U_{\alpha}(i)\right] \\ 0, Y(i) \notin\left[L_{\alpha}(i), U_{\alpha}(i)\right] \end{array}\right. \end{align*} ACE is effectively the ratio of target values falling within the confidence interval to the total number of predicted samples. \item Interval Sharpness (IS): \begin{align*} \mathrm{IS}_{\alpha}=\frac{1}{n} \sum_{t=1}^{n}\left\{\begin{array}{ll} -2 \alpha\Delta_{\alpha}(i)\\-4\left[l_{\alpha}(i)-y(i)\right], & y(i)<l_{\alpha}(t) \\ -2 \alpha\Delta_{\alpha}(i)\\-4\left[y(i)-u_{\alpha}(i)\right], & y(i)>u_{\alpha}(t) \\ -2 \alpha\Delta_{\alpha}(i), & \mathrm{otherwise}\end{array}\right. \end{align*} where $\Delta_{\alpha}(i) = u_{\alpha}(i)-l_{\alpha}(i) = 0.682$. As a reminder, corresponding to $+/- 1\sigma$ intervals, $\alpha=0.318$, $l_{\alpha}(i)=0.159$, and $u_{\alpha}(i)=0.841$. \end{itemize} From the equation of ACE, a value close to zero denotes the high reliability of prediction interval. As an infinitely wide prediction interval is meaningless, IS is another indicator contrary to the coverage rate of interval, which measures the accuracy of probabilistic forecasting. $\mathrm{IS}_{\alpha}$ is always $<0$; a great prediction interval obtains high reliability with a narrow width, which has a small absolute value of IS. \begin{figure*} \centering \includegraphics[width=0.98\textwidth]{chaining.pdf} \caption{Chained multi-output regression. From left to right, we train models to sequentially predict galaxy redshift, stellar mass, dust mass, stellar metallicity, and SFR$_{100}$. At the first step, we train {\sc mirkwood} on fluxes (as input) and redshift (as output) in the training set $\mathcal{D_{TRAIN}}$, and use it to predict redshifts for samples in the test set ($\mathcal{D_{TEST}}$) using their respective flux values as inputs. In the second step, we append the true true redshifts of samples in $\mathcal{D_{TRAIN}}$ to with their fluxes, and append the predicted redshifts of the samples in $\mathcal{D_{TEST}}$ to their fluxes. A new model is then trained on the extended training set, and used to predict stellar mass for samples in the test set. We continue thus until all five properties have been successfully predicted for all samples in the original $\mathcal{D_{TEST}}$.} \label{fig:chaining} \end{figure*} \subsection{SHAP Clustering}\label{sec:shap_clustering} You can cluster your data with the help of Shapley values. The goal of clustering is to find groups of similar instances. Normally, clustering is based on features. Features are often on different scales. For example, height might be measured in meters, color intensity from 0 to 100 and some sensor output between -1 and 1. The difficulty is to compute distances between instances with such different, non-comparable features. SHAP clustering works by clustering on Shapley values of each instance. This means that you cluster instances by explanation similarity. All SHAP values have the same unit -- the unit of the prediction space. You can use any clustering method. The following example uses hierarchical agglomerative clustering to order the instances. The plot consists of many force plots, each of which explains the prediction of an instance. We rotate the force plots vertically and place them side by side according to their clustering similarity. \subsection{SHAP Decision Plots} Let me describe this elegant plot in great detail: The output value is the prediction for that observation (the prediction of the first row in Table B is 6.20). The base value: The original paper explains that the base value E(y$_{hat}$) is `the value that would be predicted if we did not know any features for the current output.' In other words, it is the mean prediction, or mean(yhat). You may wonder why it is 5.62. This is because the mean prediction of Y$_{test}$ is 5.62. You can test it out by Y$_{test}$.mean() which produces 5.62. Red/blue: Features that push the prediction higher (to the right) are shown in red, and those pushing the prediction lower are in blue. Alcohol: has a positive impact on the quality rating. The alcohol content of this wine is 11.8 (as shown in the first row of Table B) which is higher than the average value 10.41. So it pushes the prediction to the right. pH: has a negative impact on the quality rating. A lower than the average pH (=3.26 < 3.30) drives the prediction to the right. Sulphates: is positively related to the quality rating. A lower than the average Sulphates (= 0.64 < 0.65) pushes the prediction to the left. \iffalse You may wonder how we know the average values of the predictors. Remember the SHAP model is built on the training data set. The means of the variables are: X$_$train.mean() X$_$train.mean() What is the result for the 2nd observation in Table B look like? Let's doshap_plot(1): How about the 3rd observation in Table B? Let’s do shap_plot(2): Just to do one more before you become bored. The 4th observation in Table B is this: shap_plot(3) \fi \subsection{SHAP Dependence Plot}\label{sec:shap_dep_plot} SHAP dependence plots show how a feature’s value (x-axis) impacted the prediction (y-axis) of every sample (each dot) in a dataset (Figures 4B and E; Methods 15). This provides richer information than traditional partial dependence plots (Supplemental Figure 8). For the mortality model this reproduces the standard risk inflection point of systolic blood pressure [23], while also highlighting that the impact of blood pressure risk is different for people of different ages (Figure 4B). Many individuals have a recorded blood pressure of 180 mmHg in the mortality dataset, but the impact of that measurement on their mortality risk varies because early onset high blood pressure is more concerning to the model than late onset high blood pressure. These types of interaction effects show up as vertical dispersion in SHAP dependence plots. For the chronic kidney disease model, a dependence plot again clearly reveals a risk inflection point for systolic blood pressure, but in this dataset the vertical dispersion from interaction effects appears to be partially driven by differences in blood urea nitrogen (Figure 4E). Correctly modeling blood pressure risk while retaining interpretabilty is important since blood pressure control in select chronic kidney disease (CKD) populations may delay progression of kidney disease and reduce the risk of cardiovascular events (Methods 15). SHAP dependence plots show the effect of a single feature across the whole dataset. They plot a feature's value v/s. the SHAP value of that feature across many samples. SHAP dependence plots are similar to partial dependence plots, but account for the interaction effects present in the features, and are only defined in regions of the input space supported by data. The vertical dispersion of SHAP values at a single feature value is driven by interaction effects, and another feature is chosen for coloring to highlight possible interactions. Figure () (described in more detail in \S\ref{sec:results}) shows the dependence plots for While a SHAP summary plot gives a general overview of each feature a SHAP dependence plot show how the model output varies by feauture value. Note that every dot is a person, and the vertical dispersion at a single feature value results from interaction effects in the model. The feature used for coloring is automatically chosen to highlight what might be driving these interactions. Later we will see how to check that the interaction is really in the model with SHAP interaction values. Note that the row of a SHAP summary plot results from projecting the points of a SHAP dependence plot onto the y-axis, then recoloring by the feature itself. SHAP feature dependence might be the simplest global interpretation plot: 1) Pick a feature. 2) For each data instance, plot a point with the feature value on the x-axis and the corresponding Shapley value on the y-axis. 3) Done. Mathematically, the plot contains the following points: $\left\{\left(x_{j}^{(i)}, \phi_{j}^{(i)}\right)\right\}_{i=1}^{n}$ The following figure shows the SHAP feature dependence for years on hormonal contraceptives: SHAP dependence plots are an alternative to partial dependence plots and accumulated local effects. While PDP and ALE plot show average effects, SHAP dependence also shows the variance on the y-axis. Especially in case of interactions, the SHAP dependence plot will be much more dispersed in the y-axis. The dependence plot can be improved by highlighting these feature interactions. \subsection{SHAP Summary Plots}\label{sec:shap_summary} \iffalse Combining local explanations from TreeExplainer across an entire dataset enhances traditional global representations of feature importance by: 1) avoiding the inconsistency problems of current methods (Supplementary Figure 2), 2) increasing the power to detect true feature dependencies in a dataset (Supplementary Figure 7), and 3) enabling us to build SHAP summary plots that succinctly display the magnitude, prevalence, and direction of a feature’s effect. SHAP summary plots avoid conflating the magnitude and prevalence of an effect into a single number, and so reveal rare high magnitude effects. Figure 4A illustrates its benefits using the mortality dataset: (left) a standard bar-chart based on the average magnitude of the SHAP values, and (right) a set of beeswarm plots where each dot corresponds to an individual person in the study. The position of the dot on the x-axis is the impact that feature has on the model’s prediction for that person. When multiple dots land at the same x position they pile up to show density. Figure 4A (right) reveals the direction of effects, such as men (blue) having a higher mortality risk than women (red); and the distribution of effect sizes, such as the long right tails of many medical test values. These long tails mean features with a low global importance can yet be extremely important for specific individuals. Interestingly, rare mortality effects always stretch to the right, which implies there are many ways to die abnormally early when medical measurements are out-of-range, but not many ways to live abnormally longer (Methods 14). \fi The \emph{SHAP summary plot} is a graphical way of succinctly displaying the \emph{magnitude}, \emph{prevalence}, and \emph{direction} of a feature's effect. It is an extension of the standard bar-chart based on the average magnitude of the SHAP values, and simultaneously displays both feature importance with feature effects The position on the x-axis is determined by the feature and on the y-axis by the Shapley value. The color represents the value of the feature from low to high. Overlapping points are jittered in y-axis direction, so we get a sense of the distribution of the Shapley values per feature. The features are ordered according to their importance. We consider the case of predicting galaxy mass, and show the resulting bar plot and the summary plot in Figure (). As is apparent, the summary plot is a high resolution version of the bar plot, which shows the \emph{global} relationship between the value of a feature and the impact on the prediction. But to see the exact form of the relationship, we have to look at SHAP dependence plots. \iffalse \begin{figure*} \gridline{\fig{images/Mass_shap_chain_ngb.eps}{0.28\textwidth}{(a)} } \gridline{\leftfig{images/Dust Mass_shap_chain_ngb.eps}{0.28\textwidth}{} \fig{images/Metallicity_shap_chain_ngb.eps}{0.28\textwidth}{(b)} \rightfig{images/Star Formation Rate_shap_chain_ngb.eps}{0.28\textwidth}{} } \gridline{\leftfig{images/Dust Mass_shap_ngb.eps}{0.28\textwidth}{} \fig{images/Metallicity_shap_ngb.eps}{0.28\textwidth}{(c)} \rightfig{images/Star Formation Rate_shap_ngb.eps}{0.28\textwidth}{} } \caption{Inverted pyramid figure of six individual files. The nova are (a) V2491 Cyg, (b) HV Cet, (c) LMC 2009, (d) RS Oph, (e) U Sco, and (f) KT Eri. These individual figures are taken from \label{fig:shap_chainedvsunchained}} \end{figure*} \begin{figure*} \gridline{\fig{images/Mass_scatter_chain_ngb.eps}{0.3\textwidth}{(a)} } \gridline{\leftfig{images/Dust Mass_scatter_chain_ngb.eps}{0.3\textwidth}{} \fig{images/Metallicity_scatter_chain_ngb.eps}{0.3\textwidth}{(b)} \rightfig{images/Star Formation Rate_scatter_chain_ngb.eps}{0.3\textwidth}{} } \gridline{\leftfig{images/Dust Mass_scatter_ngb.eps}{0.3\textwidth}{} \fig{images/Metallicity_scatter_ngb.eps}{0.3\textwidth}{(c)} \rightfig{images/Star Formation Rate_scatter_ngb.eps}{0.3\textwidth}{} } \caption{We also highlight the importance of chaining models to account for dependenceFor each of the seven subplots, values predicted by mirkwood are plotted on the y-axis, while ground-truth values are on the x-axis. \textbf{(a):} Galaxy mass, in units of M$_{\odot}$. \textbf{(b):} From left to right: dust mass in units of M$_{\odot}$, gas phase metallicity in units of solar metallicity, and star formation rate in units of $\frac{M_{\odot}}{\textrm{year}}$. \textbf{(c):}} \label{fig:scatter_chainedvsunchained} \end{figure*} \begin{figure*} \gridline{\leftfig{images/Mass_scatter_chain_ngb.eps}{0.28\textwidth}{} \fig{images/Mass_scatter_chain_ngb.eps}{0.28\textwidth}{} \rightfig{images/Mass_scatter_chain_ngb.eps}{0.28\textwidth}{} } \gridline{\leftfig{images/Dust Mass_scatter_chain_ngb.eps}{0.28\textwidth}{} \fig{images/Dust Mass_scatter_chain_ngb.eps}{0.28\textwidth}{} \rightfig{images/Dust Mass_scatter_chain_ngb.eps}{0.28\textwidth}{} } \gridline{\leftfig{images/Metallicity_scatter_chain_ngb.eps}{0.28\textwidth}{} \fig{images/Metallicity_scatter_chain_ngb.eps}{0.28\textwidth}{} \rightfig{images/Metallicity_scatter_chain_ngb.eps}{0.28\textwidth}{} } \gridline{\leftfig{images/Star Formation Rate_scatter_chain_ngb.eps}{0.28\textwidth}{} \fig{images/Star Formation Rate_scatter_chain_ngb.eps}{0.28\textwidth}{} \rightfig{images/Star Formation Rate_scatter_chain_ngb.eps}{0.28\textwidth}{} } \caption{effect of noise} \label{fig:scatter_chained_effectofnoise} \end{figure*} \begin{figure*} \gridline{\leftfig{images/Mass_shap_chain_ngb.eps}{0.28\textwidth}{} \fig{images/Mass_shap_chain_ngb.eps}{0.28\textwidth}{} \rightfig{images/Mass_shap_chain_ngb.eps}{0.28\textwidth}{} } \gridline{\leftfig{images/Dust Mass_shap_chain_ngb.eps}{0.28\textwidth}{} \fig{images/Dust Mass_shap_chain_ngb.eps}{0.28\textwidth}{} \rightfig{images/Dust Mass_shap_chain_ngb.eps}{0.28\textwidth}{} } \gridline{\leftfig{images/Metallicity_shap_chain_ngb.eps}{0.28\textwidth}{} \fig{images/Metallicity_shap_chain_ngb.eps}{0.28\textwidth}{} \rightfig{images/Metallicity_shap_chain_ngb.eps}{0.28\textwidth}{} } \gridline{\leftfig{images/Star Formation Rate_shap_chain_ngb.eps}{0.28\textwidth}{} \fig{images/Star Formation Rate_shap_chain_ngb.eps}{0.28\textwidth}{} \rightfig{images/Star Formation Rate_shap_chain_ngb.eps}{0.28\textwidth}{} } \caption{effect of noise} \label{fig:shap_chained_effectofnoise} \end{figure*} \fi \iffalse \begin{figure*} \begin{multicols}{2} \includegraphics[width=.9\linewidth]{images/logmass_shap_chain_ngb.eps}\par \includegraphics[width=.9\linewidth]{images/logdustmass_shap_chain_ngb.eps}\par \end{multicols} \begin{multicols}{2} \includegraphics[width=.9\linewidth]{images/logmet_shap_chain_ngb.pdf}\par \includegraphics[width=.9\linewidth]{images/logsfr_shap_chain_ngb.pdf}\par \end{multicols} \caption{abc} \label{fig:fig9} \end{figure*} \fi \subsection{Uncertainty Quantification}\label{sec:methods_uncertainty} Real observations differ from simulations in a number of ways. \begin{itemize} \item It is rarely the case that as observers we have access to all filters in a survey for every observed galaxy. For example, we might encounter a situation where we are interested in determining a galaxy's mass from its photometry, but do not have access to $K$ and $H$ band information, thus making our task difficult. \item Different filters have differing sensitivities and noise properties, resulting in non-uniform measurement noises across observation bands. Even in an ideal case where observations in UV, optical and IR are equally robust, there is an irreducible Poisson measurement error. \item While modern hydrodynamical simulations, such as those used in this work, are powerful modellers of the known Universe, they are nonetheless just that -- models. There is an inherent, irreducible \emph{domain gap} between our approximation of reality, and reality. Imperfect modeling assumptions both about known physical processes, and arising from our sheer lack of knowledge of them, are primary contributors to this gap. Some specific reasons are modeling star formation with a sub-resolution model, divergence of modeled stellar mass functions from observed ones, and incomplete understanding of AGN feedback processes. \item Any supervised ML algorithm is only as good as the data on which it is trained. It might well be the case that an observed galaxy is in a completely different parameter space than any of the galaxies in our training set. \item Even if some particular model, say \textsc{NGBoost}, with a given set of hyperparameters, is able to faithfully and satisfactorily predict galaxy properties, it is very well possible that there exist other models which can also make predictions that are just as accurate. It is also possible that for our chosen model/set of models, a different data pre-processing scheme, choice of hyperparameters (as mentioned in Section \ref{sec:methods_proposed_method}, the chosen set of hyperparameters is locally optimal but is not guaranteed to be globally optimal), or choice of scheme for balancing classes might result in better predictions. \end{itemize} Owing to these factors, a highly desirable behavior of any predictive model would be to not only return a point prediction (per galaxy property under consideration), but also some quantity conveying the model's belief or confidence in its output \citep{kendall2017uncertainties, choi2018uncertainty}. We can break down such \emph{predictive uncertainty} into two parts--\emph{aleatoric} and \emph{epistemic} \cite{kendall2017uncertainties}\footnote{The word epistemic comes from the Greek ``episteme", meaning ``knowledge"; epistemic uncertainty is ``knowledge uncertainty". Aleatoric comes from the Latin ``aleator", meaning ``dice player"; aleatoric uncertainty is the ``dice player's" uncertainty \citep{gal_thesis}}. Aleatoric uncertainty captures the uncertainty in the data generating process -- for example, measurement noise in filters, or the inherent randomness of a coin flipping experiment. It cannot be reduced by collecting more training data\footnote{We know that a fair coin has a 0.5 probability of landing heads, yet we cannot assert with 100\% certainty the outcome of the next flip, no matter how many times we have already flipped the coin.}; however, it can be reduced by collecting more informative features\footnote{Uncertainty in galaxy mass estimation in the absence of H and K band information can be drastically reduced by collecting high quality data in these bands.}. On the other hand, epistemic uncertainty models the ignorance of the predictive model, and can indeed be explained away given a sufficiently large training dataset\footnote{If we are given a biased coin where we do not know the probability $p$ of turning up heads, we can determine it to arbitrary precision by flipping the coin an arbitrarily large number of times and counting the number of times it turns up heads.}. Aleatoric uncertainty is thus \emph{irreducible} or \emph{statistical}, epistemic being its \emph{reducible} or \emph{systematic} cousin. Aleatoric uncertainty covers first three of the five issues above, while epistemic uncertainty subsumes the last two points. High aleatoric uncertainty can be indicative of noisy measurements or missing informative features, while high epistemic uncertainty could be a clue that the observed galaxy is very different that any of the galaxies the model was trained on (such a galaxy is referred to as being \emph{out of distribution}). As previously discussed, the aim for a supervised ML algorithm is to learn the latent data generating mechanism that maps each input sample $\mathbf{x}_{i}$ to its corresponding output label $y_{i}$. This can be represented as follows \[ y_i=f(\mathbf{x}_i)+\eta_{i} \] where $f(\cdot)$ is the \emph{unknown} latent function and a measurement error $\eta$ follows a standard normal distributions distribution with a variance $\sigma_{\eta,i}^{2},$ i.e., $\eta_i \sim \mathcal{N}\left(\mu=0, \sigma_{\eta,i}^{2}\right)$. The variance of $\eta_i$ corresponds to the aleatoric uncertainty, i.e., $\sigma_{\eta,i}^{2}=\sigma_{a,i}^{2}$ where we will denote $\sigma_{a,i}^{2}$ as aleatoric uncertainty associated with the observation $\mathbf{x}_{i}$. Similarly, epistemic uncertainty will be denoted as $\sigma_{e,i}^{2}$. Since $f(\cdot)$ is unknown, by training on the \emph{training set} the model attempts to approximate, or guess, this function as closely as possible. Suppose that we train $\hat{f}(\mathbf{x})$ to approximate $f(\mathbf{x})$ from the samples in the input data set, $\mathcal{D}$. Then, we can see that \[ \begin{aligned} \mathbb{E}\|y_i-\hat{f}(\mathbf{x}_i)\|^{2} &=\mathbb{E}\|y_i-f(\mathbf{x}_i)+f(\mathbf{x}_i)-\hat{f}(\mathbf{x}_i)\|^{2} \\ &=\mathbb{E}\|y_i-f(\mathbf{x}_i)\|^{2}+\mathbb{E}\|f(\mathbf{x}_i)-\hat{f}(\mathbf{x}_i)\|^{2} \\ &=\sigma_{a,i}^{2}+\sigma_{e,i}^{2}, \end{aligned} \] where $\mathbb{E}\|\cdot\|$ is the expectation operator. This indicates the total predictive variance is the sum of aleatoric uncertainty and epistemic uncertainty. The \textsc{NGBoost} algorithm that forms the backbone of {\sc mirkwood} is naturally able to output both the mean $\mu_i$ and the aleatoric uncertainty $\sigma_{a,i}^2$ for a given observation $\mathbf{x}_i$. To obtain the epistemic uncertainty $\sigma_{e,i}^2$, we use \emph{bootstrapping}. This involves creating multiples copies of the same training dataset, each time picking samples \emph{with replacement}, training the same model on all copies, and averaging the results. The goal is to simulate a scenario where a model only has access to limited samples -- and hence limited parameter space -- and to study how this impacts its predictive ability (see Figure \ref{fig:mirkwood_pipeline}, especially \emph{\textbf{Step 3}}). That is, given an \textsc{NGBoost} model, the predicted label for an observation $\mathbf{x}_{i}$ is represented as: \begin{align*} p(\mathbf{y} \mid \mathbf{x}_{i}) &= \mathcal{N}\left(\mu_{i}, \sigma_{a,i}^2\right), \end{align*} Creating $N_{\rm bags}$ bootstrapped bags essentially creates $N_{\rm bags}$ copies of the above equation. To obtain final summary statistics, we combine them as \begin{align} \hat{\mu}_i {=}\sum_{j=1}^{N_{\rm bags}}\mu_{i,j};\;\hat{\sigma}_{i,a}^2 {=} \sum_{j=1}^{N_{\rm bags}} \sigma_{i,a,j}^{2};\;\hat{\sigma}_{i,e}^2 {=} \sum_{j=1}^{N_{\rm bags}} (\mu_{i,j} {-} \hat{\mu}_i)^2 \label{eqn:main_averaging_eqn} \end{align} The upshot of this exercise is that the errors modeled by {\sc mirkwood} encapsulates both the propagated noise due in the input samples, and the uncertainty arising due to the finite size of the training set. Neither {\sc Prospector} nor previous projects in this field \citep{lovell2019learning,acquaviva2015simultaneous} take into account this latter source of uncertainty. This is a significant contribution of {\sc mirkwood} and helps mitigate the over-confidence in predictions that is typical of machine learning models. \begin{table*} \caption{Summary of machine learning terms and variables appearing in this work.} \label{tab:meaningsofterms} \centering \begin{tabular}{p{0.15\linewidth} p{0.80\linewidth}} \toprule Term & Meaning \\ \tableline \emph{Bagging} & Bootstrapped Aggregation. A machine learning meta-algorithm that generates $N_{\rm bags}$ new training sets by sampling from the parent training data set uniformly and with replacement. Each bag may or may not be the same size as the parent training data set. \\ \emph{HPO} & Hyperparameter optimization. The task of finding a well performing set of hyperparameters for any given ML algorithm. \\ \emph{Chaining} & Given multiple outputs of interest (dependent variables), the technique of running the regression model in sequence to exploit correlations among them. \\ \emph{Cross validation} & The task of dividing the training set into non-overlapping `folds' for the purpose of hyperparameter optimization. \\ $\mathcal{D}$ & Input training set comprising of all samples from {\sc Simba}, {\sc Eagle}, and {\sc IllustrisTNG}. Each sample consists of input (independent variables)-output(dependent variables) pairs. \\ $\mathcal{D_{TRAIN}}$ & Training set, derived from $\mathcal{D}$. {\sc mirkwood} is trained on this, and used for inference on $\mathcal{D_{TEST}}$. \\ $\mathcal{D_{TRAIN_{TRAIN}}}$ & Training set, derived from $\mathcal{D_{TRAIN}}$. Used for HPO. \\ $\mathcal{D_{TRAIN_{VAL}}}$ & Validation set, derived from $\mathcal{D_{TRAIN}}$. Used for HPO. \\ $\mathcal{D_{TEST}}$ & Test set. \\ $N_{\rm{CV,1}}$ & Number of CV folds that is used to produce $\mathcal{D_{TRAIN}}$ and $\mathcal{D_{TEST}}$ from $\mathcal{D}$. \\ $N_{\rm{CV,2}}$ & Number of CV folds that is used to produce $\mathcal{D_{TRAIN_{TRAIN}}}$ and $\mathcal{D_{TRAIN_{VAL}}}$ from $\mathcal{D_{TRAIN}}$. \\ $\sigma_{e}$ & Epistemic uncertainty. \\ $\sigma_{a}$ & Aleatoric uncertainty. \\ $f(\cdot)$ & Functional representation of {\sc mirkwood}. This acts on a given input vector $\mathbf{x}$ to produce the output $y$. \\ $\mu$ & The mean of a predicted galaxy property, using one bag of training data. \\ $\hat{\mu}$ & The mean of $\mu$s predicted by all $N_{\rm{bags}}$ bags. \\ \tableline \end{tabular} \end{table*}
\section{More explanations on the assumptions on Theorem~\ref{main-thm-2}} \abhi{This appendix section may be removed later.} Let us explain why the fact that the number of edges of size $(1 \pm \delta_1)\sqrt{n}$ is at most $(1-\delta_2)n$ for sufficient small $\delta_1 , \delta_2 > 0$, is ``equivalent" that the hypergraph is far from being a projective plane; this is due to the following observation. \begin{obs}\label{obs:equivalence} Let $0 \ll n_0^{-1} \ll \delta_1 , \delta_2 < 1$, and let $n \geq n_0$ be an integer. For any $n$-vertex linear hypergraph $\cH$, let $\cH_{\gamma} \subseteq \cH$ be the subhypergraph consisting of the edges of size $(1 \pm \gamma) \sqrt{n}$ for any $\gamma \in (0,1)$. Then the following hold. \begin{itemize} \item If $e(\cH_{\delta_1}) \geq (1-\delta_2)n$, then at least $(1 - 2 \delta_1 - \delta_2)$-fraction of the pairs of the vertices are contained in edges in $\cH_{\delta_1}$, and $\frac{1 - 3(\delta_1 + \delta_2)}{(1+3\delta_1)^2}$-fraction of the pairs of the edges in $\cH_{\delta_1}$ are intersecting. \item If there are at least $(1 - \delta_2)$-fraction of the pairs of the vertices are contained in edges in $\cH_{\delta_1}$, then $e(\cH_{\delta_1}) \geq (1 - 2 \delta_1 - \delta_2) n$. \end{itemize} \end{obs} \section{Proof of Lemma~\ref{lem:embed}} \abhi{This appendix section may be removed later.} Let $\cH^*$ be an $r$-uniform linear hypergraph obtained from $\cH$ by adding $r - |e|$ new vertices to each $e \in \cH$, where $|V(\cH^*)| \leq N + (r-1) D N \leq r D N$. Note that multiple singletons in $\cH$ are now distinguished in $\cH^*$, since we added disjoint sets of new vertices. Now we may apply the ideas of~\cite[Lemma 8.1]{KKMO2020} to $\cH^*$ to prove the lemma. Choose $N_0 , D_0$ sufficiently large compared to $r$. We may assume that $D \in \mathbb{N}$. It follows from well-known results~\cite{wilson1972_1, wilson1972_2, wilson1975} that there exists $N_1 = N_1(r)$ such that a Steiner system $S(2,r,M)$ exists as long as $M \geq N_1$ and both $M-1$ and $M(M-1)$ are divisible by $r-1$ and $r(r-1)$, respectively. Let us define \begin{equation}\label{eqn:c0_bound} C_0 \coloneqq \max((r+1)(r-1) , N_1). \end{equation} For any $M \geq N_1$, there exists an integer $0 \leq t < r(r-1)$ such that $M+t$ satisfies these divisibility conditions. Let $S(M)$ be the $M$-vertex hypergraph obtained by removing any $t$ vertices from $S(2,r,M+t)$. Hence $S(M)$ is simple and each vertex of $S(M)$ has degree between $\frac{M-1}{r-1} - r(r-2)$ and $\frac{M-1}{r-1} + r$. For each integer $N_1 \leq d \leq D$, we construct a simple $r$-uniform hypergraph $\cH_d$ such that $|V(\cH_d)| = (r-1)^2 D^2$ and every vertex of $\cH_d$ has degree between $d-(r+1)(r-1)$ and $d$ as follows. Let $\ell \coloneqq \lceil (r-1)D^2 / (d-r) \rceil$ and $a_1 \geq \dots \geq a_{\ell}$ be a sequence such that each $a_i$ is either $(r-1)(d-r)-1$ or $(r-1)(d-r)$, and $\sum_{i=1}^{\ell} a_i = (r-1)^2 D^2$. Now define $\cH_d$ by taking the vertex-disjoint union of $S(a_1) , \dots , S(a_\ell)$. Then we deduce that each vertex of $\cH_d$ has degree between $d-(r+1)(r-1) \leq \frac{(r-1)(d-r) - 2}{r-1} - r(r-2)$ and $\frac{(r-1)(d-r)-1}{r-1} + r \leq d$. Now we define our desired multi-hypergraph $\cH_{\rm unif}$ as follows. Let us first take the union of $T \coloneqq (r-1)^2 D^2$ vertex-disjoint copies of $\cH^*$, where the first copy is identified with $\cH^*$. If $v \in V(\cH^*)$ with $d_{\cH^*}(v) < D - C$, by~\eqref{eqn:c0_bound} and the fact that $C \ge C_0$, we have $d_{\cH^*}(v) \leq D - C_0 \leq D - N_1$, so $D -d_{\cH^*}(v) \ge N_1$. For each $v \in V(\cH^*)$ with $d_{\cH^*}(v) < D - C$, let $v^1 , \dots , v^T$ be the $T$ clone vertices of $v \in V(\cH^*)$ in $\cH_{\rm unif}$, and extend $\cH_{\rm unif}$ by making $\cH_{\rm unif}[v^1 , \dots , v^T]$ induce a copy of $\cH_{D - d_{\cH^*}(v)}$. Since every vertex of $\cH_{D - d_{\cH^*}(v)}$ has degree between $D - d_{\cH^*}(v) - (r+1)(r-1)$ and $D - d_{\cH^*}(v)$, we then have $D - (r+1)(r-1) \leq d_{\cH_{\rm unif}}(v^i) \leq D$ for $1 \le i \le T$. If $v^1 , \dots , v^T$ are the $T$ clone vertices of some vertex $v \in V(\cH^*)$ with $d_{\cH^*}(v) \geq D - C$, then $d_{\cH_{\rm unif}}(v^i) = d_{\cH^*}(v)$ for $1 \le i \le T$. Therefore, for any vertex $v \in V(\cH_{\rm unif})$, we have \begin{equation*} D - C \overset{\eqref{eqn:c0_bound}}{=} D - \max(C , (r+1)(r-1)) \leq d_{\cH_{\rm unif}}(v) \leq D. \end{equation*} Moreover, if $v \in V(\cH)$ with $d_{\cH}(v) \ge D - C$ then $d_{\cH}(v) = d_{\cH^*}(v) = d_{\cH_{\rm unif}}(v)$. Thus~\ref{E2} holds. By the construction of $\cH_{\rm unif}$, one can easily\COMMENT{Since $\cH^*$ is obtained from $\cH$ by adding new vertices to each edge, and $\cH_{\rm unif}$ is obtained by taking $T$ copies of $\cH^*$ and adding edges containing at most one vertex from each copy of $V(\cH^*)$, where the first copy of $\cH^*$ is identified with $\cH^*$ and there are no additional edges attached at each vertex $v \in V(\cH)$ with degree at least $D-C$ in $\cH$} check that $\cH_{\rm unif}$ is $r$-uniform, linear, and~\ref{E1} holds. Finally, since $|V(\cH_{\rm unif})| = T|V(\cH^*)| \leq r(r-1)^2 D^3 N$,~\ref{E3} holds. This completes the proof of the lemma. \end{comment} \vspace{1cm} {\footnotesize \obeylines \parindent=0pt Dong Yeap Kang, Tom Kelly, Daniela K\"{u}hn, Abhishek Methuku, Deryk Osthus \vspace{0.3cm} School of Mathematics, University of Birmingham, Edgbaston, Birmingham, B15 2TT, UK} \vspace{0.3cm} {\footnotesize \parindent=0pt \begin{flushleft} {\it{E-mail addresses}:} \tt{[d.y.kang.1,t.j.kelly,d.kuhn,d.osthus]@bham.ac.uk, <EMAIL>} \end{flushleft} } \end{document} \section{Useful lemmas and notes} \begin{lemma}\label{lem:embed} For any $k \geq 3$, there exist $N_0 = N_0(k)$ and $D_0 = D_0(k)$ satisfying the following. For any $N \geq N_0$ and $D \geq D_0$, let $H$ be an $N$-vertex $k$-uniform hypergraph with maximum degree at most $D$ and codegree at most $C$. There exists a $k$-uniform hypergraph $H'$ such that \begin{itemize} \item $H'$ contains $H$ as a subhypergraph, \item There exists $K = K(k)$ such that every vertex $v \in V(H')$ has degree between $D - K$ and $D$, \item $H'$ has codegree at most $C$, and \item $|V(H')| = (k-1)^2 D^2 N$. \end{itemize} \end{lemma} \begin{proof} We may assume $N$ and $D$ are sufficiently large and determine $K$ later. We may also assume that $D$ is an integer (otherwise we can take $\lfloor D \rfloor$ instead of $D$). It follows from well-known results~\cite{wilson1972_1, wilson1972_2, wilson1975} that there exists $N_1 = N_1(k)$ such that a $k$-uniform Steiner system $S(2,k,M)$ exists as long as both $M-1$ and $M(M-1)$ are divisible by $k$ and $k(k-1)$, respectively. These divisibility conditions are equivalent that $M$ is either $ck(k-1)+1$ or $(ck+1)(k-1)+1$ for some integer $c$. For any $M \geq N_1$, there exists an integer $0 \leq \ell \leq k(k-1)$ such that $M+\ell$ is equal to either $ck(k-1)+1$ or $(ck+1)(k-1)+1$ for some integer $c$. Let $S(M)$ be the resulting $M$-vertex linear hypergraph by removing any $\ell$ vertices from $S(2,k,M+\ell)$, which will reduce the degree of each remaining vertex by at most $\ell \leq k(k-1)$. Hence each vertex of $S(M)$ has degree between $\frac{M-1}{k-1} - k(k-2)$ and $\frac{M-1}{k-1} + k$.\footnote{Note that $S(2,k,M+\ell)$ has degree exactly $\frac{M-1+\ell}{k-1}$, hence the degree of $S(M)$ would be between $\frac{M-1}{k-1} - k(k-2) \leq \frac{M-1+\ell}{k-1} - \ell$ and $\frac{M-1+\ell}{k-1} \leq \frac{M-1}{k-1} + k$} For each integer $N_1 \leq d \leq D$, we construct a linear hypergraph $H_d$ such that every vertex of $H_d$ has degree between $d-(k+1)(k-1)$ and $d$, where $|V(H_d)| = (k-1)^2 D^2$ as follows. Let $\ell = \lceil (k-1)D^2 / (d-k) \rceil$ and $a_1 \geq \dots \geq a_{\ell}$ be a sequence such that each $a_i$ is either $(k-1)(d-k)-1$ or $(k-1)(d-k)$, and $\sum_{i=1}^{\ell} a_i = (k-1)^2 D^2$, where such sequence exists since $\lceil \frac{(k-1)^2 D^2}{(k-1)(d-k)} \rceil \geq (k-1)(d-k)$. Now we may define $H_d$ by taking vertex-disjoint union of $S(a_1) , \dots , S(a_\ell)$. Then we deduce that each vertex of $H_d$ has degree between $d-(k+1)(k-1) \leq \frac{(k-1)(d-k) - 2}{k-1} - k(k-2)$ and $\frac{(k-1)(d-k)-1}{k-1} + k \leq d$. Now we define our desired hypergraph $H'$ as follows. Let first take the union of $T := (k-1)^2 D^2$ vertex-disjoint copies of $H$. For each $v \in V(H)$ with $d_H(v) \leq D - N_1$, we embed $H_{D - d_H(v)}$ as the subhypergraph of $H'$ induced by $\{v^1 , \dots , v^T \}$, where $v^1 , \dots , v^T$ are the $T$ clone vertices of $v \in V(H)$ in $H'$. Since every vertex of $H_{D - d_H(v)}$ has degree between $D - d_H(v) - (k+1)(k-1)$ and $D - d_H(v)$, we have $D - (k+1)(k-1) \leq d_{H'}(v^i) \leq D$ for $1 \le i \le T$. For each $v \in V(H)$ with $d_H(v) > D - N_1$, we do not embed any hypergraph into $H'$. Hence if $v^1 , \dots , v^T$ are the $T$ clone vertices of such a vertex $v \in V(H)$, then $d_{H'}(v^i) = d_H(v) > D - N_1$ for $1 \le i \le T$. Therefore, for any vertex $v \in V(H')$, we have \begin{equation*} D - \max(N_1 , (k+1)(k-1)) \leq d_{H'}(v) \leq D. \end{equation*} It is also straightforward to check that the codegree of $H'$ is at most the codegree of $H$, and $|V(H')| = TN = (k-1)^2 D^2 N$. This completes the proof of the lemma. \end{proof} For a hypergraph $H$ and a set $X$, let $H \cap X$ be the hypergraph with $V(H \cap X) := V(H) \cap X$ and $E(H \cap X) := \{e \cap X \: : \: e \in E(H) \}$. Now we state the following corollary, which asserts that one can embed a hypergraph into an almost regular uniform hypergraph while the number of vertices is not increased too much, and both the maximum degree and the codegree are preserved. \begin{corollary}\label{cor:embed} For any $k \geq 3$, there exist $N_0 = N_0(k)$ and $D_0 = D_0(k)$ satisfying the following. For any $N \geq N_0$ and $D \geq D_0$, let $H$ be an $N$-vertex hypergraph with maximum degree at most $D$, codegree at most $C$, and every edge having size at most $k$. Then there exist a $k$-uniform hypergraph $H'$ and a set $X$ such that \begin{itemize} \item $H' \cap X$ contains $H$ as a subhypergraph, \item There exists $K = K(k)$ such that every vertex $v \in V(H')$ has degree between $D - K$ and $D$, \item $H'$ has codegree at most $C$, and \item $|V(H')| \leq k(k-1)^2 D^3 N^2$. \end{itemize} \end{corollary} \begin{proof} First of all, let $X := V(H)$. For each edge $e \in E(H)$, we may enlarge $|e|$ by adding $k-|e|$ dummy vertices, where these vertices only appear in $e$. This will add at most $kDN$ vertices, since there are at most $DN$ edges in $H$. Let $H^*$ be the resulting hypergraph. Now we may apply Lemma~\ref{lem:embed} to $H^*$, which gives a $k$-uniform hypergraph $H'$. It is straightforward to check that $H'$ satisfies all the conditions of the corollary. \end{proof} \subsection{Some old notes on absorption: Using $n/2$ reserved graph edges} Let $U$ be the set of vertices with degree at least $(1 - \varepsilon)n$. Let $H^*$ be the incidence hypergraph with $n/2$ clone sets. There is a small constant $p$ such that for any $S \subseteq V(H^*)$ with sufficiently large size (i.e., at least polylogarithmic in $n$, for example), there are exactly $(p \pm \delta) |S|$ uncovered vertices in $S$ after the nibble lemma. Here, we choose $\delta$ to satisfy $\delta \ll p$. Since the choice of reserved graph edges at each $v \in U$ is random, we expect roughly $(1 - \varepsilon)n / 2$ reserved edges at each $v$. For each clone set $C_i$, let $v_i$ be the clone of $v \in U$. We expect there are roughly $(1 - \varepsilon)pn / 2$ \emph{available} reserved edges at each $v_i$, i.e., the other end of each of those edges is also uncovered in $C_i$. Also, for each $v \in U$, since there are $n/2$ clone sets, we deduce that there are roughly $pn/2$ clone sets where the clone of $v$ is uncovered. We may consider two cases, whether $|U| < n/100$ and $|U| \geq n/100$. If $|U| < n/100$, then in each clone set $C_i$, there are roughly $p|U| < pn/100$ vertices that are clones of vertices in $U$. For each $v \in U$, there are at least $3n/4$ \section{Weighted nibble lemma} In this section, we briefly sketch the proof of the following proposition. \begin{proposition}\label{prop:weightnibble} Let $\varepsilon > 0$ be a real number $K \geq 2$ be an integer. There exists $n_0 = n_0(\varepsilon , K)$ satisfying the following. Let $H$ be an $n (\geq n_0)$-vertex linear hypergraph such that every edge has size at most $K$ and the hypergraph $H$ contains a vertex with degree close to $n$. Then there exists a partial edge-colouring of $H$ with at most $n/2$ colours such that for any $v \in V(H)$, the number of uncoloured hyperedges incident to $v$ is at most $\varepsilon n$, and the number of uncoloured graph edges incident to $v$ is at most $\max \left ( \frac{1+\varepsilon}{2} d_1(v) \: , \: \varepsilon n \right )$, where $d_1(v)$ is the number of graph edges incident to $v$. \end{proposition} Let $H$ be an $n$-vertex linear hypergraph having a vertex with degree $\geq (1-\varepsilon)n$ and every edge having size at most $K$. Now we may construct the following two auxiliary hypergraphs. \begin{itemize} \item For each edge $e \in E(H)$, we may add $K-|e|$ dummy vertices, where these dummy vertices only appear in $e$. We may also add new edges with weight 1, to ensure that all vertices are almost regular \emph{weighted degrees}. Let $H_1$ be such an auxiliary hypergraph. Here, we will not apply Corollary~\ref{cor:embed}, since this corollary yields an auxiliary hypergraph with almost regular unweighted degrees. But modifying the proofs of Lemma~\ref{lem:embed} and Corollary~\ref{cor:embed}, one may obtain such an auxiliary hypergraph $H_1$. \item Now let $D_0$ be the weighted degree of $H_1$. We may construct an auxiliary hypergraph $H_2$ that Deryk mentioned in his email, with $D_0/2$ set of clones. Let $S$ be the set of \emph{special vertices}, where each special vertex corresponds to an edge of $H_1$. For each special vertex $v$, we say $v$ is 1-weight if its corresponding edge has weight 1 in $H_1$, and 2-weight if its corresponding edge has weight 2 in $H_1$. Let $S_1$ be the set of 1-weight special vertices, and $S_2$ be the set of 2-weight special vertices. If $e = v_1 v_2 \dots v_K \in E(H_1)$, then $e^i := e v_1^i v_2^i \dots v_K^i$ will be the edge of $H_2$ for $1 \leq i \leq D_0/2$, where $v^i$ denotes $i$th clone of the vertex $v \in V(H_1)$.The weight of $e^i$ in $H_2$ is equal to the weight of $e$ in $H_1$. Then $H_2$ will be $(K+1)$-uniform, each non-special vertex has weighted degree $D_0$, each 1-weight special vertex has weighted degree $D_0/2$, while each 2-weight special vertex has weighted degree $D_0$. Note that not all vertices of $H_2$ have the weighted degree $D_0$. \end{itemize} Now we may sketch the weighted nibble process, which has three different features than the standard nibble process, e.g., AKS, as follows. \begin{itemize} \item Not all vertices have the same weighted degree; the 1-weight special vertices will have the different weighted degree. \item In AKS, we defined the set of isolated edges from a random bite as a matching $M_i$. In our setting, $M_i$ is no longer a matching, and we allow $M_i$ to be a set of disjoint stars (more precisely, disjoint sunflowers centered at special vertices). We allow two distinct edges in $M_i$ to share a special vertex. \item In AKS, they removed all vertices belonging to $i$th matching $M_i$ to define the next hypergraph. In our setting, we also remove some 1-weight vertices not in $M_i$, to make the probability that a vertex survives in the next hypergraph $F_i$, to be uniform for all vertices. \end{itemize} For $1 \leq i \leq \omega$, we may define the $i$th nibble process, where $\omega$ will be determined later. We may define a series of hypergraphs $F_0 , F_1 , \dots , F_\omega$ and the parameters $D_0 , D_1 , \dots , D_\omega$, where $F_0 := H_2$. (and the initial parameter $D_0$ is defined when we constructed $H_2$.) We may also prove the following. \begin{itemize} \item Each non-special vertex of $F_i$ has weighted degree $\sim D_i$. \item Each 1-weight special vertex of $F_i$ has weighted degree $\sim D_i/2$. \item Each 2-weight special vertex of $F_i$ has weighted degree $\sim D_i$. \end{itemize} We may define the $i$th nibble process as follows, where we define the probability space independently at random for all edges. \begin{itemize} \item For each 1-weight edge $e \in E(F_{i-1})$, we put the edge into the set $B_i$ with probability $1/D_{i-1}$. \item For each 2-weight edge $e \in E(F_{i-1})$, we put the edge into $B_i$ with probability $1 - (1 - 1/D_{i-1})^2 = 2/D_{i-1} + O(D_{i-1}^{-2})$. \abhi{Minor note. can't we simply define the probability as $2/D_{i-1}$ actually? If we can set the probability arbitrarily anyway, why toss any coins.} \Dongyeap{Yes we can. In either way, it will eventually give an error term $O(D_{i-1}^{-1})$ in the probability, especially when we approximate $\left ( 1 - \frac{1}{D_{i-1}} \right )^{\rm something}$ by $\exp(-{\rm something} / D_{i-1})$. However, we can control this small error term anyway, as follows. Since the error probability is $o(1)$, we may discard each vertex with probability $o(1)$ to regularise the survival probability for all vertices, as we did it for 1-weight special vertices (though we discard these vertices with probability $O(1)$). Note that discarding each vertex with probability $o(1)$, only removes at most $o(n)$ vertices during the whole nibble process, so it will not affect the conclusion of Proposition~\ref{prop:weightnibble}.} \end{itemize} Let $M_i$ be the set of edges $e \in B_i$ such that for each $f \in B_i$, either $e=f$ or $e \cap f \in S$. Here, $M_i$ will be the collection of disjoint stars, where each star is a sunflower centered at a special vertex. \begin{remark} During the nibble process, if we choose $e v_1^i \dots v_K^i$ into $E(M_i)$, then it implies that an edge $e \in E(H_1)$ is coloured by the colour $i$. So the sunflower centered at a special vertex means that the edge corresponding to the sunflower, is coloured by multiple colours. \end{remark} Let $R_i'$ be the set of 1-weight special vertices in $H_{i-1}$ chosen with probability $\sim 1 - \frac{1 - e^{-K}}{1 - \frac{e^{-K}}{2}}$. (i.e., one may regard $R_i'$ as a waste set for 1-weight special vertices.) Let $R_i := V(M_i) \cup R_i'$. Now we may define the \emph{$i$th hypergraph} to be $F_i := F_{i-1} - R_i$, and let $D_i(v)$ be the weighted degree of $v$ in $F_i$ for $v \in V(F_i)$. \begin{remark} Since each 1-weight special vertex has the weighted degree smaller than other types of the vertices, it has a smaller probability to be chosen in $M_i$ than other vertices. In order to make the survival probability in $F_i$ uniform for all vertices, we should choose some of 1-weight special vertices to be removed. \end{remark} We should check that the following properties hold. \begin{itemize} \item[$(\rm A)$] In order to satisfy $e \in E(M_i)$, first we should ensure that all other edges $f \in E(H_{i-1})$ sharing a non-special vertex with $e$ must not be in $B_i$, which has probability $\sim \left ( 1 - \frac{1}{D_{i-1}} \right )^{KD_{i-1}} \sim e^{-K}$ since there are $K$ non-special vertices in $e$ and each non-special vertex in $H_{i-1}$ has weighted degree $\sim D_{i-1}$. Since $e$ itself should be in $B_i$, we should also multiply $\mathbb{P}(e \in B_i)$, which depends on whether $e$ has 1-weight or 2-weight. In summary, for each 1-weight edge $e \in E(F_{i-1})$, the probability that $e \in E(M_i)$ is $$\sim \frac{1}{D_{i-1}} \left ( 1 - \frac{1}{D_{i-1}} \right )^{KD_{i-1}} \sim \frac{e^{-K}}{D_{i-1}}.$$ For each 2-weight edge $e \in E(F_{i-1})$, the probability that $e \in E(M_i)$ is $$\sim \left (1 - \left (1 - \frac{1}{D_{i-1}} \right )^2 \right ) \left ( 1 - \frac{1}{D_i} \right )^{KD_{i-1}} \sim \frac{2e^{-K}}{D_{i-1}}.$$ \item[$(\rm B)$] For each non-special vertex $v$, the probability that $v \in V(M_i)$ is \\ \begin{equation*} \sum_{v \in e} \mathbb{P}(e \in E(M_i)) \sim \left ( 1 - \frac{1}{D_{i-1}} \right )^{KD_{i-1}} \sim e^{-K}, \end{equation*} since $v$ has weighted degree $\sim D_{i-1}$. Hence we have the {\bf survival probability} $\mathbb{P}(v \in V(F_i)) = \mathbb{P}(v \notin V(M_i)) \sim 1 - e^{-K}$. \item[$(\rm C)$] For each 1-weight special vertex $v$, the probability that $v \in V(M_i)$ is \begin{equation*} \sum_{v \in e} \mathbb{P}(e \in E(M_i)) \sim \frac{1}{2} \left ( 1 - \frac{1}{D_{i-1}} \right )^{KD_{i-1}} \sim \frac{e^{-K}}{2}, \end{equation*} since $v$ has weighted degree $\sim D_{i-1} / 2$. However, in order that $v \in V(F_i)$, the vertex $v$ should not be in $R_i'$. Hence we have the {\bf survival probability} \begin{equation*} \mathbb{P}(v \in V(F_i)) = 1 - \mathbb{P}(v \notin V(M_i))\mathbb{P}(v \notin R_i') \sim 1 - \left ( 1 - \frac{e^{-K}}{2} \right ) \frac{1 - e^{-K}}{1 - \frac{e^{-K}}{2}} = 1 - e^{-K}. \end{equation*} \item[$(\rm D)$] For each 2-weight special vertex $v$, the probability that $v \in V(M_i)$ is \begin{equation*} \sum_{v \in e} \mathbb{P}(e \in E(M_i)) \sim \left ( 1 - \frac{1}{D_{i-1}} \right )^{KD_{i-1}} \sim e^{-K}, \end{equation*} since $v$ has weighted degree $\sim D_{i-1}$. Hence we have the {\bf survival probability} $\mathbb{P}(v \in V(F_i)) = \mathbb{P}(v \notin V(M_i)) \sim 1 - e^{-K}$. \item[$(\rm E)$] For any vertex $v \in V(F_i)$, in order that an edge $e$ incident to $v$ still remains in $F_i$, all the other vertices $e \setminus \{v \}$ should be in $F_i$, which has the probability $\sim (1 - e^{-K})^K$ by $(\rm 2)$, $(\rm 3)$, and $(\rm 4)$. Hence the expected weight degree of $v \in V(H_i)$ in $H_i$ will be \begin{equation*} \mathbb{E}[D_i(v)] = \sum_{v \in e} w(e) \mathbb{P}(e \subseteq V(F_i)) \sim \sum_{v \in e} w(e) (1 - e^{-K})^K = (1 - e^{-K})^K D_{i-1}(v). \end{equation*} Hence if $v$ is non-special or 2-weight special, then \begin{equation*} \mathbb{E}D_i(v) \sim (1 - e^{-K})^K D_{i-1}. \end{equation*} Otherwise if $v$ is 1-weight special, then \begin{equation*} \mathbb{E}D_i(v) \sim (1 - e^{-K})^K \frac{D_{i-1}}{2}. \end{equation*} We may use the martingale inequality to show that $D_i(v)$ is concentrated around $\mathbb{E}[D_i(v)]$, i.e., $D_i(v) \sim \mathbb{E}D_i(v)$. Hence we may deduce $D_i \sim (1 - e^{-K})^K D_{i-1}$. \end{itemize} Now we determine the final index $\omega$ of the iteration of the nibble process. Let $\omega$ be the index satisfying \begin{equation}\label{eqn:index} (1 - e^{-K}) \varepsilon \leq (1 - e^{-K})^\omega < \varepsilon. \end{equation} Under the assumption that $(\rm A)$--$(\rm E)$ holds at the $i$th nibble process for all $1 \leq i \leq \omega$ with high probability, now we can prove the consequences of Proposition~\ref{prop:weightnibble}. \begin{proof}[Proof of Proposition~\ref{prop:weightnibble}] For each vertex $v \in E(H)$, we may identify the set of edges in $H$ incident to $v$ with their corresponding special vertices. For each vertex $v$ and $0 \leq j \leq \omega$, let $E_j^2(v)$ be the set of 2-weight edges incident to $v$ in $V(F_j)$ and $M_j(v) := |E_j^2(v)|$. In order to make all the concentration inequalities hold with high probability, we need the assumption that $M_0(v) \geq \varepsilon n$; otherwise the conclusion holds trivially. For each element $w \in E_{j-1}^2(v)$, either we \begin{itemize} \item colour $w$ (i.e., put in $M_j$), or \item pass $w$ to te next set $E_j^2(v)$ without colouring it. \end{itemize} Hence after $j$th step, the number of uncoloured 2-weight edges incident to $v$ is $M_j(v) = |E_j^2(v)|$. By $(\rm D)$, we have \begin{equation*} \mathbb{E}M_j(v) \sim (1 - e^{-K}) M_{j-1}(v), \end{equation*} and using the martingale inequality, one can show the concentration $M_j(v) \sim \mathbb{E}M_j(v)$. Thus we have \begin{equation}\label{eqn:numuncol_2wgt} M_j(v) \sim (1 - e^{-K})^j M_0(v). \end{equation} Hence for each $v \in V(H)$, the number of uncoloured 2-weight edges incident to $v$ after $\omega$th nibble process, will be \begin{equation*} M_\omega(v) \sim (1 - e^{-K})^\omega \cdot n_2 \leq \varepsilon n, \end{equation*} by~\eqref{eqn:index} and~\eqref{eqn:numuncol_2wgt}, as desired.\\ Now we may estimate the number of uncoloured 1-weight edges incident to a vertex in $H$ after $\omega$th process. For each vertex $v$ and $0 \leq j \leq \omega$, let $E_j^1(v)$ be the set of 1-weight edges incident to $v$ in $V(F_j)$ and $N_j(v) := |E_j^1(v)|$. In order to make all the concentration inequalities hold with high probability, we need the assumption that $N_0(v) \geq \varepsilon n$; otherwise the conclusion holds trivially. Note that for each element $w \in E_{j-1}(v)$, either we \begin{itemize} \item colour $w$ (i.e., put in $M_j$), or \item delete $w$ (i.e., put in $R_j' \setminus V(M_j)$), or \item pass $w$ to the next set $E_j^1(v)$ without colouring it. \end{itemize} Hence after $i$th nibble process, the number of uncoloured 1-weight edges incident to $v$, will be at most \begin{center}\label{eqn:numuncol} (\# of elements in $E_i^1(v)$) + (\# of elements in $\bigcup_{j=1}^i E_{j-1}^1(v) \cap (R_j' \setminus V(M_j))$), \end{center} In order to estimate the number of elements in~\eqref{eqn:numuncol}, we prove the following claim. \begin{claim}\label{claim:estimate_uncol} We have the following for $1 \leq j \leq \omega$. \begin{itemize} \item There are $\frac{e^{-K}}{2} \cdot N_{j-1}(v)$ elements in $E_{j-1}^1(v) \cap (R_j' \setminus V(M_j))$. \item We have $N_j(v) \sim (1 - e^{-K}) N_{j-1}(v) \sim (1 - e^{-K})^j N_0(v)$. \end{itemize} \end{claim} \begin{proof}[Proof of Claim] Now we prove each statement of the proof. \begin{itemize} \item By $(\rm C)$, since each 1-weight special vertex is chosen in $M_j$ with probability $e^{-K}/2$, hence roughly $\frac{e^{-K}}{2} \cdot N_{j-1}(v)$ 1-weight elements in $E_{j-1}^1(v)$ are expected to be in $M_j$, i.e., coloured at $j$th nibble process. Hence among the other $\left ( 1 - \frac{e^{-K}}{2} \right ) \cdot N_{j-1}(v)$ elements in $E_{j-1}^1(v)$ not in $M_j$, they are put in $R_j'$ with probability $\frac{\frac{e^{-K}}{2}}{1 - \frac{e^{-K}}{2}}$, so we may expect \begin{equation*} \sim \frac{\frac{e^{-K}}{2}}{1 - \frac{e^{-K}}{2}} \cdot \left ( 1 - \frac{e^{-K}}{2} \right ) \cdot N_{j-1}(v) = \frac{e^{-K}}{2} N_{j-1}(v) \end{equation*} elements in $E_{j-1}^1(v) \cap (R_j' \setminus V(M_j))$ as desired. \item As an induction hypothesis, firstly we may assume that \begin{equation*} N_{j-1}(v) \sim (1 - e^{-K})^{j-1} N_0(v). \end{equation*} By $(\rm C)$, we have \begin{equation*} \mathbb{E}N_j(v) \sim (1 - e^{-K}) N_{j-1}(v) \end{equation*} for each vertex $v \in V(H)$. By the martingale inequality, we have $N_j(v) \sim \mathbb{E}N_j(v)$. Thus $N_j(v) \sim (1 - e^{-K}) N_{j-1}(v) \sim (1 - e^{-K})^j N_0(v)$ by induction hypothesis. \end{itemize} \end{proof} Thus by the equation~\eqref{eqn:numuncol} and Claim~\ref{claim:estimate_uncol}, we can estimate the number of uncoloured edges incident to $v$ after $i$th nibble process as follows. \begin{align}\label{eqn:rem1wgt} N_i(v) + \sum_{j=1}^{i} \frac{e^{-K}}{2}N_{j-1}(v) & \sim (1 - e^{-K})^i \cdot N_0(v) + \sum_{j=1}^i \frac{e^{-K}}{2} (1 - e^{-K})^{j-1} \cdot N_0(v) \nonumber \\ & < \left [(1 - e^{-K})^i + \frac{e^{-K}}{2} \cdot \frac{1 - (1 - e^{-K})^{i}}{e^{-K}} \right ] N_0(v) \nonumber \\ & = \left ( \frac{(1 - e^{-K})^i}{2} + \frac{1}{2} \right ) N_0(v). \end{align} Hence after $\omega$th nibble process, since $(1 - e^{-K})^\omega < \varepsilon$ by~\eqref{eqn:index}, the equation~\eqref{eqn:rem1wgt} is at most $\frac{1+\varepsilon}{2} N_0(v)$. This shows that roughly a half of 1-weight edges incident to $v$ are coloured. \end{proof} \section{Absorption}\label{absorption-section} \tom{The point of the first subsection is to describe several quasirandomness conditions that we need to hold for a set of matchings and reserved edges that enable us to absorb. The second subsection has two lemmas that essentially say that provided the matchings and absorber are quasirandom, we can absorb. The last subsection is for huge and giant edges.} \subsection{Quasirandom properties for absorption} \begin{definition}[Quasirandom properties] Let $G$ be an $n$-vertex graph, let $\cV$ be a set of subsets of $V(G)$, and let $R\subseteq E(G)$. We say $R$ is \begin{itemize} \item \textit{$(\rho, \xi, G)$-typical with respect to $\cV$} if for every $X\in \cV$, every vertex $v$ is incident to $\rho|N_G(v)\cap X| \pm \xi n$ edges $vx\in R$ where $x\in X$ and $\rho|N_G(v)\setminus X| \pm \xi n$ edges $vy\in R$ where $y \in V(G)\setminus X$, \item \textit{lower $(\rho, \xi, G)$-regular} if for every pair of disjoint sets $S, T\subseteq V(G)$ with $|S|, |T| \geq \xi n$, we have $|e_G(S, T)\cap R| \geq \rho e_G(S, T) - \xi |S||T|$, \item \textit{upper $(\rho, \xi, G)$-regular} if for every pair of disjoint sets $S, T\subseteq V(G)$ with $|S|, |T| \geq \xi n$, we have $|e_G(S, T)\cap R| \leq \rho e_G(S, T) + \xi |S||T|$, and \item \textit{$(\rho, \xi, G)$-regular} if $R$ is both lower $(\rho,\xi,G)$-regular and upper $(\rho,\xi,G)$-regular. \end{itemize} We often omit the parameter $G$ if the graph $G$ is clear from the context. We also say a graph $H$ is lower/upper $(\rho, \xi)$-regular if $E(H)$ is lower/upper $(\rho, \xi, K_{|V(H)|})$-regular, respectively. \end{definition} \tom{In the end, $\cV$ will consist of $V(\cH)$, $V^{(1 - \eps)}_+(\cH)$, and something related to the color classes containing huge edges.} \begin{definition}[Absorbers] Let $\cH$ be a hypergraph, let $G\coloneqq \cH^{(2)}$, let $G'$ be the spanning subgraph of $G$ consisting of edges with at least one end in $V^{(1 - \eps)}_+(G)$, and let $\cV$ be a set of subsets of $V(\cH)$. If $R_{\mathrm{abs}} \subseteq E(G')$ satisfies \begin{enumerate}[(i)] \item $R_{\mathrm{abs}}$ is a $(\rho, \xi, G')$-typical subgraph with respect to $\cV$ and \item $R_{\mathrm{abs}}$ is $(\rho, \xi, G')$-regular, \end{enumerate} then we say $R_{\mathrm{abs}}$ is a \textit{$(\rho, \xi, \eps)$-absorber for $\cV$}. In this section, we simply refer to a $(\rho, \xi, \eps)$-absorber as an \textit{absorber}, when $\rho$, $\xi$, and $\eps$ are clear from the context. \end{definition} \tom{edges in the absorber are used to augment matchings to cover vertices in $U$} \begin{definition} Let $\cH$ be an $n$-vertex linear hypergraph. We let $\cHreg$ be the multi-hypergraph obtained from $\cH$ by adding $\max\{n - 2 - d_{\cH}(v), 0\}$ singleton edges containing $v$ for every vertex $v$. \end{definition} \tom{The singleton edges correspond to ``dummy edges'' that we add in Section~\ref{small-non-graph-section} to make $\cH$ regular.} \begin{definition} Let $\cH$ be an $n$-vertex hypergraph, let $G\coloneqq \cH^{(2)}$, let $U\coloneqq V^{(1 - \eps)}_+(G)$ , let $U^- \coloneqq U\setminus V^{(n - 1)}_+(\cH)$, and let $R\subseteq E(G)$. Let $\cM$ be a set of edge-disjoint matchings $M_1, \dots, M_t$ in $\cHreg$. \begin{itemize} \item We say $\cM$ has \textit{nearly-perfect coverage of $U$} if \begin{enumerate}[(i)] \item every $u\in U$ is covered by at least $t - 1$ of the $M\in\cM$ and \item every $M\in\cM$ covers all but at most one vertex of $U$. \end{enumerate} \item We say $\cM$ has \textit{perfect coverage of $U$} if $\cM$ has nearly-perfect coverage of $U$ and, moreover, every vertex of $U\setminus U^-$ is covered by every $M\in\cM$. \item Let $U^{\mathrm{cov}}_\cM$ be the subset of $u\in U$ such that $u$ is covered by every $M\in\cM$. \item If every $u \in U$ satisfies $|\{e \in R : e\ni u\}\cap (\cup_{M\in\cM}M)| \leq 10 \gamma n$ , then $\cM$ \textit{preserves $R$}. \item We let $\cF(R, \cM) \coloneqq \cF$ denote the family of sets where \begin{equation*} \cF \coloneqq \bigcup_{u\in U}\left\{\{v \in N_R(u)\cap U : uv\notin \cup_{M\in\cM}M\}, \{v \in N_R(u)\setminus U : uv\notin \cup_{M\in\cM}M\}\right\}. \end{equation*} \end{itemize} (Abuse of notation again -- the $\gamma$ and $\eps$ are implicit in the definition) \end{definition} \tom The nearly-perfect coverage condition implies that the max degree is at most $n - t$. The $U^{\mathrm{cov}}_\cM$ is the ``unmarked vertices'', so perfect coverage means the max degree is at most $n - 1 - t$. In application, $R$ will be an absorber. The set $\cF(R, \cM)$ contains all the sets for which we need a pseudorandom property of the matching to absorb it with nearly-perfect coverage. For perfect coverage, we also need pseudorandomness with respect to unmarked $U^-$ vertices.} \begin{definition} Let $\cH$ be an $n$-vertex hypergraph, let $G\coloneqq \cH^{(2)}$, let $U\coloneqq V^{(1 - \eps)}_+(G)$ , let $U^- \coloneqq U\setminus V^{(n - 1)}_+(\cH)$, let $R\subseteq E(G)$, and let $\cM \coloneqq \{M_1, \dots, M_t\}$ be a set of matchings in $\cHreg$. Let $\cN \coloneqq \{N_1, \dots, N_k\}$ be a set of matchings in $\cH$. \begin{itemize} \item If the matchings in $\cN\cup\cM$ are pairwise edge-disjoint, then we say $\cN$ \textit{respects} $\cM$. \item If every $N\in \cN$ is either $(\gamma , \kappa)$-pseudorandom or $(1 - \gamma, \gamma)$-pseudorandom with respect to $\cF(R, \cM)\cup \{U, U^-\cap U^{\mathrm{cov}}_\cM\}$, then we say $\cN$ \textit{is pseudorandom with respect to $R$ and $\cM$}. \label{respectful-reservoir-property} \end{itemize} If $\cN$ respects $\cM$ and is pseudorandom with respect to $R$ and $\cM$, then we say $(\cH, \cM, R, \cN)$ is \textit{absorbable}. \end{definition} \tom{the idea here is to use the pseudorandomness with respect to $\cF(R, \cM) \cup\{U\}$ to absorb it. If $\cN$ is also pseudorandom with respect to $U^-\cap U^{\mathrm{cov}}_\cM$, then we don't have to mark a full-degree vertex if $|U^-|$ is bigger than $t + k + \kappa n$. Note that small color classes also satisfy~\ref{respectful-reservoir-property} because they are $(1 - \gamma , \gamma)$-pseudorandom. The matchings in $\cN$ will include large edges, which will affect the pseudorandomness, but only by $\xi n$, which is lower order} \subsection{Main absorption lemmas} \tom{Two lemmas in this subsection: The first will be for $U$ small, applied to absorb pseudorandom matchings or small color classes, the second will be the same but for $U$ large.} \begin{lemma}\label{crossing-absorption-lemma} Let $0 < 1/n_0 \ll \xi \ll \kappa \ll \gamma \ll \rho, \eps \ll 1$, and let $n \geq n_0$. \begin{itemize} \item Let $\cH$ be an $n$-vertex hypergraph with $G\coloneqq \cH^{(2)}$, \item let $R_{\mathrm{abs}}\subseteq E(G)$ be an absorber for $\cV \coloneqq\{V(\cH), U\}$, where $U\coloneqq V^{(1 - \eps)}_+(G)$, \abhi{would it be clearer to mention the parameters of the absorber here?} \item let $\cM$ be a set of matchings in $\cHreg$ with perfect coverage of $U$ that preserves $R_{\mathrm{abs}}$, and \item let $\cN$ be a set of matchings $N_1,\dots, N_{k}$ such that $(\cH, \cM, R_{\mathrm{abs}}, \cN)$ is absorbable and $k \leq \kappa n$. \end{itemize} If $|U| \leq n / 100$, then there is a set of matchings $\cN' \coloneqq \{N'_1, \dots, N'_k\}$ respecting $\cM$ such that $N_i\subseteq N'_i$ and $E(N_i') \setminus E(N_i) \subseteq R_{\rm abs}$ for all $i\in[k]$ and $\cM \cup \cN'$ has perfect coverage of $U$. \end{lemma} \begin{lemma}\label{internal-absorption-lemma} Let $0 < 1/n_0 \ll \xi \ll \kappa \ll \gamma \ll \rho, \eps \ll 1$, and let $n \geq n_0$. \begin{itemize} \item Let $\cH$ be an $n$-vertex hypergraph with $G\coloneqq \cH^{(2)}$, \item let $R_{\mathrm{abs}}\subseteq E(G)$ be an absorber for $\cV \coloneqq\{V(\cH), U\}$, where $U\coloneqq V^{(1 - \eps)}_+(G)$, \item let $\cM$ be a set of matchings in $\cHreg$ with nearly-perfect coverage of $U$ that preserves $R_{\mathrm{abs}}$, an \item let $\cN$ be a set of matchings $N_1,\dots, N_{k}$ such that $(\cH, \cM, R_{\mathrm{abs}}, \cN)$ is absorbable and $k \leq \kappa n$. \end{itemize} If $|U| \geq n / 100$ and $|\cM| \leq (1 - 3\eps)$, then there is a set of matchings $\cN' \coloneqq \{N'_1, \dots, N'_k\}$ respecting $\cM$ such that $N_i\subseteq N'_i$ and $E(N_i') \setminus E(N_i) \subseteq R_{\rm abs}$ for all $i\in[k]$ and $\cM \cup \cN'$ has nearly-perfect coverage of $U$. Moreover, if $\cM$ has perfect coverage of $U$ and either \begin{enumerate}[(i)] \item $|U| \leq (1 - 3\eps) n$ or \label{U-not-too-big} \item $|U^-\cap U^{\mathrm{cov}}_\cM| \geq \gamma n$, where $U^- \coloneqq U\setminus V^{(n - 1)}_+(\cH)$,\label{not-too-many-full-degree} \end{enumerate} then there exists such a $\cN'$ such that $\cM\cup\cN'$ also has perfect coverage of $U$. \end{lemma} \abhi{typo above: should be $|\cM| \leq (1 - 3\eps)n$. I also wonder why don't we use the more natural bound $|\cM| \leq (1 - \rho)n$ if that is how we use it} \tom{The next two propositions save us from having to repeat arguments in the proofs of Lemmas~\ref{crossing-absorption-lemma} and~\ref{internal-absorption-lemma}. They'll also be useful for the huge edges.} \begin{proposition}\label{crossing-matching-prop} Let $0 < \xi \ll \rho \leq 1$. If $H$ is an upper $(\rho, \xi)$-regular bipartite graph with bipartition $(A, B)$ such that $|V(H)| \leq \rho|A|/\xi$ and every $v\in A$ satisfies $d_H(v) \geq 2\rho |A|$, then $H$ has a matching saturating $A$. \end{proposition} \begin{proof} By Hall's Theorem, it suffices to show that every $\varnothing \ne S\subseteq A$ satisfies $|N_H(S)| \geq |S|$. Since $|N(S)| \geq 2\rho |A| \geq \xi |V(H)|$, so we assume $|S| \geq \xi |V(H)|$. Since every $v\in A$ satisfies $d_H(v) \geq 2\rho |A|$, every $\varnothing \ne S\subseteq A$ satisfies \begin{equation*} e_{H}(S, N(S)) \geq 2\rho|S||A|. \end{equation*} However, since $H$ is upper $(\rho, \xi)$-regular and $|S|,|N(S)| \geq \xi |V(H)|$, we also have \begin{equation*} e_{H}(S, N(S)) \leq (\rho + \xi)|S|\max\{|N(S)|, \xi |V(H)|\}. \end{equation*} Combining these two inequalities, since $|V(H)| \leq \rho|A| / \xi$, we have $|N(S)| \geq |A| \geq |S|$, as desired. \end{proof} \begin{proposition}\label{internal-matching-prop} Let $0 < 1/m \ll \xi \ll \rho \leq 1$. If $G$ is an $m$-vertex, upper $(\rho, \xi)$-regular graph such that every $v\in V(G)$ satisfies $d_G(v) \geq 3\rho m / 4$, then $G$ has an optimal matching. \end{proposition} \begin{proof} If $m$ is odd, let $G'$ be obtained from $G$ by deleting any vertex, otherwise, let $G'\coloneqq G$. By a standard probabilistic argument, $G'$ has a spanning bipartite subgraph $H$ with bipartition $(A, B)$ such that $|A| = |B| = \lfloor m / 2\rfloor$ and every $v\in V(G')$ satisfies $d_{H}(v) \geq \rho m / 3$.\COMMENT{Consider such a bipartition chosen uniformly at random. The distribution of the random subset $A$ coincides with the distribution on subsets of $V(G')$ obtained by choosing each vertex to be in $A$ with probability $1/2$, conditioned on the event that $|A| = \lfloor m / 2 \rfloor$. The probability of this event is $\Theta(1/\sqrt n)$,\abhi{$n \to m$} but by Chernoff's bound, if each vertex is chosen in $A$ independently with probability $1/2$, then the probability $v$ has less than $\rho m / 3$ neighbors in $A$ is $\exp(-\Omega(n))$.\abhi{$n \to m$}} By Hall's Theorem, it suffices to show that every $S\subseteq A$ satisfies $|N(S)| \geq |S|$. If $S\neq\varnothing$, then $|N(S)| \geq \rho m / 3 \geq \xi m$, so we assume $|S| \geq \xi m$. \abhi{$n \to m$} Since every $v\in A$ satisfies $d_H(v) \geq \rho m / 3$, every $S\subseteq A$ satisfies \abhi{$H_\ell$ in the subscripts below should be just $H$} \begin{equation*} e_{H}(S, N(S)) \geq |S| \rho m / 3. \end{equation*} However, since $G$ \abhi{$R_{\mathrm{abs}} \to G$} is upper $(\rho, \xi)$-regular, we also have \begin{equation*} e_{H}(S, N(S)) \leq (\rho + \xi)|S||N(S)|. \end{equation*} Combining these two inequalities, we have $|N(S)| \geq 3 m / 10$. Let $T\coloneqq B\setminus N(S)$. If $T = \varnothing$, then $S$ satisfies the Hall condition, as desired, so we assume $T \neq \varnothing$. By the same argument applied to $T$, we have $|N(T)| \geq 3m / 10$, so $|S| \leq |A| - |N(T)| \leq m / 5$. Now $|S| \leq m / 5 \leq 3m / 10 \leq |N(S)|$, as desired. \end{proof} \begin{proof}[Proof of Lemma~\ref{crossing-absorption-lemma}] Let $R \coloneqq R_{\mathrm{abs}}\setminus \cup_{M\in\cM}M$, and for each $i\in [k]$, let $H_i$ be the bipartite graph consisting of edges in $R$ with bipartition $(A_i, B_i)$, where $A_i\coloneqq U\setminus V(N_i)$ and $B_i \coloneqq (V(\cH)\setminus U)\setminus V(N_i)$. We claim that there exist matchings $N^{\mathrm{abs}}_i$ in $H_i$ saturating $A_i$ for each $i\in[k]$ that are pairwise edge-disjoint. We find these matchings one-by-one using Proposition~\ref{crossing-matching-prop}, if $|A_i| \geq \xi n / \rho$ -- otherwise, we find them greedily. Thus, we assume that for some $\ell \leq k$, we have such matchings $N^{\mathrm{abs}}_i$ for $i\in[\ell - 1]$, and we show that there exists such a matching $N^{\mathrm{abs}}_{\ell}$, which proves the claim. Let $H'_\ell = H_\ell \setminus \cup_{i\in[\ell-1]}N^{\mathrm{abs}}_i$. We first show that every vertex $v\in A_{\ell}$ satisfies $d_{H'_\ell}(v) \geq 2\rho |A_\ell|$. Since $|U| \leq n / 100$, $R_{\mathrm{abs}}$ is an absorber, and $\cM$ preserves $R_{\mathrm{abs}}$, every $u\in U$ satisfies\COMMENT{Since $d_{G}(u) \geq (1 - \eps)n$ and $|U| \leq n / 100$, we have $|N_G(u)\setminus U| \geq (99/100 - \eps)n$. Since $R_{\mathrm{abs}}$ is $(\rho, \xi)$-typical with respect to $\cV$, we have $|N_{R_{\mathrm{abs}}}(u)\setminus U| \geq \rho|N_G(u)\setminus U| - \xi n \geq (\rho(99/100 - \eps) - \xi)n$. Since $\cM$ preserves $R$, we have $|N_R(u)\setminus U| \geq |N_{R_{\mathrm{abs}}}(u)\setminus U| - 10 \gamma n \geq (\rho(99/100 - \eps) - \xi - 10\gamma)n$.} \begin{equation}\label{absorption-lemma-degree-outside} |N_R(u) \setminus U| \geq (\rho(99/100 - \eps) - \xi - 10\gamma)n \geq 98\rho n / 100. \end{equation} Since $(\cH, \cM, R_{\mathrm{abs}}, \cN)$ is absorbable, $N_i$ is either $(\gamma , \kappa)$-pseudorandom or $(1 - \gamma, \gamma)$-pseudorandom with respect to $\cF\coloneqq \cF(R, \cM) \cup \{U\}$. First, suppose $N_i$ is $(\gamma, \kappa)$-pseudorandom with respect to $\cF$. Now by the pseudorandomness of $N_i$ combined with~\eqref{absorption-lemma-degree-outside}, every $u\in A_{\ell}$ satisfies $d_{H_{\ell}}(u) \geq \gamma |N_R(u)\setminus U| - \kappa n \geq \gamma 97 \rho n / 100$. Since $k \leq \kappa n$, we have \begin{equation}\label{absorption-lemma-degree-outside2} d_{H'_{\ell}}(u) \geq d_{H_\ell}(u) - \kappa n \geq \gamma 96 \rho n / 100. \end{equation} By the pseudorandomness of $N_i$, we also have \begin{equation}\label{crossing-absorption-lemma-part-size-bound} |A_\ell| \leq \gamma |U| + \kappa n \leq \gamma n / 50. \end{equation} Combining~\eqref{absorption-lemma-degree-outside2} and~\eqref{crossing-absorption-lemma-part-size-bound}, we have $d_{H'_\ell}(u) \geq 2\rho |A_\ell|$, as desired. If $|A_\ell| \geq \xi n / \rho$, then Proposition~\ref{crossing-matching-prop} implies $H'_\ell$ has a matching saturating $A_\ell$, as claimed, and otherwise by~\eqref{absorption-lemma-degree-outside2}, $|A_\ell| \leq d_{H_\ell'}(u)$ for any $u \in A_\ell$, so we can find such a matching greedily. If $N_i$ is $(1 - \gamma , \gamma)$-pseudorandom with respect to $\cF$, then the proof is essentially the same, where the right side of~\eqref{absorption-lemma-degree-outside2} is replaced by $96\rho n / 100$, and the right side of~\eqref{crossing-absorption-lemma-part-size-bound} is simply $(1-\gamma)|U| + \kappa n \leq n / 50$, so we still have $d_{H'_\ell}(u) \geq 2\rho |A_\ell|$ for any $u \in A_\ell$. Therefore we have pairwise edge-disjoint matchings $N_i^{\mathrm{abs}}$ in $H_i$ saturating $A_i$ for each $i\in[k]$, as claimed. For each $i\in[k]$, let ${N'}_i = N_i\cup N_i^{\mathrm{abs}}$, and let $\cN' = \{N'_1, \dots, N'_k\}$. Now $\cN$ respects $\cM$, and $\cM \cup \cN'$ has perfect coverage of $U$, as desired. \end{proof} \begin{proof}[Proof of Lemma~\ref{internal-absorption-lemma}] Let $R \coloneqq R_{\mathrm{abs}}\setminus \cup_{M\in\cM}M$. For each $i\in [k]$, let $G_i$ be the graph with vertex-set $V(\cH)\setminus V(N_i)$ and edges in $R$, and let $U_i \coloneqq U\setminus V(N_i)$. We claim there exist matchings $N^{\mathrm{abs}}_i$ in $G_i$ for each $i\in[k]$ that are pairwise edge-disjoint, cover every vertex of $U_i\setminus U^{\mathrm{cov}}_\cM$, and cover all but at most one vertex, say $u_i$, of $U_i$. Moreover, the vertices $u_i$ are distinct, and if~\ref{U-not-too-big} $|U| \leq (1 - 2\eps)n$, then $N^{\mathrm{abs}}_i$ covers every vertex of $U_i$ for all $i\in [k]$, and otherwise if~\ref{not-too-many-full-degree} $|U^-\cap U^{\mathrm{cov}}_\cM| \geq \gamma n$, then $u_i \in U^-\cap U^{\mathrm{cov}}_\cM$. First, suppose $|U\cap V(N_i)|$ is odd. For each $i\in[k]$, we pick a distinct vertex $u_i \in U_i$ , as follows. If $|U| \leq (1 - 2\eps)n$, then since $R_{\mathrm{abs}}$ is an absorber and $\cM$ preserves $R_{\mathrm{abs}}$, every $u\in U$ satisfies\COMMENT{Since $d_G(u) \geq (1 - \eps n)$ and $|U| \leq (1 - 2\eps)n$, we have $|N_G(u)\setminus U| \geq \eps n$. Since $R_{\mathrm{abs}}$ is $(\rho, \xi)$-typical with respect to $\cV$, we have $|N_{R_{\mathrm{abs}}}(u)\setminus U| \geq (\rho\eps - \xi)n$. Since $\cM$ preserves $R_{\mathrm{abs}}$, we have $|N_R(u)\setminus U| \geq |N_{R_\mathrm{abs}}(u)\setminus U| - 10\gamma n \geq (\rho\eps - \xi - 10\gamma)n$} $|N_R(u)\setminus U| \geq (\rho\eps - \xi - 10\gamma) n$. Since $N_i$ is pseudorandom with respect to $\cF(R, \cM)$ for each $i\in[k]$, this inequality implies that $|N_{G_i}(u)\setminus U| \geq \gamma \rho\eps n / 2$. Using $\kappa \ll \gamma$, we choose $u_i$ one-by-one such that there is a matching $\{u_iv_i : u_i \in U_i, v_i \in N_{G_i}(u_i)\setminus U, i\in[k]\}$. Otherwise, if $|U^-\cap U^{\mathrm{cov}}_\cM| \geq \gamma n$, then since $N_i$ is pseudorandom with respect to $U^-\cap U^{\mathrm{cov}}_\cM$, we have $|(U^-\cap U^{\mathrm{cov}}_\cM)\setminus V(N_i)| \geq \gamma^2 n /2$, so we choose $u_i \in U^-\cap U^{\mathrm{cov}}_\cM$ one-by-one to be distinct. Otherwise, since $\cM$ has nearly-perfect coverage of $U$ and $|\cM| \leq (1 - 3\eps)n$, we have $|U\setminus U^{\mathrm{cov}}_\cM| \geq |U| - |\cM| \geq \eps n$. Thus, since each $N_i$ is pseudorandom with respect to $U$ we have $|U_i\cap U^{\mathrm{cov}}_{\cM}| \geq \eps \gamma n / 2$, so we choose the $u_i \in U_i\cap U^{\mathrm{cov}}_{\cM}$ one-by-one to be distinct. Now let $U'_i \coloneqq U_i\setminus\{u_i\}$. If $|U_i|$ is even, then let $U'_i\coloneqq U_i$. By the choice of the vertices $u_i$, it suffices find pairwise edge-disjoint perfect matchings ${N'}_i^{\mathrm{abs}}$ in $G_i[U'_i]$ for each $i\in [k]$. We find these matchings one-by-one using Proposition~\ref{internal-matching-prop}. Thus, we assume that for some $\ell \leq k$, we have such matchings ${N'}^{\mathrm{abs}}_i$ for $i\in[\ell - 1]$, and we show that there exists such a matching ${N'}^{\mathrm{abs}}_{\ell}$, which proves the claim. Let $G'_\ell = G_\ell \setminus \cup_{i\in[\ell-1]}{N'}^{\mathrm{abs}}_i$. Since $|U| \geq n / 100$, $R_{\mathrm{abs}}$ is an absorber, and $\cM$ preserves $R_{\mathrm{abs}}$, every $u\in U$ satisfie \begin{equation}\label{internal-absorption-degree-outside} |N_R(u) \cap U| \geq \rho(|U| - \eps n) - 10\gamma n - \xi n \geq 99 \rho |U| / 100. \end{equation} Since $(\cH, \cM, R_{\mathrm{abs}}, \cN)$ is absorbable, $N_i$ is either $(\gamma , \kappa)$-pseudorandom or $(1 - \gamma, \gamma)$-pseudorandom with respect to $\cF\coloneqq \cF(R, \cM) \cup \{U\}$. First, suppose $N_i$ is $(\gamma , \kappa)$-pseudorandom with respect to $\cF$. Now by the pseudorandomness of $N_i$ combined with~\eqref{internal-absorption-degree-outside}, every $u\in U'_{\ell}$ satisfies $d_{G_{\ell}[U_\ell']}(u) \geq \gamma |N_R(u)\cap U| - 1 - \kappa n \geq \gamma 98 \rho |U| / 100$. Since $k \leq \kappa n$, we have \begin{equation}\label{internal-absorption-degree-outside2} d_{G'_{\ell}[U_\ell']}(u) \geq d_{G_\ell}(u) - \kappa n \geq \gamma 97 \rho |U| / 100. \end{equation} By the pseudorandomness of $N_i$, we also have \begin{equation}\label{internal-absorption-lemma-part-size-bound} |U'_\ell| \leq 5\gamma |U| / 4. \end{equation} Combining~\eqref{internal-absorption-degree-outside2} and~\eqref{internal-absorption-lemma-part-size-bound}, we have $d_{G'_\ell[U_\ell']}(u) \geq 3\rho|U'_\ell| / 4$, so by Proposition~\ref{internal-matching-prop}, $G'_\ell[U_\ell']$ has a perfect matching, as desired. If $N_i$ is $(1 - \gamma, \gamma)$-pseudorandom with respect to $\cF$, then the proof is essentially the same, where the right side of~\eqref{internal-absorption-degree-outside2} is replaced by $96\rho |U| / 100$, and the right side of~\eqref{internal-absorption-lemma-part-size-bound} is simply $(1-\gamma)|U| + \gamma n \leq (1+99\gamma)|U|$, so we still have $d_{G'_\ell[U_\ell']}(u) \geq 3\rho|U'_\ell| / 4$ for any $u \in U_\ell'$. Therefore we have pairwise edge-disjoint matchings $N_i^{\mathrm{abs}}$ in $G_i$ that cover every vertex of $U\setminus U^{\mathrm{cov}}_\cM$ and all but at most one vertex $u_i\in U_i$, as claimed. For each $i\in[k]$, let $N'_i = N_i\cup N_i^{\mathrm{abs}}$, and let $\cN' = \{N'_1, \dots, N'_k\}$. Now $\cN$ respects $\cM$, and $\cM \cup \cN'$ has nearly-perfect coverage of $U$, as desired. Moreover, if~\ref{U-not-too-big} $|U| \leq (1 - 2\eps) n$ or~\ref{not-too-many-full-degree} $|U^-\cap U^{\mathrm{cov}}_\cM| \geq \gamma n$ and $\cM$ has perfect coverage of $U$, then either $u_i$ is covered by $N_i^{\mathrm{abs}}$ or $u_i \in U^-\cap U^{\mathrm{cov}}_\cM$, so $\cM\cup \cN'$ also has perfect coverage of $U$, as desired. \end{proof} \subsection{Absorption of huge edges} \tom{In this subsection we show how to absorb color classes containing huge edges. We need the following definition, which will be applied to these color classes.} \begin{definition} Let $\cH$ be an $n$-vertex hypergraph, let $G\coloneqq \cH^{(2)}$, and let $U\coloneqq V^{(1 - \eps)}_+(G)$. A matching $M$ in $\cH$ is \textit{difficult} if it covers at least three-fourths of the vertices in $V(\cH)\setminus U$ and $|V(\cH)\setminus U| \geq 2$. If the matching $M$ consists of a single edge $e$, then $e$ is \textit{difficult}. \end{definition} \tom{In the proof of Theorem~\ref{main-thm}, we need to consider a separate case when absorbing a color class containing a huge edge, if it is difficult. Note that if $\cH$ is a linear hypergraph, then it contains at most one difficult edge. Thus, if~\ref{non-extremal-colouring} holds for $\cH_{\mathrm{large}}$, then the coloring has at most one difficult color class. If~\ref{extremal-colouring} holds, then $|V^{(1 - \eps)}(\cH)| \leq \delta n$, so the coloring has no difficult color classes.} \tom{We use the fact that it's not ``difficult'' in the case when $|U\setminus V(M)| \geq n / 100$. Here we want to find a matching within $U\setminus V(M)$, but it may have odd cardinality. If $|U| \leq (1 - 10\eps)n$, then we'll be able to find a crossing edge to fix the parity problem since $M$ isn't difficult. Otherwise, we'll mark a non-full-degree vertex if possible. In this case, $U$ is large, so $M$ contains $O(\eps n)$ vertices of $U$. We should absorb the huge color classes first, because if we do them last we might have all the unmarked non-full-degree inside $M$. We absorb a difficult matching more generally as we would a giant edge.} \begin{lemma}\label{huge-edge-absorption-lemma} Let $0 < 1/n_0 \ll \xi \ll \gamma \ll \rho, \eps \ll 1$, and let $n \geq n_0$. \begin{itemize} \item Let $\cH$ be an $n$-vertex hypergraph with $G\coloneqq \cH^{(2)}$, \item let $M$ be a matching that is not difficult , \item let $R_{\mathrm{abs}}$ be an absorber for $\cV \coloneqq\{V(\cH), U, U\cup V(M), U\setminus V(M)\}$, where $U\coloneqq V^{(1 - \eps)}_+(G)$, and \item let $\cM$ be a set of matchings in $\cHreg$ with nearly-perfect coverage of $U$ that preserves $R_{\mathrm{abs}}$. \end{itemize} If $M$ respects $\cM$, $|\cM| \leq (1 - 12\eps)n$, and $M$ covers at most $\eps n$ vertices of $U$, then there is a matching $M'$ such that $M\subseteq M'$ and $\cM\cup\{M'\}$ has nearly-perfect coverage of $U$. Moreover, if $\cM$ has perfect coverage of $U$ and either \begin{enumerate}[(i)] \item $|U| \leq (1 - 10\eps) n$ or \label{huge-case-U-not-too-big} \item $|(U^-\cap U^{\mathrm{cov}}_\cM)\setminus V(M)| > 0$, where $U^- \coloneqq U\setminus V^{(n - 1)}_+(\cH)$,\label{huge-case-not-too-many-full-degree} \end{enumerate} then there exists such a $M'$ such that $\cM\cup\{M'\}$ also has perfect coverage of $U$. \end{lemma} \begin{proof} Let $R \coloneqq R_{\mathrm{abs}}\setminus \cup_{M\in\cM}M$. First suppose $|U\setminus V(M)| \leq n / 100$. Let $H$ be the bipartite graph consisting of edges in $R$ with bipartition $(A, B)$ where $A\coloneqq U\setminus V(M)$ and $B\coloneqq (V(\cH)\setminus U)\setminus V(M)$. We claim that there is a matching $M^{\mathrm{abs}}$ in $H$ saturating $A$. Since $M$ is not difficult and covers at most $\eps n$ vertices of $U$, we have $|V(M)| \leq (3/4 + \eps)n \leq 4n/5$. Thus, $|B| \geq n - |V(M)| - |U\setminus V(M)| \geq n/6$. Thus, since $R_{\mathrm{abs}}$ is $(\rho, \xi)$-typical with respect to $U\cup V(M)$ and $\cM$ preserves $R_{\mathrm{abs}}$, every $u \in A$ satisfies \begin{equation*} d_{H}(v) \geq (\rho(1/6 - \eps) - \xi - 10\gamma)n \geq \rho n / 7 \geq 2\rho |A|. \end{equation*} Therefore by Proposition~\ref{crossing-matching-prop}, we have a matching $M^{\mathrm{abs}}$ in $H$ saturating $A$, as claimed\COMMENT{If $|A| \leq \xi n / \rho$, then we can find it greedily.}, so let $M' = M\cup M^{\mathrm{abs}}$. Now $\cM\cup\{M'\}$ has nearly-perfect coverage of $U$, and if $\cM$ has perfect coverage of $U$, then so does $\cM\cup\{M'\}$, as required. Therefore we assume $|U\setminus V(M)| \geq n / 100$. Let $G'$ be the graph with vertex-set $V(\cH)\setminus V(M)$ and edges in $R$. We claim there exists a matching $M^{\mathrm{abs}}$ in $G'$ that covers every vertex of $(U\setminus U^{\mathrm{cov}}_\cM)\setminus V(M)$ and all but at most one vertex, say $v$, of $U\setminus V(M)$. Moreover, if~\ref{huge-case-U-not-too-big} $|U| \leq (1 - 10\eps)n$, then $M^{\mathrm{abs}}$ covers every vertex of $U\setminus V(M)$, and otherwise if~\ref{huge-case-not-too-many-full-degree} $|(U^-\cap U^{\mathrm{cov}}_\cM)\setminus V(M)| > 0$, then $v \in U^-\cap U^{\mathrm{cov}}_\cM$. First, suppose $|U\setminus V(M)|$ is odd. We choose $v \in U\setminus V(M)$, as follows. If $|U| \leq (1 - 10\eps)n$, then since $M$ is not difficult, we have $|V(\cH)\setminus (U\cup V(M))| \geq 2\eps n$, which implies that every $u\in U$ satisfies $|N_G(u) \setminus (U\cup V(M))| \geq \eps n$. Thus, since $R_{\mathrm{abs}}$ is $(\rho, \xi)$-typical with respect to $U\cup V(M)$ and $\cM$ preserves $R_{\mathrm{abs}}$, we have $|N_{G'}(u) \setminus U| \geq 1$. We choose $v\in U\setminus V(M)$ arbitrarily, and we let $v' \in |N_{G'}(v) \setminus U|$. Otherwise, if $|(U^-\cap U^{\mathrm{cov}}_\cM)\setminus V(M)| > 1$, then we choose $v \in (U^-\cap U^{\mathrm{cov}}_\cM))\setminus V(M)$. Otherwise, since $\cM$ has nearly-perfect coverage of $U$ and $|\cM \leq (1 - 12\eps)n$, we have $|(U\setminus U^{\mathrm{cov}}| \geq |U| - |\cM| \geq 2\eps n$, and since $M$ covers at most $\eps n$ vertices of $U$, we can choose $v\in (U\setminus U^{\mathrm{cov}}_\cM)\setminus V(M)$. Now let $U' \coloneqq (U\setminus V(M))\setminus\{v\}$. If $|U\setminus V(M)|$ is even, then let $U'\coloneqq U\setminus V(M)$. Let $G'' \coloneqq G'[U']$. Since $|U'| \geq n / 100 - 1$, $R_{\mathrm{abs}}$ is an absorber, and $\cM$ preserves $R_{\mathrm{abs}}$, every $u\in U$ satisfie \begin{equation*} |N_R(u) \cap U'| \geq \rho(|U \setminus V(M)| - \eps n) - 1 - 10\gamma n - \xi n \geq 3 \rho |U'| / 4, \end{equation*} so by Proposition~\ref{internal-matching-prop}, $G''$ has a perfect matching. By possibly adding the edge $vv'$ to this matching, we have the matching $M^{\mathrm{abs}}$ in $G'$ as claimed. Let $M' \coloneqq M\cup M^{\mathrm{abs}}$. Now $\{M'\}$ respects $\cM$ and $\cM \cup \{M'\}$ has nearly-perfect coverage of $U$, as desired. Moreover, if~\ref{huge-case-U-not-too-big} $|U| \leq (1 - 10\eps) n$ or~\ref{huge-case-not-too-many-full-degree} $|(U^-\cap U^{\mathrm{cov}}_\cM)\setminus V(M)| > 0$ and $\cM$ has perfect coverage of $U$, then $\cM\cup \{M'\}$ also has perfect coverage of $U$. \end{proof} \begin{lemma}\label{difficult-edge-absorption} Let $0 < 1/n_0 \ll \xi \ll 1$. If $\cH$ is an $n(\geq n_0)$-vertex linear hypergraph and $M \coloneqq \{e\}$ is a difficult matching where $e$ is huge, then at least one of the following holds: \begin{enumerate}[(\ref{difficult-edge-absorption}:a), topsep = 6pt] \item There is a matching $M'$ such that $M\subseteq M'$ and $M'$ covers every vertex of $V^{(n - 1)}_+(\cH)$ and all but at most five vertices of $V^{(n - 2)}_+(\cH)$, or\label{difficult-edge-covering} \item $\chi'(\cH) \leq n$.\label{difficult-edge-extremal} \end{enumerate} \end{lemma} \begin{proof} Let $G\coloneqq \cH^{(2)}$, let $U_1 \coloneqq V^{(n - 1)}_+(\cH)$, let $U_2 \coloneqq V^{(n - 2)}_+(\cH)\setminus U_1$, let $X = V(\cH)\setminus (e\cup U_1\cup U_2)$, and let $m\coloneqq |U_1\cup U_2|$. Since $\cH$ is linear, $e \cap U_i = \varnothing$ for $i\in\{1, 2\}$. First, suppose $U_2 = \varnothing$. If $|U_1|$ is even, then we can find a perfect matching $M_1$ in $G[U_1]$, and $M' \coloneqq M \cup M_1$ satisfies~\ref{difficult-edge-covering}, so we assume $|U_1|$ is odd. If $X\neq\varnothing$, then there is an edge $uv \in E(G)$ such that $u\in U_1$ and $v \in X$ and a perfect matching $M_1$ in $G[U_1\setminus\{u\}]$. Now $M'\coloneqq M\cup M_1\cup \{uv\}$ satisfies~\ref{difficult-edge-covering}, so we assume $X = \varnothing$, and we show $\chi'(\cH) \leq n$. Note that if $X, U_2 = \varnothing$, then the only edge in $\cH\setminus E(G)$ is $e$. Let $M_1$ be an optimal matching in $G[U_1]$, and let $G' = \cH\setminus(M_1\cup e)$. Now $G'$ is a graph with at most one vertex of degree $n - 1$, so by Theorem~\ref{thm:vizing}, $\chi'(G') \leq n - 1$. By combining a proper $(n - 1)$-edge-coloring of $G'$ with a color class consisting of $M_1\cup e$, we have $\chi'(\cH) \leq n$, as desired. Therefore we assume $U_2\neq\varnothing$, and let $u \in U_2$. Let $G'\coloneqq G[U_1 \cup U_2] - u$ if $m$ is odd and let $G' \coloneqq G[U_1\cup U_2]$ otherwise. If $G'$ has a perfect matching, then~\ref{difficult-edge-covering} holds, so we assume not. Thus, by the Tutte-Berge formula, there is a set $S$ such that $G' - S$ has at least $|S| + 2$ odd components.\COMMENT{since $G'$ has an even number of vertices} Since every vertex has degree at least $|V(G')| - 3$ in $G'$, we have $|S| \leq 1$. Moreover, if $|S| = 1$, then $|V(G')| = 4$ and the vertices in $V(G')\setminus S$ form a hyperedge of $\cH$. In this case $G$ is a star on four vertices, so $|U_2| \leq 5$ and $|U_1| \leq 1$. If $U_1 = \varnothing$, then $M'\coloneqq M$ satisfies~\ref{difficult-edge-covering}, and otherwise, $M'\coloneqq M\cup\{uv\}$ where $v\in U_1$, satisfies~\ref{difficult-edge-covering}, as desired. If $S = \varnothing$, then $G'$ is a graph with two vertices and no edges. In this case, $U_1 = \varnothing$, so $M' \coloneqq M$ satisfies~\ref{difficult-edge-covering}. \end{proof} \begin{comment} Now we aim to mark at most one vertex of degree $n-2$ from $U'$ and find a matching $M$ outside $R$ that covers all vertices in $U'$ except the marked one, as follows. \begin{itemize} \item If all vertices in $U'$ have degree $n-1$, $U = U'$ and $R = \overline{U}$, then this extremal example can be coloured with $n$ colours, as follows. \begin{itemize} \item Colour $R$ with an 1 colour. \item Colour the edges of the complete bipartite graph between $U$ and $R$ with $|R|$ colours. \item Colour the edges in $U$ with $|U|+1$ colours. Here, we reuse the colour of $R$, which allows to save one colour. \end{itemize} In total, the number of colours we use is $1 + |R| + (|U|+1) - 1 = |R| + |U| = n$, as desired. In particular, we can colour the hypergraph with $n-1$ colours when $|U|$ is even, since the edges in $U$ can be coloured with $|U|-1$ colours for this case. \item If all vertices in $U'$ have degree $n-1$ and either ($U \ne U'$ or $\overline{U} \setminus R \ne \varnothing$), then we can find a matching $M$ outside $R$ that covers all vertices in $U'$, as follows: firstly we find a matching in $U'$ which covers $U'$ except at most one of them (if $|U'|$ is odd), and the last one can be covered by using a vertex in $U \setminus U'$ or $\overline{U} \setminus R$. So we may assume that there is a vertex of degree $n-2$ in $U'$. \item The degree of each vertex in the subgraph induced by $U'$ is at least $|U'|-2$. If $|U'| - 2 \geq |U'|/2$, then the subgraph induced by $U'$ has a Hamiltonian cycle $C$ by Dirac's theorem. If $|U'|$ is even, then we can find a matching $M \subseteq C$ covering all vertices in $U'$. Otherwise, we can find a matching $M \subseteq C$ covering all vertices in $U'$, except one vertex, and we can make sure this vertex is of degree $n-2$; we mark this vertex. \item So the remaining case is when $|U'| \leq 3$ and there is a vertex of degree $n-2$ in $U'$. We do the case analysis as follows. \begin{itemize} \item Consider the case $|U'|=1$. Then we only have the vertex $w$ with degree $n-2$. We mark $w$. \item Consider the case $|U'|=2$ and let $U' = \{x,y \}$. If $xy$ is an edge, then we cover both $x$ and $y$ by $xy$. Hence we may assume that $U'$ is independent (and thus both $x$ and $y$ have degree $n-2$). If there is a vertex $w \in \overline{U'} \setminus R$, then we may cover $x$ by an edge $xw$ and mark $y$. Thus we may assume that $\overline{U'} = R$. One can easily show that this hypergraph has chromatic index $n-1$. \item Consider the case $|U'|=3$. There is an edge $e = xy$ inside $U'$ such that the vertex $w$ in $U' - \{x,y \}$ has degree $n-2$. We cover both $x$ and $y$ using $e$ and mark $w$. \end{itemize} \end{itemize} Now we show that $m$ is odd, or else $\chi'(\cH) \leq n$. Suppose not. If $G[U_1\cup U_2]$ has a perfect matching, then as before~\ref{difficult-edge-covering} holds, so we assume $G[U_1\cup U_2]$ does not have a perfect matching. By Proposition~\ref{dense-matching-prop}, $G[U_1\cup U_2]$ is one of two graphs. If $G[U_1\cup U_2]$ has two vertices and no edges, then . If not, then by Proposition~\ref{dense-matching-prop}, Thus, $m$ is odd, as claimed. Now suppose that $X \neq \varnothing$. If there is a vertex $v\in X$ such that $N_G(v) \cap (U_1 \cup U_2) \neq \varnothing$, then as before, then let $u \in N_G(v)\cap (U_1\cup U_2)$. The same argument as before applied to $G[U_1\cup U_2] - u$ implies that $\chi'(\cH) \leq n$, so we assume $N_G(v) \cap (U_1 \cup U_2) = \varnothing$ for every $v\in X$. Now $|U_1| = \varnothing$, $|X| = 1$, and every vertex in $U_2$ has degree $n - 2$ in $G$. In particular, $G - e$ is a graph of maximum of maximum degree $n - 2$, so $\chi'(G - e) \leq n - 1$, and thus $\chi'(\cH) \leq n$, as desired. Therefore we assume $X = \varnothing$. Now suppose $|U_1\cup U_2| \geq 4$, and note that every vertex has degree at least $|U_1\cup U_2| - 2 \geq |U_1\cup U_2| / 2$ in $G[U_1\cup U_2]$. Thus, by Dirac's Theorem~\cite{D52}, $G[U_1 \cup U_2]$ has a Hamilton cycle. Thus, $G[U_1\cup U_2]$ contains a matching $M_1$ covering every vertex of $U_1$ and all but at most one vertex of $U_2$. \end{comment} \section{Vertex absorption to extend colour classes}\label{absorption-section} In this section, we will define properties that that we need our absorbers to satisfy in order to carry out the vertex absorption step outlined in Section~\ref{subsection:small-edge-overview} (These absorbers will form part of the reservoirs $R$, which will be constructed in Section~\ref{reservoir-section}.) We also formalise various properties that allow a matching to be extended using vertex absorption. \subsection{Quasirandom properties for absorption}\label{subsection:absorbable-properties} \begin{definition}[Typicality and upper regularity] Let $\gamma, \rho, \xi \in (0,1)$, let $G$ be an $n$-vertex graph, let $\cV$ be a set of subsets of $V(G)$, and let $R\subseteq E(G)$. We say $R$ is \begin{itemize} \item \textit{$(\rho, \gamma, G)$-typical with respect to $\cV$} if for every $X\in \cV$, every vertex $v \in V(G)$ satisfies $|N_R(v) \cap X| = \rho|N_G(v)\cap X| \pm \gamma n$ and $|N_R(v) \setminus X| = \rho|N_G(v)\setminus X| \pm \gamma n$, and \item \textit{upper $(\rho, \xi, G)$-regular} if for every pair of disjoint sets $S, T\subseteq V(G)$ with $|S|, |T| \geq \xi n$, we have $|E_G(S, T)\cap R| \leq \rho e_G(S, T) + \xi |S||T|$. \end{itemize} We also say a graph $H$ is upper $(\rho, \xi)$-regular if $E(H)$ is upper $(\rho, \xi, K_{v(H)})$-regular. \end{definition} Note that if $H$ is a subgraph of $G$ such that $\xi v(G) < v(H)$, and $E(H)$ is upper $(\rho, \xi, G)$-regular, then $H$ is upper $(\rho, \xi v(G)/v(H))$-regular. \begin{definition}[Absorbers]\label{def:absorber} Let $\xi , \gamma, \rho , \eps \in (0,1)$. Let $\cH$ be a linear multi-hypergraph, let $G\coloneqq \cH^{(2)}$, let $G'$ be the spanning subgraph of $G$ consisting of those edges with at least one vertex in $V^{(1 - \eps)}_+(G)$, and let $\cV$ be a set of subsets of $V(\cH)$. We say $R_{\mathrm{abs}}$ is a \textit{$(\rho, \gamma, \xi, \eps)$-absorber for $\cV$} if it satisfies the following properties: \begin{enumerate}[(i)] \item\label{cond:absorber1} $R_{\mathrm{abs}} \subseteq E(G')$, \item $R_{\mathrm{abs}}$ is $(\rho, \gamma, G')$-typical with respect to $\cV$, and \item $R_{\mathrm{abs}}$ is upper $(\rho, \xi, G')$-regular. \end{enumerate} \end{definition} \begin{obs}[Robustness of absorbers]\label{obs:del_absorber} Let $\xi , \gamma, \rho , \eps \in (0,1)$. Let $\cH$ be a linear multi-hypergraph, and let $\cV$ be a set of subsets of $V(\cH)$. The following hold. \begin{itemize} \item A $(\rho,\gamma,\xi,\eps)$-absorber for $\cV$ is also a $(\rho,\gamma' , \xi , \eps)$-absorber for $\cV$, if $\gamma < \gamma'< 1$. \item For any $(\rho,\gamma,\xi,\eps)$-absorber $R$ for $\cV$, if $R' \subseteq R$ and $\Delta(R-R')\leq \alpha n$, then $R'$ is also a $(\rho,\gamma + \alpha , \xi , \eps)$-absorber for $\cV$. \end{itemize} \end{obs} \begin{definition}[Pseudorandom matchings]\label{pseudorandom-matching-def} Let $n \in \mathbb{N}$, $\gamma , \kappa \in (0,1)$, and let $\cH$ be an $n$-vertex multi-hypergraph. For a family $\cF$ of subsets of $V(\cH)$, a matching $M$ in $\cH$ is \textit{$(\gamma, \kappa)$-pseudorandom} with respect to $\cF$ if every $S\in\cF$ satisfies $|S \setminus V(M)| = \gamma|S| \pm \kappa n$. \end{definition} \begin{comment} \begin{definition}[Absorbable matchings] Let $\xi , \kappa, \gamma, \rho , \eps \in (0,1)$. Let $\cH$ be an $n$-vertex linear multi-hypergraph, let $G\coloneqq \cH^{(2)}$, and let $U\coloneqq V^{(1 - \eps)}_+(G)$. Let $\cN \coloneqq \{N_1 , \dots , N_k \}$ be a set of edge-disjoint matchings in $\cH$, let $R \subseteq E(G)$, and let $S \subseteq U$. We say $(\cH , \cN , R , S)$ is \emph{$(\rho, \eps, \gamma, \kappa, \xi)$-absorbable} if \begin{enumerate} \item[\mylabel{AB1}{(\rm AB1)}] $R$ is a $(\rho,10\gamma,\xi,\eps)$-absorber for $\{ V(\cH) , U \}$, \item[\mylabel{AB2}{(\rm AB2)}] $N_i \subseteq \cH \setminus R$ for all $i \in [k]$, and \item[\mylabel{AB3}{(\rm AB3)}] $N_i$ is $(\gamma,\kappa)$-pseudorandom with respect to $\cF(R) \cup \{U,S\}$ for all $i \in [k]$, where $\cF(R) \coloneqq \{N_R(u) \cap U \: : \: u \in U \} \cup \{N_R(u) \setminus U \: : \: u \in U \}$. \end{enumerate} We simply say $(\cH , \cN , R , S)$ is absorbable if it is $(\rho, \eps, \gamma, \kappa, \xi)$-absorbable and $\rho$, $\eps$, $\gamma$, $\kappa$, and $\xi$ are clear from the context. \end{definition} \end{comment} \begin{definition}[Absorbable matchings] \label{def:absorbable} Let $\xi , \kappa, \gamma, \rho , \eps \in (0,1)$. Let $\cH$ be an $n$-vertex linear multi-hypergraph, let $G\coloneqq \cH^{(2)}$, let $U\coloneqq V^{(1 - \eps)}_+(G)$, and let $S\subseteq U$. Let $R\subseteq E(G)$, and let $M$ be a matching in $\cH$. We say $(\cH , M , R , S)$ is \emph{$(\rho, \eps, \gamma, \kappa, \xi)$-absorbable} if \begin{enumerate} \item[\mylabel{AB1}{(\rm AB1)}] $R$ is a $(\rho,10\gamma,\xi,\eps)$-absorber for some $\cV$ such that $U,V(\cH) \in \cV$, \item[\mylabel{AB2}{(\rm AB2)}] $M \subseteq \cH \setminus R$, and \item[\mylabel{AB3}{(\rm AB3)}] at least one of the following holds: \begin{enumerate}[(i)] \item\label{AB-pseudo} $M$ is $(\gamma,\kappa)$-pseudorandom with respect to $\cF(R) \cup \{U,S\}$, where $\cF(R) \coloneqq \{N_R(u) \cap U \: : \: u \in U \} \cup \{N_R(u) \setminus U \: : \: u \in U \}$, \item\label{AB-med} $v(M) \leq \gamma n$, or \item\label{AB-huge} $|V(M) \cap U| \leq \eps n$ and $U\cup V(M), U\setminus V(M) \in \cV$. \end{enumerate} \end{enumerate} We say $(\cH , M , R , S)$ is \begin{itemize} \item $(\rho, \eps, \gamma, \kappa, \xi)$-absorbable \textit{by pseudorandomness of $M$} if~\ref{AB-pseudo} holds, \item $(\rho, \eps, \gamma, \kappa, \xi)$-absorbable \textit{by smallness of $M$} if~\ref{AB-med} holds, and \item $(\rho, \eps, \gamma, \kappa, \xi)$-absorbable \textit{by typicality of $R$} if~\ref{AB-huge} holds. \end{itemize} We simply say $(\cH , M , R , S)$ is absorbable if it is $(\rho, \eps, \gamma, \kappa, \xi)$-absorbable and $\rho$, $\eps$, $\gamma$, $\kappa$, and $\xi$ are clear from the context. \end{definition} \COMMENT{It may seem unnatural to require $10\gamma$ instead of $\gamma$ as the typicality parameter for the absorber $R$ in ~\ref{AB1}. This is because we need this parameter to be strictly larger than $\gamma$ for our applications. Our choice of $10\gamma$ is just for convenience; one could, in fact, introduce a new parameter $\gamma'$ instead of $10\gamma$, which is different from the parameter $\gamma$ in ~\ref{AB3}\ref{AB-pseudo} since we only rely on the relation $\gamma , \gamma' \ll \rho,\eps$ in the proofs of the lemmas in this section.} If $\cH$ is an $n$-vertex linear hypergraph and $\phi : \cH_{\mathrm{med}}\cup \cH_{\mathrm{large}} \rightarrow C$ is obtained from Theorem~\ref{large-edge-thm}, then we will choose an absorber $R$ such that for each $c\in C$, $(\cH, \phi^{-1}(c), R, S)$ is absorbable by smallness of $\phi^{-1}(c)$ if $c\in C_{\mathrm{med}}$ and by typicality of $R$ if $\phi$ assigns $c$ to a huge edge. For essentially every other $c \in C$, we will find a matching $M_c \supseteq \phi^{-1}(c)$ in Section~\ref{small-non-graph-section} such that $(\cH , M_c , R , S)$ is absorbable by pseudorandomness of $M_c$. In Sections~\ref{subsection:pseudorandom-absorption} and~\ref{subsection-huge-and-med-absorption}, we will show that if $(\cH , M , R , S)$ is absorbable, then we can extend $M$ to cover all but at most one vertex of $U$ using the edges of $R$. \subsection{Absorption for pseudorandom matchings}\label{subsection:pseudorandom-absorption} We will use the following two lemmas (depending on whether $|U|$ is small or not) to extend matchings $N$ for which $(\cH , N , R , S)$ is absorbable by pseudorandomness of $N$. \begin{lemma}\label{crossing-absorption-lemma} Let $0 < 1/n_0 \ll \xi \ll \kappa \ll \gamma \ll \rho, \eps \ll 1$, let $n \geq n_0$ and let $k \leq \kappa n$. Let $\cH$ be an $n$-vertex linear multi-hypergraph, let $G\coloneqq \cH^{(2)}$, let $R\subseteq E(G)$, and let $U\coloneqq V^{(1 - \eps)}_+(G)$. Let $\cN := \{N_1,\dots, N_{k}\}$ be a set of edge-disjoint matchings in $\cH$ such that $(\cH , N_i, R , \varnothing)$ is absorbable by pseudorandomness of $N_i$ for each $i\in[k]$. If $|U| \leq n / 100$, then there is a set of edge-disjoint matchings $\cN' \coloneqq \{N'_1, \dots, N'_k\}$ in $\cH$ such that for all $i \in [k]$, \begin{itemize} \item $N_i' \supseteq N_i$ and $N_i' \setminus N_i \subseteq R$, and \item $\cN'$ has perfect coverage of $U$. \end{itemize} \end{lemma} \begin{lemma}\label{internal-absorption-lemma} Let $0 < 1/n_0 \ll \xi \ll \kappa \ll \gamma \ll \rho, \eps \ll 1$, let $n \geq n_0$ and let $k \leq \kappa n$. Let $\cH$ be an $n$-vertex linear multi-hypergraph, let $G\coloneqq \cH^{(2)}$, let $R\subseteq E(G)$, let $U\coloneqq V^{(1 - \eps)}_+(G)$, and let $S \subseteq U$ satisfy $|S| \geq \gamma n$ if $|U| > (1-2\eps)n$. Let $\cN := \{N_1,\dots, N_{k}\}$ be a set of edge-disjoint matchings in $\cH$ such that $(\cH , N_i , R , S)$ is absorbable by pseudorandomness of $N_i$ for each $i\in[k]$. If $|U| \geq n/100$, then there is a set of edge-disjoint matchings $\cN' \coloneqq \{N'_1, \dots, N'_k\}$ in $\cH$ such that for all $i \in [k]$, \begin{itemize} \item $N_i' \supseteq N_i$ and $N_i' \setminus N_i \subseteq R$, and \item if $|U| \leq (1-2\eps)n$, then $\cN'$ has perfect coverage of $U$. Otherwise, $\cN'$ has nearly-perfect coverage of $U$ with defects in $S$. \end{itemize} \end{lemma} \begin{comment} \begin{lemma}\label{crossing-absorption-lemma} Let $0 < 1/n_0 \ll \xi \ll \kappa \ll \gamma \ll \rho, \eps \ll 1$. Let $n \geq n_0$, let $\cH$ be an $n$-vertex linear multi-hypergraph, let $G\coloneqq \cH^{(2)}$, and let $U\coloneqq V^{(1 - \eps)}_+(G)$. Let $\cN := \{N_1,\dots, N_{k}\}$ be a set of edge-disjoint matchings in $\cH$ such that $(\cH , \cN , R , \varnothing)$ is absorbable and $k \leq \kappa n$. If $|U| \leq n / 100$, then there is a set of edge-disjoint matchings $\cN' \coloneqq \{N'_1, \dots, N'_k\}$ in $\cH$ such that for all $i \in [k]$, \begin{itemize} \item $N_i'$ contains $N_i$ such that $N_i' \setminus N_i \subseteq R$, and \item $\cN'$ has perfect coverage of $U$. \end{itemize} \end{lemma} \begin{lemma}\label{internal-absorption-lemma} Let $0 < 1/n_0 \ll \xi \ll \kappa \ll \gamma \ll \rho, \eps \ll 1$. Let $n \geq n_0$, let $\cH$ be an $n$-vertex linear multi-hypergraph, let $G\coloneqq \cH^{(2)}$, let $U\coloneqq V^{(1 - \eps)}_+(G)$, and let $S \subseteq U$ satisfy $|S| \geq \gamma n$ if $|U| > (1-2\eps)n$. Let $\cN := \{N_1,\dots, N_{k}\}$ be a set of edge-disjoint matchings in $\cH$ such that $(\cH , \cN , R , S)$ is absorbable and $k \leq \kappa n$. If $|U| \geq n/100$, then there is a set of edge-disjoint matchings $\cN' \coloneqq \{N'_1, \dots, N'_k\}$ in $\cH$ such that for all $i \in [k]$, \begin{itemize} \item $N_i'$ contains $N_i$ such that $N_i' \setminus N_i \subseteq R$, and \item $\cN'$ has nearly-perfect coverage of $U$ with defects in $S$. Moreover, if $|U| \leq (1-2\eps)n$, then $\cN'$ has perfect coverage of $U$. \end{itemize} \end{lemma} \end{comment} To prove the above lemmas we will need the following simple observations, which follow easily from Hall's theorem. \begin{obs} \label{crossing-matching-prop} Let $0 < \xi \ll \rho \leq 1$. If $H$ is an upper $(\rho, \xi)$-regular bipartite graph with bipartition $(A, B)$ such that $v(H) \leq \rho|A|/\xi$ and every $v\in A$ satisfies $d_H(v) \geq 2\rho |A|$, then $H$ has a matching covering $A$. \end{obs} \COMMENT{\begin{proof} By Hall's Theorem, it suffices to show that every non-empty $S\subseteq A$ satisfies $|N(S)| \geq |S|$. Since $|N(S)| \geq 2\rho |A| \geq \xi v(H)$, we can assume $|S| \geq \xi v(H)$. Since every $v\in A$ satisfies $d_H(v) \geq 2\rho |A|$, every non-empty $S\subseteq A$ satisfies \begin{equation*} e_{H}(S, N(S)) \geq 2\rho|S||A|. \end{equation*} However, since $H$ is upper $(\rho, \xi)$-regular and $|S|,|N(S)| \geq \xi v(H)$, we also have \begin{equation*} e_{H}(S, N(S)) \leq (\rho + \xi)|S| |N(S)|. \end{equation*} Combining these two inequalities, we have $|N(S)| \geq |A| \geq |S|$, as desired. \end{proof}} \begin{obs}\label{internal-matching-prop} Let $0 < 1/m \ll \xi \ll \rho \leq 1$. If $G$ is an $m$-vertex, upper $(\rho, \xi)$-regular graph such that every $v\in V(G)$ satisfies $d_G(v) \geq 3\rho m / 4$, and $m$ is even, then $G$ has a perfect matching. \end{obs} \COMMENT{\begin{proof} By a standard probabilistic argument, $G$ has a spanning bipartite subgraph $H$ with bipartition $(A, B)$ such that $|A| = |B| = m / 2$ and every $v\in V(G)$ satisfies $d_{H}(v) \geq \rho m / 3$.\COMMENT{Consider such a bipartition chosen uniformly at random. The distribution of the random subset $A$ coincides with the distribution on subsets of $V(G)$ obtained by choosing each vertex to be in $A$ with probability $1/2$, conditioned on the event that $|A| = m / 2 $. The probability of this event is $\Theta(1/\sqrt m)$, but by Chernoff's bound, if each vertex is chosen in $A$ independently with probability $1/2$, then the probability $v$ has fewer than $\rho m / 3$ neighbors in $A$ is $\exp(-\Omega(m))$.} By Hall's Theorem, it suffices to show that every $S\subseteq A$ satisfies $|N(S)| \geq |S|$. If $S\neq\varnothing$, then $|N(S)| \geq \rho m / 3 \geq \xi m$, so we assume $|S| \geq \xi m$. Since every $v\in A$ satisfies $d_H(v) \geq \rho m / 3$, every $S\subseteq A$ satisfies \begin{equation*} e_{H}(S, N(S)) \geq |S| \rho m / 3. \end{equation*} However, since $G$ is upper $(\rho, \xi)$-regular, we also have \begin{equation*} e_{H}(S, N(S)) \leq (\rho + \xi)|S||N(S)|. \end{equation*} Combining these two inequalities, we have $|N(S)| \geq 3 m / 10$. Let $T\coloneqq B\setminus N(S)$. If $T = \varnothing$, then $S$ satisfies the Hall condition, as desired, so we assume $T \neq \varnothing$. By the same argument applied to $T$, we have $|N(T)| \geq 3m / 10$, so $|S| \leq |A| - |N(T)| \leq m / 5$. Now $|S| \leq m / 5 \leq 3m / 10 \leq |N(S)|$, as desired. \end{proof}} \begin{proof}[Proof of Lemma~\ref{crossing-absorption-lemma}] For each $i\in [k]$, let $H_i$ be the bipartite graph consisting of edges in $R$ with the bipartition $(A_i, B_i)$, where $A_i\coloneqq U\setminus V(N_i)$ and $B_i \coloneqq (V(\cH)\setminus U)\setminus V(N_i)$. We claim that there exist pairwise edge-disjoint matchings $N^{\mathrm{abs}}_i$ in $H_i$ covering $A_i$ for each $i\in[k]$. We find these matchings one-by-one using Observation~\ref{crossing-matching-prop}, if $|A_i| \geq \xi n / \rho$. Otherwise, we find them greedily. To this end, we assume that for some $\ell \leq k$, we have found such matchings $N^{\mathrm{abs}}_i$ for $i\in[\ell - 1]$, and we show that there exists such a matching $N^{\mathrm{abs}}_{\ell}$, which proves the claim. Let $H'_\ell := H_\ell \setminus \bigcup_{i\in[\ell-1]}N^{\mathrm{abs}}_i$. We first show that every vertex $u\in A_{\ell}$ satisfies $d_{H'_\ell}(u) \geq 2\rho |A_\ell|$. Since $|U| \leq n / 100$ and $R$ is a $(\rho , 10\gamma , \xi , \eps)$-absorber for $\{V(\cH),U \}$ by~\ref{AB1}, every $u\in A_{\ell}$ satisfies\COMMENT{A vertex of $U$, by definition, has degree at least $(1-\eps)n$ in $G'$, so it sends at least $99n/100 - \eps n$ edges to $V(G') \setminus U$ if $|U| \leq n / 100$. Since $R$ is $(\rho , 10\gamma ,G')$-typical with respect to $U$, $|N_R(u) \setminus U| \geq (\rho(99/100 - \eps) - 10\gamma)n$.} \begin{equation}\label{absorption-lemma-degree-outside-tmp} |N_R(u) \setminus U| \geq (\rho(99/100 - \eps) - 10\gamma)n \geq 98\rho n / 100. \end{equation} Note that each $N_i$ is $(\gamma , \kappa)$-pseudorandom with respect to $\cF\coloneqq \cF(R) \cup \{U\}$ by~\ref{AB3}\ref{AB-pseudo}. Together with ~\eqref{absorption-lemma-degree-outside-tmp}, this implies that every $u\in A_{\ell}$ satisfies $d_{H_{\ell}}(u) \geq \gamma |N_R(u)\setminus U| - \kappa n \geq 97 \gamma \rho n / 100$. Since $\ell \leq k \leq \kappa n$, we have \begin{equation}\label{absorption-lemma-degree-outside2-tmp} d_{H'_{\ell}}(u) \geq d_{H_\ell}(u) - \kappa n \geq 96 \gamma \rho n / 100. \end{equation} Since $N_i$ is $(\gamma, \kappa)$-pseudorandom with respect to $\cF \ni U$ and $|U| \leq n / 100$, we also have \begin{equation}\label{crossing-absorption-lemma-part-size-bound-tmp} |A_\ell| \leq \gamma |U| + \kappa n \leq \gamma n / 50. \end{equation} Combining~\eqref{absorption-lemma-degree-outside2-tmp} and~\eqref{crossing-absorption-lemma-part-size-bound-tmp}, we have $d_{H'_\ell}(u) \geq 2\rho |A_\ell|$, as desired. Note that the graph $H^*_\ell := (V(\cH), E(H'_\ell))$ is upper $(\rho, \xi)$-regular\COMMENT{$E(H^*_\ell)$ is, in fact, upper $(\rho, \xi, G')$-regular where $G'$ is the spanning subgraph of $G$ consisting of those edges with at least one vertex in $U$, which implies that $H^*_\ell$ is upper $(\rho, \xi)$-regular} since $H^*_\ell \subseteq R$, and $H^*_\ell$ is bipartite with the bipartition $(A_\ell, V(\cH) \setminus A_\ell)$ where $d_{H^*_\ell}(u) \geq 2\rho |A_\ell|$, for every $u\in A_{\ell}$. Therefore, if $|A_\ell| \geq \xi n / \rho$, then Observation~\ref{crossing-matching-prop} implies that $H^*_\ell$ has a matching $N^{\mathrm{abs}}_{\ell}$ covering $A_\ell$, so $N^{\mathrm{abs}}_{\ell}$ is also a matching in $H_\ell'$ covering $A_\ell$, as claimed. Otherwise, for any $u \in A_{\ell}$, \begin{equation}\label{eqn:bounda_ell} |A_\ell| < \xi n / \rho \leq 96 \gamma \rho n / 100 \overset{\eqref{absorption-lemma-degree-outside2-tmp}}{\leq} d_{H_\ell'}(u), \end{equation} so we can find such a matching greedily. Therefore we have pairwise edge-disjoint matchings $N_i^{\mathrm{abs}}$ in $H_i$ covering $A_i$ for $i\in[k]$, as claimed, and $N_1^{\rm abs} , \dots , N_k^{\rm abs}$ are edge-disjoint from $N_1 , \dots , N_k$ by~\ref{AB2}. For each $i\in[k]$, let ${N'_i} \coloneqq N_i\cup N_i^{\mathrm{abs}}$, and let $\cN' = \{N'_1, \dots, N'_k\}$. Hence each matching in $\cN'$ covers $U$, so $\cN'$ has perfect coverage of $U$, as desired. \end{proof} \begin{proof}[Proof of Lemma~\ref{internal-absorption-lemma}] Let $\cF := \cF(R) \cup \{U, S\}$, where $\cF(R) \coloneqq \{N_R(u) \cap U \: : \: u \in U \} \cup \{N_R(u) \setminus U \: : \: u \in U \}$. For each $i\in [k]$, let $G_i$ be the graph with $V(G_i) := V(\cH) \setminus V(N_i)$ and $E(G_i) \coloneqq \{ e \in R \: : \: e \subseteq V(\cH)\setminus V(N_i)\}$, and let $U_i \coloneqq U\setminus V(N_i)$. Since $N_i$ is $(\gamma,\kappa)$-pseudorandom with respect to $\cF \ni U$, we have \begin{equation}\label{eqn:size_ui} \textrm{$|U_i| = \gamma |U| \pm \kappa n$, so $|U_i| \geq \gamma n / 200$}. \end{equation} We claim that for each $i\in[k]$ there exists $u_i \in U_i$ and a matching $N^{\mathrm{abs}}_i$ in $G_i$ such that the following holds. The vertices $u_1, \dots, u_k$ are distinct, the matchings $N^{\mathrm{abs}}_1, N^{\mathrm{abs}}_2, \ldots, N^{\mathrm{abs}}_k$ are pairwise edge-disjoint, and $N^{\mathrm{abs}}_i$ covers every vertex of $U_i\setminus\{u_i\}$ for each $i\in[k]$. Moreover, if $|U| \leq (1 - 2\eps)n$, then $N^{\mathrm{abs}}_i$ covers every vertex of $U_i$ for each $i\in [k]$, and otherwise $u_i \in S$. To that end, we choose distinct $u_i \in U_i$ for each $i\in[k]$, as follows. \begin{itemize} \item If $|U| \leq (1 - 2\eps)n$, then since $R$ is a $(\rho,10\gamma,\xi,\eps)$-absorber for $\{V(\cH),U \}$ by~\ref{AB1}, every $u\in U_i$ satisfies\COMMENT{Since $|U| \leq (1 - 2\eps)n$, we know that $u$ sends at least $\eps n$ edges of $G'$ outside $U$, and since $R$ is $(\rho, 10\gamma, G')$-typical with respect to $U$, we have $|N_R(u)\setminus U| \ge \rho \eps n - 10\gamma n$.} $|N_R(u)\setminus U| \geq (\rho\eps - 10\gamma) n$. By~\ref{AB3}\ref{AB-pseudo}, since $N_i$ is $(\gamma, \kappa)$-pseudorandom with respect to $\cF \supseteq \cF(R)$ for each $i\in[k]$, this inequality implies\COMMENT{If $N_i$ is $(\gamma, \kappa)$-pseudorandom with respect to $\cF \supseteq \cF(R)$, then $|N_{G_i}(u)\setminus U| \ge \gamma(\rho\eps - 10\gamma) n - \kappa n \ge \gamma \rho\eps n / 2$ since $\kappa \ll \gamma \ll \rho, \eps$. } that every $u \in U_i$ satisfies $|N_{G_i}(u)\setminus U| \geq \gamma \rho\eps n / 2$. Since $k \le \kappa n$ and $\kappa \ll \gamma, \rho, \eps$, and \eqref{eqn:size_ui} holds, we can choose $u_i \in U_i$ one-by-one such that there is a matching $\{u_iv_i : i\in[k]\}$ where $v_i \in N_{G_i}(u_i)\setminus U$ for each $i\in[k]$. \item Otherwise, $|S| \geq \gamma n$, and since $N_i$ is $(\gamma, \kappa)$-pseudorandom with respect to $\mathcal F \ni S$, by~\ref{AB3}\ref{AB-pseudo}, we have $|S \setminus V(N_i)| \geq \gamma |S| - \kappa n \ge \gamma^2 n /2 > \kappa n$ for each $i \in [k]$, so we can choose $u_i \in U_i \cap S = S \setminus V(N_i)$ one-by-one such that they are distinct, as required. \end{itemize} Now let $U'_i \coloneqq U_i\setminus\{u_i\}$ if $|U_i|$ is odd. Otherwise, let $U'_i\coloneqq U_i$. By the choice of the vertices $u_i$, it suffices to find pairwise edge-disjoint perfect matchings ${N'}_i^{\mathrm{abs}}$ in $G_i[U'_i]$ for each $i\in [k]$. Indeed if $|U| \leq (1-2\eps)n$ and $|U_i|$ is odd, then $N_i^{\rm abs} \coloneqq {N'}_i^{\mathrm{abs}} \cup \{u_i v_i \}$ satisfies the claim, and otherwise $N_i^{\rm abs} \coloneqq {N'}_i^{\mathrm{abs}}$ satisfies the claim. We find these matchings one-by-one using Observation~\ref{internal-matching-prop}. To this end, we assume that for some $\ell \leq k$, we have found such matchings ${N'}^{\mathrm{abs}}_i$ for $i\in[\ell - 1]$, and we show that there exists such a matching ${N'}^{\mathrm{abs}}_{\ell}$, which proves the claim. Let $G'_\ell \coloneqq G_\ell[U'_\ell] \setminus \bigcup_{i\in[\ell-1]}{N'}^{\mathrm{abs}}_i$. Since $|U| \geq n / 100$ and $R$ is a $(\rho,10\gamma,\xi,\eps)$-absorber for $\{V(\cH),U \}$ by~\ref{AB1}, every $u\in U$ satisfies \begin{equation}\label{internal-absorption-degree-outside-tmp} |N_R(u) \cap U| \geq \rho(|U| - \eps n) - 10\gamma n \geq 99 \rho |U| / 100. \end{equation} Note that $N_{\ell}$ is $(\gamma , \kappa)$-pseudorandom with respect to $\cF \supseteq \cF(R) \cup \{U\}$ by~\ref{AB3}\ref{AB-pseudo}. Together with ~\eqref{internal-absorption-degree-outside-tmp}, this implies that every $u\in U'_{\ell}$ satisfies $d_{G_{\ell}[U'_\ell]}(u) \geq \gamma |N_R(u)\cap U| - \kappa n - 1 \geq 98 \gamma\rho |U| / 100$. Since $\ell \leq k \leq \kappa n$, we have \begin{equation}\label{internal-absorption-degree-outside2-tmp} d_{G'_{\ell}}(u) \geq d_{G_\ell[U_i']}(u) - \kappa n \geq 97\gamma \rho |U| / 100. \end{equation} We also have \begin{equation}\label{internal-absorption-lemma-part-size-bound-tmp} |U'_\ell| \pm 1 = |U_\ell| \overset{\eqref{eqn:size_ui}}{=} \gamma |U| \pm \kappa n, \text{ so } |U'_\ell| \leq 5\gamma |U| / 4. \end{equation} Since $R$ is upper $(\rho, \xi, G')$-regular and $|U'_\ell| \overset{\eqref{internal-absorption-lemma-part-size-bound-tmp}}{\ge} \gamma n/100 - \kappa n -1 \ge \gamma n/200$, $G'_{\ell}$ is upper $(\rho, 200\xi/\gamma)$-regular. Moreover, combining~\eqref{internal-absorption-degree-outside2-tmp} and~\eqref{internal-absorption-lemma-part-size-bound-tmp}, we have $d_{G'_\ell}(u) \geq 3\rho|U'_\ell| / 4$. So by\COMMENT{ We used $\rho \gg 200 \xi / \gamma$ which holds since $\xi \ll \rho, \gamma$. } Observation~\ref{internal-matching-prop}, $G'_\ell$ has a perfect matching ${N'}_\ell^{\mathrm{abs}}$, as desired. Therefore we have pairwise edge-disjoint matchings $N_i^{\rm abs}$ in $G_i$, as claimed, which by~\ref{AB2} are edge-disjoint from $N_1 , \dots , N_k$. For each $i \in [k]$, let $N'_i \coloneqq N_i\cup N_i^{\mathrm{abs}}$, and let $\cN' = \{N'_1, \dots, N'_k\}$. Now $N'_i \supseteq N_i$ and $N'_i\setminus N_i\subseteq R$ for each $i\in[k]$, and $\cN'$ has nearly-perfect coverage of $U$ with defects in $S$, as desired. Moreover, if $|U| \leq (1 - 2\eps)n$, then $\cN'$ has perfect coverage of $U$, as desired. \end{proof} \subsection{Absorption for matchings having huge edges or having few vertices}\label{subsection-huge-and-med-absorption} \begin{definition}[Difficult matching]\label{defn:difficult} Let $\cH$ be an $n$-vertex hypergraph, let $G\coloneqq \cH^{(2)}$, and let $U\coloneqq V^{(1 - \eps)}_+(G)$. A matching $M$ in $\cH$ is \textit{difficult} if it covers at least $3|V(\cH)\setminus U| / 4$ of the vertices in $V(\cH)\setminus U$ and $|V(\cH)\setminus U| \geq 2$. If the matching $M$ is difficult and consists of a single edge $e$, then we also say that $e$ is \textit{difficult}. \end{definition} We will use the following lemma to extend matchings $N$ for which $(\cH , N , R , S)$ is either absorbable by smallness of $N$ or by typicality of $R$ (provided $N$ is not difficult). \begin{lemma}\label{huge-edge-absorption-lemma} Let $0 < 1/n_0 \ll \xi \ll \kappa \ll \gamma \ll \rho, \eps \ll 1$, and let $n \geq n_0$. Suppose $k \leq \gamma n$. Let $\cH$ be an $n$-vertex linear hypergraph, let $G\coloneqq \cH^{(2)}$, let $R\subseteq E(G)$, let $U\coloneqq V^{(1 - \eps)}_+(G)$, and let $S \subseteq U$ satisfy $|S| > (\gamma + \eps)n$ if $|U| > (1 - 10\eps)n$. Let $\cN \coloneqq \{ N_1 , \dots , N_k \}$ be a set of edge-disjoint matchings in $\cH$ such that for each $i\in[k]$, either \begin{itemize} \item[\rm (a)] $(\cH, N_i, R, S)$ is $(\rho, \eps, \gamma, \kappa, \xi)$-absorbable by smallness of $N_i$, or \item[\rm (b)] $(\cH, N_i, R, S)$ is $(\rho, \eps, \gamma, \kappa, \xi)$-absorbable by typicality of $R$ and $N_i$ is not difficult.\COMMENT{When applying this lemma, the condition $|V(M) \cap U| \leq \eps n$ in ~\ref{AB3}\ref{AB-huge} presents no problem because in the extremal case, $|U| \leq \eps n$ and in the non-extremal case we will apply this lemma only when $M$ is the colour class consisting of exactly one huge edge $e$, in which case $|e \cap U| \leq \eps n$ by the definition of $U$ and the linearity of $\cH$.} \end{itemize} Then there is a set $\cN' := \{ N_1' , \dots , N_k' \}$ of pairwise edge-disjoint matchings such that for $i \in [k]$, \begin{itemize} \item $N_i' \supseteq N_i$ and $N_i' \setminus N_i \subseteq R$, and \item if $|U| \leq (1-10\eps)n$, then $\cN'$ has perfect coverage of $U$. Otherwise, $\cN'$ has nearly-perfect coverage of $U$ with defects in $S$. \end{itemize} \end{lemma} \begin{comment} \begin{lemma}\label{huge-edge-absorption-lemma} Let $0 < 1/n_0 \ll \xi \ll \gamma \ll \rho, \eps \ll 1$. Let $n \geq n_0$ be an integer, let $\cH$ be an $n$-vertex linear hypergraph, let $G\coloneqq \cH^{(2)}$, and let $U\coloneqq V^{(1 - \eps)}_+(G)$. Let $k \leq \gamma n$. \begin{itemize} \item Let $\cN := \{ N_1 , \dots , N_k \}$ be a set of $k$ edge-disjoint matchings in $\cH$ such that either $N_i$ is not difficult and\COMMENT{When applying this lemma, this condition presents no problem because in the extremal case, $|U| \leq \eps n$ and in the non-extremal case we will apply this lemma only when $M$ is the colour class consisting of exactly one huge edge $e$, in which case $|e \cap V(M)| \leq \eps n$ by the definition of $U$ and the linearity of $\cH$.} $|V(N_i) \cap U| \leq \eps n$, or $v(N_i) \leq \gamma n$ for $i \in [k]$. \item Let $R \subseteq E(G) \setminus \bigcup_{i=1}^{k} N_i$ be a $(\rho,10\gamma,\xi,\eps)$-absorber for $\cV \coloneqq\{V(\cH), U\} \cup \bigcup_{i=1}^{k} \{U\cup V(N_i), U\setminus V(N_i)\}$. \item Let $S \subseteq U$ satisfy $|S| > (\gamma + \eps) n$ if $|U| > (1-10\eps)n$. \end{itemize} Then there is a set $\cN' := \{ N_1' , \dots , N_k' \}$ of pairwise edge-disjoint matchings such that for $i \in [k]$, \begin{enumerate} \item[\mylabel{AN1}{(\ref{huge-edge-absorption-lemma}.1)}] $N_i' \supseteq N_i$ and $N_i' \setminus N_i \subseteq R$, and \item[\mylabel{AN2}{(\ref{huge-edge-absorption-lemma}.2)}] $\cN'$ has nearly-perfect coverage of $U$ with defects in $S$. Moreover, if $|U| \leq (1-10\eps)n$, then $\cN'$ has perfect coverage of $U$. \end{enumerate} \end{lemma} \end{comment} \begin{proof} Let $G'$ be the spanning subgraph of $G$ consisting only of the edges incident to a vertex in $U$. Without loss of generality, we may assume that there is an integer $s$ such that for each $i \in [s]$, we have $|U \setminus V(N_i)| \leq n/100$, and for each $i \in \{s+1, \dots, k \}$, we have $|U \setminus V(N_i)| > n/100$. For each $i \in [k]$, let $U_i := U \setminus V(N_i)$, let $V_i \coloneqq (V(\cH)\setminus U)\setminus V(N_i)$, let $H_i$ be the bipartite graph with the bipartition $(U_i, V_i)$ and $E(H_i) \coloneqq \{ e \in R \: : \: |e \cap U_i| = |e\cap V_i| = 1\}$, and let $G_i$ be the graph with $V(G_i) := V(\cH) \setminus V(N_i)$ and $E(G_i) \coloneqq \{ e \in R \: : \: e \subseteq V(\cH)\setminus V(N_i)\}$. We first claim that there exist pairwise edge-disjoint matchings $N_1^{\rm abs}, \dots, N_s^{\rm abs}$ such that for each $i \in [s]$, $N_i^{\rm abs}$ is a matching in $H_i$ covering all of the vertices in $U_i$. We find these matchings one-by-one using Observation~\ref{crossing-matching-prop}. To this end, we assume that for some $\ell \leq s$, we have found such matchings $N^{\mathrm{abs}}_i$ for $i\in[\ell - 1]$, we let $H_{\ell}' := H_{\ell} \setminus \bigcup_{t=1}^{\ell-1} N_t^{\rm abs}$, and we show that there exists such a matching $N^{\mathrm{abs}}_{\ell}$ in $H_{\ell}'$, which proves the claim. It suffices to show that every $u\in U_\ell$ satisfies \begin{equation}\label{huge-absorption-crossing-degree-bound} d_{H_{\ell}'}(u) \geq \rho n / 7 \geq 2\rho |U_{\ell}|. \end{equation} Indeed, the graph $H^*_\ell := (V(\cH), E(H'_\ell))$ is upper $(\rho, \xi)$-regular since $E(H^*_\ell) \subseteq R$, and $H^*_\ell$ is bipartite with the bipartition $(U_\ell, V(\cH) \setminus U_\ell)$ where $d_{H^*_\ell}(u) = d_{H'_\ell}(u) \geq 2\rho |U_\ell|$ for every $u\in U_{\ell}$. Therefore, if $|U_{\ell}| \geq \xi n / \rho$, then we have a matching $N_{\ell}^{\mathrm{abs}}$ in $H^*_\ell$ (and so in $H_{\ell}'$) covering $U_{\ell}$ by Observation~\ref{crossing-matching-prop}, as desired. Otherwise, by \eqref{huge-absorption-crossing-degree-bound}, $|U_{\ell}| < \xi n / \rho < \rho n / 7 \leq d_{H'_{\ell}}(u)$ for every $u \in U_{\ell}$, so we can find the desired matching $N_{\ell}^{\mathrm{abs}}$ covering $U_{\ell}$ greedily. To prove \eqref{huge-absorption-crossing-degree-bound}, first suppose (b) holds. By~\ref{AB3}\ref{AB-huge}, we have\COMMENT{Note that $v(N_{\ell}) \le (3/4 + \eps) n$ also holds when $|U| \ge n-1$.} $v(N_{\ell}) \leq (3/4 + \eps)n \leq 4n/5$. Thus, $|V_{\ell}| \geq n - v(N_{\ell}) - |U\setminus V(N_{\ell})| \geq n/5 - n/100 \geq n/6$, and since $R$ is $(\rho, 10\gamma , G')$-typical with respect to $\cV \ni U\cup V(N_{\ell})$ by~\ref{AB3}\ref{AB-huge}, every $u \in U_{\ell}$ satisfies\COMMENT{since $u \in U$, it sends at least $n/6-\eps n$ edges of $G$ to $V_{\ell}$. Since $R$ is $(\rho, 10\gamma , G')$-typical and $k \leq \gamma n$, the inequality follows.} $d_{H_{\ell}'}(u) \geq (\rho(1/6 - \eps) - 10\gamma - \gamma)n \geq \rho n / 7 \geq 2\rho |U_{\ell}|$, as desired. Therefore we assume $(\cH, N_\ell, R, S)$ is absorbable by smallness of $N_\ell$, so by~\ref{AB3}\ref{AB-med}, we have $v(N_\ell) \leq \gamma n$. Thus, $|U| \leq |U \setminus V(N_{\ell})|+v(N_{\ell}) \leq n/100 + \gamma n \leq n/50$, and since $R$ is $(\rho, 10\gamma, G')$-typical with respect to $\cV \ni U$ by~\ref{AB1}, every $u\in U_\ell$ satisfies\COMMENT{Since $u\in U$, it sends at least $(1 - \eps)n - |U| \geq (49/50 - \eps)n$ edges of $G$ outside of $U$. Since $R$ is $(\rho, 10\gamma, G')$-typical and $k \leq \gamma n$, at least $(\rho(49/50 - \eps) - 10\gamma - \gamma)n$ are in $R\setminus \bigcup_{i=1}^{\ell - 1}N_i^{\mathrm{abs}}$, and all but at most $\gamma n$ of these have an end in $V_\ell$ by smallness.} $d_{H_{\ell}'}(u) \geq (\rho(49/50 - \eps) - 10\gamma - \gamma - \gamma)n \geq \rho n / 7 \geq 2\rho |U_{\ell}|$, as desired. Therefore~\eqref{huge-absorption-crossing-degree-bound} holds in both cases, so we have the matchings $N_{1}^{\mathrm{abs}}, \dots, N_{s}^{\mathrm{abs}}$, as claimed. \begin{claim}\label{lem6.11claim} There exist matchings $N_{s+1}^{\rm abs}, \dots, N_k^{\rm abs}$ and distinct vertices $u_{s+1}, \dots, u_k$ such that for each $i \in \{s+1, \dots, k\}$, $u_i \in U_i$, $N_i^{\rm abs}$ is a matching in $G_i$ covering all the vertices of $U_i \setminus \{ u_i \}$, and the matchings $N_{1}^{\rm abs}, \dots, N_k^{\rm abs}$ are pairwise edge-disjoint. Moreover, for each $i \in \{s+1, \dots, k\}$, if $|U| \leq (1-10\eps)n$, then $N_i^{\rm abs}$ covers all vertices in $U_i$, and otherwise $u_i \in S$. \end{claim} \begin{claimproof} We choose distinct $u_i \in U_i$ for $s+1 \leq i \leq k$ as follows. Let $G_{i}' := G_{i} \setminus \bigcup_{t=1}^{s} N_t^{\rm abs}$ for $s+1 \leq i \leq k$. \begin{itemize} \item If $|U| \leq (1 - 10\eps)n$, then every $u\in U$ satisfies $|N_G(u) \setminus U| \geq 9\eps n$, and moreover if $N_i$ is not difficult, then $|V(\cH)\setminus (U\cup V(N_i))| \geq 2\eps n$, which implies that every $u\in U$ satisfies $|N_G(u) \setminus (U\cup V(N_i))| \geq \eps n$. If (b) holds, then $R$ is $(\rho, 10\gamma , G')$-typical with respect to $\cV\ni U\cup V(N_i)$ by~\ref{AB3}\ref{AB-huge}, so we have $|N_{G_i'}(u) \setminus (U \cup V(N_i))| \geq \rho |N_G(u) \setminus (U\cup V(N_i))| - 10 \gamma n - k \geq \rho\eps n / 2 > \gamma n \geq k$ for every $u\in U_i$. If (a) holds, then $v(N_i) \leq \gamma n$ and $R$ is $(\rho, 10\gamma , G')$-typical with respect to $\cV \ni U$ by~\ref{AB1}, so we have $|N_{G_i'}(u) \setminus (U \cup V(N_i))| \geq \rho |N_G(u)\setminus U| - 10 \gamma n - k - v(N_i) > 8\rho\eps n > k$ for every $u\in U_i$. Thus, $|N_{G_i'}(u) \setminus (U \cup V(N_i))| > k$ for each $i \in \{s+1, \dots, k\}$ and for all $u \in U_i$, and since $|U_i| > n/100 > k$, we can choose $u_i \in U_i$ one-by-one such that there is a matching $\{ u_i v_i \: : \: i \in \{s+1, \dots, k\}\}$ where $v_i \in N_{G_i'}(u_i) \setminus (U \cup V(N_i))$ for each $i \in \{s+1, \dots, k\}$. \item Otherwise, we have $|S| > (\gamma + \eps) n$. Using~\ref{AB3}\ref{AB-med} or~\ref{AB3}\ref{AB-huge}, and $\gamma \ll \eps$, we have $|V(N_i) \cap U| \leq \eps n$. Since $S\subseteq U$ it then follows that $|S\setminus V(N_i)| \geq |S| - |V(N_i)\cap U| > \gamma n$ for each $i \in \{s+1, \dots, k\}$. Since $k \leq \gamma n$, we can choose $u_i \in S \setminus V(N_i)$ one-by-one such that they are distinct, as required. \end{itemize} Now let $U'_i \coloneqq U_i\setminus\{u_i\}$ if $|U_i|$ is odd. Otherwise, let $U'_i\coloneqq U_i$. By the choice of the vertices $u_i$, it suffices to find pairwise edge-disjoint perfect matchings ${N'}_i^{\mathrm{abs}}$ in $G'_i[U'_i]$ for each $i\in \{s+1, \dots, k\}$. Indeed, if $|U| \leq (1-10\eps)n$ and $|U_i|$ is odd, then $N_i^{\rm abs} \coloneqq {N'}_i^{\mathrm{abs}} \cup \{u_i v_i \}$ satisfies the claim, and otherwise $N_i^{\rm abs} \coloneqq {N'}_i^{\mathrm{abs}}$ satisfies the claim. We find these matchings (${N'}_i^{\mathrm{abs}}$ for $i\in \{s+1, \dots, k\}$) one-by-one using Observation~\ref{internal-matching-prop}. To this end, we assume that for some $s+1 \le \ell \leq k$, we have found such matchings ${N'}^{\mathrm{abs}}_i$ for all $s+1 \le i \le \ell - 1$, we let $G''_\ell \coloneqq G'_\ell[U'_\ell] \setminus \bigcup_{s+1 \leq i \leq \ell-1}{N'}^{\mathrm{abs}}_i$, and we show that there exists such a matching ${N'}^{\mathrm{abs}}_{\ell}$ in $G''_\ell$, which proves the claim. Note that \begin{equation}\label{eq:lowerboundUell} |U'_{\ell}| \geq |U_{\ell}|-1 \geq n / 100 - 1 \ge n/ 200. \end{equation} Since $R$ is upper $(\rho, \xi, G)$-regular and \eqref{eq:lowerboundUell} holds, $G''_\ell$ is upper $(\rho, 200\xi)$-regular. So by Observation~\ref{internal-matching-prop}, it suffices to show that every $u\in U'_\ell$ satisfies \begin{equation}\label{huge-absorption-internal-degree-bound} d_{G_{\ell}''}(u) \geq 3 \rho |U'_{\ell}| / 4. \end{equation} To prove \eqref{huge-absorption-internal-degree-bound}, first suppose (b) holds. Since $R$ is a $(\rho,10\gamma,\xi,\eps)$-absorber for $\mathcal V \ni U_{\ell}$ by~\ref{AB3}\ref{AB-huge}, every $u\in U'_{\ell}$ satisfies\COMMENT{$u$ sends $|U_{\ell}|-\eps n$ edges of $G$ to $U_{\ell}$, and since $R$ is a $(\rho,10\gamma,\xi,\eps)$-absorber, we have $d_{G_{\ell}}(u) \ge \rho(|U_{\ell}|-\eps n) - 10 \gamma n$. So $d_{G''_{\ell}}(u) \ge \rho(|U_{\ell}|-\eps n) - 10 \gamma n - k -1 \ge \rho(|U_{\ell}|-\eps n) - 10 \gamma n - \gamma n -1$} \begin{equation*} d_{G_{\ell}''}(u) \geq \rho(|U_{\ell}| - \eps n) - 10 \gamma n - \gamma n - 1 \geq \rho(|U_{\ell}'| - \eps n) - 12 \gamma n \overset{\eqref{eq:lowerboundUell}}{\geq} 3 \rho |U'_{\ell}| / 4, \end{equation*} as desired. Therefore, we assume (a) holds. Since $R$ is $(\rho, 10\gamma , G')$-typical with respect to $\cV\ni U$ by~\ref{AB1}, every $u\in U'_\ell$ satisfies\COMMENT{$u$ sends at least $|U| - \eps n$ edges of $G$ to $U$. Since $R$ is $(\rho, 10\gamma , G')$-typical and $k \leq \gamma n$, at least $\rho(|U| - \eps n) - 10\gamma n - \gamma n$ of these edges are in $R\setminus \bigcup_{i=1}^{\ell - 1}{N'}_i^{\mathrm{abs}}$, and all but at most $\gamma n + 1$ of these have an end in $U'_\ell$.} \begin{equation*} d_{G_{\ell}''}(u) \geq \rho(|U| - \eps n) - 10 \gamma n - \gamma n - \gamma n - 1 \geq \rho(|U_{\ell}'| - \eps n) - 13 \gamma n \overset{\eqref{eq:lowerboundUell}}{\geq} 3 \rho |U'_{\ell}| / 4, \end{equation*} as desired. Therefore~\eqref{huge-absorption-internal-degree-bound} holds in both cases, so we have the matchings $N_{s+1}^{\mathrm{abs}}, \dots, N_k^{\mathrm{abs}}$, which proves Claim~\ref{lem6.11claim}. \end{claimproof} Now, letting $N_i' \coloneqq N_i \cup N_i^{\mathrm{abs}}$ for each $i \in [k]$, we have $N_i'\supseteq N_i$ and $N_i'\setminus N_i \subseteq R$, and $\cN' := \{N_1' , \dots , N_k'\}$ has nearly-perfect coverage of $U$ with defects in $S$, as desired. Moreover, if $|U| \leq (1 - 10\eps)n$, then $\cN'$ has perfect coverage of $U$, as desired. \end{proof} We will use the following lemma to extend a difficult matching. \begin{lemma}\label{difficult-edge-absorption} Let $0 < 1/n_0 \ll \beta \ll 1$, and let $n \geq n_0$. If $\cH$ is an $n$-vertex linear hypergraph with no singleton edge, $G \coloneqq \cH^{(2)}$, and $M \coloneqq \{e\}$ is a difficult matching where $e$ is huge, then at least one of the following holds: \begin{enumerate}[(\ref{difficult-edge-absorption}:a), topsep = 6pt] \item There is a matching $M'$ such that $M\subseteq M'$, $M' \setminus M \subseteq E(G)$, and $M'$ covers every vertex of $V^{(n - 1)}(\cH)$ and all but at most five vertices of $V^{(n - 2)}(\cH)$, or\label{difficult-edge-covering} \item $\chi'(\cH) \leq n$.\label{difficult-edge-extremal} \end{enumerate} \end{lemma} \begin{proof} Let $U_1 \coloneqq V^{(n - 1)}(\cH)$, let $U_2 \coloneqq V^{(n - 2)}(\cH)$, let $X \coloneqq V(\cH)\setminus (e\cup U_1\cup U_2)$, and let $m\coloneqq |U_1\cup U_2|$. Since $\cH$ is linear and $e$ is huge, $e \cap U_i = \varnothing$ for $i\in\{1, 2\}$. First, suppose $U_2 = \varnothing$. If $|U_1|$ is even, then we can find a perfect matching $M_1$ in $G[U_1]$, and $M' \coloneqq M \cup M_1$ satisfies~\ref{difficult-edge-covering}, so we assume $|U_1|$ is odd. If $X\neq\varnothing$, then there is an edge $uv \in E(G)$ such that $u\in U_1$ and $v \in X$, and there is a perfect matching $M_1$ in $G[U_1\setminus\{u\}]$. Now $M'\coloneqq M\cup M_1\cup \{uv\}$ satisfies~\ref{difficult-edge-covering}, so we assume $X = \varnothing$, and we show $\chi'(\cH) \leq n$. Note that if $X, U_2 = \varnothing$, then\COMMENT{a hyperedge (different from $e$) of size at least three would need to contain at least two vertices of $U_1$ or $e$ -- either case contradicts the linearity of $\cH$.} the only edge in $\cH\setminus E(G)$ is $e$. Let $w \in U_1$, let $M_1$ be a perfect matching in $G[U_1\setminus\{w\}]$, and let $G' \coloneqq \cH\setminus(M_1\cup e)$. Now $G'$ is a graph with exactly one vertex of degree $n - 1$ (namely $w$), so by Theorem~\ref{thm:vizing}, $\chi'(G') \leq n - 1$. By combining a proper $(n - 1)$-edge-colouring of $G'$ with the colour class consisting of $M_1\cup e$, we have $\chi'(\cH) \leq n$, as desired. Therefore we assume $U_2\neq\varnothing$ and let $u \in U_2$. Let $G'\coloneqq G[U_1 \cup U_2] - u$ if $m$ is odd and let $G' \coloneqq G[U_1\cup U_2]$ otherwise. If $G'$ has a perfect matching, then~\ref{difficult-edge-covering} holds, so we assume otherwise. Thus, by the Tutte-Berge formula, there is a set $S$ such that $G' - S$ has at least $|S| + 2$ odd components (since $G'$ has an even number of vertices, $G' - S$ cannot have $|S|+1$ odd components). Note that if a vertex has degree at least $n-2$ in $\cH$ then it has degree at least $n-3$ in $G$. Thus $\delta(G') \geq v(G') - 3$, which implies that $|S| \leq 1$. Moreover, if $|S| = 1$, then\COMMENT{removing $S$ must create at least three components, and if any of these components has more than one vertex, then any vertex from a different component would then be not adjacent to at least three other vertices in $G'$, a contradiction. Thus removing $S$ creates exactly three components, each containing exactly one vertex; moreover, each of these three vertices is non-adjacent to the other two in $G$, but their degree in $\cH$ is $n-2$, so they must form a hyperedge of size three. } $v(G') = 4$ and the vertices in $V(G')\setminus S$ form a hyperedge of $\cH$. In this case $G'$ is a star\COMMENT{the leaves of the star must be in $U_2$ because they are contained in a hyperedge, but the center may be in $U_1$} on four vertices, so $|U_2| \leq |V(G') \cup \{u \}| \leq 5$ and $|U_1| \leq 1$. If $U_1 = \varnothing$, then $M'\coloneqq M$ satisfies~\ref{difficult-edge-covering}, and otherwise, $M'\coloneqq M\cup\{uv\}$ where $v\in U_1$, satisfies~\ref{difficult-edge-covering}, as desired. If $S = \varnothing$, then $G'$ is a graph with two vertices and no edges. In this case, $U_1 = \varnothing$, so $M' \coloneqq M$ satisfies~\ref{difficult-edge-covering}. \end{proof} \section{Concluding remarks} \abhi{Worth dicussing what we want to keep from this section in the journal version.} \Dongyeap{The content below is informal and tentative.} For a hypergraph $H$ and $v \in V(H)$, let us define \begin{equation*} N(v) := \bigcup_{v \in e \in E(H)} (e \setminus \{v \}). \end{equation*} Let $\Delta^*(H)$ be the maximum of $|N(v)|$ for a vertex $v \in V(H)$, which is clearly at most $n-1$. In particular when $H$ is a simple graph, $\Delta^*(H) = \Delta(H)$. Several authors (Berge, F\"uredi, etc.) suggested the following generalisation of EFL. \begin{conjecture} For any linear hypergraph $H$, its chromatic index is at most $\Delta^*(H) + 1$. \end{conjecture} Note that this conjecture can be also regarded as a natural generalisation of Vizing's theorem, since $\Delta^*(H)$ is the maximum degree when $H$ is a simple graph. It is also worth mentioning that the proof in~\cite{kahn1992coloring} shows that the chromatic index of a linear hypegraph $H$ is $(1+o(1))\Delta^*(H)$. In fact, our proof method can be also applicable to the conjecture when $\Delta^*(H) \geq {\rm polylog}(n)$ to ensure many concentration inequalities hold simultaneously and Alon-Yuster type arguments work. Probably for non-extremal cases, it is desirable to show the improvement of the conjecture, as follows: the chromatic index is at most \begin{equation}\label{eqn:chromindex} \max ((1-\mu) \Delta^*(H) \:\:,\:\: \Delta(H) + 1 ) \end{equation} for some small $\mu > 0$. Note that this will not work for extremal cases, e.g., projective planes have chromatic index exactly $\Delta^*(H)$, so it is interesting that one may have an improved bound~\eqref{eqn:chromindex} if the hypergraph is far from being a projective plane. Should also mention about the list-variant of the EFL conjecture, which seems challenging via our method, as the list-variant of Vizing's theroem is still widely open (even for the complete bipartite graphs, it is highly nontrivial and was an infamous Dinitz conjecture that was proved in 1990s). For any $r$-uniform linear hypergraph $\cH$, it is easily checked that \begin{equation}\label{eqn:chibound} \Delta(\cH) \leq \omega(L(\cH)) \leq \Delta(\cH) + (r-1)^2. \end{equation} This is tight for projective planes. This explains why $\chi'(\cH)$ cannot be very close to $\Delta(\cH)$ when $r$ is comparable to $\Delta(\cH)$, as the right hand side of~\eqref{eqn:chibound} becomes far from $\Delta(\cH)$ -- so $\Delta(\cH)$ is not the right parameter to estimate $\chi'(\cH)$ for linear hypergraphs with large uniformity. So, what is the right parameter to estimate $\chi'(\cH)$? When $\Delta(\cH)$ is much larger than $r$, we deduce that $\omega(L(\cH)) \sim \Delta(\cH)$ by~\eqref{eqn:chibound}, and Pippenger-Spencer or Kahn's result imply that $\chi'(\cH) \sim \Delta(\cH)$. Perhaps, $\chi'(\cH) = (1+o(1))\omega(L(\cH))$ holds for any linear hypergraph $\cH$, even though it is not uniform. Currently, we do not know the much weaker bound $\chi'(\cH) = O(\omega(L(\cH)))$ yet. \section{Optimal edge-colourings}\label{graph-edge-section} In this section we will prove colouring results (Lemma~\ref{hall-based-finishing-lemma} and Corollary~\ref{cor:optcol}) which will be used to colour the leftover edges of the reservoir in the final step of the proof of Theorem~\ref{main-thm}. \subsection{Edge-colourings with forbidden lists} The following observation follows easily from Hall's theorem. \begin{obs}\label{obs:matching_A} Let $G$ be a bipartite graph with bipartition $\{A,B \}$, and let $\delta_A$ and $\delta_B$ be the minimum degrees of the vertices in $A$ and $B$, respectively. If $|A| \leq |B|$ and $\delta_A + \delta_B \geq |A|$, then $G$ has a matching covering $A$. \end{obs} \COMMENT{Suppose not. By Hall's theorem, there exist a nonempty $A' \subseteq A$ and $B' := N_G(A)$ such that $|B'| \leq |A'|-1$, thus $B \setminus B'$ is nonempty. Let $a \in A'$ and $b \in B \setminus B'$. Then \begin{equation*} \delta_A \leq d_G(a) \leq |B'| \leq |A'|-1\:\:\:,\:\:\:\delta_B \leq d_G(b) \leq |A|-|A'|, \end{equation*} since $N_G(a) \subseteq B'$ and $N_G(b) \subseteq A \setminus A'$. Hence $\delta_A + \delta_B \leq |A|-1$, contradicting our assumption.} \begin{lemma}\label{hall-based-finishing-lemma} Let $\delta \in (0,1)$, let $H$ be an $n$-vertex graph, let $C$ be a set of colours satisfying $|C| \geq 7 \delta n$, and for every $w \in V(H)$, let $C_w \subseteq C$ such that the following hold. \begin{enumerate} \item[\mylabel{cond:hall1}{{\rm (i)}}] For any $w \in V(H)$, $d_H(w) \leq |C|-|C_w|$. \item[\mylabel{cond:hall2}{{\rm (ii)}}] There is a set $U \subseteq V(H)$ with $|U| \leq \delta n$ such that every edge of $H$ is incident to a vertex of $U$. \item[\mylabel{cond:hall3}{{\rm (iii)}}] For every\COMMENT{we imagine $C_w$ as the set of forbidden colours} vertex $w \in V(H)$, $|C_w| \le \delta n$. \item[\mylabel{cond:hall4}{{\rm (iv)}}] For every $c \in C$, $|\{w \in V(H) \: : \: c \in C_w \}| \leq \delta n$. \end{enumerate} Then there exists a proper edge-colouring $\phi : E(H) \to C$ such that every edge $uv \in E(H)$ satisfies $\phi(uv) \notin C_u \cup C_v$. \end{lemma} \begin{proof}\COMMENT{the inductive steps of the proof are quite straightforward, perhaps we can omit the proof below when submitting our paper, and leave it in Appendix.} Let $U := \{u_1 , \dots , u_t \}$, where $t := |U| \leq \delta n$. Let $\phi_0 : \varnothing \to C$ be an empty function, and for every $1 \leq j \leq t$, let us inductively define a proper edge-colouring $\phi_j : \bigcup_{k=1}^{j} E_{H}(u_k) \to C$ such that \begin{enumerate} \item[\mylabel{cond:pa}{(a)\textsubscript{\textit{j}}}] $\phi_j (uv) \notin C_u \cup C_v$ for each $uv \in \bigcup_{k=1}^{j} E_H(u_k)$, and \item[\mylabel{cond:pb}{(b)\textsubscript{\textit{j}}}] $\phi_j$ is a proper edge-colouring extending $\phi_{j-1}$. \end{enumerate} Since every edge of $H$ is incident to a vertex of $U$ by~\ref{cond:hall2}, $\phi := \phi_t$ satisfies the assertion of the lemma. Let $i \in [t]$, and suppose we have already defined $\phi_j$ satisfying both~\ref{cond:pa} and~\ref{cond:pb} for $j \in [i - 1]$; now we aim to construct $\phi_i$ satisfying ~\ref{cond:pa} and~\ref{cond:pb} for $j = i$. For each $v \in V(H) \setminus \{u_1 , \dots , u_{i-1} \}$, let $C_v^* := \phi_{i-1} ( E_H(v) \cap \bigcup_{j=1}^{i-1} E_H(u_j) )$ be the set of colours of edges incident to a vertex $v \in V(H)$ in $\phi_{i-1}$. Since any vertex $v \in V(H) \setminus \{u_1 , \dots , u_{i-1} \}$ is adjacent to at most $i-1$ vertices in $\{u_1 , \dots , u_{i-1} \}$, we have \begin{equation}\label{eqn:boundcv*} |C_v^*| \overset{\ref{cond:pb}}{=} |E_H(v) \cap \bigcup_{j=1}^{i-1} E_H(u_j)| \leq i-1 \leq \delta n. \end{equation} Let $A := E_H(u_i) \setminus \bigcup_{j=1}^{i-1} E_H(u_j)$ and $B := C \setminus (C_{u_i} \cup C_{u_i}^*)$. Let $G_i$ be an auxiliary bipartite graph with the bipartition $\{A,B\}$ such that $\{e,c\} \in E(G_i)$ for $e = u_i v \in A$ and $c \in B$ if and only if $c \notin C_v \cup C_v^*$. Thus, the following hold. \begin{itemize} \item $|A| \leq |B|$. Indeed, $|A| = d_{H}(u_i) - |E_H(u_i) \cap \bigcup_{j=1}^{i-1} E_H(u_j)|$ and $|B| \overset{\ref{cond:pb}}{\geq} |C| - |C_{u_i}| - |E_H(u_i) \cap \bigcup_{j=1}^{i-1} E_H(u_j)| \overset{\ref{cond:hall1}}{\geq} |A|$. \item For each $e = u_i v \in A$, we have\COMMENT{below we used $|C| \ge 7 \delta n$.} \begin{equation}\label{eqn:mindeg_A} d_{G_i}(e) = |B|-|C_v \cup C_v^*| \geq |C| - |C_{u_i} \cup C_{u_i}^*| - |C_v \cup C_v^*| \overset{\eqref{eqn:boundcv*},~\ref{cond:hall3}}{\geq} 3 \delta n. \end{equation} \item For each $c \in B$, since there are at most $i-1$ edges in $\bigcup_{j=1}^{i-1} E_H(u_j)$ which could be assigned the colour $c$ by $\phi_{i-1}$, we have $| \{ v \in V(H) : c \in C_v^* \} | \leq 2(i-1) \leq 2 \delta n$. Thus \begin{equation}\label{eqn:mindeg_B} d_{G_i}(c) \geq |A| - |\{ v \in V(H) : c \in C_v^* \}| - |\{w \in V(H) \: : \: c \in C_w \}| \overset{\ref{cond:hall4}}{\geq} |A| - 3 \delta n. \end{equation} \end{itemize} Let $\delta_A$ and $\delta_B$ be the minimum degrees of the vertices in $A$ and $B$ in $G_i$, respectively. Then by~\eqref{eqn:mindeg_A} and~\eqref{eqn:mindeg_B}, we have $\delta_A + \delta_B \geq |A|$. Moreover, $|A| \leq |B|$, so there exists a matching $M_i$ in $G_i$ covering $A$ by Observation~\ref{obs:matching_A}. For each $e \in A = E_H(u_i) \setminus \bigcup_{j=1}^{i-1} E_H(u_j)$, let $c_e \in B$ be the unique element such that $\{e, c_e\} \in E(M_i)$. Let us define $\phi_{i}(e) := \phi_{i-1}(e)$ for $e \in \bigcup_{j=1}^{i-1} E_H(u_j)$, and $\phi_e(e) \coloneqq c_e$ for $e \in E_H(u_i) \setminus \bigcup_{j=1}^{i-1} E_H(u_j)$. Since $c_e \notin C_{u_i} \cup C_{u_i}^* \cup C_v \cup C_v^*$ for every $e = u_iv \in E_H(u_i) \setminus \bigcup_{j=1}^{i-1} E_H(u_j)$, $\phi_i$ is a proper edge-colouring satisfying~\ref{cond:pa} and~\ref{cond:pb} for $j = i$, as desired. \end{proof} \subsection{Edge-colouring pseudorandom graphs}\label{Delta-edge-col-section} Here we derive an optimal colouring result for pseudorandom graphs (Corollary~\ref{cor:optcol}) from a result (Theorem~\ref{thm:optcol}) on the overfull subgraph conjecture, which in turn is a consequence of the main result in~\cite{kuhn2013hamilton} on Hamilton decompositions of robustly expanding regular graphs. \begin{definition}[Lower regularity] Let $\rho,\xi \in (0,1)$, and let $G$ be an $n$-vertex graph. A set $R \subseteq E(G)$ is \textit{lower $(\rho, \xi, G)$-regular} if for every pair of disjoint sets $S, T\subseteq V(G)$ with $|S|, |T| \geq \xi n$, we have $|E_{G}(S, T)\cap R| \geq \rho e_{G}(S, T) - \xi |S||T|$. A graph $H$ is lower $(\rho,\xi)$-regular if $E(H)$ is lower $(\rho,\xi,K_{v(H)})$-regular, i.e., for every pair of disjoint sets $S,T \subseteq V(H)$ with $|S|,|T| \geq \xi v(H)$, we have $e_H(S,T) \geq (\rho-\xi)|S||T|$. \end{definition} \begin{obs}[Robustness of lower regularity]\label{obs:del_lowerreg} Let $\alpha , \xi , \rho \in (0,1)$, and let $G$ be a graph. Then the following hold. \begin{enumerate} \item[\mylabel{LR1}{(\ref{obs:del_lowerreg}.1)}] If $R \subseteq E(G)$ is lower $(\rho,\xi,G)$-regular and $R' \subseteq R$ satisfies $\Delta(R-R') \leq \alpha v(G)$, then $R'$ is lower $(\rho,\xi+\alpha^{1/2},G)$-regular. \item[\mylabel{LR2}{(\ref{obs:del_lowerreg}.2)}] If $G$ is lower $(\rho,\xi)$-regular and $G \subseteq H$ such that $v(H) \leq (1 + \alpha \xi) v(G)$, then $H$ is lower $(\rho(1-\alpha)^2 , \frac{\xi}{1-\alpha})$-regular. \end{enumerate} \end{obs} \COMMENT{\begin{proof} Let $v(G) = n$. For any disjoint $S,T \subseteq V(G)$ with $|S|,|T| \geq (\xi + \alpha^{1/2})n$, we have $|E_{G}(S,T) \cap R'| \geq |E_{G}(S,T) \cap R| - \alpha n|S| \geq \rho e_{G}(S,T) - \xi |S||T| - \alpha n |S| \geq \rho e_{G}(S,T) - |S| (\xi|T| + \alpha n) \geq \rho e_{G}(S,T) - |S||T| (\xi + \alpha^{1/2})$, since $|T| \geq \alpha^{1/2} n$. So $R'$ is lower $(\rho , \xi+\alpha^{1/2} , G)$-regular, as desired. Now we prove the second bullet. For any disjoint $A,B \subseteq V(H)$ such that $|A|,|B| \geq \frac{\xi}{1-\alpha} n$, we have $|A \cap V(G)|,|B \cap V(G)| \geq \frac{\xi}{1-\alpha} n - \alpha \xi n \ge \xi n$. Moreover, $|A \cap V(G)| \geq |A| - \alpha \xi n \geq |A| - \alpha \xi (1 - \alpha)\frac{|A|}{\xi} = |A| - \alpha(1 - \alpha) |A| \geq (1 - \alpha)|A|$ and, similarly, $|B \cap V(G)| \geq (1 - \alpha)|B|$. Thus, $e_{H}(A,B) \geq e_G(A \cap V(G),B \cap V(G)) \geq (\rho-\xi)|A \cap V(G)| |B \cap V(G)| \geq (\rho-\xi)(1-\alpha)^2 |A||B| \geq (\rho(1-\alpha)^2 - \xi )|A||B| \geq (\rho(1-\alpha)^2 - \frac{\xi}{1 - \alpha} )|A||B|$, as desired. \end{proof}} \begin{theorem}[Glock, K\"uhn, and Osthus \cite{GKO2016}]\label{thm:optcol} Let $0 < 1/n_0 \ll \nu , \varepsilon \ll p < 1$, and let $n \geq n_0$. Let $G$ be an $n$-vertex graph that is lower $(p,\varepsilon)$-regular and satisfies $\Delta(G) - \delta(G) \leq \nu n$. Let $\defi_G (v) := \Delta(G) - d_G(v)$ for any $v \in V(G)$. If $n$ is even and \begin{equation}\label{eqn:def_ineq} \defi_G (w) \leq \sum_{v \in V(G) \setminus \{ w\}} \defi_G (v) \end{equation} for some vertex $w \in V(G)$ with $d_G(w) = \delta(G)$, then $\chi'(G) = \Delta(G)$. \end{theorem} Even though the statement of~\cite[Theorem 1.6]{GKO2016} requires $G$ to have no overfull subgraph, it is shown in its proof that it suffices to assume that $G$ satisfies ~\eqref{eqn:def_ineq} (see the remark below~\cite[Theorem 1.6]{GKO2016}). We will use the following corollary of Theorem~\ref{thm:optcol}\COMMENT{which is weaker than~\cite[Conjecture 1.7]{GKO2016} but enough for our purpose}. \begin{corollary}\label{cor:optcol} Let $0 < 1/n_0 \ll \eta , \varepsilon \ll p < 1$, and let $n \geq n_0$. Let $G$ be an $n$-vertex graph that is lower $(p,\varepsilon)$-regular and satisfies $\Delta(G) - \delta(G) \leq \eta n$. If there are at least $\Delta(G)$ vertices in $G$ having degree less than $\Delta(G)$, then $\chi'(G) = \Delta(G)$. \end{corollary} \begin{proof}\COMMENT{Since the proof of Corollary~\ref{cor:optcol} is quite straightforward, perhaps we can omit the proof from our journal version.}Note that~\eqref{eqn:def_ineq} is equivalent to \begin{align}\label{eqn:def_ineq_2} 2(\Delta(G) - \delta(G)) \leq \sum_{v \in V(G)} (\Delta(G) - d_G(v)). \end{align} Since $G$ is lower $(p,\varepsilon)$-regular,\COMMENT{Let $V_1 \subseteq V(G)$ be a subset such that $\varepsilon n \leq |V_1| \leq 2 \varepsilon n$, and let $V_2 := V(G) \setminus V_1$. There exists $w \in V_1$ such that \begin{equation*} d_G(w) \geq |N_G(w) \cap V_2| \geq \frac{e_G(V_1 , V_2)}{|V_1|} \geq (p - \varepsilon)|V_2| \geq (p-\varepsilon)(1 - 2 \varepsilon)n \geq (p - 3 \varepsilon)n. \end{equation*}} it is easy to see that $\Delta(G) \geq (p - 3 \varepsilon)n$. Now we prove the corollary. First suppose $n$ is even. Since $G$ has at least $\Delta(G)$ vertices having degree less than $\Delta(G)$, we have $2(\Delta(G) - \delta(G)) \leq 2 \eta n \leq (p-3\varepsilon)n \leq \Delta(G) \leq \sum_{v \in V(G)}(\Delta(G) - d_G(v))$. Thus ~\eqref{eqn:def_ineq_2} holds, which implies that ~\eqref{eqn:def_ineq} holds. So we can apply Theorem~\ref{thm:optcol} to show that $\chi'(G) = \Delta(G)$. Now suppose $n$ is odd. Let $t := \lfloor \Delta(G) - 2 \eta n \rfloor$. Let $G^*$ be a graph obtained from $G$ by adding a new vertex $v^*$ adjacent to exactly $t$ vertices of $G$ having degree less than $\Delta(G)$ in $G$. Then \begin{enumerate}[(a)] \item\label{cond:a1} $\Delta(G^*) = \Delta(G)$, \item\label{cond:a2} $\delta(G^*) = d_{G^*}(v^*) = t$, \item\label{cond:a3} $|\{ v \in V(G) : \Delta(G^*) > d_{G^*}(v) \}| \geq \Delta(G) - d_{G^*}(v^*)$, and \item\label{cond:a4} $G^*$ is lower\COMMENT{set $\alpha = 1/2$, $\rho = p$ and $\xi = \eps$} $(p/4,2\eps)$-regular by~\ref{LR2} \end{enumerate} This implies that \begin{align*} \sum_{v \in V(G^*)} (\Delta(G^*) - d_{G^*}(v)) &\overset{\ref{cond:a2}}{=} \sum_{v \in V(G)} (\Delta(G^*) - d_{G^*}(v)) + (\Delta(G^*) - \delta(G^*)) \overset{\ref{cond:a1},\ref{cond:a2},\ref{cond:a3}}{\geq} 2(\Delta(G^*) - \delta(G^*)). \end{align*} Thus, $G^*$ satisfies~\eqref{eqn:def_ineq_2}, so it satisfies ~\eqref{eqn:def_ineq}. Moreover (d) holds, and $\Delta(G^*) - \delta(G^*) \leq 3 \eta v(G^*)$ by (a) and (b), so applying Theorem~\ref{thm:optcol} with $G^*, p/4, 2\eps , 3\eta$ playing the roles of $G, p, \eps, \nu$, respectively, we deduce that $\Delta(G) \leq \chi'(G) \leq \chi'(G^*) = \Delta(G^*) \overset{\ref{cond:a1}}{=} \Delta(G)$, as desired. \end{proof} \section{Introduction} \label{intro-section} Graph and hypergraph colouring problems are central to combinatorics, with applications and connections to many other areas, such as geometry, algorithm design, and information theory. As one illustrative example, the fundamental Ajtai-Koml{\'{o}}s-Pintz-Spencer-Szemer\'edi (AKPSS) theorem~\cite{AKPSS82} shows that locally sparse uniform hypergraphs have large independent sets. This was initially designed to disprove the famous Heilbronn conjecture in combinatorial geometry but has found numerous further applications e.g., in coding theory. The AKPSS theorem was later strengthened by Frieze and Mubayi~\cite{FM13} to show that linear $k$-uniform hypergraphs with $k \geq 3$ have small chromatic number. Here a hypergraph $\cH$ is \textit{linear} if every two distinct edges of $\cH$ intersect in at most one vertex. \subsection{The Erd\H{o}s-Faber-Lov\'{a}sz conjecture} In 1972, Erd\H{o}s, Faber, and Lov\'{a}sz conjectured (see~\cite{erdos1981}) the following equivalent statements. Let $n \in \mathbb{N}$. \begin{itemize} \item[(i)] If $A_1 , \dots , A_n$ are sets of size $n$ such that every pair of them shares at most one element, then the elements of $\bigcup_{i=1}^{n} A_i$ can be coloured by $n$ colours so that all colours appear in each $A_i$. \item[(ii)] If $G$ is a graph that is the union of $n$ cliques, each having at most $n$ vertices, such that every pair of cliques shares at most one vertex, then the chromatic number of $G$ is at most $n$. \item[(iii)] If $\cH$ is a linear hypergraph with $n$ vertices, then the chromatic index of $\cH$ is at most $n$. \end{itemize} Here the \textit{chromatic index} $\chi'(\cH)$ of a hypergraph $\cH$ is the smallest number of colours needed to colour the edges of $\cH$ so that any two edges that share a vertex have different colours. The formulation (iii) is the one that we will consider throughout the paper. For simplicity, we will refer to this conjecture as the EFL conjecture. Erd\H{o}s considered this to be `one of his three most favorite combinatorial problems' (see e.g.,~\cite{kahn1997}). The simplicity and elegance of its formulation initially led the authors to believe it to be easily solved (see e.g., the discussion in~\cite{cg1998} and~\cite{erdos1981}). It was initially designed as a simple test case for a more general theory of hypergraph colourings. However, as the difficulty became apparent Erd\H{o}s offered successively increasing rewards for a proof of the conjecture, which eventually reached \$500. Previous progress towards the conjecture includes the following results. Seymour~\cite{seymour1982} proved that every $n$-vertex linear hypergraph $\cH$ has a matching of size at least $e(\cH)/n$, where $e(\cH)$ is the number of edges in $\cH$. (Note that this immediately follows from the validity of the EFL conjecture, but it is already difficult to prove.) Kahn and Seymour~\cite{KS1992} proved that every $n$-vertex linear hypergraph has fractional chromatic index at most $n$. Chang and Lawler~\cite{chang1988} showed that every $n$-vertex linear hypergraph has chromatic index at most $\lceil 3n/2 - 2 \rceil$. A breakthrough of Kahn~\cite{kahn1992coloring} yielded an approximate version of the conjecture, by showing that every $n$-vertex linear hypergraph has chromatic index at most $n + o(n)$. Recently Faber and Harris~\cite{FH2019} proved the conjecture for linear hypergraphs whose edge sizes range between 3 and $cn^{1/2}$ for a small absolute constant $c>0$. More background and earlier developments related to the EFL conjecture are detailed in the surveys of Kahn~\cite{kahn1995, kahn1997}. See also the recent survey by the authors~\cite{KKMO2021survey}. \subsection{Main results} In this paper we prove the EFL conjecture for every large $n$. \begin{theorem}\label{main-thm} For every sufficiently large $n$, every linear hypergraph $\cH$ on $n$ vertices has chromatic index at most $n$. \end{theorem} There are three constructions for which Theorem~\ref{main-thm} is known to be tight: a complete graph $K_n$ for any odd integer $n$ (and minor modifications thereof\COMMENT{e.g., odd $K_n$ minus an edge.}), a finite projective plane of order $k$ on $n = k^2 + k + 1$ points, and a degenerate plane $\{ \{1,2\},\dots,\{1,n\},\{2,\dots,n\} \}$. Note that the first example has bounded edge size (two), while the other two examples have unbounded edge size as $n$ tends to infinity. Kahn's proof~\cite{kahn1992coloring} is based on a powerful method known as the R\"odl nibble. Roughly speaking, this method builds a large matching using an iterative probabilistic procedure. It was originally developed by R\"odl~\cite{rodl1985} to prove the Erd\H{o}s--Hanani conjecture~\cite{ErdosHanani} on combinatorial designs. Another famous result based on this method is the Pippenger--Spencer theorem~\cite{PippengerSpencer}, which implies that the chromatic index of any uniform hypergraph $\cH$ of maximum degree $D$ and codegree $o(D)$ is $D+o(D)$. (Note that this in turn implies that the EFL conjecture holds for all large $r$-uniform linear hypergraphs of bounded uniformity $r \geq 3$.) In a seminal paper, Kahn~\cite{kahn1996asymptotically} later developed the approach further to show that the same bound $D+o(D)$ even holds for the list chromatic index (an intermediate result in this direction, which also strengthens the Pippenger--Spencer theorem, was the main ingredient of his proof in~\cite{kahn1992coloring}). The best bound on the $o(D)$ error term for the list chromatic index of such hypergraphs was obtained by Molloy and Reed~\cite{MR2000}, and for the chromatic index, the best bound was proved in~\cite{KKMO2020}. Our proof will also rely on certain properties of the R\"odl nibble. In addition, our proof makes use of powerful colouring results for locally sparse graphs (Theorems~\ref{local-sparsity-lemma} and~\ref{aks-local-sparsity}). This line of research goes back to Ajtai, Koml{\'{o}}s, and Szemer\'edi~\cite{AKS1980} who (preceding R\"odl~\cite{rodl1985}) developed a very similar semi-random nibble approach to give an upper bound $O(k^2 / \log k)$ on the Ramsey number $R(3,k)$ by finding large independent sets in triangle-free graphs (the matching lower bound $R(3,k) = \Omega(k^2 / \log k)$ was later established by Kim~\cite{kim1995_ramsey}, also using a semi-random approach). The above Ramsey bound by Ajtai, Koml{\'{o}}s and Szemer\'edi was subsequently strengthened by a highly influential result of Johansson~\cite{johansson1996}, who showed that triangle-free graphs of maximum degree $\Delta$ have chromatic number $O(\Delta/\log \Delta)$ (and a related result was proved independently by Kim~\cite{kim1995}). The result of Frieze and Mubayi~\cite{FM13} mentioned at the start of Section~\ref{intro-section} is one of several analogues and generalizations of Johansson's Theorem. It also turns out that the condition of being triangle-free can be relaxed (in various ways) to being `locally sparse'~\cite{AIS19, AKS99, DKPS20, Vu02}. We will be able to apply such results to suitable parts of the line graph of our given linear hypergraph $\cH$. \begin{comment} \cite{AIS19, AKS99, DKPS20, Vu02}$\leftarrow$ these are the results that work best for graphs with ``full local sparsity'', i.e. where the number of edges in the neighborhood of a vertex is $o(\Delta^2)$. They all generalize Johansson's result, and the two older ones use nibble. Theorem~\ref{local-sparsity-lemma} from~\cite{MR02} works better when the number of edges in the neighborhood is $\alpha\binom{\Delta}{2}$ for $\alpha \in (0, 1)$. It is the one we actually use in the proof of Theorem~\ref{main-thm}, but the proof doesn't use nibble, and the results don't generalize Johansson's result, but the bound can be improved by using nibble~\cite{BPP18, HdVK20}. Lastly, there is another result of Johansson~\cite{J96-Kr}, also unpublished, that uses nibble, that says that the triangle-free condition can be replaced by neighborhoods having bounded chromatic number, but maybe it's not worth adding. So I think we could add the citations~\cite{AIS19, AKS99, DKPS20, Vu02} here \end{comment} One step in our proof involves what may be considered a `vertex absorption' argument; here certain vertices not covered by a matching produced by the R\"odl nibble are `absorbed' into the matching to form a colour class. (Vertex) absorption as a systematic approach was introduced by R\"odl, Ruci\'nski, and Szemer\'edi~\cite{rrs2006} to find spanning structures in hypergraphs (with precursors including~\cite{egp1991, krivelevich1997}). Absorption ideas were first used for edge decomposition problems in~\cite{kuhn2013hamilton} to solve Kelly's conjecture on tournament decompositions. We will make use of an application of the main result of~\cite{kuhn2013hamilton} to the overfull subgraph conjecture (which was derived in~\cite{GKO2016}). Kahn~\cite{kahn1995} predicted\COMMENT{In fact, he conjectured this in an informal way -- he said ``there ought to be some slack in the bound away from these extremes", as well as mentioning the strengthening of EFL by Berge-F\"uredi-Meyniel. Unfortunately, it seems to require some more ideas to prove Berge-F\"uredi-Meyniel conjecture, even for bounded edge size case, as the neighbours of the high-degree vertices in $U$ are not longer well-distributed (i.e., cannot guarantee the regularity conditions of the absorbers), where our absorption lemmas rely much on this.} that the bound in the EFL conjecture can be improved if $\cH$ is far from being one of the extremal examples mentioned above. We confirm his prediction by proving a `linear' and a `sublinear' stability result as follows. \COMMENT{Moreover, perhaps we can make the chromatic index $o(n)$ if $|e| \in [d_1 , g(n)]$, if $1 \ll d_1 \leq g(n) \ll \sqrt{n}$ -- it is also interesting to see how we can bound the chromatic index depending on the choice of $g(n)$.} \begin{theorem}[linear stability]\label{main-thm-2} For every $\delta > 0$, there exist $n_0, \sigma > 0$ such that the following holds. For any $n \geq n_0$, if $\cH$ is an $n$-vertex linear hypergraph with maximum degree at most $(1-\delta)n$ such that the number of edges of size $(1 \pm \delta)\sqrt{n}$ in $\cH$ is at most $(1-3\delta)n$, then the chromatic index of $\cH$ is at most $(1-\sigma)n$. \end{theorem} \begin{theorem}[sublinear stability]\label{weak-stability-thm} For every $\eps > 0$, there exist $n_0, \eta > 0$ such that the following holds. For any $n \geq n_0$, if $\cH$ is an $n$-vertex linear hypergraph with maximum degree at most $\eta n$ and no edge $e\in \cH$ such that $\eta \sqrt n < |e| < \sqrt n / \eta$, then the chromatic index of $\cH$ is at most $\eps n$. \end{theorem} \subsection{Related results and open problems} Formulation~(ii) of the EFL conjecture can be viewed as a statement implying that a local restriction on the local density of a graph has a strong influence on its global structure. A famous example where this is not the case is the construction by Erd\H os of graphs of high girth and high chromatic number. Another well known instance where this fails is a bipartite version of the EFL conjecture due to Alon, Saks, and Seymour (see Kahn~\cite{kahn1991}); they conjectured that if a graph $G$ can be decomposed into $k$ edge-disjoint bipartite graphs, then the chromatic number of $G$ is at most $k+1$. This conjecture was a generalisation of the Graham--Pollak theorem~\cite{gp1972} on edge decompositions of complete graphs into bipartite graphs, which has applications to communication complexity. However, this conjecture was disproved by Huang and Sudakov~\cite{HS2012} in a strong form, i.e., it is not even close to being true. A natural generalization of the EFL conjecture was suggested by Berge~\cite{berge1989} and F\"{u}redi~\cite{furedi1986}; if $\cH$ is a linear hypergraph with vertex set $V$, then the chromatic index of $\cH$ is at most $\max_{v\in V}|\bigcup_{e\ni v}e|$. This would be a direct generalization of Vizing's theorem on the chromatic index of graphs. Another beautiful question leading on from Theorem~\ref{main-thm} is whether it can be extended to list colourings. Many more related results and problems, along with a detailed sketch of some aspects of the proof of the EFL conjecture are given in the recent survey by the authors~\cite{KKMO2021survey}. \begin{comment} \abhi{Old version below, growing new version above---------------------------------------------------------------------------------------------------------------} In this paper, we focus on the last equivalent statement of the conjecture that regards colouring linear hypergraphs. The problem of colouring hypergraphs has been studied by many researchers in combinatorics. As one of the fundamental results, Pippenger and Spencer~\cite{PippengerSpencer} showed that every $k$-uniform linear hypergraph with maximum degree at most $D$ has chromatic index $D + o(D)$, based on a celebrated ``R\"{o}dl's nibble" method. There are three notable examples for which Theorem~\ref{main-thm} is tight: a complete graph $K_n$ for any odd integer $n$, a finite projective plane of order $k$ on $n = k^2 + k + 1$ points, and a degenerate plane $\{ \{1,2\},\dots,\{1,n\},\{2,\dots,n\} \}$, where the first example has bounded edge size (two), while the other two examples have unbounded edge size as $n$ tends to infinity. There have been a lot of partial results regarding the EFL conjecture, where we only mention some notable results here. Since intersecting hypergraphs are natural generalisations of projective planes, de Bruijn and Erd\H{o}s~\cite{bruijn_erdos1948} showed that every $n$-vertex linear intersecting hypergraph has at most $n$ edges, which was further generalised by F\"{u}redi~\cite{furedi1986}, and independently by Lov\'{a}sz, Kahn, and Seymour (see~\cite{KS1992}).\tom{I'm not sure we want to mention Furedi's result here. We could mention it in the conclusion, but in the introduction it seems we want to avoid the Berge-Furedi Conjecture.} \abhi{we will move this part to further generalisations subsection} Seymour~\cite{seymour1982} proved that every $n$-vertex linear hypergraph has a matching of size at least $|\cH|/n$, which was one of the original motivations for the EFL conjecture. Kahn and Seymour~\cite{KS1992} proved that every $n$-vertex linear hypergraph has fractional chromatic index at most $n$. Faber~\cite{faber2010} proved that the EFL conjecture holds for all $r$-uniform regular linear $n$-vertex hypergraphs satisfying $c \leq r \leq \sqrt{n}/c$ for some absolute constant $c>0$. We also mention some known results making progress to obtain the chromatic index of $n$-vertex linear hypergraphs close to $n$. Chang and Lawler~\cite{chang1988} showed that every $n$-vertex linear hypergraph has chromatic index at most $\lceil 3n/2 - 2 \rceil$. Finally, Kahn~\cite{kahn1992coloring} settled the conjecture asymptotically, showing that every $n$-vertex linear hypergraph has chromatic index $(1+o(1))n$. The readers should refer to Kahn's survey~\cite{kahn1995, kahn1997} and the survey by Romero and S\'{a}nchez-Arroyo~\cite{RS2007} on the EFL conjecture and related topics. \subsection{Our results} We prove the EFL conjecture for all large $n$. \begin{theorem}\label{main-thm} For every sufficiently large $n$, every linear hypergraph $\cH$ on $n$ vertices has chromatic index at most $n$. \end{theorem} Kahn~\cite{kahn1995} conjectured\COMMENT{In fact, he conjectured this in an informal way -- he said ``there ought to be some slack in the bound away from these extremes", as well as mentioning the strengthening of EFL by Berge-F\"uredi-Meyniel. Unfortunately, it seems to require some more ideas to prove Berge-F\"uredi-Meyniel conjecture, even for bounded edge size case, as the neighbours of the high-degree vertices in $U$ are not longer well-distributed (i.e., cannot guarantee the regularity conditions of the absorbers), where our absorption lemmas rely much on this. } that the bound in the EFL Conjecture can be improved if $\cH$ is far from being extremal examples such as complete graphs, finite projective planes, and degenerate planes. We prove his conjecture as follows. \COMMENT{Moreover, perhaps we can make the chromatic index $o(n)$ if $|e| \in [d_1 , g(n)]$, if $1 \ll d_1 \leq g(n) \ll \sqrt{n}$ -- it is also interesting to see how we can bound the chromatic index depending on the choice of $g(n)$.} \begin{theorem}\label{main-thm-2} For every $\delta > 0$, there exist $n_0, \sigma > 0$ such that the following holds. For any $n \geq n_0$, if $\cH$ is an $n$-vertex linear hypergraph with maximum degree at most $(1-\delta)n$ such that the number of edges of size $(1 \pm \delta)\sqrt{n}$ in $\cH$ is at most $(1-3\delta)n$, then the chromatic index of $\cH$ is at most $(1-\sigma)n$. \end{theorem} \begin{theorem}\label{weak-stability-thm} For every $\eps > 0$, there exists $n_0, \eta > 0$ such that the following holds. For any $n \geq n_0$, if $\cH$ is an $n$-vertex linear hypergraph with maximum degree at most $\eta n$ and no edge $e\in \cH$ such that $\eta \sqrt n < |e| < \sqrt n / \eta$, then the chromatic index of $\cH$ is at most $\eps n$. \end{theorem} As an analogue of the EFL Conjecture for bipartite graphs, Alon, Saks, and Seymour (see Kahn~\cite{kahn1991}) conjectured that if a graph $G$ can be decomposed into $k$ edge-disjoint bipartite graphs, then the chromatic number of $G$ is at most $k+1$. This conjecture is a generalisation of the famous Graham-Pollak theorem~\cite{gp1971,gp1972} on edge decomposition of complete graphs into bipartite graphs, which has applications to communication complexity. However, Huang and Sudakov~\cite{HS2012} disproved the Alon-Saks-Seymour conjecture in a strong form, so that it is not even close to being true. \end{comment} \section{Colouring FPP-extremal and larger edges}\label{fpp-extremal-section} In this section we prove Theorem~\ref{main-thm} when all edges are FPP-extremal or larger, as follows. \begin{lemma}\label{extremal-case-lemma} Let $0 < 1/n_0 \ll \delta \ll 1$, and let $n \geq n_0$. If $\cH$ is an $n$-vertex linear hypergraph where every $e\in \cH$ satisfies $|e| \geq (1 - \delta)\sqrt n$, then $\cH$ has a proper edge-colouring with $n$ colours, where each colour is assigned to at most two edges. \end{lemma} First we need the following simple observations. For a hypergraph $\cH$, recall that $L(\cH)$ denotes the line graph of $\cH$ and $\overline{L(\cH)}$ denotes its complement. \begin{obs}\label{lem:chromindex} Let $\cH$ be an $n$-vertex linear hypergraph. If there is a matching $N$ in $\overline{L(\cH)}$ of size $e(\cH) - n$, then $\cH$ has a proper edge-colouring with $n$ colours, where each colour is assigned to at most two edges.\COMMENT{We may assume that $e(\cH) > n$, otherwise the proposition trivially follows by colouring the edges of $\cH$ with different colours. Let $t \coloneqq e(\cH) - n$ and $N \coloneqq \{e_1 f_1 , \dots , e_t f_t \}$ be a matching of size $t$ in $\overline{L(\cH)}$. We assign the same colour to $e_i$ and $f_i$ for each $i\in [t]$ and a distinct colour to every $e \in L(\cH) \setminus \bigcup_{i=1}^{t} \{e_i,f_i \}$. This gives a proper edge-colouring of $\cH$ with \begin{equation*} (e(\cH)-2t) + t = e(\cH) - (e(\cH) - n) = n \end{equation*} colours, where each colour is assigned to at most two edges in $\cH$, as desired.}\qed \end{obs} A pair $\{e, f\}\subseteq \cH$ in an $n$-vertex hypergraph $\cH$ is \textit{useful} if $e\neq f$, $e\cap f\neq\varnothing$, and $|N(e) \cap N(f)| \leq n-2$. \begin{proposition} \label{lem:chromindex0} Let $\cH$ be an $n$-vertex linear hypergraph, and let $t \coloneqq e(\cH) - n$. If $e_1 , \dots , e_{2t} \in \cH$ are distinct pairwise intersecting edges such that $\{e_{2i-1}, e_{2i}\}$ is a useful pair for each $i \in [t]$, then $\cH$ has a proper edge-colouring with $n$ colours, where each colour is assigned to at most two edges. \end{proposition} \begin{proof} We may assume that $e(\cH) > n$. We will show that there exists a matching $N$ in $\overline{L(\cH)}$ of size $t$. For $i \in [t]$, suppose we have chosen distinct edges $z_1 , \dots , z_{i-1} \in \cH \setminus \{e_1 , \dots , e_{2t}\}$ where $z_j$ is non-adjacent to at least one of $e_{2j-1}$ or $e_{2j}$ in $L(\cH)$ for $1 \leq j \leq i-1$. We claim that one can choose $z_i \in \cH \setminus \{e_1 , \dots , e_{2t}\}$ distinct from $z_1 , \dots , z_{i-1}$ such that $z_i$ is non-adjacent to either $e_{2i-1}$ or $e_{2i}$ in $L(\cH)$. Indeed, since $|N(e_{2i-1}) \cap N(e_{2i})| \leq n-2$, letting $S \coloneqq \cH \setminus ((N(e_{2i-1}) \cap N(e_{2i})) \cup \{ e_{2i-1} , e_{2i} \})$, we have $|S| \geq e(\cH)-n$ and every $e\in S$ is non-adjacent to at least one of $e_{2i-1}$ or $e_{2i}$. Since $i-1 \leq e(\cH)-n-1$ we can choose $z_i \in S$ distinct from $z_1 , \dots , z_{i-1}$. Moreover, since $S \cap \{e_1 , \dots , e_{2t} \} = \varnothing$, we have $z_i \in \cH \setminus \{e_1 , \dots , e_{2t}\}$, as desired. Let $z_1, z_2, \ldots, z_t \in \cH \setminus \{e_1 , \dots , e_{2t}\}$ be chosen using the above procedure. Then since $z_j$ is non-adjacent to either $e_{2j-1}$ or $e_{2j}$ for each $j \in [t]$, we have a matching $N$ in $\overline{L(\cH)}$ of size $t = e(\cH)-n$. Now applying Observation~\ref{lem:chromindex}, the proof is complete. \end{proof} \begin{proposition}\label{lem:chromindex1} Let $\cH$ be an $n$-vertex linear hypergraph, and let $\{A,B \}$ be a partition of $\cH$ such that $|A|+|B|-n \leq |A|/4$. If for every distinct intersecting $e,f \in A$, the pair $\{e, f\}$ is useful, then $\cH$ has a proper edge-colouring with $n$ colours, where each colour is assigned to at most two edges. \end{proposition} \begin{proof} We may assume that $|A|+|B| \geq n+1$. Let $N$ be a matching of maximum size in $\overline{L(\cH)}$. If $|N| \geq e(\cH)-n = |A|+|B|-n$, then by Observation~\ref{lem:chromindex}, we have a proper colouring of $\cH$ with the desired properties. Thus we may assume that $|N| \leq |A|+|B|-n$. Then we have \begin{equation*} |A \setminus V(N)| - 2(|A|+|B|-n) \geq |A|-4(|A|+|B|-n) \geq 0 \end{equation*} since we assumed $|A|+|B|-n \leq |A|/4$. By the maximality of $N$, all pairs $e, f \in A \setminus V(N)$ are adjacent. Thus we may choose $2t \coloneqq 2(|A|+|B|-n)$ distinct $a_1 , \dots , a_{2t} \in A \setminus V(N)$ which are pairwise adjacent such that $|N(a_{2i-1}) \cap N(a_{2i})| \leq n-2$ holds for each $i \in [t]$. Thus we can apply Proposition~\ref{lem:chromindex0} to $\{a_1 , \dots , a_{2t} \}$ to complete the proof. \end{proof} \begin{proposition}\label{na-prop} Let $0 < 1/n_0 \ll \delta \ll 1$, and let $n \geq n_0$ satisfy $k^2 + k + 1 \geq n \geq (k - 1)^2 + k + 1$ where $n, k\in\mathbb N$. Let $\cH$ be an $n$-vertex linear hypergraph where every $e\in\cH$ satisfies $|e|\geq (1 - \delta)\sqrt n$, and let $e, f \in \cH$ be distinct intersecting edges of size at most $k$. Let $w \in e\cap f$, and let $m$ be the number of edges of size at most $k - 1$ containing $w$. If at least one of $e$ or $f$ has size at most $k - 1$, or if $m \leq 1/(3\delta)$, then $\{e, f\}$ is a useful pair. \end{proposition} \begin{proof} If at least one of $e$ or $f$ has size at most $k - 1$, then\COMMENT{To obtain the last inequality, note that $(k-1)(k-2) + \frac{n-1}{(1-\delta)\sqrt{n}-1} \le k^2-3k+2 + \sqrt{n} (1+2\delta) \le n - 2k + \sqrt{n} (1+2\delta) \le n - 2(\sqrt{n}-1) + \sqrt{n} (1+2\delta) \le n-2$} \begin{align*} |N(e) \cap N(f)| &\leq (|e|-1)(|f|-1) + d(w) \leq (k-1)(k-2) + \frac{n - 1}{(1-\delta)\sqrt{n} - 1}\\ & \leq (k^2 - k + 2) - 2k + (1 + 2 \delta) \sqrt{n} \leq n-2, \end{align*} as desired. Now we may assume $|e| = |f| =k$ and $m \leq \frac{1}{3\delta} \leq \frac{1 - 2/(k - 1)}{2\delta}$. Let us consider the number of vertices in $V(\cH) \setminus (e \cup f)$ sharing an edge with $w$. By the definition of $m$ and the linearity of $\cH$, we have \begin{equation*} m ((1-\delta) \sqrt{n} - 1) + (d(w) - 2 - m)(k-1) \leq n - |e \cup f| = n - 2k + 1 \leq k(k - 1) + 2, \end{equation*} which implies \begin{equation}\label{eqn:d_w} d(w) - 2 \leq \frac{k(k - 1) + 2}{k-1} + m \left ( 1 - \frac{(1-\delta)\sqrt{n} - 1}{k-1} \right ) \leq \frac{k(k - 1) + 2}{k-1} + 2\delta m. \end{equation} Thus, \begin{equation*} |N(e) \cap N(f)| \leq (|e|-1)(|f|-1) + d(w) - 2 \overset{\eqref{eqn:d_w}}{\leq}\COMMENT{$k^2 - 2k + 1 + \frac{k(k - 1) +2}{k - 1} + 2\delta m \leq$} k^2 - k + 1 + \frac{2}{k-1} + 2 \delta m - 2 \leq n-2, \end{equation*} so $\{e, f\}$ is a useful pair, as desired. \end{proof} Now we prove Lemma~\ref{extremal-case-lemma}. \begin{proof}[Proof of Lemma~\ref{extremal-case-lemma}] First of all, we may assume that $e(\cH) > n$. Let $k$ be a positive integer such that \begin{equation}\label{eqn:rangen} k^2 - k + 2 = (k-1)^2 + k + 1 \leq n \leq k^2 + k + 1, \end{equation} let $A^- \coloneqq \{e \in \cH \: : \: |e| \leq k-1 \}$, let $A^+ \coloneqq \{e \in \cH \: : \: |e| = k \}$, let $A \coloneqq A^- \cup A^+$, and let $B \coloneqq \{e \in \cH \: : \: |e| \geq k+1 \}$. Note that \begin{align*} \vol_{\cH}(B) \geq |B| \frac{k(k+1)}{n(n-1)} \overset{\eqref{eqn:rangen}}{\geq} \frac{|B|}{n}. \end{align*} Since $|e| \geq (1-\delta)\sqrt{n}$ for all $e\in\cH$, we have\COMMENT{The last inequality uses $\left.\binom{(1 - \delta)\sqrt n}{2}\middle/\binom{n}{2}\right. \geq \frac{(1 - \delta)^2n - (1 - \delta)\sqrt n}{n^2} \geq \frac{1 - 2\delta + \delta^2 - (1 - \delta)/\sqrt n}{n} \geq \frac{1 - 2\delta}{n}$.} \begin{align}\label{eqn:volA} \vol_{\cH}(A) \geq |A| \binom{(1-\delta)\sqrt{n}}{2} \binom{n}{2}^{-1} \geq |A| \frac{1 - 2\delta}{n}. \end{align} Combining the above two inequalities with $\vol_{\cH}(A) + \vol_{\cH}(B) \le 1$, we have \begin{align}\label{eqn:abn_0} |A| + |B| - n \leq 2 \delta |A|. \end{align} If $|A^-| \leq 300$, then by Proposition~\ref{na-prop}, for any distinct intersecting $e,f \in A$, we have that $\{e, f\}$ is useful. Moreover,~\eqref{eqn:abn_0} implies that $|A| + |B| - n \leq |A|/4$. Thus we can apply Proposition~\ref{lem:chromindex1} to obtain a proper edge-colouring of $\cH$ with the desired properties, proving the lemma in this case. Hence, we may assume that \begin{equation}\label{eqn:bounda-} |A^-| > 300. \end{equation} Note that\COMMENT{To get the last inequality, note that $\frac{k(k-1)}{n-1} \geq \frac{(k^2 + k + 1) - (2k+1)}{n} \geq \frac{n - 3\sqrt{n}}{n}$ by~\eqref{eqn:rangen}, since $k = (1+o(1))\sqrt{n}$.} \begin{align*} \vol_{\cH}(A^+ \cup B) &\geq |B| \frac{k(k+1)}{n(n-1)} + |A^+| \frac{k(k-1)}{n(n-1)} \overset{\eqref{eqn:rangen}}{\geq} \frac{|B|}{n} + \frac{|A^+|}{n} \left ( 1 - \frac{3}{\sqrt{n}} \right ). \end{align*} Similarly as in~\eqref{eqn:volA}, we have $\vol_{\cH}(A^-) \geq |A^-| (1 - 2\delta)/n.$ Combining the previous two inequalities with the fact that $\vol_{\cH}(A^+ \cup B) + \vol_{\cH}(A^-) \leq 1$, we obtain \begin{align}\label{eqn:abn} e(\cH) - n = |A^-| + |A^+ \cup B| - n \leq \frac{3|A^+|}{\sqrt{n}} + 2 \delta |A^-|. \end{align} Thus if $|A^+| \leq \sqrt{n} |A^-| / 15$, then we have $|A^-| + |A^+ \cup B| - n \leq |A^-|/4$. Using this inequality and Proposition~\ref{na-prop}, we can apply Proposition~\ref{lem:chromindex1} with $A^-$ and $A^+ \cup B$ playing the roles of $A$ and $B$, respectively, to obtain an edge-colouring of $\cH$ with the desired properties, proving the lemma in this case. Thus we can assume that \begin{equation}\label{eqn:bounda+} |A^+| > \frac{\sqrt{n}|A^-|}{15} \overset{\eqref{eqn:bounda-}}{\geq }20 \sqrt{n}. \end{equation} Now let $t\coloneqq e(\cH) - n$, let $L\coloneqq L(\cH)$ be the line graph of $\cH$, and let $N$ be a maximal matching in $\overline L$. We assume $|N| < t$, as otherwise by Observation~\ref{lem:chromindex}, we obtain the desired proper edge-colouring of $\cH$, proving the lemma. Combining this inequality with~\eqref{eqn:abn} and~\eqref{eqn:bounda+}, we have \begin{equation}\label{eqn:sizeN} |N| < t \leq \frac{3|A^+|}{\sqrt{n}} + 2 \delta |A^-| < \frac{5|A^+|}{\sqrt{n}}. \end{equation} Most of the remainder of the proof is devoted to the following claim. \begin{claim}\label{claim:useful-pairs} There are $2t$ distinct $e_1, \dots, e_{2t} \in A^{+}$ such that \begin{enumerate}[(i)] \item\label{extremal-pairwise-intersecting} $e_1, \dots, e_{2t}$ are pairwise intersecting and \item\label{extremal-useful-pairs} $\{e_{2i - 1}, e_{2i}\}$ is useful for $i\in[t]$. \end{enumerate} \end{claim} \begin{claimproof} Since $N$ is maximal, $\cH\setminus V(N)$ is a clique in $L$. We choose $e_1, \dots, e_{2t}$ in $A^+\setminus V(N)$, which will ensure that~\ref{extremal-pairwise-intersecting} holds. For each $x \in V(\cH)$, let $A_x \coloneqq \{e \in A^- \: : \: x \in e \}$, and let $V_{\rm bad} \coloneqq \{ x \in V(\cH) \: : \: |A_x| \geq (4\delta)^{-1} \}$. Thus, if $e, f\in\cH$ are distinct and intersecting such that $w\notin V_{\rm bad}$ where $w\in e\cap f$, then $\{e, f\}$ is useful by Proposition~\ref{na-prop}. We choose $e_1, \dots, e_{2t}$ such that $w\in e_{2i - 1}\cap e_{2i}$ satisfies $w\notin V_{\rm bad}$, which will ensure that~\ref{extremal-useful-pairs} holds. Let $\mathcal{P} \coloneqq \{(w,e) \: : \: \textrm{$w \in V_{\rm bad}$ and $w \in e \in A^-$}\}$, and note that $|V_{\rm bad}| \cdot (4 \delta)^{-1} \leq |\mathcal{P}| \leq (k-1) |A^-| \leq 2 \sqrt{n} |A^-|$. Thus, \begin{equation}\label{claim:nobad} |V_{\rm bad}| \leq 8 \delta |A^-| \sqrt{n}. \end{equation} Now let $A^* \coloneqq \{e \in A^+ \: : \: |e \cap V_{\rm bad}| \geq \sqrt{\delta n} \}$, and note that $|A^*| \sqrt{\delta n} \leq |V_{\rm bad}| \frac{n-1}{k - 1} \overset{\eqref{claim:nobad}}{\leq} 16 \delta n |A^-|$. Therefore \begin{equation}\label{eqn:bounda*} |A^*| \leq 16 \sqrt{\delta n} |A^-| \overset{\eqref{eqn:bounda+}}{\leq} \frac{|A^+|}{20}. \end{equation} Thus \begin{equation}\label{eqn:bounda+_2} |A^+ \setminus (A^* \cup V(N))| \geq |A^+| - |A^*| - |V(N)| \overset{\eqref{eqn:sizeN},\eqref{eqn:bounda*}}{\geq} \frac{9|A^+|}{10} \overset{\eqref{eqn:bounda+}}{\geq} 18 \sqrt{n}. \end{equation} Now we iterate the following procedure for $i \in [t']$, where $t' \coloneqq \lceil |A^+| / 4 \rceil$. Suppose we have chosen distinct $e_1 , \dots , e_{2(i-1)} \in A^+ \setminus (A^* \cup V(N))$ such that $\{e_{2j-1} , e_{2j} \}$ is useful for each $ j \in [i - 1]$. Consider the set $S_i \coloneqq A^+ \setminus \left(A^* \cup V(N) \cup \{e_1 , \dots , e_{2(i-1)} \}\right)$, which has size \begin{equation} \label{eq:size:Si} |S_i| \geq |A^+ \setminus (A^* \cup V(N))| - 2(t'-1) \overset{\eqref{eqn:bounda+_2}}{\geq} \frac{9|A^+|}{10} - \frac{|A^+|}{2} \overset{\eqref{eqn:bounda+}}{\geq} 5 \sqrt{n}. \end{equation} We first show that there exists a useful pair $\{e_{2i-1}, e_{2i}\} \subseteq S_i$. For any $e \in S_i$, we have $|e \cap V_{\rm bad}| \le \sqrt{\delta n}$ since $S_i \subseteq A^{+} \setminus A^*$. Therefore, letting $\mathcal{P}_i \coloneqq \{(w,e) : e \in S_i,\: w \in e\setminus V_{\rm bad}\}$, we have \begin{align*} \frac{1}{|V(\cH) \setminus V_{\rm bad}|}\sum_{w \in V(\cH) \setminus V_{\rm bad}} d_{S_i}(w) &= \frac{|\mathcal{P}_i|}{|V(\cH) \setminus V_{\rm bad}|} \geq \frac{|\mathcal{P}_i|}{n} = \frac{1}{n} \sum_{e \in S_i} |e \setminus V_{\rm bad}| \\&\geq \frac{|S_i| (k - \sqrt{\delta n})}{n} \overset{\eqref{eq:size:Si},\eqref{eqn:rangen}}{\geq} \frac{5 \sqrt{n} \cdot \sqrt{n}/2}{n} > 2. \end{align*} Thus there exists a vertex $w \in V(\cH) \setminus V_{\rm bad}$ with $d_{S_i}(w) \geq 2$, which implies that there is a useful pair $\{e_{2i-1},e_{2i} \} \subseteq S_i$ such that $w \in e_{2i-1} \cap e_{2i}$. The above procedure constructs a useful pair $\{e_{2i-1} , e_{2i} \} \subseteq A^+ \setminus (A^* \cup V(N))$ for each $i \in [t']$. Recall that since $N$ is maximal, the elements of $A^+ \setminus V(N)$ are pairwise intersecting. Since $t' \geq |A^+|/4 > t = e(\cH) - n$ by~\eqref{eqn:sizeN}, $e_1, \dots, e_{2t}$ satisfy~\ref{extremal-pairwise-intersecting} and~\ref{extremal-useful-pairs}, as claimed. \end{claimproof} Now by combining Claim~\ref{claim:useful-pairs} and Proposition~\ref{lem:chromindex0}, there is a proper edge-colouring of $\cH$ with $n$ colours such that each colour is assigned to at most two edges, which completes the proof of Lemma~\ref{extremal-case-lemma}. \end{proof} \section{Colouring large and medium edges}\label{large-edge-section} The main result of this section is the following, which we use in the proof of Theorem~\ref{main-thm} to colour large and medium edges. \begin{theorem}\label{large-edge-thm} Let $0 < 1/n_0 \ll 1/r_0 \ll 1/r_1, \beta \ll \gamma_1 \ll \sigma \ll \delta \ll \gamma_2\ll 1$, and let $n \geq n_0$. If $\mathcal H$ is an $n$-vertex linear hypergraph where every $e\in \cH$ satisfies $|e| > r_1$, then at least one of the following holds: \begin{enumerate}[(\ref{large-edge-thm}:a), topsep = 6pt] \item There exists a proper edge-colouring of $\mathcal H$ using at most $(1 - \sigma)n$ colours such that \begin{enumerate}[(i)] \item\label{non-extremal-huge-edge} every colour assigned to a huge edge is assigned to no other edge, \item\label{non-extremal-medium-bound} every medium edge is assigned a colour from a set $C_{\mathrm{med}}$ of size at most $\gamma_1 n$ such that for every $c\in C_{\mathrm{med}}$, at most $\gamma_1 n$ vertices are incident to an edge coloured $c$, and \item\label{non-extremal-colour-class-bound} for every colour $c\notin C_{\mathrm{med}}$ not assigned to a huge edge, at most $\beta n$ vertices are incident to an edge coloured $c$. \end{enumerate}\label{non-extremal-colouring} \item There exists a set of FPP-extremal edges of volume at least $1 - \delta$ and a proper edge-colouring of $\cH$ using at most $n$ colours such that \begin{enumerate}[(i)] \item\label{extremal-huge-edge} for every colour $c$ assigned to a huge edge, at most $\delta n$ vertices are incident to an edge coloured $c$, \item\label{extremal-medium-bound} every medium edge is assigned a colour from a set $C_{\mathrm{med}}$ of size at most $\gamma_2 n$ such that for every $c\in C_{\mathrm{med}}$, at most $\gamma_1 n$ vertices are incident to an edge coloured $c$, and \item\label{extremal-colour-class-bound} for every colour $c\notin C_{\mathrm{med}}$ not assigned to a huge edge, at most $\beta n$ vertices are incident to an edge coloured $c$. \end{enumerate}\label{extremal-colouring} \end{enumerate} \end{theorem} Note that every linear hypergraph $\cH$ satisfies $\vol_{\cH}(\cH) \leq 1$, so in~\ref{extremal-colouring}, the FPP-extremal edges contain almost all of the pairs of vertices. We now prove Theorem~\ref{main-thm-2} by combining Theorem~\ref{thm:kahn} and Theorem~\ref{large-edge-thm}. \begin{proof}[Proof of Theorem~\ref{main-thm-2}] Without loss of generality, we may assume that $\delta$ is sufficiently small. Let $0 < 1/n_0 \ll 1/r_0 \ll 1/r_1, \beta \ll \gamma \ll \sigma \ll \delta \ll 1$, and recall $\cH_{\rm small}$, $\cH_{\rm med}$, $\cH_{\rm large}$, and $\cH_{\rm ex}$ were defined in Definition~\ref{def:edgesize}. By assumption, $e(\cH_{\rm ex}) \leq (1-3\delta)n$, so \begin{equation*} \vol_{\cH}(\cH_{\rm ex}) \leq (1-3\delta)n \cdot \binom{(1+\delta)\sqrt{n}}{2} \binom{n}{2}^{-1} \leq \frac{(1-3\delta)(1+\delta)^2 n}{n-1} < 1 - \delta. \end{equation*} Hence, applying Theorem~\ref{large-edge-thm} with $\cH_{\rm med} \cup \cH_{\rm large}$, $\gamma$, $\sigma$, and $\delta$ playing the roles of $\cH$, $\gamma_1$, $\sigma$, and $\delta$, respectively, we obtain a proper edge-colouring $\phi' : \cH_{\rm med} \cup \cH_{\rm large} \to [(1-\sigma)n]$ and $C_{\rm med} \subseteq [(1-\sigma)n]$ such that every $e \in \cH_{\rm med}$ satisfies $\phi'(e) \in C_{\rm med}$ and $|C_{\rm med}| \leq \gamma n$. For every $e \in \cH_{\rm small}$, let $C(e) := \{ \phi'(f) \: : \: f \in \cH_{\rm large}\:,\:e \cap f \ne \varnothing \}$. Note that for each vertex $w \in V(\cH)$, there are at most $2 r_0^{-1} n$ edges of $\cH_{\rm large}$ incident to $w$. Therefore, for every $e \in \cH_{\rm small}$, there are at most $2r_1 r_0^{-1} n$ edges $f \in \cH_{\rm large}$ such that $e \cap f \ne \varnothing$. Hence, $|C(e)| \leq \beta n$. So applying Theorem~\ref{thm:kahn} with $\cH_{\rm small}$, $3 \beta$, $r_1$, $\lfloor (1-\delta)n \rfloor$, $[(1-\sigma)n] \setminus C_{\rm med}$ playing the roles of $\cH$, $\alpha$, $r$, $D$, $C$, respectively, we obtain a proper edge-colouring $\phi'' : \cH_{\rm small} \to [(1-\sigma)n] \setminus C_{\rm med}$ such that for every $e \in \cH_{\rm small}$, $\phi''(e) \not \in C(e)$, which implies that $\phi''(e) \ne \phi'(f)$ for every $f \in \cH_{\rm large}$ with $e \cap f \ne \varnothing$. Hence $\phi := \phi' \cup \phi'' : \cH \to [(1-\sigma)n]$ is a proper edge-colouring, as desired. \end{proof} \subsection{Reordering} If $\ordering$ is a linear ordering of the edges of a hypergraph $\cH$, for each $e\in\cH$, we define $\fwdnbr_\cH(e)\coloneqq \{f \in N_\cH(e) : f\ordering e \}$ and $\fwddeg_\cH(e)\coloneqq |\fwdnbr_\cH(e)|$. We omit the subscript $\cH$ when it is clear from the context. For each $e\in \cH$, we also let $\cH^{\ordering e} \coloneqq \{f\in \cH : f \ordering e\}$. The main result of this subsection is the following key lemma, which we use to find the ordering of the edges of $\cH$ mentioned in Section~\ref{subsection:large-edge-overview}. \begin{lemma}[Reordering lemma]\label{reordering-lemma} Let $0 < 1/r_1 \ll \tau, 1/K$ where $\tau < 1$, $K \geq 1$, and $1 - \tau - 7\tau^{1/4}/K > 0$. If $\cH$ is an $n$-vertex linear hypergraph where every $e\in \cH$ satisfies $|e| \geq r_1$, then there exists a linear ordering $\ordering$ of the edges of $\cH$ such that at least one of the following holds. \begin{enumerate}[(\ref{reordering-lemma}:a), topsep = 6pt] \item Every $e\in\cH$ satisfies $\fwddeg(e) \leq (1 - \tau)n$.\label{reordering-good} \item There is a set $W\subseteq \cH$ such that \begin{enumerate}[(W1)] \item\label{W-max-size} $\max_{e\in W}|e| \leq (1 + 3\tau^{1/4}K^{4})\min_{e\in W}|e|$ and \item\label{W-volume} $\vol_{\cH}(W) \geq \frac{(1 - \tau - 7\tau^{1/4}/K)^2}{1 + 3\tau^{1/4}K^4}$. \end{enumerate} Moreover, if $e^*$ is the last edge of $W$, then \begin{enumerate}[(O1)] \item for all $f\in \cH$ such that $e^*\ordering f$ and $f\neq e^*$, we have $\fwddeg(f) \leq (1 - \tau)n$ and\label{ordering-goodness} \item for all $e,f\in \cH$ such that $f\ordering e \ordering e^*$, we have $|f| \geq |e|$\label{ordering-by-size}. \end{enumerate} \label{reordering-volume} \end{enumerate} \end{lemma} \begin{proposition}\label{fwdnbr-prop} Let $\alpha_1, \alpha_2, \tau \geq 0$. Let $\cH$ be an $n$-vertex linear hypergraph where every $e\in\cH$ satisfies $|e|\geq 1 + \alpha_2$. Let $e\in \cH$, let $r\coloneqq |e|$, let $m_1 \coloneqq |\{f \in N(e) : |f| \geq (1 + \alpha_1)r\}|$, and let $m_2 \coloneqq |\{f \in N(e) : (1 + \alpha_1)r > |f| \geq r / (1 + \alpha_2)\}|$. If $r > 1 + \alpha_2$, then \begin{equation}\label{fwddeg-inequality}\tag{i} (1 + \alpha_1)m_1 + \frac{m_2}{1 + \alpha_2} \leq n + \frac{(1 + \alpha_2)n}{r - 1 - \alpha_2}. \end{equation} Moreover, if $m_1 + m_2 \geq (1 - \tau)n$ and $\alpha_1 > 0$, then \begin{equation}\label{fwddeg-far-bound}\tag{ii} m_1 \leq \left(\tau + \frac{(1 + \alpha_2)(1 + \alpha_2 r)}{r - 1 - \alpha_2}\right)\frac{n}{\alpha_1}. \end{equation} \end{proposition} If $\ordering$ is an ordering of the edges of an $n$-vertex linear hypergraph $\cH$ satisfying $e \ordering f$ if $|e| > |f|$, then Proposition~\ref{fwdnbr-prop}\eqref{fwddeg-inequality} with $\alpha_1, \alpha_2, \tau = 0$ implies that every $e\in\cH$ with $|e| \geq 2$ satisfies $\fwddeg(e) \leq (1 + 1/(|e| - 1))n$. This well-known fact immediately implies that every linear $n$-vertex hypergraph $\cH$ satisfies $\chi'(\cH) \leq 2n + 1$\COMMENT{In fact, using the more precise bound $\fwddeg(e) \leq |e|(n - |e|) / (|e| - 1)$, it is straightforward to show that if $\cH$ is simple, then $\chi'(\cH) \leq 2(n - 2) + 1 = 2n - 3$. If $\cH$ contains singleton edges, then we have the bound $\chi'(\cH) \leq 2n - 2$.}, and if all of its edges have size at least $r_1\geq 2$, then $\chi'(\cH) \leq (1 + 1/(r_1 - 1))n + 1$. \begin{proof}[Proof of Proposition~\ref{fwdnbr-prop}] There are exactly $r (n - r)$ pairs of vertices $\{u, v\}$ of $\cH$ where $u\notin e$ and $v\in e$. Thus, since $\cH$ is linear, $\sum_{f \in N(e)} (|f| - 1) \leq r (n - r)$. In particular, \begin{equation*} \sum_{f \in N(e) : |f| \geq (1 + \alpha_1)r} \left((1 + \alpha_1)r - 1\right) + \sum_{f \in N(e) : (1 + \alpha_1)r > |f| \geq r/(1 + \alpha_2)} \left(r / (1 + \alpha_2) - 1\right) \leq r (n - r). \end{equation*} Dividing both sides of this inequality by $r$ and rearranging terms, we obtain \begin{equation}\label{fwddeg-inequality1} (1 + \alpha_1)m_1 + m_2 / (1 + \alpha_2) \leq n - r + (m_1 + m_2)/r. \end{equation} Similarly, we have \begin{equation}\label{fwddeg-inequality2} m_1 + m_2 \leq \frac{r(n - r)}{r/(1 + \alpha_2) - 1} \leq \frac{(1 + \alpha_2)rn}{r - 1 - \alpha_2}. \end{equation} Substituting this inequality in the right side of~\eqref{fwddeg-inequality1}, we obtain~\eqref{fwddeg-inequality}, as desired. Now suppose additionally $m_1 + m_2 \geq (1 - \tau)n$ and $\alpha_1 > 0$. By combining the former inequality with~\eqref{fwddeg-inequality}\COMMENT{The left side of~\eqref{fwddeg-inequality} is $m_1 + m_2 + \alpha_1 m_1 + (1/(1 + \alpha_2) - 1)m_2$, so if $m_1 + m_2 \geq (1 - \tau)n$, then $(1 - \tau)n + \alpha_1 m_1 + (1/(1 + \alpha_2) - 1)m_2$ is at most the right side of~\eqref{fwddeg-inequality}.}, we obtain $\alpha_1 m_1 \leq \tau n + n(1 + \alpha_2) / (r - 1 - \alpha_2) + (1 - 1/(1 + \alpha_2)) m_2$. Since $1 - 1/(1 + \alpha_2) \leq \alpha_2$, we have $\alpha_1 m_1 \leq \tau n + n(1 + \alpha_2) / (r - 1 - \alpha_2) + \alpha_2 m_2$, and by combining this inequality with the bound on $m_2$ from~\eqref{fwddeg-inequality2}, we obtain~\eqref{fwddeg-far-bound}, as desired. \end{proof} \begin{proof}[Proof of Lemma~\ref{reordering-lemma}] We consider an ordering $\ordering$ of the edges of $\cH$ satisfying~\ref{ordering-goodness} and~\ref{ordering-by-size} for some $e^*\in\cH$ such that $e(\cH^{\ordering e^*})$ is minimum. Note that such an ordering exists -- in particular, any ordering where $f \ordering e$ whenever $|f| > |e|$ satisfies~\ref{ordering-goodness} and~\ref{ordering-by-size} for $e^*$, where $e^*$ is the last edge in the ordering. If $e(\cH^{\ordering e^*}) = 1$, then $\ordering$ satisfies~\ref{reordering-good}, as desired, so we assume we do not have this case. Now we have $\fwddeg(e^*) > (1 - \tau)n$, or else the predecessor of $e^*$ also satisfies~\ref{ordering-goodness} and~\ref{ordering-by-size}, contradicting the choice of $e(\cH^{\ordering e^*})$ to be minimum. Let $r \coloneqq |e^*|$, and let $W \coloneqq \{f \ordering e^* : |f| \leq (1 + 3\tau^{1/4}K^{4})r\}$. We claim that $W$ satisfies~\ref{reordering-volume}. By the choice of $\ordering$, every $e \in \fwdnbr(e^*)$ satisfies \begin{equation}\label{nbrs-ahead-of-e^*-bound} |N(e) \cap \cH^{\ordering e^*}| > (1 - \tau)n, \end{equation} or else we can make $e$ the successor of $e^*$. Let $X \coloneqq \{e \in \fwdnbr(e^*) : |e| \leq (1 + K\sqrt\tau)r\}$. By~\ref{ordering-by-size}, we may apply Proposition~\ref{fwdnbr-prop}\eqref{fwddeg-far-bound} with $K \sqrt \tau$ and $0$ playing the roles of $\alpha_1$ and $\alpha_2$, respectively, to obtain \begin{equation}\label{nbrs-far-ahead-of-e^*-bound} |X| \geq (1 - \tau)n - |\fwdnbr(e^*)\setminus X| \geq \left(1 - \tau - \frac{\tau + 2/r}{K\sqrt \tau}\right)n \geq \left(1 - \tau - \frac{2\sqrt\tau}{K}\right)n. \end{equation} Consider $e \in X$. Note that by~\ref{ordering-by-size} and the definition of $W$, every $f \in \cH^{\ordering e^*} \setminus W$ satisfies $|f| \geq (1 + 3 \tau^{1/4} K^4)r \geq (1 + K^3 \tau^{1/4})|e|$. We now aim to apply Proposition~\ref{fwdnbr-prop}\eqref{fwddeg-far-bound} to $e$ with $K^3\tau^{1/4}$ and $K\sqrt\tau$ playing the roles of $\alpha_1$ and $\alpha_2$, respectively. Let $m_1$ and $m_2$ be defined as in Proposition~\ref{fwdnbr-prop}. Then $|(N(e)\cap \cH^{\ordering e^*})\setminus W)| \leq m_1$. Moreover, since $e\in X$,~\eqref{nbrs-ahead-of-e^*-bound} implies that $m_1 + m_2 \geq (1 - \tau)n$. Thus, we can apply Proposition~\ref{fwdnbr-prop} to deduce that for every $e \in X$ we have\COMMENT{$(1 + K^3\tau^{1/4})|e| \leq (1 + K^3\tau^{1/4})(1 + K\sqrt \tau)r \leq (1 + 3K^4\tau^{1/4})r$, so $|(N(e) \cap \cH^{\ordering e^*}) \setminus W| \leq m_1$. Moreover,~\eqref{nbrs-ahead-of-e^*-bound} implies that $m_1 + m_2 \geq (1 - \tau)n$.} \begin{equation}\label{nbrhood-outside-W-bound} |(N(e) \cap \cH^{\ordering e^*}) \setminus W| \leq \left(\tau + \frac{1 + K\sqrt\tau + K\sqrt\tau |e| + K^2\tau |e|}{|e|/2}\right)\frac{n}{K^3\tau^{1/4}} \leq \frac{6K^2\sqrt\tau}{K^3\tau^{1/4}}n = \frac{6\tau^{1/4}}{K}n. \end{equation} (In the second inequality, we used that $|e| \geq r$ by~\ref{ordering-by-size}.) Now we use these inequalities to lower bound the size of $W$. First we claim that every $e\in X$ satisfies \begin{equation}\label{X-nbrs-in-W-bound} |N(e) \cap (W\setminus N(e^*))| \geq (1 - \tau - 7\tau^{1/4}/K)n - (1 + K\sqrt\tau)r^2. \end{equation} To that end, we bound $|N(e)\cap \fwdnbr(e^*)|$, as follows. Let $N_1 \coloneqq \{f\in N(e) \cap \fwdnbr(e^*): f\cap e^* = e\cap e^*\}$ and $N_2 \coloneqq (N(e)\cap \fwdnbr(e^*))\setminus N_1$. Since $\cH$ is linear and every edge in $\fwdnbr(e^*)$ has size at least $r$, we have $|N_1| \leq n / (r - 1)$ and $|N_2| \leq (|e| - 1)(|e^*| - 1) \leq (1 + K\sqrt \tau)r^2$. Thus, \begin{equation}\label{eqn:nbrhood-intersection} |N(e)\cap \fwdnbr(e^*)| \leq \frac{n}{r - 1} + (1 + K\sqrt \tau)r^2. \end{equation} On the other hand, since $W \subseteq \cH^{\ordering e^*}$, $|N(e) \cap (W\setminus N(e^*))| = |(N(e) \cap \cH^{\ordering e^*}) \cap (W\setminus N(e^*))|$. Moreover, we have\COMMENT{In fact, the equality holds.} \begin{equation*} |(N(e) \cap \cH^{\ordering e^*}) \cap (W\setminus N(e^*))| \geq |N(e) \cap \cH^{\ordering e^*}| - |(N(e) \cap \cH^{\ordering e^*}) \setminus W| - |N(e)\cap \fwdnbr(e^*)|. \end{equation*} Combining this inequality with~\eqref{nbrs-ahead-of-e^*-bound},~\eqref{nbrhood-outside-W-bound},~\eqref{eqn:nbrhood-intersection}, one can see that ~\eqref{X-nbrs-in-W-bound} follows, as claimed. For every $f \in W\setminus N(e^*)$, we also have \begin{equation}\label{W-nbrs-in-X-bound} |N(f) \cap X| \leq |N(f) \cap N(e^*)| \leq |f||e^*| \leq (1 + 3\tau^{1/4}K^4)r^2. \end{equation} Since $\sum_{e\in X}|N(e)\cap(W\setminus N(e^*))| = |\{(e, f) : e \in X,\ f \in W\setminus N(e^*),\ e \in N(f)\}| = \sum_{f\in W\setminus N(e^*)} | N(f) \cap X|$, by combining~\eqref{X-nbrs-in-W-bound} and~\eqref{W-nbrs-in-X-bound}, we have \begin{equation*} |W\setminus N(e^*)| \geq |X|\left(\frac{(1 - \tau - 7\tau^{1/4}/K)n}{(1 + 3\tau^{1/4}K^4)r^2} - \frac{1 + K\sqrt\tau}{1 + 3\tau^{1/4}K^4}\right), \end{equation*} and since $X\subseteq N(e^*) \cap W$, this inequality implies \begin{align*} |W| &\geq |X|\left(\frac{(1 - \tau - 7\tau^{1/4}/K)n}{(1 + 3\tau^{1/4}K^4)r^2} + 1 - \frac{1 + K\sqrt\tau}{1 + 3\tau^{1/4}K^4}\right)\\ &\geq \left(1 - \tau - \frac{2\sqrt\tau}{K}\right)\left(\frac{1 - \tau - 7\tau^{1/4}/K}{1 + 3\tau^{1/4}K^4}\right)\frac{n^2}{r^2}, \end{align*} where the second inequality follows from~\eqref{nbrs-far-ahead-of-e^*-bound} and the fact that $1 \geq \frac{1 + K\sqrt\tau}{1 + 3\tau^{1/4}K^4}$. Thus, $\vol_{\cH}(W) \geq |W|\binom{r}{2} / \binom{n}{2} \geq |W|\frac{r^2}{n^2}(1 - 1/r) \geq \frac{(1 - \tau - 7\tau^{1/4}/K)^2}{1 + 3\tau^{1/4}K^4}$, so $W$ satisfies~\ref{reordering-volume}, as claimed, and moreover, $\ordering$ satisfies ~\ref{ordering-goodness} and~\ref{ordering-by-size}, as required. \end{proof} \subsection{Colouring locally sparse graphs} To prove Theorem~\ref{large-edge-thm} we use the following theorem~\cite[Theorem~10.5]{MR02}, which has been improved in~\cite{BJ15, BPP18, HdVK20}. \begin{theorem}[Molloy and Reed~\cite{MR02}]\label{local-sparsity-lemma} Let $0 < 1/\Delta \ll \zeta \leq 1$. Let $G$ be a graph with $\Delta(G) \leq \Delta$. If every $v\in V(G)$ satisfies $e(G[N(v)]) \leq (1 - \zeta)\binom{\Delta}{2}$, then $\chi(G) \leq (1 - \zeta/e^6)\Delta$. \end{theorem} \begin{corollary}\label{sparsity-corollary} Let $0 < 1/n_0, 1/r \ll \alpha \ll \zeta < 1$, let $n \geq n_0$, and suppose $r \leq (1 - \zeta)\sqrt n$. If $\cH$ is an $n$-vertex linear hypergraph such that every $e\in\cH$ satisfies $|e| \in [r, (1 + \alpha)r]$, then $\chi'(\cH) \leq (1 - \zeta/500)n$. \end{corollary} \begin{proof} Let $\Delta \coloneqq (1 + \alpha)r(n - r)/(r - 1)$, and let $L\coloneqq L(\cH)$. For every edge $e\in\cH$, there are at most $(1 + \alpha)r(n - r)$ pairs of vertices $\{u, v\}$ of $\cH$ where $u\notin e$ and $v\in e$. Thus, since $\cH$ is linear and every edge has size at least $r$, we have $\Delta(L) \leq \Delta$. Similarly, if $e, f\in\cH$ share a vertex, then $|N_L(e)\cap N_L(f)| \leq n/(r - 1) + (1 + \alpha)^2r^2 \leq (1 - 5\zeta / 6)n$. Thus, every $v\in V(L)$ satisfies $e(L[N(v)]) \leq \Delta (1 - 5\zeta / 6)n / 2 \leq (1 - 5\zeta / 6)\binom{\Delta}{2}$. Therefore by Theorem~\ref{local-sparsity-lemma}, $\chi'(\cH) = \chi(L) \leq (1 - 5\zeta / (6e^6))\Delta \leq (1 - \zeta / 500)n$, as desired. \end{proof} In the proof of Theorem~\ref{weak-stability-thm}, we use the following theorem, which has been further improved in~\cite{AIS19, AKS99, DKPS20, Vu02}. \begin{theorem}[Alon, Krivelevich, and Sudakov~\cite{AKS99}]\label{aks-local-sparsity} Let $0 < \zeta, 1/K_{\ref{aks-local-sparsity}} \ll 1$. Let $G$ be a graph with $\Delta(G) \leq \Delta$. If every $v\in V(G)$ satisfies $e(G[N(v)]) \leq \zeta \Delta^2$, then $\chi(G) \leq K_{\ref{aks-local-sparsity}}\Delta / \log(1/\zeta)$. \end{theorem} We need the following corollary of Theorem~\ref{aks-local-sparsity}. The proof is nearly identical to the proof of Corollary~\ref{sparsity-corollary}, with Theorem~\ref{local-sparsity-lemma} replaced by Theorem~\ref{aks-local-sparsity}, so we omit it. \begin{corollary}\label{aks-sparsity-corollary} Let $0 < 1 / n_0 \ll \eta \ll \alpha, \eps < 1$, and let $n \geq n_0$. If $\cH$ is an $n$-vertex linear hypergraph such that every $e\in \cH$ satisfies $1 / \eta \leq |e| \leq \eta\sqrt n$ and $\min_{e\in\cH}|e| \geq \alpha\max_{e\in\cH}|e|$, then $\chi'(\cH) \leq \eps n$. \end{corollary} We remark that the proof of Corollary~\ref{aks-sparsity-corollary} is also similar to that of~\cite[Theorem 1.1]{faber2010}, where a similar statement was proved for uniform regular linear hypergraphs (which implies that the EFL conjecture holds for all $r$-uniform regular linear $n$-vertex hypergraphs satisfying $c \leq r \leq \sqrt{n}/c$ for some constant $c>0$). \COMMENT{\begin{proof} Let $r\coloneqq \min_{e\in\cH}|e|$, let $\Delta \coloneqq (r / \alpha)n/(r - 1)$, and let $L\coloneqq L(\cH)$. For every edge $e\in\cH$, there are $|e|(n - |e|) \leq (r / \alpha)n$ pairs of vertices $\{u, v\}$ of $\cH$ where $u\notin e$ and $v\in e$. Thus, since $\cH$ is linear and every edge has size at least $r$, we have $\Delta(L) \leq \Delta$. Let $e, e'\in\cH$ be adjacent in $L$, let $N_1\coloneqq \{f \in N(e)\cap N(e') : f\cap e = f \cap e'\}$, and let $N_2 \coloneqq (N(e) \cap N(e'))\setminus N_1$. Since $\cH$ is linear and every $e\in\cH$ satisfies $1 / \eta \leq |e| \leq \eta\sqrt n$, we have $|N_1| \leq n / (1/\eta - 1) \leq 3\eta n / 2$ and $|N_2| \leq (|e| - 1)(|e'| - 1) \leq \eta^2 n$. Therefore $|N(e) \cap N(e')| \leq 2\eta n$, so every $v \in V(L)$ satisfies $e(L[N(v)]) \leq \eta n \Delta \leq \eta \alpha \Delta^2$. Since $L$ satisfies $\Delta(L) \leq \Delta$ and $e(L[N(v)]) \leq \eta \alpha \Delta^2$, by Theorem~\ref{aks-local-sparsity} applied with $\eta \alpha$ playing the role of $\zeta$, we have $\chi'(\cH) = \chi(L) \leq K_{\ref{aks-local-sparsity}}\Delta / \log(1 / (\eta \alpha)) \leq \eps n$, as desired. \end{proof}} \subsection{Proof of Theorems~\ref{weak-stability-thm} and~\ref{large-edge-thm}} Let $\phi$ be a proper edge-colouring of an $n$-vertex hypergraph $\cH$. For $\alpha\in(0, 1)$, we say $\phi$ is \textit{$\alpha$-bounded} if every colour $c$ satisfies at least one of the following: $c$ is assigned to at most one $e\in\cH$, or $\phi^{-1}(c)$ covers at most $\alpha n$ vertices of $\cH$. \begin{proposition}\label{few-large-colour-classes} Let $\alpha > 0$, and let $\cH$ be an $n$-vertex linear hypergraph where every $e\in \cH$ satisfies $|e| \geq r + 1$. \begin{enumerate}[(i)] \item If $M_1, \dots, M_t$ are pairwise edge-disjoint matchings in $\cH$ that each cover at least $\alpha n$ vertices, then $t \leq n / (\alpha r)$.\label{few-large-colour-classes-bound} \item There is an $\alpha$-bounded proper edge-colouring of $\cH$ using at most $\chi'(\cH) + 2n/(\alpha^2 r)$ colours.\label{few-large-colour-classes-splitting} \end{enumerate} \end{proposition} \begin{proof} Since $\cH$ is linear, we have $1 \geq \vol_{\cH}\left(\bigcup_{i=1}^tM_i\right) = \sum_{i=1}^t\vol_{\cH}(M_i).$ Moreover,\COMMENT{For each $i\in [t]$, the volume of $M_i$ is at least as large as that of a matching covering exactly $\lceil \alpha n\rceil$ vertices, consisting of edges of size at most $r + 2$, with as many edges of size $r + 1$ as possible.}~\COMMENT{Jensen's Inequality implies that if $f : \mathbb R\rightarrow \mathbb R$ is a convex function, then for any $x_1, \dots, x_k \in \mathbb R$ and positive weights $a_1, \dots, a_k$, we have \begin{equation*} f\left(\frac{\sum_{i=1}^k a_i x_i}{\sum_{i=1}^k a_i}\right) \leq \frac{\sum_{i=1}^ka_i f(x_i)}{\sum_{i=1}^k a_i}. \end{equation*} Thus, since $x\mapsto \binom{x}{2}$ is convex, applying Jensen's Inequality with $|M_i|$ as $k$ and $a_1, \dots, a_k = 1$, we have \begin{equation*} \binom{n}{2}\vol_{\cH}(M_i) \geq \binom{\sum_{e\in M_i}|e| / |M_i|}{2}|M_i| \geq \binom{r + 1}{2}\frac{\alpha n}{r + 1}. \end{equation*}} for each $i\in[t]$, $\vol_{\cH}(M_i) \geq \left.\frac{\alpha n}{r+1}\binom{r + 1}{2}\middle/ \binom{n}{2}\right. \geq \alpha r / n$. Combining these inequalities, we have $t \leq n / (\alpha r)$, as desired for~\ref{few-large-colour-classes-bound}. Now let $\phi$ be a proper edge-colouring of $\cH$ using a set $C$ of $\chi'(\cH)$ colours. For each $c\in C$, let $M_c \coloneqq \phi^{-1}(c)$, and let $C' \coloneqq \{c \in C : |V(M_c)| > \alpha n\}$. By~\ref{few-large-colour-classes-bound}, we have $|C'| \leq n / (\alpha r)$. For each $c\in C'$, there is a partition of $M_c$ into a set $\cM_c$ of pairwise disjoint matchings such that every $M\in \cM_c$ covers at least $\alpha n / 2$ vertices and satisfies at least one of the following: $|M| = 1$, or $M$ covers at most $\alpha n$ vertices of $\cH$.\COMMENT{First, let $\cM'_c = \{\{e\} : e\in M_c \text{ and } |e| \geq \alpha n / 2\}$, and let $M'_c \coloneqq M_c \setminus \bigcup_{M\in\cM'_c}M$. Now choose matchings consisting of edges in $M'_c$ greedily.} Note that $|\cM_c| \leq 2/\alpha$. Now for each $c\in C'$, we choose a distinct set of $|\cM_c|$ colours $C_c$ disjoint from $C$, and we define a proper edge-colouring $\phi'$ of $\cH$ as follows. For each $c\in C\setminus C'$ and $e\in M_c$, we let $\phi'(e) \coloneqq \phi(e)$. For each $c\in C'$ and $e\in M_c$, we let $\phi'(e) \in C_c$ such that for every $M\in \cM_c$, every edge of $M$ is assigned the same colour. By the choice of $\cM_c$, every colour is either assigned to at most one $e\in\cH$ by $\phi'$, or there are at most $\alpha n$ vertices of $\cH$ that are incident to an edge assigned that colour, so $\phi'$ is $\alpha$-bounded, as desired. Moreover, by the bounds on $|\cM_c|$ and $|C'|$, the colouring $\phi'$ uses at most $|C| + 2|C'|/\alpha \leq \chi'(\cH) + 2n / (\alpha^2 r)$ colours, as desired for~\ref{few-large-colour-classes-splitting}. \end{proof} \begin{proposition}\label{greedy-colouring-prop} Let $0 < 1/n_0 \ll 1/r \ll \alpha_1, \alpha_2 < 1$, and let $n \geq n_0$. Let $\ordering$ be a linear ordering of the edges of an $n$-vertex linear hypergraph $\cH$ where every $e\in \cH$ satisfies $|e| \geq r$. If $C$ is a list-assignment for the line graph of $\cH$ such that every $e\in \cH$ satisfies $|C(e)| \geq \fwddeg(e) + \alpha_1 n$, then there is an $\alpha_2$-bounded proper edge-colouring $\phi$ of $\cH$ such that $\phi(e) \in C(e)$ for every $e\in\cH$. \end{proposition} \begin{proof} Let $\cH_{\mathrm{big}} \coloneqq \{e \in \cH : |e| \geq \alpha_2 n / 2\}$, and note that $e(\cH_{\mathrm{big}}) \leq 4 / \alpha_2$ by~\eqref{eqn:huge-edge-bound}. By possibly reordering $\ordering$ and replacing $\alpha_1$ with $\alpha_1 / 2$, we may assume without loss of generality that every $e\in \cH_{\mathrm{big}}$ satisfies $e\ordering f$ for $f\in \cH\setminus \cH_{\mathrm{big}}$. Choose an edge $e^*\in\cH$ and an $\alpha_2$-bounded proper edge-colouring $\phi$ of $\cH^{\ordering e^*}$ satisfying $\phi(e) \in C(e)$ for every $e\in \cH^{\ordering e^*}$ such that $e(\cH^{\ordering e^*})$ is maximum. Note that such a choice indeed exists, for example when $e^*$ is the first edge in $\ordering$. We claim that $e^*$ is the last edge of $\cH$ in $\ordering$, in which case $\phi$ is the desired colouring. Suppose to the contrary, and let $f$ be the successor of $e^*$. We have $f\notin\cH_{\mathrm{big}}$, or else assigning $f$ a colour in $C(f)\setminus\{\phi(e) : e\ordering f\}$ would yield an $\alpha_2$-bounded colouring of $\cH^{\ordering f}$, contradicting the choice of $e^*$. Now let $C_1 \coloneqq \bigcup_{e\in\fwdnbr(f)}\phi(e)$, and let $C_2$ be the set of colours $c$ for which there are at least $\alpha_2 n / 2$ vertices of $\cH$ incident to an edge assigned the colour $c$. If there is a colour $c\in C(f)\setminus (C_1\cup C_2)$, then assigning $\phi(f) \coloneqq c$ would yield an $\alpha_2$-bounded colouring of $\cH^{\ordering f}$, contradicting the choice of $e^*$. Therefore $|C_1| + |C_2| \geq |C(f)|$, and since $|C_1| \leq \fwddeg(f)$, we have $|C_2| \geq \alpha_1 n / 2$. However, by Proposition~\ref{few-large-colour-classes}\ref{few-large-colour-classes-bound}, $|C_2| \leq 2n / (\alpha_2(r - 1)) < \alpha_1 n / 2$, a contradiction. \end{proof} Before we prove Theorem~\ref{large-edge-thm}, we prove Theorem~\ref{weak-stability-thm} using Theorem~\ref{thm:kahn}, Lemma~\ref{reordering-lemma}, Corollary~\ref{aks-sparsity-corollary}, and Proposition~\ref{greedy-colouring-prop}. The proof of Theorem~\ref{large-edge-thm} uses similar ideas, with Corollary~\ref{sparsity-corollary} instead of Corollary~\ref{aks-sparsity-corollary}. \begin{proof}[Proof of Theorem~\ref{weak-stability-thm}] We may assume that $\eps \ll 1$. Choose $n_0 , \eta$ to satisfy $0 < 1/n_0 , \eta \ll \eps$. First we decompose $\cH$ into three spanning subhypergraphs, as follows. Let $\cH_1 \coloneqq \{e\in\cH : 1 / \eta < |e| < \eta \sqrt n\}$, let $\cH_2 \coloneqq \{e\in \cH : |e| \leq 1 / \eta\}$, and let $\cH_3 \coloneqq \{e\in \cH : |e| \geq \sqrt n / \eta\}$. Since $\Delta(\cH) \leq \eta n$, by Theorem~\ref{thm:kahn} applied to $\cH_2$ with $\eta n$, $1/2$, and $1 / \eta$ playing the roles of $D$, $\alpha$, and $r$, respectively, we have $\chi'(\cH_2) \leq 3 \eta n / 2 \leq \eps n / 4$. Since $\cH$ is linear and $\vol_{\cH}(\cH_3) \leq 1$, we have $e(\cH_3) \leq 2 \eta n$, and thus, $\chi'(\cH_3) \leq 2 \eta n \leq \eps n / 4$. Therefore it suffices to show that $\chi'(\cH_1) \leq \eps n / 2$. Without loss of generality, let us assume $\cH_1 \ne \varnothing$. Let $\cH_0^{\mathrm{left}} \coloneqq \cH_1$, and for every positive integer $i$, define spanning subhypergraphs $\cH_i^{\mathrm{left}}, \cH_i^{\mathrm{good}}, W_i$ of $\cH_{i - 1}^{\mathrm{left}}$ as follows. If $\cH_{i - 1}^{\mathrm{left}} = \varnothing$, then let $\cH_i^{\mathrm{left}}, \cH_i^{\mathrm{good}}, W_i\coloneqq \varnothing$. Otherwise, apply Lemma~\ref{reordering-lemma} to $\cH_{i - 1}^{\mathrm{left}}$ with $1 - \eps/6$ and $\eps^{-2}$ playing the roles of $\tau$ and $K$, respectively, to obtain an ordering $\ordering_i$. If $\ordering_i$ satisfies~\ref{reordering-good}, then let $\cH_i^{\mathrm{good}} \coloneqq \cH_{i-1}^{\mathrm{left}}$, and let $\cH_i^{\mathrm{left}}, W_i \coloneqq \varnothing$. Otherwise, let $W_i$ be the set $W$ obtained from~\ref{reordering-volume}, let $e^*_i$ be the edge of $W_i$ which comes last in $\ordering_i$, let $\cH_i^{\mathrm{good}} \coloneqq \cH_{i - 1}^{\mathrm{left}}\setminus (\cH_{i - 1}^{\mathrm{left}})^{\ordering e^*_i}$, let $f^*_i$ be the edge of $W_i$ which comes first in $\ordering_i$, and let $\cH_i^{\mathrm{left}}\coloneqq \cH_{i - 1}^{\mathrm{left}}\setminus \{e \in \cH_{i - 1}^{\mathrm{left}} : f^*_i \ordering_i e\}$. By~\ref{ordering-by-size}, we may assume without loss of generality that every $e\in \cH_{i-1}^{\rm left}$ satisfying $f^*_i \ordering_i e \ordering_i e^*_i$ is in $W_i$. By the choices of $\tau$ and $K$, if $\ordering_i$ and $W_i$ satisfy~\ref{reordering-volume}, then\COMMENT{Here we used $\eps \ll 1$.} \begin{enumerate}[label = {($\mathrm{W}_i\arabic*)$}] \item\label{Wi-max-size} $\max_{e\in W_i}|e| \leq \eps^{-10}|e_i^*|$ and \item\label{Wi-volume} $\vol_{\cH}(W_i) \geq \eps^{20}$. \end{enumerate} For any $i \geq 1$, note that the sets $W_1 , \dots , W_i$ are pairwise disjoint. Moreover, if $W_i = \varnothing$ then $\cH_i^{\rm left} = \varnothing$, and if $W_i \ne \varnothing$ then $W_1 , \dots , W_{i-1}$ are also nonempty. Thus, we have $\sum_i\vol_\cH(W_i) \leq 1$, and if $W_i \neq \varnothing$ then $i \leq \eps^{-20}$ by~\ref{Wi-volume}, so there is some integer $k \geq 1$ such that $W_k = \varnothing$, and $k \leq \eps^{-20} + 1$. Hence, \begin{equation}\label{eq:weak-stability-partition} \textrm{$\cH_1$ is partitioned into $W_1, \dots, W_{k-1}$ and $\cH_1^{\mathrm{good}}, \dots, \cH_k^{\mathrm{good}}$,} \end{equation} where $W_1 , \dots, W_{k-1}$ are nonempty, and $\cH_1^{\rm good} , \dots , \cH_k^{\rm good}$ could be empty.\COMMENT{We keep applying Lemma~\ref{reordering-lemma} until $W_k = \varnothing$. Then either the procedure ends with~\ref{reordering-good} or $\cH_{k-1}^{\rm left} = \varnothing$ (thus $\cH_k^{\rm left} = \cH_k^{\rm good} = W_k = \varnothing$).} Combine $\ordering_1, \dots, \ordering_k$ to obtain an ordering $\ordering$ of $\cH_1$ where if $f \in \cH_i^{\mathrm{good}} \cup W_i$, then $e\ordering f$ for every $e \in (\cH_{i-1}^{\mathrm{left}})^{\ordering_i f}$. Let $\cH^{\mathrm{good}} \coloneqq \bigcup_{i=1}^k \cH_i^{\mathrm{good}}$, and note that by~\ref{reordering-good} and~\ref{ordering-goodness}, \begin{equation} \label{reordering-goodnessi} \text{if $e \in \cH^{\mathrm{good}}$, then $\fwddeg_{\cH_1}(e) \leq \eps n / 6$.} \end{equation} By~\ref{Wi-max-size}, and since every $e\in \cH_1$ satisfies $1 / \eta < |e| < \eta \sqrt n$, for each $i \in [k-1]$ we can apply Corollary~\ref{aks-sparsity-corollary} to $W_i$ with $\eta$, $\eps^{10}$, and $\eps / (6k)$ playing the roles of $\eta$, $\alpha$, and $\eps$, respectively, to obtain a proper edge-colouring $\phi_i : W_i \rightarrow C_i$, where $|C_i| \leq \eps n /(6k)$. By~\eqref{reordering-goodnessi}, we can apply Proposition~\ref{greedy-colouring-prop} to $\cH^{\mathrm{good}}$ with $1/\eta$, $\eps / 6$, and $1/2$ playing the roles of $r$, $\alpha_1$, and $\alpha_2$, respectively, to obtain a proper edge-colouring $\phi' : \cH^{\mathrm{good}} \rightarrow C'$, where $|C'| \leq \eps n / 3$. We may assume without loss of generality that $C'$, $C_1, \dots, C_{k-1}$ are pairwise disjoint. Therefore by~\eqref{eq:weak-stability-partition}, we can combine $\phi'$, $\phi_1, \dots, \phi_{k-1}$ to obtain a proper edge-colouring $\phi : \cH_1 \rightarrow C' \cup \bigcup_{i=1}^{k-1} C_i$. Since $|C'| + \sum_{i=1}^{k-1} |C_i'| \leq \eps n / 2$, we have $\chi'(\cH_1) \leq \eps n / 2$, as desired. \end{proof} \begin{proposition}\label{prop:med-edges} Let $0 < 1 / n_0 \ll 1 / r_0 \ll 1 / r_1 \ll \gamma < 1$, and let $n \geq n_0$. If $\cH$ is an $n$-vertex linear hypergraph where every $e\in\cH$ satisfies $r_1 \leq |e| \leq r_0$, then there is a $\gamma$-bounded proper edge-colouring of $\cH$ using at most $\gamma n$ colours. \end{proposition} \begin{proof} By Proposition~\ref{few-large-colour-classes}\ref{few-large-colour-classes-splitting} applied with $\gamma$ and $r_1 - 1$ playing the roles of $\alpha$ and $r$, respectively, there is a $\gamma$-bounded proper edge-colouring $\phi$ of $\cH$ using at most $\chi'(\cH) + 2n / (\gamma^2 (r_1 - 1)) \leq \chi'(\cH) + \gamma n / 2$ colours. Since $\cH$ is linear and every $e\in\cH$ satisfies $|e| \geq r_1$, we have $\Delta(\cH) \leq n / (r_1 - 1)$. Thus, by Theorem~\ref{thm:kahn}, $\chi'(\cH) \leq 2n / r_1 \leq \gamma n / 2$, so $\phi$ uses at most $\gamma n$ colours, as desired. \end{proof} \begin{proof}[Proof of Theorem~\ref{large-edge-thm}] Recall that $\cH_{\rm med} = \{ e \in \cH \: : \: r_1 < |e| \leq r_0 \}$, $\cH_{\rm large} = \{ e \in \cH \: : \: |e| > r_0 \}$, and $\cH_{\rm huge} = \{ e \in \cH \: : \: |e| \geq \beta n / 4 \} $. Let $\cH' \coloneqq \cH\setminus \cH_{\mathrm{huge}}$. By Proposition~\ref{prop:med-edges}, there is a $\gamma_1$-bounded proper edge-colouring $\phi_{\mathrm{med}}$ of $\cH_{\mathrm{med}}$ using a set $C_{\mathrm{med}}$ of at most $\gamma_1 n$ colours. We use $\phi_{\mathrm{med}}$ in all cases when we prove~\ref{non-extremal-colouring}, and we define $C_{\mathrm{med}}$ differently when we prove~\ref{extremal-colouring} (see Case 2.2 below). Now we apply Lemma~\ref{reordering-lemma} several times and combine the resulting orderings to obtain an ordering $\ordering$ of $\cH$. We also define several subhypergraphs of $\cH$, which we assume are all spanning. First, apply Lemma~\ref{reordering-lemma} to $\cH'$ with $1 - \gamma_2/3$ and $\gamma_2^{-2}$ playing the roles of $\tau$ and $K$, respectively, to obtain an ordering $\ordering_1$. We define $e^*_1$, $W_1$, and $\cH_1^{\mathrm{good}}$, as follows. If $\ordering_1$ satisfies~\ref{reordering-good}, then let $e^*_1$ be the first edge of $\cH'$, let $W_1 \coloneqq \varnothing$, and let $\cH_1^{\mathrm{good}} \coloneqq \cH'$. Otherwise, let $W_1$ be the set $W$ obtained from~\ref{reordering-volume}, let $e^*_1$ be the last edge of $W_1$, and let $\cH_1^{\mathrm{good}} \coloneqq \cH'\setminus (\cH')^{\ordering_1e^*_1}$. In both cases, let $\cH_1^{\mathrm{left}} \coloneqq \cH'\setminus \cH_1^{\mathrm{good}}$, and let $r_2\coloneqq |e^*_1|$. By the choices of $\tau$ and $K$, and since $\delta \ll \gamma_2 \ll 1$, if $\ordering_1$ and $W_1$ satisfy~\ref{reordering-volume}, then \begin{enumerate}[label = {($\mathrm{W}_1\arabic*)$}] \item\label{W1-max-size} $\max_{e\in W_1}|e| \leq r_2 / \gamma_2^{10}$ and \item\label{W1-volume} $\vol_\cH(W_1) \geq \gamma_2^{20} > \delta$. \end{enumerate} If $\cH_1^{\mathrm{left}} = \varnothing$, then let $e^*_2\coloneqq e^*_1$ and $W_2, \cH_2^{\mathrm{good}} \coloneqq \varnothing$. If $\cH_1^{\mathrm{left}} \neq \varnothing$, we apply Lemma~\ref{reordering-lemma} to $\cH_1^{\mathrm{left}}$ with $3\sigma$ and $1$ playing the roles of $\tau$ and $K$, respectively, to obtain an ordering $\ordering_2$, and we define $e^*_2$, $W_2$, and $\cH_2^{\mathrm{good}}$, as follows. If $\ordering_2$ satisfies~\ref{reordering-good}, then let $e^*_2$ be the first edge of $\cH_1^{\mathrm{left}}$ in $\ordering_2$, let $W_2 \coloneqq \varnothing$, and let $\cH_2^{\mathrm{good}} \coloneqq \cH_1^{\mathrm{left}}$. Otherwise, let $W_2$ be the set $W$ obtained from~\ref{reordering-volume}, let $e^*_2$ be the last edge of $W_2$ in $\ordering_2$, and let $\cH_2^{\mathrm{good}} \coloneqq \cH_1^{\mathrm{left}}\setminus (\cH_1^{\mathrm{left}})^{\ordering_2 e^*_2}$. In all cases, let $\cH_2^{\mathrm{left}} \coloneqq (\cH_1^{\mathrm{left}}\cup\cH_{\mathrm{huge}})\setminus\cH_2^{\mathrm{good}}$, and let $r_3 \coloneqq |e^*_2|$. By the choices of $\tau$ and $K$, and since $\sigma \ll \delta\ll 1$, if $\ordering_2$ and $W_2$ satisfy~\ref{reordering-volume}, then \begin{enumerate}[label = {($\mathrm{W}_2\arabic*)$}] \item\label{W2-max-size} $\max_{e\in W_2}|e| \leq (1 + 4\sigma^{1/4})r_3$ and \item\label{W2-volume} $\vol_\cH(W_2) \geq (1 - \sigma^{1/5})^3 \geq 1 - \delta^3$. \end{enumerate} Finally, if $W_2\neq\varnothing$, then let $f^*$ be the edge of $W_2$ which comes first in $\ordering_2$, and let $\cH_3 \coloneqq \cH_2^{\mathrm{left}} \setminus \{e \in \cH_1^{\mathrm{left}} : f^*\ordering_2 e\}$. Otherwise, let $\cH_3\coloneqq\cH_{\mathrm{huge}}$. Thus in both cases, $\cH_{\rm huge} \subseteq \cH_3$. Apply Lemma~\ref{reordering-lemma} with $\cH_3$, $1 - 1/2000$, and $2000^2$ playing the roles of $\cH$, $\tau$, and $K$, respectively, to obtain an ordering $\ordering_3$. Since $W_2\cap \cH_3 = \varnothing$, we have $\vol_\cH(W_2) + \vol_\cH(\cH_3) \leq 1$. Thus, $\ordering_3$ satisfies~\ref{reordering-good}, because~\ref{reordering-volume} would imply there is a set $W'\subseteq \cH_3$ disjoint from $W_2$ with $\vol_{\cH}(W')\geq \delta$, contradicting~\ref{W2-volume}. By~\ref{ordering-by-size} of Lemma~\ref{reordering-lemma}, we may assume without loss of generality that every $e\in \cH_1^{\rm left}$ satisfying $f^* \ordering_2 e \ordering_2 e^*_2$ is in $W_2$, so \begin{equation}\label{eq:large-edge-thm-partition} \textrm{$\cH$ is partitioned into $\cH_2^{\mathrm{left}}$, $\cH_2^{\mathrm{good}}$, and $\cH_1^{\mathrm{good}}$, and $\cH_2^{\mathrm{left}}$ is partitioned into $\cH_3$ and $W_2$}. \end{equation} Combine $\ordering_1$, $\ordering_2$, and $\ordering_3$ to obtain an ordering $\ordering$ of $\cH$ where \begin{itemize} \item if $f\in\cH_1^{\mathrm{good}}$, then $e\ordering f$ for every $e\in \cH_{\mathrm{huge}}\cup (\cH')^{\ordering_1 f}$, \item if $f\in\cH_2^{\mathrm{good}} \cup W_2$, then $e \ordering f$ for every $e\in\cH_{\mathrm{huge}}\cup (\cH_1^{\mathrm{left}})^{\ordering_2 f}$, and \item if $f\in \cH_3$, then $e\ordering f$ for every $e\in \cH_3^{\ordering_3 f}$. \end{itemize} \input{tex/ordering-fig.tex} See Figure~\ref{fig:reordering}. Note the following. \begin{enumerate}[(a)] \item\label{huge-in-H3} $\cH_{\mathrm{huge}}\subseteq \cH_3$, and $e(\cH_{\mathrm{huge}}) \leq 8 / \beta$ by~\eqref{eqn:huge-edge-bound}. \item\label{reordering-goodness1} If $e\in\cH_1^{\mathrm{good}}$, then $\fwddeg_\cH(e) \leq \gamma_2 n / 2$.\COMMENT{since $\ordering_1$ satisfies either~\ref{reordering-good} or~\ref{ordering-goodness}, and by~\ref{huge-in-H3}.} \item\label{reordering-goodness2} If $e\in \cH_2^{\mathrm{good}}$, then $\fwddeg_\cH(e) \leq (1 - 2\sigma)n$ and $d^{\ordering_2}_{\cH_1^{\rm left}}(e) \leq (1 - 3\sigma)n$.\COMMENT{since $\ordering_2$ satisfies either~\ref{reordering-good} or~\ref{ordering-goodness}, and by~\ref{huge-in-H3}.} \item\label{reordering-goodness3} If $e\in \cH_3$, then $\fwddeg_\cH(e) \leq n/2000$.\COMMENT{since $\ordering_3$ satisfies~\ref{reordering-good}} \item\label{d2-bound} If $e\in\cH_1^{\mathrm{left}}$, then $|e| \geq r_2 = |e^*_1|$.\COMMENT{If $\ordering_1$ satisfies~\ref{reordering-good}, then it's vacuously true, and otherwise it follows by~\ref{ordering-by-size}.} \item\label{d3-bound} If $e\in \cH_2^{\mathrm{left}}$, then $|e| \geq r_3 = |e^*_2|$.\COMMENT{If $\ordering_2$ satisfies~\ref{reordering-good}, then it's vacuously true, and otherwise it follows by~\ref{ordering-by-size}.} \end{enumerate} We consider two cases: $\ordering_2$ satisfies~\ref{reordering-good}, or both $\ordering_1$ and $\ordering_2$ satisfy~\ref{reordering-volume}. Note that if $\ordering_1$ satisfies~\ref{reordering-good}, then $\ordering_2$ vacuously satisfies~\ref{reordering-good} (that is, the former case applies) \noindent {\bf Case 1:} $\ordering_2$ satisfies~\ref{reordering-good}. In this case, we prove~\ref{non-extremal-colouring}. If $\ordering_2$ satisfies~\ref{reordering-good}, then $\cH_3\cup \cH_2^{\mathrm{good}}\cup \cH_1^{\mathrm{good}} = \cH$ by~\eqref{eq:large-edge-thm-partition}, so every $e\in\cH$ satisfies $\fwddeg_\cH(e) \leq (1 - 2\sigma)n$ by~\ref{reordering-goodness1},~\ref{reordering-goodness2}, and~\ref{reordering-goodness3}. Thus, by Proposition~\ref{greedy-colouring-prop} applied to $\cH_{\mathrm{large}}$ with $r_0$, $\sigma / 2$, and $\beta/5$ playing the roles of $r$, $\alpha_1$, and $\alpha_2$, respectively, we obtain a $\beta/5$-bounded proper edge-colouring $\phi_{\mathrm{large}}$ of $\cH_{\mathrm{large}}$ using colours from a set $C_{\mathrm{large}}$ of size at most $(1 - 3\sigma / 2)n$ disjoint from $C_{\mathrm{med}}$. We combine $\phi_{\mathrm{large}}$ and $\phi_{\mathrm{med}}$ to obtain a proper edge-colouring $\phi$ of $\cH$ satisfying~\ref{non-extremal-colouring}, as follows. For each $e\in \cH_{\mathrm{large}}$, let $\phi(e) \coloneqq \phi_{\mathrm{large}}(e)$, and for each $e\in\cH_{\mathrm{med}}$, let $\phi(e) \coloneqq \phi_{\mathrm{med}}(e)$. Since $C_{\mathrm{large}} \cap C_{\mathrm{med}} = \varnothing$ and $|C_{\mathrm{large}} \cup C_{\mathrm{med}}| \leq (1 - \sigma)n$, the colouring $\phi$ is proper and uses at most $(1 - \sigma)n$ colours, as required. Since $\phi_{\mathrm{large}}$ is $\beta/5$-bounded, $\phi$ satisfies~\ref{non-extremal-huge-edge} and ~\ref{non-extremal-colour-class-bound}, and since $\phi_{\mathrm{med}}$ is $\gamma_1$-bounded, $\phi$ satisfies~\ref{non-extremal-medium-bound}, as desired. \noindent {\bf Case 2:} Both $\ordering_1$ and $\ordering_2$ satisfy~\ref{reordering-volume}. We assume \begin{equation}\label{eqn:d3-upper-bound} r_3 \leq \sqrt{n / (1 - 4\sigma)}, \end{equation} as otherwise $\vol_\cH(\cH_2^{\mathrm{left}}) \leq 1$ and~\ref{d3-bound} would imply $e(\cH_2^{\mathrm{left}}) \leq (1 - 3\sigma)n$\COMMENT{We have $1 \geq \vol_{\cH}(\cH_2^{\mathrm{left}}) \geq \left.e(\cH_2^{\mathrm{left}})\binom{r_3}{2}\middle/\binom{n}{2}\right.$, and if $r_3 \geq \sqrt{n / (1 - 4\sigma)}$, then $\left.\binom{r_3}{2}\middle/\binom{n}{2}\right. \geq (1 - 1/\sqrt n)/((1 - 4\sigma)n)$.}. Together with~\ref{reordering-goodness2}, this fact would imply that $\ordering_2$ satisfies~\ref{reordering-good}. We now consider two additional cases: $r_3 < (1 - \delta)\sqrt n$, and $r_3 \geq (1 - \delta)\sqrt n$. In the former case, we prove~\ref{non-extremal-colouring}, and in the latter case we prove~\ref{extremal-colouring}. \noindent {\bf Case 2.1:} $r_3 < (1 - \delta)\sqrt n$. Let $\zeta \coloneqq 1 - r_3 / \sqrt n$. Since $r_3 < (1 - \delta)\sqrt n$, we have $\zeta > \delta$. First we show how to colour $W_2\setminus\cH_{\mathrm{med}}$ in the following claim. \begin{claim}\label{claim:sparse-colouring} There is a $\beta/5$-bounded proper edge-colouring $\phi'$ of $W_2\setminus\cH_{\mathrm{med}}$ using at most $(1 - \zeta / 1000)n$ colours. \end{claim} \begin{claimproof} By~\ref{W2-max-size}, we can apply Corollary~\ref{sparsity-corollary} with $r_3$ and $4\sigma^{1/4}$ playing the roles of $r$ and $\alpha$, respectively, so $\chi'(W_2\setminus\cH_{\mathrm{med}}) \leq (1 - \zeta / 500)n$. Thus, the claim follows from Proposition~\ref{few-large-colour-classes}\ref{few-large-colour-classes-splitting} with $\beta/5$ and $r_0$ playing the roles of $\alpha$ and $r$, respectively, since $\zeta > \delta$ and $2n / ((\beta/5)^2r_0) \leq \delta^2 n \leq \zeta n / 1000$. \end{claimproof} We will colour $\cH_3\setminus\cH_{\mathrm{med}}$ with a set of colours disjoint from those that we assign to $W_2 \setminus\cH_{\mathrm{med}}$ using the following claim. \begin{claim}\label{claim:before-W-colouring} There is a $\beta/5$-bounded proper edge-colouring $\phi''$ of $\cH_3\setminus\cH_{\mathrm{med}}$ using at most $(\zeta / 1000 - 2\sigma)n$ colours. \end{claim} \begin{claimproof} Let $k \coloneqq e(\cH_3\setminus\cH_{\mathrm{med}})$. If $k \leq (\zeta / 1000 - 2\sigma)n$, then we can simply assign each edge of $\cH_3\setminus\cH_{\mathrm{med}}$ a distinct colour and the claim holds, so we assume $k > (\zeta / 1000 - 2\sigma)n$. Since $\zeta > \delta$, we have $k > 2\delta^2 n$. By~\ref{d3-bound}, every edge of $\cH_3$ has size at least $r_3$, so we have $\vol_{\cH}(\cH_3\setminus \cH_{\mathrm{med}}) \geq k(r_3 - 1)^2 / n^2$. On the other hand, by~\ref{W2-volume}, and since $\cH_3 \cap W_2 = \varnothing$ by~\eqref{eq:large-edge-thm-partition}, we have $\vol_{\cH}(\cH_3) \leq \delta^3$. Thus, $2\delta^2 n < k \leq \delta^3 n^2 / (r_3 - 1)^2$, so $r_3 < \delta^{1/4} \sqrt{n}$. Therefore, $\zeta > 1000/1001$. Now by~\ref{reordering-goodness3} and Proposition~\ref{greedy-colouring-prop} applied with $\cH_3\setminus\cH_{\mathrm{med}}$, $\ordering_3$, $r_0$, $1/6000$, and $\beta/5$ playing the roles of $\cH$, $\ordering$, $r$, $\alpha_1$, and $\alpha_2$, respectively, we obtain a $\beta/5$-bounded proper edge-colouring of $\cH_3\setminus\cH_{\mathrm{med}}$ using a set of at most $n/1500 \leq (\zeta / 1000 - 2\sigma)n$ colours, as desired. \end{claimproof} We may assume that $\phi'$ and $\phi''$ use disjoint sets of colours. By Claims~\ref{claim:sparse-colouring} and~\ref{claim:before-W-colouring}, we can combine $\phi'$ and $\phi''$ to obtain a $\beta/5$-bounded proper edge-colouring $\phi_1$ of $\cH_2^{\mathrm{left}}\setminus \cH_{\mathrm{med}}$ using a set $C_1$ of at most $(1 - 2\sigma)n$ colours. We may assume that $C_1\cap C_{\mathrm{med}} = \varnothing$. Let $C_2$ be a set of $(1 - 3\sigma / 2)n - |C_1|$ colours disjoint from $C_1$ and $C_{\mathrm{med}}$, and let $C_{\mathrm{huge}}\subseteq C_1$ where $c\in C_{\mathrm{huge}}$ if $\phi_1(f) = c$ for some $f\in \cH_{\mathrm{huge}}$. By~\ref{huge-in-H3}, $|(C_1 \cup C_2)\setminus C_{\mathrm{huge}}| \geq (1 - 7\sigma / 4)n$. We extend $\phi_1$ to a $\beta/5$-bounded proper edge-colouring of $\cH_{\mathrm{large}}$ using the following claim. \begin{claim}\label{claim:bounded-colouring-extension} There is a $\beta/5$-bounded proper edge-colouring $\phi_2$ of $(\cH_2^{\mathrm{good}}\cup\cH_1^{\mathrm{good}})\setminus \cH_{\mathrm{med}}$ such that every $e\in (\cH_2^{\mathrm{good}}\cup\cH_1^{\mathrm{good}})\setminus \cH_{\mathrm{med}}$ satisfies \begin{itemize} \item $\phi_2(e) \in (C_1\cup C_2)\setminus C_{\mathrm{huge}}$ and \item $\phi_2(e)\neq\phi_1(f)$ for every $f\in N_{\cH_2^{\mathrm{left}}\setminus\cH_{\mathrm{med}}}(e)$. \end{itemize} \end{claim} \begin{claimproof} We apply Proposition~\ref{greedy-colouring-prop} to $(\cH_2^{\mathrm{good}}\cup\cH_1^{\mathrm{good}})\setminus \cH_{\mathrm{med}}$, as follows. We let $r_0$, $\sigma/4$ and $\beta/5$ play the roles of $r$, $\alpha_1$ and $\alpha_2$, respectively, and we define the list-assignment for $L((\cH_2^{\mathrm{good}}\cup\cH_1^{\mathrm{good}})\setminus \cH_{\mathrm{med}})$ as $C(e) \coloneqq ((C_1\cup C_2)\setminus C_{\mathrm{huge}})\setminus \bigcup_{f\in N_{\cH_2^{\mathrm{left}}\setminus\cH_{\mathrm{med}}}(e)}\phi_1(f)$. Since every $e\in \cH_2^{\mathrm{good}}\cup\cH_1^{\mathrm{good}}$ satisfies $|N_{\cH_2^{\mathrm{left}}}(e)| + \fwddeg_{\cH^{\mathrm{good}}_2\cup\cH_1^{\mathrm{good}}}(e) = \fwddeg_{\cH}(e) \leq (1 - 2\sigma)n$ by~\ref{reordering-goodness1} and~\ref{reordering-goodness2}, we have $|C(e)| \geq (1 - 7\sigma / 4)n - |N_{\cH_2^{\mathrm{left}}}| \geq \fwddeg_{\cH^{\mathrm{good}}_2\cup\cH_1^{\mathrm{good}}}(e) + \sigma n/4$ as required. Therefore by Proposition~\ref{greedy-colouring-prop}, there is a $\beta/5$-bounded proper edge-colouring $\phi_2$ of $(\cH_2^{\mathrm{good}}\cup\cH_1^{\mathrm{good}})\setminus \cH_{\mathrm{med}}$ such that $\phi_2(e) \in C(e)$ for every $e\in(\cH_2^{\mathrm{good}}\cup\cH_1^{\mathrm{good}})\setminus \cH_{\mathrm{med}}$, and the choice of $C(e)$ ensures that $\phi_2$ satisfies the claim. \end{claimproof} Now we combine $\phi_1$, $\phi_2$, and $\phi_{\mathrm{med}}$ to obtain a proper edge-colouring $\phi$, and we show that $\phi$ satisfies~\ref{non-extremal-colouring}. Indeed, by~\eqref{eq:large-edge-thm-partition}, every edge of $\cH$ is assigned a colour by $\phi$, and since $|C_1| + |C_2| + |C_\mathrm{med}| \leq (1 - 3\sigma / 2) + \gamma_1 n \leq (1 - \sigma) n$, the colouring $\phi$ uses at most $(1 - \sigma)n$ colours, as required. Since $\phi_2(e) \notin C_{\mathrm{huge}}$ for each $e\in (\cH_2^{\mathrm{good}}\cup\cH_1^{\mathrm{good}})\setminus \cH_{\mathrm{med}}$, since~\ref{huge-in-H3} holds, and since $\phi''$ is $\beta / 5$-bounded, $\phi$ satisfies~\ref{non-extremal-huge-edge}. Since $\phi_1$ and $\phi_2$ are $\beta/5$-bounded, $\phi$ satisfies~\ref{non-extremal-colour-class-bound}, and since $\phi_{\mathrm{med}}$ is $\gamma_1$-bounded, $\phi$ satisfies~\ref{non-extremal-medium-bound}, as desired. \noindent {\bf Case 2.2:} $r_3 \geq (1 - \delta)\sqrt n$. By~\ref{d3-bound} and Lemma~\ref{extremal-case-lemma}, there is a proper edge-colouring $\phi_1$ of $\cH_2^{\mathrm{left}}$ using a set $C$ of at most $n$ colours such that every colour is assigned to at most two edges. By~\ref{W2-max-size},~\ref{W2-volume}, and~\eqref{eqn:d3-upper-bound}, there are no edges of size at least $\delta n/2$ in $\cH$.\COMMENT{By~\ref{W2-max-size} and~\eqref{eqn:d3-upper-bound}, any $e\in\cH$ such that $|e| \geq (1 + \delta)\sqrt n$ is not in $W_2$, so~\ref{W2-volume} implies that $\vol_\cH(e) \leq \delta^3$, which in turn implies that $|e| \leq \delta n / 2$.} Hence, $\phi_1$ satisfies~\ref{extremal-huge-edge} of~\ref{extremal-colouring}, and $\phi_1 |_{\cH_2^{\mathrm{left}}\setminus\cH_{\mathrm{huge}}}$ is $\beta/2$-bounded. Let $C_{\mathrm{huge}}\subseteq C$ where $c\in C_{\mathrm{huge}}$ if $\phi_1(f) \in\cH$ for some $f\in\cH_{\mathrm{huge}}$, and let $C_{\mathrm{med}}\subseteq C\setminus C_{\mathrm{huge}}$ have size $\gamma_2 n$ (such a set exists by~\ref{huge-in-H3}). By~\ref{W1-volume} and~\ref{W2-volume}, $W_1\cap W_2 \neq \varnothing$, so by~\ref{d3-bound}, there is an edge $e\in W_1$ such that $|e| \geq r_3$. Therefore by~\ref{W1-max-size}, $r_2 \geq \gamma_2^{10}r_3$. Also, $r_3 \geq (1 - \delta)\sqrt n \geq 2r_0 / \gamma_2^{10}$, so $r_2 \geq 2r_0$. Thus, by~\ref{d2-bound}, we have $\cH_{\mathrm{med}}\subseteq \cH_1^{\mathrm{good}}$. We use the following two claims to colour $\cH_2^{\mathrm{good}}$ and $\cH_1^{\mathrm{good}}$. The proofs are similar to the proof of Claim~\ref{claim:bounded-colouring-extension}, so we omit them. \begin{claim}\label{claim:bounded-colouring-extension2} There is a $\beta/5$-bounded proper edge-colouring $\phi_2$ of $\cH_2^{\mathrm{good}}$ such that every $e\in\cH_2^{\mathrm{good}}$ satisfies \begin{itemize} \item $\phi_2(e) \in C\setminus C_{\mathrm{huge}}$ and \item $\phi_2(e) \neq \phi_1(f)$ for every $f\in N_{\cH_2^{\mathrm{left}}}(e)$.\hfill$\blacklozenge$ \end{itemize} \end{claim} \COMMENT{% \begin{claimproof} We apply Proposition~\ref{greedy-colouring-prop} to $\cH_2^{\mathrm{good}}$, as follows. We let $r_0$, $\sigma$, and $\beta/5$ play the roles of $r$, $\alpha_1$, and $\alpha_2$, respectively, and we define the list-assignment for $L(\cH_2^{\mathrm{good}})$ as $C(e) \coloneqq (C\setminus C_{\mathrm{huge}})\setminus \bigcup_{f\in N_{\cH_2^{\mathrm{left}}}(e)}\phi_1(f)$. Since every $e\in \cH_2^{\mathrm{good}}$ satisfies $|N_{\cH_2^{\mathrm{left}}}(e)| + \fwddeg_{\cH_2^{\mathrm{good}}}(e) \leq (1 - 2\sigma)n$ by~\ref{reordering-goodness2}, we have $|C(e)| \geq \fwddeg_{\cH_2^{\mathrm{good}}}(e) + \sigma n $ as required. Therefore by Proposition~\ref{greedy-colouring-prop}, there is a $\beta / 5$-bounded proper edge-colouring $\phi_2$ of $\cH_2^{\mathrm{good}}$ such that $\phi_2(e) \in C(e)$ for every $e\in\cH_2^{\mathrm{good}}$, and the choice of $C(e)$ ensures that $\phi_2$ satisfies the claim. \end{claimproof}} \begin{claim}\label{claim:bounded-colouring-extension3} There is a $\gamma_1/2$-bounded proper edge-colouring $\phi_3$ of $\cH_1^{\mathrm{good}}$ such that every $e\in\cH_1^{\mathrm{good}}$ satisfies \begin{itemize} \item $\phi_3(e) \in C_{\mathrm{med}}$ and \item $\phi_3(e) \neq \phi_1(f)$ for every $f\in N_{\cH_2^{\mathrm{left}}}(e)$ and $\phi_3(e) \neq \phi_2(f)$ for every $f\in\cap N_{\cH_2^{\mathrm{good}}}(e)$.\hfill$\blacklozenge$ \end{itemize} \end{claim} \COMMENT{% \begin{claimproof} We apply Proposition~\ref{greedy-colouring-prop} to $\cH_1^{\mathrm{good}}$, as follows. We let $r_1$, $\gamma_2/2$, and $\gamma_1/2$ play the roles of $r$, $\alpha_1$, and $\alpha_2$, respectively, and we define the list-assignment for $L(\cH_1^{\mathrm{good}})$ as $C(e) \coloneqq C_{\mathrm{med}}\setminus ((\bigcup_{f\in N_{\cH_2^{\mathrm{left}}}(e)}\phi_1(f))\cup (\bigcup_{f\in N_{\cH_2^{\mathrm{good}}}(e)\cap }\phi_2(f))$. Since every $e\in \cH_1^{\mathrm{good}}$ satisfies $|N_{\cH_2^{\mathrm{left}}}(e)| + |N_{\cH_2^{\mathrm{good}}}(e)| + \fwddeg_{\cH_1^{\mathrm{good}}}(e) \leq \gamma_2 n / 2$ by~\ref{reordering-goodness1}, we have $|C(e)| \geq \fwddeg_{\cH_1^{\mathrm{good}}}(e) + \gamma_2 n / 2$ as required. Therefore by Proposition~\ref{greedy-colouring-prop}, there is a $\gamma_1/2$-bounded proper edge-colouring $\phi_3$ of $\cH_1^{\mathrm{good}}$ such that $\phi_3(e) \in C(e)$ for every $e\in\cH_1^{\mathrm{good}}$, and the choice of $C(e)$ ensures that $\phi_3$ satisfies the claim. \end{claimproof}} Now we combine $\phi_1$, $\phi_2$, and $\phi_3$ to obtain a proper edge-colouring $\phi$, and we show that $\phi$ satisfies~\ref{extremal-colouring}. Indeed, since $|C| \leq n$, the colouring $\phi$ uses at most $n$ colours, as required. Since $r_3 \geq (1 - \delta)\sqrt n$, by~\ref{d3-bound},~\ref{W2-max-size}, and~\eqref{eqn:d3-upper-bound}, the edges in $W_2$ are FPP-extremal, and by~\ref{W2-volume}, $\vol_{\cH}(W_2) \geq 1 - \delta$, as required. Since $\phi_i(e)\notin C_{\mathrm{huge}}$ for each $e\in\cH_{4 - i}^{\mathrm{good}}$ for $i\in\{2, 3\}$ and~\ref{huge-in-H3} holds, and since $\phi_1$ satisfies~\ref{extremal-huge-edge} of~\ref{extremal-colouring}, $\phi$ satisfies~\ref{extremal-huge-edge}. Since $\phi_1 |_{\cH_2^{\mathrm{left}}\setminus\cH_{\mathrm{huge}}}$ is $\beta/2$-bounded and $\phi_2$ is $\beta/5$-bounded, $\phi$ satisfies~\ref{extremal-colour-class-bound}, and since moreover, $C_{\mathrm{med}} \cap C_{\mathrm{huge}} =\varnothing$, $\cH_{\mathrm{med}}\subseteq \cH_1^{\mathrm{good}}$, and $\phi_3$ is $\gamma_1/2$-bounded, $\phi$ satisfies~\ref{extremal-medium-bound}, as desired. \end{proof} \section{Colouring small edges that are not in the reservoir}\label{small-non-graph-section} In this section, we prove three lemmas which will be applied to colour all of the small edges that are not in the reservoir (where the reservoir is constructed in Section~\ref{proof-section}). Since we may need to reuse the colours already used for large edges and medium edges (given by Theorem~\ref{large-edge-thm}), we need to formulate the lemmas to colour the small edges (that are not in the reservoir) by extending the colour classes given by Theorem~\ref{large-edge-thm}. The lemma below is used repeatedly in the proof of Lemma~\ref{lem:nibble2} to colour most of the non-reserved small edges in such a way that every colour class exhibits some pseudorandom properties. \begin{lemma}[Nibble Lemma]\label{lem:pseudorandom_matching} Let $0 < 1/n_0\ll 1/r , \beta \ll \kappa , \gamma \ll 1$, let $n \geq n_0$, and let $D \in [n^{1/2} , n]$. Let $\cH$ be an $n$-vertex linear multi-hypergraph. \begin{itemize} \item Let $\cH' \subseteq \cH$ be a linear multi-hypergraph such that $V(\cH) = V(\cH')$, every $e \in \cH'$ satisfies $|e| \leq r$, and for every $w \in V(\cH')$ we have $d_{\cH'}(w) = (1 \pm \beta)D$, \item let $\cF_V$ and $\cF_E$ be a family of subsets in $V(\cH')$ and $E(\cH')$, respectively, such that $|\cF_V|,|\cF_E| \leq n^{\log n}$, and \item let\COMMENT{we can imagine $M_1 , \dots, M_D \subseteq \cH$ as colour classes of large edges} $M_1 , \dots, M_D \subseteq \cH \setminus \cH'$ be pairwise edge-disjoint matchings such that for every $i \in [D]$, $|V(M_i)| \leq \beta D$, and for every edge $e \in \cH'$, we have $|\{ i \in [D] \: : \: e \cap V(M_i) \neq \varnothing \}| \leq \beta D$. \end{itemize} Then there exist pairwise edge-disjoint matchings $N_1 , \dots , N_D$ in $\cH$ such that for any $i \in [D]$, \begin{enumerate} \item[\mylabel{NB1}{(\ref{lem:pseudorandom_matching}.1)}] $N_i \supseteq M_i$ and $N_i \setminus M_i \subseteq \cH'$, \item[\mylabel{NB2}{(\ref{lem:pseudorandom_matching}.2)}] $N_i$ is $(\gamma , \kappa)$-pseudorandom with respect to $\cF_V$, and \item[\mylabel{NB3}{(\ref{lem:pseudorandom_matching}.3)}] $|F \setminus \bigcup_{j=1}^{D} N_j| \leq \gamma |F| + \kappa \max(|F|,D)$ for each $F \in \cF_E$. \end{enumerate} \end{lemma} Note that if we let $E(\cH') \in \cF_E$, then (\ref{lem:pseudorandom_matching}.3) implies that $\bigcup_{j=1}^{D} N_j$ contains almost all of the edges of $\cH'$. The matchings $M_1 , \dots, M_D$ will play the role of some of the colour classes given by Theorem~\ref{large-edge-thm}. The overall idea of the proof of Lemma~\ref{lem:pseudorandom_matching} is as follows. First we embed $\cH'$ into an $r$-uniform linear hypergraph $\cH_{\rm unif}$ using Lemma~\ref{lem:embed}. We then embed $\cH_{\rm unif}$ into an $(r+1)$-uniform auxiliary hypergraph $\cH_{\rm aux}$, and we find a pseudorandom matching $N^*$ in $\cH_{\rm aux}$ using Corollary~\ref{cor:sparse_egj}, which yields $D$ edge-disjoint pseudorandom matchings $N'_1 , \dots , N'_D$ in $\cH'$. Then we will show that the matchings $N_i := N'_i \cup M_i$ for $i \in [D]$ satisfy the desired properties. \begin{proof} We apply\COMMENT{We first apply the embedding lemma to make the given multi-hypergraph $\cH'$ uniform-- each singleton will turn into a different $r$-edge, so the resulting $\cH_{\rm unif}$ will not contain multiple edges.} Lemma~\ref{lem:embed} to $\cH'$ with $(1+\beta)D$, $2\beta D$, and $n$ playing the roles of $D$, $C$, and $N$, respectively, to obtain an $r$-uniform linear hypergraph $\cH_{\rm unif}$ such that \begin{enumerate}[(a)] \item\label{cond:unif1} $V(\cH_{\rm unif}) \supseteq V(\cH')$ and $v(\cH_{\rm unif}) \leq n^5$, and \item\label{cond:unif2} every vertex $w \in \cH_{\rm unif}$ satisfies $d_{\cH_{\rm unif}}(w) = (1 \pm \beta)D$. Moreover, $d_{\cH'}(w) = d_{\cH_{\rm unif}}(w)$ for any $w \in V(\cH')$. \end{enumerate} Note that ~\ref{cond:unif2} and ~\ref{E1} imply that \begin{enumerate}[(c)] \item\label{cond:unif3} $\cH' = \cH_{\rm unif}|_{V(\cH')}$. \end{enumerate} Let\COMMENT{The following map $\psi$ allows us to identify the edges of $\cH'$ with some edges in $\cH_{\rm unif}$. We may have added some dummy vertices to each edge $e \in \cH'$, and $\psi^{-1}(e)$ represents the transformed edge in $\cH_{\rm unif}$.} $E_{\rm meet} := \{e \in \cH_{\rm unif} : e \cap V(\cH') \not = \varnothing \}$. By~\ref{cond:unif3}, we have a bijective map\COMMENT{$\psi$ allows us to identify the edges in $E_{\rm meet}$ with $\cH'$} \begin{equation*} \textrm{$\psi : E_{\rm meet} \to \cH'$ such that $e^* \mapsto e^* \cap V(\cH')$.} \end{equation*} Thus, for any $w \in V(\cH')$, we have $E_{\cH'}(w) = \{\psi(e^*) \: : \: w \in e^* \in \cH_{\rm unif} \}$.\COMMENT{For any $e^* \in \cH_{\rm unif}$, if $e^*$ satisfies $|\{ i \in [D] \: : \: e^* \cap V(M_i) \neq \varnothing \}| > \beta D$, then $e^* \in E_{\rm meet}$ and $\psi(e^*) = e^* \cap V(\cH')$; it follows that $\psi(e^*)\in \cH'$ also satisfies $|\{ i \in [D] \: : \: \psi(e^*) \cap V(M_i) \neq \varnothing \}| > \beta D$, contradicting our assumption.} Note that the assumption $| \{ i \in [D] : e \cap V(M_i) \ne \varnothing \} | \leq \beta D$ for any $e \in \cH'$, implies that \begin{equation}\label{eqn:unif_intersect} \textrm{for every $e^* \in \cH_{\rm unif}$, we have $|\{ i \in [D] \: : \: e^* \cap V(M_i) \neq \varnothing \}| \leq \beta D$.} \end{equation} We construct\COMMENT{Now we construct an incidence hypergraph $\cH_{\rm aux}$ of $\cH_{\rm unif}$, where $V_i$ denotes the $i$th clone set of $V(\cH_{\rm unif})$ that avoids a prescribed set $V(M_i)$.} an $(r+1)$-uniform linear hypergraph $\cH_{\rm aux}$ based on $\cH_{\rm unif}$ and the sets $V(M_1), \dots , V(M_D)$, as follows. \begin{itemize} \item For any $i \in [D]$, let $V_i^* := \{w^i \: : \:w \in V(\cH_{\rm unif}) \}$, where for any distinct $i_1, i_2 \in [D]$, we have $V_{i_1}^* \cap V_{i_2}^* = \varnothing$. Now let us define a map $\varphi : [D] \times V(\cH_{\rm unif}) \to \bigcup_{i=1}^{D} V_i^*$ such that $\varphi(i,w) := w^i$ for any $(i,w) \in [D] \times V(\cH_{\rm unif})$.\COMMENT{Thus $\varphi(i,\cdot) : V(\cH_{\rm unif}) \to V_i^*$ is a bijective map that identifies $w$ with $w^i$. For a subset $S \subseteq V(\cH_{\rm unif})$, we may use a standard notion that $\varphi(i,S) := \{ \varphi(i,s) \: : \: s\in S \}$.} \item For any $i \in [D]$, let $V_i := V_i^* \setminus \varphi(i,V(M_i))$. \item Let $V(\cH_{\rm aux}) := \cH_{\rm unif} \cup \bigcup_{i \in [D]} V_i$, where $\cH_{\rm unif} \cap V_i = \varnothing$ for $i \in [D]$. \item Let $\cH_{\rm aux} := \{ \{f, v_1^i, \dots, v_r^i\} \: : \: f = \{v_1,\dots,v_r \} \in \cH_{\rm unif} \: , \{v_1^i,\dots,v_r^i \} \subseteq V_i \: , \: i \in [D] \}.$ \end{itemize} Now for every $w \in V(\cH_{\rm unif})$ and $i \in [D]$ such that $w^i \in V_i$, since $\cH_{\rm aux}$ is linear, $d_{\cH_{\rm unif}}(w) - |V(M_i)| \leq d_{\cH_{\rm aux}}(w^i) \leq d_{\cH_{\rm unif}}(w)$, since $V_i$ is obtained from $V_i^*$ by deleting $|V(M_i)|$ vertices. Since $|V(M_i)| \leq \beta D$ and (b) holds, this implies $d_{\cH_{\rm aux}}(w^i) = (1 \pm 2\beta)D$. Moreover, by~\eqref{eqn:unif_intersect}, for every $e^* \in \cH_{\rm unif}$, we have $(1-\beta)D \leq d_{\cH_{\rm aux}}(e^*) \leq D$. In summary, we have the following. \begin{equation}\label{eqn:degree_aux} \textrm{For every vertex $w \in V(\cH_{\rm aux})$, we have $d_{\cH_{\rm aux}}(w) = (1 \pm 2\beta)D$.} \end{equation} \COMMENT{Note that $\sum_{i=1}^{D} |V_i| \geq D|V(\cH')| - \sum_{i=1}^{D}|V(M_i)| \geq (1-\beta)D |V(\cH')|$.}By the construction of $\cH_{\rm aux}$, we have \begin{equation}\label{eqn:numvertices_aux} n \leq (1-\beta)D|V(\cH')| + |\cH_{\rm unif}| \leq n' := |V(\cH_{\rm aux})| \leq D|V(\cH_{\rm unif})| + |\cH_{\rm unif}| \overset{\ref{cond:unif1},\ref{cond:unif2}}{\leq} n^7. \end{equation} Let \begin{equation*} \cF^{\rm aux} := \bigcup_{i=1}^{D} \{ \varphi(i , A) \setminus \varphi(i,V(M_i)) \: : \: A \in \cF_V \} \cup \{ \psi^{-1} (F) \: : \: F \in \cF_E \}, \end{equation*} where $|\cF^{\rm aux}| \leq D|\cF_V| + |\cF_E| \leq n^{2 \log n} \leq (n')^{2 \log n'}$. Since ~\eqref{eqn:degree_aux} holds and $D \geq n^{1/2} \overset{\eqref{eqn:numvertices_aux}}{\geq} (n')^{1/14}$, we can apply Corollary~\ref{cor:sparse_egj}, with $n'$, $\cH_{\rm aux}$, $D$, $2 \beta$, $\gamma$, $\cF^{\rm aux}$ playing the roles of $n$, $\cH$, $D$, $\kappa$, $\gamma$, $\cF$, respectively, to obtain a matching $N^*$ in $\cH_{\rm aux}$, such that $|A \setminus V(N^*)| = (\gamma \pm 8 \beta)|A|$ for every $A \in \cF^{\rm aux}$ with $|A| \geq D^{1/20}$. This implies that for any $A \in \cF^{\rm aux}$, \begin{equation}\label{eqn:a_uncovered} |A \setminus V(N^*)| = \gamma |A| \pm (8 \beta |A| + D^{1/20}). \end{equation} For $i \in [D]$, let \begin{equation*} N_i' := \{ \psi(e^*) \: : \: e^* = \{v_1,\dots,v_r \} \in E_{\rm meet}\:,\:\{e^* , v_1^i , \dots , v_r^i \} \in N^*\}\text{ and }N_i := N_i' \cup M_i. \end{equation*} Then $N_1' , \dots , N_D' \subseteq \cH'$ satisfy the following properties. \begin{enumerate}[(i)] \item\label{Ni_vertex} For any $w \in V(\cH')$, we have $w \in V(N_i')$ if and only if $w^i = \varphi(i,w) \in V(N^*)$. \item\label{Ni_edge} For any $e \in \cH'$, we have $e \in \bigcup_{i=1}^{D} N_i'$ if and only if $\psi^{-1}(e) \in V(N^*)$. (Recall that $\psi^{-1}(e) \in \cH_{\rm unif} \subseteq V(\cH_{\rm aux})$.) \end{enumerate} It is easy to see\COMMENT{Indeed, since the edges of $N^*$ are disjoint, they contain distinct elements $\psi^{-1}(e)$ of $\cH_{\rm unif}$, which implies that the corresponding edges $e \in \bigcup_{i=1}^{D} N_i'$ are distinct, so $N_1' , \dots , N_D'$ are pairwise edge-disjoint matchings in $\cH'$.} that $N_1' , \dots , N_D'$ are pairwise edge-disjoint matchings in $\cH'$, and that for every $i \in [D]$, we have $V(N_i') \cap V(M_i) = \varnothing$.\COMMENT{Indeed, for every $i \in [D]$ and $e^* = \{v_1,\dots,v_r \} \in E_{\rm meet}$ such that $\psi(e^*) \in N_i'$, we have\footnote{The first equality below follows since $\varphi(i,\cdot) : V(\cH_{\rm unif}) \to V_i^*$ is a bijection.} \begin{equation*} \varphi(i,e^* \cap V(M_i)) = \varphi(i,e^*) \cap \varphi(i, V(M_i)) = \{v_1^i , \dots , v_r^i \} \cap \varphi(i,V(M_i)) \subseteq V_i \cap \varphi(i,V(M_i)) = \varnothing. \end{equation*} Thus $\psi(e^*) \cap V(M_i) \subseteq e^* \cap V(M_i) = \varnothing$, so $V(N_i') \cap V(M_i) = \varnothing$, as claimed.} Moreover, recall that $M_1, M_2, \dots, M_D \subseteq \cH \setminus \cH'$ are pairwise edge-disjoint. Altogether this implies that $N_1 , \dots , N_D$ are pairwise edge-disjoint matchings in $\cH$. This proves~\ref{NB1}. For any $F \in \cF_E$, since $\psi^{-1}(F) \subseteq \cH_{\rm unif} \subseteq V(\cH^{\rm aux})$ and $\psi^{-1}(F) \in \cF^{\rm aux}$, we have $$|F \setminus \bigcup_{i=1}^{D} N_i'| \overset{\ref{Ni_edge}}{=} |\psi^{-1}(F) \setminus V(N^*)| \overset{\eqref{eqn:a_uncovered}}{=} \gamma |F| \pm (8 \beta |F| + D^{1/20} ) \leq \gamma |F| + \kappa \max(|F|,D).$$ Thus, ~\ref{NB3} holds. Finally, we prove ~\ref{NB2}. Let us consider any $A \in \cF_V$ and $i \in [D]$. Since \begin{equation*} |A \setminus V(N_i)| = |(A \setminus V(M_i)) \setminus V(N_i')| \overset{\ref{Ni_vertex}} {=} |\varphi(i , A \setminus V(M_i)) \setminus V(N^*)| = |(\varphi(i, A)\setminus \varphi(i, V(M_i)))\setminus V(N^*)| \end{equation*} and $\varphi(i,A) \setminus \varphi(i,V(M_i)) \in \cF^{\rm aux}$, by~\eqref{eqn:a_uncovered}, we have\COMMENT{here we use $\gamma|A \setminus V(M_i)| \pm (8 \beta |A \setminus V(M_i)| + D^{1/20}) = \gamma|A|\pm ( |V(M_i)| +8 \beta |A \setminus V(M_i)| + D^{1/20}) = \gamma|A|\pm ( \beta n +8 \beta n + D^{1/20}) = \gamma|A|\pm \kappa n$.} $|A \setminus V(N_i')| = \gamma|A| \pm \kappa n$. Thus, the matching $N_i$ is $(\gamma , \kappa)$-pseudorandom with respect to $\cF_V$, proving~\ref{NB2}. \end{proof} In the next lemma, using the absorption lemmas from Section~\ref{absorption-section}, we extend the matchings given by the previous lemma in such a way that each matching will cover all but at most one vertex of $V_+^{(1-\eps)}(G)$, where the uncovered vertex of $V_+^{(1-\eps)}(G)$ must lie in a prescribed defect set $S$. In principle, we could apply Lemma~\ref{lem:pseudorandom_matching} directly with $D = (1 - \rho)n$ to colour almost all of the non-reserved small edges, but in order to be able to apply Lemmas~\ref{crossing-absorption-lemma} and~\ref{internal-absorption-lemma} to each matching, we actually need to partition the hypergraph into subhypergraphs of maximum degree at most $\kappa n$, and we apply Lemma~\ref{lem:pseudorandom_matching} to each part successively, alternating with applications of one of Lemma~\ref{crossing-absorption-lemma} or~\ref{internal-absorption-lemma}. \begin{lemma}[Main colouring lemma]\label{lem:nibble2} Let $0 < 1/n_0 \ll 1/r , \xi , \beta \ll \gamma \ll \varepsilon , \rho \ll 1$, let $n \geq n_0$, and let $D \in [n^{2/3} , n]$. Let $\cH$ be an $n$-vertex linear multi-hypergraph, let $G := \cH^{(2)}$ and let $U := V_+^{(1-\varepsilon)}(G)$. \begin{enumerate} \item[\mylabel{C1}{{\bf C1}}] Let $S \subseteq U$ satisfy $|S| \geq D + \gamma n$ if $|U| > (1-2\eps)n$, \item[\mylabel{C2}{{\bf C2}}] let $R \subseteq E(G)$ be a $(\rho,\gamma,\xi,\varepsilon)$-absorber for $\mathcal{V}$ such that $U,V(\cH) \in \cV$, \item[\mylabel{C3}{{\bf C3}}] let $\cH' \subseteq \cH \setminus R$ be\COMMENT{we can think of $\cH'$ as the hypergraph with all of the small non-reserved edges} a linear multi-hypergraph such that $V(\cH) = V(\cH')$, every edge $e \in \cH'$ satisfies $|e| \leq r$, and $d_{\cH'}(w) = (1 \pm \beta)D$ for every vertex $w \in V(\cH')$, and \item[\mylabel{C4}{{\bf C4}}] let $\cM = \{M_1 , \dots, M_{D}\}$ be a set of edge-disjoint matchings in $\cH \setminus (\cH' \cup R)$ such that $|V(M_i)| \leq \beta D$ for every $i \in [D]$, and $|\{ i \in [D] \: : \: e \cap V(M_i) \neq \varnothing \}| \leq \beta D$ for every edge $e \in \cH'$. \end{enumerate} Then there exists a set $\cN := \{N_1 , \dots , N_{D} \}$ of edge-disjoint matchings in $\cH$ satisfying the following. \begin{enumerate} \item[\mylabel{N1}{(\ref{lem:nibble2}.1)}] For every $i \in [D]$, we have $N_i \supseteq M_i$ and $N_i \setminus M_i \subseteq \cH' \cup R$. \item[\mylabel{N2}{(\ref{lem:nibble2}.2)}] For every vertex $w \in V(\cH)$, $|E_R(w) \cap \bigcup_{k=1}^{D} N_k| \leq \gamma D$ and $|E_{\cH'}(w) \setminus \bigcup_{k=1}^{D} N_k| \leq \gamma D$. \item[\mylabel{N3}{(\ref{lem:nibble2}.3)}] If $|U| \leq (1-2\eps)n$, then $\cN$ has perfect coverage of $U$. Otherwise, $\cN$ has nearly-perfect coverage of $U$ with defects in $S$. \end{enumerate} \end{lemma} \begin{proof} Let $K := \lceil \kappa^{-1} \rceil$, where we choose $\kappa$ so that $r^{-1} , \xi , \beta \ll \kappa \ll \gamma$. First, we find a partition of $\cH'$ into\COMMENT{To show that the desired partition exists, for each $e \in \cH'$, we put $e$ into exactly one of the hypergraphs $\cH_{1}' , \dots , \cH_{K}'$ with probability $K^{-1}$ independently at random. Then $\mathbb{E}[d_{\cH_i'}(w)] = d_{\cH'}(w)/K = (1 \pm \beta)D/K$. Hence, by Theorem~\ref{thm:chernoff}, since $D \geq n^{2/3}$, the following holds with probability at least $1-\exp\left({-n^{1/4}}\right)$. For every $w \in V(\cH)$ and $i \in [K]$, $d_{\cH_{i}'}(w) = \mathbb{E}[d_{\cH_i'}(w)] \pm \beta D / K = (1 \pm 2 \beta) D/K$.} pairwise edge-disjoint hypergraphs $\cH_1' , \dots , \cH_K'$ such that $\bigcup_{j=1}^{K} \cH_j' = \cH'$, and every vertex has degree $(1 \pm 2 \beta)D/K$ in $\cH_i'$ for $i \in [K]$. (To show the desired partition exists, consider a partition chosen uniformly at random.) Now, for each $i \in [K]$, we may choose $n_{i}$ to be either $\lfloor D/K \rfloor$ or $\lceil D/K \rceil$ such that $\sum_{j=1}^{K} n_{j} = D$. Let us partition the set $[D]$ into $K$ disjoint parts $I_1 , \dots , I_{K}$ such that $|I_i| = n_i$. Then $n_i \leq \kappa n$, and every vertex in $\cH_{i}'$ has degree $(1 \pm 3 \beta) n_{i}$. Let us define the following statements for $0 \le j \le K$. \begin{enumerate}[(i)$_j$] \item\label{N1_appl} For any $1 \leq k \leq j$, there exists a set $\cN_k := \{ N_c \: : \: c\in I_k \}$ of $n_k$ matchings in $\cH$ such that $M_c \subseteq N_c$ and $N_c \setminus M_c \subseteq \cH_k' \cup R$ for every $c \in I_k$. Moreover, the matchings in $\bigcup_{k=1}^{j} \cN_k$ are pairwise edge-disjoint. \item\label{N2_appl} For every $w \in V(\cH)$, \begin{equation*} |E_{R}(w) \cap \bigcup_{k \in [j]}\bigcup_{N \in \cN_k} N| \leq \gamma \sum_{k \in [j]} n_k \:\:\:\textrm{and}\:\:\: |E_{\bigcup_{k=1}^{j}\cH_k' }(w) \setminus \bigcup_{k \in [j]}\bigcup_{N \in \cN_k} N| \leq \gamma \sum_{k \in [j]} n_k. \end{equation*} \item\label{N3_appl} If $|U| \leq (1-2\eps)n$, then $\bigcup_{k=1}^{j} \cN_{k}$ has perfect coverage of $U$. Otherwise, $\bigcup_{k=1}^{j} \cN_{k}$ has nearly-perfect coverage of $U$ with defects in $S$. \end{enumerate} Using induction on $j$, we will show that ~\ref{N1_appl}--\ref{N3_appl} hold for $j = K$ which clearly proves the lemma. Note that~\ref{N1_appl}--\ref{N3_appl} trivially hold for $j = 0$. Let $i \in [K]$, and suppose that~\ref{N1_appl}--\ref{N3_appl} hold for $j = i-1$. Our goal is to find a collection $\cN_i$ of $n_i$ pairwise edge-disjoint matchings in $\cH$ satisfying~\ref{N1_appl}--\ref{N3_appl} for $j=i$. Let $R_i := R \setminus \bigcup_{k=1}^{i-1} \bigcup_{N \in \cN_k} N$, let $S_{i} := S \setminus \bigcup_{k=1}^{i-1} \bigcup_{N \in \cN_k} (U \setminus V(N))$, and \begin{equation}\label{def:cv_nibble} \textrm{$\cW := \cF(R_i) \cup \{U,S_i \}$, where $\cF(R_i) := \{ N_{R_i}(u) \cap U \: : \: u \in U \} \cup \{ N_{R_i}(u) \setminus U \: : \: u \in U \}$.} \end{equation} Now we apply Lemma~\ref{lem:pseudorandom_matching} with $\cH_i' , \cW , \{ E_{\cH_i'}(w) \: : \: w \in V(\cH) \}, \{ M_c \: : \: c \in I_i \}, \beta^{1/2} , \gamma / 4 , n_i$ playing the roles\COMMENT{we used $\beta^{1/2}/10 \gg \beta/\kappa$} of $\cH' , \cF_V , \cF_E , \{ M_1 , \dots , M_D \} , \beta , \gamma , D$\COMMENT{we use the index set $I_i$ instead of $[n_i]$ for the matchings.} to obtain a set $\cN_i' := \{ N_c' \: : \: c \in I_i \}$ of $n_{i}$ pairwise edge-disjoint matchings in $\cH$ such that the following hold. \begin{enumerate} \item[\mylabel{cond:dis_1}{(a)\textsubscript{\textit{i}}}] For every $c \in I_i$, $N_c' \supseteq M_c$ and $N_c' \setminus M_c \subseteq \cH_i'$. In particular, $N_c' \cap R = \varnothing$. \item[\mylabel{cond:dis_2}{(b)\textsubscript{\textit{i}}}] For every $c \in I_i$, $N_c'$ is $(\gamma / 4 ,\kappa)$-pseudorandom with respect to $\cW$. \item[\mylabel{cond:dis_3}{(c)\textsubscript{\textit{i}}}] For every\COMMENT{here we used that $|E_{\cH_i'}(w)| = d_{\cH_i'}(w) \leq 3n_i/2$} $w \in V(\cH)$, $|E_{\cH_i'}(w) \setminus \bigcup_{c \in I_i} N_c'| \leq \gamma n_i / 2$. \item[\mylabel{cond:dis_4}{(d)\textsubscript{\textit{i}}}] For every $w \in V(\cH)$, the number of matchings in $\cN_i'$ not covering $w$ is at most \begin{equation*} |\cN_i'| - (d_{\cH_i'}(w) - |E_{\cH_i'}(w) \setminus \bigcup_{c \in I_i} N_c'|) \overset{\ref{cond:dis_3}}{\leq} n_i - (1 - 3 \beta)n_i + \gamma n_i / 2 \leq \gamma n_i. \end{equation*} \end{enumerate} Now we show that for any given $c \in I_i$, $(\cH , N_c' , R_i , S_i)$ is $(\rho , \eps , \gamma/4 , \kappa , \xi)$-absorbable by pseudorandomness of $N_c'$, as follows. \begin{itemize} \item Using the fact that $R$ is a $(\rho,\gamma,\xi,\varepsilon)$-absorber for $\mathcal{V}$, ~\ref{N2_appl} with $j=i-1$, and Observation~\ref{obs:del_absorber}, we deduce that $R_i$ is a $(\rho , 2\gamma , \xi , \eps)$-absorber for $\cV$, showing~\ref{AB1}. \item \ref{cond:dis_1} implies~\ref{AB2}. \item By~\ref{cond:dis_2}, $N_c'$ is $(\gamma / 4 ,\kappa)$-pseudorandom with respect to $\cW$, so~\ref{AB-pseudo} of~\ref{AB3} holds, as required. \end{itemize} Moreover, if $|U| > (1-2\eps)n$, then $|S_{i}| \geq |S|-\sum_{k=1}^{i-1} n_{k} \geq D + \gamma n - D = \gamma n$, so we can apply either Lemma~\ref{crossing-absorption-lemma} or Lemma~\ref{internal-absorption-lemma} depending on the size of $U$, with $\gamma/4 , R_i , S_i , \cN_i'$ playing the roles of $\gamma , R , S , \cN$. This yields a set $\cN_i := \{ N_c \: : \: c \in I_i \}$ of $n_{i}$ pairwise edge-disjoint matchings in $\cH$ such that the following hold. \begin{itemize} \item For every $c \in I_i$, $N_c \supseteq N_c'$ and $N_c \setminus N_c' \subseteq R_i$. Since $N_c' \setminus M_c \subseteq \cH_i'$ by~\ref{cond:dis_1}, this shows~\ref{N1_appl} for $j=i$. \item By~\ref{cond:dis_3}, for any $w \in V(\cH)$, $|E_{\cH_i'}(w) \setminus \bigcup_{c \in I_i}N_c| \leq \gamma n_i/2$. Moreover, by~\ref{cond:dis_4}, all but at most $\gamma n_i$ of the matchings in $\cN_i'$ cover $w$. This together with~\ref{cond:dis_1}\COMMENT{only in case $w$ is not covered by the matchings in $\cN_i'$, then it may be covered using an edge of $R_i$} implies that $|E_{R_i}(w) \cap \bigcup_{c \in I_i} N_c| \leq \gamma n_i$. This shows~\ref{N2_appl} for $j=i$. \item If $|U| \leq (1-2\eps)n$, then $\cN_i$ has perfect coverage of $U$. Otherwise, $\cN_i$ has nearly-perfect coverage of $U$ with defects in $S_i \subseteq S$. This shows~\ref{N3_appl} for $j=i$. \qedhere \end{itemize} \end{proof} Lemma~\ref{lem:nibble2} colours most of the non-reserved small edges (as shown in (\ref{lem:nibble2}.2)). We will use the following lemma to colour the remaining non-reserved small edges such that every colour class covers all but at most one vertex of $V_+^{(1-\eps)}(G)$. Since the proportion of remaining non-reserved small edges is small, we can afford to be less efficient in the number of colours we use in this step in order to ensure that each colour class is small, which allows us to use Lemma~\ref{huge-edge-absorption-lemma} to extend them. \begin{lemma}[Leftover colouring lemma]\label{lem:leftover} Let $0 < 1/n_0 \ll 1/r,\xi \ll \gamma \ll \rho,\eps \ll 1$, let $n \geq n_0$, and let $D \in [n^{2/3} , n]$. Let $\cH$ be an $n$-vertex linear hypergraph, let $G := \cH^{(2)}$, and let $U := V_+^{(1-\eps)}(G)$. \begin{enumerate} \item[\mylabel{L1}{{\bf L1}}] Let $C$ be a set of colours with $\gamma D/2 \leq |C| \leq \gamma D$, \item[\mylabel{L2}{{\bf L2}}] let $\cM := \{M_c \: : \: c \in C \}$ be a set of pairwise edge-disjoint matchings in $\cH$, where $|V(M_c)| \leq \gamma n / 2$ for every $c \in C$, \item[\mylabel{L3}{{\bf L3}}] let $R \subseteq E(G) \setminus \bigcup_{c \in C}M_c$ be a $(\rho , 10\gamma , \xi , \eps)$-absorber for $\cV := \{ V(\cH) , U \}$, \item[\mylabel{L4}{{\bf L4}}] let $\cH_{\rm rem} \subseteq \cH \setminus (R \cup \bigcup_{c \in C} M_c)$ such that $V(\cH) = V(\cH_{\rm rem})$, $\Delta(\cH_{\rm rem}) \leq \gamma^2 D / 20$, every edge $e \in \cH_{\rm rem}$ satisfies $|e| \leq r$ and $|\{ c \in C \: : \: e \cap V(M_c) \ne \varnothing \}| \leq \gamma^2 D / 100$, \item[\mylabel{L5}{{\bf L5}}] let $S \subseteq U$ be a subset satisfying $|S| > (\gamma + \eps)n$ if $|U| > (1-10\eps)n$. \end{enumerate} Then there exists a set $\cN := \{ N_c \: : \: c \in C \}$ of pairwise edge-disjoint matchings such that the following hold. \begin{enumerate}[(\ref{lem:leftover}.1)] \item\label{F1} For any $c \in C$, we have $N_c \supseteq M_c$ and $\cH_{\rm rem} \subseteq \bigcup_{c \in C}(N_c \setminus M_c) \subseteq \cH_{\rm rem} \cup R$. \item\label{F2} If $|U| \leq (1-10\eps)n$, then $\cN$ has perfect coverage of $U$. Otherwise, $\cN$ has nearly-perfect coverage of $U$ with defects in $S$. \end{enumerate} \end{lemma} \begin{proof} Let us choose $\kappa$ such that $r^{-1},\xi \ll \kappa \ll \gamma$. Let $t := \lceil 4 \gamma^{-1} \rceil$ and $C_1 , \dots , C_t$ be a partition of $C$ into $t$ sets such that $|C_i| \geq \gamma^2 D / 10$ for $1 \leq i \leq t$. We will first show that for every $i\in [t]$, there exists a proper colouring of the edges of $\cH_{\rm rem}$ using colours from $C_i$. To that end, let $C(e) := \{c \in C \: : \: e \cap V(M_c) \ne \varnothing \}$ for every edge $e \in \cH_{\rm rem}$. Since $\Delta(\cH_{\rm rem}) \leq \gamma^2 D / 20$, $|C(e)| \leq \gamma^2 D / 100$ and $|C_i| \geq \gamma^2 D / 10$, we can apply Theorem~\ref{thm:kahn} with $\gamma^2 D / 20$ and $1/2$ playing the roles of $D$ and $\alpha$, respectively, to show that for every $i\in [t]$, there exists a proper edge-colouring $\psi_i : \cH_{\rm rem} \to C_i$ such that $\psi_i(e) \not \in C(e)$ for every $e \in \cH_{\rm rem}$. By the definition of $C(e)$, this implies that $V(\psi_i^{-1}(c)) \cap V(M_c) = \varnothing$ for any $i \in [t]$ and $c \in C_i$. Let us now define a proper edge-colouring $\psi : \cH_{\rm rem} \to C$ by choosing $i(e) \in [t]$ uniformly and independently at random for each $e \in \cH_{\rm rem}$ and setting $\psi(e) := \psi_{i(e)}(e)$. Fix an arbitrary colour $c \in C$. Then there is a unique $j \in [t]$ such that $c \in C_j$, and $|V(\psi^{-1}(c))| = \sum_{e \in \psi_j^{-1}(c)}|e| {\bf 1}_{i(e) = j}$, so by the linearity of expectation, $\mathbb{E}[|V(\psi^{-1}(c))|] = \sum_{e \in \psi_j^{-1}(c)} |e|\cdot\mathbb{P}(i(e) = j) \leq n/t \leq \gamma n / 4$. Since $|V(\psi^{-1}(c))|$ is a weighted sum of independent indicator random variables with maximum weight at most $r$, by applications of Theorem~\ref{thm:chernoff} together with a union bound, it is easy to see that $|V(\psi^{-1}(c))| < \gamma n / 2$ for all $c \in C$ with non-zero probability. Combining this with the fact that for every $c \in C$, $V(\psi^{-1}(c)) \cap V(M_c) = \varnothing$ and $|V(M_c)| \leq \gamma n / 2$, it follows that there exists a proper edge-colouring $\psi : \cH_{\rm rem} \to C$ such that $ \{ \psi^{-1}(c) \cup M_c : c \in C \}$ is a set of edge-disjoint matchings in $\cH$ where for every $c \in C$, $|V(\psi^{-1}(c)) \cup V(M_c)| \leq \gamma n$. Thus, for every $c \in C$, $(\cH , M_c \cup \psi^{-1}(c) , R , S)$ is $(\rho,\eps,\gamma,\kappa,\xi)$-absorbable\COMMENT{By Definition~\ref{def:absorbable} this means $R$ is a $(\rho , 10\gamma , \xi , \eps)$-absorber. See also the remark following the definition.} by smallness of $M_c \cup \psi^{-1}(c)$. So we can apply Lemma~\ref{huge-edge-absorption-lemma} with $\{ M_c \cup \psi^{-1}(c) : c \in C \}$ playing the role\COMMENT{we used $|C| \leq \gamma n$} of $\cN$\COMMENT{Here, we also use the index set $C$ instead of $[|C|]$.} to obtain a set $\cN = \{N_c : c \in C\}$ of pairwise edge-disjoint matchings in $\cH$ such that the following hold. \begin{itemize} \item For every $c \in C$, $N_c \supseteq M_c \cup \psi^{-1}(c)$ and $N_c \setminus (M_c \cup \psi^{-1}(c)) \subseteq R$; thus~\ref{F1} holds. \item If $|U| \leq (1-10\eps)n$, then $\cN$ has perfect coverage of $U$. Otherwise, $\cN$ has nearly-perfect coverage of $U$ with defects in $S$; thus~\ref{F2} holds. \qedhere \end{itemize} \end{proof} \section{Notation}\label{notation-section} For $n \in \mathbb{N}$, we write $[n] := \{k \in \mathbb{N} \: : \:1 \leq k \leq n \}$. We write $c = a \pm b$ if $a-b \leq c \leq a+b$. We use the `$\ll$' notation to state our results. Whenever we write a hierarchy of constants, they have to be chosen from right to left. More precisely, if we claim that a result holds whenever $0 < a \ll b \le 1$, then this means that there exists a non-decreasing function $f : (0,1] \mapsto (0,1]$ such that the result holds for all $0 < a,b \le 1$ with $a \le f(b)$. We will not calculate these functions explicitly. Hierarchies with more constants are defined in a similar way. A \emph{hypergraph} $\cH$ is an ordered pair $\cH = (V(\cH), E(\cH))$ where $V(\cH)$ is called the vertex set and $E(\cH) \subseteq 2^{V(\cH)}$ is called the edge set. If $E(\cH)$ is a multiset, we refer to $\cH$ as a multi-hypergraph. Throughout the paper we usually write $\cH$ instead of $E(\cH)$. We say that a (multi-)hypergraph $\cH$ is $r$-uniform if for every $e \in E(\cH)$ we have $|e| = r$. In particular, $2$-uniform hypergraphs are simply called \emph{graphs}. Given any multi-hypergraph $\cH$, let $v(\cH)$ denote the number of vertices in $\cH$ and let $e(\cH)$ denote the number of edges in $\cH$. Let $\cH^{(i)} \coloneqq \{e \in \cH : |e| = i \}$. Throughout the paper, we usually denote $\cH^{(2)}$ by $G$. For any subset $S \subseteq V(\cH)$, let $\cH|_S$ be the multi-hypergraph with the vertex set $V(\cH|_S) := S$ and edge set $\cH|_S := \{e \cap S \: : \: e \in \cH\:\:{\rm and}\:\:e \cap S \ne \varnothing \}$. For any vertex $v \in V(\cH)$, let $E_{\cH}(v) \coloneqq \{ e \in \cH : v \in e\}$. We define the \emph{degree} of $v$ by $d_{\cH}(v) \coloneqq |E_{\cH}(v)|$. More generally, for any given multiset $R \subseteq \cH$, let $E_{R}(v)$ denote the multiset of edges incident to $v$ in $R$, and $d_{R}(v) := |E_{R}(v)|$. We denote the minimum and maximum degrees of the vertices in $\cH$ by $\delta(\cH)$ and $\Delta(\cH)$, respectively. Let $V^{(d)}(\cH) \coloneqq \{ v \in \cH : d_{\cH}(v) = d \}$. Moreover, if $d\in\mathbb N$, then let $V^{(d)}_+(\cH) \coloneqq \{ v \in \cH : d_{\cH}(v) \ge d \}$ and if $x \in (0, 1)$, then let $V^{(x)}_+(\cH) \coloneqq \{ v \in \cH : d_{\cH}(v) \ge xn \}$, where $n \coloneqq v(\cH)$. For any edge $e \in \cH$, the set $N_{\cH}(e)$ denotes the multiset of edges $f \in E(\cH) \setminus \{e \}$ that intersect $e$. The subscript $\cH$ from $N_{\cH}(e)$ may be omitted if it is clear from the context. If $\cH'\subseteq \cH$ and $e\in \cH$, then we denote $N_\cH(e)\cap \cH'$ by $N_{\cH'}(e)$, even if $e\notin\cH'$. The \emph{line graph} $L(\cH)$ of a (multi-)hypergraph $\cH = (V(\cH), E(\cH))$ is the graph whose vertex set is $E(\cH)$, where two vertices in $L(\cH)$ are adjacent if the corresponding edges in $E(\cH)$ have a non-empty intersection. A \emph{matching} $M$ in $\cH$ is a subset of pairwise disjoint edges of $\cH$. We often regard $M$ as a hypergraph with $V(M) \coloneqq \bigcup_{e \in M}e$. For any vertex $u \in V(\cH)$, we say $u$ is \textit{covered} by a matching $M$ if $u\in e$ for some $e\in M$. For any $X\subseteq V(\cH)$, we say that a matching $M$ \textit{covers} $X$ if $M$ covers every vertex in $X$. For any integer $k \geq 0$ and a (multi-)hypergraph $\cH$, a map $\phi : \cH \to [k]$ is a \emph{proper edge-colouring} of $\cH$ if $\phi(e) \ne \phi(f)$ for any pair of distinct edges $e,f \in \cH$ such that $e \cap f \ne \varnothing$. For any integer $i$ and a proper edge-colouring $\phi : \cH \to [k]$, let $\phi^{-1}(i)$ be the set of edges $e \in \cH$ with $\phi(e) = i$. (Note that $\phi^{-1}(i)$ is a matching, for any $i$.) A (multi-)hypergraph $\cH$ is \emph{linear} if for any distinct $e,f \in \cH$, $|e \cap f| \leq 1$. A linear hypergraph may contain singleton edges (but no edge is repeated). A linear multi-hypergraph may contain multiple singleton edges incident to the same vertex but any edge of size at least two cannot be repeated (as that would contradict linearity). Given any linear multi-hypergraph $\cH$ on $n$ vertices, and any $W \subseteq \cH$, the \emph{normalised volume} of $W$ is defined as $\vol_\cH(W) \coloneqq \sum_{e\in W}\binom{|e|}{2} / \binom{n}{2}$. We sometimes omit the subscript and write $\vol(W)$ instead of $\vol_\cH(W)$ when it is clear from the context. Note that since $\cH$ is linear, $\vol_\cH(W) \le 1$ for any $W \subseteq \cH$. Given any graph $G$, for any subset of vertices $V' \subseteq V (G)$, we denote the subgraph of $G$ induced by $V'$ as $G[V'] \coloneqq (V', E')$, where $E' \coloneqq \{e \in E(G) : e \subseteq V' \}$. We write $G - V' \coloneqq G[V \setminus V']$. If $V' = \{v\}$, then we simply write $G - v$ instead of $G - \{v\}$. For any disjoint pair of subsets $S, T \subseteq V(G)$, let $E_G(S, T) := \{ st \in E(G) : s \in S, t \in T \}$, and let $e_G(S,T) \coloneqq |E_G(S, T)|$. Let $\overline{G} \coloneqq (V(G), \overline{E(G)})$ denote the complement of a graph $G$. For any non-negative integer functions $g,f : V(G) \to \mathbb{Z}$, a subset $F \subseteq E(G)$ is a \emph{$(g,f)$-factor} in $G$ if $g(w) \leq d_F(w) \leq f(w)$ for each $w \in V(G)$. \section{Overview} \label{sec:overview} In this section, we provide an overview of the proof of Theorem~\ref{main-thm}. \subsection{Colouring linear hypergraphs with bounded edge sizes}\label{subsection:small-edge-overview} Here, we discuss the proof of Theorem~\ref{main-thm} in the special case when all edges of $\cH$ have bounded size. In this subsection, we fix constants satisfying the hierarchy \begin{equation*} 0 < 1/n_0 \ll \xi \ll 1 / r \ll \gamma \ll \eps \ll \rho \ll 1, \end{equation*} we let $n \geq n_0$, and we let $\cH$ be an $n$-vertex linear hypergraph such that every $e\in \cH$ satisfies $2 \leq |e| \leq r$. We first describe the ideas which already lead to the near-optimal bound $\chi'(\cH) \leq n + 1$. Let $G$ be the graph with $V(G) \coloneqq V(\cH)$ and $E(G) \coloneqq \{e \in \cH : |e| = 2\}$. The first step of the proof is to include every edge of $G$ in a `reservoir' $R$ independently with probability $1/2$ that we will use for `absorption'. With high probability, each $v\in V(\cH)$ satisfies $d_{R}(v) = d_G(v)/2 \pm \xi n$. Since $\cH$ is linear, this easily implies that $\Delta(\cH\setminus R) \leq (1/2 + \xi)n$.\COMMENT{$d_{\cH \setminus R}(v) = d_{\cH \setminus G}(v)+ d_{G \setminus R}(v) \approx d_{\cH \setminus G}(v) + d_G(v)/2 = 1/2(d_G(v) + 2d_{\cH \setminus G}(v)) \leq n/2$.} So by the Pippenger-Spencer theorem~\cite{PippengerSpencer}, we obtain the nearly optimal bound $\chi'(\cH\setminus R) \leq (1/2 + \gamma)n$. Now using $R$ as a `vertex-absorber', we would like to extend the colour classes of $\cH \setminus R$ to cover as many vertices of $U$ as possible, where $U\coloneqq\{u\in V(\cH) : d_G(u) \geq (1 - \eps)n\}$. This would allow us to control the maximum degree in the hypergraph consisting of uncoloured edges, so that it can then be coloured with few colours. To that end, we need the following important definition. \begin{definition}[Perfect and nearly-perfect coverage] Let $\cH$ be a linear multi-hypergraph, let $\cN$ be a set of edge-disjoint matchings in $\cH$, and let $S \subseteq U \subseteq V(\cH)$. \begin{itemize} \item We say $\cN$ has \emph{perfect coverage} of $U$ if each $N \in \cN$ covers $U$. \item We say $\cN$ has \emph{nearly-perfect coverage of $U$ with defects in $S$} if \begin{enumerate}[(i)] \item each $u \in U$ is covered by at least $|\cN|-1$ matchings in $\cN$ and \item each $N \in \cN$ covers all but at most one vertex in $U$ such that $U \setminus V(N) \subseteq S$. \end{enumerate} \end{itemize} \end{definition} We will construct some $\cH'\subseteq \cH$ and a proper edge-colouring $\psi : \cH' \rightarrow C$ such that $\cH'\supseteq \cH\setminus R$, $|C| = (1/2 + \gamma)n$ and the set of colour classes $\{\psi^{-1}(c) : c\in C\}$ has nearly-perfect coverage of $U$ (with defects in $U$). Crucially, this means that $\cH\setminus \cH'$ is a graph and satisfies $\Delta(\cH \setminus \cH') \leq n - |C|$. (Indeed, every vertex $u\in U$ satisfies $d_\cH(u) \leq n - 1$ and is covered by all but at most one of the colour classes of $\psi$, and every vertex $v\notin U$ satisfies $d_{\cH \setminus \cH'}(v) \leq d_{R}(v) \leq ((1 - \eps)/2 + \xi)n < n - |C|$.) Therefore, Vizing's theorem~\cite{vizing1965} implies that $\chi'(\cH\setminus \cH') \leq \Delta(\cH\setminus \cH') + 1 \leq n - |C| + 1$, so altogether we have $\chi'(\cH) \leq \chi'(\cH') + \chi'(\cH\setminus \cH') \leq n + 1$, as claimed. To construct $\cH'$ and $\psi$ we iteratively apply the R\"{o}dl nibble to (the leftover of) $\cH \setminus R$ to successively construct large matchings $N_i$ which are then removed from $\cH \setminus R$ and form part of the colour classes of $\psi$. (The R\"odl nibble is applied implicitly via Corollary~\ref{cor:sparse_egj}, which guarantees a large matching in a suitable hypergraph.) Crucially, each matching $N_i$ exhibits pseudorandom properties, which allow us to use some edges of $R$ to extend $N_i$ into a matching $M_i$ (which will form a colour class of $\psi$) with nearly-perfect coverage of $U$, as desired. (This is why we apply the R\"odl nibble in our proof rather than the Pippenger-Spencer theorem.) Thus, $R$ acts as a `vertex-absorber' for $U \setminus V(N_i)$ and the final edge decomposition of the unused edges of $R$ into matchings is achieved by Vizing's theorem. (Actually, this only works if $\cH \setminus R$ is nearly regular, which is not necessarily the case. Thus, we first embed $\cH \setminus R$ in a suitable nearly regular hypergraph $\cH^*$ and prove that the respective matchings in $\cH^*$ have nearly-perfect coverage of $U$, which suffices for our purposes.) \begin{comment} Thus, the bulk of the proof is devoted to finding $\cH'$ and $\psi$. The details of this can be found in Sections~\ref{absorption-section} and~\ref{small-non-graph-section}, but the approach is roughly as follows. In Lemma~\ref{lem:pseudorandom_matching}, using a recent result of Ehard, Glock, and Joos~\cite{EGJ2020}, we show that in the $(1/2 + \gamma)n$-edge-colouring of $\cH\setminus R$ guaranteed by the Pippenger-Spencer theorem, every colour class satisfies some pseudorandom properties (see Definition~\ref{pseudorandom-matching-def}). In Section~\ref{absorption-section}, we show that with Hall's theorem, together with the pseudorandom properties of both the colour classes and the reservoir $R$, we can extend each colour class by adding a matching consisting of edges of $R$ so that it covers all but at most one vertex of $U$. (That is, the vertices of $U$ not covered by the colour class are `absorbed' by $R$). As we show in Lemmas~\ref{lem:nibble2} and~\ref{lem:leftover}, we can do this absorption for each colour class so that the resulting colour classes have nearly-perfect coverage of $U$, as desired. \tom{It's not really true because we add singleton edges. We could acknowledge that here, or clarify it later.} \end{comment} Let us now discuss how to improve the bound $\chi'(\cH) \leq n + 1$ to $\chi'(\cH) \leq n$. Let $S \coloneqq \{u \in U : d_G(u) < n - 1\}$, and note that if $\{\psi^{-1}(c) : c \in C\}$ has either perfect coverage of $U$, or nearly-perfect coverage of $U$ with defects in $S$, then $\Delta(\cH\setminus \cH') \leq n - 1 - |C|$. In this case, we may use the same argument as before with Vizing's theorem to obtain $\chi'(\cH) \leq n$. However, it is not always possible to find such a colouring. For example, if $\cH$ is a complete graph $K_n$ for odd $n$ (which is one of the extremal examples for Theorem~\ref{main-thm}), then $U = V(\cH)$ and $S = \varnothing$, so it is not possible for even a single colour class to have nearly-perfect coverage of $U$ with defects in $S$. However, we can adapt the above nibble-absorption-Vizing approach to work whenever $\cH$ is not `close' to $K_n$ in the following sense. \begin{comment} Nevertheless, if $\cH$ does not resemble this extremal example too closely, we can find such a colouring. To that end, we introduce the following definition. \tom{We could also move this to Section~\ref{reservoir-section}} \end{comment} \begin{definition}[$(\rho, \eps)$-full] \label{def:rho-eps-full} Let $\cH$ be an $n$-vertex linear hypergraph, and let $G$ be the graph with $V(G) \coloneqq V(\cH)$ and $E(G) \coloneqq \{e \in \cH : |e| = 2\}$. For $\eps, \rho \in (0, 1)$, $\cH$ is \textit{$(\rho,\eps)$-full} if \begin{itemize} \item $|\{u \in V(\cH) : d_G(u) \geq (1 - \eps)n\}| \geq (1 - 10 \eps) n$, and \item $|\{v \in V(\cH) : d_G(v) = n - 1\}| \geq (\rho-15\eps)n$. \end{itemize} \end{definition} \begin{comment} To prove the bound $\chi'(\cH) \leq n$, we must choose $R$ more carefully -- the details can be found in Section~\ref{reservoir-section}. Roughly speaking, we choose around half of the edges in $R$ from $E(G)$ randomly, independently and with probability $\rho / 2$, and we choose the other half deterministically so that every $v\in V(\cH)$ satisfies $d_R(v) \geq \rho d_G(v) - \xi n$ and moreover $d_R(v) \leq \rho(1 - \eps)n + \xi n$ if $v\notin U$. If $\cH$ is not $(\rho, \eps)$-full, then the argument proceeds as before, where $\{\psi^{-1}(c) : c \in C\}$ has either perfect coverage of $U$ or nearly-perfect coverage of $U$ with defects in $S$, but with $1/2$ replaced with $\rho$ or $1 - \rho$ where appropriate. Otherwise, as we show in Section~\ref{Delta-edge-col-section}, we may use a result of the third and fifth authors~\cite{KO2014} to show that $\chi'(\cH\setminus \cH') = \Delta(\cH\setminus \cH')$, which completes the proof. \end{comment} As mentioned above, when $\cH$ is not $(\rho, \eps)$-full we can adapt the nibble-absorption-Vizing approach to show that $\chi'(\cH) \leq n$ (with a reservoir of density $\rho$ rather than $1/2$). If $\cH$ is $(\rho, \eps)$-full then we will ensure that the leftover $\cH \setminus \cH' \subseteq R$ is a quasirandom almost regular graph (which involves a more careful choice of $R$ -- again it will have density close to $\rho$ rather than $1/2$ but now it consists of a `random' part and a `regularising' part). This allows us to apply a result \cite{GKO2016} on the overfull subgraph conjecture (see Corollary~\ref{cor:optcol}) which implies that $\chi'(\cH \setminus \cH') \leq \Delta(\cH \setminus \cH')$. (The result in \cite{GKO2016} is obtained as a straightforward consequence of the result in \cite{kuhn2013hamilton} that robustly expanding regular graphs have a Hamilton decomposition, and thus, a $1$-factorisation if they have even order.) \subsection{Colouring linear hypergraphs where all edges are large}\label{subsection:large-edge-overview} Now we discuss how to prove Theorems~\ref{main-thm} and~\ref{main-thm-2} when all edges of $\cH$ have size at least some large constant. In this step it is often very useful to consider the line graph $L(\cH)$ of $\cH$ and use the fact that $\chi(L(\cH)) = \chi'(\cH)$. In this subsection, we fix constants satisfying the hierarchy \begin{equation*} 0 < 1/n_0 \ll 1 / r \ll \sigma \ll \delta, \end{equation*} we let $n \geq n_0$, and we let $\cH$ be an $n$-vertex linear hypergraph such that every $e\in \cH$ satisfies $|e| > r$. Now we sketch a proof that $\chi'(\cH) \leq n$ for such $\cH$. If $\cH$ is a finite projective plane of order $k$, where $k^2 + k + 1 = n$, then the line graph $L(\cH)$ is a clique $K_n$. Thus, $\chi'(\cH) = \chi(L(\cH)) = n$, so the bound $\chi'(\cH) \leq n$ is best possible. Thus, we refer to the case where $\cH$ has approximately $n$ edges of size $(1 \pm \delta)\sqrt n$ as the `FPP-extremal' case. We also sketch how to prove the improved bound $\chi'(\cH) \leq (1 - \sigma)n$ if $\cH$ is not in the FPP-extremal case. As we discuss in the next subsection, we will need this result in the proof of Theorem~\ref{main-thm}. \begin{comment} First, in Section~\ref{fpp-extremal-section}, we consider the case when every $e\in\cH$ satisfies $|e| \geq (1 - \delta)\sqrt n$ separately. To prove $\chi'(\cH) \leq n$ in this case, we show that for $t \coloneqq e(\cH) - n$, there exist $e_1, \dots, e_t, f_1, \dots, f_t\in \cH$ such that $e_i$ and $f_i$ are disjoint for each $i \in [t]$. By assigning the same colour to $e_i$ and $f_i$ for each $i \in [t]$ and a distinct colour to the remaining edges, we obtain a proper edge-colouring using at most $n$ colours, as desired. \end{comment} Consider an ordering $\ordering$ of the edges $e_1, e_2, \dots, e_m$ of $\cH$ according to their size, i.e., $e_i \ordering e_j$ if $|e_i| > |e_j|$ for every $i, j \in [m]$. For an edge $e \in \cH$, let $\fwddeg_\cH(e)$ denote the number of edges in $\cH$ which intersect $e$ and precede $e$ in $\ordering$. Clearly, a greedy colouring following this size-monotone ordering achieves a bound of $\chi'(\cH) \leq \max_i \fwddeg_\cH(e_i) + 1$ (this bound was also used in~\cite{chang1988, kahn1992coloring}). Moreover, it is easy to see that if this greedy colouring algorithm fails to produce a colouring with at most $(1 - \sigma)n$ colours, i.e., if an edge $e$ satisfies $\fwddeg_\cH(e) \ge (1 - \sigma) n$, then almost all of the corresponding edges that intersect $e$ and precede $e$ must have size close to $|e|$. Surprisingly, if one allows some flexibility in the ordering (in particular, if we allow it to be size-monotone only up to some edge $e^*$ such that $\fwddeg_\cH(e^*) \geq (1 - \sigma)n$ while every edge $f$ with $e^*\ordering f$ satisfies $\fwddeg_\cH(f) < (1 - \sigma)n$), then one can show much more: Either we can modify the ordering to reduce the number of edges which come before $e^*$, or there is a set $W\subseteq \cH$ (where $e^*$ is the last edge of $W$) such that \begin{enumerate}[(W1)] \item\label{W1overview} $|e^*| \approx |e|$ for every $e \in W$, and \item\label{W2overview} the edges of $W$ cover almost all pairs of vertices of $\cH$. \end{enumerate} If $|e^*| \leq (1- \delta) \sqrt{n}$, then one can show that $L(W)$ induces a `locally sparse' graph (as $\cH$ is linear). Moreover,~\ref{W1overview} implies that the maximum degree of $L(W)$ is not too large, and thus one can show that $\chi(L(W))$ is much smaller than $(1 - \sigma)n$ (leaving enough room to colour the edges preceding $W$ with a new set of colours). This together with \ref{W2overview} allows us to extend the colouring of $W$ to all of $\cH$ using a suitable modification of the above greedy colouring procedure for the remaining edges in $\cH$ to obtain that $\chi'(\cH) \leq (1-\sigma)n$, as desired. If $|e^*| \geq (1- \delta) \sqrt{n}$, then we first colour the edges of size at least $(1- \delta) \sqrt{n}$ (in particular, the edges of $W$) as follows. Let $\cH' \subseteq \cH$ be the hypergraph consisting of these edges. If $e(\cH') \leq n$, then, of course, we may colour the edges of $\cH'$ with different colours. Otherwise, if $t \coloneqq e(\cH') - n > 0$, the main idea is to find a matching of size $t$ in the complement of $L(\cH')$ (where $L(\cH')$ will be close to being a clique of order not much more than $n$). By assigning the same colour to the edges of $\cH'$ that are adjacent in this matching, we obtain $\chi'(\cH') = \chi(L(\cH')) \leq n$. Now we extend the colouring to all of $\cH$ using a suitable modification of the above greedy colouring procedure again to obtain that $\chi'(\cH) \leq n$, as desired. \begin{comment} The rest of the details are in Section~\ref{large-edge-section}, but our strategy is as follows. We aim to find an ordering $\ordering$ of the edges of $\cH$ such that every $e\in \cH$ intersects at most $(1 - \sigma)n$ edges $f\in \cH$ such that $f\ordering e$, in which case we can colour $\cH$ greedily with at most $(1 - \sigma)n + 1$ colours using the ordering $\ordering$. To that end, we first order the edges of $\cH$ such that $e\ordering f$ if $|e| > |f|$, and then we attempt to ``fix'' each edge of $\cH$ recursively, starting with the last edge, by reordering some of the edges. To ``fix'' an edge $e^*$, if $e^*$ intersects at most $(1 - \sigma)n$ edges $f\in\cH$ such that $f\ordering e^*$, then we say $e^*$ is ``fixed'' and instead fix $e^*$'s predecessor (unless $e^*$ comes first, in which case we say every edge is fixed and stop the reordering). Otherwise, if there is an edge $f\in \cH$ that comes before $e^*$ and intersects $e$ \abhi{$e \to e^*$} and at most $(1 - \sigma)n$ edges of $\cH$ that come before $e$ \abhi{$e \to e^*$}, then we ``reorder'' by putting $f$ between $e^*$ and its successor and continue ``fixing'' $e^*$. Note that if $e^*$ is being fixed, then for every edge $e\in \cH$ which comes after $e^*$, $e$ intersects at most $(1 - \sigma)n$ edges which come before it, as desired. Thus, if every edge is fixed, then we have the desired ordering. A crucial ingredient in our proof, Lemma~\ref{reordering-lemma}, shows that, otherwise, if $e^*$ cannot be fixed, then there are many edges $W\subseteq \cH$ of size close to $|e^*|$, such that $(1 - \delta)\binom{n}{2}$ pairs of vertices of $\cH$ are contained in an edge of $W$. Thus, if $|e^*| \geq (1 - \delta)\sqrt n$, then we have the FPP-extremal case. Every edge $f\in\cH$ which comes before $e^*$ still satisfies $|f| \geq |e^*|$, so we colour the edges which come before $e^*$ as discussed previously, and the edges which come after $e^*$ can be coloured greedily with at most $n$ colours in the ordering provided by $\ordering$. Otherwise, we colour $\cH$ with at most $(1 - \sigma)n + 1$ colours, as follows. By the linearity of $\cH$, the edges of $W$ induce a `locally-sparse' line graph, so we use a result of Molloy and Reed~\cite{MR02} (Theorem~\ref{local-sparsity-lemma}) to colour them with $(999 + |e^*| / \sqrt n) n / 1000$ colours. Next, we use the remaining colours on the edges which come before $W$ by reapplying the fixing argument with $(1 - \sigma)$ replaced with $((1 - |e^*|/\sqrt n)/1000 - \sigma)$. Lemma~\ref{reordering-lemma} implies that this time, the process reaches the first edge, as otherwise there would be a set of edges disjoint from $W$ that together contain more than $\delta\binom{n}{2}$ pairs of the vertices of $\cH$, contradicting that $\cH$ is linear. Therefore, we can colour the edges which come before $W$ with at most $((1 - |e^*|/\sqrt n)/1000 - \sigma)n + 1$ colours, and we can extend the colouring to the edges which come after $W$ greedily in the ordering provided by $\ordering$. \end{comment} \subsection{Combining colourings of the large and small edges} We now describe how one can prove Theorem \ref{main-thm} by building on the ideas described in Sections \ref{subsection:small-edge-overview} and \ref{subsection:large-edge-overview}. In this subsection and throughout the rest of the paper we work with constants satisfying the following hierarchy: \begin{equation} 0< 1 / n_0 \ll 1/r_0 \ll \xi \ll 1 / r_1 \ll \beta \ll \kappa \ll \gamma_1 \ll \eps_1 \ll \rho_1 \ll \sigma \ll \delta \ll \gamma_2 \ll \rho_2 \ll \eps_2 \ll 1. \end{equation} Some of these constants are used to characterize the edges of a hypergraph by their size, as follows. \begin{definition}[Edge sizes]\label{def:edgesize} Let $\cH$ be an $n$-vertex linear hypergraph with $n \ge n_0$. \begin{itemize} \item Let $\cH_{\rm small} \coloneqq \{ e \in \cH \: : \: |e| \leq r_1 \}$. An edge $e\in \cH$ is \textit{small} if $e\in\cH_{\mathrm{small}}$. \item Let $\cH_{\rm med} \coloneqq \{ e \in \cH \: : \: r_1 < |e| \leq r_0 \}$. An edge $e\in\cH$ is \textit{medium} if $e\in\cH_{\mathrm{med}}$. \item Let $\cH_{\rm large} \coloneqq \{ e \in \cH \: : \: |e| > r_0 \}$. An edge $e\in \cH$ is \textit{large} if $e\in\cH_{\mathrm{large}}$. \item Let $\cH_{\mathrm{ex}} \coloneqq \{ e \in \cH \: : \: |e| = (1 \pm \delta)\sqrt n\}$. An edge $e\in\cH$ is \textit{FPP-extremal} if $e\in\cH_{\mathrm{ex}}$. \item Let $\cH_{\rm huge} \coloneqq \{ e \in \cH \: : \: |e| \geq \beta n / 4 \} $. An edge $e\in \cH$ is \textit{huge} if $e\in\cH_{\mathrm{huge}}$. \end{itemize} \end{definition} Note that $\cH_{\rm small}, \cH_{\rm med}, \cH_{\rm large}$ form a partition of the edges of $\cH$ (see Figure~\ref{fig:size}). Also note that if $\cH$ is an $n$-vertex linear hypergraph and $1/n \ll \alpha < 1$, then\COMMENT{Since $\cH$ is linear, if there are $k$ edges of size at least $\alpha n$, then $n \geq \sum_{i=1}^k\max\{\alpha n - i, 0\}$.} \begin{equation}\label{eqn:huge-edge-bound} |\{e \in \cH : |e| \geq \alpha n\}| \leq 2 / \alpha. \end{equation} \input{tex/edge-size-fig} In the proof of Theorem~\ref{main-thm}, given an $n$-vertex linear hypergraph $\cH$ with $n \ge n_0$ (where we assume $\cH$ has no singleton edges), we first find a proper edge-colouring $\psi_1 : \cH_{\mathrm{med}}\cup\cH_{\mathrm{large}} \rightarrow C_1$ as discussed in Section~\ref{subsection:large-edge-overview}, and then we extend it to a proper $n$-edge-colouring of $\cH_{\mathrm{small}}$ by adapting the argument presented in Section~\ref{subsection:small-edge-overview}. The proof proceeds slightly differently depending on whether we are in the FPP-extremal case. As discussed in the previous subsection, in the non-FPP-extremal case, $\chi'(\cH_{\mathrm{med}}\cup\cH_{\mathrm{large}}) \leq (1 - \sigma)n$, so we may assume $|C_1| = (1 - \sigma)n$. In this case, we let $\gamma \coloneqq \gamma_1$, $\eps \coloneqq \eps_1$, and $\rho \coloneqq \rho_1$; in the FPP-extremal case, we let $\gamma \coloneqq \gamma_2$, $\rho \coloneqq \rho_2$, and $\eps \coloneqq \eps_2$. We define $G$ and $U$ as in Section~\ref{subsection:small-edge-overview}, and we define a suitable `defect' set $S \subseteq U$ (whose choice now depends on the structure of $\cH$). In order to extend the colouring $\psi_1$ of $\cH_{\mathrm{med}}\cup\cH_{\mathrm{large}}$ to $\cH$, we need it to satisfy a few additional properties, which are provided by Theorem~\ref{large-edge-thm}. Roughly, we need that \begin{enumerate}[(1)] \item each colour class of $\psi_1$ covers at most $\beta n$ vertices, with exceptions for colour classes containing huge or medium edges, and \item at most $\gamma n$ colours are assigned by $\psi_1$ to colour medium edges. \end{enumerate} We choose a `reservoir' $R$ from $E(G)$; how we choose it depends on whether we are in the FPP-extremal case. In the non-FPP-extremal case, we choose it as described in Section~\ref{subsection:small-edge-overview}, and in the FPP-extremal case, we include every edge of $G$ incident to a vertex of $U$ to be in $R$ independently with probability $\rho$. Let $C_{\mathrm{hm}} \subseteq C_1$ be the set of colours assigned to a huge or medium edge by $\psi_1$. Note that $e(\cH_{\mathrm{huge}}) \leq 8/\beta$ by \eqref{eqn:huge-edge-bound}, so consequently, by (2), $|C_{\mathrm{hm}}| \leq 3\gamma n / 2$. For each $c\in C_{\mathrm{hm}}$, we use Lemma~\ref{huge-edge-absorption-lemma} to extend $\psi_1^{-1}(c)$ (in the sense of Section ~\ref{subsection:small-edge-overview}) using edges of $R$, so that $\{ \psi_1^{-1}(c) : c \in C_{\rm hm} \}$ has nearly perfect coverage of $U$ with defects in $S$. There is possibly an exceptional colour class, which we call \textit{difficult} (see Definition~\ref{defn:difficult}), that we need to consider in this step. This situation arises if $\cH$ is close to being a degenerate plane. If $\cH$ is the degenerate plane, then there is a huge edge $e$ of size $n - 1$, and $U$ consists of a single vertex of degree $n - 1$. Even though $\cH$ is not $(\rho, \eps)$-full, if $c$ is assigned to the edge $e$, it is clearly impossible to extend $\psi^{-1}(c)$ to have perfect coverage of $U$, which would be necessary in order to finish the colouring with Vizing's theorem in the final step. However, if there is a difficult colour class that we cannot absorb, then we show that we can colour $\cH$ directly (see Lemma~\ref{difficult-edge-absorption}). We now construct some $\cH'$ with $\cH_{\mathrm{small}}\setminus R \subseteq \cH' \subseteq \cH_{\mathrm{small}}$ and a proper edge-colouring $\psi_2 : \cH' \rightarrow C_2$ such that $\psi_2$ is compatible with $\psi_1$, $|C_2|$ is slightly larger than $(1 - \rho + \gamma)n$, $C_2 \cap C_{\rm hm} = \varnothing$, and $\{\psi^{-1}_1(c) \cup \psi^{-1}_2(c) : c \in C_{\rm hm} \cup C_2\}$ has nearly-perfect coverage of $U$ with defects in $S$. (Actually, as in Section~\ref{subsection:small-edge-overview} we obtain this coverage property only for a suitable auxiliary hypergraph $\cH^* \supseteq \cH'$, but we again ignore this here for simplicity.) In the non-FPP-extremal case, since $\rho = \rho_1 \ll \sigma$, this means we can reserve a set $C_{\rm final}$ of colours (of size close to $\rho n$) which are used neither by $\psi_1$ nor by $\psi_2$. Then in the final step of the proof, we can colour the leftover graph $\cH_{\mathrm{small}}\setminus \cH' \subseteq R$ (with colours from $C_{\rm final}$) as described in Section~\ref{subsection:small-edge-overview}. In the FPP-extremal case, we may have $|C_1| = n$, so we need to find a proper edge-colouring of $\cH_{\mathrm{small}}\setminus \cH'$ using colours from $C_1\setminus C_2$ while avoiding conflicts with $\psi_1$. But in this case most pairs of vertices are contained in an edge of $\cH_{\mathrm{ex}}$, which implies that $|U|$ is small. Moreover, every edge of the leftover graph $\cH_{\mathrm{small}}\setminus \cH' \subseteq R$ is incident to a vertex of $U$. These two properties allow us to colour the leftover graph $\cH_{\mathrm{small}}\setminus \cH'$ with $\Delta(\cH_{\mathrm{small}}\setminus \cH')$ colours while using (1) and (2) to avoid conflicts with $\psi_1$, as desired. \begin{comment} and since every edge of $R$ has an end in $U$, we can conclude that $U$ is a dominating set of $\cH_{\mathrm{small}}\setminus \cH'$ that is much smaller than $|C_1\setminus C_2|$. Thus, as we show in Lemma~\ref{hall-based-finishing-lemma}, we can finish the colouring in a fairly straightforward way, by colouring the edges incident to each vertex in $U$ in turn. \end{comment} We conclude by discussing how to construct $\cH'$ and $\psi_2$. Using the colours in $C_2$, we colour all of the edges of $\cH_{\mathrm{small}}\setminus R$ and some of the remaining uncoloured (by $\psi_1$) edges of $R$ based on the nibble and the absorption strategy outlined in Section~\ref{subsection:small-edge-overview}. For this, the following properties are crucial (which follow from (1) and the definition of $\cH_{\rm med}$ respectively). \begin{itemize} \item[(a)] $\psi_1^{-1}(c)$ covers at most $\beta n$ vertices for each $c\in C_2$, and \item[(b)] every vertex $v\in V(\cH)$ is contained in at most $n / (r_0-1)$ edges that are assigned a colour in $C_2$ by $\psi_1$ (since for any $c \in C_2$, either $\psi_1^{-1}(c)$ is empty or all the edges in $\psi_1^{-1}(c)$ are large). Thus, each edge in $\cH_{\rm small}$ still has slightly more than $(1 - \rho)n$ colours available in $C_2$ that do not conflict with $\psi_1$ (since any edge of $\cH_{\rm small}$ intersects at most $r_1 n/(r_0-1)$ large edges and $r_1/(r_0-1) \ll \gamma$). \end{itemize} We will use (a) and (b) to show that the effect of the previously coloured edges (by $\psi_1$) on the R\"odl nibble argument is negligible, i.e., we can adapt the arguments of Section \ref{subsection:small-edge-overview}, so that the colouring $\psi_2$ of $\cH'$ is compatible with $\psi_1$. \subsection{Organisation of the paper} In Section~\ref{notation-section}, we introduce some notation that we use throughout the paper, and in Section~\ref{preliminary-section} we collect some tools that we use in the proof. In Section~\ref{fpp-extremal-section} we prove Theorem~\ref{main-thm} for hypergraphs where every edge has size at least $(1 - \delta)\sqrt n$, and in Section~\ref{large-edge-section}, we prove Theorem~\ref{large-edge-thm}, which we use to colour the large and medium edges of our hypergraph. In Section~\ref{large-edge-section}, we also prove Theorems~\ref{main-thm-2} and~\ref{weak-stability-thm}. (In particular, Theorems~\ref{main-thm-2} and~\ref{weak-stability-thm} do not rely on the subsequent sections.) In Section~\ref{absorption-section}, we prove several lemmas that we use for vertex absorption, and in Section~\ref{small-non-graph-section}, we show how to combine the results of Section~\ref{absorption-section} with hypergraph matching results (based on the R\"odl nibble) to colour the small edges of our hypergraph not in the reservoir. In Section~\ref{graph-edge-section}, we prove Lemma~\ref{hall-based-finishing-lemma} and introduce Corollary~\ref{cor:optcol}, both of which are used in the final step of the proof to colour the uncoloured reservoir edges. In Section~\ref{reservoir-section} we show how we select the reservoir edges, and finally in Section~\ref{proof-section}, we prove Theorem~\ref{main-thm}. \begin{comment} \section{Overview 2} In this section, we provide an overview of the proof of Theorem~\ref{main-thm} and outline the paper. Throughout the paper we work with constants satisfying the following hierarchy: \begin{equation} 0< 1 / n_0 \ll 1/r_0 \ll \xi \ll 1 / r_1 \ll \beta \ll \kappa \ll \gamma_1 \ll \eps_1 \ll \rho_1 \ll \sigma \ll \delta \ll \gamma_2 \ll \rho_2 \ll \eps_2 \ll 1. \end{equation} Some of these constants are used to characterize the edges of a hypergraph by their size, as follows. \begin{definition}[Edge sizes]\label{def:edgesize} Let $\cH$ be an $n$-vertex linear hypergraph. We characterize edges based on their size, and we also define five spanning subhypergraphs $\cH_{\rm small}$, $\cH_{\rm med}$, $\cH_{\rm large}$, $\cH_{\mathrm{ex}}$, and $\cH_{\mathrm{huge}}$, such that the first three partition $\cH$, as follows (see Figure~\ref{fig:size}). \begin{itemize} \item Let $\cH_{\rm med} \coloneqq \{ e \in \cH \: : \: r_1 < |e| \leq r_0 \}$. An edge $e\in\cH$ is \textit{medium} if $e\in\cH_{\mathrm{med}}$. \item Let $\cH_{\rm small} \coloneqq \{ e \in \cH \: : \: |e| \leq r_1 \}$. An edge $e\in \cH$ is \textit{small} if $e\in\cH_{\mathrm{small}}$. \item Let $\cH_{\rm large} \coloneqq \{ e \in \cH \: : \: |e| > r_0 \}$. An edge $e\in \cH$ is \textit{large} if $e\in\cH_{\mathrm{large}}$. \item Let $\cH_{\mathrm{ex}} \coloneqq \{ e \in \cH \: : \: |e| = (1 \pm \delta)\sqrt n\}$. An edge $e\in\cH$ is \textit{FPP-extremal} if $e\in\cH_{\mathrm{ex}}$. \item Let $\cH_{\rm huge} \coloneqq \{ e \in \cH \: : \: |e| \geq \beta n / 4 \} $. An edge $e\in \cH$ is \textit{huge} if $e\in\cH_{\mathrm{huge}}$. \end{itemize} \end{definition} \input{tex/edge-size-fig} In the proof of Theorem~\ref{main-thm}, given an $n$-vertex linear hypergraph $\cH$, we first find a proper $n$-edge-colouring of $\cH_{\mathrm{med}}\cup\cH_{\mathrm{large}}$ as discussed in Section~\ref{subsection:large-edge-overview}, then we extend it to a proper $n$-edge-colouring of $\cH_{\mathrm{small}}$ by adapting the argument presented in Section~\ref{subsection:small-edge-overview}. It is instructive to first discuss a simplified version of each of these steps. Namely, we sketch a proof that $\chi'(\cH_{\mathrm{med}}\cup \cH_{\mathrm{large}}) \leq n$ and also $\chi'(\cH_{\mathrm{small}}) \leq n$. We remark that both of these results are new. The former is provided in Section~\ref{subsection:large-edge-overview}, and the latter is provided in Section~\ref{subsection:small-edge-overview}. In Section~\ref{subsection:combining}, we discuss how to strengthen and combine these results to obtain Theorem~\ref{main-thm}. \subsection{Colouring large edges}\label{subsection:large-edge-overview} \subsection{Colouring small edges}\label{subsection:small-edge-overview} \begin{definition}[Perfect and nearly-perfect coverage] Let $\cH$ be a linear multi-hypergraph, let $\cN$ be a set of edge-disjoint matchings in $\cH$, and let $S \subseteq U \subseteq V(\cH)$. \begin{itemize} \item We say $\cN$ has \emph{perfect coverage} of $U$ if each $N \in \cN$ covers $U$. \item We say $\cN$ has \emph{nearly-perfect coverage of $U$ with defects in $S$} if \begin{enumerate}[(i)] \item each $u \in U$ is covered by at least $|\cN|-1$ matchings in $\cN$ and \item each $N \in \cN$ covers all but at most one vertex in $U$ such that $U \setminus V(N) \subseteq S$. \end{enumerate} \end{itemize} \end{definition} Idea of absorption/reservoir -- vertices in $U$ are covered by basically every color class. \subsection{Combining a colouring of small, medium, and large edges}\label{subsection:combining} Note that if $\cH$ is an $n$-vertex linear hypergraph and $1/n \ll \alpha < 1$, then \COMMENT{Since $\cH$ is linear, if there are $k$ edges of size at least $\alpha n$, then $n \geq \sum_{i=1}^k\max\{\alpha n - i, 0\}$.} \begin{equation}\label{eqn:huge-edge-bound} |\{e \in \cH : |e| \geq \alpha n\}| \leq 2 / \alpha. \end{equation} In particular, if $n\geq n_0$, then $e(\cH_{\mathrm{huge}}) \leq 8/\beta$. \begin{definition} For an $n$-vertex linear hypergraph $\cH$ and $G := \cH^{(2)}$, the hypergraph $\cH$ is \textit{$(\rho,\eps)$-full} if \begin{enumerate}[(i)] \item $|V(\cH) \setminus V^{(1 - \eps)}_+(G)| \leq 10 \eps n$ and \item $|V^{(n - 1)}(G)| \geq (\rho-15\eps)n$. \end{enumerate} \end{definition} Let $i = 1$ for Type A and $i = 2$ otherwise, and let $\gamma \coloneqq \gamma_i$, $\rho = \rho_i$, and $\eps = \eps_i$. \begin{itemize} \item Let $U$ be the set of vertices of degree at least $(1 - \eps)n$. \item Reserve $\rho d_G(v)$ edges at $v$. \end{itemize} \begin{enumerate} \item Color large and medium edges first. Use Theorem~\ref{large-edge-thm} in Section~\ref{large-edge-section}. \item Using $(1 - \rho + 2\gamma)n$ colors, color all non-reservoir edges, absorbing each color class. \item What remains is a graph, and crucially \begin{itemize} \item max degree vertices are all in $U$ and \item number of `remaining' colors is at least the max degree of $U$ because of absorption. \end{itemize} Decompose differently in extremal and non-extremal case in Section~\ref{graph-edge-section}. \begin{enumerate}[(a)] \item In the extremal case, we have $|U| \leq \delta n$, because if large and medium edges require most of the colors, then Theorem~\ref{large-edge-thm} ensures a large volume set of large edges, so $U$ is small or else there's too much total volume. Use ad hoc Hall-based argument in Lemma~\ref{hall-based-finishing-lemma} applied to edges incident to $U$. \item In the non-extremal case, we will use colors not used on large and medium edges, so we can basically just use Vizing's, but do more work to go from $n + 1$ to $n$. Example -- giant edge with $|U|$ odd and conisting of full degree vertices. \end{enumerate} \end{enumerate} \end{comment} \section{Preliminaries}\label{preliminary-section} We often use the following weighted version of Chernoff's inequality. \begin{theorem}[Weighted Chernoff's inequality~\cite{CL2002}]\label{thm:chernoff} Let $c_1 , \dots , c_m > 0$ be real numbers, let $X_1 , \dots , X_m$ be independent random variables taking values $0$ or $1$, let $X \coloneqq \sum_{i=1}^{m} c_i X_i$ and let $C \coloneqq \max_{i \in [m]} c_i$. Then, \begin{equation*} \mathbb{P}(|X - \mathbb{E}(X)| \geq t) \leq 2 e^{\frac{-t^2}{2C(\mathbb{E}[X] + t/3)}}. \end{equation*} \end{theorem} \begin{comment} Let $X_1, X_2, \ldots, X_m$ be independent random variables taking values in $\Omega$ and let $f : \Omega^m \to \mathbb{R}$. If for all $i \in [m]$ and $x_1, x_2, \ldots, x_m, x'_i \in \Omega$, we have $$ |f(x_1, \ldots, x_i, \ldots, x_m) - f(x_1, \ldots, x'_i, \ldots, x_m)| \le c_i,$$ then we say $X_i$ \textit{affects} $f$ by at most $c_i$. If $c_i = 0$, then we say $X_i$ \textit{does not affect} $f$. \begin{theorem}[McDiarmid's inequality]\label{thm:mcdiarmid} Let $X_1 , \dots , X_m$ be independent random variables taking values in $\Omega$, and $f : \Omega^m \to \mathbb{R}$ is such that $X_i$ affects $f$ by at most $c_i$ for all $i \in [m]$, then for all $t > 0$, \begin{equation*} \mathbb{P}(|f(X_1, X_2, \ldots, X_m) - \mathbb{E}[f(X_1, X_2, \ldots, X_m)]| \geq t) \leq 2 \exp \left (-\frac{2t^2}{\sum_{i=1}^{m}c_i^2 } \right ). \end{equation*} \end{theorem} \end{comment} \subsection{Pseudorandom hypergraph matchings} Now we state a special case of a recent result of Ehard, Glock, and Joos~\cite{EGJ2020} that provides a matching covering almost all vertices of every set in a given collection of sets. This result will be used in the proof of Lemma~\ref{lem:pseudorandom_matching}. A similar result, but with weaker bounds, was proved earlier by Alon and Yuster~\cite{AY2005}. The proof in~\cite{EGJ2020} is derived via an averaging argument from a result on the chromatic index of hypergraphs by Molloy and Reed~\cite{MR2000}, which in turn relies on the R\"{o}dl nibble. \begin{theorem}[Ehard, Glock, and Joos~\cite{EGJ2020}]\label{thm:egj} Let $r \geq 2$ be an integer, and let $\varepsilon \coloneqq 1/(1500r^2)$. There exists $\Delta_0$ such that the following holds for all $\Delta \geq \Delta_0$. Let $\cH$ be an $r$-uniform linear hypergraph with $\Delta(\cH) \leq \Delta$ and $e(\cH) \leq \exp(\Delta^{\eps^2})$. Let $\cF^*$ be a set of subsets of $V(\cH)$ such that $|\cF^*| \leq \exp(\Delta^{\varepsilon^2})$ and $\sum_{v \in S}d_\cH(v) \geq \Delta^{26/25}$ for any $S \in \cF^*$. Then, there exists a matching $M_0$ in $\cH$ such that for any $S \in \cF^*$, we have $|S \cap V(M_0)| = (1 \pm \Delta^{-\varepsilon^2})\sum_{v \in S}d_\cH(v)/\Delta$. \end{theorem} We remark that Theorem~\ref{thm:egj} is a direct application of~\cite[Theorem 1.2]{EGJ2020} by setting $\delta \coloneqq 1/30$ and the weight functions $w_S (e) := |S \cap e|$ for $S \in \cF^*$, where $w_S( \cH ) \geq \max_{e \in \cH}w_S(e) \Delta^{1+\delta}$ follows by the assumption $\sum_{v \in S}d_\cH(v) \geq \Delta^{26/25}$, since $w_S(\cH) = \sum_{v \in S}d_\cH(v)$ and $w_S(e) \leq r$ for any $e \in \cH$.\COMMENT{\cite[Theorem 1.2]{EGJ2020} is stated as follows. {\bf Theorem}. Suppose $\delta \in (0,1)$ and $r \in \mathbb{N}$ with $r \geq 2$, and let $\eps \coloneqq \delta/50r^2$. Then there exists $\Delta_0$ such that for all $\Delta \geq \Delta_0$, the following holds: Let $\cH$ be an $r$-uniform hypergraph with $\Delta(\cH) \leq \Delta$ and $\Delta^c (\cH) \leq \Delta^{1-\delta}$ as well as $e(\cH) \leq \exp(\Delta^{\eps^2})$. Suppose that $\cF$ is a set of at most $\exp(\Delta^{\eps^2})$ weight functions on $\cH$. Then, there exists a matching $M$ in $\cH$ such that $\omega(M) = (1 \pm \Delta^{-\eps})\omega(\cH)/\Delta$ for all $\omega \in \cF$ with $\omega(\cH) \geq \max_{e \in \cH}w(e) \Delta^{1+\delta}$.\\ Indeed, then it is clear (from the assumption of Theorem~\ref{thm:egj}) that $w_S(\cH) = \sum_{v \in S}d_\cH(v) \geq \Delta^{26/25} \geq r \Delta^{31/30} \geq \max_{e \in \cH}w_S(e) \Delta^{1+\delta}$. Hence, we can apply the above theorem to obtain a matching $M_0$ in $\cH$ such that $w_S(M_0) = |S \cap V(M_0)| = (1 \pm \Delta^{-\eps})w_S(\cH)/\Delta = (1 \pm \Delta^{-\eps})\sum_{v \in S}d_\cH(v)/\Delta$, showing that Theorem~\ref{thm:egj} holds.} Our vertex absorption arguments will actually require that the number of uncovered vertices in $S$ is small but not too small.\COMMENT{Note that Theorem~\ref{thm:egj} may imply that $|S \setminus V(M_0)| = 0$, which is bad for us} So we need the following `sparsified' version of Theorem~\ref{thm:egj}, which allows us to have better control on the number of uncovered vertices. To deduce Corollary~\ref{cor:sparse_egj} from Theorem~\ref{thm:egj}, one simply applies Theorem~\ref{thm:egj} to obtain a matching $M_0$ (in $\cH$) and then we randomly remove each edge of $M_0$ with probability $\gamma$ to obtain a matching $M$ which satisfies the assertion of Corollary~\ref{cor:sparse_egj} with positive probability. We remark that one could also derive Corollary~\ref{cor:sparse_egj} via a direct application of the R\"{o}dl nibble (see~\cite{KKMO2020} for a proof of a stronger result based on stronger assumptions). \begin{corollary}\label{cor:sparse_egj} Let $0 < 1 / n_0 \ll 1 / r, \kappa , \gamma < 1$. For any integer $n \geq n_0$, let $\cH$ be an $r$-uniform linear $n$-vertex hypergraph such that every vertex has degree $(1 \pm \kappa)D$, where $D \geq n^{1/100}$. Let $\mathcal{F}$ be a set of subsets of $V(\cH)$ such that $|\mathcal{F}| \le n^{2 \log n}$. Then there exists a matching $M$ of $\cH$ such that for any $S \in \cF$ with $|S| \geq D^{1/20}$, we have $|S \setminus V(M)| = (\gamma \pm 4 \kappa)|S|$. \end{corollary} \COMMENT{\begin{proof} Let $\eps := 1/(1500r^2)$ and $\cF^* \subseteq \cF$ be the collection of all $S \in \cF$ with $|S| \geq D^{1/20}$. Then we have $\sum_{v \in S} d_\cH(v) \geq (1 - \kappa)D|S| \geq D^{26/25}$ as $|S| \geq D^{1/20}$. Then applying Theorem~\ref{thm:egj} with $\Delta \coloneqq (1+\kappa)D$, we obtain a matching $M_0$ in $\cH$ such that for all $S \in \mathcal{F^*}$, \begin{equation}\label{eqn:s_uncov} |S \cap V(M_0)| \geq (1 - \Delta^{-\varepsilon^2}) \frac{\sum_{v \in S} d_\cH(v)}{\Delta} \geq (1 - D^{-\varepsilon^2}) \frac{1-\kappa}{1+\kappa} |S| \geq (1-3\kappa)|S|. \end{equation} Now let $M$ be a matching obtained from $M_0$ by removing each $e \in M_0$ with probability $\gamma$. Let us fix $S \in \mathcal{F}^*$, and let $q \coloneqq |S \setminus V(M_0)| \overset{\eqref{eqn:s_uncov}}{\leq} 3\kappa|S|$. Let $Y_S \coloneqq |S \setminus V(M)| - q = \sum_{e \in M_0} |e \cap S| {\bf 1}_{e \notin M}$. By the linearity of expectation, \begin{equation}\label{eqn:expected_ys} \mathbb{E}[Y_S] = \sum_{e \in M_0} \gamma |e \cap S| = \gamma |S \cap V(M_0)| = \gamma (|S| - q). \end{equation} Since $Y_S$ is the weighted sum of independent random indicators with maximum weight at most $r$, by Theorem~\ref{thm:chernoff}, we have \begin{equation*} \mathbb{P} (|Y_S - \mathbb{E}[Y_S]| \geq \kappa |S|) \leq 2 \exp \left ( -\frac{ \kappa^2 |S|^2}{2 r (\gamma |S| + \kappa|S|/3)} \right ) \leq 2 \exp \left ( - r^{-1} \kappa^2 n^{1/2000} / 4 \right ), \end{equation*} since $|S| \geq D^{1/20} \geq n^{1/2000}$. Then with probability at least $1 - \exp \left ( - n^{1/4000} \right )$, $Y_S = \mathbb{E}[Y_S] \pm \kappa |S|$, so by~\eqref{eqn:expected_ys} we have $|S \setminus V(M)| = q + Y_S = q + \gamma(|S|-q) \pm \kappa |S| = (\gamma \pm 4\kappa)|S|$, since $q \leq 3 \kappa |S|$. As $|\cF^*| \leq |\cF| \leq n^{2 \log n}$, by the union bound, $|S \setminus V(M)| = (\gamma \pm 4\kappa)|S|$ holds for all $S \in \cF^*$, with positive probability.\COMMENT{at least \begin{equation*} 1 - 2 |\cF^*|\exp \left (-2r^{-2} \kappa^2 n^{1/2000} \right ) \geq 1 - 2 \exp \left ( 2 \log^2 n - 2r^{-2} \kappa^2 n^{1/2000} \right ) > 0, \end{equation*}} Fixing such a matching $M$ completes the proof. \end{proof}} \begin{comment} \subsection{Lov\'asz's $(g,f)$-factor theorem} For a graph $G$, let $g$ and $f$ be a nonnegative integral function on $V(G)$. A subset $F \subseteq E(G)$ is a \emph{$(g,f)$-factor} if $g(v) \leq d_F(v) \leq f(v)$ for any $v \in V(F)$. \begin{theorem}[Lov\'asz~\cite{lovasz1970}]\label{thm:factor} Let $G$ be a graph and let $g$ and $f$ be nonnegative integer-valued functions on $V(G)$ such that $g \leq f$. Suppose that for any disjoint $S,T \subseteq V(G)$, we have \begin{equation*} \sum_{t \in T}(d_G(t) - g(t)) + \sum_{s \in S}f(s) - e_G(S,T) - \tau(S,T) \geq 0, \end{equation*} where $\tau(S,T)$ is the number of components $C$ in $G-S-T$ such that $f(c)=g(c)$ for any $c \in V(C)$ and $e_G(T,V(C)) + \sum_{c \in V(C)}f(c)$ is odd. Then $G$ has a $(g,f)$-factor. \end{theorem} In particular, if $g(v) < f(v)$ for all $v \in V(G)$, we have $\tau(S,T) = 0$ for any disjoint $S,T \subseteq V(G)$, which yields the following. \begin{corollary}\label{cor:factor} Let $G$ be a graph and let $g$ and $f$ be nonnegative integer-valued functions on $V(G)$. If \begin{itemize} \item[$(\rm 1)$] $g(v) < f(v)$ for any $v \in V(G)$, and \item[$(\rm 2)$] $\sum_{t \in T}(d_G(t) - g(t)) + \sum_{s \in S}f(s) - e_G(S,T)\geq 0$ for any two disjoint $S,T \subseteq V(G)$, \end{itemize} then $G$ has a $(g,f)$-factor. \end{corollary} \end{comment} \subsection{Embedding lemma} The following lemma allows us to embed any linear hypergraph $\cH$ with maximum degree $D$ into an almost regular, uniform, linear hypergraph $\cH_{\rm unif}$ with maximum degree $D$, satisfying some additional properties. \begin{lemma}\label{lem:embed} Let $0 < 1/N_0, 1/D_0, 1/C_0 \ll 1/r \leq 1/3$, where $r\in\mathbb N$. Let $N \geq N_0$, let $C \geq C_0$, let $D \geq D_0$, and let $\cH$ be an $N$-vertex linear multi-hypergraph with $\Delta(\cH) \leq D$. If every $e\in\cH$ satisfies $|e| \leq r$, then there exists an $r$-uniform linear hypergraph $\cH_{\rm unif}$ such that the following hold. \begin{itemize} \item[\mylabel{E1}{(\ref{lem:embed}.1)}] $\cH \subseteq \cH_{\rm unif}|_{V(\cH)}$ and $\cH_{\rm unif}|_{V(\cH)} \setminus \cH$ only contains singleton edges. \item[\mylabel{E2}{(\ref{lem:embed}.2)}]For any $v \in V(\cH_{\rm unif})$, $D-C \leq d_{\cH_{\rm unif}}(v) \leq D$. Moreover, if $d_{\cH}(v) \geq D-C$ for $v \in V(\cH)$, then $d_{\cH_{\rm unif}}(v) = d_{\cH}(v)$. \item[\mylabel{E3}{(\ref{lem:embed}.3)}] $v(\cH_{\rm unif}) \leq r(r-1)^2 D^3 N$. \end{itemize} \end{lemma} The proof of Lemma~\ref{lem:embed} is a straightforward modification of the proof of~\cite[Lemma 8.1]{KKMO2020}. Here we briefly sketch the proof. First, let $\cH^*$ be an $r$-uniform linear hypergraph obtained from $\cH$ by adding $r - |e|$ new vertices to each $e \in \cH$. Let $T \coloneqq (r-1)^2 D^2$. For every (sufficiently large) integer $d \le D$, by considering Steiner systems, one can easily construct a linear $T$-vertex $r$-uniform hypergraph $\cH_d$ such that every vertex of $\cH_d$ has degree between $d-c_r$ and $d$ for some constant $c_r$ depending on $r$. We define our desired multi-hypergraph $\cH_{\rm unif}$ by taking the union of $T$ vertex-disjoint copies of $\cH^*$, where the first copy is identified with $\cH^*$. Then, for each $v \in V(\cH^*)$ with $d_{\cH^*}(v) < D - C$, let $v^1 , \dots , v^T$ be the $T$ clone vertices of $v \in V(\cH^*)$ in $\cH_{\rm unif}$, and extend $\cH_{\rm unif}$ by making $\cH_{\rm unif}[\{v^1 , \dots , v^T\}]$ induce a copy of $\cH_{D - d_{\cH^*}(v)}$, which implies that $D - c_r \leq d_{\cH_{\rm unif}}(v^i) \leq D$ for $1 \le i \le T$.\COMMENT{Moreover, if $v^1 , \dots , v^T$ are the $T$ clone vertices of some vertex $v \in V(\cH^*)$ with $d_{\cH^*}(v) \geq D - C$, then $d_{\cH_{\rm unif}}(v^i) = d_{\cH^*}(v)$ for $1 \le i \le T$. One can then check that the lemma follows by taking $C_0$ sufficiently large, since $C \ge C_0$.} \subsection{Some colouring results} We use Vizing's theorem~\cite{vizing1965} in the final step of our proof when $\cH$ is not $(\rho, \eps)$-full in the non-FPP-extremal case. We also use the following stronger form in Lemma~\ref{difficult-edge-absorption}. \begin{theorem}[Vizing~\cite{vizing1965}]\label{thm:vizing} Every graph $G$ with $\Delta(G) \leq D$ satisfies $\chi'(G) \leq D + 1$. Moreover, if $G$ contains at most two vertices of degree $D$, then $\chi'(G) \leq D$. \end{theorem} The following theorem is used as one of the ingredients to prove Theorems~\ref{main-thm-2} and~\ref{weak-stability-thm} in Section~\ref{large-edge-section}, as well as in Section~\ref{small-non-graph-section} to colour a small `leftover' part in Lemma~\ref{lem:leftover}. \begin{theorem}[Kahn~\cite{kahn1996asymptotically}]\label{thm:kahn} Let $0 < {1}/{D_0} \ll \alpha, {1}/{r} < 1$, and let $D \geq D_0$. Let $\cH$ be a linear hypergraph such that $\Delta(\cH) \leq D$, and every $e\in\cH$ satisfies $|e| \leq r$. Let $C$ be a set with $|C| \geq (1+\alpha)D$, and for each $e \in \cH$, let $C(e) \subseteq C$ and $|C(e)| \leq \alpha D / 2$. Then there exists a proper edge-colouring $\phi : \cH \to C$ such that $\phi(e) \notin C(e)$ for each $e \in \cH$. \end{theorem} Theorem~\ref{thm:kahn} immediately follows from ~\cite[Theorem 1.1]{kahn1996asymptotically} by defining a list $S(e) \coloneqq C \setminus C(e)$ of available colours for each $e \in \cH$.\COMMENT{The original statement of Kahn~\cite[Theorem 1.1]{kahn1996asymptotically} is stated as follows: If $\cH$ is a hypergraph $\cH$ with $\Delta(\cH) \leq D$, $|e| \leq r$ for a fixed $r$, and $\Delta^c (\cH) = o(D)$, then $\chi_\ell'(\cH) = D + o(D)$, where $o(D)$ tends to 0 as $D \to \infty$. This implies the following: for any $r \in \mathbb{N}$ and $\alpha > 0$, there exists $D_0 = D_0(\alpha , r)$ such that for any $D \geq D_0$ and linear hypergraph $\cH$ with $\Delta(\cH) \leq D$ and $|e| \leq r$ for any $e \in \cH$, $\chi_\ell'(\cH) \leq (1+\alpha)D$.} \section{Constructing reservoirs}\label{reservoir-section} In this section, we construct a set $R_{\rm res} \subseteq E(G)$ called a \emph{reservoir} with several pseudorandom properties. \begin{definition}[Pseudorandom / Regularising reservoirs]\label{def:pseudoreg} Let $\varepsilon , \rho , \xi \in (0,1)$, let $\cH$ be an $n$-vertex linear hypergraph, let $G \coloneqq \cH^{(2)}$, let $G'$ be the spanning subgraph consisting of the edges of $G$ with at least one vertex in $V_+^{(1 - \eps)}(G)$, and let $\cV$ be a set of subsets of $V(\cH)$. \begin{itemize} \item A subset $R_{\rm res} \subseteq E(G)$ is a \textit{$(\rho, \xi, \eps , \cV)$-pseudorandom reservoir} if \begin{enumerate} \item[\mylabel{P1}{(\rm P1)}] for each $v \in V(\cH)$, $d_{R_{\rm res}}(v) = \rho d_G(v) \pm \xi n$, and \item[\mylabel{P2}{(\rm P2)}] $R_{\rm res} \cap E(G')$ is a $(\rho, \xi, \xi , \eps)$-absorber for $\cV$. \end{enumerate} \item Suppose $R_{\rm abs}$ is a $(\rho/2,\xi,\xi,\eps)$-absorber for $\cV$. A set $R_{\mathrm{reg}} \subseteq E(G) \setminus R_{\rm abs}$ is a \textit{$(\rho, \xi, \eps , R_{\rm abs} , \cV)$-regularising reservoir} if $R_{\rm res} \coloneqq R_{\mathrm{abs}} \cup R_{\mathrm{reg}}$ satisfies the following. \begin{enumerate} \item[\mylabel{R1}{(\rm R1)}] For each $v \in V_+^{(1-\eps)}(G)$, $d_{R_{\rm res}}(v) = \rho d_G(v) \pm \xi n$, and \item[\mylabel{R2}{(\rm R2)}] for any $w\in V(\cH)\setminus V_+^{(1-\eps)}(G)$, $\max(\rho d_G(w),(\rho - 20 \varepsilon) n) \leq d_{R_{\rm res}}(w) \leq \rho(1-\varepsilon)n + \xi n.$ \end{enumerate} \end{itemize} \end{definition} Now we define various types of reservoirs. The type of reservoir we choose to use will depend on the structure of the hypergraph $\cH$. \begin{definition}[Types of reservoirs] Let $\varepsilon , \rho , \xi \in (0,1)$, let $\cH$ be an $n$-vertex linear hypergraph, let $G \coloneqq \cH^{(2)}$, and let $G'$ be the spanning subgraph consisting of the edges of $G$ that are incident to a vertex in $V_+^{(1-\eps)}(G)$. For a collection $\cV$ of subsets of $V(\cH)$, and $R_{\rm res} \subseteq E(G)$, we say $R_{\rm res}$ is \begin{itemize} \item a \emph{$(\rho, \xi, \eps,\cV)$-reservoir of Type $\rm A_1$} if $R_{\rm res}$ is a $(\rho, \xi, \eps,\cV)$-pseudorandom reservoir, \item a \emph{$(\rho, \xi , \eps,\cV)$-reservoir of Type $\rm A_2$} if $R_{\rm res} = R_{\rm abs} \cup R_{\rm reg}$, where \begin{itemize} \item[$\circ$] $R_{\rm abs}$ is a $(\rho/2, \xi , \xi,\eps)$-absorber for $\cV$ that is also lower $(\rho/2, \xi , G')$-regular, and \item[$\circ$] $R_{\rm reg}$ is a $(\rho,\xi,\eps,R_{\rm abs} , \cV)$-regularising reservoir, and \end{itemize} \item a \emph{$(\rho, \xi, \eps,\cV)$-reservoir of Type $\rm B$} if $R_{\rm res}$ is a $(\rho, \xi, \xi , \eps)$-absorber for $\cV$. \end{itemize} For brevity, we often omit the type if it is clear from the context. \end{definition} We will use reservoirs of Type~${\rm A_1}$ when $\cH$ is neither $(\rho,\eps)$-full nor FPP-extremal (which are defined in Definitions~\ref{def:rho-eps-full} and~\ref{def:edgesize}), reservoirs of Type~${\rm A_2}$ when $\cH$ is $(\rho,\eps)$-full but not FPP-extremal, and reservoirs of Type~${\rm B}$ when $\cH$ is FPP-extremal. \begin{comment} We now provide some motivation for the above definitions. At the end of the proof of Theorem~\ref{main-thm}, we will be in a position to colour the remaining graph $G_{\rm final}$ whose edge-set consists of almost all edges in the reservoir. As described below, the properties of the reservoirs will ensure that we can colour $G_{\rm final}$ with the required number of colours. First, consider reservoirs of Type~${\rm A_1}$. This type of reservoir will be needed when the hypergraph $\cH$ is neither $(\rho,\eps)$-full nor FPP-extremal (which are defined in Definitions~\ref{def:rho-eps-full} and~\ref{def:edgesize}). Recall that we defined absorbers to be typical with respect to $G'$ in Section~\ref{absorption-section}. When $\cH$ is not $(\rho, \eps)$-full, we need the typicality with respect to $G$ as well (to ensure that ~\eqref{eqn:bound_deg_R_3} holds), so we need to extend the absorber by adding some edges to satisfy~\ref{P1}. In this case, we can ensure that $\Delta(G_{\rm final})$ is strictly less than the number of remaining colours, so we can simply apply Vizing's theorem (Theorem~\ref{thm:vizing}) to $G_{\rm final}$. Second, reservoirs of Type~${\rm A_2}$ will be used when $\cH$ is $(\rho,\eps)$-full but not FPP-extremal. In this case, we can only guarantee that $\Delta(G_{\rm final})$ is at most the number of remaining colours, so we apply Corollary~\ref{cor:optcol} to colour $G_{\rm final}$ instead. However, $G_{\rm final}$ needs to be very close to regular to apply Corollary~\ref{cor:optcol} and~\ref{P1} is not enough to guarantee this.\COMMENT{as~\ref{P1} only ensures that $d_{R_{\rm res}}(w) \sim \rho d_G(w)$, so $d_{R_{\rm res}}(w)$ could be very small if $w \notin V_+^{(1-\eps)}(G)$.} Thus, we need to add some more edges incident to the vertices of small degree in $G$; this is possible since there are sufficiently many vertices in $G$ having degree $n-1$ (as $\cH$ is $(\rho,\eps)$-full). Finally, reservoirs of Type~${\rm B}$ will be used when $\cH$ is FPP-extremal. In this case, we will apply Lemma~\ref{hall-based-finishing-lemma} to colour $G_{\rm final}$, which requires all edges of $G_{\rm final}$ to be incident to a vertex in $U \coloneqq V_+^{(1-\eps)}(G)$. An absorber has this property by Definition~\ref{def:absorber}~\ref{cond:absorber1}, so we can simply take the reservoir to be an absorber in this case. \end{comment} Now we show the existence of a suitable absorber, a pseudorandom reservoir, and a regularising reservoir. \begin{proposition}[The existence of a pseudorandom reservoir and an absorber]\label{prop:pseudo_reservoir} Let $0 < 1 / n_0 \ll \xi , \varepsilon , \rho < 1$, and let $n \geq n_0$. Let $\cH$ be an $n$-vertex linear hypergraph, let $G \coloneqq \cH^{(2)}$, and let $G'$ be the spanning subgraph of $G$ consisting of the edges of $G$ incident to a vertex in $V_+^{(1-\eps)}(G)$. If $\cV$ is a collection of subsets of $V(\cH)$ such that $|\cV| \leq n^{\log n}$, then there exists $R_{\rm rnd} \subseteq E(G)$ such that \begin{itemize} \item $R_{\rm rnd} \cap E(G')$ is a $(\rho , \xi , \xi , \eps)$-absorber for $\cV$, and lower $(\rho,\xi,G')$-regular, and \item $R_{\rm rnd}$ is a $(\rho, \xi , \eps , \cV)$-pseudorandom reservoir. \end{itemize} \COMMENT{\begin{proof}[Proof of Proposition~\ref{prop:pseudo_reservoir}] Let $R_{\rm rnd} \subseteq E(G)$ be obtained by choosing each edge $e \in E(G)$ with probability $\rho$ independently at random, and let $R_{\rm rnd}' \coloneqq R_{\rm rnd} \cap E(G')$. For any $S \in \cV$ and $w \in V(G)$, we have $\mathbb{E}[d_{R_{\rm rnd}}(w)] = \rho d_G(w)$, $\mathbb{E}[|N_{R_{\rm rnd}'}(w) \cap S|] = \rho|N_{G'}(w) \cap S|$, and $\mathbb{E}[|N_{R_{\rm rnd}'}(w) \setminus S|] = \rho|N_{G'}(w) \setminus S|$. By Theorem~\ref{thm:chernoff}, with probability at least $1 - \exp({-n^{1/2}})$, we have $d_{R_{\rm rnd}}(w) = \rho d_G(w) \pm \xi n$, \begin{align*} |N_{R_{\rm rnd}'}(w) \cap S| = \rho |N_{G'}(w) \cap S| \pm \xi n, \text{ and } |N_{R_{\rm rnd}'}(w) \setminus S| = \rho|N_{G'}(w) \setminus S| \pm \xi n. \end{align*} As there are at most $|\cV| \leq n^{\log n}$ choices of $S \in \cV$ and $n$ choices of $w \in V(G)$, with probability at least $1 - n |\cV| \exp(-n^{1/2}) \geq 1 - \exp(-n^{1/3})$, $d_{R_{\rm rnd}}(w) = \rho d_G(w) \pm \xi n$, and $R_{\rm rnd}'$ is $(\rho , \xi , G')$-typical with respect to $\cV$. Similarly, for any two disjoint sets $A,B \subseteq V(G)$ with $|A|,|B| \geq \xi n$, $\mathbb{E}[e_{R'_{\rm rnd}}(A,B)] = \rho e_{G'}(A,B)$ hold. Applying Theorem~\ref{thm:chernoff} again, with probability at least $1 - \exp({-n^{3/2}})$, $e_{R_{\rm rnd}'}(A,B) = \rho e_{G'}(A,B) \pm \xi |A||B|$. Since there are at most $4^n$ choices of $A,B \subseteq V(G)$, with probability at least $1 - 4^n \exp(-n^{3/2}) \geq 1 - \exp(-n^{5/4})$, $R_{\rm rnd}'$ is both lower $(\rho , \xi , G')$-regular and upper $(\rho , \xi , G')$-regular. Hence, there exists a choice of $R_{\rm rnd}$ such that $R_{\rm rnd}$ is a $(\rho, \xi , \eps , \cV)$-pseudorandom reservoir, and $R_{\rm rnd}' = R_{\rm rnd} \cap E(G')$ is a $(\rho , \xi , \xi , \eps)$-absorber for $\cV$ that is also lower $(\rho,\xi,G')$-regular, as desired. \end{proof}} In particular, $R_{\rm rnd}$ is a $(\rho, \xi, \eps,\cV)$-reservoir of Type~${\rm A_1}$ and $R_{\mathrm{rnd}} \cap E(G')$ is a $(\rho, \xi, \eps,\cV)$-reservoir of Type~${\rm B}$. \end{proposition} To prove Proposition~\ref{prop:pseudo_reservoir}, it suffices to consider a set $R_{\rm rnd} \subseteq E(G)$ of edges chosen independently and uniformly at random with probability $\rho$ and apply the weighted Chernoff's inequality (Theorem~\ref{thm:chernoff}) with all weights equal to 1. \begin{lemma}[The existence of a regularising reservoir]\label{lem:reg_reservoir} Let $0 < 1/n_0 \ll \xi \ll \varepsilon \ll \rho \ll 1$, and let $n \geq n_0$. Let $\cH$ be an $n$-vertex linear hypergraph, and let $G \coloneqq \cH^{(2)}$. If $\cV$ is a collection of subsets of $V(\cH)$ such that $|\cV| \leq n^{\log n}$, $V(\cH) \in \cV$, and $\cH$ is $(\rho,\varepsilon)$-full, then for any $(\rho/2 , \xi , \xi , \varepsilon)$-absorber $R_{\rm abs}$ for $\cV$, there exists a $(\rho , \xi , \varepsilon , R_{\rm abs} , \cV)$-regularising reservoir $R_{\rm reg} \subseteq E(G) \setminus R_{\rm abs}$. \end{lemma} \begin{proof} Let $U \coloneqq V_+^{(1-\eps)}(G)$ and let $G'$ be the spanning subgraph of $G$ consisting of the edges of $G$ incident to a vertex of $U$. Let $R_{\rm abs}$ be a $(\rho/2 , \xi , \xi , \eps)$-absorber for $\cV$. Since $V(\cH) \in \cV$, \begin{equation}\label{cond:deg_abs} \text{for any $v \in V(G)$, $d_{R_{\rm abs}}(v) = \rho d_{G'}(v)/2 \pm \xi n$.} \end{equation} Let \begin{equation}\label{eq:defU'} U' \coloneqq \{w \in V(\cH) \setminus U \: : \: d_{G}(w) \geq (1 - 20 \varepsilon \rho^{-1})n \}. \end{equation} \COMMENT{The main reason why we separate $U'$ from $U$ is the following. We should reserve at least $\rho d_G(w) - \xi n$ edges for each vertex $w \in V(\cH)$, to satisfy~\eqref{eqn:bound_deg_R_3} in the proof of Lemma~\ref{lem:degree-lemma}. However, the method below only utilises the edges incident to vertices of $V^{(n-1)}(G)$; we can only reserve at most $(\rho - O(\eps))n$ many edges at each non-$U$ vertex, since there could be at most $(\rho - O(\eps))n$ vertices in $V^{(n-1)}(G)$ by the definition of $(\rho,\eps)$-fullness. However, $(\rho - O(\eps))n$ could be smaller than $\rho d_G(w) - \xi n$ for some vertices $w \in U'$, so we should reserve additional edges via $(g,f)$-factor theorem as well. For convenience, instead of first reserving the edges incident to $V^{(n-1)}(G)$ for the vertices of $U'$ and then trying to augment the degrees, we directly apply $(g,f)$-factor theorem to the vertices of $U' \cup U$.} Since $\cH$ is $(\rho,\varepsilon)$-full, we can choose a subset $S \subseteq V^{(n-1)}(G)$ with $|S| = \lceil (\rho - 20\eps)n \rceil$. Note that every vertex of $S$ is adjacent to all the other vertices of $G$. For each vertex $w \in V(\cH) \setminus (U \cup U')$, we choose $\lceil (\rho - 20\eps)n - d_{R_{\rm abs}}(w) \rceil > 0$ edges of $E_{G'} (S,\{w\}) \setminus R_{\rm abs}$\COMMENT{This is possible by the following reason: By \eqref{cond:deg_abs}, $d_{R_{\rm abs}}(w) \leq (\rho/2 + \xi)n < (\rho - 20\eps)n$, and the vertices in $S \subseteq V^{(n-1)}(G)$ are adjacent to all other vertices in $G$. In particular, all the vertices of $S$ are adjacent to $w$.}, and let $R' \subseteq E(G') \setminus R_{\rm abs}$ be the union of all such edges for all $w \in V(\cH) \setminus (U \cup U')$. Then for any $w \in V(\cH) \setminus (U \cup U')$, we have \begin{equation}\label{eqn:smalldeg_res} \rho d_G(w) \overset{\eqref{eq:defU'}}{\leq} (\rho-20\eps)n \leq d_{R_{\rm abs}}(w) + d_{R'}(w) \leq (\rho-20\eps)n+1 \leq \rho(1-\varepsilon)n. \end{equation} For each vertex $w \in U \cup U'$, let us define \begin{align*} f(w) \coloneqq \lfloor \rho d_G(w) + \xi n - d_{R_{\rm abs}}(w) - d_{R'}(w)\rfloor \text{ and } g(w) \coloneqq f(w) - 1. \end{align*} \begin{claim} There exists a $(g,f)$-factor $R''$ in $H \coloneqq G[U \cup U'] - R_{\rm abs} = G[U \cup U'] - R_{\rm abs} - R'$. \end{claim} \begin{claimproof} Since $\varepsilon \ll \rho$, for any $w \in U \cup U'$, we have $d_G(w) \geq (1-\rho)n$. Moreover, for any $w \in U \cup U'$, since $\cH$ is $(\rho, \eps)$-full, $d_{R'}(w) \leq |V(\cH) \setminus U| \leq 10 \varepsilon n \leq \rho n/10$, and by ~\eqref{cond:deg_abs}, $d_{R_{\rm abs}}(w) \le \rho n/2 + \xi n$. Hence, for any $w \in U \cup U'$ we have \begin{align*} \frac{3\rho n}{10} \leq \rho(1-\rho)n + \xi n - \left(\frac{\rho n}{2} + \xi n\right) - \frac{\rho n}{10} - 1 \leq f(w) \leq \rho n + \xi n < \frac{3\rho n}{2}. \end{align*} Therefore, for any $w \in U \cup U'$, \begin{equation} \label{eq:fg-range} f(w),g(w) \in [\rho n / 4 , 2 \rho n]. \end{equation} Moreover, for any $w \in U \cup U'$, we have \begin{align} d_{G - R_{\rm abs}}(w) \geq (1-\rho)n - \left ( \frac{\rho n}{2} + \xi n \right ) - \frac{\rho n}{10} \geq (1-2\rho)n. \label{eqn:bound_deg_h} \end{align} By Lov\'asz's $(g,f)$-factor Theorem~\cite{lovasz1970}, there exists a $(g,f)$-factor in $H$ if \begin{itemize} \item[(i)] $0 \leq g(w) < f(w) \leq d_H(w)$ for each $w \in U \cup U'$, and \item[(ii)] for any pair of disjoint sets $S,T \subseteq V(H)$, $c(S,T) \geq 0$, where \begin{align*} c(S,T) \coloneqq \sum_{t \in T}(d_{H}(t) - g(t)) + \sum_{s \in S}f(s) - e_{H}(S,T) = \sum_{t \in T}(d_{H-S}(t) - g(t)) + \sum_{s \in S}f(s). \end{align*} \end{itemize} Since $\cH$ is $(\rho,\eps)$-full and $\eps \ll \rho$, note that \begin{equation}\label{eqn:bound_rem} |V(\cH) \setminus (U \cup U')| \leq |V(\cH) \setminus U| \leq 10\eps n \leq \rho n. \end{equation} Hence, for any $w \in U \cup U'$, we have \begin{equation*} d_H(w) \geq d_{G - R_{\rm abs}}(w) - |V(G) \setminus (U \cup U')| \overset{\eqref{eqn:bound_deg_h}, \eqref{eqn:bound_rem}}{\geq} (1-2\rho)n - \rho n = (1-3 \rho)n \overset{\eqref{eq:fg-range}}{\geq} f(w), \end{equation*} so (i) holds. Now, we verify (ii). If $|S| \leq (1 - 5\rho)n$, then for any $t \in T$, we have \begin{equation*} d_{H-S}(t) \geq d_{G-R_{\rm abs}}(t) - |V(G) \setminus (U \cup U')| - |S| \overset{\eqref{eqn:bound_deg_h},\eqref{eqn:bound_rem}}{\geq} (1-2\rho)n - \rho n - |S| \geq 2 \rho n \overset{\eqref{eq:fg-range}}{\geq} g(t), \end{equation*} so $c(S,T) \geq 0$. Hence we may assume that $|S| > (1-5\rho)n$, which implies that $|T| < 5 \rho n$. Then \begin{align*} \sum_{t \in T}g(t) &\overset{\eqref{eq:fg-range}}{\leq} |T|\cdot 2 \rho n \leq 10 \rho^2 n^2 \leq (1-5\rho)n \cdot \frac{\rho n}{4} < |S| \cdot \frac{\rho n}{4} \overset{\eqref{eq:fg-range}}{\leq} \sum_{s \in S} f(s), \end{align*} so $c(S,T) \geq -\sum_{t \in T}g(t) + \sum_{s \in S}f(s) \geq 0$, proving (ii) and thus the claim. \end{claimproof} Finally, we show that $R_{\rm reg} \coloneqq R' \cup R''$ is a $(\rho , \xi , \varepsilon , R_{\rm abs} , \cV)$-regularising reservoir. Let $R_{\rm res} \coloneqq R_{\rm abs} \cup R' \cup R''$. For each $w \in U \cup U'$, we have \begin{align*} d_{R_{\rm res}}(w) &\geq (f(w) - 1) + d_{R_{\rm abs}}(w) + d_{R'}(w) \geq \rho d_G(w) + \xi n - 2, \\ d_{R_{\rm res}}(w) &\leq f(w) + d_{R_{\rm abs}}(w) + d_{R'}(w) \leq \rho d_G(w) + \xi n. \end{align*} Thus,~\ref{R1} holds, and for $w \in U'$, $(\rho - 20\varepsilon)n \overset{\eqref{eq:defU'}}{\leq} \rho d_G(w) \leq d_{R_{\rm res}}(w) \leq \rho(1-\varepsilon)n + \xi n$, as required by~\ref{R2}. Moreover, for any $w \in V(\cH) \setminus (U \cup U')$, $d_{R_{\rm res}}(w) = d_{R_{\rm abs}}(w) + d_{R'}(w)$ since $R'' \subseteq E(H) \subseteq E(G[U \cup U'])$. Therefore, by ~\eqref{eqn:smalldeg_res}, $\max(\rho d_G(w) , (\rho-20\eps)n) \leq d_{R_{\rm res}}(w) \leq \rho(1-\eps)n$, showing that ~\ref{R2} holds for $w \in V(\cH) \setminus (U \cup U')$. Thus,~\ref{R2} holds for all $w \in V(\cH)\setminus U$. This completes the proof. \end{proof} \begin{definition}[Regularised linear multi-hypergraph]\label{def:hreg} For an $n$-vertex linear hypergraph $\cH$, let $\cH_{\rm reg}$ be the linear multi-hypergraph obtained from $\cH$ by adding\COMMENT{We cannot have $n-2-d_{\cH}(w)$ or a larger number here instead of $n-3-d_\cH(w)$ because in order to be able to apply Corollary~\ref{cor:optcol}, we have to ensure that no vertices of degree at most $n-3$ in $\cH$ will attain maximum degree in the GKO case. (Recall that a vertex of degree at most $n-3$ in $\cH$ may be marked twice.)} $\max(0 , n-3-d_{\cH}(w))$ singleton edges incident to each $w \in V(\cH)$. \end{definition} Recall that $\cH_{\rm small} \coloneqq \{ e \in \cH \: : \: |e| \leq r_1 \}$. In order to be able to use Lemma~\ref{lem:nibble2}, we need to embed $\cH_{\rm small} \setminus R_{\rm res}$\COMMENT{Since the reservoir $R_{\rm res}$ contains an absorber $R$ as a subset, it is clear that $\cH_{\rm small} \setminus R_{\rm res} \subseteq \cH_{\rm small} \setminus R$.} into an almost-regular linear multi-hypergraph $\cH'$ by adding singleton edges. In particular, for each vertex $w \in V(\cH)$, we add at most $\max(0 , n - 3 - d_{\cH}(w))$ singleton edges containing $w$, so that $\cH' \subseteq \cH_{\rm reg}$. \begin{lemma}[Regularising lemma]\label{lem:degree-lemma} Let $0 < 1/n_0 \ll \xi , 1/r_1 \ll \beta , \varepsilon , \rho \ll 1$, and let $n \geq n_0$. Let $\cH$ be an $n$-vertex linear hypergraph, and let $\cV$ be a collection of subsets in $V(\cH)$ such that $V(\cH) \in \cV$. If either \begin{enumerate}[(i)] \item $R_{\rm res}$ is a $(\rho,\xi,\eps , \cV)$-reservoir of Type $\rm A_1$ or $\rm A_2$, or \item $R_{\rm res}$ is a $(\rho,\xi,\eps , \cV)$-reservoir of Type $\rm B$ and $3 \rho \leq \varepsilon$, \end{enumerate} then there exists a linear multi-hypergraph $\cH' \subseteq \cH_{\rm reg}$ such that \begin{itemize} \item $\cH'$ is obtained from $\cH_{\mathrm{small}} \setminus R_{\rm res}$ by adding singleton edges, and \item for every $w \in V(\cH)$, we have $d_{\cH'}(w) = (1-\rho) (n-1 \pm \beta n)$. \end{itemize} \end{lemma} \begin{proof} Let $G\coloneqq \cH^{(2)}$, and let $U \coloneqq V_+^{(1 - \varepsilon)}(G)$. Since $\cH$ is linear and every $w\in V(\cH)$ is contained in at most one singleton,\COMMENT{ since $1/2 \le 1 - \rho$.} \begin{equation}\label{eqn:non-graph-degree} d_{\cH\setminus E(G)}(w) \leq \frac{n-1-d_G(w)}{2} + 1 \leq (1 - \rho)(n-1-d_G(w)) + 1. \end{equation} We will show that for any $w \in V(\cH)$, \begin{equation}\label{eqn:estimate_hsmall} d_{\cH \setminus R_{\rm res}}(w) \leq (1-\rho) (n-1) + \xi n + 1. \end{equation} Let us first consider the case when $R_{\rm res}$ is a $(\rho , \xi , \eps , \cV)$-reservoir of Type~${\rm A_1}$ or~${\rm A_2}$. In this case, for any $w \in V(\cH)$, we have \begin{equation}\label{eqn:bound_deg_R_3} \rho d_G(w) - \xi n \leq d_{R_{\rm res}}(w) \leq (\rho + \xi)n. \end{equation} Indeed, if $R_{\rm res}$ is of Type $\rm A_1$, then~\eqref{eqn:bound_deg_R_3} holds by~\ref{P1}, and if $R_{\rm res}$ is of Type $\rm A_2$, then~\eqref{eqn:bound_deg_R_3} holds by~\ref{R1} and~\ref{R2}. Now, by ~\eqref{eqn:non-graph-degree} and~\eqref{eqn:bound_deg_R_3}, every $w \in V(\cH)$ satisfies \begin{align} d_{\cH \setminus R_{\rm res}}(w) = d_{G-R_{\rm res}}(w) + d_{\cH \setminus E(G)}(w) \overset{\eqref{eqn:bound_deg_R_3}}&{\leq} (1-\rho)d_G(w) + \xi n + d_{\cH \setminus E(G)}(w) \nonumber \\ \overset{\eqref{eqn:non-graph-degree}}&\leq (1-\rho)(n-1) + \xi n + 1,\label{eqn:hsmall_r_deg} \end{align} proving~\eqref{eqn:estimate_hsmall} when $R_{\rm res}$ is a $(\rho , \xi , \eps , \cV)$-reservoir of Type~${\rm A_1}$ or~${\rm A_2}$. Now let us consider the case when $R_{\rm res}$ is a $(\rho , \xi , \eps , \cV)$-reservoir of Type~${\rm B}$. Let $G'$ be the spanning subgraph of $G$ consisting of the edges of $G$ incident to a vertex of $U$. Since $R_{\rm res}$ is a $(\rho,\xi,\xi,\eps)$-absorber for $\cV$ and $V(\cH) \in \cV$, every $w \in V(\cH)$ satisfies \begin{equation}\label{eqn:bound_deg_R_4} d_{R_{\rm res}}(w) = \rho d_{G'}(w) \pm \xi n. \end{equation} If $w \in U$, then $d_{G'}(w) = d_G(w)$, so $d_{R_{\rm res}}(w) = \rho d_{G}(w) \pm \xi n$ and by the same reasoning as in~\eqref{eqn:hsmall_r_deg}, one can show that \eqref{eqn:estimate_hsmall} holds if $w \in U$. It remains to show that \eqref{eqn:estimate_hsmall} holds for $w \in V(\cH) \setminus U$. Indeed, every $w\in V(\cH)\setminus U$ satisfies \begin{align*} d_{\cH \setminus R_{\rm res}}(w) &= d_{G'-R_{\rm res}}(w) + d_{G-E(G')-R_{\rm res}}(w) + d_{\cH \setminus E(G)}(w)\\ \overset{\eqref{eqn:bound_deg_R_4}}&{\leq} (1-\rho)d_{G'}(w)+ \xi n + d_{G-E(G')}(w) + d_{\cH \setminus E(G)}(w) \\ &= (1-\rho)d_{G}(w) + \rho d_{G-E(G')}(w) + d_{\cH \setminus E(G)}(w) + \xi n\\ \overset{\eqref{eqn:non-graph-degree}}&\leq (1-\rho)d_{G}(w) + \rho (1-\eps)n + \frac{n-1-d_G(w)}{2} + 1 +\xi n\\ &= (1/2-\rho)d_{G}(w) + \rho (1-\eps)n + \frac{n-1}{2} + \xi n + 1\\ &\leq (1-\rho)(n-1) + \xi n + 1, \end{align*} as\COMMENT{Perhaps the above calculation above is too detailed. If you think so, we might some space by moving some of it to COMMENTS after we are convinced that everything is true.} desired. Note that the last inequality is equivalent to $(1/2-\rho)d_G(w) + \rho(1-\eps)n \leq (1/2-\rho)(n-1)$, which holds since\COMMENT{$(1/2-\rho)d_G(w) + \rho(1-\eps)n \leq (1/2-\rho)(1-\eps)n + \rho(1-\eps)n = (1/2)(1-\eps)n$ and this is at most $(1/2-\rho)(n-1)$ provided $2\rho + \frac{1-2\rho}{n} \leq \eps$ which holds since $2\rho + \frac{1-2\rho}{n} \leq 3\rho$ and $3\rho\leq \eps$ by our assumption.} $d_G(w) \leq (1-\eps)n$ and $3\rho \leq \eps$. Now let $k \coloneqq \lfloor (1-\rho)(n-1) - \beta n / 2 \rfloor$, and let $\cH'$ be the linear multi-hypergraph obtained from $ \cH_{\mathrm{small}} \setminus R_{\rm res}$ as follows. For every vertex $w \in V(\cH)$ satisfying $d_{ \cH_{\mathrm{small}} \setminus R_{\rm res}}(w) < k$, we add $k - d_{ \cH_{\mathrm{small}} \setminus R_{\rm res}}(w)$ singleton edges containing $w$. Then, by~\eqref{eqn:estimate_hsmall}\COMMENT{since $\xi \ll \beta$}, for every vertex $w \in V(\cH)$, \begin{equation}\label{eqn:degh*} d_{\cH'}(w) = (1-\rho)(n-1) \pm 2\beta n / 3 = (1-\rho) (n-1 \pm \beta n), \end{equation} as desired. Now we prove that $\cH' \subseteq \cH_{\rm reg}$ by showing that $\cH'$ is obtained from $\cH_{\rm small} \setminus R_{\rm res}$ by adding at most $\max(0 , n-3-d_{\cH}(w))$ singleton edges incident to each vertex $w \in V(\cH)$. Indeed, for any vertex $w \in V(\cH)$ with $d_{\cH_{\mathrm{small}} \setminus R_{\rm res}}(w) < k$, we add at most \begin{align*} k - d_{ \cH_{\mathrm{small}} \setminus R_{\rm res} }(w) \overset{\eqref{eqn:bound_deg_R_3},\eqref{eqn:bound_deg_R_4}}{\leq} (1-\rho)n - \frac{\beta n}{2} - \left ( d_{\cH}(w) - \frac{2n}{r_1} \right ) + (\rho + \xi)n \leq n - 3 - d_{\cH}(w) \end{align*} singleton edges incident to $w$, since $d_\cH (w) - d_{\cH_{\rm small}}(w) \leq 2n/r_1$ and $\xi, 1/r_1 \ll \beta$. This completes the proof of the lemma. \end{proof} \section{Proof of Theorem~\ref{main-thm}}\label{proof-section} Now we are ready to prove our main theorem. As discussed in Section~\ref{sec:overview}, the proof depends on the structure of $\cH$. The relevant properties of $\cH$ are captured by the following definition. (Recall that $(\rho, \eps)$-full linear hypergraphs were introduced in Definition~\ref{def:rho-eps-full}.) \begin{definition}[Types of hypergraphs and colourings] Let $\cH$ be a linear $n$-vertex hypergraph, and let $\phi : \cH_{\rm med} \cup \cH_{\rm large} \to [n]$ be a proper edge-colouring. We say $\phi$ is of Type~${\rm A}$ if it satisfies~\ref{non-extremal-colouring} of Theorem~\ref{large-edge-thm}, and $\phi$ is of Type~${\rm B}$ if it satisfies~\ref{extremal-colouring} of Theorem~\ref{large-edge-thm}. We say $(\cH , \phi)$ is of \begin{itemize} \item Type~${\rm A_1}$ if $\phi$ is of Type A, and $\cH$ is not $(\rho,\eps)$-full, \item Type~${\rm A_2}$ if $\phi$ is of Type A, and $\cH$ is $(\rho,\eps)$-full, \item Type~${\rm B}$ if $\phi$ is of Type B. \end{itemize} \end{definition} \begin{proof}[Proof of Theorem~\ref{main-thm}] Recall the hierarchy of the parameters $$0 < 1/ n_0 \ll 1/r_0 \ll \xi \ll 1/r_1 \ll \beta \ll \kappa \ll \gamma_1 \ll \eps_1 \ll \rho_1 \ll \sigma \ll \delta \ll \gamma_2 \ll \rho_2 \ll \eps_2 \ll 1,$$ where $r_0$ and $r_1$ are integers. Let $n \geq n_0$, and let $\cH$ be an $n$-vertex linear hypergraph. Without loss of generality, we may assume that $\cH$ has no singleton edges. Our aim is to find $n$ pairwise edge-disjoint matchings containing all of the edges of $\cH$.\COMMENT{Indeed, if we prove $\chi'(\cH') \leq n$ holds for the linear hypergraph $\cH'$ obtained from $\cH$ by removing all singleton edges, then any vertex is incident to at most $n-1$ edges in $\cH'$, so for any singleton edge incident to a vertex $w$ in $\cH$, there is an unused colour available that can be assigned to this singleton edge.} Let $G \coloneqq \cH^{(2)}$, let $U \coloneqq V_+^{(1-\eps)}(G)$, and let $G'$ be the spanning subgraph of $G$ consisting of the set of edges of $G$ incident to a vertex of $U$. \begin{pf-step}\label{step:step1} Colour large and medium edges, and define the corresponding parameters. \end{pf-step} Let $\phi : \cH_{\rm med} \cup \cH_{\rm large} \to [n]$ be the proper edge-colouring given by Theorem~\ref{large-edge-thm}. Now we define some parameters depending on the type of $(\cH , \phi)$ as follows. \begin{itemize} \item $\rho \coloneqq \rho_1$ , $\rho_{\rm abs} \coloneqq \rho_1$ , $\eps \coloneqq \eps_1$ , and $\gamma \coloneqq \gamma_1$ if $(\cH , \phi)$ is of Type~${\rm A_1}$, \item $\rho \coloneqq \rho_1$ , $\rho_{\rm abs} \coloneqq \rho_1 / 2$ , $\eps \coloneqq \eps_1$ , and $\gamma \coloneqq \gamma_1$ if $(\cH , \phi)$ is of Type~${\rm A_2}$, and \item $\rho \coloneqq \rho_2$ , $\rho_{\rm abs} \coloneqq \rho_2$ , $\eps \coloneqq \eps_2$ , and $\gamma \coloneqq \gamma_2$ if $(\cH , \phi)$ is of Type~${\rm B}$. \end{itemize} Thus, we have \begin{equation}\label{eqn:hierarchy} \kappa \ll \gamma \ll \rho, \rho_{\rm abs}, \eps \ll 1. \end{equation} Recall that difficult matchings were defined in Definition~\ref{defn:difficult}. The following claim is used in the later steps. \begin{claim}\label{claim:easyobs} The following hold. \begin{enumerate} \item[\mylabel{EP1}{(\ref{claim:easyobs}.1)}] For any edge $e \in \cH$ such that $e \cap U \ne \varnothing$, we have $|e| \leq \eps n$. \item[\mylabel{EP2}{(\ref{claim:easyobs}.2)}] For any edge $e \in \cH_{\rm small}$, we have $|\{f \in \cH_{\rm large} : e \cap f \ne \varnothing \}| \leq 2r_1 n/r_0$. \item[\mylabel{EP3}{(\ref{claim:easyobs}.3)}] If $\phi$ is of Type B, then $|U| \leq 2 \delta n$, and there is no difficult colour class in $\phi$. \item[\mylabel{EP4}{(\ref{claim:easyobs}.4)}] If $\phi$ is of Type~${\rm A}$, then there is at most one colour $c \in [n]$ such that $\phi^{-1}(c)$ contains a huge edge and $\phi^{-1}(c)$ is difficult. Moreover, if such a colour $c$ exists, then $\phi^{-1}(c) = \{e\}$ for some huge edge $e$. \end{enumerate} \end{claim} \begin{claimproof} Let us first prove~\ref{EP1}. For any edge $e \in \cH \setminus E(G)$ containing a vertex $w \in U$, since $\cH$ is linear, the vertex $w$ is not adjacent (in $G$) to any vertex of $e$. Thus, $(1-\eps)n \leq d_G(w) \leq n - |e|$, implying that $|e| \leq \eps n$, as desired. Now we prove~\ref{EP2}. Since $\cH$ is linear, every vertex $w \in V(\cH)$ is incident to at most $n/(r_0-1)$ edges of $\cH_{\rm large}$. Thus, $|\{f \in \cH_{\rm large} : e \cap f \ne \varnothing \}| \leq {|e| n} / (r_0-1) \leq 2r_1n/r_0$. Now we show~\ref{EP3}. Since there is a set of FPP-extremal edges in $\cH$ with volume at least $1-\delta$, we have $|U|(1-\eps)n/2 \leq |E(G)| \leq \delta \binom{n}{2}$. Thus, $|U| \leq 2 \delta n$. If $\phi^{-1}(c)$ is difficult, then $|V(\phi^{-1}(c))| \geq 3|V(\cH) \setminus U|/4 \geq n/2$, which is impossible since each colour class covers at most $\delta n$ vertices by~\ref{extremal-colouring}\ref{extremal-huge-edge},~\ref{extremal-colouring}\ref{extremal-medium-bound}, and~\ref{extremal-colouring}\ref{extremal-colour-class-bound} of Theorem~\ref{large-edge-thm}. Finally, we prove~\ref{EP4}. By~\ref{non-extremal-colouring}\ref{non-extremal-huge-edge} of Theorem~\ref{large-edge-thm}, every colour class of $\phi$ containing a huge edge consists of a unique edge. Suppose $\phi^{-1}(c_1)$ and $\phi^{-1}(c_2)$ are difficult colour classes of $\phi$ such that both of them contain a huge edge, and let $c_1 \ne c_2$. Then $|V(\cH) \setminus U| \geq 2$ and there exist huge edges $e_1 \ne e_2$ in $\cH$ such that $\phi(e_1) = c_1$ and $\phi(e_2) = c_2$. If $|V(\cH) \setminus U| = 2$, then both $e_1$ and $e_2$ contain $V(\cH) \setminus U$ since $\lceil 3|V(\cH) \setminus U|/4 \rceil = 2$, contradicting the linearity of $\cH$. Otherwise, if $|V(\cH) \setminus U| \geq 3$, then for $i \in \{1,2 \}$, we have $|e_i \setminus U| \geq 3|V(\cH) \setminus U|/4$, so $|(e_1 \cap e_2) \setminus U| \geq |V(\cH) \setminus U|/2 > 1$, also contradicting the linearity of $\cH$. \end{claimproof} \begin{pf-step} Choose a reservoir $R_{\rm res}$ and a defect-set $S$. \end{pf-step} Let us define \begin{equation}\label{def:cv} \cV \coloneqq \{U , V(\cH) \} \cup \bigcup_{i=1}^{n} \{ U \cup V(\phi^{-1}(i)) , U \setminus V(\phi^{-1}(i)) \}. \end{equation} By Proposition~\ref{prop:pseudo_reservoir} and Lemma~\ref{lem:reg_reservoir}, there exists $R_{\rm res} \subseteq E(G)$ such that \begin{enumerate} \item[\mylabel{RES1}{\bf RES1}] $R_{\rm res}$ is a $(\rho , \xi , \eps , \cV)$-reservoir of Type $i$ if $(\cH , \phi)$ is of Type $i$, for $i \in \{ {\rm A_1},{\rm A_2},{\rm B} \}$, and \item[\mylabel{RES2}{\bf RES2}] $R_{\rm res}$ contains a $(\rho_{\rm abs} , \xi , \xi , \eps)$-absorber $R_{\rm abs}$ for $\cV$. Moreover, if $(\cH,\phi)$ is of Type~${\rm A_2}$, then $R_{\rm abs}$ is lower $(\rho/2 , \xi , G')$-regular, and if $(\cH,\phi)$ is of Type~${\rm B}$ then $R_{\rm res} = R_{\rm abs}$. \end{enumerate} Now let us define the `defect' set $S$ by \begin{align}\label{def:s} S \coloneqq \begin{cases} U \setminus V^{(n-1)}(\cH) &\text{if }(\cH,\phi) \text{ is of Type~${\rm A_1}$.}\\ U &\text{if }(\cH,\phi) \text{ is of Type~${\rm A_2}$ or~${\rm B}$.} \end{cases} \end{align} Since $|U| \geq (1-10\eps)n$ holds only if $\phi$ is of Type~${\rm A}$ by~\ref{EP3} of Claim~\ref{claim:easyobs}, and $\eps \ll \rho$ holds if $\phi$ is of Type~${\rm A}$, we can deduce\COMMENT{If $(\cH,\phi)$ is of Type~${\rm A_1}$ and $|U| > (1-10\eps)n$, then $|S| = |U| - |V^{(n-1)}(\cH)| \ge (1-10\eps)n - (\rho-15\eps)n = (1-\rho)n + 5 \eps n$. If $(\cH,\phi)$ is of Type~${\rm A_2}$ and $|U| > (1-10\eps)n$, then $|S| = |U| > (1-10\eps)n \ge (1-\rho)n + 5 \eps n$ since $\rho \gg \eps$.} the following. \begin{equation}\label{eqn:rs} \textrm{If $|U| > (1-10\eps)n$, then $|S| \geq (1-\rho)n + 5 \eps n$.} \end{equation} \begin{pf-step} Define various subsets of colours. \end{pf-step} In this step, we will define various sets of colours, $C_{\rm med}$, $C_{\rm diff}$, $C_{\rm huge}$, $C_{\rm main}$, $C_{\rm buff}$, $C_{\rm large}$ and $C_{\rm final}$, such that $[n] = C_{\rm med} \cup C_{\rm diff} \cup C_{\rm huge} \cup C_{\rm main} \cup C_{\rm buff} \cup C_{\rm final}$. In the following steps, roughly, our goal is to extend the colour classes $\phi^{-1}(c)$ for $c \in [n] \setminus C_{\rm final}$ in such a way that the maximum degree in the hypergraph of remaining uncoloured edges is at most $|C_{\rm final}|$. To that end, first, for each $c \in C_{\rm diff}$, we will extend the colour class $\phi^{-1}(c)$ to cover every vertex of $V^{(n-1)}(\cH)$ and all but at most five vertices of $V^{(n-2)}(\cH)$ using some edges of $G$. Then for each $c \in C_{\rm huge} \cup C_{\rm med}$ we will extend the colour class $\phi^{-1}(c)$ to cover all but at most one vertex of $U$ using some edges of $R_{\rm abs}$, and finally, we will extend the colour classes $\phi^{-1}(c)$ for $c \in C_{\rm main} \cup C_{\rm buff}$ to contain all of the remaining edges in $\cH_{\rm small} \setminus R_{\rm res}$, and the resulting colour classes are further extended using some edges of $R_{\rm abs}$. Now we define the following parameters and sets of colours. \begin{itemize} \item Let $D \coloneqq \lfloor (1-\rho)(n-1) \rfloor$ and $D' \coloneqq \lfloor 10 \gamma^{1/2} D \rfloor$. \item Let $C_{\rm med} \subseteq [n]$ be a set of at most $\gamma n$ colours such that $\phi(\cH_{\rm med}) \subseteq C_{\rm med}$, which is guaranteed by~\ref{non-extremal-colouring}\ref{non-extremal-medium-bound} and~\ref{extremal-colouring}\ref{extremal-medium-bound} of Theorem~\ref{large-edge-thm}. \item By~\ref{EP3} and~\ref{EP4} of Claim~\ref{claim:easyobs}, there is at most one colour $c_{\rm diff} \in \phi(\cH_{\rm huge}) \setminus C_{\rm med}$ such that $\phi^{-1}(c_{\rm diff})$ is difficult. If such a colour $c_{\rm diff}$ exists, then let $C_{\rm diff} \coloneqq \{c_{\rm diff} \}$. Otherwise, let $C_{\rm diff} \coloneqq \varnothing$. \item Let $C_{\rm huge} \coloneqq \phi(\cH_{\rm huge}) \setminus (C_{\rm med} \cup C_{\rm diff})$. Note that, since $\cH$ is linear and for every $e \in C_{\rm huge}$, $|e| \geq \beta n/4$, we have \begin{equation}\label{eqn:num_huge} |C_{\rm huge} \cup C_{\rm diff}| \leq e(\cH_{\rm huge}) \overset{\eqref{eqn:huge-edge-bound}}{\leq} 8 \beta^{-1}. \end{equation} \item Let $C_{\rm large} \coloneqq \phi(\cH_{\rm large}) \setminus (C_{\rm med} \cup C_{\rm diff} \cup C_{\rm huge})$. \item Let $C_{\rm main} \subseteq [n] \setminus (C_{\rm med} \cup C_{\rm diff} \cup C_{\rm huge})$ be a subset of size $D$ that maximises $|C_{\rm large} \cap C_{\rm main}|$. Note that such a subset exists since $n - |C_{\rm med} \cup C_{\rm diff} \cup C_{\rm huge}| \geq n - \gamma n - 8\beta^{-1} \geq D$ by~\eqref{eqn:hierarchy} and~\eqref{eqn:num_huge}. In particular, if $\phi$ is of Type~${\rm A}$, then $C_{\rm main} \supseteq C_{\rm large}$, since $|C_{\rm large}| \leq (1-\sigma)n < D$ by~\ref{non-extremal-colouring} of Theorem~\ref{large-edge-thm}. \item Let $C_{\rm buff} \subseteq [n] \setminus (C_{\rm med} \cup C_{\rm diff} \cup C_{\rm huge} \cup C_{\rm main})$ be a subset of size $D'$. Note that such a subset exists since $n - |C_{\rm med} \cup C_{\rm diff} \cup C_{\rm huge} \cup C_{\rm main}| \geq n - \gamma n - 8\beta^{-1} - (1-\rho)n \geq \rho n / 2 \geq D'$ by \eqref{eqn:num_huge}. \item Let $C_{\rm final} \coloneqq [n] \setminus (C_{\rm med} \cup C_{\rm diff} \cup C_{\rm huge} \cup C_{\rm main} \cup C_{\rm buff})$. \end{itemize} We will use the following observations later. \begin{enumerate} \item[\mylabel{T1}{\bf T1}] If $\phi$ is of Type~${\rm A}$, then for any $c \in C_{\rm final}$, $\phi^{-1}(c) = \varnothing$, since $C_{\rm large} \subseteq C_{\rm main}$. \item[\mylabel{T2}{\bf T2}] If $\phi$ is of Type~${\rm B}$, then for any $c \in C_{\rm final}$, $\phi^{-1}(c) \subseteq \cH_{\rm large} \setminus \cH_{\rm huge}$.\COMMENT{Indeed, for any $c \in C_{\rm final}$ either $c \in C_{\rm large}$ or $\phi^{-1}(c)$ is empty.} Moreover, ~\ref{extremal-colouring}\ref{extremal-colour-class-bound} of Theorem~\ref{large-edge-thm} implies that $|V(\phi^{-1}(c))| \leq \beta n$ for any $c \in C_{\rm final}$. \end{enumerate} Also note that \begin{align}\label{eqn:bound_prev_col} (1-\rho)n \leq |C_{\rm med} \cup C_{\rm diff} \cup C_{\rm huge} \cup C_{\rm main} \cup C_{\rm buff}| \leq (1-\rho + 15 \gamma^{1/2} )n, \end{align} since $|C_{\rm med}| \leq \gamma n$, $|C_{\rm main} \cup C_{\rm buff}| = D + D' \leq (1-\rho + 10\gamma^{1/2})n$, and~\eqref{eqn:num_huge} holds. \begin{pf-step}\label{step:diff} Extend the colour classes in $\{\phi^{-1}(c) : c \in C_{\rm diff}\}$ using Lemma~\ref{difficult-edge-absorption}. \end{pf-step} In this step, for each $c \in C_{\rm diff}$, we extend the colour class $\phi^{-1}(c)$ to cover every vertex of $V^{(n-1)}(\cH)$ and all but at most five vertices of $V^{(n-2)}(\cH)$, by using only edges of $G$. If $C_{\rm diff} \ne \varnothing$, then by~\ref{EP3} and~\ref{EP4} of Claim~\ref{claim:easyobs}, $C_{\rm diff} = \{c_{\rm diff} \}$, $\phi$ is of Type~${\rm A}$, and $\phi^{-1}(c_{\rm diff}) = \{e\}$ for some huge edge $e$. Applying Lemma~\ref{difficult-edge-absorption} with $\phi^{-1}(c_{\rm diff})$ playing the role of $M$, either $\chi'(\cH) \leq n$ or we have a set $\cM_{\rm diff} \coloneqq \{ M_{c_{\rm diff}} \}$ such that the following holds. \begin{enumerate} \item[\mylabel{D1}{\bf D1}] For each $c \in C_{\rm diff}$, $M_c \supseteq \phi^{-1}(c)$, $M_c \setminus \phi^{-1}(c) \subseteq E(G)$, $M_{c}$ covers every vertex of $V^{(n-1)}(\cH)$, and $|V^{(n-2)}(\cH) \setminus V(M_c)| \leq 5$. \end{enumerate} Let us define \begin{equation*} \textrm{$R_1 \coloneqq R_{\rm abs} \setminus \bigcup_{c \in C_{\rm diff}}M_c$ and $S_1 \coloneqq S \setminus \bigcup_{c \in C_{\rm diff}}(V^{(n-2)}(\cH) \setminus V(M_c))$.} \end{equation*} Since $|C_{\rm diff}| \leq 1$ and~\ref{RES2} holds, by Observation~\ref{obs:del_absorber}, we have the following. \begin{align} &\text{$R_1$ is a $(\rho_{\rm abs} , 10\xi , \xi , \eps)$-absorber for $\cV$, so it is also a $(\rho_{\rm abs} , 3\gamma/2 , \xi , \eps)$-absorber for $\cV$.}\label{eq:R1abs}\\ &\text{If $|U| > (1-10\eps)n$, then $|S_1| \overset{\ref{D1}}{\geq} |S| - 5 \overset{\eqref{eqn:rs}}{\geq} 2 \eps n > (\eps + 3 \gamma/2)n$.}\label{eq:boundS1} \end{align} \begin{pf-step} Extend the colour classes in $\{ \phi^{-1}(c) : c \in C_{\rm huge} \cup C_{\rm med} \}$ using Lemma~\ref{huge-edge-absorption-lemma}. \end{pf-step} In this step, for each $c \in C_{\rm huge} \cup C_{\rm med}$, we extend the colour class $\phi^{-1}(c)$ to cover all but at most one vertex of $U$, by using only edges in $R_1 \subseteq R_{\rm abs}$. Combining ~\eqref{eqn:num_huge} and the fact that $|C_{\mathrm{med}}| \leq \gamma n$, we have \begin{equation}\label{eqn:size_hm} |C_{\rm huge} \cup C_{\rm med}| \leq 3\gamma n / 2. \end{equation} First suppose $c \in C_{\rm huge}$. Then we claim that $|V(\phi^{-1}(c)) \cap U| \leq \eps n$. Indeed, if $\phi$ is of Type~${\rm A}$, then $\phi^{-1}(c)$ contains exactly one edge by ~\ref{non-extremal-colouring}\ref{non-extremal-huge-edge} of Theorem~\ref{large-edge-thm}, so $|V(\phi^{-1}(c)) \cap U| \leq \eps n$ by~\ref{EP1} of Claim~\ref{claim:easyobs}. Otherwise, if $\phi$ is of Type~${\rm B}$, by~\ref{extremal-colouring}\ref{extremal-huge-edge} of Theorem~\ref{large-edge-thm}, we have $|V(\phi^{-1}(c))| \leq \delta n < \eps n$, so again $|V(\phi^{-1}(c)) \cap U| \leq \eps n$. Moreover, as noted in~\eqref{eq:R1abs}, $R_1$ is a $(\rho_{\rm abs} , 3\gamma/2 , \xi , \eps)$-absorber for $\cV$, and $U \cup V(\phi^{-1}(c)) , U \setminus V(\phi^{-1}(c)), U, V(\cH) \in \cV$ by ~\eqref{def:cv}, so $(\cH , \phi^{-1}(c) , R_1 , S_1)$ is $(\rho_{\rm abs} , \eps , 3\gamma/2 , \kappa , \xi)$-absorbable by typicality of $R_1$ if $c \in C_{\rm huge}$. Now suppose $c \in C_{\rm med}$. Then $|V(\phi^{-1}(c))| \leq \gamma n$ by~\ref{non-extremal-colouring}\ref{non-extremal-medium-bound} and~\ref{extremal-colouring}\ref{extremal-medium-bound} of Theorem~\ref{large-edge-thm}. So, again, since $R_1$ is a $(\rho_{\rm abs} , 3\gamma/2 , \xi , \eps)$-absorber for $\cV$, and $U, V(\cH) \in \cV$ by ~\eqref{def:cv}, it follows that $(\cH , \phi^{-1}(c) , R_1 , S_1)$ is $(\rho_{\rm abs} , \eps , 3\gamma/2 , \kappa , \xi)$-absorbable by smallness of $\phi^{-1}(c)$ if $c \in C_{\rm med}$. Moreover, since~\eqref{eq:boundS1} and~\eqref{eqn:size_hm} hold, we can\COMMENT{we apply Lemma~\ref{huge-edge-absorption-lemma} with $3\gamma/2$ playing the role of $\gamma$. So we need that the number of matchings is at most $3 \gamma n/2$, which holds by ~\eqref{eqn:size_hm}. Moreover, since $R_1$ is a $(\rho_{\rm abs} , 10\xi , \xi , \eps)$-absorber, it is also a $(\rho_{\rm abs} , 10(3\gamma/2) , \xi , \eps)$-absorber by $\xi \ll \gamma$.} apply Lemma~\ref{huge-edge-absorption-lemma} with $\{ \phi^{-1}(c) : c \in C_{\rm huge} \cup C_{\rm med} \}$, $R_1$, $S_1$, $\rho_{\rm abs}$, and $3\gamma/2$ playing the roles of $\cN$, $R$, $S$, $\rho$, and $\gamma$ respectively, to obtain the set $\cM_{\rm hm} \coloneqq \{ M_c : c \in C_{\rm huge} \cup C_{\rm med} \}$ of pairwise edge-disjoint matchings in $\cH$ such that the following hold. \begin{enumerate} \item[\mylabel{HM1}{\bf HM1}] For each $c \in C_{\rm huge} \cup C_{\rm med}$, $M_c$ is edge-disjoint from the matchings in $\cM_{\rm diff}$, $M_c \supseteq \phi^{-1}(c)$ and $M_c \setminus \phi^{-1}(c) \subseteq R_{\rm abs}$. \item[\mylabel{HM2}{\bf HM2}] If $|U| \leq (1-10\eps)n$, then $\cM_{\rm hm}$ has perfect coverage of $U$. Otherwise, $\cM_{\rm hm}$ has nearly-perfect coverage of $U$ with defects in $S_1$.\COMMENT{Note that $S_1$ may contain vertices of degree at most $n-3$, as we only removed some vertices with degree $n-2$ from $S$ to define $S_1$. This implies that the vertices with degree at most $n-3$ are marked/uncovered when extending the difficult matching, and they are allowed to be marked again when dealing with non-difficult huge edges.} \end{enumerate} Now let us define \begin{equation*} R_2 \coloneqq R_1 \setminus \bigcup_{c \in C_{\rm huge} \cup C_{\rm med}} M_c \text{ and }S_2 \coloneqq S_1 \setminus \bigcup_{c \in C_{\rm huge} \cup C_{\rm med}}(U \setminus V(M_c)). \end{equation*} By~\eqref{eq:R1abs},~\eqref{eqn:size_hm},~and Observation~\ref{obs:del_absorber}, the following hold. \begin{align} &\text{$R_2$ is a $(\rho_{\rm abs} , 2\gamma , \xi , \eps)$-absorber for $\cV$.}\label{eq:R2abs}\\ &\text{If $|U| > (1-10\eps)n$, then } |S_2| \overset{\eqref{eqn:size_hm}}{\geq} |S_1| - 3 \gamma n/2 \overset{\eqref{eq:boundS1}}{\geq} |S| - 5 - 3 \gamma n/2 \overset{\eqref{eqn:rs}}{\geq} D + 4\eps n. \label{eq:boundS2} \end{align} \begin{pf-step} Colour most of the edges of $\cH_{\rm small} \setminus (R_{\rm res} \cup \bigcup_{M \in \cM_{\rm diff}}M )$ by extending the colour classes in $\{\phi^{-1}(c) : c \in C_{\rm main} \}$ using Lemma~\ref{lem:nibble2}. \end{pf-step} In this step, we will first colour most of the edges in $\cH_{\rm small} \setminus (R_{\rm res} \cup \bigcup_{M \in \cM_{\rm diff}}M )$ with colours from $C_{\rm main}$ by extending the colour classes in $\{ \phi^{-1}(c) : c \in C_{\rm main} \}$, and the resulting colour classes are further extended by using only edges of $R_2 \subseteq R_{\rm abs}$. To do this, we will use Lemma~\ref{lem:nibble2}. (Note that after this step there are only a few remaining uncoloured edges in $\cH_{\rm small} \setminus (R_{\rm res} \cup \bigcup_{M \in \cM_{\rm diff}}M )$ incident to each vertex, which will be coloured in the next step.) To be able to apply Lemma~\ref{lem:nibble2}, we need to first embed $\cH_{\rm small} \setminus (R_{\rm res} \cup \bigcup_{M \in \cM_{\rm diff}}M )$ into an almost-regular linear multi-hypergraph $\cH^*$. In order to define $\cH^*$, let $\cH'$ be the linear multi-hypergraph obtained by applying Lemma~\ref{lem:degree-lemma} (Regularising lemma) with $\cH$, $R_{\rm res}$, and $\beta/2$ playing the roles of $\cH$, $R_{\rm res}$, and $\beta$, respectively. In particular, $\cH'$ is a linear multi-hypergraph obtained from $\cH_{\rm small} \setminus R_{\rm res}$ by adding singleton edges such that $\cH' \subseteq \cH_{\rm reg}$ (which is defined in Definition~\ref{def:hreg}). Now let $\cH^* \coloneqq \cH' \setminus \bigcup_{M \in \cM_{\rm diff}} M$. Then it is clear that $\cH^*$ can be obtained from $\cH_{\rm small} \setminus (R_{\rm res} \cup \bigcup_{M \in \cM_{\rm diff}}M )$ by adding singleton edges, so we have\COMMENT{we wrote $2 \beta$ below simply because we will make $2 \beta$ to play the role of $\beta$ later on. We can change it if you'd like.} the following.\COMMENT{Applying Lemma~\ref{lem:degree-lemma} we get $d_{\cH'}(w) = (1-\rho)(n-1 \pm \beta n) = (1 \pm 3\beta/2)D$, since $D = \lfloor (1-\rho)(n-1) \rfloor$. Since $\cH^*$ is a linear multi-hypergraph obtained from $\cH'$ by removing at most one edge incident to each vertex, we have $d_{\cH^*}(w) = (1 \pm 2\beta)D$.} \begin{equation}\label{eqn:h*_inside} \textrm{$\cH^* \subseteq \cH_{\rm reg} \setminus R_{\rm res} \subseteq \cH_{\rm reg} \setminus R_2$, and $d_{\cH^*}(w) = (1 \pm 2\beta)D$ for any $w \in V(\cH)$.} \end{equation} Now we want to apply Lemma~\ref{lem:nibble2} with $\cH_{\rm reg}$, $\cH^*$, $\{ \phi^{-1}(c) : c\in C_{\rm main} \}$, $R_2$, $S_2$, $r_1$, $\rho_{\rm abs}$, $2\beta$, and $2 \gamma$ playing the roles of $\cH$ , $\cH'$, $\cM$, $R$, $S$, $r$, $\rho$, $\beta$, and $\gamma$, respectively. To that end, we need to check that the assumptions~\ref{C1}--\ref{C4} of Lemma~\ref{lem:nibble2} are satisfied. First,~\eqref{eq:boundS2} implies that if $|U| > (1-10\eps)n$, then $|S_2| \geq D + 2 \gamma n$, so ~\ref{C1} holds. By \eqref{eq:R2abs} and \eqref{def:cv}, ~\ref{C2} holds. Since every edge $e \in \cH^*$ satisfies $|e| \leq r_1$,~\ref{C3} follows from~\eqref{eqn:h*_inside}. Lastly, we show that~\ref{C4} holds. By the definition of $C_{\rm main}$, for any $c \in C_{\rm main}$, $\phi^{-1}(c)$ is either empty or is contained in $\cH_{\rm large}$, so $\phi^{-1}(c) \subseteq \cH_{\rm reg} \setminus (\cH^* \cup R_2)$\COMMENT{since $\cH^* \cap \cH_{\rm large} = \varnothing$}. Moreover, by (\ref{large-edge-thm}:a)(iii) and (\ref{large-edge-thm}:b)(iii) of Theorem~\ref{large-edge-thm}, $|V(\phi^{-1}(c))| \leq \beta n \leq 2 \beta D$. Furthermore, by~\ref{EP2} of Claim~\ref{claim:easyobs}, for any $e \in \cH^*$, $| \{c \in C_{\rm main} : e \cap V(\phi^{-1}(c)) \ne \varnothing \} | \leq 2 r_1 n/r_0 \leq 2\beta D$, as desired. Thus, we can apply Lemma~\ref{lem:nibble2} to obtain a set $\cM_{\rm main}^* \coloneqq \{ M_c^* : c \in C_{\rm main} \}$ of $D$ edge-disjoint matchings in $\cH_{\rm reg}$ such that the following hold. \begin{enumerate} \item[\mylabel{MA1*}{\bf MA1*}] For any $c \in C_{\rm main}$, we have $M_c^* \supseteq \phi^{-1}(c)$ and $M_c^* \setminus \phi^{-1}(c) \subseteq \cH^* \cup R_2 \subseteq \cH^* \cup R_{\rm abs}$; in particular, $M_c^*$ is edge-disjoint from all the matchings in $\cM_{\rm diff} \cup \cM_{\rm hm}$\COMMENT{This follows since $\cH^*$ is disjoint from the matching in $\cM_{\rm diff}$, medium/large edges, and $R_{\rm res}$, by the definition of $\cH^*$. Thus~\ref{HM1} and the definition of $R_2$ together imply that $M_c^*$ is edge-disjoint from all the matchings in $\cM_{\rm hm}$ as well.}. \item[\mylabel{MA2*}{\bf MA2*}] For any $w \in V(\cH)$, \begin{itemize} \item[(i)] $|E_{R_{\rm abs}}(w) \cap \bigcup_{c \in C_{\rm main}} M_c^*| \leq 2 \gamma D$, and \item[(ii)] $|E_{\cH^*}(w) \setminus \bigcup_{c \in C_{\rm main}} M_c^*| \leq 2 \gamma D$. \end{itemize} \item[\mylabel{MA3}{\bf MA3*}] If $|U| \leq (1-2\eps)n$, then $\cM_{\rm main}^*$ has perfect coverage of $U$. Otherwise, $\cM_{\rm main}^*$ has nearly-perfect coverage of $U$ with defects in $S_2$. \end{enumerate} For every $c \in C_{\rm main}$, let $M_c$ be obtained from $M_c^*$ by removing all singleton edges, and let $\cM_{\rm main} \coloneqq \{ M_c : c \in C_{\rm main} \}$. Then, since $\cM_{\rm main}^*$ is a set of matchings in $\cH_{\rm reg} \supseteq \cH$, $\cM_{\rm main}$ is a set of matchings in $\cH$. Since we obtain $\cH_{\rm small} \setminus (R_{\rm res} \cup \bigcup_{M \in \cM_{\rm diff}}M )$ after removing singleton edges from $\cH^*$,~\ref{MA1*} and~\ref{MA2*} immediately imply~\ref{MA1} and~\ref{MA2} stated below. Let $$\cH_{\rm rem} \coloneqq \cH_{\rm small} \setminus (R_{\rm res} \cup \bigcup_{M \in \cM_{\rm diff} \cup \cM_{\rm main}}M) = \cH_{\rm small} \setminus (R_{\rm res} \cup \bigcup_{c \in C_{\rm diff} \cup C_{\rm main}} M_c).$$ \begin{enumerate} \item[\mylabel{MA1}{\bf MA1}] For any $c \in C_{\rm main}$, $M_c$ is edge-disjoint from all the matchings in $\cM_{\rm diff} \cup \cM_{\rm hm}$, $M_c \supseteq \phi^{-1}(c)$, and $M_c \setminus \phi^{-1}(c) \subseteq \left ( \cH_{\rm small} \setminus (R_{\rm res} \cup \bigcup_{M \in \cM_{\rm diff}}M ) \right ) \cup R_2$. \item[\mylabel{MA2}{\bf MA2}] \begin{itemize} \item[(i)] For any $w \in V(\cH)$, $|E_{R_{\rm abs}}(w) \cap \bigcup_{c \in C_{\rm main}} M_c| \leq 2 \gamma D$, and \item[(ii)] $\Delta(\cH_{\rm rem}) \leq 2 \gamma D$. \end{itemize} \end{enumerate} Now let us define \begin{align*} R_3 \coloneqq R_2 \setminus \bigcup_{c \in C_{\rm main}} M_c^* \text{ and }S_3 \coloneqq S_2 \setminus \bigcup_{c \in C_{\rm main}} (U \setminus V(M_c^*)). \end{align*} Since $|C_{\rm main}| = D$, \begin{equation}\label{eq:boundS3} \textrm{if $|U| > (1-10\eps)n$, then $|S_3| \geq |S_2| - D \overset{\eqref{eq:boundS2}}{\geq} 4 \eps n$.} \end{equation} Moreover, by \eqref{eq:R2abs}, ~\ref{MA2}(i) and Observation~\ref{obs:del_absorber}, \begin{equation} \label{eq:R3abs} \text{$R_3$ is a $(\rho_{\rm abs} , 4\gamma , \xi , \eps)$-absorber for $\cV$.} \end{equation} \begin{pf-step} Finish colouring the remaining uncoloured edges of $\cH_{\rm small} \setminus R_{\rm res}$ by extending the colour classes in $\{\phi^{-1}(c) : c \in C_{\rm buff} \}$ using Lemma~\ref{lem:leftover}. \end{pf-step} Recall that $\cH_{\rm rem} = \cH_{\rm small} \setminus (R_{\rm res} \cup \bigcup_{c \in C_{\rm diff} \cup C_{\rm main}} M_c)$ is the hypergraph consisting of all the uncoloured edges in $\cH_{\rm small} \setminus R_{\rm res}$. In this step, we will first colour all the edges of $\cH_{\rm rem}$ with colours from the `buffer' set $C_{\rm buff}$ by extending the colour classes in $\{\phi^{-1}(c) : c \in C_{\rm buff} \}$, and the resulting colour classes are further extended to cover all but at most one vertex of $U$, by using only edges of $R_3 \subseteq R_{\rm abs}$. To do this, we want to apply Lemma~\ref{lem:leftover} with $C_{\rm buff}$, $\{ \phi^{-1}(c) : c\in C_{\rm buff} \}$, $r_1$, $\rho_{\rm abs}$, $R_3$ and $10 \gamma^{1/2}$ playing the roles of $C$, $\cM$, $r$, $\rho$, $R$ and $\gamma$, respectively. So now we check that the assumptions~\ref{L1}--\ref{L5} of Lemma~\ref{lem:leftover} are satisfied. First, $|C_{\rm buff}| = D' = \lfloor 10 \gamma^{1/2} D \rfloor$, so~\ref{L1} holds. For each $c \in C_{\rm buff}$, note that $\phi^{-1}(c)$ is either empty or is contained in $\cH_{\rm large}$, so\COMMENT{Here we used $\beta \ll \gamma \ll 1$} $|V(\phi^{-1}(c))| \leq \beta n \leq 5\gamma^{1/2} n$ by (\ref{large-edge-thm}:a)(iii) or (\ref{large-edge-thm}:b)(iii) of Theorem~\ref{large-edge-thm}. Thus~\ref{L2} holds. Since \eqref{eq:R3abs}\COMMENT{so $R_3$ is a $(\rho_{\rm abs} , 100 \gamma^{1/2} , \xi , \eps)$-absorber as well} holds and $\{U, V(\cH) \} \subseteq \cV$ by~\eqref{def:cv}, it follows that ~\ref{L3} holds. By~\eqref{eq:boundS3}, if $|U| > (1-10\eps)n$, then $|S_3| \geq 4 \eps n \geq (10 \gamma^{1/2} + \eps) n$\COMMENT{Here we used $\gamma \ll \eps \ll 1$}, so~\ref{L5} holds. Lastly, we show that~\ref{L4} holds. Note that~\ref{MA2}(ii) implies that $\Delta(\cH_{\rm rem}) \leq 2 \gamma D \leq (10 \gamma^{1/2})^2 D / 20$. Moreover, since for each $c \in C_{\rm buff}$, $\phi^{-1}(c)$ is either empty or is contained in $\cH_{\rm large}$, we have $\cH_{\rm rem} \subseteq \cH \setminus (R_3 \cup \bigcup_{c \in C_{\rm buff}} \phi^{-1}(c))$, and for any $e \in \cH_{\rm rem} \subseteq \cH_{\rm small}$, we have $| \{c \in C_{\rm buff} : e \cap V(\phi^{-1}(c)) \ne \varnothing \} | \leq 2 r_1 n/r_0 \leq (10\gamma^{1/2})^2 D/100$,\COMMENT{Here we used $r_0^{-1} \ll \gamma \ll 1$} by~\ref{EP2} of Claim~\ref{claim:easyobs}, as desired. Thus, by Lemma~\ref{lem:leftover}, we obtain a set of pairwise edge-disjoint matchings $\cM_{\rm buff} \coloneqq \{M_c : c \in C_{\rm buff} \}$ such that the following hold. \begin{enumerate} \item[\mylabel{B1}{\bf B1}] For any $c \in C_{\rm buff}$, $M_c$ is edge-disjoint from all the matchings in $\cM_{\rm diff} \cup \cM_{\rm hm} \cup \cM_{\rm main}$, $M_c \supseteq \phi^{-1}(c)$ and $\cH_{\rm rem} \subseteq \bigcup_{c \in C_{\rm buff}}(M_c \setminus \phi^{-1}(c)) \subseteq \cH_{\rm rem} \cup R_3$. In particular, $\cH_{\rm small} \setminus R_{\rm res} \subseteq \bigcup_{c \in C_{\rm diff} \cup C_{\rm main} \cup C_{\rm buff}}(M_c \setminus \phi^{-1}(c)) \subseteq \cH_{\rm small}$. \item[\mylabel{B2}{\bf B2}] If $|U| \leq (1-10\eps)n$, then $\cM_{\rm buff}$ has perfect coverage of $U$. Otherwise, $\cM_{\rm buff}$ has nearly-perfect coverage of $U$ with defects in $S_3$. \end{enumerate} Now we combine all the matchings constructed previously. Let us define \begin{equation*} \cM_{\rm prev}^* \coloneqq \cM_{\rm diff} \cup \cM_{\rm hm} \cup \cM_{\rm main}^* \cup \cM_{\rm buff} \text{ and } \cM_{\rm prev} \coloneqq \cM_{\rm diff} \cup \cM_{\rm hm} \cup \cM_{\rm main} \cup \cM_{\rm buff}, \end{equation*} where both $\cM_{\rm prev}^*$ and $\cM_{\rm prev}$ consist of pairwise edge-disjoint matchings by~\ref{HM1},~\ref{MA1*}, ~\ref{MA1}, and~\ref{B1}. Let us also define \begin{equation*} R_{\rm final} \coloneqq R_{\rm res} \setminus \bigcup_{M \in \cM_{\rm prev}} M,\:\:\:\:G_{\rm final} \coloneqq (V(\cH) , R_{\rm final}),\:\:\:\text{and }\:\:\:\cH_{\rm final} \coloneqq R_{\rm final} \cup \bigcup_{c \in C_{\rm final}} \phi^{-1}(c). \end{equation*} \begin{pf-step} Analyse properties of $G_{\rm final}$ and $\cH_{\rm final}$. \end{pf-step} In this step we will prove the following properties of $G_{\rm final}$ and $\cH_{\rm final}$. \begin{enumerate}[label = {{\bf{F}\arabic*}}] \item\label{eqn:bound_prev_colours} $(1-\rho)n \leq |\cM_{\rm prev}^*| = |\cM_{\rm prev}| = n - |C_{\rm final}| \leq (1-\rho + 15 \gamma^{1/2} )n.$ \item\label{stat:r_rem} If $(\cH , \phi)$ is of Type~${\rm A_2}$, then $\Delta(G_{\rm final}) - \delta(G_{\rm final}) \leq 22\eps n$, and $G_{\rm final}$ is lower $(\rho/4, \eps^{1/3})$-regular. \item\label{eqn:h_final} $\cH_{\rm final} = \cH \setminus \bigcup_{M \in \cM_{\rm prev}} M = \cH \setminus \bigcup_{M \in \cM_{\rm prev}^*} M$. Moreover, if $\phi$ is of Type~${\rm A}$, $\cH_{\rm final} = R_{\rm final}$. \end{enumerate} First, since $\cM_{\rm prev} = \{M_c : c \in C_{\rm med} \cup C_{\rm diff} \cup C_{\rm huge} \cup C_{\rm main} \cup C_{\rm buff} \}$ and $C_{\rm final} = [n] \setminus (C_{\rm med} \cup C_{\rm diff} \cup C_{\rm huge} \cup C_{\rm main} \cup C_{\rm buff})$,~\ref{eqn:bound_prev_colours} follows from~\eqref{eqn:bound_prev_col}. Now we prove~\ref{stat:r_rem}. First we show that for any $w \in V(\cH)$, \begin{equation}\label{eqn:deficit} d_{R_{\rm res} \setminus R_{\rm final}}(w) \leq 15 \gamma^{1/2} n. \end{equation} Indeed, by~\ref{MA1} and~\ref{MA2}(i), $d_{R_{\rm res} \setminus R_{\rm final}}(w) {\leq} |\cM_{\rm diff}| + |\cM_{\rm hm}| + 2\gamma n + |\cM_{\rm buff}|$, and by~\eqref{eqn:size_hm}, $|\cM_{\rm hm}| \leq 3\gamma n / 2$. The previous two inequalities together with the fact that $|\cM_{\rm diff}| \leq 1$ and $|\cM_{\rm buff}| = D' \leq 10\gamma^{1/2}n$, imply that~\eqref{eqn:deficit} holds. Now we show that $\Delta(G_{\rm final}) - \delta(G_{\rm final}) \leq 22 \eps n$. Indeed, since $R_{\rm final} \subseteq R_{\rm res}$ and $R_{\rm res}$ is a $(\rho , \xi , \eps , \cV)$-reservoir of Type $A_2$, ~\ref{R1} and~\ref{R2} of Definition~\ref{def:pseudoreg} imply that $\Delta(G_{\rm final}) \leq (\rho + \xi)n$. On the other hand,~\ref{R1} and~\ref{R2} of Definition~\ref{def:pseudoreg} also imply that $d_{R_{\rm res}}(w) \geq (\rho - 20 \eps)n$ for any $w \in V(\cH)$, so by ~\eqref{eqn:deficit}, we have $d_{R_{\rm final}}(w) \geq d_{R_{\rm res}}(w) - 15 \gamma^{1/2} n \geq (\rho - 20 \eps)n - 15 \gamma^{1/2} n \geq (\rho - 21 \eps)n$ for any $w \in V(\cH)$, so $\delta(G_{\rm final}) \geq (\rho - 21\eps)n$. Thus, $\Delta(G_{\rm final}) - \delta(G_{\rm final}) \leq (21 \eps + \xi)n \le 22 \eps n$, as desired. Now we show that $G_{\rm final}$ is lower $(\rho/4 , \eps^{1/3})$-regular. Since $(\cH , \phi)$ is of Type~${\rm A_2}$, $\cH$ is $(\rho,\eps)$-full, so $|V(\cH) \setminus U| \leq 10\eps n$. Thus, by~\ref{LR2}, it suffices to show that $G_{\rm final}[U]$ is lower $(\rho/3 , \eps^{1/2})$-regular.\COMMENT{We may apply~\ref{LR2} with a small $\alpha$, for example, $\alpha = 1/10000$, and $\rho/3, \eps^{1/2}$ playing the roles of $\rho, \xi$. Indeed, $v(G_{\rm final})/v(G_{\rm final}[U]) = n/|U| \leq n/(n - 10\eps n) \leq 1 + 100 \eps \leq 1 + \alpha \eps^{1/2}$.} To that end, note that by~\ref{RES2}, $R_{\rm abs}$ is lower $(\rho/2 , \xi , G')$-regular, so~\eqref{eqn:deficit} and~\ref{LR1}\COMMENT{Note that if $d_{R_{\rm res} \setminus R_{\rm final}}(w)\leq 15 \gamma^{1/2} n$ then, $d_{R_{\rm abs} \setminus R_{\rm final}}(w)\leq 15 \gamma^{1/2} n$ since $R_{\rm abs} \subseteq R_{\rm res}$.} imply that $R_{\rm abs} \cap R_{\rm final}$ is lower $(\rho/2 , \gamma^{1/5} , G')$-regular. Moreover, for any two disjoint sets $A,B \subseteq U$ with $|A|,|B| \geq \eps^{1/2}|U| \geq \eps^{1/2}n/2$,\COMMENT{here we used $|U| \geq (1-10\eps)n$ as $\cH$ is $(\rho,\eps)$-full} we have $e_{G'}(A,B) \geq (|A| - \eps n)|B| \geq (1 - 2 \eps^{1/2})|A||B|$.\COMMENT{In the second inequality we used that since $B \subseteq U = V_+^{(1-\eps)}(G)$, any vertex of $B$ is adjacent (in $G'$) to all but at most $\eps n$ vertices of $A$.} Therefore, for any two disjoint sets $A,B \subseteq U$ with $|A|,|B| \geq \eps^{1/2}|U| \geq \gamma^{1/5} n$, we have \begin{equation*} e_{G_{\rm final}[U]} (A,B) \geq \frac{\rho}{2} e_{G'}(A,B) - \gamma^{1/5} |A||B| \geq \frac{\rho }{2} (1 - 2 \eps^{1/2})|A||B| - \gamma^{1/5} |A||B| \geq (\rho/3 - \eps^{1/2})|A||B|, \end{equation*} so $G_{\rm final}[U]$ is lower $(\rho/3 , \eps^{1/2})$-regular, completing the proof of~\ref{stat:r_rem}. Finally, we prove~\ref{eqn:h_final}. Since $\cH = \cH_{\rm small} \cup (\cH_{\rm med} \cup \cH_{\rm large})$ and $\cH_{\rm final} = R_{\rm final} \cup \bigcup_{c \in C_{\rm final}} \phi^{-1}(c)$, in order to show that $\cH_{\rm final} = \cH \setminus \bigcup_{M \in \cM_{\rm prev}}M$, it suffices to prove the following two statements. \begin{equation}\label{eqn:h_final_eq} \cH_{\rm small} \setminus \bigcup_{M \in \cM_{\rm prev}} M = R_{\rm final}\:\:\:\:\:\text{ and }\:\:\:\:\:(\cH_{\rm med} \cup \cH_{\rm large}) \setminus \bigcup_{M \in \cM_{\rm prev}} M = \bigcup_{c \in C_{\rm final}}\phi^{-1}(c). \end{equation} The first statement of~\eqref{eqn:h_final_eq} directly follows from the fact that $\cH_{\rm small} \setminus R_{\rm res} \subseteq \bigcup_{M \in \cM_{\rm prev}} M$ which is guaranteed by ~\ref{B1}. Now we show the second statement of~\eqref{eqn:h_final_eq}. To that end, first note that~\ref{D1},~\ref{HM1},~\ref{MA1}, and~\ref{B1} together imply that for each $c \in [n] \setminus C_{\rm final}$, $\phi^{-1}(c) \subseteq M_c \in \cM_{\rm prev}$, so $\bigcup_{c \in [n]\setminus C_{\rm final}} \phi^{-1}(c) \subseteq \bigcup_{M \in \cM_{\rm prev}} M$. Moreover, $\bigcup_{c \in [n] \setminus C_{\rm final}}(M_c \setminus \phi^{-1}(c)) \subseteq \cH_{\rm small}$, so $\bigcup_{M \in \cM_{\rm prev}}M \cap \bigcup_{c \in C_{\rm final}} \phi^{-1}(c) = \varnothing$. This proves that ~\eqref{eqn:h_final_eq} holds, showing that $\cH_{\rm final} = \cH \setminus \bigcup_{M \in \cM_{\rm prev}}M$. Since $\cH$ has no singleton edges, it immediately follows that $\cH \setminus \bigcup_{M \in \cM_{\rm prev}}M = \cH \setminus \bigcup_{M \in \cM_{\rm prev}^*} M$. Moreover, if $\phi$ is of Type~${\rm A}$, then by~\ref{T1}, $\bigcup_{c \in C_{\rm final}}\phi^{-1}(c) = \varnothing$, so $\cH_{\rm final} = R_{\rm final}$. This completes the proof of~\ref{eqn:h_final}. \begin{pf-step} Bound the degrees of vertices in $\cH_{\rm final}$. \end{pf-step} In this step we prove the following statements when bounding the number of colours used in the final step. \begin{enumerate} \item[\mylabel{UC1}{\bf UC1}] For any $w \in V(\cH) \setminus U$, $d_{\cH_{\rm final}}(w) \leq |C_{\rm final}| - \rho \eps n/4$. \item[\mylabel{UC2}{\bf UC2}] For any $w \in U \setminus V^{(n-1)}(\cH)$, $d_{\cH_{\rm final}}(w) \leq |C_{\rm final}| - 1$. \item[\mylabel{UC3}{\bf UC3}] For any $w \in V^{(n-1)}(\cH)$, $d_{\cH_{\rm final}}(w) \leq |C_{\rm final}|$. Moreover, there are at least $|C_{\rm final}|$ vertices of degree less than $|C_{\rm final}|$ in $\cH_{\rm final}$. \item[\mylabel{UC4}{\bf UC4}] If $(\cH , \phi)$ is either Type~${\rm A_1}$ or~${\rm B}$, then for any $w \in V^{(n-1)}(\cH)$, $d_{\cH_{\rm final}}(w) \leq |C_{\rm final}| - 1$. \end{enumerate} Now we prove~\ref{UC1}. First we show that for any $w \in V(\cH) \setminus U$, $d_{R_{\rm res}} (w) \leq \rho(1-\eps)n + \xi n$. Indeed, if $R_{\rm res}$ is a $(\rho, \xi , \eps , \cV)$-reservoir of Type~${\rm A_1}$ or~${\rm A_2}$, then it follows from~\ref{P1} or ~\ref{R2}. Otherwise, if $R_{\rm res}$ is a $(\rho, \xi , \eps , \cV)$-reservoir of Type~${\rm B}$, then it also follows since $R_{\rm res}$ is $(\rho, \xi , G')$-typical with respect to $\mathcal V \ni V(\cH)$. Thus, for any $w \in V(\cH) \setminus U$,\COMMENT{For the first inequality where we used ~\ref{eqn:bound_prev_colours} below, the calculation is as follows. Since $\xi, \gamma \ll \rho, \eps$, we have $\rho(1-\eps)n + \xi n \leq (\rho - 15 \gamma^{1/2})n + (15 \gamma^{1/2} + \xi - \rho \eps)n \leq n - |\cM_{\rm prev}| - \rho \eps n / 2$.} \begin{equation} \label{boundingGfinal} d_{G_{\rm final}} (w) \leq d_{R_{\rm res}} (w) \leq \rho(1-\eps)n + \xi n \overset{~\ref{eqn:bound_prev_colours}}{\leq} n - |\cM_{\rm prev}| - \rho \eps n / 2 \overset{~\ref{eqn:bound_prev_colours}}{=} |C_{\rm final}| - \rho \eps n / 2. \end{equation} Since $w$ is incident to at most $2n/r_0 \leq \rho \eps n / 4$ edges of $\cH_{\rm large}$, and $\cH_{\rm final} \setminus R_{\rm final} = \bigcup_{c \in C_{\rm final}} \phi^{-1}(c) \subseteq \cH_{\rm large}$ by~\ref{T1} and~\ref{T2}, we deduce that $d_{\cH_{\rm final} \setminus R_{\rm final}}(w) \leq \rho \eps n / 4$. This together with \eqref{boundingGfinal} implies that for any $w \in V(\cH) \setminus U$, $d_{\cH_{\rm final}}(w) = d_{G_{\rm final}}(w) + d_{\cH_{\rm final} \setminus R_{\rm final}}(w) \leq |C_{\rm final}| - \rho \eps n / 4$, proving ~\ref{UC1}. Before proving~\ref{UC2},~\ref{UC3}, and~\ref{UC4}, we need to collect some facts. For any $w \in V(\cH)$, let $m(w)$ be the number of the matchings in $\cM_{\rm prev}^*$ not covering $w$. Since $\cM_{\rm prev}^*$ is a set of edge-disjoint matchings in $\cH_{\rm reg}$, and $\cH_{\rm reg}$ is a linear multi-hypergraph obtained from $\cH$ by adding $\max(0 , n - 3 - d_\cH(w))$ singleton edges incident to each vertex $w \in V(\cH)$ (where $\cH$ has no singleton edges), we deduce that all but at most $m(w) + \max(0 , n-3-d_\cH(w))$ matchings in $\cM_{\rm prev}$ cover $w$. Moreover, by ~\ref{eqn:h_final}, $\cH_{\rm final} = \cH \setminus \bigcup_{M \in \cM_{\rm prev}}M$, so for any $w \in V(\cH)$ we have\COMMENT{The equality below follows by using $|\cM_{\rm prev}| = n - |C_{\rm final}|$ and $d_{\cH}(w) - n + \max(0,n-3-d_\cH(w)) = \max(d_\cH(w) - n , -3) = -\min(n - d_\cH(w) , 3)$.} \begin{align} d_{\cH_{\rm final}}(w) &\leq d_{\cH}(w) - (|\cM_{\rm prev}| - m(w) - \max(0,n-3-d_{\cH}(w))) \nonumber \\ \overset{\ref{eqn:bound_prev_colours}}&{=} |C_{\rm final}| + m(w) - \min(n - d_{\cH}(w) , 3).\label{eqn:deg_h_final} \end{align} Recall from Step~\ref{step:diff} that $S_1 = S \setminus \bigcup_{c \in C_{\rm diff}}(V^{(n-2)}(\cH) \setminus V(M_c))$. Note that~\ref{D1} implies that every matching in $\cM_{\rm diff}$ covers all of the vertices in $V^{(n-1)}(\cH)$, and~\ref{HM2},~\ref{MA3}, and~\ref{B2} imply that $\cM_{\rm hm} \cup \cM_{\rm main}^* \cup \cM_{\rm buff} = \cM_{\rm prev}^* \setminus \cM_{\rm diff} $ has nearly-perfect coverage of $U$ with defects in $S_1$. In particular, every matching in $\cM_{\rm prev}^* \setminus \cM_{\rm diff}$ covers all the vertices in $U \setminus S_1$, every matching in $\cM_{\rm diff}$ covers all the vertices in $V^{(n-1)}(\cH) \setminus S_1$ and $|\cM_{\rm diff}| \leq 1$. Thus, we have \begin{equation}\label{eqn:mbound_1} \text{$m(u) \leq 1$ for any $u \in U \setminus S_1$, and $m(v) = 0$ for any $v \in V^{(n-1)}(\cH) \setminus S_1$.} \end{equation} Now note that every vertex in $S_1$ is covered by all but at most one matching in $\cM_{\rm prev}^* \setminus \cM_{\rm diff}$, every matching in $\cM_{\rm diff}$ covers all the vertices in $V_+^{(n-2)}(\cH) \cap S_1$ and $|\cM_{\rm diff}| \leq 1$. So we have $m(u) \leq 2$ for any $u \in S_1$ and $m(v) \leq 1$ for any $v \in V_+^{(n-2)}(\cH) \cap S_1$. Combining this with~\eqref{eqn:mbound_1}, we deduce that \begin{equation}\label{eqn:mbound_2} \text{$m(u) \leq 2$ for any $u \in U \setminus V_+^{(n-2)}(\cH)$, and $m(v) \leq 1$ for any $v \in V_+^{(n-2)}(\cH)$.} \end{equation} Finally, if $|U| \leq (1-10\eps)n$ then $\cM_{\rm prev}^* \setminus \cM_{\rm diff}$ has perfect coverage of $U$ by~\ref{HM2},~\ref{MA3}, and~\ref{B2}. This combined with the fact that every matching in $\cM_{\rm diff}$ covers all the vertices in $V^{(n-1)}(\cH)$ and $|\cM_{\rm diff}| \leq 1$, implies that \begin{equation}\label{eqn:mbound_3} \text{if $|U| \leq (1-10\eps)n$, then $m(u) \leq 1$ for $u \in U \setminus V^{(n-1)}(\cH)$, and $m(v) = 0$ for $v \in V^{(n-1)}(\cH)$.} \end{equation} Now we are ready to prove~\ref{UC2},~\ref{UC3}, and~\ref{UC4}. Note that \eqref{eqn:mbound_2} and~\eqref{eqn:deg_h_final} together imply that for any $v \in U \setminus V^{(n-1)}(\cH)$, $d_{\cH_{\rm final}}(v) \leq |C_{\rm final}| - 1$ , thus~\ref{UC2} holds. Now we prove~\ref{UC3}. Note that \eqref{eqn:mbound_2} and~\eqref{eqn:deg_h_final} together imply that for any $v \in V^{(n-1)}(\cH)$, $d_{\cH_{\rm final}}(v) \leq |C_{\rm final}|$. To prove the second statement of ~\ref{UC3}, we will bound the number of vertices $v \in V^{(n-1)}(\cH)$ satisfying $m(v) = 0$. Since $\cM_{\rm prev}^* \setminus \cM_{\rm diff}$ has nearly-perfect coverage of $U$ with defects in $S_1$, every matching in $\cM_{\rm prev}^* \setminus \cM_{\rm diff}$ covers all but at most one vertex in $U$. Moreover, every matching in $\cM_{\rm diff}$ covers all of the vertices in $V^{(n-1)}(\cH)$. Thus, by~\ref{eqn:bound_prev_colours}, there are at most $|\cM_{\rm prev}| = n - |C_{\rm final}|$ vertices $v \in V^{(n-1)}(\cH)$ satisfying $m(v) \geq 1$, so every other vertex of $V^{(n-1)}(\cH)$ has degree less than $|C_{\rm final}|$ by~\eqref{eqn:deg_h_final}. This fact combined with~\ref{UC1} and~\ref{UC2} implies that there are at least $|C_{\rm final}|$ vertices with degree less than $|C_{\rm final}|$ in $\cH_{\rm final}$, proving ~\ref{UC3}. Finally, if $(\cH , \phi)$ is of Type~${\rm A_1}$ then $S_1 \subseteq S = U \setminus V^{(n-1)}(\cH)$ by~\eqref{def:s}, so by ~\eqref{eqn:mbound_1} every vertex $v \in V^{(n-1)}(\cH)$ satisfies $m(v) = 0$. On the other hand, if $(\cH , \phi)$ is of Type~${\rm B}$, then by~\ref{EP3} of Claim~\ref{claim:easyobs}, $|U| \leq 2 \delta n$, so again every vertex $v \in V^{(n-1)}(\cH)$ satisfies $m(v) = 0$ by ~\eqref{eqn:mbound_3}. Thus, in either case we have $d_{\cH_{\rm final}}(v) \leq |C_{\rm final}| - 1$ by~\eqref{eqn:deg_h_final}, proving~\ref{UC4}. \begin{pf-step} Colour $\cH_{\rm final}$ with colours in $C_{\rm final}$. \end{pf-step} We divide the proof into three cases depending on the type of $(\cH , \phi)$. In each case, it suffices to show that there is a set $\cM_{\mathrm{final}} = \{M_c : c \in C_{\mathrm{final}}\}$ of edge-disjoint matchings in $\cH_{\mathrm{final}}$ such that for every $c\in C_{\mathrm{final}}$, $\phi^{-1}(c) \subseteq M_c$ and $\bigcup_{c\in C_{\mathrm{final}}} M_c = \cH_{\mathrm{final}}$. Indeed, then $\cH = \bigcup_{M \in \cM_{\rm prev} \cup \cM_{\rm final}} M$ by~\ref{eqn:h_final}, so $\cM_{\rm prev} \cup \cM_{\rm final}$ would be the desired set of $n$ pairwise edge-disjoint matchings in $\cH$, proving Theorem~\ref{main-thm}.\\ \noindent \textit{Case 1}: $(\cH , \phi)$ is of Type~${\rm A_1}$. Note that in this case $\cH_{\rm final} = R_{\rm final}$ by~\ref{eqn:h_final}, and recall that $G_{\rm final} = (V(\cH), R_{\rm final})$. Thus, by~\ref{UC1},~\ref{UC2}, and~\ref{UC4}, $\Delta(G_{\rm final}) \leq |C_{\rm final}| - 1$. Applying Vizing's theorem (Theorem~\ref{thm:vizing}) to $G_{\rm final}$, we obtain a set $\cM_{\rm final} = \{ M_c : c \in C_{\rm final} \}$ of edge-disjoint matchings in $G_{\rm final}$ such that $\bigcup_{c \in C_{\rm final}} M_c = R_{\rm final} = \cH_{\mathrm{final}}$. Moreover, by~\ref{T1}, for any $c \in C_{\rm final}$, $\phi^{-1}(c) = \varnothing$, so $\phi^{-1}(c) \subseteq M_c$ trivially holds, as desired. This completes the proof of Theorem~\ref{main-thm} in the case when $(\cH , \phi)$ is of Type~${\rm A_1}$.\\ \noindent \textit{Case 2}: $(\cH , \phi)$ is of Type~${\rm A_2}$. Note that in this case $\cH_{\rm final} = R_{\rm final}$ by~\ref{eqn:h_final}. Thus, by ~\ref{UC1},~\ref{UC2}, and~\ref{UC3}, $\Delta(G_{\rm final}) \leq |C_{\rm final}|$, and \begin{equation}\label{eqn:count_maxdeg} \textrm{there are at least $|C_{\rm final}|$ vertices having degree less than $|C_{\rm final}|$ in $G_{\rm final}$.} \end{equation} If $\Delta(G_{\rm final}) \leq |C_{\rm final}| - 1$, then we may apply Vizing's theorem (Theorem~\ref{thm:vizing}) to $G_{\rm final}$ to obtain the desired set $\cM_{\rm final} = \{ M_c : c \in C_{\rm final} \}$ of edge-disjoint matchings where for any $c\in C_{\mathrm{final}}$, $\phi^{-1}(c) \subseteq M_c$, and $\bigcup_{c \in C_{\rm final}} M_c = R_{\rm final} = \cH_{\mathrm{final}}$ as in the previous case. Otherwise, if $\Delta(G_{\rm final}) = |C_{\rm final}|$, then by~\eqref{eqn:count_maxdeg} and~\ref{stat:r_rem}, we can apply\COMMENT{we used $\rho \gg \eps$ in this case} Corollary~\ref{cor:optcol} with $\rho/4$, $\eps^{1/3}$, $22\eps$, and $G_{\rm final}$ playing the roles of $p$, $\eps$, $\eta$, and $G$, respectively, to obtain a set $\cM_{\rm final} = \{ M_c : c \in C_{\rm final} \}$ of edge-disjoint matchings such that $\bigcup_{c \in C_{\rm final}} M_c = R_{\rm final} = \cH_{\mathrm{final}}$. Moreover, by~\ref{T1}, for any $c \in C_{\rm final}$, $\phi^{-1}(c) = \varnothing$, so $\phi^{-1}(c) \subseteq M_c$ trivially holds, as desired. This completes the proof of Theorem~\ref{main-thm} in the case when $(\cH , \phi)$ is of Type~${\rm A_2}$.\\ \noindent \textit{Case 3}: $(\cH , \phi)$ is of Type~${\rm B}$. First, for each $w \in V(\cH)$, let us define $C_w \coloneqq \{c \in C_{\rm final} : w \in V(\phi^{-1}(c)) \}$. Note that by definition, $\cH_{\rm final} \setminus R_{\rm final} = \bigcup_{c \in C_{\rm final}} \phi^{-1}(c)$, and by~\ref{T2}, for any $c \in C_{\rm final}$, $\phi^{-1}(c) \subseteq \cH_{\rm large}$. Thus, for any vertex $w \in V(\cH)$, we have \begin{equation}\label{eqn:boundc_w} |C_w| = d_{\cH_{\rm final} \setminus R_{\rm final}}(w) \leq 2 \delta n, \end{equation} since $\phi$ is a proper edge-colouring, and $w$ is incident to at most $2n / r_0 \leq 2 \delta n$ edges of $\cH_{\rm large}$. Note that~\ref{UC1},~\ref{UC2}, and~\ref{UC4} imply $\Delta(\cH_{\rm final}) \leq |C_{\rm final}| - 1$, so for any vertex $w \in V(\cH)$, we have \begin{equation}\label{eqn:bound_deg_all} d_{R_{\rm final}}(w) = d_{\cH_{\rm final}}(w) - d_{\cH_{\rm final}\setminus R_{\rm final}}(w) \overset{\eqref{eqn:boundc_w}}{\leq} |C_{\rm final}| - 1 - |C_w|. \end{equation} Now we apply Lemma~\ref{hall-based-finishing-lemma} with $G_{\rm final}$, $C_{\rm final}$, and $2 \delta$ playing the roles of $H$, $C$, and $\delta$, respectively. To that end, we need to check that the assumptions~\ref{cond:hall1}--\ref{cond:hall4} of Lemma~\ref{hall-based-finishing-lemma} are satisfied. First, by~\ref{eqn:bound_prev_colours}, $|C_{\rm final}| \geq (\rho - 15 \gamma^{1/2})n \geq 14\delta n$. By~\eqref{eqn:bound_deg_all}, ~\ref{cond:hall1} of Lemma~\ref{hall-based-finishing-lemma} holds. Now, by~\ref{EP3} of Claim~\ref{claim:easyobs}, $|U| \leq 2 \delta n$, and by Definition~\ref{def:absorber}\ref{cond:absorber1} and~\ref{RES2}, $R_{\rm final} \subseteq R_{\rm res} = R_{\rm abs} \subseteq E(G')$. Thus, every edge of $G_{\rm final}$ is incident to a vertex of $U$ by the definition of $G'$ given before {\bf Step~\ref{step:step1}}, so ~\ref{cond:hall2} of Lemma~\ref{hall-based-finishing-lemma} holds. By~\eqref{eqn:boundc_w}, ~\ref{cond:hall3} of Lemma~\ref{hall-based-finishing-lemma} holds. Finally, by ~\ref{T2}, for any $c \in C_{\rm final}$, $|\{w \in V(\cH) : c \in C_w \}| = |V(\phi^{-1}(c))| \leq \beta n \leq 2 \delta n$, so ~\ref{cond:hall4} of Lemma~\ref{hall-based-finishing-lemma} holds. Hence, by applying Lemma~\ref{hall-based-finishing-lemma}, we obtain a proper edge-colouring $\psi : R_{\rm final} \to C_{\rm final}$ such that every $uv \in R_{\rm final}$ satisfies $\psi(uv) \notin C_u \cup C_v$, implying that $V(\psi^{-1}(c)) \cap V(\phi^{-1}(c)) = \varnothing$ for every $c \in C_{\rm final}$. Now let $M_c \coloneqq \psi^{-1}(c) \cup \phi^{-1}(c)$ for each $c \in C_{\rm final}$. Then the set $\cM_{\rm final} \coloneqq \{ M_c : c \in C_{\rm final} \}$ consists of pairwise edge-disjoint matchings\COMMENT{This easily follows since $\psi^{-1}(c)$ and $\phi^{-1}(c)$ are colour classes.} such that $\phi^{-1}(c) \subseteq M_c$ for each $c \in C_{\rm final}$, and $\bigcup_{c \in C_{\rm final}} M_c = R_{\rm final} \cup \bigcup_{c \in C_{\rm final}} \phi^{-1}(c) = \cH_{\rm final}$, as desired. This completes the proof of Theorem~\ref{main-thm}. \end{proof} \begin{comment} \subsection{Colouring remaining edges} \begin{enumerate}[(1)] \item Colour large and medium edges first using Theorem~\ref{large-edge-thm} in Section~\ref{large-edge-section}. \item Consider the colour classes for huge edges. First we claim at most one of these colour classes is difficult. If~\ref{extremal-colouring}, then $|U|$ is small by the volume argument, so a colour class covering three-fourths of $\overline U$ covers at least $2n/3$ vertices. By a volume argument again, there can't be such a huge edge colour class. If~\ref{non-extremal-colouring}, these colour classes are singletons. Thus, if there are two edges that cover at least three-fourths of the vertices in $\overline U$, then they overlap if $|\overline U| \geq 2$, contradicting linearity of the hypergraph. Now absorb the difficult colour class with Lemma~\ref{difficult-edge-absorption}. Call it $M^{\mathrm{huge}}_1$. Let $\cH'$ be the graph obtained from $\cH$ by adding a dummy singleton to every $(n - 2)$-degree vertex not covered by $M^{\mathrm{huge}}_1$. \item Find the reservoir, avoiding $M^{\mathrm{huge}}_1$. \item Absorb the remaining colour classes containing huge edges with Lemma~\ref{huge-edge-absorption-lemma}. Note that the color classes from huge edges cover at most $\eps n$ vertices of $U$, because in~\ref{extremal-colouring} they cover at most $2\delta n$ vertices in total, and in~\ref{non-extremal-colouring} they're singletons, and a single edge covers at most $\eps n$ vertices of $U$ by the linearity of $\cH$. Call them $M^{\mathrm{huge}}_2, \dots$. \item Use one of Lemma~\ref{crossing-absorption-lemma} or~\ref{internal-absorption-lemma} to absorb medium edges. Call them $M^{\mathrm{med}}_1, \dots, $. \item Partition $\cH_{\mathrm{small}}$ using Lemma~\ref{partitioning-lemma}. \item For $i \in [r_0 - 1]$, split $\cH_i$ randomly into parts of maximum degree $\kappa n$, say $\cH_{i, 1}, \dots, \cH_{i, k}$, and also make uniform and regular. Don't use more than $n - 2 - d(v)$ dummy edges for any vertex $v$. \item Apply nibble, Lemma~\ref{nibble-thm} to each $\cH_{i, j}$ to find matchings that almost cover and are absorbable. For this we use $(1 - \rho)n$ colours. \item Use one of Lemma~\ref{crossing-absorption-lemma} or~\ref{internal-absorption-lemma} to absorb each of these. (Actually, this step alternates with the previous one). More precisely, say $\cM$ is the set of matchings we have built so far. If $|U| \leq (1 - 10\eps)n$, or if $|U^-| \geq n - \rho n + 10\eps n$ (that is, if $\cH$ is not $(\rho, \eps)$-full), then it has perfect coverage of $U$ (in $\cH')$, and otherwise it has nearly-perfect coverage. We make sure it preserves the reservoir because each vertex in $U$ has been uncovered at most $\gamma n$ times at this point, and we used at most $2\gamma n$ reservoir edges at each vertex for the medium edges. \item By the pseudorandomness of the matchings from Lemma~\ref{nibble-thm}, what remains has max degree at most $\gamma n$. Use Lemma~\ref{finishing-non-graph-lemma} to finish off the non-reservoir edges with at most $\sqrt \gamma n$ additional colours. \item Use one of Lemma~\ref{crossing-absorption-lemma} or~\ref{internal-absorption-lemma} to absorb from the previous step. This also uses at most $2\gamma n$ additional colours, and only reservoir edges remain. \subsection{Remaining edges in the non-extremal case} We have used $(1-\rho)n$ colours for the $d-1$ phases. After $(d-1)$th phase, we use Kahn's argument to colour all leftover edges using $2pn$ colours, where we use the absorption for the $U$-vertices if they are uncovered -- so we have used $(1-\rho)n + 2pn$ colours in total for $(d-1)$ phases and Kahn-colours. In these $(1-\rho)n + 2pn$ colour classes, for any $U$-vertex $w$, we have used exactly $(1-\rho)n + 2pn - m(w)$ edges among all edges incident to $w$ including the dummy edges (and reserved edges), where $m(w)$ is the number of colour classes where $w$ is marked. For any non-$U$ vertex $w$, we have used at least $(1-\rho)n + 2pn - pn$ edges among all edges incident to $w$ including dummy edges, since we cannot do the absorption for the colour classes where $w$ is uncovered.\\ With this in mind, now we have $\rho n - 2pn$ colours left to use Vizing or GKO for the final stage. Let us estimate the number of remaining edges at the end. \begin{itemize} \item For any vertex $w$ of degree at least $n - \beta n/2$, since we have not added any dummy edge to $w$, there are exactly $d(w) - (1-\rho)n - 2pn + m(w)$ remaining edges at $w$. Here $m(w)$ denotes the number of colour classes where $w$ is marked. Note that $m(w) = 1$ only if $d(w) \leq n-2$ or ($d(w) = n-1$ and we use GKO), and $m(w) = 2$ only if $d(w) \leq n-3$. This implies that $d(w) - (1-\rho)n - 2pn + m(w)$ is at most $\rho n - 2pn - 1$ if we use Vizing, and at most $\rho n - 2pn$ if we use GKO at the final stage. \item For any vertex $w \in U$ of degree at most $n - \beta n / 2$, since we have added at most $(1-\rho)(n-1) - d(w) + \rho d_G(w)$ dummy edges at $w$ and used at least $(1-\rho)n + 2pn - 2$ edges for $(1-\rho)n + 2pn$ colour classes, by~\eqref{eqn:totdummy}, we have at most \begin{align*} &d(w) + \left [(1-\rho)(n-1) - d(w) + \rho d_G(w) + \frac{\rho \beta n}{4} \right ] - [(1-\rho)n + 2pn - 2] \\ &\leq \rho d_G(w) - 2pn + 2 + \frac{\rho \beta n}{4}\\ &\leq \rho n - \frac{\rho \beta n}{2} - 2pn + 2 + \frac{\rho \beta n}{4}\\ &\leq \rho n - 2pn - 1 \end{align*} graph edges at $w$, which is less than the number of available colours ($\rho n - 2pn$). \item For any non-$U$ vertex $w$, since we have added at most $(1-\rho)(n-1) - d(w) + \rho d_G(w)$ dummy edges at $w$ and used at least $(1-\rho)n + 2pn - pn$ edges for $(1-\rho)n + 2pn$ colour classes, by~\eqref{eqn:totdummy}, we have at most \begin{align*} &d(w) + \left [(1-\rho)(n-1) - d(w) + \rho (1-\varepsilon)n + \frac{\rho \beta n}{4} \right ] - [(1-\rho)n + 2pn - pn] \\ &\leq \rho (1-\varepsilon)n + \frac{\rho \beta n}{4} + pn \end{align*} graph edges at $w$, which is less than the number of available colours ($\rho n - 2pn$) since we have $\beta , p \ll \varepsilon$. \end{itemize} \item Decompose remaining reservoir edges by cases. Now we have $(\rho - 2\gamma)n$ colours remaining. In the non-extremal case, we can assume these colours are not used on the large or medium edges. Since colour classes are good, vertices in $U$ have degree at most $(\rho - 2\gamma)n$ and vertices in $\overline U$ have degree at most $(\rho - \eps + \gamma)n$. \end{enumerate} \begin{enumerate}[(a)] \item In the extremal case, we have $|U| \leq \delta n$, because if large and medium edges require most of the colours, then Theorem~\ref{large-edge-thm} ensures a large volume set of large edges, so $U$ is small or else there's too much total volume. Use ad hoc Hall-based argument in Lemma~\ref{hall-based-finishing-lemma} applied to edge crossing from $U$ to $\overline{U}$. \item In the non-extremal case, the remaining colours haven't been used anywhere. If we don't have to mark full-degree vertices, we can just use Vizing. \begin{itemize} \item Suppose $|U| < (1 - 2\eps)n$. We can manage to avoid marking full-degree-vertices, unless $|U|$ is odd, $U$ consists only of full-degree vertices, and the complement of $U$ is contained in a giant edge. This extremal example clearly can be coloured with $n$ colours, otherwise use Vizing's. \item If $|U^-| \geq n - \rho n + 2\gamma n$, we can avoid marking full-degree-vertices and thus use Vizing's. \item Otherwise, assume $|U| \geq (1 - 2\eps)n$ and $|U^-| < (1 - \rho + 2\gamma)n$, which implies that $|U\setminus U^-| \geq (\rho-2\varepsilon - 2\gamma)n \geq cn / 2$ (using $\eps \ll c$). Here we allow marking full-degree vertices, thus we cannot use Vizing at the end. In this case, we reserved $(\rho -3\varepsilon)n$ edges at each $\overline U$ vertex, so that at the end it's almost $\rho n$-regular with degree error $O(\varepsilon n)$, we can use GKO and Kelly's. More precisely, using the randomness of reservoir edges for $U$-vertices, we can show that the remaining graph is lower-$(\rho,\varepsilon')$-regular, where $\varepsilon \ll \varepsilon' \ll \rho$. x Here, the reservoir edges for $\overline{U}$-vertices are not random-like, because they are only incident to full-degree vertices. But still there are only a few (at most $2 \varepsilon n$) vertices in $\overline{U}$, which is much smaller than $\varepsilon' n$ by the hierarchy $\varepsilon \ll \varepsilon'$ to guarantee the lower $(\rho,\varepsilon')$-regularity of the remaining graph. \end{itemize} \end{enumerate} \end{comment}
\section{Introduction} Heavy Flavour decays are usually described by low energy effective Hamiltonians forming an Effective Field Theory (EFT) (see, e.g. reference \cite{Buchalla} for a review). The Hamiltonians are written as: \begin{equation} H = \sum_{i} V_{CKM}^i C_i(\mu) O_i(\mu), \end{equation} where $C_i(\mu)$ are the Wilson coefficients integrating out the physics above the scale $\mu$ (short range), $O_i(\mu)$ are current operators which matrix elements represent the low energy (non-perturbative/long range) hadronic physics, and $\mu$ is the renormalization scale (typically $\sim 1 \ensuremath{\mathrm{\,Ge\kern -0.1em V}}\xspace$) distinguishing the two regimes. $V_{CKM}^i$ represents the flavour coupling associated to an operator $O_i$, i.e., Cabibbo-Kobayashi-Maskawa (CKM) matrix elements for SM operators. The Wilson coefficients thus represent the quantities which are impacted by the intervention of BSM physics.\\ For the semileptonic tree decays, the coupling of the mediating $W$ boson does not discriminate between lepton flavours in the SM. On the contrary, a BSM mediator might exhibit different couplings between light and heavy leptons. This is referred to as Lepton Flavour Universality Violation (LFUV). Such an effect could also occur for the semileptonic loop decays $b\ensuremath{\rightarrow}\xspace s\ell\ell$ where the dominant operators are $O_7,~O_9,~O_{10}$. Loop decays could also be the ground of new dynamics involving Lepton Flavour Violation (LFV) where leptons of different flavours are produced together. A review of various LHCb analyses is proposed. Several of them exhibit deviations from SM that can be explained consistently with theoretical models. \section{Semileptonic tree decays} The dominant decays ($b\ensuremath{\rightarrow}\xspace c \ell^- \bar\nu$) of this kind are generically written as $H_b\ensuremath{\rightarrow}\xspace H_c \ell^- \bar\nu$ where $H_b$ is a $b$ hadron and $H_c$ is a charm hadron. The search for a possible LFUV is performed through the measurement of the ratio: \begin{equation} R(H_c) = \frac{\mathcal{B}(H_b\ensuremath{\rightarrow}\xspace H_c \tau^- \bar{\nu})}{\mathcal{B}(H_b\ensuremath{\rightarrow}\xspace H_c \mu^- \bar{\nu})}, \end{equation} where $\mathcal{B}$ denotes the branching fraction. A BSM mediating heavy boson might couple preferentially to the tau lepton, as in Fig.\ref{Fig:btoctau_Higgs}, and thus produce a $R(H_c)$ ratio different from the expected SM-based calculations. \begin{figure}[htb \begin{center} \includegraphics[width=0.4\textwidth]{btoctaunu_higgs.pdf} \end{center} \vspace{-1.3cm} \caption{$b\ensuremath{\rightarrow}\xspace c\tau^-\bar\nu$ semileptonic transition with a mediating $W$ or charged Higgs boson as derived from 2HDM models discussed e.g. in Ref.\cite{Higgsrev_2HDM}.} \label{Fig:btoctau_Higgs} \end{figure} The modes $\bar{B}^0 \ensuremath{\rightarrow}\xspace D^{+(*)} \ell^- \bar\nu$ have drawn attention both at the $b$ factories and the LHCb experiment. The LHCb collaboration has been focusing so far on $R(D^{*+})$, where $D^{*+}$ is reconstructed via $D^{*+}\ensuremath{\rightarrow}\xspace D^0(\ensuremath{\rightarrow}\xspace {\ensuremath{\kaon^-}}\xspace{\ensuremath{\pion^+}}\xspace){\ensuremath{\pion^+}}\xspace$. The $\tau$ lepton is reconstructed in the muonic mode, $\tau^-\ensuremath{\rightarrow}\xspace\mu^-\bar{\nu}_\mu\nu_\tau$ \cite{Dstar_MuMode}, or the hadronic mode $\tau\ensuremath{\rightarrow}\xspace\pi\pi\pi(\pi^0)\nu_\tau$ \cite{Dstar_HadMode}. The discriminating variables include the missing mass, $m_{miss}^2 = (P_B-P_{D^*}-P_\mu)^2$, the momentum transfer $q^2 = (P_B-P_{D^*})^2$, the muon energy $E_\mu^*$, the $\tau$ lifetime (for the hadronic mode) and a Boost Decision Trees classifier \cite{BDT} to reject double-charm decays of the type $B \ensuremath{\rightarrow}\xspace D D X$ (for the hadronic mode). The muonic tau analysis \cite{Dstar_MuMode} obtained a measurement of $R(D^{*+})=0.336\pm0.027(stat)\pm0.030(syst)$ while the hadronic tau study \cite{Dstar_HadMode} gives $R(D^{*+})=0.291\pm0.021(stat)\pm0.026(syst)\pm0.013(BF)$, where the last uncertainty is due to the external branching fraction of the normalizing channel $\bar{B}^0\ensuremath{\rightarrow}\xspace D^{*+}{\ensuremath{\pion^-}}\xspace{\ensuremath{\pion^+}}\xspace{\ensuremath{\pion^-}}\xspace$. The latest HFLAV averaging \cite{hflav} in the $R(D)-R(D^*)$ plane, including the recent Belle collaboration $R(D^{(*)})$ measurements \cite{belle_rd_2019}, is shown in Fig.\ref{Fig:rd_rdstar_hflav}. Compared to an averaged series of SM-based predictions \cite{rd_theory}, a discrepancy of 3.1$\sigma$ is observed. \begin{figure}[htb \begin{center} \includegraphics[width=0.59\textwidth]{rdrds_spring2019.png} \end{center} \vspace{-0.7cm} \caption{Average of $R(D)$ and $R(D^*)$ \cite{hflav}.} \label{Fig:rd_rdstar_hflav} \end{figure} A similar measurement with the decays $B_c^- \ensuremath{\rightarrow}\xspace {\ensuremath{{\PJ\mskip -3mu/\mskip -2mu\Ppsi\mskip 2mu}}}\xspace \ell^- \bar\nu$, $R({\ensuremath{{\PJ\mskip -3mu/\mskip -2mu\Ppsi\mskip 2mu}}}\xspace)$, has been performed recently by the LHCb collaboration for the $\tau$ muonic mode \cite{RJpsi}, leading to \mbox{$R({\ensuremath{{\PJ\mskip -3mu/\mskip -2mu\Ppsi\mskip 2mu}}}\xspace)=0.71\pm0.17(stat)\pm0.18(syst)$} which lies 2$\sigma$ above the range of the known theoretical estimates \cite{RJpsi_theory}. \section{$b\ensuremath{\rightarrow}\xspace s\ell\ell$ transitions} At quark level, these transitions proceed through the diagrams shown in Fig.\ref{Fig:btosll_diags}. The operators contributing to these decays are not evenly distributed in the $q^2 = m_{\ell\ell}^2$ range: at low $q^2$, $O_7$ dominates (for transitions to non-scalar hadrons), in the central $q^2$ region below the charmonium resonances, $O_7$ and $O_9$ interfere, and at high $q^2$ $O_9$ and $O_{10}$ interfere. At the hadron level, the modes investigated by LHCb are ${\ensuremath{\Bu}}\xspace\ensuremath{\rightarrow}\xspace K^{*+}\ell^+\ell^-$, $B^0\ensuremath{\rightarrow}\xspace K^{0}\ell^+\ell^-$, $B^0\ensuremath{\rightarrow}\xspace K^{*0}\ell^+\ell^-$, ${\ensuremath{\B^0_\squark}}\xspace\ensuremath{\rightarrow}\xspace \phi\ell^+\ell^-$, and ${\ensuremath{\Lz^0_\bquark}}\xspace\ensuremath{\rightarrow}\xspace {\ensuremath{\PLambda}}\xspace\ell^+\ell^-$. A series of studies \cite{lhcb_xmumu} have dealt with the dynamics of the muonic modes, $\ell=\mu$, to infer the differential decay rate $\frac{d\Gamma}{dq^2}$, as illustrated in Fig.\ref{Fig:dGdq2}. The data is systematically below the SM-based theoretical predictions, with local discrepancies exceeding 3$\sigma$. Attempting to explore this intriguing behaviour, angular analyses were performed for $B^0\ensuremath{\rightarrow}\xspace K^{*0}{\ensuremath{\Pmu^+}}\xspace\mun$ \cite{lhcb_xmumu}(c), ${\ensuremath{\B^0_\squark}}\xspace\ensuremath{\rightarrow}\xspace \phi{\ensuremath{\Pmu^+}}\xspace\mun$ \cite{lhcb_xmumu}(b) and ${\ensuremath{\Lz^0_\bquark}}\xspace\ensuremath{\rightarrow}\xspace {\ensuremath{\PLambda}}\xspace{\ensuremath{\Pmu^+}}\xspace\mun$ \cite{lhcb_lzmumu_ang}. Quantities such as $P_5^\prime = \frac{S_5}{\sqrt{F_L(1-F_L)}}$ have been built to reduce the hadronic uncertainties \cite{descotes} from the coefficients $S_5$ and $F_L$ (fraction of the $K^*$ longitudinal polarization) of the angular distribution. For $B^0\ensuremath{\rightarrow}\xspace K^{*0}{\ensuremath{\Pmu^+}}\xspace\mun$, the discrepancy reported in previous studies for $P_5^\prime$ seems to be persistent as shown in Fig.\ref{Fig:P5Prime}(left). The fit for the deviations from SM to the real parts of the $C_9$ and $C_{10}$ Wilson coefficients gives the results depicted in Fig.\ref{Fig:P5Prime}(right). Considering only $C_9$, the deviation from SM is determined to be 3.3$\sigma$. \begin{figure}[htb \begin{center} \includegraphics[width=0.3\textwidth]{treeop_epeng_ll.png} \includegraphics[width=0.4\textwidth]{btosll_box.png} \end{center} \vspace{-0.5cm} \caption{$b\ensuremath{\rightarrow}\xspace s\ell\ell$ (left) penguin and (right) box transitions.} \label{Fig:btosll_diags} \end{figure} \begin{figure}[htb \begin{center} \includegraphics[width=6cm, height=4cm]{kmumu_BF.pdf} \includegraphics[width=6cm, height=4cm]{phimumu_BF.pdf} \end{center} \vspace{-0.5cm} \caption{$\frac{d\Gamma}{dq^2}$ distribution for (left) $B^+\ensuremath{\rightarrow}\xspace K^{+}{\ensuremath{\Pmu^+}}\xspace\mun$ and (right) ${\ensuremath{\B^0_\squark}}\xspace\ensuremath{\rightarrow}\xspace \phi{\ensuremath{\Pmu^+}}\xspace\mun$. The {\ensuremath{{\PJ\mskip -3mu/\mskip -2mu\Ppsi\mskip 2mu}}}\xspace and {\ensuremath{\Ppsi{(2S)}}}\xspace $q^2$ regions are vetoed. The points represent the data measurements and the rectangles or band represent the SM-based predictions.} \label{Fig:dGdq2} \end{figure} \begin{figure}[htb \begin{center} \includegraphics[width=6cm, height=4cm]{P5prime_Run1_2016.pdf} \includegraphics[width=0.4\textwidth]{ReC9ReC10_LL.pdf} \end{center} \vspace{-0.5cm} \caption{(left) Evolution of $P_5^\prime$ (see text) as a function of $q^2$ for $B^0\ensuremath{\rightarrow}\xspace K^{*0}{\ensuremath{\Pmu^+}}\xspace\mun$ and (right) resulting 1,2,3 $\sigma$ contours, using all the angular variables, of the deviations from SM of the real parts of the $C_9$ and $C_{10}$ Wilson coefficients.} \label{Fig:P5Prime} \end{figure} Another way to probe the presence of New Physics is to measure the ratio $R_X = \frac{\mathcal{B}(H_b\ensuremath{\rightarrow}\xspace X \mu^+\mu^-)}{\mathcal{B}(H_b\ensuremath{\rightarrow}\xspace X e^+e^-)}$, where $X$ denotes a hadronic system comprising a strange quark. The LHCb collaboration studied $R_K$ (${\ensuremath{\Bu}}\xspace\ensuremath{\rightarrow}\xspace{\ensuremath{\kaon^+}}\xspace\ell^+\ell^-$) \cite{lhcb_rkplus_ratio}, $R_{K^*}$ ($B^0\ensuremath{\rightarrow}\xspace K^{*0}\ell^+\ell^-$) \cite{lhcb_rkstar_ratio} and $R_{pK}$ with the decay ${\ensuremath{\Lz^0_\bquark}}\xspace\ensuremath{\rightarrow}\xspace p{\ensuremath{\kaon^-}}\xspace\ell^+\ell^-$ \cite{lhcb_rpk_ratio}. For $R_K$, the explored $q^2$ range is $[1.1,6]~\ensuremath{{\mathrm{\,Ge\kern -0.1em V^2\!/}c^4}}\xspace$, i.e. below the charmonium radiative tails, and above backgrounds of the type ${\ensuremath{\Bu}}\xspace\ensuremath{\rightarrow}\xspace{\ensuremath{\kaon^+}}\xspace\phi(\ensuremath{\rightarrow}\xspace\ell^+\ell^-)$. The $R_{K^*}$ analysis uses two bins in $q^2$, $[0.045,1.1]~\ensuremath{{\mathrm{\,Ge\kern -0.1em V^2\!/}c^4}}\xspace$ (above the photon pole) and $[1.1,6]~\ensuremath{{\mathrm{\,Ge\kern -0.1em V^2\!/}c^4}}\xspace$. Finally, $R_{pK}$ is measured with the requirements $q^2\in[0.1,6.0]~\ensuremath{{\mathrm{\,Ge\kern -0.1em V^2\!/}c^4}}\xspace$ and $m(pK)<2.6\ensuremath{{\mathrm{\,Ge\kern -0.1em V\!/}c^2}}\xspace$. The obtained measurements are $R_K=0.846^{+0.060}_{-0.054}(stat)^{+0.016}_{-0.014}(syst)$ ($1.1<q^2<6\ensuremath{{\mathrm{\,Ge\kern -0.1em V^2\!/}c^4}}\xspace$); $R_{K^*}=0.66^{+0.11}_{-0.07}(stat)\pm0.03(syst)$ for $0.045<q^2<1.1\ensuremath{{\mathrm{\,Ge\kern -0.1em V^2\!/}c^4}}\xspace$ and $0.69^{+0.11}_{-0.07}(stat)\pm0.05(syst)$ for $1.1<q^2<6\ensuremath{{\mathrm{\,Ge\kern -0.1em V^2\!/}c^4}}\xspace$. All these values are systematically below the SM-based predictions by 2.2$\sigma$ to 2.5$\sigma$ \cite{RK_theo}. With the ${\ensuremath{\Lz^0_\bquark}}\xspace\ensuremath{\rightarrow}\xspace p{\ensuremath{\kaon^-}}\xspace\ell^+\ell^-$ decay, a first observation of ${\ensuremath{\Lz^0_\bquark}}\xspace\ensuremath{\rightarrow}\xspace p{\ensuremath{\kaon^-}}\xspace e^+e^-$ is obtained with a similar Run 1 and part of Run 2 data set, as illustrated in Fig.\ref{Fig:LbtopKll_massfits}, leading to the measurement of the ratio $R_{pK}=0.86^{+0.14}_{-0.11}(stat)\pm0.05(syst)$. For all these numbers, the uncertainty will be reduced soon with the addition of the remainder of Run 2 data. \begin{figure}[htb \begin{center} \includegraphics[width=0.4\textwidth]{LbtopKmumu.pdf} \includegraphics[width=0.4\textwidth]{LbtopKee.pdf} \end{center} \vspace{-0.5cm} \caption{ Invariant mass distributions of (left) ${\ensuremath{\Lz^0_\bquark}}\xspace\ensuremath{\rightarrow}\xspace p{\ensuremath{\kaon^-}}\xspace{\ensuremath{\Pmu^+}}\xspace\mun$ and (right) ${\ensuremath{\Lz^0_\bquark}}\xspace\ensuremath{\rightarrow}\xspace p{\ensuremath{\kaon^-}}\xspace e^+e^-$ candidates. The fit shapes of the ${\ensuremath{\Lz^0_\bquark}}\xspace\ensuremath{\rightarrow}\xspace p{\ensuremath{\kaon^-}}\xspace \ell^+\ell^-$ signals and the main backgrounds are overlaid.} \label{Fig:LbtopKll_massfits} \end{figure} Figure \ref{Fig:C9C10_NP} shows the impact of the $R_{K^{*}}$ measurements by BaBar and LHCb, as well as the combination of the LFUV and angular parameters from all the experiments, on the New Physics contributions to the Wilson coefficients $C_9$ and $C_{10}$, as derived in Ref.\cite{C9C10_fit}. Combining all anomalous data, $C_9$ departs by more than 6$\sigma$ from its SM-based prediction. \begin{figure}[htb \begin{center} \includegraphics[width=0.4\textwidth]{C9C10_NP_LFUV_only.png} \includegraphics[width=0.4\textwidth]{C9C10_NP_All.png} \end{center} \vspace{-0.5cm} \caption{ The 1,2,3 $\sigma$ contours for the New Physics contributions to the $C_9$ and $C_{10}$ Wilson coefficients using (left) only the LFUV data from Belle and LHCb and (right) combining all data from angular analyses and LFUV. The fits are provided in Ref.\cite{C9C10_fit}.} \label{Fig:C9C10_NP} \end{figure} \section{$B\ensuremath{\rightarrow}\xspace\ell\ell$} For these purely leptonic modes, the combination of the most recent results of the ATLAS \cite{atlas_bmumu}, CMS \cite{cms_bmumu} and LHCb \cite{lhcb_bmumu} experiments, giving $\mathcal{B}({\ensuremath{\B^0_\squark}}\xspace\ensuremath{\rightarrow}\xspace{\ensuremath{\Pmu^+}}\xspace\mun)= (2.69^{+0.37}_{-0.35})\times10^{-9}$ and $\mathcal{B}(B^0\ensuremath{\rightarrow}\xspace{\ensuremath{\Pmu^+}}\xspace\mun)<1.9\times10^{-10}$ at 95\% confidence level (CL), shows that ${\ensuremath{\B^0_\squark}}\xspace\ensuremath{\rightarrow}\xspace{\ensuremath{\Pmu^+}}\xspace\mun$ is 2$\sigma$ below the SM-based predictions. First attempts by LHCb of measuring the ditauon \cite{lhcb_btautau} and dielectron \cite{lhcb_bee} modes lead to the results $\mathcal{B}({\ensuremath{\B^0_\squark}}\xspace\ensuremath{\rightarrow}\xspace \tau^+\tau^-)<6.3\times10^{-3}$, $\mathcal{B}(B^0\ensuremath{\rightarrow}\xspace \tau^+\tau^-)<2.1\times10^{-3}$, $\mathcal{B}({\ensuremath{\B^0_\squark}}\xspace\ensuremath{\rightarrow}\xspace e^+e^-)<11.2\times10^{-9}$ and $\mathcal{B}(B^0\ensuremath{\rightarrow}\xspace e^+e^-)<3.0\times10^{-9}$ at 95\% CL. \section{LFV searches} The hints of LFUV in $b \ensuremath{\rightarrow}\xspace s\ell\ell$ decays have motivated recent LFV searches, seeking to observe decays of the type $b \ensuremath{\rightarrow}\xspace s\ell\ell^\prime$ or $B \ensuremath{\rightarrow}\xspace \ell\ell^\prime$. A first study of ${\ensuremath{\Bu}}\xspace\ensuremath{\rightarrow}\xspace{\ensuremath{\kaon^+}}\xspace\mu^{\pm}e^{\mp}$ \cite{lhcb_kmue} lead to the establishment of the 95\% CL limits: $\mathcal{B}({\ensuremath{\Bu}}\xspace\ensuremath{\rightarrow}\xspace{\ensuremath{\kaon^+}}\xspace\mu^{-}e^{+})< 9.5\times10^{-9}$ and $\mathcal{B}({\ensuremath{\Bu}}\xspace\ensuremath{\rightarrow}\xspace{\ensuremath{\kaon^+}}\xspace\mu^{+}e^{-})< 8.8\times10^{-9}$. Another analysis on ${\ensuremath{\Bu}}\xspace\ensuremath{\rightarrow}\xspace{\ensuremath{\kaon^+}}\xspace\mu^{-}\tau^{+}$ \cite{lhcb_kmutau}, characterized by the original use of the decay $B_{s2}^{*0}\ensuremath{\rightarrow}\xspace{\ensuremath{\Bu}}\xspace{\ensuremath{\kaon^+}}\xspace$ to constraint the $\tau$ four-momentum, obtained the less stringent limit $\mathcal{B}({\ensuremath{\Bu}}\xspace\ensuremath{\rightarrow}\xspace{\ensuremath{\kaon^+}}\xspace\mu^{-}\tau^{+})< 4.5\times10^{-5}$. For what concerns the LFV leptonic modes, the decays $B^0_{(s)}\ensuremath{\rightarrow}\xspace e^{\pm}\mu^{\mp}$ \cite{lhcb_emu} and $B^0_{(s)}\ensuremath{\rightarrow}\xspace \tau^{\pm}\mu^{\mp}$ \cite{lhcb_taumu} have been studied , setting the 95\% CL limits to $\mathcal{B}(B^0_{s}\ensuremath{\rightarrow}\xspace e^{\pm}\mu^{\mp})< 6.3\times10^{-9}$, $\mathcal{B}(B^0\ensuremath{\rightarrow}\xspace e^{\pm}\mu^{\mp})< 1.3\times10^{-9}$, $\mathcal{B}(B^0_{s}\ensuremath{\rightarrow}\xspace \tau^{\pm}\mu^{\mp})< 4.2\times10^{-5}$ and $\mathcal{B}(B^0\ensuremath{\rightarrow}\xspace \tau^{\pm}\mu^{\mp})< 1.4\times10^{-5}$. \section{Prospects and summary} Most analyses presented have been published on a partial LHCb data set and are currently being updated. The second column of Table \ref{Tab:RX_prec} shows the expected precisions for the $R_X$ measurements for the full Run1+Run2 statistics. \begin{table} \centering \caption{Expected precisions for $R_X = \mathcal{B}(H_b\ensuremath{\rightarrow}\xspace X \mu^+\mu^-)/\mathcal{B}(H_b\ensuremath{\rightarrow}\xspace X e^+e^-)$. The numbers are taken from Ref.\cite{RX_UpgradeII}}\label{Tab:RX_prec} \begin{tabular}{l|cccc} \hline $R_X$ & Run 1\&2 (9\ensuremath{\mbox{\,fb}^{-1}}\xspace) & Run 3 (23\ensuremath{\mbox{\,fb}^{-1}}\xspace)& Run 4 (50\ensuremath{\mbox{\,fb}^{-1}}\xspace)& Run 5 (300\ensuremath{\mbox{\,fb}^{-1}}\xspace)\\ \hline $R_K$ & 0.043 & 0.025 & 0.017 & 0.007\\ $R_{K^{*0}}$ & 0.052 & 0.031 & 0.020 & 0.008\\ $R_{\phi}$ & 0.130 & 0.076 & 0.050 & 0.020\\ $R_{pK}$ & 0.105 & 0.061 & 0.041 & 0.016\\ $R_{\pi}$ & 0.302 & 0.176 & 0.117 & 0.047\\ \hline\hline \end{tabular} \end{table} On the longer term, the third, fourth and fifth columns of Table \ref{Tab:RX_prec} show the evolution of the expected sensitivities for the future runs of data taking. For the tree semileptonic decays, the LFU ratios $R(D^0)$, $R(D^+)$, $R(D_s^{(*)})$, $R(\Lambda_c^{(*)})$, $R({\ensuremath{{\PJ\mskip -3mu/\mskip -2mu\Ppsi\mskip 2mu}}}\xspace)$ and $R(p)$ (from ${\ensuremath{\Lz^0_\bquark}}\xspace\ensuremath{\rightarrow}\xspace p\tau\nu$) are foreseen during the first phase of Run 3. Figure \ref{Fig:RD_UpgradeII} shows the evolution of the $R(H_c)$ ratios throughout the periods of data taking. \begin{figure}[htb \begin{center} \includegraphics[width=0.6\textwidth]{RD_Prospects.pdf} \end{center} \caption{Evolution of the sensitivity on the semileptonic ratios $R(H_c)$ as reported in Ref.\cite{RD_UpgradeII}.} \label{Fig:RD_UpgradeII} \end{figure} The available results on the anomalies in the $b$-hadron decays show a combination of deviations, which has triggered an intense activity on the phenomenological side in studies aiming at constraining the Wilson coefficients and probing possible contributions of New Physics \cite{C9C10_fit,flavio,straub}. The 6 to 7$\sigma$ deviation from SM derived for $C_9$ is subject to interpretations, which try to account for what is observed in both $b\ensuremath{\rightarrow}\xspace c$ tree transitions and $b\ensuremath{\rightarrow}\xspace s$ loop decays. Explanations based on vector Leptoquarks \cite{vector_leptoquarks} and the ``4321'' model \cite{4321} have become popular. Any explored paradigm will have to satisfy the constraints of the {\ensuremath{\B^0_\squark}}\xspace meson mixing and {\ensuremath{\B_\cquark^+}}\xspace meson lifetime.
\section{Introduction} In a protoplanetary disc, planet formation by core accretion requires the gathering of solid dust into planetesimals. Of the possible mechanisms, the Streaming Instability \citep[SI,][]{2005ApJ...620..459Y} is an important possible mechanism for gathering dust too large to grow by collisional coagulation into a self-gravitating core \citep{2018haex.bookE.135A}. The SI grows from the counter-streaming of gas and dust in the disc, but a majority of the studies of this process so far has considered only a single dust size. For clarity, we will describe this as monodisperse-SI (mSI). Several groups have run fully nonlinear simulations of SI with multiple particle sizes \citep{2010ApJ...722.1437B,2018A&A...618A..75S}, but recent linear analysis in this regime, examining the limit of a continuum of dust sizes, has produced surprising results. \citet{2019ApJ...878L..30K} numerically approached the infinite-fluid limit of a multifluid streaming instability, employing the multifluid formulation of the dust-gas system derived in \citet{2019ApJS..241...25B}. Surprisingly, it was found that fast growth is limited to narrower regimes of parameter space than in the mSI case \citep{2019ApJ...878L..30K, 2020arXiv200801119Z}. In the terminology introduced in \citet{paper1} (hereafter \citetalias{paper1}) we denoted the Polydisperse Streaming Instability (PSI) as the generalization of mSI to a dust distribution with a continuum of particle sizes. Previously, we analyzed the PSI in the short dust stopping time limit with a terminal velocity approximation. We found that in this limit the PSI takes on a new character and is driven from a resonance which occurs in dust size space, the size resonance. We demonstrated analytically that for wide, power-law dust size distributions with short stopping times such that the terminal velocity approximation holds, the PSI grows only at wavenumbers much larger than where the mSI grows fastest. Fast PSI growth (on approximately a dynamical time scale) is restricted to dust to gas mass ratios approximately greater than unity, and we demonstrated the accuracy of these models by comparison to numerical calculations computed with a simple direct discretization of the eigenproblem. Independently, \citet{2020arXiv200801119Z} continued the program of \citet{2019ApJS..241...25B} and \citet{2019ApJ...878L..30K} in computing results for multifluid systems approaching the continuous limit. They also found that fast growth is limited to dust to gas mass ratios approximately greater than unity when exclusively tightly coupled dust is considered, but also found fast growth with top-heavy power-law dust distributions when the peak particle size had an associated stopping time longer than an orbital timescale. In this paper, we provide a more in-depth derivation of the model of \citetalias{paper1} and present methods for calculating results for the linear PSI stability problem. The PSI stability problem turns out to be very challenging numerically. This was already recognised in \citet{2019ApJ...878L..30K}, where they considered up to $2048$ separate dust fluids, yielding a eigenvalue problem with a matrix of size $8196\times 8196$. Even then, there were cases where they could only find upper limits to the growth rate. Since finding eigenvalues of a dense matrix is an $O(N^3)$ computation (with $N$ the matrix size), increasing the number of fluids becomes computationally prohibitive. In numerical terms and in the context of our model, the approach presented by \citet{2019ApJS..241...25B} yields a first-order discretization of the integrals over the dust distribution which provide the gas-dust coupling in the fluid equations. In \citetalias{paper1} we described a method based on a second-order discretization of these integrals, that has superior convergence behaviour but which still suffers from the same underlying computational limitations. Because of the computational difficulty, the focus of this paper is entirely on the mathematics of the PSI stability problem and the methods needed to solve it efficiently, leaving discussion of the physics of planet formation and the role of PSI for the subsequent paper in this series. The formulation and limitations of the governing equations is of central importance to understanding the physical applicability of the linear stability problem, so we present this in detail in this paper. We then further describe our \citetalias{paper1} method and the difficulties that this family of methods based on direct discretization of the governing system of equations have with the PSI eigenproblem. With this context, we present an alternate method, which avoids the limitations of the \citet{2019ApJS..241...25B} and \citetalias{paper1} methods, providing far more accurate results at a lower computational cost. These methods require complex implementations. So as a service to the community, we release as a companion to this paper an implementation in the publicly available Python-language {\tt psitools} \citep{psitools} package. Thus, this paper serves two purposes: It describes the mathematics of the PSI eigenproblem with numerical methods required to solve them, and it also serves as high-level documentation of the {\tt psitools} package. The algorithmic building blocks of the approach used in {\tt psitools} to solve the PSI eigenproblem have all previously existed, and are not special to this problem. They may find further application in other areas of theoretical astrophysics where stability eigenproblems are not amenable to simple direct discretization techniques. This paper is organized as follows. First, in Section~\ref{sec:derivation} we present the derivation for the governing equations for polydisperse dust-gas flows from a Boltzmann equation approach. In Section~\ref{sec:linear} we present the linear PSI perturbation equations for stability analysis. Then, in Section~\ref{sec:nummeth} we describe the numerical methods: The properties of the direct eigensolver are discussed in Section~\ref{sec:direct}, the new root-finding technique is described in Section~\ref{sec:rootfinding}, a related root-counting method is described in Section~\ref{sec:rootcounting}, and Section~\ref{sec:mapping} describes an algorithm for efficiently building maps of PSI growth across a continuous parameter space. In Section~\ref{sec:examples} we give benchmark results for the PSI problem and compare results obtained with these new algorithms to previously published results. Finally, we summarize the results and give conclusions in Section~\ref{sec:conclusions}. \section{Derivation of governing equations for polydispserse dust-gas flows} \label{sec:derivation} We are interested in the evolution of a mixture of gas and solids (or dust), where the solids have a range of sizes and the number of solid particles is large enough that their size distribution can be thought of as a continuum. The solids and gas interact through a drag force. The gas obeys well-known continuum equations, including mass, momentum and energy conservation, together with equations for magnetic and radiation fields, if present. In order to elucidate the general principles, and also because for the problem at hand it is sufficient, we focus on the simple case of an unmagnetized gas with a barotropic equation of state, which is governed by the usual Euler equations: \begin{align} \partial_t{\rho_{\rm g}} + \nabla\cdot ({\rho_{\rm g}} {\bf{v}_{\rm g}}) =& 0\, ,\label{eq:gascont}\\ \partial_t{\bf{v}_{\rm g}} + ({\bf{v}_{\rm g}}\cdot\nabla){\bf{v}_{\rm g}} =& -\frac{\nabla p}{{\rho_{\rm g}}} +\bm{\alpha}_{\rm g} + \bm{\alpha}_{\mathrm{drag,g}}\, , \label{eq:gasmom} \end{align} where ${\rho_{\rm g}}$ is the gas density, ${\bf{v}_{\rm g}}$ the gas velocity, $p$ denotes gas pressure and we have separated the forces acting on the gas into an acceleration due to the drag force coupling gas and dust\footnote{We use $\bm{\alpha}$ for acceleration to avoid confusion with particle size $a$.} $\bm{\alpha}_{\rm drag,g}$, and any other force acting on the gas, leading to an acceleration $\bm{\alpha}_{\rm g}$. For a barotropic fluid, a simple equation of state $p=p({\rho_{\rm g}})$ closes the system, but we note that the formalism below can be trivially extended to more complex equations as long as the only interaction between gas and solids is through the drag force. The only term that depends on the nature of the solid component is $\bm{\alpha}_{\mathrm{drag,g}}$, for which we need to find an expression when the solids have a continuous distribution in size. Equations (\ref{eq:gascont}) and (\ref{eq:gasmom}) can be derived from a kinetic picture by taking velocity moments of the Boltzmann transport equation \citep[e.g.][]{chapman_cowling_1939} and identifying the pressure as due to a random velocity component. Below, following for example \cite{2004ApJ...603..292G} and \cite{2011MNRAS.415.3591J}, we take the same approach for the solid component of the mixture, which now also has a distribution in particle size. \subsection{Boltzmann equation} Consider the distribution function for dust particles $f({\bf x}, {\bf v}, a, t)$ so that $f({\bf x}, {\bf v}, a, t)\rmd{\bf x} \rmd{\bf v} \rmd a$ is the number of dust particles in a volume $\rmd{\bf x}$ around ${\bf x}$, with velocities in a (velocity) volume $\rmd{\bf v}$ around ${\bf v}$ and with size between $a$ and $a+\rmd a$. Note that the units of $f$ are $[f]=\mathrm{cm}^{-7}~\mathrm{s^3}$. The number of particles per unit volume (i.e. the number density) is given by \begin{align} n_{\rm d}({\bf x}, t) = \int\int f({\bf x}, {\bf v}, a, t) \rmd{\bf v} \rmd a, \end{align} while the volume density is \begin{align} {\rho_{\rm d}}({\bf x}, t) =\rho_{\rm b} \int\int V(a) f({\bf x}, {\bf v}, a, t) \rmd{\bf v} \rmd a, \end{align} where $\rho_{\rm b}$ is the bulk density of a dust particle and $V(a)$ is its volume ($V(a)=4\pi a^3/3$ for spherical dust particles). The evolution of $f$ is given by the nonlinear Boltzmann equation \citep{1872boltzmann}: \begin{align} \partial_t f + {\bf v}\cdot \nabla_x f + \nabla_v\cdot (f \bm{\alpha})= 0, \label{eqBoltzmann} \end{align} where the right hand side is zero since we do not consider any collisions between dust particles. Note the subscripts on the gradient operator denoting whether the gradient is to be taken in real space or velocity space. Here $\bm{\alpha}$ is the acceleration on the dust component due to external forces, which can again be split into a component $\bm{\alpha}_{\rm d}$ covering everything but the drag force, and the drag acceleration $\bm{\alpha}_{\rm drag,d}$. \subsection{Velocity moments} \label{sec:velmom} We can take moments of the Boltzmann equation by multiplying by a quantity $\rho_{\rm b} V(a) {\bf v}^p$, where the power index $p$ is to be defined later, and integrating over velocity: \begin{align} \int \rho_{\rm b} V(a) {\bf v}^p\left(\partial_t f + {\bf v}\cdot \nabla_x f + \nabla_v\cdot(f\bm{\alpha})\right)\rmd{\bf v} =0. \label{eqBoltz} \end{align} The first term can be simplified to \begin{align} \int \rho_{\rm b} V(a) {\bf v}^p\partial_t f \rmd{\bf v} = \partial_t\left(\int \rho_{\rm b} V(a) {\bf v}^p f \rmd{\bf v} \right) \equiv \partial_t(\sigma\left< {\bf v}^p\right>_{\bf v}), \end{align} where we define a velocity average of quantity $A$ as \begin{align} \left<A\right>_{\bf v} \equiv \frac{\int Af \rmd{\bf v}}{\int f \rmd{\bf v}}, \end{align} and where we define the \emph{size density}\footnote{In keeping in line with terms such as `volume mass density', `surface mass density' and `line charge density', $\sigma$ could be called `volume size mass density', but since that in cases where `mass' and `volume' are clear from the context, $\rho$ is known simply as `density', we prefer the shorter term `size density' for $\sigma$.} $\sigma$ as \begin{align} \sigma({\bf x}, t, a) = \rho_{\rm b} V(a) \int f({\bf x}, {\bf v}, a, t) \rmd{\bf v}. \label{eq:sizedensity} \end{align} The size density is the mass density per unit size, i.e. $\sigma \rmd a$ is the mass density between $a$ and $a +\rmd a$. For a polydisperse fluid, it replaces the mass density in the evolution equations, as we will see below. In a similar way, the second term in (\ref{eqBoltz}) can be simplified to \begin{align} \int \rho_{\rm b} V(a) {\bf v}^p {\bf v}\cdot \nabla_x f \rmd{\bf v} = \nabla_x\cdot(\sigma\left< {\bf v}^p{\bf v}\right>_{\bf v}), \end{align} and, finally, the third term: \begin{align} \int \rho_{\rm b} V(a) {\bf v}^p \nabla_v\cdot(f\bm{\alpha})\rmd{\bf v} =\nonumber\\ \int \left[\nabla_v\cdot(\rho_{\rm b} V(a) {\bf v}^p \bm{\alpha}f) - f(\bm{\alpha}\cdot\nabla_v) \rho_{\rm b} V(a) {\bf v}^p\right]\rmd{\bf v} = \nonumber\\ -\sigma\left<(\bm{\alpha}\cdot\nabla_v) {\bf v}^p\right>_{\bf v}, \end{align} where we have assumed that $f$ goes to zero fast enough as $|{\bf v}|\rightarrow \infty$ so that ${\bf v}^p |\bm{\alpha}| f$ vanishes. We end up with a velocity-integrated version of (\ref{eqBoltz}) that reads: \begin{align} \partial_t(\sigma\left< {\bf v}^p\right>_{\bf v}) + \nabla_x\cdot(\sigma \left<{\bf v}^p{\bf v}\right>_{\bf v})- \sigma\left<(\bm{\alpha}\cdot\nabla_v) {\bf v}^p\right>_{\bf v}=0.\label{eqAverage} \end{align} The first two moments, $p=0$ and $p=1$ give \begin{align} \partial_t\sigma + \nabla_x\cdot(\sigma\left< {\bf v}\right>_{\bf v})=& 0,\label{eqmom1}\\ \partial_t(\sigma\left<{\bf v}\right>_{\bf v}) + \nabla_x\cdot\left(\sigma\left< {\bf v}^2\right>_{\bf v}\right)=& \sigma \left<\bm{\alpha}\right>_{\bf v}.\label{eqmom2} \end{align} Rewrite the last equation as \begin{align} \partial_t(\sigma\left<{\bf v}\right>_{\bf v}) +& \nabla_x\cdot(\sigma\left< {\bf v}\right>_{\bf v}\left< {\bf v}\right>_{\bf v}) =\nonumber\\ &\sigma \left<\bm{\alpha}\right>_{\bf v} - \nabla_x\cdot\left(\sigma\left< {\bf v}^2\right>_{\bf v}-\sigma\left< {\bf v}\right>_{\bf v}\left< {\bf v}\right>_{\bf v} \right), \label{eq:momstress} \end{align} where the last term is the divergence of a stress tensor. The fluid approximation is essentially to neglect this term, which can be done for small enough stopping times \citep{2004ApJ...603..292G, 2011MNRAS.415.3591J}. We provide some further comments on this in appendix \ref{sec:fluid}. Singling out the velocity dependence of $\bm{\alpha}$, if $\bm{\alpha}({\bf v})$ is at most quadratic in ${\bf v}$, it follows immediately that $\left<\bm{\alpha}\right>_{\bf v} = \bm{\alpha}(\left<{\bf v}\right>_{\bf v})$. If we define the size-dependent bulk velocity ${\bf{u}} \equiv \left< {\bf v}\right>_{\bf v}$, and drop the subscript $x$ on the gradient operators, we arrive at \begin{align} \partial_t\sigma + \nabla\cdot(\sigma {\bf{u}} )=& 0,\label{eq:dustcont}\\ \partial_t(\sigma {\bf{u}}) + \nabla\cdot(\sigma {\bf{u}}\ud) =& \sigma\bm{\alpha}({\bf{u}} \label{eq:dustmom}. \end{align} Note that these are the ordinary dust fluid equations, with volume density ${\rho_{\rm d}}$ replaced by the size density $\sigma$ and velocity ${\bf v}_{\rm d}$ replaced by a size-dependent velocity ${\bf{u}}$. \subsection{Size-integrated equations} The dust volume density and momentum are given by integrals over dust size: \begin{align} {\rho_{\rm d}} =& \int \sigma \rmd a,\\ {\rho_{\rm d}} {\bf v}_{\rm d} =& \int \sigma {\bf{u}} \rmd a. \end{align} If we integrate the dust fluid equations (\ref{eq:dustcont}) and (\ref{eq:dustmom}) over dust size, we get \begin{align} \partial_t{\rho_{\rm d}} + \nabla\cdot\left({\rho_{\rm d}}{\bf v}_{\rm d}\right)=& 0,\\ \partial_t\left({\rho_{\rm d}}{\bf v}_{\rm d}\right) + \nabla\cdot\left(\int\sigma {\bf{u}}\ud\rmd a\right)=& \int\sigma \bm{\alpha \rmd a. \end{align} The second equation can be rewritten as \begin{align} \partial_t\left({\rho_{\rm d}}{\bf v}_{\rm d}\right) + \nabla\cdot\left({\rho_{\rm d}}{\bf v}_{\rm d}\vd\right) = \int\sigma \bm{\alpha} \rmd a - \nabla\cdot \mathsf{S}, \label{eqDustMomInt} \end{align} with stress tensor \begin{align} \mathsf{S} = \int\sigma {\bf{u}} {\bf{u}} \rmd a-{\rho_{\rm d}}{\bf v}_{\rm d}\vd = \int \sigma ({\bf{u}} - {\bf v}_{\rm d} )({\bf{u}}+{\bf v}_{\rm d})\rmd a. \end{align} Note that this stress tensor measures velocity correlations in size space rather than velocity space, and for wide enough size distributions can not be neglected in general. In \citetalias{paper1} we found that when all particles are well-coupled to the gas, the stress tensor vanishes. If we split the acceleration into a drag acceleration $\bm{\alpha}_{\rm drag,d}$ and any other force acting on the dust $\bm{\alpha}_{\rm d}$, we find that the total momentum transfer between gas and dust is \begin{align} \int\sigma \bm{\alpha}_{\rm drag,d} \rmd a. \end{align} Conservation of momentum then dictates that the backreaction on the gas in (\ref{eq:gasmom}) must be \begin{align} \bm{\alpha}_{\rm drag,g} = -\frac{1}{{\rho_{\rm g}}}\int \sigma \bm{\alpha}_{\rm drag,d}\rmd a. \label{eq:gasdrag} \end{align} This term allows us to assemble the governing equations. Note that upon taking the size density a delta function in size space, the stress tensor again vanishes and the monodisperse dust-gas equations are recovered. \subsection{Governing equations} Armed with the results of the previous subsections, we can now write down the equations governing a mixture of gas and dust particles, where the solids have a continuous size distribution, using equations (\ref{eq:gascont}), (\ref{eq:gasmom}), (\ref{eq:dustcont}), (\ref{eq:dustmom}) and (\ref{eq:gasdrag}): \begin{align} \partial_t{\rho_{\rm g}} + \nabla\cdot ({\rho_{\rm g}} {\bf{v}_{\rm g}}) =& 0\, ,\label{eq:govfirst}\\ \partial_t{\bf{v}_{\rm g}} + ({\bf{v}_{\rm g}}\cdot\nabla){\bf{v}_{\rm g}} =& -\frac{\nabla p}{{\rho_{\rm g}}} +\bm{\alpha}_{\rm g} - \frac{1}{{\rho_{\rm g}}}\int \sigma \bm{\alpha}_{\rm drag,d}\rmd a\, ,\label{eq:govsecond} \\ \partial_t\sigma + \nabla\cdot(\sigma {\bf{u}} )=& 0,\label{eq:govthird}\\ \partial_t{\bf{u}} + ({\bf{u}}\cdot\nabla){\bf{u}} =& \bm{\alpha}_{\rm d} + \bm{\alpha}_{\rm drag,d}.\label{eq:govlast \end{align} The main differences with the two-fluid model are that the drag on the gas is now an integral over size, and that the size density $\sigma$ and the velocity ${\bf u}$ depend on dust size. These equations were employed in \citetalias{paper1} and similar equations were used in \citet{2005ApJ...625..414T}, though without reference to a derivation. \subsection{Possible generalizations} Equations (\ref{eq:govfirst})-(\ref{eq:govlast}), where the equation of state is barotropic, are sufficient to study the streaming instability in its polydisperse form. It should be clear that adding more complicated gas physics is trivial as long as it does not lead to further interactions between gas and solids. For example, one could study the effect of magnetic fields on the gas by adding the Lorentz force to $\bm{\alpha}_{\rm g}$ and including the induction equation. This is a trivial extension unless for example the resistivity depends on dust density, in which case the resistivity will involve an integral over $\sigma$. Another example would be the inclusion of a gas energy equation, which is a trivial extension if gas and dust temperatures can be assumed to be either equal or independent. Again, coupling of dust and gas temperatures will involve an integral over $\sigma$. \section{The linear PSI} \label{sec:linear} \subsection{Basic equations} We set up the problem in the well-known geometry of a shearing box \citep{1965MNRAS.130..125G}, which is a local Cartesian coordinate frame, orbiting at radius $r_0$ with angular velocity $\bm{\Omega}$, where the $x$-direction coincides with the radial direction and $y$ with the azimuthal direction, while $z$ is the vertical direction, perpendicular to the disc mid plane, as usual. The body forces acting on gas and dust are the Coriolis force and a tidal force through an effective potential $\Phi=-S\Omega x^2$, where $S$ is the shear rate of the disc ($S=3\Omega/2$ in a Keplerian disc). In addition, we give the gas an extra acceleration in the $x$ direction in order to accommodate effects from a global pressure gradient \citep{2005ApJ...620..459Y,2007ApJ...662..613Y}, so that the total acceleration of the gas is given by \begin{align} \bm{\alpha}_{\rm g} = 2\eta {\bf \hat x} - 2\bm{\Omega}\times {\bf v}_g-\nabla\Phi. \end{align} Since the parameter governing the sub-Keplerian nature of the disc comes from a \emph{global} pressure gradient, for the local model $\eta$ has to be prescribed as an input parameter. If we denote the global pressure by $P$, we have that \begin{align} \eta = \frac{1}{2{\rho_{\rm g}}}\frac{\partial P}{\partial r} \sim \frac{c^2}{r_0}, \end{align} where $c$ is the speed of sound in the gas and $r_0$ is the fiducial orbital radius of the shearing box. The acceleration on the dust is the same but with the term involving $\eta$ omitted. We take the drag force to be in the Epstein regime: \begin{align} \bm{\alpha}_{\rm drag,d} = - \frac{{\bf{u}}-{\bf{v}_{\rm g}}}{{\tau_{\rm s}}(a)}, \end{align} where ${\tau_{\rm s}}$ is the (size-dependent) \emph{particle} stopping time \citep[see e.g.][]{2003A&A...399..297W} and therefore depends on gas density: \begin{align} {\tau_{\rm s}} = \sqrt{\frac{\pi}{8}}\frac{a\rho_{\rm b}}{{\rho_{\rm g}} c}. \end{align} We note that the gas density dependence is sometimes neglected in calculations of the streaming instability, either explicitly \citep{2019ApJ...878L..30K} or through an incompressibility condition on the gas \citep{2005ApJ...620..459Y}. Since the gas motions involved are very subsonic, this should lead to minor differences only \citep{2007ApJ...662..613Y}. Using a reference gas density, one can define a Stokes number\footnote{Different authors have used different notations for stopping times and Stokes numbers. To avoid possible confusion, we note that while \cite{2017ApJ...849..129L} use our definition of ${\tau_{\rm s}}$, \cite{2005ApJ...620..459Y}, \cite{2018MNRAS.477.5011S} and \cite{2019arXiv190605371U} use $t_{\rm stop}$ for the particle stopping time and ${\tau_{\rm s}}$ for the Stokes number. Other conventions are by \cite{2019ApJ...878L..30K}, who use $t_s$ for particle stopping time and $T_s$ for Stokes number, and by \cite{2020MNRAS.492.4591J}, who use $t_{\rm stop}$ for particle stopping time and $\mathrm{St}$ for a (modified) Stokes number.} through \begin{align} \mathrm{St}=\Omega {\tau_{\rm s}}. \end{align} Tightly coupled particles have $\mathrm{St} \ll 1$, while the strongest drift velocities occur for particles with $\mathrm{St} \sim 1$ \citep[e.g.][]{1977MNRAS.180...57W}. The equations governing the gas are then given by (\ref{eq:govfirst}) and (\ref{eq:govsecond}), with accelerations as stated above: \begin{align} \partial_t{\rho_{\rm g}} + \nabla\cdot({\rho_{\rm g}}{\bf{v}_{\rm g}}) =& 0\, ,\label{eq:gascont_sbox}\\ \partial_t {\bf{v}_{\rm g}} + ({\bf{v}_{\rm g}} \cdot \nabla){\bf{v}_{\rm g}} =& 2\eta {\bf \hat x} -\frac{\nabla p}{{\rho_{\rm g}}}- 2\bm{\Omega}\times {\bf{v}_{\rm g}}-\nabla\Phi \nonumber\\ &+ \frac{1}{{\rho_{\rm g}}}\int \sigma\frac{{\bf{u}}-{\bf{v}_{\rm g}}}{{\tau_{\rm s}}(a)}\rmd a.\label{eq:gasmom_sbox} \end{align} We take the equation of state to be isothermal, $p = c^2{\rho_{\rm g}}$, with constant sound speed $c$. The dust fluid equations can similarly be constructed from (\ref{eq:govthird}) and (\ref{eq:govlast}): \begin{align} \partial_t\sigma + \nabla\cdot(\sigma {\bf{u}} )=& 0,\label{eq:dustcont_sbox}\\ \partial_t {\bf{u}} + ({\bf{u}} \cdot \nabla){\bf{u}} =& -2\bm{\Omega}\times {\bf{u}}-\nabla\Phi - \frac{{\bf{u}}-{\bf{v}_{\rm g}}}{{\tau_{\rm s}}(a)}.\label{eq:dustmom_sbox} \end{align} With these shearing-box equations for the gas-dust system in hand, we can proceed to solve for the equilibrium state. \subsection{Equilibrium state} For the equilibrium state, we take ${\rho_{\rm g}}$ and $\sigma$ to be spatially constant. An equilibrium solution can then be found with velocities independent of $y$ and $z$ and no vertical velocity (\citetalias{paper1}; see also \citealt{2005ApJ...625..414T}, \citealt{2018MNRAS.479.4187D}): \begin{align} {v_{{\rm g}x}} =& \frac{2\eta}{\kappa}\frac{\mathcal{J}_1}{\left(1+ \mathcal{J}_0\right)^2 + \mathcal{J}_1^2}, \\ v_{gy} =& -Sx -\frac{\eta}{\Omega}\frac{1 + \mathcal{J}_0}{\left(1+ \mathcal{J}_0\right)^2 + \mathcal{J}_1^2},\\ u_x =& \frac{2\eta}{\kappa} \frac{\mathcal{J}_1 - \kappa{\tau_{\rm s}}(a)(1 + \mathcal{J}_0)}{(1+\kappa^2{\tau_{\rm s}}(a)^2)(\left(1+ \mathcal{J}_0\right)^2 + \mathcal{J}_1^2)} ,\\ u_y =& -Sx - \frac{\eta}{\Omega}\frac{1 + \mathcal{J}_0 + \kappa{\tau_{\rm s}}(a)\mathcal{J}_1}{(1+\kappa^2{\tau_{\rm s}}(a)^2)(\left(1+ \mathcal{J}_0\right)^2 + \mathcal{J}_1^2)}, \end{align} with integrals \begin{align} \mathcal{J}_m = \frac{1}{{\rho_{\rm g}}}\int \frac{\sigma (\kappa{\tau_{\rm s}}(a))^{m}}{1+\kappa^2{\tau_{\rm s}}(a)^2} \rmd a. \end{align} Here $\kappa$ is the epicyclic frequency. For $\eta=0$, only the linear shear remains for both gas and dust, while $\eta\neq 0$ introduces drift between gas and dust. It is worth noting that for tightly coupled particles, the radial drift velocity is first order in $\mathrm{St}$, while the azimuthal drift velocity is second order. Also, note that as mentioned in section \ref{sec:fluid} this equilibrium state is in principle valid outside the regime of validity of the fluid approximation, as it has no velocity dispersion. However, it should be kept in mind that this is probably best viewed as an artefact of the unstratified, unmagnetised shearing box. \subsection{Linear perturbations} Consider small Eulerian perturbations on top of the equilibrium state, $X({\bf x}, t, a) = X^0({\bf x}, a) + X^1({\bf x}, t, a)$, where $X$ stands for any hydrodynamic variable (noting that gas quantities do not depend on dust size), a superscript '0' indicates the equilibrium state and a superscript '1' indicates a small perturbation. Keeping terms up to linear order in perturbed quantities, and noting that ${\rho_{\rm g}}{\tau_{\rm s}}$ is constant for Epstein drag, we find from (\ref{eq:gascont_sbox}) and (\ref{eq:gasmom_sbox}) that the gas perturbations are governed by: \begin{align} \partial_t{\rho_{\rm g}^1} &+ {\bf v}_{\rm g}^0\cdot \nabla{\rho_{\rm g}^1} + {\rho_{\rm g}^0}\nabla\cdot {\bf v}_{\rm g}^1 = 0,\\ \partial_t {\bf v}_{\rm g}^1 &+ {v^0_{{\rm g}x}} \partial_x{\bf v}_{\rm g}^1 -S {v^1_{{\rm g}x}}{\bf \hat y} = -\frac{\nabla p^1}{{\rho_{\rm g}^0}}- 2\bm{\Omega}\times {\bf v}_{\rm g}^1\nonumber\\ &+ \frac{1}{{\rho_{\rm g}^0}}\int \sigma^1\frac{\Delta{\bf{u}}^0}{{\tau_{\rm s}}(a)}\rmd a + \frac{1}{{\rho_{\rm g}^0}}\int \sigma^0\frac{{\bf{u}}^1-{\bf v}_{\rm g}^1}{{\tau_{\rm s}}(a)}\rmd a, \end{align} with equilibrium relative velocity $\Delta {\bf{u}}^0 = {\bf{u}}^0-{\bf v}_{\rm g}^0$. From (\ref{eq:dustcont_sbox}) and (\ref{eq:dustmom_sbox}) we find that dust perturbations are governed by: \begin{align} \partial_t\sigma^1 &+ {\bf{u}}^0\cdot\nabla\sigma^1 + \sigma^0\nabla\cdot {\bf{u}}^1 = 0,\\ \partial_t {\bf{u}}^1 &+ u_x^0 \partial_x{\bf{u}}^1 - Su_{x}^1{\bf \hat y} =\nonumber\\ &-2\bm{\Omega}\times {\bf{u}}^1 - \frac{{\bf{u}}^1-{\bf v}_{\rm g}^0}{{\tau_{\rm s}}(a)} - \frac{{\rho_{\rm g}^1}}{{\rho_{\rm g}^0}} \frac{\Delta {\bf{u}}^0}{{\tau_{\rm s}}(a)}. \end{align} We consider perturbations of the form $X^1({\bf x},t,a) = \hat X(a) \exp(\rmi {\bf k}\cdot {\bf x} - \rmi \omega t)$, with wavenumber ${\bf k} = (k_x, k_y, k_z)^T$ and frequency $\omega$. Note that if $\omega$ has a positive imaginary part this signals exponential growth\footnote{This follows the convention of \cite{2005ApJ...620..459Y}, who define a growth rate $s=\Im(\omega)$, \cite{2017ApJ...849..129L}, whose $\sigma$ corresponds to our $\omega$, \cite{2018MNRAS.477.5011S}, and \cite{2020MNRAS.492.4591J}. We caution the reader that \cite{2019ApJ...878L..30K} consider perturbations with a different time dependence, $\exp(-\omega t)$, as well as \cite{2020ApJ...891..132C}, who use $\exp(\sigma t)$.}. We consider only perturbations with $k_y=0$ (axisymmetric in a global context). Using the above form of the perturbations, the dust and gas perturbation equations transform to: \begin{align} k_x {v^0_{{\rm g}x}} \frac{{\hat{\rho}_{\rm g}}}{{\rho_{\rm g}^0}} &+ {\bf k}\cdot {\bf{\hat{v}}_{\rm g}} = \omega \frac{{\hat{\rho}_{\rm g}}}{{\rho_{\rm g}^0}},\label{eq:eig_gasdens}\\ k_x {v^0_{{\rm g}x}} {\bf{\hat{v}}_{\rm g}} &+ \rmi S {\hat{v}_{{\rm g}x}}{\bf \hat y} +\frac{{\bf k} c^2{\hat{\rho}_{\rm g}}}{{\rho_{\rm g}^0}} - 2\rmi \bm{\Omega}\times {\bf{\hat{v}}_{\rm g}}\nonumber\\ &+ \frac{\rmi}{{\rho_{\rm g}^0}}\int \hat \sigma\frac{\Delta{\bf u}^0}{{\tau_{\rm s}}(a)}\rmd a + \frac{\rmi}{{\rho_{\rm g}^0}}\int \sigma^0\frac{{\bf \hat u}-{\bf{\hat{v}}_{\rm g}}}{{\tau_{\rm s}}(a)}\rmd a = \omega {\bf{\hat{v}}_{\rm g}},\label{eq:eig_gasvel}\\ k_xu_x^0\hat \sigma &+ \sigma^0{\bf k}\cdot {\bf \hat u} = \omega \hat\sigma,\label{eq:eig_dustdens}\\ k_x u_x^0 {\bf \hat u} &+ \rmi S\hat u_{x}{\bf \hat y} -2\rmi\bm{\Omega}\times {\bf \hat u} -\rmi \frac{{\bf \hat u}-{\bf{\hat{v}}_{\rm g}}}{{\tau_{\rm s}}(a)} -\rmi \frac{{\hat{\rho}_{\rm g}}}{{\rho_{\rm g}^0}} \frac{\Delta {\bf u}^0}{{\tau_{\rm s}}(a)}. = \omega {\bf \hat u}.\label{eq:eig_dustvel} \end{align} These equations constitute an integral eigenvalue problem for eigenvalue $\omega$. It is often convenient to work with dimensionless units by choosing a time scale $\Omega^{-1}$ and a length scale $\eta/\Omega^2$. The parameters governing the system are then the non-dimensional wave vector ${\bf K} = {\bf k}\eta/\Omega^2$, the shear parameter $S/\Omega$, the dust to gas ratio $\mu = {\rho_{\rm d}^0}/{\rho_{\rm g}^0}$, the non-dimensional gas sound speed $c/(\Omega\eta)$ and the size density $\sigma^0(a)$. It should be noted that both size density $\sigma$ and dust velocity ${\bf u}$ depend on dust size, background as well as perturbations. By taking the size density a delta function in size space, we recover the monodisperse eigenvalue problem for the streaming instability after multiplying (\ref{eq:eig_dustvel}) by $\sigma^0$ and integrating the dust equations over size. Similar to its monodisperse counterpart, PSI modes are largely incompressible. Taking the incompressible limit of (\ref{eq:eig_gasdens})-(\ref{eq:eig_dustvel}) leads to a simplified problem in the terminal velocity approximation \citepalias{paper1}. It does not considerably simplify the full problem, however, as the main numerical difficulties arise in accurately evaluating the integrals over size. \subsection{Size resonance} A important result from analysing the PSI linear stability problem in the terminal velocity limit obtained in \citetalias{paper1} was the existence and role of the size resonance. This can be simply expressed as the radial phase velocity of the mode matching the background radial drift velocity of the dust. More precisely, in dust stopping time (${\tau_{\rm s}}$) space it is located where \begin{align} \frac{\Re(\omega)}{k_x} = {u^0_{x}}({\tau_{\rm s}}) \label{eq:sizeresonance} \end{align} is satisfied. From equation~(\ref{eq:eig_dustdens}), at this size we can expect a strong response in the size density. The size resonance is closely related to a resonance that comes up in the theory of Resonant Drag Instabilities \citep[RDIs,][]{2018MNRAS.477.5011S,2018ApJ...856L..15S}. RDI theory works for a monodisperse dust fluid in the limit $\mu \ll 1$, so that the backreaction on the gas can be treated as a perturbation. If a wave in the gas can be identified whose phase speed for a particular wavenumber matches the dust advection speed, one expects the strongest reaction, or fastest growth rates for an instability, at precisely this wavenumber. At this resonance it is possible to calculate approximate growth rates in a particular simple way \citep{2018ApJ...856L..15S}. The size resonance, on the other hand, plays a role for \emph{all} values of $\mu$ \citepalias{paper1}. The resonance condition is usually only satisfied by a single size, and even if the resonant size is actually in the size distribution under consideration, the size resonance does not always promote instability \citepalias{paper1}. Unlike the resonance in RDI theory, the size resonance therefore has limited predictive power. \section{Numerical Methods} \label{sec:nummeth} This section presents the numerical methods use to solve the linear PSI stability problem. The PSI eigenvalue problem proves to have significant difficulty. We employ two approaches for solving the PSI linear stability eigenproblem, each with different strengths, to build confidence in the results found. First, we employ the same direct solver (section \ref{sec:direct}), based on discretizing the dust eigenfunctions as a function of stopping time as in \citetalias{paper1}. This provides well determined results, but has the disadvantage of very large computational cost and slow convergence in cases when the instability growth is very small. Second, we employ a root finding technique to find the roots of the dispersion relation resulting from Equations~(\ref{eq:eig_gasdens}--\ref{eq:eig_dustvel}) directly without discretization (section \ref{sec:rootfinding}). To do this requires high quality estimates for the starting point of the complex root finding iteration. The process of deriving good guesses becomes inherently stochastic, and while when a root is found it is verifiably real and highly accurate, it is possible to miss roots. Like with the direct solver, this difficulty arises primarily when the instability growth rate is very small, and we will explore the structure of the dispersion relation in the complex plane which leads to this difficulty in detail. In Section~\ref{sec:rootcounting} we describe the application of a method for counting the roots of the inside a contour in the complex plane. The application of this method is to provide a separate check on the existence of a growing mode when mapping wavenumber space. We additionally describe an efficient algorithm for generating maps in wavenumber space of the fastest growing PSI mode, with the root finding algorithm in Section~\ref{sec:mapping}. In all examples, we focus on the traditional MRN dust size distribution \citep{1977ApJ...217..425M}, which was also considered in previous works (\citetalias{2019ApJ...878L..30K, paper1}; \citealt{2020arXiv200801119Z}). \subsection{Direct Solver} \label{sec:direct} \begin{figure} \includegraphics[width=\columnwidth]{paper2_direct_solver_eigenspaces.pdf} \caption{Central section of the distribution of direct solver eigenvalues ($\omega_i$) for {\sl Upper:} ${\tau_{\rm s}}=[10^{-8}, 10^{-2}]\Omega^{-1}$, $\mu=0.5$, $K_x=700$, $K_z=1000$, where the uppermost eigenvalue corresponds to a real physical growing mode and {\sl Lower:} $K_x=100$, $K_z=1000$ where the upper branch does not appear to contain any physical growing modes, both with MRN distributions. {\sl Orange:} $L=128$ points {\sl Blue:} $L=512$ points, both with logarithmic gridding in ${\tau_{\rm s}}$. } \label{fig:direct_eigenspace} \end{figure} \begin{figure} \includegraphics[width=0.9\columnwidth]{paper2_direct_solver_direct_eigenfunctions.pdf} \caption{Fastest growing numerical dust eigenfunctions, showing only ${\tau_{\rm s}}>4\times10^{-5}$ from direct solver at $L=512$ on a logarithmic grid. {\sl Left:} ${\tau_{\rm s}}=[10^{-8}, 10^{-2}]\Omega^{-1}$, $\mu=0.5$, $K_x=700$, $K_z=1000$, and {\sl Right:} $K_x=100$, $K_z=1000$ with MRN distributions. {\sl Black Dashed}: Position of terminal velocity size resonance. Eigenfunctions are normalized to set $\Im({\hat{v}_{{\rm g}x}})=0$ and $|\max({\hat{\sigma}})|=1$.} \label{fig:direct_eigenfunctions} \end{figure} \begin{figure} \includegraphics[width=0.9\columnwidth]{direct_convergence.pdf} \caption{ Convergence of the direct solver, for smooth and non-smooth eigenfunctions. {\sl Upper:} ${\tau_{\rm s}}=[10^{-8}, 10^{-1}]\Omega^{-1}$, $\mu=3$, $K_x=70$, $K_z=100$, a case where the fastest growing eigenmode is smooth and has well resolved finite growth. {\sl Lower:} $K_x=1000$, $K_z=100$ where the numerical fastest growing mode has a sharp discontinuity which leads to first order convergence, apparently towards a zero imaginary part.} \label{fig:direct_convergence} \end{figure} The most straightforward way to solve the eigenvalue problem is through directly transforming equations~(\ref{eq:eig_gasdens})--(\ref{eq:eig_dustvel}) into a matrix form, and them numerically solving for eigenvalues and eigenvectors. Our direct solver accomplished this by discretization in ${\tau_{\rm s}}$ and replacing the integrals with a discrete quadrature approximation. After discretizing on $L$ points in ${\tau_{\rm s}}$ space the results are $4+4L$ eigenvalues $\omega_{L,0\dots 4+4L}$ each with an eigenvector consisting of gas components ${\hat{\rho}_{\rm g}}$, ${\bf \hat{v}}_{\rm g}$ and the dust eigenfunctions ${\hat{\sigma}}({\tau_{\rm s}})$ and ${\bf \hat{u}}({\tau_{\rm s}})$. An eigenvector decomposition of this complex-valued matrix is then found with the {\tt scipy.linalg.eig} routine. Our implementation was previously described in \citetalias{paper1}. The {\tt psitools.direct} module provides this solver with trapezoidal rule quadrature and a small variety of grid functions. Here we describe in more detail the performance of this solver and where the main difficulties with this direct approach to calculating eigenvalues lies. The direct solver generates 4 additional eigenvalues per added ${\tau_{\rm s}}$-space point used in the discretization, and these do not need to all correspond to physical eigenvalues of the continuous problem \citep{Boyd}. In Figure~\ref{fig:direct_eigenspace} we show the central section of eigenspace for two different modes, with the numerical eigenvalues for $L=128$ and $L=512$. In the upper panel a PSI mode with strong growth exists, and the corresponding eigenvalue, with the largest imaginary part, is insensitive to the direct solver resolution. However, in the lower panel, a mode with no fast PSI growth was chosen, so the fastest growing eigenvalues at each resolution are very sensitive to resolution and the imaginary parts (growth rate) decrease rapidly as resolution is increased. These fastest growing eigenvalues are numerically spurious, and arise from the discretization, not the physical system. Thus the difficulty with the direct solver when applied to PSI modes with little physical growth lies in either identifying and removing the numerically spurious eigenvalues, or in keeping them well enough resolved to lie below the physical ones in the complex plane. Reducing the growth rate of the spurious eigenmodes is in turn difficult due to the structure of the associated eigenfunctions. Shown in Figure~\ref{fig:direct_eigenfunctions} are the dust eigenfunctions for the fastest growing modes in the two cases from Figure~\ref{fig:direct_eigenspace}. In the formulation of the direct eigensolver, these functions appear in the integrals which are approximated with a trapezoid rule quadrature. The resolution requirement for the direct solver is apparent from the sharp shape of the $\sigma({\tau_{\rm s}})$ functions. Overplotted in Figure~\ref{fig:direct_eigenfunctions} is the location of the size resonance as determined from the terminal velocity limit. This can be expressed as the phase speed of the unstable mode matching the radial drift velocity of the dust (see (\ref{eq:sizeresonance})). In both cases, the sharp feature in the dust eigenfunction coincides with the size resonance. However, on the left the physical growing mode contains a finite-width feature in $\hat{\sigma}$ which becomes better resolved with increasing ${\tau_{\rm s}}$ points, while on the right the feature narrows with higher resolution, and the growth rate of the mode decreases. In this numerically spurious case, the growth at the size resonance is an artifact of the finite resolution in ${\tau_{\rm s}}$. On the left of Figure~\ref{fig:direct_eigenfunctions} , the sharp feature in $\sigma$ is physical, and can be reasonably resolved, so the trapezoid rule quadrature converges at second order. However, on the right, the eigenfunction for the numerically spurious eigenvalue contains an asymptote which narrows continuously as the resolution in ${\tau_{\rm s}}$ is increased, and thus the convergence of the trapezoid rule quadrature is reduced to first order. This is demonstrated in Figure~\ref{fig:direct_convergence}, where the convergence behaviour of the direct solver is shown for these two cases. The fastest growing mode converges at second order for the first case, and at first order (towards zero) in the second case where the fastest growing mode is numerically spurious. Figure~\ref{fig:direct_convergence} also illustrates the impact on the direct solver of the choice of ${\tau_{\rm s}}$ gridding. In the case of a physically growing eigenvalue, the error obtained with a logarithmic grid in ${\tau_{\rm s}}$ is roughly an order of magnitude lower than with the Chebyshev roots grid. However, in the case of a numerically spurious eigenvalue, the Chebyshev roots grid outperforms the lograrithmic grid by nearly an order of magnitude. Finally, there are two practical limits on the accuracy of the direct solver. As it uses a dense matrix eigenvalue solver, the computational cost scales as $O(L^3)$, which with contemporary processors makes $L\sim 4096$ a practical upper limit to the resolution. We also find that the roundoff error limitations of double precision floating point begin to infect results for small growth rates at resolutions of this magnitude, so larger resolutions (and smaller errors) cannot be obtained unless higher precision floating point techniques are implemented in the matrix eigensolver, further increasing the computational cost. The difficulties with the direct solver, inherent to its internal construction of eigenfunctions simultaneously while calculating the eigenvalues we seek, motivates us to formulate a entirely different solution method for the eigenvalue problem, based on directly finding roots of the PSI dispersion relation in the complex plane. This side-steps the difficulties of the direct solver, and also provides the ability to cross-check the results obtained with either method. However, the direct solver converges quickly at second order in cases with fast PSI growth, and the smoothness of the numerically determined growth rate as as a function of wavenumber or other underlying parameters still make it useful when optimizing for maximal growth rates. The ability to construct eigenfunctions is also useful for examining the nature of specific growing modes. \subsection{Root finding algorithm} \label{sec:rootfinding} Motivated by the difficulties of the direct solver approach, we have developed a root finding algorithm for the complex frequency $\omega$ in equations~(\ref{eq:eig_gasdens})-(\ref{eq:eig_dustvel}). The interface to this is implemented in the {\tt psitools.psimode} module. This development begins with first casting the linear problem into a single equation, that is, the dispersion relation. \subsubsection{Dispersion relation in matrix form} We can obtain an expression for the dispersion relation by eliminating all quantities except ${\bf{\hat{v}}_{\rm g}}$. Starting from equations (\ref{eq:eig_gasdens})-(\ref{eq:eig_dustvel}), first eliminate the gas density perturbation through (\ref{eq:eig_gasdens}): \begin{align} \frac{{\hat{\rho}_{\rm g}}}{{\rho_{\rm g}^0}} = \frac{{\bf k}\cdot {\bf{\hat{v}}_{\rm g}}}{\omega - k_x {v^0_{{\rm g}x}}}, \end{align} and write the gas momentum equation as \begin{eqnarray} \mathsf{P} {\bf{\hat{v}}_{\rm g}} + \frac{\rmi}{{\rho_{\rm g}^0}}\int \hat \sigma\frac{\Delta{\bf u}^0}{{\tau_{\rm s}}(a)}\rmd a + \frac{\rmi}{{\rho_{\rm g}^0}}\int \sigma^0\frac{{\bf \hat u}-{\bf{\hat{v}}_{\rm g}}}{{\tau_{\rm s}}(a)}\rmd a =0\label{eq:gasmomP}, \end{eqnarray} where the matrix $\mathsf{P}$ is given by \begin{eqnarray} \mathsf{P} = \left(\begin{array}{ccc} - \omega_{\rm g} + \frac{k_x^2c^2}{\omega_{\rm g}} & 2\rmi\Omega & \frac{k_xk_zc^2}{\omega_{\rm g}} \\ -\rmi (2\Omega - S) & - \omega_{\rm g} & 0\\ \frac{k_xk_zc^2}{\omega_{\rm g}} & 0 & - \omega_{\rm g} + \frac{k_z^2c^2}{\omega_{\rm g}} \end{array}\right), \end{eqnarray} with shifted frequency $\omega_{\rm g} = \omega -k_x{v^0_{{\rm g}x}}$. The gas drag terms in the gas momentum equation (\ref{eq:gasmomP}) read: \begin{align} \frac{\rmi}{{\rho_{\rm g}^0}}\int \frac{\sigma^0}{{\tau_{\rm s}}(a)} & \left[\Delta{\bf u}^0 \frac{\hat\sigma}{\sigma^0} + {\bf \hat u} - {\bf{\hat{v}}_{\rm g}}\right]\rmd a =\nonumber\\ & \int \mathcal{K}(a)\left[\Delta{\bf u}^0 \frac{{\bf k}\cdot {\bf\hat u}}{\omega-k_xu_x^0(a)} + {\bf \hat u} - {\bf{\hat{v}}_{\rm g}}\right]\rmd a, \label{eq:gasdragint} \end{align} with kernel $\mathcal{K}= \rmi \sigma^0/({\rho_{\rm g}^0}{\tau_{\rm s}})$ and we have used the dust continuity equation to write $\hat\sigma$ in terms of ${\bf \hat u}$. If we define a matrix $\mathsf{V}$ such that \begin{align} \int \mathcal{K}(a)\left[\Delta{\bf u}^0 \frac{\hat\sigma}{\sigma^0} + {\bf \hat u} - {\bf{\hat{v}}_{\rm g}}\right]\rmd a = \int \mathcal{K}(a)\left[\mathsf{V}(a){\bf \hat u} - {\bf{\hat{v}}_{\rm g}}\right]\rmd a.\label{eq:gasmomV} \end{align} It is easily verified that we need \begin{align} \mathsf{V} = \mathsf{I} + \frac{1}{\omega-k_xu_x^0}\left(\begin{array}{ccc} \Delta u_x^0 k_x & 0 & \Delta u_x^0 k_z\\ \Delta u_y^0 k_x & 0 & \Delta u_y^0 k_z\\ 0 & 0 & 0 \end{array}\right). \end{align} We want to get an expression for ${\bf \hat u}$ in terms of ${\bf{\hat{v}}_{\rm g}}$. The dust momentum equation (\ref{eq:eig_dustvel}) gives, after eliminating gas density: \begin{align} \left(k_x u_x^0-\omega-\frac{\rmi}{{\tau_{\rm s}}(a)}\right) {\bf \hat u} + \rmi S\hat u_{x}{\bf \hat y} &-2\rmi\bm{\Omega}\times {\bf \hat u} =\nonumber\\ &\rmi \frac{{\bf k}\cdot {\bf{\hat{v}}_{\rm g}}}{\omega_{\rm g}}\frac{\Delta {\bf u}^0}{{\tau_{\rm s}}(a)} -\rmi \frac{{\bf{\hat{v}}_{\rm g}}}{\tau_s(a)}. \end{align} Write as matrix equation \begin{align} \mathsf{A}(a){\bf\hat u} = \mathsf{D}(a) {\bf{\hat{v}}_{\rm g}}, \end{align} with \begin{align} \mathsf{A}=\left(\begin{array}{ccc} d & 2\rmi\Omega & 0\\ \rmi(S-2\Omega) & d & 0\\ 0 & 0 & d \end{array}\right), \end{align} with $d = k_xu_x^0 - \omega - \rmi/{\tau_{\rm s}}$, and \begin{align} \mathsf{D} = -\frac{\rmi}{{\tau_{\rm s}}}\mathsf{I} + \frac{\rmi}{{\tau_{\rm s}}\omega_{\rm g}}\left(\begin{array}{ccc} \Delta u_x^0 k_x & 0 & \Delta u_x^0 k_z\\ \Delta u_y^0 k_x & 0 & \Delta u_y^0 k_z\\ 0 & 0 & 0 \end{array}\right). \end{align} Hence ${\bf \hat u} = \mathsf{A}^{-1}\mathsf{D} {\bf{\hat{v}}_{\rm g}}$, which we can use in (\ref{eq:gasmomV}) to obtain \begin{align} \int \mathcal{K}(a) & \left[\Delta{\bf u}^0 \frac{\hat\sigma}{\sigma^0} + {\bf \hat u} - {\bf{\hat{v}}_{\rm g}}\right]\rmd a =\nonumber\\ & \int \mathcal{K}(a)\left[\mathsf{V}(a)\mathsf{A}^{-1}(a)\mathsf{D}(a) - \mathsf{I}\right]\rmd a {\bf{\hat{v}}_{\rm g}} \equiv \mathsf{M} {\bf{\hat{v}}_{\rm g}}. \label{eq:gasmomM} \end{align} The inverse of $\mathsf{A}$ is straightforward to calculate: \begin{eqnarray} \mathsf{A}^{-1}=\left(\begin{array}{ccc} -\frac{d}{\kappa^2-d^2} & \frac{2\rmi\Omega}{\kappa^2-d^2} & 0\\ \frac{\rmi(S-2\Omega)}{\kappa^2-d^2} & -\frac{d}{\kappa^2-d^2} & 0\\ 0 & 0 & \frac{1}{d} \end{array}\right). \end{eqnarray} The dispersion relation is found by plugging (\ref{eq:gasmomM}) into (\ref{eq:gasmomP}) and is given by \begin{align} \det(\mathsf{P} + \mathsf{M})\equiv f_{\rm disp}(\omega, k_x, k_z, \mu, c, \eta, \Omega, S, \sigma^0(a)) =0, \end{align} where we have explicitly indicated the dependence of $f_{\rm disp}$ on the parameters of the system. It is often convenient to work in non-dimensional units, choosing a time scale $\Omega^{-1}$ and a length scale $\eta/\Omega^2$. The non-dimensional dispersion relation is then \begin{align} f_{\rm disp}\left(\frac{\omega}{\Omega}, \frac{\eta k_x}{\Omega^2}, \frac{\eta k_z}{\Omega^2}, \mu, \frac{\Omega c}{\eta}, \frac{S}{\Omega}, \sigma^0(a)\right) =0, \end{align} with the understanding that $\sigma^0$ is normalized in such a way that when integrated over size it gives the required dust to gas ratio $\mu$. If we furthermore restrict ourselves to Keplerian discs ($S=3\Omega/2$) and the standard value $\Omega c/\eta = 1/0.05$ \citep[e.g.][]{2005ApJ...620..459Y}\footnote{The specific choice of $\Omega c/\eta$ is not important as long as $\Omega c/ \eta \gg 1$, so that gas motions are very subsonic and the gas can in principle be treated as an incompressible fluid \citep{2007ApJ...662..613Y}.}, it is clear that the parameters governing the system are $\mu$ and the size distribution $\sigma^0$: \begin{align} f_{\rm disp}\left(\nu, K_x, K_z, \mu, \sigma^0(a)\right) =0, \end{align} with $\nu = \omega/\Omega$ and $K = \eta k/\Omega^2$. \subsubsection{Evaluating the dispersion relation} Evaluating $f_{\rm disp}$ is an expensive operation because of the integrals in $\mathsf{M}$. Moreover, it turns out the integrals involved can often be very slowly converging, which makes standard numerical quadratures fail. As can be seen from (\ref{eq:gasdragint}), some of the integrands have $\omega - k_x u_x^0(a)$ in the denominator. If $\Re(\omega)=k_xu_x^0(a)$ for some $a$ in the size range under consideration, then the integral diverges for $\Im(\omega)=0$, and converges very slowly when $\omega$ has a very small imaginary part\footnote{Note that we evaluate the dispersion relation at a particular value of $\omega$, which is therefore a known quantity. What is not known is whether this particular value is in fact an eigenvalue.} . \begin{figure} \includegraphics[width=\columnwidth]{fig_quadrature.pdf} \caption{Evaluating the integral (\ref{eq:quadrature}) with {\sc quadpack}{} as implemented in {\tt scipy.integrate.quad} at two different error tolerances, together with the result obtained using the tanhsinh quadrature.} \label{fig:quadrature} \end{figure} \begin{figure*} \includegraphics[width=0.9\textwidth]{zoom.pdf} \caption{Colourized visualisation (also known as domain colouring) of $f_{\rm disp}$, for $K_x=54.11$, $K_z=300$, $\mu=10$ with an MRN size distribution ${\tau_{\rm s}}=[10^{-8}, 10^{-1}]\Omega^{-1}$. Colour indicates complex phase; brightness indicates absolute value. Clockwise from top left we zoom in by a factor of 10 in each panel. The black horizontal bar indicates the scale of the plot.} \label{fig:zoom} \end{figure*} Consider for example the integral \begin{align} \Im\left(\int_0^1 \frac{\rmd x}{x - \rmi\epsilon}\right) = \int_0^1 \frac{\epsilon \rmd x}{x^2 + \epsilon^2} = \tan^{-1}\left(\frac{1}{\epsilon}\right), \label{eq:quadrature} \end{align} which is representative of the difficult integrals when $\Im (\omega) = \epsilon$. In the limit $\epsilon \rightarrow 0$, the integral approaches $\pi/2$. Results obtained with {\sc quadpack}{} \citep{1983qspa.book.....P}, as implemented in {\tt scipy.integrate.quad} are shown in Figure \ref{fig:quadrature}. For a requested error tolerance of $10^{-8}$ (both absolute and relative) the integration fails for $\epsilon < 4.6\cdot 10^{-5}$, with a warning that the integral may be divergent or slowly convergent. For a more stringent error tolerance of $10^{-12}$ (again both absolute and relative), the integration fails for $\epsilon < 2.8\cdot 10^{-6}$ with additional warnings that the result may be affected by roundoff errors. Note that the integration fails despite the fact that the problematic region is at the edge of the integration domain ($x=0$), which is usually beneficial \citep{1983qspa.book.....P}. In order to evaluate the dispersion relation accurately for very small growth rates, we have turned to tanh-sinh quadrature \citep{tanhsinh}. The basic idea is to evaluate an integral \begin{align} I = \int_{-1}^1 f(x) dx, \end{align} by substituting $x = \tanh((\pi/2)\sinh t)$, and approximate the resulting integral over an infinite interval by the midpoint rule with step size $h$: \begin{align} I &= \frac{\pi}{2}\int_{-\infty}^\infty f(x(t))\frac{\cosh t}{\cosh^2\left(\frac{\pi}{2}\sinh t\right)} dt \nonumber\\ &\approx \frac{\pi h}{2} \sum_{i=-\infty}^\infty f(x(hi))\frac{\cosh(hi)}{\cosh^2\left(\frac{\pi}{2}\sinh (hi)\right)}\nonumber\\ &\equiv h \sum_{i=-\infty}^\infty f(x_i) w_i. \end{align} Since the weights $w_i$ go to zero double exponentially for $|i|\rightarrow \infty$ \citep{tanhsinh}, the number of terms needed in the sum should be small. The step size $h$ is reduced until the required error tolerance in reached. It is most efficient to proceed in levels, where at each level the step size is reduced by a factor of 2. In this case, half the terms are already known from the previous level and do not have to be recomputed. Furthermore, given a minimum step size $h_{\rm min}$, all abscissae and weights can be precomputed, which is advantageous if, like in our case, one needs to evaluate many integrals. We have chosen $h_{\rm min}=2^{-12}$, and set the maximum number of terms considered in the summation so that we aim for a precision of $\sim 10^{-15}$: \begin{align} x_{i_{\rm max}} &< 1 - 10^{-15},\\ w_{i_{\rm max}} &> 10^{-15}. \end{align} The first limit is to make sure we are not evaluating the integrand \emph{exactly} at the end points, which is necessary in cases where the function diverges at an endpoint but the integral is finite. The result for integral (\ref{eq:quadrature}) with the tanh-sinh quadrature is shown in Figure \ref{fig:quadrature} with the green line. Unlike {\sc quadpack}{}, tanh-sinh finds the correct limit of $\pi/2$ in the limit $\epsilon \rightarrow 0$. The reason for the qualitative improvement over {\sc quadpack}{} results lies in the fact that the almost-divergence at the left endpoint gets mapped onto $-\infty$ where the weights go to zero double exponentially. It is therefore important that any difficult points in the integration domain appear at the endpoints only. Most of the time for an integral appearing in our matrix $\mathsf{M}$ this is not the case, which is why we split up the integration domain into two intervals, separated at the size where $\omega = k_x u_x^0(a)$. This way, we have been able to obtain accurate values for $f_{\rm disp}$ for $\Im(\omega)/\Omega \geq 10^{-8}$. An example of the intricate structure of the dispersion relation is shown in Figure \ref{fig:zoom}, using $K_x=54.11$, $K_z=300$, $\mu=10$ and an MRN size distribution between Stokes numbers $10^{-8}$ and $10^{-1}$. This particular set of parameters gives rise to a growing mode with\footnote{Note that the number of digits in this frequency is chosen so that the result can be reliably reproduced with different sample points, see section \ref{sec:benchmark}.} $\nu = 0.29767708 + 2.8\cdot 10^{-7}\rmi$. In these domain colouring graphs \citep[see e.g.][]{farris}, a complex number is represented by a colour and a brightness. The colour is determined by the argument of the complex number, represented with a hue following the colour wheel. The brightness is determined by the magnitude of the complex number. Therefore, roots show up as dark points with a colour wheel around them, while poles show up as white points with colour wheels in the opposite direction. In the top left panel, two additional roots can be identified by their colour wheels at $\nu=0.83524314-0.014770598\rmi$ and $\nu = -1.1548451-0.0054118162\rmi$, both of which are damped. Zooming in by a factor of 10 in each subsequent panel, we can for the first time make out the root in the second to last panel, where it is located above a branch cut along the real axis, which can be identified by the jump in colour to purple for $\Im(\nu) < 0$. This branch cut indicates that in general, we can not assume $f_{\rm disp}$ to be well-behaved everywhere. \subsubsection{Root finding in the complex plane} \begin{figure} \includegraphics[width=\columnwidth]{attraction.pdf} \caption{Basins of attraction for the three roots of Figure \ref{fig:zoom}. Dark indicates convergence to the damped mode with negative real part, yellow to the damped root with positive real part, and green convergence to the growing mode.} \label{fig:attraction} \end{figure} Armed with a reliable algorithm to evaluate $f_{\rm disp}$, the remaining problem is to find its roots for a given set of parameters (in dimensionless form) $(\nu, K_x, K_z, \mu, \sigma^0(a))$. For brevity, we will refer to this problem as finding the roots of $f_{\rm disp}(\nu)$. Note that owing to the complexity of $f_{\rm disp}$ we do not have its derivative with respect to $\nu$ available, which reduces the number of root finding algorithms available. Since $\nu$ is complex in general, the search is two-dimensional, the degrees of freedom being the real and complex parts of $\nu$. While this makes root finding more difficult and expensive compared to root finding in $\mathbb{R}^1$, certain properties of complex numbers can make root finding in the complex plane more straightforward than in $\mathbb{R}^2$, some of which we will detail below. Unfortunately, very few numerical root finding algorithms can guarantee to find \emph{all} roots of a function. Iterative methods such as secant or Newton will converge on a root, but the convergence path in more than one dimension is often erratic, and there is often no straightforward relationship between the starting guess and the root the algorithm lands on. For polynomials, this sensitivity of the final answer to the starting guess leads to the concept of Newton fractals, where the boundaries of basins of attraction have a fractal structure. For the same parameters as used in Figure \ref{fig:zoom}, we show the basin of attraction for the growing mode in Figure \ref{fig:attraction} using the secant method. The green region has a size of only $\sim 10^{-4}$ in all directions. This means that without any prior information about the root, we would have to cover a square in the complex plane of size $\sim 1$ (so that both epicyclic and secular modes can be found) with $10^8$ starting points to be able to find this growing mode. This is clearly undoable. A very useful technique for finding roots in the complex plane makes use of contour integration. First of all, the number of zeros of an analytic function $f$ inside a contour $C$ can be found from Cauchy's argument principle, which involves a contour integral over $C$ of the logarithmic derivative of $f$: \begin{align} Z = \frac{1}{2\pi \rmi} \oint_C \frac{f'(z)}{f(z)}dz, \label{eq:contour} \end{align} where $Z$ is the number of zeros of $f$ inside $C$, counted as many times as its multiplicity. This follows from the fact that $f'/f$ has a simple pole at each zero of $f$ with residue equal to the multiplicity of the zero. A generalization allows the positions of the roots to be calculated \citep{delves}, even without needing the derivative of $f$ \citep{ioakimidis}. This algorithm can in principle guarantee to find \emph{all} roots inside $C$. Unfortunately, our function $f_{\rm disp}$ is not analytic everywhere, as shown for example by the branch cut along the real axis in Figure \ref{fig:zoom}. Even if this can be remedied by choosing $C$ carefully, a more serious issue is the small-scale structure in $f_{\rm disp}$ apparent in Figure \ref{fig:zoom}, resulting in a very large number of function evaluations necessary to calculate the contour integrals. Since evaluating $f_{\rm disp}$ is very expensive, this unfortunately makes this algorithm impractical even if the positions of all branch cuts are known. A different approach consists of first approximating $f_{\rm disp}$ by a rational function, and using the zeros of the rational approximation as starting points for the secant method. We have opted for the AAA algorithm as described in \cite{AAA}. Working in dimensionless units, given a set of $M$ sample points $\left\{\nu_i\right\}$ with associated data values $\left\{f_{{\rm disp},i}\right\}$, use a subset of $m<M/2$ support points for a rational barycentric interpolation: \begin{align} r(\nu) = \left.\sum_{j=1}^m \frac{w_j f_{{\rm disp},j}}{\nu - \nu_j} \middle/ \sum_{j=1}^m\frac{w_j}{\nu-\nu_j}\right. , \end{align} with properties $r(\nu_i) = f_{{\rm disp},i}$ and also $r$ has no poles at $\left\{\nu_i\right\}$. The weights $\left\{w_i\right\}$ are chosen in such a way that $r(\nu)$ is the best fit to the \emph{remaining} sample points in the least-squares sense. If we label the $M-m$ remaining sample points, i.e. those points that are not used as support points, as $\left\{N_i\right\}$ and the associated data values as $\left\{F_i\right\}$, the least squares problem can be cast as \begin{align} \mathrm{minimize} \norm{A w},~\norm{w}=1, \label{eq:leastsquares} \end{align} where $A$ is the $(M-m)\times m$ matrix \begin{align} A = \left(\begin{array}{ccc} \frac{F_1-f_{{\rm disp},1}}{N_1-\nu_1} & \cdots & \frac{F_1-f_{{\rm disp},m}}{N_1-\nu_m}\\ \vdots & \ddots & \vdots\\ \frac{F_{M-m}-f_{{\rm disp},1}}{N_{M-m}-\nu_1} & \cdots & \frac{F_{M-m}-f_{{\rm disp},m}}{N_{M-m}-\nu_m} \end{array}\right). \end{align} The least-squares problem (\ref{eq:leastsquares}) is solved by singular value decomposition \citep{AAA}. If the maximum residual $\max_i |r(\nu_i) - F_i|$ is smaller than a given tolerance (typically set to $10^{-13} \max_i F_i$), the approximation is deemed good enough and the algorithm terminated. Otherwise, an extra support point is chosen from $\left\{N_i\right\}$, followed again by the least-squares problem, until the desired tolerance is reached. The extra support point is chosen to be the one that has the largest residual. Note that in order for the least squares problem to make sense, we need $M-m > m$, or $m < M/2$. In all cases we have considered, $m \ll M$ when the desired tolerance is reached. \begin{figure} \includegraphics[width=\columnwidth]{graph_psimode.pdf} \caption{Flowchart of the rootfinding algorithm. Input is the domain $D$, wavenumbers $K_x$ and $K_z$, and the parameters $\mu$ and the size distribution given by $\sigma^0(a)$. Outputs are the roots in $D$, if any.} \label{fig:graph_psimode} \end{figure} Having obtained a rational approximation $r(\nu)$, its zeros can be found from the generalized eigenvalue problem \citep{klein}: \begin{align} \left(\begin{array}{ccccc} 0 & w_1 f_{{\rm disp},1} & w_2 f_{{\rm disp},2} & \cdots & w_m f_{{\rm disp},m}\\ 1 & \nu_1 & & &\\ 1 & & \nu_2 & & \bigzero\\ \vdots & \bigzero & & \ddots & \\ 1 & & & & \nu_m \end{array}\right) = \nonumber\\ \lambda \left(\begin{array}{ccccc} 0 & & & &\\ & 1 & & \bigzero &\\ & & 1 & &\\ & \bigzero & & \ddots & \\ & & & & 1 \end{array}\right). \end{align} At least two of the eigenvalues are infinite, and the remaining $m-1$ eigenvalues are the roots of $r(\nu)$. These roots are then used as starting points for secant iterations with the exact dispersion relation. The rational approximation often has spurious poles and roots that occur in pairs, the so-called Froissart doublets \citep{froissart, AAA}. Fortunately these are easy to identify since pole and root almost cancel each other in terms of their residue, making the contour integral around the doublet almost zero. In a cleanup step, we therefore take a very small rectangular contour around each root of the rational approximation and calculate the associated residue. If it is smaller than a cleaning tolerance set by the user, the support point closest to this spurious root is removed from the rational approximation. As a result, the spurious root disappears. Care has to be taken with setting the cleaning tolerance: too aggressive cleaning reduces the quality of the rational approximation as many support points are removed. In addition, there is always the chance of accidentally removing a non-spurious root. On the other hand, each root is followed up by a secant iteration on the exact dispersion relation, which is expensive. We decided on a safety net, enforcing a minimum number of support points and at least one root inside the domain of interest. The cleaning tolerance is temporally increased if one of these requirements is not met. The rootfinding algorithm takes as input a domain $D$, a connected open subset of the complex plane, which will be searched for roots. Since we are interested in growing modes, we usually take $D$ to be above the real axis. While not strictly necessary for the rootfinding algorithm, it is much more efficient to avoid the branch cut on the real axis. We therefore typically limit ourselves to $\Im(\nu) > 10^{-8}$, and while we then can not exclude growth rates $< 10^{-8}\Omega$, if present these modes would be dynamically unimportant. In practice, it is straightforward, but relatively expensive, to verify that no growing modes exist by letting $D$ drop slightly below the real axis. On the other end we typically limit $D$ to $\Im(\nu) < 1$, since growth rates faster than the dynamical time scale are not expected for the SI. In practice, these modes would be very easy to find (all the difficulties typically occur close to the real axis). It should also be noted that the rational approximation is in principle valid outside $D$ (it only knows about the sample points, not about $D$), and can be quite accurate if the dispersion relation is quite smooth, which is typically the case away from the real axis. This means that it is likely that faster growing modes could be found without enlarging $D$. The real range of $\nu$ we consider is typically $-2 < \Re(\nu) < 2$, so that both epicyclic ($|\Re(\nu)| \sim 1$) and secular ($|\Re(\nu)| \ll 1$) roots can be found. Similar to the fast growing modes, it is likely that any growing modes with $|\Re(\nu)| > 2$ can be found without enlarging $D$. We draw sample points from a uniform random distribution over $D$, therefore not including any prior knowledge about any possible roots of $f_{\rm disp}$. For many roots only a few sample points are enough (see below). The root displayed in Figure \ref{fig:zoom}, on the other hand, is one of the most difficult roots to find. In essence, we need a sample point in or very close to the green region in Figure \ref{fig:attraction} in order for the root to be `noticed' by the AAA algorithm. For sample points that are uniformly distributed over $D$, this would mean $\sim 10^8$ sample points, which is again computationally too expensive to be practical. However, we can use the fact that the rational approximation is likely to be good just outside $D$ to make the algorithm adaptive in a straightforward way. If we take our standard imaginary range for $D$, i.e. $10^{-8} < \Im(\nu) < 1$, then for any realistic number of sample points the rational approximation does not yield any roots in $D$ for the parameters of Figure \ref{fig:zoom}, or at least the roots do not converge to the growing root upon secant iteration on the exact dispersion relation. However, there are always damped roots of the rational approximation (which are therefore outside $D$). Take such a root $\nu_{\rm damped}$ and create a \emph{zoom domain} $D'$ close to $\nu_{\rm damped}$ but inside $D$. In practice, we take the size of the $D'$ to be $\sim |\Im(\nu_{\rm damped})|$. The zoom domain is populated with the same number of sample points as $D$, and a new rational approximation is calculated based on all sample points of both $D$ and $D'$. This process is repeated until either a growing root is found or the maximum number of zoom levels is reached. A flowchart of the basic rootfinding algorithm is shown in Figure \ref{fig:graph_psimode}. The main issue with the algorithm as presented there is that there is no guarantee that \emph{all} roots inside $D$ will be found. In particular, if the rootfinding algorithm returns an empty list, that does not mean that there are no roots inside $D$. It may well be that by increasing the number of sample points and the maximum number of zoom levels a root can be found. If we are interested in only a single set of parameters, it makes sense to throw in the maximum number of points and the maximum number of zoom levels that is computationally feasible. A more common situation, however, is that we are performing parameter scans, for example over wavenumbers. This allows for extra information to be given to the root finder, namely the roots of previously calculated parameters that are nearby. These roots can be passed to the root finder and added as zoom domains automatically at the start. This can speed up parameter scans considerably, making difficult roots much more easy to find, and is exploited by the wavenumber space mapping algorithm discussed in Section~\ref{sec:mapping}. \begin{figure} \includegraphics[width=\columnwidth]{singlefluid.pdf} \caption{Comparison by way of a domain colouring graph of the exact dispersion relation (top panel) to the rational approximation using $10$ samples (bottom panel) for a single size dust fluid with $K_x=54.11$, $K_z=300$, $\mu=10$ and $\mathrm{St}=0.1$.} \label{fig:singlefluid} \end{figure} \begin{figure} \includegraphics[width=\columnwidth]{rational.pdf} \caption{Comparison by way of a domain colouring graph of the exact dispersion relation (top panel) to the rational approximation using $10$ samples and $5$ zoom levels (bottom panel) for the parameters of Figure \ref{fig:zoom}. The inset in the lower panel shows the area around the root of the exact dispersion relation, indicated by the cross.} \label{fig:rational} \end{figure} \begin{figure} \includegraphics[width=\columnwidth]{roots_complex_plane_trajectory.pdf} \caption{Visualisation of central dispersion relation roots in the complex plane for $K_x=54.11$, $K_z=300$, $\mu=10$ with an MRN size distribution ${\tau_{\rm s}}\in [{\tau_{\rm s,min}}, 10^{-1}\Omega^{-1}]$ with ${\tau_{\rm s,min}} \in [10^{-8},10^{-1}]\Omega^{-1}$, where the colour corresponds to the lower end of the dust size distribution.} \label{fig:traject} \end{figure} The power of the AAA algorithm is illustrated in Figure~\ref{fig:singlefluid}, where we compare the exact dispersion relation (top panel) to the rational approximation (bottom panel) for the single size limit of the parameters used in Figure \ref{fig:zoom}. The rational approximation was obtained using 10 samples, 5 of which were used as support points. The exact dispersion relation has two growing roots at $\nu=-1.29535+0.023936\rmi$ and $\nu=0.576094 + 0.470201\rmi$, and the rational approximation is almost indistinguishable even for such a small number of samples. The roots of the rational approximation are located at the correct location to 4 significant digits. The sample points $\nu_i$ were drawn from a uniform random distribution with real part $\Re(\nu_i) \in [-2,2]$ and imaginary part $\Im(\nu_i) \in [10^{-8},1]$. While this is one of the easiest roots to find, the accuracy per number of function evaluations (i.e., $10$) is remarkable. The parameters of Figure \ref{fig:zoom} give rise to one of the most difficult roots to find. Here the adaptive zoom algorithm is absolutely necessary. Using $10$ sample points per domain, $5$ zoom levels are sufficient to locate the root, giving rise to $170$ sample points in total, of which $39$ support points. The result is displayed in Figure~\ref{fig:rational}. While the global structure is reproduced well without any zoom domains, the fine structure around the root only becomes apparent when using multiple zoom levels. After adding new zoom levels $5$ times, the root in the rational approximation appears close enough to the actual root so that a secant iteration on the exact dispersion relation converges on the growing root. The inset in the bottom panel shows that the root of the rational approximation does not coincide exactly with the root of $f_{\rm disp}$ (indicated by the cross), but a secant iteration gets there in $2$ steps. The total number of evaluations of $f_{\rm disp}$ to get the result of Figure~\ref{fig:rational} is $198$. The vast majority comes from calculating the $170$ function samples, while the remaining $28$ are from failed secant iterations after each zoom level. The bulk of the computational time still goes into evaluating $f_{\rm disp}$ rather than the calculation of the rational approximation and its roots. It is worth noting that no prior information about the location of the root was used: the calculation was fully adaptive. It is instructive to see how the roots change when the size distribution is widened from single size (Figure~\ref{fig:singlefluid}) to the full width of Figure~\ref{fig:rational}. The paths of the roots are depicted in Figure~\ref{fig:traject}, where we keep the maximum stopping time fixed at $10^{-1}\Omega^{-1}$ and decrease the minimum stopping time from $10^{-1}\Omega^{-1}$ (yellow, single size limit of Figure~\ref{fig:singlefluid}) to $10^{-8}\Omega^{-1}$ (dark blue, the full width of Figure~\ref{fig:rational}). The growing root with negative real part very quickly finds itself below the real axis, at a stopping time range of $\sim 10$. The root that grows fastest in the single size limit progressively moves towards the real axis, never crossing it, and landing on a growth rate of $2.8 \cdot 10^{-7} \Omega$. \subsection{Root counting} \label{sec:rootcounting} \begin{figure} \includegraphics[width=\columnwidth]{arg.pdf} \caption{Argument of $f_{\rm disp}$ for the parameters of Figure \ref{fig:singlefluid} (single size, blue curve) and Figure \ref{fig:rational} (size distribution, orange curve). The vertical dotted lines indicate the corners of the contour, from left to right $-2 + 2\cdot 10^{-7}\rmi$, $2 + 2\cdot 10^{-7}\rmi$, $2 + \rmi$ and $-2+\rmi$.} \label{fig:arg} \end{figure} \begin{figure} \includegraphics[width=\columnwidth]{linABCD.pdf} \caption{Growth rates of the four monodisperse test cases {\tt linA}, {\tt linB} \citep{2007ApJ...662..613Y} and {\tt linC} and {\tt linD} \citep{2010ApJS..190..297B} when widening the size distribution towards smaller sizes. For each curve, the rightmost end corresponds to the monodisperse limit. Monodisperse results from \citet{2007ApJ...662..613Y} and \citet{2010ApJS..190..297B} are marked by crosses. } \label{fig:linABCD} \end{figure} While finding the roots using contour integral techniques turned out to be impractical, we can still use (\ref{eq:contour}) to calculate the number of zeroes inside a contour $Z$, since it is possible to write the integral in terms of the change in argument of $f$ along $C$. This follows simply from the fact that $\log f = \log (|f|) + \rmi\, \mathrm{arg} f$ (modulo $2\pi\rmi$), and hence \begin{align} Z = \frac{1}{2\pi \rmi} \oint_C \frac{\rmd}{\rmd z}\left(\log f(z)\right)dz = \frac{1}{2\pi} \left[\mathrm{arg} f\right]_{z \in C}, \label{eq:argincrease} \end{align} where $\left[X\right]_\gamma$ denotes the increase in $X$ along the path $\gamma$. Note that this makes $Z$ the winding number of $f(C)$ around the origin. In practice, one divides up the contour $C$ into small steps, located between a series of points $c_1$, $c_2$, $\dots$. If the argument of $f$ changes by less than $\pi$ between $c_k$ and $c_{k+1}$, the change in argument of $f$ over this step is simply $\mathrm{arg}(f(c_{k+1})/f(c_k))$. Therefore, if this condition is verified for all steps, we have that \begin{align} Z = \frac{1}{2\pi} \sum_k \mathrm{arg}\left(\frac{f(c_{k+1})}{f(c_k)}\right). \label{eq:znum} \end{align} The problem is that without any further knowledge on the global properties of $f$, it is impossible to know whether the argument condition between steps is satisfied \citep[see e.g.][]{yingkatz}. In practice this means that it is not possible to get a cast-iron guarantee that the number of roots as found from a numerical implementation of (\ref{eq:znum}) is correct. However, since this is essentially a one-dimensional problem, it is relatively straightforward to implement a reliable refinement algorithm. Starting from the minimum amount of points that define a piecewise linear contour, we keep dividing up segments if either \begin{itemize} \item{The length of the segment is longer than a user-supplied value.} \item{The change in argument along a segment is larger than a user-supplied limit.} \end{itemize} By default, both parameters are set to $0.1$, which yields reliable results in almost all cases. Looking again at the cases of Figures~\ref{fig:singlefluid} and~\ref{fig:rational}, and defining a rectangular contour with corners $-2 + 2\cdot 10^{-7}\rmi$, $2 + 2\cdot 10^{-7}\rmi$, $2 + \rmi$ and $-2+\rmi$, we find the results depicted in Figure~\ref{fig:arg}. It is immediately apparent that the argument of $f_{\rm disp}$ shows structure on very small scales, so that jumps in $2\pi$, essential for calculating the winding number, can easily be missed. The single size case (blue curve) increases the argument by $4\pi$ before returning to the starting point, indicating there are two roots in the domain, while the full size distribution (orange curve) increases the argument by $2\pi$, indicating that there is only one root inside the domain. These numbers agree with Figure~\ref{fig:traject} in the two limits. To produce the single size curve, $384$ function evaluations were needed, while for the full size distribution $501$ function evaluations were needed. This last number should be compared to the $198$ function evaluations needed to actually find the position of the root using the AAA algorithm. Nevertheless, this technique provides an independent verification that we are not missing any roots. \subsection{Wavenumber space mapping algorithm} \label{sec:mapping} The root finder algorithm has a remarkable power, but the accuracy and cost is not fully deterministic. This is both due to the role of the random sample points in the AAA algorithm stage and the difficulty of the complex basis of attraction for roots with the secant iteration. However, we have found that roots with fast growth rates, and those which occur in certain dispersion relation configurations are more easily and reliably located. We employ an algorithm designed to exploit the strengths and work around the weaknesses of the root finder. This mapping algorithm is based on using easily found roots as guesses for neighbouring points in wavenumber space. First, root finder runs are performed on a coarse grid in wavenumber space. This pass most easily picks up the core of islands of growing modes. Next, another pass is made over the grid, rerunning the root finder algorithm for each point where no growing eigenvalues were found but having neighbouring points with growing eigenvalues, using those neighbour values as guesses which trigger enhanced sampling of the AAA algorithm rational approximation. As a protection against excessive work due to redundant roots, the list of guesses is pruned to remove values by dropping the guess $\nu_j$ from the set of guesses when $\|\nu_i-\nu_j\| < 10^{-4}\|\Im(\nu_i)\|$ for $j>i$. This pass is repeated again if the newly found roots cause any other point with no roots to have new neighbours, until a pass over the grid is made which reveals no new roots. Having exhausted all possibilities at the current refinement level, the grid is refined by a factor of two in each direction in wavenumber space, injecting new points in between the existing ones. The cycle of passing over the grid, visiting each point where no root has been found, and using the roots from neighbouring points as guesses for enhanced sampling of the rational approximation is repeated on this refined grid. As an additional protection against the stochastic nature of the root finding algorithm, for each point in wavenumber space multiple AAA algorithm runs are made with different random number generator seeds. In practice we find four repetitions per point to be sufficient (although conservative). The cost of repeated solutions can be traded off against a number of other parameters. These include an increased grid resolution yielding more accurate guesses from neighbouring grid points, the use of more samples, or a smaller tolerance in the AAA algorithm. Tuning the parameters of the wavenumber mapping algorithm affects the cost to find a filled out map, but not the accuracy of the dispersion relation roots found. In practice, small omissions in the wavenumber map of fastest growing eigenvalues will not inhibit its interpretation as in many cases the accuracy of the values found is more important \begin{table*} \caption{Reference PSI Eigenvalues for an MRN dust distribution} \label{tab:benchmark} \begin{tabular}{cccccc} \hline $\mu$ & $\beta$ & $\tau_{\rm s}$ $[\Omega^{-1}]$ & $K_x$ & $K_z$ & $\omega \ [\Omega]$ \\ \hline $0.5$ & $-3.5$ & $[10^{-8}, 10^{-2}]$ & $35$ & $1$ & $0.0238231683+0.002011559\rmi$ \\ $0.5$ & $-3.5$ & $[10^{-8}, 10^{-2}]$ & $500$ & $240$ & $0.3610751+0.01554988\rmi$ \\ $3$ & $-3.5$ & $[10^{-8}, 10^{-1}]$ & $10$ & $0.1$ & $0.00751969859+0.0019668183\rmi$ \\ $3$ & $-3.5$ & $[10^{-8}, 10^{-1}]$ & $80$ & $333$ & $0.66028708+0.12914965\rmi$ \\ \hline \end{tabular} \end{table*} \begin{figure*} \includegraphics[width=0.33 \textwidth]{krapp19_fig1_psi_growth.pdf} \includegraphics[width=0.33 \textwidth]{krapp19_fig1_psi_frequency.pdf} \includegraphics[width=0.33 \textwidth]{krapp19_fig1_psi_count.pdf} \caption{Growing eigenvalues (in units of $\Omega$) for the main cases of \citet{2019ApJ...878L..30K}, with $\mu=1$ and MRN dust distribution. {\sl Top}: ${\tau_{\rm s}}\in[10^{-4},10^{-1}]\Omega^{-1}$ {\sl Bottom}: ${\tau_{\rm s}}\in[10^{-4}, 1]\Omega^{-1}$ {\sl Left}: Growth rate {\sl Middle}: Frequency {\sl Right}: Root count in the domain $\mathfrak{R}(\omega) \in [-2, 2]$, $\mathfrak{I}(\omega) \in [2\times 10^{-7}, 1]$.} \label{fig:krapp19fig1psigrowth} \end{figure*} \begin{table*} \caption{PSI eigenvalues for \citet{2020arXiv200801119Z} cases} \label{tab:zy20benchmark} \begin{tabular}{cccccc} \hline $\mu$ & $\beta$ & $\tau_{\rm s}$ $[\Omega^{-1}]$ & $K_x$ & $K_z$ & $\omega\ [\Omega]$ \\ \hline $2$ & $-3.5$ & $[10^{-3}, 10^{-1}]$ & $60$ & $60$ & $0.50033907+0.09766131\rmi$ \\ $0.2$ & $-3.5$ & $[10^{-3}, 10^{-1}]$ & $10$ & $10$ & No roots with $\Im(\omega)>2\times 10^{-7}$ exist for ${\tau_{\rm s,min}} < 1.851\times10^{-2}$\\ $0.2$ & $-3.5$ & $[10^{-3}, 2]$ & $1$ & $1$ & $-0.63022118+0.03973764\rmi$ \\ \hline \end{tabular} \end{table*} \begin{figure*} \includegraphics[width= 0.75\textwidth]{yz20_growth.pdf} \caption{ Growth rate maps for cases from \citet{2020arXiv200801119Z}, all MRN dust distributions. {\sl Top row}: ${\tau_{\rm s}}\in[10^{-4},10^{-2}]\ \Omega^{-1}$ {\sl left} $\mu=0.1$, {\sl middle} $\mu=0.158$, {\sl right} $\mu=0.398$ {\sl Bottom row}: $\mu=1$, ${\tau_{\rm s,min}}=10^{-4} \ \Omega^{-1}$ {\sl left} ${\tau_{\rm s,max}}=0.1\ \Omega^{-1}$, {\sl middle} ${\tau_{\rm s,max}}=1\ \Omega^{-1}$, {\sl right} ${\tau_{\rm s,max}}=5\ \Omega^{-1}$ .} \label{fig:ZY20} \end{figure*} \section{Example Computations} \label{sec:examples} In this section we use the new algorithms as implemented in {\tt psitools} \citep{psitools} to calculate some benchmark values and results for problems previously appearing in the literature \citep{2019ApJ...878L..30K,2020arXiv200801119Z}. In these examples, the dust distributions are all MRN distributions, which can be specified by a scaling as \begin{align} \sigma(a) \propto a^{3+\beta},\ \beta=-3.5\, . \end{align} in terms of the dust particle radius $a$. For all results in this section the radial pressure support of the disc is $\eta=0.05\ r_0\Omega^2$. \subsection{Monodisperse modes} \label{sec:mono} We first consider four benchmark cases that were considered in the monodisperse limit by \cite[][{\tt linA} and {\tt linB}]{2007ApJ...662..613Y} and \cite[][{\tt linC} and {\tt linD}]{2010ApJS..190..297B}. Starting from the monodisperse limit, we increase the width of the size distribution towards smaller sizes using an MRN size distribution, keeping the dust-to-gas ratio constant, until the minimum stopping time is $10^{-8}\Omega^{-1}$. The resulting growth rates are displayed in Figure \ref{fig:linABCD}. At the rightmost point of each curve, which corresponds to the monodisperse limit, we recover the growth rates given in \cite{2007ApJ...662..613Y} to 4 significant digits and those in \cite{2010ApJS..190..297B} to 7 significant digits. The same holds for the real parts of $\omega$. The monodisperse growth rates are indicated by crosses in Figure \ref{fig:linABCD}. When widening the size distribution, two of the modes, {\tt linB} and {\tt linD}, vanish, while the other two reach a limit with non-zero growth, although considerably slower growth than in the monodisperse limit. \subsection{Reference PSI Eigenvalues} \label{sec:benchmark} To aid in future comparisons and for verifying the functionality of the {\tt psitools} package when run, we have tabulated a set of example roots in Table~\ref{tab:benchmark}. These have been produced with the root finding technique. To account for the convergence of the final root finding iteration, the solution was repeated from the AAA algorithm with different random sample points ten times, and then result quoted results from truncating the real and imaginary parts to the number of digits having the same value in all ten results. Thus all the digits displayed here should be reproducible and independent of the starting point for the complex root finding iteration. \subsection{Comparison to Krapp et al.~(2019) cases} \label{sec:krappfig1} We present results for the main cases of \citet{2019ApJ...878L..30K} cases in Figure~\ref{fig:krapp19fig1psigrowth} as a demonstration of wavenumber space mapping and root counting. In these PSI configurations we find the presence of growing modes is isolated to small sections of the wavenumber space we examined, with no appreciable growth ($>2\times10^{-7}\ \Omega^{-1}$) in most regions. In the upper panel of Figure~\ref{fig:krapp19fig1psigrowth}, we find two regions of growth above the threshold exist. The fastest growth is contained in a diagonal ridge, with a growth rate of $0.0161\ \Omega$ and frequency $0.232\ \Omega$ at $K_x=20.0$, $K_z=6.56$, similar to the peak value in \citet{2019ApJ...878L..30K} their figure~1. However, in our results we do not find the ridge of fast growth $\geq 10^{-3}\ \Omega$ continuing to $K_z=10^3$ as \citet{2019ApJ...878L..30K} did with 512 fluids. Instead, both the root finding calculations and root-counting map do not find any mode with growth above the $2\times10^{-7}\ \Omega$ threshold in this ridge for $K_z > 34.14$. A second region of growing modes exists along the $K_z$ axis, with growth rates $\sim 10^{-4}\ \Omega$ and frequencies $\approx -1\ \Omega$. This region also appears in \citet{2019ApJ...878L..30K} their figure~1, with weak dependence on the number of fluids used and a similar growth rate suggesting it is reasonably well converged in their calculations. Comparing the lower panels of Figure~\ref{fig:krapp19fig1psigrowth} and \citet{2019ApJ...878L..30K} their figure~1 shows the ridge of fastest growing modes disappears in the continuum limit. That is, the ridge of growing modes inside the $10^{-3}\ \Omega$ contour in their calculation with 512 dust fluids is completely absent in our results (Figure~\ref{fig:krapp19fig1psigrowth} lower panel) for a continuous dust distribution. The remaining growth in our continuum calculation is instead along the $K_z$ axis, at a level slightly below $10^{-3}\ \Omega$. This region is in good agreement with the values found in the 512 dust fluid calculation from \citet{2019ApJ...878L..30K}. Thus, it appears that their 2048 species result on the maximum growth rate of $\sim 10^{-3}\ \Omega$ for this configuration in (\citet{2019ApJ...878L..30K} their figure~4) is very close to the continuum result, but this does not correspond to the region with the fastest growth in their 512 fluid calculation. \subsection{Comparison to ZY20 cases} \label{sec:ZY20} \citet{2020arXiv200801119Z} have also published results which the {\tt psimode} root finder can be compared to. First, we provide results for the continuum limit of the cases in \citet{2020arXiv200801119Z} their table~1 in Table~\ref{tab:zy20benchmark}. For the first and last case, the root finding algorithm finds a finite growth rate in good agreement with the highest resolution result given in \citet{2020arXiv200801119Z}. However, in the $\mu=0.2$, ${\tau_{\rm s}}\in[10^{-3},10^{-1}]\ \Omega^{-1}$, $K_x=10$, $K_z=10$ case we do not find an unstable root of the PSI dispersion relation with a growth rate above $2\times10^{-7}\Omega$ for a dust distribution wider than ${\tau_{\rm s}}\in[1.851\times 10^{-2},10^{-1}]\ \Omega^{-1}$. It should be noted that for this case the values given in \citet{2020arXiv200801119Z} are falling nearly linearly with increasing resolution, suggesting agreement with our result that in the continuum case the growth rate is very close to zero. Results from the root finder and wavenumber mapping algorithm corresponding to \citet{2020arXiv200801119Z} their figures~8 and~9 are shown in Figure~\ref{fig:ZY20}. It should be noted that the final one of these cases goes significantly beyond ${\tau_{\rm s}}=1\ \Omega^{-1}$, where in general the fluid formulation for dust is not strictly valid \citep[][see also section \ref{sec:fluid}]{2004ApJ...603..292G, 2011MNRAS.415.3591J}. However, we have run this case regardless for comparison purposes as the mathematical problem posed is the same regardless of the physical consistency. Agreement with the better converged regions of the \citet{2020arXiv200801119Z} results is good. Notably our results also agree that the poorly resolved ridge of apparent growth in \citet{2020arXiv200801119Z} their figure~8 (Figure~\ref{fig:ZY20} top row), which is rapidly decreasing with resolution and lies along the monodisperse resonant drag instability curve, is not present in the continuum PSI case. In the cases from \citet{2020arXiv200801119Z} their figure~9 (Figure~\ref{fig:ZY20} bottom row) we find that two regions of growth for the PSI exist, but unlike \citet{2020arXiv200801119Z} in the ${\tau_{\rm s,max}}=5\Omega^{-1}$ case we find growing modes above our threshold continuously joining both islands of growth. In discussing their results for these setups, \citet{2020arXiv200801119Z} pose that these leave as a question for future studies of why the PSI shows fast growth at some wavenumbers, and simple direct calculations of the eigenproblem converge only towards very slow or zero growth at others. The answer to this is that the PSI size resonance yields instability growth which asymptotically tends to zero as the distribution is widened for many wavenumbers, and only yields finite growth for wide distributions at certain points in wavenumber space, as shown in \citetalias{paper1}. \section{Conclusions} \label{sec:conclusions} In this second paper of the series, following the presentation of the basic setup and analysis of the terminal-velocity limit of PSI in \citetalias{paper1}, we have presented further mathematical background and advanced numerical techniques for the full PSI problem. We have presented the first-principles derivation of the governing equations for polydisperse dust-gas flows with dilute dust, the Polydisperse Streaming Instability linear stability problem, and a range of methods for accurately solving the resulting eigenproblem. We have elucidated the limitations of the a direct methods of solving the eigenproblem based on a discretization of the dust continuum in stopping time as employed by \citet{2019ApJ...878L..30K}, \citet{2020arXiv200801119Z}, and \citetalias{paper1}. Recognizing these limitations has lead to an alternate formulation of the linear stability eigenproblem based on reducing the dispersion relation to a complex polynomial with accuracy limited only in practice by floating point restrictions. After describing the structure of this dispersion relation in the complex plane, we have presented an efficient set of algorithms for complex root finding in the specific PSI dispersion relation case. This circumvents entirely the large computational expense inherent in the previous direct discretizations of the problem, while also providing significant insight with the ability to map the structure of the PSI dispersion relation. As byproduct, we presented a method for numerically computing the number of roots of the PSI dispersion relation inside a contour in the complex plane through contour integration. This provides another independent check on the convergence and accuracy of the results of the direct or root-finding solvers for the PSI stability problem. Furthermore, we have presented a method for efficiently making maps of growing modes in wavenumber space with this root finding algorithm, through recursively refining a mesh in parameter space, and using the results of neighbouring points in phase space to guide the root-finding algorithm, thereby deceasing cost and increasing reliability. An implementation of all the methods presented is available in the {\tt psitools} package \citep{psitools}. These methods should be useful for general problems involving root finding in the complex plane, in particular when evaluating the function is expensive. Potential examples include finding linear modes in self-gravitating discs \citep[e.g.][]{1989ApJ...347..959A}, and linear modes of the Rossby Wave Instability \citep{1999ApJ...513..805L}. The next paper in this series will apply these methods to a survey of the most promising regimes where the PSI may provide a mechanism for manifesting the critical planetesimal formation stage in planet formation. \section*{Acknowledgements} The software described in this work makes use of the NumPy \citep{2011CSE....13b..22V}, SciPy \citep{2020NatMe..17..261V}, and mpi4py \citep{DALCIN2008655}, pytest, and pytest-mpi libraries. This research was supported by a STFC Consolidated grants awarded to the QMUL Astronomy Unit 2017--2020 ST/P000592/1 and 2020--2023 ST/T000341/1. We acknowledge that the results of this research have been achieved using the DECI resource Beskow based in Sweden at PDC with support from the PRACE aisbl. This research utilised Queen Mary's Apocrita HPC facility, supported by QMUL Research-IT \citep{apocrita}. SJP is supported by a Royal Society URF. \section*{Data availability} The software used to perform calculations in this work is publicly archived on Zenodo \citep{psitools}. \bibliographystyle{mnras}
\section{Conclusion} \label{sec:sum} We provided a stability and performance analysis of MPC based on finite-tail cost. The proposed MPC formulation provides a nice middle ground between MPC formulations with and without terminal ingredients. Due to the simple design and the typically less restrictive stability condition, this MPC formulation may be especially useful whenever the design of suitable terminal ingredients is non-trivial, such as control problems involving dynamic operation, model adaptation, or data-driven input-output models. \section*{ACKNOWLEDGEMENTS} We would like to thank our colleagues D. Gramlich and J. Berberich for helpful comments on the manuscript. \section{Numerical example} \label{sec:num} The following example shows the general applicability of the finite-tail cost MPC and the benefits compared to an MPC formulation without any terminal ingredients. We consider the nonlinear four tank system taken from~\cite{raff2006nonlinear} with \begin{align*} A_1\dot{x}_1=&-a_1\sqrt{2gx_1}+a_3\sqrt{2gx_3}+b_1 u_1,\\ A_2\dot{x}_2=&-a_2\sqrt{2gx_2}+a_4\sqrt{2gx_4}+b_2 u_2,\\ A_3\dot{x}_3=&-a_3\sqrt{2gx_3}+(1-b_2)u_2,\\ A_4\dot{x}_4=&-a_4\sqrt{2gx_4}+(1-b_1)u_1, \end{align*} where $x_i$ denotes the water level of tank $i$, $u_i$ corresponds to the water inflow, and the parameters $a_i,A_i,b_i,g$ are positive constants. The discrete-time system is defined using an Euler discretization and a sampling time of $T_{\mathrm{s}}=3s$. We consider the problem of stabilizing a setpoint $(x_{\mathrm{s}},u_{\mathrm{s}})$ with the quadratic stage cost $\ell(x,u)=\|x-x_{\mathrm{s}}\|_Q^2+\|u-u_{\mathrm{s}}\|_R^2$, $Q=\text{diag}(1,1,10^{-2}, 10^{-2})$, $R=\text{diag}(10^{-4},10^{-4})$. This problem is equivalent to the problem of stabilizing the origin (Ass.~\ref{ass:tracking_cost}), using a simple coordinate shift. The system constants, the setpoint, and the box constraints $\mathbb{Z}$ are chosen as in~\cite{raff2006nonlinear}. In the following, the local stability properties of $\kappa$ are verified numerically, analogous to the numerical computation of the terminal set size in~\citep[Remark~3.1]{chen1998quasi}. Assumption~\ref{ass:exp_feedback} can be satisfied by choosing $\kappa$ as the LQR based on the linearization around the setpoint, resulting in $\rho=0.93$, $C=6.9$, $\epsilon=0.08$ and Inequality~\eqref{eq:gamma_bound} holds with $\gamma_{k}\leq74<98.3=C/(1-\rho)$ for $k\in\mathbb{I}_{[0,30]}$. The system is open-loop stable with a rather slow system dynamics and thus might seem simple to stabilize using MPC. However, this system is in fact a standard example to demonstrate that an MPC scheme without any terminal ingredients is in general not stabilizing, unless the prediction horizon is chosen large enough, compare~\cite{raff2006nonlinear}. In fact, using arguments similar to Theorem~\ref{thm:main} to guarantee local stability of the MPC without terminal ingredients requires $N> 2\frac{\log( \gamma)}{\log(\gamma)-\log(\gamma-1)}> 600$, which is quite conservative. \cite{grune2010analysis} reduced the conservatism of these bounds by using an LP analysis, an additional scalig $\omega>1$ for the stage cost, and implementing the first $K$ steps of the optimal open-loop input sequence. However, even with a weighting of $\omega=5\cdot 10^2$ and a multi-step implementation of $K=20$, the results in~\citep[Thm.~5.4]{grune2010analysis} still requires a prediction horizon of $N\geq 132$ to ensure stability. Thus, for the present example, an MPC scheme without any terminal ingredients requires a large prediction horizon $N$ to ensure stability which results in a large computational demand. We consider the finite-horizon cost with an extended horizon of $M=25$ and a prediction horizon of $N=5$. Inequality~\eqref{eq:relaxed_CLF_4} holds with $c_M=0.013$, which is significantly smaller than the bound $c_M=C\rho^M\frac{1-\rho}{1-\rho^M}\approx 0.09$ resulting from Proposition~\ref{prop:CLF}. Given these constants, Theorem~\ref{thm:main} ensures asymptotic stability for all initial condition $x_0\in\mathbb{X}_{\overline{V}}$ with $\overline{V}>\epsilon$. Thus, the proposed MPC formulation ensures stability in a reasonable region of attraction with a combined horizon of $N+M=30$. By considering the linearization, we find that even with $M=8$ and $N=1$ the finite-tail cost MPC yields a stable closed loop, however, with a potentially small region of attraction. \begin{figure}[hbtp] \begin{center} \includegraphics[width=0.4\textwidth]{Plots/ClosedLoop.eps} \end{center} \caption{Exemplary closed-loop trajectories. Top: $x_3$ (blue), $x_4$ (red) with steady-state $x_{\mathrm{s}}$ (dashed), and state constraint (black). Bottom: $u_1$ (green), $u_2$ (magenta), stationary input $u_{\mathrm{s}}$ (dashed), and input constraint (black).} \label{fig:M} \end{figure} An exemplary closed-loop trajectory for $N=5$, $M=25$, and $x_0=x_{\mathrm{s}}-(4,4,4,-2.5)$ can be seen in Figure~\ref{fig:M}. The MPC efficiently handles the state and input constraints by using the maximal control input to ensure fast convergence before reducing the control input to ensure satisfaction of the state constraint. This example demonstrated the benefits of the finite-tail cost MPC, which requires little offline design (only a locally stabilizing feedback $\kappa$) and ensures asymptotic stability with a relatively short horizon compared to MPC without terminal ingredients. \section{Introduction} Model predictive control (MPC) is an optimization-based control technique that is applicable to general nonlinear constrained systems~\citep{rawlings2017model,grune2017nonlinear}. The standard method to design a stabilizing MPC scheme includes the offline design of terminal ingredients, i.e., a local control Lyapunov function (CLF) and a terminal set ~\citep{chen1998quasi,mayne2000constrained}. However, terminal ingredients are often not employed in practical implementation due to challenges in the offline design, compare the discussion by~\cite{mayne2013apologia}. Specifically, while there exist simple to apply design methods based on the linearization around the steady-state~\citep{chen1998quasi,rawlings2017model}, the resulting terminal ingredients are often conservative. Furthermore, if a more general setup is considered, the design of the terminal ingredients becomes increasingly challenging, compare, e.g., online changing setpoints~\citep{limon2018nonlinear}, dynamic reference trajectories~\citep{faulwasser2012optimization,koehler2020nonlinearTAC}, or online model adaptation~\citep[Criterion 1--2]{adetola2011robust}. Thus, it is desirable to develop MPC schemes with guaranteed stability that relax the offline design requirements to allow for an easier implementation. \subsubsection*{Related work} \cite{alamir1995stability} showed that there exists some large enough prediction horizon, such that an MPC scheme without any terminal ingredients ensures asymptotic stability, compare also the work by~\cite{primbs2000feasibility} and \cite{jadbabaie2005stability}. Computable lower bounds on a sufficiently long prediction horizon using \textit{exponential cost controllability} have been derived by~\cite{tuna2006shorter,grune2008infinite} and later improved by~\cite{grune2009analysis,grune2010analysis} using a linear programming (LP) analysis, compare also the continuous-time results by~\cite{reble2012unconstrained}. Results for MPC without terminal ingredients using positive semi-definite stage costs are obtained by~\cite{grimm2005model} using the notion of cost detectability, compare also the less conservative results by~\cite{Koehler2020Regulation} using the notion of cost observability. Stability based on infinite-horizon tail costs has been shown by~\cite{de1998stabilizing}. \cite{magni2001stabilizing} derived stability conditions for finite-tail cost MPC. The corresponding finite-horizon tail cost can be viewed as a relaxed CLF. By using a relaxed CLF as a terminal cost, stability can be established using a smaller prediction horizon, compare the analysis in~\cite[A3]{tuna2006shorter}, \cite[Ass.~5]{grimm2005model}, and \cite[Prop.~2]{reble2012improved}. Furthermore, by choosing the stage cost as a relaxed CLF with a non-uniform weighting, stability can be ensured for arbitrary short horizons~\citep{alamir2018stability}. \cite{boccia2014stability} considered a relaxed \textit{local} exponential cost controllability and derived a sufficiently long prediction horizon for a specified region of attraction, compare also the continuous-time results by~\cite{esterhuizen2020recursive}. The corresponding analysis was further improved by~\cite{kohlernonlinear19} to derive less conservative bounds. These derivations all use sublevel set arguments for the value function, similar to the implicit terminal set constraint proposed by~\cite{limon2006stability}. Overall, the resulting bounds on the prediction horizon for MPC without terminal ingredients are often too conservative for practical applications. Thus, providing easy to implement MPC schemes with guaranteed stability remains an open problem. \subsubsection*{Contribution} We analyse the closed-loop stability and performance of the finite-tail cost MPC proposed by~\cite{magni2001stabilizing} using modern tools developed for MPC without terminal ingredients. In particular, we show that the finite-tail cost constitutes a relaxed CLF and use (local) exponential cost controllability to prove asymptotic stability and derive a suboptimality bound. Given a (local) stabilizing control law, an extended horizon for the finite-tail cost, and a suitably chosen region of attraction, we provide a lower bound on the prediction horizon that ensures closed-loop stability and a desired suboptimality bound for the closed-loop performance (relative to the infinite-horizon optimal performance). From a practical point of view, the considered MPC formulation can be viewed as an intermediate design between MPC schemes with and without terminal ingredients. The provided analysis reveals that the explicit inclusion of a (locally) stabilizing control law in the MPC formulation can significantly improve the resulting bounds. Thus, we can ensure closed-loop stability with a shorter prediction horizon and reduce the online computational demand. Compared to the design of a (local) CLF, the considered formulation only requires the offline computation of a (locally) stabilizing control law, which is often already available, especially in case of open-loop stable systems. The benefits and applicability of the proposed MPC formulation are illustrated using the classical four tank system. \subsubsection*{Notation} The interior of a set $\mathbb{Z}$ is denoted by $\text{int}(\mathbb{Z})$. The set of non-negative real numbers and integers are denoted by $\mathbb{R}_{\geq 0}$ and $\mathbb{I}_{\geq 0}$, respectively. The set of integers in the interval $[a,b]\subseteq\mathbb{R}$ are denoted by $\mathbb{I}_{[a,b]}$. By $\mathcal{K}_\infty$, we denote the set of continuous functions $\alpha:\mathbb{R}_{\geq 0}\rightarrow\mathbb{R}_{\geq 0}$ that are strictly increasing, unbounded, and satisfy $\alpha(0)=0$. The quadratic norm with respect to a positive definite matrix $Q=Q^\top$ is denoted by $\|x\|_Q^2=x^\top Q x$. \section{Finite-tail cost MPC} \label{sec:MPC} In this section, we describe the problem setup (Sec.~\ref{sec:MPC_1}), the stabilizing control law (Sec.~\ref{sec:MPC_2}), and the considered MPC formulation (Sec.~\ref{sec:MPC_3}). \subsection{Setup} \label{sec:MPC_1} We consider the following nonlinear discrete-time system \begin{align*} x(t+1)&=f(x(t),u(t)),\quad x(0)=x_0, \end{align*} with the state $x\in\mathbb{X}=\mathbb{R}^n$, the control input $u(t)\in\mathbb{U}\subseteq\mathbb{R}^m$, the dynamics $f:\mathbb{X}\times\mathbb{U}\rightarrow\mathbb{X}$, the initial condition $x_0\in\mathbb{X}$, and the time step $t\in\mathbb{I}_{\geq 0}$. We impose point-wise in time constraints on the state and input \begin{align*} (x(t),u(t))\in \mathbb{Z}\subseteq\mathbb{X}\times\mathbb{U},\quad t\in\mathbb{I}_{\geq 0}. \end{align*} We consider a stage cost $\ell:\mathbb{X}\times\mathbb{U}\rightarrow\mathbb{R}_{\geq 0}$ and define $\ell_{\min}(x):=\inf_{u\in\mathbb{U}}\ell(x,u)$. The control goal is to minimize the closed-loop cost, stabilize the origin, and satisfy the constraints. We assume that $f(0,0)=0$, $0\in\text{int}(\mathbb{Z})$, $f,\ell$ are continuous, and $\mathbb{U}$ is compact. \begin{assum} (Tracking stage cost) \label{ass:tracking_cost} There exist functions $\underline{\alpha}_\ell, \overline{\alpha}_\ell\in\mathcal{K}_\infty$, such that $\underline{\alpha}_\ell(\|x\|)\leq \ell_{\min}(x)\leq \overline{\alpha}_\ell(\|x\|)$ for all $x\in\mathbb{X}$ and $\ell(0,0)=0$. \end{assum} This assumption characterizes the fact that the stage cost is positive definite w.r.t. the origin and is typically ensured by choosing a quadratic stage cost. \subsection{Stabilizing feedback} \label{sec:MPC_2} The considered MPC formulation uses a known continuous control law $\kappa:\mathbb{X}\rightarrow\mathbb{U}$ to define a finite-tail cost. The corresponding stage cost is denoted by $\ell_\kappa(x):=\ell(x,\kappa(x))$. Given some initial state $x$, we define the closed-loop state and input response under the feedback $\kappa$ by the continuous functions $\phi_{\mathrm{x}}:\mathbb{I}_{\geq 0}\times\mathbb{X}\rightarrow\mathbb{X}$ and $\phi_{\mathrm{u}}:\mathbb{I}_{\geq 0}\times\mathbb{X}\rightarrow\mathbb{U}$: \begin{align*} \phi_{\mathrm{x}}(0,x):=&x,\quad \phi_{\mathrm{u}}(k,x):=\kappa(\phi_{\mathrm{x}}(k,x)),\quad k\in\mathbb{I}_{\geq 0},\\ \phi_{\mathrm{x}}(k+1,x):=&f(\phi_{\mathrm{x}}(k,x),\phi_{\mathrm{u}}(k,x)),\quad k\in\mathbb{I}_{\geq 0}. \end{align*} \begin{assum}(Locally stabilizing controller) \label{ass:exp_feedback} There exist constants $\rho\in[0,1)$, $C\geq 1$, $\epsilon>0$ such that for all $x\in\mathbb{X}$ satisfying $\ell_{\min}(x)\leq \epsilon$, we have \begin{subequations} \label{eq:exp_feedback} \begin{align} \label{eq:exp_feedback_cost} &\ell_\kappa(\phi_{\mathrm{x}}(k,x))\leq C\rho^{k} \ell_{\min}(x),\quad k\in\mathbb{I}_{\geq 0},\\ \label{eq:exp_feedback_constraint} &(\phi_{\mathrm{x}}(k,x),\phi_{\mathrm{u}}(k,x))\in\mathbb{Z},\quad k\in\mathbb{I}_{\geq 0}. \end{align} \end{subequations} \end{assum} In case a quadratic stage cost $\ell$ is used, Condition~\eqref{eq:exp_feedback_cost} holds if the controller $\kappa$ ensures (local) exponential stability, compare~\cite[Sec.~6.2]{grune2017nonlinear}. Condition~\eqref{eq:exp_feedback_constraint} follows from $0\in\text{int}(\mathbb{Z})$, $\kappa$ continuous, Condition~\eqref{eq:exp_feedback_cost} and Assumption~\ref{ass:tracking_cost} for $\epsilon>0$ small enough. Hence, a suitable controller $\kappa$ exists if the linearization at the origin is stabilizable, c.f.~\citep{chen1998quasi}. \subsection{MPC formulation} \label{sec:MPC_3} Given some horizon length $M\in\mathbb{I}_{\geq 1}$, the finite-tail cost $V_{\mathrm{f},M}:\mathbb{X}\rightarrow\mathbb{R}_{\geq 0}$ is defined as \begin{align*} &V_{\mathrm{f},M}(x):=\\ &\begin{cases} \sum_{k=0}^{M-1}\ell_\kappa(\phi_{\mathrm{x}}(k,x)) & \text{if } (\phi_{\mathrm{x}}(k,x),\phi_{\mathrm{u}}(k,x))\in\mathbb{Z}, k\in\mathbb{I}_{[0,M-1]} \\ \infty & \mathrm{otherwise} \end{cases}\nonumber \end{align*} Given a predicted state and input sequence $x(\cdot|t)\in\mathbb{X}^{N+1}$, $u(\cdot|t)\in\mathbb{U}^N$, the considered cost function is given by \begin{align*} \mathcal{J}_{N,M}(x(\cdot|t),u(\cdot|t)):=&\sum_{k=0}^{N-1}\ell(x(k|t),u(k|t))+V_{\mathrm{f},M}(x(N|t)), \end{align*} where $N\in\mathbb{I}_{\geq 1}$ is the prediction horizon and $M\in\mathbb{I}_{\geq 1}$ is the extended horizon used for the finite-tail cost. At time $t$, given a state $x(t)$, the MPC control law is determined based on the following optimization problem \begin{align} \label{eq:MPC} \inf_{u(\cdot|t)}&\mathcal{J}_{N,M}(x(\cdot|t),u(\cdot|t))\\ \text{s.t. }&x(k+1|t)=f(x(k|t),u(k|t)),~ k\in\mathbb{I}_{[0,N]},\nonumber\\ &x(0|t)=x(t),~ (x(k|t),u(k|t))\in\mathbb{Z},~ k\in\mathbb{I}_{[0,N-1]}.\nonumber \end{align} A minimizer\footnote Given feasibility, a minimizer exists due to continuity of $\ell,\kappa,f$ and $\mathbb{U}$ compact, cf.~\citep[Prop~2.4]{rawlings2017model}. We define $V_{N,M}(x(t))=\infty$ in case the optimization problem~\eqref{eq:MPC} is not feasible. } is denoted by $u^*(\cdot|t)$ with the corresponding state trajectory $x^*(\cdot|t)$ and the value function $V_{N,M}(x(t)):=\mathcal{J}_{N,M}(x^*(\cdot|t),u^*(\cdot|t))$. The closed-loop is given by applying the initial part of an optimal input sequence, i.e., $u(t)=u^*(0|t)$. Compared to an MPC scheme using standard terminal ingredients~\citep{chen1998quasi,mayne2000constrained}, the considered MPC formulation~\eqref{eq:MPC} drops the terminal set constraint (as also proposed by~\cite{limon2006stability}) and the standard terminal cost is replaced by a finite-tail cost $V_{\mathrm{f},M}$. Due to the specific structure of the finite-tail cost $V_{\mathrm{f},M}$, the considered MPC formulation can also be viewed as an MPC scheme without terminal ingredients~\citep{grune2009analysis} with a prediction horizon $N+M$, subject to the additional parametrization $u(k|t)=\kappa(x(k|t))$, $k\in\mathbb{I}_{[N,N+M-1]}$, similar to move-blocking~\citep{cagienard2007move}. The only offline design required for the MPC implementation is the stabilizing feedback $\kappa$. The prediction horizon $N$ and the extended horizon $M$ are tuning variables that trade of stability, performance, and computational complexity, compare the discussion in Remark~\ref{rk:trade_off} below. \section{Theoretical analysis} \label{sec:theory} In the following, we study the closed-loop properties of the finite-tail cost MPC. First, Propositions~\ref{prop:gamma} and \ref{prop:CLF} derive bounds on the value function and the finite-tail cost. Then, Theorem~\ref{thm:main} provides a closed-loop analysis. \begin{prop} \label{prop:gamma} Let Assumption~\ref{ass:exp_feedback} hold. For any $N\in\mathbb{I}_{\geq 0}$, $M\in\mathbb{I}_{\geq 0}$, for any $x\in\mathbb{X}$ with $\ell_{\min}(x)\leq \epsilon$, the optimization problem~\eqref{eq:MPC} is feasible and the value function satisfies \begin{align} \label{eq:gamma_bound} V_{N,M}(x)\leq \gamma_{N+M}\ell_{\min}(x),~ \gamma_{k}:=\frac{1-\rho^{k}}{1-\rho}C,~k\in\mathbb{I}_{\geq 0}. \end{align} \end{prop} \begin{pf} Condition~\eqref{eq:exp_feedback_constraint} in Assumption~\ref{ass:exp_feedback} ensures that $u(k|t)=\kappa(x(k|t))$ is locally a feasible candidate solution to~\eqref{eq:MPC} ensuring $V_{N,M}(x)\leq V_{\mathrm{f},N+M}(x)$. Condition~\eqref{eq:exp_feedback_cost} and the geometric series yield the expression for $\gamma_{k}$ in~\eqref{eq:gamma_bound}. $\hfill\square$ \end{pf} Condition~\eqref{eq:gamma_bound} corresponds to the (local) exponential cost controllability condition that is used in the analysis of MPC without terminal ingredients~\citep{boccia2014stability}. \begin{prop} \label{prop:CLF} Let Assumption~\ref{ass:exp_feedback} hold. For any $M\in\mathbb{I}_{\geq 1}$ and any $x\in\mathbb{X}$ satisfying $\ell_{\min}(x)\leq \epsilon$, we have \begin{subequations} \label{eq:relaxed_CLF} \begin{align} \label{eq:relaxed_CLF_1} \ell_{\min}(x)\leq V_{\mathrm{f},M}(x)\leq& \gamma_M\ell_{\min}(x),\\ \label{eq:relaxed_CLF_2} V_{\mathrm{f},M+1}(x)-V_{\mathrm{f},M}(x)\leq& C\rho^M\ell_{\min}(x). \end{align} If additionally $V_{\mathrm{f},M}(x)\leq \epsilon$ holds, then we have \begin{align} \label{eq:relaxed_CLF_4} V_{\mathrm{f},M+1}(x)\leq&(1+c_M)V_{\mathrm{f},M}(x),~c_M:=\frac{C\rho^M(1-\rho)}{1-\rho^M}. \end{align} \end{subequations} \end{prop} \begin{pf} The lower and upper bound in~\eqref{eq:relaxed_CLF_1} follow by the definition of $\ell_{\min}$ and the proof in Proposition~\ref{prop:gamma}. Inequality~\eqref{eq:relaxed_CLF_2} follows using \begin{align*} V_{\mathrm{f},M+1}(x)-V_{\mathrm{f},M}(x)=\ell_{\kappa}(\phi_{\mathrm{x}}(M,x))\stackrel{\eqref{eq:exp_feedback_cost}}{\leq} C\rho^M\ell_{\min}(x). \end{align*} Note that given $\ell_\kappa(x)\leq V_{\mathrm{f},M}(x)$, Inequality~\eqref{eq:relaxed_CLF_4} directly follows from Inequality~\eqref{eq:relaxed_CLF_2} for $c_M=C\rho^M$, which is, however, conservative. In the following, we use an LP analysis similar to the one proposed by~\cite{grune2009analysis,grune2010analysis} to prove Inequality~\eqref{eq:relaxed_CLF_4} with $c_M=C\rho^M\dfrac{1-\rho}{1-\rho^M}\leq C\rho^M$. Denote $\ell_k=\ell_\kappa(\phi_{\mathrm{x}}(k,x))$, $k\in\mathbb{I}_{[0,M]}$. Condition~\eqref{eq:relaxed_CLF_4} is equivalent to $\ell_M\leq c_M\sum_{k=0}^{M-1} \ell_k$. Assumption~\ref{ass:exp_feedback} and $\ell_j\leq V_{\mathrm{f},M}(x)\leq \epsilon$, $j\in\mathbb{I}_{[0,M-1]}$ ensure \begin{align*} \ell_k\leq C\rho^{k-j}\ell_j,~j\in\mathbb{I}_{[0,M-1]},~k\in\mathbb{I}_{[j+1,M]}. \end{align*} We normalize the stage cost using $\tilde{\ell}_k:=\ell_k/V_{\mathrm{f},M}(x)$, $k\in\mathbb{I}_{[0,M]}$, where we assume w.l.o.g. $V_{\mathrm{f},M}(x)>0$. Thus, a constant $c_M$ satisfying~\eqref{eq:relaxed_CLF_4} can be computed using the following LP: \begin{subequations} \label{eq:LP} \begin{align} c_M:=&\max_{\tilde{\ell}_k} \tilde{\ell}_M\\ \text{s.t. } &\sum_{k=0}^{M-1}\tilde\ell_k=1,\quad \tilde\ell_M\leq C\rho^{M-k}\tilde\ell_k,~k\in\mathbb{I}_{[0,M-1]}. \end{align} \end{subequations} Using a standard argument of contradiction, the constraints are all active. Thus, the maximum can be analytically computed, yielding $c_M:=\dfrac{C\rho^M(1-\rho)}{1-\rho^M}$. $\hfill\square$ \end{pf} For $M>\underline{M}:=\log(C)/\log(1/\rho)$, we have $\alpha_M:=1-C\rho^M>0$ and thus Inequality~\eqref{eq:relaxed_CLF_2} ensures that $V_{\mathrm{f},M}$ is (locally) a relaxed CLF, i.e., $V_{\mathrm{f},M}(f(x,\kappa(x)))\leq V_{\mathrm{f},M}(x)-\alpha_M\ell_\kappa(x)$ holds. For $M\rightarrow\infty$ we recover the infinite-tail cost proposed by~\cite{de1998stabilizing} which satisfies the standard CLF condition employed in the literature~\citep{rawlings2017model}. \begin{thm} \label{thm:main} Let Assumptions~\ref{ass:tracking_cost}--\ref{ass:exp_feedback} hold. Then, for any $\overline{V}>0$, $M\in\mathbb{I}_{\geq 1}$, there exists a constant $N_{\overline{V},M}\geq 0$ such that for all $N> N_{\overline{V},M}$ and any initial condition $x_0\in\mathbb{X}_{\overline{V}}:=\{x\in\mathbb{X} \mid V_{N,M}(x)\leq \overline{V}\}$, Problem~\eqref{eq:MPC} is feasible for all $t\in\mathbb{I}_{\geq 0}$, the constraints are satisfied, and the origin is asymptotically stable for the resulting closed loop. Furthermore, there exist constants $\alpha_{N,M}\in(0,1]$, $\epsilon_{N,M}\in(0,1]$ such that the following performance bound holds for the resulting closed loop: \begin{align} \label{eq:performance_finite_tail} \sum_{k=0}^\infty \ell(x(k),u(k))\leq\dfrac{1}{\epsilon_{N,M}}V_{N,M}(x_0) \leq \dfrac{1}{\alpha_{N,M}}V_{\infty,0}(x_0). \end{align} \end{thm} \begin{pf} The following proof uses the properties in Propositions~\ref{prop:gamma}-\ref{prop:CLF}, improved arguments regarding the characterization of the region of attraction that combine ideas from~\cite{kohlernonlinear19} and~\cite{limon2006stability}, and standard bounds for MPC without terminal ingredients based on exponential cost controllability~\citep{tuna2006shorter,grune2008infinite}. In order to simplify the following exposition, we use the constant bound $\gamma=\gamma_\infty=C/(1-\rho)$, which is valid for all horizons $N,M\in\mathbb{I}_{\geq 0}$. The proof is split into three parts. Part I and II show that the value function $V_{N,M}$ satisfies the following bounds at time $t\in\mathbb{I}_{\geq 0}$, assuming $x(t)\in\mathbb{X}_{\overline{V}}$: \begin{subequations} \label{eq:UCON_finite_tail_1} \begin{align} \label{eq:UCON_finite_tail_1_1} \ell_{\min}(x(t))\leq V_{N,M}(x(t))\leq &\gamma_{\overline{V}}\ell_{\min}(x(t)),\\ \label{eq:UCON_finite_tail_1_2} V_{N,M}(x(t+1))-V_{N,M}(x(t))\leq &-\epsilon_{N,M}\ell(x(t),u(t)), \end{align} \end{subequations} with later specified constants $\gamma_{\overline{V}}\geq \epsilon_{N,M}>0$. Part III establishes that $x(t)\in\mathbb{X}_{\overline{V}}$ holds recursively for all $t\in\mathbb{I}_{\geq 0}$, derives the performance bound~\eqref{eq:performance_finite_tail}, and establishes asymptotic stability. Abbreviate $\ell(k|t):=\ell(x^*(k|t),u^*(k|t))$ and $V(k|t):=V_{N-k,M}(x^*(k|t))$, $k\in\mathbb{I}_{[0,N]}$ with $u^*(N|t)=\kappa(x^*(N|t))$. \\ \textbf{Part I:} The lower bound in Inequality~\eqref{eq:UCON_finite_tail_1_1} follows directly from $\ell\geq 0$. Define $\gamma_{\overline{V}}:=\max\left\{\gamma,\frac{\overline{V}}{\epsilon}\right\}$. The upper bound in Inequality~\eqref{eq:UCON_finite_tail_1_1} follows from the local upper bound in Proposition~\ref{prop:gamma} and $V_{N,M}(x(t))\leq \overline{V}$ using a case distinction whether $\ell_{\min}(x(t))\leq \epsilon$, compare also~\citep{boccia2014stability,kohlernonlinear19}. \\ \textbf{Part II:} In the following, we show that there exists a point $k\in\mathbb{I}_{[0,N_0]}$, $N_0:=\left\lceil\gamma_{\overline{V}}-\gamma\right\rceil=\left\lceil\max\left\{0,\frac{\overline{V}-\gamma\epsilon}{\epsilon}\right\}\right\rceil\in\mathbb{I}_{\geq 0}$, such that $V(k|t)\leq \gamma\epsilon$. For contradiction assume $V(k|t)>\gamma\epsilon$, $k\in\mathbb{I}_{[0,N_0]}$. Using Proposition~\ref{prop:gamma} this implies $\ell(k|t)>\epsilon$, $k\in\mathbb{I}_{[0,N_0]}$ since $\ell(k|t)\leq \epsilon$ would imply $V(k|t)\leq \gamma\ell(k|t)\leq \gamma\epsilon$. For any $k'\in\mathbb{I}_{[0,N]}$, the principle of optimality ensures \begin{align*} V_{N,M}(x(t))=\sum_{k=0}^{k'-1}\ell(k|t)+V(k'|t). \end{align*} Thus, $\ell(k|t)>\epsilon$, $k\in\mathbb{I}_{[0,N_0]}$ and $V(0|t)\leq \overline{V}$ yields \begin{align*} V(N_0|t)<\overline{V}-\epsilon N_0\leq \overline{V}-\epsilon(\gamma_{\overline{V}}-\gamma)\leq \gamma\epsilon, \end{align*} which contradicts $V(k|t)>\gamma\epsilon$, $k\in\mathbb{I}_{[0,N_0]}$. Denote the smallest element $k\in\mathbb{I}_{[0,N]}$, which satisfies $V(k|t)\leq \gamma\epsilon$ by $k_x$. Thus, we have $V(k|t)\leq V(k_x|t)\leq \gamma\epsilon$ for $k\in\mathbb{I}_{[k_x,N]}$. Furthermore, $V(k|t)\leq \gamma\epsilon$, $k\in\mathbb{I}_{[k_x,N]}$ implies $V(k|t)\leq \gamma\ell(k|t)$, $k\in\mathbb{I}_{[k_x,N]}$ using Proposition~\ref{prop:gamma} and a case distinction whether $\ell(k|t)\leq \epsilon$. Furthermore, it holds that \begin{align} \label{eq:V_N_0_finite_tail} V(k_x|t)\leq \gamma\min\{\ell(k_x|t),\epsilon\}\leq \gamma\min\{\ell(0|t),\epsilon\}, \end{align} where the second inequality follows from the definition of $k_x$, i.e., $\ell(0|t)\leq \epsilon$ implies $k_x=0$. In addition, $V(k_x|t)\leq \overline{V}$ implies $V(k_x|t)\leq \underline{\gamma}\epsilon$, $\underline{\gamma}:=\min\{\gamma,\overline{V}/\epsilon\}$. In the following, we show that Condition~\eqref{eq:UCON_finite_tail_1_2} holds with some $\epsilon_{N,M}\in(0,1]$. Define $\rho_{\gamma}:=\dfrac{\gamma-1}{\gamma}\in[0,1)$. Given that $V(k|t)\leq \gamma\ell(k|t)$, $k\in\mathbb{I}_{[k_x,N]}$, we can use the bounds by~\cite{tuna2006shorter,grune2008infinite} for the remaining horizon of length $N-k_x\geq N-N_0$ to show \begin{align} \label{eq:V_exp} V(N|t)\leq \rho_\gamma^{N-k_x} V(k_x|t)\stackrel{\eqref{eq:V_N_0_finite_tail}}{\leq} \rho_\gamma^{N-N_0}\min\{\gamma\ell(0|t),\underline{\gamma}\epsilon\}. \end{align} For $N\geq N_1:=N_0+\left\lceil \dfrac{\max\{\log(\underline{\gamma}),0\}}{\log(\gamma)-\log(\gamma-1)}\right\rceil$ this implies $V(N|t)\leq \epsilon$. Finally, we bound the value function in the next time step by appending the local control law $\kappa$ as a feasible candidate solution, yielding \begin{align*} &V_{N,M}(x(t+1))-V_{N,M}(x(t))\\ \leq& -\ell(0|t)+V_{\mathrm{f},M+1}(x^*(N|t))-V_{\mathrm{f},M}(x^*(N|t))\nonumber\\ \stackrel{\eqref{eq:relaxed_CLF_4}}{\leq} &-\ell(0|t)+c_MV(N|t)\nonumber \\ \stackrel{\eqref{eq:V_exp}}{\leq }&-\ell(0|t)+c_M \rho_\gamma^{N-N_0}\gamma \ell(0|t)\nonumber\\ \stackrel{ \mathrm{Prop.}~\ref{prop:gamma}-\ref{prop:CLF}}{=}&- \underbrace{\left(1-C^2 \rho_\gamma^{N-N_0}\dfrac{\rho^M }{1-\rho^M} \right)}_{=:\epsilon_{N,M}}\ell(0|t). \end{align*} For $N>N_2:=N_0+\dfrac{\log(C^2\rho^M/(1-\rho^M))}{\log(\gamma)-\log(\gamma-1)}$, we have $\epsilon_{N,M}>0$. Thus, given any $M\in\mathbb{I}_{\geq 1}$, all the previous bounds hold for \begin{align*} N>N_M:=N_0+\dfrac{\max\{\log(\underline{\gamma}),\log(C^2\rho^M/(1-\rho^M)),0\}}{\log(\gamma)-\log(\gamma-1)}. \end{align*} \textbf{Part III:} Condition~\eqref{eq:UCON_finite_tail_1_2} with $\ell\geq 0$ and $\epsilon_{N,M}>0$, ensure that $V_{N,M}$ is non-increasing and thus $x(t)\in\mathbb{X}_{\overline{V}}$ holds for all $t\in\mathbb{I}_{\geq 0}$. Hence, the results in Part I and II hold for all $t\in\mathbb{I}_{\geq 0}$. Inequalities~\eqref{eq:UCON_finite_tail_1} and Assumption~\ref{ass:tracking_cost} ensure asymptotic stability of the origin $x=0$. The first inequality in the performance bound~\eqref{eq:performance_finite_tail} follows directly by using Inequality~\eqref{eq:UCON_finite_tail_1_2} in a telescopic sum. Given an initial condition $x_0\in\mathbb{X}$, define an infinite horizon optimal trajectory $x_\infty(k)$, $u_\infty(k)$, $k\in\mathbb{I}_{\geq 0}$ with $V_{\infty,0}(x_0)=\sum_{k=0}^\infty \ell(x_\infty(k),u_\infty(k))$. Note that $V_{\infty,0}(x_0)\geq V_{N,M}(x_0)$ would directly imply~\eqref{eq:performance_finite_tail} with $\alpha_{N,M}=\epsilon_{N,M}$ and thus we consider w.l.o.g. $V_{\infty,0}(x_0)\leq V_{N,M}(x_0)\leq \overline{V}$. We note that the local upper bound on the value function from Proposition~\ref{prop:gamma} is equally applicable to the infinite-horizon value function, i.e., $\ell_{\min}(x_{\infty}(k))\leq \epsilon$ implies $V_{\infty,0}(x_{\infty}(k))\leq \gamma\ell_{\min}(x_{\infty}(k))$, $k\in\mathbb{I}_{\geq0}$. Thus, we can use the same steps from Part~II to show that the infinite-horizon optimal trajectory satisfies \begin{align*} V_{\infty,0}(x_\infty(N))\leq &\rho_\gamma^{N-N_0}\min\{\underline{\gamma}\epsilon,V_{\infty,0}(x_0)\} \end{align*} We have $\ell_{\min}(x_\infty(N))\leq V_{\infty,0}(x_\infty(N))\leq\epsilon$ using $N\geq N_1$ and thus Inequality~\eqref{eq:relaxed_CLF_1} yields $V_{\mathrm{f},M}(x_\infty(N))\leq \gamma \ell_{\min}(x_\infty(N))$. The initial part of the infinite-horizon optimal trajectory is a feasible candidate solution to the optimization problem~\eqref{eq:MPC}, implying \begin{align*} V_{N,M}(x_0)\leq& V_{\infty,0}(x_0)+V_{\mathrm{f},M}(x_\infty(N))\\ \leq& (1+\gamma \rho_\gamma^{N-N_0})V_{\infty,0}(x_0). \end{align*} Inequality~\eqref{eq:performance_finite_tail} follows with $\alpha_{N,M}:=\dfrac{\epsilon_{N,M}}{1+\gamma\rho_\gamma^{N-N_0}}\in(0,\epsilon_{N,M}]$. $\hfill\square$ \end{pf} Although the underlying MPC formulation including $V_{\mathrm{f},M}$ is essentially equivalent to the MPC formulation by~\cite{magni2001stabilizing}, the proof deviates significantly. In particular, in~\cite[Eq.~(13)]{magni2001stabilizing} it is simply assumed that \begin{align*} \ell_\kappa(\phi_{\mathrm{x}}(M,x^*(N|t)))< \ell(x(t),u^*(0|t)). \end{align*} In our analysis, on the contrary, we provide explicit computable conditions in terms of lower bounds on the prediction horizon $N_M$ that ensure the desired closed-loop properties. The constant $\alpha_{N,M}$ bounds the suboptimality of the closed loop performance compared to the infinite-horizon optimal cost $V_{\infty,0}(x)$. Similar estimates are frequently used in MPC without terminal ingredients~\citep{reble2012unconstrained}, however, corresponding bounds for MPC with terminal ingredients are often less intuitive, compare the results by~\cite{grune2008infinite}. \begin{rem} (Comparison to state of the art) \label{rk:compare} The derived theoretical result is interesting for multiple reasons. First, it generalizes and unifies the standard results for MPC without terminal ingredients (\cite{boccia2014stability,grune2008infinite,grune2009analysis,grune2010analysis}, $M=0$) and MPC with terminal ingredients (\cite{chen1998quasi,de1998stabilizing,limon2006stability}, $M=\infty$), by considering a relaxed CLF (cf. Prop~\ref{prop:CLF}). Compared to an MPC formulation with terminal ingredients, weaker conditions are imposed on the terminal cost and no explicit terminal set constraint is used. The price we have to pay for this relaxation is that a horizon $N>N_M$ is required. However, compared to the standard bounds in MPC without terminal ingredients (cf.~\cite{boccia2014stability,grune2008infinite,tuna2006shorter,grune2009analysis,grune2010analysis}, $M=0$), the bounds derived in Theorem~\ref{thm:main} can be significantly less conservative, as explained in the following. To simplify the following discussion, suppose that Assumption~\ref{ass:exp_feedback} holds globally (as assumed in most of the literature). Then, Theorem~\ref{thm:main} ensures stability, if $ \dfrac{\rho^{M}\rho_\gamma^{N}}{1-\rho^M}$ is sufficiently small. For comparison, the simple bounds used in MPC without terminal ingredients~\citep{grune2008infinite,boccia2014stability,tuna2006shorter} require $\rho_\gamma^{N}$ to be small enough. The most important difference is the fact that the extended horizon $M$ scales w.r.t. $\rho$ while the prediction $N$ scales with $\rho_\gamma$, which is larger since $1-\rho_\gamma=\dfrac{1-\rho}{C}\leq 1-\rho$. This can lead to a significant reduction in the overall needed horizon $N+M$ as demonstrated in Section~\ref{sec:num} with a numerical example. Furthermore, we can also ensure (local) stability with an arbitrary short prediction horizon $N$ by choosing $M$ large enough. The derivation of the region of attraction in Theorem~\ref{thm:main} reduces the conservatism inherent in earlier arguments used by~\cite{boccia2014stability,esterhuizen2020recursive} by splitting the prediction horizon $N$ in two intervals, combining the ideas by~\cite{kohlernonlinear19} and \cite{limon2006stability}. \end{rem} \begin{rem} (Stability, performance, computation complexity) \label{rk:trade_off} The choice of the prediction horizon $N$ and the extended horizon $M$ are tuning variables that impact the stability ($\epsilon_{N,M}$), performance ($\alpha_{N,M}$), and the computational demand. In particular, increasing either $N$ or $M$ increases $\epsilon_{N,M}$ and thus improves the nominal stability. On the other hand, increasing the region of attraction or improving the suboptimality estimate $\alpha_{N,M}$ above a certain threshold can only be achieved by increasing the prediction horizon $N$. In particular, for $N\rightarrow\infty$ we can choose $\overline{V}$ arbitrary large and we approach infinite-horizon performance ($\alpha_{N,M}=1$), which is not the case for a large extended horizon $M$. This is rather natural, since the feedback $\kappa$ only ensures \textit{local} stability and we did not assume that the controller is optimal in any sense. From a computational perspective, increasing $N$ or $M$ similarly increases the number of function evaluations involved in the cost function and constraints. However, if a condensed formulation is used, an increase in $M$ does not increase the number of decision variables. Thus, a large extended horizon $M$ with a small prediction horizon $N$ can result in drastically reduced computational requirements compared to an MPC scheme without terminal ingredients that may require a significantly larger prediction horizon $N$. \end{rem}
\section{Introduction} \label{sec:intro} Detecting winds driven by active galactic nuclei (AGN) and identifying mechanisms of AGN feedback is at the forefront of observational astronomy because of the critical importance of these processes in galaxy formation \citep{silk98, king03}. This task is made difficult by the multi-phase nature of galactic winds, where different phases of the wind must be probed using different observational techniques \citep{Veilleux20}. At relatively low redshifts ($z<1$), AGN-driven outflows have been detected and studied through nebular emission lines \citep{morg05,holt08,rupk11,liu13a,harr14} as well as molecular and neutral gas phases \citep{cico14,alat11,aalt12,feru14,morg13,Strum11,Veilleux17,Fluetsch19,Lutz20}. At low redshifts, the massive stellar component of the host galaxies is already in place. The dramatic decline of the galaxy stellar mass function beyond $M^*$ is likely due to AGN feedback \citep{crot06, hopk06} and must have been established at earlier epochs. To probe the effects of AGN on the formation of the massive galaxies, we must examine the period $z=2-3$ \citep{boyl98,mada14} when galaxies were growing most rapidly. Increasing body of work shows that high-redshift quasars often display forbidden emission lines (such as \hbox{[O$\,${\scriptsize III}]} $\lambda$5007\AA) with high velocity offsets or dispersions, which may be positively correlated with quasar luminosity, obscuration and level of jet activity \citep{zaka16b, wu18,glik17,urru12,brus16,pern15a,Forster18,Forster19,Davies19,Kakkad20}. Although the nominal velocities of \hbox{[O$\,${\scriptsize III}]}\ are often well in excess of 1000 \kms, the impact of these ionized gas outflows on their hosts cannot be established unless there are spatially resolved observations. Spatial information is necessary to demonstrate galaxy-wide extents, high velocities and outflow rates with significant momentum flux on galactic and circumgalactic scales or direct impact on the molecular gas reservoir. Such observations exist for some sub-samples \citep{nesv06, nesv08, cano12,Swinbank15,carn15, kakk16,Harrison16,vayner17,Brusa18,Herrera-Camus19,Davies20}. However, this task remains extremely challenging due to the cosmological surface brightness dimming and due to the difficulty of subtracting the quasar light to reveal the faint signatures of the wind. Despite the significant ongoing observational effort, it is not clear how the kinetic power of the outflows depends on the quasar evolutionary stage or type of activity, or how the ionized gas outflows are related to other phases. Supermassive black boles (SMBH) grow the majority of their mass in obscured environments \citep{hopkins05}. Once they reach a critical mass theoretical work predicts that the central accretion disk can produce outflows powerful enough to extend onto galactic scales \citep{king15}, affecting the star-forming properties of the host galaxy and clearing the central nuclear region of gas and dust. The most powerful outflows are most efficiently driven in obscured environments, either through radiation pressure or through adiabatic shocks because it is easier to couple the momentum of both the photons and the shocks to the surrounding gas \citep{wagn12,fauc12a,costa18}. The transitional phase is very rapid occurring on million-year time scales \citep{hopkins05} in numerical simulations. Hence catching AGN during this key phase can be very difficult. Studying obscured AGN with evidence for powerful outflows can provide clues as to how they affect the star-forming properties of galaxies and how AGN transition to an unobscured phase. Extremely red quasars \citep{ross15,hama17} were initially discovered through a selection based on high rest frame ultra-violet to infrared colors (i-W3$>4.6$ mag) from the Wide-Field Infrared Survey Explorer (WISE; \citealt{wrig10}) and SDSS. Recent X-ray observations for 11 ERQs reveals high nuclear obscuration with column densities up to $10^{24}\rm~cm^{-2}$ \citep{goul18a,Ishikawa21}. ERQs show peculiar rest-frame UV emission lines with large equivalent widths, missing wings in the broad emission lines, and unusual emission-line ratios typically not seen in other quasar populations. Powerful outflows driven in extremely obscured environments may link to the atypical emission-line properties in ERQs \citep{hama17,alex18}. While there have been excellent studies focusing on ionized outflows in systems with obscured nuclei \citep{pern15a,pern15b,cres15}, there have yet to be studies of the unique ERQ population with IFS observation. ERQs are some of the most intrinsically luminous obscured objects at high redshift. Among the obscured population at high redshift, ERQs show some of the most powerful outflows, as evidenced by extremely broad \hbox{[O$\,${\scriptsize III}]}\ emission lines with velocities reaching up to 6700 \kms, not seen in any other quasar population at any redshift \citep{perr19}. Obscured AGN may be the clue to the short-lived transitional stage where feedback that affects star formation may be visible. In this paper, we present integral-field unit observations of five powerful red and obscured quasars at $z=2.3-3$ and map their ionized gas winds. In Section \ref{sec:data} we describe the sample selection, observations and data reduction. In Section \ref{sec:analysis}, we present the kinematic analysis and ionized gas maps, with individual objects analyzed in-depth in Section \ref{sec:individual}. We discuss the implications of our findings in Section \ref{sec:disc} and conclude in Section \ref{sec:conc}. We use $h=0.7$, $\Omega_{\rm m}=0.3$, $\Omega_{\Lambda}=0.7$ cosmology and air wavelengths for the emission lines, all magnitudes are on the AB system. \section{Observations and data reduction} \label{sec:data} \subsection{Sample selection} The targets in this study are selected from two different, but physically related samples. One sample is that by \citet{alex13}, who identified 145 high-redshift obscured (type-2) quasar candidates from the spectroscopic database of the Sloan Digital Sky Survey (SDSS; \citealt{daws13}) Data Release 9 \citep{ahn12} based on emission-line widths, requiring full width at half maximum (FWHM)$<$2000 \kms\ for both the CIV$\lambda$1550\AA\ and Ly$\alpha$ emission lines. The lack of broad-emission components in the permitted lines of quasar spectra is usually taken to be a sign of nuclear obscuration, which prevents the observer from seeing the broad-line region. Therefore, one classical selection of type-2 AGN relied on the dominance of narrow lines at optical wavelengths \citep{hao05a, reye08}. Because of the greater opacity of the dust at UV wavelengths, the line-based selection of type-2 candidates at rest-frame UV wavelengths results in a sample with a wide range of obscuration values, and some of these objects are not obscured enough to be classified as type-2 based on their rest-frame optical spectra \citep{gree14b}. Indeed the type-2 quasar in this study shows a broad \hbox{H$\alpha$}\ emission line and is likely better characterized as a type 1.5 or 1.9 quasar. However, throughout the paper, we will be referring to this object as a type-2 quasar. The other targets in this study are selected from the ERQ sample. The ERQ and the type-2 samples represent a large fraction of all known obscured, luminous, high-redshift quasars, they have been extensively studied across the electromagnetic spectrum by us and by other groups. In particular, we conducted extensive near-infrared (NIR) observing campaigns to measure integrated \hbox{[O$\,${\scriptsize III}]}\ properties of the objects in both samples. The rest-frame optical properties of the line-selected type-2 quasar candidates are described by \citet{gree14b}, and two additional NIR long-slit spectra were published by \citet{alex18} and \citet{zaka19}. All of these observations have been done in seeing-limited conditions and are spatially unresolved. NIR (rest-frame optical) properties for ERQs are summarized by \citet{zaka16b} and \citet{perr19}. ERQs stand out from the type-2 quasars and the rest of the AGN population in that they show very broad (FWHM $\sim 1000-6000$ \kms) forbidden emission lines. These large velocity widths indicate very fast outflows, with possibly a very large opening angle. Their fast velocities translate to large outflow momenta flux and outflow kinetic luminosities, making them one of the most powerful ionized outflows among any AGN sample in the distant Universe \citep{perr19}. From the sub-samples with available NIR spectroscopy, the targets for Near-Infrared Integral Field Spectrograph (NIFS) observations were then selected based on two criteria. The most constraining criterion is the availability of relatively bright nearby stars which can enable laser-guided adaptive optics (AO) observations; specifically, a $r<17$ mag star within 25\arcsec\ of the science target is typically required. This cut renders over 90\% of targets inaccessible to AO-assisted observations at the Gemini North Observatory. Secondly, based on the measurements from the long-slit NIR data we prioritized the most \hbox{[O$\,${\scriptsize III}]}-luminous targets for our integral-field-unit (IFU) observations. These requirements, plus long requisite exposure times, limited our NIFS proposals to only one-two targets at a time. SDSS J2323$-$0100 was targeted for OSIRIS follow up after its VLT long-slit spectrum was published by \citet{zaka16b}. The observations presented here were built up over many semesters of proposals and observations, and the program was significantly delayed by the mechanical problems with the Gemini AO system in 2017-2018. The targets are listed in Table \ref{obstab}, with their `type' designated as type-2 or ERQ depending on their original selection as described above, and listing program numbers for the programs that were successful in obtaining relevant data. \subsection{Observations} NIFS on Gemini-North provides spectroscopy with $R\sim 5000$ over a 3$^{''}\times$3$^{''}$ field of view \citep{mcgregor03} using an imaging slicer design. The priority for our program was to observe the \hbox{[O$\,${\scriptsize III}]}+H$\beta$ emission-line complex. Depending on the redshift of each target, this complex falls in the $H$ or $K$-band. All sources whose redshift places these lines in the regions of low atmospheric transparency were excluded at an early stage in our sample selection. For two sources with \hbox{[O$\,${\scriptsize III}]}+H$\beta$ in the $H$-band, we additionally have $K$-band observations that cover the [NII]+H$\alpha$ line complex. Observations are obtained in each band separately using the same $H-K$ filter, but different gratings with central wavelengths adjusted to cover the lines of interest optimally. Observations were requested and conducted in the queue mode. The requested weather conditions are determined by the performance requirements of the AO system (image quality in the top 70\% of all observations; cloud cover in the top 50\% of all observations; any sky brightness and water vapor). During observations, the seeing as measured using CFHT's skyprobe are listed in Table \ref{obstab}. To enable sky subtraction, we nod by 30'' from the science target to blank sky in the repeating ``object-sky-object'' sequences. The length of exposure is a trade-off between minimizing the read noise and the read-out time, avoiding saturation by the thermal background, and obtaining enough redundancy between exposures. Individual exposure times varied between 450 and 645 sec, and total on-target exposure times varied between 20 and 100 min. OSIRIS on Keck provides spectroscopy with $R\sim 3500$ with a variable field-of-view (FOV) utilizing a lenslet design \citep{Larkin06,Mieda14,Boehle16}. The OSIRIS observations were conducted in the Hn3 and Kbb filters using the 50 mas plate scale mode, providing a field of view of 2.4\arcsec$\times$3.2\arcsec and 0.8\arcsec$\times$3.2\arcsec, respectively. The $H$ band observations were targeted to search for extended emission on arcsecond scales, hence the larger FOV was selected, and we observed a dedicated sky frame. We optimized the $K$-band observations for on-source exposure time by nodding the object in the long axis of the OSIRIS FOV and subtracting pair observations for sky emission removal. We bracketed the $K$-band observations with observations of a PSF star selected to have the same offset from the tip/tilt star as the quasar. \begin{table*} \centering \caption{Observing log.} \label{obstab} \begin{tabular}{cccccccc} \hline Source & Project & Date & Instrument & Band & Exp. Time (s) & Seeing & Corrected PSF \\ SDSS & & & & \\ \hline & & & Type-2 & & & \\ \hline J081257.15+181916.8 & GN-2014A-Q-42 & 2014/04/11& NIFS & K & 6$\times$645 & 0\farcs37$\pm$0\farcs04 & 0\farcs17$\times$0\farcs22 \\ & GN-2014B-Q-44 & 2014/11/09& NIFS & H & 5$\times$645 & 0\farcs49$\pm$0\farcs05 & 0\farcs31$\times$0\farcs32 \\ \hline & & & ERQ & & & \\ \hline J165202.64+172852.3 & GN-2019A-FT-111 &2019/05/07-08 & NIFS & K & 10$\times$600 & 0\farcs41$\pm$0\farcs09 & 0\farcs17$\times$0\farcs21 \\ J082653.42+054247.3 & GN-2016A-FT-8 & 2016/02/27 & NIFS & H & 12$\times$450 & 0\farcs35$\pm$0\farcs08 & 0\farcs29$\times$0\farcs31 \\ J091301.33+034207.6 \tablenotemark{a} & GN-2014B-Q-44 & 2015/01/28& NIFS & K & 2$\times$645 & 0\farcs32$\pm$0\farcs06 & -- \\ J232326.17-010033.1 & & 2017/08/13 & OSIRIS & Hn4 & 10 $\times$600 & 0\farcs50 & 0\farcs085$\times$0\farcs088 \\ J232326.17-010033.1 & & 2017/09/02 & OSIRIS & Kbb & 6 $\times$600 & 0\farcs60 & 0\farcs082$\times$0\farcs08\\ \hline \end{tabular} \tablenotetext{a}{Data quality not sufficient to perform any analysis.} \end{table*} \subsection{Data reduction} We performed the NIFS data reduction using the {\sc gemini iraf/pyraf} package, following the standard procedure for NIR spectra. This procedure includes the trimming of the images, flat-fielding, cosmic ray rejection, sky subtraction, wavelength, and s-distortion calibrations. To remove the telluric absorption features, we use the spectra of A0-A2V standard stars observed before or after the observation of the science target. We use the {\sc nftelluric} task of the {\sc nifs.gemini.iraf} package to normalize and shift the spectrum of the standard star and divide it into the science frames. For each frame, we use the telluric star spectrum that was observed with the most similar air mass and closest in time to the science target. Then, we performed the flux calibration by interpolating a black body function to the spectra of the telluric standard stars and generate datacubes for each individual exposure with 0\farcs05 width square spaxels. Finally, we median combine the individual datacubes into a single datacube for each target using the {\it gemcombine} task of the {\sc gemini iraf} package and the {\it sigclip} algorithm to eliminate the remaining cosmic rays and bad pixels, using the peak of the continuum as reference for the astrometry of the distinct cubes. We reduced the OSIRIS observations using the OSIRIS data reduction pipeline \citep{OSIRIS_DRP}. The pipeline first creates a master dark by median combining several dark observations taken at the start of the night. After dark subtraction, the pipeline extracts the spectra using a Lucy-Richardson deconvolution using a known spectral-PSF for each lenslet stored in the rectification matrix. The pipeline then applies wavelength calibration and combines the spectra into a 3D data cube. The pipeline performs scaled sky subtraction by scaling families of OH emission lines in the sky cubes to match the science observations. The cubes are finally mosaicked using a sigma clipping algorithm, and the data are flux calibrated similarly to the NIFS observations. Our estimated absolute flux uncertainty is at 10-15$\%$. \subsection{Point-spread function analysis} Quasars often outshine the extended emission from their host galaxy. Observing type-2 objects often helps with the contrast, however, at higher redshifts, the unresolved component from the narrow line region can still be brighter than that of the extended emission from the host galaxy. Also, UV-selected type-2 quasars can still show emission from the broad-line region in the Balmer series \citep{gree12} and continuum emission from the accretion disk. Our sample contains one UV-selected type-2 quasar and 3 ERQs. These sources have varying levels of contrast between the unresolved and extended emission. All sources show broad-line emission that is expected to outshine or be comparable to the magnitude of the host galaxy, hence for each object, we performed PSF subtraction before searching for extended emission from the host galaxy. Details of the PSF subtraction routine can be found in \cite{vayner16}, and \cite{vayner20}. We utilize channels containing emissions from the quasar continuum or the broad-line region that do not overlap with OH emission from the night-sky to construct a PSF image. The image is then normalized to the peak emission and subtracted from the rest of the data channels. This technique effectively removes any unresolved emission from the data cube and leaves behind only extended emission. \section{Analysis} \label{sec:analysis} \subsection{Fitting emission lines} After the data cubes are PSF-subtracted, we search all the channels for extended emission in each emission line. For any detected emission 3$\sigma$ above the background, we collapse the data cube around the peak of the emission line and divide by the standard deviation in an empty sky region to construct a signal-to-noise (SNR) image. Spaxels with a 2$\sigma$ or above emission are then fit with a Gaussian model plus a zero degree polynomial using the least-squares fitting routine \textit{curvefit} within \textit{SciPy}. We visually inspect each fit. In some spaxels, a multi-Gaussian fit is necessary for individual emission lines. We deem a multi-Gaussian fit successful if we find an improvement in the reduced $\chi^{2}$ value. In all cases, the $\chi^{2}$ value improved by at least 2.7, after we introduced a second Gaussian component to the fit. We visually inspected the new fit and the residuals to confirm the results. When fitting the \hbox{H$\alpha$}\ emission line all parameters (intensity, width and redshift) are free. When fitting the \hbox{[N$\,${\scriptsize II}]}\ emission lines, we fix the redshift and the line widths to those of \hbox{H$\alpha$}. The ratios of the line peaks for the \hbox{[N$\,${\scriptsize II}]}\ 6548 \AA\ and 6583 \AA\ emission lines is held fixed at 1:2.95. The only free parameter is the line intensity of the rest-frame 6584 \AA\ \hbox{[N$\,${\scriptsize II}]}\ emission. When fitting the \hbox{[O$\,${\scriptsize III}]}\ emission lines, the \hbox{[O$\,${\scriptsize III}]} 4959 \AA\ has no free parameters, since we hold the line width and redshift fixed relative to \hbox{[O$\,${\scriptsize III}]}\ 5007 \AA\, and we hold the ratio between the two line peaks fixed at 1:2.98. Channels with strong OH emission are weighted during least-squares fitting using a noise spectrum constructed from an empty sky region. We constructed an intensity map by summing up each emission line spectrally from -3$\sigma_{pixels}$ to +3$\sigma_{pixels}$, where the standard deviation comes from the fit of the Gaussian model. We constructed a radial velocity map by computing the Doppler shift of the line-centroid relative to the quasar's redshift. The redshifts are taken from the narrowest nebular (e.g., \hbox{H$\beta$}, \hbox{[O$\,${\scriptsize III}]}) emission line from the spatially-unresolved point source component. The line centroid comes from the Gaussian fit. For spaxels with a multi-Gaussian fit, we use the line-intensity weighted centroid. We constructed a velocity dispersion map using the best fit $\sigma$ value. In the case of a multi-Gaussian fit, we used the line width, where we integrated 66$\%$ of the total line intensity. For the three objects which show extended emission we present the emission line, radial velocity and dispersion maps in Figures \ref{fig:1652}, \ref{fig:0812} , and \ref{fig:SDSS2323}. OSIRIS observations of SDSSJ2323-0100 cover \hbox{[O$\,${\scriptsize III}]}\ 5007 \AA\, but the wavelength coverage is too narrow to deblend \hbox{[O$\,${\scriptsize III}]}\ 4959 \AA, \hbox{[O$\,${\scriptsize III}]}\ 5007 \AA\ and \hbox{H$\beta$}\ for us to be able to construct the maps of the \hbox{[O$\,${\scriptsize III}]}\ emission line, the goal of those observations was to gauge the extent of the \hbox{[O$\,${\scriptsize III}]}\ emitting gas. \begin{figure*}[!th] \centering \includegraphics[trim=5cm 6cm 5cm 6cm, clip=true, width=\linewidth]{SDSS1652_maps.eps} \caption{From left to right, PSF-subtracted \hbox{[O$\,${\scriptsize III}]} emission line flux, mean velocity and velocity dispersion of SDSS~J1652+1728 over the field of view of NIFS. North is up, east is to the left. The star represents the location of the subtracted out quasar. The bar represents 1\arcsec or 8.6 kpc at the redshift of the source. The ellipse in the lower left corner shows the FWHM of the AO corrected PSF.} \label{fig:1652} \end{figure*} \begin{figure*}[!th] \centering \includegraphics[trim=5cm 6cm 5cm 6cm, clip=true, width=\linewidth]{SDSS0812_maps.eps} \caption{PSF-subtracted NIFS observations of SDSS~J0812+1819. On the left we present a three-color composite of ionized emission from \hbox{H$\alpha$} (red) \hbox{[O$\,${\scriptsize III}]} (green) and \hbox{[N$\,${\scriptsize II}]} (blue) in the host galaxy of SDSSJ0812+1819. Middle panel shows the radial velocity relative to the redshift of the quasar and the right panel shows the velocity dispersion. White bar represents one arcsecond on sky and the ellipse represents the FWHM of the PSF of the LGS-assisted observations} \label{fig:0812} \end{figure*} \pagebreak \begin{figure*}[!th] \centering \includegraphics[width=8.0 in]{SDSS2323_three_panel.eps} \caption{From left to right, PSF-subtracted \hbox{H$\alpha$}\ emission line flux, mean velocity, and velocity dispersion of SDSS~J12323 over the field of view of OSIRIS. North is up, east is to the left. The bar on the left figure represents one arcsecond or 8.6 kpc at the redshift of the quasar, while the ellipse represents the FWHM of the PSF in our observations.} \label{fig:SDSS2323} \end{figure*} \subsection{Searching for outflows} \label{sec:outflow-rates-energetics} The most turbulent discs in massive ($>10^{11}$\msun) galaxies show an ionized gas velocity dispersion of 250 \kms\ in distinct star-forming regions with maximum rotational velocity of 400 \kms\ \citep{Forster18}. Estimates of the stellar mass for ERQs from recent HST observations \citep{zaka19} overlap with the most massive galaxies in the SINS survey \citep{Forster18}. Hence emission lines that have a radial velocity dispersion $>$250 \kms\ or radial velocity $>$400 \kms\ (computed from the line-centroid) results in gas that most likely belong to an outflow. Both the radial velocity dispersion and offset are relative to the redshift of the quasar. Spaxels satisfying these criteria have their spectra extracted to construct a high signal-to-noise ratio spectrum. The spectra are fit with multiple Gaussians for each nebular emission line, which are detected at a 3$\sigma$ or greater significance. We also search for unresolved-nuclear outflows in our systems by subtracting a model of the extended emission and extract the spectrum from the unresolved point source. The model that we subtract is a data cube consisting of the best fit Gaussian emission at each spaxel location. Similarly, we search for broad and highly kinematically offset emission-line gas. We compute the outflow rates following the methodology presented in \citet{cano12}, assuming a conical outflow where the gas fills a significant fraction of the cone or a conical outflow consisting of many concentric shells. The reason for this assumption is that we see outflowing gas at a large range of velocities ($\pm2000$ \kms in the case of SDSSJ1652+1728, SDSSJ2323-0100 and SDSSJ0826+0542), likely due to projection effects of an inclined cone projected onto the sky. The following formula gives the mass outflow rate: \begin{equation}\label{equation:outflow-cone} \dot{M}=3\frac{Mv_{out}}{R_{out}}, \end{equation} where $M$ is the mass of the ionized gas, $v_{out}$ is the velocity, and $R_{out}$ is the extent of the outflow. For the velocity we use the non-parametric $v_{10}$ value of the \hbox{[O$\,${\scriptsize III}]}\ or \hbox{H$\alpha$}\ emission lines; this is the velocity where 10\% of the line flux is integrated for the Gaussian component associated with the outflow. The velocity is calculated from the spectrum integrated over the entire outflow region in each source. For the radius, we use the extent where we integrated 90\% of the flux associated with broad extended emission using the emission line map from the broad Gaussian component. For unresolved outflows, $R$ is the FWHM of the PSF. Our methodology for calculating the radius and the outflow velocity is selected to account for inclination effects of the outflow \citep{gree12,cano12}. To compute the mass, we use the luminosity of the \hbox{H$\alpha$}\ or \hbox{[O$\,${\scriptsize III}]}\ emission line and convert that to an ionized gas mass using the methodology presented in \citet{oste06} or \citet{cano12}. For the case of \hbox{[O$\,${\scriptsize III}]}\, the ionized gas mass is less certain as we do not know the metallicity and assume solar value. We also do not apply any ionization correction and assume all of the oxygen is double ionized. The contribution from other ionization states of Oxygen is unknown, and this is likely a significant contributor to additional uncertainty in deriving the outflow rate from the \hbox{[O$\,${\scriptsize III}]}\ line. It further adds to the discrepancy between the measurement of outflow rates and energetics from the \hbox{[O$\,${\scriptsize III}]}\ line and the Balmer lines \citep{demp18}. The largest uncertainty comes from the unknown electron density of the gas. We use a nominal value of 500 \eden\ with a range of 100-900 \eden. These values are all within the range of measured electron densities in ionized outflows at high redshift \citep{harr14,vayner17,Forster19}. In addition to the outflow rates we also compute the momentum flux of the outflow: \begin{equation} \dot{P} = \dot{M} \times v_{out} \end{equation} and the kinetic luminosity: \begin{equation} \dot{E} = \frac{1}{2}\times\dot{M}\times v_{out}^{2}. \end{equation} The radius, velocity, outflow rates and energetics of individual outflows along with the bolometric luminosity of the quasars are presented in Table \ref{tab:outflow-prop}. The bolometric luminosities are taken from \cite{gree12} and \cite{perr19}. The uncertainties on the outflows and energetics are dominated by systematic rather than measurement errors that are presented in Table \ref{tab:outflow-prop}. \begin{deluxetable*}{llllllllll} \tablecaption{Outflow properties of the sources within this study \label{tab:outflow-prop}. R$\rm_{out}$ is the radial extent of the outflow. V$\rm_{out}$ is the velocity of the outflow. dM/dt$\rm_{[OIII]}$ and dM/dt$\rm_{H\alpha}$ are the outflow rate using masses derived from their respective line luminosities. $\dot{P}$ is the momentum flux of the outflow. L$\rm_{AGN}$ is the bolometric luminosity of the quasar. $\frac{\dot{E}_{outflow}}{\dot{L}_{AGN}}$ is the energy coupling efficiency between the kinetic luminosity of the outflow and bolometric luminosity of the quasar. $\frac{\dot{P}_{outflow}}{\dot{P}_{AGN}}$ is the momentum flux ratio between the ionized outflow and the photon momentum flux from the quasar accretion disk. N = Unresolved nuclear outflow, E = resolved, extended outflow.} \tablehead{\colhead{Source}& \colhead{R$\rm_{out}$}& \colhead{V$\rm_{out}$}& \colhead{dM/dt$\rm_{[OIII]}$}& \colhead{dM/dt$\rm_{H\alpha}$}& \colhead{$\dot{P}$}& \colhead{$\dot{E}$}& \colhead{L$\rm_{AGN}$}& \colhead{$\frac{\dot{E}_{outflow}}{\dot{L}_{AGN}}$}& \colhead{$\frac{\dot{P}_{outflow}}{\dot{P}_{AGN}}$}\\ \colhead{SDSSJ}& \colhead{kpc}& \colhead{\kms}& \colhead{\myr}& \colhead{\myr}& \colhead{$10^{35}$dyne}& \colhead{$10^{43}$ erg s$^{-1}$ }& \colhead{$10^{47}$ erg s$^{-1}$ }& \colhead{$\%$}& \colhead{} } \startdata 0812N &$<$1.9 & 650$\pm$10 & $>$35$\pm$18 & $>$62$\pm$45 & $>$2.5$\pm$1.8 & $>$0.8$\pm$0.6 & 0.5$\pm$0.1 & $>$0.02$\pm$0.01 & $>$0.15$\pm$0.1\\ 0826N & $<$2.55 & 2829$\pm$10 & $>$1340$\pm$680 & -- & $>$240$\pm$120 & $>$338$\pm$170 & 3$\pm0.3$ & $>$1$\pm$0.5 & $>$2$\pm$1\\ 1652N & $<$1.7 & 1334$\pm$10 & $>$843$\pm$430 & -- & $>$70$\pm$40 & $>$47$\pm$20 & 5$\pm$0.1 & $>0.1\pm0.05$ & $>$0.4$\pm$0.2\\ 1652E & 2.5$\pm$0.1 & 1031$\pm$50 & 124$\pm$100 & -- & 8$\pm$7 & 4$\pm$3 & 5$\pm$0.1 & 0.01$\pm$0.006 & 0.05$\pm$0.04\\ 2323E & 0.77$\pm$0.01 & 1963$\pm$50 & -- & 2750$\pm$2465 & 340$\pm$305 & 334$\pm$300 & $1\pm0.1$ & $2.7\pm2.5$ & 8.5$\pm$8\\ \enddata \end{deluxetable*} \section{Individual Objects}\label{sec:individual} \pagebreak In this section, we briefly describe previously known properties for each object and present their new NIR IFU data. \subsection{SDSS~J1652+1728 (z=2.9482)} \label{sec:1652} SDSS~J1652+1728 was part of the ERQ core sample \citep{ross15, hama17}, but its rest-frame UV line widths are just above the 2000 \kms\ required to satisfy the type-2 quasar candidate criteria from \citet{alex13}. GNIRS spectrum of this object which showed an extremely broad blue-shifted component in its \hbox{[O$\,${\scriptsize III}]}\ line \citep{alex18}, quite in line with other ERQs which show kinematically extreme \hbox{[O$\,${\scriptsize III}]}\ \citep{zaka16b, perr19}. The object is a $\sim 1.5$ mJy radio source, which lies a few $\sigma$ away from the relationship between \hbox{[O$\,${\scriptsize III}]}\ velocity width and radio power, in the sense that its radio luminosity is perhaps above that expected as a by-product of the outflow alone \citep{hwan18}. Spectropolarimetric observations \citep{alex18} of SDSS~J1652+1728 -- a unique probe of circumnuclear geometry of the outflow -- show a 90$^{\circ}$ swing in the polarization position angle for rest-frame UV emission lines (L$\alpha$, CIV and NV) as a function of velocity indicating that the outflowing material originates within an equatorial dusty scattering region. Furthermore, SDSS~J1652+1728 is the most highly polarized source in the sample, with continuum polarization reaching 10$-$15\% and polarization position angle 130$^{\circ}$ East of North. This is relevant because, from this value, we can infer the dominant orientation of the scatterer relative to the nucleus, 220$^{\circ}$ East of North. X-ray observations \citep{goul18a,Ishikawa21} show that SDSS~1652+1728 is a Compton thick, intrinsically luminous quasar with a column density of 1$\times10^{24}~\rm cm^{-2}$ and X-ray luminosity $L_{2-10~keV}=1.27\times10^{45}$ erg s$^{-1}$ . HST observations \citep{zaka19} in the rest-frame $B$-band show an extended host galaxy with multiple clumps or companions and an extended low surface brightness feature directed to the West, which may be a tidal tail. The host luminosity is well above the median for the ERQs and is $\ga 10 L^*$ for galaxies at a similar redshift. After performing PSF-subtraction on the IFS observations, we detected extended emission towards the south-west, consisting of both narrow and a broad emission line (Figure \ref{fig:1652}). The spectra along with the fits are shown in Figure \ref{fig:spec_SDSS1652}. We compare the distribution and morphology of the extended narrow and broad emission in Figure \ref{fig:SDSS1652_broad_n_narrow} by constructing \hbox{[O$\,${\scriptsize III}]}\ emission line maps for each component that we fit in Figure \ref{fig:spec_SDSS1652}. The broader emission is associated with the outflow and is more extended towards the south, while the narrow emission extending towards the west is either gas within the host galaxy or a tidal tail feature associated with the extended emission seen in the HST observations. After subtracting a model of the extended emission, we detect unresolved emission on scales $<1.7$ kpc. We extract the spectrum from the point source. The spectrum consists of a broad \hbox{[O$\,${\scriptsize III}]}\ emission line from the outflow and a narrow component, either associated with the host galaxy or a merger component. We detect a slight shift between the average velocity of the unresolved and resolved outflow. The unresolved component must be greater in size than the broad-line region because we are detecting it in a forbidden line. For example, the \hbox{[O$\,${\scriptsize III}]}\ line is suppressed by collisional de-ionization at $n>8\times 10^5$ cm$^{-3}$, hence it must arise on scales of at least a few hundred pc \citep{hama11}. The majority of the emission in this object is from the unresolved component. The profile of the \hbox{[O$\,${\scriptsize III}]}\ emission line is consistent with that is found in \citet{perr19}. Unfortunately, we cannot measure any interesting line ratios for this object because of its redshift, such that H$\beta$ falls right between $H$ and $K$ bands. SDSS~J1652+1728 is part of an approved early-release-science (ERS) program for the \textit{James Webb Space Telescope (JWST)}. The observations will provide resolved \hbox{H$\beta$}\ and \hbox{H$\alpha$}\ maps allowing us to conduct resolved photoionization diagnostics for this object. Furthermore additional access to rest frame near-infrared H$_{2}$ emission lines will allow us to constrain the multi-phase nature of the outflow in this system. \begin{figure*} \centering \includegraphics[width=8.0 in]{spec_all_SDSS1652.eps} \caption{Top left: integrated spectrum from point source emission in the SDSSJ1652+1728 system along with multi-Gaussian fit to the \hbox{[O$\,${\scriptsize III}]}\ emission line. Bottom left: integrated spectrum over the extended emission along with the fit model. On the bottom right in white contours we show the region that was integrated to produce the spectrum. The ellipse represents the size of the PSF and the bar represents 1 arcsecond on sky or about 8 kpc at the redshift of the target.} \label{fig:spec_SDSS1652} \end{figure*} \begin{figure*} \centering \includegraphics[width=8.0 in]{SDSS1652_broad_n_narrow.eps} \caption{Figure comparing the extended narrow and broad emission morphology and distribution in SDSSJ1652+1728. Left: Extended narrow \hbox{[O$\,${\scriptsize III}]}\ emission line map. Right: Extended broad \hbox{[O$\,${\scriptsize III}]}\ emission line map. The ellipse in the lower left corner shows the FWHM of the PSF while the bar represents 1\arcsec.} \label{fig:SDSS1652_broad_n_narrow} \end{figure*} \subsection{SDSS~J0812+1819 (z=2.3794)} \label{sec:0812} This object was identified as a type-2 quasar candidate by \citet{alex13} based on its rest-frame UV properties. Follow-up NIR (rest-frame optical) spectroscopy by \citet{gree14b} did not reveal a broad component in H$\beta$ but did reveal one in H$\alpha$; hence this source can be classified as type 1.9 according to the standard optical line classification scheme. The object matches to an extended radio source in the FIRST survey \citep{beck95} consisting of two resolved radio sources centered on the quasar offset by 3$-$5\arcsec\ from the optical position and with an integrated flux density of 5.5 mJy. With this flux and the observed narrow \hbox{[O$\,${\scriptsize III}]}, this object's radio emission is not consistent with being wind-induced \citep{zaka14, hwan18}, and we classify it as radio-loud. The morphology is linear and consistent with a lobe-dominated source at position angle 170$^{\circ}$ East of North. Further, 33 GHz observations reveal a core with flux 0.23 mJy/beam and possible traces of optically-thin emission from the lobes \citep{alex17}. After performing PSF subtraction on the IFS observations, we detect extended emission associated with two clumpy regions extended in the east-west direction in the \hbox{[O$\,${\scriptsize III}]}, \hbox{H$\alpha$}, and the \hbox{[N$\,${\scriptsize II}]}\ emission lines. We detect no outflows on these spatial scales. After subtracting a model of the extended emission (similar to SDSSJ1652+1728, section \ref{sec:1652}), we detect an unresolved component that consists of both narrow and broad emission components. The narrow emission comes from the extended-narrow line region of the quasar, while the broad component is associated with an outflow on scales $<1.9$ kpc. The spectra along with the fits are shown in Figure \ref{fig:spec_SDSS0812}. Given that we detect \hbox{[O$\,${\scriptsize III}]}, \hbox{H$\alpha$}, and the \hbox{[N$\,${\scriptsize II}]}\ emission lines in this object, we can use line ratios to investigate the source of ionization across the galaxy. Since we do not detect \hbox{H$\beta$}\ in individuals spaxles, we calculate its flux assuming case B recombination ($\rm F_{H\alpha}/F_{H\beta}$ = 2.87) and no dust extinction. Under these assumptions, we find that 73$\%$ of the spaxels are consistent with gas photoionization from massive stars as they fall within the maximum expected line ratios for star formation on the BPT diagram at $z=2$ \citep{Kewley13b}. The rest of the spaxels are consistent with quasar photoionization. We combine the \hbox{H$\alpha$}\ flux from spaxels consistent with star formation, and we measure a star formation rate of 46$\pm$5 \myr\ using the empirical \hbox{H$\alpha$}\ luminosity star formation rate relation form \citep{kenn98}. Likely, extinction is contributing to a lower log(\oiii/\hb) since we are using \hbox{H$\alpha$}\ and case B recombination as a proxy for \hbox{H$\beta$}. More accurate extinction values are necessary to measure the actual fraction of the gas photoionized by stars vs. the quasar. Integrating over the extent depicted in contours shown in Figure \ref{fig:spec_SDSS0812} we measure a log(\nii/\ha) ratio of $-0.49$ and a log(\oiii/\hb) value of 0.65; however, the actual value is likely closer to 1 based on the \hbox{H$\beta$}\ flux limit from the total integrated spectrum in Figure \ref{fig:spec_SDSS0812}. \begin{figure*} \centering \includegraphics[width=8.0 in]{spec_all_SDSS0812.eps} \caption{Top left: Spectrum from point source emission in the SDSSJ0812+1819 system along with multi-Gaussian fit to the \hbox{[O$\,${\scriptsize III}]}, \hbox{H$\alpha$}\ and \hbox{[N$\,${\scriptsize II}]}\ emission lines, the broad-\hbox{H$\alpha$}\ component has been subtracted out to highlight the outflow in \hbox{H$\alpha$}. Bottom left: integrated spectrum over the extended emission along with the best fit model. On the bottom right in white contours we show the region that was integrated to produce the spectrum. The ellipse represents the size of the PSF and the bar represents 1 arcsecond on sky or about 8 kpc at the redshift of the target.} \label{fig:spec_SDSS0812} \end{figure*} \subsection{SDSS~J2323$-$0100 (z=2.3695)} \label{sec:2323} Like SDSS~J1652+1728, SDSS~J2323$-$0100 was selected as an ERQ \citep{ross15, hama17}. A noteworthy feature of its rest-frame UV spectrum from the SDSS \citep{zaka16b} is a high apparent \hbox{N$\,${\scriptsize V}}\ 1240 \AA/Ly$\alpha$ ratio, even higher than that seen in SDSS~J1652+1728 \citep{alex18}; this feature may be due to outflows in the broad-line region wherein the high-velocity \hbox{N$\,${\scriptsize V}}\ troughs may be blocking Ly$\alpha$ \citep{hama17}. SDSS~J2323$-$0100 was among the first objects we observed with NIR (rest-frame optical) spectroscopy, revealing some of the most extreme kinematics of the \hbox{[O$\,${\scriptsize III}]}\ emission known, with FWHM=2625 \kms\ \citep{zaka16b, perr19}. HST observations of this object reveal a face-on major merger between two galaxies, with nuclei separated by 1.3\arcsec=11 kpc and the SDSS position of the quasar consistent with the south-western of the two galactic nuclei. Due to the lack of previous integral-field or spatially resolved spectroscopy, it was unknown whether the second nucleus hosts any activity. The source is not detected in the radio down to 0.03 mJy and is classified as radio-quiet \citep{hwan18}. PSF-subtracted OSIRIS observations reveal a marginally spatially resolved emission in \hbox{[O$\,${\scriptsize III}]}\ and \hbox{H$\alpha$}\ associated with the galaxy hosting the luminous quasar. The \hbox{[O$\,${\scriptsize III}]}\ emission line profile is consistent with a single broad component, while the \hbox{H$\alpha$}\ emission line has both a broad and and an intermediate velocity (1267$\pm$54 \kms) component. The difference between the \hbox{H$\alpha$}\ and \hbox{[O$\,${\scriptsize III}]}\ profiles within our observations likely due to insufficient wavelength coverage near the \hbox{[O$\,${\scriptsize III}]}\ emission lines to perform accurate emission-line and continuum fitting. The spectra along with the fits are shown in Figure \ref{fig:spec_SDSS2323}. We have also attempted to search for evidence of rest-frame \hbox{[N$\,${\scriptsize II}]}\ 6549 \AA\ and 6584 \AA\ emission lines, by including additional Gaussians in the fit. When fitting for the \hbox{[N$\,${\scriptsize II}]}\ emission lines the ratio between \hbox{[N$\,${\scriptsize II}]}\ 6584 and \hbox{[N$\,${\scriptsize II}]}\ 6549 were held fixed at 1:2.95, with the lines width and redshift tied to \hbox{H$\alpha$}, hence the only free parameter was the flux of the \hbox{[N$\,${\scriptsize II}]}\ 6584 emission line. The resultant fit had \hbox{[N$\,${\scriptsize II}]}\ emission line flux within the noise of our observations and resulted in a poorer $\chi^{2}$ value. Likely, the \hbox{[N$\,${\scriptsize II}]}\ fit is below the threshold of our observations. The profile of the \hbox{H$\alpha$}\ emission line is consistent with that of the \hbox{[O$\,${\scriptsize III}]}\ emission measured by \citet{perr19}. The continuum in the OSIRIS observations is also resolved on a similar scale as the emission lines and is consistent with stellar light from the host galaxy. No continuum is detected from the quasar, only emission from the broad-line region in \hbox{H$\alpha$}. The \textit{H}-band observations were conducted first and hinted at extended emission both in continuum and line emission when comparing their spatial profiles to that of the tip/tilt star. To perform a more accurate measurement of the size of the line and continuum emission, the $K$-band observations for this object were accompanied by observations of a nearby star at similar separation from the tip/tilt star as the quasar. We construct azimuthally average 1D profiles for the \hbox{H$\alpha$}\ emission and the continuum and compare them to the profile of the PSF-star, the tip/tilt star, and a type-1 quasar observed on the same night under similar conditions. The 1D profile of \hbox{H$\alpha$}\ and continuum emission is broader than that of the PSF-star consistent with being extended (Figure \ref{fig:radial_profile_SDSS2323}). We fit the PSF star with a 2D Gaussian profile and measure a FWHM of 0.082$\times$0.08\arcsec\, which we believe is an accurate representation of the resolution achieved on our observations. We deconvolve this value from the spatial profiles of \hbox{H$\alpha$}\ and continuum and measure spatial extents of $92\pm1$ mas for \hbox{H$\alpha$}\ at 90\% integrated light and an effective radius for the stellar continuum of 50$\pm$1 mas. We measure an emission line free $K$-band magnitude for the host galaxy of 20.7$\pm$0.1. Only continuum emission is detected in the nucleus of the merging galaxy and is likely consistent with stellar light, however it is too faint and falls close to the edge of the OSIRIS FOV to place an accurate magnitude. While the OSIRIS observations reveal continuum emission, we are likely only detecting the circumnuclear emission from the galaxy. The 1-$\sigma$ surface brightness limit of our observations is 20.42 mag/\arcsec$^2$ and the rest of the structure detected in this galaxy with HST \citep{zaka19} is at a fainter surface brightness. \begin{figure*} \centering \includegraphics[width=7.5 in]{spec_all_SDSS2323.eps} \caption{Left: Spectrum from extended emission in the SDSSJ2323-0100 system along with multi-Gaussian fit to the \hbox{H$\alpha$}\ emission line. Right: in white contours, we show the region that was integrated to produce the spectrum. The ellipse represents the PSF size, and the bar represents 1 arcsecond or about 8.6 kpc at the redshift of the target.} \label{fig:spec_SDSS2323} \end{figure*} \begin{figure} \centering \includegraphics[width=3.7 in]{radial_profile_analysis.eps} \caption{Radial profile analysis for SDSSJ2323-0100 to gauge the extent of the continuum and line emission. The curves represent azimuthally averaged radial profiles for the PSF star (red), \hbox{H$\alpha$}\ emission map (green) and the K-band line free continuum (orange).} \label{fig:radial_profile_SDSS2323} \end{figure} \subsection{SDSS~J0826+0542 (z=2.5767)} \label{sec:0826} SDSS~J0826$+$0542 was selected from the SDSS as an ERQ \citep{ross15, hama17}, and just like for SDSS~J1652$+$1728, and SDSS~J2323$-$0100, follow-up NIR (rest-frame optical) observations obtained with Gemini GNIRS revealed high-velocity, broad and blue-shifted component in the \hbox{[O$\,${\scriptsize III}]}\ emission line \citep{goul18a, perr19}. It is an extremely luminous, hard-spectrum X-ray source consistent with near-Compton-thick absorption along the line of sight \citep{goul18a}. Just like SDSS~J1652+1728, this source is marginally radio-loud \citep{hwan18}. After performing PSF subtraction we detect no extended emission. We extract the spectrum from the point source. The spectrum is consistent with a broad \hbox{[O$\,${\scriptsize III}]}\ emission line coming from an outflow region. The upper limit on the size of the outflow is 0.4\arcsec. We present the spectrum in Figure \ref{fig:spec_SDSS0826}. \begin{figure} \centering \includegraphics[width=3.7in]{SDSS0826_nuclear_spec.eps} \caption{Spectrum from point source emission in the SDSSJ0826+0542 system along with multi-Gaussian fit to the \hbox{[O$\,${\scriptsize III}]}\ emission lines.} \label{fig:spec_SDSS0826} \end{figure} \section{Discussion} \label{sec:disc} \subsection{Comparison with other high redshift samples} Over the last decade, numerous studies have focused on resolving ionized outflows in high redshift galaxies with AGN. These studies have utilized IFS \citep{harr12,cano12,carn16,vayner17} and long-slit spectroscopy \citep{Coil15,Leung19} targeting nebular emission lines redshifted into the near-infrared. Generally, they have been successful at detecting ionized outflows and measuring their dynamics and kinematics to better understand their impact on their respective galaxies. These studies, for the most part, used slightly different ways of calculating the mass outflow rates. These outflow rates have to be recomputed following the methodology presented in \citet{fior17} and \citet{vayner20} to consistently compare the results from different surveys. \cite{vayner20} collated data from studies of galaxies with outflows at a redshift of $\rm 1<z<3$, at the peak of the accretion rate density on SMBH \citep{Delvecchio14} and the star formation rate density of the Universe \citep{mada14} where galaxies and SMBH undergo the majority of their growth. The galaxies span a wide range of star formation rate, AGN bolometric luminosity (L$_{bol} = 10^{45-47}$erg s$^{-1}$ ) and nuclear obscuration (both type-1 and 2). In \cite{vayner20}, the outflow rates are recomputed, taking into account some of the significant uncertainties that scourge outflow rates and energetics in the distant Universe. The literature outflow rates in \cite{vayner20} are combined with a sample of radio-loud type-1 quasars observed with OSIRIS in the same study. We compute our outflows rates in the same manner (see section \ref{sec:outflow-rates-energetics}) and, for the first time, can compare information on resolved outflows in ERQs to other samples in the distant Universe. In Figure \ref{fig:E_dot_P_dot}, we present the location of the ERQs on the outflow momentum flux ($\dot{P}_{outflow}$ ) vs. AGN radiation momentum flux diagram and the equivalent energy rate of the outflow vs. the luminosity of the AGN diagram. Similarly, we place the ERQs on the outflow momentum flux ratio vs. outflow radius plot shown in Figure \ref{fig:P_dot_ratio_vs_R}. The momenta and energy rates for ERQs are within the range of other high redshift studies at similar bolometric luminosity. However, interestingly the outflows within our sample all appear to be compact relative to the majority of the ionized outflows found in the distant Universe. Given our small sample, it is challenging to say anything about the general ERQ population and how that may differ from other studies. \subsection{Outflow driving mechanisms} Numerous mechanisms have been proposed to explain the physical mechanisms that drive galaxy scale outflows \citep{murr05,thom15,costa18,Veilleux20}. They include radiation pressure from AGN/massive young stars, supernova explosions, shocks driven by ultra-fast outflows, jets, and broad-absorption line winds. Often to distinguish between all driving mechanisms requires spatially resolved observations of outflows and measurement of their kinetic luminosity, momentum flux, and radial extent as well as energy and momentum supply from both star formation and AGN activity. Quasars tend to reside in galaxies with a broad range of star formation properties; understanding the star formation rates, as well as the AGN bolometric luminosities, therefore crucial \citep{Aird19}. The ratio between the momentum flux of the outflow to the photon momentum flux of the accretion disk (L$_{AGN}$/c) or stellar bolometric luminosity and the radius of the outflow can be used to distinguish between various sources of driving mechanisms \citep{thom15,zubo12,costa18}. Current theoretical consensus is that high $\frac{\dot{P}_{outflow}}{\dot{P}_{AGN}}$\ on $>1$ kpc scales is due to adiabatic shocks, where the material is swept by an outflow that does not radiate energy efficiently. Generally, in these outflows, the momentum flux grows as the outflow expands until the outflow reaches a certain radius where gravitation effects and interactions with the ISM and circum-galactic medium slow the outflowing material \citep{fauc12b}. High $\frac{\dot{P}_{outflow}}{\dot{P}_{AGN}}$\ on $<$ 1 kpc scales can be attributed to a radiation pressure-driven wind in a high column density environment where infrared photons are trapped and scattered multiple times, which gets reflected in the ``momentum boost" \citep{thom15,costa18}. Typically radiation pressure-driven winds achieve a maximum $\frac{\dot{P}_{outflow}}{\dot{P}_{AGN}}$\ $\approx2$ on $>1$ kpc scale, with the $\frac{\dot{P}_{outflow}}{\dot{P}_{AGN}}$\ dropping down as the outflow expands. Low $\frac{\dot{P}_{outflow}}{\dot{P}_{AGN}}$\ $<$1 on any scale can be either attributed to radiation pressure-driven winds in a low column density environment or a shock that can radiate its energy efficiently \citep{fauc12b}. For sources within our sample, multiple mechanisms are likely at play in driving the observed outflows. For SDSSJ2323-0100 and SDSSJ0826+0542, the potentially high momentum flux ratios tell us that an adiabatic shock driven by a ultra-fast outflow or a broad-absorption line type wind can drive the galaxy scale outflows. Given the relatively small radii, another likely scenario is the ionized outflows are driven by radiation pressure from the accretion disk of the quasars in a high column density environment. For SDSSJ1652+1728, radiation pressure from the quasar accretion disk or a radiative shock can drive the observed ionized outflow. At the extent of the outflow, there would have to be a factor 20 more outflowing gas mass in either the neutral or molecular phase for the outflow to be considered driven by an adiabatic shock or radiation pressure from a high column density environment \citep{costa18}. Other studies have found a substantial amount of neutral and molecular gas in galactic outflows \citep{carn15,vayner17,rupk17,Fluetsch19}. The factor of 20 is based on how much we would need to scale the $\frac{\dot{P}_{outflow}}{\dot{P}_{AGN}}$\ of the outflow in SDSSJ1652+1728 at its current extent to match that found in simulations by \citet{fauc12a} for an energy conserving outflow. The factor of 20 is also consistent with predictions by \cite{demp18} for the amount of neutral or molecular gas required in an outflow to prevent over-ionization of the \hbox{[O$\,${\scriptsize III}]}. For SDSSJ0812+1819, the outflow is likely driven by either radiation pressure or a radiative shock. For an adiabatic shock to drive the outflow, there would have to be a factor of 40 or more gas in a neutral or molecular gas phase based on the momentum fluxes found in simulations by \citet{fauc12a} at the extent of the outflow in SDSSJ0812+1819. A nuclear starburst would require a star formation rate of 2300 \myr, 2000 \myr, 8,000 \myr, and 50 \myr\ for SDSS2323-0100, SDSS1652+1728, SDSS0826+0542 and SDSS0812+1819, respectively, to drive the outflow through radiation pressure. We assume the Starburst99 stellar feedback model \citep{leit99} with a Kroupa IMF \citep{kroup01}: \begin{equation} \dot{P}_{SFR} = 1.5\times10^{33}\frac{\dot{M}_{SFR}}{1M_{\odot}yr^{-1}} \rm dyne\label{eq:pdot_SFR_SFR} \end{equation} For star formation to drive the outflows through supernova explosions would require a star formation rate of 500 \myr, 500 \myr\ and 1600 \myr\ for SDSS2323-0100, SDSS1652+1728, and SDSS0826+0542. We assume there is one supernova explosion for 100 solar mass of stars formed and using the momentum injection per supernova from recent simulations by \citet{Kim15} and \citet{Martizzi15}: \begin{equation} \dot{P}_{SNe} = 7.5\times 10^{33} \frac{\dot{M}_{SFR}}{1M_{\odot}yr^{-1}} \left(\frac{n}{100\,{\rm cm}^{3}}\right)^{-0.18} \left(\frac{Z}{Z_\odot}\right) \rm dyne \label{eq:SNe_mom}. \end{equation} Such high star formation rates are not supported by our data, as we see no evidence for narrow \hbox{H$\alpha$}\ or \hbox{H$\beta$}\ emission that would be consistent with nuclear starbursts at such star formation rates. There could be obscured star-forming regions, and future observations with ALMA can help search for that. Most likely, the entirety of the outflows are driven by radiative mechanisms of the quasar. SDSSJ0812+1819 shows evidence for jets in radio data, hence there is a possibility of jets also driving the observed nuclear outflow in this one system. For SDSS1652+1728, given the redshift we cannot currently put a limit on the star formation rate using a Balmer emission line. The existence of a narrow \hbox{[O$\,${\scriptsize III}]}\ component could signal photoionization by massive young stars in an HII region, however, just as likely, quasar photoionization can produce the observed emission line. Interestingly, the overall orientation of the ionized gas outflow relative to the nucleus is consistent with the 220 deg East of North (center of the SW quadrant) inferred from the polarimetric observations. The detection of co-spatial scattering and forbidden-line outflows indicates that the quasar illuminates both the outflowing gas and the scattering gas with the same geometry \citep{wyle16a}. Further evidence for a co-spatial UV photon scattering and outflowing gas comes from our recent \textit{Hubble Space Telescope} ACS observations (GO-14608, PI: Zakamska, exposure time: 2188.0 s) taken in the F814W filter ($\lambda_{rest}$ = 2733.8 \AA). Spectropolarimetric observations already revealed a high degree of polarization near these wavelengths; after performing PSF subtraction of the quasar emission on the ACS data, we detect extended emission in the SW - NE direction, matching closely to the predicted orientation of illumination from spectropolarimetry \citep{alex18}. Within the wavelength range of the F814W filter, we do not expect any strong emission from UV lines; hence nearly the entire light in this filter has to come from a continuum source. The PSF subtraction was done by extracting a portion of the ACS image centered on a nearby star with a similar magnitude as the quasar; we then normalized the image to the peak flux value and re-scale it the peak flux of the quasar, and subtract it out. We compare the extent and morphology of the rest-frame UV emission to both the narrow and broad emission detected in \hbox{[O$\,${\scriptsize III}]}. The general orientation, extent, and morphology of the rest-frame UV emission match closely to the extended broad-emission detected in \hbox{[O$\,${\scriptsize III}]}\ from the outflow. The narrow \hbox{[O$\,${\scriptsize III}]}, which extends in the western direction, matches a portion of the UV emission that likely originates from a star-forming region in either the host galaxy or a merging galaxy (Figure \ref{fig:ACS}). The direction of the narrow \hbox{[O$\,${\scriptsize III}]}\ emission also matches the general extent of the WFC3 F140W imaging from \citep{zaka19}, that traces the stellar continuum from the host galaxy.\\ \indent Most of the UV emission likely comes from scattered light in the conical illumination region for SDSS1652+1728. The scattered light's extent is approximately two times greater than the ionized outflow detected with NIFS. The diameter of the extended UV emission is approximately 24 kpc. The \hbox{[O$\,${\scriptsize III}]}\ emission appears to trace a single cone of the outflow, while in the UV light, we see a double-cone, indicating that the ionization may be impacting a much larger extent. The asymmetry of the UV light likely indicates that scattering is occurring of dust grains in the outflow. Forward scattering can explain the differences in the observed intensity between the SW and NE regions if the axis of the scattering cone points towards the observer in the SW region. Presence of dust can also explain why the NW cone is undetected in \hbox{[O$\,${\scriptsize III}]}, where the back cone is partially extincted by dust and the \hbox{[O$\,${\scriptsize III}]}\ line strength is below the flux sensitivity of NIFS. Based on \citet{zaka05,obie16} scattering models due to dust grains and electrons in z$\sim 0.5$ type-2 quasars, the scattered light comes from low-density clouds. For large scattering regions, dust scattering is further favored over electron scattering since, based on the modeled electron density, the recombination emission line intensity would be unphysical \citep{zaka05}. The low density of these regions can partially explain the larger extent of the scattering light compared to \hbox{[O$\,${\scriptsize III}]}, due to the stronger dependence of the \hbox{[O$\,${\scriptsize III}]}\ intensity on the electron density. The direction of quasar illumination and direction of scattered UV photons matching closely to the galactic outflow further support that the quasar is the primary driving source of the galactic outflow. Accurate measurement of the energetics from the neutral and molecular phase is imperative to understand both the driving mechanism behind the galactic scale outflow and the impact on the star formation in the host galaxy. \begin{figure*} \centering \includegraphics[width=7.0 in]{ACS.eps} \caption{\textit{HST} ACS observations of SDSS1652+1728. In the background of both images, we show a PSF subtracted F814W image of the host galaxy. On the left, we overlay in contours the integrated intensity \hbox{[O$\,${\scriptsize III}]}\ map from the broad component due to the outflow, and we stretch the ACS image in the range of 22.5 to 24.5 mag/arcsec$^{2}$ to highlight the faint diffuse emission, the dashed line represents the scattering angle from spectropolarimetric observations \citep{alex18}. On the right, we overlay the narrow component of \hbox{[O$\,${\scriptsize III}]}, that originates either from star-formation or quasar photoionization from an extended narrow-line region. Only a small fraction of the UV emission correlates with the narrow \hbox{[O$\,${\scriptsize III}]}\ component. The image stretch on the right ranges from 21.5 to 23.5 mag/arcsec$^{2}$ to highlight the brighter compact emission. The strong correlation between the extended broad \hbox{[O$\,${\scriptsize III}]}\ and UV emission indicates that the majority of the extended UV light ($\lambda_{rest}$ = 2733.8 \AA) originates from scattering in the direction of the outflow. The bar in each image represents 8.5 kpc, the red ellipse in the lower left corner represents the resolution of the NIFS observations, while the white ellipse shows the resolution of \textit{HST} ACS.} \label{fig:ACS} \end{figure*} \begin{figure*} \centering \includegraphics[width=7.5in]{E_DOT_P_DOT_ERQ.eps} \caption{On the left we plot the momentum flux of the outflow against the radiation momentum flux of the accretion disk. Red points represent ionized outflows in the distant Universe, with the black stars representing the objects within our sample. The blue points are molecular outflows studied in low redshift galaxies. We plot two lines of constant ratio; 2:1 and 10:1 as these provide clues into the driving mechanism of the outflows. Theoretically points below the 2:1 signal outflows that are driven by either radiation pressure or a radiative shock. Points above the 2:1 line signal outflows that are driven by either radiation pressure in a confined region within $<1$ kpc or an outflow driven by an adiabatic shock. On the right we plot the energy rate of the outflow against the bolometric luminosity of AGN. The lines of constant ratio signal coupling efficiencies proposed by various theoretical works necessary to clear the gas from the host galaxy through outflows and establish the local scaling relations such as $M_{\bullet}-\sigma~$.} \label{fig:E_dot_P_dot} \end{figure*} \begin{figure*} \centering \includegraphics[width=7.5in]{P_dot_ratio_vs_R_w_models.eps} \caption{The ratio of momentum flux as a function of the outflow radius. Red points are from ionized outflows, and blue points are from molecular, the points from this study are shown with a black star. High momentum flux ratio on small scales is generally attributed to radiation pressure-driven winds in a high column density environment. High momentum flux on large and small scales can be attributed to an adiabatic shock driven outflow, while low momentum flux ratio on small and large scales can be attributed to a radiative shock. Low momentum flux ratios on small and large scales can also be attributed to radiation pressure-driven winds in low column density environments. The dividing lines between the models are selected from theoretical work by \citealt{fauc12a,thom15,costa18}.} \label{fig:P_dot_ratio_vs_R} \end{figure*} \subsection{Potential impact of the outflow on their host galaxies} Several theoretical works have proposed a coupling efficiency between the galaxy scale outflow and the quasar's bolometric luminosity to explain the observed local scaling relation between the mass of the SMBH and the velocity dispersion and bulge of a galaxy. Generally, in these theoretical frameworks, once the galaxies assemble onto a local scaling relation, a certain fraction of the quasar bolometric luminosity needs to be converted into the kinetic luminosity of the outflow to affect the flow of gas onto the galaxy, induce turbulence in the ISM to affect the efficiency of star formation \citep{power11,zubo12}. The current consensus is that if the quasars transfer about 0.1-1$\%$ of its luminosity into an outflow, there can be a significant impact \citep{Hopkins10,choi12,costa18}. We compute and present the ratio between the bolometric luminosity of the quasar and the kinetic luminosity of the outflow in Table \ref{tab:outflow-prop}. For SDSSJ2323-0100 and SDSSJ0826+0542 we find that 2.7\% (0.2-5.2\%) and 1\% (0.5-1.5\%) of the quasars' bolometric luminosity is converted into the outflows' kinetic luminosity, respectively. Even at the low end of both ranges, the coupling efficiency is large enough for the outflow to affect the galaxy. For SDSSJ1652+1728, the coupling efficiency is 0.1\% (0.05-0.2\%), on the low end of what is prescribed by theoretical work. The addition of other ionization states of Oxygen and additional neutral and molecular gas components will increase the coupling efficiency. Furthermore, we assumed solar metallicity when computing the outflow mass using the \hbox{[O$\,${\scriptsize III}]}\ emission line; if the true metallicity is lower, that can increase the amount of ionized gas that we compute. Hence the outflow in this system is likely to impact the galaxy. For SDSSJ0812+1819, the coupling efficiency is at 0.02$\%$, significantly lower than what is necessary for the outflow to impact the host galaxy, a substantial fraction of outflowing gas in either neutral or molecular phase would be necessary. From a theoretical standpoint, the nuclei transition to an unobscured phase once a powerful nuclear outflow can be driven \citep{hopkins05,king15} efficiently. In the current theoretical paradigm, this is supposed to occur when the galaxies fall on the local $M_{\bullet}-\sigma~$ relation because star formation in the host galaxy needs to be suppressed on a similar timescale to the SMBH growth. Driving outflows through radiation pressure or an adiabatic shock are most efficient in confined circumnuclear environments, producing a high $\frac{\dot{P}_{outflow}}{\dot{P}_{AGN}}$ fast-moving turbulent outflows \citep{costa18,fauc12a,king15}. These conditions are potentially best satisfied in systems with high nuclear column densities and already known fast-moving outflows, making ERQs ideal candidates for long-sought transitional objects. In our two resolved objects, the outflow sizes are smaller than the average size measured in other AGN systems at similar redshift and bolometric luminosity. The outflows in SDSSJ2323-0100 and SDSSJ0826+0542 carry a significant amount of energy and momentum with a large momentum flux ratio that can be caused by radiation pressure or an adiabatic shock. The outflows are powerful enough to clear the gas and dust in the circum-nuclear region and transition these object to a blue type-1 quasar. For the above reasons, SDSSJ2323-0100 and and SDSSJ0826+0542 excellent example of transition objects in the distant Universe. While there is evidence for strong outflows in the SDSSJ2323-0100, SDSSJ1652+1728 and SDSSJ0826+0542 systems, we still find the presence of quiescent gas due to the narrow line emission in SDSSJ1652+1728 and the existence of a large molecular reservoir in the SDSSJ2323-0100 system (Serena Perrotta, private communication). Likely the outflows only affect the nuclear regions of these galaxies as they have yet to expand deeper into the interstellar medium. There is likely to be a delay between the present time and when the galaxy's full extent will be affected by these outflows. In SDSSJ0812+1819, the outflow is likely not powerful enough to affect any region of its host galaxy. \section{Conclusions} \label{sec:conc} Extremely red quasars at high redshifts display some of the most extreme kinematics in their forbidden emission lines, and it is very important to determine whether the observed high velocities of the gas imply large-scale outflows and powerful energetics of feedback. In this paper, we present the first adaptive optics assisted NIR IFS (rest-frame optical) observations of 3 ERQs and a candidate type-2 quasar. The observations were conducted with the NIFS instrument at the Gemini North Observatory and with OSIRIS at the W. M. Keck Observatory. We performed PSF subtraction to remove any unresolved quasar emission to search for extended emission from the host galaxies. We fit the emission lines at each spaxel to extract information on the line intensity, radial velocity offset, and dispersion. We detected extended emission in SDSSJ2323-0100 and SDSSJ1652+1728 originating from both a narrow-line region and an outflow, with only narrow emission detected in SDSSJ0812+1819. In SDSSJ0826+0542, no extended emission is detected, and we place an upper limit on its size. Outflows are found in all objects. In SDSSJ1652+1728, we detect both a resolved and an unresolved component to the outflow. In SDSSJ2323-0100, we only detect an extended outflow while in SDSSJ0812+1819 and SDSSJ0826+0542, the outflows are unresolved within our observations. We calculated outflow rates, kinetic luminosities, and momentum fluxes for all outflows. We compared the energetics to theoretical predictions and other high redshift samples and found: \begin{itemize} \item Several AGN mechanisms can drive the observed outflows. For SDSSJ2323-0100, either radiation pressure from the quasar or an adiabatic shock sweeping material in the host galaxy is responsible for driving the galaxy scale ionized outflow. For SDSSJ1652+1728, the outflow can potentially be driven by radiation pressure or a radiative shock, however outflowing gas in other phases can shift the driving mechanism to an adiabatic shock or radiation pressure from a high column density nuclear region. The outflow in SDSSJ0812+1819 is likely driven by radiation pressure in a low column density environment or a radiative shock. \item The outflows in SDSSJ2323-0100, SDSSJ1652+1728, and SDSSJ0826+0542 satisfy the minimum coupling criteria between the bolometric luminosity of the quasar and kinetic luminosity of the outflow to have an impact on the star-forming properties of the host galaxy. However, there is evidence for narrow emission in SDSSJ1652+1728 indicating the presence of a quiescent gas while in SDSSJ2323-0100, there is a substantial molecular gas reservoir. Likely the outflows are only affecting at present the nuclear regions of these two galaxies. The coupling efficiency in SDSSJ0812+1819 is below the minimum value prescribed by theoretical work for the outflow to have any impact on the host galaxy. \item We find the ionized outflows in our sample of ERQs to be less extended than ionized outflows in other samples in the distant Universe. The small outflow radius, high momentum flux ratio, and the high obscuration in SDSSJ2323-0100 make this an excellent candidate for a transitional object where the quasar driven outflow is expelling material from the nuclear region and unveiling the SMBH accretion disk. \end{itemize} \section{Data availability} The Keck OSIRIS data of this work are publicly available from the Keck Observatory Archive (https://www2.keck.hawaii.edu/koa/public/koa.php). The Gemini NIFS data of this work are publicly available from the Gemini Observatory Archive (https://archive.gemini.edu/searchform). Source information is provided with this paper. Other data underlying this article will be shared on a reasonable request to the corresponding author. \pagebreak \section{Acknowledgments} Based on observations obtained at the Gemini Observatory, which is operated by the Association of Universities for Research in Astronomy, Inc., under a cooperative agreement with the NSF on behalf of the Gemini partnership: the National Science Foundation (United States), the National Research Council (Canada), CONICYT (Chile), the Australian Research Council (Australia), Minist\'{e}rio da Ci\^{e}ncia, Tecnologiae Inova\c{c}\~{a}o (Brazil) and Ministerio de Ciencia, Tecnolog\'{i}a e Innovaci\'{o}n Productiva (Argentina). The authors thank Gemini scientists Julia Scharw\"achter, Trent Dupuy, Andreea Petric, Marie Lemoine-Busserolle, and Susan Ridgway for helping us plan and execute this program and who served as our Gemini phase II liaison for planning this program (GN-2019A-FT-111, GN-2016A-FT-8, GN-2014A-Q-42, GN-2014B-Q-44). Based on observations with the NASA/ESA Hubble Space Telescope obtained at the Space Telescope Science Institute, which is operated by the Association of Universities for Research in Astronomy, Incorporated, under NASA contract NAS5-26555. Support for program number HST-GO-14608 was provided through a grant from the STScI under NASA contract NAS5-26555. The authors wish to thanks Jim Lyke, Randy Campbell, and other SAs with their assistance at the telescope to acquire the Keck OSIRIS data sets. The data presented herein were obtained at the W.M. Keck Observatory, which is operated as a scientific partnership among the California Institute of Technology, the University of California and the National Aeronautics and Space Administration. The Observatory was made possible by the generous financial support of the W.M. Keck Foundation. The authors wish to recognize and acknowledge the very significant cultural role and reverence that the summit of Maunakea has always had within the indigenous Hawaiian community. We are most fortunate to have the opportunity to conduct observations from this mountain. This research has made use of the NASA/IPAC Extragalactic Database (NED) which is operated by the Jet Propulsion Laboratory, California Institute of Technology, under contract with the National Aeronautics and Space Administration. A.V. and N.L.Z. acknowledge support of the STScI grant JWST-ERS-01335.002 and HST-GO-14608. R.A.R thanks partial financial support from the Funda\c c\~ao de Amparo \`a pesquisa do Estado do Rio Grande do Sul (17/2551-0001144-9 \& 16/2551-0000251-7) and Conselho Nacional de Desenvolvimento Cient\'ifico e Tecnol\'ogico (202582/2018-3 \& 302280/2019-7). We want to thank the anonymous referee for their constructive comments that helped improve the manuscript.
\section{Introduction} The Hodge conjecture is major open problem in Complex Algebraic Geometry that has been puzzling mathematician for decades now. The modern statement is the following: Let $X$ be smooth complex projective variety, then the (rational) cycle class map is surjective:$$cl_{\otimes\mathbb{Q}}:CH^p(X)\otimes\mathbb{Q}\rightarrow H^{p,p}\cap H^{2p}(X,\mathbb{Q})$$ where $cl_{\otimes\mathbb{Q}}(\sum a_iX_i) = \sum a_i[X_i]$, $a_i\in\mathbb{Q}$ and $[X_i]$ is the class of the subvariety $X_i$. The case $p=1$ is the only case that it is known to hold in general, which follows from Lefschetz's theorem on $(1,1)$-classes. Special cases have emerged during the years but all of them were specific for certain classes of varieties. For example, Abelian varieties of prime dimension, unirational and uniruled fourfolds, hypersurfaces of degree less than 6, and some others \cite{L}. Using hard Lefschetz theorem, Lefschetz hyperplane theorem and some Hilbert scheme arguments, we can reduce the Hodge conjecture to the case of an even dimensional $(>2)$ variety and primitive middle cohomology classes. Shioda \cite{S} gave an interesting characterization of the Hodge conjecture for Fermat varieties, which we now review. \section{Shioda's work} Let $X^n_m\in\mathbb{P}^{n+1}$ denote the Fermat variety of dimension $n$ and degree $m$, i.e. the solution to the equation: $$x_0^m+x_1^m+\ldots+x_{n+1}^m=0$$ and $\mu_m$ the group of $m$-th roots of unity. Let $G^n_m$ be quotient of the group $\overbrace{\mu_m\times\ldots\times\mu_m}^{n+2}$ by the subgroup of diagonal elements. The group $G^n_m$ acts naturally on $X^n_m$ by coordinatewise multiplication, moreover, the character group $\hat{G^n_m}$ of $G^n_m$ can be identified with the group: $$\hat{G^n_m}=\{ (a_0,\ldots, a_{n+1})|a_i\in\mathbb{Z}_m, a_0+\ldots+a_{n+1}=0\}$$ via $(\zeta_0,\ldots,\zeta_{n+1})\mapsto \zeta_0^{a_0}\dots\zeta_{n+1}^{a_{n+1}}$, where $(\zeta_0,\ldots,\zeta_{n+1})\in G^n_m$. By the previous section, in order to prove the Hodge conjecture, it's enough to prove it for primitive classes, therefore in this paper we will focus on primitive cohomology. The action of $G^n_m$ extends to the primitive cohomology and makes $H^i_{prim}(X^n_m,\mathbb{Q})$ and $H^i_{prim}(X^n_m,\mathbb{C})$ a $G^n_m$-module. For $\alpha\in \hat{G^n_m}$, we set: $$V(\alpha)=\{ \xi\in H^n_{prim}(X^n_m,\mathbb{C}) | g^*(\xi)=\alpha(g)\xi\text{ for all } g\in G^n_m \}$$ Before stating the characterization of Hodge classes we need a few notation. Let $$\mathfrak{U}^n_m:= \{ \alpha = (a_0,\ldots, a_{n+1})\in \hat{G^n_m} | a_i\neq 0 \text{ for all } i \}$$ For $\alpha\in\mathfrak{U}^n_m$ we set $|\alpha|=\sum_i \frac{<a_i>}{m}$, where $<a_i>$ is the representative of $a_i\in\mathbb{Z}_m$ between $1$ and $m-1$. Suppose $n=2p$, then we set $$\mathfrak{B}^n_m:= \{ \alpha \in \mathfrak{U}^n_m | |t\alpha|=p+1 \text{ for all } t\in\mathbb{Z}^*_m \}$$ \begin{theorem}\cite{R,S} Let $Hdg^p := H^{p,p}\cap H^{2p}_{prim}(X,\mathbb{Q})$ be the group of primitive Hodge cycles. Then: \begin{itemize} \item[(a)] $\dim V(\alpha)=0$ or $1$, and $V(\alpha)\neq 0 \iff \alpha\in\mathfrak{U}^n_m$ \item[(b)] $Hdg^p = \bigoplus_{\alpha\in\mathfrak{B}^n_m} V(\alpha)$ \end{itemize} \end{theorem} Now let $C(X^n_m)$ denote the subspace of $Hdg^p$ which are classes of algebraic cycles. Then $C(X^n_m)$ is a $G^n_m$-submodule and by the theorem above there is a subset $\mathfrak{C}^n_m\subseteq\mathfrak{B}^n_m$ such that: $$C(X^n_m)= \bigoplus_{\alpha\in\mathfrak{C}^n_m} V(\alpha)$$ the Hodge conjecture can then be stated as follows: \begin{conjecture}[Hodge Conjecture] For all $n,m$ we have $\mathfrak{C}^n_m=\mathfrak{B}^n_m$. \end{conjecture} By the discussion in the previous section, this is true for $n\leq2$ and all $m$. The idea to prove this equality for Fermat varieties it to use the fact that $X^n_m$ `contains' disjoint unions of $X^k_m$ with $k<n$, we then blow that up to find a relation between the cohomologies and to inductively construct algebraic cycles in $X^n_m$. More precisely, we have: \begin{theorem}\cite{S}\label{shioda} Let $n=r+s$ with $r,s\geq 1$. Then there is an isomorphism $$f: [H^r_{prim}(X^r_m,\mathbb{C})\otimes H^s_{prim}(X^s_m,\mathbb{C})]^{\mu_m} \oplus H^{r-1}_{prim}(X^{r-1}_m,\mathbb{C})\otimes H^{s-1}_{prim}(X^{s-1}_m,\mathbb{C})\isomto H^n_{prim}(X^n_m,\mathbb{C})$$ with the following properties: \begin{itemize} \item[a)] $f$ is $G^n_m$-equivariant \item[b)] $f$ is morphism of Hodge structures of type (0,0) on the first summand and of type $(1,1)$ on the second. \item[c)]If $n=2p$ then $f$ preserves algebraic cycles, moreover if $$Z_1\otimes Z_2\in H^{r-1}_{prim}(X^{r-1}_m,\mathbb{C})\otimes H^{s-1}_{prim}(X^{s-1}_m,\mathbb{C})$$ then $f(Z_1\otimes Z_2)=mZ_1\wedge Z_2$, where $Z_1\wedge Z_2$ is the algebraic cycle obtained by joining $Z_1$ and $Z_2$ by lines on $X^n_m$, when $Z_1,Z_2$ are viewed as cycles in $X^n_m$. \end{itemize} \end{theorem} In light of this theorem, we introduce the following notation: $$\mathfrak{U}^{r,s}_m=\{(\beta,\gamma)\in\mathfrak{U}^{r}_m\times\mathfrak{U}^{s}_m\ | \beta=(b_0,\ldots,b_{r+1}),\gamma=(c_0,\ldots,c_{s+1}),\text{ and } b_{r+1}+c_{s+1}=0\}$$ For $(\beta,\gamma)\in\mathfrak{U}^{r,s}_m$ we define: $$\beta\#\gamma=(b_0,\ldots,b_{r},c_0,\ldots,c_{s})\in\mathfrak{U}^{r+s}_m$$ and for $\beta'=(b_0,\ldots,b_{r})\in\mathfrak{U}^{r-1}_m$ and $\gamma'=(c_0,\ldots,c_{s})\in\mathfrak{U}^{s-1}_m$, we set: $$\beta'*\gamma'=(b_0,\ldots,b_{r},c_0,\ldots,c_{s})\in\mathfrak{U}^{r+s}_m$$ Using the theorem above we have: \begin{corollary} Suppose $n=2p=r+s$, where $r,s\geq 1$. \begin{itemize} \item[a)] If $r,s$ are odd and $(\beta',\gamma')\in\mathfrak{C}^{r-1}_m\times \mathfrak{C}^{s-1}_m$ then $\beta'*\gamma'\in\mathfrak{C}^{n}_m$ \item[b)] If $r,s$ are even and $(\beta,\gamma)\in(\mathfrak{C}^{r}_m\times \mathfrak{C}^{s}_m)\cap \mathfrak{U}^{r,s}_m$ then $\beta\#\gamma\in\mathfrak{C}^{n}_m$ \end{itemize} \end{corollary} By the above corollary, the Hodge conjecture can be proven for the Fermat $X^n_m$ if the following conditions are true for every $\alpha\in\mathfrak{B}^{n}_m$: \begin{itemize} \item[(P1)] $\alpha\sim\beta'*\gamma'$ for some $(\beta',\gamma')\in\mathfrak{B}^{r-1}_m\times \mathfrak{B}^{s-1}_m,\quad (r,s \text{ odd})$. \item[(P2)] $\alpha\sim\beta\#\gamma$ for some $(\beta,\gamma)\in(\mathfrak{B}^{r}_m\times \mathfrak{B}^{s}_m)\cap \mathfrak{U}^{r,s}_m,\quad (r,s \text{ even and positive})$. \end{itemize} where $\sim$ means equality up to permutation between factors. In order to make these conditions more explicit, we introduce the additive semi-group $M_m$ of non-negative solutions $(x_1,\ldots,x_{m-1};y)$ with $y>0$, to the following system of linear equations: $$\sum_{i=1}^{m-1} <ti>x_i = my\text{ for all } t\in\mathbb{Z}_m^*$$ Also, define $M_m(y)$ as those solutions where $y$ is fixed. Note that by Gordan's lemma, $M_m$ is finitely generated. \begin{definition} An element $a\in M_m$ is called \textbf{decomposable} if $a=c+d$ for some $c,d\in M_m$, otherwise it's called \textbf{indecomposable}. An element is called \textbf{quasi-decomposable} if $a+b=c+d$ for some $a\in M_m(1)$ and $c,d\in M_m$ with $c,d\neq a$. \end{definition} With this notation we can identify elements of $\mathfrak{B}^n_m$ with elements of $M_m$ using the map: $$\{\}:\alpha=(a_0,\ldots,a_{n+1})\in \mathfrak{B}^n_m \mapsto \{\alpha\}=(x_1(\alpha),\ldots,x_{m-1}(\alpha),\frac{n}{2}+1)\in M_m(\frac{n}{2}+1)$$ where $x_k(\alpha)$ is the number os i's such that $<a_i>=k$. Note that $\alpha$ satisfies $(P1)$ above if and only if $\{\alpha\}$ is decomposable. If $\alpha$ satisfies $(P2)$ then $\{\alpha\}$ is quasi-decomposable. Conversely, if the latter is true then $\alpha$ satisfies $(P1)$ or $(P2)$. So it makes sense to introduce the following conditions: \begin{itemize} \item[($P^n_m$)] Every indecomposable elemets of $M_m(y)$ with $3\leq y\leq \frac{n}{2}+1$, if any, is quasi-decomposable. \item[($P_m$)] Every indecomposable elemets of $M_m(y)$ with $y\geq 3$ is quasi-decomposable. \end{itemize} By the results above we conclude: \begin{theorem}\cite{S} If condition ($P_m$) is satisfied, then the Hodge conjecture is true for $X^n_m$ for any $n$. If ($P^n_m$) is satisfied then the Hodge conjecture is true for $X^n_m$. \end{theorem} For $m$ prime or $m=4$, $M_m$ is generated by $M_m(1)$ which gives: \begin{theorem}\cite{R,S} If $m$ is prime or $m=4$, the Hodge conjecture is true for $X^n_m$ for all $n$. \end{theorem} Shioda manually verified condition ($P_m$) for $m\leq 20$ and concluded: \begin{theorem}\cite{S} If $m\leq 20$, the Hodge conjecture is true for $X^n_m$ for all $n$. \end{theorem} Starting at $m=21$ the number of indecomposables and the length of elements of $M_m$ are very large so it's hard to verify ($P_m$) by hand for unknown cases, unless $m=p^2$ a square of a prime. In the latter case, condition ($P_m$) is not always true, it's false for $m=25$ for example. However, Aoki\cite{A} explicitly constructed the algebraic cycles that generates each $V(\alpha)$, such cycles are called \textbf{standard} cycles. \begin{theorem}\cite{A} If $m=p^2$, the Hodge conjecture is true for $X^n_m$ for all $n$, even though condition ($P_m$) may be false. \end{theorem} \section{New cases of the Hodge conjecture} A natural question is whether or not the Hodge conjecture can always be proved using condition ($P_m$). As described above, there are false negatives, i.e. ($P_m$) is false but the Hodge conjecture is still true. This is due to the fact that there are cycles not coming from the induced structure, see \cite{A}. The next obvious question is then for which values of $m$, if any, the condition ($P_m$) is false, besides $m=p^2$. This would say that there are cycles, not of type standard as in \cite{A}, such that they too do not come from the induced structure. Technically they are candidates for a counter-example to the Hodge conjecture. We used SAGE math to answer that question and more generally to investigate when conditin ($P_m$) is true. All the code used in this section can be found in the \hyperref[appendix]{Appendix}. In the case of Fermat fourfolds, we computed first all the indecomposable elements with length $\geq 3$, because the $(2,2)$ cycles have length exactly $3$. So the idea was to find values of $m$ for which there were none of them. \begin{proposition} If $m\leq 100$ is an integer coprime to 6, then the Hodge conjecture is true for all Fermat fourfolds $X^4_m$. \end{proposition} This is a strong evidence that the Hodge conjecture should be true for fourfolds $X^4_m$ where $m$ is coprime to $6$. It also suggests the structure of $\mathfrak{B}^4_m$, namely, if $3 \mid m$ then there are indecomposables elements of length $3$. That is indeed the case, before proving it we need the lemma below proved by Shioda and Aoki: \begin{lemma}Let $m$ be an integer coprime to 6. \begin{itemize} \item[a)] (Shioda \cite{S2}) $Hdg^1(X^2_m)$ is generated by lines. \item[b)] (Aoki \cite{aoki}) $Hdg^1(X^1_m\times X^1_m)$ is generated by lines. \end{itemize} \end{lemma} \begin{theorem} If $m$ is coprime to $6$, then the Hodge conjecture is true for all Fermat fourfolds $X^4_m$. \end{theorem} \begin{proof} By taking $m=6$ and $r=s=2$ in theorem \ref{shioda}, the result follows directly from the lemma above. \end{proof} The following corollary is immediate by \cite{S}: \begin{corollary} If $m_i$ are integers coprime to $6$, then the Hodge conjecture is true for arbitrary products of Fermat fourfolds $X^4_{m_1}\times \dots X^4_{m_k}$. \end{corollary} We slightly extended Shioda's work by verifying condition ($P_m$) for $m=21,27$. A computational proof can be found in the \hyperref[appendix]{Appendix}. \begin{theorem} The Hodge conjecture is true for Fermats $X^n_{21}$ and $X^n_{27}$. \end{theorem} An interesting case is $m=33$, where condition ($P_m$) is false, because we've explicitly founded a cycle that is not quasi-decomposable and is not of standard type either. \begin{proposition} Condition $P_{33}$ is false. More precisely, the following cycle $$(0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 3)$$ supported on $X^4_{33}$ is not quasi-decomposable in $M_{33}$. \end{proposition} This proposition confirms that starting at $n=4$, there are cycles not coming from the induced structure. Therefore, we can not prove the Hodge conjecture only using this approach. One thing that can be done is to find explicitly the algebraic cycles whose class project non trivially to $V(\alpha)$ for each $\alpha\in\mathfrak{B}^n_m$, see \cite{A}. In the particular case where $m=3d$ and $3\nmid d$, as above, we have a candidate. Consider the following elementary symmetric polynomials in \textbf{x}$=(x_0,\dots,x_5)$: \begin{equation} \begin{split} p_1(\textbf{x}) := x_0+x_1+x_2+x_3+x_4+x_5 \\ p_2(\textbf{x}) := x_0x_1+x_0x_2+\dots x_4x_5\\ p_3(\textbf{x}) :=x_0x_1x_2+\dots x_3x_4x_5 \end{split} \end{equation} Recall the Newton identity: \begin{equation} x_0^3+x_1^3+x_2^3+x_3^3+x_4^3+x_5^3=p_1(\textbf{x})^3-3p_1(\textbf{x})p_2(\textbf{x})+3p_3(\textbf{x})^3 \end{equation} Set $\textbf{x}^d=(x_0^d,\dots,x_5^d)$, then: \begin{equation} x_0^m+x_1^m+x_2^m+x_3^m+x_4^m+x_5^m=p_1(\textbf{x}^d)^3-3p_1(\textbf{x}^d)p_2(\textbf{x}^d)+3p_3(\textbf{x}^d)^3 \end{equation} Let $W$ denotes the following variety in $\mathbb{P}^5$: \begin{equation} p_1(\textbf{x}^d)=p_2(\textbf{x}^d)=p_3(\textbf{x}^d)=0 \end{equation} By construction, $W\subseteq X^4_m$ is a subvariety of codimension 2, so $[W]\in Hdg^2(X^4_m)$ . \begin{question} Can $[W]$ project non trivially in $V(\alpha)$ for every $\alpha\in\mathfrak{B}^4_m$ which is not quasi-decomposable and not of standard type? \end{question} If the answer is yes, then we would have a positive answer to the Hodge conjecture in this case. We know by Schur's lemma that the number of indecomposable elements is finite. Given $m\in\mathbb{Z}_+$, in order to prove the Hodge conjecture for $X^n_m$ and any $n$, it's enough to prove for all $X^{n}_m, n\leq n'$, where $n'=2(m'-1)$ and $m'$ is the largest length of all the indecomposable elements in $M_m$. Let $\mathcal{I}_m$ be set of indecomposable elements of $M_m$. Define $\phi : \mathbb{Z}_+\to \mathbb{Z}_+$ by the rule \begin{equation} \phi(m)=\{ \max{y} \:| \: (x_1,\dots x_{m-1},y)\in\mathcal{I}_m \} \end{equation} We have the following: \begin{proposition} If the Hodge conjecture is true for $X^{n}_m$, for all $n\leq 2(\phi(m)-1)$, then it's true for $X^n_m$ and any $n$. \end{proposition} \begin{proof} The Hodge classes in $X^n_m$ are parametrized by $\mathcal{B}^n_m$, which can be viewed inside $M_m$ as elements of length $\frac{n}{2}+1$. Since the indecomposables generate $M_m$, it is enough that those be classes of algebraic cycles. But that is the case if the Hodge conjecture is true when $\frac{n}{2}+1\leq \phi(m)$, by definition of $\phi(m)$. \end{proof} Therefore, for Fermat varieties of degree $m$, we don't need to check the Hodge conjecture in every dimension. It's enough to prove the result for dimension up to $2(\phi(m)-1)$. A natural question that arises is then what is the explicit expression of the function $\phi(m)$. For $m$ prime or $m=4$, we know already that $\phi(m)=1$. Also, by \cite{A}, we know that for $p>2$ prime $\phi(p^2)=\frac{p+1}{2}$. Here's a table with the a few values of $\phi(m)$: \vspace{0.5cm} \begin{center} \begin{tabular}{ |c|c| } \hline $m$ & $\phi(m)$ \\ \hline 20 & 5 \\ 21 & 3 \\ 22 & 7 \\ 23 & 1 \\ 24 & 9 \\ 25 & 3 \\ \hline \end{tabular} \begin{tabular}{ |c|c| } \hline $m$ & $\phi(m)$ \\ \hline 26 & 7 \\ 27 & 5 \\ 28 & 7 \\ 29 & 1 \\ 30 & 9 \\ 31 & 1 \\ \hline \end{tabular} \begin{tabular}{ |c|c| } \hline $m$ & $\phi(m)$ \\ \hline 32 & 9 \\ 33 & 5 \\ 34 & 5 \\ 35 & 8 \\ 36 & 13 \\ 37 & 1 \\ \hline \end{tabular} \begin{tabular}{ |c|c| } \hline $m$ & $\phi(m)$ \\ \hline 38 & 11 \\ 39 & 5 \\ 40 & 17 \\ 41 & 1 \\ 42 & 11 \\ 43 & 1 \\ \hline \end{tabular} \end{center} \vspace{0.5cm} Based on the values above and the ones already computed, we believe the following is true: \begin{conjecture} For $p>2$ prime, we have $\phi(p^k)=\frac{p^{k-1}+1}{2}$, and $\phi(2^l)=2^{l-2}+1$ for $l>2$. \end{conjecture} Computing $\phi(m)$ for $m<48$ gives the following: \vspace{.5cm} \begin{center} \begin{tikzpicture} \begin{axis}[xmin=1, xmax=47, ymin=0, ymax=18, xlabel=$m$, ylabel=$\phi(m)$,ytick={1,3,5,7,9,13,17},xtick={5,10,15,20,25,30,35,40,45}] \addplot[only marks] coordinates { (1,1)(2,1)(3,1)(4,1)(5,1)(6,3)(7,1)(8,3)(9,2)(10,3)(11,1)(12,5)(13,1)(14,3)(15,3)(16,5)(17,1)(18,7)(19,1)(20,5)(21,3)(22,7)(23,1)(24,9)(25,3)(26,7)(27,5)(28,7)(29,1)(30,9)(31,1)(32,9)(33,5)(34,5)(35,8)(36,13)(37,1)(38,11)(39,5)(40,17)(41,1)(42,11)(43,1)(44,17)(45,11)(46,11)(47,1) }; \draw[blue,dashed](6,3) -- (36,13) node[left,black] {$y=\frac{m+3}{3}$};; \end{axis} \end{tikzpicture} \end{center} \vspace{.5cm} For $m\geq 48$, computations become more and more time consuming, and specially if $m$ has a lot of prime powers in its prime decomposition. But the results obtained here give us a glimpse about the structure of $M_m$ and consequently, the Hodge conjecture in the case of Fermat varieties. \section*{Appendix: A code implementation of Shioda's approach}\label{appendix} The following SAGE code, for a fixed $m>1$, checks whether or not every indecomposable element is quasi-decomposable. If such condition is true then the Hodge conjecture holds for $X^n_m$. \begin{lstlisting} from itertools import product from fractions import gcd import sys import numpy as np #from sage.geometry.polyhedron.backend_normaliz import Polyhedron_normaliz def how_many_indec(m): p = MixedIntegerLinearProgram(base_ring=QQ) w = p.new_variable(integer=True, nonnegative=True) for k in range(1,m): if gcd(k,m) == 1: l=0 for i in range(1,m): l += ((i*k) l += -m*w[m-1] #print l p.add_constraint(l == 0) p.add_constraint(w[m-1] >= 1) indec = p.polyhedron(backend='normaliz').integral_points_generators()[0] indec_less = [ x for x in indec if x[-1]> 2] return len(indec_less) def poly_sol(m): p = MixedIntegerLinearProgram(base_ring=QQ) w = p.new_variable(integer=True, nonnegative=True) for k in range(1,m): if gcd(k,m) == 1: l=0 for i in range(1,m): l += ((i*k) l += -m*w[m-1] p.add_constraint(l == 0) p.add_constraint(w[m-1] >= 1) return p.polyhedron(backend='normaliz') def lengthOne(m): p = MixedIntegerLinearProgram(base_ring=QQ) w = p.new_variable(integer=True, nonnegative=True) for k in range(1,m): if gcd(k,m) == 1: l=0 for i in range(1,m): l += ((i*k) l += -m*w[m-1] p.add_constraint(l == 0) p.add_constraint(w[m-1] == 1) return p.polyhedron(backend='normaliz').integral_points() def get_indec(m): p = MixedIntegerLinearProgram(base_ring=QQ) w = p.new_variable(integer=True, nonnegative=True) #print 'x is for k in range(1,m): if gcd(k,m) == 1: l=0 for i in range(1,m): l += ((i*k) l += -m*w[m-1] #print l p.add_constraint(l == 0) p.add_constraint(w[m-1] >= 1) return p.polyhedron(backend='normaliz').integral_points_generators()[0] def get_standard(m,primes): result = [] for p in primes: d = m/p if p == 2: for i in range(1,m): if (p*i) temp = [i,(i+d) #print temp std = [] for e in range(1,m): std.append(temp.count(e)) std.append(2) if tuple(std) not in result: result.append(tuple(std)) else: for i in range(1,m): if (p*i) #print i temp = [0]*(p+1) for k in range(p): temp[k]= (i+k*d) temp[p]=(m-p*i) #print temp std = [] for e in range(1,m): std.append(temp.count(e)) std.append((p+1)/2) #print gcd(i,d) #print tuple(std) #print '--' if if tuple(std) not in result: result.append(tuple(std)) else: if tuple(std) not in result: result.append(tuple(2*x for x in std)) return result def reverse_to(y,m): r=[] n = len(y)-2 for e in range(1,m): r.append(y.count(e)) r = r + [n/2 + 1] return tuple(r) def convert_to_u(x,m): last = x[-1] n = 2*(last-1) r = [] for k in range(m-1): if x[k] != 0: r = r + [k+1]*x[k] return tuple(r) def get_points_length_less_m(x,m): p = MixedIntegerLinearProgram(base_ring=QQ) w = p.new_variable(integer=True, nonnegative=True) #print 'x is for k in range(1,m): if gcd(k,m) == 1: l=0 for i in range(1,m): l += ((i*k) l += -m*w[m-1] #print l p.add_constraint(l == 0) p.add_constraint(w[m-1] >= 1) p.add_constraint(w[m-1] <= x) return p.polyhedron(backend='normaliz').integral_points() arr = [] def get_indec_less(m,prm): p = poly_sol(m) print 'getting indecomposable elements for |m= indec = p.integral_points_generators()[0] #length_one = [ x for x in indec if x[-1]==1] #print 'there are standards = [list(x) for x in get_standard(m,prm)] print 'there are indec_less = [ x for x in indec if x[-1]>= 3 and list(x) not in standards] print 'there are return indec_less def prime_factors(n): i = 2 factors = [] while i * i <= n: if n i += 1 else: n //= i if i not in factors: factors.append(i) if n > 1: if n not in factors: factors.append(n) #print('finished computing primes:',factors) return factors m = 21 primes = prime_factors(m) quasi = [] dict_ = {} indec_less = get_indec_less(m,primes) lasts_ =[] length_one = lengthOne(m) for el in indec_less: last = el[-1] print '---' print el print 'position: count=0 if last not in dict_: possible = get_points_length_less_m(last,m) dict_[last] = possible for el2,el3,el4 in product(length_one,possible,possible): if el + el2 == el3 + el4 and (el != el3 and el != el4): print 'I am quasi' quasi.append(el) break samples=len(possible)*len(possible)*len(length_one) count+=1 sys.stdout.write("Progress: sys.stdout.flush() if el not in quasi: print 'This element is not quasi' print 'The HC CAN NOT be predicted for degree break else: for el2,el3,el4 in product(length_one,dict_[last],dict_[last]): if el + el2 == el3 + el4 and (el != el3 and el != el4): print 'I am quasi' quasi.append(el) break samples=len(dict_[last])*len(dict_[last])*len(length_one) count+=1 sys.stdout.write("Progress: sys.stdout.flush() if el not in quasi: print 'This element is not quasi' print 'The HC CAN NOT be predicted for degree break print 'The HC is TRUE for degree \end{lstlisting} \bibliographystyle{amsplain}
\section{Introduction} Galaxy clusters are the most massive bound objects in the Universe. The more massive, $10^{14} - 10^{15}$ M$_{\odot}$, the more rare. As a trace of the underlying cosmic web, they can be used as an independent probe of the expansion rate of the Universe and growth of structure. Well measured populations can place constraints on cosmological models based on their predictions \citep[e.g.][]{boh04,vik09,man10,wei13}. Clusters are X-ray luminous sources due to the large amount of hot gas trapped in their gravitational potential wells \citep{jon99}. The extended nature of the sources make them distinct from most other extra-galactic sources, allowing more ease in performing surveys of high volume and completeness. Additionally, X-ray properties of clusters scale with the mass of the system \citep{kai86}, making these types of surveys even more important for cosmological studies. The evolution of the halo mass function is an important cosmological tool. Clusters are best detected from the X-rays emitted by their hot diffuse gas. The first major X-ray cluster survey came with the ROSAT All Sky Survey \citep{ebe00,ike02,rei02,sch03}, mapping the brightest galaxy clusters outside of the Galactic Plane. Subsequent surveys \citep{ros98,rom00,burk03,bure07} and other generations of X-ray telescopes have contributed to cluster cosmology \citep{pac06,vik09,man10,fin10,cle14,pie16}, though not on an all-sky scale. The next advance in X-ray astronomy is the newly launched extended ROentgen Survey with an Imaging Telescope Array (eROSITA). Performing a new all-sky survey in the soft X-ray band, the improved resolution and sensitivity will lead to $\sim$100\,000 galaxy cluster detections ($\sim3 \times 10^{-14}$ erg s$^{-1}$ cm$^{-2}$ flux limit at 0.5-2 keV) out to a redshift of $\sim$1 \citep{mer12,bor14}. Though X-rays are most efficient for the purpose of cluster detection and mass proxy, the understanding of their redshift to high accuracy is lacking. This highlights the importance of optical follow-ups. The Sloan Digital Sky Survey (SDSS) has a played a critical role in optical confirmation of galaxy clusters. Measuring the red-sequence of galaxy cluster member galaxies using multi-waveband optical imaging \citep{gla00,ryk14} provides a useful tool for identifying the optical counterparts of clusters and characterising their redshifts. For the ultimate purpose of constraining cosmological models, spectroscopic redshifts are needed. The extra precision on redshift allows for the ability to disentangle projection effects of line-of-sight alignments, infalling substructure, and other correlated structure from the underlying dark matter halo concentration. The next important step is the difficult task of obtaining galaxy spectra, which requires deep imaging for targeting and longer spectroscopic integration times. The SPectroscopic IDentification of eROSITA Sources (SPIDERS) cluster program within SDSS-IV \citep{bla17} was designed to carry out the necessary follow-up for the next generation of all-sky X-ray surveys. The survey itself fully relies on the use of the Baryon Oscillation Spectroscopic Survey (BOSS) spectrograph \citep{sme13} mounted on the SDSS-2.5m telescope at Apache Point Observatory \citep{gun06}. Our observing strategy is shared with the cosmology project eBOSS (extended Baryon OScillation Survey, \citet{daw16}) in order to maximize the ability to obtain large amounts of spectroscopic redshifts. SPIDERS targets are few in comparison to eBOSS, but are given the highest priority when assigning fibers for observing. An initial study of the first 300 deg$^2$ of the survey were provided by \citet{cle16}. A small sample of galaxy clusters along with the full target list were published in the form of a Value Added Catalogue\footnote{\texttt{https://www.sdss.org/dr14/data\_access/value-added-catalogs/?vac\_id=the-spiders-clusters-demonstration-sample-catalogue}} (VAC). This study demonstrated the survey's feasibility and usefulness of the data set. Additional studies have been preformed using an updated VAC catalogue\footnote{\texttt{https://www.sdss.org/dr14/data\_access/value-added-catalogs/?vac\_id=spiders-x-ray-galaxy-cluster-catalogue-for-dr14}} as a part of Data Release 14 (DR14). This has been used for topics including characterising scaling relations with cluster richness between both mass and X-ray luminosity \citep{cap19,cap20} and properties of brightest cluster galaxies \citep{fur18,erf19}. The COnstraining Dark Energy with X-ray (CODEX) clusters survey \citep{fin20} describes the X-ray source catalogue that forms the basis for the SPIDERS follow-up program. They present the advanced wavelet filtering techniques used on X-ray images and provides the modeling of the sample selection. A companion paper to this work \citep[Clerc et al. accepted][]{} describes in detail the final status of the survey including: overall characteristics, final targeting strategies, achieved completeness and spectral quality. Cosmological applications of the galaxy cluster sample are explored. This paper describes the entire process for the construction of the final SPIDERS galaxy cluster catalogue as part of DR16 \citep{ahu20}. It encompasses all data obtained throughout the entire SDSS-IV program, including the original pilot sample of \citet{cle16}. Every aspect of the process is detailed from target selection, manual inspection of the spectroscopic members and analysis of the full data set. We present an update to the first results from the SPIDERS cluster program. The outline of this paper is as follows. In Section~\ref{sec:2} we describe the SPIDERS sample and how targets were selected for the survey. In Section~\ref{sec:3} we describe our method of visual inspection for validating the spectroscopic redshift of the cluster. In Section~\ref{sec:4} we present the final results of the validation effort. Section~\ref{sec:5} details the construction of what goes into the final catalogue. Section~\ref{sec:6} is the full description of the value added catalogue with highlights of its scientific importance. Finally, in Section~\ref{sec:7} we present our initial cosmological constraints based on our velocity dispersion measurements. Unless otherwise stated, the cosmological model used in this paper is a flat $\Lambda$ Cold Dark Matter with $\Omega_{\rm{m}} = 0.3$ and $H_{\rm{o}}= 70$ km s$^{-1}$ Mpc$^{-1}$. Magnitudes are expressed in their native SDSS (AB) system \citep{fuk96}. \section{The SPIDERS Cluster Sample} \label{sec:2} Cluster candidates for SPIDERS have been drawn from a subset of CODEX \citep{fin20}. CODEX is an X-ray selected catalogue of clusters reaching fluxes of 10$^{-13}$ ergs s$^{-1}$ cm$^{-2}$. CODEX uses data from the ROSAT All Sky survey (RASS), specifically in the $\sim$10,000 square degree BOSS imaging footprint. A comprehensive description of source detection is presented in \citet{fin20}. A total of 10,415 CODEX entries were considered for follow-up, of which 4,114 made it into the final area surveyed by SPIDERS. Target galaxies for spectroscopic follow-up are identified using the red-sequence technique. For each X-ray source detection, redMaPPer version 5.2 \citep{ryk14} was run at that position on the sky using the SDSS imaging data of Data Release 8 (DR8). The calibration of the red-sequence is carried out using existing SDSS spectroscopy from DR9 and only needs a small set of training clusters for calibration. The full details of this procedure is presented in \citet{ryk14}. Given a new red-sequence model, cluster finding begins by looking for galaxy members in a 0.7 Mpc radius of the X-ray centre. The algorithm proceeds to iterate over each guess for the redshift. An optimized richness estimator \citep{roz09,ryk12} uses colour offset from the red-sequence, $i$-band magnitude, and projected distance from the cluster centre to determine the probability of a galaxy being a member, ultimately producing a richness and it's corresponding likelihood. Richness is defined as the sum of the probabilities, with corrections for missing area and photometric depth (see \citet{ryk14} for full details). If more than 3 members are detected, the highest probability members are simultaneously fit to the red-sequence model to find the new cluster photometric redshift. This process iterates until convergence on redshift ($|z_{i+1} - z_{i}| < 0.0002$) is achieved. The candidate cluster with the highest likelihood at the end of this procedure is selected as the optical counterpart. Due to the uncertainty associated with the position of RASS detections, the entire algorithm is run again allowing for the centre to vary within 3 arcmin. This new red-sequence provides an alternate cluster centre and the final estimate of the cluster's photometric redshift ($z_{\rm{\lambda}}$) and richness ($\lambda_{\rm{OPT}}$) that are entered into the SPIDERS cluster sample. We refer to this as the `optical detection'. The reproducible process of associating initial red-sequence candidates to spectroscopic fibres is referred to as 'targeting'. It involves all sub-components of the eBOSS programme. It is designed to optimize efficiency metrics defined for each survey; in the case of SPIDERS, the figure of merit is spectroscopic completeness. The targeting algorithm uses priority flags associated to each targets. We use the galaxy membership probability as the main factor in determining SPIDERS clusters targeting priority. Before ranking, galaxies that we do not want to be targeted are filtered out. All galaxies associated with clusters of richness less than 10 are removed from the target list. All galaxies with a probability less than 5 percent are also removed. Members already with a spectroscopic redshift from past observations are matched and removed. For the remaining galaxies, only members with a fiber i-band magnitude between 17.0 and 21.2 will be considered for targeting to maximize detection efficiency. These filtering steps led from an initial list of 158,368 CODEX red-sequence galaxies to a pool of 44,367 galaxies submitted for follow-up. This defines the full SPIDERS member candidate sample. The final target ranking is determined, in general, as a function of cluster richness and member probability. Cluster richness is divided into bins of: $\lambda_{\rm{OPT}} > 40$, $30 < \lambda_{\rm{OPT}} < 40$, $20 < \lambda_{\rm{OPT}} < 30$, $10 < \lambda_{\rm{OPT}} < 20$. Each cluster's red-sequence is ranked from highest to lowest probability. The three top ranked members of all clusters are assigned the same priority flag of 1, 2, and 3, regardless of richness. From rank 4 and up, priority is given to galaxies in higher richness bins. After this ranking, a subsequent filtering occurs due to physical conditions during observing: sky fiber density is restricted to $\sim$10/deg$^2$ and fiber collisions at a radius of 62'' within an SDSS plate. Finally, 30,236 galaxies were selected for follow-up within the DR16 sky area. The full details and visualisation of this scheme are found in \citet{cle16} and more recent updates reported in \citet{cle20}. \section{Spectroscopic Validation} \label{sec:3} Trained astronomers are required to verify the existence of a cluster in order to disentangle their complex nature \citep{guz09, ada11}. An automatic membership assignment algorithm was developed to ease the validation efforts of such a large sample \citep{cle16}. This was implemented as the first step before any visual inspection takes place. Our approach is broad in order to account for varying mass throughout the sample. Each cluster with red-sequence members associated with a spectroscopic redshift are considered individually. An initial redshift is computed using the bi-weight average \citep[see,][]{bee90} of all observed members, $N_{\rm{zspec,0}}$. All members are rejected with velocities offset by greater then 5000 km s$^{-1}$. A $3\sigma$ clipping procedure is run on the remaining members, $N_{\rm{zspec,1}}$, to converge on a final preliminary redshift and velocity dispersion. The procedure starts with recomputing the bi-weight average, $z$, of the remaining members. The proper velocity for each galaxy is estimated by $v_{\rm{prop}} = c(z_i - z) / (1 + z)$ \citep{dan80}, where $z_i$ is the redshift of the individual galaxy. Velocity dispersion is then calculated depending on the number of spectroscopic members. For cases with $N_{\rm{zspec,1}} \geq 15$, velocity dispersion is calculated as the square root of the bi-weight variance of the member galaxies' proper velocities. Otherwise, the gapper method is used for cases with a lower spectroscopic sampling rate, as it is known to give more robust results \citep{bee90}. The entire procedure is allowed to iterate until convergence or is stopped after 10 steps. Figure~\ref{fig:automatic_result} highlights two cases, one where the automatic membership assignment works successfully and one where it fails. The upper panel of this figure is the typical example where no interference is required during visual inspection. Little time is needed in a case like this when the cluster is well sampled and no signs of outliers are present. The lower panel shows where the automatic assignment has trouble when line-of-sight contamination is strong. A combination of studying the phase space diagrams, 2D projected maps, velocity histograms, optical images, and X-ray detection information is needed to understand and recalculate membership. The details of what is available during visual inspection is described below. \begin{figure} \centering \includegraphics[width=\columnwidth]{automatic_success} \includegraphics[width=\columnwidth]{automatic_failure} \caption{Automatic analysis of redshift (velocities) for two different clusters. Plotted are the difference between spectroscopic and cluster photometric redshift versus RedMaPPer membership probability. Points highlighted in purple were selected as members by the automatic algorithm and the blue line is the cluster redshift determined by that selection. The dash-dot and dotted lines are the photometric redshift and it's associated error. Upper panel: This example shows a cluster where the automatic assignment has no problem identifying based solely on the $3\sigma$ clipping procedure. Lower panel: Another example where automatic membership assignment fails due to confusion with possible nearby structure. The grey points are galaxies not selected as members by the automatic algorithm. These figures are representative of diagnostic plots used during inspection.} \label{fig:automatic_result} \end{figure} \begin{figure*} \centering \includegraphics[width=\textwidth]{screening_interface.pdf} \caption{Screening Web Interface. Various phase-space plots are used to help inspectors make their decision whether or not to validate a cluster. {/bf Red-sequence galaxies with a spectroscopic redshift are represented in the uppermost panels, as a function of their redshift offset to the cluster photometric redshift (on the left) of their position on sky (on the right).} Members are colour coded by negative (blue) or positive (red) proper velocity in the middle-left and middle-right panel, showing respectively the velocity-distance distribution and sky distribution of current selected members. The lower left histogram shows the redshift distribution of all red-sequence galaxies. The lower right histogram stands for current selected members only. Tools for manually assigning members for recalculating redshift and velocity dispersion are also available from the command panels on the left-hand side of the interface.} \label{fig:screening} \end{figure*} Figure~\ref{fig:screening} shows a typical snapshot of the screening web interface used by the visual inspectors. The six panels within the interface are as follow: the top-left panel is the difference between spectroscopic redshift and photometric redshift plotted against the natural log of the redMaPPer membership probability for all observed red-sequence members. Red-sequence galaxies selected as cluster members initially by the algorithm (or modified later by the user) are highlighted in purple, otherwise they would be shown as grey points. The top-right panel is the 2D projected sky positions of all observed red-sequence members, the middle-left panel is the velocity offset to the computed cluster redshift plotted against the projected distance from the cluster center in Mpc for only the selected cluster members, the middle-right panel is the 2D projected sky positions of only the selected members with the physical distance from the cluster center highlighted in 0.5 Mpc intervals, the bottom-left panel is the distribution of red-sequence member redshifts, and the bottom-right panel is the velocity offset distribution of only the selected cluster members. Catalogue information is available to the inspectors in the upper tabs of the interface. They contain, most importantly for inspection, the photometric redshift, the richness estimate, and how many red-sequence members have spectroscopy. The tabs on the left side allow the inspectors to access more information about the cluster and utilize tools to aid in the manual selection of members in cases where the automatic algorithm fails. During validation, inspectors have access to all the individual spectra, direct links to the cluster location in legacy sky viewer \citep{dey19}, and visual displays of all SDSS related spectroscopy in the field of view together with all red-sequence members. Different tools allow the inspector to manually select or de-select single or groups of members. Redshift and velocity dispersion is always recalculated using the same routines used by the automatic algorithm. During validation, no requirements were given to the inspectors in order to ensure independence between visual inspections. Loose guidelines were discussed amongst inspectors, mainly concerning available literature on previous work. Studies of nearby systems \citep{rin13, mun14} and scaling relations based on richness \citep{sim17,mur18} where important for understanding the make-up of galaxy clusters. The former benefit from galaxy phase-space diagrams sampled by factors several tens of hundreds denser than typical SPIDERS clusters; these clusters were considered are high signal-to-noise analogs. The latter provide a support for excluding configurations incompatible with the expected scaling of cluster observables with total mass (e.g.~low-richness clusters should have small velocity dispersions and conversely). To further illustrate the validation procedure, we will highlight a few examples of common scenarios encountered during the process. A minimum of three members are required to converge on a final redshift solution. These members should lie close to each other in the velocity-distance diagram. Explicit formulations of exact threshold criteria was avoided and everything was left to inspectors as much as possible; such criteria emerged in the later stage of reconciliation among inspectors (as described below). In Figure~\ref{fig:3mem}, the upper panels shows a case where three members are sufficient to validate a redshift. In the velocity-distance phase space plot, all three members are at similar velocities, and are also clustered in 1D distance and in 2D sky projection. Coinciding with an X-ray detection as well gives us confidence this is more than a chance pairing. In the lower panels is a case where three observations is not sufficient to validate a redshift. One galaxy is offset in velocity from the other two members by more than 6000 km s$^{-1}$, while these same two members are separated on the sky by over a megaparsec. More observations would be needed to determine which of these three, if any, are a part of a cluster at this location. \begin{figure*} \centering \includegraphics[width=\textwidth]{validated_3mem} \includegraphics[width=\textwidth]{unvalidated_3mem} \caption{Illustration of two clusters with only 3 candidate member galaxies. A blue-to-red colour gradient is used to highlight the negative-to-positive velocity offset from the centre. Upper panels: Velocity offset and distance phase space plot with the 2D sky projecting from the screening web tool. This example illustrates the case when the minimum number of red-sequence members are able to validate the cluster redshift. Lower panels: Same plots as above, but for a case where validation cannot be confirmed, as not even two of galaxies appear to likely be associated with one another. Solid and dashed lines are the same as shown in Figure~\ref{fig:automatic_result}.} \label{fig:3mem} \end{figure*} An example of a cluster with 10 members, the median value after validation, is illustrated in the upper panel of Figure~\ref{fig:ave_clus}. Universally these are agreed upon that they are in fact clusters, but on an inspector by inspector basis, there may not be agreement on the exact membership make up. These differences are mediated in the reconciliation round of validation. For comparison, the bottom panel of Figure~\ref{fig:ave_clus} shows the more rare instance of a well sampled system where it is easier to find a consensus, since agreement on clusters status and membership list are reached by all. The most time consuming aspect of validation belongs to the targets where more than one ``component'' is apparent along the line-of-sight. This affects $\sim 8\%$ of the total validated sample. We define a component as a grouping of 3 or more galaxies associated with an X-ray source. There is no limit on how many component can be classified. Upon the conclusion of the validation process, inspectors agreed on three main scenarios that were encountered: the redMaPPer redshift ($z_{\rm{\lambda}}$) corresponds to the main component, corresponds to a secondary component, or does not correspond to any component. The first is the most common case we find representing approximately 50\% of all multi-component systems. Multiple components can be apparent in the foreground or background, but the majority of observed galaxies are consistent with $z_{\rm{\lambda}}$, suggesting the performance of redMaPPer is mostly not affected by the presence of smaller systems, though the estimated richness has been overestimated by a small factor. The rarest case ($\sim 10\%$) is the second example. A small grouping of galaxies is consistent with $z_{\rm{\lambda}}$, but a larger grouping is found in the foreground or background, outside the photometric errors. Small components are defined to have less than half the number of members compared to the main component. We find the median red-sequence width before membership cleaning, $\Delta z$, to be a factor of 2 larger than the errors on $z_{\rm{\lambda}}$ for SPIDERS clusters. This could be the possible explanation for why this offset of the main component occurs. The last case describes the rest of the systems, for which neither of the component's redshift are consistent with $z_{\rm{\lambda}}$, but the richness estimate is still accurate, or multiple components are confusing redMaPPer entirely. Figure~\ref{fig:split_clus} presents an example of two equal components, split in between by $z_{\rm{\lambda}}$. We find that when two, likely equal mass clusters are in near proximity to each other, redMaPPer interprets this as one cluster located between the real clusters with a richness overestimated by at least a factor of two. We discuss in more detail how we define and report the main component of clusters below in section~\ref{sec:5}. \begin{figure} \centering \includegraphics*[width=\columnwidth]{average_cluster} \includegraphics*[width=\columnwidth]{40members} \caption{Illustration of clusters with intermediate and high number of candidate member galaxies. The points are highlighted using the same colour scheme of Figure~\ref{fig:3mem}. Upper panel: Velocity offset and distance phase space plot for a cluster with the number of members equal to the median. Lower panel: The same phase space plot for a rare, well sampled system. Solid and dashed lines are the same as shown in Figure~\ref{fig:automatic_result}.} \label{fig:ave_clus} \end{figure} The final stage of validation is the reconciliation between the decisions from all inspectors. Individual evaluations are collected in the form of digital pre-formatted files at the end of an evaluation campaign. A moderator checks the usability of the submitted results and for each cluster candidate compares the output of all inspectors. This consists of a two-step process. The first step involves addressing the agreement between evaluations. It requires that a majority emerges among inspectors concerning the validation status of the cluster (either validated or unvalidated) and that redshift values agree within their 95\% uncertainty ranges. An automated algorithm attempts to find disjunct groups of redshift values close to each other. If a group emerges gathering a majority of inspections (or if all evaluations belong to one single group), the redshifts are said to agree with each other. In case of multiple component splits, the moderator is prompted for an explicit agreement. All candidates that do not reach an agreement are put back to the pool of inspections in order to collect more votes. The second step involves building a conciliated catalogue based on the agreed upon evaluations. If a majority of inspectors validated a candidate, the corresponding membership flags are averaged (column \texttt{SCREEN\_NMEMBERS\_W}) and so are the cluster systemic redshift, velocity dispersion and uncertainties. A redshift spread is computed as the standard deviation of the inspectors' cluster redshift values, reflecting the amplitude of the agreement between inspectors. It is then added in quadrature to the cluster redshift uncertainty. In cases of multiple components, a manual association between components is made and averages are performed sequentially for each component. All unvalidated evaluations are discarded. Candidates collecting a majority of unvalidated statuses are flagged as such. \begin{figure} \centering \includegraphics*[width=\columnwidth]{split} \caption{Redshift versus distance from cluster centre. The solid line is the photometric redshift from redMaPPer and the dashed lines are the associated uncertainties on that estimation. Two components are apparently at a lower and higher redshift compared to the photometric estimate are confusing the red-sequence finder algorithm. They are likely similar in mass with a detection of 9 members in the lower redshift component and 13 members in the higher redshift component. This results in an overestimation of richness by approximately a factor of two.} \label{fig:split_clus} \end{figure} \begin{table*} \centering \begin{tabular*}{\textwidth}{c@{\extracolsep{\fill}}cccccr} \hline \multicolumn{1}{l}{ } & \multicolumn{1}{c}{Inspection} & \multicolumn{1}{c}{ } & \multicolumn{1}{c}{ } & \multicolumn{1}{c}{Validated } & \multicolumn{1}{c}{Unique} & \multicolumn{1}{r}{ } \\ \multicolumn{1}{l}{Run} & \multicolumn{1}{c}{round} & \multicolumn{1}{c}{Selection} & \multicolumn{1}{c}{Candidates} & \multicolumn{1}{c}{components} & \multicolumn{1}{c}{components} & \multicolumn{1}{r}{Inspectors} \\ \hline 2016-07-04 & Round-1 & $\mathrm{\lambda}_\text{OPT}$ $>$ 30 & 573 & 520 & 478 & 8 \\ 2016-07-04 & Round-2 & 20 $<$ $\mathrm{\lambda}_\text{OPT}$ $<$ 30 & 344 & 246 & 230 & 8 \\ 2016-07-04 & Round-3 & 10 $<$ $\mathrm{\lambda}_\text{OPT}$ $<$ 20 & 618 & 396 & 344 & 2 \\ 2018-04-27 & Round-1 & $\mathrm{\lambda}_\text{OPT}$ $>$ 30 & 434 & 379 & 365 & 6 \\ 2018-04-27 & Round-2 & 20 $<$ $\mathrm{\lambda}_\text{OPT}$ $<$ 30 & 216 & 166 & 145 & 4 \\ 2018-04-27 & Round-3 & 10 $<$ $\mathrm{\lambda}_\text{OPT}$ $<$ 20 & 432 & 281 & 264 & 5 \\ 2018-04-27 & Round-4 & $\mathrm{\lambda}_\text{OPT}$ $>$ 10, incomplete (SEQUELS) & 193 & 175 & 159 & 2 \\ 2018-12-04 & Round-1 & $\mathrm{\lambda}_\text{OPT}$ $>$ 10, w/ revised redshift & 383 & 299 & 276 & 4 \\ 2019-03-22 & Round-1 & $\mathrm{\lambda}_\text{OPT}$ $>$ 10 & 818 & 616 & 571 & 3 \\ 2019-03-22 & Round-2 & $\mathrm{\lambda}_\text{OPT}$ $>$ 10, remaining partially observed & 140 & 101 & 87 & 3 \\ 2019-03-22 & Round-3 & re-inspection required & 14 & 14 & 14 & 2 \\ \end{tabular*} \caption{Statistics for each round during the almost three year validation effort. Subsequent runs are for the inspection of completed observations of candidates not covered in earlier runs, unless otherwise noted in the text. } \label{tab:validation_results} \end{table*} \section{Validation results} \label{sec:4} Over the course of the SDSS-IV survey, periodic validation rounds took place as new data became available. Upon assembly of a new ``run'', a call for inspectors was announced to the entire collaboration. A minimum number of groups consisting of 50 targets each were assigned to insure that at least 2 votes are recorded in every case, with no restriction on the maximum number of groups an inspector wants to validate. Below is the summary for each sample making up the final catalogue. The name of the run signifies the cut off date for which data was included. General details for each run are found in Table~\ref{tab:validation_results}. \subsection{Run 2016-07-04} Just for the purpose of breaking up the work load into more equal parts, each round was defined by a richness cut. Round one consisted of all observed candidates, marked as complete, with optical richness ($\mathrm{\lambda}_\text{OPT}$) greater than 30. Candidates marked as complete are systems with as many observations as their allocated amount of spectroscopic fibres. Except for marginal changes due to reprocessing of the data, their observational status is therefore definitive in the context of the project. A total of 573 candidates were inspected in this round. This round makes up the entirety of the DR14 catalogue release \citep{dr14}. For the second round, only completed candidates with the cut 20 $<$ $\mathrm{\lambda}_\text{OPT}$ $<$ 30 were considered. This amounted to 344 new inspections. For the final round, the remaining 618 candidates with 10 $<$ $\mathrm{\lambda}_\text{OPT}$ $<$ 20 were inspected. The two available inspectors for this round disagreed on a total of 21 candidates. Due to there being no way to break the disagreements, two additional inspectors were added during the reconciliation round to find a consensus for these candidates. A final total of 1052 validated components were found. The full breakdown for each round is presented in Table~\ref{tab:validation_results}. \subsection{Run 2018-04-27} This run consists of the next 22 months of observations, all were new to the inspectors. The first three rounds were broken up into the same richness bins as the previous run. Round 1 consisted of inspections of 434 candidates, round 2 consisted of inspections of 216 candidates, and round 3 consisted of inspections of 432 candidates. The 4th round was initiated as a special round to catch up on missing candidates. It was determined that candidates labeled incomplete in the original SEQUELS pilot area \citep{cle16} no longer had the potential to be re-observed due to changing survey strategy and targeting. Every candidate in this area was included for inspection, totaling 193. Only two inspectors were available for this round again. A third inspector voted to break the disagreement for the 4 candidates with no consensus. A final total of 1001 validated components were found. Table~\ref{tab:validation_results} contains more details for each round within this run. \subsection{Run 2018-12-04} A third run was initiated in order to reassess the effect of major changes to the spectra processing pipeline \citep{ahu20}. Included in this run are all completed candidates observed over the previous 7 months and all candidates from the previous two runs where 1 or more galaxies show a different redshift, redshift error, or warning flag. Round 1 consisted of a total of 383 candidates. Among them, 200 were new inspections and 183 were reanalyses of previous systems. Among clusters validated in the previous runs, 52 were validated again and one was unvalidated thanks to one galaxy redshift change in its red-sequence and a more careful examination. Among the clusters unvalidated in previous run, 88 became validated. A final total of 299 validated components were found. See Table~\ref{tab:validation_results} for more details. \subsection{Run 2019-03-22} The final run took place after the completion of the SPIDERS survey. Round 1 consisted of the remaining 818 candidates with completed observations. Round 2 consisted of the remaining 140 candidates that had partially completed observations. About 720 were new inspections and little less than 250 were reanalyses of systems inspected in earlier runs. Among the previously validated systems, 98 were validated again, none were unvalidated. Among the previously unvalidated systems, 72 became validated. A final total of 717 validated components were found. An additional third round was needed during the construction of the final catalogue for re-inspecting multi-component clusters that did not fall into any of our classification categories. The details of this can be found in section~\ref{sec:5}. Additional details of the rounds are presented in Table~\ref{tab:validation_results}. \subsection{Inspection statistics} The mean number of inspectors per cluster candidate in this sample was approximately 3. Over the full sample of 2740 validated clusters, there are only 71 instances where a full consensus was not reached between inspectors. For spectroscopic redshift determination, there are 622 instances where there was not exact agreement. The mean spread for these instances is 0.00049 (147 km s$^{-1}$), with the maximum disagreement being 0.0055 (1\,650 km s$^{-1}$). Comparing to the automatic membership assignment, there are 955 instances where the redshift was changed after inspection. Within this sample, there are 228 cases where inspectors additionally broke the candidates up into 2, 3, or 4 separate components. The chances for a candidate to be validated were highly dependent on redshift, richness, and number of spectra obtained. Figure~\ref{fig:validation_fraction} shows the optical richness versus photometric redshift for the all validated and unvalidated clusters from the entire program. There is very little dependence below a redshift of 0.3. Out to a redshift of 0.4 though, most clusters below richness 20 are unvalidated. This trend increases until a redshift of 0.6 where almost all clusters are unvalidated except the most extreme objects ($\mathrm{\lambda}_\text{OPT}$ $>$ 100). This follows approximately $15 \times \zeta(z_{\rm{\lambda}})$, {where \bf $\zeta=e^{5.5(z-0.35)}-0.12$ (at $z>0.37$)} is the redshift-dependent scaling adopted by redMaPPer to account for galaxies brighter than the $0.2L^*$ limit, but are fainter than can be detected in SDSS \citep[][their Fig.~19]{ryk14}. This empirical delineation is materialized with the red dashed line in Fig.~\ref{fig:validation_fraction}; it reflects that about fifteen $L>0.2L^*$ galaxies must appear in SDSS images in order for a cluster to be validated. The red line has been obtained by setting a requirement on targeting at least 8 of the cluster member candidates, as with an average success rate of measuring the redshift in accordance with cluster redshift of 0.7, which leads to at least 5 confirmed member galaxies. Figure~\ref{fig:validation_nhasz} illustrates the targeting efficiency. We present the ratio of observed galaxies to all red-sequence member candidates versus the cluster photometric redshift, where a minimum of 9 spectra were available per cluster. Below a redshift of 0.2, we are able to reach a maximum 1:1 ratio. This maximum ratio drops off to 1:2 out to redshift 0.3, and further to 1:3 out to redshift 0.4. Beyond that, no trend is discernible. The red points represent all clusters that were unvalidated with a minimum of 9 spectra obtained. We achieved a $>$99\% validation rate across the entire sample at this level. Considering only clusters at $z<0.3$, the validation rate improves to $~$99\% when at least 5 spectra are obtained. \begin{figure} \centering \includegraphics[width=\columnwidth]{valunval_specsel.pdf} \caption{The validation results of all inspection rounds are plotted showing richness versus photometric redshift. Validated clusters are shown in black, unvalidated candidates are shown in yellow. Only the highest richness (mass) clusters are validated with increasing redshift. The dashed red line roughly indicates the transition between mostly validated and mostly unvalidated, where $\zeta(z_{\rm{\lambda}})$ is the redshift dependent photometric depth correction factor for richness estimates.} \label{fig:validation_fraction} \end{figure} \begin{figure} \centering \includegraphics[width=\columnwidth]{nhasz} \caption{The ratio of observed members (i.e., spectroscopic redshift was obtained) to total red-sequence members for each cluster candidate (where $N_{\rm{observed}} \geq 9$) is plotted against the photometric redshift. Validated points are shown in grey and unvalidated points are shown in red. Over this entire sub-sample, less than 1\% of candidates are unvalidated. At a redshift of 0.4 (black dashed line), the maximum observing efficiency appears to flatten out at an approximate 1:3 ratio.} \label{fig:validation_nhasz} \end{figure} \section{Catalogue Construction} \label{sec:5} Basic X-ray properties for every cluster that has been validated have been calculated. We report the fluxes corrected for Galactic absorption. In performing this calculation, we assume a constant spectral shape of the source, and perform a correction for this assumption as a part of the K-correction, which accounts for the effect of the source spectral shape (defined by temperature of the emission and the redshift). We use the XXL $L-T$ \citep{giles} relation and $M-T$ \citep{lieu} relation and a flat $\Omega_m=0.3$ $\Lambda$CDM cosmology in the calculations of $L_X$, as those agree with the CODEX weak lensing work of \citet{kettula15}. The fluxes are measured within the apertures defined to contain a significant flux measurement, with respect to the background, but constrained to be within $12^\prime$. As these do not necessarily cover the whole cluster, we extrapolate the measurement using the expected surface brightness profiles of clusters. The procedure is described in \cite{finoguenov07} and has to be applied iteratively, allowing the cluster size to change with iterations, based on the obtained $L_X$. For nearby clusters with large corrections factors (greater than 2), we re-extracted fluxes using much larger apertures, extending to $48^\prime$, confirming the results. Further filtering must be carried out before merging the separate validations runs into the final catalogue. The first step is to classify all clusters that have been validated with multiple components in the line of sight. Inspectors are tasked with ordering the components from most to least significant. The most significant component is considered the main gravitating halo along the line of sight, and this is defined as the component with the most spectroscopic members associated with it. For instances where membership is equal between components, the component that is located at a lower redshift is considered the most significant. Inspectors may also choose to ``re-merge'' components if they believe the cluster is experiencing a near 1:1 merger, as there is no clear indication of which part is the most significant. This results mainly when components are within 4000 km/s of each other. Round 3 of run 2019-03-22 was the re-inspection of clusters deemed to be likely experiencing this type of merger. For these cases, the redshift of gravitating halo is accurate, but the velocity dispersion reported is likely unreliable as a mass proxy. Once the classification is complete, agreement is required by all inspectors before a cluster is entered into the final catalogue. Where disagreements exist still, further discussion takes place until a unanimous decision is reached. Only the main component is entered into the catalogue. A flag in the final catalogue, $\rm{NCOMPONENT}$, indicates the number of visually identified components, or $-1$ for clusters identified as mergers. The next step is to concatenate the separate catalogues while simultaneously removing duplicate clusters. Due to some clusters being inspected multiple times throughout the validation process, we took care to choose the newest evaluation as the one to enter our catalogue. Following this, duplicates with unique IDs are also filtered out. As the CODEX catalogue is compiled from two separate X-ray detection and RedMaPPer runs, a few rare instances occur where candidates are entered twice into the target list under different IDs. These are determined by matching clusters based on RA, Dec, and spectroscopic redshift. The few cases are checked visually as to whether they are sharing the same member galaxies. These are removed, keeping the ID from the second RedMapper run (IDs starting with 2). Next, we attempted to remove all clusters still remaining that were validated under unique IDs, but are still likely to be the same structure being counted twice. Clusters are matched with any other cluster in the sample that is within 5 times R$_{200}$ and $0.03(1+z)$ in redshift ($<9000$ km s$^{-1}$) of itself. In Figure~\ref{fig:nearby}, we plot the absolute velocity offset against the projected sky separation for each pair of clusters. It is likely that some these clusters are in some phase of merging. Most pairs are found to be separated within 10 to 100 arcminutes, though a small number are within a few arcminutes of each other. With centres being based on RASS detections, it is not possible to distinguish the difference between X-ray sources with less than 2 arc minute separation. Upon visually inspecting pairs within 5 arcminutes of each other, we discover most pairs have inter-mixed galaxy members. In these cases, we enter the pair into the final catalogue as a single object. For the final step, we make one last check for mistakenly unvalidated candidates. Candidates that appear to be outliers from the rest of the sample (see the red points in Figure~\ref{fig:validation_nhasz}) are visually inspected one last time. We collaboratively agree that the data available is not sufficient enough to determine a cluster redshift. This finalises the catalogue. \begin{figure} \centering \includegraphics[width=\columnwidth]{nearby_clusters} \caption{Absolute velocity offset versus projected sky separation between cluster pairs before cleaning the sample. The pairs to the left of the vertical dashed line were visually inspected individually for common galaxy members. Some clusters are represented multiple times due to proximity of more than one other cluster.} \label{fig:nearby} \end{figure} \section{The Catalogue} \label{sec:6} The full SPIDERS cluster catalogue of optical properties, redshifts, dynamical properties, and X-ray properties can be found online\footnote{\texttt{https://www.sdss.org/dr16/data\_access/value-added-catalogs/?vac\_id=spiders-x-ray-galaxy-cluster-catalogue-for-dr16}}. In total, our catalogue contains 2740 visually inspected galaxy clusters. Contained within these clusters are 33,340 individual galaxy members. Along with this cluster catalogue, we have released the database of redshifts used for identification \citep{ahu20}, the targeting scheme \citep{cle16}, and the full target catalogue\footnote{\texttt{https://www.sdss.org/dr16/data\_access/value-added-catalogs/?vac\_id=spiders-target-selection-catalogues}}. \begin{table*} \centering \begin{tabular*}{\textwidth}{l@{\extracolsep{\fill}}llr} \hline \multicolumn{1}{l}{Column} & \multicolumn{1}{l}{Unit} & \multicolumn{1}{c}{Description} & \multicolumn{1}{r}{Example} \\ \hline \texttt{CLUS\_ID} (1) & & SPIDERS/CODEX identification number & $1\_6939$ \\ \texttt{NCOMPONENT} (2) & & Number of validated components, or merger flag & 1 \\ \texttt{CODEX} (3) & & The CODEX cluster candidate unique identifier & 26240 \\ \texttt{RA} (4) & deg & CODEX X-ray detection right ascension (J2000) & 233.106 \\ \texttt{DEC} (5) & deg & CODEX X-ray detection declination (J2000) & 39.003 \\ \texttt{RA\_OPT} (6) & deg & CODEX optical detection right ascension (J2000) & 233.083 \\ \texttt{DEC\_OPT} (7) & deg & CODEX optical detection declination (J2000) & 39.024 \\ \texttt{LAMBDA\_CHISQ\_OPT} (8) & & Richness $\mathrm{\lambda}_\text{OPT}$ of the CODEX optical detection & 38.8 \\ \texttt{Z\_LAMBDA} (9) & & Photometric redshift (z$_\lambda$) of the CODEX optical detection & 0.27 \\ \texttt{Z\_LAMBDA\_ERR} (10) & & Uncertainty on z$_\lambda$ & 0.01 \\ \texttt{NMEM} (11) & & Number of objects in the CODEX red-sequence & 50 \\ \texttt{NOKZ} (12) & & Number of red-sequence members with a spectroscopic redshift & 14 \\ \texttt{SCREEN\_CLUZSPEC} (13) & & Galaxy cluster redshift, assigned after visual inspection & 0.2863 \\ \texttt{SCREEN\_CLUZSPEC\_ERR} (14) & & Bootstrap uncertainty on \texttt{SCREEN\_CLUZSPEC} & 0.0012 \\ \texttt{SCREEN\_CLUZSPEC\_SPREAD} (15) & & Dispersion in the inspection cluster redshifts & 0 \\ \texttt{SCREEN\_CLUZSPEC\_GAP} (16) & km s$^{-1}$ & Gapper estimate of the cluster velocity dispersion & 790.0 \\ \texttt{SCREEN\_CLUVDISP\_BWT} (17) & km s$^{-1}$ & Square root of the bi-weight variance velocity dispersion & 805.5 \\ \texttt{SCREEN\_CLUVDISP\_BEST} (18) & km s$^{-1}$ & Value of the ``best velocity dispersion'' & 790.0 \\ \texttt{SCREEN\_NMEMBERS\_W} (19) & & Weighted number of red-sequence members identified as members & 11 \\ \texttt{STATUS} (20) & & Validation status of the cluster assigned by the visual inspector & validated \\ \texttt{NINSPECTORS} (21) & & Number of individual inspections for this system & 3 \\ \texttt{NVALID} (22) & & Number of inspectors validating this system as a galaxy cluster & 3 \\ \texttt{LX0124} (23) & ergs s$^{-1}$ & Luminosity in the (0.1-2.4) keV band of the cluster, aperture $R_\text{500c}$ & $1.5\times10^{44}$ \\ \texttt{ELX} (24) & ergs s$^{-1}$ & Uncertainty on \texttt{LX0124} & $0.5\times10^{44}$ \\ \texttt{R200C\_DEG} (25) & deg & Apparent $R_\text{200c}$ radius of the galaxy cluster & 0.088 \\ \texttt{FLUX052} (26) & ergs s$^{-1}$ cm$^{-2}$ & Galaxy cluster X-ray flux in the 0.5-2.0 keV band & $3.9\times10^{-13}$ \\ \texttt{EFLUX052} (27) & ergs s$^{-1}$ cm$^{-2}$ & Uncertainty on \texttt{FLUX052} & $1.2\times10^{-13}$ \\ \texttt{MCXC} (28) & & Identifier in the MCXC catalogue \citep{pif11}, if present & n/a \\ \texttt{ANAME} (29) & & Alternative name in \citep{pif11}, if present & n/a \\ \hline \end{tabular*} \caption{Descriptions of the columns for the validated SPIDERS/CODEX galaxy cluster catalogue. The full VAC, and all others for DR16, are available online at: \texttt{https://www.sdss.org/dr16/data\_access/value-added-catalogs/}} \label{tab:catalogue_columns} \end{table*} The names of the included columns are presented in Table~\ref{tab:catalogue_columns} with units, a short description, and an example of the data formatting. The columns of the catalogue provide: (1) the SPIDERS name, (2) the total number of individually identified cluster components along the line-of-sight, or a value of $-1$ is given if the multiple components are undergoing a major merger, agreed upon by at least two inspectors, (3) the CODEX target candidate name, (4) and (5) the right ascension and declination for the epoch J2000 in degrees of the RASS X-ray detection, (6) and (7) the right ascension and declination for the epoch J2000 in degrees of the optical centre determined by redMaPPer, (8) the redMaPPer richness based on aperture at the optical centre, (9) and (10) the photometric redshift of the red-sequence and the associated error estimation, (11) the total number of member candidates in the CODEX targeting catalogue, (12) the total number of member candidates with a spectroscopic redshift, (13) the assigned redshift for the galaxy cluster after visual inspection, (14) the bootstrap uncertainty on the assigned galaxy cluster redshift, (15) the dispersion in redshift between inspectors as described in Section 3, (16) the velocity dispersion calculated using the gapper estimate (GAP) in units of km s$^{-1}$, (17) the velocity dispersion using the square root of the bi-weight variance (BWT) in units of km s$^{-1}$, (18) the best velocity dispersion in units of km s$^{-1}$ based on \citet{bee90} where we report GAP if less than 15 members are used in the calculation and BWT for well sampled systems of 15 or more members, (19) the sum total of weighted membership flags of red-sequence galaxies determined after inspection, (20) the validation status assigned after inspection reconciliation, (21) the number of individual inspections for the given validated galaxy cluster, (22) the number of inspectors to give a status of validated, (23) and (24) the calculated X-ray luminosity in units of ergs s$^{-1}$ for the 0.1-2.4 keV band using an aperture radius of $R_\text{500c}$ and the associated uncertainties as described in Section 5, (25) the $R_\text{200c}$ radius of the galaxy cluster in units of degrees, (26) and (27) the measured X-ray flux in units of ergs s$^{-1}$ cm$^{-2}$ for the 0.5-2.0 keV band and associated uncertainties as described in Section 5, (28) and (29) the matched identifier in the MCXC catalogue or an alternate name given by \citet{pif11} in cases where the galaxy cluster appears in both catalogues. The optical RA and DEC coordinates given in columns (6) and (7) are determined by running redMaPPer a second time with a relaxed constraint on the centre. The uncertainties on the initial X-ray position of RASS sources is approximately 3 arcmin, which the red-sequence finder is allowed to vary within in order to optimize the centre. The richness given in column (8) refers to the redMaPPer richness estimator value determined, prior to SPIDERS follow-up, from red-sequence members found using the optical centre. It is equal to the sum of the membership probabilities over the field of view, the details of which are described in \citet{ryk14}. There are additional factors taking into account the unobserved, masked areas within the search aperture and the photometric depth correction, modeled as an exponential increase towards high-$z$ \citep{fin20}. The radii $R_\text{500c}$ and $R_\text{200c}$ referenced in columns (23), (24), and (25) are determined using the $L_\text{X}$-$M$ scaling relations of \citet{lea10}. Here we present a few examples of the improvements this catalogue achieves due to large scale spectroscopic follow-up. Figure~\ref{fig:redshift_err} highlights the improved accuracy on redshifts. We plot the ratio of photometric to spectroscopic redshift errors against the spectroscopic redshift. The typical statistical uncertainty on cluster redshifts is $\Delta z /(1+z) = 6 \times 10^{-4}$ (Clerc et al. accepted). We demonstrate that this translates into an improvement of a factor of $\sim10$ compared to the photometric estimation. Redshifts below 0.1 are improved even greater due to the known short comings of red-sequence finders on nearby objects \citep{ryk14}. Overall, this is achieved due to a redshift improvement by a factor of $\sim100$ for individual galaxies, demonstrated by density shaded points. \begin{figure} \centering \includegraphics[width=\columnwidth]{z_error_ratio} \caption{Ratio of photometric to spectroscopic redshift errors plotted against the spectroscopic redshift. Clusters are represented by red circles. The individual member galaxies are represented as squares highlighted by point density.} \label{fig:redshift_err} \end{figure}% When comparing our redshift determinations to the 220 clusters in common with the MCXC catalogue \citep{pif11}, we find good agreement in general with only a handful of outliers. Figure~\ref{fig:zdiff} illustrates the distribution of the velocity offset between SPIDERS redshifts and MCXC redshifts, normalized by $\sigma_{\rm{BWT}}$. Only 5 systems in the sample are offset by more than 3$\sigma$, a minimum requirement that suggests these matches would not be considered one object during visual inspection. On re-inspection of these outliers, all but one case are of systems that are highly sampled (the other system only having 5 redshifts available), and only one system has evidence for multiple components along the line-of-sight. Inset into Figure~\ref{fig:zdiff}, we have plotted an example of a cluster match with an approximate 5$\sigma$ offset. The red cross indicates the MCXC centre (X-ray peak) of the cluster, where the blue crosses are the individual member galaxies, 23 total, used in the calculation of the cluster redshift. No projected offset is apparent, indicating both catalogs are referring to the same extended X-ray source. Without knowing the exact method for determining the individual redshifts in MCXC, we cannot explain the discrepancy in velocity offset, though we can conclude our measurement is robust. A detailed comparison of our redMaPPer sample with Planck clusters \citep{roz14,roz15} has also been carried out. These results are encouraging and a thorough comparison of the spectroscopic properties of all available overlapping surveys is required, but is beyond the scope of this current work. \begin{figure} \centering \includegraphics[width=\columnwidth]{mxcx_offset_dist} \caption{Distribution of velocity offset between matched SPIDERS and MCXC cluster, normalised by $\sigma_{\rm{BWT}}$. Offset is determined by the same calculation of proper velocity used during visual inspection. Inset: Projected sky coordinates of SPIDERS member galaxies (blue crosses) and the X-ray peak centre from the MCXC catalogue (red cross). The example matched cluster (\texttt{1\_2788/J1025.0+4750)} has a discrepancy in proper velocity of approximately 5$\sigma$.} \label{fig:zdiff} \end{figure} In Figure~\ref{fig:sig_lx}, we present the updated $\sigma - L_{\rm{X}}$ relation as presented in \citet{cle16}. This improves the previous DR14 release by increasing the highly sampled systems from 39 clusters to 755 clusters. We define a highly sampled system as having 15 or more spectroscopic members used in the calculation of velocity dispersion as well as only one detected component along the line of sight to insure no external force is affecting the measurement. We also make a cut in redshift at $z<0.4$, as the sample above that redshift (32 clusters only) is highly incomplete. The raw values used in the $\sigma - L_{\rm{X}}$ plane are the reported values in column (17) of the catalogue. The bias corrected values are calculated using an updated approach from the previous release \citep{cle16}. Details of this are described in section~\ref{sec:7}. Associated errors are calculated using the method of re-sampling observations of clusters with a well determined velocity dispersion using a high number of spectroscopic observations \citep{rue14}. We again compute the best-fitting power law to the bias corrected data points using the BCES method \citep{akr96}, with the $y$-axis as the dependent variable, to illustrate our samples trend. We fit constants A and B defined as, \begin{equation} \log \left(\frac{\sigma_{\rm{BWT}}}{700~\rm{km~s^{-1}}}\right) = A + B \log \left(\frac{L_{\rm{X}}}{10^{44} \rm{ergs~s^{-1}}}\right), \label{eq:sig_lx} \end{equation} where we find the best fits to be $(-5.91 \pm 1.47) \times 10^{-2}$ and $(1.29 \pm 0.35) \times 10^{-1}$, respectively. We find a standard deviation of 0.13 along the vertical axis of the fit. Over-plotted is the comparison to the $L_{\rm{X}}-M_{\rm{200c}}-z$ relation of \citet{cap20}. Both samples are drawn from the same catalogue, though they use an earlier release with no redshift cut, for a total of 344 systems. Also used are an updated measurement of X-ray luminosity \citet{fin20}, where flux is extracted through larger apertures for nearby clusters instead of the smaller fixed aperture of our catalogue. We evaluate the relation at fixed mass and redshift, $M_{\rm{200c}} = 3 \times 10^{14}$ and $z = 0.16$, the approximate mean of both samples. Following \citet{Carlberg1997aa}, we scale with velocity dispersion as, \begin{equation} \label{eq:sigma-mass} \sigma = \frac{10 R_{\rm{200}} H(z)}{\sqrt{3}}, \end{equation} \begin{equation} R_{\rm{200}} = \left( \frac{3 M_{\rm{200c}}}{4\pi 200\rho_{\rm{cr}}} \left(\frac{H(z)}{100}\right)^{-2} \right)^{1/3}. \label{eqn:sig_rich} \end{equation} With twice the number of systems with a higher quality selection, it is encouraging that out simple analysis shows good agreement. There is also no effect on the fit whether using X-ray luminosity from our catalogue, or the updated values. A proper derivation utilising a fully consistent statistical treatment is the important next step. \begin{figure} \centering \includegraphics[width=\columnwidth]{vdisp_lx_lz} \caption{$\sigma - L_{\rm{X}}$ relation for SPIDERS clusters. The plotted points are clusters with 15 or more validated members for $z < 0.4$. The triangles represent the raw bi-weight variance calculations. The crosses represent the bias corrected values together with their uncertainty. The solid and dashed red lines show the BCES fit to the bias corrected values and the 1$\sigma$ uncertainty range. The solid blue line represents the translated $L_{\rm{X}} - M_{\rm{200c}}$ scaling relation from \citet{cap20}.} \label{fig:sig_lx} \end{figure} \begin{figure} \centering \includegraphics[width=\columnwidth]{vdisp_rich_legacy} \caption{$\sigma$-$\lambda$ relation for SPIDERS clusters. This sample is drawn the same cluster sample used in Figure~\ref{fig:sig_lx}. Raw and bias corrected bi-weight variances are represented by triangles and crosses, respectively. The solid and dashed red lines shows the BCES fit and $1\sigma$ uncertainty for the bias corrected values and updated richness calculations. The solid blue and green lines represent the translated predictions from \citet{kii20} and \citet{mul19}.} \label{fig:sigma-lambda} \end{figure} We also obtain a fit for the $\sigma - \lambda$ relation, presented in Figure~\ref{fig:sigma-lambda}. Starting with the same sample, we find all clusters overlap with the DESI Legacy imaging surveys \citep{dey19}, for a total of 611 clusters. With deeper imaging data, a more accurate calibration of richness is achieved. RedMaPPer is re-run at the position of the optical centre for all CODEX clusters, allowing for a new centre to be found \citep{IderChitham2020}. This improvement reduces the up-scatter of low mass systems that occurs due to shallow imaging, especially at high redshift. At the mean redshift of our sample, this improvement scales as $\lambda_{\rm{Legacy}} \sim 0.89 \cdot \lambda_{\rm{SDSS}}$. We aim to compute the best-fitting power law to these new data using the same BCES method as before to illustrate the sample trend, compare to predictions from the literature and look for evidence of redshift evolution. We fit constants A and B defined as, \begin{equation} \log \left(\frac{\sigma_{\rm{BWT}}}{700~\rm{km~s^{-1}}}\right) = A + B \log \left(\frac{\lambda_\text{Legacy}}{35}\right), \end{equation} where we find the best fits to be ($-5.36 \pm 0.45) \times 10^{-2}$ and ($3.23 \pm 0.57) \times 10^{-1}$, respectively. We find an overall standard deviation of 0.11 for the fit. Dividing the sample into low (< 35) and high (> 35) richness, the standard deviation along the vertical axis is 0.11 and 0.12, respectively, indicating it is relatively constant along the fit. For comparison, we translate results based on studies of mass and richness for different cluster studies. \citet{kii20} studied a small sample of high-$z$, high-$\lambda$ clusters using deep CFHT multi-band imaging. They use a hierarchical Bayesian model to determine their $\lambda_{\rm{CFHT}} - M_{\rm{WL}}$ relation. We have compared the legacy richness measurements to the their own CFHT measurements, finding the richness scaling as $\lambda_{\rm{Legacy}} \sim 0.94 \cdot \lambda_{\rm{CFHT}}$. Using this scaling, their fit compares favorably with our low-z sample. The good agreement, even with lower mass systems, is likely due to using the slope of \citet{ble20} as a prior, a large SZ detected cluster sample that extends to lower masses. A similar study by \citet{mul19} is composed of low-z, high-$\lambda$ clusters based on Subaru/Suprime-Cam observations. Taking the already converted scaling relation ($M_{500c}$ to $M_{200c}$) from \citet{kii20}, the prediction has a steeper slope, but agreement in the richness range they fit for ($\lambda > 50$) is good. Extrapolating to lower richness though, agreement is poor in general. Our sample demonstrates the importance of low mass clusters when studying scaling relations. Carrying out the same analysis on the high redshift sample produced a completely unconstrained fit. With less than 30 examples of clusters at $z > 0.4$, all with high richness as well, much more low richness data is required. \newcommand{\sigma}{\sigma} \newcommand{\obs}[1]{\tilde{#1}} \newcommand{^{\rm true}}[1]{#1} \newcommand{0.1\xspace}{0.1\xspace} \newcommand{0.3\xspace}{0.3\xspace} \newcommand{497\xspace}{497\xspace} \newcommand{2230\xspace}{2230\xspace} \newcommand{\bin}[1]{\Delta #1} \newcommand{\bin{\!\ln{\obs{\x}}}_i}{\bin{\!\ln{\obs{\sigma}}}_i} \newcommand{\bin{\obs{\x}}_i}{\bin{\obs{\sigma}}_i} \newcommand{\bin{{\obs{z}}}_j}{\bin{{\obs{z}}}_j} \newcommand{CODEX\xspace}{CODEX\xspace} \newcommand{XCLASS\xspace}{XCLASS\xspace} \newcommand{SPIDERS\xspace}{SPIDERS\xspace} \newcommand{\true{\mu}, \true{z}, \nu}{^{\rm true}{\mu}, ^{\rm true}{z}, \nu} \newcommand{\intlim}[2]{\int_{#1}^{#2}} \newcommand{\int_{\binz}}{\int_{\bin{{\obs{z}}}_j}} \newcommand{\int_{\binzi}}{\int_{\binzi}} \newcommand{\int_{\binlnx}}{\int_{\bin{\!\ln{\obs{\x}}}_i}} \newcommand{\intlim{-4}{+4}}{\intlim{-4}{+4}} \newcommand{\intlim{0.05}{0.75}}{\intlim{0.05}{0.75}} \newcommand{\expect{\ln\true{\x}(\true{\mu}, \true{z})}}{\expect{\ln^{\rm true}{\sigma}(^{\rm true}{\mu}, ^{\rm true}{z})}} \newcommand{\intlim{\expect{\ln\true{\x}(\true{\mu}, \true{z})} - 4\sintlnx}{\expect{\ln\true{\x}(\true{\mu}, \true{z})} + 4 \sintlnx}}{\intlim{\expect{\ln\true{\x}(\true{\mu}, \true{z})} - 4\sintlnx}{\expect{\ln\true{\x}(\true{\mu}, \true{z})} + 4 \sintlnx}} \newcommand{\intlim{30.7}{35.3}}{\intlim{30.7}{35.3}} \newcommand{\prob}[1]{P(#1)} \newcommand{\g}[2]{(#1\,|\,#2)} \newcommand{\probg}[2]{P\g{#1}{#2}} \newcommand{\probgg}[3]{P_{#1}\g{#2}{#3}} \newcommand{\expect}[1]{\langle #1 \rangle} \section{Cosmology constraints} \label{sec:7} Because velocity dispersion is a proxy for cluster mass, the evolution of the velocity dispersion function is a useful cosmological tool. The primary cosmological analysis for the CODEX\xspace component of the SPIDERS\xspace DR16 cluster sample is carried out using optical richness as a mass proxy \citep{IderChitham2020}. Constraints can be derived in an analogous way using velocity dispersion as a dynamical mass proxy. To accomplish this, a modification to the PDF which describes the relation between the observed and true quantities is necessary i.e. replacing $\probg{\ln\obs{\lambda}}{\ln^{\rm true}{\lambda(^{\rm true}{\mu},^{\rm true}{z}}}$ with $\probg{\ln\obs{\sigma}}{\ln^{\rm true}{\sigma}(^{\rm true}{\mu},^{\rm true}{z}})$ in the likelihood function presented in \citep{IderChitham2020}, where $\probg{\ln\obs{\sigma}}{\ln^{\rm true}{\sigma}(^{\rm true}{\mu},^{\rm true}{z}})$ is a normal distribution centred on the value of the natural logarithm of the true velocity dispersion $\ln^{\rm true}{\sigma}$ \citep{Carlberg1997aa} added to a mean bias value, with a scatter of both statistical and intrinsic origin. Here we define $\mu = \ln M_{\rm 200c}$. Based on numerical simulations, \citet{ferragamo2020} found the mean bias value to depend on the radial aperture (through a multiplicative factor $B_{\rm ape}$) and number of galaxies $N_{\rm gal}$ entering the measurement and on the fraction of interlopers. Interlopers are galaxies entering the computation of velocity dispersion, but they are located outside of the virially bound cluster region. Following results of \citet{saro2013}, the fraction of interlopers is estimated as a function of cluster redshift and radial aperture. This fraction sets the value of the multiplicative bias factor $B_{\rm int}$ on the velocity dispersion measurement \citep{ferragamo2020}. An additional 0.98 bias factor is applied, considering that only the most massive galaxies contribute to the measurement \citep{ferragamo2020}. We found this model is consistent with that derived from SPIDERS-like resampling of bright nearby clusters \citep{zha16}. Combining these four sources of bias and following our notations, we write: \begin{equation} \langle \obs{\sigma} \rangle = \frac{0.98\sigma }{0.9775 +\left(\frac{0.72}{N_{\rm gal}-1}\right)^{1.28}} B_{\rm ap}\left( \frac{R_{\rm ap}}{R_{\rm 200c}(\mu,{z})} \right) B_{\rm int} \left( \frac{R_{\rm ap}}{R_{\rm 200c}(\mu,{z})}, z \right). \end{equation} As for estimating the scatter, we considered the model of \citet{saro2013} (their Eq.~7) which links $N_{\rm gal}$ to the scatter on $\ln(\obs{\sigma}/\sigma)$. This is added in quadrature to the extra contribution from interlopers shown in their Fig.~10, that is a function $S_{int}$ of both cluster mass and radial aperture. Therefore we write: \begin{equation} Var( \ln \obs{\sigma} ) = \left(-0.037+\frac{1.047}{\sqrt{N_{\rm gal}}}\right)^2 + \left(S_{\rm int}\left(\frac{R_{\rm ap}}{R_{\rm 200c}(\mu, z)}, M_{\rm vir}(\mu, z) \right) \right)^2 , \end{equation} and for simplicity, we define $\delta = \ln \langle \obs{\sigma} \rangle - \ln\sigma$ and the scatter on $\ln\obs{\sigma}$ as $\Delta = \sqrt{Var(\ln \obs{\sigma} )}$. Using now the assumption that $\ln \obs{\sigma}$ is normally distributed around $\ln^{\rm true}{\sigma}$ with a bias term (equivalently, $\obs{\sigma}$ distribution is log-normal), we write the following expression for the additive bias $b$ on $\ln\obs{\sigma}$: \begin{equation} b(R_{\rm ap}, M_{\rm vir}(\mu, z), N_{\rm gal}) = \langle \ln \obs{\sigma} \rangle - \ln \sigma = \delta - \frac{\Delta^2}{2}. \end{equation} The scatter term $\Delta$ due to measurement uncertainties is added in quadrature to an intrinsic scatter to form the resulting scatter on $\ln\obs{\sigma}$: \begin{equation} f = \sqrt{\Delta^2 + \Sigma_0^2}. \end{equation} Presented in section~\ref{sec:6}, velocity dispersion can be linked to the total mass by equation~\ref{eq:sigma-mass}. This relation describes the mean value of $\sigma$. We consider the scatter term as a part of $\obs{\sigma}$. The discussion above can be summarized as a probability to observe a velocity dispersion, for a given true value of it and a redshift (which defines the quality of the data). We denote this as $P(\ln \obs{\sigma}| \ln \sigma (\mu,z),z)$. The relation is controlled by a single number, $N_{\rm gal}$, that we tabulated based on the data and inverted the relation to read $N_{\rm gal}(\sigma(\mu,z), z)$, a function called by the code, which subsequently defines the bias $b$ and the scatter $f$ of the observed values, \begin{multline} P(\ln \obs{\sigma}|\ln\sigma (\mu,z),z) =\mathcal{N}(\ln \obs{\sigma}, \\ \ln \sigma + b(R_{\rm ap}, M_{\rm vir}(\mu, z), N_{\rm gal}), \\ f(R_{\rm ap}, M_{\rm vir}(\mu, z), N_{\rm gal})). \end{multline} The error term is done by sampling the data and determining the typical number of members entering a velocity dispersion calculation at a given dispersion and redshift bin $f( \sigma, z)$. The way to estimate the error using an average number of members is given above. A 10\% sensitivity cut to the sample, proposed by \cite{fin20} to obtain clean X-ray identification, corresponds to \begin{equation} \label{eqn:cut1} P^\mathrm{RASS}(I | \obs{\sigma}, z)=\theta (\obs{\sigma} - 375(z/0.15)^{0.38}), \end{equation} where $\theta$ denotes a step-function. To avoid incompleteness of SDSS, we introduce an additional cut: \begin{equation} \label{eqn:cut2} P^\mathrm{SDSS}(I>0.9 | \obs{\sigma}, z)=\theta(\obs{\sigma}- (372 + 2.76e^{3.3z^2})). \end{equation} This equation describes the 90\% completeness of SDSS. Since the cuts are identical between the data and the model, to ensure the cut is applied consistently to both data and the model, we include it in a definition of velocity dispersion bins, $\Delta \ln \obs{\sigma}_i$, to stay above the completeness limits. The CODEX survey function $P_X(I|\mu,z,\nu=0)$ \citep{fin20} is included, where $\nu=0$ notation means that we use the part of the calculation, which corresponds to a zero value of covariance between the velocity dispersion and X-ray luminosity: \begin{multline} \label{eqn:hmf} \langle N(\Delta \ln \obs{\sigma}_i, \Delta z_j) \rangle = \int_{\Delta z_j} \ensuremath{\mathrm{d}} z \frac{\ensuremath{\mathrm{d}} V}{\ensuremath{\mathrm{d}} z} \int_{\Delta \ln \obs{\sigma}_i} \ensuremath{\mathrm{d}} \ln \obs{\sigma} \\ \int \ensuremath{\mathrm{d}} \mu P(\ln \obs{\sigma}|\ln \sigma(\mu,z),z) P_X(I | \mu,z,\nu=0) \frac{\ensuremath{\mathrm{d}} n(\mu, z) }{\ensuremath{\mathrm{d}}\mu}. \end{multline} \begin{figure} \centering \includegraphics[width=\columnwidth]{delta_z.pdf} \caption{\label{fig:delta_z} The abundance of SPIDERS\xspace clusters as a function in bins ($\Delta$) of observed redshift ($\bin{{\obs{z}}}_j$) and velocity dispersion ($\bin{\obs{\x}}_i$) where $\obs{z} \in \left[0.1\xspace, 0.3\xspace\right)$ and $\obs{\sigma} \in \left[497\xspace, 2230\xspace\right).$ Systems are selected according to Equation~\ref{eqn:cut1} and Equation~\ref{eqn:cut2}. These cuts on the observable space is accounted for in the cosmological likelihood function. Steps represent the observed data and shaded regions trace the expectation value of the model, centred on the median. The upper and lower limit correspond to the 15\% and 85\% confidence intervals of the MCMC chains.} \end{figure} The binned data and best fit model are shown in Figure~\ref{fig:delta_z} for three logarithmically distributed bins of velocity dispersion over a redshift range of $[0.1, 0.3)$ with a bin-width of 0.05. The low velocity dispersion bin is dominated by selection effects, yet it provides the strongest constraints on the $z \sim 0.15$ cluster abundance. The two high velocity dispersion bins show the effect of increasing volume, which balances out the evolution of the cluster mass function. The evolution of the highest bin shall be stronger and so, the resulting trend is flatter. The corresponding constraints are $\sigma_8=0.74^{+0.03}_{-0.02}$, $\Omega_{m_0}=0.33^{+0.02}_{-0.02}$ and the velocity dispersion of the intrinsic scatter $\Sigma_{0}=0.24^{+0.02}_{-0.02}$ derived from the Markov Chain Monte Carlo (MCMC) process are shown in Figure~\ref{fig:cosmo_results}. These results depend on a large number of fixed parameters which reduce the flexibility of the likelihood, causing a significant underestimation of the apparent uncertainties. However, our solution still overlaps with other cluster surveys \citep{vik09,boh14,boc19,fin20}. Cosmology using a non-baryonic tracer of mass is similar to that achieved through calibration of baryonic tracers. Since the need for cluster calibration is removed, the tension to Planck18 cosmology can no longer be explained through deficiencies of mass calibration. In the calibration of $\sigma$, we rely on numerical simulations \citep{Carlberg1997aa} and not on the empirical calibrations. Since it is these empirical calibrations that have been questioned during the Planck CMB vs. Planck cluster cosmology comparison \citep{pc18}, this argument cannot be used to explain the disagreement of our results with Planck18 cosmology and other explanations shall be sought. We have estimated, for the first time the intrinsic scatter of $\sigma$. Compared to simulations, our estimate falls between the higher prediction of \citet{saro2013} and the lower prediction of \citet{mun13}. The low intrinsic scatter is also comparable to other cluster mass proxies such as X-ray luminosity, X-ray temperature, optical richness and SZ thermal energy \citep[][]{cap19,cap20,mul19,ble20,kii20} \begin{figure} \centering \includegraphics[width=\columnwidth]{cosmo_results.pdf} \caption{\label{fig:cosmo_results} Constraints on cosmological parameters and the intrinsic scatter of the velocity dispersion constraints for SPIDERS\xspace DR16 as. Contours depict the 68\% and 95\% confidence levels where posterior distributions are obtained using the likelihood function described in section~\ref{sec:7}.} \end{figure} \section{Summary} We present the largest catalogue of visually confirmed, spectroscopic galaxy clusters. Herein we describe the entire validation process. The SPIDERS program successfully followed-up 2740 X-ray sources identified as galaxy clusters detected in RASS. A total of 33,340 redshifts were used with an improved $\Delta z_{\rm{spec}} /(1+z) = 6 \times 10^{-4}$ compared to $\Delta z_{\rm{phot}} /(1+z) = 5 \times 10^{-2}$. The overall efficiency of successful validation reached 99\% when $\geq 9$ red-sequence members were observed. This improves to $\geq 5$ red-sequence members observed at redshifts $z<0.3$. The number of confirmed members per cluster ranges from 3 to 75, with a median of 10 members. We fit a scaling relation as $\log \sigma \propto A + B \log L_{\rm{X}}$ (equation~\ref{eq:sig_lx}) using the BCES method. The resulting normalization and slope are: \begin{equation} \begin{split} A = (-5.91 \pm 1.47) \times 10^{-2} \\ B = (1.29 \pm 0.35) \times 10^{-1}. \end{split} \end{equation} Our relation is in excellent agreement with a previous \citep{cap20} study of dynamical masses using a subset of our sample. We fit as well a scaling relation as $\log \sigma \propto A + B \log \lambda_{\rm{Legacy}}$ (equation~\ref{eqn:sig_rich}) using the BCES method as well. The resulting normalization and slope are: \begin{equation} \begin{split} A = (-5.36 \pm 0.45) \times 10^{-2} \\ B = (3.23 \pm 0.57) \times 10^{-1}. \end{split} \end{equation} Comparing to weak lensing (WL) samples \citep[][]{mul19,kii20}, our relation compares well in the high richness range. Extrapolating to low richness the two WL samples diverge from agreement. Our sample highlights the importance the large richness range is for constraining scaling relation models. On a first attempt to constrain cosmology with this sample, velocity dispersion is used as a mass proxy. The constraints we obtain for as follow: \begin{equation} \begin{split} \sigma_8=0.74^{+0.03}_{-0.02} \\ \Omega_{m_0}=0.33^{+0.02}_{-0.02} \\ \Sigma_{0}=0.24^{+0.02}_{-0.02}. \end{split} \end{equation} Though the errors are underestimated, our solution overlaps with other galaxy cluster surveys. We find the values of scatter being comparably low to other cluster mass tracers, which makes $\sigma$ a viable cosmology tool and provides good prospects for the eROSITA cluster follow-up program on 4MOST \citep{fin19}. \section*{Data Availability} The data underlying this article are available in the SDSS website at https://www.sdss.org. \section*{Acknowledgements} CK, NC, AF and JIC acknowledge the financial support from the visitor and mobility program of the Finnish Centre for Astronomy with ESO (FINCA), funded by the Academy of Finland grant nr 306531. CK and NC acknowledge this research was supported by the DFG cluster of excellence `Origin and Structure of the Universe' (www.universe-cluster.de). NC acknowledges travel support from the Institut Francais de Finlande, the Embassy of France in Finland, the French Ministry of Higher Education, Research and Innovation, the Finnish Society of Sciences and Letters and the Finnish Academy of Science and Letters. AS is supported by the ERC-StG `ClustersXCosmo' grant agreement 716762, and by the FARE-MIUR grant `ClustersXEuclid' R165SBKTMA. Funding for the Sloan Digital Sky Survey IV has been provided by the Alfred P. Sloan Foundation, the U.S. Department of Energy Office of Science, and the Participating Institutions. SDSS-IV acknowledges support and resources from the Center for High-Performance Computing at the University of Utah. The SDSS web site is www.sdss.org. SDSS-IV is managed by the Astrophysical Research Consortium for the Participating Institutions of the SDSS Collaboration including the Brazilian Participation Group, the Carnegie Institution for Science, Carnegie Mellon University, the Chilean Participation Group, the French Participation Group, Harvard-Smithsonian Center for Astrophysics, Instituto de Astrof\'isica de Canarias, The Johns Hopkins University, Kavli Institute for the Physics and Mathematics of the Universe (IPMU) / University of Tokyo, the Korean Participation Group, Lawrence Berkeley National Laboratory, Leibniz Institut f\"ur Astrophysik Potsdam (AIP), Max-Planck-Institut f\"ur Astronomie (MPIA Heidelberg), Max-Planck-Institut f\"ur Astrophysik (MPA Garching), Max-Planck-Institut f\"ur Extraterrestrische Physik (MPE), National Astronomical Observatories of China, New Mexico State University, New York University, University of Notre Dame, Observat\'ario Nacional / MCTI, The Ohio State University, Pennsylvania State University, Shanghai Astronomical Observatory, United Kingdom Participation Group, Universidad Nacional Aut\'onoma de M\'exico, University of Arizona, University of Colorado Boulder, University of Oxford, University of Portsmouth, University of Utah, University of Virginia, University of Washington, University of Wisconsin, Vanderbilt University, and Yale University. \bibliographystyle{mnras}
\section{Introduction} \setcounter{equation}{0} Understanding dualities is a major challenge in modern theoretical physics. Despite their widespread presence in diverse branches --including field theory, (super)gravity, string theory and condensed matter-- a comprehensive theoretical framework that explains the origin of the phenomenon and describes its full implications is lacking. In the case of gravitational theories, dualities are intimately related to the emergence of hidden symmetries upon toroidal compactifications (supplemented by Hodge dualizations of Kaluza-Klein fields). For instance, it has long been recognized that the reduction to three dimensions of the four-dimensional Einstein-Hilbert action in the presence of a Killing vector, followed by the dualization of the Kaluza-Kelin vector to a scalar, exhibits a $SL(2,R)$ invariance acting on the scalar sector. The latter, conformed by a dilaton and axion, parametrizes a $SL(2,R)/SO(2)$ coset space. This $SL(2,R)$ invariance is commonly referred to in the literature as the Ehlers symmetry \cite{Ehlers}. In the presence of two commuting Killing vectors, the reduction to two dimensions can be achieved in two different ways: either by a direct compactification to two dimensions, or by a reduction to three dimensions followed by a dualization of the vector field to a scalar and a final reduction to two dimensions. Each of these routes yields a different $SL(2,R)/SO(2)$ sigma model in the scalar sector. The first one is associated to the $SL(2,R)$ Matzner-Misner group, which originates from coordinate transformations preserving the vector space spanned by the Killing vectors. In the second case the $SL(2,R)$ group is properly the Ehlers group. The intertwining of the Matzner-Misner and Ehlers groups generates an infinite-dimensional group realized non-locally, as described by Geroch \cite{Geroch}. \medskip A similar situation occurs in supergravity \cite{Cremmer}: the (11-$d$) toroidal compactification of the eleven-dimensional theory yields maximally supersymmetric supergravity in dimension $d$ with a symmetry structure hidden within the non-gravitational degrees of freedom in the reduced bosonic sector, namely $p$-forms and scalars. After Hodge dualization of the $p$-forms to their lowest possible rank, they combine in an irreducible representation of a non-compact group $G$ acting globally, whereas the scalar sector is described by the non-linear sigma model $G/H$, with $H$ the maximal compact subgroup of $G$. In even dimensions, the global symmetry $G$ is realized as an electric-magnetic duality transformation interchanging equations of motion and Bianchi identities. Reduction to five, four and three dimensions yields as $G$ the exceptional Lie groups $E_{6(6)}$, $E_{7(7)}$ and $E_{8(8)}$, respectively. \medskip The study of the rich algebraic structure that underlies the emergence of hidden symmetries in compactifications of (super)gravity has led to conjecture the existence of an infinite-dimensional Kac-Moody algebra acting as a fundamental symmetry of the uncompactified theory \cite{Julia}-\cite{Lambert}, encompassing the duality symmetries that appear upon dimensional reduction. A key property of these algebras is that they involve all the bosonic fields in the theory and their Hodge duals, including the graviton and its dual field. The associated symmetry transformation for a given tensor field relates it to all the rest of the fields, regardless their tensor structure, and in general has a highly non-trivial form. In four dimensions, the graviton and its dual field are each described by a symmetric rank-two tensor field, and a duality symmetry relating them is expected to emerge, inherited from the underlying infinite-dimensional algebraic structure. This has motivated the search of duality-symmetric action principles involving gravity \cite{HT}-\cite{me}, along the lines of the work \cite{deser1} establishing a manifestly duality symmetric formulation of Maxwell action. \medskip It seems natural to wonder about the possibility of deriving duality-symmetric action principles for theories of gravity involving higher derivatives. Among those, conformal gravity occupies a position of particular interest in the literature. Being constructed out of the square of the Weyl tensor, the action principle is invariant under conformal rescalings of the metric. As opposed to Einstein gravity, it is power-counting renormalizable \cite{stelle},\cite{adler}, albeit it presents a Ostrogradski linear instability in the Hamiltonian --due to the fourth-order character of the equations of motion and the non-degeneracy of the Lagrangian \footnote{Recall that a higher order Lagrangian is non-degenerate whenever the highest time derivative term can be expressed in terms of the canonical variables.}--, which is typically assumed to translate into the presence of {\itshape{ghosts}} --negative-norm states-- upon quantization. It is well known that solutions of Einstein gravity form a subset of solutions of conformal gravity, a fact that has recently been exploited in \cite{maldacena} to show the equivalence at the classical level of Einstein gravity with a cosmological constant and conformal gravity with suitable boundary conditions that eliminate ghosts. Another interesting aspect of conformal gravity is that it admits supersymmetric extensions for ${\cal{N}}\leq 4$, the maximally supersymmetric theory admitting different variants (see \cite{susy1} for a review and \cite{dewitt} for recent progress). Other theoretical advances involving conformal gravity include its emergence from twistor string theory \cite{witten1} and its appearance as a counterterm in the AdS/CFT correspondence \cite{adscft}. \medskip A generalization of electric-magnetic duality in conformal gravity was studied in the early work \cite{deser}, where the Euclidean action with a gauge-fixed metric was expressed in terms of quadratic forms involving the electric and magnetic components of the Weyl tensor, exhibiting a discrete duality symmetry upon the interchange of these components. This result can be regarded as the analog of the duality symmetry of Euclidean Maxwell action under the exchange of electric and magnetic fields. Unlike \cite{deser1}, duality is discussed in terms of the electric and magnetic components of the curvature, and not at the level of the dynamical degrees of freedom of the theory. \medskip In the present article we focus on linearized conformal gravity with Lorentzian signature and show that the action principle admits a manifestly duality invariant form in terms of the dynamical variables. The derivation requires working in the Hamiltonian formalism, the identification of the constraints --both algebraic and differential-- and the resolution of the differential ones in terms of potentials, that we will eventually interpret as a dual metric and a dual extrinsic curvature. The structure of the duality-symmetric action principle is new, different from duality-invariant Maxwell theory and linearized gravity: duality acts rotating simultaneously the three-dimensional metrics $(h_{ij}, \tilde{h}_{ij})$ and the extrinsic curvatures $(K_{ij},\tilde{K}_{ij})$. \medskip The rest of the article is organized as follows. In Section II we review general features of conformal gravity and remark that, in the linearized regime, the Hodge dual of the linearized Weyl tensor obeys an identity of the same functional form as the equation of motion satisfied by the Weyl tensor itself, in complete analogy with the symmetric character of vacuum Maxwell equations with respect to the exchange of the field strength and its Hodge dual. Motivated by this observation, in Section III we establish a twisted self-duality form of the linearized equations of motion of conformal gravity. Section IV deals with the generalities of the Hamiltonian formulation, including the identification of the dynamical variables and the constraints of the theory. To deal with the fact that the Lagrangian contains second order time derivatives of the metric perturbation, we will formally promote the linearized extrinsic curvature to an independent dynamical variable. Section V is dedicated to the resolution of the differential constraints in terms of two potentials. These are interpreted as a dual three-dimensional metric and a dual extrinsic curvature. In Section VI we present a manifestly duality invariant form of the action principle, where the two metrics and extrinsic curvatures appear on equal footing. Finally we draw our conclusions in Section VII and set out proposals for future work. \section{Conformal gravity} \setcounter{equation}{0} The action principle of conformal gravity is given by \begin{equation} S[g_{\mu\nu}]=-\frac{1}{4}\int\;d^{4}x\sqrt{-g}\cW_{\mu\nu\r\s}\cW^{\mu\nu\r\s}\label{actionf}, \end{equation} with $g_{\mu\nu}$ the metric tensor defined on a manifold $\cM$ and $\cW^{\mu}_{\ \nu\rho\sigma}$ the Weyl tensor \begin{equation} \tensor{\cW}{^\mu_\nu_\r_\s}\equiv \tensor{\cR}{^\mu_\nu_\r_\s}-2(g^{\mu}_{\ [\r}\cS_{\s]\nu}-g_{\nu[\r}\cS_{\s]}^{\ \mu}). \end{equation} Here ${\cal{R}}^{\mu}_{\ \nu\rho\sigma}$ and ${\cal{S}}_{\mu\nu}$ are the Riemann and Schouten tensors, respectively. The latter is defined as \begin{equation} \cS_{\mu\nu} \equiv \frac{1}{2}(\cR_{\mu\nu}-\frac{1}{6}g_{\mu\nu}\cR). \end{equation} We adopt the convention that indices within brackets are antisymmetrized, with an overall factor of $1/n!$ for the antisymmetrization of $n$ indices. \medskip The Weyl tensor $\cW^{\mu}_{\ \nu\r\s}$ is invariant under diffeomorphisms \begin{equation} \delta g_{\mu\nu} = \nabla_{\mu}\xi_{\nu} + \nabla_{\nu}\xi_{\mu}, \end{equation} and local conformal rescalings of the metric \begin{equation} g_{\mu\nu}\rightarrow g'_{\mu\nu}=\Omega^2(x) g_{\mu\nu}. \end{equation} These transformations also determine the symmetries of the action principle (\ref{actionf}). \medskip The Weyl tensor satisfies the same tensorial symmetry properties as the Riemann tensor, \begin{align} \cW_{\mu\nu\r\s}=-\cW_{\nu\mu\r\s}=-\cW_{\mu\nu\s\r}=\cW_{\r\s\mu\nu},\label{symm} \end{align} as well as the identities \begin{eqnarray} &\cW_{[\mu\nu\s]\r}=0,\label{id} \end{eqnarray} \begin{eqnarray} &\cW^{\mu}_{\ \nu\mu\s}=0,\label{traceless} \end{eqnarray} and \begin{equation} \nabla_{\mu}\tensor{\cW}{^\mu_\nu_\r_\s}=-{\cal{C}}_{\nu\r\s},\label{bianchi} \end{equation} where we have introduced the Cotton tensor \begin{align} &\cC_{\nu\r\s}\equiv 2\nabla_{[\r}\cS_{\s]\nu}. \end{align} Equation (\ref{bianchi}) is a consequence of the Bianchi identity for the Riemann tensor. \medskip The fourth-order equation of motion derived from the conformal gravity action principle (\ref{actionf}) reads \begin{equation} (2\nabla_{\r}\nabla^{\s} + \cR_{\r}^{\ \s})\cW^{\r}_{\ \mu\s\nu}=0.\label{eomf} \end{equation} This is usually referred to as the Bach equation, the left-hand side of (\ref{eomf}) being dubbed the Bach tensor. Clearly, conformally flat metrics constitute a particular subset of solutions to the equations of motion (\ref{eomf}). Einstein metrics constitute another subset of particular solutions. \medskip \begin{center} {\bf{Remarks on the linearized regime}} \end{center} In the linearized regime \begin{equation} g_{\mu\nu} = \eta_{\mu\nu} + h_{\mu\nu} \end{equation} the Weyl tensor takes the form \begin{align} &W^{\mu}_{\ \nu\rho\sigma}[h] = \tensor{R}{^\mu_\nu_\r_\s}[h]-2(\delta^{\mu}_{\ [\r}S_{\s]\nu}[h]-\delta_{\nu[\r}S_{\s]}^{\ \mu}[h]),\label{weyltensor} \end{align} where $R_{\mu\nu\r\s}$ is the linearized Riemann tensor \begin{align} R_{\mu\nu\r\s}=-\frac{1}{2}[\partial_{\mu}\partial_{\r}h_{\nu\s}+\partial_{\nu}\partial_{\s}h_{\mu\r}-\partial_{\mu}\partial_{\s}h_{\nu\r}-\partial_{\nu}\partial_{\r}h_{\mu\s}]\label{riemann} \end{align} and $S_{\mu\nu}$ the linearized Schouten tensor. The action principle and equations of motion reduce to \begin{align} &S[h_{\alpha\beta}]=-\frac{1}{4}\int\;d^{4}xW_{\mu\nu\r\s}[h]W^{\mu\nu\r\s}[h] \end{align} and \begin{equation} \del_{\mu}\del_{\nu}W^{\mu\r\nu\s}[h]=0. \label{eoml} \end{equation} The linearized Weyl tensor still obeys the symmetry properties (\ref{symm}), and the identity (\ref{bianchi}) takes the linearized form \begin{equation} \del_{\mu}W^{\mu\nu\r\s}[h]=-C^{\nu\r\s}[h]. \label{weyl_cotton} \end{equation} This allows for a rewriting of the linearized Bach equation in terms of the Cotton tensor: \begin{equation} \del_{\r}C^{\nu\r\s}[h]=0. \end{equation} Let us now introduce the Hodge dual of the linearized Weyl tensor: \begin{equation} ^{*}W_{\mu\nu\rho\sigma}[h]\equiv\frac{1}{2}\tensor{\epsilon}{_\mu_\nu^\alpha^\beta}\tensor{W}{_\alpha_\beta_\r_\s}[h]. \end{equation} By construction it possesses the same symmetries as $W_{\mu\nu\r\s}$, namely \begin{equation} ^{*}W_{\mu\nu\r\s}=^{*}W_{\r\s\mu\nu}=-^{*}W_{\nu\mu\r\s}=-^{*}W_{\mu\nu\s\r}. \end{equation} It also satisfies the cyclic identity \begin{equation} ^{*}W_{[\mu\nu\r]\s}=0 \end{equation} and is traceless \begin{equation} ^{*}W^{\mu}_{\ \nu\mu\r}=0. \end{equation} At this point, it is crucial to observe that $^{*}W_{\mu\nu\rho\sigma}$ satisfies the following identity: \begin{equation} \del_{\mu}\del_{\nu}\;^{*}W^{\mu\r\nu\s}[h]=0.\label{id_dual_w} \end{equation} This is directly related to the identity \begin{equation} C_{\s[\nu\r,\mu]}[h]=0 \end{equation} satisfied by the linearized Cotton tensor, for \begin{eqnarray} &\del_{\mu}\del_{\nu}\;^{*}W^{\mu\r\nu\s}[h]=\frac{1}{2}\del_{\mu}\del_{\nu}\epsilon^{\mu\r\alpha\beta}W_{\alpha\beta}^{\ \ \nu\s}[h]\nn\\ &=-\frac{1}{2}\del_{\mu}\epsilon^{\mu\r\alpha\beta}C^{\s}_{\ \alpha\beta}[h]=0. \end{eqnarray} It is now clear that the set of equations conformed by the linearized Bach equation (\ref{eoml}) and the identity (\ref{id_dual_w}) \begin{align} \partial_{\mu}\partial_{\rho}W^{\mu\nu\rho\sigma}[h]&=0\nn\\ \partial_{\mu}\partial_{\rho}\,^{*}W^{\mu\nu\rho\sigma}[h]&=0\label{WWW} \end{align} may be regarded as the analog of Maxwell equations in vacuum \begin{align} \partial_{\mu}F^{\mu\nu}[A]&=0\nn\\ \partial_{\mu}\, ^{*}F^{\mu\nu}[A]&=0.\label{electrom} \end{align} The set of equations (\ref{WWW}) is symmetric under the replacement of the Weyl tensor and its Hodge dual. \section{Twisted self-duality form of the equations of motion} \setcounter{equation}{0} Given the formal resemblance between equations (\ref{electrom}) and (\ref{WWW}), it seems natural to wonder about the existence of an underlying electric-magnetic duality structure in linearized conformal gravity. In this section we show that the set of equations (\ref{WWW}) can be cast in a covariant twisted self-duality form, and that the non-covariant subset defined by selecting the purely spatial components of the latter contains all the information of the full covariant set --which parallels the situation in electromagnetism \cite{abh} and linearized Einstein gravity \cite{mebh}. \medskip In order to understand the logic underlying twisted self-duality, it is useful to briefly recall the situation in Maxwell theory. Consider the vacuum equations (\ref{electrom}), where we tacitly assume $F_{\mu\nu}=\partial_{\mu}A_{\nu}-\partial_{\nu}A_{\mu}$. Although (\ref{electrom}) are symmetric under the exchange of $F_{\mu\nu}[A]$ and $^{*}F_{\mu\nu}[A]$, these quantities do not appear exactly on an equal footing: the equation for $^{*}F_{\mu\nu}$ is an identity. In other words, $^{*}F_{\mu\nu}$ has been implicitly solved in terms of the potential $A^{\mu}$. Indeed, upon use of Poincar\'e lemma, one finds $^{*}F_{\mu\nu}=\epsilon_{\mu\nu\alpha\beta}\partial^{\alpha}A^{\beta}$ for some vector potential $A^{\mu}$, and the definition of the Hodge dual yields $F_{\mu\nu}=\partial_{\mu}A_{\nu}-\partial_{\nu}A_{\mu}$, as expected. We seek instead a formulation where $F_{\mu\nu}$ and $^{*}F_{\mu\nu}$ appear on equal footing, with no implicit prioritization of any of them. This is achieved \cite{abh} by considering the field strength and its Hodge dual as independent variables, solving simultaneously for both in terms of potentials $F_{\mu\nu}[A]=\partial_{\mu}A_{\nu}-\partial_{\nu}A_{\mu}$ and $^{*}F_{\mu\nu}\equiv H_{\mu\nu}[B]=\partial_{\mu}B_{\nu}-\partial_{\nu}B_{\mu}$, and finally imposing a first-order, twisted self-duality condition that takes into account that $F_{\mu\nu}[A]$ and $H_{\mu\nu}[B]$ are not independent but actually related by Hodge dualization: \begin{align} ^{*}\begin{pmatrix} F_{\mu\nu} \\ H_{\mu\nu} \end{pmatrix}={\cal{S}}\begin{pmatrix} F_{\mu\nu}\\ H_{\mu\nu} \end{pmatrix}, \ \ \ {\cal{S}}=\begin{pmatrix} 0 & 1\\ -1 & 0 \end{pmatrix}.\label{tsdmax} \end{align} Clearly, equation (\ref{tsdmax}) implies the second-order Maxwell equations (\ref{electrom}) by taking the divergence. However, in this first-order formulation $F_{\mu}[A]$ and $H_{\mu\nu}[B]$ appear on an equal footing, related to each other by Hodge dualization. \medskip As a caveat, we notice a redundancy in the twisted self-duality equations (\ref{tsdmax}), for either row can be obtained from the other by Hodge dualization. It is actually possible to identify a non-covariant subset of (\ref{tsdmax}) that is equivalent to the original set of equations and free from redundancies \cite{abh}. This is achieved by selecting the purely spatial components of (\ref{tsdmax}), which produces \begin{align} \begin{pmatrix} {\cal{B}}_{i}[A] \\ {\cal{B}}_{i}[B] \end{pmatrix}={\cal{S}}\begin{pmatrix} {\cal{E}}_{i}[A]\\ {\cal{E}}_{i}[B] \end{pmatrix},\label{tsdnon} \end{align} with ${\cal{E}}_{i}$ and ${\cal{B}}_{i}$ the usual electric and magnetic fields. \medskip Let us now turn the discussion to linearized conformal gravity. Since the dual Weyl tensor $^{*}W_{\mu\nu\r\s}$ has the same algebraic and differential properties as the Weyl tensor, it can be written itself in the same functional form as $W_{\mu\nu\r\s}[h]$ for some different metric $f_{\mu\nu}$: \begin{align} &^{*}W_{\mu\nu\r\s}[h] = H_{\mu\nu\rho\sigma}[f], \end{align} with \begin{align} &H^{\mu}_{\ \nu\r\s}[f] \equiv \tensor{R}{^\mu_\nu_\r_\s}[f]-2(\delta^{\mu}_{\ [\r}S_{\s]\nu}[f]-\delta_{\nu[\r}S_{\s]}^{\ \mu}[f]), \end{align} the relation between $h_{\mu\nu}$ and $f_{\mu\nu}$ being non-local. Similarly, it is easy to verify that the Cotton tensor and its Hodge dual have the same properties, and therefore we can write \begin{equation} ^{*}C_{\mu\nu\r}[h]=D_{\mu\nu\r}[f], \end{equation} where $D_{\m\nu\r}[f]$ has the same functional form as the Cotton tensor for the dual metric $f_{\mu\nu}$ \begin{align} &D_{\mu\nu\r}[f]= -\del_{\r}H^{\r}_{\ \mu\nu\r}[f]. \end{align} Exactly in parallel as what happens in electromagnetism, Hodge duality exchanges equations of motion and differential identities. In the theory defined by $h_{\mu\nu}$, $\partial_{\mu}\partial_{\nu}W^{\mu\nu\r\s}[h]=0$ is an equation of motion and $\partial_{\mu}\partial_{\nu}^{*}W^{\mu\nu\r\s}[h]$ can be seen as the analogue of the Bianchi identity in Maxwell theory. However, when we consider the dual theory defined by $f_{\mu\nu}$, the latter implies the equation of motion for the dual metric $\partial_{\mu}\partial_{\nu}H^{\mu\nu\r\s}[f]=0$, whereas the former is related to the differential identity $\partial_{\mu}\partial_{\nu}\,^{*}H^{\mu\nu\r\s}[f]=0$. \medskip Although the set of equations (\ref{WWW}) is symmetric under the formal exchange of the Weyl tensor and its Hodge dual, implicitly we have prioritized the formulation based on $h_{\mu\nu}$, for $f_{\mu\nu}$ does not appear at all. Following the same logic as discussed above in the case of electromagnetism, it is possible though to find a set of second-order equations equivalent to (\ref{WWW}) where both metrics appear on an equal footing. This is the twisted self-duality equation for linearized conformal gravity: \begin{equation} ^*\hspace{-.02cm} \begin{pmatrix} W^{\mu\nu\r\s}[h]\\ H^{\mu\nu\r\s}[f]\\ \end{pmatrix} = {\mathcal S} \begin{pmatrix} W^{\mu\nu\r\s}[h]\\ H^{\mu\nu\r\s}[f]\\ \end{pmatrix}, \; \; \; {\mathcal S} = \begin{pmatrix} 0&1 \\ -1 & 0 \end{pmatrix}. \label{tsd} \end{equation} Equation (\ref{tsd}) is obtained from (\ref{WWW}) by solving for $W_{\mu\nu\r\s}$ and $H_{\mu\nu\r\s}\equiv ^{*}W_{\mu\nu\r\s}$, treated as independent field strengths, and imposing the condition that they are actually related by Hodge dualization. On the other hand, taking the double divergence on both sides, the twisted self-duality equation (\ref{tsd}) reproduces immediately the equations of motion for $W_{\mu\nu\r\s}[h]$ and $H_{\mu\nu\r\s}[f]$ in virtue of the differential identities satisfied by their Hodge duals, exactly as what happens in the Maxwell theory. We notice (\ref{tsd}) also implies the vanishing of the trace of $W^{\mu\nu\r\s}[h]$ and $H^{\mu\nu\r\s}[f]$, owing to the respective cyclic identities. This is in consistency with their definitions as the traceless part of the Riemann tensor for the corresponding metrics $h_{\mu\nu}$ and $f_{\mu\nu}$. \medskip \medskip The set of equations (\ref{tsd}) is redundant, in the sense that either row can be obtained as the Hodge dual of the other one. So we can keep only the subset of equations associated to the first row in (\ref{tsd}): \begin{align} &^{*}W^{0i0j} = H^{0i0j}\nn\\ &^{*}W^{0ijk} = H^{0ijk}\nn\\ &^{*}W^{ijkl} = H^{ijkl}\label{set}. \end{align} Moreover, we see that the third equation in (\ref{set}) can be obtained from the second one, for \begin{eqnarray} ^{*}W^{ijkl} = H^{ijkl} \Leftrightarrow \epsilon^{ij0m}W_{0m}^{\ \ kl} = H^{ijkl}\nn\\ \Leftrightarrow W^{0mkl} = -\frac{1}{2}\epsilon_{ij}^{\ \ 0m}H^{ijkl} = -^{*}H^{0mkl}, \end{eqnarray} the last expression being the Hodge dual of the second equation in (\ref{set}). Thus, the only independent components of the covariant twisted self-duality equations (\ref{tsd}) are \begin{align} &^{*}W^{0i0j} = H^{0i0j}\nn\\ &^{*}W^{0ijk} = H^{0ijk}\label{tsd2}. \end{align} Defining the electric component $\cE_{ij}$ and magnetic component $\cB_{ij}$ of the Weyl tensor $W_{\mu\nu\r\s}$ as \begin{align} \cE_{ij}[h]&\equiv W_{0i0j}[h] \ \ \ \nn\\ \cB_{ij}[h]&\equiv -^{*}W_{0i0j}[h]=-\frac{1}{2}\epsilon_{0imn}W_{0j}^{\ \ mn}[h], \end{align} and similarly for $H_{\mu\nu\r\s}$ \begin{align} \cE_{ij}[f]&\equiv H_{0i0j}[f], \ \ \ \nn\\ \cB_{ij}[f]&\equiv -^{*}H_{0i0j}[f]=-\frac{1}{2}\epsilon_{0imn}H_{0j}^{\ \ mn}[f], \end{align} equation (\ref{tsd2}) can be cast in the form \begin{equation} \begin{pmatrix} \cE^{ij}[h]\\ \cE^{ij}[f]\\ \end{pmatrix} = {\mathcal S} \begin{pmatrix} \cB^{ij}[h]\\ \cB^{ij}[f]\\ \end{pmatrix}, \; \; \; {\mathcal S} = \begin{pmatrix} 0&1 \\ -1 & 0 \end{pmatrix}. \label{tsd3} \end{equation} This equation is non-redundant and contains all the information in the covariant twisted self-duality equation (\ref{tsd}). It will be referred to as the non-covariant twisted self-duality equation. \medskip From their definitions, it is straightforward to see that the electric and magnetic components are both symmetric and traceless. Moreover, their double divergence vanishes: \begin{eqnarray} \partial_{i}\partial_{j}\cE_{ij}[h] = \partial_{i}\partial_{j}\cE_{ij}[f] = \partial_{i}\partial_{j}\cB_{ij}[h] = \partial_{i}\partial_{j}\cB_{ij}[f]=0.\nn\\ \end{eqnarray} \section{Hamiltonian formulation} \setcounter{equation}{0} Having established the twisted self-duality structure underlying the equations of motion of linearized conformal gravity, the natural next step is to seek a formulation of the corresponding action principle that manifestly displays duality symmetry. In order to do so, we shall follow the same strategy as in Maxwell theory \cite{deser1} and linearized gravity \cite{HT}: the Hamiltonian formulation is introduced by a 3+1 slicing of space-time, constraints are identified and solved in terms of potentials, and finally a manifest duality symmetric action is written down upon substitution in terms of potentials. This section deals with the Hamiltonian formulation of the theory and the identification of the constraints. \medskip The action principle for linearized Weyl gravity is \begin{align} S=-\frac{1}{4}\int\;d^{4}xW_{\mu\nu\r\s}W^{\mu\nu\r\s}. \end{align} The squared Weyl tensor is decomposed upon a $3+1$ slicing of space-time as follows: \begin{align} W_{\mu\nu\r\s}W^{\mu\nu\r\s} &= 4W_{0i0j}W^{0i0j}+4W_{0ijk}W^{0ijk}+W_{ijkl}W^{ijkl}\nn\\ &= 8W_{0i0j}W^{0i0j}+4W_{0ijk}W^{0ijk} \label{ld}. \end{align} In order to deal with the second-order character of the Lagrangian, we shall follow the Ostrogradski method: to define a dynamical variable depending on first-order derivatives that will be formally treated as independent, and impose afterward its definition through a Lagrange multiplier. A natural choice is the linearized extrinsic curvature: \begin{align} K_{ij}=\frac{1}{2}(\dot{h}_{ij}-\partial_{i}h_{0j}-\partial_{j}h_{0i}). \end{align} It will be required then to express the Weyl tensor in terms of $K_{ij}$. \medskip First, let us write the Riemann tensor and its contractions in terms of the extrinsic curvature. The components of (\ref{riemann}) are: \begin{align} &R_{ijkl}=-\frac{1}{2}[\partial_{i}\partial_{k}h_{jl}+\partial_{j}\partial_{l}h_{ik}-\partial_{i}\partial_{l}h_{jk}-\partial_{j}\partial_{k}h_{il}]\nn\\ &R_{0i0j}=-\dot{K}_{ij}-\frac{1}{2}\partial_{i}\partial_{j}h_{00}\nn\\ &R_{0ijk}=-(\partial_{j}K_{ik}-\partial_{k}K_{ij}). \end{align} In turn, the components of the Ricci tensor read \begin{align} &R_{00}=R_{0i0}^{\ \ \ i} = -\dot{K}-\frac{1}{2}\Delta h_{00}\nn\\ &R_{0i}=\partial^{k}K_{ik}-\partial_{i}K\nn\\ &R_{ij}=-\dot{K}_{ij}-\frac{1}{2}\partial_{i}\partial_{j}h_{00}+R_{ikj}^{\ \ \ k}, \end{align} and the scalar curvature is \begin{align} R=-2R_{0i0}^{\ \ \ i}+R_{ij}^{\ \ ij} = 2\dot{K} + \Delta h_{00} + R_{ij}^{\ \ ij}. \end{align} From the definition of the Weyl tensor (\ref{weyltensor}) one derives the relations \begin{align} W_{0i0j}&=\frac{1}{2}(R_{0i0j} + R_{imj}^{\ \ \ m}) - \frac{1}{6}\delta_{ij}(R_{mn}^{\ \ mn} + R_{0m0}^{\ \ \ m}) \nn\\ &=\frac{1}{2}(-\dot{K}_{ij}-\frac{1}{2}\partial_{i}\partial_{j}h_{00} + R_{imj}^{\ \ \ m})\nn\\ & - \frac{1}{6}\delta_{ij}(-\dot{K}-\frac{1}{2}\Delta h_{00} + R_{mn}^{\ \ mn})\nn \end{align} and \begin{align} W_{0ijk}&=\partial_{k}K_{ij}-\partial_{j}K_{ik}\nn\\ &+ \frac{1}{2}(\delta_{ij}(\partial^{l}K_{lk}-\partial_{k}K)-\delta_{ik}(\partial^{l}K_{jl}-\partial_{j}K)).\nn \end{align} The Lagrangian reads \begin{align} {\cal{L}}&=-\frac{1}{4}W_{\mu\nu\r\s}W^{\mu\nu\r\s}=-\left[\frac{1}{2}(\dot{K}_{ij}\dot{K}^{ij}+R_{imj}^{\ \ \ m}R^{inj}_{\ \ \ n}\right.\nn\\ &+\dot{K}_{ij}\partial^{i}\partial^{j}h_{00}-2\dot{K}^{ij}R_{imj}^{\ \ \ m}-\partial_{i}\partial_{j}h_{00}R^{imj}_{\ \ \ m})\nn\\ &-\frac{1}{6}(\dot{K}^2+R_{ij}^{\ \ ij}R_{mn}^{\ \ mn}+\dot{K}\Delta h_{00}-2\dot{K}R_{ij}^{\ \ ij}-\Delta h_{00}R_{mn}^{\ \ mn})\nn\\ &\left.+\frac{1}{12}\Delta h_{00}\Delta h_{00}-W_{0ijk}W_{0}^{\ ijk}\right]. \end{align} The conjugate momentum associated to $K_{ij}$ is defined as usual: \begin{align} &P^{ij}=\frac{\partial L}{\partial \dot{K}_{ij}}=-\left[\dot{K}^{ij}+\frac{1}{2}\partial^{i}\partial^{j}h_{00}-R^{imj}_{\ \ \ m}\right.\nn\\ &\left.-\frac{1}{6}\Delta h_{00}\delta^{ij}+\frac{1}{3}R_{mn}^{\ \ mn}\delta^{ij}-\frac{1}{3}\dot{K}\delta^{ij}\right]\label{conj}. \end{align} We notice that the trace of $P^{ij}$ vanishes identically: \begin{align} P=0\label{c1}. \end{align} This shall be treated as a primary constraint. \medskip The Hamiltonian is now introduced through the Legendre transformation \begin{equation} {\cal{H}} = P^{ij}\dot{K}_{ij} - {\cal{L}}. \end{equation} Upon substitution for the generalized velocities, it can be expressed in terms of $P^{ij}$ and $K_{ij}$: \begin{equation} {\cal{H}} = -\frac{1}{2}P_{ij}P^{ij}-\frac{1}{2}P^{ij}\partial_{i}\partial_{j}h_{00} + R_{imj}^{\ \ \ m}P^{ij} - W_{0ijk}W_{0}^{\ ijk}. \end{equation} \medskip Now we have to take into account the fact that the definition of $K_{ij}$ actually depends on $\dot{h}_{ij}$ by introducing in the action principle the constraint term $\lambda^{ij}(\dot{h}_{ij}-\partial_{j}h_{0i}-\partial_{i}h_{0j}-2K_{ij})$. The factor $\lambda^{ij}$ becomes a Lagrange multiplier enforcing the definition of $K_{ij}$ : \begin{align} &S[h_{ij}, p^{ij}, K_{ij}, P^{ij}]=\int\;d^{4}x[P^{ij}\dot{K}_{ij}+\frac{1}{2}Pi_{ij}Pi^{ij}\nn\\ &+\frac{1}{2}P^{ij}\partial_{i}\partial_{j}h_{00}-P^{ij}R_{imj}^{\ \ \ m}\nn\\ &+2\partial_{j}K_{ik}\partial^{j}K^{ik}+2\partial_{k}K\partial_{l}K^{kl}-\partial_{l}K\partial^{l}K-3\partial ^{l}K_{kl}\partial_{m}K^{km}\nn\\ &+\lambda^{ij}(\dot{h}_{ij}-\partial_{j}h_{0i}-\partial_{i}h_{0j}-2K_{ij})]\label{action2}. \end{align} Clearly one can identify the Lagrange multiplier $\lambda^{ij}$ with the conjugate momentum associated to $h_{ij}$, $p^{ij}\equiv \lambda^{ij}$. Upon integration by parts, the components $h_{00}$ and $h_{0j}$ act now as Lagrange multipliers imposing the constraints \be \partial_{i}\partial_{j}P^{ij} = 0 \label{ccc1} \ee and \be \partial_{j}p^{ij}=0.\label{ccc2} \ee The latter reads exactly as in linearized gravity \cite{HT}. Ignoring total derivatives coming from the previous integration by parts, the final form of the Hamiltonian action principle is \begin{align} &S[h_{ij}, p^{ij}, K_{ij}, P^{ij}, h_{0i}, h_{00}] = \int d^{4}x\left[P_{ij}\dot{K}_{ij} + p^{ij}\dot{h}_{ij}\right.\nn\\ &\left.- \cH_{0} + 2\partial_{j}p^{ij}h_{0i} - \frac{1}{2}\partial_{i}\partial_{j}P^{ij}h_{00}\right] \end{align} with \begin{align} &- \cH_{0} = \frac{1}{2}P^{ij}P_{ij} - P^{ij}R_{imj}^{\ \ \ m} - 2p^{ij}K_{ij}\nn\\ &+ 2\partial_{j}K_{ik}\partial^{j}K^{ik} + 2\partial_{k}K\partial^{l}K_{kl} - \partial_{l}K\partial^{l}K - 3\partial^{l}K_{kl}\partial_{m}K^{km}\label{Ham}. \end{align} One notices in (\ref{Ham}) the presence of terms linear in the conjugate momenta, which points out the Ostrogradski linear instability of the theory. \medskip There is an additional constraint that comes about by demanding the preservation of the constraint (\ref{c1}) under time evolution. In other words, the Poisson bracket of the constraint (\ref{c1}) with the Hamiltonian should vanish: \begin{align} \{P, \int d^3x\,{\cal{H}}\} = 0. \end{align} This results in the constraint \begin{align} p = 0 \label{c2}. \end{align} The consistency condition applied to this constraint does not produce any further ones. \medskip Adding up the traceless constraints (\ref{c1}) and (\ref{c2}), the action principle reads \begin{align} &S[h_{ij}, p^{ij}, K_{ij}, P^{ij}, h_{0i}, h_{00}, \lambda_{1}, \lambda_{2}] \nn\\ &= \int d^{4}x\left[P_{ij}\dot{K}_{ij} + p^{ij}\dot{h}_{ij} - {\cal{H}}_{0}+ 2\partial_{j}p^{ij}h_{0i} - \frac{1}{2}\partial_{i}\partial_{j}P^{ij}h_{00}\right.\nn\\ &\left. + \lambda_{1}P + \lambda_{2}p\right]. \label{actionfin} \end{align} The gauge transformations of the dynamical variables are \begin{align} &\delta h_{ij} = \partial_{i}\xi_{j} + \partial_{j}\xi_{i} + \delta_{ij}\xi\nn\\ &\delta K_{ij} = \frac{1}{2}[-2\partial_{i}\partial_{j}\xi_{0} + \delta_{ij}\dot{\xi}]\nn\\ &\delta p^{ij} = 0\nn\\ &\delta P^{ij} = 0. \end{align} These can be obtained directly from the definition of the dynamical variables in terms of the components of the four-dimensional metric $h_{\mu\nu}$. It is straightforward to verify that the constraints (\ref{cc1}), (\ref{cc2}), (\ref{c1}) and (\ref{c2}) are first class, so the previous gauge transformations can also be derived from the Poisson bracket with the constraints. We notice that $p=0$ generates the Weyl rescaling for $h_{ij}$, whereas $\partial_{j}p^{ij}$ is responsible for the same three-dimensional diffeomorphism invariance of linearized Einstein gravity. \section{Resolution of the constraints} We shall now focus on the resolution of the differential constraints \begin{equation} \partial_{i}\partial_{j}P^{ij} = 0\label{cc1} \end{equation} and \begin{equation} \partial_{j}p^{ij} = 0\label{cc2}, \end{equation} subject to the traceless constraints \begin{equation} P = 0\label{t1} \end{equation} and \begin{equation} p = 0.\label{t2} \end{equation} Let us first focus on (\ref{cc1}). Taking into account that $P = 0$, this can be solved in terms of some tensor potential $\psi_{ij}$ as follows: \begin{equation} P^{ij}=\epsilon_{imn}\partial^{m}\psi^{nj} + \epsilon_{jmn}\partial^{m}\psi^{ni}. \end{equation} Because of the traceless condition on $P^{ij}$ , the antisymmetric component of $\psi_{ij}$ is restricted to have the form \begin{equation} \psi_{[ij]} = \partial_{i}w_{j} - \partial_{j}w_{i}. \end{equation} However, by the redefinition of the symmetric component of the potential $\psi_{(ij)}\equiv \phi_{ij} + \partial_{i}w_{j} + \partial_{j}w_{i}$ the solution simply takes the form \begin{equation} P^{ij} = \epsilon_{imn}\partial^{m}\phi^{nj} + \epsilon_{jmn}\partial^{m}\phi^{ni}\label{res1}, \end{equation} with $\phi_{ij}$ a symmetric tensor. Note that, since $\delta P^{ij} = 0$, the ambiguities in the definition of the potential $\phi_{ij}$ are restricted to have the form \begin{equation} \delta\phi_{ij} = \partial_{i}\partial_{j}\xi + \delta_{ij}\theta. \end{equation} This has exactly the same form as $\delta K_{ij}$, which already suggests that $K_{ij}$ and $\phi_{ij}$ can be treated on equal footing, and justifies the renaming $\phi_{ij}\equiv \tilde{K}_{ij}$. \medskip In order to solve the constraint (\ref{cc2}), we may use the Poincar\'e lemma and write \begin{equation} p^{ij} = \epsilon_{imn}\partial^{m}\omega^{nj} + \epsilon_{jmn}\partial^{m}\omega^{ni}\label{pij} \end{equation} for some symmetric potential $\omega_{ij}$, bearing in mind the fact that $p^{ij}$ is symmetric and traceless. However, the additional condition $\partial_{i}p^{ij}=0$ must be fulfilled, which implies that \be \partial_{i}\epsilon_{jmn}\partial^{m}\omega^{ni}=0\label{identity} \ee should be identically satisfied. A particular choice of $\omega_{ij}$ that fulfills this condition is \begin{equation} \omega_{ij} = R_{ij}[\tilde{h}], \label{choice} \end{equation} with $R_{ij}[\tilde{h}]$ having the functional form of the linearized three-dimensional Ricci tensor for some symmetric tensor $\tilde{h}_{ij}$ --to be interpreted in the sequel as a second, dual metric. Indeed, we see that \begin{equation} \partial_{i}\epsilon_{jmn}\partial^{m}R^{ni}[\tilde{h}] = \epsilon_{jmn}\partial^{m}(\Delta\partial_{i} \tilde{h}_{ik} - \partial_{l}\Delta \tilde{h}_{kl}) = 0. \end{equation} More generally, the condition (\ref{identity}) is identically satisfied for \be \omega_{ij} = R_{ij}[\tilde{h}] + \delta_{ij}s_{1} + \partial_{i}\partial_{j}s_{2}. \label{omegaij} \ee with $s_{1}$ and $s_{2}$ undetermined scalar functions. The contribution to (\ref{pij}) from the last two terms in (\ref{omegaij}) vanishes, so they can be ignored in practice. \medskip We shall write then \begin{equation} p^{ij} = -\frac{1}{2}\left(\epsilon_{imn}\partial^{m}R^{nj}[\tilde{h}] + \epsilon_{jmn}\partial^{m}R^{ni}[\tilde{h}]\right),\label{res2} \end{equation} where the global factor has been chosen for future convenience. This expression is invariant under transformations of $\tilde{h}_{ij}$ having the same form as those defining the symmetries of conformal gravity, \begin{align} \delta \tilde{h}_{ij} = \partial_{i}\chi_{j} + \partial_{j}\chi_{i} + \delta_{ij}\chi, \end{align} as we could have expected. \medskip \section{Manifest duality invariance} \setcounter{equation}{0} We can now implement equations (\ref{res1}) and (\ref{res2}) in the action principle (\ref{actionfin}). Let us first we compute the quadratic term in $P^{ij}$: \begin{align} &\frac{1}{2}P^{ij}P_{ij} = 2\partial_{j} \tilde{K}_{ik}\partial^{j}\tilde{K}^{ik} + 2\partial^{k}\tilde{K}\partial^{l}\tilde{K}_{kl} \nn\\ &- \partial_{l}\tilde{K}\partial^{l}\tilde{K} - 3\partial^{l}\tilde{K}_{kl}\partial_{m}\tilde{K}^{km}. \end{align} Remarkably, this has exactly the same form as the quadratic terms in $K_{ij}$ appearing in the Hamiltonian (\ref{Ham}), and suggests an invariance under the transformation \begin{align} &K_{ij} \rightarrow \tilde{K}_{ij}, \nn\\ &\tilde{K}_{ij} \rightarrow -K_{ij}. \label{d1} \end{align} The kinetic term $P^{ij}\dot{K}_{ij}$ is also invariant under (\ref{d1}) (up to total derivatives): \begin{align} &P^{ij}\dot{K}_{ij} = 2\epsilon_{imn}\partial_{m}\tilde{K}_{jn}\dot{K}^{ij} \rightarrow -2\epsilon_{imn}\partial_{m}K_{jn}\dot{\tilde{K}}^{ij}\nn\\ & = 2\epsilon_{imn}\partial_{m}\tilde{K}_{jn}\dot{K}^{ij} + \text{total derivatives}. \end{align} \medskip Substituting now in the term $-2p^{ij}K_{ij}$, we find \begin{align} -2p^{ij}K_{ij} &= 2\epsilon_{imn}\partial^{m}R^{nj}[\tilde{h}]K_{ij} = -2\epsilon_{imn}R^{nj}[\tilde{h}]\partial_{m}K_{ij}\nn\\ &+\text{total derivatives}. \end{align} We may compare this expression with the term \begin{equation} -P^{ij}R_{ij}[h] = -2\epsilon_{imn}\partial_{m}\tilde{K}_{nj}R_{ij}[h] \end{equation} and see that these two are rotated into each other by the transformation (\ref{d1}) supplemented by \begin{align} &h_{ij}\rightarrow \tilde{h}_{ij}\nn\\ &\tilde{h}_{ij}\rightarrow -h_{ij}.\label{duality} \end{align} The kinetic term $\dot{h}_{ij}p^{ij}=-\dot{h}_{ij}\epsilon_{imn}\partial_{m}R_{nj}[\tilde{h}]$ is also invariant under (\ref{duality}) up to total derivatives: \begin{align} &-\dot{h}_{ij}\epsilon_{imn}\partial_{m}R_{nj}[\tilde{h}] = \frac{1}{2}\dot{h}_{ij}\epsilon_{imn}\partial_{m}(\Delta \tilde{h}_{nj} - \partial_{j}\partial_{k} \tilde{h}_{kn}) \nn\\ &\rightarrow -\frac{1}{2}\dot{\tilde{h}}_{ij}\epsilon_{imn}\partial_{m}(\Delta h_{nj} - \partial_{j}\partial_{k} h_{kn}) \nn\\ &= \frac{1}{2}\dot{h}_{ij}\epsilon_{imn}\partial_{m}(\Delta \tilde{h}_{nj} - \partial_{j}\partial_{k} \tilde{h}_{kn})+\text{total derivatives}. \end{align} So we conclude that, once the constraints are solved, the action principle (\ref{actionfin}) can be cast in the manifestly duality invariant form \begin{align} &S[h_{ij},\tilde{h}_{ij},K_{ij},\tilde{K}_{ij},] = \int d^{4}x [2\epsilon_{imn}\partial_{m}\tilde{K}_{jn}\dot{K}_{ij}\nn\\ & - \dot{h}_{ij}\epsilon_{imn}\partial_{m}R_{nj}[\tilde{h}] - \cH],\label{dualityactionfin} \end{align} where \begin{align} &-\cH = 2\epsilon_{imn}\partial^{m}\tilde{K}_{nj}R_{ij}[h] - 2\epsilon_{imn}\partial^{m}K_{ij}R_{nj}[\tilde{h}] \nn\\ & 2\partial_{j} K_{ik}\partial^{j}K^{ik} + 2\partial^{k}K\partial^{l}K_{kl} - \partial_{l}K\partial^{l}K - 3\partial^{l}K_{kl}\partial_{m}K^{km}\nn\\ &+ 2\partial_{j}\tilde{K}_{ik}\partial^{j}\tilde{K}^{ik} + 2\partial^{k}\tilde{K}\partial^{l}\tilde{K}_{kl} - \partial_{l}\tilde{K}\partial^{l}\tilde{K} - 3\partial^{l}\tilde{K}_{kl}\partial_{m}\tilde{K}^{km}\nn\\ \end{align} and we have dropped surface terms. One can verify that the action principle (\ref{dualityactionfin}) is actually invariant under continuous duality rotations of the dual metrics and extrinsic curvatures: \begin{align} \begin{pmatrix} h_{ij} \\ \tilde{h}_{ij} \end{pmatrix}&=\begin{pmatrix}\text{cos}\,\theta & \text{sin}\,\theta\\ -\text{sin}\,\theta & \text{cos}\,\theta \end{pmatrix}\begin{pmatrix} h_{ij}\\ \tilde{h}_{ij} \end{pmatrix}\nn\\ \nn\\ \begin{pmatrix} K_{ij} \\ \tilde{K}_{ij} \end{pmatrix}&=\begin{pmatrix}\text{cos}\,\theta & \text{sin}\,\theta\\ -\text{sin}\,\theta & \text{cos}\,\theta \end{pmatrix}\begin{pmatrix} K_{ij}\\ \tilde{K}_{ij} \end{pmatrix}. \end{align} \medskip \section{Conclusions} \setcounter{equation}{0} We have shown that electric-magnetic duality is a hidden symmetry of linearized conformal gravity, both at the level of the equations of motion and the action principle. In order to render the symmetry manifest, i.e. to establish a formulation where the ``electric'' and ``magnetic'' degrees of freedom appear on equal footing, it seems necessary to work in a non-manifestly space-time covariant framework. The covariant equations of motion and differential identities obeyed by the Weyl tensor and its Hodge dual can be recovered from a non-covariant subset of the twisted self-duality equation, where the electric and magnetic components of the Weyl tensors for two dual metrics appear on equal footing. The action principle is cast in a manifestly duality-invariant form as well, upon resolution of the constraints in the Hamiltonian formalism. The potentials that solve these constraints are interpreted as a dual three-dimensional metric and a dual extrinsic curvature. Duality acts as simultaneous rotations in the respective spaces spanned by the two metrics and the two extrinsic curvatures. \medskip There are several interesting directions for future work to be discussed. An important question is to determine whether a manifestly duality invariant action principle can be obtained upon linearization around more general backgrounds, in particular (anti) de Sitter space-time. The precise relation between the equations of motion obtained from the duality-symmetric action principle and the non-covariant twisted self-duality equation should be determined. Supersymmetric extensions can also be investigated, along the lines of the work \cite{susy}. Although we have not dealt with topological terms, it may be interesting to study the consequences of their presence: for instance, to investigate if they can cancel out the total derivatives produced by integration by parts in the process of rending the action principle in its manifestly duality-invariant form. Manifest space-time covariance of the action principle might be restored upon introduction of auxiliary fields, although those are expected either to enter in a non-polynomial fashion \cite{PST} or to appear in infinite number \cite{D}. Possible obstructions to manifest duality invariance at higher perturbative orders should also be explored \cite{deser2}. \medskip Electric-magnetic duality in abelian Yang-Mills theory has been discussed at the quantum level in the path-integral formulation \cite{witten}. Here one adds to the abelian action $S[A]$ a term $i\int B\wedge dF$ featuring an additional 1-form field $B$, such that integrating over it produces a delta functional $\delta(dF)$ allowing integration over not necessarily closed 2-forms $F$. If we instead integrate over $F$, the partition function written as an integral over $B$ takes the same form as expressed in terms of the original 1-form field $A$, but interchanging the coupling constant $e^2$ and the $\theta$-parameter. Whether a similar analysis can be performed in linearized conformal gravity seems an avenue worth exploring.
\section{Introduction} The objective of an output regulation problem is to control a given output of the plant to asymptotically track a prescribed reference trajectory and rejecting asymptotically undesired disturbances, both of which are generated by an exosystem, while keeping all the trajectories of the system bounded \cite{14,Astolfi5}. In contrast to \cite{14}, where the measured output of the plant was assumed to be continuous, in this work we consider that the output measurement streams are only available sporadically. Owing to the intermittent availability of the measured plant output, the classical output regulation theory based on the internal model principle in \cite{8} is not applicable. Output regulation problem for linear networked control systems with measurement intermittency has been addressed in the works of \cite{Astolfi5}, where the impulsive updates of the latest measurements from the plant are subjected to a zero-order holding device. With the assumption that the impulsive new measurement updates are held constant until the measurement arrives, the results of \cite{Astolfi5} are then extended to the case of minimum phase nonlinear systems in \cite{Astolfi6}. Output regulation problem with periodically sampled measurement updates for linear systems are studied by the authors of \cite{Lawrence9}, \cite{Fujioka10}. The works in \cite{Lawrence9, Fujioka10, Antunes11} do not take into account the intersampling behavior and phenomenon like uncertain time-varying transmission and scheduling are neglected. While these issues are addressed in the context of output regulation problems for linear networked control systems in \cite{Astolfi5}, the proposed continuous-discrete regulator therein keeps the received plant measurement constant in between the sampling times, which is a restrictive requirement. \subsection{Contribution} In this paper, we study the output regulation problem for LTI systems with aperiodically sampled measurements. The main contribution of the paper consists of showing how the ``pre-processing'' and ``post-processing'' architectures in \cite{Wang9} can be adapted by including suitable ``hybrid extensions'' to assure asymptotic output regulation in the presence of intermittent output measurements. For the two architectures, sufficient conditions in the form of matrix inequalities are provided. The two architectures are compared in terms of design complexity. In particular, we demonstrate that by opting for a ``post-processing paradigm'', the proposed design conditions are easier to handle from numerical standpoint as opposed to its counterpart, thereby offering greater design simplicity. The remainder of the paper is organized in the following manner. First, in Section~\ref{sec:1} we briefly present some preliminaries on classical output regulation problem, and hybrid systems theory. The construction of the hybrid linear regulator based on pre-processing of internal model along with the hybrid modeling of overall closed loop system is proposed in Section~\ref{sec:2}. The sufficient conditions concerning the stability of the overall closed loop system with intermittent measurements are given in Section~\ref{sec:3}. The solution to the output regulation problem with the post-processing architecture is offered in Section \ref{sec:7}. A numerical example illustrating the effectiveness of the proposed solution by both approaches is given in respective sections. Discussion on results and some concluding remarks are provided in Section \ref{sec:6}. \subsection{Notation} We will now introduce some notations which will be used throughout the text. The set $\mathbb{N}_{>0}$ is the set of all strictly positive integers and $\mathbb{N}=\mathbb{N}_{>0}\cup\{0\}$. The set of $\mathbb{R}_{>0}$\ (or $\mathbb{R}_{>=0}$) represent the set of positive (or non-negative) real numbers. $\mathbb{R}^{n\times{m}}$ represent the set of all real matrices with order $n\times{m}$. $I$ and $0$ are respectively the identity and null matrices of appropriate dimensions. A square, symmetric matrix $A=A^{\text{T}}$ with $A\geq{0}$\ (or $A>0$) implies that the matrix $A$ is a positive semi-definite (or a positive definite) and equivalently $-A$ is a negative semi-definite (or negative definite) matrix. Given square matrices $A_1,\ A_2,\ ,\cdots,\ A_N$ of compatible dimensions, $A=\text{blk diag}(A_1,A_2,\cdots,A_N)$ denotes a block diagonal matrix with the $i^{\text{th}}$ diagonal element being $A_i$ and $\text{col}(A_1,A_2,\cdots,A_N)=\begin{bmatrix}A^{\text{T}}_1,A^{\text{T}}_2,\cdots,A^{\text{T}}_{N}\end{bmatrix}^{\text{T}}$. For a square matrix $A$, $\sigma(A)$ is the spectrum of $A$, ${\He}(A)=A+A^{\text{T}}$, $\det(A)$ is the determinant and product of all eigenvalues of $A$. For $x,y\in\Re^{N}$, $\|x\|$ denotes the Euclidean norm of vector $x$, $\text{col}(x,y)=[x^{\text{T}},y^{\text{T}}]^{\text{T}}$, $\langle{x,y}\rangle$ is the standard inner product. Given a vector $x\in\Re^{N}$ and a nonempty set $\mathcal{A}\subset\Re^{N}$, the distance of $x$ to $\mathcal{A}$ is defined as $|x|_{\mathcal{A}}=\inf_{y\in\mathcal{A}}\|x-y\|$. \subsection{Preliminaries on hybrid Systems}\label{subsec:hy} We consider a hybrid system with state $x\in\mathbb{R}^{n}$ of the form \begin{equation}\label{eq:hy} \mathcal{H}\begin{cases} \dot{x}\ =\ f(x),~ x\in C\\ x^{+}\ \in\ G(x),~ x\in D, \end{cases} \end{equation} where the shorthand notation $\mathcal{H}=\{C,f,D,G\}$ comprises of the flow set $C$, flow map $f$, jump set $D$, and jump map $G$. A set $E\subset\mathbb{R}_{>=0}\times \mathbb{N}$ is said to be a hybrid time domain if it is the union of finite or infinite sequence of intervals $[t_j,t_{j+1})\times\{j\}$. A function $\phi:\text{dom}\ \phi\mapsto\mathbb{R}^{n}$ is a hybrid arc if $\text{dom}\ \phi$ is a hybrid time domain with $\phi(\cdot\ ,\ j)$ being locally absolutely continuous for each $j$. A solution to $\mathcal{H}$ is said to be \textit{complete} if its domain is unbounded and \textit{maximal}, and if it is not the truncation of another solution \cite{Ferrante12}. Given a hybrid system $\mathcal{H}$ in \eqref{eq:hy}, we say that $\mathcal{H}$ satisfies hybrid basic conditions \cite{Goebel13,Ferrante12}, if $C$ and $D$ are closed in $\mathbb{R}^{n}$, $f:\mathbb{R}^{n}\to\mathbb{R}^{n}$ is continuous and $G\rightrightarrows\mathbb{R}^{n}$ is locally bounded, nonempty, outer semicontinuous relatively in $D$. The following notion of global exponential stability is used in the paper. \begin{mydefinition}[\cite{teel2012lyapunov}] Given the set $\mathcal{A}$ be closed. The set $\mathcal{A}$ is said to be globally exponentially stable (GES) for $\mathcal{H}$ if there exists strictly positive real numbers $\lambda$ and $k$ such that for any initial condition every maximal solution $\phi$ to $\mathcal{H}$ is complete and satisfies for all $(t,j)\in\text{dom}\ \phi$ \begin{equation}\label{eq:16} |\phi(t,j)|_{\mathcal{A}}\leq k\ e^{-\lambda(t+j)}|\phi(0,0)|_{\mathcal{A}}. \end{equation} \end{mydefinition} \section{Problem Formulation}\label{sec:1} Consider a linear time-invariant plant of the form \begin{equation} \begin{aligned}\label{eq:plant} \mathcal{P}\begin{cases} \dot{x}_{p} &= A_{p}x_p+B_{p}u+E_{p}w,\\ y_{p} &= C_{p}x_p,\\ e_{p} &= y_{p}- y_{w},\\ y_w &= F_{p}w, \end{cases} \end{aligned} \end{equation} with $x_{p}\in\Re^{n_p},~u\in\Re^{m_p},~y_p,~e_p\in\Re^{p}$ being respectively the state, control law to be designed, measured and regulated output of the plant which we aim to regulate to zero. The exogenous signal $w\in\Re^{q}$ is generated by an exosystem of the form \begin{equation}\label{eq:2} \dot{w}=Sw, \end{equation} where the exosystem matrix $S$ is assumed to be neutrally stable, \emph{i.e.} $S$ has all eigenvalues on the imaginary axis. While $S$ is perfectly known, the exosystem state $w$ in \eqref{eq:2} not directly available for feedback design. The matrices $A_p, B_p, E_p, C_p$ and $F_p$ in \eqref{eq:plant} are constant matrices of appropriate dimensions and such that the pair $(A_p,C_p)$ is detectable. The output $y_p$ is available only at some isolated time instances $t_k, k\in{\mathbb{N}}_{>0}$, not known a priori. We assume that the sequence $\{t_k\}_{k=1}^{\infty}$ are strictly increasing, $t_k\to\infty$ as $k\to\infty$ and there exist two positive scalars $T_1$ and $T_2$ which uniformly bounds the consecutive intersampling intervals $[t_k,t_{k+1}]$ of $\{t_k\}$ as follows \begin{equation}\label{eq:3} 0\leq{t_1}\leq{T_2},~T_1\leq{t_{k+1}-t_k}\leq{T_2},~\forall{k}\in\mathbb{N}_{>0}. \end{equation} As noted in \cite{Ferrante3}, the strictly positive lower bound $T_1$ prevents the existence of accumulation points in the sequence $\{t_k\}_{k=1}^{\infty}$ and thus avoids zero behaviors. On the other hand, $T_2$ defines the maximum allowable transfer time (MATI) \cite{Postoyan7}. \subsection{Preliminaries on Linear Output Regulation Problem}\label{sec:prl} We now define the objectives of the output regulation problem. For system \eqref{eq:plant}, the output regulation problem is said to be solved if the following two conditions are satisfied. \begin{enumerate} \item When $w=0$, all the trajectories of the closed loop system exponentially converge to zero, \emph{i.e.} the origin of the unperturbed closed loop system $(w=0)$ is exponentially stable. \item When $w\neq{0}$, the trajectories of the closed loop system \eqref{eq:plant} are internally stable and the regulated output signal $e_p(t)$ exponentially converges to zero, \emph{i.e.} $\lim_{t\to\infty}e_p(t)=0$. \end{enumerate} We now consider the following two assumptions which are required to guarantee the solvability of the classical output regulation problem \cite{14,8}. \begin{myassumptions}\label{as:1} The matrix pair $(A_p,B_p)$ is stabilizable and $(A_p,C_p)$ is detectable.\hfill $\diamond$ \end{myassumptions} \begin{myassumptions}\label{as:2} The matrix $\begin{bmatrix}A_p-\lambda{I} & B_p\\C_p & 0\end{bmatrix},\ \lambda\in\sigma(S)$ is of full rank or equivalently there exists a unique solution pair $(X_p,R)$ to the following linear regulator equation \begin{equation}\label{eq:4} \begin{aligned} X_pS &=A_pX_p+B_p{R}+E_p,\\ 0 &=C_pX_p-F_p, \end{aligned} \end{equation} where the matrix $X_p$ uniquely defines the steady state $x_p=X_pw$ on which the regulated output $e_{p}=0$. Additionally, the steady state input $u=Rw$ renders the given manifold $x_p=X_pw$ positively invariant. \hfill $\diamond$ \end{myassumptions} As noted in \cite{14}, under Assumptions \ref{as:1}, \ref{as:2}, the output regulation problem for the plant \eqref{eq:plant} is solvable by the dynamic error feedback control of the form \begin{equation} \begin{aligned}\label{eq:5} u &={K}z,~ \dot{z} &=\mathcal{G}_{1}z+\mathcal{G}_{2}e_p, \end{aligned} \end{equation} where $z\in\Re^{n_z}$ is the regulator state to be specified later and the constant controller gain matrices $\mathcal{G}_1$ and $\mathcal{G}_{2}$ of appropriate dimensions are defined as \begin{equation}\label{eq:6} \begin{aligned} \mathcal{G}_{1} &=T\begin{bmatrix}S_1 & S_2\\S_3 & G_1\end{bmatrix}{T^{-1}},~\mathcal{G}_{2}=T\begin{bmatrix}S_4\\G_2\end{bmatrix},\\ G_1 &=\text{blk diag}(\beta_1,\beta_2,\cdots,\beta_p),\\ {G}_2 &=\text{blk diag}(\gamma_1,\gamma_2,\cdots,\gamma_p), \end{aligned} \end{equation} with $\sigma(G_1)=\sigma(S)$, and $\beta_i,\ \gamma_i$ respectively being a constant square matrix and a column vector of dimension $d_i\in{\mathbb{N}}_{>0}$ such that the pair $(\beta_i,\gamma_i)$ is controllable and the matrix $\hat{A} =\begin{bmatrix}A & BK\\\mathcal{G}_{2}C& \mathcal{G}_1\end{bmatrix}$ is Hurwitz. The matrices $S_1,\ S_2,\ S_3,\ S_4$ are arbitrary constant matrices of appropriate dimensions and $T\in\Re^{n_z\times{n_z}}$ is any nonsingular matrix. Therefore, when the signals $y_p$ and $y_w$ are continuously measured, the requirements for the solvability of the output regulation problem are said to be satisfied with Assumptions \ref{as:1} and \ref{as:2}. \section{Solution Outline by Pre-processing architecture of Internal Model}\label{sec:2} \subsection{Proposed Controller} Since the output of the plant is available sporadically, we propose a control scheme, depicted in Fig. \ref{fig.1}, constituted by a preprocessing of an internal model $\mathcal{G}$ of the exosystem \cite{Bin14}, stabilizing controller $\mathcal{K}$, and a holding device $\mathcal{J}$. In the proposed control scheme, the plant $\mathcal{P}$ along with the internal model of the exosystem $\mathcal{G}$, viewed together as an extended continuous plant $\hat{\mathcal{P}}$ is stabilized by a dynamic controller $\mathcal{K}$ which relies on the continuous regulated error signal $\theta$ generated by the holding device $\mathcal{J}$. The hold device $\mathcal{J}$ receives the intermittent regulated error signal $e(t_k)$ available from the output of the sampler $\mathcal{S}$ at every nonuniform time instants $t_k$. With a little abuse of notation from \eqref{eq:5}, the continuous-time internal model controller $\mathcal{G}$ and its input to the plant $\mathcal{P}$ is given as follows \begin{equation}\label{eq:int_model} \mathcal{G}\left\{ \begin{aligned} &\dot{z}=G_{1}z+G_{2}v\\ &u= Kz \end{aligned}\right. \end{equation} where $K\in\mathbb{R}^{m_{p}\times{n}_{z}}$ is a controller gain matrix of the extended plant $\hat{\mathcal{P}}$, the internal model controller pair $(G_1,G_2)$ are defined in \eqref{eq:6}, and the continuous-time signal $v(t)\in\mathbb{R}^{n_v}$ is the output of the stabilizer, defined next. \begin{equation}\label{eq:stab} \mathcal{K} \begin{cases} \dot{x}_{c}= A_c{x_c} + B_c{\theta},\\ v \ = C_c{x_{c}} + D_c{\theta}, \end{cases} \end{equation} where $x_{c}\in\mathbb{R}^{n_p+n_z}$ is the stabilizer state and $\theta\in\mathbb{R}^{p}$ is the state of the holding device $\mathcal{J}$. From the controller state $x_{c}(t)$ and last received measurement of the regulated output $e_{p}(t)$, the holding device $\mathcal{J}$ generates an intersample signal to feed the stabilizer $\mathcal{K}$. For all $k\in\mathbb{N}_{>0}$ The dynamics of the holding device $\mathcal{J}$ is given as follows \begin{equation}\label{eq:theta} \mathcal{J} \begin{cases} \dot{\theta}(t)= H\theta + Ex_c,\ \text{if}\,\,t\neq\ t_k,\\ \theta(t^+)= e_p(t),\hspace{4ex}\ \text{if}\,\,t=t_k. \end{cases} \end{equation} The arrival of new measurements instantaneously updates $\theta(t)$ to $e_p(t)$ and in between updates the holding state $\theta$ evolves according to the continuous dynamics of \eqref{eq:theta}. In the next section, we present the hybrid modeling of the overall closed loop system in the presence of sporadic measurements of the regulated output $e_{p}(t)$. But, to simplify our analysis in the modeling stage, we first transform coordinates of the plant state $x_p$, internal model state $z$, and holding state $\theta$ as follows. \begin{figure} \centering \includegraphics[width=0.48\textwidth]{schematic2.jpg} \caption{{\label{fig.1}} Schematic representation of the closed loop system with sporadic measurements under ``pre-processing'' architecture. Continuous-time signals are marked with solid arrows, while the sporadic measurements are with dashed arrows.}\vspace{-1ex} \end{figure} \begin{equation}\label{eq:coord} \tilde{x}_p=x_p-X_p{w},\ \tilde{z}=z-Zw,\ \tilde{\theta}=\theta-e_p, \end{equation} where $X_p$ is a solution to the linear regulator equation \eqref{eq:4}, and $Z\in\mathbb{R}^{q\times{n_z}}$ is a transformation matrix which by virtue of internal model principle \cite{14} satisfies \begin{equation}\label{eq:Z} ZS=G_1{Z},\ KZ=R \end{equation} with $G_1$ and $K$ given in \eqref{eq:int_model}. \subsection{Hybrid modeling} The hybrid closed-loop system with state $\tilde{x}=\text{col}(\tilde{x}_p,\tilde{z},x_c)$\ $\in\mathbb{R}^{2(n_p+n_z)}$ and jumps in $\theta(t)$, depicted in Fig. \ref{fig.1}, is described as follows \begin{equation}\label{eq:cl} \begin{aligned} & \dot{\tilde{x}} = \mathbb{A}\ \tilde{x} + \mathbb{B}\ \tilde{\theta},~\dot{\tilde{\theta}} = H\tilde{\theta} + \mathbb{J}\ \tilde{x},~t\neq{t_k},\\ & \tilde{x}(t^+) =\tilde{x},~\tilde{\theta}(t^+)=0,\hspace{10ex}t=t_k, \end{aligned} \end{equation} where \begin{align*} \mathbb{A} &=\begin{bmatrix}A+BD_c{C} & B{C_c}\\B_c{C} & A_c\end{bmatrix}, \mathbb{B}=\begin{bmatrix}B{D_c}\\B_c\end{bmatrix},\nonumber\\ \mathbb{J} &=\begin{bmatrix}HC-C{A} & E\end{bmatrix},\ A=\begin{bmatrix}A_p & B_p{K}\\0 & G_1\end{bmatrix},\\ B &=\begin{bmatrix}0\\G_2\end{bmatrix}, C=\begin{bmatrix}C_p & 0\end{bmatrix}. \end{align*} Similar to \cite{Ferrante3}, we now introduce a timer variable $\tau$ which keeps track of the duration of flows and triggers a jump when certain condition is violated. Therefore, from \cite{Ferrante3,Ferrante12}, $\tau$ is made to decrease as ordinary time increases satisfying \eqref{eq:3} and it resets to any point in $[T_1,T_2]$ when $\tau$ reaches $0$. The overall closed loop system composed of the states $\tilde{x},\ \tilde{\theta},\ \tau$ can then be represented by the following hybrid system \begin{equation}\label{eq:14} \mathcal{H}_{cl}\begin{cases} \dot{\tilde{\mathbf{x}}} &=f(\tilde{\mathbf{x}}),~\tilde{\mathbf{x}}\in {C},\\ \tilde{\mathbf{x}}^{+} &=G(\tilde{\mathbf{x}}),~\tilde{\mathbf{x}}\in{D}, \end{cases} \end{equation} \subsection{Problem Statement}\label{sub:prob_state} To solve the output regulation problem, we introduce the compact set \begin{equation} \label{eq:A} \mathcal{A}\coloneqq \{0\}\times\{0\}\times[0, T_2]\subset\mathbb{R}^{n_p+n_z+1} \end{equation} and the design the controller so that $\mathcal{A}$ is globally exponentially stable for hybrid system \eqref{eq:14}. \begin{problem} Given the extended plant model $\hat{\mathcal{P}}$ composed of $\mathcal{P}$ in \eqref{eq:plant} and internal model $\mathcal{G}$ in \eqref{eq:int_model}, design control $\Delta_{\mathcal{K}}$ and hold parameter $\Delta_{\mathcal{J}}$ \begin{equation} \Delta_{\mathcal{K}}=\left[\begin{array}{c|c}A_c & B_c \\ \hline C_c & D_c\end{array}\right],\ \Delta_{\mathcal{J}}=\left[\begin{array}{c|c} H & E\end{array}\right] \end{equation} such that the set $\mathcal{A}$ defined in \eqref{eq:A} is GES for the hybrid system $\mathcal{H}_{cl}$.\hfill$\diamond$ \label{prob:Design} \end{problem} \section{Main Results}\label{sec:3} In this section, we provide sufficient stability conditions to solve Problem~\ref{prob:Design}. To this end, following \cite{Ferrante12}, we introduce the following property, whose role is clarified later in Theorems~\ref{th:1} and \ref{th:2}. we consider the fo Lyapunov function $V(\tilde{\mathbf{x}})$ for $\mathcal{H}_{cl}$ in the form as $\mathbf{V}(\tilde{\mathbf{x}})=W_1(\tilde{x})+W_{2}(\tilde{\theta},\tau)$, where $W_{1}(\tilde{x})=\tilde{x}^{\text{T}}P_{1}\tilde{x}, W_{2}(\tilde{\theta},\tau)=e^{\delta\tau}{\tilde{\theta}}^{\text{T}}P_2\tilde{\theta}$ with $P_1\in\mathbb{R}^{2(n_p+n_z)\times{2(n_p+n_z)}},\ P_2\in\mathbb{R}^{p\times{p}}>0$ and $\tau\in [0,T_2]$. Take $\chi_1=\min(\lambda_{\min}(P_1),\lambda_{\min}(P_2))$, $\chi_2=\max(\lambda_{\max}(P_1),e^{\delta{T_2}}\lambda_{\max}(P_2))$, then \begin{equation}\label{eq:chi} \chi_{1}|\tilde{\mathbf{x}}|_{\mathcal{A}}^{2}\leq{\mathbf{V}(\tilde{\mathbf{x}})}\leq\chi_{2}|\tilde{\mathbf{x}}|_{\mathcal{A}}^{2}. \end{equation} \begin{property} Consider positive definite continuously differentiable functions $W_{1}(\tilde{x})$ and $W_2(\tilde{\theta},\tau)$ with flow maps in \eqref{eq:14}. There exist positive definite functions $\rho_1\in\mathbb{R}^{2(n_p+n_z)}\to\mathbb{R}$, $\rho_{2}\in\mathbb{R}^{p}\to\mathbb{R}$, $\omega_{1}\in\mathbb{R}^{p}\to\mathbb{R}$, $\omega_{2}\in\mathbb{R}^{2(n_p+n_z)}\to\mathbb{R}$, positive scalars $k_1,~k_2$ such that $\forall\ (\tilde{x},v_1)\in\mathbb{R}^{2(n_p+n_z)+p}$, and $(\tilde{\theta},\tau,v_2)\in\mathbb{R}^{p}\times{[0,T_2]}\times\mathbb{R}^{2(n_p+n_z)}$ we have \begin{align} \langle\ {\nabla W_{1}(\tilde{x}),\mathbb{A}\tilde{x}+\mathbb{B}v_1}\ \rangle &\leq{-\rho_{1}}(\tilde{x})+\rho_{2}(v_{1}),\label{eq:19}\\ \langle\ {\nabla W_{2}({\tilde{\theta}},\tau), (H\tilde{\theta}+\mathbb{J}{v}_{2}}, -1)\ \rangle &\leq{-\omega_{1}}(\tilde{\theta})+\omega_{2}(v_{2}),\label{eq:20}\\ -\rho_{1}(\tilde{x})+\omega_{2}(\tilde{x}) & \leq{-k_1}\|\tilde{x}\|^2,\label{eq:21}\\ -\omega_{1}(\tilde{\theta})+\rho_{2}(\tilde{\theta}) & \leq{-k_2}\|\tilde{\theta}\|^2\label{eq:22} \end{align} \hfill$\diamond$ \end{property} \begin{mytheorem}[\cite{Ferrante12}]\label{th:1} Let \textit{Property 1} hold. Then the set $\mathcal{A}$ in \eqref{eq:A} is globally exponentially for the hybrid system $\mathcal{H}_{cl}$. \QEDB \end{mytheorem} \begin{proof} {From \eqref{eq:chi}, we observe that the Lyapunov function $\mathbf{V}(\tilde{\mathbf{x}})$ is bounded between two monotonically increasing functions. Next, for each $\tilde{\mathbf{x}}\in{D}$ and a scalar $v_3\in [0,T_2]$ with $\bar{g}(\tilde{\mathbf{x}})=(\tilde{x},0,v_3)\in G(\tilde{\mathbf{x}})$ we have \begin{equation}\label{eq:23} \mathbf{V}(\bar{g})\!-\!\mathbf{V}(\tilde{\mathbf{x}})\!=\!W_2(0,\!v_3)-W_2(\tilde{\theta},\!0)\!\leq\!\!{-\lambda_{\max}(\!P_2)}\|\tilde{\theta}\|^2. \end{equation} On the other hand, by evaluating $\dot{\mathbf{V}}=\langle {\nabla \mathbf{V}(\tilde{\mathbf{x}}), f(\tilde{\mathbf{x}})} \rangle$ along flow directions in \eqref{eq:14} and by virtue of equations \eqref{eq:19} - \eqref{eq:22}, we obtain \begin{align} & \langle {\nabla \mathbf{V}(\tilde{\mathbf{x}}), f(\tilde{\mathbf{x}})} \rangle \!=\! \langle {\nabla W_1,\mathbb{A}\tilde{x}\!+\!\mathbb{B}\tilde{\theta}} \rangle \!+\! \langle {\nabla {W}_2, \mathbb{J}\tilde{x}\!+\!H\tilde{\theta}} \rangle\nonumber\\ & \leq -\rho_{1}(\tilde{x})+\rho_{2}(\tilde{\theta})-\omega_{1}(\tilde{\theta})+\omega_{2}(\tilde{x})\nonumber\\ & \leq -k_1(\|\tilde{x}\|^2)-k_2(\|\tilde{\theta}\|^2)\leq -\chi_3\ |\tilde{\mathbf{x}}|^2_{\mathcal{A}},\label{eq:24} \end{align} where $\chi_3=\min(k_1,k_2)$. From \eqref{eq:chi}, $\dot{\mathbf{V}}$ in \eqref{eq:24} yields $\dot{\mathbf{V}}(\tilde{\mathbf{x}})\leq -\dfrac{\chi_3}{\chi_2}\ \mathbf{V}(\tilde{\mathbf{x}})$ for all $\tilde{x}\in C$, and therefore, thanks to \eqref{eq:23}, $\forall\ (t,j)\in \text{dom}\ \phi_{cl}$, \begin{equation} \mathbf{V}(\phi_{cl}(t,j)) \leq e^{-\dfrac{\chi_3}{\chi_2}t} \mathbf{V}(\phi_{cl}(0,0)),\nonumber \end{equation} or equivalently, \begin{align} |\phi_{cl}(t,j)|_{\mathcal{A}} &\leq \sqrt{\dfrac{\chi_{2}}{\chi_{1}}} \ e^{-\dfrac{\chi_3}{2\chi_2}t}|\phi_{cl}(0,0)|_{\mathcal{A}}. \end{align} As a result, the conditions of global exponential stability \eqref{eq:16} are satisfied with $\lambda\in \bigg(0,\dfrac{\chi_{3}T_1}{2\chi_{2}(1+T_1)}\bigg]$ and $k_{cl}=\sqrt{\dfrac{\chi_2}{\chi_1}}e^{\omega},\ \omega\geq\lambda$ and hence the set $\mathcal{A}$ is globally exponentially stable with respect to $\mathcal{H}_{cl}$.} \end{proof} \begin{mytheorem} \label{th:2} If there exist symmetric positive definite matrices $P_3,P_4\in\mathbb{R}^{2(n_p+n_z)\times{2(n_p+n_z)}}$, $P_5, P_6\in\mathbb{R}^{p\times{p}}$, and matrices $A_c\in\mathbb{R}^{(n_p+n_z)\times{(n_p+n_z)}}$, $B_c\in\mathbb{R}^{(n_p+n_z)\times{p}}$, $C_c\in\mathbb{R}^{n_v\times{(n_p+n_z)}}$, $D_c\in\mathbb{R}^{n_v\times{p}}$, $H\in\mathbb{R}^{p\times{p}}$, $E\in\mathbb{R}^{p\times{(n_p+n_z)}}$ be such that \begin{align} & P_3-P_4 \prec 0,\label{eq:26}\\ & P_5-P_6 \prec 0,\label{eq:27}\\ & \mathcal{M}_{1} = \begin{bmatrix}{\He}(P_1\mathbb{A})+P_4 & P_1\mathbb{B}\\ \mathbb{B}^{\text{T}}P_1 & -P_5 \end{bmatrix} \preceq {0},\label{eq:28}\\ & \mathcal{M}_2(0)\preceq{0},\ \mathcal{M}_{2}(T_2)\preceq {0},\label{eq:29} \end{align} where $\mathcal{M}_{2}(\tau)=\begin{bmatrix}e^{\delta\tau}\Big[{\He}(P_2H)-\delta{P_2}\Big]+P_6 & e^{\delta\tau}P_2\mathbb{J}\\ e^{\delta\tau}\mathbb{J}^{\text{T}}P_2 & -P_3\end{bmatrix}$ with $\tau\in[0,T_2]$, then \textit{Property 1} holds. \QEDB \end{mytheorem} \begin{proof} Define $\rho_1(\tilde{x})=\tilde{x}^{T}P_4\tilde{x}$, $\rho_{2}(\tilde{\theta})=\tilde{\theta}^{\text{T}}P_5\tilde{\theta}$, $\omega_{1}(\tilde{\theta})=\tilde{\theta}^{\text{T}}P_6\tilde{\theta}$, $\omega_{2}(\tilde{x})=\tilde{x}^{\text{T}}P_3\tilde{x}$. Now we evaluate $\dot{W}_{1}$ as \begin{align} \dot{W}_{1}(\tilde{x}) &=\langle \nabla W_{1}(\tilde{x}),\mathbb{A}\tilde{x}+\mathbb{B}\tilde{\theta} \rangle=\dot{\tilde{x}}^{\text{T}}P_1\tilde{x}+\tilde{x}^{\text{T}}P_1\dot{\tilde{x}}\nonumber\\ & =\tilde{x}^{\text{T}}{\He}(P_1\mathbb{A})\tilde{x}+\tilde{\theta}^{\text{T}}\mathbb{B}^{\text{T}}P_1\tilde{x}+\tilde{x}^{\text{T}}P_1\mathbb{B}\ \tilde{\theta}. \end{align} By virtue of \eqref{eq:28}, we thus obtain $\Omega_{1}(\tilde{x},\tilde{\theta})=\dot{W}_{1}+\tilde{x}^{\text{T}}P_4\tilde{x}-\tilde{\theta}^{\text{T}}P_5\tilde{\theta}=\begin{bmatrix}\tilde{x}^{\text{T}} & \tilde{\theta}^{\text{T}}\end{bmatrix}\mathcal{M}_{1}\begin{bmatrix}\tilde{x}\\\tilde{\theta}\end{bmatrix}\leq{0}$, which as a consequence yields \eqref{eq:19}. On the other hand, \begin{align} &\dot{W}_{2}=e^{\delta\tau}\dot{\tilde{\theta}}^{\text{T}}P_2\tilde{\theta}+e^{\delta\tau}{\tilde{\theta}}^{\text{T}}P_2\dot{\tilde{\theta}}-\delta{e^{\delta\tau}}\tilde{\theta}^{\text{T}}P_2\tilde{\theta}\nonumber\\ &=e^{\delta\tau}\Big[\tilde{\theta}^{\text{T}}\Big({\He}(P_2{H})\!-\!\delta{P_2})\tilde{\theta}\!+\!\tilde{x}^{\text{T}}\mathbb{J}^{\text{T}}P_2\tilde{\theta}\!+\!\tilde{\theta}^{\text{T}}P_2\mathbb{J}\tilde{x}\Big].\label{eq:31} \end{align} Then, $\Omega_{2}(\tilde{x},\tilde{\theta})\!=\!\dot{W}_{2}+\tilde{\theta}^{\text{T}}P_6\tilde{\theta}-\tilde{x}^{\text{T}}P_3\tilde{x}=\begin{bmatrix}\tilde{x}^{\text{T}}\! & \! \tilde{\theta}^{\text{T}}\end{bmatrix}\!\mathcal{M}_{2}(\tau)\!\begin{bmatrix}\tilde{x}\\\tilde{\theta}\end{bmatrix}$, which is a convex expression with respect to each value of $\tau\in [0,T_2]$ and therefore, for each $\tau$, there exists $\alpha(\tau)$ such that $\mathcal{M}_{2}(\tau)=\alpha(\tau)\mathcal{M}_{2}(0)+(1-\alpha(\tau))\mathcal{M}_{2}(T_2)$. By virtue of $\mathcal{M}_{2}(0),\ \mathcal{M}_{2}(T_2)\leq{0}$, we thus obtain $\mathcal{M}_{2}(\tau)\leq {0}$ and consequently $\Omega_{2}(\tilde{x},\tilde{\theta})\leq{0}$, which in turn yields \eqref{eq:20}. Since $\dot{\Omega}_{1}(\tilde{x},\tilde{\theta}),\ \dot{\Omega}_{2}(\tilde{\theta},\tau)\leq{0}$, we further obtain from Eqns. \eqref{eq:26} and \eqref{eq:27} \begin{align} \dot{\mathbf{V}} &=\dot{W}_{1}+\dot{W}_{2}\leq \tilde{x}^{\text{T}}(P_3-P_{4})\tilde{x}+\tilde{\theta}^{\text{T}}(P_5-P_6)\tilde{\theta}\nonumber\\ & \leq \lambda_{\max}(P_3-P_4)\|{\tilde{x}}\|^2+\lambda_{\max}(P_5-P_6)\|\tilde{\theta}\|^2\nonumber\\ & \leq -k_1\|\tilde{x}\|^2-k_2\|\tilde{\theta}\|^2\leq -\chi_3 |\tilde{\mathbf{x}}|^2_{\mathcal{A}}<0, \end{align} where $k_1=-\lambda_{\max}(P_3-P_4)$, $k_2=-\lambda_{\max}(P_5-P_6)$, and as a result, the last two conditions of \textit{Property 1} are evident. \end{proof} Theorem~\ref{th:2} provides sufficient conditions to guarantee the exponential stability of $\mathcal{H}_{cl}$ with respect to $\mathcal{A}$. However, these conditions in \eqref{eq:26} - \eqref{eq:29} can not be directly used for designing the decision variables $P_1,\ P_2,\ A_c,\ B_c,\ C_c,\ D_c$ and $\delta$. Therefore, some matrix manipulations are required to turn these conditions into an LMI feasibility problem. The proposed control solution to the output regulation problem by the pre-processing architecture is an extension of the results on exponential stabilization of LTI systems in the presence of aperiodic sampling, presented in \cite{Ferrante12}. \subsection{LMI based Regulator Design}\label{subsec:4} In this section, we perform matrix and variable manipulations to turn conditions \eqref{eq:26} - \eqref{eq:29} into a tractable LMI based controller design procedure. First, we find the Schur complement of \eqref{eq:28} as \begin{equation}\label{eq:33} \bar{\mathcal{M}}_{1} =\begin{bmatrix}{\He}(P_1\mathbb{A}) & P_1\mathbb{B} & I\\ \mathbb{B}^{\text{T}}P_1 & -P_5 & 0\\ I & 0 & -P_8 \end{bmatrix} \preceq{0} \end{equation} where $P_8=P^{-1}_{4}$. Therefore, \eqref{eq:26} now becomes \begin{equation}\label{eq:34} P_3 - P^{-1}_{8} \prec 0, \end{equation} which is not an LMI with respect to $P_8$. To transform this into an LMI, we need to find an upper bound of $P_3$ in \eqref{eq:34} in terms of $P_8$. From Lemma 1 of \cite{Ferrante12}, for all $\alpha\in\mathbb{R}$, $P^{-1}_{8}$ and $P_8$ are related by the following inequality \begin{equation} \label{eq:35} P^{-1}_{8}\succ 2\alpha{I}-\alpha^2P_8. \end{equation} Therefore, from \eqref{eq:35}, the matrix conditions in \eqref{eq:34} are met if we assume that the following LMI holds: \begin{equation} \label{eq:36} P_3-2\alpha{I}+\alpha^{2}P_8\prec 0,\ \alpha\in\mathbb{R}. \end{equation} Next, in \eqref{eq:33}, we observe that the nonlinear terms are associated with the decision variable $P_1$. Let us now characterize the structure of $P_1$ as \begin{equation} \begin{aligned} \label{eq:37} P_1 &=\begin{bmatrix}X & U\\ U^{T} & W \end{bmatrix},\ P^{-1}_1=\begin{bmatrix}Y & V\\V^{\text{T}} & Z\end{bmatrix}, \end{aligned} \end{equation} where $\ X,Y,Z,W\in\mathbb{R}^{n_p+n_z}>0,\ {\det}(U)\neq{0},\ {\det}{V}\neq{0}$ for $U,V\in\mathbb{R}^{n_p+n_z}$. From \eqref{eq:37}, we obtain $W=-V^{-1}YU=-V^{-1}Y(I-XY)V^{-T}$ since $XY+UV^{\text{T}}=I$, and therefore $P_1$ becomes \begin{equation} \label{eq:38} P_1=\left[\begin{array}{c|c}X & U \\ \hline \noalign{\vspace{0.7ex}} {U^{T}} & -V^{-1}(Y-YXY)V^{-T}\end{array}\right]. \end{equation} Next, define a matrix $\Psi=\begin{bmatrix}Y & I\\V^{\text{T}} & 0\end{bmatrix}$ which is nonsingular as ${\det}(V)\neq{0}$. Since $P_1>0$, we also obtain \begin{equation} \label{eq:39} \bar{P}_{1}=\Psi^{\text{T}}P_1\Psi=\begin{bmatrix}Y & I\\I & X\end{bmatrix}>0, \end{equation} and then by congruence transformation on $\bar{\mathcal{M}}_{1}$, \eqref{eq:33} yields \begin{align} \hat{\mathcal{M}}_{1} &=\text{blkdiag}(\Psi^{\text{T}},I,I)\ \bar{\mathcal{M}}_{1}\ \text{blk diag}(\Psi,I,I)\nonumber\\ &= \begin{bmatrix}\Psi^{\text{T}}{\He}(P_1\mathbb{A})\Psi & \Psi^{\text{T}}P_1\mathbb{B} & \Psi^{\text{T}}\\ \mathbb{B}^{\text{T}}P_1\Psi & -P_5 & 0\\ \Psi & 0 & -P_8 \end{bmatrix}\nonumber\\ &={\He}\Bigg(\begin{bmatrix}\Psi^{\text{T}}P_1\mathbb{A}\Psi & \Psi^{\text{T}}P_1\mathbb{B} & 0\\ 0 & -P_5 & 0\\ \Psi & 0 & -P_8\end{bmatrix}\Bigg) \leq{0}, \label{eq:40con} \end{align} which is still not an LMI. By performing the change of variables as in \cite{Ferrante12} we define $K_1\in\mathbb{R}^{n_v\times(n_p+n_z)}$, $K_2\in\mathbb{R}^{n_v\times{p}}$, $K_3\in\mathbb{R}^{(n_p+n_z)\times(n_p+n_z)}$, $K_4\in\mathbb{R}^{(n_p+n_z)\times{p}}$ such that \begin{align} & \begin{bmatrix}K1 & K_2\\K_3-XAY & K_4\end{bmatrix}=\!\!\begin{bmatrix}I & 0\\XB & U\end{bmatrix}\!\!\begin{bmatrix}D_c & C_c\\B_c & A_c\end{bmatrix}\!\!\begin{bmatrix}CY & I\\V^{\text{T}} & 0\end{bmatrix}\nonumber\\ & \Delta_{\mathcal{K}}=\begin{bmatrix}U^{-1} & -U^{-1}XB\\0 & I\end{bmatrix}\Gamma_{\mathcal{K}}\begin{bmatrix}V^{-T} & 0\\-C{Y}V^{-T} & I\end{bmatrix}, \label{eq:41} \end{align} where $\Gamma_{\mathcal{K}}=\begin{bmatrix}K_3-XA{Y} & K_4\\K_1 & K_2\end{bmatrix}$. Then, by substituting the results of \eqref{eq:41} in \eqref{eq:40con} we obtain \begin{align} \hat{\mathcal{M}}_{1} &={\He}\Bigg(\begin{bmatrix}\Pi_{1} & \Pi_2 & 0\\0 & -P_5 & 0\\\Psi & 0 & -P_8 \end{bmatrix}\Bigg)\leq{0}, \label{eq:42}\\ \Pi_{1} &=\begin{bmatrix}A{Y}+BK_1 & A_0+B{K_2}C\\ K_3 & XA+K_{4}C\end{bmatrix},\Pi_{2}=\begin{bmatrix}BK_2\\K_4\end{bmatrix},\nonumber \end{align} which is an LMI with respect to $X, Y, V, K_i,~i=1,2,3,4$. Next, by defining $Z_1=P_2{H}$ and $Z_2=P_2{E}$, it can be easily shown that the equation \eqref{eq:29} can be turned into an LMI with respect to the decision variables $P_2,Z_{1},Z_2,P_6$. The hold gain $\Delta_{\mathcal{J}}$ thus becomes \begin{equation} \label{eq:42.1} \Delta_{\mathcal{J}}=\left[\begin{array}{c|c}P^{-1}_{2}Z_1 & P^{-1}_{2}E\end{array}\right]. \end{equation} In what follows is a proposition with a set of LMIs giving sufficient conditions to solve \textit{Problem 1}. The proof of the results in Proposition \ref{prop.1} appear in \cite{Ferrante12}. \begin{myproposition} \label{prop.1} Given a plant $\mathcal{P}$ in \eqref{eq:plant} with internal model controller $\mathcal{G}$ in \eqref{eq:int_model}, real scalars $\alpha,\delta>0$, $X,Y\in\mathbb{R}^{(n_p+n_z)\times(n_p+n_z)}>0$, $P_3,P_8\in\mathbb{R}^{2(n_p+n_z)\times{2}(n_p+n_z)}>0$, $P_5, P_6\in\mathbb{R}^{p\times{p}}>0$, $V\in\mathbb{R}^{(n_p+n_z)\times{(n_p+n_z)}}$ with ${\det} (V)\neq{0}$, $K_1\in\mathbb{R}^{n_v\times(n_p+n_z)}$, $K_2\in\mathbb{R}^{n_v\times{p}}$, $K_3\in\mathbb{R}^{(n_p+n_z)\times(n_p+n_z)}$, $K_4\in\mathbb{R}^{(n_p+n_z)\times{p}}$, $Z_{1}\in\mathbb{R}^{p\times{p}}, Z_{2}\in\mathbb{R}^{p\times(n_p+n_z)}$ such that \begin{align} \bar{P}_{1} &=\begin{bmatrix}Y & I\\I & X\end{bmatrix}>0,\label{eq:43}\\ \hat{\mathcal{M}}_{1} &={\He}\Bigg(\begin{bmatrix}\Pi_{1} & \Pi_2 & 0\\0 & -P_5 & 0\\\Psi & 0 & -P_8 \end{bmatrix}\Bigg)\leq{0}\label{eq:44}\\ P_3 & -2\alpha{I}+\alpha^2{P_8}<0,\label{eq:45}\\ P_5 & -P_6 <0,\label{eq:46}\\ \hat{\mathcal{M}}_{2}(0) &\leq{0},\ \hat{\mathcal{M}}_{2}(T_2)\leq {0},\label{eq:47} \end{align} where $\mathcal{M}_{2}(\tau)=\left[\begin{array}{c|c}e^{\delta\tau}\Lambda_{1}+P_6 & e^{\delta\tau}\Lambda_{2}\\\noalign{\vspace{0.7ex}}\hline\noalign{\vspace{0.7ex}} e^{\delta\tau}\Lambda^{\text{T}}_{2} & -P_3\end{array}\right]$, $\Lambda_{1}={\He}(Z_1)-\delta{P_2}$, $\Lambda_{2}=\begin{bmatrix}Z_1C_0-P_2C_0A_0 & Z_2\end{bmatrix}$, $\Psi=\begin{bmatrix}Y & I\\V^{\text{T}} & 0\end{bmatrix}$, \begin{align} \Pi_{1}&=\begin{bmatrix}A{Y}+BK_1 & A_0+B{K_2}C\\ K_3 & XA+K_{4}C\end{bmatrix},~\Pi_{2}=\begin{bmatrix}BK_2\\K_4\end{bmatrix}.\label{eq:34a2} \end{align} Let $U\in\mathbb{R}^{(n_p+n_z)\times(n_p+n_z)}$ be any nonsingular matrix such that \begin{equation}\label{eq:48} XY+UV^{\text{T}}=I. \end{equation} Then the conditions in Theorem \ref{th:2} and subsequently those of \textit{Property 1} are satisfied. With the selection of control and hold gains as in \begin{align} \Delta_{\mathcal{K}}&=\begin{bmatrix}U^{-1} & \!\!\!-U^{-1}\!X\!B\\0 & I\end{bmatrix}\!\!\begin{bmatrix}K_3\!-\!XA{Y} & \!\!\!K_4\\K_1 & \!\!\!K_2\end{bmatrix}\!\!\begin{bmatrix}V^{-T} & \!\!\!0\\\!-C{Y}V^{-T} & \!\!\!I\end{bmatrix},\nonumber\\ \Delta_{\mathcal{J}}&=\left[\begin{array}{c|c}P^{-1}_{2}Z_1 & P^{-1}_{2}E\end{array}\right],\label{eq:con_hold} \end{align} the solution to \textit{Problem 1} is obtained. \end{myproposition} \begin{proof} We have previously stated that the sufficient stability conditions in Theorem \ref{th:2} satisfy the requirements of \textit{Property 1} and subsequently achieve global exponential stability of $\mathcal{H}_{cl}$. However, the conditions in Theorem \ref{th:2} cannot be immediately adopted to pursue the design of stabilizer and hold control matrices $\Delta_{\mathcal{K}}$, $\Delta_{\mathcal{J}}$ and therefore if we can now show that the equations \eqref{eq:43} - \eqref{eq:47} provide an alternative stability conditions in terms of LMI, then \textit{Problem 1} is turned into a feasibility problem of these LMIs and solution to these LMIs eventually lead us to derive $\Delta_{\mathcal{K}}$, $\Delta_{\mathcal{J}}$ of \textit{Problem 1}. \textit{proof of \eqref{eq:43}}: Since $P_1>0$ with $P_1$ in \eqref{eq:38} is not an LMI with respect to $X,Y$ and $V$, we perform congruence transformation on $P_1>0$ with multiplying $\Psi=\begin{bmatrix}Y & I\\V^{\text{T}} & 0\end{bmatrix}$ and $\Psi^{\text{T}}$ respectively on either side of this inequality to yield $\bar{P}_{1}>0$ in \eqref{eq:43}. The inequality in \eqref{eq:43} is linear with respect to $X,Y$ and ${P}_{1}>0\Longleftrightarrow{\bar{P}_1}>0$. \textit{Proof of \eqref{eq:44}}: $\mathcal{M}_{1}$ in \eqref{eq:28} is nonlinear with respect to $P_1,A_c,B_c,C_c,D_c$. By using Schur complement on $\mathcal{M}_{1}$, an equivalent simpler inequality in terms of $\bar{\mathcal{M}}_{1}$ is obtained in \eqref{eq:33}. After congruence transformation on \eqref{eq:33} and subsequent change of variables, $\hat{\mathcal{M}_{1}}$ yields \eqref{eq:44}, which is now linear with respect to $X,Y,V,K_1,K_2,K_3,K_4,P_5,P_8$. \textit{Proof of \eqref{eq:45}}: As we have noted earlier, $\hat{\mathcal{M}}_{1}$ is linear with respect to $P_8$. However, with the substitution of $P_4=P^{-1}_{8}$, \eqref{eq:26} yields \eqref{eq:34} which is not an LMI with respect to $P_8$. From Lemma 1 of \cite{Ferrante12}, we have shown earlier that the LMI in \eqref{eq:45} indeed satisfies \eqref{eq:35} for any $\alpha\in\mathbb{R}$. Notice that the LMI conditions in \eqref{eq:27} and \eqref{eq:46} are unchanged. Furthermore, the proof of \eqref{eq:47} directly follows from \eqref{eq:29} by setting $Z_1=P_2{H}$ and $Z_{2}=P_2{E}$. Therefore, the set of LMIs in \eqref{eq:43} - \eqref{eq:48} are equivalent sufficient stability conditions for asserting global exponential stability of $\mathcal{H}_{cl}$. Furthermore, once we solve these LMIs, then with the decision variables in \textit{Proposition 1}, we construct our stabilizer and hold matrix $\Delta_{\mathcal{K}}$ and $\Delta_{\mathcal{J}}$ respectively in \eqref{eq:41} and \eqref{eq:42.1}. This concludes the proof. \end{proof} \subsection{Illustrative Example:} \label{sub:sec} In this section, we present a numerical example to illustrate the effectiveness of our designed stabilizer for the following plant: \begin{equation} \begin{aligned} A_p & =\begin{bmatrix}-2 &1\\0 & -0.8\end{bmatrix},B_p=\begin{bmatrix}0\\1\end{bmatrix},E_p\!=\!\begin{bmatrix}1 &0\end{bmatrix},\\ C_p & = 10E_p,~F_p\!=20B^{\text{T}}_{p}, \label{eq:ex1} \end{aligned} \end{equation} and exosystem \eqref{eq:2} is a single frequency harmonic oscillator of the form \begin{equation}\label{eq:ex2} S = \begin{bmatrix}0 & 1\\-1 & 0\end{bmatrix},~\sigma(S)\ =\ \pm\ 1i. \end{equation} It is easy to verify that the Assumptions \ref{as:1}, \ref{as:2} are satisfied. Then, according to \cite{14}, we select $1$- copy internal model of the exosystem \eqref{eq:int_model} as \begin{equation}\label{eq:eq36} G_1=\begin{bmatrix}0 & 1\\-1 & 0\end{bmatrix}, G_2=\begin{bmatrix}0\\1\end{bmatrix}. \end{equation} With the above system parameters of the extended plant model $\hat{\mathcal{P}}$ in Fig. \ref{fig.1}, we then proceed to obtain a numerical solution to the set of LMIs in Proposition~\ref{prop.1}. Numerical solutions to LMIs are obtained through a YALMIP toolbox \cite{Lofberg7} in Matlab\textsuperscript{\textcopyright} and SDPT3 solver \cite{tutuncu6}. To enforce the nonsingularity of matrix $V$ in \textit{Proposition} \ref{prop.1} and avoid ill-conditioned controller matrix $\Delta_{\mathcal{K}}$ \eqref{eq:con_hold}, following \cite{Ferrante12}, we respectively consider two additional constraints \begin{align} V + V^{\text{T}} \succ 0,~ -50\bar{P}_{1} \preceq {\Pi_1+\Pi^{\text{T}}_{1}} \preceq -0.2\bar{P}_{1}, \label{eq:53} \end{align} where matrices $\bar{P}_{1}$ and $\Pi_{1}$ are defined in \eqref{eq:43} and \eqref{eq:34a2}. With our proposed design methodology, we find a feasible solution to the LMIs in \textit{Proposition} \ref{prop.1} for $T_2 = 0.3$, $\alpha = 4.35$, $\delta=3.5$ and the stabilizer and hold gain matrices are given as follows \begin{align} A_c & \!=\!\! \begin{bmatrix}\!-2.05 & \!0.78 & \!-0.084 & \!-0.063\\\!-4.76 & \!-3.27 & \!-0.417 & \!-0.055\\ \!-7.799 & \!-6.4 & \!-4.47 & \!1.259\\ \!40.98 & \!19.73 & \!-2.48 & \!-20.32 \end{bmatrix}\!,B_c\!=\!\begin{bmatrix}0.003\\0.13\\0.2\\-1.08\end{bmatrix}\!,\nonumber\\ C_c & = \begin{bmatrix}184.05 & \!\!103.39 & \!\!11.27 & \!\!-78.5\end{bmatrix}\!,D_c\!=\!-4.827,\nonumber\\ H & =-2.135, E=\!\begin{bmatrix}-2.13 & \!\!\!0.0014 & \!\!\!0.0171 & \!\!\!-0.0003\end{bmatrix}\!\!. \nonumber \end{align} With these controller parameters, and minimum dwell time $T_1 = 0.1$, we observe from Figs.~\ref{fig.4} that the plant output successfully tracks the reference exosystem trajectory $F_pw$ and the regulated output goes to zero. \begin{figure} \centering \includegraphics[width=1\linewidth]{schematic4.jpg} \caption{Sample and hold regulated output $e(t)$ with dashed lines indicating jumps in it.}\vspace{-2.5ex} \label{fig.4} \end{figure} \section{Postprocessing with hybrid internal model}\label{sec:7} \begin{figure} \centering \includegraphics[width=0.48\textwidth]{Schematic3.jpg} \caption{{\label{fig.1a}} Schematic representation of the closed loop system with sporadic measurements under ``post-processing'' architecture. Continuous-time signals are marked with solid arrows, while the sporadic measurements are with dashed arrows.}\vspace{-1ex} \end{figure} In this section, we illustrate how the postprocessing paradigm can be exploited in the setting of this paper to solve the output regulation problem. In particular, one interesting aspect that emerges is that in postprocessing internal model control, the internal model is continuously fed via the regulation error, which however in our setting is available only intermittently. To overcome this problem, we propose to augment a classical internal-model $\mathcal{G}$ with a hybrid estimator $\mathcal{O}$, as shown in Fig. \ref{fig.1a}, which provides a converging estimate of the regulation error based on the intermittent measurement. This gives rise to a ``hybrid internal model''. With a little abuse of notation, we consider the following architecture for the internal model: \begin{equation}\label{eq:int_model2} \mathcal{G}\left\{ \begin{aligned} &\dot{z}=G_{1}z+G_{2}\hat{e}_{p},\hspace{18ex}\text{if}~t\neq{t_k},\\ &z(t^{+})= z(t),\hspace{22ex}\text{if}~t={t_k},\\ &u_{i}= Kz, \end{aligned}\right. \end{equation} where $z\in\mathbb{R}^{n_z}$ is the state vector of the internal model $\mathcal{G}$, and the input to the internal model $\hat{e}_{p}$ is an estimated output of $e_{p}$ by the hybrid observer $\mathcal{O}$ \begin{equation}\label{eq:h.o} \mathcal{O}\left\{ \begin{aligned} &\dot{\chi} = \mathsf{T}\chi,\hspace{26ex}\text{if}~t\neq{t_k}\\ &\chi(t^+) =\mathsf{L_1}\chi(t)+\mathsf{L_2}e_p(t),\hspace{9.5ex}\text{if}~t={t_k},\\ &\hat{e}_{p} = \mathsf{H}\chi, \end{aligned}\right. \end{equation} with the observer matrices $\mathsf{L}_i,~i=1,2$, and $\mathsf{T}$ to be designed later and $\chi\in\R^{n_\chi}$ being the state variable of the hybrid observer $\mathcal{O}$. The output $u_i$ in \eqref{eq:int_model2} of the above internal model is fed to a standard LTI continuous-time stabilizer $\mathcal{K}$ with state vector $x_k\in\mathbb{R}^{n_k}$ as \begin{equation}\label{eq:40} \mathcal{K}\left\{\begin{aligned} &\dot{x}_k = A_kx_k+B_k{u_i},\hspace{12ex}\text{if}~t\neq{t_k},\\ &x_k(t^+) = x_k(t),\hspace{16ex}\text{if}~t={t_k},\\ & u(t) = C_k x_k(t)+D_ku_{i}(t). \end{aligned}\right. \end{equation} Before moving forward, we suppose the following assumption holds. \begin{myassumptions} \label{assu:francis} Let $$ A_{cl}=\!\!\begin{bmatrix} A_p&\!\!\!B_pC_k\\ 0&\!\!\!A_k \end{bmatrix}, B_{cl}=\!\!\begin{bmatrix} B_pD_k\\ B_k \end{bmatrix}\!\!K, \mathsf{H}_{1}= \begin{bmatrix}C_p&\!\!\!\!0_{p\times{n_k}}\end{bmatrix}, $$ and for all $\lambda\in\sigma(S)$, the matrix $$\begin{bmatrix}A_{cl}-\lambda I & B_{cl}\\\mathsf{H}_{1} & 0\end{bmatrix} $$ is full rank. \end{myassumptions} Assumption~\ref{assu:francis} ensures the existence of a pair $(X_M, Z)$ such that: \begin{equation}\label{eq:Francis} \begin{aligned} X_MS &=A_{cl}X_M+B_{cl}{Z}+E_{cl},\\ 0 &=\mathsf{H}_{1}X_M-F_p, \end{aligned} \end{equation} where $E_{cl}^{\text{T}}\coloneqq \begin{bmatrix} E_p^{\text{T}} &0 \end{bmatrix}$, $Z\in\mathbb{R}^{q\times{n_z}}$ satisfying $ZS=GZ$ by virtue of internal model principle. We show later that Assumption~\ref{assu:francis} is fulfilled under some natural conditions. Let us define an augmented stabilizer-plant system with the state vector $x_{M}=\text{col}(x_p,x_k)$ as \begin{equation} \begin{aligned} & \dot{x}_{M}= A_{cl}x_{M}+B_{cl}z+E_{cl}w,\hspace{6ex}\text{if}~t\neq{t_k},\\ & e_{p}= \mathsf{H}_{1}x_{M}-F_{p}w,\\ & x_{M}(t^{+})= x_{M},\hspace{19.8ex}\text{if}~t={t_k}, \end{aligned} \end{equation} where internal model state $z$ evolves according to \eqref{eq:int_model2} and is rewritten as \begin{equation} \begin{aligned} &\dot{z}=G_{1}z+G_{2}\mathsf{H}_{1}\chi,\hspace{16ex}\text{if}~t\neq{t_k},\\ &z(t^{+})=z(t),\hspace{21.7ex}\text{if}~t={t_k}. \end{aligned} \end{equation} By using the change of coordinates $\tilde{x}_{M}=x_{M}-X_{M}w, \tilde{z}=z-Zw$ and defining $\tilde{x}_{\alpha}=\text{col}(\tilde{x}_{M},\tilde{z})$ with $X_{M}$ and $Z$ being solution to \eqref{eq:Francis} and \eqref{eq:Z} respectively, the augmented system $\hat{\mathcal{P}}$ in Figure \ref{fig.1a} consisting of the stabilizer-plant and internal model dynamics in transformed coordinates yield the following form \begin{equation}\label{eq:eq40} \begin{aligned} & \dot{\tilde{x}}_{\alpha} = \mathfrak{A}_{c}\tilde{x}_{\alpha}+\mathfrak{B}_{c}(\mathsf{H}\chi-\begin{bmatrix}\mathsf{H}_{1}&0\end{bmatrix}\tilde{x}_{\alpha}),\hspace{2.4ex}\text{if}~t\neq{t_k},\\ & \tilde{x}_{\alpha}(t^{+}) = \tilde{x}_{\alpha},\hspace{24.8ex}\text{if}~t={t_k}, \end{aligned} \end{equation} where \begin{equation} \begin{aligned} \mathfrak{A}_{c}= \mathfrak{A}\!+\!\mathfrak{B}_{c}\begin{bmatrix}\mathsf{H}_{1}&0\end{bmatrix}, \mathfrak{A}=\begin{bmatrix}A_{cl} & B_{cl}\\0 & G_{1}\end{bmatrix}, \mathfrak{B}_{c} = \begin{bmatrix}0\\G_{2}\end{bmatrix}.\nonumber \end{aligned} \end{equation} At this stage it is clear that to solve the output regulation problem, $\mathsf{T}$ and $\mathsf{L}_{i},~i=1,2$ in \eqref{eq:h.o} need to be designed to ensure that $\tilde{e}_p\coloneqq (e_p-\hat{e}_p)$ approaches zero asymptotically. To this end, we pick $n_\chi=n_p+n_k+n_z+p$, we denote $\chi=(\chi_1, \chi_2)\in\R^{n_p+n_k+n_z}\times \R^{p}$. The state component $\chi_{1}$ can be viewed as an estimate of $\tilde{x}_{\alpha}$ in \eqref{eq:eq40} and $\chi_{2}$ of $\tilde{e}_{p}$. Based on this, let us now select the observer parameters as \begin{equation}\label{eq:eq45} \begin{aligned} \mathsf{T} & = \begin{bmatrix}\mathfrak{A}_{c} & Q\\0 & W\end{bmatrix}, \mathsf{L}_{1}=\begin{bmatrix}I & 0\\-\mathsf{H}_{2} & 0\end{bmatrix}, \mathsf{L}_{2}=\begin{bmatrix}0\\I\end{bmatrix},\\ \mathsf{H}_{2} &=\begin{bmatrix}\mathsf{H}_{1} & 0\end{bmatrix}, \mathsf{H}=\begin{bmatrix}\mathsf{H}_{2}&0\end{bmatrix}, \end{aligned} \end{equation} where $Q\in\R^{(n_p+ n_k+n_z)\times p}$ and $W\in\R^{p\times p}$ are to be designed. By introducing a clock variable $\tau$, defining $\tilde{\chi}_{1}=\tilde{x}_{\alpha}-\chi_{1}$, $\tilde{\chi}_{2}=\chi_{2}-\mathsf{H}_{2}\tilde{\chi}_{1}$, the overall closed-loop hybrid dynamical system with state vector $\tilde{\mathbf{x}}=\text{col}(\tilde{x}_{c},\tau), \tilde{x}_{c}=\text{col}(\chi_{1},\tilde{\chi}_{1},\tilde{\chi}_{2})$ yields \eqref{eq:14}, where \begin{equation}\label{eq:eq42} \begin{aligned} f(\tilde{\mathbf{x}}) & = \text{blk diag}\left(\begin{bmatrix}\mathfrak{A}_{c} & \begin{array}{cc}Q\mathsf{H}_{2}& Q\end{array}\\0 & h(\tilde{\chi}_{1},\tilde{\chi}_{2})\end{bmatrix},-1\right),\\ h(\tilde{\chi}_{1},\tilde{\chi}_{2}) & = \begin{bmatrix}\mathfrak{A}-Q\mathsf{H}_{2} & -Q\\W\mathsf{H}_{2}-\mathsf{H}_{2}(\mathfrak{A}-Q\mathsf{H}_{2}) & W+\mathsf{H}_{2}Q\end{bmatrix},\\ \mathcal{C} & = \mathbb{R}^{2(n_p+n_k+n_z)+p}\times\left[0,T_2\right],\\ G(\tilde{\mathbf{x}}^{+}) & =\text{blk diag}(I,0,\tau^{+}), \tau^{+}\in\left[T_1,T_2\right],\\ \mathcal{D} & = \mathbb{R}^{2(n_p+n_k+n_z)+p}\times\{0\}. \end{aligned} \end{equation} Let us now consider the following assumption. \begin{myassumptions} \label{as:LyapIM} The matrix $\mathfrak{A}_c$ is Hurwitz and there exist $\mathcal{W}\colon\R^{n_\chi+1}\rightarrow\R$ and positive real numbers $\boldsymbol{\omega}_1$, $\boldsymbol{\omega}_2$, $\boldsymbol{\varrho}$ such that for all $(\tilde{\chi}_1, \tilde{\chi}_2,\tau)\in\R^{n_\chi}\times [0, T_2]$: $$ \begin{aligned} &\boldsymbol{\omega}_1(\tilde{\chi}_1^{\text{T}} \tilde{\chi}_1+\tilde{\chi}_2^{\text{T}} \tilde{\chi}_2)\leq \mathcal{W}(\tilde{\chi}_1, \tilde{\chi}_2,\tau)\leq\boldsymbol{\omega}_2(\tilde{\chi}_1^{\text{T}} \tilde{\chi}_1+\tilde{\chi}_2^\top \tilde{\chi}_2)\\ &\langle\nabla{\mathcal{W}}(\tilde{\chi}_1, \tilde{\chi}_2,\tau), (h(\tilde{\chi}_1, \tilde{\chi}_2),-1) \rangle\leq -\boldsymbol{\varrho} (\tilde{\chi}_1^\top \tilde{\chi}_1+\tilde{\chi}_2^\top \tilde{\chi}_2)\\ &\mathcal{W}(\tilde{\chi}_1, 0,\nu)-\mathcal{W}(\tilde{\chi}_1, \tilde{\chi}_2,0)\leq 0\qquad \forall\nu\in[T_1, T_2] \end{aligned} $$ \end{myassumptions} The result given next shows that under Assumption~\ref{as:LyapIM} the output regulation problem is solved. \begin{mytheorem} \label{the:OutputObserver} Let Assumption~\ref{as:LyapIM} hold. Then, the following items hold: \begin{itemize} \item[($i$)] Assumption~\ref{assu:francis} holds; \item[($ii$)] the set \begin{equation} \label{eq:setIM} \mathcal{A}_I\coloneqq \{0\}\times [0, T_2]\subset \R^{2(n_p+n_z+n_k)+p}\times\R \end{equation} is globally exponentially stable for \eqref{eq:14} with flow/jump maps and their respective domains given in \eqref{eq:eq42}. \end{itemize} \end{mytheorem} \begin{proof} To prove item $(i)$, it suffices to notice that if $$\mathfrak{A}_c=\mathfrak{A}+\mathfrak{B}_{c}\mathsf{H}_{2}$$ is Hurwitz, then the triple $\left(\mathfrak{A},\mathfrak{B}_{c},\mathsf{H}_{2}\right)$ is stabilizable and detectable. Therefore, one has that for all $\lambda\in\mathbb{C}_+$, the matrix $$ \begin{aligned} \rk&\begin{bmatrix} A_{cl}-\lambda I&B_{cl}&0\\ 0&G_1-\lambda I&G_2 \end{bmatrix}=n_p+n_k+n_z\\ \rk&\begin{bmatrix} A_{cl}-\lambda I&B_{cl}\\ 0&G_1-\lambda I\\ \mathsf{H}_{1}&0 \end{bmatrix}=n_p+n_k+n_z \end{aligned} $$ From the second condition above, it turns out that for all $\lambda\in\sigma(G_1)=\sigma(S)\subset\mathbb{C}_+$ $$ \rk\begin{bmatrix} A_{cl}-\lambda I&B_{cl}\\ \mathsf{H}_{1}&0\\ 0&G_1-\lambda I \end{bmatrix}=n_p+n_k+n_z $$ which is equivalent to Assumption~\ref{assu:francis}. To show item $(ii)$, we rely on the cascade structure of \eqref{eq:14} with flow/jump maps and domain sets given in \eqref{eq:eq42}. Define for all $\boldsymbol{\tilde{x}}\in\mathcal{C}$ $$ \mathcal{U}(\boldsymbol{\tilde{x}})\coloneqq \chi_1^{\text{T}}\boldsymbol{\mathcal{P}}\chi_1+ \mathcal{W}(\tilde{\chi}_1,\tilde{\chi}_2,\tau) $$ where $\boldsymbol{\mathcal{P}}=\boldsymbol{\mathcal{P}}^{\text{T}}> 0$ is such that $$ \He(\boldsymbol{\mathcal{P}}\mathfrak{A}_c)=-\boldsymbol{\mathcal{Q}} $$ for some $\boldsymbol{\mathcal{Q}}=\boldsymbol{\mathcal{Q}}^{\text{T}}> 0$. Such a selection of $\boldsymbol{\mathcal{P}}$ and $\boldsymbol{\mathcal{Q}}$ is possible due to $\mathfrak{A}_c$ being Hurwitz. Observe that for all $\boldsymbol{\tilde{x}}\in\mathcal{C}$, \begin{align} & \boldsymbol{\alpha}_1\vert \boldsymbol{\tilde{x}}\vert^2_{\mathcal{A}_{I}} \leq \mathcal{U}(\mathbf{\tilde{x}}) \leq \boldsymbol{\alpha}_2\vert \mathbf{\tilde{x}}\vert^2_{\mathcal{A}_{I}},\text{with}\label{eq:SandwichW}\\ & \boldsymbol{\alpha}_1=\max\{\lambda_{\max}(\boldsymbol{\mathcal{P}}),\boldsymbol{\omega}_2\}, \boldsymbol{\alpha}_2= \min\{\lambda_{\min}(\boldsymbol{\mathcal{P}}),\boldsymbol{\omega}_1\}.\nonumber \end{align} Then, from Assumption~\ref{as:LyapIM}, for all $\boldsymbol{\tilde{x}}\in\mathcal{C}$, one has $$ \begin{aligned} &\langle \nabla \mathcal{U}(\boldsymbol{\tilde{x}}), f(\boldsymbol{\tilde{x}})\rangle\leq -\chi_1^{\text{T}}\boldsymbol{\mathcal{Q}}\chi_1-\boldsymbol{\varrho}(\tilde{\chi}_1^\top \tilde{\chi}_1+\tilde{\chi}_2^\top \tilde{\chi}_2)\\ &\hspace{6ex}+2\chi_1^{\text{T}}\boldsymbol{\mathcal{P}}Q\mathsf{H}_{2}\tilde{\chi}_1+2\chi_1^{\text{T}}\boldsymbol{\mathcal{P}}Q\tilde{\chi}_2, \end{aligned} $$ which by using Young inequality yields, for all $\boldsymbol{\tilde{x}}\in\mathcal{C}$: \begin{align} &\langle \nabla \mathcal{U}(\boldsymbol{\tilde{x}}), f(\boldsymbol{\tilde{x}})\rangle\!\leq\!\chi_1^\top(-\boldsymbol{\mathcal{Q}}+(\varpi_{0}+\varpi_{1}) I)\chi_1+\!\tilde{\chi_1}^{\text{T}}\!\!\left(-\boldsymbol{\varrho}I\right.\nonumber\\ &\left.+\dfrac{1}{\varpi_{0}}\mathsf{H}^{\text{T}}_{2} Q^{\text{T}}\boldsymbol{\mathcal{P}}^2Q\mathsf{H}_{2}\!\!\right)\!\tilde{\chi}_{1}\!+\!\tilde{\chi}^{\text{T}}_{2}\left(\!\!-\boldsymbol{\varrho}I\!\!+\!\!\dfrac{1}{\varpi_{1}}Q^{\text{T}}\boldsymbol{\mathcal{P}}^{2}Q\!\right)\!\tilde{\chi}_{2},\label{eq:Young} \end{align} for any $\varpi_{0},\varpi_{1}>0$. At this stage, select $\varpi_{0}$ and $\varpi_{1}$ such that \begin{equation}\label{eq:eq46} \begin{aligned} &-\boldsymbol{\mathcal{Q}}+(\varpi_{0}+\varpi_{1}) I< 0,\\ &-\boldsymbol{\varrho}I+\dfrac{1}{\varpi_{0}}\mathsf{H}^{\text{T}}_{2}Q^{\text{T}}\boldsymbol{\mathcal{P}}^{2}Q\mathsf{H}_{2}~<~0,\\ &-\boldsymbol{\varrho}I+\dfrac{1}{\varpi_{1}}Q^{\text{T}}\boldsymbol{\mathcal{P}}^{2}Q~<~0. \end{aligned} \end{equation} Then, from \eqref{eq:Young} for all $\boldsymbol{\tilde{x}}\in\mathcal{C}$, $\langle \nabla \mathcal{U}(\boldsymbol{\tilde{x}}), f(\boldsymbol{\tilde{x}})\rangle$ yields \begin{equation} \begin{aligned} &\langle \nabla \mathcal{U}(\boldsymbol{\tilde{x}}), f(\boldsymbol{\tilde{x}})\rangle\leq-\lambda_c\vert \boldsymbol{\tilde{x}}\vert^2_{\mathcal{A}_{I}}, \end{aligned} \label{eq:WdotFinal} \end{equation} where $\lambda_c\coloneqq\min\left\{\vert\lambda_{c_1}\vert,\left\vert\lambda_{c_2}\right\vert,\left\vert\lambda_{c_3}\right\vert \right\}$ with \begin{equation} \begin{aligned} \lambda_{c_1}&=\lambda_{\max}\left(-\boldsymbol{\mathcal{Q}}+(\varpi_{0}+\varpi_{1}) I\right),\\ \lambda_{c_2}&=\lambda_{\max}\left(-\boldsymbol{\varrho}I+\dfrac{1}{\varpi_{0}}\mathsf{H}^{\text{T}}_{2}Q^{\text{T}}\boldsymbol{\mathcal{P}}^{2}Q\mathsf{H}_{2}\right),\\ \lambda_{c_3}&=\lambda_{\max}\left(-\boldsymbol{\varrho}I+\dfrac{1}{\varpi_{1}}Q^{\text{T}}\boldsymbol{\mathcal{P}}^{2}Q\right). \end{aligned} \end{equation} For a specific choice of $\varpi_{0}$ and $\varpi_{1}$ satisfying $\dfrac{\varpi_{0}}{\varpi_{1}}\geq\|\mathsf{H}_{2}\|^2$, $\varpi_{0}+\varpi_{1}<\lambda_{\min}(\boldsymbol{\mathcal{Q}})$, it can be easily shown that all the conditions in \eqref{eq:eq46} hold. Now observe that, from Assumption~\ref{as:LyapIM}, for all $\boldsymbol{\tilde{x}}\in\mathcal{D}$, $g\coloneqq (g_{\chi_1}, g_{\tilde{\chi_1}},g_{\tilde{\chi_2}},g_{\tau})\in G(\boldsymbol{\tilde{x}})$ one has \begin{equation} \label{eq:DeltaW} \mathcal{U}(g)-\mathcal{U}(\boldsymbol{\tilde{x}})=\mathcal{W}(g_{\tilde{\chi_1}},g_{\tilde{\chi_2}},g_{\tau})-\mathcal{W}(\tilde{\chi}_1,\tilde{\chi}_2,0)\leq 0. \end{equation} Let $\phi$ be any maximal solution to \eqref{eq:14}. Then, by using \eqref{eq:WdotFinal} and \eqref{eq:DeltaW}, direct integration of $\mathcal{U}\circ\phi$ yields: $$ \mathcal{U}(\phi(t, j))\leq e^{-\lambda_c t}\mathcal{U}(\phi(0,0))\quad\forall (t,j)\in\dom\phi $$ The latter, thanks to Lemma~1 of \cite{Ferrante3} yields, for some positive, solution independent, $\lambda_{0},\kappa$: $$ \mathcal{U}(\phi(t, j))\leq \kappa e^{-\lambda_{0} (t+j)}\mathcal{U}(\phi(0,0))\quad\forall (t,j)\in\dom\phi $$ which, thanks to \eqref{eq:SandwichW}, shows that the set $\mathcal{A}_I$ in \eqref{eq:setIM} is GES for \eqref{eq:14}. This concludes the proof. \end{proof} \begin{myproposition} Let $\bar{P}\in\mathbb{R}^{n_p+n_k+n_z}>0$, $\hat{P}\in\mathbb{R}^{p}>0$, $\bar{J}\in\R^{(n_p+n_k+n_z)\times p}$, $\hat{J}\in\R^{p\times p}$, $\delta>0$, such that \begin{equation} \label{eq:LMI_Design_Obser} \begin{aligned} &\begin{bmatrix} \He(\bar{P}\mathfrak{A}-\bar{J}\mathsf{H}_{2}) & -\bar{J}+(-\hat{P}\mathsf{H}_{2}\mathfrak{A}+\hat{J}\mathsf{H}_{2})^{\text{T}}\\ \bullet&-\delta \hat{P}+\He(\hat{J}) \end{bmatrix}< 0\\ &\begin{bmatrix} \He(\bar{P}\mathfrak{A}\!-\!\bar{J}\mathsf{H}_{2})&\!\!\!\!-\bar{J}+e^{\delta{T}_{2}}\left[-\hat{P}\mathsf{H}_{2}\mathfrak{A}+\hat{J}\mathsf{H}_{2}\right]^{\text{T}}\\ \bullet&\!\!\!\!e^{\delta{T}_{2}}\left[-\delta\hat{P}+\He(\hat{J})\right]\! \end{bmatrix}\!\!<\!0 \end{aligned} \end{equation} and $\mathfrak{A}_c$ be Hurwitz. Set $Q=\bar{P}^{-1}\bar{J}$, $W=\hat{P}^{-1}\hat{J}-\mathsf{H}_{2}Q$. Then, Assumption~\ref{as:LyapIM} holds with: \begin{equation}\label{eq:eq51} \mathcal{W}(\tilde{\chi}_1,\tilde{\chi}_2,\tau)=\tilde{\chi}_1^{\text{T}} \bar{P}\tilde{\chi}_1+e^{\delta\tau} \tilde{\chi}_2^{\text{T}}\hat{P}\tilde{\chi_2} \end{equation} \end{myproposition} \begin{proof} It is easy to show from \eqref{eq:eq51} that for all $(\tilde{\chi},\tau)\in\R^{n_\chi}\times [0, T_2]$, $\tilde{\chi}=\text{col}(\tilde{\chi}_{1},\tilde{\chi}_{2})$, \begin{align} &\boldsymbol{\omega}_{1}\|\tilde{\chi}\|^{2}\leq\mathcal{W}(\tilde{\chi},\tau)\leq\boldsymbol{\omega}_{2}\|\tilde{\chi}\|^{2}~\text{with}\nonumber\\ &\boldsymbol{\omega}_{1}=\min\left(\lambda_{\min}(\bar{P},\lambda_{\min}(\hat{P})\right),\nonumber\\&\boldsymbol{\omega}_{2}=\max\left(\lambda_{\max}(\bar{P},e^{\delta{T}_{2}}\lambda_{\max}(\hat{P})\right)\nonumber \end{align} and thus the first condition in Assumption \ref{as:LyapIM} is satisfied. By differentiating $\mathcal{W}$ in \eqref{eq:eq51} along the flow map $h(\tilde{\chi})$ in \eqref{eq:eq42} and with the substitution of $Q=\bar{P}^{-1}\bar{J}$ and $W=\hat{P}^{-1}\hat{J}-\mathsf{H}_{2}Q$ in the resulting expression, we obtain \begin{align} &\dot{\mathcal{W}}(\tilde{\chi},\tau)=\langle\nabla{\mathcal{W}}(\tilde{\chi},\tau), (h(\tilde{\chi}),-1) \rangle=\tilde{\chi}^{\text{T}}\mathcal{M}(\tau)\tilde{\chi},\\ &\mathcal{M}(\tau)\!=\!\!\!\begin{bmatrix} \!\He(\bar{P}\mathfrak{A}\!-\!\bar{J}\mathsf{H}_{2})&\!\!-\bar{J}\!\!+\!e^{\delta\tau}\!\!\left(-\mathfrak{A}^{\text{T}}\mathsf{H}^{\text{T}}_{2}\hat{P}\!+\!\mathsf{H}_{2}^{\text{T}}\hat{J}\right)\!\\ \bullet&\!\!\!\!e^{\delta\tau}\!\!\left(-\delta\hat{P}\!+\!\He(\hat{J})\right)\!\!\!\! \end{bmatrix}\!\!.\nonumber \end{align} From Lemma 3 of \cite{Ferrante3}, it is straightforward to show that there exists $\lambda^{'}:[0,\tau]\to\left[0,1\right]$ such that for each $\tau\in[0,T_2]$, $\mathcal{M}(\tau)=\lambda^{'}(\tau)\mathcal{M}(0)+(1-\lambda^{'}(\tau))\mathcal{M}(T_2)$. The satisfaction of the two LMIs in \eqref{eq:LMI_Design_Obser} then yields $\mathcal{M}(\tau)<0, \forall{\tau}\in\left[0,T_2\right]$, and thus the second condition in Assumption \ref{as:LyapIM} is satisfied. Furthermore, $\mathcal{W}(\tilde{\chi}_{1},0,v)-\mathcal{W}(\tilde{\chi},0)={-\tilde{\chi}_{2}}\hat{P}\tilde{\chi}_{2}<0$ and the third condition in Assumption \ref{as:LyapIM} is satisfied as well. From Theorem \ref{the:OutputObserver}, the set $\mathcal{A}_{I}$ in \eqref{eq:setIM} of the hybrid closed-loop system \eqref{eq:14} with flow/jump dynamics \eqref{eq:eq42} is therefore globally exponentially stable. This concludes the proof. \end{proof} To illustrate the effectiveness of the post-processing paradigm, let us reconsider the same example from Section \ref{sub:sec}. We design a continuous-time stabilizer satisfying \eqref{eq:40} with the stabilizer matrices given as follows \begin{align} A_{k} & = \begin{bmatrix}-7 &\!\!-3.28 &\!\!-1.03 &\!\! -1.18 &\!\!0.7\\ 0 &\!\!-9.7 &\!\!12.1 &\!\!0 &\!\!0\\ 0 &\!\!-12.1 &\!\!-5.78 &\!\!-4.19 &\!\!2.49\\ 0 &\!\!0 &\!\! 0 &\!\!-16.6 &\!\!6.8\\ 0 &\!\!0 &\!\!0 &\!\!-6.8\!\!&\!\!-16.6 \end{bmatrix},D_k=0,\nonumber\\ B_k & = \begin{bmatrix}-0.2 & -3 & 1 & -2 & 354.9\end{bmatrix}^{\text{T}},\label{eq:57}\\ C_{k} & = \begin{bmatrix}52.73& -178.33 & -56.3 & -64.3 & 38.2\end{bmatrix},\nonumber \end{align} which makes the closed-loop system matrix $\mathfrak{A}_{c}$ in \eqref{eq:eq40} Hurwitz. From \eqref{eq:57}, and by solving the LMIs in \eqref{eq:LMI_Design_Obser} we determine hybrid observer components \eqref{eq:eq45} as $$Q=\left[Q_1, Q_2\right]^{\text{T}}\ \text{with}~ Q_1=\begin{bmatrix}7.43 &\!\!7.44&\!\!-0.0065&\!\!0.01\end{bmatrix},$$ $$Q_2=\begin{bmatrix}0.16 & 2.81 & 5.07 & 0.28 & -0.25\end{bmatrix},~W=1.357.$$ The internal model controller parameter $G_1$ is same as in \eqref{eq:eq36} and $G_2=\begin{bmatrix}-5&-4\end{bmatrix}^{\text{T}}$. The post-processing regulator comprising of this hybrid observer, stabilizer and internal model controller parameters, given above, is then applied to the plant \eqref{eq:plant} and the simulation results are shown in Figure \ref{fig.ep}. We observe from Fig. \ref{fig.ep} that the hybrid observer successfully estimates the regulated output and along with the actual regulated output of the plant, this also converges to zero asymptotically. Thus, the objective of the output regulation problem is achieved under sporadic measurements. \begin{figure} \centering \includegraphics[width=1\linewidth]{schematic8.jpg} \caption{Regulated output of the plant and estimated regulated output by the observer.}\vspace{-3ex} \label{fig.ep} \end{figure} \begin{myremark} The main advantage introduced by the post-processing approach is that it permits to use a controller designed in a purely continuous-time setting, by extending the closed-loop system (as depicted in Figure~\ref{fig.1a}) via the proposed hybrid observer $\mathcal{O}$, to solve the output regulation problem in the presence of intermittent measurements. This, besides enabling the use of legacy controllers, it also allows to drastically simply the design of the regulator. As opposed, the approach presented in Section~\ref{sec:3}, which is based on the pre-processing paradigm, requires the design of a hybrid controller for the stabilization of the extended plant plant--internal model. This generally results into higher order controllers and a more intricate design approach. \end{myremark} \section{Conclusion}\label{sec:6} In this paper, we studied the output regulation problem for LTI plants with sporadically sampled output measurements. Due to measurements being available at sporadic time instances, we propose a hybrid regulator that is composed of a continuous-time controller fed by hybrid intersample device. The resulting closed-loop system is modeled as hybrid dynamical system. Within this setting, we revisit two classical paradigms for output regulation problem: postprocessing and preprocessing internal model. In both scenarios, hinging upon Lyapunov tools for hybrid dynamical system, sufficient conditions in the form of matrix inequalities have been provided for the design of a regulator ensuring internal stability and exponential output regulation. With the use of a continuous-time controller, We also observed that the post-processing paradigm allows greater design simplicity as compared to the pre-processing counterpart. Building upon this post-processing paradigm, in future we would like to extend this study for solving cooperative output regulation problem of multi-agent system under sporadically available measurements from the agents. \bibliographystyle{IEEEtran}
\section{Introduction} Let $\ell(\pi)$ denote the number of cycles of a permutation $\pi\in S_n$. Let $\phi_0,\phi_1,\ldots,\phi_{n-1}$ be the Foulkes characters of $S_n$, so $\phi_i$ is afforded by the sum of Specht modules $V_\beta$ with $\beta$ of border shape with $n$ boxes and $i+1$ rows. For history and properties, see Chapter 8 of Kerber's book \cite{Kerber}. Our starting point is the classical fact that the $\phi_i$'s depend only on length in the sense that \begin{equation}\label{length property} \phi_i(\sigma)=\phi_i(\tau)\quad\text{whenever}\quad \ell(\sigma)=\ell(\tau), \end{equation} and in fact the $\phi_i$'s form a basis for the space $\mathrm{CF}_\ell(S_n)$ of all class functions $\vartheta$ that depend only on $\ell$, with each $\vartheta\in \mathrm{CF}_\ell(S_n)$ decomposing uniquely as \begin{equation}\label{decomposition Sn} \vartheta =\sum_{i=0}^{n-1} \frac{\langle \vartheta,\epsilon_i\rangle}{\epsilon_i(1)}\phi_i, \end{equation} where $\epsilon_i$ is the irreducible character $\chi_\lambda$ for the hook shape $\lambda=(n-i,1^i)$, so $\epsilon_i(1)=\binom{n-1}{i}$. Other important facts about the $\phi_i$'s include: They decompose the character $\rho$ of the regular representation: \begin{equation}\label{reg decomposition} \phi_0+\phi_1+\ldots+\phi_{n-1}=\rho. \end{equation} Their degrees are Eulerian numbers: \begin{equation}\label{Eulerian degrees} \phi_i(1)=|\{\pi\in S_n \mid \mathrm{des}(\pi)=i\}|,\quad \mathrm{des}(\pi)=|\{i \mid \pi(i)>\pi(i+1)\}|. \end{equation} They branch according to \begin{equation}\label{Sn branching rule} \phi_i|_{S_{n-1}}=(n-i)\phi_{i-1}+(i+1)\phi_i. \end{equation} And they even admit a closed-form expression: \begin{equation}\label{Sn expression} \phi_i(\pi)=\sum_{j=0}^{n-1} (-1)^{i-j}\binom{n+1}{i-j}(j+1)^{\ell(\pi)}. \end{equation} But two questions remain unanswered. \begin{enumerate}[\it {Question} 1.\ ] \item\label{Q1} How does a product $\phi_i\phi_j$ decompose into a sum of $\phi_k$'s? \item\label{Q2} What is the inner product $\emptysq$ with respect to which the $\phi_i$'s form an orthonormal basis? \end{enumerate} We answer both of these questions in the next section. For decomposing products, we present 3 solutions. The first is a combinatorial solution which follows from a recent result that interprets the values $\phi_i(\pi)$ as coefficients of Loday's Eulerian idempotents from cyclic homology \cite{Loday} in certain sums in the group algebra $\mathbb C[S_n]$. The second solution is an explicit closed-form solution using \eqref{Sn expression}. The third solution is perhaps the most surprising, being a recursive solution given by Delsarte in 1976 in a context void of characters and groups, and given 4 years before the $\phi_i$'s were introduced by Foulkes in 1980. Delsarte's work, which had been overlooked up to now, adds yet another surprising place where Foulkes characters arise. A few years ago, Diaconis and Fulman connected the $\phi_i$'s with adding random numbers \cite{DF1}. Denote by $\Phi$ the character table \[\Phi=\left(\phi_i(C_{n-j})\right)_{0\leq i,j\leq n-1},\] where \[C_i=\{\pi\in S_n \mid \ell(\pi)=i\}\] and for any $\vartheta\in \mathrm{CF}_\ell(S_n)$ we denote by $\vartheta(C_i)$ the value $\vartheta(\pi)$ for any ${\pi\in C_i}$. Holte \cite{Holte} studied the carries that occur when adding $n$ random numbers in base~$b$, particularly the Markov chain with transition matrix \begin{equation*} M=(M(i,j))_{0\leq i,j\leq n-1} \end{equation*} given by \begin{equation}\label{carries matrix} M(i,j)=\text{chance}\{\text{next carry is $j$} \mid \text{last carry is $i$}\}. \end{equation} Diaconis and Fulman found that the transposed columns of $\Phi$ are left eigenvectors, in particular \[\Phi^tM=D\Phi^t,\] where $D={\rm diag}(b^{0},b^{-1},\ldots,b^{-n+1})$. We consider not adding random numbers and keeping track of carries, but multiplying random $n$-cycles in $S_n$ and counting factorizations. Let $\sigma$ and $\tau$ be $n$-cycles $(i_1\, i_2\, \ldots\, i_n)$ chosen uniformly at random from $C_1$, and consider the expected number of ways that the product $\sigma\tau$ can be written as a product $\alpha\beta$ with $\alpha\in C_i$ and $\beta\in C_j$, i.e.\ \[{\mathbf E}|\sigma C_i\cap \tau C_j|.\] Dividing by $n!$ gives a probability distribution on pairs $(C_i,C_j)$, and our answer to Question~\ref{Q2} is that the $\phi_i$'s form an orthonormal basis with respect to the inner product on $\mathrm{CF}_\ell(S_n)$ defined by \[[\vartheta,\psi]=\frac{1}{|S_n|}\sum_{i,j=0}^{n-1} \vartheta(C_i)\ol{\psi(C_j)}{\mathbf E}|\sigma C_i\cap \tau C_j|.\] As a remarkable consequence, we find that the $\phi_i$'s arise in a natural way from multiplying random $n$-cycles: they result from the inner product $\emptysq$ by applying the Gram--Schmidt process to the natural basis of characters $1^{\ell},2^{\ell},\ldots, n^{\ell}$ in $\mathrm{CF}_{\ell}(S_n)$. This is analogous to how the irreducible characters of $S_n$ can be obtained by taking the usual inner product on class functions of $S_n$, namely \[\langle \vartheta,\psi\rangle =\frac{1}{|S_n|} \sum_{K\in\mathrm{Cl}(S_n)} \vartheta(K)\ol{\psi(K)} |K|,\] taking a natural choice of permutation characters indexed by partitions, namely $(1_{S_\lambda})^{S_n}$ with a certain natural order, and applying the Gram--Schmidt process. As a new application of Foulkes characters, we give a short proof of a celebrated result of Zagier which generalizes one of Harer and Zagier on the enumeration of Riemann surfaces of a given genus. We also rewrite the Markov chain for carries in terms of our inner product $[\,\text{-}\, ,\,\text{-}\, ]$ and products of characters in $\mathrm{CF}_\ell(S_n)$: \[M(i,j)=[\phi_i,b^{\ell-n}\phi_j],\] which is not generally equal to $M(j,i)$. In the second part of the paper, Section~\ref{Sect G(r,1,n)}, we answer Questions~\ref{Q1} and~\ref{Q2} for the full monomial groups $G(r,1,n)$ with $r>1$. The author introduced analogues of Foulkes characters for these groups, as well as many other reflection groups, in \cite{M1}, where they were constructed from certain reduced homology groups for subcomplexes of the Milnor fiber complex, which is a certain wedge of spheres that is an equivariant strong deformation retract of a Milnor fiber from the invariant theory of the group, and then used various machinery to prove, among other things \cite{M1,M2,M3,M4}, analogues of \eqref{length property}--\eqref{Sn expression}. The role of $\ell$ is played by $n-\mathfrak l$, where $\mathfrak l$ is the most natural choice of ``length'', \[\mathfrak l(x)=\min\{k\geq 0\mid x=y_1y_2\ldots y_k\ \text{for some reflections $y_i\in G(r,1,n)$}\}.\] In addition to enjoying properties analogous to \eqref{length property}--\eqref{Sn expression}, the Foulkes characters of $G(r,1,n)$ were shown in \cite{M2} to play the role of irreducibles among the characters of $G(r,1,n)$ that depend only on $\mathfrak l$ in the sense that the characters of $G(r,1,n)$ that depend only on $\mathfrak l$ are precisely the unique non-negative integer linear combinations of the Foulkes characters. So our answers to Questions~\ref{Q1} and \ref{Q2} round out a truly remarkable story for the groups $G(r,1,n)$ with $r>1$, particularly the hyperoctahedral groups $G(2,1,n)$. Question~\ref{Q1} for $G(r,1,n)$ has answers that are similar to our answers for~$S_n$. Question~\ref{Q2} for $G(r,1,n)$ is more complicated than for $S_n$, but our answer is of a similar flavor and simplifies in the case of the hyperoctahedral group. As in the case of type A, benefits include a probability distribution on the analogues of the pairs $(C_i,C_j)$, and a new construction of the Foulkes characters of $G(r,1,n)$ in terms of multiplying random elements and applying the Gram--Schmidt process to a natural basis. Another application is a remarkable rewriting of a Markov chain studied by Diaconis and Fulman for adding random numbers in balanced ternary, a number system that both reduces carries and, in the words of Donald Knuth, is ``perhaps the prettiest number system of~all.'' \section{Type A} \subsection{The inner product} We start with our answer to Question~\ref{Q2} for $S_n$. Given a subset $A$ of a group $G$, we denote by $\csum{A}$ the sum $\sum_{a\in A}a$ in $\mathbb C[G]$. \begin{definition} For $\vartheta,\psi\in \mathrm{CF}_\ell(S_n)$, and for $n$-cycles $\sigma$ and $\tau$ chosen uniformly at random from $C_1$, we define \[[\vartheta,\psi]=\frac{1}{|S_n|}\sum_{i,j=1}^n \vartheta(C_i)\overline{\psi(C_j)} \mathbf E |\sigma C_i\cap \tau C_j|.\] \end{definition} \begin{proposition}\label{general [,] prop} For $\vartheta,\psi\in \mathrm{CF}_\ell(S_n)$, \begin{equation} [\vartheta,\psi] = \sum_\chi \left\langle \vartheta,\frac{\chi}{\chi(1)}\right\rangle \left\langle \overline{\psi},\frac{\chi}{\chi(1)}\right\rangle, \end{equation} where the sum is over the irreducible characters $\epsilon_i=\chi_{(n-i,1^i)}$, $0\leq i\leq n-1$. \end{proposition} \begin{proof} Denoting the regular representation of $S_n$ by $\mathrm{Reg}$, we have \begin{align*} [\vartheta,\psi] &= \frac{1}{|S_n|^2} \mathrm{Tr}\circ\mathrm{Reg}\left(\sum_{i,j=1}^n \vartheta(C_i)\overline{\psi(C_j)}\frac{\csum{C_1}^2\csum{C_i}\csum{C_j}}{|C_1|^2} \right)\\ &=\frac{1}{|S_n|^2} \sum_{\chi\in\mathrm{Irr}(S_n)} \sum_{i,j=1}^n \frac{\vartheta(C_i)\overline{\psi(C_j)}}{|C_1|^2} \chi(1) \frac{\chi(C_1)^2|C_1|^2}{\chi(1)^2} \sum_{x\in C_i}\frac{\chi(x)}{\chi(1)} \sum_{y\in C_j}\chi(y)\\ &=\frac{1}{|S_n|^2} \sum_{\chi\in\mathrm{Irr}(S_n)} \sum_{i,j=1}^n \chi(C_1)^2 \sum_{x\in C_i}\frac{\vartheta(C_i) \chi(x)}{\chi(1)} \sum_{y\in C_j}\frac{\overline{\psi(C_j)}\chi(y)}{\chi(1)}\\ &=\sum_{\chi\in\mathrm{Irr}(S_n)} \chi(C_1)^2 \left\langle \vartheta,\frac{\chi}{\chi(1)}\right\rangle \left\langle \overline{\psi},\frac{\chi}{\chi(1)}\right\rangle \\ &=\sum_\chi \left\langle \vartheta,\frac{\chi}{\chi(1)}\right\rangle \left\langle \overline{\psi},\frac{\chi}{\chi(1)}\right\rangle, \end{align*} where the last sum is over all $\chi_{(n-i,1^i)}$ with $0\leq i\leq n-1$. \end{proof} \begin{theorem} The characters $\phi_0,\phi_1,\ldots,\phi_{n-1}$ form an orthonormal basis for the Hilbert space $\mathrm{CF}_\ell(S_n)$ with inner product $\emptysq$. \end{theorem} \begin{proof} By property \eqref{decomposition Sn} and Proposition~\ref{general [,] prop}. \end{proof} A natural choice of basis for $\mathrm{CF}_\ell(S_n)$ that is composed of characters is $1^{\ell},2^{\ell},\ldots, n^{\ell}$, the character $k^{\ell}:\pi\mapsto k^{\ell(\pi)}$ being afforded by $(\mathbb C^k)^{\otimes n}$ with \[\pi.(v_1\otimes v_2\otimes\ldots\otimes v_n)=v_{\pi^{-1}(1)}\otimes v_{\pi^{-1}(2)}\otimes \ldots\otimes v_{\pi^{-1}(n)}.\] \begin{theorem} The characters $\phi_0,\phi_1,\ldots,\phi_{n-1}$ result from the inner product $\emptysq$ by applying the Gram--Schmidt process to the characters $1^{\ell},2^{\ell},\ldots, n^{\ell}$. \end{theorem} \begin{proof} By \eqref{Sn expression}, we have $\Phi=LV$ with \[ L=\left((-1)^{i-j}\binom{n+1}{i-j}\right)_{0\leq i,j\leq n-1},\quad V=\left((i+1)^{\ell(C_{n-j})}\right)_{0\leq i,j\leq n-1}, \] so $L$ is lower unitriangular and $V$ is the character table of the $k^{\ell}$. But this means that the rows of $\Phi$ are obtained by applying the Gram--Schmidt process to the rows of $V$ using the inner product with respect to which the rows of $\Phi$ are orthonormal. \end{proof} \subsection{} We remark on a formula for Foulkes characters that is similar to some well-known formulas for various systems of orthogonal polynomials, including Legendre polynomials, Hermite polynomials $(2X-\frac{d}{dX})^n\cdot 1$, and Laguerre polynomials $\frac{1}{n!}(\frac{d}{dX}-1)^nX^n$. It appears in the work of Diaconis and Fulman~\cite{DF1} in a slightly different form. Let \[A_n=\sum_{\pi\in S_n} X^{\mathrm{des}(\pi)},\] so \[A_0=1,\quad A_1=1,\quad A_2=1+X,\quad A_3=1+4X+X^2,\quad \ldots,\] and \begin{equation}\label{Eulerian diff} \left(1+X\frac{d}{dX}\right)^n\frac{1}{1-X}=\frac{A_n}{(1-X)^{n+1}}. \end{equation} \begin{theorem}[Diaconis--Fulman]\label{Diaconis--Fulman formula} For $1\leq j \leq n$, \begin{equation}\label{OP type formula} \sum_{i=0}^{n-1} \phi_i(C_j) X^i= (1-X)^{n+1}\left(1+X\frac{d}{dX}\right)^j\frac{1}{1-X}. \end{equation} \end{theorem} \begin{proof} Denoting by $\phi_i^{(n)}$ and $C_j^{(n)}$ the $\phi_i$ and $C_j$ for $S_n$, we have \cite{Foulkes,Kerber,M1} \begin{equation}\label{row rec} \phi^{(n)}_i(C_j^{(n)})=\phi^{(n-1)}_i(C_j^{(n-1)})-\phi^{(n-1)}_{i-1}(C_j^{(n-1)}) \end{equation} for $0\leq i\leq n-1$ and $1\leq j\leq n-1$, where we take $\phi_{-1}^{(n-1)}=\phi_{n-1}^{(n-1)}=0$. So the $S_{n-1}$ cases of \eqref{OP type formula} imply the first $n-1$ cases of \eqref{OP type formula} for $S_n$, while equality holds for $j=n$ by \eqref{Eulerian degrees} and \eqref{Eulerian diff}. \end{proof} \subsection{Decomposing products of Foulkes characters} We now present three solutions to computing $[\phi_i\phi_j,\phi_k]$ for $0\leq i,j,k\leq n-1$. \subsubsection{First solution} Our first solution is a combinatorial solution in terms of descents, and it is a corollary of an earlier theorem involving Loday's Eulerian idempotents \cite{Loday}. Writing \[\csum{D_i}=\sum_{{\pi\in S_n}\atop{\mathrm{des}(\pi)=i}}\pi,\] the Eulerian idempotents $\csum{E_0},\csum{E_1},\ldots,\csum{E_{n-1}}\in \mathbb Q[S_n]$ are defined by \begin{equation}\label{Eulerian Idempotents} \sum_{i=0}^{n-1}\binom{X+n-1-i}{n} \csum{D_i}=\sum_{i=0}^{n-1}\csum{E_{n-1-i}}X^{n-i}, \end{equation} and the following is a special case of Theorem~9 in \cite{M1}. \begin{theorem}\label{transition result} $\Phi^{t}$ is the transition matrix from \[\csum{D_0},\csum{D_1},\ldots, \csum{D_{n-1}}\] to \[\csum{E_{n-1}},\csum{E_{n-2}},\ldots, \csum{E_0},\] so \begin{equation}\label{D into E's} \csum{D_i}=\sum_{j=0}^{n-1} \phi_i(C_{n-j}) \csum{E_{n-1-j}} \end{equation} and \begin{equation}\label{Phi inverse} \Phi^{-t}=\left(\text{Coeff.\ of $X^{n-j}$ in }\binom{X+n-1-i}{n}\right)_{0\leq i,j\leq n-1}. \end{equation} \end{theorem} As a consequence of Theorem~\ref{transition result}, we have the following. \begin{theorem}\label{Sn combinatorial solution} For any fixed $z\in S_n$ with $\mathrm{des}(z)=k$, \begin{equation}\label{Sn combinatorial solution Eq} [\phi_i\phi_j,\phi_k]=|\{(x,y)\in S_n^2 \mid \mathrm{des}(x)=i,\ \mathrm{des}(y)=j,\ xy=z\}|. \end{equation} \end{theorem} \begin{proof} The $\csum{D_i}$'s form a basis for a subalgebra of $\mathbb C[S_n]$, and the $\csum{E_i}$'s are orthogonal idempotents, so by \eqref{D into E's}, $[\phi_i\phi_j,\phi_k]$ is the coefficient of $\csum{D_k}$ in $\csum{D_i}\csum{D_j}$. Hence \eqref{Sn combinatorial solution Eq}. \end{proof} \subsubsection{Second solution} Our second solution is a closed-form solution which uses the decomposition in \eqref{decomposition Sn}, the explicit expression for $\phi_i(\pi)$ in \eqref{Sn expression}, and the fact that, for any $\chi_\lambda\in\mathrm{Irr}(S_n)$, \begin{equation}\label{hook content formula} \langle X^{\ell},\chi_\lambda\rangle=\prod_{b \in \lambda}\frac{X+c(b)}{h(b)}, \end{equation} where for a box $b\in\lambda$ located in the $i$-th row and $j$-th column, \[c(b)=j-i,\quad h(b)=\lambda_i-j+1+|\{k>i \mid \lambda_k\geq j\}|.\] \begin{theorem} \begin{equation} [\phi_i\phi_j,\phi_k] = \sum_{{0\leq u\leq i}\atop{0\leq v\leq j}}(-1)^{i-u}(-1)^{j-v}\binom{n+1}{i-u}\binom{n+1}{j-v}\binom{uv+u+v+n-k}{n}. \end{equation} \end{theorem} \begin{proof} By \eqref{decomposition Sn} and \eqref{Sn expression}, \begin{align*} [\phi_i\phi_j,\phi_k] &= \left\langle \phi_i\phi_j,\frac{\epsilon_k}{\epsilon_k(1)}\right\rangle\\ &= \sum_{u,v=0}^{n-1} (-1)^{i-u}(-1)^{j-v}\binom{n+1}{i-u}\binom{n+1}{j-v}\left\langle\left((u+1)(v+1)\right)^{\ell},\frac{\epsilon_k}{\epsilon_k(1)}\right\rangle, \end{align*} and by \eqref{hook content formula}, \[\left\langle\left((u+1)(v+1)\right)^{\ell},\frac{\epsilon_k}{\epsilon_k(1)}\right\rangle =\binom{(u+1)(v+1)+n-1-k}{n}. \] \end{proof} \subsubsection{Third solution} The third solution is a recursive solution due to P.~Delsarte \cite{Delsarte}. For Foulkes characters $\phi_i,\phi_j,\phi_k$ of $S_n$, let us write \[\phi_i\phi_j=\sum_{k=0}^{n-1} c_{ijk}^{(n)} \phi_k.\] Delsarte defines recursively certain values $F(i,k,n)$, $0\leq i,k\leq n$, that depend on a parameter $q$ and initial conditions $F(0,k,m)$ with $0\leq k\leq m$, and he considers the matrix $P_{n-1}=(F(i,k,n-1))_{0\leq i, k\leq n-1}$. Although Delsarte did not specialize in this way, taking $q=1$ and $F(0,k,m)$ to be the Eulerian number $|\{\pi\in S_{m+1}\mid \mathrm{des}(\pi)=k\}|$, and then comparing Delsarte's definition with \eqref{Eulerian degrees} and \eqref{row rec}, we find that the transpose of Delsarte's matrix $P_{n-1}$ becomes the Foulkes character table $\Phi$ of $S_n$, so that \begin{equation}\label{Foulkes Delsarte} \phi_i(C_{n-j})=F(j,i,n-1),\quad 0\leq i,j\leq n-1. \end{equation} In addition to finding very general expressions for the $F(i,k,n)$ and the determinant of $P_{n-1}$ in Theorems 2 and 3 of \cite{Delsarte}, Delsarte also found a recursive solution for calculating the $c_{ijk}^{(n)}$'s, since $c_{ij0}^{(n)}=[\phi_i,\phi_j]=\delta_{ij}$. \begin{theorem}[Delsarte] \[c_{i+1,j+1,k+1}^{(n+1)}-c_{i+1,j+1,k}^{(n+1)}=-c_{i,j,k}^{(n)}+c_{i+1,j,k}^{(n)}+c_{i,j+1,k}^{(n)}-c_{i+1,j+1,k}^{(n)}.\] \end{theorem} \subsection{} Before moving on, we give another useful consequence of Theorem~\ref{transition result}. Let \begin{equation} \phi=\phi_0+X\phi_1+X^2\phi_2+\ldots +X^{n-1}\phi_{n-1}. \end{equation} \begin{theorem}\label{General inversion} For any two sequences $a_1,a_2,\ldots,a_n$ and $b_1,b_2,\ldots,b_n$, \[\sum_{i=1}^n a_i X^i =\sum_{k=1}^n b_k \binom{X+n-k}{n}\] if and only if \[\sum_{i=1}^n a_i\phi(C_i) =\sum_{k=1}^n b_k X^{k-1}.\] \end{theorem} \begin{proof} Let \[a=\begin{pmatrix} a_n \\ a_{n-1}\\ \vdots \\ a_1\end{pmatrix},\quad b=\begin{pmatrix} b_1 \\ b_2\\ \vdots \\ b_n\end{pmatrix},\quad x=\begin{pmatrix} X^n \\ X^{n-1}\\ \vdots \\ X^1\end{pmatrix},\quad y=\begin{pmatrix} \binom{X+n-1}{n} \\ \binom{X+n-2}{n}\\ \vdots \\\binom{X}{n} \end{pmatrix}.\] Then \eqref{Phi inverse} can be rewritten as \[\Phi^{-t}x=y.\] So \[a^tx=b^t y\quad \Leftrightarrow\quad a^tx=b^t \Phi^{-t}x\quad \Leftrightarrow\quad a^t \Phi^tx=b^t x\quad \Leftrightarrow\quad a^t\Phi^{t}z=b^tz,\] where $z=(1,X,\ldots, X^{n-1})^t$ is obtained from $x$ by replacing $X$ by $X^{-1}$ and then multiplying by $X^{n}$. \end{proof} \subsection{Zagier's result} As an application of Foulkes characters, particularly the formula of Diaconis and Fulman in Theorem~\ref{Diaconis--Fulman formula} and our inversion result in Theorem~\ref{General inversion}, we give a new short proof of a well-known result of Zagier~\cite{Zagier}. \begin{theorem}[Main theorem of Zagier] For any conjugacy class ${K\in \mathrm{Cl}(S_n)}$ and any $n$-cycle $\sigma\in S_n$, let \[p_i(K)=\frac{|\{\tau\in K\mid \tau\sigma \text{ \rm has $i$ cycles}\}|}{|K|}.\] The numbers $p_i(K)$ are determined by \begin{equation}\sum_{i=1}^n p_i(K)P_i(X)=\frac{\wp(K,X)}{(1-X)^{n+2}},\end{equation} where $\wp(K,X)=\det(1-\tau X,\mathbb C^n)$ is the characteristic polynomial of an element $\tau\in K$ under the permutation representation $\tau\mapsto (\delta_{i\tau(j)})_{i,j}$ and \[P_1(X)=\frac{1}{(1-X)^2},\quad P_2(X)=\frac{1+X}{(1-X)^3},\quad P_3(X)=\frac{1+4X+X^2}{(1-X)^4},\quad\ldots\] are the polynomials in $\frac{1}{1-X}$ defined by $P_i(X)=\sum_{k=1}^\infty k^i X^{k-1}\in\mathbb Z[[X]]$. \end{theorem} \begin{proof} Writing $L(X)=\sum_{\pi\in S_n} \pi X^{\ell(\pi)}$, and denoting the regular representation by $\mathrm{Reg}$, we have \begin{align*} \sum_{i=1}^n p_i(K)X^i &= \frac{1}{|S_n|}\frac{1}{|K|}\mathrm{Tr}\circ\mathrm{Reg} (K\sigma L(X))\\ &=\frac{1}{|S_n|}\frac{1}{|K|}\sum_{\chi\in\mathrm{Irr}(S_n)} \chi(1)\frac{\chi(K)|K|}{\chi(1)} \chi(\sigma) \sum_{\pi\in S_n} \frac{\chi(\pi) X^{\ell(\pi)}}{\chi(1)}\\ &=\sum_{k=0}^{n-1}(-1)^k \epsilon_k(K) \left\langle \frac{\epsilon_k}{\epsilon_k(1)},X^{\ell}\right\rangle\\ &=\sum_{k=0}^{n-1}(-1)^k \epsilon_k(K) \binom{X+n-k-1}{n}. \end{align*} Equivalently, by Theorem~\ref{General inversion}, \begin{equation}\label{Foulkes Zagier} \sum_{i=1}^n p_i(K)\phi(C_i)=\sum_{k=0}^{n-1}(-1)^k \epsilon_k(K)X^k=\frac{\wp(K,X)}{1-X}. \end{equation} By Theorem~\ref{Diaconis--Fulman formula}, \eqref{Foulkes Zagier} is equivalent to \begin{equation} \sum_{i=1}^n p_i(K)P_i(X)=\frac{\wp(K,X)}{(1-X)^{n+2}}. \end{equation} \end{proof} \subsection{Carries in terms of products} As another application of our framework for Foulkes characters, we give an interesting reformulation of the Markov chain studied by Holte \cite{Holte} and Diaconis and Fulman \cite{DF1} in terms of our inner product $\emptysq$ and products of characters in $\mathrm{CF}_\ell(S_n)$. Let $M$ be the transition matrix given in \eqref{carries matrix}. \begin{theorem}\label{Sn rewrite} $M(i,j)=[\phi_i,b^{\ell-n}\phi_j]$. \end{theorem} \begin{proof} Diaconis and Fulman showed that, for $0\leq j\leq n-1$, the row vector $(\phi_0(C_{n-j}),\phi_1(C_{n-j}),\ldots,\phi_{n-1}(C_{n-j}))$ is a left eigenvector of the transition matrix $M$ with eigenvalue $b^{-j}$, so \begin{equation}\label{Sn eigen} \Phi^tM=D\Phi^t, \end{equation} where $D$ is the diagonal matrix ${\rm diag}(1,b^{-1},b^{-2},\ldots, b^{-n+1})$. For $0\leq i,j\leq n-1$, let \[ \alpha_{ij}= \frac{1}{|S_n|} \sum_{\pi\in C_{n-j}} \frac{\epsilon_i(\pi)}{\epsilon_i(1)},\qquad \epsilon_i=\chi_{(n-i,1^i)}, \] and let $\Lambda$ be the matrix \[ \Lambda=(\alpha_{ij})_{0\leq i,j\leq n-1}. \] Then, using \eqref{decomposition Sn}, \begin{equation}\label{Sn Lambda inverse} \Lambda\Phi^t = \left(\left\langle \frac{\epsilon_i}{\epsilon_i(1)},\phi_j\right\rangle\right)_{0\leq i,j\leq n-1} =I. \end{equation} Hence, by \eqref{Sn eigen} and \eqref{Sn Lambda inverse}, \[ M=\Lambda D\Phi^t = \left(\left\langle \frac{\epsilon_i}{\epsilon_i(1)}b^{\ell-n},\phi_j\right\rangle\right)_{0\leq i,j\leq n-1} = \left([ \phi_i,b^{\ell-n}\phi_j]\right)_{0\leq i,j\leq n-1}. \] \end{proof} \section{Type B and the other full monomial groups}\label{Sect G(r,1,n)} We begin by fixing an integer $r>1$, a primitive $r$-th root of unity $\zeta$, the cyclic group $Z=\langle \zeta\rangle$, and a full monomial group \[G_n=G(r,1,n),\] so the elements of $G_n$ are the $n$-by-$n$ matrices $x$ with exactly one nonzero entry in each row and each column, and with $r$-th roots of unity for the nonzero entries. Equivalently, the elements $x\in G_n$ are the products \[x=D.A_{\pi}\] where $D$ is a diagonal matrix ${\rm diag}(\xi_1,\xi_2,\ldots,\xi_n)$ with $\xi_i\in Z$, and $A_{\pi}=(\delta_{i\pi(j)})_{1\leq i,j\leq n}$ is the usual matrix of a permutation $\pi\in S_n$. By the {\it type of~$x$} we shall mean the partition-valued function \[\lambda: \mathrm{Cl}(Z)\to \mathscr P\] which takes $\{\zeta^j\}$, $0\leq j\leq r-1$, to the partition $\lambda^j$ whose parts are the periods of the cycles $(i_1\, i_2\, \ldots\, i_k)$ of $\pi$ such that $x_{i_1 i_2}x_{i_2 i_3}\ldots x_{i_k i_1}=\zeta^j$, so two elements of $G_n$ belong to the same conjugacy class if and only if they have the same type. We shall denote by $K_\lambda$ the class of elements of type $\lambda$. Identifying $\lambda$ with the $r$-tuple of partitions $\lambda^i$, we shall write \[\lambda=(\lambda^0,\lambda^1,\ldots,\lambda^{r-1})\in\mathscr P^r\] and \[\|\lambda\|=\sum_{i=0}^{r-1} |\lambda^i|=n.\] In general, for any partition-valued function $f$ on a finite set $\mathscr S$, we write \[\|f\|=\sum_{s\in\mathscr S} |f(s)|.\] There is also the natural bijection \cite{Macdonald} between irreducible characters $\chi_\lambda$ of $G_n$ and partition-valued functions \[\lambda:\mathrm{Irr}(Z)\to \mathscr P\] with $\|\lambda\|=n$. Denoting by $\varphi_k$ the irreducible character of $Z$ given by \[\varphi_k(\zeta^s)=\zeta^{ks},\] and identifying $\lambda$ with the $r$-tuple of values $\lambda(\varphi_i)$, we shall write \[\lambda=(\lambda(\varphi_0),\lambda(\varphi_1),\ldots,\lambda(\varphi_{r-1})).\] With $G_n$ being a reflection group, there is the natural length function \[\mathfrak l(x)=\min \{k\geq 0 \mid x=y_1y_2\ldots y_k\ \text{for some reflections $y_i\in G_n$}\}.\] For our purposes, we will instead work with another length function $\ell$. We define, for $x\in G_n$ of type $\lambda=(\lambda^0,\lambda^1,\ldots,\lambda^{r-1})\in\mathscr P^r$, \[\ell(x)=\text{number of parts of $\lambda^0$}.\] By Proposition 2 of \cite{M2}, \begin{equation} \ell(x)=n-\mathfrak l(x)=\dim\ker(x-1), \end{equation} so studying $\ell$ is equivalent to studying $\mathfrak l$. In particular, a function $f$ depends only on $\ell$, in the sense that $f(x)=f(y)$ whenever $\ell(x)=\ell(y)$, if and only if $f$ depends only on $\mathfrak l$. The Foulkes characters of $G_n$ were introduced in \cite{M1}, where they were constructed from certain reduced homology groups coming from the associated Milnor fiber complex, which is a certain wedge of spheres that is a strong deformation retract of a Milnor fiber $f_1^{-1}(1)$ coming from the invariant theory of $G_n$. They are denoted \[\phi_0,\phi_1,\ldots,\phi_n,\] and they were shown in \cite{M1} to have some remarkable properties that are analogous to the type A properties stated in \eqref{length property}--\eqref{Sn expression}. The $\phi_i$'s form a basis for the space $\mathrm{CF}_\ell(G_n)$ of all class functions $\vartheta$ that depend only on $\ell$, with each $\vartheta\in \mathrm{CF}_\ell(G_n)$ decomposing uniquely as \begin{equation}\label{decomposition G(r,1,n)} \vartheta=\sum_{i=0}^{n} \frac{\langle \vartheta,\epsilon_i\rangle}{\epsilon_i(1)}\phi_i, \end{equation} where $\epsilon_i$ is the irreducible character $\chi_{((n-i),(1^i),\emptyset,\emptyset,\ldots,\emptyset)}$, so $\epsilon_i(1)=\binom{n}{i}$. They decompose the character $\rho$ of the regular representation: \begin{equation}\label{G(r,1,n) reg decomposition} \phi_0+\phi_1+\ldots+\phi_{n}=\rho. \end{equation} Their degrees are the natural analogues of Eulerian numbers given by Steingr\'imsson's notion of descent: \begin{equation}\label{G(r,1,n) Eulerian degrees} \phi_i(1)=|\{x\in G_n \mid \mathrm{des}(x)=i\}|. \end{equation} They branch according to \begin{equation}\label{G(r,1,n) branching rule} \phi_i|_{G_{n-1}}=((n+1)r-(ri+1))\phi_{i-1}+(ri+1)\phi_i. \end{equation} And they admit closed-form expressions: \begin{equation}\label{G(r,1,n) expression} \phi_i(x)=\sum_{j=0}^{n} (-1)^{i-j}\binom{n+1}{i-j}(rj+1)^{\ell(x)}. \end{equation} We shall denote by $\Phi$ the character table \[\Phi=(\phi_i(C_{n-j}))_{0\leq i,j\leq n},\] where, for $0\leq i\leq n$, \[C_i=\{x\in G_n \mid \ell(x)=i\},\] and for any $\vartheta\in\mathrm{CF}_\ell(G_n)$ we denote by $\vartheta(C_i)$ the value $\vartheta(x)$ for any $x\in C_i$. \subsection{Fourier transform of $X^{\ell}$} The Fourier transform of the class function $X^\ell: x\mapsto X^{\ell(x)}$ will play an important role in what follows. Given $\lambda\in\mathscr{P}^r$, by $b\in \lambda$ we shall mean a box $b$ contained in the Young diagram of some $\lambda^j$, and by $c(b)$ and $h(b)$ we shall mean the usual content and hook-length associated to the box $b$ in $\lambda^j$. Given $\lambda\in\mathscr{P}^r$ and $b\in\lambda$, we define \[ \delta_0(b)= \begin{cases} 1 & \text{if $b\in\lambda^0$,}\\ 0 & \text{otherwise.} \end{cases} \] \begin{theorem}\label{r hook content} For any $\lambda\in\mathscr{P}^r$ with $\|\lambda\|=n$, \begin{equation}\label{r hook chi} \langle X^{\ell},\chi_{\lambda}\rangle = \prod_{b\in\lambda}\frac{\frac{X-1}{r}+c(b)+\delta_0(b)}{h(b)}, \end{equation} \begin{equation}\label{r hook normalized} \left\langle X^{\ell}, \frac{\chi_{\lambda}}{\chi_{\lambda}(1)}\right\rangle = \frac{1}{n!} \prod_{b\in\lambda}\left(\frac{X-1}{r}+c(b)+\delta_0(b)\right), \end{equation} and, for $\mathfrak X_\lambda:G_n\to{\rm GL}_d(\mathbb C)$ affording $\chi_\lambda$, \begin{equation}\label{r hook Fourier} \sum_{x\in G_n}X^{\ell(x)}\mathfrak X_{\lambda}(x) = \prod_{b\in\lambda}(X+rc(b)+r\delta_0(b)-1) \mathfrak X_{\lambda}(1). \end{equation} \end{theorem} \begin{proof} For any non-negative integer $k$, define \[\chi_{n,k}(x)=(kr+1)^{\ell(x)},\quad x\in G_n.\] By Proposition 6 and Proposition 7 of \cite{M2}, in the standard notation, see~\cite{M2}, we have \begin{equation} \sum_{n\geq 0}{\rm ch}(\chi_{n,k})X^n = H(\varphi_0)^{k+1}\prod_{j=1}^{r-1}H(\varphi_j)^k. \end{equation} For any $\varphi\in\mathrm{Irr}(Z)$, by \cite[p.\ 66]{Macdonald}, we have \begin{equation} H(\varphi)^k=\sum_{\mu\in \mathscr{P}} a_\mu s_\mu(\varphi) X^{|\mu|}, \end{equation} where \begin{equation} a_\mu=\prod_{b\in \mu}\frac{k+c(b)}{h(b)}. \end{equation} Hence \begin{equation} \sum_{n\geq 0}{\rm ch}(\chi_{n,k})X^n = \sum_{\nu\in\mathscr P^r}a_{\nu}S_{\nu}X^{|\nu|}, \end{equation} where \begin{equation} a_{\nu}=\prod_{b\in\nu}\frac{k+c(b)+\delta_0(b)}{h(b)}. \end{equation} Equivalently, for any $\nu\in\mathscr P^r$ with $\|\nu\|=n$, \begin{equation} \left\langle (kr+1)^{\ell},\chi_{\nu}\right\rangle =\prod_{b\in\nu}\frac{k+c(b)+\delta_0(b)}{h(b)}. \end{equation} This holds for all non-negative integers $k$, so it holds as an equality of polynomials in $\mathbb C[k]$, and upon replacing $k$ by $\frac{X-1}{r}$, we get \eqref{r hook chi}. The equality in \eqref{r hook normalized} follows from \eqref{r hook chi}, since \begin{equation} \chi_{\lambda}(1) = \binom{n}{|\lambda^0|,|\lambda^1|,\ldots,|\lambda^{r-1}|} \prod_{i=0}^{r-1}\chi_{\lambda^i}(1) = n!\prod_{i=0}^{r-1}\frac{\chi_{\lambda^i}(1)}{|\lambda^i|!} = \frac{n!}{\prod_{b\in\lambda} h(b)}. \end{equation} For \eqref{r hook Fourier}, let $L(X)=\sum_{x\in G_n}xX^{\ell(x)}$. $L(X)$ is central, so \begin{equation}\label{get alpha} \mathfrak X_{\lambda}(L(X))=\alpha\mathfrak X_{\lambda}(1) \end{equation} for some polynomial $\alpha$. Taking the trace on both sides of \eqref{get alpha} and dividing by $\chi_{\lambda}(1)$ gives \begin{equation}\label{alpha first} \alpha = n!r^n\left\langle X^{\ell},\frac{\chi_{\lambda}}{\chi_{\lambda}(1)}\right\rangle. \end{equation} By \eqref{r hook normalized} and \eqref{alpha first}, \[\alpha=\prod_{b\in\lambda}\left(X-1+rc(b)+r\delta_0(b)\right).\] \end{proof} \subsection{} There are four important consequences of Theorem \ref{r hook content}. \subsubsection{} For $0\leq k\leq n-1$, we shall write \[\eta_{s,k}=\chi_{(\emptyset,\ldots,\emptyset,(n-k,1^k),\emptyset,\ldots,\emptyset)},\] where the hook-shaped partition $(n-k,1^k)$ is in position $0\leq s\leq r-1$. \begin{proposition}\label{X hook prop} \begin{equation}\label{X hook eq} \left\langle X^{\ell},\frac{\eta_{s,k}}{\eta_{s,k}(1)}\right\rangle = \begin{cases} \binom{\frac{X-1}{r}+n-k}{n} & \text{if $s= 0$,}\\ \binom{\frac{X-1}{r}+n-k-1}{n} & \text{if $s\neq 0$.}\\ \end{cases} \end{equation} \end{proposition} \begin{proof} By \eqref{r hook normalized} of Theorem~\ref{r hook content}. \end{proof} \begin{proposition}\label{phi hook prop} \begin{equation}\label{phi hook eq} \left\langle \phi_i,\frac{\eta_{s,k}}{\eta_{s,k}(1)}\right\rangle = \begin{cases} \delta_{ik} & \text{if $s= 0$,}\\ \delta_{i, k+1} & \text{if $s\neq 0$.} \end{cases} \end{equation} \end{proposition} \begin{proof} For $0\leq u,v\leq n$, we have \cite[Eq.\ 18]{M2} \begin{equation}\label{inverse matrices} \sum_{j=0}^n (-1)^{u-j}\binom{n+1}{u-j}\binom{n+j-v}{n}=\delta_{uv}. \end{equation} See also \cite[Eq.\ 1.6.1]{Loday} and \cite[Eqs.\ 9 and 11]{M1}. By \eqref{G(r,1,n) expression}, \eqref{X hook eq}, and \eqref{inverse matrices}, \begin{align*} \left\langle\phi_i,\frac{\eta_{s,k}}{\eta_{s,k}(1)}\right\rangle &=\sum_{j=0}^{n} (-1)^{i-j}\binom{n+1}{i-j}\left\langle (rj+1)^{\ell},\frac{\eta_{s,k}}{\eta_{s,k}(1)}\right\rangle\\ &= \sum_{j=0}^{n} (-1)^{i-j}\binom{n+1}{i-j}\binom{n+j-k-1+\delta_{0s}}{n}\\ &=\begin{cases} \delta_{ik} & \text{if $s= 0$,}\\ \delta_{i,k+1} & \text{if $s\neq 0$.} \end{cases} \end{align*} \end{proof} \subsubsection{} For $0\leq k\leq n$, let \begin{equation} \epsilon_k=\chi_{((n-k),(1^k),\emptyset,\emptyset,\ldots,\emptyset)}. \end{equation} \begin{proposition}\label{X epsilon} \begin{equation}\label{X epsilon eq} \left\langle X^\ell,\frac{\epsilon_k}{\epsilon_k(1)}\right\rangle =\binom{\frac{X-1}{r}+n-k}{n}. \end{equation} \end{proposition} \begin{proof} By \eqref{r hook normalized} of Theorem~\ref{r hook content}. \end{proof} \begin{proposition}\label{phi epsilon} \begin{equation}\label{phi epsilon eq} \left\langle \phi_i,\frac{\epsilon_k}{\epsilon_k(1)}\right\rangle =\delta_{ik}. \end{equation} \end{proposition} \begin{proof} By \eqref{G(r,1,n) expression}, \eqref{X epsilon eq}, and \eqref{inverse matrices}, \begin{align*} \left\langle\phi_i,\frac{\epsilon_{k}}{\epsilon_{k}(1)}\right\rangle &= \sum_{j=0}^{n} (-1)^{i-j}\binom{n+1}{i-j}\left\langle (rj+1)^{\ell},\frac{\epsilon_{k}}{\epsilon_{k}(1)}\right\rangle\\ &= \sum_{j=0}^{n} (-1)^{i-j}\binom{n+1}{i-j}\binom{n+j-k}{n}\\ &= \delta_{ik}. \end{align*} \end{proof} \subsection{Orthogonality relations} \begin{definition} Let $\seq$ be a sequence of classes \[K_1,K_2,\ldots, K_m\in\mathrm{Cl}(G_n).\] Let $k_i$ be chosen uniformly at random from $K_i$, for $1\leq i\leq m$, and consider the expected number of ways that the random product $k_1k_2\ldots k_m$ can be written as $ab$ with $a\in C_i$ and $b\in C_j$, i.e.\ \begin{equation}\label{General expectation} \mathbf E|k_1k_2\ldots k_m C_i\cap C_j|. \end{equation} For $\vartheta,\psi\in\mathrm{CF}_\ell(G_n)$, let \begin{equation}\label{a sigma inner product} [\vartheta,\psi]_{\seq}=\frac{1}{|G_n|}\sum_{i,j=0}^n \vartheta(C_i)\ol{\psi(C_j)}\mathbf E|k_1k_2\ldots k_m C_i\cap C_j|. \end{equation} \end{definition} Our inner product will be a certain convex combination of $\emptysq_{\seq}$'s. We shall denote the expectation in \eqref{General expectation} by \[\mu_{\seq}(C_i,C_j)=\mathbf E|k_1k_2\ldots k_m C_i\cap C_j|.\] \begin{proposition}\label{a sigma inner product expression} \begin{equation} [\vartheta,\psi]_{\seq}= \sum_{\chi\in\mathrm{Irr}(G_n)}\frac{\chi(K_1)\chi(K_2)\ldots\chi(K_m)}{\chi(1)^{m-2}} \left\langle \vartheta,\frac{\chi}{\chi(1)}\right\rangle \left\langle \ol{\psi},\frac{\chi}{\chi(1)}\right\rangle. \end{equation} \end{proposition} \begin{proof} Writing \[\csum{K}=\prod_{i=1}^m\frac{\csum{K_i}}{|K_i|},\] the right-hand side of \eqref{a sigma inner product} equals \begin{equation} \frac{1}{|G_n|^2} \mathrm{Tr}\circ \mathrm{Reg}\left( \sum_{i,j=0}^n \vartheta(C_i)\ol{\psi(C_j)} \csum{K} \csum{C_i}\csum{C_j} \right), \end{equation} which in turn equals \begin{equation} \frac{1}{|G_n|^2} \sum_{i,j=1}^n \sum_{\chi\in\mathrm{Irr}(G_n)} \vartheta(C_i)\ol{\psi(C_j)} \chi(1)^2 \omega_\chi(\csum{K}\csum{C_i}\csum{C_j}), \end{equation} where $\omega_\chi(W)$ denotes the scalar by which a central element $W$ of $\mathbb C[G_n]$ acts on a module affording $\chi$, so \begin{equation} \omega_\chi(\csum{K}\csum{C_i}\csum{C_j}) = \left(\prod_{u=1}^m \frac{\chi(K_u)}{\chi(1)}\right)\sum_{x\in C_i}\frac{\chi(x)}{\chi(1)}\sum_{y\in C_j}\frac{\chi(y)}{\chi(1)}. \end{equation} Hence \[[\vartheta,\psi]_{\seq}= \sum_{\chi\in\mathrm{Irr}(G_n)}\frac{\chi(K_1)\chi(K_2)\ldots\chi(K_m)}{\chi(1)^{m-2}} \left\langle \vartheta,\frac{\chi}{\chi(1)}\right\rangle \left\langle \ol{\psi},\frac{\chi}{\chi(1)}\right\rangle. \] \end{proof} \begin{proposition}\label{G(r,1,n) orth prop} Let $\mathfrak a=(K_1,K_2,\ldots,K_m)$ be a sequence of classes of $G_n$ such that $K_1=K_\lambda$ for some $\lambda$ with $\lambda^s=(n)$ for some $s$. Then \begin{equation}\label{alpha orth} [\phi_i,\phi_j]_{\seq} = \delta_{ij}\xi_\seq(i), \end{equation} where \begin{equation}\label{alpha expression} \xi_\seq(i)={\sum_{\chi\in H_i}}\frac{\chi(K_1)\chi(K_2)\ldots \chi(K_m)}{\chi(1)^{m-2}}, \end{equation} and \[H_i=\begin{cases} \{\eta_{0,0}\} & \text{if $i=0$,}\\ \{\eta_{0,i}\}\cup\{\eta_{1,i-1},\eta_{2,i-1},\ldots, \eta_{r-1,i-1}\} & \text{if $0< i<n$,}\\ \{\eta_{1,n-1},\eta_{2,n-1},\ldots,\eta_{r-1,n-1}\} & \text{if $i=n$.} \end{cases} \] \end{proposition} \begin{proof} By Proposition~\ref{a sigma inner product expression}, the analogue of Murnaghan--Nakayama for $G_n$ given by Ariki and Koike \cite{Ariki}, and Proposition~\ref{phi hook prop}. \end{proof} \begin{definition}\label{mu def} Let $\mathfrak a_1,\mathfrak a_2,\ldots,\mathfrak a_5$ be the sequences \begin{align*} \seq_1 &=\left(\ K_{((n),\emptyset,\emptyset,\ldots,\emptyset)}\ ,\ K_{((n),\emptyset,\emptyset,\ldots,\emptyset)}\ \right), \\ \seq_2 &=\left(\ K_{((n),\emptyset,\emptyset,\ldots,\emptyset)}\ ,\ K_{(\emptyset,(n),\emptyset,\ldots,\emptyset)}\ \right),\\ \seq_3 &=\left(\ K_{((n),\emptyset,\emptyset,\ldots,\emptyset)}\ ,\ K_{((n-1),(1),\emptyset,\ldots,\emptyset)}\ \right),\\ \seq_4 &=\left(\ K_{((n),\emptyset,\emptyset,\ldots,\emptyset)}\ ,\ K_{((n),\emptyset,\emptyset,\ldots,\emptyset)}\ ,\ K_{((n-1,1),\emptyset,\ldots,\emptyset)}\ ,\ K_{((n-1,1),\emptyset,\ldots,\emptyset)}\ \right),\\ \seq_5 &=\left(\ K_{((n),\emptyset,\emptyset,\ldots,\emptyset)}\ ,\ K_{((n),\emptyset,\emptyset,\ldots,\emptyset)}\ ,\ K_{((n-1),(1),\emptyset,\ldots,\emptyset)}\ ,\ K_{((n-1,1),\emptyset,\ldots,\emptyset)}\ \right), \end{align*} and let \[\mu_i=\mu_{\seq_i}.\] If $n=1$, so $G_n$ is cyclic, let \[ \mu= \frac{2}{r}\mu_{1}+ \frac{r-2}{r}\mu_{2}. \] If $n\geq 2$, let \begin{equation}\label{mu ge 2} \mu= \frac{1}{r}\mu_{1}+ \frac{r-2}{2r}\mu_{2}+ \frac{1}{4}\mu_{3}+ \frac{1}{2r}\mu_{4}+ \frac{r-2}{4r}\mu_{5}. \end{equation} Define, for $\vartheta,\psi\in\mathrm{CF}_\ell(G_n)$, \begin{equation}\label{G(r,1,n) (,) def} [\vartheta,\psi]=\frac{1}{|G_n|}\sum_{i,j=0}^n \vartheta(C_i)\ol{\psi(C_j)}\mu(C_i,C_j). \end{equation} \end{definition} It should be noted that the expression for $\mu$ given in \eqref{mu ge 2} simplifies in the case of the hyperoctahedral group. If $r=2$ and $n\geq 2$, then \begin{equation}\label{type B mu} \mu = \frac{1}{2}\mu_1+ \frac{1}{4}\mu_3+ \frac{1}{4}\mu_4. \end{equation} As in the case of $S_n$, we have the following properties. \begin{proposition} For all $0\leq i,j\leq n$, \begin{equation} \mu(C_i,C_j)=\mu(C_j,C_i)\geq 0, \end{equation} \begin{equation} \sum_{i=0}^n \mu(C_i,C_j)=|C_j|, \end{equation} and \begin{equation} \sum_{i,j=0}^n\frac{\mu(C_i,C_j)}{|G_n|}=1. \end{equation} \end{proposition} \begin{proof} These follow from the definition of $\mu$. \end{proof} \begin{theorem} The characters $\phi_0,\phi_1,\ldots,\phi_n$ form an orthonormal basis for the Hilbert space $\mathrm{CF}_\ell(G_n)$ with inner product $\emptysq$. \end{theorem} \begin{proof} The $n=1$ case is a simple calculation, so assume $n\geq 2$. By the expression for $\xi_\seq(i)$ in \eqref{alpha expression} and the analogue of Murnaghan--Nakayama for $G_n$ given by Ariki and Koike \cite{Ariki}, we have the values in Tables~\ref{alpha table} and~\ref{alpha table small} for~$\xi_{\seq_k}(i)$. \begin{table}[H] \centering \begin{tabular}{cccccc} \toprule $\seq$ & $i=0$ & $i=1$ & $2\leq i \leq n-2$ & $i=n-1$ & $i=n$\\ \midrule $\seq_1$ & $1$ & $r$ & $r$ & $r$ & $r-1$\\ $\seq_2$ & $1$ & $0$ & $0$ & $0$ & $-1$\\ $\seq_3$ & $1$ & $-1$ & $0$ & $-1$ & $1$\\ $\seq_4$ & $1$ & $r-1$ & $0$ & $1$ & $r-1$\\ $\seq_5$ & $1$ & $-1$ & $0$ & $1$ & $-1$\\ \bottomrule \end{tabular}\caption{$\xi_{\seq}(i)$ for $n\geq 3$, $\seq=\seq_k$, $1\leq k\leq 5$.}\label{alpha table} \end{table} \begin{table}[H] \centering \begin{tabular}{cccccc} \toprule $\seq$ & $i=0$ & $i=1$ & $i=2$\\ \midrule $\seq_1$ & $1$ & $r$ & $r-1$ \\ $\seq_2$ & $1$ & $0$ & $-1$ \\ $\seq_3$ & $1$ & $-2$ & $1$ \\ $\seq_4$ & $1$ & $r$ & $r-1$ \\ $\seq_5$ & $1$ & $0$ & $-1$ \\ \bottomrule \end{tabular}\caption{$\xi_{\seq}(i)$ for $n=2$, $\seq=\seq_k$, $1\leq k\leq 5$.}\label{alpha table small} \end{table} By the definition of $\emptysq$ in \eqref{G(r,1,n) (,) def}, the orthogonality relation in \eqref{alpha orth}, and the values in Tables~\ref{alpha table} and~\ref{alpha table small}, we conclude that the $\phi_i$'s are an orthonormal basis for the Hilbert space $\mathrm{CF}_\ell(G_n)$ with inner product $\emptysq$. \end{proof} A natural choice of basis for $\mathrm{CF}_{\ell}(G_n)$ that is composed of characters is \[1^\ell,(r+1)^\ell,(2r+1)^\ell,\ldots,(nr+1)^\ell.\] For the fact that these are characters, see Proposition 6 in \cite{M2}. \begin{theorem} The characters $\phi_0,\phi_1,\ldots,\phi_{n}$ result from the inner product $\emptysq$ by applying the Gram--Schmidt process to the characters \[1^{\ell},(r+1)^{\ell},\ldots, (rn+1)^{\ell}.\] \end{theorem} \begin{proof} By \eqref{G(r,1,n) expression}, we have $\Phi=LV$ with \[ L=\left((-1)^{i-j}\binom{n+1}{i-j}\right)_{0\leq i,j\leq n},\quad V=\left((ri+1)^{\ell(C_{n-j})}\right)_{0\leq i,j\leq n}, \] so the rows of $\Phi$ are obtained by applying the Gram--Schmidt process to the rows of $V$ using the inner product with respect to which the rows of $\Phi$ are orthonormal. \end{proof} We include the following orthogonality relation of independent interest. \begin{proposition} Let $\sigma$ be an element of some class $K_{\lambda}$ of $G_n$ with ${\lambda^i=(n)}$ for some $i>0$. Then \begin{equation} \frac{1}{|G_n|}\sum_{u,v=0}^n\phi_i(C_u)\phi_j(C_v)|\sigma C_u\cap C_v|=(-1)^i\binom{n}{i}\delta_{ij}. \end{equation} \end{proposition} \begin{proof} By Proposition~\ref{G(r,1,n) orth prop} with $m=1$ and $K_1=K_\lambda$, and using the analogue of the Murnaghan--Nakayama rule for $G_n$. \end{proof} \subsection{Decomposing products of Foulkes characters} We give two solutions to computing $[\phi_i\phi_j,\phi_k]$. The first is a closed-form solution, and the second is a combinatorial solution. \subsubsection{First solution} \begin{theorem} \begin{equation} [\phi_i\phi_j,\phi_k]=\sum_{{0\leq u\leq i}\atop{0\leq v\leq j}}(-1)^{i-u}(-1)^{j-v}\binom{n+1}{i-u}\binom{n+1}{j-v}\binom{ruv+u+v+n-k}{n}. \end{equation} \end{theorem} \begin{proof} By \eqref{G(r,1,n) expression} and Proposition~\ref{phi epsilon}, \begin{align*} [\phi_i\phi_j,\phi_k] &= \left\langle \phi_i\phi_j,\frac{\epsilon_k}{\epsilon_k(1)}\right\rangle\\ &= \sum_{u,v=0}^n (-1)^{i-u}(-1)^{j-v}\binom{n+1}{i-u}\binom{n+1}{j-v}\left\langle\left((ru+1)(rv+1)\right)^{\ell},\frac{\epsilon_k}{\epsilon_k(1)}\right\rangle, \end{align*} and by Proposition~\ref{X epsilon}, \begin{equation} \left\langle\left((ru+1)(rv+1)\right)^{\ell},\frac{\epsilon_k}{\epsilon_k(1)}\right\rangle = \binom{ruv+u+v+n-k}{n}. \end{equation} \end{proof} \subsubsection{Second solution} Just as for $S_n$, our combinatorial solution for computing $[\phi_i\phi_j,\phi_k]$ is in terms of descents and certain idempotents. Using Steingr\'imsson's notion of descent for $G_n$ and writing \[\csum{D_i}=\sum_{{x\in G_n}\atop{\mathrm{des}(x)=i}}x,\] the Eulerian idempotents $\csum{E_0},\csum{E_1},\ldots,\csum{E_{n}}\in \mathbb Q[G_n]$ for $G_n$ are defined by \begin{equation}\label{Eulerian Idempotents G(r,1,n)} \sum_{i=0}^{n}\binom{n+\frac{X-1}{r}-i}{n} \csum{D_i}=\sum_{j=0}^{n}\csum{E_{n-j}}X^{n-j}, \end{equation} see \cite{M1} and references therein. The following is a special case of \cite[Thm.~9]{M1}. \begin{theorem}\label{transition result G(r,1,n)} $\Phi^{t}$ is the transition matrix from \[\csum{D_0},\csum{D_1},\ldots, \csum{D_{n}}\] to \[\csum{E_{n}},\csum{E_{n-1}},\ldots, \csum{E_0},\] so \begin{equation}\label{D into E's G(r,1,n)} \csum{D_i}=\sum_{j=0}^{n} \phi_i(C_{n-j}) \csum{E_{n-j}} \end{equation} and \begin{equation}\label{Phi inverse G(r,1,n)} \Phi^{-t}=\left(\text{Coeff.\ of $X^{n-j}$ in }\binom{n+\frac{X-1}{r}-i}{n}\right)_{0\leq i,j\leq n}. \end{equation} \end{theorem} Our combinatorial solution is an immediate corollary of Theorem~\ref{transition result G(r,1,n)}. \begin{theorem}\label{G(r,1,n) combinatorial solution} For any fixed $z\in G_n$ with exactly $k$ descents, \begin{equation}\label{G(r,1,n) combinatorial solution Eq} [\phi_i\phi_j,\phi_k]=|\{(x,y)\in G_n\times G_n \mid \mathrm{des}(x)=i,\ \mathrm{des}(y)=j,\ xy=z\}|. \end{equation} \end{theorem} \begin{proof} As in the proof of Theorem~\ref{Sn combinatorial solution}, the $\csum{D_i}$'s span a subalgebra of $\mathbb C[G_n]$, and the $\csum{E_i}$'s are orthogonal idempotents, so by \eqref{D into E's G(r,1,n)}, $[\phi_i\phi_j,\phi_k]$ is the coefficient of $\csum{D_k}$ in $\csum{D_i}\csum{D_j}$. \end{proof} \subsection{} We end with $G_n$ analogues of three earlier results for $S_n$, namely, the formula of Diaconis and Fulman in Theorem~\ref{Diaconis--Fulman formula}, the useful inversion result in Theorem~\ref{General inversion}, and the reformulation of Holte's Markov chain for adding random numbers in terms of products and Foulkes characters. \subsubsection{} Writing \[A_{r,n}=\sum_{x\in G_n} X^{\mathrm{des}(x)},\] the analogue of \eqref{Eulerian diff} is \begin{equation}\label{G(r,1,n) Eulerian diff} \left[\left(1+Y\frac{d}{dY}\right)^n\frac{1}{1-Y^r}\right]_{Y=X^{1/r}}=\frac{A_{r,n}}{(1-X)^{n+1}}, \end{equation} and the analogue of Theorem~\ref{Diaconis--Fulman formula} is the following, with a version of the hyperoctahedral case already appearing in earlier work of Diaconis and Fulman~\cite{DF2}. \begin{theorem} For $0\leq j \leq n$, \begin{equation}\label{r OP type formula} \sum_{i=0}^{n} \phi_i(C_j) X^i= \left[(1-Y^r)^{n+1}\left(1+Y\frac{d}{dY}\right)^j\frac{1}{1-Y^r}\right]_{Y=X^{1/r}}. \end{equation} \end{theorem} \begin{proof} The proof follows just as for $S_n$. Denoting by $\phi_i^{(n)}$ and $C_j^{(n)}$ the $\phi_i$ and $C_j$ for $G_n$, we have \cite[Theorem 7]{M1} \begin{equation}\label{G(r,1,n) row rec} \phi^{(n)}_i(C_j^{(n)}) = \phi^{(n-1)}_i(C_j^{(n-1)})-\phi^{(n-1)}_{i-1}(C_j^{(n-1)}) \end{equation} for $0\leq i\leq n$ and $0\leq j\leq n-1$, where we take $\phi_{-1}^{(n-1)}=\phi_{n}^{(n-1)}=0$. So the $G_{n-1}$ cases of \eqref{r OP type formula} imply the first $n$ cases of \eqref{r OP type formula} for $G_n$, while equality holds for $j=n$ by \eqref{G(r,1,n) Eulerian degrees}, which is Corollary 8.1 in \cite{M1}, and \eqref{G(r,1,n) Eulerian diff}. \end{proof} \subsubsection{} For the analogue of Theorem~\ref{General inversion}, let \begin{equation} \phi=\phi_0+X\phi_1+X^2\phi_2+\ldots +X^n\phi_n. \end{equation} \begin{theorem}\label{r General inversion} For any two sequences $a_0,a_1,\ldots,a_n$ and $b_0,b_1,\ldots,b_n$, \[\sum_{i=0}^n a_i X^i =\sum_{i=0}^n b_i \binom{n+\frac{X-1}{r}-i}{n}\] if and only if \[\sum_{i=0}^n a_i\phi(C_i) =\sum_{i=0}^n b_i X^i.\] \end{theorem} \begin{proof} This follows from \eqref{Phi inverse G(r,1,n)} just as Theorem~\ref{General inversion} followed from \eqref{Phi inverse}. \end{proof} \subsubsection{Carries in terms of products} In \cite{DF2}, Diaconis and Fulman connected the hyperoctahedral Foulkes characters with adding an even number $N$ of random numbers using balanced digits and odd base $b$. We shall denote the transition matrix of the Diaconis--Fulman Markov chain by $M_B$, so \[M_B=(M_B(i,j))_{0\leq i,j\leq N}\] with \[M_B(i,j)=\text{chance}\left\{\text{next carry is } j-\frac{N}{2} \mid \text{ last carry is }i-\frac{N}{2}\right\}.\] We rewrite this Markov chain in terms of our inner product and products involving Foulkes characters of the hyperoctahedral group $B_N=G(2,1,N)$. \begin{theorem} Let $\phi_0,\phi_1,\ldots,\phi_N$ be the Foulkes characters of $B_N$. Then \[M_B(i,j)=[\phi_i,b^{\ell-N}\phi_j].\] \end{theorem} \begin{proof} Denoting by $\Phi_B$ the Foulkes character table $(\phi_i(C_{N-j}))_{0\leq i,j\leq N}$ for~$B_N$, Diaconis and Fulman showed that \[\Phi_B^t M_B=D\Phi_B^t,\quad D={\rm diag}(b^0,b^{-1},\ldots, b^{-N}).\] For $0\leq i,j\leq N$, let \[ \alpha_{ij} = \frac{1}{|B_N|}\sum_{x\in C_{N-j}}\frac{\epsilon_i(x)}{\epsilon_i(1)}, \quad \epsilon_i = \chi_{((N-i),(1^i),\emptyset,\emptyset,\ldots,\emptyset)}, \] and let \[\Lambda=(\alpha_{ij})_{0\leq i,j\leq N}.\] Then \[ \Lambda \Phi_B^t = \left(\left\langle \frac{\epsilon_i}{\epsilon_i(1)},\phi_j\right\rangle\right)_{0\leq i,j\leq N} = I. \] Hence \[ M_B = \Lambda D\Phi_B^t = \left(\left\langle \frac{\epsilon_i}{\epsilon_i(1)}b^{\ell-N},\phi_j \right\rangle\right)_{0\leq i,j\leq N} = \left([\phi_i,b^{\ell-N}\phi_j]\right)_{0\leq i,j\leq N}. \] \end{proof} \subsection*{Acknowledgements} The author would like to thank Jason Fulman and the referee for several helpful comments.
\section{Introduction} \noindent In the framework of the Quantum Chromodynamics in the kinematic region where energy is much greater than the transferred momenta (''the Regge kinematics'') the strong interactions can be described by the exchange of pomerons, which can be interpreted as bound states of pairs of the so-called reggeized gluons. In the quasiclassical approximation (which neglects pomeron loops) and in the approximation of a large number of colors, for the scattering of a small projectile off a large target (''dilute-dense scattering'') it leads to the well-known Balitsky-Kovchegov (BK) equation widely used for the description of DIS and particle-nucleus ($pA$) scattering. The BK equation corresponds to summing fan diagrams going from the projectile to the nuclear target with the propagator given by the well-known BFKL equation and the triple pomeron vertices responsible for the splitting of a pomeron in two. Going beyond the quasiclassical approximation and taking account of loops presents a hardly surmountable problem, which has been not solved until now. In connection with this difficulty much attention was given to the previous attempts to study the strong interactions before the era of the QCD and using the old reggeon theory \cite{gribov,migdal,migdal1} introduced by V.N.Gribov and based on the phenomenological local pomeron and its interaction vertices. In fact the $pA$ interaction in this framework was considered in \cite{schwimmer} where the sum of all fan diagrams similar to the BK equation in the QCD was found. Unlike the QCD, in the local pomeron model both the pomeron intercept and coupling constant for the triple pomeron vertex are taken as phenomenological parameters adjusted to the experimental data. Needless to say the local pomeron is much poorer in his physical content as compared to its QCD counterpart, which makes it unfit to describe processes with hard momentum transfer like DIS. However, the local pomeron theory is much simpler than the QCD one and admits various methods which make it possible to go beyond the quasiclassical approximation. In particular renormalization group methods have been widely applied to establish some basic properties of the Gribov model. In \cite{migdal1,ref1,ref2,ref3} a reggeon field theory with zero renormalized reggeon mass has been investigated by means of the Callan-Symanzik equation and the $\epsilon$-expansion was studied in the vicinity ($D=4-\epsilon$) of the critical dimension of transverse space. The key result was the existence of an infrared fixed point which leads to scaling laws for the pomeron Green function. More recently a general reggeon field theory as investigated in the framework of the functional renormalization group formalism with the aim of finding fixed points for the coupling constants flows, which may shed light on comparing it with the QCD and relevance for the description of the region of low momenta ~\cite{BCV1}. Still in the realistic three-dimensional world even the local pomeron model does not allow to find the full quantum-mechanical solution of the problem with the contribution of pomeron loops fully taken into account. In view of this trouble a still simpler model (''toy'' model) was considered and studied in some detail. The local pomeron model was taken in the one-dimensional world, that is depending only on rapidity $y$ \cite{amati1,amati2,jengo,amati3,rossi}. Such a model essentially was equivalent to the standard Quantum Mechanics and studied by methods of the quantum mechanics. Later also numerical methods were used both for the evaluation of the eigenvalues of the quantum Hamiltonian \cite{bondarenko,braun3} and for integrating the partial differential equation which governs the evolution of this system in rapidity \cite{braun1,braun2}. The important message which follows from these studies is that the quantum effects, that is the loops, change cardinally the high-energy behaviour of the amplitudes and so the neglect of them is at most a very crude approximation. It is remarkable that in the QCD, apart from the pomeron with the positive $C$-parity and signature, a compound state of three reggeized gluons with the negative $C$-parity and signature, the odderon, appears. Its possible experimental manifestations has not been found with certainty up to now, which may be explained both by its behaviour with energy and its small coupling to participant hadrons. On the theoretical level two species of the odderon were found, the Bartels-Lipatov-Vacca (BLV) odderon \cite{blv} with the intercept exactly equal to unity, in which the three reggeized gluons are pairwise located at the same spatial point, and the more complicated Janik-Wosiek odderon \cite{jw1,jw2} with all three reggeized gluons at different points, the intercept somewhat below unity and so probably subdominant at high energies. It was noted in \cite{hiim} that the BLV odderon is in a certain sense an imaginary part of the full $S$-matrix with both $C=\pm 1$ exchanges whose real part is the pomeron. Having this in mind, in analogy with the BK equation a system of equations summing fan diagrams made of both pomerons $P$ and odderons $O$ has been derived \cite{ksw, hiim}. It takes into account transitions $P\leftrightarrow PP$, $P\leftrightarrow OO$ and $O\leftrightarrow PO$ with the coupling constants related as 1:-1:2, respectively. This system is more complicated than the BK equation but can be solved numerically as the latter \cite{hiim,motyka,braun4}. However, going beyond the quasiclassical approximation remains unrealizable. In the framework of the local reggeon model the odderon has been introduced in ~\cite{BCV2} again within the functional renormalization group formalism and the same goal of finding possible fixed points for the coupling constants flows. However, even forgetting strong limitations on the number of terms in the effective action, the found fixed points tell nothing about the actual values for amplitudes with given phenomenological parameters. In view of this and learning the lesson from the studies of the theory with only pomerons, in this paper we propose a generalization of the one-dimensional ''toy'' model to include interactions of both the pomerons and odderons. Note that earlier results found in the functional renormalization group formalism in ~\cite{BCV2} do not help much to construct such a model due to the essential use of infrared regulators inherent in this formalism. The Lagrangian function of the one-dimensional model with only the pomerons is \begin{equation} {L}=\Phi^{+} \partial_y \Phi - \mu_P \Phi^{+} \Phi + i \lambda \Phi^{+} ( \Phi + \Phi^{+} ) \Phi, \label{e11} \end{equation} where $\Phi,\Phi^{+}$ are the complex pomeron field and its conjugate, the mass parameter $\mu_P=\alpha(0)-1$ is defined by the intercept of the pomeron Regge trajectory and $\lambda$ is the effective coupling constant. To generalize \Ref{e11} we are guided by the properties of the transition vertices $P\leftrightarrow PP$, $P\leftrightarrow OO$ and $O\leftrightarrow PO$ found both in the analysis of the loop diagrams in the QCD ~\cite{BR} and in the quasiclassical equations~\cite{ksw,hiim}. As derived in ~\cite{BR} the one loop corrections should be negative when a pomeron is present in the loop and positive for the odderon loop in the pomeron propagator. From ~\cite{hiim} we deduce that the intercept of the odderon is unity and relation of the coupling constants $P\to PP$, $P\to OO$ and $O\to PO$ should be as in the quasiclassical equations. We have also to take into account the negative signature of the odderon, which makes its contribution to the amplitude real in contrast to the positive imaginary one for the pomeron. As will be discussed in the next Section, these properties dictate the form of the Lagrangian in our new local reggeon model as $$ {L}= \Phi^{+} \partial_y \Phi - \mu_P \Phi^{+} \Phi + i(\Psi^{+} \partial_y \Psi - \mu_O \Psi^{+} \Psi) $$ \begin{equation} + i \lambda \left( \Phi^{+}\Phi^{+}\Phi + \Phi^{+}\Phi\Phi +2i \Psi^{+} \Psi \Phi +2i \Phi^{+} \Psi^{+} \Psi - \Phi^{+} \Psi \Psi - \Psi^{+} \Psi^{+} \Phi \right) . \label{e12a} \end{equation} Here $\Phi$ is the complex pomeron field, $\Psi$ is the complex odderon field, $\Phi^{+}$ and $\Psi^{+}$ are their conjugates, $\mu_P$ and $\mu_O$ are the pomeron and odderon mass parameters equal to the intercepts minus 1, respectively, the effective coupling constant $\lambda$ is the same as in the pure pomeron theory \Ref{e11}. To take the odderon signature into account its free Lagrangian is multiplied by $i$, which multiplies its propagator by $-i$. Apart from this we have taken real the coupling constants for $\Psi^{+} \Psi \Phi$ and its conjugate in contrast with all the rest coupling constants kept positive imaginary. This is necessary to conform to the QCD loop contributions and quasiclassical equations \cite{ksw, hiim, BR}. This theory is formally different with the one introduced earlier in ~\cite{BCV2}, however, we shall see that in fact they are fully equivalent after the appropriate transformation of field variables. This theory describes both creation and absorption of pomerons and odderons and contains interactions only with even powers of the odderon field, hereby conserving the $C$-symmetry. It also has the relation between the coupling constants of different transitions in correspondence with the QCD. In our work we will start with the arbitrary $\mu_O$, but in the numerical studies we adopt the zero mass parameter for the odderon in accordance with property of leading BLV odderon. In the next Section from the Lagrangian function \Ref{e12a} we construct the quantum Hamiltonian of the model, study the equations of motion and compare with the quasiclassical (fan) equations in the QCD \cite{ksw,hiim}. In Section 3 we consider evolution in rapidity of the pomeron and odderon propagators and $pA$ amplitude in our model and suggest two calculational schemes for its numerical study: development in powers and point-like evolution. In Section 4 the numerical results found by these methods are presented. In Section 5 the effect of introducing of the quartic interaction in the theory is studied. Section 6 contains some conclusions. \section{The Hamiltonian} \subsection{Quantization} \noindent The free part of the Lagrangian \Ref{e12a} has the standard form and admit the canonical quantization. Treating $y$ as the imaginary time one finds that the canonical conjugates to the variables $\Phi$ and $\Psi$ are \begin{equation} \Phi^{*} = \Phi^{+} , \quad \Psi^{*} = i \Psi^{+} , \label{e20} \end{equation} respectively. The canonical quantization in the imaginary time leads to the following commutation relations \begin{equation} [\Phi , \Phi^{*}]=1, \quad [\Psi , \Psi^{*}]=1, \quad [\Phi , \Psi^{*}]=0, \quad [\Psi , \Phi^{*}]=0 . \label{e23} \end{equation} The Lagrangian can be presented in the form \begin{equation} {L}=\Phi^{*} \partial_y \Phi - \mu_P \Phi^{*} \Phi + \Psi^{*} \partial_y \Psi - \mu_O \Psi^{*} \Psi + V(\Phi,\Psi) . \label{e21} \end{equation} Here $V(\Phi,\Psi)$ is the interaction term which does not contain derivatives in $y$. Then the Euclidean Hamiltonian is \begin{equation} H=-\left( \Phi^{*} \partial_y \Phi + \Psi^{*} \partial_y \Psi - L \right) = -\mu_P \Phi^{*}\Phi - \mu_O \Psi^{*} \Psi + V(\Phi,\Psi) , \label{e24} \end{equation} where the interaction $V$ is \begin{equation} V(\Phi,\Psi)= i \lambda \left( \Phi^{*}\Phi^{*}\Phi + \Phi^{*}\Phi\Phi +2 \Psi^{*} \Psi \Phi +2 \Phi^{*} \Psi^{*} \Psi - \Phi^{*} \Psi \Psi + \Psi^{*} \Psi^{*} \Phi \right). \label{e24a} \end{equation} Comparing with the pomeron-odderon interaction introduced in ~\cite{BCV2} we observe that in our case all triple interactions are imaginary but the relative sign of $P\to OO$ and $OO\to P$ transitions is opposite. This guarantees that the $OO$ loops are have a different sign as compared to $PP$ loops. If one does the canonical phase transformation \[ \Psi^*\to e^{-i\pi/4}\Psi^*,\ \ \Psi\to e ^{i\pi/4}\Psi , \] then the two last terms in (\ref{e24a}) will appear with the same real coupling constant $\lambda$ as in ~\cite{BCV2}. So our pomeron-odderon interaction is fully equivalent to one in the latter, provided the three coupling constants there have the same magnitude. The relations \Ref{e23} allow one to interpret $\Phi^{*},\Psi^{*}$ as the creation operators and $\Phi,\Psi$ as the annihilation operators. The vacuum satisfies the condition $\Phi |0\> =\Psi|0\>=0$ and the Fock space is considered as a full space of states created from the vacuum by action of any number of $\Phi^{*}$ and $\Psi^{*}$. The Schr\"odinger equation for the wave function of the system $F(y,\Phi^{*},\Psi^{*})$ is \begin{equation} \frac{\partial F(y,\Phi^{*},\Psi^{*})}{\partial y}=-H F(y,\Phi^{*},\Psi^{*}) . \label{schroed} \end{equation} Note that the original field $\Psi^{+}=-i\Psi^{*}$ has a meaning of the creation operator of the odderon state. \subsection{Equations of motion and comparison with the QCD equations for amplitudes} \noindent The corresponding to \Ref{e24} differential equations of motion for the field operators are \begin{eqnarray} {\partial{\Phi}}/{\partial y}&=[H,\Phi]= &\mu_P \Phi -i{\lambda} \big( \Phi^2 - \Psi^2 \big) -2i\lambda \big( \Phi^{*}\Phi + \Psi^{*}\Psi \big) , \nonumber \\ {\partial{\Psi}}/{\partial y}&=[H,\Psi]=&\mu_O \Psi -2i\lambda \Phi\Psi -2i\lambda \big( \Psi^{*}\Phi + \Phi^{*}\Psi \big) , \nonumber \\ {\partial{\Phi}^{*}}/{\partial y}&=[H,\Phi^{*}]=& -\mu_P \Phi^{*} +2i\lambda \big( \Phi^{*}\Phi + \Psi^{*}\Psi \big) +i{\lambda} \big( \left(\Phi^{*}\right)^2 +\left(\Psi^{*}\right)^2 \big) , \nonumber \\ {\partial{\Psi}^{*}}/{\partial y}&=[H,\Psi^{*}]=&-\mu_O \Psi^{*} +2i\lambda \big( \Psi^{*}\Phi - \Phi^{*}\Psi \big) +2i\lambda \big( \Phi^{*}\Psi^{*} \big) . \label{e44} \end{eqnarray} Note that the connection \Ref{e20} with the Hermitian conjugates with respect to the standard scalar product is not conserved during the evolution in $y$ since the Hamiltonian is not Hermitian and the dynamics of the system is not unitary. We are interested in these equations to compare them in the fan approximation with the QCD. The fan equations are obtained when all terms which contain two creation operators and one annihilation operator are dropped from the Hamiltonian. In our case one has to consider each of the equations \Ref{e44} without the last term in the parentheses. Here we can introduce $\Phi=-i\chi$, $\Psi=-i\omega$ to get from two first equations $$ \frac{\partial\chi}{\partial y}=\mu_P\chi+\lambda(-\chi^2+\omega^2), $$ \begin{equation} \frac{\partial\omega}{\partial y}=\mu_O\omega -2\lambda\chi\omega . \label{faneq} \end{equation} One can see that these fan equations coincide in their form with the fan equations in the QCD. Indeed, the coupled equations for evolution of the odderon together with the pomeron, derived in \cite{hiim} in the transverse coordinate space are $$ {\partial N(\tdm{x},\tdm{y};y) \over \partial y} = {\bar\alpha_s \over 2\pi} \int d^2 z \; { (\tdm{x} - \tdm{y})^2 \over (\tdm{x} - \tdm{z})^2 (\tdm{z} - \tdm{y})^2} \left[ N(\tdm{x},\tdm{z};y) + N(\tdm{z},\tdm{y};y) - N(\tdm{x},\tdm{y};y) \right. $$ \begin{equation} \left. - N(\tdm{x},\tdm{z};y)N(\tdm{z},\tdm{y};y) + O (\tdm{x},\tdm{z};y) O(\tdm{z},\tdm{y};y) \right], \label{e48} \end{equation} $$ {\partial O(\tdm{x},\tdm{y};y) \over \partial y} = {\bar\alpha_s \over 2\pi} \int d^2 z \; { (\tdm{x} - \tdm{y})^2 \over (\tdm{x} - \tdm{z})^2 (\tdm{z} - \tdm{y})^2} \left[ O(\tdm{x},\tdm{z};y) + O(\tdm{z},\tdm{y};y) - O(\tdm{x},\tdm{y};y) \right. $$ \begin{equation} \left. - O(\tdm{x},\tdm{z};y)N(\tdm{z},\tdm{y};y) - N (\tdm{x},\tdm{z};y) O(\tdm{z},\tdm{y};y) \right] \label{e49} \end{equation} where $N(\tdm{x},\tdm{y};y)$ and $O(\tdm{x},\tdm{y};y)$ are the $C$-even and $C$-odd dipole amplitudes, respectively, symmetric and antisymmetric in ${\bf x},{\bf y}$. Here $\bar\alpha_s=N_c\alpha_s/\pi$. Following \cite{motyka} consider the translational invariant situation when the amplitudes depend only on the difference ${\bf r=x-y}$. Then passing to the momentum space \begin{equation} \chi(\tdm{k},y) = \int {d^2 \tdm{r} \over 2 \pi r^2} N(\tdm{r},y) \exp(-i \tdm{k}\tdm{r}), \quad \omega(\tdm{k},y) = \int {d^2 \tdm{r} \over 2 \pi r^2} O(\tdm{r},y) \exp(-i \tdm{k}\tdm{r}). \end{equation} we get the equations \cite{motyka} $$ {\partial \chi(\tdm{k},y) \over \partial y} = -H^{BFKL}\chi - \bar\alpha_s \chi^2 + \bar\alpha_s \omega^2, $$ \begin{equation} {\partial \omega(\tdm{k},y) \over \partial y} =- H^{BFKL}\omega - 2 \bar\alpha_s \chi\omega, \label{e411} \end{equation} where $H^{BFKL}$ is the standard LL BFKL Hamiltonian. For the local pomeron and odderon both $\chi$ and $\omega$ do not depend on $\tdm{k}$ and depend only on rapidity $y$. Then the equations simplify to $$ {\partial \chi(y) \over \partial y} = \mu_P \chi(y) - \bar\alpha_s \chi^2(y) + \bar\alpha_s \omega^2(y) , $$ \begin{equation} {\partial \omega(y) \over \partial y} = \mu_O \omega(y) -2 \bar\alpha_s \chi(y)\omega(y) , \label{e412} \end{equation} where the mass parameters $\mu_P$ and $\mu_O$ have a sense of the pomeron and odderon intercepts minus $1$, respectively. If one chooses $\lambda=\bar\alpha_s \equiv {N_c \alpha_s}/{\pi}$ then the equations \Ref{e412} completely coincide with our equations \Ref{faneq}. It is to be noted that the choice of real vertices for transitions $O\to O+P$ and $O+P\to O$ in our original Lagrangian \Ref{e12a} was dictated by the form of the equation for $\partial\omega/\partial y$. With the imaginary vertices one would obtain factor $i$ in the right-hand part, which could not be eliminated by rescaling of $\omega$, since the equation is linear in it. We acknowledge that the use of the one-dimensional description without the transverse space dependence for the odderon field, which is antisymmetric in $\tdm{k}$, is problematic. The comparison of terms of the equations connected with local interactions can, however, have a sense. It shows, at least, that coefficients before different terms and their signs coincide in \Ref{e44} and \Ref{e412}. Finally, the comparison of the fan equations fixes the coupling constant for $\Phi^{*}\Psi\Psi$ interaction but not for the last term in \Ref{e24a}. Here we choose the constant for the last term in \Ref{e12a} negative imaginary (or, equivalently, the opposite signs before the two last terms in \Ref{e24a}) to take into account the signature properties of odderon. With the given choice of constants the simple loop constructed from two odderon lines gives the positive correction to the pomeron propagator, whereas the simple loop from one odderon line and one pomeron line gives the negative correction both to the pomeron and odderon propagators. \subsection{Passage to the real Hamiltonian} \noindent The Lagrangian function \Ref{e12a} is to be accompanied by the form of the coupling of the pomerons and odderons to the external particles. We assume the eikonal form for the operators of creation of the initial state and annihilation of the final state (analogous to ones taken in \cite{braun1,braun2}): \begin{equation} F^{(in)}=1-e^{-ig_P^{(i)}\Phi^* + g_O^{{i}}\Psi^*} ,\quad F^{(fin)}=1-e^{-ig_P^{(i)}\Phi - g_O^{{i}}\Psi} \label{fin1} \end{equation} with possibly different coupling constants of interaction with the projectile and the target. We choose $g_p$ with a negative sign to later deal with well behaved expressions. The Hamiltonian \Ref{e24} with interaction \Ref{e24a} is complex, which makes practical use of it inconvenient. So one can pass to a real Hamiltonian. One possibility (case A) to do it is to introduce the Fock-Bargmann representation of operators \begin{equation} u \equiv i\Phi^{*} , \quad v = \frac{\partial}{\partial u}\equiv -i\Phi , \ \ \quad w \equiv i\Psi^{*} = -\Psi^{+} , \quad z = \frac{\partial}{\partial w} \equiv -i\Psi . \label{e53} \end{equation} In terms of these operators \begin{equation} H^{(A)}=-\mu_P u\frac{\partial}{\partial u}-\mu_O w\frac{\partial}{\partial w} +\lambda u^2\frac{\partial}{\partial u}-\lambda u\frac{\partial^2}{\partial u^2} -2\lambda w\frac{\partial^2}{\partial u\partial w}+2\lambda uw\frac{\partial}{\partial w} +\lambda u\frac{\partial^2}{\partial w^2}+\lambda w^2\frac{\partial}{\partial u} . \label{hampoa} \end{equation} The initial and final states become \begin{equation} F^{(in)}=1-e^{-g^{(i)}_P u - ig_O^{(i)} w} , \quad F^{(fin)}=1-e^{g^{(f)}_P v - ig_O^{(f)} z}. \label{e54a} \end{equation} So the coupling of the odderon to the projectile and the target becomes pure imaginary. Accordingly, our Hamiltonian is now real but the initial and final states are not. To separate real and imaginary amplitudes one has to separate terms with even and odd numbers of odderons, that is having $C=+1$ and $C=-1$. This can be done separating terms proportional to even or odd powers $m=m_i+m_f$ of the product ${g^{(i)}_O}^{m_i}{g^{(f)}_O}^{m_f}$. The alternative possibility (case B) is to only pass to imaginary $\Phi$ and $\Phi^{*}$ and do not change $\Psi$ and $\Psi^*$: \begin{equation} u \equiv i\Phi^{*} , \quad v = \frac{\partial}{\partial u}\equiv -i\Phi , \ \ \quad w \equiv \Psi^{*} = i\Psi^{+} , \quad z = \frac{\partial}{\partial w} \equiv \Psi . \end{equation} and to retain the form of the odderon coupling to the initial and final states. The alternative Hamiltonian is \begin{equation} H^{(B)}=-\mu_Pu\frac{\partial}{\partial u}-\mu_O w\frac{\partial}{\partial w} +\lambda u^2\frac{\partial}{\partial u}-\lambda u\frac{\partial^2}{\partial u^2} -2\lambda w\frac{\partial^2}{\partial u\partial w}+2\lambda uw\frac{\partial}{\partial w} -\lambda u\frac{\partial^2}{\partial w^2}-\lambda w^2\frac{\partial}{\partial u} . \label{hampob} \end{equation} As compared to the previous case the signs of the two last terms will be opposite. However, it is trivial to find out that this possibility is equivalent to the canonical transformation $\Psi\to i\Psi,$ $\Psi^*\to -i\Psi^*$ and in the end gives the same result for the amplitudes. \section{Evolution in rapidity} \subsection{Basic equations and methods for solution} \noindent If the initial state in the Schr\"odinger picture at rapidity zero is given by \begin{equation} |{y=0}\>=F_{y=0}(\Phi^{*},\Psi^{*})|0\>, \end{equation} then at rapidity $y$ it will be given by \begin{equation} |y\>=F_y(\Phi^{*},\Psi^{*})|0\> \end{equation} with the evolution to rapidity $y$ given by the equation \begin{equation} \frac{\partial F_y}{\partial y}=-HF_y . \label{evol} \end{equation} The amplitude for the transition from the state $F_{y=0}|0\>$ to a state $\<0|F^{(fin)}$ at rapidity $y$ will be given by the matrix element \begin{equation} i{\cal A}(y)= \<0| F^{(fin)}(\Phi,\Psi) e^{-Hy} F_{y=0}(\Phi^{*},\Psi^{*}) |0\> . \label{e51} \end{equation} We take the Hamiltonian in the real form \Ref{hampoa} with the initial and final states in the form \Ref{e54a}. The amplitude becomes $$ i{\cal A}(y)= \<0| \Big(1-e^{g_P^{(f)}v -ig_O^{(f)}z}\Big) e^{-Hy} \Big(1-e^{-g_P^{(i)}u - ig_O^{(i)}w}\Big) |0\> $$ \begin{equation} =-\<0| \, e^{g_P^{(f)}\frac{\partial}{\partial u} - ig_O^{(f)} \frac{\partial}{\partial w}} \, F_y(u,w) |0\> , \label{e55} \end{equation} where \begin{equation} F_y(u,w)=e^{-Hy}(1-e^{-g_P^{(i)}u -ig_O^{(i)}w}) \label{e56} \end{equation} is the result of the evolution of the initial state to rapidity $y$. Applying the derivatives we find \begin{equation} i{\cal A}(y)=-F_y(u,w)\Big|_{u=g^{(f)}_P, w=-ig^{(f)}_O}, \label{e57} \end{equation} that is the amplitude is obtained by just substituting $u$ and $w$ in the evolved $F(u,w)$ with the coupling constant for the target. To find the propagator one evidently has to take the terms linear in these coupling constants (or in $u$ or $w$). So the pomeron and odderon propagators are obtained as \begin{equation} P(y)=\frac{\partial F(u,w)}{\partial u}\Big|_{u=0,w=0}, \ \ O(y)=\frac{\partial F(u,w)}{\partial w}\Big|_{u=0,w=0} \label{props} \end{equation} with the odderon propagator actually carrying extra factor $i$. Passing to the possible methods to solve the evolution equation \Ref{evol} with the Hamiltonian given by \Ref{hampoa} or \Ref{hampob} we can find two basic alternatives. The first one is to study the Hamiltonian and find its eigenvalues. This is a difficult problem already without odderon, as demonstrated by earlier studies. With only the pomeron the Hamiltonian is non-Hermitian and acting on a complex field variable. Fortunately, in this case it could be transformed to a Hermitian Hamiltonian, which allowed to approximately find its ground state at very small coupling \cite{jengo}. Later a formalism has been developed to find all eigenvalues from the initial Hamiltonian in the complex variable \cite{braun3}. Inclusion of the odderon substantially aggravates the situation. Now the initial non-Hermitian Hamiltonian depends on two complex variables. Its analysis requires much more efforts and transformation to a Hermitian Hamiltonian becomes hardly possible. So we are left with the second alternative, which is to directly integrate the evolution equation numerically. This procedure turned out quite efficient for the pure pomeron model at physically reachable energies \cite{braun1}, although of course it cannot be stretched to infinite energies when the groundstate eigenvalue becomes essential. So we turn to direct integration of \Ref{evol} starting from some initial condition at $y=0$. One may consider two possibilities for the choice of variables for the wave function. One may develop $F_y(u,w)$ in power expansion in $u$ and $w$ \begin{equation} F_y(u,w)=\sum_{n=0,m=0}g_{nm}(y)u^nw^m. \label{powers} \end{equation} This form has a nice physical interpretation. Term with $u^nw^m$ corresponds to a state with $n$ pomerons and $m$ odderons. So expansion \Ref{powers} immediately gives the pomeron-odderon content of the wave function. However, convergence of this expansion is not guaranteed and the cut series obviously has a very bad behaviour at large $u$ and $w$. So, as we shall see, the applicability of this method is severely restricted to small values of $y$ and the coupling constant $\lambda$. Another possibility actually employed in \cite{braun1} is to take the initial function $F_{y=0}(u,w)$ on the lattice $(u_i,w_j)$ and evolve $F$ on this lattice. In this case the evolution equation itself is responsible for the high $y$ and $\lambda$ behaviour. As a result this method can be applied in a wide region of $y$ and $\lambda$. In the next subsections we consider these numerical methods in more detail. \subsection{Evolution by power expansion} \noindent Using \Ref{powers} one finds from \Ref{hampoa} $$ H F_y(u,w)=\sum_{n=0,m=0}g_{nm}(y) \Big(-\mu_Pnu^nw^m-\mu_Omu^nw^m +\lambda nu^{n+1}w^m-\lambda n(n-1)u^{n-1}w^m $$ \begin{equation} -2\lambda nmu^{n-1}w^m +2\lambda mu^{n+1}w^m+\lambda m(m-1)u^{n+1}w^{m-2} +\lambda nu^{n-1}w^{m+2}\Big) . \end{equation} Combining these terms as a coefficient before $u^nw^m$ one finds \begin{equation} H F_y(u,w)=\sum u^nw^m f_{nm}(y),\ \ \ f_{nm}(y)=Hg_{nm}(y) , \end{equation} where at $n\ge 2$ and $m\ge 2$ $$ f_{nm}=-\mu ng_{nm}-\mu_Omg_{nm} +\lambda(n-1)g_{n-1,m}-\lambda n(n+1)g_{n+1,m} $$ \begin{equation} -2\lambda(n+1)mg_{n+1,m} +2\lambda mg_{n-1,m}+\lambda (m+1)(m+2)g_{n-1,m+2} +\lambda (n+1)g_{n+1,m-2} \label{fnm} \end{equation} and for smaller values of $n$ and $m$ $$f_{00}=0,\ \ f_{10}=-\mu_Pg_{10}-2\lambda g_{20}+2\lambda g_{02}, \ \ f_{01}=-\mu_Og_{01}-2\lambda g_{11} , $$ $$f_{11}=-(\mu_P+\mu_O)g_{11}-6\lambda g_{21}+2\lambda g_{01}+6\lambda g_{03} , $$ $$f_{20}=-2\mu_P g_{20}+\lambda g_{10}-6\lambda g_{30}+2\lambda g_{12} $$ $$f_{21}=-(2\mu_p+\mu_O)g_{21}+3\lambda g_{11}-12\lambda g_{31}+6\lambda g_{13} , $$ $$f_{12}=-(\mu_P+2\mu_O)g_{12}-10\lambda g_{22} -4\lambda g_{02}+12\lambda g_{04}+2\lambda g_{20} , $$ \begin{equation} f_{02}=-2\mu_O g_{02}-4\lambda g_{12} +\lambda g_{10} . \end{equation} Note that if the initial $g_{nm}$ are given at $n,m\le N$ then one has to require that in \Ref{fnm} terms with $g_{nm}$ outside this domain should be put to zero. The full Hamiltonian describes creation and absorption of pomerons and odderons so that the theory includes loops constructed of both. To study the influence of loops one can consider a reduced fan Hamiltonian which describes fan diagrams and does not contain loops. Denoting the successive eight terms in \Ref{hampoa} or \Ref{hampob} as $(1),(2),\dots ,(8)$ one finds that the fan Hamiltonian contains terms $(1)+(2)+(3)+(6)+(8)$ and does not contain the rest. So in case A the fan Hamiltonian is \begin{equation} H^{(A)}_{fan}=-\mu_Pu\frac{\partial}{\partial u}-\mu_Ow\frac{\partial}{\partial w} +\lambda (u^2+w^2)\frac{\partial}{\partial u} +2\lambda uw\frac{\partial}{\partial w} \label{hfan} \end{equation} and in $H^{(B)}_{fan}$ the term with $w^2$ will have the opposite sign. For the fan diagrams in the power representation instead of \Ref{fnm} we find for $n,m\ge 2$ \begin{equation} f_{nm}^{fan}=-(n\mu_P+m\mu_O)g_{nm} +\lambda (n-1+2m)g_{n-1,m}+\lambda (n+1)g_{n+1,m-2} \label{fanfnm} \end{equation} and for $n<2$ or $m<2$ with $\mu_O=0$ $$f_{00}=0,\ \ f_{10}=-\mu_Pg_{10}, \ \ f_{01}=0,f_{11}=-\mu_P g_{11}+2\lambda g_{01} , $$ $$f_{20}=-2\mu_P g_{20}+\lambda g_{10}, \ \ f_{21}=-2\mu_P g_{21}+3\lambda g_{11} , $$ \begin{equation} f_{12}=-\mu_P g_{12}+4\lambda g_{02}+2\lambda g_{20}, \ \ f_{02}=+\lambda g_{10} . \end{equation} \subsection{Evolution by points. Composite fields} \noindent The method similar to one used in the previous papers \cite{braun1,braun2} is to use the evolution equation as it is, choosing some initial function at a set of points $u_0,\dots, u_N, w_0,\dots,w_N$ and evolving it with rapidity $y$ by the Runge-Kutta method. As a result of this numerical exercise one gets $F_y(u_0,...u_N|w_0,...w_N)$. This method worked for the pomeron evolution without the odderon in a very wide choice of the model parameters. Note, however, that this method requires a very particular choice of variables $u$ and $w$. In the Gribov model studied in \cite{braun1,braun2} the wave function is an analytic functions in $u$. Obviously, any analytical function can be completely determined by its values on some ray in the complex plane. However, one experience drawn from those papers was that the initial condition for the evolution has to be imposed on the positive real axis $i\Phi^*=u>0$, otherwise the numerical evolution process breaks down. The reason may be in that in practice one has to limit the values of $\Phi^*$ (or $u$). Convergence requires the wave function to fall at large values of the argument and this is possible only for a very particular direction in the complex $\Phi^*$-plane. As a result one has obligatory to pass from $\Phi^*$ to $u=i\Phi^*$ and start the evolution from positive $u$. With the odderon included we have the same situation with two variables $\Phi^*$ and $\Psi^*$ and from the start it is not clear which values for these variables in their complex plane allow convergence. We have immediately discovered that with the choice $u=i\Phi^*$ and $w=i\Psi^*$ evolution from the positive axes for both variables is impossible, leading to divergence at quite small values of $y<1$. So we are bound to seek for different variables in which evolution becomes realizable. As a hint one may consider a model (which will be the subject of our subsequent paper) in which the fake odderon does not possess the negative signature and moreover has the same intercept as the pomeron, their difference reduced only to the $C$-parity. In such a model the choice of variables for evolution is trivial, since it follows this choice for the model with only the pomeron. Based on this hint we introduce composite fields as linear combinations of the pomeron and odderon fields. We define $$ \phi = \frac{\Phi + i \Psi}{\sqrt{2}} , \quad \phi^* = \frac{\Phi^* - i \Psi^*}{\sqrt{2}} , $$ \begin{equation} \tilde \phi = \frac{\Phi - i \Psi}{\sqrt{2}} , \quad \tilde \phi^* = \frac{\Phi^* + i \Psi^*}{\sqrt{2}} . \label{e31} \end{equation} Their commutation relations are $$ \left[ \phi , \phi^* \right] = 1 , \quad \left[ \tilde \phi , \tilde \phi^* \right] = 1 , $$ \begin{equation} \left[ \phi , \tilde \phi \right] = \left[ \phi , \tilde \phi^* \right] = \left[ \phi^* , \tilde \phi \right] = \left[ \phi^* , \tilde \phi^* \right] = 0 , \label{e32} \end{equation} which shows that $\phi$ and $\tilde\phi$ are independent dynamical variables. If one takes the interaction Hamiltonian as a sum of two interactions of the Gribov model \Ref{e11} depending on different composite variables and with an appropriate coupling constants one finds \begin{equation} V_0 = i {\sqrt{2}}\,{\lambda} \left(\phi^{*}\phi\phi + \phi^{*}\phi^{*}\phi \right) + i {\sqrt{2}}\,{\lambda} \left(\tilde\phi^{*}\tilde\phi\tilde\phi +\tilde\phi^{*}\tilde\phi^{*}\tilde\phi \right) \label{e33} \end{equation} or in terms of elementary fields \begin{equation} V_0(\Phi,\Psi)= + i \lambda \left( \Phi^{*}\Phi\Phi + \Phi^{*}\Phi^{*}\Phi +2 \Psi^{*}\Psi\Phi + 2 \Phi^{*}\Psi^{*}\Psi - \Phi^{*}\Psi\Psi - \Psi^{*}\Psi^{*}\Phi \right). \label{e34} \end{equation} Comparing with the true interaction $V$ with the odderon signature taken into account we find \begin{equation} V=V_0+V_1,\end{equation} where \begin{equation} V_1=2i\lambda\Psi^*\Psi^*\Phi= -i\frac{\lambda}{\sqrt{2}}\Big(\phi^* -\tilde{\phi}^* \Big)^2 (\phi+\tilde{\phi}). \end{equation} So the full Hamiltonian in terms of composite fields is \begin{equation} H=H_0+V_0+V_1, \end{equation} where the free part (in the physical case $\mu_O=0$) is \begin{equation} H_0=-\frac{1}{2}\mu_P (\phi^* +\tilde{\phi}^*)(\phi+\tilde{\phi}). \end{equation} Following the experience with only the pomeron field we pass to real variables introducing \begin{equation} \phi^*=-iu , \quad \phi=i\frac{\partial}{\partial u} =iv , \quad \tilde{\phi}^*=-iw , \quad \tilde{\phi}=\frac{\partial}{\partial w} =iz . \end{equation} We stress that these $u$ and $w$ are not the old $u$ and $w$ in \Ref{e53}. We denote them so only to economize in notations. Then the final Hamiltonian in variables $u$ and $w$ is found as $$ H=-\frac{1}{2}\mu_P (u+w)\Big(\frac{\partial}{\partial u}+\frac{\partial}{\partial w}\Big) $$ $$ -\lambda\sqrt{2}\Big(u\frac{\partial^2}{\partial u^2}-u^2\frac{\partial}{\partial u} +w\frac{\partial^2}{\partial w^2}-w^2\frac{\partial}{\partial w}\Big) $$ \begin{equation} -\frac{\lambda}{\sqrt{2}}(u-w)^2\Big(\frac{\partial}{\partial u}+\frac{\partial}{\partial w}\Big). \label{newh} \end{equation} This Hamiltonian is symmetric in variables $u$ and $w$. So once the initial wave function $F(u,w)$ is (anti)symmetric in $u$ and $w$ it will preserve this property in the evolution in rapidity. It is remarkable that if one takes the initial function $F(u,v)$ on the positive axis of both $u$ and $v$ then its evolution in rapidity become possible in a rather wide region of parameters $\mu_P$ and $\lambda$ and also to rather high values of the rapidity. The results of this evolution for different sets of $(\mu_P,\lambda)$ are reported in the next Section. Note that the pomeron and odderon fields are expressed as \begin{equation} \Phi^+=\Phi^*=\frac{\phi^* +\tilde \phi^*}{\sqrt{2}}, \quad \Psi^+=-i\Psi^*=\frac{\phi^*-\tilde \phi^*}{\sqrt{2}} \label{e60} \end{equation} or in terms of $u$ and $w$ \begin{equation} \Phi^+=-i\frac{u+w}{\sqrt{2}},\ \ \Psi^+=-i\frac{u-w}{\sqrt{2}} \label{e61} \end{equation} and the evolution equation for the wave function takes the form \Ref{evol} with the Hamiltonian \Ref{newh}. To start evolution in terms of $\phi$, $\tilde\phi$ we choose \Ref{e61}, dropping the common factor $(-i)$, as the initial state $F_{y=0}(u,w)$ for the pomeron and odderon, respectively. The expressions for the propagators become \begin{equation} P(y)=\frac{1}{\sqrt{2}} \left(\frac{\partial}{\partial u} + \frac{\partial}{\partial w} \right) F(u,w)\Big|_{u=w=0}, \ \ O(y)=-\frac{1}{\sqrt{2}} \left(\frac{\partial}{\partial u} - \frac{\partial}{\partial w} \right) F(u,w)\Big|_{u=w=0} \label{e62} \end{equation} instead of \Ref{props}. Since the exchange of $u$ and $w$ is the $C$-transformation, the $C$-symmetry of the Hamiltonian assures that the wave function remains symmetrical under $u \leftrightarrow w$ for the pomeron and antisymmetrical for the odderon at any $y$. Furthermore, $C$-symmetry guarantees that the symmetrical and antisymmetrical parts of the wave function evolve independently that allows one to choose the sum $u\sqrt{2}$ of \Ref{e61} as the initial state and to find both propagators from \Ref{e62} in one numerical simulation. \section{Numerical evolution: results} \subsection{Power expansion} \noindent Evolution by power expansion works only for small values of $\mu_P$ and $\lambda$. In our calculation we took $\mu=0.1$ and $\lambda =0.01$ and $0.03$. The evolution equations in all cases were solved by the second order Runge-Kutta method with the precision 10000 points for $\Delta y=1$. The evolution breaks down at larger $\lambda$. For the chosen $\lambda$ the evolution works approximately until $y=30$ for $\lambda=0.01$ and until $y=20$ for $\lambda=0.03$. The actual interval of $\lambda$ when the evolution works is clear from the figures presenting the results. Note that for technical reasons our figures are labeled by values of $e=-\mu$ and $a=-\lambda$. \newpage {\bf The propagators} \noindent The pomeron propagator $P(y)$ calculated by power expansion for $\mu=0.1$ is shown in Fig.~\ref{fig6} by upper curves in the left upper panel for $\lambda=0.01$ and the left lower panel for $\lambda=0.03$. To compare and see the precision the lower curves present our far more precise results obtained by point evolution. In the right panels we similarly present the odderon propagator for the same values of $\mu$ and $\lambda$. For the odderon the lower curves were obtained by power expansion and the upper ones by point evolution. One observes that the power expansion gives satisfactory results at smaller values of $\lambda$ and rapidity. With the growth of both its precision worsens notably and at $\lambda=0.03$ its convergence breaks down already at $y\sim 15$. \begin{figure}[h!p] \begin{center} \includegraphics[width=7.2 cm]{comp01_001.eps} \includegraphics[width=7.2 cm]{compo01_001.eps} \includegraphics[width=7.2 cm]{comp01_003.eps} \includegraphics[width=7.2 cm]{compo01_003.eps} \vskip -0.2cm \caption{Propagators of the pomeron (left panels) and odderon (right panels) as calculated by power expansion (dashed curves) and point evolution (solid curves). In all panels $\mu=0.1$. In upper panels $\lambda=0.01$, in the lower $\lambda=0.03$.} \label{fig6} \end{center} \vskip -0.5cm \end{figure} The influence of loops and the odderon in the whole region $0<y<30$ will be illustrated later, in Fig. \ref{fig1} based on the precise calculations by the point-like evolution. \vspace*{0.2 cm} {\bf The pA amplitude} \noindent The $pA$ amplitude may be $C$-even and $C$-odd and depend on the couplings of the pomeron and odderon to the proton in the projectile and target. We take $g^{(i)}_P=g^{(f)}_P=1$ and for the odderon we consider two cases $|g_O^{(i)}|=1$ and $g_O=0$. In the second case all the influence of the odderon is reduced to loops. The coupling constant $\lambda$ was again taken as $0.01$ and $0.03$. The $C$-even and $C$-odd amplitudes are presented in Figs. \ref{fig3} and Fig.~\ref{fig4}. In Fig.~\ref{fig5} we show the even amplitude with the odderon coupling equal to zero, when the whole influence of the odderon reduces to its loop contribution. In all these pictures the $pA$ amplitude is shown together with the predictions from fan diagrams. As one observes in the $C$-even amplitude the combined effect of the pomeron and odderon loops is the same as in the propagators: they diminish the amplitudes, just as without odderon. The situation with the $C$-odd amplitude is not clear, since it is quite small and the loop effects become visible at rapidities probably outside the region of convergence, which is observed at $y>5$ for $\lambda=0.03$. \begin{figure}[ht] \begin{center} \includegraphics[width=7.2 cm]{namplidp_001.eps} \includegraphics[width=7.2 cm]{namplidp_003.eps} \caption{pA C-even amplitudes for at different rapidities for $\mu_p=0.1 $, $\lambda=0.01, 0.03$ and $g_P=|g_O|=1$. The upper curves correspond to summation of the fan diagrams.} \label{fig3} \end{center} \end{figure} \begin{figure}[ht] \begin{center} \includegraphics[width=7.2 cm]{namplidm_001.eps} \includegraphics[width=7.2 cm]{namplidm_003.eps} \caption{pA C-odd amplitudes at different rapidities for $\mu_p=0.1$, $\lambda=0.01, 0.03$ and $g_P=|g_O|=1$. The lower curves correspond to summation of the fan diagrams.} \label{fig4} \end{center} \end{figure} \begin{figure}[h!] \begin{center} \includegraphics[width=7.2 cm]{namplib_001.eps} \includegraphics[width=7.2 cm]{namplib_003.eps} \caption{pA C-even amplitudes at different rapidities for $\mu_p=0.1$, $\lambda=0.01, 0.03$ and $g_P=1, g_O=0$ (lower curves). The upper curves corresponds to summation of the fan diagrams.} \label{fig5} \end{center} \end{figure} \subsection{Evolution by points} \noindent As mentioned, unlike evolution by powers, evolution of Eq.~\Ref{evol} on the $(u,w)$ lattice admits wide areas in $y$, $\mu$ and $\lambda$ using different steps in $y$. The latter depend on the values of $\lambda$. For $\lambda\leq 0.05$ satisfactory results were obtained with $N=400$ points in the interval $(0,20)$ for both $u$ and $w$ and 2000 points for $\Delta y=1$. However, for $\lambda=0.1$ we had to raise the precision in $y$ to take 20000 points for $\Delta y=1$. With $\lambda=1$ one has to take 100000 points for $\Delta y=1$ with the corresponding rise in the processor time. Raising the number of points in $u$ and $w$ to $N=500$ changes both propagators only by few percents. Below we report on the calculated pomeron and odderon propagators, for which we took symmetric and antisymmetric initial conditions $(u\pm w)/\sqrt{2}$, respectively. We do not report our results for $pA$ amplitudes, since their behaviour more or less follows the one found above via the evolution by powers. \vspace*{0.2 cm} {\bf Pomeron and odderon propagators} We start with our results for the pomeron at small values of $\mu$ and $\lambda$, where also power expansion gives converging results previously shown in Fig. \ref{fig6}. In Fig. \ref{fig1} the solid (middle) curves show the pomeron propagator with $\mu=0.1$ and $\lambda=0.01$ (left panel) and $0.03$ (right panel). The bottom curves show the results obtained without the odderon (only pomeron loops) and the upper curves show the propagator without any loops. One concludes that the odderon loops somewhat enhance the propagator, which is natural as they bear the opposite sign. \begin{figure}[h!p] \begin{center} \includegraphics[width=7.2 cm]{nlocpom001_001.eps} \includegraphics[width=7.2 cm]{nlocpom001_003.eps} \vskip -0.2cm \caption{The pomeron propagators as functions of rapidity for $\mu=0.1$, $\lambda=0.01$ (left panel) and $0.03$ (right panel). Our results with both the pomeron and odderon loops are shown in the middle curve, those with only the pomeron loops in the bottom curve and without loops in the upper curve.} \label{fig1} \end{center} \vskip -0.5cm \end{figure} At $\lambda\geq 0.04$ evolution by power expansion breaks down. So the rest plots for the pomeron and odderon propagators shown in Figs.~\ref{fig7}-\ref{fig11} use evolution by points. For the pomeron we compared our results including odderon loops with our old calculations without odderon \cite{braun3,braun1}. We consider the cases with $$ (\mu,\lambda)=(1,0.1),\ \ (-1,0.1),\ \ (1,1/3),\ \ (1,1),\ \ (0.1,1), $$ which fully enough illustrate the dependence on the intercept $1+\mu$ and triple coupling constant $\lambda>0$. The dashed curves in all plots of the pomeron propagator correspond the results without odderon. \begin{figure}[h!p] \begin{center} \includegraphics[width=7.2 cm]{ncomp_1_01.eps} \includegraphics[width=7.2 cm]{nlocpod1_01.eps} \caption{The solid curves show pomeron (left panel) and odderon (right panel) propagators as functions of rapidity for $\mu=1$, $\lambda=0.1$. The dashed curve in the left panel shows the pomeron propagator in absence of the odderon (only pomeron loops).} \label{fig7} \end{center} \end{figure} \begin{figure}[h!p] \begin{center} \includegraphics[width=7.2 cm]{ncomp_-1_01.eps} \includegraphics[width=7.2 cm]{nlocpod-1_01.eps} \caption{The solid curves show pomeron (left panel) and odderon (right panel) propagators as functions of rapidity for $\mu=-1$, $\lambda=0.1$. The dashed curve in the left panel shows the pomeron propagator in absence of the odderon (only pomeron loops).} \label{fig8} \end{center} \end{figure} \begin{figure}[h!p] \begin{center} \includegraphics[width=7.2 cm]{ncomp_1_033.eps} \includegraphics[width=7.2 cm]{nlocpod1_033.eps} \caption{The solid curves show pomeron (left panel) and odderon (right panel) propagators as functions of rapidity for $\mu=1$, $\lambda=1/3$. The dashed curve in the left panel shows the pomeron propagator in absence of the odderon (only pomeron loops).} \label{fig9} \end{center} \end{figure} \begin{figure}[h!p] \begin{center} \includegraphics[width=7.2 cm]{ncomp_1_1.eps} \includegraphics[width=7.2 cm]{nlocpod1_1.eps} \caption{The solid curves show pomeron (left panel) and odderon (right panel) propagators as functions of rapidity for $\mu=1$, $\lambda=1$. The dashed curve in the left panel shows the pomeron propagator in absence of the odderon (only pomeron loops).} \label{fig10} \end{center} \end{figure} \begin{figure}[h!p] \begin{center} \includegraphics[width=7.2 cm]{ncomp_01_1.eps} \includegraphics[width=7.2 cm]{nlocpod01_1.eps} \caption{The solid curves show pomeron (left panel) and odderon (right panel) propagators as functions of rapidity $\mu=0.1$, $\lambda=1$. The dashed curve in the left panel shows the pomeron propagator in absence of the odderon (only pomeron loops).} \label{fig11} \end{center} \end{figure} Observing our results we see that the effect of the odderon loops is universally constructive. As expected they act in the opposite direction compared to the pomeron loops making the propagator somewhat larger. This effect is enhanced with the growth of rapidity. At large values of $\lambda$ the effect of odderon loops starts at quite small $y$ and becomes very strong, see Figs.~\ref{fig9}-\ref{fig11}. In all cases at large enough $y$ the pomeron propagator goes to zero. \newpage \section{Quadruple interaction} \noindent The conclusion that only the triple interactions are essential at large energies is based on the renormalization group analysis \cite{migdal,migdal1} and is not applicable for the one-dimensional model. To introduce the quadruple interaction in our theory we shall exploit the idea that the model can be expressed via the composite fields \Ref{e31} and add a term to the Hamiltonian \begin{equation} H_4=\lambda'\Big(\phi^*\phi^*\phi\phi +\tilde{\phi}^*\tilde{\phi}^*\tilde{\phi}\tilde{\phi}\Big) . \label{h4} \end{equation} In terms of the pomeron and odderon fields one finds \begin{equation} \phi^*\phi^*\phi\phi =\frac{1}{\sqrt{2}}\Big[({\Phi^*}^2-{\Psi^*}^2)(\Phi^2-\Psi^2) +4 \Phi^* \Psi^* \Phi\Psi+2i({\Phi^*}^2-{\Psi^*}^2)\Phi\Psi -2i\Phi^* \Psi^* (\Phi^2-\Psi^2)\Big] . \end{equation} Then the quadruple interaction \Ref{h4} can be written as \begin{equation} H_4^{(A)}=\lambda'\Big({\Phi^*}^2\Phi^2 + {\Psi^*}^2\Psi^2 -{\Phi^*}^2\Psi^2-{\Psi^*}^2\Phi^2 + 4\Phi^* \Psi^* \Phi\Psi \Big) . \end{equation} Passing to variables $u,w$ \Ref{e53} we have \begin{equation} H_4=\lambda'\Big((u^2-w^2)\frac{\partial^2}{\partial u^2} +(w^2-u^2)\frac{\partial^2}{\partial w^2}+4uw\frac{\partial^2}{\partial u\partial w}\Big) . \label{h41a} \end{equation} One can try to use these form of the interaction to perform the evolution by points in the space $(u,w)$. Unfortunately the additional quadruple terms drastically spoil convergence and do not allow to move above $y=1$. In contrary, with a non-zero $\lambda'$ evolution by powers allows to calculate the pomeron and odderon propagators at rather high values of $\lambda$ and $\lambda'$ at least up to rapidity $y=10$. In the evolution in powers of $u$ and $w$ this interaction generates an additional term $f_{nm}^{(4)}$ in \Ref{fnm}. For $n,m\geq 2$ one finds \begin{equation} f^{(4)}_{nm}=\lambda'\Big\{[n(n-1)+m(m-1)+4nm]g_{nm} -(m+1)(m+2)g_{n-2,m+2}-(n+1)(n+2)g_{n+2,m-2}\Big\} \label{fnm4} \end{equation} and for smaller $n$ or $m$ $$f^{(4)}_{00}=f^{(4)}_{10}=f^{(4)}_{01}=0,\ \ f^{(4)}_{11}=\lambda'g_{11} $$ $$f^{(4)}_{20}=2\lambda'(g_{20}-g_{02}),\ \ f^{(4)}_{02}=-f^{(4)}_{20} $$ \begin{equation} f^{(4)}_{21}=2\lambda'(g_{21}-3g_{03}), \ \ f^{(4)}_{12}=2\lambda'(g_{12}-3g_{30}) . \end{equation} In Fig.~\ref{quadr} we show the propagators at $\mu=0.1$, $\lambda=0.1$ and values of $\lambda'=0$, $0.5$, $1$ and $2$. Convergence becomes better with the growth of $\lambda'$. In particular at $\lambda'=0$ that is without the quadruple interaction, the power series method diverges and the corresponding curves could only be obtained by the point evolution. Calculation shows that the quadruple interaction somewhat raises both the pomeron and odderon propagators which are illustrated in Fig.~\ref{quadr}. The curves show the propagators successively enhanced as the values of $\lambda'$ are raised: $\lambda'=0, 0.5, 1, 2$. So the quadruple interaction \Ref{h4} acts in the opposite direction to the loops coming from the triple interaction providing a constructive contribution. \begin{figure}[ht] \begin{center} \includegraphics[width=7.2 cm]{nlpomq.eps} \includegraphics[width=7.2 cm]{nlpodq.eps} \caption{Pomeron (left panel) and odderon (right panel) propagators at different rapidities for $\mu=0.1 $, $\lambda=0.1$ with the quadruple interaction. Curves from bottom to top correspond to $\lambda'=0$, $0.5$, $1.0$ and $2.0$.} \label{quadr} \end{center} \end{figure} \section{Conclusions} \noindent We have proposed an one-dimensional reggeon model for the interaction of local pomerons and odderons at different energies. The model is a natural generalization of the well-known ''toy'' model for the pomerons only and follows the structure of the pomeron-odderon evolution in the QCD. It allows to study evolution of interacting pomerons and odderons with quantum effects (loops) fully taken into account and so estimate these effects and validity of the quasiclassical approximation. Practical methods to study evolution in rapidity were proposed. In the general case they can be pursued by the same numerical procedure that turned out to be successful for the model without odderons, provided the initial wave function is adequately chosen. In particular, naive independent initial choice of the pomeron and odderon contribution is not allowed for evolution, since, probably, it contradicts the asymptotic properties of the wave function considered as a function of two complex field describing the pomeron-odderon system. The found numerical results show that the inclusion of odderon loops enhances the pomeron propagators but somewhat damps the $pA$ amplitudes. In particular, the odderon propagator strongly falls with energy in agreement with conclusions from the QCD. Remarkably the influence of odderon loops is clearly felt both in the propagators and amplitudes. also leads to overall damping with energies. We also studied a certain quadruple interaction choosing it in a form symmetric in pomerons and odderons. This interaction acts constructively and raises both the pomeron and odderon propagators. \section{Acknowledgements} \noindent The authors are grateful to the referee for major constructive comments and suggestions used in the paper. \newpage
\section*{Abstract} A novel approach towards construction of absolutely continuous distributions over the unit interval is proposed. Considering two absolutely continuous random variables with positive support, this method conditions on their convolution to generate a new random variable in the unit interval. This approach is demonstrated using some popular choices of the positive random variables such as the exponential, Lindley, gamma. Some existing distributions like the uniform and the beta are formulated with this method. Several new structures of density functions having potential for future application in real life problems are also provided. One of the new distributions having one parameter is considered for parameter estimation and real life modelling application and shown to provide better fit than the popular one parameter Topp-Leone model.\\ \noindent\textbf{\large{Keywords:}} Topp-Leone, Uniform, Beta, Exponential, Gamma, Lindley, Convolution, Ferlie-Gumble- Morgenstern copula.\\ \noindent\textbf{\large{MSC 2010:}} 60E05. \\ \section{Introduction} Consider a departmental store where customers arrive independently of each other. Suppose the store opens at 10:00 a.m. and the second customer arrives at 11:00 a.m. Arrival time of the first customer was not observed. Then the store manager may be interested in finding the probability of the first customer arriving within half an hour from opening the store. If the customers arrive according to a Poisson process, then the probability of the first customer arriving within 10:30 a.m. is $0.5$. In fact, for given arrival time of the second customer, arrival time of the first customer is conditionally uniform over the duration that is uniform over 10:00 a.m to 11:00 a.m. This follows from the assumption that the inter-arrival times of the customers are independently and identically distributed (iid) exponential random variates. However, the conditional distribution does not remain uniform when any one of the above assumptions is relaxed. Still the resulting conditional distribution has support $(0,1)$, the unit interval. This simple yet previously unaddressed approach clearly opens up a scope for constructing new distributions in the unit interval.\\ Importance of distributions with support $(0,1)$ is well established for modelling proportions, scores, rates, indices etc. Responses in the unit interval are often focus of investigation in many fields of application including finance (Gómez-Déniz et al. 2014, Biswas et al. 2020), public health (Mazucheli et al. 2019, Biswas and Chakraborty 2019), demography (Andreopoulos et al. 2019). The first model that comes to the mind of practitioners is obviously the well known Beta distribution (Johnson et al. 1995). Besides this, the Kumaraswamy's distribution (Kumaraswamy 1980, Jones 2009) and the Topp-Leone distribution (Topp and Leone 1955) also received attention. In recent times, a number of new models have been proposed as alternatives to the Beta and Kumaraswamy's distributions to enhance modelling flexibility as par context (Grassia 1977, Tadikamalla and Johnson 1982, Barndorff-Nielsen and Jorgensen 1991, Lemonte et al. 2013, Pourdarvish et al. 2015, Mazucheli et al. 2018, 2019, 2020). This recent surge in the number of research papers devoted to proposing new distribution in the unit interval clearly exhibits their growing relevance.\\ Most of the above distributions are generated through a suitable variable transformation of a baseline distribution with positive support. For $X$ being a positive valued random variable, the transformations $U=X/(1+X)$, $U=1/(1+X)$, $U=\exp(-X)$ are popularly used to derive a distribution with support $(0,1)$. Besides this, a general approach based on the cumulative distribution function-quantile function by Smithson and Shou (2017), Rodrigues et al. (2019) and Cancho et al. (2020). The objective of this paper is to describe a general procedure for construction of distributions with support $(0,1)$ from conditional convolution approach.\\ Rest of the article is organized as follows. The new method of deriving distributions on $(0,1)$ is presented in the next section. Section 3 is devoted for illustrating the proposed methodology. Section 4 provides some detail on a new one parameter distribution along with real life application. This article is concluded with a potential generalization and further scopes. \section{Method} Consider a two component absolutely continuous random vector $(X,Y)$ with joint cumulative distribution function (cdf) $F_{X,Y}$ and joint probability density function (pdf) $f_{X,Y}$. Let $F_X$ and $f_X$ are the marginal cdf and the marginal pdf of $X$, respectively. Similarly, $F_Y$ and $f_Y$ denote the marginal cdf and the marginal pdf of $Y$. The conditional cdf and pdf of $X$ given the realization on $Y$ are $F_{X|Y}$ and $f_{X|Y}$, respectively. \\ We assume that both $X$ and $Y$ have positive support, that is $P(X>0)=P(Y>0)=1$. For $Z=X+Y$, the cdf of $Z$ can be expressed as \begin{equation}\label{eq:Fz} F_Z(z)=\int_0^z F_{X|Y}(z-y) f_Y(y)\,dy. \end{equation} The corresponding pdf is \begin{equation}\label{eq:fz} f_Z(z)=\int_0^z f_{X,Y}(z-y,y)\,dy=\int_0^z f_{X|Y}(z-y) f_Y(y)\, dy. \end{equation} In particular, when $X$ and $Y$ are independent, the cdf and the pdf of $Z$ can be obtained by replacing $F_{X|Y}(z-y)$ by $F_X(z-y)$ in (\ref{eq:Fz}) and $f_{X|Y}(z-y)$ by $f_X(z-y)$ in (\ref{eq:fz}), respectively. \\ We are interested in the conditional distribution of $X$ given $Z=1$. The corresponding random variable be $U$ with support $(0,1)$, the unit interval. Now $P(U\leq u)=P(X\leq u|Z=1)=P(X\leq u , X+Y=1)/f_Z(1)$. $P(X\leq u , X+Y=1)$ can be seen as $\int_0^u f_{X,Y}(v,1-v)\, dv$ and hence the pdf of $U$ is \begin{equation}\label{eq:fu} f_U(u)=\frac{f_{X,Y}(u,1-u)}{f_Z(1)}, \,\, \textrm{for}\,\, 0<u<1. \end{equation} If $X$ and $Y$ are independently distributed, then $f_{X,Y}(u,1-u)$ can be replaced by $f_X(u)f_Y(1-u)$ in (\ref{eq:fu}). It may be noted that, bivariate distributions on $(0,\infty)\times (0,\infty)$ are seldom naturally available. The common techniques to construct bivariate distributions from given marginals involve marginal transformation method, trivariate reduction and bivariate copula (Balakrishnan and Lai 2009). To demonstrate the proposed method for constructing distributions on the unit interval, some bivariate distributions will be considered in Section 3. The bivariate density we use here is derived using Ferlie-Gumble-Morgenstern (FGM) copula (Gumble 1960) when the marginal densities $f_X$ and $f_Y$ are available. The joint density function of $(X,Y)$ with additional parameter $\alpha\in [-1,1]$ using FGM copula is \begin{equation}\label{eq:fgm} f_{X,Y}(x,y)=f_X(x)f_Y(y)[1+\alpha(2F_X(x)-1)(2F_Y(y)-1)]. \end{equation} \section{Main results} In this section we apply the proposed method to first derive distributions in $(0, 1)$ which are known followed by some new ones which to the best of our knowledge are not yet reported in the literature. \subsection{Known distributions} As outlined in Section 1, let $X$ and $Y$ follow exponential distribution independently with same parameter $\theta$. Then $f_X(x|\theta)=\theta\exp(-\theta x)$ and $f_Y(y|\theta)=\theta\exp(-\theta y)$. Putting the the expressions of $f_X(x|\theta)$ and $f_Y(y|\theta)$ in (\ref{eq:fz}), we get $f_Z(1|\theta)=\theta^2\exp(-\theta)$. Now, putting the expressions of $f_X(x|\theta)$, $f_Y(y|\theta)$ and $f_Z(1|\theta)$ in (\ref{eq:fu}) we get $f_U(u)=1$ for $0<u<1$ which is pdf of the uniform uniform distribution over unit interval. \\ Let $G(\alpha,\beta)$ denote the gamma distribution with density function $\alpha^\beta x^{\beta-1}\exp(-\alpha x)/\Gamma(\beta)$ for $\alpha,\beta >0$. Consider $X\sim$G$(\alpha,\beta_1)$ and $Y\sim$G$(\alpha,\beta_2)$ independently. Using (\ref{eq:fz}) it is easy to see that $Z\sim G(\alpha,\beta_1+\beta_2)$. Now, putting $f_X(x|\alpha,\beta_1)$, $f_Y(y|\alpha,\beta_2)$ and $f_Z(1)=\alpha^{\beta_1+\beta_2}\exp(-\alpha)/\Gamma(\beta_1+\beta_2)$ in (\ref{eq:fu}) we get $f_U(u|\beta_1,\beta_2)=\Gamma(\beta_1+\beta_2)u^{\beta_1-1}(1-u)^{\beta_2-1}/\Gamma(\beta_1)\Gamma(\beta_2)$ which is the pdf of beta distribution with parameters $\beta_1$ and $\beta_2$.\\ While the uniform and beta cases are easily seen, generating the other distributions in the unit interval as mentioned in Section 1 using the proposed method remain a challenge. However, we do not claim that the distributions can (or cannot) be generated using the proposed method. \subsection{New distributions} Here we consider different distributions for $(X, Y)$ to construct a number of new distributions on the unit interval.\\ \noindent\textbf{Distribution 1:} Let $X$ and $Y$ follow exponential distribution independently with parameter $\theta_1$ and $\theta_2$, respectively. Putting $f_X(x|\theta_1)=\theta_1\exp(-\theta_1x)$ and $f_Y(y|\theta_2)=\theta_2\exp(-\theta_2y)$ in (\ref{eq:fz}) we get \begin{equation} f_Z(1)=\begin{cases} \frac{\theta_1\theta_2(e^{-\theta_1}-e^{-\theta_2})}{\theta_1-\theta_2}\quad \textrm{for}\quad \theta_1\neq\theta_2\\ \theta^2e^{-\theta} \quad \textrm{for}\quad \theta_1=\theta_2=\theta. \end{cases} \end{equation} Now, putting $f_X(x|\theta_1)$, $f_Y(y|\theta_2)$ and $f_Z(1)$ in (\ref{eq:fu}) and replacing $\theta_1-\theta_2$ by $\delta$ we obtain \begin{equation} \label{eq:d1} f_U(u)=\begin{cases} \frac{\delta e^{-\delta u}}{1-e^{-\delta}}\quad \textrm{for} \quad \delta\neq 0\\ 1\quad \textrm{for} \quad \delta=0. \end{cases} \end{equation} The density function in (\ref{eq:d1}) reduces to that of truncated exponential distribution with region of truncation $(1,\infty)$ when we restrict the parameter space to $\delta>0$. However, the new genesis does not require the parameter $\delta$ to be positive. Thus the density in (\ref{eq:d1}) provides more flexibility with $\delta\in\mathcal{R}$, the real line despite having the same mathematical structure as the said truncated exponential distribution. From Figure 1 it is clear that the density can be both increasing and decreasing depending on $\delta$. For $\delta<0$, it is increasing with mode at $1$ and for $\delta>0$, it is decreasing with mode at $0$.\\ \begin{figure}[H] \begin{center} \includegraphics[height=3in,width=4in,angle=0]{figure1.pdf} \caption{Plot of the density function of Distribution 1.} \end{center} \end{figure} \noindent\textbf{Distribution 2:} Let $X$ and $Y$ both marginally follow exponential distribution with parameters $\theta$. Putting $f_X(x|\theta)=\theta\exp(-\theta x)$, $F_X(x|\theta)=1-\exp(-\theta x)$, $f_Y(y|\theta)=\theta\exp(-\theta y)$ and $F_Y(y|\theta)=1-\exp(-\theta y)$ in (\ref{eq:fgm}) we obtain the following bivariate exponential distribution with parameters $\theta>0$ and $-1\leq\alpha\leq 1$. \begin{equation}\label{eq:fgmd2} f_{X,Y}(x,y|\theta,\alpha)=\theta^2 e^{-\theta(x+y)}\left[1+\alpha(1-2e^{-\theta x})(1-2e^{-\theta y})\right] \end{equation} Using (\ref{eq:fgmd2}) in (\ref{eq:fz}) we obtain \begin{equation} f_Z(1)=\theta^2 e^{-\theta}\left[1+\alpha\left\{1+4e^{-\theta}-\frac{4}{\theta}+4\frac{e^{-\theta}}{\theta}\right\}\right]. \end{equation} Putting (\ref{eq:fgmd2}) and (\ref{eq:fz}) in (\ref{eq:fu}) we obtain the following density function. \begin{equation}\label{eq:d2} f_U(u)=\frac{1+\alpha(1-2e^{-\theta u})(1-2e^{-\theta(1-u)})}{\left[1+\alpha\left\{1+4e^{-\theta}-\frac{4}{\theta}+4\frac{e^{-\theta}}{\theta}\right\}\right]} \end{equation} This distribution has two parameters and may prove to be useful in modelling applications. It is clear that for $\alpha=0$, $X$ and $Y$ are independent and consequently (\ref{eq:d2}) reduces to uniform distribution. From Figure 2, it can be seen that the distribution is symmetric about $0.5$ and it possesses both bath-tub shaped and bell-shaped curves.\\ \begin{figure}[H] \begin{center} \includegraphics[height=3in,width=6in,angle=0]{figure2.jpg} \caption{Plot of the density function of Distribution 2.} \end{center} \end{figure} \noindent\textbf{Distribution 3:} Let $X$ and $Y$ follow Lindley distribution independently and identically with parameter $\theta>0$. Putting $f_X(x|\theta)=\theta^2(1+x)\exp(-\theta x)/(1+\theta)$ and $f_Y(y|\theta)=\theta^2(1+y)\exp(-\theta y)/(1+\theta)$ in (\ref{eq:fz}) we get \begin{equation}\label{eq:LLZ} f_Z(1)=\frac{13}{6}\frac{e^{-\theta}\theta^4}{(1+\theta)^2}. \end{equation} As in previous cases, using the density functions of $X$ and $Y$ along with (\ref{eq:LLZ}) in (\ref{eq:fu}) we obtain \begin{equation}\label{eq:LLU} f_U(u)=\frac{6}{13}(2-u)(1+u). \end{equation} The resulting distribution is free from any parameter and thus not flexible as clear from Figure 3. Clearly (\ref{eq:LLU}) is symmetric about $0.5$.\\ \begin{figure}[H] \begin{center} \includegraphics[height=3in,width=4in,angle=0]{figure3.pdf} \caption{Plot of the density function of Distribution 3.} \end{center} \end{figure} \noindent\textbf{Distribution 4:} Let $X$ and $Y$ follow Lindley distribution independently with parameters $\theta_1$ and $\theta_2$, respectively. Here $f_X(x|\theta_1)=\theta_1^2(1+x)\exp(-\theta_1 x)/(1+\theta_1)$ and $f_Y(y|\theta_2)=\theta_2^2(1+y)\exp(-\theta_2 y)/(1+\theta_2)$. The density function of $Z=X+Y$ is evaluated using (\ref{eq:fz}) but we do not report it here due to its messy structure. However, the density function of $U$ obtained using $f_X(x|\theta_1)$, $f_Y(y|\theta_2)$ and $f_Z(1)$ in (\ref{eq:fu}) is \begin{equation}\label{eq:LLU2} f_U(u)=\begin{cases} \frac{\delta^3 e^{-\delta u} (u-2)(1+u)}{(2-\delta-2\delta^2)+e^{-\delta}(2\delta^2-2-\delta)}\quad \textrm{for} \quad \delta\neq0\\ \frac{6}{13}(2-u)(1+u)\quad \textrm{for} \quad \delta=0 \end{cases} \end{equation} for $\delta=\theta_1-\theta_2\in \mathcal{R}$. Obviously the density in (\ref{eq:LLU2}) having one parameter is an extension of (\ref{eq:LLU}). From Figure 4 and Figure 1, it can be seen that the Distribution 4 and Distribution 1 behave quite similarly.\\ \begin{figure}[H] \begin{center} \includegraphics[height=3in,width=4in,angle=0]{figure4.pdf} \caption{Plot of the density function of Distribution 4.} \end{center} \end{figure} \noindent\textbf{Distribution 5:} Let $X$ follow exponential distribution with parameter $\theta$ and $Y$ follow Lindley distribution with parameter $\theta$ independently. Here $f_X(x|\theta)=\theta\exp(-\theta x)$ and $f_Y(y|\theta)=\theta^2(1+y)\exp(-\theta y)/(1+\theta)$. From (\ref{eq:fu}) we get \begin{equation}\label{eq:EL1} f_U(u)=\frac{2}{3}(2-u). \end{equation} This distribution has no parameter and thus not flexible for modelling purposes . The density in (\ref{eq:EL1}) is decreasing and it decreases from $4/3$ at $u=0$ to $2/3$ at $u=1$ linearly as given in Figure 5.\\ \begin{figure}[H] \begin{center} \includegraphics[height=3in,width=4in,angle=0]{figure5.pdf} \caption{Plot of the density function of Distribution 5.} \end{center} \end{figure} \noindent \textbf{Distribution 6:} Let $X$ follow exponential distribution with parameter $\theta_1$ and $Y$ follow Lindley distribution with parameter $\theta_2$ independently. Here $f_X(x|\theta_1)=\theta_1\exp(-\theta_1 x)$ and $f_Y(y|\theta_2)=\theta_2^2(1+y)\exp(-\theta_2 y)/(1+\theta_2)$. Using the density functions first in (\ref{eq:fz}) and then in (\ref{eq:fu}) we get \begin{equation}\label{EL2} f_U(u)=\begin{cases} \frac{\delta^2 e^{\delta(1-u)}(2-u)}{1-\delta+(2\delta-1)e^\delta}\quad \textrm{for}\quad \delta\neq 0\\ \frac{2}{3}(2-u)\quad \textrm{for}\quad \delta= 0. \end{cases} \end{equation} Here $\delta=\theta_1-\theta_2\in \mathcal{R}$. A few representative plots of the density function are provided in Figure 6.\\ \begin{figure}[h] \begin{center} \includegraphics[height=3in,width=4in,angle=0]{figure6.pdf} \caption{Plot of the density function of Distribution 6.} \end{center} \end{figure} \noindent \textbf{Distribution 7:} Consider $X$ following exponential distribution with parameter $\theta$ and $Y$ following gamma distribution with parameters $\alpha$ and $\beta$. Putting $f_X(x|\theta)=\theta\exp(-\theta x)$ and $f_Y(y|\alpha,\beta)=\alpha^\beta y^{\beta-1}\exp(-\alpha x)/\Gamma(\beta)$ in (\ref{eq:fz}) we get \begin{equation}\label{eq:egz} f_Z(1)=\begin{cases} \frac{\theta \alpha^\beta e^{-\theta}\{\Gamma(\beta)-\Gamma(\alpha-\theta)\}}{\Gamma(\beta) (\alpha-\theta)^\beta}\quad \textrm{for} \quad \alpha\neq \theta\\ \frac{\alpha^{\beta+1}\exp(-\alpha)}{\Gamma(\beta+1)} \quad \textrm{for}\quad \alpha=\theta. \end{cases} \end{equation} Here $\Gamma(s,t)$ denotes the incomplete gamma function $\int_t^\infty v^{s-1} \exp(-v)\, dv$. Now using the density functions of $X$ and $Y$ along with (\ref{eq:egz}) in (\ref{eq:fu}) we obtain \begin{equation}\label{eq:egu} f_U(u)=\begin{cases} \frac{\delta^\beta}{\Gamma(\beta)-\Gamma(\beta,\delta)}e^{\delta(1-u)}(1-u)^{\beta-1}\quad \textrm{for}\quad \beta>0,\delta\neq 0\\ \beta (1-u)^{\beta-1}\quad \textrm{for} \quad \alpha>0,\delta=0 \end{cases} \end{equation} where $\delta=\alpha-\theta\in \mathcal{R}$. The density in (\ref{eq:egu}) has two parameters and may prove to be a competitor of the popular beta distribution as evident from Figure 7.\\ \begin{figure}[H] \begin{center} \includegraphics[height=2in,width=6in,angle=0]{figure7.jpg} \caption{Plot of the density function of Distribution 7.} \end{center} \end{figure} \noindent \textbf{Distribution 8:} Let $X$ be a Lindley random variable with parameter $\theta$ and $Y$ be a gamma random variable with parameters $\theta$ and $\beta$. Here $f_X(x|\theta)=\theta^2(1+x)\exp(-\theta x)/(1+\theta)$ and $f_Y(y|\theta,\beta)=\theta^\beta y^{\beta-1}\exp(-\theta x)/\Gamma(\beta)$. Putting the densities of $x$ and $Y$ first in (\ref{eq:fz}) and then using $f_Z(1)$ along with the density functions in (\ref{eq:fu}) we obtain \begin{equation}\label{eq:flg} f_U(u)=\frac{\beta(1+\beta)}{2+\beta} (1+u) (1-u)^{\beta-1}\quad \textrm{for} \quad \beta>0. \end{equation} The parameter $\theta$ labelling the distributions of both $X$ and $Y$ surprisingly plays no role in (\ref{eq:flg}). Despite being a one-parameter distribution, it is quite flexible for modelling purposes since the corresponding density function has a wide range of shapes as can be seen from Figure 8. The derived distribution can also be seen as a mixture of two beta distributions where the mixing proportions are also functions of the parameter $\beta$ . \begin{figure}[H] \begin{center} \includegraphics[height=3in,width=4in,angle=0]{figure8.pdf} \caption{Plot of the density function of Distribution 8.} \end{center} \end{figure} \section{LCG: A new one parameter distribution} Distribution 8 is derived from the distribution of Lindley random variable conditioned on the convolution of the same with gamma random variable. Thus a working abbreviation for the distribution with pdf in (\ref{eq:flg}) is taken as $LCG(\beta)$ and we write $U\sim LCG(\beta)$. The cumulative distribution function (cdf) of $LCG(\beta)$ is \begin{equation}\label{eq:Flg} F_U(u)=1-\frac{(1-u)^\beta(2+\beta+u\beta)}{2+\beta},\quad 0<u<1. \end{equation} Figure 9 exhibits the functional form of $F_U$ for different choices of $\beta$. With increasing $\beta$, the cdf becomes more and more convex in shape. \begin{figure}[H] \begin{center} \includegraphics[height=3in,width=4in,angle=0]{figure10.pdf} \caption{Plot of the cumulative distribution function of LCG distribution.} \end{center} \end{figure} The corresponding hazard rate is \begin{equation}\label{eq:hlg} h(u)=\frac{\beta(1+\beta)}{2+\beta+u\beta}\frac{1+u}{1-u},\quad 0<u<1. \end{equation} The LCG family has increasing failure rate as shown in Figure 10. \begin{figure}[H] \begin{center} \includegraphics[height=3in,width=4in,angle=0]{figure9.pdf} \caption{Plot of the hazard rate of LCG distribution.} \end{center} \end{figure} \noindent The lower order moments are very simple, the mean and the variance of $LCG(\beta)$ is given below. \begin{equation} E(U)=\frac{4+\beta}{(2+\beta)^2}\quad \textrm{and} \quad V(U)=\frac{\beta(16+9\beta+\beta^2)}{(2+\beta)^4(3+\beta)} \end{equation} \subsection{Generating random observations} To generate random observations from $LCG(\beta)$ it is convenient to use the cdf in (\ref{eq:Flg}). We employ cdf inversion technique as the structure is not too complex. For a random observation $v$ from uniform distribution over $(0,1)$ we equate $F_U(u)=v$ and find solution of the equation in $u$. This $u$ is a random observation from $LCG(\beta)$. This technique produces the following nonlinear equation in $u$ \begin{equation}\label{eq:Flgv} (1-u)^\beta(2+\beta+u\beta)-(1-v)(2+\beta)=0. \end{equation} We solve (\ref{eq:Flgv}) by \textit{uniroot} function available on basic \textbf{R}. \subsection{Estimation} Since $E(U)$ is structurally simple, a method of moment estimator can easily be implemented. For a given dataset $\bm{u}=(u_1, u_2, ..., u_n)$, we calculate the sample mean $\Bar{u}=(1/n)\sum_{i=1}^n u_i$ and form the following equation. \begin{equation}\label{eq:mme1} E(U)=\frac{4+\beta}{(2+\beta)^2}=\Bar{u} \end{equation} The equation in (\ref{eq:mme1}) can be rewritten as \begin{equation}\label{eq:mme2} \Bar{u}\beta^2+(4\Bar{u}-1)\beta+4(\Bar{u}-1)=0. \end{equation} The method of moment estimator $\hat{\beta}_{MM}$ is the solution of (\ref{eq:mme2}) in $\beta$. \\ The log-likelihood function of $\beta$ given the dataset $\bm{u}$ is \begin{equation}\label{mle1} l(\beta|\bm{u})=n\log\left[\frac{\beta(1+\beta)}{2+\beta}\right]+\sum_{i=1}^n \log(1+u_i)+(\beta-1)\sum_{i=1}^n \log(1-u_i). \end{equation} Differentiating $l(\beta|\bm{u})$ with respect to $\beta$ and equating it with $0$ yields the following. \begin{equation}\label{eq:mle2} T(\bm{u})\beta^2+(3T(\bm{u})-1)\beta+(2T(\bm{u})-4)=0 \end{equation} Here $T(\bm{u})=-(1/n)\sum_{i=1}^n \log (1-u_i)$. To solve both (\ref{eq:mme2}) and (\ref{eq:mle2}) in $\beta$, we use \textit{polyroot} function available in basic \textbf{R}. The solution of (\ref{eq:mle2}) is the maximum likelihood estimate namely $\hat{\beta}_{ML}$. \begin{center} \begin{table}[h!] \centering \vspace{1cm} \caption{Bias and mean-squared error (MSE) of $\hat{\beta}_{MM}$ and $\hat{\beta}_{ML}$.} \label{tab:simul} \begin{tabular}{cccccc} \hline\\ $n$ & $\beta$ & Bias($\hat{\beta}_{MM}$) & MSE($\hat{\beta}_{MM}$) & Bias($\hat{\beta}_{ML}$) & MSE($\hat{\beta}_{ML}$) \\ \\\hline \multirow{3}{*}{20} & 2.30 & 0.07792 &0.27779 & -0.21959 &0.33440 \\ & 7.80 &0.34196 &3.74806 &0.21788 &3.72484\\ & 15.00&0.52377 &12.36922 &0.46433 &12.36009 \\ \hline \multirow{3}{*}{40} & 2.30 &0.01869 &0.12236 &-0.29453 &0.21342 \\ & 7.80 &0.13403 &1.48331 &-0.00307 &1.48377\\ &15.00 &0.38477 &5.71176 &0.30913 &5.72911 \\ \hline \multirow{3}{*}{60} &2.30 &0.01719 &0.08165 &-0.29909 &0.17421 \\ & 7.80 &0.12145 &0.96437 &-0.02729 &0.96883 \\ &15.00 & 0.16190 &3.51346 &0.08157&3.51912 \\ \hline \multirow{3}{*}{80} & 2.30 &0.00449 &0.06157 &-0.31263 &0.16230 \\ & 7.80 &0.12302 &0.70574 &-0.03383 &0.70355 \\ & 15.00 & 0.14265 & 2.69120 &0.05492 &2.69554 \\ \hline \multirow{3}{*}{100} & 2.30 & 0.01120 &0.04923 &-0.30954 &0.14639 \\ & 7.80 &0.06890 &0.55969 &-0.08804 &0.57761\\ & 15.00 & 0.17952 &2.35752 &0.08494 &2.35630 \\ \hline \end{tabular}% \end{table} \end{center} A simulation experiment is performed to study the relative performance of the estimators. We generate 1000 samples of different sizes ($n$) using the method in Section 4.1 and compute the average bias and mean squared error of the estimators. From Table 1, it is seen that the performance of both the estimators are quite similar. With increasing $\beta$, the mean squared error of both the estimators increase. As desired the mean squared error and absolute bias of both the estimators decrease with increase in sample size. \subsection{Application} Consider the following datasets from Caramanis et al. (1983) providing computation time of two different algorithms namely SC16 and P3. \\ \noindent SC16:= (0.853, 0.759, 0.866, 0.809, 0.717, 0.544, 0.492, 0.403, 0.344, 0.213, 0.116, 0.116, 0.092, 0.070, 0.059, 0.048, 0.036, 0.029, 0.021, 0.014, 0.011, 0.008, 0.006)\\ \noindent P3:= (0.853, 0.759, 0.874, 0.800, 0.716, 0.557, 0.503, 0.399, 0.334, 0.207, 0.118, 0.118, 0.097, 0.078, 0.067, 0.056, 0.044, 0.036, 0.026, .019, 0.014, 0.010)\\ \noindent Mazumdar and Gaver (1984) comparison of the mentioned algorithms for estimating the unit capacity factor. For a population level comparison one may refer to Genc (2013) where the authors fitted Topp-Leone model to both SC16 and P3 datasets for further analysis. It is to be noted that to improve the population level comparison, one need to select a better suited model. One parameter distributions on the unit interval is rare and the Topp-Leone distribution is a benchmark in this category. The introduced LCG distribution is a new addition to this category and hence a real life data driven comparison with Topp-Leone is sufficient to justify its utility. Topp-Leone model fits the datasets well as can be seen in Genc (2013). However, we compare fitting of the Topp-Leone model with that of the LCG in Table 2 and find that the proposed LCG model is far better as indicated by the corresponding AIC values. \begin{center} \begin{table}[h!] \centering \vspace{1cm} \caption{Goodness of fit.} \label{tab:simul} \begin{tabular}{ccccc} \hline\\ Dataset & Distribution & MLE & Log-likelihood & AIC \\ \\\hline \multirow{2}{*}{SC16} & Topp-Leone & 0.5943 & -11.3660 & 25.7837 \\ & LCG & 1.9876 & 2.9459 & -3.8981 \\ \hline \multirow{2}{*}{P3} & Topp-Leone & 0.6778 & -10.9016 & 23.8032 \\ & LCG & 1.8646 &2.3009 &-2.6098\\ \hline \end{tabular}% \end{table} \end{center} \section{Discussion} A number of new distributions with simple yet flexible structures are derived in the current work. Throughout the article we discussed about the distribution of $U=X|X+Y=1$. It is obvious that in many situations the distribution of $V=Y|X+Y=1$ is different from $U$ and hence may be of interest fom new distribution perspective. However, we refrain from detailing such density function since the same can be done by simply finding density function of $V=1-U$. We envisage that the proposed method and the derived distributions will be a useful addition in the existing literature. In fact the LCG is shown to be a better one parameter model than the benchmark Topp-Leone distribution. Since the LCG model possesses simple structure of the mean, modelling unit responses with covariates using LCG is of interest. Moreover Section 4.2 hints a productive study on the stress-strength reliability of the LCG distribution. These problems are under consideration and will be reported as independent works. Detailed investigation on the other derived distributions are required and further research on this is warranted. This article is intended to motivate researchers to delve into the possibilities of exploring new distributions with different choices of the joint distributions of $(X,Y)$. The proposed method can naturally be extended. One may consider the random vector $(X_1, X_2, ..., X_n)$ with $P(X_i>0)=$ for $i=1, 2, ..., n$. For $k<n$, $U=X_1+X_2+...+X_k|X_1+X_2+...+X_n=1$ is a random variable with support $(0,1)$. In our case $n=2$ and $k=1$. \section*{References} Andreopoulos, P., Bersimis, G. F., Tragaki, A., \& Rovolis, A. (2019). Mortality modeling using probability distributions. APPLICATION in greek mortality data. \textit{Communications in Statistics-Theory and Methods}, 48(1), 127-140.\\ \\ Balakrishnan, N., \& Lai, C. D. (2009). \textit{Continuous bivariate distributions}. Springer Science \& Business Media.\\ \\ Barndorff-Nielsen, O. E., \& Jørgensen, B. (1991). Some parametric models on the simplex. \textit{Journal of Multivariate Analysis}, 39(1), 106-116.\\ \\ Biswas, A., \& Chakraborty, S. (2019). $R= P (Y< X)$ for unit-Lindley distribution: inference with an application in public health. \textit{arXiv preprint arXiv:1904.06181}.\\ \\ Biswas, A., Chakraborty, S., \& Mukherjee, M. (2020). On estimation of stress–strength reliability with log-Lindley distribution. \textit{Journal of Statistical Computation and Simulation}, 1-23.\\ \\ Cancho, V. G., Bazán, J. L., \& Dey, D. K. (2020). A new class of regression model for a bounded response with application in the study of the incidence rate of colorectal cancer. \textit{Statistical Methods in Medical Research}, 29(7), 2015-2033.\\ \\ Caramanis, M., Stremel, J., Fleck, W., \& Daniel, S. (1983). Probabilistic production costing: an investigation of alternative algorithms. \textit{International Journal of Electrical Power \& Energy Systems}, 5(2), 75-86.\\ \\ Genc, A. I. (2013). Estimation of $P (X> Y)$ with Topp–Leone distribution. \textit{Journal of Statistical Computation and Simulation}, 83(2), 326-339.\\ \\ Gómez-Déniz, E., Sordo, M. A., \& Calderín-Ojeda, E. (2014). The Log–Lindley distribution as an alternative to the beta regression model with applications in insurance. \textit{Insurance: Mathematics and Economics}, 54, 49-57.\\ \\ Grassia, A. (1977). On a family of distributions with argument between 0 and 1 obtained by transformation of the gamma and derived compound distributions. \textit{Australian Journal of Statistics}, 19(2), 108-114.\\ \\ Gumbel, E. J. (1960). Multivariate distributions with given margins and analytical examples.\textit{ Bulletin de l’Institut International de Statistique}, 37(3), 363-373.\\ \\ Johnson, N. L., Kotz, S., \& Balakrishnan, N. (1995). \textit{Continuous Univariate Distributions}, volume 2. John Wiley\&Sons. Inc.,, 75.\\ \\ Jones, M. C. (2009). Kumaraswamy’s distribution: A beta-type distribution with some tractability advantages. \textit{Statistical Methodology}, 6(1), 70-81.\\ \\ Kumaraswamy, P. (1980). A generalized probability density function for double-bounded random processes. \textit{Journal of Hydrology}, 46(1-2), 79-88.\\ \\ Lemonte, A. J., Barreto-Souza, W., \& Cordeiro, G. M. (2013). The exponentiated Kumaraswamy distribution and its log-transform.\textit{ Brazilian Journal of Probability and Statistics}, 27(1), 31-53.\\ \\ Mazucheli, J., Menezes, A. F. B., \& Ghitany, M. E. (2018). The unit-Weibull distribution and associated inference. \textit{Journal of Applied Probability and Statistics}, 13, 1-22.\\ \\ Mazucheli, J., Menezes, A. F. B., Fernandes, L. B., de Oliveira, R. P., \& Ghitany, M. E. (2020). The unit-Weibull distribution as an alternative to the Kumaraswamy distribution for the modeling of quantiles conditional on covariates. \textit{Journal of Applied Statistics}, 47(6), 954-974.\\ \\ Mazumdar, M., \& D. P. Gaver. (1984). On the computation of power-generating system reliability indexes.\textit{ Technometrics} 26, no. 2 (1984): 173-185.\\ \\ Mazucheli, J., Menezes, A. F. B., \& Chakraborty, S. (2019). On the one parameter unit-Lindley distribution and its associated regression model for proportion data. \textit{Journal of Applied Statistics}, 46(4), 700-714.\\ \\ Pourdarvish, A., Mirmostafaee, S. M. T. K., \& Naderi, K. (2015). The exponentiated Topp-Leone distribution: Properties and application. \textit{Journal of Applied Environmental and Biological Sciences}, 5(7), 251-6.\\ \\ Rodrigues, J., Bazán, J. L., \& Suzuki, A. K. (2020). A flexible procedure for formulating probability distributions on the unit interval with applications. \textit{Communications in Statistics-Theory and Methods}, 49(3), 738-754.\\ \\ Smithson, M., \& Shou, Y. (2019). cdfquantreg: An R package for CDF-Quantile Regression.\\ \\ Tadikamalla, P. R., \& Johnson, N. L. (1982). Systems of frequency curves generated by transformations of logistic variables.\textit{ Biometrika}, 69(2), 461-465.\\ \\ Topp, C. W., \& Leone, F. C. (1955). A family of J-shaped frequency functions. \textit{Journal of the American Statistical Association}, 50(269), 209-219. \section*{Appendix: R-codes} \subsubsection*{C1: Random sample generation from LCG distribution.} \begin{lstlisting}[language=R] rGL=function(n,beta) { sample=0 for(i in 1:n) { v=runif(1) f=function(u) { (1-u)^beta*(2+beta+u*beta)-(1-v)*(2+beta) } proc=uniroot(f,c(0,1)) sample[i]=proc$root } return(sample) } \end{lstlisting} \subsubsection*{C2: Method of moment estimation for LCG distribution.} \begin{lstlisting}[language=R] MME=function(data) { ubar=mean(data) z=c(4*(ubar-1),4*ubar-1,ubar) return(max(Re(polyroot(z)))) } \end{lstlisting} \subsubsection*{C2: Maximum likelihood estimation for LCG distribution.} \begin{lstlisting}[language=R] MLE=function(data) { Tu=-mean(log(1-data)) z=c(2*Tu-4,3*Tu-1,Tu) return(max(Re(polyroot(z)))) } \end{lstlisting} \end{document}
\section{Introduction} Thanks to the advancement of deep learning, face recognition has been remarkably incorporated in most biometric systems. Thus facial biometric systems are widely used in various applications, including mobile phone authentication, access control and face payment~\cite{kunda2018survey,galterio2018review}. Face-spoofing attacks,in which a spoofed face is presented to the biometric system in an attempt to be authenticated, are becoming a inevitable threat~\cite{el2020deep,rattani2018survey}. Therefore, face-spoofing detection has become a critical requirements for any face recognition system to filter out fake faces~\cite{ramachandra2017presentation}. While face anti-spoofing techniques have received much attention to aim at identifying whether the captured face is genuine or fake, most face-spoofing detection techniques are biased towards a specific presentation attack type or presentation device; failing to robustly detects various spoofing scenarios. To mitigate this problem, we aim at developing a generalizable face-spoofing framework which able to accurately identify various spoofing attacks and devices. Face anti-spoofing techniques have received much attention and several anti-spoofing approaches have been introduced in retrospective studies~\cite{ramachandra2017presentation,galbally2014biometric}. Traditional image-based approaches focus on image quality and characteristics and thus employ hand-craft features, such as LBP, SIFT, HOG, and SURF, with shallow classifiers to discriminate the live and fake faces~\cite{boulkenafet2016face,de2012lbp,maatta2011face}. These hand-crafted features are limited to specific spoofing patterns, scene conditions and spoofing devices, which limits their generalization~\cite{li2016generalized}. Lately, deep methods based on Convolutional Neural Networks (CNNs) provide an alternative way to further push the effectiveness of anti-spoofing techniques via learning a discriminate representation in an end-to-end manner~\cite{li2016original,yang2014learn}. While data-driven feature learning boost the performance of spoofing detection, these methods fail to exploit the nature of spoofing patterns, which consist of skin details, color distortion, moire patterns, glass reflection, shape deformation, etc. as they mostly build models for the current dataset and fail to generalize in cross-dataset settings. Further, they also suffer from sensitivity to lighting and illumination distortion~\cite{boulkenafet2016face} as they are built upon controlled and biased datasets. As a result, these models suffer from overfitting and poor generalizability to new patterns and environments. While numerous machine learning models have been developed to discover artifacts in spoof images, the performance of spoofing models in practical settings is still far from perfect due to the following challenges. First, the available spoofing attack datasets are limited and bias to several environmental and capture settings as compared to other computer vision tasks such as image classification for which there exist large-scale labelled datasets, like ImageNet~\cite{deng2009imagenet}. More specifically, they collected for a specific attack scenario, e.g. reply-attack, or they collected with controlled lighting and illuminance settings with limited number of subjects, i.e., faces. Second, there exist various attack types and new attack scenarios are detected once a while, such as adversarial examples~\cite{guera2018deepfake}. Most proposed models work optimal for a specific scenario or dataset and their performance on unseen attack types (data) are unreliable. Third, current deep models are developed for semantic-rich computer vision task, e.g., object detection and image captioning, as opposed to anti-spoofing which relies on low-level features. Thus, these models fail to capture good spoofing patterns as they attempt to learn high-level semantic features. Thus, developing a task-specific model equipped with low-level discriminator is highly desired. To tackle these challenges, we propose a dual channel neural model that directly learns optimal features to discriminate fake and genuine faces. To do so, the proposed model learns a low-dimensional latent space for face spoofing task using deep and wide channels. The former, i.e, the deep channel, learns data-driven features discriminating genuine and spoofed faces by leveraging a CNN architecture specifically designed for spoofing detection task. The later, i.e., wide channel, leverages hand-crafted feature, already popular for spoofing detection task ( in frequency, texture, and temporal dimensions) and seamlessly integrated them into the low-dimensional latent space learnt by the deep channel. The proposed framework has been extensively examined on several spoofing detection datasets to evaluate its effectiveness. The main contributions of this paper is as follows: \begin{itemize} \item Develop a well-generalized model robust to environmental changes and datasets. \item Take advantage of both CNN and hand-crafted features strengths to confront with newly generated or unseen attacks. \item Compare the efficiency of each methods on some of the available dataset. \item Propose a deep architecture fitting on low-level characteristic patterns in spoofing domain. \end{itemize} \section{Related Works} The main approaches in face anti-spoofing can be broadly categorized into three groups: traditional texture discriminators, Deep Learning feature learning and motion based methods. Texture analysis approaches are mostly effective against photo and print attacks. For instance, in~\cite{li2004live}, Li et al. employed Fourier spectra analysis and assumed fake faces are usually smaller or have fewer high frequency components in photographs compared to real faces. However, the author ignored the illumination variations. Peixoto et al.~\cite{peixoto2011face} used difference-of-Gaussian (DoG) which previously was proposed by Tan et al. in~\cite{tan2010face}, and combined it with sparse logistic regression to encounter with print attacks. Using LBP features for spoofing detection proposed by Määttä et al. in~\cite{maatta2011face} which achieved outperforming results on NUAA Imposter dataset. Razvan D. A~\cite{albu2015face}, also experiment on NUAA with random transform method. Boulkenafet et al.~\cite{boulkenafet2016face} investigated the effect of various color spaces and combination of different color-texture features such as LBP, BSIF, LBQ, SID and CoALBP. Pereira et al in~\cite{de2012lbp}, proposed a spatio-temporal texture feaure called Local Binary Patterns from Three Orthogonal Planes (LBP-TOP) which outperformed LBP based methods on Replay-Attack dataset. However, the method performance falls drastically in other datasets or more realistic cases. Thanks to gathering of large datasets in recent years, CNN based network are able to extract discriminative features to detect spoofing attacks. For example, Yang et al.~\cite{yang2014learn} leveraged CNN to extract features from detected face in image. To consider information in other parts of image, they further feed different scales of input image to the network ($5$ different scales), from closely cropped face to further distance. Atoum et al.~\cite{atoum2017face} extracts local texture features in small patches from the faces along with estimated depth feature map for detection of the spoofing attack. LSTM-CNN architecture was leveraged to take advantage of consecutive frames in a video which was proved to be effective in the case of video replay attacks~\cite{xu2015learning}. Chen et al.~\cite{chen2019attention}, proposed a two stream convolutional neural network (TSCNN) which works on two complementary space: RGB and multi-scale retinex (MSR). space to take advantage of both texture details in RGB space and illumination invariance of MSR. Gan et al.~\cite{gan20173d}, experimented 3D CNN on public video attack datasets such as CASIA~\cite{zhang2012face} and Replay-Attack~\cite{chingovska2012effectiveness}. Motion based methods aim to use the face dynamics, reactions and activities such as head shaking, lip movement, blinking to distinguish genuine face from fake one. Kollreider et al.~\cite{kollreider2007real} used facial parts movement as liveness features. Pan et al.~\cite{pan2007eyeblink} used eye blink to detect spoofing attacks. In~\cite{bao2009liveness}, optical flow vectors of the face region are extracted from the video and compared between different regions. Most of the methods are designed to detect printed photo attacks and not much effective to counter video attacks. However, Tirunagari et al.~\cite{tirunagari2015detection}, applied dynamic mode decomposition (DMD) which is able to represent temporal information of spoof video in a single image. \section{Proposed Framework} \label{sec::framework} \begin{figure*} \includegraphics[width=\linewidth]{figures/1.pdf} \caption{The schematic view of Face-Spoofing Detection Framework} \label{fig::framework} \end{figure*} We proposed a dual channel neural architecture to exploit both deep and wide features for face spoofing detection, as shown in Fig.~\ref{fig::framework}. The deep channel leverages a CNN architecture to extract discriminative patterns of spoofing from data. The designed architecture focuses to extract subtle distortions of images that represent a presentation attack. The wide channel, however, employs hand-crafted features with a shallow network to empower the model with domain-specific features known by experts. We next aggregate the extracted features of each channel into a low-dimensional latent space for final classification. \subsection{Deep feature Learning Channel} In our experiments, we discovered that very deep neural models are ineffective in learning discriminative features for face spoofing detection task while employing shallower and simpler architectures can lead to better results and higher generalization. This can be justified by considering the nature of the problem. Face spoofing and presentation attacks usually causes illuminance distortions, reflection and soft artifacts in the image. These artifact can be considered as low level features. Thus using very deep neural model can distract the model from paying attention on these subtle alterations to some higher level semantic in images, such as face characteristics of the subjects, which explained in detail in~\cite{zeiler2014visualizing}. This suggests that neural architectures for face spoofing needs shallower CNN architectures as compared of other computer vision tasks. This Channel contains multiple layers of convolutional and pooling followed by fully connected layer. Batch normalization and dropout are also added for regularization in order to avoid overfitting. The input consists of face image frames which are detected and cropped with margin from the dataset videos, already aligned and resized to $160 \times 160 \times 3$ in the preprocessing step. The output of the channels gives the $512$ embedding vector derived from the input face image. The deep channel network architecture is shown in Table~\ref{tbl::deep-channel-architecture}. The embedding vector from output of the CNN channel will be passed into feature interaction learning block. \begin{table*} \centering \caption{Deep channel network structure. The input and output sizes are described in rows x cols x \#filters. The layer details are specified as kernel size, stride, padding} \label{tbl::deep-channel-architecture} \begin{tabular}{|c|c|c|c|c|} \hline \hline Layer & Size-in & Size-out & Layer Details & Parameters \\ \hline Conv1 & 160×160×3 & 158×158×32 & (3,3), S=1, P=valid & 896 \\ \hline Conv2 & 158×158×32 & 156×156×32 & (3,3), S=1, P=valid & 9248 \\ \hline Batch norm1 & 156×156×32 & 156×156×32 & & 128 \\ \hline Dropout1 & 156×156×32 & 156×156×32 & Rate=0.1 & 0 \\ \hline Max pool1 & 156×156×32 & 78×78×32 & (2,2), S=2, P=valid & 0 \\ \hline Conv3 & 78×78×32 & 76×76×64 & (3,3), S=1, P=valid & 18,496 \\ \hline Conv4 & 76×76×64 & 74×74×64 & (3,3), S=1, P=valid & 36,928 \\ \hline Batch norm2 & 74×74×64 & 74×74×64 & & 256 \\ \hline Dropout2 & 74×74×64 & 74×74×64 & Rate=0.1 & 0 \\ \hline Max pool2 & 74×74×64 & 37×37×64 & (2,2), S=2, P=valid & 0 \\ \hline Conv5 & 37×37×64 & 33×33×128 & (5,5), S=1, P=valid & 204,928 \\ \hline Conv6 & 33×33×128 & 29×29×128 & (5,5), S=1, P=valid & 409,728 \\ \hline Batch norm3 & 29×29×128 & 29×29×128 & & 512 \\ \hline Dropout3 & 29×29×128 & 29×29×128 & Rate=0.1 & 0 \\ \hline Max pool3 & 29×29×128 & 14×14×128 & (2,2), S=2, P=valid & 0 \\ \hline Dense1 & 25088×1 & 512×1 & 512 neurons (relu) & 12,845,568 \\ \hline Batch norm4 & 512×1 & 512×1 & & 2048 \\ \hline Embedding & 512×1 & 512×1 & 512 neurons (relu) & 262,656 \\ \hline CNN Total & \multicolumn{3}{c|}{} & 13,791,392 \\ \hline \end{tabular} \end{table*} \subsection{Shallow Feature Exploitation} Retrospective studies showed color and texture features can effectively extract face spoofing patterns in videos~\cite{chingovska2012effectiveness, de2012lbp, maatta2011face}. Thus, in the wide channel, first the aligned face image is passed to a descriptor computing unit. This unit extracts color texture features, such as LBP, CoALBP and LBQ, from gray-scale, HSV and YCbCr color spaces, as showin in Table~\ref{tbl::shallow-features}. The resulting feature vectors of each descriptor shows various aspect of distortions in videos. These features are then concatenated with each other to form the total feature vector. The vector will be passed to the shallow channel to learn the embedding of the videos. The wide channel includes two fully connected layers, each contains $512$ hidden units. The last layer is then used as the embedding vector of the descriptors and will be fed to the feature interaction block to learn a low-dimensional latent space from both channels. \begin{table*} \centering \caption{The parameters of the descriptors and dimensions of the concatenated RGB and YCbCr feature vectors used in our experiments} \label{tbl::shallow-features} \begin{tabular}{|c|c|c|} \hline \textcolor[rgb]{0.133,0.133,0.133}{Descriptor} & \textcolor[rgb]{0.133,0.133,0.133}{Parameters} & \textcolor[rgb]{0.133,0.133,0.133}{Dimensions} \\ \hline \hline \textcolor[rgb]{0.133,0.133,0.133}{LBP} & Radius R=1, Neighbors P=8 & \textcolor[rgb]{0.133,0.133,0.133}{354} \\ \hline \textcolor[rgb]{0.133,0.133,0.133}{CoALBP} & R=1, LBP descriptor= LBP+, B=2 & \textcolor[rgb]{0.133,0.133,0.133}{6144} \\ \hline \textcolor[rgb]{0.133,0.133,0.133}{LPQ} & Widows size M=3, $\alpha$=1/7 & \textcolor[rgb]{0.133,0.133,0.133}{255} \\ \hline \end{tabular} \end{table*} \subsection{Feature Interaction Learning} Here, we integrate both embeddings learnt from deep and wide channels into a unified latent space and leverage it to classify the input image into genuine and spoofed face. In total, our model includes two fully-connected layers right before the output layer (described next) to allow for modelling interactions between the components of the intermediate representation, i.e., embeddings from two channels. In particular, we concatenate the outputs of the both components to form a dense vector and feed it to fully-connected layers to get more high-level and abstract features. Let $e_d$ and $e_w$ denotes the embedding learnt by deep and wide channels, respectively, the fully-connected layer computes, \begin{align} \mathbf{z} = \Phi \left( \mathbf{W} \begin{bmatrix} \mathbf{e}_d \\ \mathbf{e}_w \end{bmatrix} + \mathbf{b} \right), \end{align} where $\mathbf{W}$ and $\mathbf{b}$ are the weight vectors and bias term and $\Phi$ is the activation function for the fully connected layers. Activation function here is the ReLU non-linearity function. Here, we used two consecutive block of dense layer with $512$ hidden units for the feature interaction layer. The hypothesis behind these blocks is to learn non-linear interaction of the parameters according to the input constructed from both deep and wide embeddings, where impacts of each feature is learnt in training process. The problem is dealt with as a binary classification task so that the network would be either spoof or bona fide label. Therefore binary cross-entropy is utilized as the loss function of the network output layer. Table~\ref{tbl::finalblock-parameters} illustrates the final block network architecture and total parameters number. \begin{table*} \centering \caption{Final block structure and total parameters of the proposed network} \label{tbl::finalblock-parameters} \begin{tabular}{|c|c|c|c|c|} \hline Layer & Size-in & Size-out & Layer details & Parameters \\ \hline Concat & 2×512 & 1024×1 & & 0 \\ \hline Dense3 & 1024×1 & 512×1 & 512 neurons (relu) & 524800 \\ \hline Batch norm4 & 512×1 & 512×1 & & 2048 \\ \hline Dense4 & 512×1 & 256×1 & 256 neurons (relu) & 131,328 \\ \hline Classification & 256×1 & 1 & Sigmoid & 513 \\ \hline Total & & & & 18,172,577 \\ \hline \end{tabular} \end{table*} \section{Experiments} In this section, we conduct extensive experiments to evaluate the effectiveness of the proposed framework for representation learning for face spoofing detection in several datasets, which shows the superiority of our proposed approach over the state-of-the-art baseline methods. \subsection{Data Preparation and Preprocessing} \paratitle{Face Detection.} Face detection is an essential step to properly deal with face anti-spoofing task. Due to its usefulness in many computer vision tasks, there exist several techniques to identify faces in images such as Haar Cascades, Viola-Jones and SSD~\cite{padilla2012evaluation,jones2003fast,zhang2017s3fd}. These methods have been used in previous research and worked sufficiently. However, in our work we decided to use Multi-task Cascade Convolutional Network (MTCNN) which has the ability of aligning faces in different poses and has adequate performance in unconstrained environments and various illuminations. MTCNN consists of three CNN networks leveraging a cascade architecture. The first stage detects the candidate facial windows and their bounding boxes and merges highly overlapping ones. In second and third stages the results are refined more and non-maximum suppression (NMS) is applied to filter out false candidates. Finally five facial landmark positions are obtained. We applied the method to the frames of videos to extract face images. Since in anti-spoofing task the background detail and information may be of great importance, a margin of pixels preserved around detected faces. \paratitle{Color Texture Feature Extraction.} The value of color texture descriptors for face anti-spoofing detection have been proved by retrospective studies. In this part our method is mostly based on~\cite{boulkenafet2016face}. The main idea is that the artifact face image may suffer from different types of quality loss because of being affected by different camera systems and a display device such as mobile devices, monitors or papers. Therefore, the spoofed image can be detected by analyzing color texture features on channels of different color spaces such as HSV and YCbCr. The HSV and YCbCr color space has been proven useful in previous works due to the chrominance and luminance information which are less correlated than RGB channels. More details of the effectiveness of the color textures usages in PAD and color spaces differences can be found in~\cite{boulkenafet2016face,de2012lbp,maatta2011face}. To leverage this information, we have constructed our image representing vector from three feature descriptors: Local Binary Pattern (LBP), Co-occurrence of Adjacent Local Binary pattern (CoALBP) and Local Phase Quantization (LBQ) which are extracted from gray-scale image, HSV and YCbCr channels ( six descriptors in total), as described in the following. \emph{Local Binary Pattern (LBP)}: The Local Binary Pattern descriptor which is proposed in~\cite{ojala2000gray} is a gray-scale texture descriptor. Because of its discriminative power and computational simplicity, LBP has become a popular approach in various applications. To do so, a binary code is computed for each pixel by setting a Threshold for circularly symmetric neighborhood of adjacent pixels with the value of the central pixel, which can be stated as, \begin{align} LBP_{P,R}(x,y) = \sum_{n=1}^{P} \delta( r_n \Vert -r_c) \times 2^{(n-1)}. \end{align} where $\delta(x) = 1$ if $x>=0$, otherwise $\delta(x) = 0$. The intensity value of central pixel $(x,y)$ and its $P$ neighbor pixels in the circle of radius $R$, are denoted by $r_c$ and $r_n$ $(n = 1, \ldots, P)$, respectively. Then the histogram is computed to measure the occurrence of different binary patterns. \emph{Co-occurrence of Adjacent Local Binary Patterns (CoALBP):} In the LBP method, the information of spatial relation between patterns are not taken into account by the histogram. In order to take advantage of this information, the Co-occurrence of Adjacent Local Binary Patterns (CoALBP) is proposed in~\cite{nosaka2011feature}. After the LBP pattern are extracted from the image, four direction are defined such as $ D= \{ (0, \Delta d), (\Delta d, 0), (\Delta d, \Delta d), (-\Delta, \Delta d) \}$ exploit the correlation and similarity between the adjacent patterns, where $\delta d$ is the distance between two adjacent patterns. A $2$-dimensional histogram with size of $16 \times 16$ is created for each direction and the obtained histograms are concatenated to form the CoALBP descriptor~\cite{boulkenafet2016face}. \emph{Local Phase Quantization (LPQ):} The Local Phase Quantization (LPQ) descriptor is mainly exploited to extract the texture information from the blurred images~\cite{ojansivu2008blur}. The Short Term Fourier Transform (STFT) is performed on image pixels to analyze the $M \times M$ neighborhoods adjacent to a center pixel $x$. Let $\mathcal{F}_u(x)$ be the STFT at the pixel $x$ using the bi-dimensional spatial frequency $u$. In the LPQ descriptor, only four complex frequencies are used: $u_0 = (\alpha, 0)$, $u_1 = (\alpha, \alpha)$, $u_2 = (0, \alpha)$, and $u_3 = (-\alpha, -\alpha)$, where $\alpha$ is a small scalar $(\alpha \ll 1)$, corresponding to the $0$, $45$ and $90$ and $135$ directions. To compute the LBQ descriptor, the LPQ features at a pixel $x$ are given by the vector, \begin{align} F_x = [ Re{F_{u0}(x), F_{u1}(x), F_{u2}(x), F_{u3}(x)}, \\ \nonumber Im{F_{u0}(x), F_{u1}(x), F_{u2}(x), F_{u3}(x)} ], \end{align} where $Re{.}$ and $Im{.}$ are the real and the imaginary parts of a complex number, respectively. The elements of the vector $F_x$ are fed to the previously defined $\delta$ function to be binarized, then the resulting coefficients are represented as integer values in range of $0$ to $255$ and stored into a histogram. Also a de-correlation step based on the whitening transform before the quantization process is suggested to make the LPQ coefficients statistically independents~\cite{boulkenafet2016face}. Table~\ref{tbl::shallow-features} illustrates the details of the different descriptors used in this work. \subsection{Experimental Setting} The proposed framework is designed to examine selfie videos submitted by users to a biometric system in order to detect spoofed faces for illegitimate access. To do so, the videos are passed into several steps. First, to organize the data, all video frames are extracted and MTCNN face detection is applied to them. A margin of $44$ pixels is also added to help detecting artifacts cues that may be existed in the background image. Then, the cropped image is resized to $160 \times 160$. To accelerate the training process, first we produced the data for both channels before feeding to the network. Thus, the normalized RGB image is converted to HSV, YCbCr and gray-scale color spaces and the texture descriptors are extracted from each channels of HSV, YCbCr and gray-scale separately and concatenated to form the enhanced feature vector. The resulting vector is used as an input for Wide channel. The parameters of each feature are provided in Table~\ref{tbl::shallow-features}. Finally, the face images and their corresponding feature vectors are fed into the network which was explained in section~\ref{sec::framework}. Also, it is worth noting that the learning rate and decay coefficient are 0.001 and the momentum term is $0.9$. The output value of the network describes the probability of spoofing attack in the image. \begin{figure*} \includegraphics[width=\columnwidth]{figures/Picture1.pdf} \caption{Samples of real and fake images in Rose-Youtu, SiW and NUAA datasets} \label{fig::framework} \end{figure*} \subsection{Datasets} We verified the performance of our proposed method on three widely-used datasets: SiW, ROSE-Youtu and NUAA Imposter. In the first two dataset different spoofing attacks using different devices are recorded. NUAA, however, only focuses on print attacks. All the datasets have already been divided to training and development sets and we used the same settings for the experiments. A short description of each dataset is brought in the following. \paratitle{SiW dataset}: SiW includes live and spoof videos from $165$ subjects, where, for each subject, there are $8$ live and up to $20$ spoof videos, in total $4,478$ videos~\cite{liu2018learning}. All videos are captured in $30$ fps, about $15$ second length. The recording resolution is $1080P$ HD. The live videos are collected in four sessions with variations of distance, pose, illumination and expression. The spoof videos are collected with various attacks such as printed paper and replay. \paratitle{ROSE-Youtu dataset}: This dataset covers a large variety of illumination conditions, camera models, and attack types, consists of $3350$ videos with $20$ subjects publicly available~\cite{li2018unsupervised}. For each subject, there are $150$ to $200$ video clips with the average duration around 10 seconds recorded by 5 different mobile phones with different resolutions. There exist $25$ genuine face video which covers $5$ different illumination conditions in office environment, including clients wearing eye-glasses. They considered three spoofing attack types including printed paper attack, video replay attack, and mask attack. \paratitle{NUAA Imposter dataset}: The dataset consists of 15 subjects videos captured by webcams~\cite{tan2010face}. The photos of both genuine subjects and their spoofing images are recorded with a frame rate of 20 fps. Five hundred images are gathered for each. Pictures are all frontal with a neutral expression. Location and illumination condition of each session are varied. \subsection{Results} In order to evaluate the performance of our approach, we trained our model on SiW and ROSE-Youtu training parts separately. The evaluation is done on the test parts of these datasets with EER (equal error rate) and HTER (half total error rate) metrics. Also to measure the generalization, the cross dataset test is done for both of them (training on SiW and testing with ROSE-Youtu and vice versa). Since NUAA is small dataset and limited to print attack, it is used just for evaluations on both testing scenarios. The results are illustrated in table 5. \begin{table}[] \centering \caption{Proposed model accuracy on cross-dataset settings} \label{tbl::performance} \begin{tabular}{|l|c|c|c|c|c|c|} \hline \textbf{\begin{tabular}[c]{@{}l@{}}Train/Test\\ Datasets\end{tabular}} & \multicolumn{2}{c|}{\textbf{SiW}} & \multicolumn{2}{c|}{\textbf{ROSE}} & \multicolumn{2}{c|}{\textbf{NUAA}} \\ \hline \textbf{Metric} & \textbf{EER} & \textbf{HTER} & \textbf{EER} & \textbf{HTER} & \textbf{EER} & \textbf{HTER} \\ \hline \textbf{SiW} & 0.55\% & 1.05\% & 19.57\% & 25.21\% & 26.57\% & 29.22\% \\ \hline \textbf{ROSE} & 17.83\% & 23.37\% & 4.27\% & 6.12\% & 22.34\% & 27.48\% \\ \hline \end{tabular} \end{table} \begin{table*}[h] \centering \caption{Separate channels evaluation on cross-dataset test} \label{tbl::separate-channel-evaluation} \begin{tabular}{|l|c|c|c|c|c|c|c|c|} \hline \textbf{\begin{tabular}[c]{@{}l@{}}Train/Test\\ Datasets\end{tabular}} & \multicolumn{4}{c|}{\textbf{SiW}} & \multicolumn{4}{c|}{\textbf{ROSE}} \\ \hline \textbf{Method} & \multicolumn{2}{c|}{\textbf{CNN}} & \multicolumn{2}{c|}{\textbf{Color-Texture}} & \multicolumn{2}{c|}{CNN} & \multicolumn{2}{c|}{\textbf{Color-Texture}} \\ \hline \textbf{Metric} & \textbf{EER} & \textbf{HTER} & \textbf{EER} & \textbf{HTER} & \textbf{EER} & \textbf{HTER} & \textbf{EER} & \textbf{HTER} \\ \hline \textbf{SiW} & 1.05\% & 1.68\% & 1.92\% & 3.41\% & 28.57\% & 34.33\% & 34.75\% & 39.67\% \\ \hline \textbf{ROSE} & \multicolumn{1}{l|}{27.51\%} & \multicolumn{1}{l|}{32.02\%} & \multicolumn{1}{l|}{30.70\%} & \multicolumn{1}{l|}{35.82\%} & \multicolumn{1}{l|}{9.34\%} & \multicolumn{1}{l|}{10.23\%} & \multicolumn{1}{l|}{8.95\%} & \multicolumn{1}{l|}{10.81\%} \\ \hline \end{tabular} \end{table*} It can be inferred from the results that while ROSE-Youtu is a smaller than SiW, it is more reliable and general dataset and produced more generalized results in cross dataset test. On the other hand SiW is large and more biased dataset. Because of lower quality images of NUAA which increases FRR (False rejection rate), results drops greatly in EER. Furthermore, it is important to measure how much improvement is achieved by using this approach compare to each single channel networks. to compare the performance over each channel, the feature interaction block is replaced with sigmoid classification layer and the network is trained with the same data as before. The comparing results is shown in following Table6. It can be seen in the table that the dual channel approach outperforms both single channel models. It is also produced more generalized model with better results in cross dataset tests. Also, while the descriptor model can perform pretty well on one dataset, it is more prone the get overfit when facing an unseen dataset and has lower results on cross dataset test, while CNN model can still perform better extracting general features. \section{Conclusion and Future Work} In this paper we proposed a dual channel method to use both CNN and color texture descriptors domains. According to the results our method can not only make a significant improvement comparing to previous similar methods, but also It comes out it can be a effective method to extract well-generalized and robust features to use for cross dataset experiments and avoid biases between datasets. For the future, one useful lead is using transfer learning for the CNN channel with more sophisticated architectures. Also other descriptors can be added to the other channel to derive better representation for anti-spoofing problem.
\section*{Acknowledgements} K.M., R.Q.J., and M.C.\ are supported by the U.S.\ National Science Foundation grants PHY-1921006 and PHY-2011334. The authors would like to thank their LIGO Scientific Collaboration and Virgo Collaboration colleagues for their help and useful comments, in particular Tito Dal Canton. The authors are grateful for computational resources provided by the LIGO Laboratory and supported by the U.S.\ National Science Foundation Grants PHY-0757058 and PHY-0823459, as well as resources from the Gravitational Wave Open Science Center, a service of the LIGO Laboratory, the LIGO Scientific Collaboration and the Virgo Collaboration. Part of this research has made use of data, software and web tools obtained from the Gravitational Wave Open Science Center and openly available at \url{https://www.gw-openscience.org}. LIGO was constructed and is operated by the California Institute of Technology and Massachusetts Institute of Technology with funding from the U.S.\ National Science Foundation under grant PHY-0757058. Virgo is funded by the French Centre National de la Recherche Scientifique (CNRS), the Italian Istituto Nazionale di Fisica Nucleare (INFN) and the Dutch Nikhef, with contributions by Polish and Hungarian institutes. This manuscript has been assigned LIGO Document Control Center number LIGO-P2000497. \section{Conclusion} \label{conclusion} In this paper, we have presented NNETFIX, a new machine learning-based algorithm designed to estimate the portion of a \ac{BBH} \ac{GW} signal that may be gated due to the presence of an overlapping glitch. We have tested the accuracy of the algorithm with different choices of signal parameters and gate settings, and defined several metrics to assess NNETFIX's performance. Among these metrics, the most important ones are the \ac{FMG} and the \ac{ORL}. The \ac{FMG} quantifies the algorithm's efficiency in reconstructing the gated data in the time domain. Positive values of this metric indicate that the full time series better matches the NNETFIX reconstructed time series than the gated time series. The fraction of samples that show improvement varies from approximately one third to over 95\% across the cases that we investigated. Results show that NNETFIX may be able to successfully reconstruct a majority of \ac{BBH} signals with peak single interferometer \ac{SNR} greater than 20 and gates with durations up to a few hundreds of milliseconds as close as a few tens of milliseconds before their merger time. The \ac{ORL} quantifies the algorithm's efficiency in improving the sky map from the gated time series. Positive values of this metric indicate that the sky map from the NNETFIX reconstructed time series has a larger overlap with the sky map from the full time series than the one obtained from the gated data. Sky maps from reconstructed data improve for higher network \ac{SNR} values as the \ac{ANN} can use a larger amount of signal energy to estimate the missing portion of the waveform. We find positive \ac{ORL} median values for all cases that we investigated with network \ac{SNR} above 28.3. Perhaps surprisingly, NNETFIX seems also to perform better in cases with longer gate durations or shorter signals. In these scenarios, the sky localizations obtained with gated data are considerably degraded. Thus, the improvements in the reconstructed sky maps are more sizeable. Reconstructed sky maps of more massive \ac{BBH} mergers typically show significant improvements compared to the sky maps obtained with gated data. In a real case scenario, we envision NNETFIX to be pre-trained on real noise data from the detectors for a sparse set of models, each covering a region of the five-dimensional parameter space spanned by \ac{SNR}, component masses, gate duration, and gate end-time before geocentric merger time, as was illustrated in Sec.~\ref{methodology} (but with a finer grid). While the optimal value of the network \ac{SNR} and the best estimates of the signal component masses are unknown to the observer because of the gating, the gated data and/or the data from the second interferometer may provide a rough estimate of these parameters. The estimated values of these parameters and the known gate parameters can then be used to choose the most appropriate pre-trained model in the NNETFIX bank. Typically, the NNETFIX reconstructed time series will produce a higher single interferometer peak \ac{SNR} than the gated time series. If that is the case, the known \ac{FSG} can be used to estimate the optimal single interferometer peak \ac{SNR} of the (unknown) full time series by fitting the expected roughly linear relation between the \ac{FRS} and the \ac{FSG} for the given \ac{TT} set. The overlap of the sky map from the NNETFIX reconstructed data with the sky map that could be obtained with the full data (if it were not contaminated by a glitch), $O_{r,f}$, can be estimated by looking at the distribution of the \ac{ORL} for the \ac{TT} set at hand. The exploration sets that we investigated show that there is a well-defined correlation between the \ac{ORL}, the \ac{FSG} and the overlap between the sky maps obtained from the gated data and the NNETFIX reconstructed data, $O_{r,g}$. If this correlation is generally valid, the \ac{ORL} can be estimated from the observed values of the $O_{r,g}$ and the \ac{FSG} using a fit calculated from the \ac{TT} set used to train the selected NNETFIX model. To expedite this process, the samples in each \ac{TT} set could be clustered according to the distributions of the \ac{ORL}, the $O_{r,g}$, and the \ac{FSG}. A classifier could then be trained to estimate the optimal \ac{SNR} and sky localization error region of the full signal. Once NNETFIX has been trained, the CPU time required to reconstruct the data is of the order of a few seconds for gate durations up to hundreds of milliseconds. This short turnout makes the algorithm suitable to be used in low-latency. NNETFIX could also be applied to \ac{GW} signals other than \ac{BBH} mergers, such as \ac{BNS} or \ac{NSBH} mergers. Therefore, it could be beneficial for rapid follow-up of glitch-contaminated, potentially \ac{EM}-bright candidate detections. In future work, we intend to explore the application of NNETFIX and its effect on the sky localization of \ac{BNS} signals, as well as detector network configurations with more than two detectors. Improving the sky localizations of potentially \ac{EM}-bright signals could increase the chances of coincident \ac{EM} and \ac{GW} observations and lead to a better understanding of the physical properties of their sources. \section{Performance of sky maps}\label{effect_skylocalization} The NNETFIX reconstructed time series are expected to produce better sky maps, and therefore better sky localization error regions of the astrophysical signal, than the gated time series. We evaluate this improvement by comparing the overlaps of the sky map derived from the full time series with the sky maps derived from the gated time series and the reconstructed time series. In the following, we generate the sky maps with a modified version of a pyCBC \cite{alex_nitz_2020_3904502} script, \textsc{pycbc\_make\_skymap}, in which the data can be manually gated. We follow Ref.~\cite{Ashton_2018} and define the overlap of two sky maps (1,2) as \begin{equation}\label{eq:def_overlap_integral} O_{1,2} = \frac{\displaystyle 4\pi\int \! p_1(\Omega) p_2(\Omega) \, \mathrm{d}\Omega} {\displaystyle \int \! p_1(\Omega) \, \mathrm{d}\Omega \int \! p_2(\Omega) \, \mathrm{d}\Omega}\,, \end{equation} where $p_1(\Omega)$ and $p_2(\Omega)$ are the sky localization probability densities of the sky maps and the integrals are over the solid angle $\Omega$. The discretized version of Eq.~(\ref{eq:def_overlap_integral}) is \begin{equation}\label{eq:def_overlap_discrete} O_{1,2} = N \sum_{i=1}^N P_{1i}P_{2i}\,, \end{equation} where $P_{1i}$ and $P_{2i}$ each denote the sky localization probability of the $i$-th pixel of the corresponding sky map, and $N$ is the total number of pixels. Each sky map is normalized such that the sum of the pixel values over the entire map is 1. Equation (\ref{eq:def_overlap_discrete}) gives values in the range $(0,N)$. Higher values of $O_{1,2}$ indicate a better overlap between the two maps while lower values denote worse overlaps and/or maps which tend to have less-localized error regions. A suitable metric to evaluate the improvement in the sky localization of a signal due to NNETFIX's reconstruction is the \ac{ORL} \begin{equation}\label{eq:log_ratio} \text{\ac{ORL}} = \log_{10}\frac{O_{r,f}}{O_{g,f}}\,, \end{equation} where $O_{r,f}$ ($O_{g,f}$) denote the overlaps of the sky maps obtained with the reconstructed (gated) time series and the full series. Positive (negative) values of the \ac{ORL} indicate that the sky map from the reconstructed time series has a larger (smaller) overlap with the sky map from the full time series than the latter has with the sky map from the gated time series. Tables \ref{table:m1_12_m2_10_OI}-\ref{table:m1_35_m2_29_OI} give the fraction of samples with positive \ac{ORL} for all exploration sets. High values of the \ac{ORL} are obtained when the overlap of the reconstructed (gated) sky map with the sky map from the full time series is large (small). The former typically occurs for reconstructed time series with large values of the \ac{FMG}. The latter may happen when the loss of signal due to the gate is high and even small gains in the single interferometer peak \ac{SNR} have a significant impact on the sky localization. An example of the \ac{ORL} distribution as a function of $O_{g,f}$ is shown in Fig.\ \ref{fig:snr30_m1_20_m2_15_tbm_30ms_dur_130ms_roc_OI} for the exploration set with $\rho_{N}=42.4$, component masses $(m_1,m_2)=(20,15)$ $M_\odot$, $t_g=130$ ms and $t_e=30$ ms. The median value of the \ac{ORL} is $1.14^{+1.15}_{-1.10}$, where the error is a 1-$\sigma$ percentile. The \ac{ORL} is positive in 87\% of the samples. Median values of \ac{ORL} for all exploration sets are given in Tables \ref{table:m1_12_m2_10_med_Z}-\ref{table:m1_35_m2_29_med_Z}. \begin{figure}[ht!] \centering \includegraphics[width=0.7\linewidth]{figures/figure8.pdf} \caption{Scatterplot of \ac{ORL} and $O_{g,f}$ for the 512 samples from the exploration set with $\rho_N=42.4$, component masses $(m_1,m_2)=(20,15)$ \(M_\odot\), gate end-time $t_e = 30$ ms and gate duration $t_d = 130$ ms. The colored circles denote samples with $0 < \text{\ac{FMG}} \le 1$, the $\times$ markers denote samples with \ac{FMG} $\le 0$ and the $+$ markers denote overfitted samples with \ac{FMG} $> 1$. 87\% of the samples have positive \ac{ORL}. The median value is \ac{ORL}$=1.14^{+1.15}_{-1.10}$, where the error is a 1-$\sigma$ percentile.} \label{fig:snr30_m1_20_m2_15_tbm_30ms_dur_130ms_roc_OI} \end{figure} Values of \ac{ORL} across the exploration sets generally increase with network \ac{SNR}, component masses and gate duration. The network \ac{SNR} of the signal is the main factor that determines the value of the \ac{ORL}. Because NNETFIX efficiently reconstructs time series containing signals with large \acp{SNR}, when network \acp{SNR} are large, the sky maps obtained from the full data are typically more similar to the sky maps from the reconstructed data than to the sky maps from the gated data. We find positive \ac{ORL} median values for all exploration sets with $\rho_N\ge 28.3$, irrespective of mass, gate duration and end-time. For these sets, the median values of the \ac{ORL} for the high \ac{SNR} sets are greater than the corresponding values for the medium \ac{SNR} sets by a factor ranging from $\sim 1.4$ for the high-mass scenario with $t_d=130$ ms and $t_e=15$ ms to $\sim 5$ for the low-mass scenario with $t_d=75$ ms and $t_e=170$ ms. The sky maps of reconstructed time series with lower \ac{SNR} generally show little improvement compared with the sky maps of gated time series. Median values of \ac{ORL} for the sets with $\rho_{N}=11.3$ are typically around 0, irrespective of the mass scenario, gate duration and gate end-time. The second most important factor that determines the \ac{ORL} are the component masses. Median \ac{ORL} values typically increase as values of the component masses become larger. For the exploration sets with $\rho_{N}=28.3$ $(42.4)$, the median values of \ac{ORL} for the high-mass exploration sets are greater than the corresponding values for the low-mass exploration sets by a factor ranging from $\sim 1.5$ ($2.3$) for $t_d=130$ ms and $t_e=90$ ms ($t_d=130$ ms and $t_e=15$ ms) to $\sim 20.5$ ($12.6$) for $t_d=50$ ms and $t_e=15$ ms ($t_d=50$ ms and $t_e=30$ ms). Median values of \ac{ORL} have a roughly linear dependency on gate duration. For the high and medium \ac{SNR} exploration sets, the median values of \ac{ORL} for $t_d = 130$ ms are larger than the corresponding values for $t_d=50$ ms by a factor ranging from $\sim 1.6$ (medium-mass scenario with $\rho_N=42.4$ and $t_e=15$ ms) to $\sim 4.7$ (high-mass scenario with $\rho_N=28.3$ and $t_e=90$ ms). Since longer gate durations correspond to greater signal losses, NNETFIX's reconstruction provides larger \ac{SNR} gains and \ac{ORL} values as the gate duration increases. The portion of a signal close to the merger time has a greater impact on the sky map than the portion of the signal in the early inspiral phase. Therefore, median values of the \ac{ORL} for the medium and high \ac{SNR} exploration sets with $t_e = 15$ ms are typically higher than the corresponding values for the sets with $t_e=170$ ms by a factor ranging from $\sim 1.1$ (low-mass scenario with $\rho_N=28.3$ and $t_d=90$ ms) to $\sim 7.1$ (high-mass scenario with $\rho_N=28.3$ and $t_d=50$ ms). For shorter signals and larger gate durations, a gate end-time very close to the merger time may lead to large signal losses and removal of the merger portion of the signal in \ac{H1}, and thus, make the reconstruction process less efficient. Figure \ref{fig:Z_VS_tbm} shows the \ac{ORL} as a function of the gate end-time for the high-mass sets with $t_d=130$ ms and different network \acp{SNR}. Figure \ref{fig:skymap} shows the sky localization error region that is obtained with the NNETFIX reconstructed data for the case of Fig.~\ref{fig:inj_result}. The value of the \ac{ORL} is $\sim 1.7$, corresponding to improving the overlap by a factor of $\sim 50$. \begin{figure}[ht!] \centering \includegraphics[width=0.7\linewidth]{figures/figure9.pdf} \caption{\ac{ORL} as a function of the gate end-time $t_e$ for the exploration set with component masses $(m_1,m_2)=(35,29)$ $M_\odot$, gate duration $t_d = 130$ ms, and different network \acp{SNR} $\rho_N=11.3$ (cyan solid), $\rho_N=28.3$ (red dashed), and $\rho_N=42.4$ (blue dashed). The curves denote median values. Shaded areas are 1-$\sigma$ percentiles.} \label{fig:Z_VS_tbm} \end{figure} \begin{figure}[ht!] \centering \includegraphics[width=0.7\linewidth]{figures/figure10.pdf} \caption{The 90\% probability sky localization error regions obtained with the reconstructed (dashed-blue), full (gray area) and gated (solid-red) time series for the case of Fig.~\ref{fig:inj_result}. The star denotes the injection location.} \label{fig:skymap} \end{figure} In summary, for a majority of the cases with gate durations up to a few hundreds of milliseconds and as close as a few tens of milliseconds to the merger time, the sky maps of reconstructed time series with network \ac{SNR} $\rho_N \ge 28.3$ better overlap with the sky maps of the full time series compared to the sky maps obtained with gated data (in some cases by a factor up to over 1000\%). In these cases, it can also be shown that the true direction of the signals typically belong to sky localization error regions for the reconstructed data with smaller probability contour values than the regions obtained with gated data. \section{Performance in the time-domain}\label{evaluation_in_time_series} NNETFIX's performance in estimating the full time series can be assessed by computing the amount of \ac{SNR} lost in the reconstruction process. We define the \ac{FRS} \begin{equation} \label{eq:snr_loss} \text{FRS} = \frac{\rho_f - \rho_r}{\rho_f}\,, \end{equation} where $\rho_f$ and $\rho_r$ are the (single interferometer) peak \ac{SNR} of the full time series and the reconstructed time series in \ac{H1}, respectively. Positive values of \ac{FRS} close to zero generally indicate accurate time series reconstructions. However, \ac{FRS} $\sim 0$ may also occur when the gating does not significantly reduce the peak \ac{SNR} of the full series, and thus, $\rho_f\sim\rho_g\sim\rho_r$. These cases can be separated by the \ac{FSG} \begin{equation} \label{eq:snr_gain} \text{FSG} = \frac{\rho_r - \rho_g}{\rho_g}\,, \end{equation} where $\rho_g$ is the peak \ac{SNR} of the gated series. The \ac{FSG} characterizes the amount of \ac{SNR} gained by the reconstructed time series in comparison to the gated time series. Typically, NNETFIX performance is better for smaller values of \ac{FRS} and larger values of \ac{FSG}. Median values of FRS across the exploration sets range from \ac{FRS} $=-0.09$ (high-mass case with $\rho_N=11.3$, $t_d=170$ ms and $t_e=50$ ms) to \ac{FRS} $=0.22$ (medium-mass case with $\rho_N=28.3$, $t_d=15$ ms and $t_e=130$ ms). Sets with smaller gate durations are generally characterized by lower \ac{FRS} values. All exploration sets with $t_d=50$ ms have \ac{FRS} $<0.1$. The fraction of sets with \ac{FRS} below this threshold reduces to 0.78 and 0.55 for gate durations of 75 ms and 130 ms, respectively. Similarly, exploration sets with gates that are farther away from the time of the merger also tend to have a lower median value of the \ac{FRS}. All sets with gate end-times at 170 ms before merger have median \ac{FRS} $<0.07$ while only 81\%, 55\% and 11\% of the samples with $t_e=90$, 30 and 15 ms have \ac{FRS} below this threshold, respectively. The effects of the network \ac{SNR} and component masses on \ac{FRS} are less significant. About 83\% of the sets with $\rho_N=11.3$ have median \ac{FRS} $<0.1$ compared to 75\% for the sets with $\rho_N=28.3$ and $\rho_N=42.4$. The percentages of low-mass, medium-mass and high-mass sets with \ac{FRS} $<0.1$ are comparable at about 78\%, 75\% and 81\%, respectively. Median values of \ac{FSG} range from $\sim 0.02$ (low-mass, low-\ac{SNR} case with $t_d=170$ ms and $t_e=50$ ms) to $\sim 0.89$ (high-mass, low-\ac{SNR} case with $t_d=130$ ms and $t_e=15$ ms). High-mass (low-mass) exploration sets are typically characterized by higher (lower) values of the \ac{FSG}. All high-mass sets have \ac{FSG} $>0.08$, while all low-mass sets have \ac{FSG} $<0.07$. Gate end-time and \ac{SNR} do not seem to significantly affect the value of \ac{FSG}. The gate duration has a larger effect. Sets with longer gate durations typically have larger median value of the \ac{FSG}. Two thirds of the sets with $t_d=130$ ms have \ac{FSG} $>0.08$ compared to only 42\% of the sets with $t_d=50$ ms. A combined threshold of \ac{FRS} $\gtrsim 0$ and \ac{FSG} $\gtrsim 0.01$ is a conservative choice for good reconstructions. About 70\% of the samples across all the exploration sets satisfy this criterion. Figure~\ref{fig:estimated_ts} shows the NNETFIX data reconstruction for the time series of Fig.~\ref{fig:inj_result}. As shown in Fig.~\ref{fig:qtrasn}, the reconstructed time series recovers a large signal energy in the gated portion. In this case, \ac{FRS} $=0.05$ and \ac{FSG} $=0.53$. \begin{figure}[ht!] \centering \includegraphics[width=0.7\linewidth]{figures/figure2.pdf} \caption{The whitened full time series (gray), the gated time series (red) and the reconstructed time series (blue) for the simulated event of Fig.~\ref{fig:inj_result}. The vertical black-dashed line denotes the merger time in \ac{H1}.} \label{fig:estimated_ts} \end{figure} \begin{figure}[ht!] \centering \includegraphics[width=\linewidth]{figures/figure3.pdf} \caption{Time frequency representations of the full (left), gated (middle), and reconstructed (right) time series for the simulated event of Fig.~\ref{fig:estimated_ts} using the Q transform \cite{Chatterji:2004qg}. The vertical red-dashed line denotes the gate and the vertical white-dotted line denotes the merger time in \ac{H1}. } \label{fig:qtrasn} \end{figure} A complementary metric to evaluate the performance of the algorithm is the \ac{FMG} \begin{equation} \label{eq:gain_over_loss} \text{\ac{FMG}} = \frac{M_r - M_g}{M_f - M_g}\,, \end{equation} where the match $M_i$ between a time series $s_i$ and the injected waveform $h$ is \begin{equation} \label{eq:match} M_i = \frac{\langle s_i|h\rangle}{\sqrt{\langle s_i|s_i\rangle\langle h|h\rangle}}\,. \end{equation} The inner product of two time series $s_i$ and $s_j$ is defined as \begin{equation} \langle s_i|s_j\rangle = 4\Re \int^{f_N}_{f_1}\frac{\tilde{s_i}(f)\tilde{s_j}^\ast(f)}{S(f)}df\,, \end{equation} where the tilde indicates the Fourier transform, the star denotes the complex conjugate, $S(f)$ is the detector noise \ac{PSD}, $f_1$ is the high-pass frequency, and $f_N$ is the Nyquist frequency. In Eq.~(\ref{eq:gain_over_loss}), we assume $M_f - M_g>0$. In rare instances (0.5\% of all exploration set data samples), $M_g$ becomes larger than $M_f$. This occurs for small values of the single interferometer peak \ac{SNR} (median value of 4.6) when the gated portion of the data is dominated by noise and anti-correlates with the injected waveform. In the following, we remove these data samples from the exploration sets. The \ac{FMG} assesses how well the NNETFIX reconstructed data matches the signal in comparison to the full data and gated data. Positive (negative) values of the \ac{FMG} correspond to $M_r$ greater (smaller) than $M_g$, indicating that the NNETFIX reconstructed time series has a better (worse) match with the injected waveform than the gated time series. Values of the \ac{FMG} larger than 1 indicate that the \ac{ANN} overfits the data, i.e., the reconstructed time series is more similar to the injected waveform than the full time series. Therefore, we consider the reconstructions with $0<\text{\ac{FMG}}\le 1$ to be successful. Figures \ref{fig:snr30_m1_20_m2_15_tbm_30ms_dur_130ms_roc_O_r_O_g} and \ref{fig:snr8_m1_20_m2_15_tbm_30ms_dur_130ms_roc_O_r_O_g} show the distributions of the \ac{FMG} for two exploration sets from the medium-mass scenario. Figure \ref{fig:hist_lambda} displays the comparison of these distributions. \begin{figure}[ht!] \centering \includegraphics[width=0.7\linewidth]{figures/figure4.pdf} \caption{Scatterplot of $M_r/M_f$ vs.\ $M_g/M_f$ for the exploration set with $\rho_N=42.4$, $(m_1,m_2)=(20,15)$ \(M_\odot\), $t_d = 130$ ms and $t_e = 30$ ms. The circles denote samples with $0<\text{\ac{FMG}}\le 1$, the $\times$ markers denote samples with \ac{FMG} $\le 0$ and the $+$ markers denote overfitted samples with \ac{FMG} $>1$. The gray area denotes the region of the parameter space with $0<\text{\ac{FMG}}\le 1$, which contains 95\% of the reconstructed time series. Two outliers with values \ac{FMG}$=-0.4$ and \ac{FMG}$=1.6$ are not shown in the plot in order to improve readability.} \label{fig:snr30_m1_20_m2_15_tbm_30ms_dur_130ms_roc_O_r_O_g} \end{figure} \begin{figure}[ht!] \centering \includegraphics[width=0.7\linewidth]{figures/figure5.pdf} \caption{Scatterplot of $M_r/M_f$ vs.\ $M_g/M_f$ for the exploration set with $\rho_N=11.3$, $(m_1,m_2)=(20,15)$ \(M_\odot\), $t_d = 130$ ms and $t_e = 30$ ms. The circles denote samples with $0<\text{\ac{FMG}}<1$, the $\times$ markers denote samples with \ac{FMG} $\le 0$ and the $+$ markers denote overfitted samples with \ac{FMG} $>1$. The gray area denotes the region of the parameter space with $0<\text{\ac{FMG}}\le 1$, which contains 59\% of the reconstructed time series.} \label{fig:snr8_m1_20_m2_15_tbm_30ms_dur_130ms_roc_O_r_O_g} \end{figure} \begin{figure}[ht!] \centering \includegraphics[width=0.7\linewidth]{figures/figure6.pdf} \caption{Distribution of the \ac{FMG} for the exploration sets with component masses $(m_1,m_2)=(20,15)$ \(M_\odot\), gate duration $t_d = 130$ ms, gate end-time $t_e = 30$ ms, and $\rho_N=11.3$ (gray-filled) and $\rho_N=42.4$ (red). The vertical dashed lines denote \ac{FMG}$=0$ and \ac{FMG}$=1$. The efficiency of the set with $\rho_N=11.3$ is 59\%. The efficiency of the set with $\rho_N=42.3$ is 95\%.} \label{fig:hist_lambda} \end{figure} We quantify NNETFIX's performance by estimating the reconstruction efficiency, which we define as the fraction of successfully reconstructed samples, i.e., samples with $0<\text{\ac{FMG}}\leq 1$. The fractions of samples with \ac{FMG} $\le 0$, $0<\text{\ac{FMG}}\leq 1$ and \ac{FMG} $>1$ for all exploration sets are given in Tables \ref{table:m1_12_m2_10}-\ref{table:m1_35_m2_29}. The efficiency across all exploration sets varies from approximately $0.31$ to over $0.95$. There is a mild dependence on the component masses of the system; the median value of the efficiency decreases from $0.77$ for the low-mass scenario to $0.61$ for the high-mass scenario when all other parameters (\ac{SNR}, gate duration and gate end-time) are held fixed. Within each mass scenario when the gate duration and gate end-time are held fixed, NNETFIX's efficiency typically improves by a factor $\sim 1.5$--2 as the network \ac{SNR} increases. As the \ac{SNR} becomes higher, the algorithm can rely on a larger amount of signal energy before and after the gated portion of the data to reconstruct the time series. NNETFIX successfully reconstructs over two thirds of the time series with $\rho_N=28.3$ or larger for all low-mass and medium-mass exploration sets and over half of the time series for the high-mass sets with the exception of two marginal cases with gate duration $t_d=75$ ms and gate end-time $t_e=90$ ms. The exploration sets with $\rho_N=11.3$ exhibit lower efficiencies, ranging from 31\% for the high-mass set with $t_d=75$ ms and $t_e=90$ ms to 66\% for the low-mass set with $t_d=130$ ms and $t_e=15$ ms. Figure \ref{fig:frac_sample_m1_20_m2_15} shows the efficiency for the exploration sets with component masses $(m_1,m_2) = (20,15) M_\odot$ as a function of the single interferometer peak \ac{SNR}. The percentage of successful reconstructions ranges from $\sim$ 33\%--66\% at low peak \ac{SNR} to $\gtrsim$ 80\% at high peak \ac{SNR}, with the lowest values $\lesssim$ 40\% occurring for the sets with $t_d\ge 75$ ms and $t_e\ge 30$ ms. Time series with peak \ac{SNR} above $\sim$ 20 show successful reconstructions in 70\% or more of the cases, irrespective of gate duration and end-time. \begin{figure}[ht!] \centering \includegraphics[width=0.7\linewidth]{figures/figure7.pdf} \caption{Efficiency as a function of the single interferometer peak \ac{SNR} for the scenario with component masses $(m_1,m_2)=(20,15)$ \(M_\odot\). Each line corresponds to a different gate duration and gate end-time combination. Green (blue, black, red) markers denote gate end-times $t_e = 15$ (30, 90, 170) ms. Circles (crosses, squares) denote gate durations $t_d = 50$ (75, 130) ms. The bin width is 5.} \label{fig:frac_sample_m1_20_m2_15} \end{figure} Changing the gate duration does not seem to have a significant effect on NNETFIX's efficiency, which only varies slightly at fixed network \ac{SNR} and gate end-time across all exploration sets. Similarly, for fixed gate duration and network \ac{SNR}, the gate end-time before merger time also has a marginal effect, although NNETFIX tends to produce better reconstructions when the gate is closer to the merger time, especially for long gate durations in the low-mass and medium-mass scenarios. In conclusion, we find that NNETFIX may successfully reconstruct gated data of durations up to a few hundreds of milliseconds and as close as a few tens of milliseconds before the merger time for a majority of time series with single interferometer peak \ac{SNR} greater than 20. \section{Introduction}\label{introduction} The field of \ac{GW} astronomy began with the first direct detection of a \ac{GW} signal from a \ac{BBH} merger \cite{Abbott:2016GW150914} on September 14$^{\rm th}$, 2015. Nine additional \ac{BBH} mergers were detected with high confidence during the first and second LIGO \cite{advLigo2015} and Virgo~\cite{advVirgo2015} observation runs \cite{GWTC-1}. During the third LIGO-Virgo observation run, 39 binary merger events were detected with high confidence \cite{Abbott:2020niy}, including two exceptional \ac{BBH} events \cite{LIGOScientific:2020stg, PhysRevLett.125.101102, Abbott_2020} and a possible \ac{NSBH} merger \cite{Abbott:2020khf}. On August 17$^{\rm th}$, 2017, the first detection of a \ac{GW} signal from a \ac{BNS} merger, GW170817, expanded multi-messenger astronomy to include \ac{GW} observations \cite{GW170817}. A short \ac{GRB} was detected approximately 1.7 seconds after the \ac{BNS} merger time \cite{GBM:2017lvd}. The sky map calculated from the \ac{GW} signal allowed the identification of the event with an \ac{EM} counterpart \cite{GW170817, GBM:2017lvd}. The association of this \ac{GW} event with the observed \ac{EM} transients supports the long-hypothesized model that at least some short \acp{GRB} are due to \ac{BNS} coalescences \cite{Monitor:2017mdv} and has provided many insights into fundamental astrophysics and cosmology. In April 2020, a second \ac{BNS} merger without an \ac{EM} counterpart was detected \cite{Abbott:2020uma}. In order to detect \ac{GW} signals, ground-based \ac{GW} detectors must be extremely sensitive, causing them to become highly susceptible to instrumental and environmental noise \cite{GWTC-1}. In particular, transient noise bursts, or {\em glitches}, may impair the quality of detector data. The presence of a glitch in the proximity of a \ac{GW} signal can adversely affect the analysis of the latter, including calculating the sky localization of the source. The most notable example of such an occurrence was GW170817, where the effect of a glitch was mitigated in low-latency by removing the contaminated portion of the data and in follow-up studies by applying ad hoc mitigation algorithms \cite{GW170817,Driggers:2018gii}. One possibility to mitigate the effect of a contaminating glitch would be to discard the data from the affected detector. This is the simplest and fastest solution; however, it is also likely to impact the analysis and sky localization, especially in cases where data is only available from two detectors. Another technique that can be used in low-latency is {\em gating}, which removes the data affected by the glitch. One method of gating is to set the data affected by the glitch to zero using a window function to smoothly transition into and out of the gate \cite{Usman:2015kfa}. Gating was used in the case of GW170817 to produce the low-latency sky localization for \ac{EM} follow-up observations \cite{Pankow}. On larger latencies, glitch mitigation techniques such as using BayesWave \cite{Bayeswave} to model and subtract the glitch can be used \cite{Pankow}. Figure~\ref{fig:inj_result} shows an example of the detrimental effect gating data can have on the sky localization error region of a simulated \ac{BBH} merger signal. The sky localization obtained with the gated data significantly differs from the sky localization estimated from the full data. Also, the 90\% sky localization error region after the gating is applied no longer includes the true sky position of the injected signal. \begin{figure}[ht] \begin{center} \begin{minipage}[b]{0.49\textwidth} \includegraphics[width=\textwidth]{figures/figure1a.pdf} \end{minipage} \hfill \begin{minipage}[b]{0.49\textwidth} \includegraphics[width=\textwidth]{figures/figure1b.pdf} \end{minipage} \end{center} \caption{Left: Whitened time series of a simulated \ac{BBH} signal with two-detector network \ac{SNR} $\rho_{\rm N}=42.4$ and component masses $(m_1,m_2)=(35,29)$ \(M_\odot\) in \ac{aLIGO} recolored Gaussian noise (red curve). A 130 ms gate is applied 30 ms before the geocentric merger time (gray curve). The vertical black-dashed line denotes the merger time in \ac{H1}. Right: The 90\% sky localization error regions from the full data (gray area) and the gated data (red empty contours). The star indicates the true sky position of the simulated signal.} \label{fig:inj_result} \end{figure} The higher detector sensitivity of LIGO and Virgo in their third observing run has led to an increased number of \ac{GW} candidate detections from different astrophysical populations \cite{LIGOScientific:2020stg, Abbott:2020uma, Abbott:2020khf}. Future observation runs with higher sensitivity are expected to produce even greater detection rates, which would lead to higher chances of observing \ac{GW} signals contaminated by glitches. The inability to accurately estimate the sky localization of \ac{GW} candidates with potential \ac{EM} counterparts due to glitches contaminating the signal could put at risk new astrophysical discoveries such as those made with GW170817. Thus, the development and implementation of accurate low-latency denoising methods could be highly beneficial to multi-messenger observations. In this paper, we present a machine learning-based algorithm to denoise transient \ac{GW} signals called NNETFIX (``A Neural NETwork to `FIX' \ac{GW} signals coincident with short-duration glitches in detector data"). NNETFIX uses \acp{ANN} to estimate the portion of a signal which is lost due to the presence of an overlapping glitch. We train the \ac{ANN} to reconstruct the portion of a gated signal on a template bank of \ac{BBH} waveforms injected into simulated noise data. The accuracy of the algorithm is assessed by comparing the recovered waveform, \acf{SNR}, and sky map from the processed data to the corresponding quantities obtained before gating. We derive a set of statistical metrics to assess the improvement in these quantities. \section{Algorithm implementation, training and testing} \label{methodology} We consider a scenario in which a transient \ac{BBH} \ac{GW} signal is observed by a network of at least two detectors and the data of one detector is partially gated to remove a glitch. Without loss of generality, we perform the analysis for the two LIGO detectors, \acf{H1} and \ac{L1}, with the gating applied to data from the \ac{H1} detector. We assume the merger time at the geometric center of Earth (or geocentric merger time) to be (approximately) known from \ac{L1} data. We denote with $s_f(t)$, $s_g(t)$ and $s_r(t)$ the full time series, the gated time series, and the NNETFIX reconstructed time series, respectively. The output of NNETFIX can be thought of as the map \begin{equation} \label{eq:predicted_ts} s_r(t) := F\left[s_g(t)\right]\,. \end{equation} We train an \ac{ANN} regression algorithm to construct the map $F$ such that $s_r(t)\sim s_f(t)$. The NNETFIX implementation uses the \textsc{scikit-learn} \cite{scikit-learn} \ac{MLP} Regressor, a type of \ac{ANN} in which the nodes (mathematical functions) are arranged into layers and connected to every node in the preceding and/or succeeding layers \cite{MLP}. Each node calculates a weighted linear combination of the outputs from the preceding layer and applies an activation function that introduces a non-linearity into the node's output. The \ac{ANN} trained by NNETFIX consists of one hidden layer containing 200 neurons. In the \ac{ANN} training process, NNETFIX uses the rectified linear unit (\textit{ReLU}) activation function \cite{Nair2010RectifiedLU} and the \textit{ADAM} stochastic gradient-based optimizer \cite{adam} with a learning rate of $10^{-3}$. Ten percent of the training data samples are set aside and used for validating the training. The training iteration stops if the \ac{ANN} performance plateaus with a tolerance level of $10^{-4}$ to avoid overtraining. To reconstruct the gated portion of the time series, one hidden layer works better than multiple hidden layers for the loss function of mean square error and the number of hidden layers tested. The values from the loss function have a weak dependency on the number of neurons. To train the algorithm, we first build template banks of simulated non-spinning \textsc{IMRphenomD} \ac{BBH} merger waveforms \cite{IMRPhenomD} with varying intrinsic and extrinsic parameters. To reduce the potential for overtraining, each template bank also includes a number of (pure) noise time series. We distribute the positions of the injected signals isotropically in the sky. The waveform coalescence phase, polarization angle, and cosine of the inclination angle are uniformly distributed in the intervals $[0, 2\pi]$, $[0, \pi]$, and $[-1,1]$, respectively. We uniformly distribute the network \ac{SNR} $\rho_{\rm N}$ \cite{Usman:2015kfa} of the simulated signals in the range $[11.3,42.4]$. We consider three distinct template banks corresponding to low, medium, and high \ac{BBH} component masses to assess the prediction accuracy of the trained \acp{ANN} for different signal lengths. The \ac{BBH} component masses are uniformly sampled according to a Jeffreys prior for the matched-filter detection statistic. As the mass of the system decreases, we employ a higher number of templates to properly cover the mass parameter space \cite{Cokelaer:2007kx,Harry:2009ea,VanDenBroeck:2009gd,Manca:2009xw}. For each of the three distinct template banks, we build 12 \ac{TT} sets: first, we inject each waveform into 50 distinct realizations of recolored Gaussian noise for \acf{aLIGO} at design sensitivity; second, we include the (pure) noise time series; third, we shuffle and split the set by 70\%--30\% for training and testing; and finally, we apply the 12 combinations of gate durations $t_d=$ (50, 75, 130) ms and gate end-times before the geocentric merger time $t_e=$ (15, 30, 90, 170) ms. The time series are sampled at 4096 Hz, whitened, and high-passed. A conservative value of 25 Hz is used for the high-pass filter. The gates are implemented as a reversed Tukey window with a taper of 0.1 s and held fixed with respect to geocentric merger time; however, the merger time seen in the \ac{H1} detector naturally shifts due to the sky position and the polarization angle of the \ac{GW} signal. Table \ref{mass_table} shows the range of the component masses, the number of waveforms, the number of noise series, and the dimension of the sets for the different scenarios. \begin{table}[ht] \centering \begin{tabular}[t]{l>{\centering}p{0.15\linewidth}>{\centering}p{0.15\linewidth}>{\centering}p{0.08\linewidth}>{\centering}p{0.08\linewidth}>{\centering\arraybackslash}p{0.3\linewidth}} \toprule & $m_1$ [\(M_\odot\)] & $m_2$ [$M_\odot$] & $n_s$ & $n_n$ & Set dimension ($n_s\times 50 + n_n$)\\ \midrule Low & 10--15 & 8--12 & 348 & 1900 & 19300\\ Medium & 15--25 & 12--18 & 251 & 1350 & 13900\\ High & 28--42 & 23--35 & 61 & 300 & 3350\\ \bottomrule \end{tabular} \caption{Component mass ranges, number of waveforms ($n_s$), number of pure noise series ($n_n$), and dimension of the \ac{TT} sets for each of the three scenarios and combinations of gate durations and end-times.}\label{mass_table} \end{table} We test the effectiveness of the \acp{ANN} by calculating the coefficient of determination for the \ac{MLP} Regressor in \textsc{scikit-learn} on the testing sets \cite{scikit-learn}. The coefficient of determination ranges from $-\infty$ (bad) to 1 (perfect estimation), with positive values corresponding to some degree of accuracy. We evaluate the coefficient of determination on each testing set after training the \ac{ANN} on the corresponding training set. The ranges of the coefficient of determination for the testing sets are [0.773, 0.882], [0.750, 0.883], and [0.691, 0.879] for the low-mass, medium-mass, and high-mass scenarios, respectively, and the means are 0.833, 0.827, and 0.814. We test for potential statistical effects in the training method by considering the medium mass scenario with a gate duration of 50 ms and a gate end-time of 30 ms as a representative case. For 100 trials, we find that the coefficient of determination ranges from 0.800 to 0.826 with a mean of 0.815, which is consistent with the ranges of the testing sets. The effect of NNETFIX on quantities such as \ac{SNR} and sky localization varies for different component masses, network \ac{SNR}, and gate settings. Therefore, we construct 108 additional independent {\em exploration} sets with fixed network \ac{SNR} $\rho_{\rm N}=(11.3$, 28.3, $42.4)$ and component masses of (12, 10), (20, 15), (35, 29) $M_\odot$, and identical combinations of gate durations and end-times as the \ac{TT} sets. Each exploration set consists of 512 independent time series with the remaining parameters distributed as in the \ac{TT} sets. \section*{References} \bibliographystyle{iopart-num}
\section{Introduction} The problem of evolution of non-relativistic quantum packets in moving potentials (moving traps) with fixed shapes attracted attention of many authors for the past five decades. In particular, moving rectangular potential wells or barriers in one dimension were considered in \cite{Pimpale91,Lee02,Chiofalo03,Shegelski13,Dimeo14}. The moving Eckart potentials were studied in \cite{Ge96,Miyashita07}. A moving one-dimensional rigid box with impenetrable walls was studied in \cite{Hron81,Beauchard06}. The moving delta-potential in one dimension was discussed in \cite{Lee02,Pimpale91f,Cheng93,Pimpale04,Granot09}. Two moving delta-potentials in one dimension were investigated in \cite{Breit65,Herling65,Nishida65,Zhdanov74,Solov76,Dappen77,Danared84,Scheitler90,Manko98,Chikhachev05tmf,Chikhachev05}. Generalizations to three dimensions were made in \cite{Solov76,Chikhachev05tmf,Chikhachev05}, while a constant harmonic oscillator potential was added in \cite{Chikhachev05}. The Dirac and Klein--Gordon equations for the moving step potential were solved in \cite{Hamil16}. A non-relativistic quantum harmonic oscillator with a moving center described by means of the time-dependent Schr\"odinger equation with the Hamiltonian \begin{equation} H= p^2/(2M) + M\omega^2[x-b(t)]^2/2 , \label{Ham} \end{equation} was studied with different purposes in \cite{Duru89,Hurley11}. Several authors considered Hamiltonian (\ref{Ham}) in connection with the problem of optimal non-adiabatic transport of traps for ultracold atoms without exciting their vibrational quantum states (heating) \cite{Reichle06,Couvert08,Torron11,Guery14}. The subject of the present article is the general problem of {\em excitation\/} of a {\em moving\/} oscillator, which seems to be not considered until now in full. The search for non-exciting trajectories of the moving center is the special case of this general problem. \section{Transition probabilities to the instantaneous Fock states of the moving oscillator} Hamiltonian (\ref{Ham}) can be written as the Hamiltonian of a forced harmonic oscillator \begin{equation} H= p^2/(2M) + M\omega^2x^2/2 -f(t) x + f^2(t)/(2 M\omega^2), \label{Hamf} \end{equation} with the ``effective force'' $f(t) = M\omega^2 b(t)$. The dynamics of a quantum oscillator with Hamiltonian (\ref{Hamf}) was the subject of numerous studies. In particular, this problem attracted attention of many researchers in 1950s-1960s \cite{Bart49,Feynman50,Ludwig51,Feynman51,Glauber51,Husimi53,Schwinger53,Kerner58,Fuller63,Scarfone64,% Carr65,Gilbey66,Ninan69,Merz70,Zeld70,MM70}. For detailed reviews see, e.g., \cite{DM183-2,Popov07}. One of the most important results was a nice formula for the probabilities of transitions between the initial Fock state $|m\rangle$ at $t=0$ and the Fock state $|n\rangle$ at the instant $t$ \begin{equation} P_{mn} =\frac{\mu!}{\nu!} \gamma^{|m-n|} e^{-\gamma}\left[L_{\mu}^{(|m-n|)}(\gamma)\right]^2, \quad \begin{array}{l} \mu =\mbox{min}(m,n), \\ \nu =\mbox{max}(m,n), \end{array} \label{Pmn} \end{equation} where $L_n^{(\alpha)}(x)$ is the associated Laguerre polynomial (defined according to \cite{Bateman}). Parameter $\gamma$ is related to the Fourier transform of the external force: \begin{equation} \gamma =(2M\hbar \omega)^{-1}\left|\int_0^t f(\tau) e^{i\omega \tau}d\tau\right|^2. \label{gam} \end{equation} Formula (\ref{Pmn}) was found for the first time by Ludwig \cite{Ludwig51}, but his work was practically unknown, since it was written in German. Two years later the same result was given by Schwinger \cite{Schwinger53} (for $t=\infty$ and, strictly speaking, for the field oscillators excited by a classical current). The special case of (\ref{Pmn}) for $m=0$, \begin{equation} P_{0n}= e^{-\gamma} \gamma^n /n!, \label{P0n} \end{equation} was derived in \cite{Bart49,Feynman51,Glauber51}, but the presence of the Laguerre polynomial was not detected in that papers. Husimi \cite{Husimi53} used Charlier polynomials instead of Laguerre ones. Later, different derivations (sometimes rather long and complicated) of (\ref{Pmn}) were given in \cite{Kerner58,Fuller63,Scarfone64,Carr65,Gilbey66,Ninan69,Merz70}. However, applying formula (\ref{Pmn}) with parameter $\gamma$ defined by (\ref{gam}) with $f(t) = M\omega^2 b(t)$ to the case of moving oscillator, one arrives at strange results. For example, in the special case of uniformly moving center with $b(t)=vt$ (assuming that the center position at $t=0$ was $x=0$) one obtains \begin{equation} \gamma(t) = \frac{Mv^2}{2\hbar\omega}\left[(\omega t)^2 +4\sin^2(\omega t/2) - 2\omega t \sin(\omega t)\right]. \label{gamv} \end{equation} This formula predicts unlimited excitations of the oscillator energy levels. The reason of the controversy becomes clear, if one looks at solutions of the classical equations of motion for Hamiltonian (\ref{Ham}) (they coincide with quantum solutions for the average values). In the simplest case of zero initial conditions, these solutions read \begin{equation} x(t) = vt -v\sin(\omega t)/\omega, \quad d{x}/t = v - v\cos(\omega t). \label{xclas} \end{equation} Therefore, the first term in (\ref{gamv}) (proportional to $t^2$) is nothing but the potential energy of the moving oscillator center (normalized by the energy quantum $\hbar\omega$). It appears because formula (\ref{Pmn}) describes transitions between the Fock states defined for the oscillator with a {\em fixed\/} center at $x=0$, while we are interested in the situation with the {\em moving\/} center. The amplitude of real oscillations in the case concerned is proportional to the constant velocity $v$ of the moving center, so that the excitation probabilities (related to the energy of oscillations) must be also time-independent ones. One of the simplest ways to obtain the correct result is to follow the scheme used in \cite{MM70,DM183-2}, based on the concept of coherent states. The time dependent coherent state, satisfying the Schr\"odinger equation with Hamiltonian (\ref{Hamf}) and coinciding with the usual (unforced) coherent state at $t=0$, has the following form in the coordinate representation (see, e.g., \cite{DM183-2}): \begin{eqnarray} \langle x|\alpha\rangle_t &=& \left(\frac{M\omega}{\pi\hbar}\right)^{1/4} \exp\left\{ -\frac{M\omega}{2\hbar} x^2 + \sqrt{\frac{2M\omega}{\hbar}}\, x e^{-i\omega t}[\alpha -\delta(t)] + \alpha \left[\delta(t) e^{-2i\omega t} +\delta^*(t)\right] \right. \nonumber \\ && \left. -\frac{i\omega t}{2} -\,\frac{\alpha^2}{2}e^{-2i\omega t} -\,\frac{|\alpha|^2}{2} +i\omega \int_0^t d\,\tau \delta^2(\tau)e^{-2i\omega \tau} - \frac{i}{2 M\omega^2\hbar} \int_0^t f^2(\tau)\,d\,\tau \right\}, \label{coh} \end{eqnarray} where \begin{equation} \delta(t) = -i(2M\hbar\omega)^{-1/2} \int_0^t f(\tau) e^{i\omega \tau}d\tau, \qquad |\delta(t)|^2 = \gamma. \label{del} \end{equation} One has to compare this function with the coherent state $|\beta\rangle$ of the unforced oscillator (with $\delta=0$), considered with respect to the {\em moving\/} center $b(t)$ (not with respect to the initial oscillator center at $x=0$). Applying the {\em extended\/} Galilean transform \cite{Rosen72,Greenberger79}, the corresponding wave function can be written as \begin{eqnarray} \langle x|\beta\rangle_t &=& \left(\frac{M\omega}{\pi\hbar}\right)^{1/4} \exp\left\{ -\frac{M\omega}{2\hbar} [x-b(t)]^2 + \sqrt{\frac{2M\omega}{\hbar}}\, [x -b(t)] e^{-i\omega t}\beta +\frac{iM\dot{b}(t)}{\hbar} x \right. \nonumber \\ && \left. -\frac{i\omega t}{2} -\,\frac{\beta^2}{2}e^{-2i\omega t} -\,\frac{|\beta|^2}{2} - \frac{iM}{2 \hbar} \int_0^t \dot{b}^2(\tau)\,d\,\tau \right\}, \label{cohG} \end{eqnarray} where $\dot{b} \equiv db/dt$. The transition amplitude between coherent states $\langle \beta|\alpha\rangle$ is given by the Gaussian integral. After some algebra (in particular, using several integrations by parts in the integrals containing functions $\delta^2(\tau)$ and $\dot{b}^2(\tau)$), one can arrive at the following simple expression: \begin{equation} \langle \beta|\alpha\rangle = \exp\left[\alpha\beta^* +\alpha u(t) -\beta^* u^*(t) -\left(|\alpha|^2 +|\beta|^2 \right)/2 -|u(t)|^2/2 -i\phi(t) \right], \label{Tab} \end{equation} where \begin{equation} u(t) = -i \sqrt{\frac{M}{2\hbar\omega}} \int_0^t \ddot{b}(\tau) e^{-i\omega\tau}\,d\,\tau, \label{ut} \end{equation} \begin{equation} \phi(t) = \int_0^t d\tau \left\{\mbox{Im}\left[\dot{u}(\tau)u^*(\tau)\right] +M b(\tau)\ddot{b}(\tau)/\hbar \right\}. \label{phi} \end{equation} The simple expression for the phase (\ref{phi}) was obtained under the conditions $b(0)=\dot{b}(0)=0$ (used during some integrations by parts), but these conditions were not used for the derivation of function $u(t)$ (\ref{ut}). Using the standard expansions of coherent states over the (time-dependent) Fock states, \[ |\alpha\rangle_t = e^{-|\alpha|^2/2} \sum_{m=0}^{\infty} \frac{\alpha^m}{\sqrt{m!}}|m\rangle_t, \quad |\beta\rangle_t = e^{-|\beta|^2/2} \sum_{n=0}^{\infty} \frac{\beta^n}{\sqrt{n!}}|n\rangle_t, \] one can see that function (\ref{Tab}) is the generating function for the transition amplitudes $A_{mn}$ between the evolved initial states $|m\rangle_t$ and moving unforced states $|n\rangle_t$: \[ \langle \beta|\alpha\rangle = \exp\left[-\left(|\alpha|^2 +|\beta|^2\right)/2\right] \sum_{m,n=0}^{\infty} \frac{\alpha^m \beta^{*n}}{\sqrt{m! n! }}A_{mn}. \] Taking into account the generating function of the associated Laguerre polynomials (proofs can be found, e.g., in \cite{DM183-2,CahGla1}) \begin{equation} \exp\left(\xi x +\eta y + \xi\eta\right) = \sum_{m,n=0}^{\infty} \frac{\xi^n \eta^m}{n!} x^{n-m} L_m^{(n-m)}\left(-xy\right), \label{Lagg} \end{equation} one arrives finally to formula (\ref{Pmn}) for the transition probabilities $P_{mn} = \left|A_{mn}\right|^2$, but with $\gamma = |u(t)|^2$. This is the first main result of this article. Formally, it could be obtained by putting the force of inertia $f_i = -M \ddot{b}$ in formula (\ref{gam}). But our goal was to provide the strict proof, using the extended Galilean transform. Our second goal was to analyze whether the effects of excitation due to the motion of the center of a harmonic potential (harmonic trap) could be observed under realistic experimental conditions. The examples of the next section show that the answer is positive. \section{Examples and numerical estimations} If $\ddot{b}=a = const$, then \begin{equation} u(t) = \frac{a \sqrt{M}}{2\hbar\omega^3}\left(e^{-i\omega t} -1 \right), \;\;\; |u(t)|^2 = \frac{2M a^2}{\hbar\omega^3}\sin^2\left(\frac{\omega t}{2}\right), \label{ua} \end{equation} so that a constant acceleration results in {\em periodic\/} excitations, and the oscillator returns to its initial internal state (in the uniformly accelerated frame) after each period $2\pi/\omega$. If the oscillator center is accelerated during a short time interval $T_a \ll 2\pi/\omega$, then $|u(t)|^2 = Mv^2/(2\hbar\omega) \equiv G$ for $t>T_a$, independently of the concrete form of function $\ddot{b}(t)$. Here $v$ is the final constant velocity of the moving center. For example, if the center of a harmonic trap for ultracold atoms with frequency $\omega \sim 100$\,s$^{-1}$ (this is a realistic value \cite{Leggett01}) almost instantly starts to move with the constant velocity $1\,$mm/s, then $G \sim 5$ for atoms with mass $M\sim 10^{-22}\,$g, which means a significant degree of excitation. If the uniformly moving center suddenly stops later at instant $T$, then $|u(T)|^2 = 4G\sin^2(\omega T/2)$. For the periodic motion of center, $b(t)= R[1-\cos(\Omega t)]$ (satisfying the conditions $b(0)=\dot{b}(0)=0$), one obtains \begin{equation} |u(t)|^2 =G\,\Omega^2\left[\frac{\sin^2(\omega_- t/2)}{\omega_-^2} + \frac{\sin^2(\omega_+ t/2)}{\omega_+^2} + \frac{2\cos(\Omega t)\sin(\omega_- t/2)\sin(\omega_+ t/2)}{\omega_- \omega_+} \right]. \label{uosc} \end{equation} Here, $\omega_{\pm} = \omega \pm \Omega$ and $G = M(R \Omega)^2/(2\hbar\omega)$. If the center returns to its initial position after $s$ oscillations at $t=2\pi s/\Omega$, then \begin{equation} |u_s|^2 = \frac{4G(\Omega\omega)^2}{\left(\Omega^2 -\omega^2\right)^2}\sin^2(s\pi\omega/\Omega). \label{uosc-s} \end{equation} The same value can be obtained for the parameter $|\delta_s|^2$ calculated according to Eq. (\ref{del}), since the centers of moving and fixed oscillators coincide at this specific instant. One can see that $|u_s|^2 \ll G$ if $\omega \ll \Omega$ or $\omega \gg \Omega$. But this parameter can be quite big in the resonance case $\omega=\Omega$ (as one can expect): $\left|u_s^{(res)}\right|^2 = G(\pi s)^2$. For the two-dimensional oscillator moving in the $xy$ plane, the coherent states and transition amplitudes between them, being the Gaussian exponential functions, are obvious products of functions (\ref{coh}), (\ref{cohG}) and (\ref{Tab}). Consequently, transition probabilities between the selected initial $|m_x, m_y\rangle$ and final $|n_x, n_y\rangle$ Fock states are given by products of functions (\ref{Pmn}), dependent on parameters $|u_x(t)|^2$ and $|u_y(t)|^2$ determined by the moving center coordinates $b_x(t)$ and $b_y(t)$. If the oscillator is isotropic, then the total transition probabilities between the energy eigenstates (taking into account their degeneracy) must depend on the only parameter $|{\bf u}|^2 =\left|u_x\right|^2 + \left|u_y\right|^2$, due to the rotational symmetry. This statement can be easily confirmed for the transitions from the vacuum state $|0,0\rangle$ to all states $|n_x,n_y\rangle$ with $n_x+n_y = n =const$, \begin{equation} {\cal P}_{0n} = \exp\left[-\left(\left|u_x\right|^2 + \left|u_y\right|^2\right)\right] \sum_{n_x+n_y = n} \frac{\left|u_x\right|^{2 n_x}\left|u_y\right|^{2 n_y}}{n_x ! n_y !} = \exp\left(-|{\bf u}|^2\right) \frac{|{\bf u}|^{2n}}{n!}. \label{Pon2} \end{equation} Here, the known binomial formula was used. The same result (\ref{Pon2}) is true for the $N$-dimensional isotropic harmonic oscillator (as a consequence of the multinomial formula), but only for transitions from the initial ground state. One could suppose that a general formula for the total transition probability ${\cal P}_{mn}$ between the $m$-th and $n$-th degenerate energy levels is given by the same formula (\ref{Pmn}) with $\gamma$ replaced by $|{\bf u}|^2 \equiv w$. Unfortunately, it is not the case. One of simple examples is the transition probability between all the first and second excited energy levels of the two-dimensional isotropic oscillator (the notation below seems to be clear): \[ {\cal P}_{12} = P_{01,02} + P_{01,11} + P_{01,20} + P_{10,02} + P_{10,11} + P_{10,20}. \] Using explicit expressions for the associated Laguerre polynomials $L_1^{(\alpha)}(x) = 1 +\alpha - x$ \cite{Bateman}, one obtains (writing here $\left|u_x\right|^2 =\xi$ and $\left|u_y\right|^2 =\eta$, so that $\xi+\eta= w$) \begin{eqnarray*} {\cal P}_{12} &=& e^{-\xi-\eta}\left[\frac{\eta}{2}(2-\eta)^2 +\xi(1-\eta)^2 +\frac{\xi^2}{2}\eta + \xi \frac{\eta^2}{2} +(1-\xi)^2\eta +\frac{\xi}{2}(2-\xi)^2\right] \nonumber \\ &=& \frac{w}{2}e^{-w}\left(6 - 4w +w^2\right) = \frac{w}{2}e^{-w} \left\{2 +\left[L_1^{(1)}(w)\right]^2 \right\}. \end{eqnarray*} Similarly, ${\cal P}_{11} = e^{-w} \left\{ 1 +\left[L_1^{(0)}(w)\right]^2 \right\}$. Now we consider the motion of the center of the isotropic oscillator potential along a circle: $b_x(t) = R\{1-\cos[\varphi(t)]\}$, $b_y(t) = R\sin[\varphi(t)]$ (this is an example of rotating traps \cite{Fetter09,Palm16,Lizu19}). Function $\varphi(t)$ must satisfy the condition $\dot\varphi(0)=0$, due to the requirements $b_x(0)=b_y(0)=\dot{b}_x(0)=\dot{b}_y(0)=0$. If $\dot\varphi(t)$ grows rapidly (during the time interval $T_a$ much smaller than $2\pi/\omega$) to the constant value $\Omega$, one can put $\varphi(t)=\Omega t$ in the integral for $u_x(t)$. Consequently, function $|u_x(t)|^2$ is given again by Eq. (\ref{uosc}). But calculating $u_y(t)$, one must take into account rapid jumps of the velocity $\dot{b}_y$ from zero to $R\Omega$ at the initial short transient interval and its fast return to zero value before $t_s=2\pi s/\Omega$, if the moving center rapidly stops at the initial point after $s$ complete revolutions. Finally, one can obtain the following expression for the excitation parameter $w_s = |u_x(t_s)|^2 + |u_y(t_s)|^2$: \begin{equation} w_s = \frac{2M(R\Omega\omega)^2\left(\omega^2 +\Omega^2\right)}{\hbar\omega\left(\omega^2 -\Omega^2\right)^2} \sin^2(s\pi\omega/\Omega). \label{ws} \end{equation} For the slowly rotating ($\Omega \ll \omega$) harmonic trap center one has \begin{equation} w_s =G\sin^2(s\pi\omega/\Omega), \quad G= 2MR^2\Omega^2/(\hbar\omega). \end{equation} For example, if the center of a harmonic trap with $\omega \sim 100$\,s$^{-1}$ slowly rotates with frequency $\Omega \sim 10^{-2}$\,s$^{-1}$ (one rotation for ten minutes) along a circle with radius $R=10$\,cm, then $G \sim 20$ for $M \sim 10^{-22}$\,g. Consequently, strong excitations of the vibration modes inside the trap can be achieved, although the concrete value of the excitation parameter $w_s$ is very sensitive to the value of the big ratio $\omega/\Omega$. Perhaps, this result could be interesting from the point of view of experiments with ultracold gases in harmonic traps. \section*{Acknowledgment} The author acknowledges a partial support of the Brazilian agency CNPq.
\section{Introduction}\label{section.intro} We consider what is termed the {\em Mostar index} of Fibonacci and Lucas cubes. These two families of graphs are special subgraphs of hypercube graphs. They were introduced as alternative interconnection networks to hypercubes, and have been studied extensively because of their interesting graph theoretic properties. The Mostar index of a graph was introduced in \cite{Mostar1}. Let $G = (V(G),E(G))$ be a graph with vertex set $V(G)$ and edge set $E(G)$. For any $uv\in E(G)$ let $n_u(G)$ denote the number of vertices in $V(G)$ that are closer (w.r.t. the standard shortest path metric) to $u$ than to $v$; and let $n_v(G)$ denote the number of vertices in $V(G)$ that are closer to $v$ than to $u$. The {\em Mostar index} of $G$ is defined in \cite{Mostar1} as $$\Mo(G) = \sum_{uv\in E(G)}|n_u(G)-n_v(G)|~.$$ When $G$ is clear from the context we will write $n_u = n_u(G)$ and $n_v = n_v(G).$ Distance related properties of graphs such as the Wiener index, irregularity and Mostar index have been studied for various families of graphs in the literature. The Wiener index $W(G)$ of a connected graph $G$ is defined as the sum of distances over all unordered pairs of vertices of $G$. It is determined for Fibonacci cubes and Lucas cubes in \cite{Wiener.Fibo}. The irregularity of a graph is another distance invariant measuring how much the graph differs from a regular graph and Albertson index (irregularity) is defined as the sum of $|deg(u)-deg(v)|$ over all edges $uv$ in the graph \cite{Albertson}. The irregularity of Fibonacci cubes and Lucas cubes are studied in \cite{Klavzar_irr,FiboLucas_irr}. The relation between the Mostar index and the irregularity of graphs and their difference are investigated in \cite{Mostar3}. Recently, the Mostar index of trees and product graphs have been investigated in \cite{Mostar2}. In this work, we determine the Mostar index of Fibonacci cubes and Lucas cubes. As a consequence we derive a relation between the Mostar and the Wiener indices for Fibonacci cubes, giving an alternate expression to the closed formula for $W(\Gamma_n)$ calculated in \cite{Wiener.Fibo}. \section{Preliminaries}\label{section.prelim} We use the notation $[n]=\{1,2, \ldots,n\}$ for any $n\in\Z^+$. Let $B=\{0,1\}$ and $$B_n=\{b_1 b_2 \ldots b_n\mid b_i\in B,\ \forall i\in[n]\}$$ denote the set of all binary strings of length $n$. Special subsets of $B_n$ defined as $$\sF_n=\{b_1 b_2 \ldots b_n\mid b_i\cdot b_{i+1}=0,\ \forall i\in[n-1]\}$$ and $$\sL_n=\{b_1b_2 \ldots b_n\mid b_i\cdot b_{i+1}=0,\ \forall i\in[n-1]\mbox{ and } b_1\cdot b_{n}=0 \}$$ are the set of all Fibonacci strings and Lucas strings of length $n$ respectively. The $n$-dimensional hypercube $Q_n$ has vertex set $B_n$. Two vertices are adjacent if and only if they differ in exactly one coordinate in their string representation. For $n\ge 1$ the Fibonacci cube $\Gamma_n$ and the Lucas cube $\Lambda_n$ are defined as the subgraphs of $Q_n$ induced by the Fibonacci strings $\sF_n$ and Lucas strings $\sL_n$ of length $n$ \cite{Hsu,Lucas}. For convenience, we take $\Gamma_0 = K_1$ whose only vertex is represented by the empty string. One can classify the binary strings defining the vertices of $\Gamma_n$ by whether or not $b_1= 0$ or $b_1=1$. In this way $\Gamma_n$ decomposes into a subgraph $\Gamma_{n-1}$ whose vertices start with 0 and a subgraph $\Gamma_{n-2}$ whose vertices start with 10 in $\Gamma_n$. This decomposition can be denoted by \be \Gamma_n= 0\Gamma_{n-1}+10\Gamma_{n-2}~. \nn\ee Furthermore, $0\Gamma_{n-1}$ in turn has a subgraph $00\Gamma_{n-2}$ and there is a perfect matching between $00\Gamma_{n-2}$ and $10\Gamma_{n-2}$, whose edges are called {\em link edges}. This decomposition is the {\em fundamental decomposition} of $\Gamma_n$. In a similar way we can also decompose $\Gamma_n$ as \be \Gamma_n= \Gamma_{n-1}0+\Gamma_{n-2}01~. \nn\ee We refer to \cite{survey} for further details on $\Gamma_n$ . For $n\ge 2$, $\Lambda_n$ is obtained from $\Gamma_n$ by deleting the vertices that start and end with 1. This gives the fundamental decomposition of $\Lambda_n$ as \be \Lambda_n= 0\Gamma_{n-1}+10\Gamma_{n-3}0~. \nn\ee Here $0\Gamma_{n-1}$ has a subgraph $00\Gamma_{n-3}0$ and there is a perfect matching between $00\Gamma_{n-3}0$ and $10\Gamma_{n-3}0$. Fibonacci numbers $f_n$ are defined by the recursion $f_n = f_{n-1} + f_{n-2}$ for $n\ge 2$, with $f_0 = 0$ and $f_1 = 1$. Similarly, the Lucas numbers $L_n$ are defined by $L_n = L_{n-1} + L_{n-2}$ for $n\ge 2$, with $L_0 = 2$ and $L_1 = 1$. It is well-known that $|V(Q_n)|=|B_n|=2^n$, $|V(\Gamma_n)|=|\sF_n|=f_{n+2}$ and $|V(\Lambda_n)|=|\sL_n|=L_{n}$. For any binary string $s$ we let $w_H(s)$ denote the Hamming weight of $s$, that is, the number of its nonzero coordinates. The {\em XOR} of two binary strings $s_1$ and $s_2$ of length $n$, denoted by $s_1 \oplus s_2$ is defined as the string of length $n$ whose coordinates are the modulo 2 sum of the coordinates of $s_1$ and $s_2$. The distance $d(u,v)$ between two vertices $u$ and $v$ of the hypercube, the Fibonacci cube and the Lucas cube is equal to the Hamming distance between the string representations of $u$ and $v$. In other words, $d(u,v)=d_H(s_1,s_2)=w_H(s_1 \oplus s_2)$ for any of these graphs, by assuming $u$ and $v$ have string representations $s_1$ and $s_2$, respectively. \section{The Mostar index of Fibonacci cubes} For any $uv\in E(\Gamma_{n})$ let the string representations of $u$ and $v$ be $u_1 u_2\ldots u_n$ and $v_1 v_2\ldots v_n$, respectively. By the structure of $\Gamma_{n}$ we know that $d(u,v)=1$, that is, there is only one index $k$ for which $u_k\neq v_k$. \begin{lemma}\label{lemma1} For $n\ge 2$, assume that $uv\in E(\Gamma_n)$ with $u_k=0$ and $v_k=1$ for some $k\in [n]$. Then $n_u(\Gamma_n)=f_{k+1}f_{n-k+2}$ and $n_v(\Gamma_n)=f_{k}f_{n-k+1}$. \end{lemma} \begin{proof} The result is clear for $n=2$. Assume that $n\ge 3$, $1<k<n$ and let $\alpha\in V(\Gamma_{n})$ have string representation $b_1 b_2 \ldots b_n$. Since $uv\in E(\Gamma_n)$, $u$ and $v$ must be of the form $a_1\ldots a_{k-1}0a_{k+1}\ldots a_n$ and $a_1\ldots a_{k-1}1a_{k+1}\ldots a_n$, respectively. Since $v\in V(\Gamma_n)$ we must have $a_{k-1}=a_{k+1}=0$. From these representations we observe that the difference between $d(\alpha,u)$ and $d(\alpha,v)$ depends on the value of $b_k$ only. If $b_k=0$ we have $d(\alpha,u)=d(\alpha,v)-1$ and if $b_k=1$ we have $d(\alpha,u)=d(\alpha,v)+1$. Therefore, the vertices whose $k$th coordinate is 0 are closer to $u$ than $v$; and the vertices whose $k$th coordinate is 1 are closer to $v$ than $u$. Hence $n_u(\Gamma_n)$ is equal to the number of vertices in $\Gamma_n$ whose $k$th coordinate is 0. These vertices have string representation of the form $\beta_10\beta_2$ where $\beta_1$ is a Fibonacci string of length $k-1$ and $\beta_2$ is a Fibonacci string of length $n-k$. Consequently $n_u(\Gamma_n)=f_{k+1}f_{n-k+2}$. Similarly $n_u(\Gamma_n)$ is number of vertices of the form $\beta_3010\beta_4$, and this is equal to $f_{k}f_{n-k+1}$. For the case $k=1$ we have $u\in V(0\Gamma_{n-1})$ and $v\in V(10\Gamma_{n-2})$. Then $n_u(\Gamma_n)=|V(0\Gamma_{n-1})|=f_{n+1}$ and $n_v(\Gamma_n)=|V(10\Gamma_{n-2})|=f_{n}$. Similarly, for $k=n$ we have $u\in V(\Gamma_{n-1}0)$ and $v\in V(\Gamma_{n-2}01)$. This gives again $n_u(\Gamma_n)=f_{n+1}$ and $n_v(\Gamma_n)=f_{n}$ for $k=n$. As $f_1=f_2=1$, these are also of the form claimed. \end{proof} To find the Mostar index of Fibonacci cubes we only need to find the number of edges $uv$ in $\Gamma_n$ for which $u_k=0$ and $v_k=1$ for a fixed $k\in [n]$ and add up these contributions over $k$. \begin{lemma}\label{lemma2} For $n\ge 2$, assume that $uv\in E(\Gamma_n)$ with $u_k=0$ and $v_k=1$ for some $k\in [n]$. Then the number of such edges in $\Gamma_n$ is equal to $f_{k}f_{n-k+1}$. \end{lemma} \begin{proof} As in the proof of Lemma \ref{lemma1} the result is clear for $n=2$. Assume that $n\ge 3$. For $1<k<n$ we know that $u$ and $v$ are of the form $a_1\ldots a_{k-2}000a_{k+2}\ldots a_n$ and $a_1\ldots a_{k-2}010a_{k+2}\ldots a_n$. Then the number edges $uv$ in $\Gamma_n$ satisfying $u_k=0$ and $v_k=1$ is equal to the number of vertices of the form $a_1\ldots a_{k-2}000a_{k+2}\ldots a_n$, which gives the desired result. For the boundary cases $k=1$ and $k=n$ we need to find the number of vertices of the form $00a_3\ldots a_n$ and $a_1\ldots a_{n-2}00$, respectively. Clearly, this number is equal to $|V(00\Gamma_{n-2})|=f_n$ and $f_1=1$. This completes the proof. \end{proof} Using Lemma \ref{lemma1} and Lemma \ref{lemma2} we obtain the following main result. \begin{theorem}\label{thm.main} The Mostar index of Fibonacci cube $\Gamma_n$ is given by \begin{equation}\label{formula1} \Mo(\Gamma_n) = \sum_{k=1}^{n} f_{k}f_{n-k+1}\left(f_{k+1}f_{n-k+2}-f_{k}f_{n-k+1}\right) ~. \end{equation} \end{theorem} \begin{proof} Let $uv\in E(\Gamma_n)$ with $u_k=0$ and $v_k=1$ for some $k\in [n]$. Then from Lemma \ref{lemma1} we know that $$|n_u-n_v|=f_{k+1}f_{n-k+2}-f_{k}f_{n-k+1} $$ and therefore using Lemma \ref{lemma2} we have \be \Mo(\Gamma_n) &=& \sum_{uv\in E(\Gamma_n)}|n_u-n_v| \nn\\ &=& \sum_{k=1}^{n} f_{k}f_{n-k+1}\left(f_{k+1}f_{n-k+2}-f_{k}f_{n-k+1}\right) ~. \nn\ee \end{proof} Note that $f_{k+1}f_{n-k+2}-f_{k}f_{n-k+1}= f_{k}f_{n-k}+f_{k-1}f_{n-k+2}$ so that we can equivalently write \begin{equation}\label{formula2} \Mo(\Gamma_n) = \sum_{k=1}^{n} f_{k}f_{n-k+1}\left(f_{k}f_{n-k}+f_{k-1}f_{n-k+2}\right)~. \nn\end{equation} In Section \ref{sec.rec} Theorem \ref{thm.main3}, we present a closed form formula for $\Mo(\Gamma_n)$ obtained by using the theory of generating functions. Next we consider the Mostar index of Lucas cubes. \section{The Mostar index of Lucas cubes} We know that $\Lambda_{2}=\Gamma_2$ and therefore $\Mo(\Gamma_2)=\Mo(\Lambda_2)=2$. For any $uv\in E(\Lambda_{n})$ let the string representations of $u$ and $v$ be $u_1 u_2\ldots u_n$ and $v_1v_2\ldots v_n$, respectively. We know that $d(u,v)=1$ and there is only one index $k$ for which $u_k\neq v_k$. Similar to Lemma \ref{lemma1} and Lemma \ref{lemma2} we have the following result. \begin{lemma}\label{lemma3} For $n\ge 3$, assume that $uv\in E(\Lambda_n)$ with $u_k=0$ and $v_k=1$ for some $k\in [n]$. Then $n_u(\Lambda_n)=f_{n+1}$ and $n_v(\Lambda_n)=f_{n-1}$. \end{lemma} \begin{proof} Assume that $1<k<n$ and let $\alpha\in V(\Lambda_n)$ having string representation $b_1b_2\ldots b_n$. Since $uv\in E(\Lambda_n)$, $u$ and $v$ must be of the form $a_1\ldots a_{k-2}000a_{k+2}\ldots a_n$ and $a_1\ldots a_{k-2}010a_{k+2}\ldots a_n$, respectively. Then, if $b_k=0$ we have $d(\alpha,u)=d(\alpha,v)-1$ and if $b_k=1$ we have $d(\alpha,u)=d(\alpha,v)+1$. Therefore, $n_u(\Lambda_n)$ and $n_v(\Lambda_n)$ are equal to the number of vertices in $\Lambda_n$ whose $k$th coordinate is 0 and 1, respectively. Therefore we need to count the number of Lucas strings of the form $\beta_10\beta_2$ and $\beta_3010\beta_4$ which gives $n_u(\Lambda_n)=f_{n+1}$ and $n_v(\Lambda_n)=f_{n-1}$. For the case $k=1$, using the fundamental decomposition of $\Lambda_n$ we have $u\in V(0\Gamma_{n-1})$ and $v\in V(10\Gamma_{n-3}0)$. Then $n_u(\Lambda_n)=|V(0\Lambda_n)|=f_{n+1}$ and $n_v(\Lambda_n)=|V(10\Gamma_{n-3}0)|=f_{n-1}$. Similarly, for $k=n$ we have the same results $n_u(\Lambda_n)=f_{n+1}$ and $n_v(\Lambda_n)=f_{n-1}$. \end{proof} For any $uv\in E(\Lambda_{n})$ using Lemma \ref{lemma3} we have $$|n_u(\Lambda_n)-n_v(\Lambda_n)|=f_{n+1}-f_{n-1}=f_n~.$$ Since the number of edges in $\Lambda_n$ is $nf_{n-1}$ \cite{Lucas}, similar to the Theorem \ref{thm.main} we have the following result . \begin{theorem}\label{thm.main2} The Mostar index of Lucas cube $\Lambda_n$ is given by $$\Mo ( \Lambda_n) = n f_n f_{n-1}~.$$ \end{theorem} Here we remark that the vertices of Lucas cubes are represented by Lucas strings which are circular binary strings that avoid the pattern ``11". Because of this symmetry, the derivation of a closed formula of Theorem \ref{thm.main2} for the Mostar index of Lucas cube $\Lambda_n$ is easier than the one for $\Gamma_n$, in which the first and the last coordinates behave differently from the others. \section{A closed formula for $\Mo(\Gamma_n)$}\label{sec.rec} By the fundamental decomposition of $\Gamma_n$, the set of edges $E(\Gamma_n)$ consists of three distinct types: \begin{enumerate} \item The edges in $0\Gamma_{n-1}$, which we denote by $E(0\Gamma_{n-1})$. \item The link edges between $10\Gamma_{n-2}$ and $00\Gamma_{n-2}\subset 0\Gamma_{n-1}$, which we denote by $C_{n}$. \item The edges in $10\Gamma_{n-2}$, which we denote by $E(10\Gamma_{n-2})$~. \end{enumerate} In other words we have the partition $$E(\Gamma_n)=E(0\Gamma_{n-1}) \cup C_{n} \cup E(10\Gamma_{n-2}) ~.$$ We keep track of the contribution of each part of this decomposition by setting for $n\ge 2$, \be\label{defn.Mn} M_n(x,y,z)=\sum_{uv\in E(0\Gamma_{n-1})}|n_u-n_v|x+ \sum_{uv\in C_{n}}|n_u-n_v|y + \sum_{uv\in E(10\Gamma_{n-2})}|n_u-n_v|z ~. \ee Clearly, $\Mo(\Gamma_{n})=M_n(1,1,1)$. By direct inspection we observe that \begin{eqnarray*} M_2&=&x+y \\ M_3&=&4x+2y+z \\ M_4&=&16x+6y+6z \\ M_5&=&54x+15y+23z \end{eqnarray*} which gives \begin{eqnarray*} \Mo(\Gamma_{2})&=&M_2(1,1,1)=2 \\ \Mo(\Gamma_{3})&=&M_3(1,1,1)=7 \\ \Mo(\Gamma_{4})&=&M_4(1,1,1)=28 \\ \Mo(\Gamma_{5})&=&M_5(1,1,1)=92~, \end{eqnarray*} consistent with the values that are calculated using Theorem \ref{thm.main}. By using the fundamental decomposition of $\Gamma_n$ we obtain the following useful result. \begin{proposition}\label{prop.main.rec} For $n\ge 2$ the polynomial $M_n(x,y,z)$ satisfies $$M_n(x,y,z)=M_{n-1}(x+z,0,x)+M_{n-2}(2x+z,x+z,x+z)+f_{n-1}\left(f_{n}+f_{n-2}\right)x+f_nf_{n-1}y$$ where $M_0(x,y,z)=M_1(x,y,z)=0$. \end{proposition} \begin{proof} By the definition (\ref{defn.Mn}), there are three cases to consider: \begin{enumerate} \item Assume that $uv\in C_{n}$ such that $u\in V(0\Gamma_{n-1})$ and $v\in V(10\Gamma_{n-2})$:\\ We know that $d(u,v)=1$ and the string representations of $u$ and $v$ must be of the form $00b_3\ldots b_n$ and $10b_3\ldots b_n$, respectively. Then using Lemma \ref{lemma1} with $k=1$ we have $|n_u-n_v|=f_{n+1}-f_n=f_{n-1}$ for each edge $uv$ in $C_{n}$. As $|C_n|=f_n$ all of these edges contribute $f_nf_{n-1}y$ to $M_n(x,y,z)$. \item Assume that $uv\in E(10\Gamma_{n-2})$:\\ Let the string representations of $u$ and $v$ be $10u_3\ldots u_n$ and $10v_3\ldots v_n$, respectively. Using the fundamental decomposition of $\Gamma_n$ there exist vertices of the form $u'=0u_3\ldots u_n$ and $v'=0v_3\ldots v_n$ in $V(\Gamma_{n-1})$; $u''=u_3\ldots u_n$ and $v''=v_3\ldots v_n$ in $V(\Gamma_{n-2})$. Then $n_u$ counts the number of vertices $0\alpha\in V(0\Gamma_{n-1})$ and $10\beta \in V(10\Gamma_{n-2})$ satisfying $d(0\alpha,u)<d(0\alpha,v)$ and $d(10\beta,u)<d(10\beta,v)$. For any $0\alpha\in V(0\Gamma_{n-1})$ we know that $d(0\alpha,u)=d(\alpha,u')+1$ and $d(0\alpha,v)=d(\alpha,0v')+1$. Therefore, for a fixed $0\alpha\in V(0\Gamma_{n-1})$, $d(\alpha,u')<d(\alpha,v')$ if and only if $d(0\alpha,u)<d(0\alpha,v)$. Similarly, for any $10\beta\in V(10\Gamma_{n-2})$ we have $d(10\beta,u)=d(\beta,u'')$ and $d(\beta,v)=d(\beta,v'')$. Then we can write \be\label{eq.case.2} \sum_{uv\in E(10\Gamma_{n-2})}\big|n_u(\Gamma_n)-n_v(\Gamma_n)\big| &=&\sum_{u'v'\in E(\Gamma_{n-1})}\big|n_{u'}(\Gamma_{n-1})-n_{v'}(\Gamma_{n-1})\big| \nn\\ & &+\sum_{u''v''\in E(\Gamma_{n-2})}\big|n_{u''}(\Gamma_{n-2})-n_{v''}(\Gamma_{n-2})\big|~. \nn\ee Note that $\Gamma_{n-1}=0\Gamma_{n-2}+10\Gamma_{n-3}$ and the edge $u'v'\in E(\Gamma_{n-1})$ is an edge in the set $E(0\Gamma_{n-2})$. Furthermore $u''v''\in E(\Gamma_{n-2})$ is an arbitrary edge. Then by the definition \eqref{defn.Mn} of $M_n$ we have $$\sum_{u'v'\in E(\Gamma_{n-1})}\big|n_{u'}(\Gamma_{n-1})-n_{v'}(\Gamma_{n-1})\big|= M_{n-1}(1,0,0)$$ and $$\sum_{u''v''\in E(\Gamma_{n-2})}\big|n_{u''}(\Gamma_{n-2})-n_{v''}(\Gamma_{n-2})\big|= M_{n-2}(1,1,1)~.$$ Hence all of these edges $uv\in E(10\Gamma_{n-2})$ contribute $\big(M_{n-1}(1,0,0)+M_{n-2}(1,1,1)\big)z$ to $M_n(x,y,z)$. \item Assume that $uv\in E(0\Gamma_{n-1})$: \\ Since $0\Gamma_{n-1}=00\Gamma_{n-2}+010\Gamma_{n-3}$ we have three subcases to consider here. \begin{enumerate} \item Assume that $uv\in C_{n-1}$ such that $u\in00\Gamma_{n-2}$ and $v\in 010\Gamma_{n-3}$ .\\ Then using Lemma \ref{lemma1} with $k=2$ we have $|n_u-n_v|=f_3f_{n}-f_2f_{n-1}=2f_n-f_{n-1}=f_n+f_{n-2}$ for each edge $uv$ in $C_{n}$. As $|C_{n-1}|=f_{n-1}$ all of these edges contribute $f_{n-1}(f_n+f_{n-2})x$ to $M_n(x,y,z)$. \item Assume that $uv\in E(010\Gamma_{n-3})$:\\ Let the string representations of $u$ and $v$ are of the form $010u_4\ldots u_n$ and $010v_4\ldots v_n$ respectively. Using the fundamental decomposition of $\Gamma_n$ there exist vertices of the form $u'=000u_4\ldots u_n$ and $v'=000v_4\ldots v_n$ in $V(0\Gamma_{n-1})$; $u''=0u_4\ldots u_n$ and $v''=0v_4\ldots v_n$ in $V(\Gamma_{n-2})$. Then for any $10\alpha\in V(10\Gamma_{n-2})$ we know that $d(10\alpha,u)=d(10\alpha,u')+1=d(\alpha,u'')+2$ and we know that $d(10\alpha,v)=d(10\alpha,v')+1=d(\alpha,v'')+2$. Therefore for all $10\alpha\in V(10\Gamma_{n-2})$ we count their total contribution to $M_n$ by $M_{n-2}(1,0,0)x$ in this case. Furthermore, as $uv\in E(010\Gamma_{n-3})$ we have $uv\in E(0\Gamma_{n-1})$, and for all $0\alpha\in V(0\Gamma_{n-1})$ we count their total contribution to $M_n$ by $M_{n-1}(0,0,1)x$ by using the definition of $M_{n-1}$. Hence, the edges $uv\in E(010\Gamma_{n-3})$ contribute $\big(M_{n-1}(0,0,1)+M_{n-2}(1,0,0)\big)x$ to $M_n(x,y,z)$. \item Assume that $uv\in E(00\Gamma_{n-2})$.\\ These edges are the ones of $E(0\Gamma_{n-1})$ that are not in $E(010\Gamma_{n-3})$ and $C_{n-1}$ (not created during the connection of $00\Gamma_{n-2}$ and $010\Gamma_{n-3}$). Then similar to the Case 2 and using the definition \eqref{defn.Mn} of $M_n$ these edges contribute $\big(M_{n-1}(1,0,0)+M_{n-2}(1,1,1)\big)x$ to $M_n(x,y,z)$. \end{enumerate} \end{enumerate} Combining all of the above cases and noting $M_{n-1}(0,0,1)x=M_{n-1}(0,0,x)$, $M_{n-2}(1,0,0)x=M_{n-2}(x,0,0)$, $M_{n-2}(1,1,1)x=M_{n-2}(x,x,x)$ we complete the proof. \end{proof} If we write $M_n(x,y,z)=a_nx+b_ny+c_nz$, then from the recursion in Proposition \ref{prop.main.rec}, we obtain for $ n \geq 2$ \begin{eqnarray*} a_n &=& a_{n-1} + c_{n-1} + 2 a_{n-1} + b_{n-2} + c_{n-2} +f_{n-1} (f_n + f_{n-2}) \\ b_n & = & f_n f_{n-1} \\ c_n &=& a_{n-1}+ a_{n-2} + b_{n-2} + c_{n-2} ~. \end{eqnarray*} Eliminating $b_n$, this is equivalent to the system \begin{eqnarray}\label{system1} a_n &=& a_{n-1} + 2 a_{n-1} + c_{n-1}+c_{n-2} + f_{n-2}f_{n-3} + f_{n-1} f_{n-2} + f_n f_{n-1} \\ \nonumber c_n &=& a_{n-1}+ a_{n-2} + c_{n-2} + f_{n-2}f_{n-3} ~. \end{eqnarray} Let $A(t), B(t), C(t)$ be the generating functions of the sequences $a_n, b_n , c_n$, ($ n \geq 2$), respectively. We already know that (\cite[A001654]{oeis}) \begin{equation}\label{GFB} B(t) = \sum_{n \geq 2} f_n f_{n-1} t^n = \frac{t^2}{(1+t) (1-3t+t^2)} ~. \end{equation} From \eqref{system1} we obtain \begin{eqnarray}\label{system2} A(t) & = & (t + 2 t^2) A(t) + (t +t^2) C(t) + (1 + t + t^2 ) B(t) \\ \nonumber C(t) &=& (t + t^2) A(t) + t^2 C (t) + t^2 B(t) ~. \end{eqnarray} Solving the system of equations \eqref{system2} and using \eqref{GFB} we calculate \begin{eqnarray}\label{system3} A(t) & = & \frac{t^2} {(1+t)^2 (1-3t+t^2)^2} ~,\\ C(t) &= & \frac{t^3 + 2 t^4 - t^5}{(1+t)^2 (1-3t+t^2)^2 } \nn ~. \end{eqnarray} Since $\Mo (\Gamma_n) = M_n(1,1,1) = a_n + b _n + c_n$, adding the generating functions $A(t), B(t), C(t)$ we obtain \begin{equation}\label{MoGF} \sum_{n \geq 2 } \Mo (\Gamma_n) t^n = \frac{(2-t)t^2}{(1+t)^2 (1-3t+t^2)^2} ~. \end{equation} Using partial fractions decomposition in \eqref{MoGF} and the expansions \begin{eqnarray}\label{expansion1} \frac{1}{1-3t + t^2} & =& \sum_{n\geq 0} f_{2n+2} t^n ~,\\ \label{expansion2} \frac{1}{(1-3t + t^2)^2} & =& \sum_{n\geq 0} \frac{1}{5} \big( (4n+2) f_{2n+2} + (3n+3) f_{2n+1} \big) t^n \end{eqnarray} we obtain $$ \Mo ( \Gamma_n) = \frac{1}{25} \big( (3n+2) (-1)^n + (4n-5) f_{2n+2} + (3n+3) f_{2n+1} - (4n-3) f_{2n} - 3n f_{2n-1} \big)~, $$ which can be simplified to the closed form expression for $\Mo ( \Gamma_n)$ in Theorem \ref{thm.main3}. This is another way of writing the sum given in Theorem \ref{thm.main}. \begin{theorem}\label{thm.main3} The Mostar index of Fibonacci cube $\Gamma_n$ is \begin{equation}\label{formula3} \Mo (\Gamma_n) = \frac{1}{25} \big((3n-2)f_{2n+2} + n f_{2n+1} + (3n+2)(-1)^n \big)~. \nn\end{equation} \end{theorem} \section{The Wiener index and remarks} In \cite{Wiener.Fibo} it is shown that \begin{equation}\label{wiener} W(\Gamma_n)=\sum_{k=1}^{n} f_{k}f_{k+1}f_{n-k+1}f_{n-k+2}~ \end{equation} and that this sum can be evaluated as \begin{equation}\label{klavzar} W(\Gamma_n)= \frac{1}{25} \big( 4 (n+1) f_n^2 +(9n+2) f_n f_{n+1} +6n f_{n+1}^2 \big) ~. \end{equation} In view of our formula \eqref{formula1} of Theorem \ref{thm.main} and \eqref{wiener} this means that $$ W(\Gamma_n)= \Mo (\Gamma_n) + \sum_{k=1}^{n} (f_{k}f_{n-k+1})^2 ~. $$ The sum above is the sequence \cite[A136429]{oeis} with generating function $$ \frac{t(1-t)^2}{(1+t)^2 (1-3t+t^2)^2}~. $$ Adding the generating function \eqref{MoGF} to this, we get \begin{equation}\label{GFW} \sum_{n\geq1} W(\Gamma_n) t^n = \frac{t}{(1+t)^2 ( 1 - 3t + t^2)^2} ~. \end{equation} Using partial fractions and the expansions \eqref{expansion1} and \eqref{expansion2}, $W(\Gamma_n)$ ($n \geq 2$) is found to be $$ W(\Gamma_n) = \frac{1}{25} \big( (3n+2)f_{2n+3} + (n-2) f_{2n+2} -(n+2)(-1)^n\big) $$ which is a somewhat simpler expression than \eqref{klavzar}.\\ It is also curious that in view of their generating functions \eqref{system3} and \eqref{GFW} which differ only by factor of $t$, we have $$a_n = M_n(1,0,0) = W(\Gamma_{n-1})~.$$
\section*{Literaturverzeichnis}} \DefineBibliographyStrings{ngerman}{ andothers = {{et\,al\adddot}}, } \title{\textbf{Moving sum data segmentation for stochastics processes based on invariance}} \begin{document} \author{\Large Claudia Kirch\thanks{Institute for Mathematical Statistics, Department of Mathematics, Otto-von-Guericke University Magdeburg, Center for Behavioral Brain Sciences (CBBS); claudia.kirch$ @ $ovgu.de}, \ \Large Philipp Klein\thanks{Institute for Mathematical Statistics, Department of Mathematics, Otto-von-Guericke University Magdeburg, philipp.klein$ @ $ovgu.de} } \DeclareFieldFormat{citehyperref}{% \DeclareFieldAlias{bibhyperref}{noformat \bibhyperref{#1}} \DeclareFieldFormat{textcitehyperref}{% \DeclareFieldAlias{bibhyperref}{noformat \bibhyperref{% #1% \ifbool{cbx:parens} {\bibcloseparen\global\boolfalse{cbx:parens}} {}}} \savebibmacro{cite} \savebibmacro{textcite} \renewbibmacro*{cite}{% \printtext[citehyperref]{% \restorebibmacro{cite}% \usebibmacro{cite}}} \renewbibmacro*{textcite}{% \ifboolexpr{ ( not test {\iffieldundef{prenote}} and test {\ifnumequal{\value{citecount}}{1}} ) or ( not test {\iffieldundef{postnote}} and test {\ifnumequal{\value{citecount}}{\value{citetotal}}} ) } {\DeclareFieldAlias{textcitehyperref}{noformat}} {}% \printtext[textcitehyperref]{% \restorebibmacro{textcite}% \usebibmacro{textcite}}} \DeclareCiteCommand{\citeauthor} {\boolfalse{citetracker}% \boolfalse{pagetracker}% \usebibmacro{prenote}} {\ifciteindex {\indexnames{labelname}} {}% \printtext[bibhyperref]{\printnames{labelname}}} {\multicitedelim} {\usebibmacro{postnote}} \DeclareCiteCommand{\citeyear} {} {\bibhyperref{\printdate}} {\multicitedelim} {} \DeclareCiteCommand{\citetitle} {\bibsentence \usebibmacro{prenote}} {\printtext[bibhyperref]{\usebibmacro{title}}} {\multicitedelim} {\usebibmacro{postnote}} \newcommand*{\fullref}[1]{\hyperref[{#1}]{\hyperref{#1}(\ref*{#1})}} \newcommand{\lambda}{\lambda} \newcommand{\int \limits}{\int \limits} \newcommand{\vartau}{\vartau} \newcommand{\limm}{\lim \limits} \newcommand{\bigcupp}{\bigcup \limits} \newcommand{\bigcapp}{\bigcap \limits} \newcommand{\summ}{\sum \limits} \newcommand{\mathbf{B}}{\mathbf{B}} \newcommand{\boldsymbol{\mu}}{\boldsymbol{\mu}} \newcommand{\boldsymbol{\Sigma}}{\boldsymbol{\Sigma}} \newcommand{\mathbf{W}}{\mathbf{W}} \newcommand{\mathbf{R}}{\mathbf{R}} \newcommand{\mathbf{M}}{\mathbf{M}} \newcommand{\mathbf{Z}}{\mathbf{Z}} \newcommand{\mathbf{u}}{\mathbf{u}} \newcommand{\mathbf{Y}}{\mathbf{Y}} \newcommand{\mathbf{d}}{\mathbf{d}} \newcommand{\mathbf{X}}{\mathbf{X}} \newcommand{\widetilde{\mathbf{R}}}{\widetilde{\mathbf{R}}} \newcommand{{\tt{R}} }{{\tt{R}} } \newcommand{{\tt{RStudio}} }{{\tt{RStudio}} } \newcommand{\left\lbrace}{\left\lbrace} \newcommand{\right\rbrace}{\right\rbrace} \newcommand{\geschweift}[1]{\left\lbrace #1 \right\rbrace} \newcommand{\ceil}[1]{\left\lceil #1 \right\rceil} \newcommand{\floor}[1]{\left\lfloor #1 \right\rfloor} \newcommand{\linksoffen}[1]{\left( #1 \right]} \newcommand{\rechtsoffen}[1]{\left[ #1 \right)} \newcommand{\Anz}[2]{X_{\left(#1 T,#2 T\right]}} \newcommand{\Anzreskaliert}[2]{X_{\left(#1,#2\right]}} \newcommand{\Anznormiert}[2]{Y_{\left(#1,#2\right]}} \newcommand{\overset{\mathcal{D}}{\longrightarrow}}{\overset{\mathcal{D}}{\longrightarrow}} \newcommand{\overset{P}{\longrightarrow}}{\overset{P}{\longrightarrow}} \newcommand{\EW}[1]{\E\left[#1\right]} \newcommand{\Var}[1]{\Varianz\left[#1\right]} \newcommand{\Cov}[2]{\Covarianz\left[#1,#2\right]} \newcommand{\Prob}[1]{\Wkeit\left(#1\right)} \newcommand{\supp}[1]{\underset{#1}{\sup}} \newcommand{\limsupp}[1]{\underset{#1}{\limsup}} \newcommand{\inff}[1]{\underset{#1}{\inf}} \newcommand{\liminff}[1]{\underset{#1}{\liminf}} \newcommand{\maxx}[1]{\underset{#1}{\max}} \newcommand{\minn}[1]{\underset{#1}{\min}} \newcommand{\argmaxx}[1]{\underset{#1}{\argmax}} \newcommand{\argminn}[1]{\underset{#1}{\argmin}} \newcommand{\abs}[1]{\left|#1\right|} \newcommand{X}{X} \newcommand{Y}{Y} \newcommand{\sigma}{\sigma} \newcommand{\rho}{\rho} \newcommand{d}{d} \newcommand{\mu}{\mu} \newcommand{c}{c} \newcommand{\xi}{\xi} \newcommand{\Delta}{\Delta} \newcommand{h}{h} \newcommand{\gamma}{\gamma} \newcommand{\mathbf{m}}{\mathbf{m}} \newcommand{\boldsymbol{\Lambda}}%{\mathbf{N}}{\boldsymbol{\Lambda} \newcommand{D}{D} \newcommand{\mathbf{N}}{\mathbf{N}} \newcommand{\widehat{\cp}}{\widehat{\xi}} \newcommand{\widehat{\cp}}{\widehat{\xi}} \newcommand{\widehat{\cp}}{\widehat{\xi}} \newcommand{\widehat{\cporig}}{\widehat{c}} \newcommand{q}{q} \newcommand{\widehat{q}}{\widehat{q}} \newcommand{G}{G} \newcommand{G}{G} \newcommand{\accentset{\circ}{W}}{\accentset{\circ}{W}} \newcommand{G}{G} \newcommand{\delta}{\delta} \newcommand{f}{f} \newcommand{g}{g} \newcommand{\Sigma}{\Sigma} \newcommand{\widehat{\Sigma}}{\widehat{\Sigma}} \newcommand{\eta}{\eta} \newcommand{\eps}{\vartau} \newcommand{\beta}{\beta} \newcommand{MOSUM}{MOSUM} \newcommand{\textcolor{white}{a}}{\textcolor{white}{a}} \newcommand{\zentrierenalt}[1]{\vcenter{\hbox{$\displaystyle #1 $}}} \newcommand{\zentrieren}[1]{\vcenter{\hbox{$ \overset{\textcolor{white}{a}}{#1} $}}} \maketitle \begin{center} \begin{minipage}{0.875\textwidth} \begin{center} \textbf{Abstract}\\ \end{center} The segmentation of data into stationary stretches also known as multiple change point problem is important for many applications in time series analysis as well as signal processing. Based on strong invariance principles, we analyse data segmentation methodology using moving sum (MOSUM) statistics for a class of regime-switching multivariate processes where each switch results in a change in the drift. In particular, this framework includes the data segmentation of multivariate partial sum, integrated diffusion and renewal processes even if the distance between change points is sublinear. We study the asymptotic behaviour of the corresponding change point estimators, show consistency and derive the corresponding localisation rates which are minimax optimal in a variety of situations including an unbounded number of changes in Wiener processes with drift. Furthermore, we derive the limit distribution of the change point estimators for local changes -- a result that can in principle be used to derive confidence intervals for the change points. \end{minipage} \end{center} \noindent\textbf{Keywords:} Data segmentation, Change point analysis, moving sum statistics, multivariate processes, invariance principle, regime-switching processes\\\\ \textbf{MSC2020 classification:} 62M99; 62G20, 62H12 \section{Introduction}\label{introduction} The detection and localisation of structural breaks has a long tradition in statistics, dating back to \cite{Page}. Nevertheless, there is still a large maybe even increasing interest in this topic surely also because change point analysis is broadly applicable in a number of fields such as neurophysiology (see \cite{Messer14}), genomics (compare \cite{Olshen}, \cite{NiuZhang}, \cite{LiMunkSieling}, \cite{ChanChen}), finance (\cite{Aggarwal}, \cite{ChoFryzlewicz}), astrophysics (see \cite{FischEckleyFearnhead}) or oceanographics (\cite{Killick10}). A large amount of research deals with the detection of changes in univariate time series in particular changes in the mean (compare \cite{CsorgoHorvath97} for an overview) where recently also applications to continuous time stochastic processes, functional or high-dimensional panel data (see e.g.\ \cite{horvath2014extensions}). However, extensions to the multiple change point problem that aims at segmenting the data into stationary stretches beyond changes in the mean in time series data are much more scarce. Generally, data segmentation methods can roughly be split up in two approaches: The first approach first introduced by \cite{Yao} in the context of i.i.d.\ normally distributed data using the Schwarz' criterion aims at optimizing suitable objective functions. \cite{Kuehn} extended this approach to processes in a setting closely related to the one in this paper albeit only allowing for univariate processes and a finite number of change points. Further approaches include e.~g.\ least-squares (\cite{YaoAu}) or the quasi-likelihood-function (\cite{Braun}). Generally, such approaches are computationally expensive, such that there is another body of work proposing fast algorithms e.g.\ using dynamic programming (\cite{Killick12}, \cite{Maidstone}). A second approach is based on hypothesis testing, where e.g.\ binary segmentation introduced by \cite{Vostrikova} recursively uses tests constructed for the at-most-one-change situation. This arises several problems including the observation that detection power can be poor if the set of change points is unfavourable, such that several extensions have been proposed in the literature such as circular binary segmentation (\cite{Olshen}) or wild binary segmentation (\cite{Fryzlewicz}). \subsection*{Connection to existing work} Another class of test-based methods uses moving sum (MOSUM) statistics which were first introduced by \cite{BauerHackl}. They are particularly useful in the context of localising multiple change points and recently have broadly been used for the detection and the estimation of change points, see e.g.\ \cite{yau2016inference} for changes in autoregressive time series, \cite{EichingerKirch} in a hidden Markov framework and \cite{ChoKirchMeier} as well as \cite{ChoKirch} who proposed a two-stage data segmentation procedure based on multiscale MOSUM\ statistics. This work extends the results of \cite{EichingerKirch} to a more general setting including multivariate mean changes, changes in diffusion as well as in renewal processes. Our results also lays the foundations for the analysis of a two-step procedure as in \cite{ChoKirch}. \cite{Messer14} propose a bottom-up-approach combining several moving-sum statistics to obtain change point estimators in univariate renewal processes. Our work extends these results in several ways: First, \cite{Messer14} do not show consistency of the change point estimators neither do they derive localisation rates, which is one of the main results of this work. Furthermore, in addition to results for MOSUM\ procedures with linear bandwidth (in the sample size) as in \cite{Messer14} we obtain results for sublinear bandwidths allowing in particular to obtain consistent estimators in situations where the distance between change points is sublinear. Additionally, we go beyond the univariate case including some multivariate point processes based on renewal processes in our analysis. Sequential change point methodology for renewal processes has been proposed by~\cite{GutSteinebach02} and \cite{GutSteinebach09}, for diffusion processes by \cite{Mihalache}. We analyse a more general model of regime-switching multivariate processes including multivariate partial sum, renewal as well as diffusion processes. We require the processes to fulfill a multivariate invariance principle, where processes switch (possibly with a number increasing to infinity with increasing sample size) between finitely many regimes with each switch resulting in a change in the drift. A univariate version of that model with at-most-one change point has been considered by \cite{HorvathSteinebach} and \cite{KuehnSteinebach}. A univariate version for finitely many change points has been considered by \cite{Kuehn} where consistency for the number of change points has been shown. Those results are now extended to include MOSUM\ methodology for the estimation of a multiple (possibly unbounded) number of change points in a multivariate setting, where we achieve a minimax optimal separation rate in addition to a minimax optimal localisation rate (for the change point estimators) in case of a bounded number of change points as well as for Wiener processes with drift (see Remark~\ref{Remark_minimax} below). \subsection*{Organization of the material} In Subsection \ref{subsection_model}, we introduce the multiple change point model we consider followed by some examples of processes fulfilling the model in Subsection \ref{subsection_examples}. In Section \ref{section_procedures}, we describe how to estimate change points based on MOSUM\ statistics: First, we introduce the MOSUM\ statistics in \ref{subsection_mosum_statistics}, before presenting the estimators for the structural breaks in \ref{subsection_cp_estimators}. In \ref{subsection_threshold} we derive some asymptotic results for the MOSUM\ statistics that are required for threshold selection and can also be used in a testing context. In Section \ref{section_consistency} we show that the corresponding data segmentation procedure is consistent. Finally, we derive the localisation rates in addition to the corresponding asymptotic distribution of the change point estimators for local changes. In Section \ref{subsection_simulation}, we present some results from a small simulation study. The proofs can be found in Appendix \ref{appendix}. \section{Multiple change point problem}\label{section_seg_procedure} In this section we introduce the general multiple change model for which we derive the theoretic results. In particular, this model includes changes in multivariate renewal processes as a special case which was the original motivation for this work. \subsection{Model} \label{subsection_model} Consider $P<\infty$ time-continuous $p$-dimensional stochastic processes $\{\mathbf{R}_{t,T}^{(j)}:0\le t\le T\}$ with (unknown) drift $(\boldsymbol{\mu}_T^{(j)}\cdot t)$ and (unknown) covariance $(\boldsymbol{\Sigma}_{j,T}\cdot t)$ fulfilling the following joint invariance principle. The observed process is then assumed to switch between these $P$ processes (states). \begin{Assumption}\label{invariance_principle}\ \\ Denote the joint process by $\mathbf{R}_{t,T}=\left({\mathbf{R}_{t,T}^{(1)}}^{\prime},\ldots,{\mathbf{R}_{t,T}^{(P)}}^{\prime}\right)^{\prime}$ as well the joint drift by $\boldsymbol{\mu}_T=\left({\boldsymbol{\mu}_T^{(1)}}^{\prime},\ldots,{\boldsymbol{\mu}_T^{(P)}}^{\prime}\right)^{\prime}$, where $^{\prime}$ indicates the matrix transpose. For every $ T>0 $ there exist $(p\cdot P)$-dimensional Wiener processes $\mathbf{W}_{t,T}$ with covariance matrix $\boldsymbol{\Sigma}_T$ and \begin{align*} \boldsymbol{\Sigma}_{T}^{(i)}=(\boldsymbol{\Sigma}_T(l,k))_{l,k=p\,(i-1)+1,\ldots,p\,i} \end{align*} with \begin{align*} \|{\boldsymbol{\Sigma}_{T}^{(i)}}\|=O(1),\qquad \|{\boldsymbol{\Sigma}_{T}^{(i)}}^{-1}\|=O(1), \end{align*} such that, possibly after a change of probability space, it holds that for some sequence $\nu_T\to 0$ \begin{align*} \sup_{0\le t\le T}\|\widetilde{\mathbf{R}}_{t,T}-\mathbf{W}_{t,T}\|= \sup_{0\le t\le T}\|\left(\mathbf{R}_{t,T}-\boldsymbol{\mu}_T\,t\right)-\mathbf{W}_{t,T}\|= O_P\left(T^\frac{1}{2}\,\nu_T\right), \end{align*} where $\widetilde{\mathbf{R}}_{t,T}=\mathbf{R}_{t,T}-\boldsymbol{\mu}_T\,t$ denotes the centered process. \end{Assumption} If these $P$ processes are independent, which is a reasonable assumption in a switching context, the joint invariance principle reduces to the validity of an invariance principle for each process. The assumption on the norm of the covariance matrices is equivalent to the smallest eigenvalue of $\boldsymbol{\Sigma}_T^{(i)}$ being bounded in addition to being bounded away from zero (both uniformly in $T$). In many situations, the covariance matrices will not depend on $T$, in which case this assumption is automatically fulfilled under positive definiteness. The convergence rate $\nu_T$ in the invariance principle typically depends on the number of moments that exist. Roughly speaking, the more moments the original process has, the faster $\nu_T$ converges. We now observe a process $\mathbf{Z}_{t,T}$ with increments switching between the above processes at some unknown change points $ 0=c_{0}<c_{1}<\ldots<c_{q_T}<c_{q_T+1}=T$, where $q_T$ can be bounded or unbounded. More precisely, we observe for $c_{\ell}<t\le c_{\ell+1}$ \begin{align} \mathbf{Z}_{t,T}=\left(\mathbf{R}_{t,T}^{(c_{\ell}+1)}-\mathbf{R}_{c_{\ell},T}^{(c_{\ell}+1)}\right)+\sum_{j=1}^{\ell }\left(\mathbf{R}_{c_j,T}^{(c_j)}-\mathbf{R}_{c_{j-1},T}^{(c_j)}\right). \label{eq_model} \end{align} The upper index $^{(c_j)}$ at the process $\mathbf{R}_{\cdot,T}$ indicates (with a slight abuse of notation) the active regime between the $(j-1)$-st and the $j$-th change point, from which the increments come in that stretch. Because we concentrate on the detection of changes in the drift, we need to assume that the drift changes between two neighboring regimes, i.e.\ \begin{align*} \mathbf{d}_{i,T}:=\boldsymbol{\mu}_T^{(c_i+1)}-\boldsymbol{\mu}_T^{(c_i)} \neq 0 \quad \text{for all }i=1,\ldots,q_T, \end{align*} where $\mathbf{d}_{i,T}$ is bounded but we allow for $\mathbf{d}_{i,T}\to 0$ as long as the convergence is slow enough (see Assumption \ref{bandwidth}). For ease of notation we drop the dependency on $T$ for all above quantities except $q_T$ in the following except in situations where it helps clarify the argument. The aim of this paper is to estimate the number and location of the change points and prove consistency of the estimator for the number of change points in addition to deriving localisation rates for the change point estimators. The corresponding univariate model with at most one change was first considered by \cite{HorvathSteinebach} and extended to a gradual change setting by \cite{steinebach2000some}. \cite{KirchSteinebach} prove validity for corresponding permutation tests. Furthermore, \cite{GutSteinebach02} develop sequential change point tests and analyse the corresponding stopping time (\cite{GutSteinebach09}). A related univariate multiple change situation with a bounded number of change points has been considered by \cite{KuehnSteinebach}, who propose to use a Schwarz information criterion for change point estimation. However, this methodology is computationally expensive with quadratic computational complexity, which is one of the reasons why we propose an alternative methodology based on a single-bandwidth moving sum (MOSUM) statistic in order to estimate the change points. We will show that the rescaled change point estimators are consistent and derive the corresponding localisation rates. \subsection{Examples}\label{subsection_examples} In this section, we give three important examples fulfilling the above model assumptions, namely partial sum-processes, renewal processes as well as integrals of diffusion processes including Ornstein-Uhlenbeck and Wiener processes with drift. A detailed analysis of MOSUM\ procedures for detecting changes in (univariate) renewal processes extending the work by ~\cite{Messer14} was the original motivation for this work and is covered by this much broader framework. \subsubsection{Partial-Sum-Processes}\label{sec_partial_sums} This first example extends the classical multiple changes in the mean model: Let $\mathbf{X}^{(i)}_1,\mathbf{X}^{(i)}_2,\ldots$ be a time series with $ \EW{\mathbf{X}^{(i)}_1}=0$ and $\Covmulti{\mathbf{X}^{(i)}_1}=I_p$ and all $i=1,\ldots,P$. Let \begin{align*} \mathbf{R}_{t}^{(i)}=\sum_{j=1}^{\lfloor t\rfloor}\left(\boldsymbol{\mu}^{(i)}+ {\boldsymbol{\Sigma}_{T}^{(i)}}^{1/2}\mathbf{X}^{(i)}_j\right). \end{align*} The corresponding process fulfills Assumption \ref{invariance_principle} in a wide range of situations. For example, \cite{Einmahl} shows the validity in the case that $\mathbf{X}_1, \mathbf{X}_2,\ldots$ with $\mathbf{X}_j=\left(\mathbf{X}^{(1)}_j,\ldots,\mathbf{X}^{(P)}_j \right)^{\prime}$ are i.i.d.~with $ \EW{\|\mathbf{X}_1\|^{2+\delta}}<\infty $ for some $\delta>0$. Additionally, \cite{KuelbsPhilipp} state an invariance principle for mixing random vectors in Theorem 4, additionally there are many corresponding univariate results under many different weak-dependency formulations. For $\mathbf{X}^{(i)}=\mathbf{X}^{(1)}$ (and $\boldsymbol{\Sigma}^{(i)}=\boldsymbol{\Sigma}^{(1)}$) for all $i$, then we are back to the classical multiple mean change problem that has been considered in many papers in particular for the univariate situation, see e.g.~the recent survey papers by \cite{fearnhead2020relating} or \cite{cho2020data}. \subsubsection{Renewal and some related point processes}\label{sec_ex_renewal} The second example aims at finding structural breaks in the rates of renewal and some related point processes: We consider $P$ independent sequences of $p$-dimensional point processes that are related to renewal processes in the following way: For each $i=1,\ldots,P$ we start with $\tilde{p}\ge p$ independent renewal processes $\widetilde{R}_{t,j}^{(i)}$, $j=1,\ldots,\tilde{p}$, from which we derive a $p$-dimensional point process $\mathbf{R}_t^{(i)}=\mathbf{B}^{(i)} \left(\widetilde R_{t,1}^{(i)},\ldots,\widetilde R_{t,\tilde p}^{(i)}\right)^{\prime}$, where $\mathbf{B}^{(i)}$ is a $(p\times\tilde{p})$ - matrix with non-negative integer-valued entries. By Lemma 4.2 in \cite{SteinebachEastwood} Assumption \ref{invariance_principle} is fulfilled for a block-diagonal $\boldsymbol{\Sigma}_T$ with \begin{align*} &\boldsymbol{\Sigma}_T^{(i)}=\mathbf{B}^{(i)}\mathbf{D}\left(\frac{\boldsymbol{\sigma}^2(i)}{\boldsymbol{\mu}^{3}(i)}\right){\mathbf{B}^{(i)}}^{\prime},\\ &\text{with }\mathbf{D}\left(\frac{\boldsymbol{\sigma}^2(i)}{\boldsymbol{\mu}^{3}(i)}\right)=\operatorname{diag}\left(\frac{\sigma_1^2(i)}{\mu_1^{3}(i)},\ldots,\frac{\sigma_{\tilde{p}}^2(i)}{\mu_{\tilde{p}}^{3}(i)}\right), \end{align*} where $\mu_j(i)$ and $\sigma_j^2(i)$ are the mean and variance of the corresponding inter-event times. \cite{SteinebachEastwood} and \cite{Csenki} consider $\tilde{p}=p$ but use inter-event times that are dependent for $j=1,\ldots,p$. In such a situation, the invariance principle in Assumption \ref{invariance_principle} still holds if the intensities are the same across components with $\Sigma_T^{(i)}=\Sigma_{\IET}^{(i)}/\mu_1^3(i)$, where $\Sigma_{\IET}^{(i)}$ is the covariance of the vector of inter-event times -- a setting that we adopt in the simulation study. If the intensities differ, then by \cite{SteinebachEastwood} an invariance principle towards a Gaussian process can still be obtained, but this is no longer a multivariate Wiener process. While each component is a Wiener process, the increments from one component may depend on the past of another. Many of the below results can still be derived in such a situation, however, such a model does not seem to be very realistic for most applications as the stochastic behavior of the increments of one component depends on the lagged behavior of the other components, where the lag increases with time. While a lagged dependence is realistic in many situations, in most situations one would expect this lagged-dependence to be constant across time. \cite{Messer14} consider this model for univariate renewal processes with varying variance. They propose a multiscale procedure based on MOSUM\ statistics related to those we will discuss in the next section using linear bandwidths. In \cite{Messer17}, they extend the procedure to processes with weak dependencies. They show convergence in distribution of the MOSUM\ statistics to functionals of Wiener processes similar to the results that we obtain and analyze the behaviour of the signal term in \cite{Messer172}. However, they have not derived any consistency results for the change point estimators. In this paper, we extend their results to sublinear bandwidths and prove the consistency of the corresponding estimators as well as their localisation rates. \subsubsection{Diffusion processes} Clearly, switching between independent (or components of a multivariate) Brownian motion with drift is included in this framework. Additionally, \cite{Heunis} and \cite{Mihalache} derive invariance principles in the context of diffusion processes including Ornstein-Uhlenbeck processes among others. Let $ \left(\mathbf{X}_t\right)_{t\ge0} $ be a stochastic process in $ \R^N $ satisfying a stochastic differential equation \[ d\mathbf{X}_t=\boldsymbol{\mu}\left(\mathbf{X}_t\right)dt+ \boldsymbol{\Sigma}\left(\mathbf{X}_t\right)d\mathbf{B}_t \] with respect to an $ n $-dimensional standard Wiener process $ \left(\mathbf{B}_t\right)_{t\ge0} $ and let $ \boldsymbol{\mu},\boldsymbol{\Sigma} $ be globally Lipschitz-continuous. Under some conditions on $ f:\R^N\to\R^p $, as given by \cite{Heunis}, relating to $ \boldsymbol{\mu},\boldsymbol{\Sigma} $, which in particular guarantee that the function $f$ applied to the (invariant) diffusion results in a centered process, there exists a $ p $-dimensional Wiener process $ \left(\mathbf{W}_t\right)_{t\ge0} $ and some $ \eta>0 $ such that \[ \left\|\int_0^T f(\mathbf{X}_s)\ ds-\mathbf{W}_T\right\|=O\left(T^{1/2-\eta}\right), \] where $ \left(\mathbf{X}_t\right)_{t\ge0} $ either is a solution to the SDE with fixed starting value $ \mathbf{X}_0=y_0 $ or a strictly stationary solution with respect to an invariant distribution.\\ Furthermore, in the case of a one-dimensional stochastic diffusion process, \cite{Mihalache} showed for some $ L^2 $-functions fulfilling constraints depending on $ \boldsymbol{\mu}, \boldsymbol{\Sigma} $ that there exists a strong invariance principle for the integrals of diffusion processes with a rate of $ O(\left(T\log_2 T\right)^{1/4}\sqrt{\log T}) $. \section{Data segmentation procedure} \label{section_procedures} Now, we are ready to introduce a MOSUM-based data segmentation procedure for stochastic processes following the above model: \subsection{Moving sum statistics} \label{subsection_mosum_statistics} At every change point, the drift of the process that is active to the left of that change point is different from the drift of the process that is active to the right of the change point. Consequently, the increment of the process $\mathbf{R}$ to the left will systematically differ from the one to the right. On the other hand, in a stationary stretch away from any change point both increments will be approximately the same as they are estimating the same drift. It is this observation that gives rise to the following moving sum (MOSUM) statistic that is based on the moving difference of increments with bandwidth $h=h_T$ \begin{align}\label{eq_mosum} \mathbf{M}_t=\mathbf{M}_{t,T,h_T}(\mathbf{Z})&=\frac{1}{\sqrt{2h}}\,\left[\left(\mathbf{Z}_{t+h}-\mathbf{Z}_t\right)-\left( \mathbf{Z}_t-\mathbf{Z}_{t-h} \right)\right]\notag\\ &=\frac{1}{\sqrt{2h}}\,\left(\mathbf{Z}_{t+h}-2\mathbf{Z}_t+\mathbf{Z}_{t-h}\right). \end{align} If there is no change, then this difference will fluctuate around 0. On the other hand close to a change point, this difference will be different from 0. Ideally, the bandwidth should be chosen to be as large as possible (to get a better estimate obtained from a larger 'effective sample size' of the order $h$). On the other hand, the increments should not be contaminated by a second change as this can lead to situations where the change point can no longer be reliably localised by the signal. Indeed, we need the following assumptions on the bandwidth for a change to be detectable: \begin{Assumption}\ \label{bandwidth} For $\nu_T$ as in Assumption~\eqref{invariance_principle} the bandwidth $h<T/2$ fulfills \begin{align*} & \frac{\nu_T^2\,T\,\log T}{h}\to 0. \end{align*} Furthermore, it isolates the $i$-th change point in the sense of \begin{align} & h\le \frac 1 2 \, \Delta_i,\qquad \text{where }\Delta_i=\min(c_{i+1}-c_i,c_i-c_{i-1}). \label{condition_bandwidth} \end{align} Additionally, the signal needs to be large enough to be detectable by this bandwidth, i.e.\ \begin{align} \frac \|\mathbf{d}_i\|^2\,h}{\log\left( \frac{T}{h} \right)}\to\infty.\label{condition_mean_change} \end{align} \end{Assumption} Combining \eqref{condition_bandwidth} and \eqref{condition_mean_change} shows that -- with an appropriate bandwidth $h$ -- changes are detectable as soon as \begin{align}\label{eq_separation} \frac \|\mathbf{d}_i\|^2\,\Delta_i}{\log\left( \frac{T}{\Delta_i}\right) }\to\infty. \end{align} In case of the classical mean change model as in Subsection~\ref{sec_partial_sums} this is known to be the minimax-optimal separation rate that cannot be improved (see Proposition 1 of \cite{AriasCastro}). The assumption on the distance of the first and last change point to the boundary of the process in \eqref{condition_bandwidth} can be relaxed as no boundary effects can occur there. \subsection{Change point estimators} \label{subsection_cp_estimators} The MOSUM\ statistic $\mathbf{M}_t= \mathbf{m}_{t}+ \boldsymbol{\Lambda}}%{\mathbf{N}_t$ as in \eqref{eq_mosum} decomposes into a piecewise linear signal term $ {\mathbf{m}_t=\mathbf{m}_{t,h,T}} $ and a centered noise term $\boldsymbol{\Lambda}}%{\mathbf{N}_t=\boldsymbol{\Lambda}}%{\mathbf{N}_{t,h,T}$ with \begin{align} &{\sqrt{2h}} \,\mathbf{m}_t=\begin{cases} (h-t+c_i)\,\mathbf{d}_i,&\ \text{for }c_i<t\le c_i+h,\\ 0,&\ \text{for }c_i+h<t\le c_{i+1}-h,\\ (h+t-c_{i+1})\,\mathbf{d}_{i+1},&\ \text{for }c_{i+1}-h<t\le c_{i+1}, \end{cases} \label{signal}\\[3mm] & \sqrt{2h}\;\boldsymbol{\Lambda}}%{\mathbf{N}_t= \sqrt{2h}\;\boldsymbol{\Lambda}}%{\mathbf{N}_t \label{noise}(\widetilde{\mathbf{R}}) \\* &\quad =\begin{cases} \widetilde{\mathbf{R}}_{t+h}^{(c_{i+1})}-2\widetilde{\mathbf{R}}_{t}^{(c_{i+1})}+\widetilde{\mathbf{R}}_{c_i}^{(c_{i+1})} -\widetilde{\mathbf{R}}_{c_i}^{(c_{i})}+\widetilde{\mathbf{R}}_{t-h}^{(c_{i})},&\ \text{for }c_i<t\le c_i+h,\\ \widetilde{\mathbf{R}}_{t+h}^{(c_{i+1})}-2\widetilde{\mathbf{R}}_{t}^{(c_{i+1})}+\widetilde{\mathbf{R}}_{t-h}^{(c_{i+1})}, &\ \text{for }c_i+h<t\le c_{i+1}-h,\\ \widetilde{\mathbf{R}}_{t+h}^{(c_{i+2})}-\widetilde{\mathbf{R}}_{c_{i+1}}^{(c_{i+2})}+\widetilde{\mathbf{R}}_{c_{i+1}}^{(c_{i+1})}-2\widetilde{\mathbf{R}}_{t}^{(c_{i+1})}+\widetilde{\mathbf{R}}_{t-h}^{(c_{i+1})}, &\ \text{for }c_{i+1}-h<t\le c_{i+1}, \end{cases} \notag \end{align} where $ \widetilde{\mathbf{R}}_t:=\mathbf{R}_t-t\boldsymbol{\mu} $ for $ i=0,\ldots,q_T $ and the upper index $c_{j}$ denotes the active regime between the $(j-1)$st and $j$-th change point (with a slight abuse of notation).\\ The signal term is a piecewise linear function that takes its extrema at the change points and is 0 outside $h$-intervals around the change points. Additionally, the noise term is asymptotically negligible compared to the signal term (see Theorem \ref{theorem_threshold} for the corresponding theoretic statement and Figure \ref{figure_signal_noise} for an illustrative example). \begin{figure} \includegraphics*[scale=0.44]{Signal_noise2.pdf} \caption{Univariate MOSUM\ statistic with $T=100,\, 1\,000,\, 10\,000$ (from left to right), where the noise term (fluctuating around the signal) becomes smaller and smaller relative to the signal term.}\label{figure_signal_noise} \end{figure} \begin{figure}[t] \caption{In the upper panel, the observed event times of a univariate renewal process with 3 change points (i.e.\ 4 stationary segments) are displayed (where the plot needs to be read like a text: It starts in the upper row on the left, then continues in the first row and jumps to the second row and so on). The grey and white regions mark the estimated segmentation of the data while the red intervals mark the true segmentation.\\ In the lower panel, the corresponding MOSUM\ statistic with (relative) bandwidth $h/T=0.07$ is displayed. The grey areas are the regions where the threshold ($\alpha=0.05$ as in Remark~\ref{rem_choice_threshold}) is exceeded (in absolute value). The blue solid lines indicate the change point estimates obtained as local extrema that fall within the grey area (making them \emph{significant}). The true change points are indicated by the red dashed lines. }\label{figure_rp_example} \includegraphics*[width=\textwidth]{RP_example13.pdf} \end{figure} These observations motivate the following data segmentation procedure, that considers local extrema that are big enough (in absolute value) as change point estimators: To this end, a suitable threshold $\beta=\beta_{h,T}$ is needed to define \emph{significant} time points, where a point $t^*$ is \emph{significant} if \begin{align}\label{eq_mosum_signif} \mathbf{M}_{t^*}^{\prime}\,\widehat{\mathbf{A}}^{-1}_{t^*}\,\mathbf{M}_{t^*}\ge\beta \end{align} with $\widehat{\mathbf{A}}_{t^*}$ is some symmetric positive definite matrix that may depend on the data fulfilling \begin{Assumption} \label{variance_estimator} \begin{align*} &\sup_{h\le t\le T-h}\left\|\widehat{\mathbf{A}}_{t,T}^{-1}\right\|=O_P\left(1\right),\quad \sup_{i=1,\ldots,q_T}\sup_{|t-c_i|\le h}\left\|\widehat{\mathbf{A}}_{t,T}\right\|=O_P(1). \end{align*} \end{Assumption} A good (non data-driven) choice fulfilling this assumption is given by \begin{align}\label{eq_sigma_t} \boldsymbol{\Sigma}_{t}=\boldsymbol{\Sigma}_{t,T}=\boldsymbol{\Sigma}_T^{(c_{i})} \end{align} for $c_{i-1}<t\le c_{i}$, which guarantees scale-invariance of the procedure and allows for nicely interpretable thresholds (see Section~\ref{subsection_threshold}). The latter remains true for estimators as long as they fulfill \begin{align} \sup_{i=1,\ldots,q_T}\sup_{|t-c_i|> h}\left\|\widehat{\boldsymbol{\Sigma}}_{t,T}^{-1/2}-\boldsymbol{\Sigma}_t^{-1/2}\right\|=o_P\left(\left(\log \frac{T}{h}\right)^{-1}\right) \label{variance_estimator2} \end{align} in addition to the above boundedness assumptions. In particular, this permits local estimators that are consistent only away from change points but contaminated by the change in a local environment thereof. The latter is typically the case for covariance estimators, think e.g.\ of the sample variance contaminated by a change point. In order to not reduce detection power in small samples, it is beneficial if the estimator is additionally consistent directly at the change point, which is also achievable (see e.g.\ \cite{EichingerKirch}). The choice of the threshold $\beta$ will be discussed in the next section, where we can make use of asymptotic considerations in the no-change situation. Typically, there are intervals of significant points (due to the continuity of the signal) such that only local extrema of such intervals actually indicate a change point. To define what a local extremum is, we require a tuning parameter $0<\eta <1 $. This parameter defines the locality requirement on the extremum, where a point $t^*$ is a local extremum if it maximizes the absolute MOSUM\ statistic within its $\eta h$-environment, i.e.\ if \begin{align} t^*=\min\left\{ \argmaxx{t^*-\eta h\le t\le t^*+\eta h}\|\mathbf{M}_t\|. \right\} \label{cp_estimator} \end{align} The threshold $\beta$ distinguishes between \emph{significant} and \emph{spurious} local extrema that are purely associated with the noise term. The set of all significant local extrema is the set of change point estimators with its cardinality an estimator for the number of the change points. Figure~\ref{figure_rp_example} shows an example illustrating these ideas: Away from the change points the MOSUM\ statistic fluctuates around 0 (within the white area that is beneath the threshold in absolute value) while it falls within the grey area close to the change points -- making corresponding local extrema significant. Furthermore, the statistic does not need to return to the white area in order to have all changes estimated, as can be seen between the first and second change point. This is one of the major advantages of the $\eta$-criterion based on \emph{significant} local maxima as described here (in comparison to the $\epsilon$-criterion originally investigated by \cite{EichingerKirch} in the context of mean changes, see also the discussion in \cite{ChoKirchMeier}). Nevertheless, results for the $\epsilon$-criterion can be obtained along the lines of our proofs below. \subsection{Threshold selection}\label{subsection_threshold} As pointed out above we need to choose a threshold $\beta=\beta_{h,T}$ that can distinguish between significant and spurious local extrema. The following theorem gives the magnitudes of signal as well as noise terms: \begin{Theorem}\label{theorem_threshold}\ Let the Assumptions~\ref{invariance_principle}, \ref{bandwidth} and \ref{variance_estimator} hold. \begin{enumerate}[(a)] \item For the signal $\mathbf{m}_t$ with $c_i-h<t<c_i+h$, it holds \begin{align*} \mathbf{m}_t^{\prime}\widehat{\mathbf{A}}_t^{-1}\mathbf{m}_t \ge \frac{1}{2\|\widehat{\mathbf{A}}_t\|}\frac{(h-\abs{t-c_i})^2}{h}\|\mathbf{d}_i\|^2. \end{align*} At other time points the noise term is equal to zero. \item For the noise term it holds for $q_T=0$, i.e.\ in the no-change situation \begin{enumerate}[(i)] \item for a linear bandwidth $h=\gamma T$ with $0<\gamma<1/2$ \begin{align*} &\sup_{\gamma T \le t\le T-\gamma t} \boldsymbol{\Lambda}}%{\mathbf{N}_{t}^{\prime}\boldsymbol{\Sigma}_{T}^{-1}\boldsymbol{\Lambda}}%{\mathbf{N}_{t}\\ &\qquad\overset{\mathcal{D}}{\longrightarrow} \sup_{\gamma\le s\le 1-\gamma}\frac{1}{2\gamma}\left({\mathbf{B}}_{s+\gamma}-2{\mathbf{B}}_s+{\mathbf{B}}_{s-\gamma}\right)^{\prime}\left({\mathbf{B}}_{s+\gamma}-2{\mathbf{B}}_s+{\mathbf{B}}_{s-\gamma}\right), \end{align*} where ${\mathbf{B}} $ denotes a multivariate standard Wiener process.\\ In particular, the squared noise term is of order $O_P(1)$ in this case. \item for a sublinear bandwidth $h/T\to 0$ but Assumption \ref{bandwidth} fulfilled, it holds that \begin{align*} a\left(\frac{T}{h}\right)\supp{h\le t\le T-h}\sqrt{\boldsymbol{\Lambda}}%{\mathbf{N}_t^{\prime}\boldsymbol{\Sigma}_T^{-1}\boldsymbol{\Lambda}}%{\mathbf{N}_t }-b\left(\frac{T}{h}\right)\overset{\mathcal{D}}{\longrightarrow} E, \end{align*} where $ E $ follows a Gumbel distribution with $ \Prob{E\le x}=e^{-2e^{-x}} $ and \begin{align*} a(x)=&\ \sqrt{2\log x}\\ b(x)=&\ 2\log x+\frac{p}{2}\log\log x+\log\frac{3}{2}-\log\Gamma\left(\frac{p}{2}\right). \end{align*} In particular, the above squared noise term is of order $O_P\left( \log(T/h) \right)$ in this case. \end{enumerate} The assertions remain true if an estimator for the covariance is used fulfilling \eqref{variance_estimator2} uniformly over all $h\le t\le T-h$. \item In the situation of multiple change points, it holds that \begin{align*} \sup_{h \le t\le T-h} \|\boldsymbol{\Lambda}}%{\mathbf{N}_t\|=&\ O_P(\sqrt{\log(T/h)}). \end{align*} \end{enumerate} \end{Theorem} In order to obtain consistent estimators, on the one hand, the threshold needs to be asymptotically negligible compared to the squared signal term as in Theorem~\ref{theorem_threshold} (a). This guarantees that every change is detected with asymptotic probability 1. On the other hand, the threshold needs to grow faster than the squared noise term in Theorem~\ref{theorem_threshold} (c) so that false positives occur with asymptotic probability 0. Hence, both conditions are fulfilled under the following assumption: \begin{Assumption}\label{threshold} The threshold fulfills: \begin{align*} \frac{\beta_{h,T}}{h_T\ \min\limits_{i=1,\ldots,q_T}\|\mathbf{d}_i\|^2}&\ \to 0,\qquad \frac{\log\frac{T}{h_T}}{\beta_{h,T}}\ \to 0 \qquad (T\to \infty). \end{align*} \end{Assumption} The following remark introduces a threshold that has a nice interpretation in connection with change point testing: \begin{Remark}\label{rem_choice_threshold} A common choice for the threshold is obtained as the asymptotic $\alpha_T$-quantile obtained from Theorem~\ref{theorem_threshold} (b) for some sequence $\alpha_T\to 0$. In the simulation study in Section~\ref{subsection_simulation} we use this threshold with $\alpha_T=0.05$. Using the asymptotic $\alpha$-quantile (from the no-change situation) guarantees that all change point estimators are significant at a global level $\alpha$, where significant is meant in the usual testing sense. This gives this choice a nice interpretability. In fact, Theorem~\ref{theorem_threshold} shows that such a threshold with a constant sequence $\alpha$ yields an asymptotic test at level $\alpha$ which has asymptotic power one by Theorem~\ref{theorem_consistency}. Nevertheless, often, tests designed for the at-most-one-change as in \cite{HuskovaSteinebach00}, \cite{HuskovaSteinebach02} have a better power, but are not as good at localising change points (see Figure~1 in \cite{cho2020data} for an illustration). \end{Remark} \section{Consistency of the segmentation procedure}\label{section_consistency} In this section, we will show consistency of the above segmentation procedure for both the estimators of the number and locations of the change points. Furthermore, we derive localisation rates for the estimators of the locations of the change points for some special cases showing that they cannot be improved in general. This is complemented by the observations that these localisation rates are indeed minimax-optimal if the number of change points is bounded in addition to observing Wiener processes with drift. Otherwise the generic rates that are obtained based solely on the invariance principle will not be tight in the sense that the proposed procedure can provide better rates than suggested by the invariance principle. The following theorem shows that the change point estimators defined in \eqref{cp_estimator} are consistent for the number and locations of the change points. \begin{Theorem}\label{theorem_consistency} Let Assumptions \ref{invariance_principle}, \ref{bandwidth} -- \ref{threshold} hold. Let $ 0<\hat{c}_1<\ldots<\hat{c}_{\hat{q}_T} $ be the change point estimators of type \eqref{cp_estimator}. Then for any $\tau>0$ it holds \begin{align*} \lim_{T\to\infty}\Prob{\max_{i=1,\ldots,\min(\hat{q}_T,q_T)}\left|\hat{c}_i-c_i\right|\le \tau h, \hat{q}_T=q_T}=\ 1. \end{align*} \end{Theorem} The theorem shows in particular that the number of change points is estimated consistently. For the linear bandwidth we additionally get consistency of the change point locations in rescaled time, while for the sublinear bandwidths we already get a convergence rate of $h/T$ towards the rescaled change points. Under the following stronger assumptions, the localisation rates can be further improved: \begin{Assumption}\label{Hajek_Renyi}\begin{enumerate}[(a)] \item It holds for any of the centered processes $\widetilde{\mathbf{R}}^{(j)}$ as in \eqref{noise} and any value $\theta_i=\theta_{i,T}$ (which will be $c_i$ or $c_i\pm h$ when the assumption is applied) for any sequence $D_T\ge 1$ (bounded or unbounded) \begin{align*} \sup_{\frac{D_T}{\|\mathbf{d}_i\|^2}\le s \le h} \frac{\sqrt{D_T} \left\|\widetilde{\mathbf{R}}_{\theta_i}^{(j)}-\widetilde{\mathbf{R}}_{\theta_i\pm s}^{(j)}\right\|}{s\left\|\mathbf{d}_i\right\|}=O_P(\omega_T). \end{align*} \item Let now the upper index $\theta_i$ denote the active stretch in the stationary segment $(\theta_i,\theta_i+s)$ respectively $(\theta_i-s,\theta_i)$. Then, it holds for any sequence $D_T>0$ \begin{align*} \max_{i=1,\ldots,q_T} \sup_{\frac{D_T}{\|\mathbf{d}_i\|^2}\le s \le h} \frac{\sqrt{D_T} \left\|\widetilde{\mathbf{R}}_{\theta_i}^{(\theta_i)}-\widetilde{\mathbf{R}}_{\theta_i\pm s}^{(\theta_i)}\right\|}{s\left\|\mathbf{d}_i\right\|}=O_P(\tilde{\omega}_T). \end{align*} \end{enumerate} \end{Assumption} The localisation rates of the MOSUM\ procedure are determined by the rates $\omega_n,\tilde{\omega}_n$ which need to be derived for each example separately (at least for the tight ones). In the context of partial sum processes these results are well known. For example, the suprema in (a) are stochastically bounded by the H\'aj\'ek-R\'enyi inequality which has been shown for partial sum processes even with weakly dependent errors. In that context, the assertion in (b) is fulfilled with a polynomial rate in $q_T$ (see \cite{ChoKirch}, Proposition 2.1 (c)(ii)). \begin{Remark}\label{rem_rates} \begin{enumerate}[(a)] \item For Wiener processes with drift $\omega_T=1$ and $\tilde{\omega}_T=\sqrt{\log(q_T)}$ (see Proposition~\ref{prop_WP_rates} below). \item By the invariance principle in Assumption~\ref{invariance_principle}, all rates are clearly dominated by $T^{1/2}\nu_T$. However, this is often far too liberal a bound (see Proposition 2.1 in \cite{ChoKirch} for some tight bounds in case of partial sum processes). \item Often, for each regime there exist forward and backwards invariance principles from some arbitrary starting value $\theta_i$. This is the case for partial sum processes and for (backward and forward) Markov processes due to the Markov property. For renewal processes, this can be shown along the lines of the original proof for the invariance principle (\cite{CsorgoHorvathSteinebach}) because the time to the next (previous) event is asymptotically negligible; see also Example 1.2 in \cite{KuehnSteinebach}). In this case, the H\'aj\'ek-R\'enyi results for Wiener processes carry over (see Proposition~\ref{prop_WP_rates}) to the different processes underlying each regime, resulting in $\omega_T=1$. For the situation with a bounded number of change points this carries over to $\tilde{\omega}_T$. \end{enumerate} \end{Remark} \begin{Theorem}\label{theorem_convergence_rate}\ \\ Let Assumptions \ref{invariance_principle}, \ref{bandwidth} -- \ref{threshold} in addition to \ref{Hajek_Renyi} hold. For $\hat{q}_T<q_T$ define $\hat{c}_i=T$ for $i=\hat{q}_T+1,\ldots,q_T$. \begin{enumerate}[(a)] \item For a single change point estimator the following localisation rate holds \[ \left\|\mathbf{d}_i\right\|^2\left|\hat{c}_{i}-c_i\right| =O_P\left(\omega_T^2\right). \] \item The following uniform rate holds true: \[ \max_{i=1,\ldots,q_T}\left\|\mathbf{d}_i\right\|^2\left|\hat{c}_{i}-c_i\right| =O_P\left(\tilde{\omega}_T^2\right). \] \end{enumerate} \end{Theorem} \begin{Remark}[Minimax optimality]\label{Remark_minimax} We have already mentioned beneath \eqref{eq_separation} that the separation rate given there is minimax optimal (see Proposition 1 of \cite{AriasCastro}). Minimax optimal localisation rates (derived in the context of changes in the mean of univariate time series, which is covered by the partial sum processes in our framework) are known for a few special cases: First, the minimax optimal localisation rate for a single change point and in extension also for a bounded number of change points is given by $\omega_T=1$ in the above notation (see e.g.\ Lemma 2 in \cite{wang2020univariate}). In particular this shows that our procedures achieves the minimax optimality in case of a bounded number of change points under weak assumptions (as pointed out in Remark~\ref{rem_rates} (c)). Secondly, the optimal localisation rate for unbounded change points under sub-Gaussianity (attained for partial sum process of i.i.d.\ errors) is given by $\tilde{\omega_T}=\sqrt{\log T}$ (see Proposition 6 in \cite{Verzelenetal} and Proposition 2.3 in \cite{ChoKirch}). Indeed, we match this rate for Wiener processes with drift. \end{Remark} The following theorem derives the limit distribution of the change point estimators for local changes which shows in particular that the rates are tight. In principle, this result can be used to obtain asymptotically valid confidence intervals for the change point locations. In case of fixed changes, the limit distribution depends on the underlying distribution of the original process (see \cite{AntochHuskova_fixed} for the case of partial sum processes), where the proof can be done along the same lines. We need the following assumption: \begin{Assumption}\label{ass_cp_distr} Let $\mathbf{d}_i=\mathbf{d}_{i,T}=\|\mathbf{d}_i\| \mathbf{u}_i + o(\|\mathbf{d}_i\|)$ with $\|\mathbf{u}_i\|=1$ and $\|\mathbf{d}_{i,T}\|\to 0$. Assume that $\mathbf{Y}^{(j)}_s=\mathbf{Y}^{(j)}_s(c_i,D)$ with \begin{align*} & \mathbf{Y}^{(1)}_s=\widetilde{\mathbf{R}}^{(c_i)}_{c_i-h+\frac{s-D}{\|d_i\|^2}}-\widetilde{\mathbf{R}}^{(c_i)}_{c_i-h-\frac{D}{\|d_i\|^2}},\\ & \mathbf{Y}^{(21)}_s=\widetilde{\mathbf{R}}^{(c_i)}_{c_i+\frac{s-D}{\|d_i\|^2}}-\widetilde{\mathbf{R}}^{(c_i)}_{c_i-\frac{D}{\|d_i\|^2}},\qquad \mathbf{Y}^{(22)}_s=\widetilde{\mathbf{R}}^{(c_{i+1})}_{c_i+\frac{s-D}{\|d_i\|^2}}-\widetilde{\mathbf{R}}^{(c_{i+1})}_{c_i-\frac{D}{\|d_i\|^2}},\\ & \mathbf{Y}^{(3)}_s=\widetilde{\mathbf{R}}^{(c_{i+1})}_{c_i+h+\frac{s-D}{\|d_i\|^2}}-\widetilde{\mathbf{R}}^{(c_{i+1})}_{c_i+h-\frac{D}{\|d_i\|^2}} \end{align*} fulfill the following multivariate functional central limit theorem for any constant $D>0$ in an appropriate space equipped with the supremum norm \begin{align*} \left\{\|\mathbf{d}_i\|\,(\mathbf{Y}^{(1)}_s,\mathbf{Y}^{(21)}_s,\mathbf{Y}^{(22)}_s,\mathbf{Y}^{(3)}_s)^{\prime}:0\le s\le 2D\right\}\overset{w}{\longrightarrow}\left\{\widetilde{\mathbf{W}}_s:0\le s\le 2D\right\}, \end{align*} where $\widetilde{\mathbf{W}}$ is a Wiener process with covariance matrix $\boldsymbol{\Xi}$ (not depending on $D$). For $-D\le t\le D$ denote $\mathbf{W}_t=(\mathbf{W}^{(1)}_t,\mathbf{W}^{(21)}_t,\mathbf{W}^{(22)}_t,\mathbf{W}^{(3)}_t)^{\prime}=\widetilde{\mathbf{W}}_{D+t}-\widetilde{\mathbf{W}}_D$. \end{Assumption} By Assumption~\ref{bandwidth} it holds $h\|\mathbf{d}_i\|^2\to \infty$, such that the distance $h-\frac{2D}{\|d_i\|^2}$ between $\mathbf{Y}^{(1)}$ and $\mathbf{Y}^{(2j)}$ (resp.\ between $\mathbf{Y}^{(2j)}$ and $\mathbf{Y}^{(3)}$) diverges to infinity. As such for processes with independent increments the processes $\mathbf{Y}^{(1)}$, $(\mathbf{Y}^{(21)},\mathbf{Y}^{(22)})^{\prime}$, $\mathbf{Y}^{(3)}$ are independent for $T$ large enough. Additionally, under weak assumptions such as mixing conditions this independence still holds asymptotically in the sense that $\mathbf{W}^{(1)}$, $(\mathbf{W}^{(21)},\mathbf{W}^{(22)})^{\prime}$, $\mathbf{W}^{(3)}$ are independent. Functional central limit theorems for these processes follow from invariance principles as in Assumption~\ref{invariance_principle} with $\boldsymbol{\Sigma}_T\to \boldsymbol{\Sigma}$ as long as such invariance principles still hold with an arbitrary (moving) starting value, which is typically the case (see also Remark~\ref{rem_rates} (c)). As such, it typically holds that $\boldsymbol{\Xi}^{(1)}=\boldsymbol{\Xi}^{(21)}=\boldsymbol{\Sigma}^{(c_i)}$ and $\boldsymbol{\Xi}^{(3)}=\boldsymbol{\Xi}^{(22)}=\boldsymbol{\Sigma}^{(c_{i+1})}$ where $\boldsymbol{\Xi}^{j}=\operatorname{Cov}(\mathbf{W}^{(j)}_1)$ and $\boldsymbol{\Sigma}^{(c_i)}$ is the covariance matrix associated with the regime between the $(i-1)$st and $i$th change point. The following theorem gives the asymptotic distribution for the change point estimators in case of local change points. \begin{Theorem}\label{limit_distribution}\ \\ Let Assumptions \ref{invariance_principle}, \ref{bandwidth} -- \ref{threshold}, \ref{Hajek_Renyi} (a) with $\omega_T=1$ and \ref{ass_cp_distr} hold. For $\hat{q}_T<q_T$ define $\hat{c}_i=T$ for $i=\hat{q}_T+1,\ldots,q_T$. Let \begin{align*} \Psi_t^{(i)}:=-\abs{t}+\begin{cases} \mathbf{u}_i^{\prime}\mathbf{W}_{t}^{(1)}-2\,\mathbf{u}_i^{\prime}\mathbf{W}_{t}^{(21)}+ \mathbf{u}_i^{\prime}\mathbf{W}_t^{(3)},&\ t<0\\ \mathbf{u}_i^{\prime} \mathbf{W}_{t}^{(1)}-2\,\mathbf{u}_i^{\prime}\mathbf{W}_{t}^{(22)}+\mathbf{u}_i^{\prime}\mathbf{W}_t^{(3)},&\ t\ge 0. \end{cases} \end{align*} Then, for all $ i=1,\ldots,q_T, $ it holds that for $T\to\infty$ \[ \left\|\mathbf{d}_i\right\|^2\left(\hat{c}_{i}-c_i\right)\overset{\mathcal{D}}{\longrightarrow} \argmax\geschweift{\Psi_t^{(i)}\Big| t\in\R} \] If there is a fixed number of changes $q_T=q$ with $q$ fixed and a functional central limit theorem as in Assumption~\ref{ass_cp_distr} holds jointly for all $q$ change points, then the result also holds jointly. \end{Theorem} Due to the Markov property of Wiener processes, $\{\Psi_t^{(i)}:t\ge 0\}$ is independent of $\{\Psi_t^{(i)}:t\le 0\}$. \begin{Remark} \begin{enumerate}[(a)] \item If $\mathbf{W}^{(1)}$, $(\mathbf{W}^{(21)},\mathbf{W}^{(22)})^{\prime}$, $\mathbf{W}^{(3)}$ are independent which is typically the case (see discussion beneath Assumption~\ref{ass_cp_distr}), then $\Psi_t^{(i)}$ simplifies to \begin{align*} \Psi_t^{(i)}:=-\abs{t}+\begin{cases} \sqrt{\sigma^2_{(1)}+4\,\sigma^2_{(21)}+ \sigma^2_{(3)}}\,B_t,&\ t<0\\ \sqrt{\sigma^2_{(1)}+4\, \sigma^2_{(22)}+\sigma^2_{(3)}}\,B_t,&\ t\ge 0, \end{cases} \end{align*} where $B$ is a (univariate) standard Wiener process and $\sigma_{(j)}^2=\mathbf{u}_i^{\prime}\boldsymbol{\Xi}^{(j)}\mathbf{u}_i$. Usually (see discussion beneath Assumption~\ref{ass_cp_distr}) $\sigma_{(21)}=\sigma_{(1)}$ and $\sigma_{(22)}=\sigma_{(3)}$ further simplifying the expression. For some examples such as partial sum processes it holds $\boldsymbol{\Sigma}_t=\boldsymbol{\Sigma}$ for all $t$, such that all $\sigma_{(j)}$ coincide. In this case this further simplifies to \begin{align*} \Psi_t^{(i)}:=-\abs{t}+\sqrt{6}\, \sigma_{(1)}\,B_{t}. \end{align*} For univariate partial sum processes this result has already been obtained in Theorem 3.3 of \cite{EichingerKirch}. However, the assumption of $\boldsymbol{\Sigma}_t=\boldsymbol{\Sigma}$ is typically not fulfilled for renewal processes because the covariance depends on the changing intensity of the process. \item If $\mathbf{W}^{(1)}$, $(\mathbf{W}^{(21)},\mathbf{W}^{(22)})^{\prime}$, $\mathbf{W}^{(3)}$ are independent and $\mathbf{M}_t$ in \eqref{cp_estimator} is replaced by $\boldsymbol{\Sigma}_t^{-1/2}\mathbf{M}_t$, then the Wiener processes $\mathbf{W}^{(j)}$ are standard Wiener processes, such that $\Psi_t^{(i)}$ simplifies to \begin{align*} \Psi_t^{(i)}:=-\abs{t}+\sqrt{6}\, B_{t}. \end{align*} This shows that in this case the limit distribution of $\hat{c}_{i}-c_i$ does only depend on the magnitude of the change $\mathbf{d}_i$ but not on its direction $\mathbf{u}_i$. Statistically, however, this is difficult to achieve as it requires a uniformly (in $t$) consistent estimator for the usually unknown covariance matrices $\boldsymbol{\Sigma}_t$. \end{enumerate} \end{Remark} \section{Simulation study}\label{subsection_simulation} In this section, we illustrate the performance of our procedure for multivariate renewal processes by means of a simulation study. Related simulations in addition to a variety of data examples for partial sum processes have been conducted by \cite{EichingerKirch,ChoKirchMeier} and for univariate renewal processes by \cite{Messer14,Messer17}. More precisely, we analyse three-dimensional renewal processes with $T=1600$, where the increments of the inter-event times for each component are $ \Gamma- $distributed with intensity changes at 250, 500, 900 and 1150, where the expected time $\mu$ between events is given by $1.3$, $0.9$, $0.6$, $0.8$ and $1.3$. We use a bandwidth of $ h=120$ and the parameter $\eta=0.75$. Smaller values of $\eta$ as suggested by \cite{ChoKirchMeier} for partial sum processes tend to produce duplicate change point estimators by having two or more significant local maxima for each change point if the variance is too large. For a single-bandwidth MOSUM\ procedure as suggested here, this should be avoided but can be relaxed if a post-processing procedure is applied as e.g.\ by \cite{ChoKirch} for partial sum processes. In contrast to partial sum processes, it is natural for renewal processes that the variances change with the intensity, therefore we consider the following three scenarios: (i) standard deviations of constant value 0.7 (referred to as {\texttt{constvar}}), (ii) standard deviations being $ 5/6 \mu $ (referred to as {\texttt{smallvar}}) and (iii) multivariate Poisson processes (referred to as {\texttt{Poisson}}). We consider both the case of independence and dependence between the three components. In the latter case, we generate for each regime $i$ an independent (in time) sequence of $ \Gamma- $distributed inter-event-times $Y_{j}=Y_{j}^{(i)}$, $j=1,2,3$, with a correlation of $ 0.2 $ (for all pairs) as $ Y_{j}=X_{j}+X_{4}$, where $X_j\sim\Gamma(s,\lambda) $ for $j=1,2,3$ and $X_{4}\sim\Gamma(s/4,\lambda) $ for appropriate values of $s$ and $\lambda$ (resulting in the above intensities and standard deviations for each regime). \begin{table}[t] \begin{subtable}[h]{\textwidth} \caption{{\texttt{constvar}}: Constant standard deviation of $0.7$.} \begin{tabular}{c||c|c|c|c|c|c} Change point at& 250 & 500 & 900 & 1150& spurious & duplicate \\ \hline\hline independent, estimator (A) & 0.9992 & 0.9985 & 0.9253 & 0.9998 & 0.0243 & 0.0035\\ independent, estimator (B) & 0.9962 & 0.9727 & 0.6149 & 0.9998 & 0.0033 & 0.0003\\ \hline dependent, estimator (A) & 0.9966 & 0.9959 & 0.9052 & 1 & 0.0326 & 0.0030\\ dependent, estimator (B) & 0.9879 & 0.9551 & 0.6245 & 0.9993 & 0.0072 & 0.0004\\ dependent, estimator (C) & 0.9439 & 0.8360 & 0.3534 & 0.9975 & 0.0049 & 0.0004\\ \end{tabular} \vspace{3mm} \label{Table_constvar} \end{subtable} \begin{subtable}[h]{\textwidth} \caption{{\texttt{smallvar}}: Standard deviation of $ 5/6 $ the expected time between events.} \begin{tabular}{c||c|c|c|c|c|c} Change point at & 250 & 500 & 900 & 1150& spurious & duplicate\\ \hline\hline independent, estimator (A) & 0.9790 & 1 & 0.9707 & 1 & 0.0273 & 0.0023\\ independent, estimator (B) & 0.9354 & 1 & 0.9302 & 0.9999 & 0.0038 & 0.0002\\ \hline dependent, estimator (A) & 0.9657 & 0.9999 & 0.9527 & 0.9996 & 0.0347 & 0.0026\\ dependent, estimator (B) & 0.9197 & 0.9982 & 0.9089 & 0.9986 & 0.0071 & 0.0013\\ dependent, estimator (C) & 0.7421 & 0.9882 & 0.7137 & 0.9896 & 0.0043 & 0.0003\\ \end{tabular} \vspace{3mm} \label{Table_smallvar} \end{subtable} \begin{subtable}[h]{\textwidth} \caption{ {\texttt{Poisson}}-distributed inter-event times.} \begin{tabular}{c||c|c|c|c|c|c} Change point at& 250 & 500 & 900 & 1150& spurious & duplicate\\ \hline\hline independent, estimator (A) & 0.8913 & 0.9963 & 0.8615 & 0.9976 & 0.0390 & 0.0042 \\ independent, estimator (B) & 0.7338 & 0.9844 & 0.7174 & 0.9876 & 0.0029 & 0.0009\\ \hline dependent, estimator (A) & 0.8654 & 0.9910 & 0.8331 & 0.9923 & 0.0457 & 0.0047\\ dependent, estimator (B) & 0.7138 & 0.9756 & 0.6961 & 0.9749 & 0.0056 & 0.0012\\ dependent, estimator (C) & 0.4525 & 0.8883 & 0.4217 & 0.8963 & 0.0042 & 0.0001\\ \end{tabular} \vspace{2mm} \label{Table_poisson} \end{subtable} \caption{Detection rates for each change point as well as the average number of spurious and duplicate estimators for different distributions of the inter-event times.} \label{Table_simstudy} \end{table} In the simulations, we use a threshold as in Remark~\ref{rem_choice_threshold} with $\alpha_T=0.05$. By Section~\ref{sec_ex_renewal} and \eqref{eq_sigma_t} it holds that $\boldsymbol{\Sigma}_t=\Covmulti{(Y_1,Y_2,Y_3)^{\prime}}/\EW{Y_1}^3$ while we use the following choices for the matrix $\widehat{\mathbf{A}}_t$ as in \eqref{eq_mosum_signif}: (A) Diagonal matrix with locally estimated variances $\widehat{\boldsymbol{\Sigma}}_t(j,j)$ on the diagonal, $j=1,2,3$, (B) with the true variances $\boldsymbol{\Sigma}_t(j,j)$ on the diagonal and (C) in case of dependent components (non-diagonal) true covariance matrix $\boldsymbol{\Sigma}_t$. While only (A) is of relevance in applications, this allows us to understand the influence of estimating the variance on the procedure. For dependent data, the distinction between (B) and (C) is important for applications, because a good enough estimator (resulting in a reasonable estimator for the inverse) is often not available for the full covariance matrix as in (C) for moderately high or high dimensions, while it is much less problematic to estimate (B). In (A) the variances at location $t$ are estimated as \begin{align} \widehat{\boldsymbol{\Sigma}}_t(j,j)=\min\geschweift{\frac{ \widehat{\sigma}_{j,-}^2(t)}{\widehat{\mu}_{j,-}^3(t)},\frac{ \widehat{\sigma}_{j,+}^2(t)}{\widehat{\mu}_{j,+}^3(t)}}, \label{eq_var_est} \end{align} where $\widehat{\sigma}_{j,\pm}^2(t)$ and $\widehat{\mu}_{j,\pm}(t)$ are the sample variance and sample mean respectively based on the inter-event times of the $j$th-component within the windows $(t-h,t]$ for $'-'$ respectively $(t,t+h]$ for $'+'$. The first and last inter-event times that have been censored by the window are not included. Using the minimum of the left and right local estimators takes into account that the variance can (and typically will) change with the intensity which has already been discussed by \cite{ChoKirchMeier} in the context of partial sum processes. The results of the simulation study can be found in Table \ref{Table_simstudy}, where we consider a change point to be detected if there was an estimator in the interval $ [c_i-h,c_i+h] $. Additional significant local maxima in such an interval are called \emph{duplicate} change point estimators, while additional significant local maxima outside any of these intervals are called \emph{spurious}. The procedure performs well throughout all simulations with high detection rate, few spurious and very few duplicate estimators. The results improve further for smaller variance, in which case the signal-to-noise ratio is better. When the diagonal matrix with the estimated variance is being used, the detection power is larger in all cases than when the true variance is being used. In case of the changes at location 900 this is a substantial improvement, such that the use of this local variance estimator can help boost the signal significantly. This comes at the cost of having an increased but still reasonable amount of spurious and duplicate change point estimators. \begin{figure}[tb] \includegraphics*[width=\textwidth]{Mix.pdf} \caption{MOSUM\ statistics with bandwidths of $ h=30,60,90,120 $ (top to bottom) for a three-dimensional renewal process with \emph{multiscale} change with increasing distance between change points in combination with decreasing magnitude of the changes in intensity. The dashed vertical lines indicate the location of the true changes, while the solid lines indicate the change point estimators. \\In this multiscale situation no single bandwidth can detect all changes: The changes to the left are well estimated by smaller bandwidth, the ones in the middle by medium-sized bandwidths and the one to the right by the largest bandwidth. } \label{figure_mix} \end{figure} This effect stems from using the minimum in \eqref{eq_var_est}, which was introduced to gain detection power if the variance changes with the intensity. Additionally, the use of the true (asymptotic) covariance matrix leads to worse results than only using the corresponding diagonal matrix possibly because the asymptotic covariances do not reflect the small sample (with respect to $h$) covariances well enough. From a statistical perspective this is advantageous because the local estimation of the inverse of a covariance matrix in moderately large or large dimensions is a very hard problem leading to a loss in precision, while the diagonal elements are far less difficult to estimate consistently. In the above situation the changes are \emph{homogeneous} in the sense that the smallest change in intensity is still large enough compared to the smallest distance to neighboring change points (for a detailed definition we refer to \cite{ChoKirch}, Definition 2.1, or \cite{cho2020data}, Definition 2.1). In particular, this guarantees that all changes can be detected with a single bandwidth only. In some applications with \emph{multiscale} signals, where frequent large changes as well as small isolated changes are present, this is no longer the case as Figure \ref{figure_mix} shows. In such cases, several bandwidths need to be used and the obtained candidates pruned down in a second step (see \cite{ChoKirch} for an information criterion based approach for partial sum processes as well as \cite{Messer14} for a bottom-up-approach for renewal processes). Similarly, if the distance to the neighboring change points is unbalanced MOSUM\ procedures with asymmetric bandwidths as suggested by \cite{ChoKirchMeier} may be necessary. \section{Discussion and Outlook} In this paper, we considered a class of multivariate processes that, possibly after a change of probability space fulfill a uniform strong invariance principle. We assumed that the process switches possibly infinitely many times between finitely many regimes, with each switch inducing a change in the drift. This setup includes several important examples, including multivariate partial sum processes, diffusion processes as well as renewal processes. In order to localise these changes, we extended the work of \cite{EichingerKirch} and \cite{Messer14} and proposed a single-bandwidth procedure using MOSUM\ statistics in order to estimate changes, allowing for local changes. We were able to show consistency for the estimators. Further, we were able to derive (uniform) localisation rates in the form of exact convergence rates, which are indeed minimax-optimal.\\ One drawback of the procedure is the use of a single bandwidth. In practice, the identification of the optimal bandwidth turns out to be rather difficult as pointed out e.~g.~by \cite{ChoKirch} and \cite{Messer14}: On the one hand, one wants to choose a large bandwidth in order to have maximum power, while on the other hand, choosing a too large bandwidth may lead to misspecification or nonidentification of changes. Furthermore, as can be seen in the simulation study, in a multiscale change point situation (see Definition~2.1 of \cite{ChoKirch}) no single bandwidth can detect all change points. Therefore, one future topic of interest would be to extend the proposed procedure to a true multiscale setup as in \cite{ChoKirch}. \section*{Acknowledgements} This work was supported by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) - 314838170, GRK 2297 MathCoRe. \printbibliography
\section{Introduction} ACM's consolidated article template, introduced in 2017, provides a consistent \LaTeX\ style for use across ACM publications, and incorporates accessibility and metadata-extraction functionality necessary for future Digital Library endeavors. Numerous ACM and SIG-specific \LaTeX\ templates have been examined, and their unique features incorporated into this single new template. If you are new to publishing with ACM, this document is a valuable guide to the process of preparing your work for publication. If you have published with ACM before, this document provides insight and instruction into more recent changes to the article template. The ``\verb|acmart|'' document class can be used to prepare articles for any ACM publication --- conference or journal, and for any stage of publication, from review to final ``camera-ready'' copy, to the author's own version, with {\itshape very} few changes to the source. \section{Template Overview} As noted in the introduction, the ``\verb|acmart|'' document class can be used to prepare many different kinds of documentation --- a double-blind initial submission of a full-length technical paper, a two-page SIGGRAPH Emerging Technologies abstract, a ``camera-ready'' journal article, a SIGCHI Extended Abstract, and more --- all by selecting the appropriate {\itshape template style} and {\itshape template parameters}. This document will explain the major features of the document class. For further information, the {\itshape \LaTeX\ User's Guide} is available from \url{https://www.acm.org/publications/proceedings-template}. \subsection{Template Styles} The primary parameter given to the ``\verb|acmart|'' document class is the {\itshape template style} which corresponds to the kind of publication or SIG publishing the work. This parameter is enclosed in square brackets and is a part of the {\verb|documentclass|} command: \begin{verbatim} \documentclass[STYLE]{acmart} \end{verbatim} Journals use one of three template styles. All but three ACM journals use the {\verb|acmsmall|} template style: \begin{itemize} \item {\verb|acmsmall|}: The default journal template style. \item {\verb|acmlarge|}: Used by JOCCH and TAP. \item {\verb|acmtog|}: Used by TOG. \end{itemize} The majority of conference proceedings documentation will use the {\verb|acmconf|} template style. \begin{itemize} \item {\verb|acmconf|}: The default proceedings template style. \item{\verb|sigchi|}: Used for SIGCHI conference articles. \item{\verb|sigchi-a|}: Used for SIGCHI ``Extended Abstract'' articles. \item{\verb|sigplan|}: Used for SIGPLAN conference articles. \end{itemize} \subsection{Template Parameters} In addition to specifying the {\itshape template style} to be used in formatting your work, there are a number of {\itshape template parameters} which modify some part of the applied template style. A complete list of these parameters can be found in the {\itshape \LaTeX\ User's Guide.} Frequently-used parameters, or combinations of parameters, include: \begin{itemize} \item {\verb|anonymous,review|}: Suitable for a ``double-blind'' conference submission. Anonymizes the work and includes line numbers. Use with the \verb|\acmSubmissionID| command to print the submission's unique ID on each page of the work. \item{\verb|authorversion|}: Produces a version of the work suitable for posting by the author. \item{\verb|screen|}: Produces colored hyperlinks. \end{itemize} This document uses the following string as the first command in the source file: \begin{verbatim} \documentclass[sigconf]{acmart} \end{verbatim} \section{Modifications} Modifying the template --- including but not limited to: adjusting margins, typeface sizes, line spacing, paragraph and list definitions, and the use of the \verb|\vspace| command to manually adjust the vertical spacing between elements of your work --- is not allowed. {\bfseries Your document will be returned to you for revision if modifications are discovered.} \section{Typefaces} The ``\verb|acmart|'' document class requires the use of the ``Libertine'' typeface family. Your \TeX\ installation should include this set of packages. Please do not substitute other typefaces. The ``\verb|lmodern|'' and ``\verb|ltimes|'' packages should not be used, as they will override the built-in typeface families. \section{Title Information} The title of your work should use capital letters appropriately - \url{https://capitalizemytitle.com/} has useful rules for capitalization. Use the {\verb|title|} command to define the title of your work. If your work has a subtitle, define it with the {\verb|subtitle|} command. Do not insert line breaks in your title. If your title is lengthy, you must define a short version to be used in the page headers, to prevent overlapping text. The \verb|title| command has a ``short title'' parameter: \begin{verbatim} \title[short title]{full title} \end{verbatim} \section{Authors and Affiliations} Each author must be defined separately for accurate metadata identification. Multiple authors may share one affiliation. Authors' names should not be abbreviated; use full first names wherever possible. Include authors' e-mail addresses whenever possible. Grouping authors' names or e-mail addresses, or providing an ``e-mail alias,'' as shown below, is not acceptable: \begin{verbatim} \author{Brooke Aster, David Mehldau} \email{dave,judy,<EMAIL>} \email{<EMAIL>} \end{verbatim} The \verb|authornote| and \verb|authornotemark| commands allow a note to apply to multiple authors --- for example, if the first two authors of an article contributed equally to the work. If your author list is lengthy, you must define a shortened version of the list of authors to be used in the page headers, to prevent overlapping text. The following command should be placed just after the last \verb|\author{}| definition: \begin{verbatim} \renewcommand{\shortauthors}{McCartney, et al.} \end{verbatim} Omitting this command will force the use of a concatenated list of all of the authors' names, which may result in overlapping text in the page headers. The article template's documentation, available at \url{https://www.acm.org/publications/proceedings-template}, has a complete explanation of these commands and tips for their effective use. Note that authors' addresses are mandatory for journal articles. \section{Rights Information} Authors of any work published by ACM will need to complete a rights form. Depending on the kind of work, and the rights management choice made by the author, this may be copyright transfer, permission, license, or an OA (open access) agreement. Regardless of the rights management choice, the author will receive a copy of the completed rights form once it has been submitted. This form contains \LaTeX\ commands that must be copied into the source document. When the document source is compiled, these commands and their parameters add formatted text to several areas of the final document: \begin{itemize} \item the ``ACM Reference Format'' text on the first page. \item the ``rights management'' text on the first page. \item the conference information in the page header(s). \end{itemize} Rights information is unique to the work; if you are preparing several works for an event, make sure to use the correct set of commands with each of the works. The ACM Reference Format text is required for all articles over one page in length, and is optional for one-page articles (abstracts). \section{CCS Concepts and User-Defined Keywords} Two elements of the ``acmart'' document class provide powerful taxonomic tools for you to help readers find your work in an online search. The ACM Computing Classification System --- \url{https://www.acm.org/publications/class-2012} --- is a set of classifiers and concepts that describe the computing discipline. Authors can select entries from this classification system, via \url{https://dl.acm.org/ccs/ccs.cfm}, and generate the commands to be included in the \LaTeX\ source. User-defined keywords are a comma-separated list of words and phrases of the authors' choosing, providing a more flexible way of describing the research being presented. CCS concepts and user-defined keywords are required for for all articles over two pages in length, and are optional for one- and two-page articles (or abstracts). \section{Sectioning Commands} Your work should use standard \LaTeX\ sectioning commands: \verb|section|, \verb|subsection|, \verb|subsubsection|, and \verb|paragraph|. They should be numbered; do not remove the numbering from the commands. Simulating a sectioning command by setting the first word or words of a paragraph in boldface or italicized text is {\bfseries not allowed.} \section{Tables} The ``\verb|acmart|'' document class includes the ``\verb|booktabs|'' package --- \url{https://ctan.org/pkg/booktabs} --- for preparing high-quality tables. Table captions are placed {\itshape above} the table. Because tables cannot be split across pages, the best placement for them is typically the top of the page nearest their initial cite. To ensure this proper ``floating'' placement of tables, use the environment \textbf{table} to enclose the table's contents and the table caption. The contents of the table itself must go in the \textbf{tabular} environment, to be aligned properly in rows and columns, with the desired horizontal and vertical rules. Again, detailed instructions on \textbf{tabular} material are found in the \textit{\LaTeX\ User's Guide}. Immediately following this sentence is the point at which Table~\ref{tab:freq} is included in the input file; compare the placement of the table here with the table in the printed output of this document. \begin{table} \caption{Frequency of Special Characters} \label{tab:freq} \begin{tabular}{ccl} \toprule Non-English or Math&Frequency&Comments\\ \midrule \O & 1 in 1,000& For Swedish names\\ $\pi$ & 1 in 5& Common in math\\ \$ & 4 in 5 & Used in business\\ $\Psi^2_1$ & 1 in 40,000& Unexplained usage\\ \bottomrule \end{tabular} \end{table} To set a wider table, which takes up the whole width of the page's live area, use the environment \textbf{table*} to enclose the table's contents and the table caption. As with a single-column table, this wide table will ``float'' to a location deemed more desirable. Immediately following this sentence is the point at which Table~\ref{tab:commands} is included in the input file; again, it is instructive to compare the placement of the table here with the table in the printed output of this document. \begin{table*} \caption{Some Typical Commands} \label{tab:commands} \begin{tabular}{ccl} \toprule Command &A Number & Comments\\ \midrule \texttt{{\char'134}author} & 100& Author \\ \texttt{{\char'134}table}& 300 & For tables\\ \texttt{{\char'134}table*}& 400& For wider tables\\ \bottomrule \end{tabular} \end{table*} Always use midrule to separate table header rows from data rows, and use it only for this purpose. This enables assistive technologies to recognise table headers and support their users in navigating tables more easily. \section{Math Equations} You may want to display math equations in three distinct styles: inline, numbered or non-numbered display. Each of the three are discussed in the next sections. \subsection{Inline (In-text) Equations} A formula that appears in the running text is called an inline or in-text formula. It is produced by the \textbf{math} environment, which can be invoked with the usual \texttt{{\char'134}begin\,\ldots{\char'134}end} construction or with the short form \texttt{\$\,\ldots\$}. You can use any of the symbols and structures, from $\alpha$ to $\omega$, available in \LaTeX~\cite{Lamport:LaTeX}; this section will simply show a few examples of in-text equations in context. Notice how this equation: \begin{math} \lim_{n\rightarrow \infty}x=0 \end{math}, set here in in-line math style, looks slightly different when set in display style. (See next section). \subsection{Display Equations} A numbered display equation---one set off by vertical space from the text and centered horizontally---is produced by the \textbf{equation} environment. An unnumbered display equation is produced by the \textbf{displaymath} environment. Again, in either environment, you can use any of the symbols and structures available in \LaTeX\@; this section will just give a couple of examples of display equations in context. First, consider the equation, shown as an inline equation above: \begin{equation} \lim_{n\rightarrow \infty}x=0 \end{equation} Notice how it is formatted somewhat differently in the \textbf{displaymath} environment. Now, we'll enter an unnumbered equation: \begin{displaymath} \sum_{i=0}^{\infty} x + 1 \end{displaymath} and follow it with another numbered equation: \begin{equation} \sum_{i=0}^{\infty}x_i=\int_{0}^{\pi+2} f \end{equation} just to demonstrate \LaTeX's able handling of numbering. \section{Figures} The ``\verb|figure|'' environment should be used for figures. One or more images can be placed within a figure. If your figure contains third-party material, you must clearly identify it as such, as shown in the example below. \begin{figure}[h] \centering \includegraphics[width=\linewidth]{sample-franklin} \caption{1907 Franklin Model D roadster. Photograph by Harris \& Ewing, Inc. [Public domain], via Wikimedia Commons. (\url{https://goo.gl/VLCRBB}).} \Description{A woman and a girl in white dresses sit in an open car.} \end{figure} Your figures should contain a caption which describes the figure to the reader. Figure captions are placed {\itshape below} the figure. Every figure should also have a figure description unless it is purely decorative. These descriptions convey what’s in the image to someone who cannot see it. They are also used by search engine crawlers for indexing images, and when images cannot be loaded. A figure description must be unformatted plain text less than 2000 characters long (including spaces). {\bfseries Figure descriptions should not repeat the figure caption – their purpose is to capture important information that is not already provided in the caption or the main text of the paper.} For figures that convey important and complex new information, a short text description may not be adequate. More complex alternative descriptions can be placed in an appendix and referenced in a short figure description. For example, provide a data table capturing the information in a bar chart, or a structured list representing a graph. For additional information regarding how best to write figure descriptions and why doing this is so important, please see \url{https://www.acm.org/publications/taps/describing-figures/}. \subsection{The ``Teaser Figure''} A ``teaser figure'' is an image, or set of images in one figure, that are placed after all author and affiliation information, and before the body of the article, spanning the page. If you wish to have such a figure in your article, place the command immediately before the \verb|\maketitle| command: \begin{verbatim} \begin{teaserfigure} \includegraphics[width=\textwidth]{sampleteaser} \caption{figure caption} \Description{figure description} \end{teaserfigure} \end{verbatim} \section{Citations and Bibliographies} The use of \BibTeX\ for the preparation and formatting of one's references is strongly recommended. Authors' names should be complete --- use full first names (``Donald E. Knuth'') not initials (``D. E. Knuth'') --- and the salient identifying features of a reference should be included: title, year, volume, number, pages, article DOI, etc. The bibliography is included in your source document with these two commands, placed just before the \verb|\end{document}| command: \begin{verbatim} \bibliographystyle{ACM-Reference-Format} \section{Appendix: Distance between adversary and VDS\xspace speaker.} To launch a speech re-use attack, an adversary first records a user's interaction with VDS\xspace. In this experiment, we measure how effectively the acoustic nonce is preserved with varying distance between the VDS\xspace speaker and adversary's recording device (microphone) at the time of capture. Figure~\ref{fig:BER_dist} shows that this distance significantly impacts BER. The computed BER is 0\% upto a distance of 4 m when the signal to noise ratio is low. If the captured speech is being re-used, assuming a lossless audio input to VDS\xspace, the entire nonce can be recovered and used for determining the particular user interaction session the speech was previously used in. \begin{figure}[h] \centering \includegraphics[width=0.4\linewidth]{figures/figure_rdis.pdf} \caption{Variation of bit error rate (\%) with different distances between microphone and user (simulated using a playback device) in different environments: (a) conference room, (b) dining hall, and (c) in a car parked at a gas station. Given a fixed size car in (c), results can only be computed upto a distance of 0.7 m. \label{fig:real_dis} \end{figure} \begin{figure} \centering \begin{subfigure}[b]{0.4\textwidth} \includegraphics[width=\textwidth]{figures/figure5.pdf} \caption{} \label{fig:identest} \end{subfigure} \hfill \begin{subfigure}[b]{0.4\textwidth} \includegraphics[width=\textwidth]{figures/BER_distance.pdf} \caption{} \label{fig:BER_dist} \end{subfigure} \caption{\small (a) Impact of the proposed security overlay on prediction confidence of Microsoft Azure Speaker Recognition system in three different environments. (b) Impact of distance between the VDS\xspace speaker and an adversary's recording device at the time of capture on speech re-use. } \end{figure} \begin{figure}[t] \centering \includegraphics[width=0.4\textwidth]{figures/sim_dbdiffer.pdf} \caption{Loudness of speech with and without embedded nonce (average value of 5 measurements).} \label{fig:dbdifference} \end{figure} \begin{comment} \begin{figure}[b] \centering \begin{subfigure}[b]{0.45\linewidth} \raisebox{-\height}{\includegraphics[width=1\linewidth]{figures/figure5.pdf}} \end{subfigure} \caption{Impact of the proposed security overlay on prediction confidence of Microsoft Azure Speaker Recognition system in three different environments: (a) conference room, (b) dining hall, and (c) in a car parked at a gas station. Given a fixed size car in (c), results can only be computed upto a distance of 0.7 m. For each query, the system outputs four different confidence levels: none, low, normal and high.} \label{fig:identest} \end{figure} \begin{figure}[t] \centering \begin{subfigure}[b]{0.45\linewidth} \raisebox{-\height}{\includegraphics[width=1\linewidth]{figures/BER_distance.pdf}} \end{subfigure} \caption{Impact of distance between the VDS\xspace speaker and an adversary's recording device at the time of capture on speech re-use.} \label{fig:BER_dist} \end{figure} \begin{figure}[t] \centering \includegraphics[width=0.45\linewidth]{figures/sim_dbdiffer.pdf} \caption{Loudness of speech with and without embedded nonce.} \label{fig:dbdifference} \end{figure} \end{comment} \section{Appendix: Nonce Removal Techniques} \label{appendix:nonce_removal} \begin{itemize}[noitemsep,leftmargin=*] \item Resampling. Samples the audio at a different frequency (e.g. 44.1 KHz) to remove sampling-dependent watermark. \item Amplitude Compression. Alters the amplitude of recorded audio to bypass amplitude-related watermark detection. \item Filtering. Uses a high pass or low pass filter to remove a specific range of frequency in the audio. For example, separate audible signals from inaudible frequencies (e.g. ultrasound). \item Lossy Compression. Leverages data encoding methods that uses inexact approximations and partial data discarding to compress the audio. For example, MP3~\cite{mp3} or MPEG-1 Audio Layer III reduce audio file size by taking advantage of a perceptual limitation of human hearing. \item Equalization. Modifies the frequency response of an audio system using linear filters. Frequency response is the measure of the audio output in comparison to the input as a function of frequency. For example, a 5kHz wave input may have a 4kHz output response. \item Additive Noise. Adds noise to decrease SNR (signal-to-noise ratio) so that watermark cannot be extracted successfully. \end{itemize} \section{Appendix: User Study Demographics} The demographics for the 120 participants in the user study are shown in Figure~\ref{tab:group_userstudy}. There are more female participants than male participants, and 56.7\% of the participants are between age 25 to 35. \begin{table}[h] \centering \small \vspace{-5mm} \caption{User study participant demographic information.} \vspace{-0mm} \label{tab:group_userstudy} \begin{tabular}{l|ccc|cccc} \toprule[1.5pt] \multirow{2}{*}{Category} & \multicolumn{3}{c}{Gender Groups} & \multicolumn{4}{c}{Age Groups} \\ \cmidrule{2-8} & Male&Female&Others & 18-25, &25-35, &35-45, & 45-55\\ \midrule Number & 65 &53 &2 & 42 & 68 & 41 & 11\\ \bottomrule \end{tabular} \end{table} \end{appendix} \section{Background and Related Work} In this section, we VCS \cite{vui} is operated by voice commands, as shown in Figure \ref{fig:firstarch}. Users' voice commands are transcribed and comprehended by the system and the proper response is returned either by playing a verbal response (e.g., announcing the time) or taking an external action (e.g., turning lights on/off). The system is triggered by a wake-up command (e.g., Alexa, Hey Siri) and then it works in a turn-taking mode, the device is idle while the user sends commands and the user usually is silent when the device plays responses. \texttt{AEOLUS\xspace}\ leverages device idle time to embed the acoustic nonce. VCS works in four stages, 1) a voice channel over which the verbal requests and responses are exchanged, 2) the text/speech processing engine to convert speech-to-text and text-to-speech, and 3) speaker verification to recognize the user for penalization or security purposes and 4) the text/intent processing engine to execute commands. Our goal is to protect the voice channel against replay attacks. \subsection{Speaker Recognition} Voice or speaker recognition analyzes a person's voice to verify their identity. Airways and soft-tissue cavities, as well as the shape and movement of the mouth and jaw, influence voice patterns to create a unique voiceprint. Speaker recognition is a type of voice recognition technology. However, it is not the same as speech recognition, which is the technology used in speech-to-text applications. Speech recognition can make sense of verbal language, but it cannot verify the identity of the speaker based on his or her unique vocal attributes; speaker verification can. Voice biometrics is still in the early stages of development and is the target of different attacks such as replay attacks and voice synthesis attacks. Replay attacks are known to be the most accessible attack~\cite{pindrop} to affect a VCS. It requires only a simple microphone and loudspeaker to launch effective attacks. In this attack, the attacker records the target user when s/he speaks a command in a hope to replay the command in the future and gain access to the system. Speaker verification deployed in current systems fail to detect such attack since the attacked voice sample captures the exact feature of the target user. Several defense techniques such as liveness detection are proposed to detect replay attacks \cite{zhang2017hearing, shiota2015voice}. However, these techniques have distance or hardware limitations, and therefore, are not practical as shown by recent studies \cite{shirvanian2019quantifying}. Voice synthesis attacks are another possible attack on speaker recognition. Voice conversion and speech synthesis tools try to generate an individual's voice by mimicking characteristics of the target speaker. To generate a convincing voice that can break a robust speaker recognition system, many speech synthesis tools require a collection of the target voice and several hours of training. Research in the speaker recognition domain is advancing to detect this type of attack. A collection of work in this area can be found in the recent ASVSPoof 2019 challenge \cite{todisco2019asvspoof}. \subsection{Nonce-based Authentication} In the security domain, a nonce is often a random or pseudo-random number issued in an authentication protocol to ensure that earlier messages are not reused in a replay attempt, as shown in Figure~\ref{fig:nonce}. For each authentication request-response session, the server assigns and transfers a fresh nonce as a request and expects to receive a response from the client that contains the nonce along with the authentication credential. The idea is that an attacker who has eavesdropped previous communications cannot resubmit the response since a freshly generated request contains a nonce not available in earlier authentications. The nonce and the credential are bundled and encrypted as a single message to avoid the removal of nonce and access to the encrypted credential. \texttt{AEOLUS\xspace}{'s} strategy uses a similar concept, however, unlike communications happening between two machines over the data channel, an acoustic nonce cannot be simply encrypted or hashed. Therefore, we propose a voice frequency-range hopping technique to embed the acoustic nonce. This embedding works similar to encrypting the bundle of nonce and credential in traditional nonce authentication. \begin{figure}[t] \centering \includegraphics[width=1\linewidth]{figures/background1.pdf} \caption{Nonce-based Authentication} \label{fig:nonce} \end{figure} \begin{figure*} \centering \includegraphics[width=0.8\linewidth]{figures/overview1.pdf} \caption{\texttt{AEOLUS\xspace}\ in VCS.} \label{fig:overview1} \end{figure*} \section{Background and Related Work} \subsection{Example Use Cases} \label{sec:motivate} \smallskip\noindent\textbf{Voice-driven Payments.} Voice-driven services are being increasingly used for payments, especially in retail environments~\cite{vpsurvey}. Amazon and Exxon recently announced voice-driven payments at over 11,500 gas stations in the US~\cite{gasstationpay}. A recent user study~\cite{paysafe} indicates that while most users are comfortable conducting low-value purchases such as ordering a meal and shopping for groceries using voice-driven payment services, the majority of them do not have sufficient confidence in conducting high value purchases due to security concerns. Most voice-driven payment services authenticate users through speaker verification. However, they often lack adequate protection mechanisms against speech re-use attacks where an attacker records a user interaction and re-uses it to attack the service either on-site or remotely. This is analogous to card skimming~\cite{scaife2018fear} where an attacker re-uses a victim's credit card information. \texttt{AEOLUS\xspace}\ can be deployed to prevent speech re-use attacks in voice-driven payments. \smallskip\noindent\textbf{Workplace Automation.} A variety of digital assistants are being used for unsupervised or semi-supervised interactions in workplace environments~\cite{alexabusiness}. In addition to accurate speaker recognition (identification and/or verification), it is important to have adequate protection mechanisms against speech re-use to protect sensitive resources in such environments~\cite{workplaceva}. \texttt{AEOLUS\xspace}\ can be incorporated in workplace digital assistants for this purpose. \subsection{Related Work} \smallskip\noindent\textbf{Speech Replay Detection} Existing research related to speech replay detection can be classified into two categories, software-based and hardware-based methods. Software-based methods use machine learning to determine whether the input speech is produced by a human or replayed using a recording device~\cite{chen2017you}~\cite{ahmed2020void}~\cite{kinnunen2017asvspoof}. Chen et al.~\cite{chen2017you} present a method that obtains 0\% EER for distance (between user and VDS\xspace input device) of only a few centimeters which limits its applicability in practice. Ahmed et al.~\cite{ahmed2020void}'s method, on the other hand, is reported to work well upto a distance of 2.6 meters. However, the EER varies significantly in different environments with it being as low as 11.6\%. One of the best performing methods ~\cite{kinnunen2017asvspoof} reports EER of 6.7\% on ASVSpoof 17 database. A caveat, however, is that these methods aim to address general replay attacks. In contrast, \texttt{AEOLUS\xspace}\ aims to prevent speech re-use and obtains 0\% EER upto a distance of 4 meters in three different environments. The second category of approaches use additional hardware (e.g., a vibration sensor on user's neck) to check that speech is produced in real-time by a user~\cite{feng2017continuous}~\cite{pradhan2019combating}. Such approaches, in general, outperform machine learning-based methods. For example, Feng et al.~\cite{feng2017continuous} report 97\% successful detection rate, on average, with no strict assumption on distance. However, there are two major practical limitations using the aforementioned approaches for detecting speech re-use, (i) requirement of extra hardware which has cost implications, and (ii) inconvenience to users. \texttt{AEOLUS\xspace}\ only uses the built-in speaker and microphone in smart devices yet achieves high speech re-use detection rate. \smallskip\noindent\textbf{Audio Watermarking.} Audio watermarking is widely used for multimedia copyright protection~\cite{swanson1998robust,seok2001audio}. Both time domain~\cite{bassia2001robust} and frequency domain~\cite{cox1996secure,neubauer1998digital} watermarking techniques have been proposed in the literature. Typically, audio watermark embedding and detection is self-synchronized~\cite{wu2005efficiently}. Advanced watermarking methods use spread-spectrum modulation~\cite{swanson1998robust} to prevent watermark removal and provide imperceptibility~\cite{cox1996secure,kirovski2003spread}. While useful, these techniques cannot be directly used in VDS\xspace operational setting. They are designed for fixed length offline audio files, e.g., music recordings in CDs~\cite{swanson1998robust}, and do not consider the impact of environmental factors, e.g., bitrate variability and background noise, in over-the-air transmission. Such environmental factors result in a dynamic and lossy acoustic environment in turn making watermark embedding and retrieval significantly challenging. Further, they are not designed for real-time speech and speaker recognition systems where input speech is unknown apriori and can be of variable length. \texttt{AEOLUS\xspace}\ is designed to take these pragmatic considerations into account. It is able to successfully embed and retrieve acoustic nonce in the voice channel without degrading user experience in practice. \begin{comment} \subsection{Equal-loudness Contour} \begin{figure}[h] \centering \includegraphics[width=0.85\linewidth]{figures/Human_Hearing.png} \caption{Equal-loudness Contour~\cite{wiki_elc,fasciani2014voice}} \label{fig:hh} \end{figure} Also, we learn from Equal-loudness Contour that, at certain frequencies, human ear precepts less sound intensity thus the sound is not as loud as it supposed to be. For example, in Figure~\ref{fig:hh}, 4kHz shows a very low sensitivity sound pressure level. However, for a machine, all these should share the same sensitivity. We leverage this phenomenon to adjust the acoustic sound in addition to the ambient aforementioned loudness adaptor. In other words, low sensitivity frequencies will be preferred so that user hear less noisy acoustic nonce. \begin{table*} \centering \small \vspace{-0mm} \caption{Watermarking Techniques Used in Audios} \vspace{-0mm} \label{tab:toprank} \begin{tabular}{llllll} \toprule[1.5pt] Abstracted Name & \parbox[t]{2cm}{ Dynamic \\ Tagging} & Authentication & Anti-removal & \parbox[t]{3cm}{ Human Perception \\Consideration} &\parbox[t]{2cm}{ Open Acoustic \\ Channel} \\ \midrule Time Domain watermarking\cite{bassia2001robust} &\cmark &\cmark&\xmark&\cmark&\xmark\\ Perceptual Masking\cite{swanson1998robust} &\cmark &\cmark&\cmark&\cmark&\xmark\\ Secure spread spectrum watermarking\cite{cox1996secure} &\xmark &\cmark&\cmark&\xmark&\xmark \\ Spread-Spectrum Watermarking\cite{kirovski2003spread} &\cmark &\cmark&\cmark&\xmark&\xmark\\ Self-synchronized watermarking\cite{wu2005efficiently} &\cmark &\cmark&\rmark&\xmark&\xmark\\ \bottomrule \end{tabular} \begin{tablenotes} \centering \item \cmark: Effective, \xmark: Ineffective, \rmark: Partially Effective \end{tablenotes} \end{table*} \end{comment} \section{Practical Realization} \label{sec:new design} \subsection{Challenges} In this section, we discuss the two key challenges while implementing \texttt{AEOLUS\xspace}\ in practice: reliability and imperceptibility. \smallskip\noindent\textbf{Reliability.} The first challenge is to reliably embed an acoustic nonce in over-the-air channel, as well as to accurately detect nonce from the recorded speech. Because over-the-air acoustic nonce transmission is impacted by factors such as background noise and distance between microphone and playback device, it is difficult to achieve this in operational settings. It is also important to determine if any previously embedded acoustic nonce is present in the recorded speech to ascertain speech re-use. The metric used to measure reliability is the bit error rate (BER) between the embedded and detected nonce. Recall that BFSK is used for acoustic nonce embedding and detection. Under the assumption that only additive white Gaussian noise (AWGN) is present in over-the-air channel, BER can be computed using the complimentary error function $erfc()$~\cite{kumar2010comparison} as follows: \begin{equation} \label{eqn:ber} BER = \frac{1}{2} erfc(\sqrt{E_b / N_0}) \end{equation} \noindent Note that BER computation in Eqn.~\ref{eqn:ber} involves the normalized per bit signal-to-noise ratio ${E_b/N_0}$~\cite{johnson2006signal} which depends on the frequency $f$ and amplitude $\alpha$ of the carrier wave. However, other types of noises besides AWGN are typically present in over-the-air channel. Hence, we conduct Room Impulse Response (RIR) simulation experiments to study the impact of carrier wave amplitude and frequency on BER. \smallskip\noindent\textbf{Imperceptibility.} The second challenge is to ensure that the embedded acoustic nonce does not degrade VDS\xspace user experience. For this, the acoustic nonce should be as imperceptible as possible to a VDS\xspace user. The nonce embedding and generation modules presented earlier do not adequately address this challenge because (i) they do not optimize any objective metric for imperceptibility, and (ii) they do not account for dynamic and noisy environments where it is difficult to achieve both reliability and imperceptibility simultaneously. For measuring imperceptibility, Sound Pressure Level (SPL) is computed using the following equation: \begin{equation} \label{eqn:soundpressure} SPL = 2 {\pi}^2{f}^2{\alpha}^2\rho{c}/{v} \end{equation} \noindent Here, $f$ represents the frequency and $\alpha$ is the amplitude of the carrier wave. $\rho$ represents the density of the transmission channel (e.g., over-the-air channel), and $c$ denotes the speed of acoustic transmission. Given that the average SPL for human speech is 60dBm~\cite{human_normal_hearing}, $f$ and $\alpha$ should ideally ensure that SPL is below this threshold for imperceptibility. Like Equation~\ref{eqn:ber}, while this equation provides a theoretical basis to understand SPL, we study how the aforementioned parameters impact SPL using RIR simulation. \subsection{Key Parameters} There are two key parameters that impact reliability and imperceptibility: (i) acoustic nonce generation and embedding parameters that include frequency and amplitude of the carrier wave used for acoustic nonce generation and bitrate used for acoustic nonce encoding, and (ii) environmental parameters that include the distance between the microphone and user, the room size, and background noise among others. To understand the impact of the these parameters on reliability and imperceptibility, we implement \texttt{AEOLUS\xspace}\ as a prototype and setup an RIR environment called MCRoomSim in MATLAB~\cite{wabnitz2010room}. RIR is a commonly used tool for estimating the performance of signal processing applications in over-the-air channel~\cite{chenmetamorph,abdullah2019practical}. \begin{figure*}[t] \centering \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[width=1\linewidth]{figures/BER_amp.pdf} \caption{Frequency-range=4-5kHz, hopping = 2, bitrate = 30 bits/sec} \label{fig:BER_a} \end{subfigure} \hfill \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[width=1\linewidth]{figures/BER_bitrate.pdf} \caption{Frequency-range=4-5kHz, hopping=2, amplitude = 1} \label{fig:BER_b} \end{subfigure} \hfill \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[width=1\linewidth]{figures/BER_noise.pdf} \caption{Freq-range=4-5kHz, hopping=2, bitrate=30 bits/sec, amplitude=1} \label{fig:BER_c} \end{subfigure} \caption{Variation of bit error rate (\%) with: (a) amplitude of carrier wave, (b) bitrate used for encoding acoustic nonce, (c) background noise levels when embedding the acoustic nonce. $E_b/N_0$ is calculated in decibels. The distance between user (simulated using a speaker) and the microphone is set to 1 m.} \label{fig:sim_freq} \vspace{-4mm} \end{figure*} \subsubsection{Nonce Generation and Embedding Parameters}\hfill \smallskip \noindent \textit{Amplitude.} According to RIR simulation, a lower amplitude yields lower $E_b/N_0$ ratio and consequently, higher BER (see Figure \ref{fig:BER_a}). This is consistent with Equation~\ref{eqn:ber}. Furthermore, as shown in Figure~\ref{fig:sim_spl}, SPL is proportional to the amplitude of the carrier wave. \smallskip \noindent \textit{Frequency.} BER and SPL are evaluated in the frequency range at which typical speaker recognition systems operate (5 Hz - 8 kHz; sampling rate = 500 Hz). The other parameters are fixed as follows: ${E_b/N_0}$ = 1, frequency hopping = 2, amplitude (normalized) = 1, bitrate = 30 bits/sec, distance = 1 meter. It is observed that the carrier wave frequency neither impacts BER nor SPL. The later is in contrast to existing research~\cite{suzuki2004equal,wiki_elc} which shows that the frequency of an acoustic wave affects the loudness as perceived by humans in a non-linear manner. Hence, the frequency to SPL mapping from IoSR toolkit~\cite{githubmapping} is used as reference. \smallskip \noindent \textit{Bitrate.} Figure~\ref{fig:BER_b} shows the impact of acoustic nonce bitrate on BER. BER increases significantly as bitrate increases beyond 20 bits/sec. One of the causes is asynchronous signal overlapping in the time domain when two bits are transmitted too close to each other. \subsubsection{Environmental Parameters}\hfill \begin{figure}[t] \centering \begin{subfigure}[b]{0.40\textwidth} \centering \includegraphics[width=1\linewidth]{figures/SPL_amp.pdf} \caption{$E_b/N_0$ = 1, carrier frequency range = 4-5kHz, hopping=2, bitrate = 30 bits/sec, distance = 1m} \label{fig:SPL_a} \end{subfigure} \hfill \begin{subfigure}[b]{0.45\textwidth} \centering \includegraphics[width=1\linewidth]{figures/SPL_dist.pdf} \caption{$E_b/N_0$ = 1, carrier frequency range = 4-5kHz, hopping=2, bitrate = 30 bits/sec, Amplitude (normalized) = 1} \label{fig:SPL_b} \end{subfigure} \caption{Variation of sound pressure level (dBm) with (a) amplitude of carrier wave, and (b) distance between user (simulated using a speaker) and the microphone.} \label{fig:sim_spl} \end{figure} \begin{comment} \begin{figure}[b] \centering \begin{subfigure}[b]{0.23\textwidth} \centering \includegraphics[width=\textwidth]{figures/sim_freq_shifting.pdf} \caption[]% {{\small RIR Result}} \label{fig:sim_f_shift} \end{subfigure} \hfill \begin{subfigure}[b]{0.23\textwidth} \centering \includegraphics[width=\textwidth]{figures/real_freq_shifting.pdf} \caption[]% {{\small Real-world Result}} \label{fig:r_f_shift} \end{subfigure} \label{fig:f_shift} \caption{Difference in measured frequencies of the transmitted and received acoustic nonce (in Hz) at different embedding frequencies: (a) simulated using RIR, and (b) real world measurement in a 5 cm distance.} \end{figure} \end{comment} \smallskip \noindent \textit{Frequency Shifting.} Over-the-air acoustic nonce transmission induces differences in the received frequencies and the transmitted frequencies called \textit{frequency shifting}. Frequency shifting can also occur because of hardware limitations, e.g., a microphone with a 1.8 kHz frequency limit being used to capture a 2 kHz wave. Since the received frequency is used to decode the acoustic nonce, frequency shifting needs to be accounted for by \texttt{AEOLUS\xspace}. We investigate frequency shifting in the simulation setting (operating frequency range: 500 Hz-8 kHz, cardioid loudspeaker type, dipole microphone type) and determine the frequency shifting range to be +/- 15 Hz. \smallskip \noindent\textit{Distance.} Distance between a VDS\xspace user and VDS\xspace input impacts imperceptibility of the acoustic nonce. Figure~\ref{fig:SPL_b} indicates that this distance is inversely proportional to SPL. \smallskip \noindent \textit{Background Noise.} Figure~\ref{fig:BER_c} and Equation~\ref{eqn:ber} suggest that the background noise is proportional to BER. In an environment with high background noise, the nonce generation and embedding parameters need to be configured appropriately (e.g., decrease bitrate, increase amplitude) to limit the BER. \subsection{Mathematical Formulation} \label{sec:optfor} To address reliability and imperceptibility simultaneously, we model over-the-air acoustic nonce transmission as an optimization problem. Let a user's recited speech be denoted by $x$, and the acoustic nonce embedded by \texttt{AEOLUS\xspace}\ be $\delta$. Also, let the function that accounts for variations induced by over-the-air channel, e.g., due to acoustic signal air absorption and distance, be $h(\cdot)$. The speech recorded by the microphone is thus represented as $h(x)$. When $\delta$ is embedded at the time of user interaction with the VDS\xspace, $x$ mixes with $\delta$. As a result, the microphone records $h(\textbf{x}* \delta)$, where $*$ denotes signal convolution between $x$ and $\delta$. Assume that \texttt{AEOLUS\xspace}\ detects nonce $\delta{'}$ in $h(x * \delta)$. Let us define an objective function $f(\cdot)$ denoting BER that takes the parameter set $\mathcal{P} = \{<f,\alpha,\tau>, ...\}$ as input, and a function $g(\cdot)$ denoting SPL. The goal is to find the optimal parameter set $\mathcal{P}$ that minimizes $f$ (for reliability) subject to the constraint that the SPL difference between speech with and without embedded nonce is less than or equal to a threshold $\theta$ (for imperceptibility): \begin{equation} \label{eqn:optim} \arg \min_{\mathcal{P}} f(\mathcal{P}) \\ \text{ subject to } g(h(\textbf{x}* \delta)) - g(h(\textbf{x})) \leq \theta \end{equation} \begin{algorithm}[t] \SetKwInOut{Input}{input} \SetKwInOut{Output}{output} \small \SetAlgoLined \textbf{initialization:} \\ 1. Create candidate population:$\mathcal{P} = \{P<f,\alpha,\tau>, ...\}$\\ 2. Initialize: $\mathcal{P}_{output} =\{\}$, $i = 0$, $MAX_i = 100$, $MAX_{output} = 20$, $\beta = 0.5$\\ 2. Acquire environmental parameters: $d$, $N_0$ 3. Set up Goals:$BER < 10^{-9}$, $SPL^{'} - SPL \leq \theta$\\ \textbf{optimization:} \\ \While{$i<= MAX_i$, $\mathcal{P}_{output}.Size <= MAX_{output}$ }{ \ForEach {individual $P_i (i = 1, ...) \in \mathcal{P}$} { \If{$P_i$ satisfies the Goals} {$\mathcal{P}_{output} \leftarrow P_i$ } Create candidate $C$ from parent $P_i$, $d$, $N_0$.\\ \eIf{the candidate is better than the parent} {$P_{feasible} \leftarrow$ Candidate $C$ \\ Candidate $C$ replaces the parent} {the candidate is discarded} } Randomly select next $P$ in $\mathcal{P}$.} \textbf{output:} $\mathcal{P}_{output}$ \vspace{2mm} \hrule \vspace{0.8mm} \textbf{Candidate Creation:} \vspace{0.8mm} \hrule \vspace{2mm} \Input{Parent $P_{par}$, $d$, $N_0$, $\beta$} Randomly select individuals $P_{1}$ , $P_{2}$ from $\mathcal{P}$\\ Calculate candidate $C$ as $C = P_{par} + \beta (P_{1} - P_{2} )$,\\ where $\beta$ is a scaling parameter decided by $d$ and $N_0$. \\ \Output{Candidate $C$} \caption{Computing Optimal Parameters} \label{alg:de} \end{algorithm} \subsection{Computing Optimal Parameters} \label{subsec:optimization} \smallskip \noindent \textbf{Initialization.} The environmental parameters are first initialized (Figure~\ref{fig:overview3_b} \textcircled{5}) using the VDS\xspace input. The background noise energy is calculated by inspecting the ambient sound. Frequency shifting is calculated by transmitting and decoding a nonce that covers the working frequency range (500 - 8 kHz, sampled every 500 Hz). It is assumed that the distance between the user and VDS\xspace input device is set by the VDS\xspace device vendor. \smallskip \noindent \textbf{Optimization.} \begin{comment} \textcolor{red}{ The \texttt{AEOLUS\xspace}\ optimization is considered to be non-differentiable, non-continuous and noisy. First, VDS\xspace{'s} acoustic environment and its related parameters could be unpredictable and dynamic due to the physical environment (e.g., human movement or obstacles) and background noise changes (e.g., the noise level in a dining hall can be different within several seconds). Also, the numeric results of BER are often affected by the acoustic encoding/decoding algorithms (e.g., the BFSK used in \texttt{AEOLUS\xspace}) and the quality of their implementations. In real-world communication applications, BERs or bitrates can have sudden increases or drops based on the algorithms being used. The objective function is a multi-dimensional problem with constraints as well with the consideration of both the reliability and imperceptibility. } \textcolor{red}{ Hence, we apply differential evolution (DE)~\cite{das2010differential,storn1997differential} to obtain optimal parameters because DE is known to be an efficient optimization method~\cite{fleetwood2004introduction,chen2019real} for practical problems which have objective functions that are non-differentiable, non-continuous, noisy, multi-dimensional, or have many local minima, constraints. DE is more suitable compared to other gradient-dependent methods because it can be used regardless of the underlying acoustic encoding method and environmental setting. } \end{comment} Computing the gradients of the optimization parameters directly using gradient-based methods is inefficient~\cite{chen2019real}. This is because the VDS\xspace{'s} acoustic environment is dynamic (e.g., due to occlusions and varying background noise levels). In addition, the formulated optimization is a multi-dimensional problem with considerations of both reliability and imperceptibility. Hence, we use differential evolution (DE)~\cite{das2010differential,storn1997differential} which is a gradient-free method. DE generates diverse candidate solutions in each iteration which avoids local minima and aids in convergence to a global minima. It does not require apriori knowledge of the underlying acoustic encoding method or acoustic environment. Algorithm~\ref{alg:de} summarizes the use of DE for obtaining optimal parameters. The initial set of candidate parameters $\mathcal{P}$ includes feasible frequency $f$, amplitude $\alpha$, and bitrate $\tau$, estimated using RIR simulation. Once \texttt{AEOLUS\xspace}\ is deployed, the initialization module first estimates the environmental parameters, e.g., $N_0$ and $d$. Subsequently, the optimization module uses the pre-calculated RIR parameters for efficient convergence to optimal parameters (see Section~\ref{subsec:eval_performance}). \begin{comment} \footnotetext{In the goals, $10^{-9}$ is used because it is a commonly used threshold for a good BER in communication systems. The 5\% is used as an example usage of finding small SPL difference. } \end{comment} \section{Voice Frequency-hopping Spread Spectrum (VFHSS)} \label{sec:vfhss} \begin{comment} \begin{figure}[b] \centering \includegraphics[width=0.8\linewidth]{figures/vfhss.pdf} \caption{Example VFHSS consists of four waves in different frequencies. } \label{fig:vfhss} \end{figure} \end{comment} To establish a systematic approach for tackling the challenges, we first model the questions with a convex maximization problem. In our setting, an attacker's goal is to remove the nonce from the recorded speech. The attack is considered to be successful if a clean audio record without any detectable nonce residual can be produced. This clean audio record should also be able to pass speaker verification and other VCS functionalities. First, \texttt{AEOLUS\xspace}\ should detect the existence of previously embedded nonce fully or partially. Second, the embedded nonce can be preserved, partially or fully, when different watermark attacks are performed. \smallskip\noindent\textbf{Watermark Attacks.} There are three major types of watermark attacks that are relevant to our work ~\cite{arnold2003techniques}: detection of watermark, embedding of watermark and removal of watermark. As described earlier we focus on addressing the threats from removal attacks. We list common watermark removal attacks in the following, note that some of these techniques are also used in popular noise cancellation: \begin{itemize}[noitemsep,leftmargin=*] \item Resampling. In digital recording, sampling process takes snapshots of an audio or video. For example, a popular sampling rate for audio is 44.1kHz. Attacks may sample the audio in a different frequency to remove sampling-dependent watermark. \item Amplitude Compression. Attackers may resize the amplitude of audio signals recorded to avoid amplitude-related watermark detection. \item Filtering. Filtering is effective in removing audio signals from a specific range of frequency. For example, ultrasound-based inaudible voice commands can be removed by applying Low Pass Filter to separate audio signals from inaudible frequencies. \item Lossy Compression. This attack leverages data encoding methods that uses inexact approximations and partial data discarding to represent the audio. For example, MP3~\cite{mp3}, or MPEG-1 Audio Layer III, conducts audio file size reduction by taking advantage of a perceptual limitation of human hearing. \item Equalization. This process commonly used to alter the frequency response of an audio system using linear filters. A frequency response is a measure the audio output as a function of frequency, in comparison to the input. For example, a 5kHz wave input may have a 4kHz response as the output. \item Additive Noise. An attack could add noise to decrease SNR (signal-to-noise) ratio so that watermark signals cannot be extracted successfully. \end{itemize} \smallskip\noindent\textbf{Resistance to Watermark Removal.} To address the issue of removable watermarking, as shown in Figure~\ref{fig:vfhss}, we leverage Frequency-hopping Spread Spectrum (FHSS)~\cite{cvejic2004spread,cvejic2004algorithms} to obtain high robustness against standard watermark attacks. Although is is known that FHSS prevents attacks from getting useful clean audio recording, we also argue it is only useful in voice frequency range because filtering attack could easily filter out high frequency signal. In practice, a frequency drifting is commonly observed in real-world acoustic wave transmission. This is because of the hardware limitation such as the vibration sensitivity of a loud speaker. In our preliminary tests, we noticed that the transmission rate of acoustic communication is limited as we could reach at most 20 bits/sec in the close distance (i.e., within 5 meter) transmission. As a result, we propose to leverage \textit{\textbf{multi-band acoustic tagging}}. This means \texttt{AEOLUS\xspace}\ will use not only one range of frequency for nonce transmission. Multiple bands are used, for example, as shown in Figure~\ref{fig:spectro1}, two bands are used either with or without frequency hopping. Note that, the frequency hopping starts at 0.5 seconds. \begin{figure}[h] \centering \includegraphics[width=0.90\linewidth]{figures/spectro1.pdf} \vspace{-2mm} \caption{Spectrogram of an Example Multi-band Acoustic Nonce.} \label{fig:spectro1} \end{figure} \section{Summary and Future Work} In this work, we present a security overlay called \texttt{AEOLUS\xspace}\ that can be integrated with any voice-driven service to prevent speech re-use. \texttt{AEOLUS\xspace}\ reliably embeds a dynamic acoustic nonce that is non-disruptive to a VDS\xspace user, and detects the embedded nonce from the recorded user speech. \texttt{AEOLUS\xspace}\ can be combined with other defense mechanisms to further enhance VDS\xspace security. As an example, it can be used alongside a dynamic challenge-response method where in each interaction, the user is expected to respond to a fresh challenge (e.g., repeat a phrase). The acoustic nonce can be embedded in each challenge, and can be detected using \texttt{AEOLUS\xspace}. Experiments conducted in three different environments show that \texttt{AEOLUS\xspace}\ can be used in operational VDS\xspace scenarios with minimal overhead. In future, we plan to conduct in-depth investigation of methods for generation and encoding of acoustic nonce, e.g., using variations of music or other forms of sound along with different encoding schemes. We also plan to conduct large-scale live subject testing to further evaluate reliability and imperceptibility. \section{Experimental Evaluation} \label{sec:eval} \begin{figure}[t] \centering \begin{subfigure}[b]{0.244\textwidth} \centering \includegraphics[width=\textwidth]{figures/conferenceroom.JPG} \caption[Conference Room.]% {{\scriptsize Conference Room.}} \label{fig:mean and std of net14} \end{subfigure} \hfill \begin{subfigure}[b]{0.244\textwidth} \centering \includegraphics[width=\textwidth]{figures/dining.JPG} \caption[\scriptsize Dining Hall]% {{\scriptsize Dining Hall}} \label{fig:mean and std of net24} \end{subfigure} \hfill \begin{subfigure}[b]{0.244\textwidth} \centering \includegraphics[width=\textwidth]{figures/gas_1.jpg} \caption[]% {{\scriptsize Gas Station (Car).}} \label{fig:mean and std of net34} \end{subfigure} \hfill \begin{subfigure}[b]{0.244\textwidth} \centering \includegraphics[width=\textwidth]{figures/gas_2.jpg} \caption[]% {{\scriptsize Setup in the Car.}} \label{fig:mean and std of net44} \end{subfigure} \caption[] {\small Experimental setup to evaluate \texttt{AEOLUS\xspace}\ in different environments.} \label{fig:realdevice} \end{figure} \texttt{AEOLUS\xspace}\ is implemented as a prototype in MATLAB and evaluated in three different environments: (i) a conference room (approx. 5.5 m by 4 m) selected as a reference for a semi-public indoor environment, (ii) a campus dining area (approx. 25m by 50m) chosen to mimic a noisy indoor public area, and (iii) inside a car parked at a gas station to simulate the use case of voice-driven payments at gas stations~\cite{gasstationpay}. For (i) and (ii), a FIFINE K669B microphone is used to record speech, and a Logitech S120 Speaker System is used as playback device to simulate users. The evaluation is performed at different distances (0.5-4 m) between the microphone and playback device. For (iii), the microphone is identical but the car's in-built speakers are used instead of the Logitech speakers. Also, the evaluation is performed at two different distances 0.5 and 0.7 m. \texttt{AEOLUS\xspace}\ is evaluated both on speech data captured from live participants in ReMASC dataset~\cite{gong2019remasc} and synthesized speech from Amazon Polly. A total of ten different speaker profiles are used (four of which are synthesized). For each profile, three different speech samples are used. Microsoft Azure's speech and speaker recognition services~\cite{ms_speaker} are used for speech-to-text and speaker recognition. Text-independent speaker verification service~\cite{ms_verification} is used for speaker verification experiments. Each speaker's profile is first enrolled using a speech sample longer than 20 seconds. Verification is performed using the speaker's speech samples with and without acoustic nonce, and yields one of the following outputs: acceptance with ``high'', ``normal'', or ``low'' confidence, or a rejection. \begin{comment} \begin{figure*}[h] \centering \begin{subfigure}[b]{0.32\textwidth} \raisebox{-\height}{\includegraphics[width=1\linewidth]{figures/spectro22.pdf}} \vspace{-2mm} \caption{Conference Room} \end{subfigure} \begin{subfigure}[b]{0.32\textwidth} \raisebox{-\height}{\includegraphics[width=1\linewidth]{figures/spectro2.pdf}}% \vspace{-2mm} \caption{Dining Hall} \end{subfigure} \begin{subfigure}[b]{0.32\textwidth} \raisebox{-\height}{\includegraphics[width=1\linewidth]{figures/spectro2.pdf}}% \vspace{-2mm} \caption{Dining Hall} \end{subfigure} \caption{Spectrogram of Real-world experiments. Both are in the distance 0.5 meter with acoustic Embedding. } \label{fig:spectro2} \end{figure*} \end{comment} \subsection{Performance} \label{subsec:eval_performance} \begin{table}[t] \centering \scriptsize \caption{Optimal parameters for achieving reliability and imperceptibility at a distance of 0.5 m between the microphone and user in different environments: (a) conference room, (b) dining hall, and (c) in a car parked at a gas station.} \label{tab:parameters} \begin{tabular}{lllll} \toprule[1.5pt] Location & \parbox[t]{1.5cm}{SPL (dB-A)}&\parbox[t]{1.8cm}{Frequency \\($\pm$ 200 Hz)} & \parbox[t]{1.8cm}{Amplitude \\ (normalized)} & \parbox[t]{1.1cm}{Bitrate \\ (bits/sec)}\\ \midrule \parbox[t]{2.5cm}{Conference Room} & 41 & 4000 Hz & 0.52& 35\\ Dining Hall & 58 & 5200 Hz & 1 & 25 \\ Gas Station (Car) & 47 & 4800 Hz & 0.61 & 33 \\ \bottomrule \end{tabular} \end{table} \smallskip \noindent \textbf{Optimal Parameters.} First, we estimate optimal parameters for achieving reliability and imperceptibility simultaneously in a given environment using Algorithm~\ref{alg:de}. The frequency step size is set to 200 Hz and $\theta$ is set as 0.1 to ensure that the generated nonce is below the average human speech SPL of 60 db. It is observed that lower amplitudes and frequencies and higher bitrates are comparatively optimal for acoustic nonce embedding in low noise environments, e.g., conference room (see Table~\ref{tab:parameters}). Relatively higher amplitudes and frequencies, and lower bitrates are more optimal in environments with higher noise, such as the dining hall. This is because the background noise in such environments typically vests as a low amplitude low frequency noise. \begin{comment} \begin{table}[b] \centering \scriptsize \vspace{-0mm} \caption{} \vspace{-0mm} \label{tab:overhead} \begin{tabular}{lll} \toprule[1.5pt] Location & \parbox[t]{2cm}{DE Iteration \\ Number} & \parbox[t]{2.5cm}{One-time\\ Initialization Time}\\ \midrule Conference Room & 1 & 10.2 sec \\ Dining Hall & 2 & 41.8 sec \\ Gas Station & 2 & 18.4 sec \\ \bottomrule \end{tabular} \end{table} \end{comment} \smallskip \noindent \textbf{Computational Overhead.} Algorithm~\ref{alg:de} iteratively optimizes the parameter set $\mathcal{P}$ for the given environment. For conference room, a single iteration is sufficient. However, for dining hall and gas station environments, a few iterations ($<10$) are required and the computation takes a few seconds. This does not cause a delay at the time of user interaction because it overlaps with the time a user typically takes to set up a VDS\xspace. The acoustic nonce embedding and decoding process occurs while user is interacting with VDS\xspace. The computational overhead is negligible because the nonce size is small, and the playback device is used only when the user is speaking. \begin{comment} \hfill \begin{subfigure}[b]{0.24\textwidth} \centering \includegraphics[width=1\linewidth]{figures/BER_distance.pdf} \caption{Carrier wave frequency range = 4-5kHz, hopping = 2, bitrate = 30 bits/sec, amplitude = 1} \label{fig:BER_c} \end{subfigure} \end{comment} \begin{comment} \begin{table*}[h] \centering \scriptsize \vspace{-0mm} \caption{} \vspace{-0mm} \label{tab:custom} \begin{tabular}{lll} \toprule[1.5pt] Location & BER & EER\\ \midrule Conference Room & 1 & 10.2 sec \\ Dining Hall & 4 & 41.8 sec \\ Gas Station & 2 & 18.4 sec \\ \bottomrule \end{tabular} \end{table*} \end{comment} \begin{comment} \begin{figure}[t] \centering \includegraphics[width=0.35\linewidth]{figures/figure_rdis.pdf} \caption{Variation of bit error rate (\%) with different distances between microphone and user (simulated using a playback device) in different environments: (a) conference room, (b) dining hall, and (c) in a car parked at a gas station. Given a fixed size car in (c), results can only be computed upto a distance of 0.7 m. \label{fig:real_dis} \end{figure} \end{comment} \smallskip \noindent \textbf{Reliability} Next, we measure the reliability of embedding and retrieving acoustic nonce in the three environments. For this, we compute the average BER over 5 independent trials at different distances between the VDS\xspace input device (microphone) and user. Figure~\ref{fig:real_dis} shows that in all three environments, the average BER upto a distance of 1.5 m is 0\%. Note, however that BER increases significantly beyond 1.5m in dining hall because the environment is relatively noisy. \begin{table}[t] \centering \scriptsize \caption{Acoustic nonce recovery bit error rate (BER) and speech re-use detection performance (FAR and FRR) at different distances in the three environments. } \label{tab:detection} \begin{tabular}{l|l|l|c|l|c|l|l|c} \toprule[1.5pt] Location & Dis. & BER/FAR/FRR & Location & Dis. & BER/FAR/FRR & Location & Dis. & BER/FAR/FRR\\ \midrule \parbox[t]{1.35cm}{Conference\\Room} & 0.5m & 0\%/0\%/0\% &\parbox[t]{0.9cm}{ Dining\\Hall} & 0.5m & 0.2\%/0\%/0.5\% & \parbox[t]{0.9cm}{Gas\\Station \\ (Car)} & 0.5m & 0\%/0\%/0\%\\ & 1m & 0\%/0\%/0\% & & 1m & 1.2\%/0\%/ 1\%& & 0.7m & 0.5\%0\%0.5\%\\ & 4m & 1.2\%/0\%/0.5\% & & 2m & 75\%/0\% /78\% &&\\ \bottomrule \end{tabular} \end{table} \smallskip \noindent \textbf{Speech Re-use Detection.} In this experiment, we measure the efficacy of \texttt{AEOLUS\xspace}\ in detecting speech re-use (see Table~\ref{tab:detection}). The input speech is considered re-used if (i) the current nonce is not decoded correctly, and (ii) if any trace of an obsolete nonce is detected. FRR indicates the proportion of falsely rejected samples because of incorrect nonce decoding or because the detected nonce is obsolete. FAR indicates how many re-used speech samples with obsolete nonces are falsely accepted. \texttt{AEOLUS\xspace}\ achieves 0.5\% FRR at 0\% FAR for speech re-use prevention upto a distance of 4 meters in the three environments. \subsection{Robustness} \smallskip \noindent \textbf{Impact on Speaker and Speech Recognition.} The goal of this experiment is to assess the impact of acoustic nonce embedding and decoding on the performance of a commercial speaker and speech recognition system (Microsoft Azure). The results show that there is limited impact on the performance of the speaker recognition system for the conference room and dining hall environments upto a distance of 1.5 m (see Appendix Figure~\ref{fig:identest}). The embedded nonce marginally increases the average word error rate (WER) of the speech recognition system to 4.4\%. The WER is close to the reported average WER of 5.1\% for the same system in the NIST 2000 Switchboard test set~\cite{xiong2018microsoft}. Manually reviewing the results indicates that most errors are related to incorrect suffix ``-ing''. A few errors are due to small word omissions such as ``an'' and ``a''. Relatively more errors occur in the dining hall environment due to the background noise. \begin{table*}[htbp] \caption{Performance of Microsoft Azure speaker recognition system (similarity score 0 - 1) and speech recognition system (WER) after nonce removal using two different FHSS schemes. Without nonce removal, the respective average similarity score and WER of the two systems are 0.897 and 5.1\%~\cite{xiong2018microsoft}. Lossy compression and equalization nonce removal techniques failed to remove the nonce and the speech samples were rejected by \texttt{AEOLUS\xspace}.} \centering \scriptsize \label{table:speaker_iden} \begin{tabular}{c|c|c|c|c} \toprule[1.5pt] \multirow{2}{*}{Removal Technique} & \multicolumn{2}{c}{\parbox[t]{4.4cm}{ 4-5kHz, 2 Hop., Avg. of 30 samples}} & \multicolumn{2}{|c}{\parbox[t]{4.5cm}{ 1-8kHz, 10 Hop., Avg. of 30 samples}} \\ \cmidrule{2-5} & \parbox{2cm}{\centering Speaker\\ Verification (Score, 0-1) }& \parbox{2.2cm}{\centering Speech \\ Recognition (WER \%)} &\parbox{2cm}{\centering Speaker\\ Verification (Score, 0-1) }& \parbox{2.2cm}{\centering Speech \\ Recognition (WER \%)}\\ \midrule Resampling & 0.233 & 29.73\%& 0.170& 91.83\% \\ Amplitude Compression & 0.217 & 34.31\% & 0.184 & 63.4\% \\ Filtering & 0.623& 17.12\% & 0.319& 62.21\%\\ Additive Noise & 0.318 & 53.13\% & 0.192 & 96.34\%\\ Lossy Compression & Reject & Reject& Reject & Reject\\ Equalization & Reject & Reject& Reject& Reject\\ \bottomrule \end{tabular} \end{table*} \smallskip \noindent \textbf{Acoustic Nonce Removal.} An adversary may attempt to remove the embedded acoustic nonce and obtain a ``clean'' speech sample to conduct re-use attacks. To test the robustness of \texttt{AEOLUS\xspace}\ in this adversarial setting, we use 6 common audio watermark removal techniques~\cite{wu2005efficiently} (see Appendix~\ref{appendix:nonce_removal} for details). Each technique is iteratively used until the acoustic nonce cannot be detected in a speech sample. The removal attempts are repeated for all speech samples in the dataset mentioned above. Table~\ref{table:speaker_iden} shows that nonce removal techniques reduced the average recognition performance of the commercial speaker recognition system by 79.52\%, and increased the average word error rate of the speech recognition system by 33.57\%. \subsection{Human Perception} \subsubsection{Empirical Measurement.} In this experiment, we empirically measure the change in SPL due to the embedded nonce. The distance between VDS\xspace output and the recording device is 1 m in dining hall and conference room, and 0.7 m in the car. The results (see Appendix Figure~\ref{fig:dbdifference}) show that the average SPL difference in each environment is less than 1.4\%. Non-parametric Wilcoxon Signed Rank test~\cite{wilcoxon1970critical} (at 95\% confidence level) is used to measure the statistical significance of the difference in SPL before and after acoustic nonce embedding. The results indicate that the differences are statistically insignificant. \begin{table*}[b] \centering \scriptsize \caption{Perception of speech samples. Overall (\%) is the proportion of participants that label speech samples as imperceptible, non-disruptive, or disruptive. Sample (\%) is the proportion of speech samples (with nonce) that are determined to be imperceptible, non-disruptive, or disruptive by the majority of participants.} \vspace{-0mm} \label{tab:userstudy_overview} \begin{tabular}{l|c|c|c} \toprule[1.5pt] Location & \parbox[t]{2.9cm}{Imperceptible \\ (Overall/Sample\%)} & \parbox[t]{2.9cm}{Non-disruptive \\ (Overall/Sample\%)} &\parbox[t]{3.1cm}{Disruptive, Nonce-caused \\ (Overall/Sample\%)}\\ \midrule Conference Room & 34.87\%/50\% & 50\%/50\% & 1.31\%/0\% \\ Dining Hall & 32.64\%/25\% & 41.67\%/75\% & 7.64\%/0\%\\ Gas Station (Car) & 32.14\%/25\% & 42.86\%/75\% & 8.57\%/0\% \\ \bottomrule \end{tabular} \end{table*} \begin{comment} \begin{table}[h] \centering \small \vspace{-0mm} \caption{User Study Survey Questions.} \label{tab:surveyquestion} \begin{tabular}{cl} \toprule[1.5pt] Question & \parbox{2.7cm}{Options}\\ \midrule \multirow{7}{*}{\parbox[m]{4cm}{Q1. Pretend you are using voice-based service in a dining area, can you hear the speech in this audio clearly?}} &A. Very Clear \\ &B. Clear.\\ &\parbox{2.7cm}{C. It is neither clear or unclear but I am fine with it.} \\ &\\ &\parbox{2.7cm}{D. I can hear the speech but it is very unclear.} \\ & \\ &\parbox{2.7cm}{E. I cannot hear any speech.} \\ \midrule \multirow{2}{*}{\parbox[m]{4cm}{Q2. Please transcribe the speech.}} & [Text]: \_\_\_\_ \\ & \\ \midrule \multirow{2}{*}{\parbox[m]{4cm}{Q3. How noisy is this audio, rate from 0 - 10? (10 is most noisy)}} & [0-10]: \_\_\_\_ \\ & \\ \midrule \multirow{5}{*}{\parbox[m]{4cm}{Q4. Do you find any noise affects your user experience?}} & \parbox[m]{2.7cm}{A. I can hear something, but nothing bothers me.} \\ & \\ & \parbox[m]{2.7cm}{B. Yes, there is something troubles me. } \\ & \\ & C. Nothing at all \\ \midrule \multirow{3}{*}{\parbox[m]{4cm}{Q5. If there are some noises affect your user experience for the voice service, what is it?}} & [Text]: \_\_\_\_ \\ & \\ &\\ \bottomrule \end{tabular} \end{table} \end{comment} \smallskip\noindent\textbf{User Study.} Next, we study the impact of \texttt{AEOLUS\xspace}\ on VDS\xspace usability. For this, 120 participants (with prior experience using a VDS\xspace) from various demographics (age groups, gender shown in Appendix Table~\ref{tab:group_userstudy}) are recruited on Amazon Mechanical Turk. Each participant is presented with a survey that takes approximately 10 minutes to complete. Post completion of the survey, a participant is paid 4 USD as incentive. The survey questions are designed to ensure bias is not introduced in the results (no leading questions). Each participant is asked to enter their demographic information. The participant is then instructed to play a test sample and adjust the playback volume to a comfortable level. Following this, the participant is presented with a survey with five speech samples and follow up questions. Included in the five samples is one sample with only background noise (and no speech) to check if the participant is attentive. The participants are asked to provide speech transcriptions for all samples and the provided transcriptions are used to check the participants' attentiveness. Eleven participants failed to pass this test and hence were excluded. The test samples are uniformly selected at random from a dataset of 24 speech recordings, 12 recordings each with and without embedded nonce from the three environments. The average length of the speech samples is 6.4 seconds. To ensure the user study is unbiased, all samples presented to a participant are from the same speaker and pertain to the same voice command. After listening to a speech sample, a participant is asked to rate the noise level of the speech sample on a scale of 0 - 10 (10 being the highest noise level). The participant is also instructed to report any noticeable noise source that affects their experience, and to specify the characteristic of the noise that resulted in this disruption (e.g., human conversation, train or car noise). The answer is used to ascertain the source of noise that impacted the usability (e.g., the embedded nonce). \smallskip \noindent \textbf{Results.} Table~\ref{tab:userstudy_overview} reports the average human perception ratings. The acoustic nonce does not degrade overall user experience for 94.16\% of speech samples, on average, in the three environments. Since this does not adequately measure the participant's perception of nonce embedding for each sample, per speech sample perception is also reported. No speech sample with embedded nonce is perceived to be disruptive by the majority of participants. \begin{comment} We show some example comments from respondents who reported that the noise in the audio affects their user experience, \begin{itemize}[leftmargin=*] \setlength\itemsep{0.5em} \item[] \textit{Compared to the other samples, the background voices are much louder. In fact, a man speaking almost overpowered the voice I is supposed to listen to.} (P-004, G2\footnote{G1, G2, G3 are respectively the participant groups for testing audios collected in the conference room, dining hall, and gas station.}) \end{itemize} \noindent We find some respondents reported other noise sources but the acoustic nonce. For example, P-004 says the people chatting in the dining hall affected his user experience of VDS\xspace. \begin{itemize}[leftmargin=*] \setlength\itemsep{0.5em} \item[] \textit{Car noises, but the singing is also very far away and hard to hear.} (P-072, G3) \end{itemize} \noindent Similarly, P-072 is complaining about street noise in Q5. \begin{itemize}[leftmargin=*] \setlength\itemsep{0.5em} \item[] \textit{An echo, or like it is far away.} (P-019, G1) \end{itemize} \noindent Some respondents reported the acoustic nonce in Q5. For example, P-019 reported the echo sound and claimed it is affecting her user experience of VDS\xspace. \end{comment} \begin{comment} \begin{table}[h] \centering \small \vspace{-0mm} \caption{Imperceptibility for Different User Groups.} \vspace{-0mm} \label{tab:group_userstudy} \begin{tabular}{lcl} \toprule[1.5pt] User Group & \parbox[t]{4.5cm}{Imperceptible / Non-disruptive / Disruptive \%} & \parbox[t]{1.1cm}{Number \\ Participant }\\ \midrule Female & 51.6\% / 32.3\%/ 16\% & \\ Male & 65\% / 33\% / 2\% & \\ Age: 18-34 & 35.6\% / 42.5\%/ 21.8\% & \\ Age: 35-49 & 37\% / 55.5\%/ 7.4\% & \\ Age: 50+ & 62.4\% / 22\%/ 15.6\% & \\ \bottomrule \end{tabular} \end{table} \end{comment} \begin{comment} \smallskip \noindent \textbf{Imperceptibility for Different User Groups.} We further discuss how people from different groups perceive acoustic nonce. We find younger people tend to be more sensitive in differentiating the nonce and background noise. This may be due to the age-related hearing loss, showing the younger population are more sensitive to the noise. As expected, participants from different genders do not show a significant difference in perceiving acoustic nonce. \end{comment} \begin{table}[h] \centering \scriptsize \caption{Average perceived noise (on a scale of 0-10) in speech samples with and without acoustic nonce collected in the three environments.} \label{tab:noise_userstudy} \begin{tabular}{lcccc} \toprule[1.5pt] Location & \parbox[t]{1.7cm}{w/o Nonce} & \parbox[t]{1.7cm}{w/ Nonce} & t-test, $\alpha=0.05$ & Statistically Significant \\ \midrule Conference Room & 3.8 & 4.8 & $t =4.2022, p =0.0001489$ & Yes\\ Dining Hall & 5.7 & 6.1 & $t=1.4595, p =0.1524$ & No\\ Gas Station (Car) & 5 & 5.6 & $t=3.0697, p=0.00389$ & Yes\\ \bottomrule \end{tabular} \end{table} \smallskip \noindent \textbf{Perceived Noise Level.} Table~\ref{tab:noise_userstudy} shows that the speech samples containing the acoustic nonce are perceived to have a higher noise level. The dependent samples paired t-test (at 95\% confidence) indicates a statistically significant difference (between samples with and without nonce) in the conference room and car. However, this difference is statistically insignificant in the dining hall due to higher background noise level compared to the conference room and car. Despite perceiving higher noise level, the majority of participants do not perceive any speech sample to be disruptive (see Table~\ref{tab:userstudy_overview}). \section{Experiment Setup} \begin{comment} \smallskip \noindent \textbf{Audio Watermark Removal.} As discussed in Section~\ref{sec:vfhss}, we aim to test \texttt{AEOLUS\xspace}\ with 6 common audio watermark removal techniques. All these techniques are implemented using Matlab which has many audio signal processing libraries such as Audio Toolbox, Wavelet Toolbox. \smallskip \noindent \textbf{Speaker Recognition.} We use Microsoft Speaker Recognition system~\cite{ms_speaker} as the target testing function. To remove human factors in this test, we use synthesized speech with Amazon Polly~\cite{polly} as the voice input to enroll a speaker profile. Then the same synthesis scheme is used to generate testing speech to test with the profile identification system. Two types of simulation are conducted in this work. \smallskip \noindent \textbf{MCRoomSim.} First, to evaluate how different parameters affect encoded the propagation of acoustic waves in a room, we leverage a Matlab-based library, MCRoomSim~\cite{wabnitz2010room}. While Acoustic Communication Kit provides transmitter and receiver parts of \texttt{AEOLUS\xspace}, we also simulate how acoustic waves propagate in the indoor environment. MCRoomSim allows \texttt{AEOLUS\xspace}\ to be tested exclusively before the real-world experiments. In MCRoomSim, various physical environment parameters are set to qualitatively test \texttt{AEOLUS\xspace}. For example, one can adjust the room size, air absorption, etc. \section{Introduction} \label{sec:intro} Voice-driven services (VDS) are widely deployed in commercial products to enable personalized and convenient experiences for consumers. Examples include digital assistants from Amazon, Apple and Google for performing tasks like smart home control and online commerce in a hands-free manner, and automated and human-assisted voice response systems for customer support. While this increasing ubiquity can be primarily attributed to improved real world performance of deep learning driven speech and speaker recognition, security is an equally important consideration in operational settings. To secure VDS\xspace in practice, one of the common security mechanisms used is ``voice password''. For example, applications such as Samsung Bixby, Wechat and others~\cite{bixbypassword,wechatpassword,mobileapp_password} prompt users to speak a password and perform two factor authentication by checking (i) if the spoken passphrase is correct, and (ii) it was spoken by the authorized user. \begin{figure}[t] \centering \includegraphics[width=0.8\linewidth]{figures/ReUse_vs_Replay.pdf} \caption{Difference between re-use and replay attacks. In both cases, an adversary records a user’s interaction with a voice driven service (VDS) ``A'', over-the-air as shown in (a). In case of re-use (b), the recorded interaction is used to attack the same type of VDS A, while in case of replay (c), the interaction can be used to attack the same or different type of VDS A’.} \label{fig:firstarch} \end{figure} Voice passwords, however, do not provide security against voice spoofing techniques such as speech replays~\cite{gong2018protecting,pradhan2019combating,leng2020replay} and synthesis~\cite{synthesisattack}. While there are known practical limitations in conducting speech synthesis attacks (e.g., the attack proposed in~\cite{synthesisattack} requires 24 hours of high quality training data), it is easier to conduct replay attacks in practice. Broadly, there are two categories of defense mechanisms that aim to prevent speech replays. The first class of methods use machine learning to determine whether a speech sample is produced by a human or replayed using a playback device~\cite{chen2017you,wang2020differences}. The second category of techniques use external devices (e.g., a vibration sensor) to check if the speech is produced by a human in real-time~\cite{feng2017continuous}. For machine learning techniques, real world performance usually depends on training data and its relevance to the test environment. A state-of-the-art method Void~\cite{ahmed2020void}, as an example, has significantly different equal error rates (EER), 0.3\% and 11.6\%, on two speech datasets collected in two different environments. Another practical limitation is unreliability of playback device signatures used by machine learning techniques~\cite{wang2020differences}. In addition, for methods that use extra hardware, there are usability and cost implications for practical deployment. In this work, we aim to address a subset of replay attacks, called \textit{speech re-use} attacks. We define speech re-use attacks to be specific to a certain type of VDS. As shown in Figure~\ref{fig:firstarch}, let A and A' be the VDS types for the capture and attack steps, respectively. Replay attacks typically consider a variety of VDS types for capture and attack steps (A = A' and A $\neq$ A'), while re-use attacks are a subset of replay attacks where the VDS types in consideration for the capture and attack steps is similar (A = A'). The proposed security overlay prevents re-use attacks on protected VDS. For example, if the security overlay is integrated with each Alexa's VDS, it can prevent speech captured from user interaction with one Alexa's VDS from being re-used on another Alexa's VDS. This is similar to the device specific random pattern used in Face ID to counter digital and physical spoofs~\cite{faceID_security} (see Figure \ref{fig:facial}). We present \texttt{AEOLUS\xspace}\footnote{Named after Aelous, the "Keeper of the Winds" in Greek mythology.}, a security overlay that proactively embeds a dynamic acoustic nonce in the voice channel via the microphone at the time of user interaction, and detects the presence of the embedded nonce in the speech recorded by the speaker to ensure speech freshness. \texttt{AEOLUS\xspace}\ is designed as a software solution, and can be integrated by a vendor with any closed-loop VDS\xspace that involves real-time user interaction. It is useful for providing additional security in critical applications such as user authentication and payments. \texttt{AEOLUS\xspace}\ does not require any extra hardware and works with in-built speaker and microphone in consumer products. \texttt{AEOLUS\xspace}\ is secure by design against attacks that remove the embedded nonce for speech re-use. It uses Frequency-hopping spread spectrum (FHSS)~\cite{cvejic2004algorithms}~\cite{cvejic2004spread} technique for dynamic acoustic nonce embedding. Similar techniques have been previously used to watermark audio recordings for copyright purposes~\cite{swanson1998robust}~\cite{bassia2001robust}. However, their application in offline audio watermarking is fundamentally different from VDS\xspace operational setting where the length and content of the input speech is unknown apriori. \texttt{AEOLUS\xspace}\ is designed for real-time over-the-air use without prior knowledge of the input speech. \texttt{AEOLUS\xspace}\ addresses two key practical challenges. The first challenge is to reliably embed an acoustic nonce over-the-air and retrieve it successfully from the recorded speech. Over-the-air acoustic nonce propagation is affected by factors such as background noise and distance between microphone and loudspeaker~\cite{chenmetamorph}. The latter, for instance, results in distorted and attenuated speech signal which increases the likelihood of errors while extracting the embedded acoustic nonce. The second challenge is to embed the acoustic nonce such that it is imperceptible to a VDS\xspace user. Achieving imperceptibility is non-trivial in light of the first challenge. This is because an important consideration for reliability is embedding acoustic nonce of certain strength which, in turn, makes the acoustic nonce perceptible. Therefore, we model acoustic nonce generation as an optimization problem and compute the set of optimal parameters, e.g., nonce's operating frequency, amplitude, bitrate in different environments using differential evolution. \begin{figure}[t] \centering \includegraphics[width=0.8\linewidth]{figures/facial.pdf} \caption{(a) Face ID's device-specific random IR pattern projection at the time of user authentication for preventing re-use~\cite{faceID_security}. Analogous to (a), the proposed security overlay (b) uses a random acoustic nonce at the time of user interaction to prevent speech re-use in voice-driven systems.} \label{fig:facial} \end{figure} We evaluate \texttt{AEOLUS\xspace}\ in three different environments and show that it works reliably upto a range of 4 m. Additionally, we conduct a user study involving 120 subjects (approved by the institutional human study review board) to evaluate the imperceptibility of the embedded nonce. The results of the study show that majority of users find the embedded acoustic nonce to be either imperceptible or non-disruptive. \noindent In summary, the contributions of this work are as follows: \begin{itemize} \item Design of a VDS\xspace security overlay called \texttt{AEOLUS\xspace}\ to ensure freshness of input speech without any extra hardware dependency. \item Modeling acoustic nonce propagation as an optimization problem to address i) reliability, i.e. ensuring successful embedding and retrieval of dynamic acoustic nonce without impacting VDS functionality, and (ii) imperceptibility, i.e. to have minimal impact on VDS users' experience. \item Comprehensive real-world evaluation to show that \texttt{AEOLUS\xspace}\ can work effectively (0.5\% false reject rate (FRR) and 0\% false accept rate (FAR) in detecting speech re-use) up to a range of 4 meters in three different environments. \item User study with 120 subjects to demonstrate that the embedded acoustic nonce does not degrade user experience. \end{itemize} \begin{comment} \item \textcolor{red}{Comprehensive real-world evaluation to show that \texttt{AEOLUS\xspace}\ can work effectively ($0\%$ equal error rate (EER)\footnote{Equal error rate (EER) is the error rate at which false acceptance rate (FAR) and false rejection rate (FRR) are equal. The lower the EER, the more effective the system.} in detecting speech re-use up) to a range of 4 meters in three different environments.} \end{comment} \section{Proposed Security Overlay} \label{sec:design} \begin{figure}[t] \centering \begin{subfigure}[b]{0.49\textwidth} \centering \includegraphics[width=1\linewidth]{figures/overview3.pdf} \caption{} \label{fig:overview3_a} \end{subfigure} \hfill \begin{subfigure}[b]{0.49\textwidth} \centering \includegraphics[width=1\linewidth]{figures/aeolus_design.pdf} \caption{} \label{fig:overview3_b} \end{subfigure} \caption{Use of the proposed security overlay to prevent speech re-use in voice-driven services. (a) At the time of user interaction, an acoustic nonce is generated and embedded in over-the-air channel, and its presence is detected in the recorded speech to ensure speech freshness. (b) \texttt{AEOLUS\xspace}{-enabled} VDS\xspace components with the associated data flows. Shown in blue and grey are the components used to prevent speech re-use.} \label{fig:overview3} \end{figure} \subsection{Threat Model} The following assumptions are made while designing \texttt{AEOLUS\xspace}\ to address the speech re-use attack scenario. The hardware device (loudspeaker and microphone) that is used by a user to interact with VDS\xspace is trusted and secure, and an adversary cannot disable the speaker or the microphone. The proposed overlay can be used by a VDS\xspace to generate, embed, and detect acoustic nonce. At the time of user interaction, the method used to trigger a VDS\xspace, e.g., words or phrases like ``Alexa'' and ``Hey, Siri'' are not protected but can initiate the proposed overlay to prevent re-use of voice commands and confidential passphrases. For example, to prevent re-use of a user's voice password to access recent account transactions when the user is interacting with a voice banking VDS\xspace~\cite{paypalpin}. An adversary can use a commodity recording device to record prior user interactions with ``any'' \texttt{AEOLUS\xspace}-enabled VDS\xspace, and re-use the recorded interaction to attack any \texttt{AEOLUS\xspace}-enabled VDS\xspace. Attack scenarios where an adversary can record or access clean user speech samples (i.e., recordings without embedded acoustic nonce) to launch replay or speech synthesis attacks are considered out of scope and are not addressed. The key underlying assumptions are that (i) users typically interact with VDS\xspace using specific commands (e.g., a user-defined passphrase~\cite{bixbypassword}) and these commands can be protected with the proposed overlay, and (ii) it is difficult to record clean samples of these commands from interaction with unprotected devices or in human conversations. However, this does not limit the use of \texttt{AEOLUS\xspace}\ in conjunction with other defense mechanisms for replay or speech synthesis attacks. \subsection{Core Components} \label{subsec:goals} To prevent speech re-use in VDS\xspace, \texttt{AEOLUS\xspace}\ uses three core components, nonce generation, nonce embedding and nonce detection. \smallskip\noindent\textbf{Nonce Generation.} The nonce generation module is invoked upon initiation of a new user interaction session (see Figure~\ref{fig:overview3_b} \textcircled{1}). Akin to nonce-based authentication~\cite{tsai2009efficient,bellare1995provably}, the module generates a digital nonce (a random number of a length $L$) that is valid for the current session. Nonce length $L$ should be sufficiently large to prevent use of duplicate nonces in different sessions. Given limited bandwidth of over-the-air channel and estimated user base for popular VDS\xspace (e.g., Alexa skill has 300,000 daily users~\cite{alexadailyuser}), the minimum permitted value of $L$ is set to 32 bits. 32-bit long nonce is sufficient to protect short speech samples (e.g., a voice passphrase) in a particular session. Nonce repetition is permitted to protect longer speech samples during the session. The nonce $\delta$ for session $S$ is stored in a set $S_{set}$. $S_{set}$ is subsequently used by the nonce detection module to determine if the embedded nonce is current. \smallskip\noindent\textbf{Nonce Embedding.} Post nonce generation, an encoding algorithm, Binary Frequency Shift Keying (BFSK)~\cite{park2010underwater,truax2001acoustic}, is used to encode the generated digital nonce as an acoustic nonce. Each bit is independently encoded as a cosine wave $\omega_i$. Bit ``0'' is encoded as a 1kHz cosine wave, and bit ``1'' as a 5 kHz cosine wave. All cosine waves in the set $\omega$ are concatenated to yield the acoustic nonce $\delta$. The acoustic nonce $\delta$ is embedded in over-the-air channel using VDS\xspace playback device ( Figure~\ref{fig:overview3_b} \textcircled{2}). An important parameter for nonce embedding is the time duration of the embedded acoustic nonce relative to the time duration of user interaction. Using a real-world dataset with 27,000 samples~\cite{gong2019remasc}, we estimate that the average user interaction is 3 sec. As an example, let the minimum duration of embedded nonce be half of the average user interaction. In this case, the acoustic nonce embedding would require a bitrate of 14 bits/sec, and the maximum duration of each component cosine wave $w_i$ can be 42 ms. Note that this estimate does not consider the idle time in user interaction. Additionally, to prevent an adversary from obtaining clean speech sample by removing the embedded nonce, the nonce embedding module leverages Frequency-hopping Spread Spectrum (FHSS)~\cite{cvejic2004spread,cvejic2004algorithms}. FHSS is a well-known technique that provides high robustness against standard embedded signal removal attacks. For high robustness, the module uses FHSS with a set of different frequencies and periodically selects the operating frequency at random. \smallskip\noindent\textbf{Nonce Detection.} Once user interaction ends, the recorded audio is processed using the nonce detection module (Figure~\ref{fig:overview3_b} \textcircled{3}). The module decodes the acoustic nonce using BFSK, and checks that (i) the nonce is completely decoded, and (ii) the decoded nonce is current. The recorded speech is subsequently processed using standard VDS\xspace modules (Figure~\ref{fig:overview3_b} \textcircled{4}). If nonce detection fails or if the decoded nonce has a high Bit Error Rate (BER), a recourse action (e.g. a retry or reject) can be taken. Furthermore, if speech is reused by an adversary and both the current nonce and the obsolete nonce from re-used speech are detected, information about re-used speech such as when and where it was recorded can be determined from $S_{set}$. Another scenario can be signal interference between the current and obsolete nonce resulting in inappropriate decoding result. In such case, pertinent recourse action can be taken. \section{Related Work} \noindent\textbf{Two Factor Authentication} One effective way of authenticating an insecure channel is to use secured factors to assist the authentication process. For example, text messages are used to prove users' identity in online banking, shopping, etc. In voice channel authentication aspect, Feng et al.~\cite{feng2017continuous} presents a method to authenticate a human speaker with extra sensors that collect body-surface vibrations. Another way of preventing replay attacks is to identify the loud speakers used in attacking voice channel~\cite{chen2017you}. In specific, the magnetic field incurred by using loud speakers are used to detect replay attacks. However, this technique works only in very close range (within 8 centimeter). Due to these limitations, these techniques are not practical enough for real-world deployment, and hence, are not used in popular VCS. In this work, we aim to design a defense solution that works in a reasonable range without extra devices needed. \noindent\textbf{Challenge-response Authentication.} Challenge-response protocols are used to mitigate replay attacks in authentication over data channel. In this approach, typically, a randomly generated key (either public or private) is used for authentication. However, in the setting of using voice assists, such shared keys between a human user and VCS does not exist. Our mitigation, essentially uses the concept of challenge-response authentication in the data communication and applies it in the context of open voice channel to prevent replay attack. \noindent\textbf{Audio Passphrases.} VCS users might authenticate using a predefined passphrase even when speaker recognition is not incorporated. However, this passphrase is spoken in an open voice channel and not an encrypted data channel. Once the attacker eavesdrops the passphrase s/he could replay it in future. Our mitigation can even protect replay of passphrases similar to the way nonce authentication protects replay of authentication credentials. \noindent\textbf{Audio Watermarking Techniques.} Traditional digital audio watermarking techniques have already been studied in~\cite{swanson1998robust}~\cite{bassia2001robust}. The fundamental differences between our work and watermarking techniques are three-folded. First, we work with a real-time system rather than an existing audio files. Therefore, our system needs to work in real-time with various audio length and content. Second, we work with open voice channels and not an offline audio file, and therefore, it is not as simple as mixing the audio watermarking with an audio file offline. Third, the main goal of previous audio watermarking is to provide copyright protection, while we mainly aim to prevent replay attacks. Hence, the embedded information should be dynamic in our technique, unlike a static copyright information embedded in an audio file. \smallskip\noindent\textbf{Voice-driven Customer Service} Voiceprint-based speaker recognition is being used to verify the identity of customers. For example, Citi Bank launched voiceprint-based authentication in 2016~\cite{citivoiceprint}. Within the first year itself, over 1 million customers used the service in Asia Pacific region. Like voice-based payments, voice-driven customer service is susceptible to speech re-use for authenticate.
\section{Introduction} A spatial dimension $N\geq 2$ and an exponent $p \in (1,+\infty)$ are given. Let $\Omega$ be an open bounded set in $\mathbb{R}^{N}$ and let $f$ belong to $L^{q_{0}}(\Om)$ with \begin{equation} \label{Eq 1.1} q_{0}=(p^{*})^{\prime}\,\ \text{if}\,\ 1<p<N, \qquad q_{0}>1 \,\ \text{if} \,\ p=N, \qquad q_{0}=1 \,\ \text{if} \,\ p>N, \end{equation} where $p^{*}=Np/(N-p)$ and $(1/p^{*})+(1/(p^{*})^{\prime})=1$. In this paper, every open set is nonempty. In view of the Sobolev embeddings (see, for instance, \cite[Theorem 7.10]{PDE}), the functional $E_{f,\Omega}$ defined over $W^{1,p}_{0}(\Omega)$ by \[ E_{f,\Omega}(u)=\frac{1}{p}\int_{\Omega} |\nabla u|^{p}\diff x - \int_{\Omega} fu \diff x \] is finite. It is a well-known fact that for each closed proper subset $\Sigma$ of $\overline{\Omega}$ the functional $E_{f,\Omega}$ admits a unique minimizer $u_{f,\Omega,\Sigma}$ over $W^{1,p}_{0}(\Omega\backslash \Sigma)$. Furthermore, the Sobolev function $u_{f,\Omega,\Sigma}$ is a unique solution to the Dirichlet problem \begin{equation*} -\Delta_{p}u = f \,\ \text{in}\,\ \Omega\backslash \Sigma,\,\ u \in W^{1,p}_{0}(\Omega\backslash \Sigma). \end{equation*} The latter means that $u_{f,\Omega,\Sigma} \in W^{1,p}_{0}(\Omega\backslash \Sigma)$ and \begin{equation*} \int_{\Om} |\nabla u_{f,\Omega,\Sigma}|^{p-2} \nabla u_{f,\Om,\Sigma} \nabla \varphi \diff x= \int_{\Om}f\varphi \diff x\qquad \forall \varphi \in W^{1,p}_{0}(\Omega\backslash \Sigma). \end{equation*} Notice that if a closed set $\Sigma \subset \overline{\Omega}$ has zero $p$-capacity (for the definition of capacity, see Section 2), then $u_{f,\Omega,\Sigma}=u_{f,\Omega,\emptyset}$ (see Remark~\ref{rem 2.8}). The dependence of $u_{f,\Omega,\Sigma}$ on $p$ is neglected in this paper. For each closed proper subset $\Sigma$ of $\overline{\Omega}$, the $p$-compliance functional at $\Sigma$ is defined by \[ C_{f,\Omega}(\Sigma)=-E_{f,\Omega}(u_{f,\Omega,\Sigma})=\frac{1}{p^{\prime}}\int_{\Omega}|\nabla u_{f,\Omega,\Sigma}|^{p}\diff x = \frac{1}{p^{\prime}}\int_{\Omega}fu_{f,\Omega,\Sigma}\diff x. \] The purpose of this paper is to prove the importance of the connectedness assumption in the statements of the following two shape optimization problems for the existence of solutions to these problems. \begin{problem} \label{P 1.1} Let $p \in (N-1, +\infty)$. Given $\lambda>0$, find a set $\s \subset \overline{\Om}$ minimizing the functional $\mathcal{F}_{\lambda,f,\Omega}$ defined by \[ \mathcal{F}_{\lambda,f,\Omega}({\s}^{\prime})=C_{f,\Omega}({\s}^{\prime})+ \lambda \mathcal{H}^{1}({\s}^{\prime}) \] among all sets $\Sigma^{\prime}$ in the class $\mathcal{K}(\Omega)$ of all closed connected proper subsets of $\overline{\Omega}$. \end{problem} \begin{problem} \label{P 1.2} Let $p \in (N-1, +\infty)$. Given $L>0$, find a set $\s \subset \overline{\Om}$ minimizing the $p$-compliance functional $C_{f,\Omega}$ among all sets $\Sigma^{\prime}$ in the class $\mathcal{A}_{L}(\Omega)$ of all closed connected subsets of $\overline{\Omega}$ satisfying the constraint $ 0<\mathcal{H}^{1}(\Sigma^{\prime})\leq L.$ \end{problem} These two problems were studied in \cite{Butazzo-Santambrogio,MR3063566,MR3195349,Opt,p-compl,partialregularity}, however, until this paper, the importance of the connectedness of admissible sets in their statements for the existence of solutions had not been proved, but it was simply mentioned as a remark without proof in \cite{Opt} for the special case $N=p=2$. In this paper, we provide a detailed proof in any spatial dimension $N\geq 2$ for every $p\in (N-1,+\infty)$ and for the sharp integrability assumption on the source term $f \in L^{q_{0}}(\Omega)$. It is worth noting that any closed set $\Sigma^{\prime}\subset\overline{\Omega}$ with $\mathcal{H}^{1}(\Sigma^{\prime})<+\infty$ is removable for the Sobolev space $W^{1,p}_{0}(\Omega)$ if $p\in (1,N-1]$ (see, for instance, Theorem~\ref{thm 2.2} and Remark~\ref{rem 2.8}), namely, $W^{1,p}_{0}(\Omega \backslash \Sigma^{\prime})=W^{1,p}_{0}(\Omega)$ and this implies that $C_{f,\Omega}(\Sigma^{\prime})=C_{f,\Omega}(\emptyset)$. Thus, defining Problem~\ref{P 1.1} for some exponent $p \in (1, N-1]$, we would get only trivial solutions to this problem: every point $x_{0}$ in $\overline{\Omega}$ and the empty set. On the other hand, every set $\Sigma^{\prime}$ in $\mathcal{A}_{L}(\Omega)$ would be a solution to Problem~\ref{P 1.2} if this problem were defined for $p\in (1,N-1]$. Also, if $\Sigma^{\prime}\subset \overline{\Omega}$ is a closed set such that $\Sigma^{\prime}\cap \Omega$ is of Hausdorff dimension one and with finite $\mathcal{H}^{1}$-measure, then $\Sigma^{\prime}$ is not removable for $W^{1,p}_{0}(\Omega)$ if and only if $p\in (N-1,+\infty)$ (see Corollary~\ref{cor 2.4} and Remark~\ref{rem 2.8}). Furthermore, a point $x_{0}\in \Omega$ is not removable for $W^{1,p}_{0}(\Omega)$ if and only if $p\in (N,+\infty)$ (see Theorem~\ref{thm 2.2}, Remark~\ref{rem 2.3} and Remark~\ref{rem 2.8}). Therefore, Problem~\ref{P 1.1} and Problem~\ref{P 1.2} are interesting only in the case when $p\in (N-1,+\infty)$. We also assume that $f \neq 0$ in $L^{q_{0}}(\Omega)$, because otherwise the $p$-compliance functional $C_{f,\Omega}(\cdot)$ would be reduced to zero, and then each solution to Problem~\ref{P 1.1} would be either a point $x_{0} \in \overline{\Omega}$ or the empty set, and any set in $\mathcal{A}_{L}(\Omega)$ would be a solution to Problem~\ref{P 1.2}. It is clear that replacing the class $\mathcal{K}(\Omega)$ in the statement of Problem~\ref{P 1.1} by the class of all closed connected subsets $\Sigma^{\prime}$ of $\overline{\Omega}$ satisfying the estimate $C_{f,\Omega}(\Sigma^{\prime})+\lambda\mathcal{H}^{1}(\Sigma^{\prime})\leq C_{f,\Omega}(\emptyset)$ does not actually change Problem~\ref{P 1.1}. Thus, from now on we shall talk only about those admissible sets $\Sigma^{\prime}$ for Problem~\ref{P 1.1} for which the estimate $C_{f,\Omega}(\Sigma^{\prime})+\lambda\mathcal{H}^{1}(\Sigma^{\prime})\leq C_{f,\Omega}(\emptyset)$ holds. The connectedness assumption, together with the bounds on the length (i.e., $\mathcal{H}^{1}$-measure) of admissible sets for Problem~\ref{P 1.1} and Problem~\ref{P 1.2}, gives the necessary compactness to prove that these two problems admit a solution (see \cite{sverak} for $p=2$ and \cite{Bucur} for the general case). In this paper, we prove the following two theorems. \begin{theorem} \label{thm 1.3} Let $\Om \subset \mathbb{R}^{N}$ be open and bounded, $\lambda>0$, $p \in (N-1, + \infty)$, $f \in L^{q_{0}}(\Om)$, $f \not =0$,~$q_{0}$~is defined in (\ref{Eq 1.1}). Then the existence of minimizers for the functional $\mathcal{F}_{\lambda,f,\Omega}$ over the class of all closed proper subsets of $\overline{\Omega}$ fails. \end{theorem} \begin{theorem} \label{thm 1.4} Let $\Om \subset \mathbb{R}^{N}$ be open and bounded, $L>0$, $p \in (N-1, + \infty)$, $f \in L^{q_{0}}(\Om)$, $f \not =0$,~$q_{0}$~is defined in (\ref{Eq 1.1}). Then the existence of minimizers for the $p$-compliance functional $C_{f,\Omega}$ over the class $\bigl\{\Sigma^{\prime}\subset \overline{\Omega}: \,\ \Sigma^{\prime}\,\ \text{is closed},\,\ 0<\mathcal{H}^{1}(\Sigma^{\prime})\leq L\bigr\}$ fails. \end{theorem} \section{Preliminaries} For any nonempty open set $U\subset \mathbb{R}^{N}$, $W^{1,p}(U)$ is the Sobolev space of functions defined on $U$ whose distributional gradient $\nabla u$ belongs to $L^{p}(U;\mathbb{R}^{N})$. We denote by $W^{1,p}_{0}(U)$ the closure of $C^{\infty}_{0}(U)$ in $W^{1,p}(U)$, where $C^{\infty}_{0}(U)$ is the space of functions in $C^{\infty}(U)$ with compact support in $U$. By $C^{0}(X)$ we shall denote the space of continuous functions on $X$. For each set $A \subset \mathbb{R}^{N}$, the set $A^{c}$ will denote its complement in $\mathbb{R}^{N}$, that is, $A^{c}=\mathbb{R}^{N}\backslash A$. We shall denote by $\mathcal{H}^{d}(A)$ the $d$-dimensional Hausdorff measure of $A$. Let us recall the notion of the Bessel capacity (see e.g. \cite{Potential}, \cite{Ziemer}). \begin{defn} \label{def 2.1} \textit{ For $p\in (1,+\infty)$, the Bessel $(1,p)$-capacity of a set $E\subset \mathbb{R}^{N}$ is defined as \[ {\rm Cap}_{p}(E)=\inf \bigl\{\|f\|^{p}_{L^{p}(\mathbb{R}^{N})} :\, g*f \geq 1\,\ \text{on}\,\ E,\,\ f\in L^{p}(\mathbb{R}^{N}),\,\ f \geq 0\bigr\}, \] where the Bessel kernel $g$ is defined as that function whose Fourier transform is} \[ \hat{g}(\xi)=(2\pi)^{-\frac{N}{2}}\bigl(1+|\xi|^{2}\bigr)^{-\frac{1}{2}}. \] \end{defn} We say that a property holds $p$-quasi everywhere (abbreviated as $p$-q.e.) if it holds except on a set $A$ where $\cp_{p}(A)=0$. It is worth mentioning that, by \cite[Corollary 2.6.8]{Potential}, for every $p\in (1,+\infty)$, the notion of the Bessel capacity ${\rm Cap}_{p}$ is equivalent to the following \[ \widetilde{{\rm Cap}_{p}}(E)=\inf_{u \in W^{1,p}(\mathbb{R}^{N})}\biggl\{\int_{\mathbb{R}^{N}}|\nabla u|^{p}\diff x + \int_{\mathbb{R}^{N}}|u|^{p}\diff x : u \geq 1 \,\ \text{on some neighborhood of $E$}\biggr\} \] in the sense that there exists $C=C(N,p)>0$ such that for any set $E\subset \mathbb{R}^{N}$, \[ \frac{1}{C}\widetilde{{\rm Cap}_{p}}(E) \leq {\rm Cap}_{p}(E) \leq C\widetilde{{\rm Cap}_{p}}(E). \] The notion of capacity is crucial in the investigation of the pointwise behavior of Sobolev functions. For convenience, we recall the next theorems and propositions. \begin{theorem}\label{thm 2.2} Let $E\subset \mathbb{R}^{N}$ and $p\in (1,N]$. Then $\cp_{p}(E)=0$ if $\mathcal{H}^{N-p}(E)<+\infty$. Conversely, if $\cp_{p}(E)=0$, then $\mathcal{H}^{N- p+\varepsilon}(E)=0$ for every $\varepsilon>0$. \end{theorem} \begin{proof} For a proof of the fact that ${\rm Cap}_p(E)=0$ if $\mathcal{H}^{N-p}(E)<+\infty$, we refer to \cite[Theorem 5.1.9]{Potential}. The fact that if ${\rm Cap}_{p}(E)=0,$ then $\mathcal{H}^{N-p+\varepsilon}(E)=0$ for every $\varepsilon>0$ follows from \cite[Theorem 5.1.13]{Potential}. \end{proof} \begin{rem}\label{rem 2.3} Let $p \in (N,+\infty)$. Then, there exists $C=C(N,p)>0$ such that for any nonempty set $E\subset \mathbb{R}^{N}$, ${\rm Cap}_p(E)\geq C$. We can take $C= {\rm Cap}_{p}(\{0\})$, which is positive by \cite[Proposition 2.6.1 (a)]{Potential}, and use the fact that the Bessel $(1,p)$-capacity is an invariant under translations and is nondecreasing with respect to set inclusion. \end{rem} Recall that for all $E\subset \mathbb{R}^{N}$ the number \[ \hdim(E)=\sup\bigl\{s \in [0,+\infty): \mathcal{H}^{s}(E)=+\infty\bigr\}=\inf\bigl\{t\in [0,+\infty): \mathcal{H}^{t}(E)=0\bigr\} \] is called the Hausdorff dimension of $E$. \begin{cor}\label{cor 2.4} Let $E \subset \mathbb{R}^{N}$, $\hdim(E)=1$ and $\mathcal{H}^{1}(E)<+\infty$. Then ${\rm Cap}_p(E)>0$ if and only if $p\in (N-1, +\infty)$. \end{cor} \begin{proof}[Proof of Corollary \ref{cor 2.4}] If $p>N$, then by Remark~\ref{rem 2.3}, ${\rm Cap}_{p}(E)>0$. Assume by contradiction that ${\rm Cap}_{p}(E)=0$ for some $p \in (N-1,N]$. Taking $\varepsilon= (p-N+1)/2$ so that $0<N-p+\varepsilon<1$, by Theorem~\ref{thm 2.2} we get, $\mathcal{H}^{N-p+\varepsilon}(E)=0$, but this leads to a contradiction with the fact that $\hdim(E)=1$. On the other hand, if $p \in (1, N-1]$, then $\mathcal{H}^{N-p}(E)<+\infty$ and by Theorem~\ref{thm 2.2}, ${\rm Cap}_{p}(E)=0$. This completes the proof of Corollary~\ref{cor 2.4}. \end{proof} \begin{prop} \label{prop 2.5} Let $t\in (0,1]$ and $A_{t}=[0, t]\times \{0\}^{N-1}$. Then the following assertions hold. \begin{enumerate}[label=(\roman*)] \item If $p \in (N-1, N)$, then there exists a constant $C=C(N,p)>0$ such that \[ t^{N-p} \leq C {\rm Cap}_{p}(A_{t}). \] \item If $p=N$, then there exists a constant $C=C(N)>0$ such that \[ \biggl(\log\biggl(\frac{C}{t}\biggr)\biggr)^{1-p} \leq C {\rm Cap}_{p}(A_{t}). \] \end{enumerate} \end{prop} \begin{proof} Since $\diam(A_{t})\leq 1$, $(i)$ and $(ii)$ follows from \cite[Corollary 5.1.14]{Potential}. \end{proof} \begin{defn} \label{def 2.6} Let the function $u$ be defined $p$-q.e. on $\mathbb{R}^{N}$ or on some open subset. Then $u$ is said to be $p$-quasi continuous if for every $\varepsilon>0$ there is an open set $A$ with ${\rm Cap}_{p}(A)<\varepsilon$ such that the restriction of $u$ to the complement of $A$ is continuous in the induced topology. \end{defn} \begin{theorem} \label{thm 2.7} Let $Y\subset \mathbb{R}^{N}$ be an open set and $p \in (1,+\infty)$. Then for each $u \in W^{1,p}(Y)$ there exists a $p$-quasi continuous function $\widetilde{u} \in W^{1,p}(Y)$, which is uniquely defined up to a set of ${\rm Cap}_{p}$-capacity zero and $u=\widetilde{u}$ a.e. in $Y$. \end{theorem} \begin{proof} We refer the reader, for instance, to the proof of \cite[Theorem 2.8]{p-compl}, which actually applies for the general spatial dimension $N\geq 2$. \end{proof} \begin{rem} \label{rem 2.8} A Sobolev function $u \in W^{1,p}(\mathbb{R}^{N})$ belongs to $W^{1,p}_{0}(Y)$ if and only if its $p$-quasi continuous representative $\widetilde{u}$ vanishes $p$-q.e. on $Y^{c}$ (see \cite[Theorem 4]{BAGBY} and \cite[Lemma 4]{Hedberg}). Thus, if $Y^{\prime}$ is an open subset of $Y$ and $u \in W^{1,p}_{0}(Y)$ such that $\widetilde{u}=0$ $p$-q.e. on $Y\backslash Y^{\prime}$, then the restriction of $u$ to $ Y^{\prime}$ belongs to $W^{1,p}_{0}(Y^{\prime})$ and conversely, if we extend a function $u \in W^{1,p}_{0}(Y^{\prime})$ by zero on $Y\backslash Y^{\prime}$, then $u \in W^{1,p}_{0}(Y)$. It is worth mentioning that if $\Sigma \subset \overline{Y}$ and ${\rm Cap}_{p}(\s)=0$, then $W^{1,p}_{0}(Y) = W^{1,p}_{0}(Y \backslash \s)$. Indeed, $u \in W^{1,p}_{0}(Y)$ if and only if $u \in W^{1,p}(\mathbb{R}^{N})$ and $\widetilde{u}=0$ $p$-q.e. on $Y^{c}$ that is equivalent to say $u\in W^{1,p}(\mathbb{R}^{N})$ and $\widetilde{u}=0$ $p$-q.e. on $Y^{c} \cup \s$ (since ${\rm Cap}_{p}(\Sigma)=0$ and ${\rm Cap}_{p}(\cdot)$ is a subadditive set function, see \cite[Proposition 2.3.6]{Potential}) or $u \in W^{1,p}_{0}(Y \backslash \s)$. In the sequel we shall always identify $u \in W^{1,p}(Y)$ with its $p$-quasi continuous representative $\widetilde{u}$. \end{rem} \begin{prop} \label{prop 2.9} Let $D\subset \mathbb{R}^{N}$ be a bounded extension domain and let $u \in W^{1,p}(D)$. Consider the set $E=\overline{D} \cap \{x: u(x)=0\}$. If $\cp_{p}(E)>0$, then there exists a constant $C=C(N,p,D)>0$ such that \[ \int_{D}|u|^{p}\diff x \leq C ({\rm Cap}_p(E))^{-1} \int_{D} |\nabla u|^{p}\diff x. \] \end{prop} \begin{proof} For a proof, see, for instance, \cite[Corollary 4.5.3, p. 195]{Ziemer}. \end{proof} \section{Proofs of Theorem~\ref{thm 1.3} and Theorem~\ref{thm 1.4}} To prove Theorem~\ref{thm 1.3} and Theorem~\ref{thm 1.4}, we need the following two lemmas. \begin{lemma}\label{lem 3.1} Let $p\in (N-1, +\infty)$, $a \in (0,1),\, \delta>0$ and $u \in W^{1,p}((0,\delta)^{N})$ satisfying $u=0\,\ p$-q.e. on $\bigl[\delta/2-a \delta/2, \delta/2+ a \delta/2\bigr] \times \bigl\{\delta/2\bigr\}^{N-1}$. Then there exists $C=C(N,p)>0$ such that \[ \int_{(0, \delta)^{N}} |u|^{p} \diff x \leq C \delta^{p} ({\rm Cap}_{p}([0, a]\times \{0\}^{N-1}))^{-1} \int_{(0, \delta)^{N}} |\nabla u|^{p}\diff x. \] \end{lemma} \begin{proof}Define a function $v \in W^{1,p}((0,1)^{N})$ by $v(\cdot)=u(\delta(\cdot))$. Then we observe that $v=0$ $p$-q.e. on $\bigl[1/2-a/2,1/2+a/2\bigr]\times~\bigl\{1/2\bigr\}^{N-1}$. By Proposition~\ref{prop 2.9} and the fact that the Bessel $(1,p)$-capacity is an invariant under translations and is nondecreasing with respect to set inclusion, there exists a constant $C=C(N,p)>0$ such that \[ \int_{(0,1)^{N}} |v|^{p} \diff y \leq C ({\rm Cap}_{p}([0, a]\times \{0\}^{N-1}))^{-1} \int_{(0,1)^{N}} |\nabla v|^{p}\diff y. \] Finally, using the change of variables $x=\delta y$, we recover the desired estimate. \end{proof} \begin{lemma}\label{lem 3.2} Let $\Omega\subset \mathbb{R}^{N}$ be open and bounded, $\Sigma$ be a closed proper subset of $\overline{\Omega}$, $p \in (1,+\infty)$ and $f_{1}, f_{2} \in L^{q_{0}}(\Omega)$, where $q_{0}$ is defined in (\ref{Eq 1.1}). Let $z:[0,+\infty)\to [0, +\infty)$ be defined by \[ z(t)=t^{p^{\prime}}\,\ \, \text{if} \,\ 2\leq p<+\infty, \qquad z(t)=\Bigl(\|f_{1}\|^{p^{\prime}}_{L^{q_{0}}(\Omega)}+\|f_{2}\|^{p^{\prime}}_{L^{q_{0}}(\Omega)}\Bigr)^{2-p}t^{p}\,\ \, \text{if}\,\ 1<p<2. \] Then there exists a constant $A=A(p)>0$ such that \[ C_{f_{1},\Omega}(\Sigma)\leq 2^{p-1}C_{f_{2},\Omega}(\Sigma)+ Az(\|f_{1}-f_{2}\|_{L^{q_{0}}(\Omega)}). \] \end{lemma} \begin{proof} According to \cite[Theorem 2.3]{ABC}, there exists $C=C(p)>0$ such that \[ \int_{\Omega}|\nabla u_{f_{1},\Omega,\Sigma}-\nabla u_{f_{2},\Omega, \Sigma}|^{p}\diff x \leq Cz(\|f_{1}-f_{2}\|_{L^{q_{0}}(\Omega)}). \] Since for any nonnegative numbers $c$ and $d$, $(c+d)^{p}\leq 2^{p-1}(c^{p}+d^{p})$, we deduce that \begin{align*} \frac{1}{p^{\prime}}\int_{\Omega}|\nabla u_{f_{1},\Omega,\Sigma}|^{p}\diff x &\leq \frac{2^{p-1}}{p^{\prime}}\int_{\Omega}|\nabla u_{f_{2},\Omega,\Sigma}|^{p}\diff x + \frac{2^{p-1}}{p^{\prime}}\int_{\Omega}|\nabla u_{f_{1},\Omega, \Sigma}-\nabla u_{f_{2}, \Omega, \Sigma}|^{p}\diff x\\ &\leq \frac{2^{p-1}}{p^{\prime}}\int_{\Omega}|\nabla u_{f_{2},\Omega,\Sigma}|^{p}\diff x+ 2^{p-1}Cz(\|f_{1}-f_{2}\|_{L^{q_{0}}(\Omega)}). \end{align*} Thus, defining $A=2^{p-1}C$, we complete the proof of Lemma~\ref{lem 3.2}. \end{proof} \begin{proof}[Proof of Theorem~\ref{thm 1.3}] Since $\Omega$ is bounded, there exists $R>0$ such that $\Omega$ is contained in the $N$-cube $Q=(-R,R)^{N}$.\\ \textit{Step 1.} We start by proving that for any $g \in L^{p^{\prime}}(Q)$, $\inf \bigl\{ \mathcal{F}_{\lambda,g,\Omega}(\Sigma): \Sigma \subsetneqq \overline{\Omega}\,\ \text{is closed}\bigr\}=0.$ First of all, notice that $\inf\bigl\{\mathcal{F}_{\lambda, g, \Omega}(\Sigma): \Sigma\subsetneqq \overline{\Omega}\,\ \text{is closed}\bigr\}$ is equal to \begin{equation}\label{3.1} \inf \biggl\{ \frac{1}{p^{\prime}} \int_{\Omega} |\sigma|^{p^{\prime}} \diff x + \lambda \mathcal{H}^{1}(\Sigma): \Sigma \subsetneqq \overline{\Omega} \,\ \text{is closed,}\,\ \sigma \in L^{p^{\prime}}(\Omega; \mathbb{R}^{N}), -div(\sigma)=g \,\ \text{in} \,\ \mathcal{D}^{\prime}(\Omega\backslash \Sigma)\biggr\}, \end{equation} which is a direct consequence of \cite[Lemma A.3]{p-compl}. Fix an arbitrary $\varepsilon \in (0,1)$. We construct a sequence $\{(\sigma_{n},S_{n})\}_{n\in \mathbb{N}^{*}}$ of admissible pairs for problem~(\ref{3.1}) such that \[ \limsup_{n\to+\infty}\biggl(\frac{1}{p^{\prime}}\int_{\Omega} |\sigma_{n}|^{p^{\prime}}\diff x+\lambda \mathcal{H}^{1}(S_{n})\biggr) \leq \lambda 2^{N}R\varepsilon. \] For each integer $n\geq 1$ and each point $\xi^{n}$ in the set~$\bigl\{jR/n : j \in \bigl\{-n,...,n-1 \bigr\} \bigr\}^{N}$, we define the open ``local $N$-cube" $Q(\xi^{n})\subset Q$ by \[ Q(\xi^{n})=\Biggl(\xi^{n}+\biggl(0,\frac{R}{n}\biggr)^{N}\Biggr), \] the ``crack'' set $S(\xi^{n})\subset Q(\xi^{n})$ by \[ S(\xi^{n})=\Biggl(\xi^{n}+\biggl[\frac{R}{2n} -\frac{\varepsilon R}{2 n^{N}}, \frac{R}{2n} + \frac{\varepsilon R}{2 n^{N}}\biggr] \times \biggl\{\frac{R}{2n}\biggr\}^{N-1}\Biggr) \] (see Figure \ref{Figure grid}), and the space $W_{\xi^{n}}$ consisting of the Sobolev functions $w \in W^{1,p}(Q(\xi^{n}))$ vanishing $p$-q.e. on $S(\xi^{n})$, that is, \[ W_{\xi^{n}}=\bigl\{w \in W^{1,p}(Q(\xi^{n})) : w=0 \,\ p \text{-q.e. on}\;\ S(\xi^{n})\bigr\}. \] \begin{figure} \centering \includegraphics[width=.5\textwidth]{Grid-1.png} \caption{Construction of the $N$-cubes $Q(\xi^{n})$ and the crack sets $S(\xi^{n})$ in the proof of Theorem~\ref{thm 1.3}.} \label{Figure grid} \end{figure} Notice that $W_{\xi^{n}}$ is closed in $W^{1,p}(Q(\xi^{n}))$. Indeed, assume that $(w_{m})_{m\in \mathbb{N}}\subset W_{\xi^{n}}$ and $w_{m}\to w$ in $W^{1,p}(Q(\xi^{n}))$. We fix a function $\chi \in C^{\infty}_{0}(Q(\xi^{n}))$ such that $\chi=1$ on $S(\xi^{n})$. For each $m\in \mathbb{N},$ we have $w_{m}\chi \in W^{1,p}(Q(\xi^{n}))$ and $w_{m}\chi =0$ $p$-q.e. on $(Q(\xi^{n}))^{c}\cup S(\xi^{n})$. Then, according to Remark~\ref{rem 2.8}, $(w_{m}\chi)_{m\in \mathbb{N}}\subset W^{1,p}_{0}(Q(\xi^{n})\backslash S(\xi^{n}))$. In addition, $w_{m}\chi \to w \chi$ in $W^{1,p}_{0}(Q(\xi^{n})\backslash S(\xi^{n}))$ and hence $w\chi=0$ $p$-q.e. on $(Q(\xi^{n}))^{c}\cup S(\xi^{n})$ (see Remark~\ref{rem 2.8}). But this implies that $w=0$ $p$-q.e. on $S(\xi^{n})$ and therefore $w \in W_{\xi_{n}}$. For convenience, we define the set \[ A_{\varepsilon,n}=\biggl[0, \frac{\varepsilon}{n^{N-1}}\biggr]\times \biggl\{0\biggr\}^{N-1}. \] Next, changing variables if necessary and applying Lemma~\ref{lem 3.1} with $a=\varepsilon/n^{N-1}$ and $\delta=R/n$, we deduce that for each $w \in W_{\xi^{n}}$, the inequality \[ \int_{Q(\xi^{n})} |w|^{p}\diff x \leq \frac{C}{n^{p}} ({\rm Cap}_{p}(A_{\varepsilon,n}))^{-1} \int_{Q(\xi^{n})} |\nabla w|^{p}\diff x \numberthis \label{3.2} \] holds for some $C=C(N,p,R)>0$. Since $(W_{\xi^{n}},\|\cdot\|_{W^{1,p}(Q(\xi^{n}))})$ is a reflexive Banach space and the functional $F_{\xi^{n}}:W_{\xi^{n}}\to \mathbb{R}$ defined by \[ F_{\xi^{n}}(w)=\frac{1}{p}\int_{Q(\xi^{n})} |\nabla w|^{p}\diff x - \int_{Q(\xi^{n})} gw \diff x \] is lower semicontinuous, coercive (thanks to (\ref{3.2})) and strictly convex, using the direct method in the Calculus of Variations, we deduce that $F_{\xi^{n}}$ admits a unique minimizer $u_{\xi^{n}}$ over $W_{\xi^{n}}$. It should be noted that the same is true in the case when $g \in L^{q_{0}}(Q)$ thanks to the Sobolev embeddings, but we shall use, in particular, the fact that $g \in L^{p^{\prime}}(Q)$ to derive some nice estimates below. It follows from the minimality of $u_{\xi^{n}}$ that \[ \lim_{t\to 0+}\frac{1}{t}(F_{\xi^{n}}(u_{\xi^{n}}+tw)-F_{\xi^{n}}(u_{\xi^{n}}))\geq 0 \,\ \,\ \text{and} \,\ \,\ \lim_{t\to 0+}\frac{1}{t}(F_{\xi^{n}}(u_{\xi^{n}}-tw)-F_{\xi^{n}}(u_{\xi^{n}}))\geq 0 \,\ \,\ \forall w \in W_{\xi^{n}}. \] This implies that \[ \int_{Q(\xi^{n})} |\nabla u_{\xi^{n}}|^{p-2} \nabla u_{\xi^{n}} \nabla w \diff x = \int_{Q(\xi^{n})} g w \diff x \qquad \forall w \in W_{\xi^{n}} \numberthis \label{3.3} \] and, in particular, \[ \int_{Q(\xi^{n})} |\nabla u_{\xi^{n}}|^{p} \diff x = \int_{Q(\xi^{n})} g u_{\xi^{n}} \diff x. \] Applying H\"{o}lder's inequality to the right-hand side of the latter formula and then the inequality (\ref{3.2}) to $u_{\xi^{n}}$, we obtain that \[ \int_{Q(\xi^{n})} |\nabla u_{\xi^{n}}|^{p}\diff x\leq \frac{C^{\frac{1}{p}}}{n}({\rm Cap}_{p}(A_{\varepsilon,n}))^{-\frac{1}{p}}\Biggl(\int_{Q(\xi^{n})}|g|^{p^{\prime}}\diff x \Biggr)^{\frac{1}{p^{\prime}}}\Biggl(\int_{Q(\xi^{n})}|\nabla u_{\xi^{n}}|^{p}\diff x \Biggr)^{\frac{1}{p}} \] and hence \begin{equation}\label{3.4} \int_{Q(\xi^{n})} |\nabla u_{\xi^{n}}|^{p} \diff x \leq \frac{\widetilde{C}}{n^{p^{\prime}}} ({\rm Cap}_{p}(A_{\varepsilon,n}))^{1-p^{\prime}} \int_{Q(\xi^{n})} |g|^{p^{\prime}} \diff x, \end{equation} where $\widetilde{C}=\widetilde{C}(N,p,R)>0$. Here we have used the fact that $g \in L^{p^{\prime}}(Q)$. For each $n\in\mathbb{N}^{*}$, let $\sigma_{n} \in L^{p^{\prime}}(Q; \mathbb{R}^{N})$ be defined as follows \[ \left.\sigma_{n} \right |_{Q(\xi^{n})}:= |\nabla u_{\xi^{n}}|^{p-2} \nabla u_{\xi^{n}} \,\ \text{for each}\,\ Q(\xi^{n}) \subset Q. \] Also, for each $n\in \mathbb{N}^{*}$, define the compact set ${\s}_{n} \subset Q$ by $\Sigma_{n}:= \bigcup S(\xi^{n}),$ where the union is taken over all $S(\xi^{n})$ in $Q$. Then \begin{align*} \int_{Q} |\sigma_{n}|^{p^{\prime}}\diff x = \sum \int_{Q(\xi^{n})} |\nabla u_{\xi^{n}}|^{p}\diff x & \stackrel{(\ref{3.4})}{\leq} \frac{\widetilde{C}}{n^{p^{\prime}}} ({\rm Cap}_{p}(A_{\varepsilon,n}))^{1-p^{\prime}} \sum \int_{Q(\xi^{n})} |g|^{p^{\prime}}\diff x \\ & = \frac{\widetilde{C}}{n^{p^{\prime}}} ({\rm Cap}_{p}(A_{\varepsilon,n}))^{1-p^{\prime}} \int_{Q}|g|^{p^{\prime}}\diff x, \numberthis \label{3.5} \end{align*} where the summations are taken over all $N$-cubes $Q(\xi^{n}) \subset Q$. On the other hand, \[ \mathcal{H}^{1}(\Sigma_{n})= 2^{N}R \varepsilon. \numberthis \label{3.6} \] Let us now fix an arbitrary function $\varphi \in C^{\infty}_{0}(\Omega\backslash {\s}_{n})$. We extend $\varphi$ by zero outside $\Omega\backslash \Sigma_{n}$ and keep the same notation for this extension. It is clear that the restriction of $\varphi$ on each $Q(\xi^{n})\subset Q$ belongs to $W_{\xi^{n}}$. Then, using the optimality condition (\ref{3.3}) and the fact that $\varphi=0$ on $\Omega^{c}\cup \Sigma_{n}$, we get \begin{align*} \int_{\Omega} \sigma_{n} \nabla \varphi \diff x = \sum \int_{Q(\xi^{n})} |\nabla u_{\xi^{n}}|^{p-2} \nabla u_{\xi^{n}} \nabla \varphi \diff x = \sum \int_{Q(\xi^{n})} g \varphi \diff x = \int_{\Omega} g \varphi \diff x, \end{align*} where the summations are taken over all $N$-cubes $Q(\xi^{n}) \subset Q$. This implies that \[ -div(\sigma_{n})=g \,\ \text{in}\,\ \mathcal{D^{\prime}}(\Omega\backslash {\s}_{n}). \] So for each $n\in\mathbb{N}^{*}$, defining $S_{n}$ by $S_{n}=\Sigma_{n}\cap\overline{\Omega}$, we observe that $(\sigma_{n}, S_{n})$ is an admissible pair for problem (\ref{3.1}). Let us consider the next three cases.\\ \textit{Case 1: $p\in (N-1,N)$}. By Proposition~\ref{prop 2.5} $(i)$ applied with $t=\varepsilon/n^{N-1}$, there exists $C_{0}=C_{0}(N,p)>0$ such that \[ \frac{\varepsilon^{N-p}}{n^{(N-1)(N-p)}} \leq C_{0} {\rm Cap}_{p}(A_{\varepsilon,n}) \] and hence \[ ({\rm Cap}_{p}(A_{\varepsilon,n}))^{1-p^{\prime}} \leq C n^{(N-1)(N-p)(p^{\prime}-1)} \] for some $C=C(\varepsilon, p, N)>0$. Since $p\in (N-1,N)$, we observe that $(N-1)(N-p)(p^{\prime}-1)<p^{\prime}$.\\ \textit{Case 2: $p=N.$} By Proposition~\ref{prop 2.5} $(ii)$ applied with $t=\varepsilon/n^{N-1}$, there exists $C_{0}=C_{0}(N)>0$ such that \[ \biggr(\log\biggr(\frac{C_{0}n^{N-1}}{\varepsilon}\biggl)\biggl)^{1-p} \leq C_{0} {\rm Cap}_{p}(A_{\varepsilon,n}) \] and hence \[ ({\rm Cap}_{p}(A_{\varepsilon,n}))^{1-p^{\prime}} \leq C \log (Cn) \] for some $C=C(\varepsilon, N)>0$.\\ \textit{Case 3: $p>N$.} In this case, by Remark~\ref{rem 2.3}, there exists $C=C(N,p)>0$ such that \[ ({\rm Cap}_{p}(A_{\varepsilon,n}))^{1-p^{\prime}} \leq C. \] Thus, returning to the estimate (\ref{3.5}), we can now conclude that for any fixed $p>N-1$ there exists a nonnegative function $\psi$, defined on $(0, +\infty)$, such that $\psi(n) \to 0$ as $n\to +\infty$ and \[ \int_{Q} |\sigma_{n}|^{p^{\prime}}\diff x \leq \psi(n). \] Letting $n$ tend to $+\infty$ in the above estimate, taking into account the fact that $\mathcal{H}^{1}(S_{n})\leq \mathcal{H}^{1}(\Sigma_{n})$ and the estimate $(\ref{3.6})$, we get that the infimum in problem (\ref{3.1}) is less than or equal to $\lambda2^{N}R\varepsilon$ and hence \[ \inf \bigl\{\mathcal{F}_{\lambda,g,\Omega}(\s): \Sigma \subsetneqq \overline{\Omega}\,\ \text{is closed}\bigr\} \leq \lambda 2^{N} R \varepsilon. \] As $\varepsilon \in (0,1)$ was arbitrarily chosen, \[ \inf \bigl\{\mathcal{F}_{\lambda,g,\Omega}(\s): \Sigma \subsetneqq \overline{\Omega}\,\ \text{is closed}\bigr\}=0. \] \textit{Step 2.} We prove that $\inf\bigl\{\mathcal{F}_{\lambda,f,\Omega}(\Sigma): \s \subsetneqq \overline{\Omega}\,\ \text{is closed}\bigr\}=0$. Let us fix a sequence $(f_{m})_{m\in\mathbb{N}}\subset L^{p^{\prime}}(Q)$ such that $f_{m}\to f$ in $L^{q_{0}}(\Omega)$. Next, using Lemma~\ref{lem 3.2} and if $p\in (1,2)$, then using also the fact that the sequence $(\|f_{m}\|_{L^{q_{0}}(\Omega)})_{m\in \mathbb{N}}$ is bounded, we deduce that there exist a constant $A=A(p)>0$ and a nonnegative function $z\in C^{0}([0,+\infty))$ satisfying $z(0)=0$ such that for all $m\in \mathbb{N}$, \[ \inf_{\Sigma \subsetneqq \overline{\Omega}\, \text{is closed}}\mathcal{F}_{\lambda,f,\Omega}(\Sigma)\leq 2^{p-1}\inf_{\Sigma \subsetneqq \overline{\Omega}\, \text{is closed}}\mathcal{F}_{\lambda,f_{m},\Omega}(\Sigma)+Az(\|f-f_{m}\|_{L^{q_{0}}(\Om)})=Az(\|f-f_{m}\|_{L^{q_{0}}(\Om)}), \] where we have used the result of \textit{Step 1}. Next, letting $m$ tend to $+\infty$ in the above estimate, we deduce that $\inf\bigl\{\mathcal{F}_{\lambda,f,\Omega}(\Sigma): \s \subsetneqq \overline{\Omega}\,\ \text{is closed}\bigr\}=0$. \\ \textit{Step 3.} Assume by contradiction that there is a solution $\widetilde{\Sigma}$ to the problem \[\inf\bigl\{\mathcal{F}_{\lambda,f,\Omega}(\Sigma): \s \subsetneqq \overline{\Omega} \,\ \text{is closed}\bigr\}.\] From \textit{Step 2} it follows that $C_{f,\Omega}(\widetilde{\Sigma})=\mathcal{H}^{1}(\widetilde{\Sigma})=0$. Then $u_{f,\Omega,\widetilde{\Sigma}}=0$ as an element of $W^{1,p}(\Omega)$. By the minimality of $u_{f,\Omega,\widetilde{\Sigma}}$ (recall that $u_{f,\Omega,\widetilde{\Sigma}}$ is a unique minimizer of $E_{f,\Omega}$ over $W^{1,p}_{0}(\Omega\backslash \widetilde{\Sigma})$) and the fact that $u_{f,\Omega,\widetilde{\Sigma}}=0$, \[ 0=\lim_{t\to 0+}\frac{1}{t}\Bigl(E_{f,\Omega}\Bigl(u_{f,\Omega,\widetilde{\Sigma}}+t\zeta\Bigr)-E_{f,\Omega}\Bigl(u_{f,\Omega,\widetilde{\Sigma}}\Bigr)\Bigr)=\lim_{t\to 0+}\frac{1}{t}E_{f,\Omega}(t\zeta)=-\int_{\Omega} f \zeta \diff x\,\ \,\ \forall \zeta \in C^{\infty}_{0}(\Omega \backslash \widetilde{\Sigma}), \] which implies that $f=0$ a.e. in $\Omega$ and leads to a contradiction. This completes our proof of Theorem~\ref{thm 1.3}. \end{proof} \begin{proof}[Proof of Theorem \ref{thm 1.4}] There exists $R>0$ such that $\Omega \subset (-R,R)^{N}$. Fix an arbitrary $g \in L^{p^{\prime}}((-R,R)^{N})$. This is a direct consequence of \cite[Lemma A.3]{p-compl} that $\inf\bigl\{C_{g,\Omega}(\Sigma): \Sigma \subset\overline{\Omega}\,\ \text{is closed}, \,\ 0<\mathcal{H}^{1}(\Sigma)\leq L\bigr\}$ is equal to \begin{equation*} \inf\biggl\{\frac{1}{p^{\prime}}\int_{\Omega}|\sigma_{\Sigma}|^{p^{\prime}}\diff x: \Sigma \subset \overline{\Omega}\,\ \text{is closed},\,\ 0<\mathcal{H}^{1}(\Sigma)\leq L,\,\ \sigma_{\Sigma}\in L^{p^{\prime}}(\Omega;\mathbb{R}^{N}),-div(\sigma_{\Sigma})=g\,\ \text{in}\,\ \mathcal{D}^{\prime}(\Omega\backslash \Sigma) \biggr\}. \end{equation*} Then, proceeding in the same way as in \textit{Step 1} in the proof of Theorem~\ref{thm 1.3}, we can construct a sequence $(\sigma_{\Sigma_{n}})_{n\in \mathbb{N}^{*}} \subset L^{p^{\prime}}(\Omega; \mathbb{R}^{N})$ such that for each $n\in \mathbb{N}^{*}$, $\Sigma_{n}\subset \overline{\Omega}$ is closed, $0<\mathcal{H}^{1}(\Sigma_{n})\leq L$, $-div(\sigma_{\Sigma_{n}})=g$ in $\mathcal{D}^{\prime}(\Omega\backslash \Sigma_{n})$ and, in addition, \[ \lim_{n\to +\infty}\int_{\Omega}|\sigma_{\Sigma_{n}}|^{p^{\prime}}\diff x=0. \] Thus $\inf\bigl\{C_{g,\Omega}(\Sigma): \Sigma \subset\overline{\Omega}\,\ \text{is closed},\,\ 0<\mathcal{H}^{1}(\Sigma)\leq L\bigr\}=0.$ Now let $(f_{m})_{m\in\mathbb{N}}\subset L^{p^{\prime}}((-R,R)^{N})$ be a sequence such that $f_{m}\to f \,\ \text{in}\,\ L^{q_{0}}(\Omega)$. We already know that for each $m\in\mathbb{N}$, \[\inf\bigl\{C_{f_{m},\Omega}(\Sigma): \Sigma \subset\overline{\Omega}\,\ \text{is closed},\,\ 0<\mathcal{H}^{1}(\Sigma)\leq L\bigr\}=0.\] This, together with Lemma~\ref{lem 3.2} and the fact that $\|f-f_{m}\|_{L^{q_{0}}(\Omega)}\to 0$ as $m\to +\infty$, implies that \[ \inf\bigl\{C_{f,\Omega}(\Sigma): \Sigma \subset\overline{\Omega}\,\ \text{is closed}, \,\ 0<\mathcal{H}^{1}(\Sigma)\leq L\bigr\}=0. \] Suppose now by contradiction that there is a solution $\widetilde{\Sigma}$ to the above problem. Since $C_{f,\Omega} (\widetilde{\Sigma})=0$, we have $u_{f,\Omega,\widetilde{\Sigma}}=0$ as an element of $W^{1,p}(\Omega)$. Then, using the minimality of $u_{f,\Omega,\widetilde{\Sigma}}$, we deduce that \[ \int_{\Omega}f\zeta\diff x=0 \qquad \forall \zeta \in C^{\infty}_{0}(\Omega\backslash \widetilde{\Sigma}), \] which implies that $f=0$ a.e. in $\Omega$ and leads to a contradiction. This completes the proof of Theorem~\ref{thm 1.4}. \end{proof} \textit{Acknowledgments.} I thank Antoine Lemenant for suggesting that I work on this problem, for his support and valuable comments on the manuscript. Also I am grateful to Antonin Chambolle for fruitful discussions. This work was partially supported by the project ANR-18-CE40-0013 SHAPO financed by the French Agence Nationale de la Recherche (ANR).
\section{Introduction} Macroeconomic models with heterogeneous agents have exploded in popularity in recent years.\footnote{For references and discussion, see \citet{Krueger2016}, \citet{Ahn2017}, and \citet{Kaplan2018JEP}.} New micro data sets -- including firm and household surveys, social security and tax records, and censuses -- have exposed the empirical failures of traditional representative agent approaches. The new models not only improve the fit to the data, but also make it possible to meaningfully investigate the causes and consequences of inequality among households or firms along several dimensions, including endowments, financial constraints, age, size, location, etc. So far, however, empirical work in this area has only been able to exploit limited features of the micro data sources that motivated the development of the new models. As emphasized by \citet{Ahn2017}, the burgeoning academic literature has mostly calibrated model parameters and performed over-identification tests by matching a few empirical moments that are deemed important \emph{a priori}. This approach may be highly inefficient, as it ignores that the models' implied macro dynamics and cross-sectional properties often fully determine the entire \emph{distribution} of the observed macro and micro data. The failure to exploit the joint information content of macro and micro data stands in stark contrast to the well-developed inference procedures for estimating \emph{representative} agent models using only macro data \citep{Herbst2016}. To exploit the full information content of macro and micro data, we develop a general technique to perform Bayesian inference in heterogeneous agent models. We assume the availability of aggregate time series data as well as repeated cross sections of micro data. Evaluation of the joint macro and micro likelihood function is complicated by the fact that the model-implied cross-sectional distributions typically depend on unobserved aggregate state variables. To overcome this problem, we devise a way to compute a numerically unbiased estimate of the model-implied likelihood function of the macro and micro data. As argued by \citet{Andrieu2010} and \citet{Flury2011}, such an unbiased likelihood estimate can be employed in standard Markov Chain Monte Carlo (MCMC) procedures to generate draws from the fully efficient Bayesian posterior distribution given all available data. The starting point of our analysis is the insight that existing solution methods for heterogeneous agent models directly imply the functional form of the joint sampling distribution of macro and micro data, given structural parameters. These models are typically solved numerically by imposing a flexible functional form on the relevant cross-sectional distributions (e.g., a discrete histogram or parametric family of densities). The distributions are governed by time-varying unobserved state variables (e.g., moments). To calculate the model-implied likelihood, we decompose it into two parts. First, heterogeneous agent models are typically solved using the method of \citet{Reiter2009}, which linearizes with respect to the macro shocks but not the micro shocks. Hence, the \emph{macro part} of the likelihood can be evaluated using standard linear state space methods, as proposed by \citet{Mongey2017} and \citet{Winberry2018}.\footnote{If non-Reiter model solution methods are used, our general estimation approach could in principle still be applied, though its computational feasibility would be context-dependent, as discussed in \cref{sec:concl}.} Second, the likelihood of the repeated cross sections of \emph{micro data, conditional on the macro state variables}, can be evaluated by simply plugging into the assumed cross-sectional density. The key challenge that our method overcomes is that the econometrician typically does not directly observe the macro state variables. Instead, the observed macro time series are imperfectly informative about the underlying states. Our procedure can loosely be viewed as a rigorous Bayesian version of a two-step approach: First we estimate the latent macro states from macro data, and then we compute the model-implied cross-sectional likelihood conditional on these estimated macro states. More precisely, we obtain a \emph{numerically unbiased} estimate of the likelihood by averaging the cross-sectional likelihood across repeated draws from the smoothing distribution of the hidden states given the macro data. We emphasize that, despite being based on a likelihood estimate, our method is fully Bayesian and automatically takes into account all sources of uncertainty about parameters and states. An attractive computational feature is that evaluation of the micro part of the likelihood lends itself naturally to parallel computing. Hence, computation time scales well with the size of the data set. Though our baseline method is designed for repeated cross sections of micro data, we present ideas for exploiting panel data in \cref{sec:panel}. We perform finite-sample valid and fully efficient Bayesian inference by plugging the unbiased likelihood estimate into a standard MCMC algorithm. The generic arguments of \citet{Andrieu2010} and \citet{Flury2011} imply that the ergodic distribution of the MCMC chain is the full-information posterior distribution that we would have obtained if we had known how to evaluate the exact likelihood function (not just an unbiased estimate of it). This is true no matter how many smoothing draws are used to compute the unbiased likelihood estimate. In principle, we may use any MCMC posterior sampling algorithm that relies only on evaluating (the unbiased estimate of) the posterior density, such as Random Walk Metropolis-Hastings. In contrast to other estimation methods, our full-information method is automatically finite-sample efficient and can easily handle unobserved individual heterogeneity, micro measurement error, as well as data imperfections such as selection or censoring. In an important early work, \citet{Mongey2017} propose to exploit micro data by collapsing it to time series of cross-sectional moments and incorporating these into the macro likelihood. \emph{In principle}, this approach can be as efficient as our full-information approach if the structural model implies that these moments are sufficient statistics for the micro data. We provide examples where this is not the case, for example due to the presence of unobserved individual heterogeneity and/or micro measurement error. Even when sufficient statistics do exist, it is necessary to properly account for sampling error in the observed cross-sectional moments, which is done automatically by our full-information likelihood method, but could be delicate and imprecise for moment-based approaches. Moreover, textbook adjustments to the micro likelihood allow us to accommodate specific empirically realistic features of micro data such as selection (e.g., over-sampling of large firms) or censoring (e.g., top-coding of income), whereas this is challenging to do efficiently with moment-based approaches. We illustrate the joint inferential power of macro and micro data through two numerical examples: a heterogeneous household model \citep{Krusell1998} and a heterogeneous firm model \citep{Khan2008}. In both cases we assume that the econometrician observes certain standard macro time series as well as intermittent repeated cross sections of, respectively, (i) household employment and income and (ii) firm capital and labor inputs. Using simulated data, and given flat priors, we show that our full-information method accurately recovers the true structural model parameters. Importantly, for several structural parameters, the micro data reduces the length of posterior credible intervals substantially, relative to inference that exploits only the macro data. In fact, we give examples of parameters that can only be identified if micro data is available. In contrast, inference from moment-based approaches can be highly inaccurate and sensitive to the choice of moments. We deliberately keep our numerical illustrations low-dimensional and build our code on top of the user-friendly Dynare-based model solution method of \citet{Winberry2018}. Though pedagogically useful, this particular numerical model solution method cannot handle very rich models, so a full-scale empirical illustration is outside the scope of this paper. However, there is nothing in our general inference approach that rules out larger-scale models. We argue in \cref{sec:concl} that our general inference approach is compatible with cutting-edge model solution methods that apply automatic dimension reduction of the state space equations \citep{Ahn2017}. \paragraph{Literature.} Our paper contributes to the recent literature on structural estimation of heterogeneous agent models by exploiting the full, combined information content available in macro and micro data. We build on the idea of \citet{Mongey2017} and \citet{Winberry2018} to estimate heterogeneous agent models from the linear state space representation obtained from the \citet{Reiter2009} model solution approach. Several papers have exploited only macro data (as well as calibrated steady-state micro moments) for estimation, including \citet{Winberry2018}, \citet{Hasumi2019}, \citet{Acharya2020}, \citet{Auclert2020humps}, and \citet{Auclert2020seq}. \citet{Challe2017}, \citet{Mongey2017}, \citet{Bayer2020}, and \citet{Papp2020} additionally track particular cross-sectional moments over time. In contrast, we exploit the entire model-implied likelihood function given repeated micro cross sections, which is (at least weakly) more efficient, as discussed further in \cref{sec:theory_moment}. We are not aware of other papers that tackle the fundamental problem that the aggregate shocks affecting cross-sectional heterogeneity are not directly observed. \citet{ParraAlvarez2020} use the model-implied steady-state micro likelihood in a heterogeneous household model, but abstract from macro data or aggregate dynamics. Closest to our approach are \citet{FernandezVillaverde2018}, who exploit the model-implied joint sampling density of macro and micro data in a particular heterogeneous agent macro model. However, they assume that the underlying state variables are directly observed, whereas our contribution is to solve the computational challenges that arise in the generic case where the macro states are (partially) latent. Certain other existing methods for combining macro and micro data cannot be applied in our setting. \citet{Hahn2018} develop asymptotic theory for estimation using interdependent micro and macro data sets, but their full-information approach requires derivatives of the exact likelihood in closed form, which is not available in our setting due to the need to integrate out unobserved state variables. \citet{Chang2018} propose a \emph{reduced-form} approach to estimating the feedback loop between aggregate time series and heterogeneous micro data; they do not consider estimation of structural models. In likelihood estimation of \emph{representative} agent models, micro data has mainly been used to inform the prior, as in \citet{Chang2002}. Finally, unlike the microeconometric literature on heterogeneous agent models \citep{Arellano2017}, our work explicitly seeks to estimate the deep parameters of a general equilibrium macro model by also incorporating aggregate time series data. \paragraph{Outline.} \cref{sec:model} shows that heterogeneous agent models imply a fully-specified statistical model for the macro and micro data. \cref{sec:method} presents our method for computing an unbiased likelihood estimate that is used to perform efficient Bayesian inference. There we also compare our full-information approach with moment-based estimation approaches. \cref{sec:example_hh,sec:example_firm} illustrate the inferential power of combining macro and micro data using two simple numerical examples, a heterogeneous household model and a heterogeneous firm model. \cref{sec:panel} proposes an extension to panel data. \cref{sec:concl} concludes and discusses possible future research directions. \cref{sec:appendix} contains proofs and technical results. A Supplemental Appendix and a full Matlab code suite are available online.\footnote{\url{https://github.com/mikkelpm/het_agents_bayes}} \section{Framework} \label{sec:model} We first describe how heterogeneous agent models generically imply a statistical model for the macro and micro data. Then we illustrate how a simple model with heterogeneous households fits into this framework. \subsection{A general heterogeneous agent framework} \label{sec:framework} Consider a given structural model that implies a fully-specified equilibrium relationship among a set of aggregate and idiosyncratic variables. We assume the availability of macro time series data as well as repeated cross sections of micro data, as summarized in \cref{fig:model}. Let $\mathbf{x} \equiv \lbrace x_t \rbrace_{1 \leq t \leq T}$ denote the vector of observed time series data (e.g., real GDP growth), where $x_t$ is a vector, and $T$ denotes the time series sample size. At a subset $\mathcal{T} \subset \lbrace 1,2,\dots,T \rbrace$ of time points we additionally observe the micro data $\mathbf{y} \equiv \lbrace y_{i,t} \rbrace_{1 \leq i \leq N_t, t \in \mathcal{T}}$, where $y_{i,t}$ is a vector (e.g., the asset holdings of household $i$ or the employment of firm $i$). At each time $t$, the cross section $\lbrace y_{i,t} \rbrace_{1 \leq i \leq N_t}$ is sampled at random from the model-implied cross-sectional distribution \emph{conditional} on some macro state vector $z_t$. For now it is convenient to assume that $\lbrace y_{i,t} \rbrace$ constitutes a representative sample, but sample selection or censoring are easily accommodated in the framework, as we demonstrate in \cref{sec:example_firm_censor}. Formally, we make the following assumption. \begin{asn} \label{asn:model} The data is sampled as follows: \begin{enumerate} \item Conditional on $\mathbf{z} \equiv \lbrace z_t \rbrace_{t=1}^T$, the micro data $\lbrace y_{i,t} \rbrace_{1 \leq i \leq N_t, t \in \mathcal{T}}$ is independent across $t$ and the data points $\lbrace y_{i,t} \rbrace_{i=1}^{N_t}$ at time $t$ are sampled i.i.d.\ from the density $p(y_{i,t} \mid z_t,\theta)$. \item Conditional on $\mathbf{z}$, the micro data $\mathbf{y}$ is independent of the macro data $\mathbf{x}$. \item Conditional on $z_t$ and $\lbrace x_\tau,z_\tau \rbrace_{\tau \leq t-1}$, the macro data $x_t$ is sampled from the density $p(x_t \mid z_t,\theta)$. Conditional on $\lbrace z_\tau \rbrace_{\tau \leq t-1}$, the state vector $z_t$ is sampled from the density $p(z_t \mid z_{t-1},\theta)$. \end{enumerate} \end{asn} The first condition above operationalizes the notion of representative sampling of repeated cross sections. The second condition entails no loss of generality, since we can always include $x_t$ in the state vector $z_t$. The third condition is a standard Markovian state space formulation of the aggregate dynamics, as discussed further below. \begin{figure}[tp] \centering \begin{tikzpicture}[node distance=1cm, auto] \node[punkt] (z_tm1) {$z_{t-1}$}; \node[punkt, right=3cm of z_tm1] (z_t) {$z_t$}; \node[punkt, right=3cm of z_t] (z_tp1) {$z_{t+1}$}; \node[left=0.3cm of z_tm1] (ldots) {\dots}; \node[right=0.3cm of z_tp1] (rdots) {\dots}; \draw[pil] (z_tm1) -- node [midway,above=1mm] {\small $p(z_t \mid z_{t-1},\theta)$} (z_t); \draw[pil] (z_t) -- (z_tp1); \node[below left=1.2cm and 0.6cm of ldots] (lline) {}; \node[below right=1.2cm and 0.6cm of rdots] (rline) {}; \draw[dashed] (lline) -- (rline); \node[above right=-0.1cm of lline,font=\bf] {$\uparrow$ latent}; \node[below right=-0.1cm of lline,font=\bf] {$\downarrow$ observed}; \node[punkt, below right=2.8cm and 0.1cm of z_tm1] (x_t) {$x_t$}; \node[punkt, below left=2.8cm and 0.1cm of z_tp1, text depth=2pt] (y_it) {$\lbrace y_{i,t} \rbrace_{i=1}^{N_t}$}; \draw[pil] (z_t) -- node [pos=0.7,left=3mm] {\small $p(x_t \mid z_t,\theta)$} (x_t); \draw[pil] (z_t) -- node [pos=0.7,right=4mm] {\small $p(y_{i,t} \mid z_t,\theta)$ \footnotesize (i.i.d.\ across $i$)} (y_it); \node[right=0.1cm of y_it] {\footnotesize (observed for $t \in \mathcal{T}$)}; \end{tikzpicture} \caption{Diagram of the distribution of the macro and micro data implied by a heterogeneous agent model. The state vector $z_t$ includes any time-varying parameters that govern the cross-sectional distribution $p(y_{i,t} \mid z_t,\theta)$.} \label{fig:model} \end{figure} Given the structural parameter vector $\theta$, the fully-specified heterogeneous agent model implies functional forms for the macro observation density $p(x_t \mid z_t,\theta)$, the macro state transition density $p(z_t \mid z_{t-1},\theta)$, and the micro sampling density $p(y_{i,t} \mid z_t,\theta)$. These density functions reflect the equilibrium of the model, as we illustrate in the next subsection, and they are the key inputs in the likelihood computation in \cref{sec:method}. Notice that the framework allows the micro and macro data to be dependent, though this dependence must be fully captured by the macro state vector $z_t$, which is determined by the structure of the model at hand. Because the sampling densities $p(x_t \mid z_t,\theta)$ and $p(y_{i,t} \mid z_t,\theta)$ are derived from an equilibrium model, the likelihood function derived below in equation \eqref{eqn:micro_likel_int} automatically embodies any constraints of the type envisioned by \citet{Imbens1994} on the relationship between the aggregate macro data and the time-varying population moments of the micro sampling distribution. For example, if $y_{i,t}$ equals individual-level consumption, $x_t$ equals aggregate consumption, and $z_t$ equals the underlying macro shocks (which determine the dynamics of aggregates and of the micro distribution), then the asymptotic adding-up constraint that $\lim_{N_t \to \infty}\frac{1}{N_t} \sum_{i=1}^{N_t} y_{i,t} \stackrel{a.s.}{=} x_t$ will be automatically satisfied if the sampling densities are derived from a model that imposes market clearing. In most applications, some of the aggregate state variables $z_t$ that influence the macro and micro sampling densities are unobserved, i.e., $z_t \neq x_t$. This fact complicates the evaluation of the exact likelihood function and is the key technical challenge that we overcome in this paper, as discussed in \cref{sec:method}. \subsection{Example: Heterogeneous household model} \label{sec:model_hh} We use a simple heterogeneous household model \`{a} la \citet{Krusell1998} to illustrate the components of the general framework introduced in \cref{sec:framework}. Our discussion of the model and the numerical equilibrium solution technique largely follows \citet{Winberry2016,Winberry2018}. Though this model is far too stylized for quantitative empirical work, we demonstrate the flexibility of our framework by adding complications such as permanent heterogeneity among households as well as measurement error in observables. In \cref{sec:example_hh} we will estimate a calibrated version of this model on simulated data. \paragraph{Model assumptions.} A continuum of heterogeneous households $i \in [0,1]$ are exposed to idiosyncratic employment risk as well as aggregate shocks to wages and asset returns. Households have log preferences over consumption $c_{i,t}$ at time $t=0,1,2,\dots$. When employed ($\epsilon_{i,t}=1$), households receive wage income net of an income tax levied at rate $\tau$. When unemployed ($\epsilon_{i,t}=0$), they receive unemployment benefits equal to a fraction $b$ of their hypothetical working wage. The idiosyncratic unemployment state $\epsilon_{i,t}$ evolves exogenously according to a two-state first-order Markov process that is independent of aggregate conditions and household decisions. Households cannot insure themselves against their employment risk, since the only available financial instruments are shares of capital $\tilde{a}_{i,t}$, which yield a rate of return $r_t$. Financial investment is subject to the borrowing constraint $\tilde{a}_{i,t} \geq 0$. For expositional purposes, we add a dimension of permanent household heterogeneity: Each household is endowed with a permanent labor productivity level $\lambda_i$, which is drawn at the beginning of time from a lognormal distribution with mean parameter $\mathbb{E}[\log \lambda_i] = \mu_\lambda \leq 0$ and variance parameter chosen such that $\mathbb{E}[\lambda_i]=1$. An employed household inelastically supplies $\lambda_i$ efficiency units of labor, earning pre-tax income of $\lambda_i w_t$, where $w_t$ is the real wage per efficiency unit of labor. To summarize, the households' problem can be written \begin{align*} &\max_{c_{i,t},a_{i,t} \geq 0} \mathbb{E}_0\left[\sum_{t=0}^\infty \beta^t \log c_{i,t} \right] \\ &\;\text{s.t.} \quad c_{i,t} = \lambda_i\big\lbrace w_t[(1-\tau)\epsilon_{i,t} + b(1-\epsilon_{i,t})] + (1+r_t)a_{i,t-1} - a_{i,t} \big\rbrace, \end{align*} where $a_{i,t}=\tilde{a}_{i,t}/\lambda_i$ are the normalized asset holdings. A representative firm produces the consumption good using a Cobb-Douglas production function $Y_t=e^{\zeta_t}K_t^\alpha L^{1-\alpha}$, where aggregate capital $K_t$ depreciates at rate $\delta$, and $L$ is the aggregate level of labor efficiency units (which is constant over time since employment risk is purely idiosyncratic). The firm hires labor and rents capital in competitive input markets. Log total factor productivity (TFP) evolves as an AR(1) process $\zeta_t = \rho_\zeta \zeta_{t-1} + \varepsilon_t$, where $\varepsilon_t \overset{i.i.d.}{\sim} N(0,\sigma_\zeta^2)$. The government balances its budget period by period, implying $\tau L = b(1-L)$. We collect the deep parameters of this model in the vector $\theta$. These include $\beta$, $\alpha$, $\delta$, $\tau$, $\rho_\zeta$, $\sigma_\zeta$, the transition probabilities for idiosyncratic employment states, and $\mu_\lambda$. \paragraph{Equilibrium definition and computation.} The mathematical definition of a recursive competitive equilibrium is standard, and we refer to \citet{Winberry2016} for details. We now review \citeauthor{Winberry2016}'s method for solving the model numerically. A key model object is the cross-sectional joint distribution of the micro state variables, i.e., employment status $\epsilon_{i,t}$, normalized assets $a_{i,t-1}$, and permanent productivity $\lambda_i$. This distribution, which we denote $\tilde{\mu}_t(\epsilon,a,\lambda)$, is time-varying as it implicitly depends on the aggregate productivity state variable $\zeta_t$ at time $t$. Due to log utility and the linearity of the households' budget constraint in $\lambda_i$, macro aggregates are unaffected by the distribution of the permanent cross-sectional heterogeneity $\lambda_i$ (recall that $\mathbb{E}[\lambda_i]=1$). This implies that the mean parameter $\mu_\lambda$ of the log-normal distribution of $\lambda_i$ is only identifiable if micro data is available, as discussed further in \cref{sec:example_hh}. In equilibrium we have $\tilde{\mu}_t(\epsilon,a,\lambda) = \mu_t(\epsilon,a)F(\lambda \mid \mu_\lambda)$, where $F(\cdot \mid \mu_\lambda)$ denotes the time-invariant log-normal distribution for $\lambda_i$. To solve the model numerically, \citet{Winberry2016,Winberry2018} assumes that the \emph{infinite-dimen\-sional} cross-sectional distribution $\mu_t(\epsilon,a)$ can be well approximated by a rich but \emph{finite-dimensional} family of distributions. The distribution of $a$ given $\epsilon$ is a mixture of a mass point at 0 (the borrowing constraint) and an absolutely continuous distribution concentrated on $(0,\infty)$. At every point in time, \citeauthor{Winberry2016} approximates the absolutely continuous part using a density of the exponential form \[g_{\epsilon}(a) = \exp\left\{\tilde\varphi_{\epsilon0}+\tilde\varphi_{\epsilon1}\tilde m_{\epsilon1}+\sum_{\ell=2}^q \varphi_{\epsilon\ell} \left[\left(a-\tilde m_{\epsilon1}\right)^\ell-\tilde m_{\epsilon\ell}\right]\right\},\] where $\tilde m_{\epsilon1}=\mathbb E[a \mid \epsilon]$, $\tilde m_{\epsilon l}=\mathbb E[\left(a-\tilde m_{\epsilon1}\right)^\ell\mid \epsilon]$ for $l\ge2$, the $\tilde\varphi_{\epsilon\ell}$'s are coefficients of the distribution, and $q \in \mathbb{N}$ is a tuning parameter that determines the quality of the numerical approximation. The $q+1$ coefficients $\{\tilde\varphi_{\epsilon\ell}\}_{0\le l\le q}$ are pinned down by the $q$ moments $\{\tilde m_{\epsilon\ell}\}_{1\le l\le q}$, along with the normalization that $g_{\epsilon}(a)$ integrates to one. The approximation of the distribution $\mu_t(\epsilon,a)$ at any point in time therefore depends on $2(q+1)$ parameters: the probability point mass at $a=0$ as well as the $q$ moments $\{\tilde m_{\epsilon\ell}\}_{1\le l\le q}$, for each employment state $\epsilon$. Denote the vector of all these parameters by $\psi$. The model solution method proceeds under the assumption $\mu_t(a,\epsilon) = G(a,\epsilon; \psi_t)$, where $G$ denotes the previously specified parametric mixture functional form for the distribution, and we have added a time subscript to the parameter vector $\psi = \psi_t$. Though the approximation $\mu_t(a,\epsilon) \approx G(a,\epsilon; \psi_t)$ only becomes exact in the limit $q \to \infty$, the approximation may be good enough for small $q$ to satisfy the model's equilibrium equations to a high degree of numerical accuracy. Adopting the distributional approximation, the model's aggregate equilibrium can now be written as a nonlinear system of expectational equations in a finite-dimensional vector $z_t$ of macro variables: \begin{equation} \label{eqn:equilibrium_nonlin} \mathbb{E}_t[H(z_{t+1}, z_t,\varepsilon_{t+1}; \theta)] = 0, \end{equation} where we have made explicit the dependence on the deep model parameters $\theta$. Consistent with the notation in \cref{sec:framework}, the vector $z_t$ includes (log) aggregate output $\log(Y_t)$, capital $\log(K_t)$, wages $\log(w_t)$, rate of return $r_t$, and productivity $\zeta_t$, but also the time-varying distributional parameters $\psi_t$. For brevity, we do not specify the full equilibrium correspondence $H(\cdot)$ here but refer to \citet{Winberry2016} for details. Among other things, $H(\cdot)$ enforces that the evolution over time of the cross-sectional distributional parameters $\psi_t$ is consistent with households' optimal savings decision rule, given the other macro state variables in $z_t$. $H(\cdot)$ also enforces consistency between micro variables and macro aggregates, such as capital market clearing $K_t = \sum_{\epsilon=0}^1 \int a \mu_t(\epsilon,da)$. Estimation of the heterogenous agent model requires a fast numerical solution method, which \citet{Winberry2016,Winberry2018} achieves using the \citet{Reiter2009} linearization approach. First the system of equations \eqref{eqn:equilibrium_nonlin} is solved numerically for the steady state values $z_t=z_{t-1}=\bar{z}$ in the case of no aggregate shocks ($\varepsilon_t=0$). Then the system \eqref{eqn:equilibrium_nonlin} is linearized as a function of the aggregate variables $z_t$, $z_{t-1}$, and $\varepsilon_t$ around their steady state values, and the unique bounded rational expectations solution is computed (if it exists) using standard methods for linearized models \citep{Herbst2016}. This leads to a familiar linear transition equation of the form: \begin{equation} \label{eqn:loglin_transition} z_t - \bar{z} = A(\theta)(z_{t-1}-\bar{z}) + B(\theta)\varepsilon_t. \end{equation} The matrices $A(\theta)$ and $B(\theta)$ are functions of the derivatives of the equilibrium correspondence $H(\cdot)$, evaluated at the steady state $\bar{z}$. Notice that $A(\cdot)$ and $B(\cdot)$ implicitly depend on functionals of the steady-state cross-sectional distribution of the micro state variables $(\epsilon,a)$. This is because the \citet{Reiter2009} approach only linearizes with respect to \emph{macro} aggregates $z_t$ and shocks $\varepsilon_t$, while allowing for all kinds of heterogeneity and nonlinearities on the micro side, such as the borrowing constraint in the present model. In practice, \citet{Winberry2016,Winberry2018} implements the linearization of equation \eqref{eqn:equilibrium_nonlin} automatically through the software package Dynare.\footnote{See \citet{Adjemianetal2011}.} For pedagogical purposes, we build our inference machinery on top of the code that \citeauthor{Winberry2018} kindly makes available on his website, but we discuss alternative cutting-edge model solution methods in \cref{sec:concl}. Our inference method treats the linearized equilibrium relationship \eqref{eqn:loglin_transition} as the true model for the (partially unobserved) macro aggregates $z_t$. That is, we do not attempt to correct for approximation errors due to linearization or due to the finite-dimensional approximation of the micro distribution. In particular, the transition density $p(z_t \mid z_{t-1},\theta)$ introduced in \cref{sec:framework} is obtained from the linear Gaussian dynamic equation \eqref{eqn:loglin_transition}, as opposed to the exact nonlinear equilibrium of the model, which is challenging to compute. We stress that the goal of our paper is to fully exploit \emph{all} observable implications of the (numerically approximated) structural model, and we leave concerns about model misspecification to future work (see also \cref{sec:concl}). \paragraph{Sampling densities.} We now show how the sampling densities of macro and micro data can be derived from the numerical model equilibrium. For sake of illustration, assume that we observe a single macro variable given by a noisy measure of log output, i.e., $x_t=\log(Y_t)+e_t$, where $e_t \sim N(0,\sigma_e^2)$. The measurement error is not necessary for our method to work; we include it to illustrate the identification status of different kinds of parameters in \cref{sec:example_hh}. For this choice of observable, the sampling density $p(x_t \mid z_t,\theta)$ introduced in \cref{sec:framework} is given by a normal density with mean $\log(Y_t)$ and variance $\sigma_e^2$. More generally, we could consider a vector of macro observables $x_t$ linearly related to the state variables $z_t$, with a vector $e_t$ of additive measurement error:\footnote{Some of the elements of $e_t$ could have variance 0 if no measurement error is desired.} \begin{equation} \label{eqn:loglin_meas} x_t = S(\theta)z_t+e_t. \end{equation} Together, the equations \eqref{eqn:loglin_transition}--\eqref{eqn:loglin_meas} constitute a linear state space model in the observed and unobserved macro variables. We exploit this fact to evaluate the macro and micro likelihood function in \cref{sec:method}. As for the micro data, suppose additionally that we observe repeated cross sections of households' employment status $\epsilon_{i,t}$ and after-tax/after-benefits income $\iota_{i,t} = \lambda_i\lbrace w_t[(1-\tau)\epsilon_{i,t} + b(1-\epsilon_{i,t})] + (1+r_t)a_{i,t-1} \rbrace$. That is, at certain times $t \in \mathcal{T} = \lbrace t_1,t_2,\dots,t_{|\mathcal{T}|} \rbrace$ we observe $N_t$ observations $y_{i,t} = (\epsilon_{i,t},\iota_{i,t})'$, $i=1,\dots,N_t$, drawn independently from a cross-sectional distribution that is consistent with $\mu_t(\epsilon,a)$, $F(\lambda \mid \mu_\lambda)$, and $z_t$. The joint sampling density $p(y_{i,t} \mid z_t,\theta)$ can be derived from the model's underlying cross-sectional distributions. The conditional distribution of $\iota_{i,t}$ given $\epsilon_{i,t}$ and the macro states is absolutely continuous, since the micro heterogeneity $\lambda_i$ smooths out the point mass at the households' borrowing constraint. By differentiating the cumulative distribution function, it can be verified that the conditional sampling density of $\iota_{i,t}$ given $\epsilon_{i,t}$ equals \begin{equation} \label{eqn:hh_income_dens} p(\iota_{i,t} \mid \epsilon_{i,t},z_t,\theta) = \pi_{\epsilon_{i,t}}(\psi_t) \frac{f(\frac{\iota_{i,t}}{\xi_{i,t}} \mid \mu_{\lambda})}{\xi_{i,t}} + [1-\pi_{\epsilon_{i,t}}(\psi_t)] \int_{0}^\infty \frac{f(\frac{\iota_{i,t}}{\xi_{i,t}+(1+r_t) a} \mid \mu_{\lambda})}{\xi_{i,t}+(1+r_t) a}g_{\epsilon_{i,t}}(a \mid \psi_t)\,da, \end{equation} where $f(\cdot \mid \mu_\lambda)$ is the assumed log-normal density for $\lambda_i$, $\pi_\epsilon(\psi_t) \equiv P(a=0 \mid \epsilon,\psi_t)$ is the probability mass at zero for assets, and $\xi_{i,t} \equiv w_t[(1-\tau)\epsilon_{i,t} + b(1-\epsilon_{i,t})]$. In practice, the integral can be evaluated numerically, cf.\ \cref{sec:example_hh}. This concludes the specification of the model as well as the derivations of the macro state transition density and of the sampling densities for the macro and micro data. In \cref{sec:method} we will use these ingredients to derive the likelihood function consistent with the model and the observed data. \paragraph{Other observables and models.} Of course, one could think of many other empirically relevant choices of macro and micro observables, leading to other expressions for the sampling densities. Our choices here are merely meant to illustrate how our framework is flexible enough to accommodate: (i) a mixture of discrete and continuous observables; (ii) observables that depend on both micro and macro states; and (iii) persistent cross-sectional heterogeneity $\lambda_i$ that, given repeated cross section data, effectively amounts to measurement error at the micro level. We emphasize that the general framework in \cref{sec:framework} can also handle many other types of heterogeneous agent models. To show this, \cref{sec:example_firm} will consider an alternative model with heterogeneous firms as in \citet{Khan2008}. \section{Efficient Bayesian inference} \label{sec:method} We now describe our method for doing efficient Bayesian inference. We first construct a numerically unbiased estimate of the likelihood, and then discuss the posterior sampling procedure. Finally, we compare our approach with procedures that collapse the micro data to a set of cross-sectional moments. \subsection{Unbiased likelihood estimate} Our likelihood estimate is based on decomposing the joint likelihood into a macro part and a micro part (conditional on the macro data): \begin{align} p(\mathbf{x},\mathbf{y} \mid \theta) &= \overbrace{p(\mathbf{x} \mid \theta)}^{\text{macro}} \, \overbrace{p(\mathbf{y} \mid \mathbf{x},\theta)}^{\text{micro}} \nonumber \\ &= p(\mathbf{x} \mid \theta) \int p(\mathbf{y} \mid \mathbf{z}, \theta) p(\mathbf{z} \mid \mathbf{x},\theta)\, d\mathbf{z} \nonumber \\ &= p(\mathbf{x} \mid \theta) \int \prod_{t \in \mathcal{T}}\prod_{i=1}^{N_t} p(y_{i,t} \mid z_t,\theta) p(\mathbf{z} \mid \mathbf{x},\theta) \, d\mathbf{z}. \label{eqn:micro_likel_int} \end{align} Note that this decomposition is satisfied by construction under \cref{asn:model} and will purely serve as a computational tool. The form of the decomposition should not be taken to mean that we are assuming that ``$\mathbf{x}$ affects $\mathbf{y}$ but not \emph{vice versa}.'' As discussed in \cref{sec:model}, our framework allows for a fully general equilibrium feedback loop between macro and micro variables. The macro part of the likelihood is easily computable from the \citeauthor{Reiter2009}-linearized state space model \eqref{eqn:loglin_transition}--\eqref{eqn:loglin_meas}. Assuming i.i.d.\ Gaussian measurement error $e_t$ and macro shocks $\varepsilon_t$, the macro part of the likelihood $p(\mathbf{x} \mid \theta)$ can be obtained from the Kalman filter. This is computationally cheap even in models with many state variables and/or observables. This idea was developed by \citet{Mongey2017} and \citet{Winberry2018} for estimation of heterogeneous agent models from aggregate time series data. The novelty of our approach is that we compute an unbiased estimate of the micro likelihood conditional on the macro data. Although the integral in expression \eqref{eqn:micro_likel_int} cannot be computed analytically in realistic models, we can obtain a \emph{numerically unbiased} estimate of the integral by random sampling: \begin{equation} \label{eqn:micro_likel_unbias} \int \prod_{t \in \mathcal{T}}\prod_{i=1}^{N_t} p(y_{i,t} \mid z_t,\theta) p(\mathbf{z} \mid \mathbf{x},\theta) \, d\mathbf{z} \approx \frac 1 J \sum_{j=1}^J \prod_{t \in \mathcal{T}}\prod_{i=1}^{N_t} p(y_{i,t} \mid z_t=z_t^{(j)},\theta), \end{equation} where $\mathbf{z}^{(j)} \equiv \lbrace z_t^{(j)} \rbrace_{1 \leq t \leq T}$, $j=1,\dots,J$, are draws from the joint smoothing density $p(\mathbf{z} \mid \mathbf{x},\theta)$ of the latent states. Again using the \citeauthor{Reiter2009}-linearized model solution, the Kalman smoother can be used to produce these state smoothing draws with little computational effort \citep[e.g.,][]{Durbin2002}. As the number of smoothing draws $J \to \infty$, the likelihood estimate converges to the exact likelihood, but we show below that finite $J$ is sufficient for our purposes, as we rely only on the numerical unbiasedness of the likelihood estimate, not its consistency. Our likelihood estimate can loosely be interpreted as arising from a two-step approach: First we estimate the states from the macro data, and then we plug the state estimates $z_t^{(j)}$ into the micro sampling density. However, unlike more \emph{ad hoc} versions of this general idea, we will argue next that the unbiased likelihood estimate makes it possible to perform valid Bayesian inference that fully takes into account all sources of uncertainty about states and parameters. The expression on the right-hand side of the likelihood estimate \eqref{eqn:micro_likel_unbias} is parallelizable over smoothing draws $j$, time $t$, and/or individuals $i$. Thus, given the right computing environment, the computation time of our method scales well with the dimensions of the micro data. This is particularly helpful in models where evaluation of the micro sampling density involves numerical integration, as in the household model in \cref{sec:example_hh} below. \subsection{Posterior sampling} Now that we have a numerically unbiased estimate of the likelihood, we can plug it into any generic MCMC procedure to obtain draws from the posterior distribution, given a choice of prior density. We may simply pretend that the likelihood estimate is exact and run the MCMC algorithm as we otherwise would, as explained by \citet{Andrieu2010} and \citet{Flury2011}. Despite the simulation error in estimating the likelihood, the ergodic distribution of the MCMC chain will equal the fully efficient posterior distribution $p(\theta \mid \mathbf{x},\mathbf{y})$. This is true no matter how small the number $J$ of smoothing draws is. Still, the MCMC chain will typically exhibit better mixing if $J$ is moderately large so that proposal draws are not frequently rejected merely due to numerical noise. In principle, we can use any generic MCMC method that requires only the likelihood and prior density as inputs, such as Metropolis-Hastings. Our approach can also be applied to Sequential Monte Carlo sampling \citep[chapter 5]{Herbst2016}.\footnote{Implementation of Algorithm 8 in \citet{Herbst2016} requires some care. The mutation step (step 2.c) can use the unbiased likelihood estimate with finite number of smoothing draws $J$, by \citet{Andrieu2010}. However, it is not immediately clear whether an unbiased likelihood estimate suffices for the correction step (step 2.a). For the latter step, we therefore advise using a larger number of smoothing draws to ensure that the likelihood estimate is close to its analytical counterpart.} \subsection{Comparison with moment-based methods} \label{sec:theory_moment} The above full-information approach yields draws from the same posterior distribution as if we had used the model-implied exact joint likelihood of the micro and macro data; it is thus finite-sample optimal in the usual sense. An alternative approach proposed by \citet{Challe2017} and \citet{Mongey2017} is to collapse the micro data into a small number of cross-sectional moments which are tracked over time (that is, the repeated cross sections of micro data are transformed into time series of cross-sectional moments). We now examine under which circumstances our full-information approach is strictly more efficient than this moment-based approach. We focus on moment-based approaches that track the evolution of cross-sectional moments over time, rather than exploiting only steady-state moments. Empirically, cross-sectional distributions are often time-varying \citep{krueger2010cross,wolff2016household}. The model-based numerical illustrations below also exhibit time-variation in cross-sectional distributions. Thus, collapsing the time-varying moments to averages across the entire time sample would leave information on the table. If the micro sampling density has sufficient statistics for the parameters of interest, and the sufficient statistics are one-to-one functions of the observed cross-sectional moments, then these moments contain the same amount of information about the structural parameters as the full micro data set. As stated in the Pitman-Koopman-Darmois theorem, only the exponential family has a fixed number of sufficient statistics. The following result obtains. \begin{thm} \label{thm:suff_stat} If the conditional sampling density of the micro data $y_{i,t}$ can be expressed as \begin{equation} \label{eqn:exp} p(y_{i,t} \mid z_t,\theta) =\exp\left[\varphi_0(z_t,\theta)+\mathfrak m_{0}(y_{i,t})+\sum_{\ell=1}^{Q} \varphi_\ell(z_t,\theta)\mathfrak m_{\ell}(y_{i,t})\right], \end{equation} for certain functions $\varphi_\ell(\cdot,\cdot),\mathfrak m_\ell(\cdot)$, $\ell=0,\dots,Q$, then there exist sufficient statistics for $\theta$ given by the cross-sectional moments \begin{equation} \hat m_{\ell,t} = \frac 1{N_t} \sum_{i=1}^{N_t} \mathfrak m_{\ell}(y_{i,t}),\quad \ell=1,\dots,Q. \label{eqn:moments} \end{equation} \end{thm} \begin{proof} Please see \cref{sec:moment_proof}. \end{proof} That is, under the conditions of the theorem, the full micro-macro data set $\lbrace \mathbf{y},\mathbf{x} \rbrace$ contains as much information about the parameters $\theta$ as the moment-based data set $\lbrace \mathbf{\hat{m}},\mathbf{x} \rbrace$, where $\mathbf{\hat{m}} \equiv \lbrace \hat{m}_{\ell,t} \rbrace_{1 \leq \ell \leq Q, t \in \mathcal{T}}$. This result is not trivial due to the presence of the latent macro states $z_t$, which are integrated out in the likelihood \eqref{eqn:micro_likel_int}. The key requirement is that in \eqref{eqn:exp}, the terms inside the exponential should be additive and each term should take the form \(\varphi_\ell(z_t,\theta)\mathfrak m_\ell(y_{i,t})\). Whether or not the micro sampling density exhibits the exponential form \eqref{eqn:exp} depends on the model and on the choice of micro observables. As explained in \cref{sec:model_hh}, in this paper we adopt the \citet{Winberry2018} model solution approach, which approximates the cross-sectional distribution of the idiosyncratic micro state variables $s_{i,t}$ using an exponential family of distributions. Hence, \emph{if we observed the micro states $s_{i,t}$ directly}, \cref{thm:suff_stat} implies that there would be no loss in collapsing the micro data to a certain set of cross-sectional moments. However, there may not exists sufficient statistics for the actual micro observables $y_{i,t}$, which are generally non-trivial functions of the latent micro states $s_{i,t}$ and macro states $z_t$. The following corollary gives conditions under which sufficient statistics still obtain. Let \(y_{i,t}\) be a \(d_y\times1\) vector and \(s_{i,t}\) be a \(d_s\times1\) vector. \begin{cor} \label{cor:exp_poly} Suppose we have: \begin{enumerate} \item The conditional density of the micro states $s_{i,t}$ given $z_t$ is of the exponential form. \item The micro states are related to the micro observables as follows: \begin{equation} s_{i,t}=B_1(z_t,\theta)\Upsilon(y_{i,t})+B_0(z_t,\theta), \label{eqn:transform} \end{equation} where: \begin{enumerate}[a)] \item \(d_{y}=d_{s}\). \item $\Upsilon(\cdot)$ is a known, piecewise bijective and differentiable function with its domain and range being subsets of \(\mathbb R^{d_s}\). \item The $d_s \times d_s$ matrix $B_1(z_t,\theta)$ is non-singular for almost all values of \((z_t,\theta)\). \end{enumerate} \end{enumerate} Then there exist sufficient micro statistics for $\theta$. \end{cor} \begin{proof} Please see \cref{sec:moment_proof}. The proof states the functional form of the sufficient statistics. \end{proof} There are several relevant cases where the conditions of \cref{cor:exp_poly} fail and hence sufficient statistics may not exist. First, the dimension $d_y$ of the observables $y_{i,t}$ could be strictly smaller than the dimension $d_s$ of the latent micro states $s_{i,t}$. Second, there may not exist any linear relationship between $s_{i,t}$ and some function $\Upsilon(y_{i,t})$ of $y_{i,t}$, for example due to binding constraints. Third, there may be unobserved individual heterogeneity and/or micro measurement error, such as the individual-specific productivity parameter $\lambda_i$ in \cref{sec:model_hh}. We provide further discussion in \cref{sec:suff_stat_general}. Even if the model exhibits sufficient statistics given by cross-sectional moments of the observed micro data, valid inference requires taking into account the sampling uncertainty of these moments. This is a challenging task, since the finite-sample distribution of the moments is typically not Gaussian (especially for higher moments), see \cref{sec:nonlinear-Gaussian} for an example. Hence, the observation equation for the moments does not fit into the linear-Gaussian state space framework \eqref{eqn:loglin_transition}--\eqref{eqn:loglin_meas} that lends itself to Kalman filtering. If the micro sample size is large, the sampling distribution of the moments may be well approximated by a Gaussian distribution, but even then the variance-covariance matrix of the distribution will generally be time-varying and difficult to compute/estimate. In \cref{sec:example_hh} below we consider one natural method for approximately accounting for the sampling uncertainty of the moments. We find that this moment-based approach is less reliable than our preferred full-information approach. The potential inefficiency and fragility of the moment-based approach contrasts with the ease of applying our efficient full-information method. Users of our method need not worry about the existence of sufficient statistics, nor do they need to select which moments to include in the analysis and figure out how to account for their sampling uncertainty. Moreover, we show by example in \cref{sec:example_firm_censor} that the full-information approach can easily accommodate empirically relevant features of micro data such as censoring or selection, which is challenging to do in a moment-based framework (at least in an efficient way). \section{Illustration: Heterogeneous household model} \label{sec:example_hh} We now demonstrate that combining macro and micro data can sharpen structural inference when estimating the heterogeneous household model of \cref{sec:model_hh} on simulated data. We contrast the results of our efficient full-information approach with those of an alternative moment-based approach. This section should be viewed as a proof-of-concept exercise, as we deliberately keep the dimensionality of the inference problem small in order to focus attention on the core workings of our procedure. \subsection{Model, data, and prior} We consider the stylized heterogeneous household model defined in \cref{sec:model_hh}. We aim to estimate the households' discount factor $\beta$, the standard deviation $\sigma_e$ of the measurement error in log output, and the individual productivity heterogeneity parameter $\mu_\lambda$. All other parameters are assumed known for simplicity. Consistent with \cref{sec:model_hh}, we assume that the econometrician observes aggregate data on log output with measurement error, as well as repeated cross sections of household employment status $\epsilon_{i,t}$ and after-tax/after-benefits income $\iota_{i,t}$. We adopt the annual parameter calibration in \citet{Winberry2016}, see \cref{sec:example_hh_calib}. In particular, $\beta=0.96$. We choose the true measurement error standard deviation $\sigma_e$ so that about 20\% of the variance of observed log output is due to measurement error, yielding $\sigma_e=0.02$.\footnote{One possible real-world interpretation of the measurement error is that it represents the statistical uncertainty in estimating the natural rate of output (recall that the model abstracts from nominal rigidities).} The individual heterogeneity parameter $\mu_\lambda$ is chosen to be $-0.25$, implying that the model's cross-sectional 20th to 90th percentile range of log after-tax income roughly matches the range in U.S. data \citep[Table I]{Piketty2018}. Using this calibration, we simulate $T=100$ periods of macro data, as well as micro data consisting of $N_t=N=1,000$ households observed at each of the ten time points $t=10,20,30,\dots,100$. The data is simulated using the same approximate model solution method as is used to compute the unbiased likelihood estimate, see \cref{sec:model_hh}. Finally, we choose the prior on $(\beta,\sigma_e,\mu_\lambda)$ to be flat in the natural parameter space. \subsection{Computation} Following \citet{Winberry2016,Winberry2018}, we solve the model using a Dynare implementation of the \citet{Reiter2009} method. This allows us to use Dynare's built-in Kalman filter/smoother procedures when evaluating the micro likelihood estimate \eqref{eqn:micro_likel_unbias}. We use an approximation of degree $q=3$ when approximating the asset distribution, in the notation of \cref{sec:model_hh}. We average the likelihood across $J=500$ smoothing draws. The integral \eqref{eqn:hh_income_dens} in the micro sampling density of income is evaluated using a combination of numerical integration and interpolation.\footnote{First, we use a univariate numerical integration routine to evaluate the integral on an equal-spaced grid of values for $\log \iota$. Then we use cubic spline interpolation to evaluate the integral at arbitrary $\iota$. In practice, a small number of grid points is sufficient in this application, since the density \eqref{eqn:hh_income_dens} is a smooth function of $\iota$.} To simulate micro data from the cross-sectional distribution, we apply the inverse probability transform to the model-implied cumulative distribution function of assets, which in turn is computed using numerical integration. For simplicity, our MCMC algorithm is a basic Random Walk Metropolis-Hastings algorithm with tuned proposal covariance matrix and adaptive step size \citep{Atchade2005}.\footnote{Our proposal distribution is a mixture of (i) the adapted multivariate normal distribution and (ii) a diffuse normal distribution, with 95\% probability attached to the former. We verified the Diminishing Adaption condition and Containment condition in \citet{rosenthal2011optimal}, so the distribution of the MCMC draws will converge to the posterior distribution of the parameters.} The starting values are determined by a rough grid search on the simulated data. We generate 10,000 draws and discard the first 1,000 as burn-in. Using parallel computing on 20 cores, likelihood evaluation takes about as long as \citeauthor{Winberry2016}'s (\citeyear{Winberry2016}) procedure for computing the model's steady state. \subsection{Results} \label{sec:example_hh_post} \begin{figure}[t] \centering \textsc{Heterogeneous household model: Posterior density} \\[\baselineskip] \includegraphics[width=\linewidth]{hh_N1000_04_postdens-eps-converted-to.pdf} \caption{Posterior densities with (blue solid curves) and without (black dashed curves) conditioning on the micro data. Both sets of results use the same simulated data set. Vertical dashed lines indicate true parameter values. Posterior density estimates from the 9,000 retained MCMC draws using Matlab's {\tt ksdensity} function with default settings. The third display omits the macro-only results, since $\mu_\lambda$ is not identified from macro data alone.} \label{fig:example_hh_postdens} \end{figure} \cref{fig:example_hh_postdens} shows that both macro and micro data can be useful or even essential for estimating some parameters, but not others. The figure depicts the posterior densities of the three parameters, on a single sample of simulated data. The full-information posterior (blue solid curves) is concentrated close to the true values of the three parameters (which are marked by vertical thin dashed lines). The figure also shows the posterior density \emph{without} conditioning on the micro data (black dashed curves). The household discount factor $\beta$ is an important determinant of not just aggregate variables, but also the heterogeneous actions of the micro agents in the economy. Ignoring the micro data leads to substantially less accurate inference about $\beta$ in this simulation, as the macro-only posterior is less precisely centered around the true value as well as more diffuse than the full-information posterior. Nevertheless, macro data clearly does meaningfully contribute to pinning down the parameter $\beta$. More starkly, $\mu_\lambda$ can only be identified from the cross section, since by construction the macro aggregates are not influenced by the distribution of the individual permanent productivity draws $\lambda_i$. In contrast, essentially all the information about the measurement error standard deviation $\sigma_e$ comes from the macro data, again by construction. Thus, our results here illustrate the general lesson that both macro and micro data can be either essential, useful, or irrelevant for estimating different parameters. \begin{figure}[t] \centering \textsc{Heterogeneous household model: Consumption policy function, employed} \\[\baselineskip] \includegraphics[width=\linewidth,clip=true,trim=2em 0 2em 0]{hh_N1000_04_conspolfct_emp1.png} \caption{Estimated steady state consumption policy function for employed households, either using both micro and macro data (left panel) or only using macro data (right panel). The thick black curve is computed under the true parameters. The thin lines are 900 posterior draws (computed using every 10th MCMC draw after burn-in). X-axes are normalized asset holdings $a_{i,t}$.} \label{fig:example_hh_consumption} \end{figure} \cref{fig:example_hh_consumption} shows that efficient use of the micro data leads to substantially more precise estimates of the steady state consumption policy function for employed households.\footnote{\cref{fig:example_hh_consumption_unemp} in \cref{sec:example_hh_results} plots the policy function for unemployed households.} The left panel shows that full-information posterior draws of the consumption policy function (thin curves) are fairly well centered around the true function (thick curve), as is expected given the accurate inference about $\beta$ depicted in \cref{fig:example_hh_postdens}. In contrast, the right panel shows that macro-only posterior draws are less well centered and exhibit higher variance, especially for households with high or low current asset holdings. The added precision afforded by efficient use of the micro data translates into more precise estimates of the marginal propensity to consume (the derivative of the consumption policy function) at the extremes of the asset distribution. This is potentially useful when analyzing the two-way feedback effect between macroeconomic policies and redistribution \citep{Auclert2019}. \begin{figure}[t] \centering \textsc{Het.\ household model: Impulse responses of asset distribution, employed} \\[\baselineskip] \includegraphics[width=\linewidth,clip=true,trim=3em 0 2em 0]{hh_N1000_04_distirf_emp1.png} \caption{Estimated impulse response function of employed households' asset distribution with respect to an aggregate productivity shock, either using both micro and macro data (left panel) or only using macro data (right panel). The thin lines are 900 posterior draws (computed using every 10th MCMC draw after burn-in). X-axes are normalized asset holdings $a_{i,t}$. The four rows in each panel are the asset densities at impulse response horizons 0 (impact), 2, 4, and 8. The black dashed and black solid curves are the steady state density and the impulse response, respectively, computed under the true parameters. On impact the true impulse response equals the steady state density, since households' portfolio choice is predetermined.} \label{fig:example_hh_irf} \end{figure} The extra precision afforded by micro data also sharpens inference on the impulse response function of the asset distribution with respect to an aggregate productivity shock. \cref{fig:example_hh_irf} shows full-information (left panel) and macro-only (right panel) posterior draws of the impulse response function of employed households' asset holding density, in the periods following a 5\%\ aggregate productivity shock.\footnote{For unemployed households, see \cref{fig:example_hh_irf_unemp} in \cref{sec:example_hh_results}.} Once again, the full-information results have substantially lower variance. Following the shock, there is a noticeable movement of the asset distribution computed under the true parameters (black solid curve). At horizon $h=8$, the mean increases by 0.16 relative to the steady state (black dashed curve), the variance increases by 0.10, and the third central moment decreases by 0.06. However, the true movement in the asset distribution is not so large relative to the estimation uncertainty. This further motivates the use of an efficient inference method that validly takes into account all estimation uncertainty. The previous qualitative conclusions hold up in repeated simulations from the calibrated model. We repeat the MCMC estimation exercise on 10 different simulated data sets.\footnote{Computational constraints preclude a full Monte Carlo study.} \cref{fig:example_hh_postdens_all} plots all 10 full-information and macro-only posterior densities for the three parameters on the same plot. Notice that the full-information densities for $\beta$ systematically concentrate closer to the true value than the macro-only posteriors do, as in \cref{fig:example_hh_postdens}. \begin{figure}[t] \centering \textsc{Heterogeneous household model: Posterior density, multiple simulations} \\[\baselineskip] \includegraphics[width=\linewidth,clip=true,trim=3em 0 3em 0]{hh_N1000_postdens.png} \caption{Posterior densities with (blue curves) and without (gray curves) conditioning on the micro data, for 10 different simulated data sets. See also caption for \cref{fig:example_hh_postdens}.} \label{fig:example_hh_postdens_all} \end{figure} Our inference approach is valid in the usual Bayesian sense no matter how small the sample size is. In \cref{fig:example_hh_postdens_N100} of \cref{sec:example_hh_results} we show that the full-information approach still yields useful inference about the model parameters if we only observe $N=100$ observations every ten periods (instead of $N=1000$ as above). \subsection{Comparison with moment-based methods} \label{sec:example_hh_lik} In this subsection, we compare the above full-information results with a moment-based inference approach, to shed light on the theoretical comparison in \cref{sec:theory_moment}. Due to the unobserved individual heterogeneity parameter $\lambda_i$, fixed-dimensional sufficient statistics do not exist in this model with the given observables.\footnote{The unobserved individual heterogeneity is observationally equivalent to micro measurement error given repeated cross sections of micro data.} Hence, we follow empirical practice and compute an \emph{ad hoc} selection of cross-sectional moments, including the sample mean, variance, and third central moment of household after-tax income. We compute the moments separately for the groups of employed and unemployed households, in each period $t=10,20,\dots,100$ where micro data is observed. We consider three moment-based approaches with different numbers of observables: The ``1st Moment'' approach only incorporates time series of sample means, the ``2nd Moment'' approach incorporates both sample means and variances, and the ``3rd Moment'' approach incorporates sample moments up to the third order. Once we compute the time series of cross-sectional moments on the simulated data, we treat them as additional time series observables and proceed as in the ``Macro Only'' approach considered earlier. To account for the sampling uncertainty in the cross-sectional moments, we appeal to a Central Limit Theorem and treat the moments as jointly Gaussian, which is equivalent to adding measurement error in those state space equations that correspond to the moments. A natural and practical way to construct the variance-covariance matrix of the measurement error is to estimate its elements using higher-order sample moments of micro data. The variance-covariance matrix is actually time-varying according to the structural model, but since this would be challenging to account for, we treat it as fixed over the sample.\footnote{Higher-order sample moments are less accurate approximations to their population counterparts. Given an empirically relevant cross-sectional sample size, the resulting variance-covariance matrix would be even more imprecise if inferred period by period.} \cref{sec:moment_vcv} provides the details of how we estimate the variance-covariance matrix. The computation time of the moment-based likelihood functions is not much faster than our full-information approach, since the evaluation of the micro likelihood (which is specific to the full-information method) takes approximately the same amount of time as the calculation of the model's steady state (which is common to all methods), when implemented on a research cluster with 20 parallel workers. We compare the shape and location of the likelihood functions for the full-information and moment-based methods.\footnote{We omit full posterior inference results for the moment-based methods, as they were more prone to MCMC convergence issues than our full-information method.} For graphical clarity, we vary a single parameter at a time, keeping the other parameters at their true values. \cref{fig:example_hh_lik_byrep} plots the univariate log likelihood functions of all inference approaches based on one typical simulated data set.\footnote{We compute the full-information likelihood function by averaging across $J=500$ smoothing draws. For a clearer comparison of the plotted likelihood functions, we fix the random numbers used to draw from the smoothing distribution across parameter values. Note that we \emph{do not} fix these random numbers in the MCMC algorithm, as required by the \citet{Andrieu2010} argument.} Since we are interested in the curvature of the likelihood functions near their maxima, and not the overall level of the functions, we normalize each curve by subtracting its maximum. \begin{figure}[t] \centering \textsc{Heterogeneous household model: Likelihood comparison} \\[\baselineskip] \includegraphics[width=\linewidth]{hh_likelihood_N1000_04-eps-converted-to.pdf} \caption{Comparison of log likelihoods across inference methods, based on one typical simulated data set. Each panel depicts univariate deviations of a single parameter while keeping all other parameters at their true values. The maximum of each likelihood curve is normalized to be zero. Vertical dashed lines indicate true parameter values. The ``1st Moment'' and ``Macro Only'' curves are flat on the right panel, since $\mu_\lambda$ is not identified from this data alone. For results across 10 different simulated data sets, see \cref{fig:example_hh_lik_byest} in \cref{sec:example_hh_lik_multi}. } \label{fig:example_hh_lik_byrep} \end{figure} \cref{fig:example_hh_lik_byrep} shows that the moment-based likelihoods do not approximate the efficient full-information likelihood well, with the ``3rd Moment'' likelihood being particularly inaccurately centered. There are two reasons for this. First, as discussed in \cref{sec:theory_moment}, there is no theoretical sufficient statistics in this setup, so all the moment-based approaches incur some efficiency loss. Second, the sampling distributions of higher-order sample moments are not well approximated by Gaussian distributions in finite samples, and the measurement error variance-covariance matrix depends on even higher-order moments, which are poorly estimated. A separate issue is that the individual heterogeneity parameter $\mu_\lambda$ cannot even be identified using the ``1st Moment'' approach, since this parameter does not influence first moments of the micro data. The ``2nd Moment'' likelihood is not entirely misleading but nevertheless differs meaningfully from the full-information likelihood.\footnote{The ``Full Info'' and ``Macro Only'' likelihoods are consistent with the posterior densities plotted in \cref{sec:example_hh_post}. For $\beta$, the ``Macro Only'' likelihood has a smaller curvature around the peak and a wider range of peaks across simulated data sets, so the full information method helps sharpen the inference of $\beta$. For $\sigma_e$, the ``Macro Only'' curves are close to their ``Full Info'' counterparts. The parameter $\mu_\lambda$ is not identified in the ``Macro Only'' case, so the corresponding likelihood function is flat.} \cref{fig:example_hh_lik_byest} in \cref{sec:example_hh_lik_multi} confirms that the aforementioned qualitative conclusions hold up across 10 different simulated data sets. To summarize, even in this relatively simple model, the moment-based methods we consider lead to a poor approximation of the full-information likelihood, and the inference can be highly sensitive to the choice of which moments to include. It is possible that other implementations of the moment-based approach would work better in particular applications. Nevertheless, any moment-based approach will require challenging \emph{ad hoc} choices, such as which moments to use and how to account for their sampling uncertainty. No such choices are required by the efficient full-information approach developed in this paper. \section{Illustration: Heterogeneous firm model} \label{sec:example_firm} As our second proof-of-concept example, we estimate a version of the heterogeneous firm model of \citet{Khan2008}. In addition to showing that our general inference approach can be applied outside the specific \citet{Krusell1998} family of models, we use this section to illustrate how sample selection or data censoring can easily be accommodated in our method. \subsection{Model, data, and prior} \label{sec:example_firm_baseline} A continuum of heterogeneous firms are subject to both idiosyncratic and aggregate productivity shocks. Investment is subject to non-convex adjustment costs. Specifically, firm $i$'s investment $I_{i,t}$ is free if $|I_{i,t}/k_{i,t}| \leq a$, where $k_{i,t}$ is the firm-specific capital stock, and $a \geq 0$ is a parameter. Otherwise, firms pay a fixed adjustment cost of $\xi_{i,t}$ in units of labor. $\xi_{i,t}$ is drawn at the beginning of every period from a uniform distribution on the interval $[0, \bar{\xi}]$, independently across firms and time. Here $\bar{\xi} \geq 0$ is another parameter. In addition to the aggregate productivity shock, there is a second aggregate shock that affects investment efficiency. The representative household has additively separable preferences over log consumption and (close to linear) leisure time. For brevity, we relegate the details of the model to \cref{sec:example_firm_details}, which entirely follows \citeauthor{Winberry2018}'s (\citeyear{Winberry2018}) version of the \citet{Khan2008} model. We aim to estimate the adjustment cost parameters $\bar{\xi}$ and $a$. \citet{Khan2008} showed that these parameters have little impact on the aggregate macro implications of the model in their preferred calibration; hence, micro data is needed. We keep all other parameters fixed at their true values for simplicity. \cref{sec:example_firm_prod} provides results for an alternative exercise where we instead estimate the parameters of the firms' idiosyncratic productivity process; the key messages are qualitatively similar to those presented below. We adopt the annual calibration of \citet{Winberry2018}, which in turn follows \citet{Khan2008}, see \cref{sec:example_firm_calib}. However, we make an exception in setting the firm's idiosyncratic log productivity AR(1) parameter $\rho_\epsilon=0.53$, following footnote 5 in \citet{Khan2008}.\footnote{This avoids numerical issues that arise when solving the model for high degrees of persistence, as required in the estimation exercise in \cref{sec:example_firm_prod}.} We then adjust the log productivity innovation standard deviation $\sigma_\epsilon=0.0364$, so that the variance of the idiosyncratic log productivity process is unchanged from the baseline calibration in \citet{Khan2008} and \citet{Winberry2018}. The macro implications of our calibration are virtually identical to the baseline in \citet{Khan2008}, as those authors note. We assume that the econometrician observes time series on aggregate output and investment, as well as repeated cross sections of micro data on firms' capital and labor inputs. We simulate macro data with sample size $T=50$, while micro cross sections of size $N=1000$ are observed at each point in time $t=1,\dots,50$. Unlike in \cref{sec:example_hh}, we do not add measurement error to the macro observables. The prior on $(\bar{\xi},a)$ is chosen to be flat in the natural parameter space. \subsection{Computation} As in \cref{sec:example_hh}, we solve and simulate the model using the \citet{Winberry2018} Dynare solution method. We follow \citet{Winberry2018} and approximate the cross-sectional density of the firms' micro state variables (log capital and idiosyncratic productivity) with a multivariate normal distribution. Computation of the micro sampling density is simple, since -- conditional on macro states -- the micro observables (capital and labor) are log-linear transformations of these micro state variables. We use $J=500$ smoothing draws to compute the unbiased likelihood estimate. The MCMC routine is the same as in \cref{sec:example_hh}. The starting values are selected by a rough grid search on the simulated data. We generate 10,000 draws and discard the first 1,000 as burn-in. Likelihood evaluation using 20 parallel cores is several times faster than computing the model's steady state. \subsection{Results} \label{sec:example_firm_results} Despite the finding in \citet{Khan2008} that macro data is essentially uninformative about the firms' adjustment cost parameters, these are accurately estimated when the micro data is used also. \cref{fig:example_firm_postdens} shows the posterior densities of $\bar{\xi}$ and $a$ computed on 10 different simulated data sets. The posterior distribution of each parameter is systematically concentrated close to the true parameter values. We refrain from visually comparing these results with inference that relies only on macro data, since the macro likelihood is almost entirely flat as a function of $(\bar{\xi},a)$, consistent with \citet{Khan2008}.\footnote{On average across the 10 simulated data sets, the standard deviation (after burn-in) of the macro log likelihood $\log p(\mathbf{x} \mid \theta)$ across all Metropolis-Hastings proposals of the parameters is only 0.14, while it is 18.7 for the micro log likelihood $\log p(\mathbf{y} \mid \mathbf{x}, \theta)$.} Thus, micro data is essential to inference about these parameters. This finding is broadly consistent with \citet{Bachmann2014}, who show that the dynamics of the cross-sectional dispersion of firm investment are very informative about the nature of firm-level frictions. \begin{figure}[t] \centering \textsc{Heterogeneous firm model: Posterior density, multiple simulations} \\[\baselineskip] \includegraphics[width=\linewidth]{firm_exp1_postdens.png} \caption{Posterior densities across 10 simulated data sets. Vertical dashed lines indicate true parameter values. Posterior density estimates from the 9,000 retained MCMC draws using Matlab's {\tt ksdensity} function with default settings.} \label{fig:example_firm_postdens} \end{figure} \subsection{Correcting for imperfect sampling of micro data} \label{sec:example_firm_censor} One advantage of the likelihood approach adopted in this paper is that standard techniques can be applied to correct for sample selection or censoring in the micro data. This is highly relevant for applied work, since household or firm surveys are often subject to known data imperfections, even beyond measurement error. Valid inference about structural parameters merely requires that the micro sampling density $p(y_{i,t} \mid z_t,\theta)$ introduced in \cref{sec:framework} accurately reflects the sampling mechanism, including the effects of selection or censoring. Hence, if it is known, say, that an observed variable such as household income is top-coded (i.e., censored) at the threshold $\bar{y}$, then the functional form of the density $p(y_{i,t} \mid z_t,\theta)$ should take into account that the observed data equals a transformation $y_{i,t} = \min\lbrace \tilde{y}_{i,t},\bar{y} \rbrace$ of the theoretical household income $\tilde{y}_{i,t}$ in the DSGE model. The likelihood functions of such limited dependent variable sampling models are well known and readily looked up, see for example \citet[chapters 17 and 19]{Wooldridge2010}.\footnote{If the nature of the data imperfection is only partially known, it may be possible to estimate the sampling mechanism from the data. For example, if the data is suspected to be subject to endogenous sample selection, one could specify a Heckman-type selection model and estimate the parameters of the selection model as part of the likelihood framework \citep[chapter 19]{Wooldridge2010}. It is outside the scope of this paper to consider nonparametric approaches or to analyze the consequences of misspecification of the sampling mechanism.} We provide one illustration below. Other approaches to estimating heterogeneous agent models do not handle data imperfections as easily or efficiently. For example, inference based on cross-sectional moments of micro observables may require lengthy derivations to adjust the moment formulas for selection or censoring, especially for higher moments. Moreover, even in models where low-dimensional sufficient statistics exist for the underlying micro variables, cf.\ \cref{sec:theory_moment}, the \emph{imperfectly observed} micro data may not afford such sufficient statistics. In contrast, our likelihood-based approach is automatically efficient, and the adjustments needed to account for common types of data imperfections can be looked up in microeconometrics textbooks. \paragraph{Illustration: Selection on outcomes.} We illustrate the previous points by adding an endogenous selection mechanism to the sampled micro data in the heterogeneous firm model. Assume that instead of observing a representative sample of firms every period, we observe the draws for those firms whose employment in that period exceeds the 90th percentile of the steady-state cross-sectional distribution of employment. To make the effective micro sample size comparable to that in \cref{sec:example_firm_results}, we here set the per-period micro sample size \emph{before selection} equal to $N=10000$. That is, out of 10000 potential draws in a period, we only observe the capital and labor inputs of the approximately 1000 largest firms. Though stylized, this sampling mechanism is intended to mimic the real-world phenomenon that databases such as Compustat tend to only cover the largest active firms in the economy. To adjust the likelihood for selection, we combine the model-implied cross-sectional distribution of the idiosyncratic state variables with the functional form of the selection mechanism. Let $g_t(\epsilon,k)$ be the cross-sectional distribution of idiosyncratic log productivity $\epsilon_{i,t}$ and log capital $k_{i,t}$ at time $t$, implied by the model (this density is approximated using an exponential family of densities, as in \citealp{Winberry2018}). In the model, log employment is given by $n_{i,t} = (\log\nu + \zeta_t - \log(w_t) + \epsilon_{i,t} + \alpha k_{i,t})/(1-\nu)$, where $w_t$ is the aggregate wage, $\zeta_t$ is log aggregate TFP, and $\nu$ and $\alpha$ are the output elasticities of labor and capital in the firm production function ($\nu+\alpha<1$). Since observations $y_{i,t} = (n_{i,t},k_{i,t})'$ are observed if and only if $n_{i,t} \geq \bar{n}$, the micro sampling density is given by the truncation formula\footnote{The integral in the denominator can be computed in closed form if the density $g_t(\epsilon,k)$ is multivariate Gaussian, which is the approximation we use in our numerical experiments, following \citet{Winberry2018}.} \[p(n_{i,t},k_{i,t} \mid z_t,\theta) = \frac{(1-\nu) g_t\big((1-\nu)n_{i,t} - \alpha k_{i,t} - \log\nu - \zeta_t + \log(w_t), k_{i,t} \big)}{\int_{-\infty}^\infty \int_{-\infty}^\infty \mathbbm{1}\big(\log\nu + \zeta_t - \log(w_t) + \epsilon + \alpha k \geq (1-\nu)\bar{n}\big) g_t(\epsilon,k) \, d\epsilon \, dk}.\] The selection threshold $\bar{n}$ is given by the true 90th percentile of the steady-state distribution of log employment. We assume this threshold is known to the econometrician for simplicity.\footnote{In principle, $\bar{n}$ could be treated as another parameter to be estimated from the available data.} \begin{figure}[tp] \centering \textsc{Heterogeneous firm model: Posterior densities with selection} \\[\baselineskip] \includegraphics[width=\linewidth]{firm_exp2_postdens.png} \caption{Posterior densities across 10 simulated data sets subject to selection. Vertical dashed lines indicate true parameter values. Posterior density estimates from the 9,000 retained MCMC draws using Matlab's {\tt ksdensity} function with default settings.} \label{fig:example_firm_postdens_trunc} \end{figure} \cref{fig:example_firm_postdens_trunc} shows the posterior distribution of the adjustment cost parameters $(\bar{\xi},a)$ in the model with selection, across 10 simulated data sets. All settings are the same as in \cref{sec:example_firm_results}, except for (i) the selection mechanism in the simulated micro data and the requisite adjustment to the functional form of the micro likelihood function, and (ii) the pre-selection micro sample size $N=10000$ (as discussed above). The posterior distributions of the parameters of interest remain centered close to the true parameter values, with no appreciable increase in posterior uncertainty relative to \cref{fig:example_firm_postdens}. This example demonstrates that data imperfections can be handled in a valid and efficient manner using standard likelihood techniques. \section{Extension to panel data} \label{sec:panel} While our baseline procedure in \cref{sec:method} assumes the micro data to be given by repeated cross sections, we now consider settings where the micro data has a panel dimension -- that is, the same cross-sectional units are observed over two or more consecutive time periods. For tractability, we focus on panel data sets where the time dimension per unit is short (similar to \citealp{Papp2020}). One example is rotating panel survey data, where each unit is observed for a few consecutive time periods, after which it is replaced by a new, representatively sampled unit (as in the Bureau of Labor Statistics' Consumer Expenditure Survey). Panel data sets with a large time dimension, such as detailed administrative data sets, are computationally challenging and beyond the scope of this paper. \subsection{Challenges and solutions} The main challenge in handling panel data is the need to integrate out any unobserved individual-specific state variables (such as idiosyncratic productivity or asset holdings) that influence agents' dynamic decision rules. If the structural model directly implies a simple functional form for the one-step-ahead predictive density $p(y_{i,t} \mid y_{i,t-1},y_{i,t-2},\dots,\mathbf{z},\theta)$ of the \emph{observed} data $y_{i,t}$ for individual $i$, then evaluating the micro likelihood is trivial (as in reduced-form dynamic panel data models). Unfortunately, in most settings this predictive density is not available in closed form, and must instead be computed as the integral $\int p(y_{i,t} \mid s_{i,t},\mathbf{z},\theta)p(s_{i,t} \mid y_{i,t-1},y_{i,t-2},\dots,\mathbf{z},\theta)\,ds_{i,t}$ over the latent micro state variables $s_{i,t}$. Whereas the first density in the integrand may often be available in closed form, the second density will typically not be (outside simple linear models). Hence, evaluating the integral for each $i$ and $t$ appears to be computationally infeasible in many applications, especially if the number of time periods is moderately large. Nevertheless, as we now show, it is often possible to evaluate the micro likelihood when the time dimension per unit is small, by avoiding direct evaluation of the intractable predictive density. Our proposal for exploiting panel data utilizes the model-implied relationship between (i) the latent micro state variables $s_{i,t_i}$ in the \emph{initial} period $t_i$ for individual $i$ and (ii) the micro observables $\lbrace y_{i,t} \rbrace_t$ in all observed time periods for that individual. This relation necessarily involves iterating on the dynamic micro decision rules of the agents in the economy. In the next subsection, we explain this approach by example, using the heterogeneous household model from \cref{sec:model_hh}. Since the main focus of this paper is repeated cross-sectional micro data, we leave a numerical exploration of the benefits of panel data for future work. \subsection{Example: Heterogeneous household model} \label{sec:panel_example} Unlike in \cref{sec:model_hh}, we here assume that we observe two consecutive periods of $y_{i,t}=(\epsilon_{i,t},\iota_{i,t})$ for each household $i$, i.e., household employment and income. To implement the likelihood estimate in \cref{sec:method}, we must evaluate the conditional micro density \[p(y_{i,t},y_{i,t-1} \mid \mathbf{z},\theta) = \underbrace{p(\epsilon_{i,t},\epsilon_{i,t-1} \mid \mathbf{z},\theta)}_{=p(\epsilon_{i,t-1},\theta)p(\epsilon_{i,t} \mid \epsilon_{i,t-1},\theta)} p(\iota_{i,t},\iota_{i,t-1} \mid \epsilon_{i,t},\epsilon_{i,t-1},\mathbf{z},\theta).\] Employment $\epsilon_{i,t}$ evolves as a simple exogenous two-state Markov process, so the challenge is to evaluate the last density on the right-hand side above. Note that, by definition of household income, \[\iota_{i,t-1} = \lambda_i \big( w_{t-1}[(1-\tau)\epsilon_{i,t-1} + b(1-\epsilon_{i,t-1})] + (1+r_{t-1})a_{i,t-2} \big),\] and \[\iota_{i,t} = \lambda_i \big( w_t[(1-\tau)\epsilon_{i,t} + b(1-\epsilon_{i,t})] + (1+r_{t})a_{t-1}'(a_{i,t-2},\epsilon_{i,t-1})\big),\] where $a_{t-1}'(a,\epsilon)$ is the model-implied micro policy function at period $t-1$ for next-period normalized assets given current normalized assets $a$ and current employment $\epsilon$, and given the aggregate state $z_{t-1}$. Conditional on $(\epsilon_{i,t},\epsilon_{i,t-1})$ and the macro states $\mathbf{z}$ in all periods, the observation $(\iota_{i,t},\iota_{i,t-1})$ is therefore a known transformation of the initial micro state vector $s_{i,t-1} = (\lambda_i,a_{i,t-2})$.\footnote{Strictly speaking, employment $\epsilon_{i,t-1}$ is also a micro state variable. However, since it follows an exogenous Markov process, our derivations above condition on it, and we can therefore disregard it in $s_{i,t-1}$.} We can then derive $p(\iota_{i,t},\iota_{i,t-1} \mid \epsilon_{i,t},\epsilon_{i,t-1},\mathbf{z},\theta)$ by applying the change-of-variables formula to the density $p(\lambda_i,a_{i,t-2} \mid \epsilon_{i,t},\epsilon_{i,t-1},\mathbf{z},\theta) = f(\lambda_i \mid \mu_\lambda)g_{\epsilon_{i,t-1}}(a_{i,t-2} \mid \psi_{t-1})$, where $\psi_{t-1}$ denotes the parameters governing the cross-sectional distribution and is part of the aggregate state $z_{t-1}$, and the density $g_{\epsilon_{i,t-1}}(a_{i,t-2} \mid \psi_{t-1})$ is directly available from the output of the model solution procedure, as discussed in \cref{sec:model_hh}.\footnote{Note that assets are predetermined, so the subscript for the distribution parameters is $t-1$.} Computing the Jacobian term in the change-of-variables formula requires us to evaluate the derivative $\partial a_{t-1}'(a,\epsilon)/\partial a$, for example by applying finite differences to the function $a_{t-1}'(a,\epsilon)$ that is outputted by the numerical model solution method.\footnote{If the solution method uses an approximate, discrete grid for this function, one possibility is to compute the derivative of a smooth interpolation of the discretized rule.} \subsection{Summary and discussion} In general terms, our proposal is to express the consecutive micro observations in terms of the latent micro state variables $s_{i,t_i}$ in the initial observed period $t_i$ for individual $i$. We can then ``invert'' this relation and evaluate the micro likelihood using the model-implied cross-sectional density of $s_{i,t_i}$ (which we also exploited previously in the repeated cross section setup). This strategy is highly context-specific as it exploits the structure of the observables and iterates on the model-implied dynamic decision rules of the agents. Though we have only illustrated the strategy for the case of two-period panel data, the idea could in principle be applied to longer panels by further iterating on the decision rules; however, this could become cumbersome when the time dimension is moderately large. As a side note, it is straightforward to allow for measurement error in the micro observables by simply adding independent noise to the density of the noise-less observables using the convolution formula.\footnote{Unlike the repeated cross section case, in the case of panel data, unobserved individual heterogeneity and micro measurement error are not observationally equivalent.} In some models the dynamic relationship between micro states and micro observables may be sufficiently convoluted to render the above approach impractical. For such cases, we propose an alternative approach in \cref{sec:panel_general} based on artificially adding lagged state variables to the micro state vector in the numerical model solution procedure. Though this alternative approach is conceptually simple to implement, the increase in the dimension of the effective micro state vector may require more time to be spent on computing an accurate numerical solution of the model. We therefore recommend that researchers first attempt the baseline approach illustrated in the previous subsection, which does not require any modification of the numerical model solution method. \section{Conclusion} \label{sec:concl} The literature on heterogeneous agent models has hitherto relied on estimation approaches that exploit \emph{ad hoc} choices of micro moments and macro time series for estimation. This contrasts with the well-developed framework for full-information likelihood inference in \emph{representative agent} models \citep{Herbst2016}. We develop a method to exploit the full information content in macro and micro data when estimating heterogeneous agent models. As we demonstrate through economic examples, the \emph{joint} information content available in micro and macro data is often much larger than in either of the two separate data sets. Our inference procedure can loosely be interpreted as a two-step method: First we estimate the underlying macro states from macro data, and then we evaluate the likelihood by plugging into the cross-sectional sampling densities given the estimated states. However, our method delivers finite-sample valid and fully efficient Bayesian inference that takes into account all sources of uncertainty about parameters and states. The computation time of our procedure scales well with the size of the data set, as the method lends itself to parallel computing. Unlike estimation approaches based on tracking a small number of cross-sectional moments over time, our full-information method is automatically efficient and can easily accommodate unobserved individual heterogeneity, micro measurement error, as well as data imperfections such as censoring or selection. For clarity, we have limited ourselves to numerical illustrations with small-scale models in this paper, leaving full-scale empirical applications to future work. Our approach is computationally most attractive when the model is solved using some version of the \citet{Reiter2009} linearization approach, since this yields simple formulas for evaluating the macro likelihood and drawing from the smoothing distribution of the latent macro states, cf.\ \cref{sec:method}. To estimate large-scale quantitative models it would be necessary to apply now-standard dimension reduction techniques or other computational shortcuts to the linearized representation of the macro dynamics \citep{Ahn2017,Auclert2020seq}, and we leave this to future research. Nevertheless, we emphasize that our method is in principle generally applicable, as long as there exists some way to evaluate the macro likelihood, draw from the smoothing distribution of the macro states, and evaluate the micro sampling density given the macro states. Our research suggests several additional avenues for future research. First, it would be useful to go beyond our extension to short panel data sets in \cref{sec:panel} and develop methods that are computationally feasible when the time dimension of the panel is large. Second, since our method works for a wide range of generic MCMC posterior sampling procedures, it would be interesting to investigate the scope for improving on the simple Random Walk Metropolis-Hastings algorithm that we use for conceptual clarity in our examples. Third, the goal of this paper has been to fully exploit all aspects of the assumed heterogeneous agent model when doing statistical inference; we therefore ignore the consequences of misspecification. Since model misspecification potentially affects the entire macro equilibrium and thus cannot be addressed using off-the-shelf tools from the microeconometrics literature, we leave the development of robust inference approaches to future work. \clearpage \section{Variance-covariance matrix for moment-based methods} \label{sec:moment_vcv} Here we describe how we estimate the variance-covariance matrix of the cross-sectional moments when implementing the moment-based inference approaches in \cref{sec:example_hh_lik}. We take the ``3rd Moment'' inference approach as an example. The measurement error variance-covariance matrices of other moment-based approaches can be derived in a similar fashion. Let $\hat m_{\epsilon j,t}$, for $\epsilon=0,1$ and $j=1,2,3$, be the cross-sectional sample moments of household after-tax income in period $t$, and $m_{\epsilon j,t}$ be the corresponding population moments, where $\epsilon$ indicates the employment status of the group and $j$ represents the order of the moment, such as the sample mean, variance, and third central moment. For instance, \begin{align*} \hat m_{11,t}&=\frac{\sum_{i=1}^{N}\iota_{i,t}\epsilon_{i,t}}{\sum_{i=1}^{N}\epsilon_{i,t}},\quad m_{11,t}=\mathbb E[\iota_{i,t}\mid \epsilon_{i,t}=1,\;z_t],\\ \hat m_{1j,t}&=\frac{\sum_{i=1}^{N}(\iota_{i,t}-\hat m_{11,t})^j\epsilon_{i,t}}{\sum_{i=1}^{N}\epsilon_{i,t}},\quad m_{1j,t}=\mathbb E[(\iota_{i,t}-m_{11,t})^j\mid \epsilon_{i,t}=1,\;z_t],\quad \text{for }j > 1. \end{align*} Define $\hat m_t \equiv \left( \hat m_{01,t}, \hat m_{02,t}, \hat m_{03,t}, \hat m_{11,t}, \hat m_{12,t}, \hat m_{13,t} \right)'.$ To construct the measurement error variance-covariance matrix $\mathbb V\left[\hat m_t\mid z_t\right]$, we need to compute the variances and covariances across $\hat m_{\epsilon j,t}$'s. It is easy to see that $\hat m_{0j,t}$ and $\hat m_{1k,t}$ are asymptotically independent as $N\to\infty$ for any moment orders $j,k$, so we can focus on deriving the diagonal blocks where the moments share the same employment status $\epsilon$. Let us first consider the variance of $\hat m_{11,t}$. As $(\iota_{i,t},\epsilon_{i,t})$ is cross-sectionally i.i.d.\ given $z_t$, we resort to the Central Limit Theorem and Slutsky's theorem and obtain\footnote{In the denominator, $\frac{1} {N}\sum_{i=1}^{N}\epsilon_{i,t}\overset{p}{\to} \mathbb{E}[\epsilon_{i,t}]$ as $N\to \infty$. Recall that $\mathbb{E}[\epsilon_{i,t}]=L$ for all $t$.} \begin{equation}\mathbb V[\hat m_{11,t}\mid z_t] = \frac{\mathbb V[\iota_{i,t}\mid \epsilon_{i,t}=1,\;z_t]}{N L}+o_p\left(N ^{-1}\right).\label{eqn:v11}\end{equation} The sample analog of $\mathbb V[\iota_{i,t}\mid \epsilon_{i,t}=1,\;z_t]$ is $\hat m_{12,t}$, the sample variance of the employed group in period $t$. As explained in the main text, we assume that the variance-covariance matrix of the moments is constant across time and estimate it using full-sample sample moments (i.e., averaging across time). Thus, the numerator in \eqref{eqn:v11} is approximated by $\hat m_{12} \equiv \frac 1 {|\mathcal T|}\sum_{t\in\mathcal T}\hat m_{12,t}$, where $\mathcal T$ is the subset of time points we observe the micro data, and $|\mathcal T|$ gives the number of elements in set $\mathcal T$.\footnote{In our numerical experiment, the micro sample size $N_t=N$ is constant over time. If this were not the case, $\hat{m}_{12}$ should be constructed using sample size weights.} Similarly, the denominator in \eqref{eqn:v11} can be approximated by $\hat N_1 \equiv \frac 1 {|\mathcal T|}\sum_{t\in\mathcal T}\sum_{i=1}^{N}\epsilon_{i,t}$. For other elements in the ``employed'' block, we have \begin{align*} &\mathbb V[\hat m_{12,t}\mid z_t] = \frac{\mathbb V[\left(\iota_{i,t}- m_{11}\right)^2\mid \epsilon_{i,t}=1,\;z_t]}{N L}+o_p\left(N ^{-1}\right)\approx \frac{\hat m_{14}-\hat m_{12}^2}{\hat N_1},\\ &\mathbb V[\hat m_{13,t}\mid z_t] = \frac{\mathbb V[\left(\iota_{i,t}- m_{11}\right)^3\mid \epsilon_{i,t}=1,\;z_t]}{N L}+o_p\left(N ^{-1}\right)\approx \frac{\hat m_{16}-6\hat m_{14}\hat m_{12}-\hat m_{13}^2+9\hat m_{12}^3}{\hat N_1},\\ &\mathbb{C}\text{ov}[\hat m_{11,t},\hat m_{12,t}\mid z_t] = \frac{\text{cov}[\iota_{i,t}- m_{11},\;\left(\iota_{i,t}- m_{11}\right)^2\mid \epsilon_{i,t}=1,\;z_t]}{N L}+o_p\left(N ^{-1}\right)\approx \frac{\hat m_{13}}{\hat N_1},\\ &\mathbb{C}\text{ov}[\hat m_{11,t},\hat m_{13,t}\mid z_t] = \frac{\text{cov}[\iota_{i,t}- m_{11},\;\left(\iota_{i,t}- m_{11}\right)^3\mid \epsilon_{i,t}=1,\;z_t]}{N L}+o_p\left(N ^{-1}\right)\approx \frac{\hat m_{14}-3\hat m_{12}^2}{\hat N_1},\\ &\mathbb{C}\text{ov}[\hat m_{12,t},\hat m_{13,t}\mid z_t] = \frac{\text{cov}[\left(\iota_{i,t}- m_{11}\right)^2,\;\left(\iota_{i,t}- m_{11}\right)^3\mid \epsilon_{i,t}=1,\;z_t]}{N L}+o_p\left(N ^{-1}\right) \\ &\qquad\qquad\qquad\qquad\;\; \approx \frac{\hat m_{15}-4\hat m_{13}\hat m_{12}}{\hat N_1}.\end{align*} In each equation, the first equality is given by a similar cross-sectionally i.i.d.\ argument. The second approximation rewrites the variance/covariance in the numerator in terms of population moments \citep[as in][but omitting inconsequential degree-of-freedom adjustments]{fisher1930moments}, and then substitutes these population moments with their sample analogs averaged over time. Note that the last terms in the equations above call for even higher-order sample moments. Specifically, to approximate the variance/covariance involving the $m$-th and $n$-th order sample moments, we need sample moments up to the $(m+n)$-th order. For the ``unemployed'' block, we can replace $\hat m_{1j,t},\;\epsilon_{i,t}=1,\;L,\;\hat m_{1j},\text{ and }\hat N_1$ with $\hat m_{0j,t},\;\epsilon_{i,t}=0,\;1-L,\;\hat m_{0j},\text{ and }\hat N_0 \equiv \frac 1 {|\mathcal T|}\sum_{t\in\mathcal T}\sum_{i=1}^{N}(1-\epsilon_{i,t}) $, respectively. Combining all steps above, we can approximate the measurement error variance-covari\-ance matrix using sample moments of micro data: \begin{align*}\mathbb V\left[\hat m_t\mid z_t\right]&\approx\begin{pmatrix}V_{00} & 0_{3\times3} \\ 0_{3\times3} & V_{11} \\ \end{pmatrix},\\ V_{00}&\equiv \frac 1{\hat N_0}\left(\begin{array}{ccc} \hat m_{02} & \hat m_{03} & \hat m_{04}-3\hat m_{02}^2\\ \hat m_{03} & \hat m_{04}-\hat m_{02}^2 & \hat m_{05}-4\hat m_{03}\hat m_{02} \\ \hat m_{04}-3\hat m_{02}^2 & \hat m_{05}-4\hat m_{03}\hat m_{02} & \substack{\hat m_{06}-6\hat m_{04}\hat m_{02}\\-\hat m_{03}^2+9\hat m_{02}^3} \\ \end{array}\right),\\ V_{11}&\equiv \frac 1{\hat N_1}\left(\begin{array}{ccc} \hat m_{12} & \hat m_{13} & \hat m_{14}-3\hat m_{12}^2\\ \hat m_{13} & \hat m_{14}-\hat m_{12}^2 & \hat m_{15}-4\hat m_{13}\hat m_{12} \\ \hat m_{14}-3\hat m_{12}^2 & \hat m_{15}-4\hat m_{13}\hat m_{12} & \substack{\hat m_{16}-6\hat m_{14}\hat m_{12}\\-\hat m_{13}^2+9\hat m_{12}^3} \\ \end{array}\right).\end{align*} \clearpage \section{Heterogeneous household model} \subsection{Calibration} \label{sec:example_hh_calib} \cref{tab:example_hh_calib} shows the parameter calibration used to simulate the data. Here $\pi(0 \to 1)$, for example, denotes the idiosyncratic Markov transition probability $P(\epsilon_{i,t+1}=1 \mid \epsilon_{i,t}=0)$. \begin{table}[tp] \centering \textsc{Heterogeneous household model: Parameter calibration} \\[\baselineskip] \renewcommand{\arraystretch}{1.1} \begin{tabular}{lll|lll} \hline $\beta$ & Discount factor & 0.96 & $\pi(0\rightarrow 1)$ & U to E trans. & 0.5 \\ $\alpha$ & Capital share & 0.36 & $\pi(1\rightarrow 0)$ & E to U trans. & 0.038 \\ $\delta$ & Capital depreciation & 0.10 & $\rho_\zeta$ & Agg.\ TFP AR(1) & 0.859 \\ $b$ & UI replacement rate & 0.15 & $\sigma_\zeta$ & Agg.\ TFP AR(1) & 0.014 \\ $\mu_\lambda$ & Idiosyncratic distr. & -0.25 & $\sigma_e$ & Meas.\ err.\ in output & 0.02\\ \hline \end{tabular} \caption{Parameter calibration in the heterogeneous household model.} \label{tab:example_hh_calib} \end{table} \subsection{Additional simulation results} \label{sec:example_hh_results} Here we provide additional results for the numerical illustration of the heterogeneous household model. \cref{fig:example_hh_consumption_unemp} shows the full-information and macro-only posterior distributions of the steady-state consumption policy function for unemployed households. \cref{fig:example_hh_irf_unemp} shows the full-information and macro-only posterior distributions of the impulse response function of the asset distribution for unemployed households with respect to a TFP shock. In terms of the comparison between full-information and macro-only inference, both these figures are qualitatively similar to those for employed households, cf.\ \cref{fig:example_hh_consumption,fig:example_hh_irf} in the main paper. \begin{figure}[tp] \centering \textsc{Het.\ household model: Consumption policy function, unemployed} \\[\baselineskip] \includegraphics[width=\linewidth,clip=true,trim=2em 0 2em 0]{hh_N1000_04_conspolfct_emp0.png} \caption{Posterior draws of steady-state consumption policy function for unemployed households. See caption for \cref{fig:example_hh_consumption}.} \label{fig:example_hh_consumption_unemp} \end{figure} \begin{figure}[tp] \centering \textsc{Het.\ household model: Impulse responses of asset distribution, unemployed} \\[\baselineskip] \includegraphics[width=\linewidth,clip=true,trim=3em 0 3em 0]{hh_N1000_04_distirf_emp0.png} \caption{Posterior of impulse response function of unemployed households' asset distribution with respect to an aggregate productivity shock. See caption for \cref{fig:example_hh_irf}.} \label{fig:example_hh_irf_unemp} \end{figure} \cref{fig:example_hh_postdens_N100} shows the full-information and macro-only posterior densities of the model parameters in an alternative simulation where we only observe $N=100$ micro draws every ten periods (instead of $N=1000$). All other settings are the same as in \cref{sec:example_hh}. Naturally, the accuracy of posterior inference is affected by the smaller sample size, but we see that the individual heterogeneity parameter $\mu_\lambda$ is still precisely estimated in this simulation. \begin{figure}[tp] \centering \textsc{Heterogeneous household model: Posterior density, $N=100$} \\[\baselineskip] \includegraphics[width=\linewidth]{hh_N100_04_postdens-eps-converted-to.pdf} \caption{Posterior densities with (blue solid curves) and without (black dashed curves) conditioning on the micro data, for cross-sectional sample size $N=100$. See caption for \cref{fig:example_hh_postdens}.} \label{fig:example_hh_postdens_N100} \end{figure} \clearpage \section{Heterogeneous firm model} \subsection{Model assumptions} \label{sec:example_firm_details} We here briefly describe the assumptions of the heterogeneous firm model. See \citet{Khan2008} and \citet{Winberry2018} for more complete discussions of the model. Note that the notation in this section recycles some of the notation used for the household model in \cref{sec:model_hh}. A unit mass of firms $i \in [0,1]$ have decreasing returns to scale production functions $Y_{i,t} = e^{\zeta_t+\epsilon_{i,t}}k_{i,t}^\alpha n_{i,t}^\nu$, where $k_{i,t}$ and $n_{i,t}$ denote firm-specific capital and labor inputs ($\alpha+\nu<1$). Labor $n_{i,t}$ is hired in a competitive labor market with aggregate wage rate $w_t$. Aggregate log TFP $\zeta_t$ evolves as an AR(1) process $\zeta_t = \rho_\zeta \zeta_{t-1} + \varepsilon_{\zeta,t}$, $\varepsilon_{\zeta,t} \overset{i.i.d.}{\sim} N(0,\sigma_\zeta^2)$. The firm-specific log productivity levels evolve as independent AR(1) processes $\epsilon_{i,t} = \rho_\epsilon \epsilon_{i,t-1} + \omega_{i,t}$, where the idiosyncratic shocks $\omega_{i,t} \overset{i.i.d.}{\sim} N(0,\sigma_\epsilon^2)$ are independent across $i$ and are dynamically independent of aggregate TFP. After production, firms can choose to turn part of their production good into investment in next-period capital. A gross investment level of $I_{i,t}$ yields next-period capital $k_{i,t+1} = (1-\delta)k_{i,t} + e^{q_t} I_{i,t}$. The aggregate investment efficiency shifter $q_t$ follows an AR(1) process $ q_t = \rho_q q_{t-1} + \varepsilon_{q,t}$, where the aggregate shock $\varepsilon_{q,t} \overset{i.i.d.}{\sim} N(0,\sigma_q^2)$ is independent of the aggregate TFP shock $\varepsilon_{\zeta,t}$. Investment activity is free if $|I_{i,t}/k_{i,t}| \leq a$, where $a \geq 0$ is a parameter. Otherwise, firms pay a fixed adjustment cost of $\xi_{i,t}$ in units of labor (i.e., the monetary cost is $\xi_{i,t} \times w_t$). $\xi_{i,t}$ is drawn at the beginning of every period from a uniform distribution on the interval $[0, \bar{\xi}]$, independently across firms and time. Here $\bar{\xi} \geq 0$ is another parameter. A representative household chooses consumption $C_t$ and labor supply $L_t$ to maximize \[\mathbb{E}_0\left[\sum_{t=0}^\infty \beta^t \left\{ \log C_t - \chi \frac {L_t^{1+\varphi}} {1+\varphi} \right\} \right],\] where $\varphi$ is the inverse Frisch elasticity of labor supply. The household owns all firms and markets are complete. Market clearing requires $C_t = \int (Y_{i,t} + I_{i,t})\,di$ and $L_t = \int n_{i,t}\, di$. See \citet[section 2.2]{Winberry2018} for the Bellmann equations implied by the firms' and household's optimality conditions. \subsection{Calibration} \label{sec:example_firm_calib} \cref{tab:example_firm_calib} shows the parameter calibration used to simulate the data. The labor disutility parameter $\chi$ is chosen so that steady-state hours equal $\bar{N}=1/3$, given all other parameters. As explained in \cref{sec:example_firm_baseline}, the only difference from \citet{Winberry2018} is that the idiosyncratic productivity process uses the alternative (less persistent) parametrization from \citet{Khan2008}. We do this because \citeauthor{Winberry2018}'s Dynare code appears to be more numerically stable in a neighborhood of these alternative parameter values. \begin{table}[tp] \centering \textsc{Heterogeneous firm model: Parameter calibration} \\[\baselineskip] \renewcommand{\arraystretch}{1.1} \begin{tabular}{lll|lll} \hline $\beta$ & Discount factor & 0.961 & $\overline\xi$ & Fixed cost bound & 0.0083 \\ $\chi$ & Labor disutility & $\bar{N}=\frac 1 3$ & $\rho_\zeta$ & Agg.\ TFP AR(1) & 0.859 \\ $\varphi$ & Inverse Frisch & $10^{-5}$ & $\sigma_\zeta$ & Agg.\ TFP AR(1) & 0.014 \\ $\nu$ & Labor share & 0.64 & $\rho_q$ & Agg.\ inv.\ eff.\ AR(1) & 0.859 \\ $\alpha$ & Capital share & 0.256 & $\sigma_q$ & Agg.\ inv.\ eff.\ AR(1) & 0.014 \\ $\delta$ & Capital depreciation & 0.085 & $\rho_\epsilon$ & Idio.\ TFP AR(1) & 0.53 \\ $a$ & No fixed cost region & 0.011 & $\sigma_\epsilon$ & Idio.\ TFP AR(1) & 0.0364 \\ \hline \end{tabular} \caption{Parameter calibration in the heterogeneous firm model.} \label{tab:example_firm_calib} \end{table} \subsection{Estimating the parameters of the firms' productivity process} \label{sec:example_firm_prod} In this subsection we run the same estimation exercise as in \cref{sec:example_firm}, except that we here estimate the AR(1) parameter $\rho_\epsilon$ and innovation standard deviation $\sigma_\epsilon$ of the firms' idiosyncratic log productivity process. All other structural parameters (including the adjustment cost parameters) are assumed known for simplicity. The data and estimation settings are similar to those in \cref{sec:example_firm_results} except that micro cross sections are observed at each of the five time points $t=10,20,\dots,50$. \cref{fig:example_firm_prod_postdens} shows the full-information posterior densities of the idiosyncratic productivity parameters $(\rho_\epsilon,\sigma_\epsilon)$, across 9 simulated data sets.\footnote{We simulated 10 data sets but discarded one, as standard MCMC convergence diagnostics showed a failure of convergence of the Metropolis-Hastings sampler for that particular data set.} The posterior densities are well-centered and concentrated near the true parameter values. We refrain from comparing with posterior inference that only exploits macro data, as these posteriors are extremely diffuse, consistent with \citet{Khan2008}. \begin{figure}[tp] \centering \textsc{Heterogeneous firm model: Posterior densities of productivity parameters} \\[\baselineskip] \includegraphics[width=\linewidth]{firm_exp3_postdens.png} \caption{Posterior densities across 9 simulated data sets. Vertical dashed lines indicate true parameter values. Posterior density estimates from the 9,000 retained MCMC draws using Matlab's {\tt ksdensity} function with default settings.} \label{fig:example_firm_prod_postdens} \end{figure} \section{Alternative panel data approach} \label{sec:panel_general} We here propose an alternative approach to handling panel data that may sometimes be more convenient than the procedure discussed in \cref{sec:panel}. Another view of the challenge described in that section is that, while the solution to the heterogeneous agent model supplies the marginal cross-sectional distribution of micro state variables at any point in time $p\left(s_{i,t}\mid z_{t},\theta\right)$, it does not directly supply the \emph{joint} density of micro state variables across multiple points in time $p\left(\left\{s_{i,t}\right\}_{t\in\mathcal{T}}\mid \mathbf{z},\theta\right)$. To get around this issue, our second proposal is to artificially expand the micro state vector when solving the heterogeneous agent model, by including the previous periods' state variables in the current state vector. Again, consider for illustration the heterogeneous household model in \cref{sec:model_hh}, and suppose each household is observed for two consecutive periods. Rather than treating the micro state vector as simply $s_{i,t}=(\lambda_i,\epsilon_{i,t},a_{i,t-1})$ (permanent productivity, current-period employment, and predetermined normalized assets), we now expand it to be $\tilde s_{i,t}=(\lambda_i,\epsilon_{i,t},a_{i,t-1},\epsilon_{i,t-1},a_{i,t-2})$ (thus including previous-period employment and normalized assets). Let $\tilde\psi_t$ denote the parameters governing the full four-dimensional cross-sectional distribution for the expanded micro state variables $\tilde s_{i,t}$. Then $\tilde\psi_t$ is part of the expanded aggregate state $\tilde z_t$. Having expanded the micro state vector, we now modify the numerical model solver so that it outputs the joint cross-sectional density of $\tilde{s}_{i,t}$, not just of $s_{i,t}$. This is achieved by altering the model solution code and continuing to impose all model-implied restrictions on the evolution of the cross-sectional distribution (which is summarized by distribution parameters $\tilde\psi_t$). Note that the model-implied restrictions include those implied by the individual saving behavior $a_{t}'(a,\epsilon)$ and the exogenous Markov process for employment $p(\epsilon_{i,t} \mid \epsilon_{i,t-1},\theta)$. We also continue to apply the \citet{Reiter2009} type model solution method, leading to a state space model for macro variables characterized by equations \eqref{eqn:loglin_transition} and \eqref{eqn:loglin_meas}. Given a draw of the macro states $\mathbf{\tilde z}$ outputted from the modified model solution, we can easily compute the micro likelihood for two consecutive periods of household employment and income $(y_{i,t},y_{i,t-1})=(\epsilon_{i,t},\iota_{i,t},\epsilon_{i,t-1},\iota_{i,t-1})$. This can be calculated as a simple distributional transformation of the four-dimensional distribution of the expanded micro state vector $\tilde s_{i,t}$, using the definition $\iota_{i,t'} = \lambda_i\lbrace w_{t'}[(1-\tau)\epsilon_{i,t'} + b(1-\epsilon_{i,t'})] + (1+r_{t'})a_{i,t'-1} \rbrace$ for $t' \in \lbrace t-1,t\rbrace$. Though conceptually simple, the downside of the approach described in this section is that the expansion of the micro state vector is computationally demanding, for two reasons. First, as the dimension of the effective micro state vector $\tilde s_{i,t}$ increases, so does the dimension of the distribution parameters $\tilde \psi_{t}$, and then both the speed and the precision of off-the-shelf numerical methods for solving heterogeneous agent models tend to deteriorate. Second, achieving a sufficiently accurate approximation of the cross-sectional distribution of the higher-dimensional expanded micro state vector $\tilde s_{i,t}$ may require using a large number $q$ of basis functions in the finite-dimensional distributional approximation described in \cref{sec:model_hh}, which further increases the dimension of $\tilde \psi_t$ in the equilibrium approximation. \end{appendices} \clearpage \phantomsection \addcontentsline{toc}{section}{References}
\section{Adjoint equations} \label{secAdjoint} The efficient implementation of {\it Algorithm} needs computationally tractable algorithm for solving the direction finding subproblem ${\bf P_c(u)}$ which at every iteration requires the evaluation of $\langle \nabla \bar{F}_0(u),d\rangle$, $\langle \nabla \bar{g}_i^1(u),d\rangle$, $i\in E$, $\langle \nabla \bar{g}_j^2(u),d\rangle$, $j\in I$. If we do that by using solutions to the linearized equations then each update of $d$ would request solving these equations. If we use adjoint equations the evaluation comes down to the calculations of scalar products since $\nabla \bar{F}_0(u)$, $\nabla \bar{g}_i^1(u)$, $i\in E$, $\nabla \bar{g}_j^2(u)$, $j\in I$ are available prior to solving ${\bf P_c(u)}$. It is sufficient to show how $\nabla \bar{F}_0(u)$ could be calculated with the help of adjoint equations since the adjoint equations for the other functionals will differ only by terminal conditions. We formulate the adjoint equations for two cases, they are derived on the basis of a variational approach presented in \cite{bh1975} and by taking into account our results on solutions to linearized equations of ordinary differential equations and differential--algebraic equations of the special form arising when a system remains in the sliding mode. {\it Case 1).} In the first case we assume that in the time interval $ [t_0,t_t] $ the system evolves according to \begin{equation} x' = f_1(x,u). \label{eqAdjEqsFirstCaseOde} \end{equation} At a transition time $ t_t $ the continuous state trajectory meets the switching surface such that the following condition holds \begin{equation} h(x(t_t)) = 0. \label{eqAdjEqsFirstCaseTrans} \end{equation} After the transition the system evolves according to DAEs \begin{eqnarray} x' &=& f_F(x,u) + h_x^T(x)z \label{eqAdjEqsFirstCaseDaeDiff} \\ 0 &=& h(x) \label{eqAdjEqsFirstCaseDaeAlg} \end{eqnarray} up to an ending time $ t_f $. To derive the adjoint equations we construct the following augmented functional \begin{eqnarray} &{\displaystyle \Phi(x,z,u,\lambda,\pi) = \phi(x(t_f)) + \pi h(x(t_t)) + \int_{t_0}^{t_t^-} \lambda_f^T(t) \left( x'(t) - f_1(x(t),u(t)) \right) dt}\nonumber \\ &{\displaystyle +\int_{t_t^+}^{t_f}\left [ \lambda_f^T(t) \left( x'(t) - f_F(x(t),u(t)) - h_x^T(x(t))z(t) \right) +\lambda_h^T(t) h(x(t))\right ] dt.} \nonumber \end{eqnarray} Suppose now that we calculate the variation of the augmented functional with respect to $(x,z)$ only. \begin{eqnarray} &{\displaystyle d\Phi(x,z,u,\lambda,\pi) = \phi_x(x(t_f))y^{x,d}(t_f) + \pi h_x(x(t_t))dx(t_t) + }\nonumber \\ &{\displaystyle \lambda_f^T(t_t^-) \left( x'(t_t^-) - f_1(x(t_t^-),u(t_t^-)) \right) dt_t }\nonumber \\ &{\displaystyle +d\left [\int_{t_0}^{t_t^-} \lambda_f^T(t) \left( x'(t) - f_1(x(t),u(t)) \right) dt\right ] }\nonumber \\ &{\displaystyle -\lambda_f^T(t_t^+) \left( x'(t_t^+) - f_F(x(t_t^+),u(t_t^+)) - h_x^T(x(t_t^+))z(t_t^+) \right)dt_t -\lambda_h^T(t_t^+) h(x(t_t^+)) dt_t }\nonumber \\ &{\displaystyle + d \left [\int_{t_t^+}^{t_f}\left [ \lambda_f^T(t) \left( x'(t) - f_F(x(t),u(t)) - h_x^T(x(t))z(t) \right) +\lambda_h^T(t) h(x(t))\right ] dt\right ].} \nonumber \end{eqnarray} By integrating by parts the formulas $ \int \lambda_f(t)x(t)dt $ (since $\lambda_f$ is sufficiently smooth) we obtain \begin{eqnarray} &{\displaystyle d\Phi(x,z,u,\lambda,\pi) = \phi_x(x(t_f))y^{x,d}(t_f) + \pi h_x(x(t_t))dx(t_t)}\nonumber \\ &{\displaystyle +\lambda_f^T(t_t^-) \left( x'(t_t^-) - f_1(x(t_t^-),u(t_t^-)) \right) dt_t + d\left [ \left[\lambda_f^T(t)x(t)\right]_{t_0}^{t_t^-}\right ] -}\nonumber \\ &{\displaystyle d\left [ \int_{t_0}^{t_t^-}\left [(\lambda_f^T)'(t) x(t) + \lambda_f^T(t) f_1(x(t),u(t))\right ] dt \right ] }\nonumber \\ &{\displaystyle -\lambda_f^T(t_t^+) \left( x'(t_t^+) - f_F(x(t_t^+),u(t_t^+)) - h_x^T(x(t_t^+))z(t_t^+) \right)dt_t }\nonumber\\ &{\displaystyle -\lambda_h^T(t_t^+) h(x(t_t^+)) dt_t + d \left [ \left[\lambda_f^T(t)x(t)\right]_{t_t^+}^{t_f} \right ] - }\nonumber \\ &{\displaystyle d\left [ \int_{t_t^+}^{t_f} \left [ (\lambda_f^T)'(t) x(t) + \lambda_f^T(t) \left( f_F(x(t),u(t)) + h_x^T(x(t))z(t) \right) - \lambda_h^T(t) h(x(t))\right ] dt\right ].} \nonumber \end{eqnarray} Expanding further the variations (also with respect to u) and taking into account the initial conditions of the linearized equations we obtain \begin{eqnarray} &{\displaystyle d\Phi(x,z,u,\lambda,\pi) = \phi_x(x(t_f))y^{x,d}(t_f) + \pi h_x(x(t_t))dx(t_t) +}\nonumber \\ &{\displaystyle \lambda_f^T(t_t^-)x'(t_t^-)dt_t - \lambda_f^T(t_t^-)f_1(x(t_t^-),u(t_t^-))dt_t +\lambda_f^T(t_t^-)y^{x,d}(t_t^-) }\nonumber \\ &{\displaystyle -\int_{t_0}^{t_t^-}\left [ (\lambda_f^T)'(t) y^{x,d}(t) + \lambda_f^T(t) (f_1)_x(x(t),u(t))y^{x,d}(t) \right .}\nonumber \\ &{\displaystyle \left . +\lambda_f^T(t) (f_1)_u(x(t),u(t))d(t) \right ]dt -\lambda_f^T(t_t^+)x'(t_t^+)dt_t +}\nonumber \\ &{\displaystyle \lambda_f^T(t_t^+)f_F(x(t_t^+),u(t_t^+))dt_t +\lambda_f^T(t_t^+)h_x^T(x(t_t^+))z(t_t^+)dt_t -}\nonumber \\ &{\displaystyle \lambda_h^T(t_t^+)h(x(t_t^+))dt_t + \lambda_f^T(t_f)y^{x,d}(t_f) - \lambda_f^T(t_t^+)y^{x,d}(t_t^+) - }\nonumber\\ &{\displaystyle \int_{t_t^+}^{t_f} \left [(\lambda_f^T)'(t) y^{x,d}(t) + \lambda_f^T(t) (f_F)_x(x(t),u(t)) y^{x,d}(t) \right . }\nonumber \\ &{\displaystyle + \lambda_f^T(t) (f_F)_u(x(t),u(t))d(t) + \lambda_f^T(t) h_x^T(x(t))y^{z,d}(t) +}\nonumber \\ &{\displaystyle \left . \lambda_f^T(t) (h_x^T(x(t))z(t))_xy^{x,d}(t)-\lambda_h^T(t) h_x(x(t))y^{x,d}(t) \right ]dt.} \nonumber \end{eqnarray} Now, if we take into account the formula (\ref{Lin5})--(\ref{Lin6}) for the differential of $ x(t_t) $, and rearrange the components with respect to differentials $ dx(t_t),\ dt_t $ and variations $ y^{x,d}(t_f),\ y^{x,d}(t),\ y^{z,d}(t),\ d(t) $ \begin{eqnarray} &{\displaystyle d\Phi(x,z,u,\lambda,\pi) = \left( \phi_x(x(t_f)) +\lambda_f^T(t_f) \right)y^{x,d}(t_f) + \left( \pi h_x(x(t_t)) + \right .}\nonumber \\ &{\displaystyle \left . \lambda_f^T(t_t^-) -\lambda_f^T(t_t^+) \right) dx(t_t) + \left( -\lambda_f^T(t_t^-)f_1(x(t_t^-),u(t_t^-)) + \right .} \nonumber \\ &{\displaystyle \left . \lambda_f^T(t_t^+)f_F(x(t_t^+),u(t_t^+)) + \lambda_f^T(t_t^+)h_x^T(x(t_t^+))z(t_t^+) - \lambda_h^T(t_t^+)h(x(t_t^+)) \right) dt_t }\nonumber \\ &{\displaystyle -\int_{t_0}^{t_t^-} \left ( (\lambda_f^T)'(t) + \lambda_f^T(t) (f_1)_x(x(t),u(t)) y^{x,d}(t) + \lambda_f^T(t) (f_1)_u(x(t),u(t))d(t) \right )dt }\nonumber \\ &{\displaystyle -\int_{t_t^+}^{t_f} \left [ \left( (\lambda_f^T)'(t) + \lambda_f^T(t) (f_F)_x(x(t),u(t)) + \lambda_f^T(t) (h_x^T(x(t))z(t))_x -\right . \right .} \nonumber \\ &{\displaystyle \left . \left . \lambda_h^T(t) h_x(x(t)) \right) y^{x,d}(t) + \lambda_f^T(t) (f_F)_u(x(t),u(t))d(t) + \lambda_f^T(t) h_x^T(x(t))y^{z,d}(t)\right ] dt.} \nonumber \end{eqnarray} We can now state conditions for adjoint equations such that the expressions with differentials $ dx(t_t),\ dt_t $ and variations $ y^{x,d}(t_f),\ y^{x,d}(t),\ y^{z,d}(t) $ disappear and only the coefficients with variation $ d(t) $ remain. These components will state a formula to efficiently calculate the gradient of $ \phi(x(t_f)) $ with respect to controls. Let us start with components that are present under the integrals. We want to zero the following components \begin{eqnarray} &{\displaystyle \left( (\lambda_f^T)'(t) + \lambda_f^T(t) (f_1)_x(x(t),u(t)) \right) y^{x,d}(t),\ t\in[t_0,t_t^-], }\nonumber \\ &{\displaystyle \left( (\lambda_f^T)'(t) + \lambda_f^T(t) (f_F)_x(x(t),u(t)) + \right .}\nonumber \\ &{\displaystyle \left . \lambda_f^T(t) (h_x^T(x(t))z(t))_x -\lambda_h^T(t) h_x(x(t)) \right) y^{x,d}(t),\ t\in[t_t^+,t_f],}\nonumber \\ &{\displaystyle \lambda_f^T(t) h_x^T(x(t))y^{z,d}(t),\ t\in[t_t^+,t_f] .}\nonumber \end{eqnarray} We achieve that by assuming that \begin{equation} (\lambda_f^T)'(t) = - \lambda_f^T(t) (f_1)_x(x(t),u(t)),\ t\in[t_0,t_t^-] \label{eqAdjEqsFirstCaseAdjOde} \end{equation} and \begin{eqnarray} (\lambda_f^T)'(t) &= &-\lambda_f^T(t) (f_F)_x(x(t),u(t)) - \lambda_f^T(t) (h_x^T(x(t))z(t))_x \nonumber \\ & & + \lambda_h(t) h_x(x(t)) \label{eqAdjEqeqAsFirstCaseAdjDaeDiff}\\ 0 &= & \lambda_f^T(t) h_x^T(x(t)),\ t\in [t_t^+,t_f]. \label{eqAdjEqsFirstCaseAdjDaeAlg} \end{eqnarray} (\ref{eqAdjEqsFirstCaseAdjOde}) is a system of ODEs with respect to the adjoint variable $ \lambda_f(t) $. (\ref{eqAdjEqeqAsFirstCaseAdjDaeDiff})--(\ref{eqAdjEqsFirstCaseAdjDaeAlg}) form a system of DAEs with respect to the adjoint variables $ \lambda_f(t) $ and $ \lambda_h(t) $. The DAEs are of index 2 which can be shown by considering the differentiation of (\ref{eqAdjEqsFirstCaseAdjDaeAlg}) \begin{eqnarray} 0 & = & \left( \lambda_f^T(t) h_x^T(x(t)) \right)' = (\lambda_f^T)'(t) h_x^T(x(t)) + \lambda_f^T(t) \left( h_x^T(x(t)) \right)'\nonumber \\ & = & \left( -\lambda_f^T(t) (f_F)_x(x(t),u(t)) - \lambda_f^T(t) (h_x^T(x(t))z(t))_x \right. \nonumber \\ & & \left. + \lambda_h(t) h_x(x(t)) \right) h_x^T(x(t)) + \lambda_f^T(t) \left( h_x^T(x(t)) \right)' \nonumber \end{eqnarray} The algebraic variable $ \lambda_h^T(t) $ is multiplied by $ h_x(x(t))h_x^T(x(t)) $ which is nonzero by the assumption {\bf (H1)}. This means that we can evaluate $ \lambda_h(t) $ by using the above equation which proves that the DAEs are index 2 equations. One can also show that under {\bf (H1)} a solution to the equations (\ref{eqAdjEqeqAsFirstCaseAdjDaeDiff})-(\ref{eqAdjEqsFirstCaseAdjDaeAlg}), and to the equations (\ref{eqAdjEqsFirstCaseAdjOde}), are such that $\lambda_f$ is an absolutely continuous functions. This fact justifies the use of the integration by parts formula in our derivations. Let us consider the component \begin{eqnarray} &{\displaystyle \left( \phi_x(x(t_f)) +\lambda_f^T(t_f) \right)y^{x,d}(t_f).}\nonumber \end{eqnarray} At the end of the time interval the trajectory evolves according to DAEs (\ref{eqAdjEqeqAsFirstCaseAdjDaeDiff})-(\ref{eqAdjEqsFirstCaseAdjDaeAlg}). The trajectory, after variation of controls, stays within the hyperplane defined by $ h(x(t)) = 0 $ which means that the variation $ y^{x,d}(t_f) $ is always orthogonal to $ h_x(x(t_f)) $. Therefore, the component disappears if the following condition is satisfied: \begin{eqnarray} &{\displaystyle \phi_x(x(t_f)) +\lambda_f^T(t_f) = \nu h_x(x(t_f)).}\nonumber \end{eqnarray} for some real number $\nu$. The DAEs (\ref{eqAdjEqeqAsFirstCaseAdjDaeDiff})-(\ref{eqAdjEqsFirstCaseAdjDaeAlg}) have to be consistently initialized. To provide the consistent endpoint conditions for the adjoint variables $ \lambda_f,\ \lambda_h $ we follow the approach presented in \cite{clps2000} and solve the following system of equations at time $ t_f $ for the variables $ \lambda_f, \lambda_h, \nu $ \begin{eqnarray} \nu h_x^T(x(t_f)) & = & \phi_x^T(x(t_f)) + \lambda_f(t_f) \label{terminal} \\ 0 & = & h_x(x(t_f))\lambda_f(t_f) \nonumber \\ 0 & = & \left(h_x(x(t_f))\right)'\lambda_f(t_f) - h_x(x(t_f)) \left( f_F \right)_x^T(x(t_f),u(t_f)) \lambda_f(t_f) -\nonumber \\ & & h_x(x(t_f)) \left(h_x^T(x(t_f))z(t_f)\right)_x^T \lambda_f(t_f) + \nonumber \\ & & h_x(x(t_f)) h_x^T(x(t_f)) \lambda_h (t_f). \label{slidingDAEIndex2HiddenAdjEndpoint} \end{eqnarray} The solution to these equations is (due to {\bf (H1)}): $\nu = h_x\phi_x^T/\|h_x\|^2$,\\ $\lambda_f = h_x\phi_x^Th_x^T/\|h_x\|^2 - \phi_x^T$, $\lambda_h = \lambda_f^T\left ( \left (f_F\right )_x + \left (h_xz\right )_x +h_x^T\right )/\|h_x\|^2$, where all functions are evaluated at $(x(t_f),z(t_f),u(t_f))$. At the transition time $ t_t $ the adjoint variable $ \lambda_f $ undergoes a jump. To calculate the value of $ \lambda_f(t_t^-) $ the following system of equations have to be solved for the variables $ \lambda_f(t_t^-),\ \pi $ \begin{eqnarray} \lambda_f(t_t^-) & = & \lambda_f(t_t^+) - \pi h_x^T(x(t_t)) \nonumber \\ \lambda_f^T(t_t^-) f_1(x(t_t^-),u(t_t^-)) & = & \lambda_f^T(t_t^+) f_F(x(t_t^+),u(t_t^+)) + \lambda_f^T(t_t^+)h_x^T(x(t_t^+))z(t_t^+) -\nonumber \\ & & \lambda_h^T(t_t^+)h(x(t_t^+)). \label{odeAdjTransHamilCont} \end{eqnarray} The solution to these equations is (due to {\bf (H2)}: $\pi = ( (\lambda_f^+)^Tf_1(-)-(\lambda_f^+)^Tf_F(+) -$ \\ $(\lambda_f^+)^Th_x(+)z^+ + \lambda_h^+ h(+))/h_x(+)f_1(-)$, $\lambda_f^- = \lambda_f^+ - \pi h_x(+)$. where $\lambda_f^+$, etc. is aa a function evaluated at $t_t^+$ (according to our notation (\ref{Jump2})), $\lambda_f^-$ at $t_t^-$, function $f_F(+)$, etc. is as evaluated at $(x(t_t^+),u(t_t^+))$, function $f_1(-)$, etc. at $(x(t_t^-),u(t_t^-))$. Once we solve the adjoint equations we obtain the adjoint variables $ \lambda_f $ and $ \lambda_h $. Eventually we are in a position to calculate the first variation of the cost function $ \phi(t_f) $ with respect to a control function variation $ d $ as follows \begin{eqnarray} &{\displaystyle d\phi(x(t_f)) = d\Phi(x,z,u,\lambda,\pi) = \left \langle \bar{F}_0(u),d\right \rangle = }\nonumber\\ &{\displaystyle -\int_{t_0}^{t_t^-} \lambda_f^T(t) (f_1)_u(x(t),u(t))d(t) dt - \int_{t_t^+}^{t_f} \lambda_f^T(t) (f_F)_u(x(t),u(t))d(t) dt. }\nonumber \end{eqnarray} \section{The weak maximum principle} \label{SecWMP} On the basis of the defined adjoint equations we can formulate the weak maximum principle for the considered problem. Suppose that $\bar{u}$ is the problem solution. Then, as shown in {\it Theorem \ref{t1}}, $\bar{u}$ will satisfy conditions (\ref{NC1a})--(\ref{NC1c}) together with $g_i^1 (x^{\bar{u}}(t_f)) = 0$, $i\in E$, $g_j^2 (x^{\bar{u}}(t_f))\leq 0$, $j\in I$. The weak maximum principle for the problem {\bf (P)} can assume a quite complicated form depending on the number of switching points triggered by the optimal control $\bar{u}$ In order to exemplify the possible conditions stated by the weak maximum principle consider the case when optimal control $\bar{u}$ forces the system behavior denoted as {\it Case 1)} in Section \ref{secAdjoint}. We call the necessary optimality conditions for that case ${\bf (NC^{13})}$ \vspace{3mm} \noindent ${\bf (NC^{13})}$: There exist: nonnegative numbers $\alpha_j^2$, $j\in I$, numbers $\alpha_i^1$, $i\in E$ such that $\sum_{i\in E}\left | \alpha_i^1\right | +\sum_{j\in I} \alpha_j^2 \neq 0$; piecewise differentiable function $\lambda_f$; piecewise continuous function $\lambda_h$, such that the following hold:\\ {\it (i) terminal conditions ($\lambda_f(t_f)$, $\lambda_h(t_f)$ and $\nu$ are evaluated from equations below)} \begin{eqnarray} -\lambda_f(t_f) & = & \phi_x^T(\bar{x}(t_f)) + \nu h_x^T(\bar{x}(t_f)) + \sum_{i\in E} \alpha_i^1\left (g_i^1\right )_x^T (\bar{x}(t_f))+ \sum_{j\in I} \alpha_j^2\left (g_j^2\right )_x^T (\bar{x}(t_f)) \nonumber \\ 0 & = & h_x(\bar{x}(t_f))\lambda_f(t_f) \nonumber \\ 0 & = & \left(h_x(\bar{x}(t_f))\right)'\lambda_f(t_f) - h_x(\bar{x}(t_f)) \left( f_F \right)_x^T(\bar{x}(t_f),\bar{u}(t_f))\lambda_f(t_f) - \nonumber \\ & & h_x(\bar{x}(t_f)) \left(h_x^T(\bar{x}(t_f))\bar{z}(t_f)\right)_x^T\lambda_f(t_f) + h_x(\bar{x}(t_f)) h_x^T(\bar{x}(t_f)) \lambda_h (t_f); \nonumber \end{eqnarray} {\it (ii) adjoint equations}\\ for $ t\in [t_t,t_f) $ \begin{eqnarray} \lambda_f' &=& - \left( f_F \right)_x^T(\bar{x},\bar{u})\lambda_f - \left(h_x^T(\bar{x})z\right)_x^T\lambda_f + h_x^T(\bar{x}) \lambda_h \nonumber \\ 0 &=& h_x(\bar{x})\lambda_f \nonumber \end{eqnarray} \noindent for $ t\in [t_0,t_t) $ \begin{eqnarray} \lambda_f' = - \left( f_1 \right)_x^T(\bar{x},\bar{u})\lambda_f; \nonumber \end{eqnarray} {\it (iii) jump conditions ($\lambda_f(t_t^-)$ and $\pi$ are evaluated from the equations below)} \begin{eqnarray} \lambda_f(t_t^-) & = &\lambda_f(t_t^+) - \pi h_x^T(\bar{x}(t_t^-)) \nonumber \\ \lambda_f^T(t_t^-) f_1(\bar{x}(t_t^-),\bar{u}(t_t^-)) & = & \lambda_f^T(t_t^+) f_F(\bar{x}(t_t^+),\bar{u}(t_t^+)) + \nonumber \\ & & \lambda_f^T(t_t^+)h_x^T(\bar{x}(t_t^+))\bar{z}(t_t^+) - \lambda_h^T(t_t^+)h(\bar{x}(t_t^+)); \nonumber \end{eqnarray} {\it (iv) the weak maximum principle}\\ \noindent for $ t\in [t_t,t_f) $ \begin{eqnarray} \lambda_f^T(t) \left (f_F\right )_u (\bar{x}(t),\bar{u}(t))u \leq \lambda_f^T(t) \left (f_F\right )_u (\bar{x}(t),\bar{u}(t))\bar{u}(t)\nonumber \end{eqnarray} \noindent for $ t\in [t_0,t_t] $ \begin{eqnarray} \lambda_f^T(t) \left (f_1\right )_u (\bar{x}(t),\bar{u}(t))u \leq \lambda_f^T(t) \left (f_1\right )_u (\bar{x}(t),\bar{u}(t))\bar{u}(t)\nonumber \end{eqnarray} for all $u\in U$;\\ {\it (v) complementarity conditions} \begin{eqnarray} \alpha_j^2 = 0,\ \ {\rm if}\ \ j\not\in I_{0,\bar{u}}. \nonumber \end{eqnarray} The necessary optimality conditions ${\bf (NC^{13})}$ are stated for the case when the optimal trajectory $(\bar{x},\bar{z})$ corresponding to the optimal control $\bar{u}$ is such that to the switching point $t_t$ the system evolution is according to $f_1$, and then the movement takes on the sliding surface until $t_f$. For that case we can prove the theorem which is the restatement of part {\it iii)} of {\it Theorem \ref{t1}}. \newtheorem{Th3}{Theorem}[section] \begin{Th3} \label{Th3} Assume that data for {\rm {\bf (P)}} satisfies hypotheses ${\bf (H1)}$, ${\bf (H2)}$, ${\bf (H3)}$, ${\bf (H4)}$ and ${\bf (CQ)}$. Let $\{u_k\}$ be a sequence of controls generated by {\it Algorithm} and let $\{c_k\}$ be a sequence of the corresponding penalty parameters. Then \begin{enumerate} \item [iii)] if $\bar{u}$ is the limit point of $\{u_k\}$, $\bar{x}$ its state corresponding trajectory and suppose that for $\bar{u}$ {\it Case 1)} applies, then the pair $(\bar{x},\bar{u})$ satisfies the necessary optimality conditions ${\bf (NC^{13})}$. \end{enumerate} \end{Th3} \begin{proof} As shown in the proof of Theorem 5.1 ({\it Stage 2}--Dualization) in \cite{pv98} the conclusions of the proof of {\it Theorem \ref{t1}} can be expressed by \begin{eqnarray} &{\displaystyle \min_{d\in {\mathcal D}_{\bar{u}}} \max_{\gamma\in {\mathcal K}} \Psi(d,\gamma) = 0}\nonumber \end{eqnarray} where \begin{eqnarray} &{\displaystyle {\mathcal K} = \left \{ \gamma = \left (\alpha_0,\{\alpha^1_i\}_{i\in E}, \{\alpha^2_j\}_{j\in I}\right )\in \mathbb{R}^{1+|E|+|I|}:\ \alpha_0\geq 0,\ \alpha^2_j\geq 0,\ j\in I, \right . } \nonumber \\ &{\displaystyle \left . \ \alpha_0 + \sum_{i\in E} \left |\alpha^1_i\right | + \sum_{j\in I}\alpha^2_j = 1,\ \alpha^2_j = 0\ \ {\rm if} \ j\not\in I_{0,\bar{u}} \right \}}\nonumber \end{eqnarray} and \begin{eqnarray} &{\displaystyle \Psi(d,\gamma) := \alpha_0\left \langle \nabla \bar{F}_0(\bar{u}),d\right \rangle + c \left ( \sum_{i\in E}\alpha^1_i\left \langle \nabla \bar{g}^1_i(\bar{u}),d\right \rangle + \sum_{j\in I_{0,\bar{u}}} \alpha^2_j\left\langle \nabla \bar{g}^2_j(\bar{u}), d\right\rangle \right ).}\nonumber \end{eqnarray} $\Psi(\cdot,\gamma)$ is a linear function on ${\mathcal C}^N_m[T]$ of which ${\mathcal D}_{\bar{u}}$ is a convex subset. $\Psi(d,\cdot)$ is a bounded linear map and ${\mathcal K}$ is a compact convex set with respect to the product topology of $\mathbb{R}^{1+|E|+|I|}$. It follows from the minimax theorem (\cite{ae}) that there exists some nonzero $\bar{\gamma}\in {\mathcal K}$ such that \begin{eqnarray} &{\displaystyle \min_{d\in {\mathcal D}_{\bar{u}}}\max_{\gamma\in {\mathcal K}} \Psi(d,\gamma) = \min_{d\in {\mathcal D}_{\bar{u}}} \Psi(d,\bar{\gamma}) = 0,}\label{l530} \end{eqnarray} with $\bar{\gamma} = (\bar{\alpha}_0,\{\bar{\alpha}^1_i\}_{i\in E},\{\bar{\alpha}^2_j\}_{j\in I})$. Since the constraint qualification ${\bf (CQ)}$ holds we can easily show that $\bar{\alpha}_0\neq 0$. The adjoint equations have been derived for the functional $\bar{F}_0(u)$, however similar analysis could be carried out for the functional \begin{eqnarray} &{\displaystyle H(u) = \bar{F}_0(u) + c\left ( \sum_{i\in E} \bar{\alpha}_i^1 \bar{g}_i^1 (u) + \sum_{j\in I}\bar{\alpha}_j^2\bar{g}_j^2(\bar{u}) \right ), }\nonumber \end{eqnarray} then by taking $\alpha_i^1 = c\bar{\alpha}_i^1$, $i\in E$, $\alpha_j^2 = c\bar{\alpha}_j^2$, $j\in I$ (notice that $c>0$). \end{proof} The other cases than {\it Case 1)} can be analyzed, with respect to necessary optimality conditions, in a similar way. We do not enumerate these cases because they are numerous, e.g.: the system behaves first according to function $f_2$, then, until the end it is in the sliding mode; the system starts in the sliding mode before moving to the mode with dynamics described by $f_1$ or $f_2$; there are several discrete modes the system assumes on the interval $[t_0,t_f]$. In particular, in {\it Case 2)}---the system starts in the sliding mode and at the time $t_t$ it switches to the discrete state $q=1$, the necessary optimality conditions will shape as follows (we assume that the switching function for leaving the sliding mode is given by $\eta(x,u)$). \vspace{3mm} \noindent ${\bf (NC^{31})}$: There exist: nonnegative numbers $\alpha_j^2$, $j\in I$, numbers $\alpha_i^1$, $i\in E$ such that $\sum_{i\in E}\left | \alpha_i^1\right | +\sum_{j\in I} \alpha_j^2 \neq 0$; piecewise smooth function $\lambda_f$; piecewise continuous function $\lambda_h$, such that the following hold:\\ {\it (i) terminal conditions} \begin{eqnarray} &{\displaystyle -\lambda_f(t_f) = \phi_x^T(\bar{x}(t_f)) + \sum_{i\in E} \alpha_i^1\left (g_i^1\right )_x^T (\bar{x}(t_f)) + \sum_{j\in I} \alpha_j^2\left (g_j^2\right )_x^T (\bar{x}(t_f))}\nonumber \end{eqnarray} {\it (ii) adjoint equations}\\ for $ t\in [t_t,t_f) $ \begin{eqnarray} \lambda_f' = - \left( f_1 \right)_x^T(\bar{x},\bar{u})\lambda_f; \nonumber \end{eqnarray} \noindent for $ t\in [t_0,t_t) $ \begin{eqnarray} \lambda_f' &=& - \left( f_F \right)_x^T(\bar{x},\bar{u})\lambda_f - \left(h_x^T(\bar{x})z\right)_x^T\lambda_f + h_x^T(\bar{x}) \lambda_h \nonumber \\ 0 &=& h_x(\bar{x})\lambda_f \nonumber \end{eqnarray} {\it (iii) jump conditions ($\lambda_f(t_t^-)$, $\nu_t$ and $\pi$ are evaluated from the equations below)} \begin{eqnarray} \lambda_f(t_t^-) - \lambda_f(t_t^+) + \pi \eta_x^T(x(t_t),u(t_t)) & = & \nu_t h_x^T(x(t_t^-)) \label{Tt1} \\ \lambda_f^T(t_t^-) f_F(x(t_t^-),u(t_t^-)) + \lambda_f^T(t_t^-)h_x^T(x(t_t^-))z(t_t^-) \nonumber \\ - \pi \eta_u(x(t_t),u(t_t))u'(t_t^-) - \lambda_h^T(t_t^-)h(x(t_t^-)) & = & \lambda_f^T(t_t^+) f_1(x(t_t^+),u(t_t^+)) \label{Tt2} \end{eqnarray} and \begin{eqnarray} 0 & = & h_x(x(t_t^-))\lambda_f(t_t^-)\label{Tt3} \\ 0 & = &\left(h_x(x(t_t^-))\right)'\lambda_f(t_t^-) - \nonumber \\ & & h_x(x(t_t^-)) \left( f_F \right)_x^T(x(t_t^-),u(t_t^-))\lambda_f(t_t^-) - \nonumber \\ & & h_x(x(t_t^-)) \left(h_x^T(x(t_t^-))z(t_t^-)\right)_x^T\lambda_f(t_t^-) + \nonumber \\ & & h_x(x(t_t^-)) h_x^T(x(t_t^-)) \lambda_h (t_t^-). \label{Tt4} \end{eqnarray} {\it (iv) the weak maximum principle}\\ \noindent for $ t\in [t_t,t_f) $ \begin{eqnarray} \lambda_f^T(t) \left (f_1\right )_u (\bar{x}(t),\bar{u}(t))u \leq \lambda_f^T(t) \left (f_1\right )_u (\bar{x}(t),\bar{u}(t))\bar{u}(t)\nonumber \end{eqnarray} \noindent for $ t=t_t$ \begin{eqnarray} {\displaystyle \left (\lambda_f^T(t_t^-) \left (f_F\right )_u (\bar{x}(t_t^-),\bar{u}(t_t^-)) + \pi \eta_u(x(t_t^-),u(t_t^-))\right )u \leq} \nonumber \\ \left (\lambda_f^T(t_t^-) \left (f_F\right )_u (\bar{x}(t_t^-),\bar{u}(t_t^-))+ \pi \eta_u(x(t_t^-),u(t_t^-))\right ) \bar{u}(t_t^-)\nonumber \end{eqnarray} \noindent for $ t\in [t_0,t_t) $ \begin{eqnarray} \lambda_f^T(t) \left (f_F\right )_u (\bar{x}(t),\bar{u}(t))u \leq \lambda_f^T(t) \left (f_F\right )_u (\bar{x}(t),\bar{u}(t))\bar{u}(t)\nonumber \end{eqnarray} for all $u\in U$;\\ {\it (v) complementarity conditions} \begin{eqnarray} \alpha_j^2 = 0,\ \ {\rm if}\ \ j\not\in I_{0,\bar{u}}. \nonumber \end{eqnarray} \section*{} \label{SecAppendix} \section{Proof of {\it Lemma \ref{l2}}} \label{AppendixL} \begin{proof} Take any $u\in {\cal U}$. Let $r>0$ be a number such that \begin{eqnarray} &{\displaystyle M(u) < r}\nonumber \end{eqnarray} for all $u\in {\cal U}$. We deduce from ${\bf (CQ)}$ that there is a simplex in ${\cal E}(u)\subset {\cal R}^{n_E}$ ($n_E= |E|$) with vertices $\{e_j\}_{j=0}^{n_E}$ which contains $0$ as an interior point. By definition of ${\cal E}(u)$, there exist $d_0,\ldots,d_{n_E}\in {\cal D}$ and $\delta > 0$ such that for $j=0,\ldots,n_E$ \begin{eqnarray} &{\displaystyle \left \{\left \langle \nabla \bar{g}^1_i(u), d_j\right \rangle\right \}_{i\in E} = e_j,\ \ \max_{i\in I} \left \langle \nabla \bar{g}^2_i(u), d_j \right \rangle \leq - \delta.} \nonumber \end{eqnarray} Let $(\lambda_0,\lambda_1,\ldots,\lambda_{n_E})$ be the barycentric coordinates of $0$ w.r.t. the vertices $e_j$ of the simplex, i.e. \begin{eqnarray} &{\displaystyle 0\ \left (=\sum_{j=0}^{n_E} \lambda_j e_j\right ) = \nabla \bar{g}^1 (u)\circ \sum_{j=0}^{n_E} \lambda_j d_j .}\nonumber \end{eqnarray} Here \begin{eqnarray} \nabla \bar{g}^1(u\circ d & := & \left \{\left \langle \nabla \bar{g}^1_i(u),d\right \rangle \right \}_{i\in E}.\nonumber \end{eqnarray} We shall also write \begin{eqnarray} \bar{g}^1 (u) & := & \left \{ \bar{g}^1_i(u)\right \}_{i\in E}.\nonumber \end{eqnarray} Since the vertices are in general position and $0$ is an interior point, the $\lambda_i$'s are all positive and we may find $\delta_1 > 0$ such that \begin{eqnarray} &{\displaystyle \left (\lambda_0 - \sum_{j=1}^{n_E} \alpha_j,\lambda_1 + \alpha_1,\ldots, \lambda_{n_E} + \alpha_{n_E} \right )} \nonumber \\ &{\displaystyle \in \left \{ \gamma\in {\cal R}^{n_E+1}:\ \gamma_j \geq 0\ \forall j,\ \sum_{j=0}^{n_E}\gamma_j =1 \right \}} \nonumber \end{eqnarray} whenever $\alpha\in {\cal B}(0,\delta_1)\subset {\cal R}^{n_E}$. (${\cal B}(0,\delta_1)$ is a ball with radius $\delta_1$.) Furthermore, the $n_E\times n_E$ matrix $P(u)$ defined by \begin{eqnarray} &{\displaystyle P(u)\alpha := \sum_{j=1}^{n_E} \nabla \bar{g}^1(u)\circ \alpha_j (d_j-d_0) } \label{b1} \end{eqnarray} is invertible for $u=\tilde{u}$, from the definition of $d_j,\ j= 1,\ldots,n_E$. In consequence of hypothesis ${\bf (CQ)}$ and in view of the continuity properties of the mapping $u\rightarrow y^{x,d}$ for fixed $d$ we may choose a neighborhood ${\cal O}(\tilde{u})$ of $\tilde{u}$ in ${\cal U}$ and numbers $\hat{r}\geq r$ and $\delta_2\in (0,\hat{r}^{-1}]$ such that for any $u\in {\cal U}$ satisfying $u\in {\cal O}(\tilde{u})$ \begin{eqnarray} (i) \hspace{5mm}& & \max_{i\in I}\left \langle \nabla \bar{g}^2_i(u),v_j - u\right \rangle \leq - \delta/2\ \ \forall j \nonumber\\ (ii)\hspace{5mm} & & P(u)\ \ {\rm is\ invertible} \nonumber\\ (iii)\hspace{5mm} & & \left \| P(u)^{-1} \nabla \bar{g}^1(u)\circ \left (\left (\sum_{j=0}^{n_E} \lambda_j v_j\right )-u\right ) \right \| \leq \delta_1/2\nonumber\\ (iv)\hspace{5mm} & & \delta_2 \left \| P(u)^{-1} \right \| n_E^{1/2} \leq \delta_1/2 .\nonumber \end{eqnarray} (In {\it (iv)} the norm is the Frobenius norm. Here the controls $v_j\in {\cal U}$, $j=0,\ldots,n_E$ are defined to be \begin{eqnarray} &{\displaystyle v_j(t):= u(t) + d_j(t,u(t)).}\nonumber \end{eqnarray} Now suppose that the control $u$ is not feasible. Set \begin{eqnarray} &{\displaystyle \alpha = P(u)^{-1} \left [ - \nabla \bar{g}^1(u)\circ \left (\left (\sum_{j=0}^{n_E}\lambda_j v_j\right ) -u\right ) - \delta_2 M(u)^{-1} \bar{g}^1(u) \right ]. } \nonumber \\ \label{b2} \end{eqnarray} Notice that, by properties {\it (iii)} and {\it (iv)}, $\| \alpha \| \leq \delta_1$. Also set \begin{eqnarray} &{\displaystyle \hat{v} = v_0 + \sum_{j=1}^{n_E} (\lambda_j + \alpha_j)(v_j-v_0).}\nonumber \end{eqnarray} Because $\| \alpha \| \leq \delta_1$ we have that $\hat{v}\in {\cal U}$. Finally we define $v$ to be \begin{eqnarray} &{\displaystyle v = u + \left (M(u)/\hat{r}\right )(\hat{v}-u).}\nonumber \end{eqnarray} Since $M(u)/\hat{r} \leq 1$, it follows that $v\in {\cal U}$. We now verify that this control function has the required properties. Notice first that \begin{eqnarray} &{\displaystyle \left \| v - u \right \|_{{\mathcal L}^\infty} \leq (2d/\hat{r})M(u),}\label{b3} \end{eqnarray} where $d$ is a bound on the norms of elements in ${\cal U}$. We have from (\ref{b1}) and (\ref{b2}) that \begin{eqnarray} P(u)\alpha & = & \nabla\bar{g}^1(u)\circ \sum_{j=1}^{n_E} \alpha_j(v_j- v_0) \nonumber \\ & = & - \nabla \bar{g}^1(u)\circ \left (\sum_{j=1}^{n_E} \lambda_j \left (v_j-v_0\right ) + v_0 - u\right ) - \delta_2 M(u)^{-1} \bar{g}^1(u).\nonumber \end{eqnarray} By definition of $\hat{v}$, \begin{eqnarray} &{\displaystyle \nabla \bar{g}^1(u)\circ (\hat{v}-u) = -\delta_2 M(u)^{-1}\bar{g}^1(u).}\nonumber \end{eqnarray} But then \begin{eqnarray} &{\displaystyle \nabla \bar{g}^1(u)\circ (v - u) = -(\delta_2/ \hat{r})\bar{g}^1(u).} \nonumber \end{eqnarray} Since $\delta_2/\hat{r}\leq 1$, it follows that \begin{eqnarray} &{\displaystyle \max_{i\in E} \left | \bar{g}^1_i(u) + \left \langle \nabla \bar{g}^1_i(u), v-u\right \rangle \right | - \max_{i\in E} \left | \bar{g}^1_i(u)\right | \leq - (\delta_2/\hat{r})M(u).}\label{b4} \end{eqnarray} We deduce from property {\it (i)} that \begin{eqnarray} &{\displaystyle \left \langle \nabla \bar{g}^2_j(u),v_0 + \sum_{i=1}^{n_E}\left (\lambda_i + \alpha_i\right )\left (v_i-v_0\right )-u\right \rangle \leq - \delta/2,\ \forall j\in I.} \nonumber \end{eqnarray} It follows that \begin{eqnarray} &{\displaystyle \left \langle \nabla \bar{g}^2_j(u),v-u\right \rangle \leq \left (M(u)\right )\left ( - \delta/2\right )\ \forall j\in I.}\nonumber \end{eqnarray} Since $M(u)/\hat{r}\leq 1$ we deduce that \begin{eqnarray} &{\displaystyle \min\left [0,\bar{g}^2_j(u)\right ]+ \left \langle \nabla \bar{g}^2_j(u),v-u\right \rangle \leq -\left (\delta/\left (2\hat{r}\right )\right )M(u)\ \forall j\in I.} \nonumber \\ \label{b5} \end{eqnarray} Surveying inequalities (\ref{b3})--(\ref{b5}), we see that $v$ satisfies all relevant conditions for completion of the proof, when we set $K_1 = \min \{\delta_2,\delta/(2\hat{r})\}$ and $K_2 = 2d/\hat{r}$, numbers whose magnitudes do not depend on our choice of $u$. \end{proof} \section{Proof of {\it Proposition \ref{p1}}} \label{AppendixP} \begin{proof} {\it (i)} Fix $u\in {\mathcal U}$, we must find $\hat{c} > 0$ such that, if $c > \hat{c}$ then $t_c(u)\leq 0$. If $M(u)=0$ then of course $t_c(u)\leq 0$ for any $c >0$. If $M(u) > 0$ then according to {\it Lemma \ref{l2}} there exists $\hat{d}\in {\cal U}-u$ such that, if we set $\varepsilon=K_1M(u) > 0$ with $K_1$ as in {\it Lemma \ref{l2}}, then \begin{eqnarray} &{\displaystyle \max_{i\in E} \left [\left |\bar{g}^1_i(u) + \left \langle \nabla \bar{g}^1_i(u),\hat{d} \right \rangle \right | -M(u) \right ] \leq \max_{i\in E} \left [\left | \bar{g}^1_i(u) + \left \langle \nabla \bar{g}^1_i(u),\hat{d} \right \rangle \right | -\left | \bar{g}_i^1(u) \right | \right ] \leq -\varepsilon,} \nonumber \\ &{\displaystyle \max_{j\in I} \left [\bar{g}^2_j(u) + \left \langle \nabla \bar{g}^2_j(u),\hat{d} \right \rangle -M(u) \right ] \leq \max_{j\in I} \left [\bar{g}^2_j(u) + \left \langle \nabla \bar{g}^2_j(u),\hat{d} \right \rangle -\bar{g}^2_i(u) \right ] \leq -\varepsilon } \nonumber \end{eqnarray} and \begin{eqnarray} &{\displaystyle \theta (u) < -\varepsilon.}\nonumber \end{eqnarray} Here \begin{eqnarray} &{\displaystyle \theta(u) = \max\left [ \max_{i\in E} \left |\bar{g}^1_i(u) + \left \langle \nabla \bar{g}^1_i(u),\hat{d}\right \rangle \right | -M(u), \right .} \nonumber \\ &{\displaystyle \left . \max_{j\in I}\left [ \bar{g}^2_j(u) + \left \langle \nabla \bar{g}^2_j(u), \hat{d}\right \rangle - M(u) \right ]\right ].} \nonumber \end{eqnarray} Because $\sigma_{c}(u) = \left \langle \nabla \bar{F}_0(u),\bar{d}\right \rangle + c\left [\bar{\beta}-M(u)\right ]$, from the definition of $t_c$ and (\ref{Lin1})--(\ref{Lin3}), we get \begin{eqnarray} &{\displaystyle t_c(u) \leq W + c \theta(u) + M(u)/c,}\nonumber \end{eqnarray} where $W=\max\ [0,\langle \nabla \bar{F}_0(u),\hat{d}\rangle]$. It follows that $t_c(u)\leq 0$ for any $c > \hat{c}$ where \begin{eqnarray} &{\displaystyle \hat{c} := \max \left [1, \frac{W + M(u)}{-\theta(u)}\right ]. }\nonumber \end{eqnarray} {\it (ii)} Take $u\in {\mathcal U}$ and $c > 0$ such that $\sigma_c(u) < 0$. Let $(d,\beta)$ be the solution to ${\bf P_c(u)}$. Since $\sigma_c(u)\neq 0$, it follows that $d\neq 0$. We deduce from the differentiability properties of $\phi$, $g^1_i$, $g^2_j$, and (\ref{Lin4}) that there exists $o:[0,\infty)\rightarrow [0,\infty)$ such that $s^{-1} o(s)\rightarrow 0$ as $s\downarrow 0$ and the following three inequalities are valid for any $\alpha\in [0,1]$: \begin{eqnarray} &{\displaystyle \bar{F}_c(u+\alpha d) - \bar{F}_c(u) \leq \alpha \left \langle \nabla \bar{F}_0(u),d\right \rangle + c \max \left [\max_{i\in E} \left | \bar{g}^1_i(u) + \alpha \left \langle \nabla \bar{g}^1_i(u), d\right \rangle \right |, \right .} \nonumber \\ &{\displaystyle \left . \max_{j\in I} \left ( \bar{g}^2_j(u) + \alpha \left \langle \nabla \bar{g}^2_j(u), d\right \rangle \right ) \right ] - \max \left [\max_{i\in E} \left |\bar{g}^1_i(u)\right |, \max_{j\in I} \bar{g}^2_j(u) \right ] + o(\alpha).} \label{l59} \end{eqnarray} By convexity of the functions $e\rightarrow \max_{i\in E} | \bar{g}^1_i(u) + \langle \nabla \bar{g}^1_i(u),e\rangle |$, $e\rightarrow \max_{j\in I} ( \bar{g}^2_j(u)$ $+\langle \nabla \bar{g}^2_j(u),e\rangle )$: \begin{eqnarray} &{\displaystyle \max_{i\in E} \left | \bar{g}^1_i(u) + \alpha \left \langle \nabla \bar{g}^1_i(u), d\right \rangle \right | - M(u_k) \leq \alpha \left [ \max_{i\in E} \left | \bar{g}^1_i(u) + \left \langle \nabla \bar{g}^1_i(u),d\right \rangle \right | - M(u_k) \right ],}\nonumber \\ &{\displaystyle \max_{j\in I} \left ( \bar{g}^2_j(u) + \alpha \left \langle \nabla \bar{g}^2_j(u), d\right \rangle \right ) - M(u_k) \leq \alpha \left [ \max_{j\in I} \left ( \bar{g}^2_j(u) + \left \langle \nabla \bar{g}^2_j(u),d\right \rangle \right ) - M(u_k) \right ].}\nonumber \end{eqnarray} From inequality (\ref{l59}) then \begin{eqnarray} &{\displaystyle \bar{F}_c(u+\alpha d) - \bar{F}_c(u) \leq \alpha \left \{ \left \langle \nabla \bar{F}_0(u), d\right \rangle + c\max [\max_{i\in E} \left |\bar{g}^1_i(u) + \left \langle\nabla \bar{g}^1_i(u), d\right \rangle\right |, \right .} \nonumber \\ &{\displaystyle \left . \left . \max_{j\in I} \left (\bar{g}^2_j(u) + \left \langle\nabla \bar{g}^2_j(u), d\right \rangle\right ) \right ] - c M(u) \right \} + o(\alpha) \leq \alpha \sigma_c(u) + o(\alpha).}\nonumber \end{eqnarray} It follows that \begin{eqnarray} &{\displaystyle \bar{F}_c(u + \alpha d) - \bar{F}_c(u) \leq \alpha \gamma \sigma_c(u)\ \ \forall \alpha\in [0,\alpha_1], }\label{l515} \end{eqnarray} where $\alpha_1 > 0$ is such that $o(\beta)\leq \beta(\gamma-1)\sigma_c(u)$ for all $\beta\in [0,\alpha_1]$. \end{proof} \section{Proof of {\it Theorem \ref{t1}}} \label{AppendixT} \begin{proof} {\it (i)} Let $\{u_k\}$ be the sequence generated by {\it Algorithm} and let $\{c_k\}$ be the corresponding penalty parameters. Let $\{k_l\}$ be the sequence of index values at which the penalty parameter increases. By extracting a further subsequence (we do not relabel) we can arrange that the sequence $\{u_{k_l}\}$ has a limit point $\bar{u}\in {\mathcal U}$ because ${\mathcal U}$ is compact. We shall find a number $\hat{c}<\infty$ such that for sufficiently large $k_l$ `$c_{k_l} > \hat{c}$' implies `$\sigma_{c_{k_l}}(u_{k_l})\leq - M(u_{k_l})|/c_{k_l}$'. This contradicts our assumption that the penalty parameter increases along the subsequence. So we may conclude that $\{c_k\}$ is bounded. Fix $k_l$ such that $u_{k_l}\in {\mathcal O}(\bar{u})$, where ${\mathcal O}(\bar{u})$ is the neighborhood of $\bar{u}$ as specified in {\it Lemma \ref{l2}}. From the minimizing property of $\sigma_{c_{k_l}}(u_{k_l})$ we deduce \begin{eqnarray} \sigma_{c_{k_l}}(u_{k_l}) & \leq & \left \langle \nabla \bar{F}_0(u_{k_l}),v_{k_l}-u_{k_l}\right \rangle + \nonumber \\ & & c_{k_l} \max\left [ \max_{i\in E} \left | \bar{g}^1_i(u_{k_l}) + \left \langle \nabla \bar{g}^1_i(u_{k_l}), v_{k_l} - u_{k_l} \right \rangle \right | - M(u_{k_l}),\right . \nonumber \\ & & \left . \max_{j\in I}\left [\bar{g}^2_j(u_{k_l}) + \left \langle \nabla \bar{g}^2_j(u_{k_l}),v_{k_l}-u_{k_l}\right \rangle \right ] - M(u_{k_l})\right ] \label{equal} \end{eqnarray} for a control function $v_{k_l}$ satisfying conditions (\ref{l532})--(\ref{l535}) of {\it Lemma \ref{l2}} in which $v_{k_l}$, $u_{k_l}$ replace $v$, $u$ respectively. It follows \begin{eqnarray} \sigma_{c_{k_l}} (u_{k_l}) & \leq & \left |\left \langle \nabla \bar{F}_0(u_{k_l}),v_{k_l}-u_{k_l}\right \rangle \right | - c_{k_l} K_1 M(u_{k_l}). \nonumber \end{eqnarray} Since the control constraint $U$ is bounded and in view of (\ref{Lin1})--(\ref{Lin3}) there exists $r>0$ (independent of $k_l$) such that \begin{eqnarray} &{\displaystyle \left | \left \langle \nabla \bar{F}_0(u_{k_l}),v_{k_l}-u_{k_l}\right \rangle \right | \leq r \| v_{k_l} - u_{k_l}\|_{{\mathcal L}^\infty}.} \nonumber \end{eqnarray} Hence \begin{eqnarray} &{\displaystyle \sigma_{c_{k_l}}(u_{k_l}) \leq - (c_{k_l}K_1 - r K_2) M(u_{k_l}).} \nonumber \end{eqnarray} We conclude that \begin{eqnarray} &{\displaystyle \sigma_{c_{k_l}}(u_{k_l}) \leq - M(u_{k_l})/c_{k_l} } \nonumber \end{eqnarray} if $c_{k_l} \geq \hat{c}$, where $\hat{c}$ is the smallest positive number $c$ which satisfies the equation: $c^2 K_1 - c (rK_2) \geq 1$. \vspace{2mm} {\it (ii)} and {\it (iii)} Let $\{u_k\}$ be an infinite sequence generated by {\it Algorithm}. We must show that $\lim_{k\rightarrow\infty}\sigma_{c_k}(u_k) =0$ and, if a convergent subsequence of $\{u_k\}$ has a limit point $\bar{u}\in {\mathcal U}$, that conditions ${\bf (NC^{13})}$ are satisfied at $\bar{u}$. {\it Stage 1. }(Convergence analysis) Since the $c_k$'s are bounded and can increase only by multiplies of $c^0$, we must have $c_k=c$ for all $k\geq k_0$, for some $k_0$ and $c>0$. In view of the manner in which $u_k$'s are constructed, we have \begin{eqnarray} &{\displaystyle \tilde{F}_c(u_{k+1})-\tilde{F}_c(u_k) \leq \gamma \alpha_k \sigma_c(u_k) }\nonumber \end{eqnarray} for all $k\geq k_0$. This means that, for all $j\geq 1$, $k\geq k_0$ \begin{eqnarray} &{\displaystyle \bar{F}_c(u_{k+j}) - \bar{F}_c(u_{k}) \leq \gamma \sum_{i=0}^{j-1} \alpha_{k+i} \sigma_c(u_{k+i}). }\label{54b} \end{eqnarray} Since $\{\bar{F}_c(u_k)\}$ is a bounded sequence and $\alpha_k\sigma_c(u_k)$ are nonpositive, we conclude \begin{eqnarray} &{\displaystyle \alpha_k\sigma_c(u_k) \rightarrow 0\ \ {\rm as}\ k\rightarrow \infty.}\label{l520} \end{eqnarray} Since $\sigma_c(u)$ is bounded as $u$ ranges over ${\mathcal U}$ we can arrange by a subsequence extraction (we do not relabel) that \begin{eqnarray} &{\displaystyle \sigma_c(u_k) \rightarrow \sigma\ {\rm for\ some}\ \sigma \leq 0.}\nonumber \end{eqnarray} We claim that $\sigma=0$. To show this, suppose to the contrary that $\sigma < 0$. Then by (\ref{l520}) $\alpha_k\rightarrow 0$. We must have \begin{eqnarray} \bar{F}_c(u_k + \eta^{-1}\alpha_k d_k) - \bar{F}_c (u_k) & > & \gamma \eta^{-1}\alpha_k \sigma_c(u_k) \nonumber \end{eqnarray} for all $k$ sufficiently large. However $\| \alpha_k d_k \|_{{\mathcal L}^\infty}\rightarrow 0$ as $k\rightarrow\infty$ (it follows from the presence of term $1/2 \| d\|^2_{{\mathcal L}^2}$ in the objective function of the direction finding subproblem). It follows now from (\ref{Lin1})--(\ref{Lin4}) and Propositions 2.1.5--2.1.6 stated in \cite{py99} that there exists a function $o:[0,\infty) \rightarrow [0,\infty)$ such that $s^{-1}o(s)\rightarrow 0$ as $s\downarrow 0$ and \begin{eqnarray} \max_{i\in E} \left |\bar{g}^1_i(u_k + \eta^{-1}\alpha_k d_k)\right | & \leq & \max_{i\in E}\left | \bar{g}^1_i(u_k) + \left \langle \nabla \bar{g}^1_i(u_k),\eta^{-1}\alpha_k d_k\right \rangle \right | + \nonumber \\ & & o(\eta^{-1}\alpha_k \left \| d_k\right \|_{{\mathcal L}^\infty}), \label{l521d} \\ \max_{j\in I} \bar{g}^2_j(u_k + \eta^{-1}\alpha_k d_k) & \leq & \max_{j\in I}\left [ \bar{g}^2_j(u_k) + \left \langle \nabla \bar{g}^2_j(u_k),\eta^{-1}\alpha_k d_k\right \rangle \right ] + \nonumber \\ & & o(\eta^{-1}\alpha_k \left \| d_k\right \|_{{\mathcal L}^\infty}), \label{l521dd} \end{eqnarray} and \begin{eqnarray} &{\displaystyle \bar{F}_c(u_k+\eta^{-1}\alpha_kd_k) - \bar{F}_c(u_k) \leq \left \langle \nabla \bar{F}_0(u_k),\eta^{-1}\alpha_kd_k\right \rangle +} \nonumber \\ &{\displaystyle c \max \left [\max_{i\in E} \left |\bar{g}^1_i(u_k) + \left \langle \nabla \bar{g}^1_i(u_k),\eta^{-1} \alpha_kd_k\right \rangle\right | \right . -M(u_k),} \nonumber \\ &{\displaystyle \left . \max_{j\in I} \bar{g}^2_j(u_k) + \left \langle \nabla \bar{g}^2_j(u_k),\eta^{-1} \alpha_kd_k\right \rangle -M(u_k)\right ] + o(\eta^{-1}\alpha_k\left \| d_k\right \|_{{\mathcal L}^\infty}).} \label{l521f} \end{eqnarray} By convexity of the functions $e\rightarrow \max_{i\in E} | \bar{g}^1_i(u) + \langle \nabla \bar{g}^1_i(u),e\rangle |$, $e\rightarrow \max_{j\in I} ( \bar{g}^2_j(u)$ $+\langle \nabla \bar{g}^2_j(u),e\rangle )$: \begin{eqnarray} &{\displaystyle \max_{i\in E} \left | \bar{g}^1_i(u_k) + \left \langle \nabla \bar{g}^1_i(u_k),\eta^{-1}\alpha_k d_k\right \rangle \right | - M(u_k) } \nonumber \\ &{\displaystyle \leq \eta^{-1} \alpha_k \left ( \max_{i\in E}\left |\bar{g}^1_i(u_k) + \left \langle \nabla \bar{g}^1_i(u_k),d_k\right \rangle \right | - M(u_k) \right ),} \label{l521i} \\ &{\displaystyle \max_{j\in I} \bar{g}^2_j(u_k) + \left \langle \nabla \bar{g}^2_j(u_k),\eta^{-1}\alpha_k d_k\right \rangle - M(u_k) } \nonumber \\ &{\displaystyle \leq \eta^{-1} \alpha_k \left ( \max_{j\in I}\bar{g}^2_j(u_k) + \left \langle \nabla \bar{g}^2_j(u_k),d_k\right \rangle - M(u_k)\right ),} \label{l521ia} \end{eqnarray} Combining inequalities (\ref{l521d})--(\ref{l521ia}), noting the definition of $\sigma_c(u_k)$ and the fact that $(d_k,\beta_k)$ solves ${\bf P_{c}(u_k)}$, and dividing across the resulting inequality by $\alpha_k$ we arrive at \begin{eqnarray} &{\displaystyle \eta^{-1}\sigma_c(u_k) + \alpha_k^{-1} o(\eta^{-1}\alpha_k \left \| d_k\right \|_{{\mathcal L}^\infty}) \geq \eta^{-1}\gamma \sigma_c(u_k).}\nonumber \end{eqnarray} We get $\eta^{-1}\sigma \geq \eta^{-1}\gamma \sigma$ in the limit. But this implies $\gamma \geq 1$, since $\sigma< 0$ by assumption. From this contradiction we conclude the validity of $\sigma =0$. Assertion {\it (ii)} of the theorem follows from the definition of $t_c$ and part {\it (i)}. Let $\{u_k\}$ be a convergent subsequence with the limit point $\bar{u}\in {\mathcal U}$. We must show that conditions ${\bf (NC^{13})}$ are satisfied at $\bar{u}$. First we establish that $\bar{u}$ is feasible for ${\bf (P)}$ and, for some $c> 0$, \begin{eqnarray} &{\displaystyle 0 \leq \left [ \left \langle \nabla \bar{F}_0(\bar{u}),d \right \rangle + c \max \left [\max_{i\in E} \left |\left\langle \nabla \bar{g}^1_i(\bar{u}),d\right\rangle\right|, \max_{j\in I} \left\langle \nabla \bar{g}^2_j(\bar{u}),d\right\rangle \right ] \right ] } \nonumber \end{eqnarray} for all $d\in {\mathcal D}_{\bar{u}}$. Since $\{u_k\}\rightarrow\bar{u}$ we know that $x_k=x^{u_k}\rightarrow x^{\bar{u}}=\bar{x}$ uniformly. Because the penalty parameter is not updated for $k$ sufficiently large we have \begin{eqnarray} &{\displaystyle \sigma_c(u_k) \leq - M(u_k)/c.}\nonumber \end{eqnarray} But we have shown that $\sigma_c(u_k)\rightarrow 0$ as $k\rightarrow\infty$. It follows now from the fact that $u_k\rightarrow\bar{u}\in {\mathcal U}$ that in the limit \begin{eqnarray} &{\displaystyle \max_{i\in E}\left |\bar{g}^1_i(\bar{u})\right | = 0, \ \max_{j\in I}\bar{g}^2_j(\bar{u})\leq 0.}\label{limit} \end{eqnarray} We have established that $\bar{u}$ is feasible for ${\bf (P)}$. Since $\sigma_c(u_k)\rightarrow 0$ and $M(u_k)\rightarrow 0$ we must also have $d_k\rightarrow 0$. If it does not happen then we would come to the contradiction with (\ref{SigmaPos}). That implies that we also must have $\beta_k\rightarrow 0$ and that means that at $\bar{u}$ (\ref{NC1b})--(\ref{NC1c}) must hold. Now choose any sequence $\rho_k\downarrow 0$, $\rho_k\leq 1$ for all $k$ such that \begin{eqnarray} &{\displaystyle \rho_k^{-1} \sigma_c(u_k) \rightarrow 0\ \ {\rm as}\ k\rightarrow \infty.}\label{l523} \end{eqnarray} Choose any $d\in {\mathcal D}_{\bar{u}}$. By the convexity of ${\mathcal U}$, $\rho_k d_k\in {\mathcal D}_{u_k}$ for each $k$. By definition of $\sigma_c$ then \begin{eqnarray} \sigma_c(u_k) & \leq & \phi_x(x^{u_k}(t_f)) y^{x_k,\rho_k d_k}(t_f) + \nonumber \\ & & c\max\left [\max_{i\in E}\left | g^1_i(x^{u_k}(t_f)) + (g^1_i)_x (x^{u_k}(t_f)) y^{x_k,\rho_k d_k}(t_f) \right | - M(u_k),\right . \nonumber \\ & & \left . \max_{j\in I}\left [g^2_j(x^{u_k}(t_f)) + (g^2_j)_x (x^{u_k}(t_f)) y^{x_k,\rho_k d_k}(t_f)\right ] - M(u_k)\right ]. \nonumber \\ \label{l524} \end{eqnarray} Fix $\hat{\varepsilon} > 0$. Since $\rho_k\downarrow 0$ (and consequently $y^{x_k,\rho_kd_k}\rightarrow 0$ uniformly), we have: \begin{eqnarray} &{\displaystyle \max_{j\in I}\left [ g^2_j(x^{u_k}(t_f)) + (g^2_j)_x (x^{u_k}(t_f)) y^{x_k,\rho_kd_k}(t_f)\right ]} \nonumber \\ &{\displaystyle \leq \max_{I_{\hat{\varepsilon},\bar{u}}} \left [ \ g^2_j(x^{u_k}(t_f)) + (g^2_j)_x(x^{u_k}(t_f)) y^{x_k,\rho_kd_k}(t_f) \right ], } \nonumber \end{eqnarray} for all $k$ sufficiently large. Here, $I_{\varepsilon,u} = \{i\in I:\ \bar{g}_i^2(u) \geq \max_{j\in I} [\bar{g}_j^2(u)]-\varepsilon \}$. Inserting these inequalities into (\ref{l524}), noting that $y^{x_k,\rho_k d_k}=\rho_ky^{x_k,d_k}$, dividing across by $\rho_k$ and passing to the limit with the help of (\ref{l523}) and continuity of $\bar{F}_0(\cdot)$, $u\rightarrow \langle \nabla\bar{F}_0(u),d\rangle$, etc, we obtain \begin{eqnarray} &{\displaystyle 0\leq \phi_x(x^{\bar{u}}_r(t_f)) y^{\bar{x},d}(t_f) +c\max\left [\max_{i\in E}\left |(g^1_i)_x (x^{\bar{u}}(t_f)) y^{\bar{x},d}(t_f)\right|, \right . } \nonumber \\ &{\displaystyle \left . \max_{j\in I_{\hat{\varepsilon},\bar{u}}}(g^2_j)_x(x^{\bar{u}}(t_f)) y^{\bar{x},d}(t_f) \right ]. } \label{mpwlm} \end{eqnarray} This inequality is valid for each $\hat{\varepsilon} > 0$ and $d\in {\mathcal D}_{\bar{u}}$. Again choose arbitrary $d\in {\cal D}_{\bar{u}}$ and take $\varepsilon_k\downarrow 0$. For each $k$ let $(g^2_j)_x(x^{\bar{u}}(t_f))\cdot$ $y^{\bar{x},d}(t_f)$ achieves its maximum over $I_{\varepsilon_k,\bar{u}}$ at $j=j_k$. Then \begin{eqnarray} &{\displaystyle 0 \leq \phi_x(x^{\bar{u}}(t_f))y^{\bar{x},d}(t_f) + c \left [\max_{i\in E} \left |(g^1_i)_x(x^{\bar{u}}(t_f)) y^{\bar{x},d}(t_f)\right |, \right .} \nonumber \\ &{\displaystyle \left . (g^2_{j_k})_x(x^{\bar{u}}(t_f)) y^{\bar{x},d}(t_f) \right ].} \label{5.15} \end{eqnarray} Extract a subsequence (we do not relabel) such that $j_k= \bar{j}$ for all $k$ and $t_k\rightarrow \bar{t}$ for some index value $\bar{j}$. By continuity of the functions involved $\bar{j}\in I_{0,\bar{u}}$ and (\ref{5.15}) is valid with $\bar{j}$. We have arrived at \begin{eqnarray} &{\displaystyle 0 \leq \phi_x(x^{\bar{u}}(t_f)) y^{\bar{x},d}(t_f) +c \max \left [ \max_{i\in E} \left |(g^1_i)_x(x^{\bar{u}}(t_f))y^{\bar{x},d}(t_f)\right |, \right .} \nonumber \\ &{\displaystyle \left . \max_{j\in I_{0,\bar{u}}}(g^2_j)_x(x^{\bar{u}}(t_f)) y^{\bar{x},d}(t_f) \right ] .}\label{AppendixFinalInequality} \end{eqnarray} \label{nondescfun2} Since $\sigma_{c_k}(u_k)\rightarrow 0$, from (\ref{SigmaPos}) we must also have $d_k\rightarrow 0$. $\{c_k\}$ is bounded and $M(u_k)\rightarrow 0$ then (\ref{SigmaPos}) also implies that $\beta_k\rightarrow 0$. Therefore, the inequality (\ref{AppendixFinalInequality}), which holds for all $d\in {\mathcal D}_{\bar{u}}$, in particular for $(d\equiv 0)\in {\mathcal D}_{\bar{u}}$, is what we set out to prove. Finally, we must attend to the case when {\it Algorithm} generates a finite sequence which terminates at a control $u_{\bar{k}} = \bar{u}$ satisfying the stopping criterion. This case is dealt with by applying the preceding arguments to the infinite sequence of controls obtained by `filling in' with repetitions of the following control $u_k$. \end{proof} \section{Calculating the optimal control} \label{CalcOptCon} In our work we consider hybrid systems with sliding modes. For the sake of simplicity let us consider a hybrid system with two discrete states collected in a set $ \mathcal{Q} = \{1,2 \}$. Let us assume that the invariant sets are $ \mathcal{I}(1) = \left\{ x\in \mathbb{R}^n: h(x)\leq 0 \right\} $ and $ \mathcal{I}(2) = \left\{ x\in \mathbb{R}^n: h(x)\geq 0 \right\} $ where $ h: \mathbb{R}^n \rightarrow \mathbb{R} $. If the hybrid system starts its evolution from a discrete state $ q = 1 $ the continuous state evolves according to an equation $ x' = f_1(x,u) $. At a transition time $ t_t $ the continuous state trajectory reaches the boundary of an invariant set and we have $ h(x(t_t)) =0$. The first order condition which guarantees that the continuous state trajectory will leave the invariant set $ \mathcal{I}(1) $ is (\cite{ljs2000}) \begin{equation} h_x(x(t_t))f_1(x(t_t),u(t_t)) > 0 \label{sw1} \end{equation} where $ h_x^T(x) $ is the normal vector to a surface \begin{equation} \Sigma = \{ x\in \mathbb{R}^n: h(x) = 0 \} \end{equation} at $ x $. If at a transition time we also have \begin{equation} h_x(x(t_t))f_2(x(t_t),u(t_t)) > 0 \label{sw2} \end{equation} then the discrete state changes from $ q=1 $ to $ q = 2 $ and the continuous state continues the evolution according to the equation $ x' = f_2(x,u) $. If at a transition time we have \begin{equation} h_x(x(t_t))f_2(x(t_t),u(t_t)) < 0 \end{equation} then both vector fields $ f_1(x,u) $ and $ f_2(x,u) $ point towards the surface $ \Sigma $ and we face the {\it sliding motion} phenomenon (\cite{dl2009}). The sliding motion can be handled with the concept of {\it Filippov solutions} (\cite{fil88},\cite{dl2009}). We say that a continuous state trajectory is a Filippov solution of the considered hybrid system if \begin{eqnarray} &{\displaystyle x' = \left \{ \begin{array} {ll} f_1(x,u) & {\rm if}\ h(x) < 0 \\ f_F(x,u) & {\rm if}\ h(x) = 0 \\ f_2(x,u) & {\rm if}\ h(x) > 0 \end{array} \right .}\nonumber \end{eqnarray} where $ f_F(x,u)$ is a convex combination of $ f_1(x,u) $ and $ f_2(x,u) $ \begin{equation} f_F(x,u) = (1-\alpha)f_1(x,u) + \alpha f_2(x,u),\ \alpha \in [0,1]. \label{fFDef} \end{equation} During the sliding motion the continuous state trajectory must stay in the surface $ \Sigma $, so the condition \begin{equation} h_x(x)f_F(x,u)=0 \label{fFTangency} \end{equation} must be satisfied. From (\ref{fFDef}) and (\ref{fFTangency}) it is easy to find the formula for $ \alpha $ coefficient \begin{equation} \alpha(x,u) = \frac{h_x(x)f_1(x,u)}{h_x(x)\left(f_1(x,u)-f_2(x,u) \right)}.\label{AlphaF} \end{equation} When dealing with hybrid systems we have to pay special attention to systems behavior at switching times $t_t$, on the left and the right of these points. To this end we define \begin{eqnarray} &{\displaystyle u(t_t^-) = \lim_{t\rightarrow t_t, t<t_t} u(t),\ u(t_t^+) = \lim_{t\rightarrow t_t, t>t_t} u(t),} \label{Jump2} \end{eqnarray} and we assume that $u$ is continuous from the left which means that \begin{eqnarray} &{\displaystyle u(t_t^-) = u(t_t)\ \ {\rm and}\ u(t_t^+) \neq u(t_t)} \label{Jump4} \end{eqnarray} in general. This notation at a neighborhood of time $t_t$ apply also to other functions, for example \begin{eqnarray} &{\displaystyle x(t_t^-) = \lim_{t\rightarrow t_t, t <t_t} x(t),\ x(t_t^+) = \lim_{t\rightarrow t_t, t >t_t} x(t).} \label{Jump2x} \end{eqnarray} In this setting general conditions (\ref{sw1})-(\ref{sw2}) for changing discrete states must be stated as follows: \begin{eqnarray} h_x(x(t_t^{-}))f_1(x(t_t^{-}),u(t_t^{-})) & > & 0 \label{sw1a} \\ h_x(x(t_t^+))f_2(x(t_t^+),u(t_t^+)) & > & 0, \label{sw2a} \end{eqnarray} and, in particular case when $h$ is defined through the function $\alpha(x,u)$ and, for example, the system transits to state $q=1$ \begin{eqnarray} \alpha(x(t_t^-),u(t_t^-)) &=& 0 \label{sw3lsc} \\ h_x(x(t_t^+))f_1(x(t_t^+),u(t_t^+)) & < & 0 \label{sw3alsc} \\ h_x(x(t_t^+))f_2(x(t_t^+),u(t_t^+)) & < & 0 \label{sw3blsc} \end{eqnarray} The introduced convention is also applied to integrals, for example \begin{eqnarray} &{\displaystyle \int_{t_0}^{t_t^-}p(x(t),u(t))dt = \lim_{t\rightarrow t_t,t< t_t}\int_{t_0}^t p(x(\tau),u(\tau))d\tau. }\nonumber \end{eqnarray} But taking piecewise smooth functions as controls requires also checking at each point $t_j$ (see (\ref{pwc2})) whether the system is still at a sliding mode after control changes at time $t_j$, if not a new discrete state at this time must be determined. During the sliding motion the continuous state trajectory should stay in a set $ \Sigma $. To keep this condition satisfied during the numerical integration, we follow the approach proposed in \cite{ap1998} and integrate the differential-algebraic equations (DAEs) \begin{eqnarray} x' &=& f_F(x,u) + h_x(x)^Tz \label{slidingDAEDiff} \\ 0 &=& h(x) \label{slidingDAEAlg} \end{eqnarray} instead of ODEs \begin{equation} x' = f_F(x,u). \label{Fil2} \end{equation} It can be shown that at a sliding motion equations (\ref{slidingDAEDiff})--(\ref{slidingDAEAlg}) and (\ref{Fil2}) are equivalent (\cite{ps2020a}). We prefer using (\ref{slidingDAEDiff})--(\ref{slidingDAEAlg}) instead of (\ref{Fil2}) for the reason of getting more stable numerical solution on the switching surface. The sliding motion can be treated as the third discrete state with $ q = 3 $. Treating the sliding motion as another discrete state implies that guards functions $h$ should depend also on control variables $u$ and system equations should be given, in general, by implicit equations (\ref{slidingDAEDiff})-(\ref{slidingDAEAlg}). From now on the invariant set at a discrete state $q$ will be defined as follows \begin{equation} \mathcal{I}(q) = \left\{ (x,z,u)\in \mathbb{R}^{n+1+m}: \eta_q(x,u)\leq 0 \right\},\ \eta_q: \mathbb{R}^{n} \times U\rightarrow \mathbb{R}^{n_{\mathcal{I}_q}} \label{defInvariantSeta} \end{equation} Furthermore, the function ${\mathcal F}$ is related to the functions $f_q$ and $h_q$ defining, for a given discrete state $q$, DAEs: \begin{eqnarray} x' & = & f_q (x,u) + \left (h_q\right )_x(x)^Tz \nonumber \\ 0 & = & h_q(x).\nonumber \end{eqnarray} In particular, we can have $h_q (x)\equiv 0$ for some $q$ and then the guarding function $\eta_q$ is not dependent on $u$. If we assume that a switching surface function $\eta$ depends on $u$ we need continuity of function $\eta(x(t),u(t))$ to locate uniquely a switching time $t_t$. For that reason we assume that control functions $u$ are piecewise smooth---another justification for the chosen admissible controls is given in the next Section \ref{secOpt} by referring to properties of the Filippov's solution stated in \cite{fil88}. Another implication of using switching functions dependent on $u$ is the necessity of updating the discrete state $q$ whenever control functions $u$ exhibit jumps. Consider the system \begin{eqnarray} x' & = & f(x,u) + h_x(x)^Tz = f_r(x,z,u) \label{NewslidingDAEDiffInd1} \\ 0 & = & h(x),\label{NewslidingDAEAlgInd1} \end{eqnarray} on $[t_0,t_f]$. We assume that on some subintervals $t^0,t^1]$ we can have $h(x)\equiv 0$ and in that case system (\ref{NewslidingDAEDiffInd1})--(\ref{NewslidingDAEAlgInd1}) reduces to ODEs. Since we consider, for the simplicity of presentation, that our hybrid system can be only in three states $q=1,2,3$ (and the third state reserved for a sliding motion) our state trajectory on the entire horizon $[t_0,t_f]$ will consist of trajectories of type $(x,z)$ on subintervals $A^s_i$, $i\in I_s$, and of type $x$ on subintervals $A^1_i$, $i\in I_1$ (if trajectory is defined by the function $f_1$) and subintervals $A^2_i$, $i\in I_2$ (if trajectory is defined by the function $f_2$). We have $\cup_{i\in I^s_i}A^s_i\cup_{i\in I_1}A^1_i\cup_{i\in I_2}A^2_i = [t_0,t_f]$. Our approach is based on sensitivity analysis stated in \cite{ps2020a} where it is shown that solutions to linearized equations of DAEs have properties similar to those exhibited by linearized equations to ordinary differential equations, provided that some conditions are met. Namely, if we denote by $(x,z)$ the solution of (\ref{NewslidingDAEDiffInd1})--(\ref{NewslidingDAEAlgInd1}) for given $u$, by $(x^{d},z^{d})$ the solution for the control $u+d$, and by $(y^{x,d},y^{z,d})$ the solution to the linearized equations: \begin{eqnarray} \left (y^{x}\right )' &=& f_x(x,u)y^x + \left (h_x(x)^Tz\right)_x y^x + h_x(x)^T y^z + f_u(x,u) d \label{LslidingDAEDiff} \\ 0 &=& h_x(x) y^x, \label{LslidingDAEAlg} \end{eqnarray} then the following will be satisfied \begin{eqnarray} \|(x,z)\|_{{\mathcal L}^\infty} & \leq & c_1 \label{Lin1} \\ \| (x^{d},z^{d}) - (x,z)\|_{{\mathcal L}^\infty} & \leq & c_2 \|d\|_{{\mathcal L}^\infty} \label{Lin2} \\ \| (y^{x,d},y^{z,d})\|_{{\mathcal L}^\infty} & \leq & c_3 \|d\|_{{\mathcal L}^1} \label{Lin3} \end{eqnarray} for some positive constants $c_1$, $c_2$, $c_3$. Furthermore, for any $\varepsilon$ satisfying $\varepsilon_t > \varepsilon > 0$, where $\varepsilon_t$ is as specified in ${\bf (H3)}$, there exists function $o:([0,\infty]\rightarrow (0,\infty)$ such that $\lim_{s\rightarrow 0^{+}} o(s)/s = 0$ and \begin{eqnarray} &{\displaystyle \| x^{d}(t) - \left (x(t) + y^{x,d}(t)\right )\| \leq o\left ( \|d\|_{{\mathcal L}^\infty}\right ),}\nonumber \\ &{\displaystyle \hspace{45mm} \forall t\in [t_0,t_t^1-\varepsilon] \bigcup [t_f-\varepsilon, t_f] \bigcup_{i\in I_t(u)\backslash \{N_t(u)\}} [t_t^i,t_t^{i+1}-\varepsilon].}\label{Lin4} \end{eqnarray} Here, the points $\{t_t^i\}_{i=1}^{N_t(u)}$ are as specified in the assumption ${\bf (H3)}$. In order to specify the relations for differentials of $x$ at a switching point $t_t$, denoted by $dx^d$, additional notation has to be introduced. Suppose that a control $u$ is perturbed by $d$, then a new switching point $t_t^d$ will occur. We assume that before switching of discrete states the system evolves according to equations (\ref{NewslidingDAEDiffInd1}--(\ref{NewslidingDAEAlgInd1}) with $f$ and $h$ replaced by $f_1$ and $h_1$ respectively and after the switching the system is described by (\ref{NewslidingDAEDiffInd1}--(\ref{NewslidingDAEAlgInd1}) with $f_2$ and $h_2$ instead of $f$ and $h$. Then, we have \begin{eqnarray} \left \| x^d_1(t_t^{d-})-x_1(t_t^-)- d\left (x_1\right)^d_-\right \| & \leq & o(\|d\|_{{\mathcal L}^\infty}), \label{Lin5} \\ \left \| x^d_2(t_t^{d+})-x_2(t_t^+)- d\left (x_2\right)^d_+\right \| & \leq & o(\|d\|_{{\mathcal L}^\infty}), \label{Lin6} \end{eqnarray} for all $u$ and $d$ such that $u+d\in {\mathcal U}$ where $d\left (x_1\right)^d_- = y^{x,d}_1(t_t^-) + f_{1r}(x_1(t_t^-),$ $z_1(t_t^-),u(t_t^-))$ $\times dt_t^d$, $x_1$, $x^d_1$, $z_1$ are solutions to equations (\ref{NewslidingDAEDiffInd1})--(\ref{NewslidingDAEAlgInd1}) with $f=f_1$, $h=h_1$, $y^{x,d}_1$ are solutions to the corresponding linearized equations associated with equations (\ref{NewslidingDAEDiffInd1})--(\ref{NewslidingDAEAlgInd1}), $d\left (x_2\right)^d_+ = y^{x,d}_2(t_t^+) + f_{2r}(x_2(t_t^+),z_2(t_t^+),u(t_t^+))dt_t^d$, $x_2$, $x^d_2$, $z_2$ are solutions to equations (\ref{NewslidingDAEDiffInd1})--(\ref{NewslidingDAEAlgInd1}) with $f=f_2$, $h=h_2$ and $y^{x,d}_2$ are solutions to the corresponding linearized equations associated with equations (\ref{NewslidingDAEDiffInd1})--(\ref{NewslidingDAEAlgInd1}). Here, $dt_t^d$ is the differential of the switching point $t_t$ and $o$ are such that $\lim_{s\rightarrow 0^+}|o(s)|/s =0$; $dx^d_-$ and $dx^d_+$ differentials correspond to systems behavior before and after the switching ($dx^d_-=dx^d_+$). In order to present the conjectures under which (\ref{Lin1})--(\ref{Lin4}) hold we introduce the function $e(x,z,u) = h_x(x)f(x,u) + \|h_x(x)\|^2z$. Then under {\bf (H1)}, {\bf (H2)} and {\bf (H3)} the relations (\ref{Lin1})--(\ref{Lin4}) are satisfied. \begin{description} \item[${\bf (H1)}$] $U$ is a compact convex set in ${\mathbb R}^m$, $f: {\mathbb R}^n\times {\mathbb R}^m\rightarrow {\mathbb R}^n$, $h: {\mathbb R}^n\rightarrow {\mathbb R}$, \\ i) function $f(\cdot,\cdot)$ is differentiable, $f_x$ $f_u$ are continuous and there exists $0<k_f^1 < +\infty$ such that \begin{eqnarray} &{\displaystyle \| f_x(x,u) \| \leq k_f^1} \label{SH2b} \end{eqnarray} for all $(x,u)\in {\mathbb R}^n\times U$,\\ ii) if $h(x)\not\equiv 0$ then $(x(t_0),z(t_0))$ are such that \begin{eqnarray} &{\displaystyle h(x(t_0)) =0,\ z(t_0)=0,\ h_x(x(t_0))f(x(t_0),u(t_0))=0,} \label{initial1} \end{eqnarray} $h(\cdot)$ is twice differentiable and $\nabla^2 h$ is continuous. Moreover, there exist $\varepsilon > 0$, $ 0 < k_{hf} <+\infty$, $0< k_e^1 < +\infty$, $0 < k_f^2 < +\infty$, $0< k_f^3 < +\infty$, $0 < k_h^1 < k_h^2 < +\infty$, $0 < k_h^3 < +\infty$ with the properties \begin{eqnarray} &{\displaystyle \| f(x,u) \| \leq k_f^2} \label{SM2ba}\\ &{\displaystyle \| f_u(x,u) \| \leq k_f^3} \label{SM2bc} \\ &{\displaystyle \|h_x(x)f(x,u)\| \leq k_{hf}} \label{SH2a} \\ &{\displaystyle \| e_{x,z,u}(\hat{x},\hat{z},\hat{u}) - e_{x,z,u}(x,z,u)\|\leq k_e^1\|(\hat{x},\hat{z},\hat{u}) - (x,z,u) \|} \label{SH2c} \\ &{\displaystyle k_h^1 \leq \|h_x(x) \| \leq k_h^2} \label{SH2e} \\ &{\displaystyle \|\nabla^2 h(x)\| \leq k_h^3} \label{SH2f} \end{eqnarray} for all $(x,z,u)$, $(\hat{x},\hat{z},\hat{u})$ in $\mathbb{R}^n\times \mathbb{R} \times U$ such that $|h(x)|\leq\varepsilon$, $| h(\hat{x})|\leq \varepsilon$. \end{description} In ${\bf (H1)}$ it is assumed that $U$ is a compact convex set. In order to show (\ref{Lin1})--(\ref{Lin4}) it is sufficient to assume that $U$ is bounded, but the convergence analysis which is based on (\ref{Lin1})--(\ref{Lin4}) requires the stronger assumption. \begin{description} \item[${\bf (H2)}$] i) Function $\eta(\cdot,\cdot)$ is differentiable and there exist $0<L_1<+\infty$ and $0<L_2 <+\infty$ such that \begin{eqnarray} \left \| \eta_{x,u}(\hat{x},\hat{u}) - \eta_{x,u}(x,u)\right \| & \leq & L_1\|(\hat{x},\hat{u}) - (x,u) \| \label{H3a} \\ \left | f_{r}(\hat{x},\hat{z},\hat{u}) - f_{r}(x,z,u)\right | & \leq & L_2\|(\hat{x},\hat{z},\hat{u}) - (x,z,u) \| \label{H3b} \end{eqnarray} for all $(x,z,u)$, $(\hat{x},\hat{z},\hat{u})$ in $\mathbb{R}^n\times \mathbb{R} \times U$. \vspace{2mm} ii) There exists $\varepsilon > 0$ and $0<L_3 <+\infty$ such that for all switching points $t_t$ (each switching time corresponds to some $u\in {\mathcal U}$) and for all their perturbations $t_t^d$ triggered by perturbations $d$ such that $u+d\in {\mathcal U}$, $\|d\|_{{\mathcal L}^\infty}\leq \varepsilon$, and for all $\theta\in [0,1]$ we have \begin{eqnarray} &{\displaystyle \left |\eta_x(x(\tau^{\theta ,d}(t_t)),u(\tau^{\theta ,d}(t_t) )) f_{r}(x(\tau^{\theta ,d}(t_t)),z(\tau^{\theta ,d}(t_t)),u(\tau^{\theta ,d}(t_t) ))\right . }\nonumber \\ &{\displaystyle \left . + \eta_u(x(\tau^{\theta ,d}(t_t)),u(\tau^{\theta ,d}(t_t) ))u'(\tau^{\theta ,d}(t_t))\right |\geq L_3} \label{H3c} \end{eqnarray} where \begin{eqnarray} \tau^{\theta ,d}(t_t) & = & t_t + \theta (t^d_t - t_t). \label{Midt} \end{eqnarray} \vspace{2mm} iii) Perturbations $d\in {\mathcal U}-u$ are such that \begin{eqnarray} &{\displaystyle \|d\|_{{\mathcal L}^\infty} \rightarrow 0 \implies\|d'\|_{{\mathcal L}^\infty} \rightarrow 0. } \label{Dprime} \end{eqnarray} \end{description} Notice that if system leaves discrete state $q=1$, or $q=2$ then $\eta=h$ and does not depend on $u$. We denote by $N_t(u)$ the number of switching times triggered by a control $u\in {\mathcal U}$ and by $I_t(u)$ the set of indices which indicates all switching points. We make the hypothesis \begin{description} \item[{\bf (H3)}] There exists a nonnegative integer number $I_t^{{\rm max}} < +\infty$ and $\varepsilon_t > 0$ such that \begin{eqnarray} N_t(u) & \leq & I_t^{{\rm max}}, \label{Hyp4}\\ t_t^i & \leq & t_t^{i+1} - \varepsilon_t,\ \forall i\in I_t(u)\ \backslash \{N_t(u)\},\label{Hyp4a} \\ t_t^{N(u)} & \leq & t_f - \varepsilon_t \label{Hyp4b} \end{eqnarray} for all $u\in {\mathcal U}$. \end{description} \section{Optimal control problem with sliding modes and piecewise smooth controls} \label{secOpt} Taking into account the considerations and definitions presented in the previous section, in particular including the possibility of the system entering (and spending some time) in the sliding mode, we now turn attention to the optimal control problem of interest---{\bf (P)}: \begin{eqnarray} &\min_{u} \phi(x(t_f))& \label{defOptControlProblemCost} \end{eqnarray} subject to the constraints \begin{eqnarray} \begin{array}{lc} x' = f_1(x,u) &\ \ {\rm if}\ q=1 \nonumber \\ x' = f_2(x,u) &\ \ {\rm if}\ q=2 \nonumber \\ \left \{ \begin{array}{lll} x' & = & f_F(x,u) + h_x(x)^Tz \nonumber \\ 0 &=& h(x) \nonumber \end{array}\right . &\ \ {\rm if}\ q=3 \end{array}\nonumber \\ \label{SystemEq} \end{eqnarray} and the terminal constraints \begin{eqnarray} &g^1_i(x(t_f)) = 0\ \forall i\in E & \\ &g^2_j(x(t_f)) \leq 0\ \forall j\in I.& \label{defOptControlProblemEndIneq} \end{eqnarray} We also assume that the initial state $x(t_0)=x_0$ is fixed. Crucial assumption concerns the class of control functions. Our algorithm requires that control functions are piecewise smooth functions. The justification for that is given \cite{ps2020a} by referring to properties of Filippov's solutions. Thus the admissible control $u$ is a function $u$ from the set ${\mathcal U}$, where \begin{eqnarray} &{\displaystyle {\mathcal U} =\left \{ u\in {\mathcal C}^N_m[T]:\ u(t)\in U\subset \mathbb{R}^m,\ t\in [t_0,t_f] \right \} } \nonumber \\ &{\displaystyle {\mathcal C}_m^N[T] =\left \{ u\in {\mathcal L}^2_m[T]:\ u(t)=\sum_{j=1}^N\phi_j(t)u^N_j(t),\right . }\nonumber \\ &{\displaystyle \left . u_j^N\in \mathcal{C}_m^1[t_{j-1},t_j],\ j=1,\ldots,N,\ t\in[t_0,t_f] \right \}, } \nonumber \end{eqnarray} \begin{eqnarray} &{\displaystyle \phi_j(t) = \left \{ \begin{array}{ll} 1, & {\rm if}\ t\in[t_{j-1},t_j)\nonumber \\ 0, & {\rm if}\ t\not\in [t_{j-1},t_j)\nonumber \end{array} \right . ,\ t_j = jt_f/N,\ j\in \{0,1,\ldots,N\}.} \label{pwc2} \end{eqnarray} The method we propose for solving the problem ${\bf (P)}$ is based on an exact penalty function. By using an exact penalty function approach, instead of solving the problem ${\bf (P)}$ we solve the problem ${\bf P_{c}}$ \begin{eqnarray} &{\displaystyle \min_{u\in {\mathcal U} } \bar{F}_c(u)} \label{1e} \end{eqnarray} in which the exact penalty function $\bar{F}_c(u)$ is defined as follows \begin{eqnarray} &{\displaystyle \bar{F}_c(u) = \bar{F}(u) +c \max \left [0,\max_{i\in E} \left |\bar{g}^1_i(u)\right |,\max_{j\in I} \bar{g}^2_j(u)\right ]} \nonumber \\ \label{2e} \end{eqnarray} For fixed $c$ and $u$ the direction finding subproblem, ${\bf P_{c}(u)}$, for the problem ${\bf (P_c)}$ is: \begin{eqnarray} &{\displaystyle \min_{d\in {\mathcal D}_u,\beta\in \mathbb{R}}\left [\left \langle \nabla \bar{F}_0(u),d\right \rangle +c \beta + 1/2 \| d \|^2_{{\mathcal L}^2} \right ] } \nonumber \end{eqnarray} subject to \begin{eqnarray} \left | \bar{g}^1_i(u) + \left \langle \nabla \bar{g}^1_i(u),d\right \rangle\right | & \leq &\beta\ \ \forall i\in E \nonumber \\ \bar{g}^2_j (u) + \left \langle \nabla \bar{g}^2_j(u),d\right \rangle & \leq & \beta\ \ \forall j\in I. \nonumber \end{eqnarray} Here, \begin{eqnarray} &{\displaystyle {\mathcal D}_u \left \{ d\in {\mathcal C}^N_m[T]:\ d\in {\mathcal U}-u,\ \|d\|_{\mathcal L}^2 \rightarrow 0 \implies \|d'\|_{{\mathcal L}^2} \rightarrow 0\right \}.}\nonumber \end{eqnarray} The direction finding subproblem is based on first order approximations to the problem functionals, defined as follows \begin{eqnarray} \langle \nabla \bar{F}_0(u),d\rangle & = & \phi_x(x^u(t_f)) y^{x,d}(t_f) \label{Linapp1} \\ \langle \nabla \bar{g}_i^1(u),d\rangle & = & \left (g_i^1\right )_x(x^u(t_f)) y^{x,d}(t_f),\ i\in E \label{Linapp2} \\ \langle \nabla \bar{g}_j^2(u),d\rangle & = & \left (g_j^2\right )_x(x^u(t_f)) y^{x,d}(t_f),\ j\in I. \label{Linapp3} \end{eqnarray} The subproblem can be reformulated as an optimization problem with the objective function which is strictly convex. The problem therefore has the unique solution $(\bar{d},\bar{\beta})$. Since this solution depends on $c$ and $u$, we may define {\it descent function} $\sigma_{c}(u)$ and {\it penalty test function} $t_{c}(u)$ (see \cite{py99} for details), to be used to test optimality of a control $u$ and to adjust $c$, respectively, as \begin{eqnarray} &{\displaystyle \sigma_{c}(u) = \left \langle \nabla \bar{F}_0(u),\bar{d}\right \rangle + c\left [\bar{\beta}-M(u)\right ] }\label{sigmaf} \end{eqnarray} and \begin{eqnarray} &{\displaystyle t_{c}(u) = \sigma_{c}(u) + M(u)/c }\label{testf} \end{eqnarray} \label{tesfun2} for given $c> 0$ and $u\in {\mathcal U}$. Here, \begin{eqnarray} &{\displaystyle M(u) = \max\left [0,\max_{i\in E}\left |\bar{g}^1_i(u)\right |, \max_{j\in I}\bar{g}^2_j(u)\right ],}\nonumber \end{eqnarray} A general algorithm is as follows. \\[5mm] {\bf Algorithm} Fix parameters: $\gamma,\ \eta \in (0,1)$, $c^0 > 0$, $\kappa >1$. \begin{enumerate} \item Choose the initial control $u_{0}\in {\cal U}$. Set $k=0$, $c_{-1}=c^0$. \item Let $c_k$ be the smallest number chosen from $\{c_{k-1},\kappa c_{k-1}, \kappa^2 c_{k-1},\ldots \}$ such that the solution $(d_k,\beta_k)$ to the direction finding subproblem ${\bf P_{c_k}(u_k)}$ satisfies \begin{eqnarray} &{\displaystyle t_{c_k} (u_k) \leq 0. }\label{penadj} \end{eqnarray} If $\sigma_{c_k}(u_k) =0$ then STOP. \item Let $\alpha_k$ be the largest number chosen from the set $\{1,\eta,\eta^2,\ldots,\}$ such that \begin{eqnarray} &{\displaystyle u_{k+1} = u_k + \alpha_k d_k}\nonumber \end{eqnarray} satisfies the relation \begin{eqnarray} \bar{F}_{c_k}(u_{k+1}) - \bar{F}_{c_k}(u_k) & \leq & \gamma\alpha_k\sigma_{c_k} ( u_k).\nonumber \end{eqnarray} Increase k by one. Go to Step 2. \end{enumerate} Since \begin{eqnarray} &{\displaystyle \left \langle \nabla \bar{F}_0(u_k),d\right \rangle + c_k \beta + 1/2 \| d\|^2_{{\mathcal L}^2} \leq c_kM(u_k),}\nonumber \end{eqnarray} which holds because $0\in {\mathcal U}-u_k$, we also have \begin{eqnarray} &{\displaystyle \left \langle \nabla \bar{F}_0(u_k),d\right \rangle + c_k\left [\beta -M(u_k)\right ] \leq -1/2 \| d\|^2_{{\mathcal L}^2} \leq 0}\label{SigmaPos} \end{eqnarray} which implies that the descent function $\sigma_{c_k}(u_k)$ is nonpositive valued at each iteration. {\it Algorithm} generates a sequence of controls $\{ u_k\}$ and the corresponding sequence of penalty parameters $\{c_k\}$ such that $\{ c_k\}$ is bounded and any accumulation point of $\{ u_k\}$ satisfies optimality conditions in the form of the weak maximum principle for the problem ${\bf (P)}$, i.e. $\sigma_{\bar{c}}(\bar{u})=0$ for the limit point $\bar{u}$ and the limit point of the sequence $\{c_k\}$. But $\sigma_{\bar{c}}(\bar{u})=0$ implies that $M(\bar{u})=0$ due to the definition (\ref{testf}) and since (\ref{penadj}) holds. It can be shown that the set ${\mathcal U}$ is compact (since we assume that $U$ is compact) and this fact can be used to prove the convergence of {\it Algorithm} without referring to relaxed controls (cf. \cite{py99}). However, we still need to introduce two additional hypotheses. The first one concerns the functions defining the objective and constraints: \begin{description} \item[{\bf (H4)}] $\phi$, $g_i^1$, $i\in E$, $g_j^2$, $j\in I$ are continuously differentiable functions. \end{description} The second one is related to a constraint qualification which is needed to prove the convergence of {\it Algorithm}. To this end we first introduce the set \begin{eqnarray} &{\displaystyle {\mathcal D} = \left \{ d\in {\mathcal C}^N_m[T]:\ \|d\|_{{\mathcal L}^2} \rightarrow 0 \implies \|d'\|_{{\mathcal L}^2} \rightarrow 0,\ \exists u\in {\mathcal U}\ {\rm such\ that}\ u+d\in {\mathcal U}\right \} }\nonumber \end{eqnarray} and the set \begin{eqnarray} &{\displaystyle {\mathcal F}(u) = \left \{ d\in {\mathcal D}:\ \max_{j\in I} \left \langle \nabla \bar{g}_j^2(u),d\right \rangle < 0 \right \}. }\nonumber \end{eqnarray} Then the constraint qualification condition takes the form \begin{description} \item[{\bf (CQ)}] for each $u\in {\mathcal U}$, ${\mathcal F}(u)\neq \emptyset$, and in the case $E\neq \emptyset$ we have \begin{eqnarray} &{\displaystyle 0\in {\rm interior}{\mathcal E}(u)}\label{CQa} \end{eqnarray} where \begin{eqnarray} &{\displaystyle {\mathcal E}(u) = \left \{ \left \{ \langle \nabla \bar{g}^1_i,d\rangle\right \}_{i\in E}\in \mathbb{R}^{|E|}:\ d\in {\mathcal F}(u)\right \}.}\nonumber \end{eqnarray} \end{description} Under stated assumptions {\it Algorithm} is globally convergent in the following sense. \newtheorem{t1}{Theorem}[section] \begin{t1} \label{t1} Assume that data for {\rm {\bf (P)}} satisfies hypotheses ${\bf (H1)}$, ${\bf (H2)}$, ${\bf (H3)}$, ${\bf (H4)}$ and ${\bf (CQ)}$. Let $\{u_k\}$ be a sequence of controls generated by {\it Algorithm} and let $\{c_k\}$ be a sequence of the corresponding penalty parameters. Then \begin{enumerate} \item [i)] $\{c_k\}$ is a bounded sequence \item [ii)] \begin{eqnarray} &{\displaystyle \lim_{k\rightarrow\infty}\sigma_{c_k}(u_k)=0,\ \ \lim_{k\rightarrow\infty} M(u_k) = 0.}\label{t1ii} \end{eqnarray} \item [iii)] Let $\bar{u}$ be the limit point of the sequence $\{u_k\}$ and $\bar{x}$ the trajectory corresponding to $\bar{u}$, then the necessary optimality conditions hold: \begin{description} \item[{\rm {\bf (NC)}}]: \begin{eqnarray} &{\displaystyle 0 \leq \min_{d\in {\mathcal D}_{\bar{u}}} \phi_x (\bar{x}(t_f))y^{\bar{x},d}(t_f)} \label{NC1a} \end{eqnarray} subject to the constraints \begin{eqnarray} g_i^1(\bar{x}(t_f)) + \left (g_i^1\right )_x(\bar{x}(t_f)) y^{\bar{x},d}(t_f) & = & 0,\ i\in E \label{NC1b} \\ g_j^2(\bar{x}(t_f)) + \left (g_j^2\right )_x(\bar{x}(t_f)) y^{\bar{x},d}(t_f) & \leq & 0,\ j\in I_{0,\bar{u}} \label{NC1c} \end{eqnarray} together with $g_i^1 (\bar{x}(t_f)) = 0$, $i\in E$, $g_j^2 (\bar{x}(t_f))\leq 0$, $j\in I$. Here, \begin{eqnarray} &{\displaystyle I_{\varepsilon,u} = \left \{j\in I:\ \bar{g}_j^2(u)\geq \max_{j\in I} \bar{g}_j^2(u) - \varepsilon \right \}.}\nonumber \end{eqnarray} \end{description} \end{enumerate} \end{t1} The proof of {\it Theorem \ref{t1}} follows the lines of the proof of Theorem 5.1 stated in \cite{pv98}, however for the completeness of presentation it is provided in {\it Appendix \ref{AppendixT}}. The proof heavily uses the implications of the constraint qualification {\bf (CQ)} stated in the following lemma and on the properties of solutions to the system equations and solutions to their linearized equations $(x,z)$, $(y^{x,d},y^{z,d})$ expressed by (\ref{Lin1})--(\ref{Lin4}). The proof {\it Lemma \ref{l2}} is given in {\it Appendix \ref{AppendixL}}. \newtheorem{l2}{Lemma}[section] \begin{l2} \label{l2} Assume ${\bf (H1)}$, ${\bf (H2)}$, ${\bf (H3)}$, ${\bf (H4)}$ and ${\bf (CQ)}$. For any control $\tilde{u}\in{\mathcal U}$ there exist a neighborhood ${\mathcal O}(\tilde{u})$ of $\tilde{u}$, $K_1 > 0$ and $K_2 > 0$ with the following properties: given any $u\in {\mathcal U}$ such that $u\in{\mathcal O}(\tilde{u})$ there exists $v\in {\cal U}$ such that \begin{eqnarray} &{\displaystyle \max_{i\in E} \left | \bar{g}^1_i(u) + \left \langle \nabla \bar{g}^1_i(u), v- u\right \rangle \right | - \max_{i\in E} \left |\bar{g}^1_i (u) \right | \leq - K_1 M(u) } \label{l532}\\ &{\displaystyle \max_{j\in I} \left \langle \nabla \bar{g}^2_j(u),v-u \right \rangle \leq - K_1 M(u) } \label{l533} \\ &{\displaystyle {\rm and}\ \ \left \| v -u \right \|_{{\mathcal L}^\infty} \leq \ \ K_2 M(u).} \label{l535} \end{eqnarray} \end{l2} The role of {\bf (CQ)} is to ensure uniform boundedness of penalty parameter values. In particular, if {\bf (CQ)} is satisfied one can prove the following proposition which is needed in order to demonstrate the feasibilities of Steps 2--3 of {\it Algorithm}. \newtheorem{p1}{Proposition}[section] \begin{p1} \label{p1} \begin{enumerate} \item [(i)] Assume that hypotheses ${\bf (H1)}$, ${\bf (H2)}$, ${\bf (H3)}$, ${\bf (H4)}$ and ${\bf (CQ)}$ are satisfied. Then for any $u\in {\cal U}$ there exists $\bar{c} >0$ such that for all $c > \bar{c}$ \begin{eqnarray} &{\displaystyle t_{c} (u ) \leq 0.}\nonumber \end{eqnarray} \item [(ii)] Assume that hypotheses ${\bf (H1)}$, ${\bf (H2)}$, ${\bf (H3)}$ and ${\bf (H4)}$ are satisfied. Then for any $u\in {\cal U}$ and $c >0$ such that $\sigma_c (u) < 0$ there exists $\bar{\alpha} > 0$ such that if $\alpha\in [0,\bar{\alpha})$ then \begin{eqnarray} \tilde{F}_c (\tilde{u}) - \tilde{F}_c (u) & \leq & \gamma \alpha \sigma_c (u)\nonumber \end{eqnarray} where $\tilde{u} = u +\alpha d$, $(d, \beta)$ is the solution to the direction finding subproblem corresponding to $c$ and $u$ and $\sigma_c(u)$ is defined by (\ref{sigmaf}). \end{enumerate} \end{p1} The proofs of {\it Lemma \ref{l2}} closely follows the lines of the proof of Lemma 6.1 stated in \cite{pv98}, so it is omitted here. The proof of {\it Proposition \ref{p1}} is given in {\it Appendix \ref{AppendixP}}. \section{Conclusions} \label{SecConclusions} The paper presents the computational approach to hybrid optimal control problems with sliding modes. It seems to be the first method for optimal control problems with hybrid systems which can exhibit sliding modes. We show that under the assumption that controls are represented by piecewise constant functions the presented method is globally convergent in the sense that every accumulation point of a sequence generated by the method satisfies necessary optimality conditions in the form of the weak maximum principle. In the accompanying papers (\cite{ps19a},\cite{ps19b}) we present the implementable version of our computational method by relaxing the condition that continuous state trajectories are available. In these papers we assume that system equations are integrated by an implicit Runge--Kutta method and we show that the global convergence of the implementable version of our algorithm is preserved provided that the integration procedure step sizes converge to zero. The algorithms presented in the paper are first order methods since they are based on linearizations of functions defining our optimal control problem. We can provide second order versions of these algorithms by applying an SQP approach in which second order terms in the functions expansions are placed in a quadratic term of the objective function of ${\bf P_c(u)}$---then instead of using the term $1/2\|d\|_{{\mathcal L}^2}$ we use $1/2 d^THd$. $H$ represents the approximation to the Hessian of the Lagrange function of the problem. Of course the second order approach can be applied if the optimal control problem can be stated as the problem in the Euclidean space, for example when control functions are piecewise constant functions (\cite{py99}). The convergence analysis presented in this paper can be used to prove global convergence of the second order method provided that matrices $H$ used at iterations are uniformly positive definite and bounded. \section{Introduction} Hybrid systems are systems with mixed discrete-continuous dynamics (\cite{ss2000},\cite{bbm1999}). The set of discrete states $ \mathcal{Q} $ consist of finite number of elements denoted by $ q $. The admissible controls set $ \mathcal{U} $ consists of measurable functions $ u:I \rightarrow U $ defined on a closed interval $ I $ with the values in $ U \in \mathbb{R}^m $. The continuous dynamics in each discrete state is described by ordinary differential equations (ODEs) \begin{eqnarray} {\displaystyle x' = f(x,u)}\label{explicit} \end{eqnarray} or more generally by differential-algebraic equation (DAEs) \begin{eqnarray} &{\displaystyle 0 = F(x',x,u),}\label{implicit} \end{eqnarray} where $ x \in \mathbb{R}^n $, $ f: \mathbb{R}^n \times U \rightarrow \mathbb{R}^n $, $ F: \mathbb{R}^n \times \mathbb{R}^n \times U \rightarrow \mathbb{R}^n $. The transitions between discrete states are triggered when the condition of the form \begin{equation} \eta(x,u) \leq 0 \end{equation} stops to be satisfied, where $ \eta: \mathbb{R}^n \times U \rightarrow \mathbb{R} $. The functions $ \eta(x,u) $ are called {\it guards}. We restrict our analysis to systems with autonomous transitions and without state jumps during transitions. The optimal control problem with a hybrid system has been considered in many papers. The necessary optimality conditions for a class of hybrid systems without state jumps have been first formulated in \cite{w1966}. In \cite{bh1975} the variational methods have been used to formulate adjoint equations for systems with state jumps. The Pontryagin maximum principle for hybrid systems with state jumps has been formulated for several classes of hybrid systems in \cite{s1999}, \cite{s2004}, \cite{sc2007}, \cite{sc2009}, \cite{tc2010}, \cite{tc2011}, \cite{tc2013}, \cite{pc2013}. In papers \cite{s2004}, \cite{sc2007}, \cite{sc2009}, \cite{tc2010}, \cite{tc2013} also algorithms based on the hybrid maximum principle are discussed. Our paper does not consider optimal control problems in which switching times are decision variables (\cite{scgb06}). In \cite{ps17} we have introduced an algorithm for optimal control problems with hybrid systems described by higher index DAEs. In the paper we have assumed that we deal with discrete time differential--algebraic equations resulting from the system equations discretization by an implicit Runge--Kutta method. In none of these papers an optimal control problem with hybrid systems exhibiting sliding modes has been considered. This paper fills that gap by considering hybrid systems whose motion can be on the switching manifold (transition guard). For these optimal control problems we formulate a weak version of the maximum principle provided that controls are represented by piecewise smooth controls. Furthermore, we propose an algorithm which generates a sequence of approximating optimal controls which converges to a control which satisfies optimality conditions stated by the weak maximum principle. The convergence is established under the assumption that continuous time system equations are given. In the accompanying papers (\cite{ps19a},\cite{ps19b}) we show that the algorithm convergence can still be attained if state trajectories are obtained by an implicit Runge--Kutta method provided that the integration procedure step sizes go to zero. The main focus of the paper is on the problems with hybrid systems which can exhibit sliding motion. For these problems we propose algorithms which have global convergence properties. One algorithm is a first order method which is stated for problems with piecewise smooth controls. We also discuss the method which is intended for control problems with hybrid systems whose trajectories do not experience sliding motion. In the case of these optimal control problems we assume that control functions are elements of the space ${\mathcal L}^\infty$. Our convergence results are based on the trajectory sensitivity analysis of hybrid systems presented in the paper \cite{ps2020a}. The computational approach to hybrid systems we advocate in this paper (and in \cite{ps17}, \cite{ps19a}, \cite{ps19b}) assumes that for a given control function we attempt to follow true systems trajectories as close as possible by using integration procedures with a high order of convergence. It is in contrast to the approach which uses approximations to the discontinuous right-hand side for the differential equations or inclusions by a smooth right--hand side (\cite{sa2010}, \cite{sa2012}, \cite{mhrl2015}). The smoothing approach demonstrates that it can be used to find approximate solutions to optimal control problems with systems which exhibit sliding modes however there is still a lack of evidence that it is capable of efficiently finding optimal controls and state trajectories with high accuracy by choosing proper values of smoothing parameters. \section{Hybrid systems without sliding motion} \label{secwSM} The process of finding optimal solutions to control problems with hybrid systems significantly simplifies when trajectories generated during the process do contain sections with sliding modes. In this case we assume that our state trajectory on the entire horizon $[t_0,t_f]$ will consist of trajectories of type of type $x$ only, i.e. we have \begin{eqnarray} &{\displaystyle [t_0,t_f] = \cup_{i\in I_1}A^1_i\cup_{i\in I_2}A^2_i. } \nonumber \end{eqnarray} For the simplicity of presentation consider the case when the system on time subinterval $[t_0,t_t)$ evolves according to equations \begin{eqnarray} &{\displaystyle x' = f_1(x,u),}\label{wSM1} \end{eqnarray} and then, on the subinterval $[t_t,t_f]$, according to \begin{eqnarray} &{\displaystyle x' = f_2(x,u),}\label{wSM2} \end{eqnarray} Due to our previous remarks we do not have to restrict the class of admissible control functions to piecewise smooth functions, and we can can take as ${\mathcal U}$ the set \begin{eqnarray} &{\displaystyle {\mathcal U} = \left \{ u\in {\mathcal L}_m^2[T]:\ u(t) \in U,\ {\rm a.e.\ on}\ T\right \},} \label{wSM3} \end{eqnarray} For this set of admissible controls, and due to our assumption that sliding mode does not occur, the relations (\ref{Lin1})--(\ref{Lin4}) hold for $x$, $x^d$ and $y^{x,d}$ on the subintervals $[t_0,t_t]$ and $[t_t,t_f]$. The adjoint equations for the equations (\ref{wSM1})--(\ref{wSM2}) can be derived in a way described in Section \ref{secAdjoint}. To this end we define the functional \begin{eqnarray} &{\displaystyle \Phi(x,z,u,\lambda,\pi) = \phi(x(t_f)) + \pi h(x(t_t)) +}\nonumber \\ &{\displaystyle \int_{t_0}^{t_t^-} \lambda_f^T(t) \left( x'(t) - f_1(x(t),u(t)) \right) dt + \int_{t_t^+}^{t_f}\lambda_f^T(t) \left( x'(t) - f_2(x(t),u(t)) \right) dt,} \nonumber \end{eqnarray} and after applying arguments as in Section \ref{secAdjoint}, we arrive at the equations for adjoint variable $\lambda_f$: \begin{equation} (\lambda_f^T)'(t) = - \lambda_f^T(t) (f_1)_x(x(t),u(t)),\ t\in[t_0,t_t] \label{eqAdjf1} \end{equation} and \begin{eqnarray} &{\displaystyle (\lambda_f^T)'(t) = \lambda_f^T(t) (f_2)_x(x(t),u(t)),\ t\in (t_t,t_f].} \label{eqAdjf2} \end{eqnarray} The transversality condition for the equations (\ref{eqAdjf1})--(\ref{eqAdjf2}) is \begin{eqnarray} &{\displaystyle \phi_x^T(x(t_f)) + \lambda_f(t_f) = 0} \label{eqAdjterminal} \end{eqnarray} and the jump conditions at the switching time $t_t$ are \begin{eqnarray} \lambda_f(t_t^-) & = & \lambda_f(t_t^+) - \pi h_x^T(x(t_t)) \nonumber \\ \lambda_f^T(t_t^-) f_1(x(t_t^-),u(t_t^-)) & = & \lambda_f^T(t_t^+) f_2(x(t_t^+),u(t_t^+)). \label{eqAdjswitching} \end{eqnarray} Then the first variation of the cost function $ \phi(t_f) $ with respect to a control function variation $ d $ is follows \begin{eqnarray} &{\displaystyle d\phi(x(t_f)) = d\Phi(x,z,u,\lambda,\pi) = }\nonumber\\ &{\displaystyle -\int_{t_0}^{t_t^-} \lambda_f^T(t) (f_1)_u(x(t),u(t))d(t) dt - \int_{t_t^+}^{t_f} \lambda_f^T(t) (f_2)_u(x(t),u(t))d(t) dt. }\nonumber \end{eqnarray} Having adjoint equations for the simplest possible case of control problems which hybrid systems do not exhibit sliding modes we can formulate necessary optimality conditions for the case---${\bf (NC^{12})}$. \vspace{3mm} \noindent ${\bf (NC^{12})}$: There exist: nonnegative numbers $\alpha_j^2$, $j\in I$, numbers $\alpha_i^1$, $i\in E$ such that $\sum_{i\in E}\left | \alpha_i^1\right | +\sum_{j\in I} \alpha_j^2 \neq 0$; number $\pi$; absolutely continuous function $\lambda_f$, such that the following hold:\\ {\it (i) terminal conditions} \begin{eqnarray} \lambda_f(t_f) & = & -\phi_x^T(\bar{x}(t_f)) \nonumber \end{eqnarray} {\it (ii) adjoint equations}\\ for $ t\in (t_t,t_f) $ \begin{eqnarray} \lambda_f' &=& - \left( f_2 \right)_x^T(\bar{x},\bar{u})\lambda_f\nonumber \end{eqnarray} \noindent for $ t\in [t_0,t_t] $ \begin{eqnarray} \lambda_f' = - \left( f_1 \right)_x^T(\bar{x},\bar{u})\lambda_f; \nonumber \end{eqnarray} {\it (iii) jump conditions ($\lambda_f(t_t^-)$ and $\pi$ are the solutions to the algebraic equations stated below) } \begin{eqnarray} \lambda_f(t_t^-) & = &\lambda_f(t_t^+) - \pi h_x^T(\bar{x}(t_t^-)) \nonumber \\ \lambda_f^T(t_t^-) f_1(\bar{x}(t_t^-),\bar{u}(t_t^-)) & = & \lambda_f^T(t_t^+) 2_F(\bar{x}(t_t^+),\bar{u}(t_t^+)) \nonumber \end{eqnarray} {\it (iv) the weak maximum principle}\\ \noindent for $ t\in (t_t,t_f) $ \begin{eqnarray} \lambda_f^T(t) \left (f_2\right )_u (\bar{x}(t),\bar{u}(t))u \leq \lambda_f^T(t) \left (f_2\right )_u (\bar{x}(t),\bar{u}(t))\bar{u}(t)\nonumber \end{eqnarray} \noindent for $ t\in [t_0,t_t] $ \begin{eqnarray} \lambda_f^T(t) \left (f_1\right )_u (\bar{x}(t),\bar{u}(t))u \leq \lambda_f^T(t) \left (f_1\right )_u (\bar{x}(t),\bar{u}(t))\bar{u}(t)\nonumber \end{eqnarray} for all $u\in U$;\\ {\it (v) complementarity conditions} \begin{eqnarray} \alpha_j^2 = 0,\ \ {\rm if}\ \ j\not\in I_{0,\bar{u}}. \nonumber \end{eqnarray} Since we elaborate on the case of optimal control problems with hybrid systems which do not involve sliding modes we have to introduce the assumption which excludes the possibility of system going into the sliding mode. The assumption concerns switching points $t_t$ and is postulated instead of ${\bf (H2)}$. \begin{description} \item[${\bf (H2')}$]Function $h(\cdot)$ is differentiable and there exist $0<L_1<+\infty$ and $0<L_2 <+\infty$ such that \begin{eqnarray} &{\displaystyle \left \| h_{x}(\hat{x}) - h_{x}(x)\right \| \leq L_1\|\hat{x} - x \|,} \label{H3a12} \\ &{\displaystyle \left | h_x(\hat{x})f_{i}(\hat{x},\hat{u}) - h_x(x)f_{i}(x,u)\right | \leq L_2\|(\hat{x},\hat{u}) - (x,u) \|,} \label{H3b12} \end{eqnarray} for all $(x,u)$, $(\hat{x},\hat{u})$ in $\mathbb{R}^n \times U$. For any $u\in {\mathcal U}$ and any switching point $t_t$ the following limits exist \begin{eqnarray} &{\displaystyle \lim_{t\rightarrow t_t, t< t_t} u(t),\ \lim_{t\rightarrow t_t, t> t_t} u(t)} \end{eqnarray} (and are denoted by $u(t_t^-)$ and $u(t_t^+)$ respectively). There exists $\varepsilon > 0$ and $0<L_3 <+\infty$ such that for all switching points $t_t$ (each switching time corresponds to some $u\in {\mathcal U}$) and for all their perturbations $t_t^d$ triggered by perturbations $d$ such that $u+d\in {\mathcal U}$, $\|d\|_{{\mathcal L}^2}\leq \varepsilon$, and for all $\theta\in [0,1]$ we have \begin{eqnarray} &{\displaystyle h_x(x(\tau^{\theta ,d}(t_t)) ) f_{i}(x(\tau^{\theta ,d}(t_t)),u(\tau^{\theta ,d}(t_t) ))\geq L_3,} \label{H3c12} \end{eqnarray} or \begin{eqnarray} &{\displaystyle h_x(x(\tau^{\theta ,d}(t_t)) ) f_{i}(x(\tau^{\theta ,d}(t_t)),u(\tau^{\theta ,d}(t_t) )) \leq -L_3,} \label{H3cc12} \end{eqnarray} for $i=1,2$, where \begin{eqnarray} \tau^{\theta ,d}(t_t) & = & t_t + \theta (t^d_t - t_t). \label{Midt12} \end{eqnarray} \end{description} The hypothesis {\bf (H2')} which replaces {\bf (H2)} does not request the condition (\ref{Dprime}) for perturbations $d$. This is the consequence of having the switching function $\eta=h$ which does not depend on controls. That simplification spreads through the definitions which concern perturbations $d$, for example, the definitions of ${\mathcal D}_u$ and ${\mathcal D}$, which should be updated in order to work with the broader sets of perturbations, do not contain the requirement (\ref{Dprime}). {\it Theorem \ref{Th4}} can be proved along the lines of the proof of {\it Theorem \ref{t1}}, {\it Theorem \ref{Th3}} and with sets ${\mathcal D}_u$, ${\mathcal D}$ modified in this way. \newtheorem{Th4}{Theorem}[section] \begin{Th4} \label{Th4} Assume that data for {\rm {\bf (P)}} satisfies hypotheses ${\bf (H1)}$, ${\bf (H2')}$, ${\bf (H3)}$, ${\bf (H4)}$ and ${\bf (CQ)}$. Let $\{u_k\}$ be a sequence of controls generated by {\it Algorithm} and let $\{c_k\}$ be a sequence of the corresponding penalty parameters. Then \begin{enumerate} \item [i)] $\{c_k\}$ is a bounded sequence \item [ii)] \begin{eqnarray} &{\displaystyle \lim_{k\rightarrow\infty} M(u_k) = 0.}\nonumber \end{eqnarray} \item [iii)] if $\bar{u}$ is the limit point of $\{u_k\}$, $\bar{x}$ its state corresponding trajectory and suppose that for $\bar{u}$ the case of this section applies, then the pair $(\bar{x},\bar{u})$ satisfies the necessary optimality conditions ${\bf (NC^{12})}$. \end{enumerate} \end{Th4}
\section{Introduction} Fast radio bursts (FRBs) propagate from as far as $\sim$Gpc distances through their local environments, the interstellar medium (ISM) and circumgalactic medium (CGM) of their host galaxy, the intergalactic medium (IGM) and any intervening galaxies or galaxy haloes, the halo and ISM of the Milky Way, and finally through the interplanetary medium (IPM) of our Solar System before arriving at the detector. Along their journey they experience dispersion and multi-path propagation from free electrons along the line-of-sight (LoS). The dispersion measure ${\rm DM} = \int n_e dl/(1+z)$, where $n_e$ is the electron density and $z$ is the redshift. Most FRBs are extragalactic and have DMs much larger than the expected contribution from our Galaxy, with the single possible exception being the Galactic magnetar source SGR 1935$+$2154 \citep{2020arXiv200510828B, 2020arXiv200510324T}. Many studies of FRB propagation have focused on the ``DM budget," constraining the relative contributions of intervening media to the total observed FRB DM, with particular attention paid to determining the DM contribution of the IGM, which in principle can be used to estimate the distance to an FRB without a redshift \citep[e.g.,][]{2015MNRAS.451.4277D,2019ApJ...886..135P}. For FRBs with redshifts the subsequent intergalactic ${\rm DM}(z)$ relationship can be used to measure the cosmic baryon density, as was first empirically demonstrated by \cite{2020Natur.581..391M}. Arguably the least constrained DM contribution to FRBs is that of their host galaxies, which has been estimated in only one case using Balmer line observations \citep[][]{2017ApJ...834L...7T}. \indent Understanding FRB propagation requires study of not just dispersion but also scattering. Bursts propagate along multiple ray paths due to electron density fluctuations, which leads to detectable chromatic effects like pulse broadening, scintillation, and angular broadening. These effects are respectively characterized by a temporal delay $\tau$, frequency bandwidth $\Delta \nu_{\rm d}$, and full width at half maximum (FWHM) of the scattered image $\theta_{\rm d}$. Scattering effects generally reduce FRB detectability, obscure burst substructure, or produce multiple images of the burst, and may contaminate emission signatures imprinted on the signal at the source \citep[e.g.,][]{2017ApJ...842...35C, 2019ApJ...876L..23H, 2020MNRAS.497.3335D}. On the other hand, scattering effects can also be used to resolve the emission region of the source \citep{2020ApJ...899L..21S} and to constrain properties of the source's local environment \citep[for a review of FRB scattering see][]{2019A&ARv..27....4P, 2019ARA&A..57..417C}. Since the relationship between $\tau$ and DM is known for Galactic pulsars \citep[e.g.,][]{1997MNRAS.290..260R, 2004ApJ...605..759B,2015ApJ...804...23K,2016arXiv160505890C}, it is a promising basis for estimating the DM contributions of FRB host galaxies based on measurements of $\tau$ (Cordes et al., in prep). In order to use scattering measurements for these applications, we need to assess how intervening media contribute to the observed scattering (i.e., a ``scattering budget"). To disentangle any scattering effects intrinsic to the host galaxy or intervening galaxies, we need to accurately constrain the scattering contribution of the Milky Way. \indent Broadly speaking, an FRB will encounter ionized gas in two main structural components of the Milky Way, the Galactic disk and the halo. The Galactic disk consists of both a thin disk, which has a scale height of about 100 pc and contains the spiral arms and most of the Galaxy's star formation \citep[e.g.,][]{2002astro.ph..7156C}, and the thick disk, which has a scale height of about 1.6 kpc and is dominated by the more diffuse, warm ($T\sim10^4$ K) ionized medium \citep[e.g.,][]{2020ApJ...897..124O}. The halo gas is \added{thought to be} dominated by the hot ($T\sim 10^6$ K) ionized medium, and most of this hot gas is contained within 300 kpc of the Galactic center \added{\citep[e.g.,][]{2017ApJ...835...52F}}. While the DMs and scattering measurements of Galactic pulsars and pulsars in the Magellanic Clouds predominantly trace plasma in the thin and thick disks, extragalactic sources like FRBs are also sensitive to gas in the halo. \indent In this paper we assess the contribution of galaxy haloes to the scattering of FRBs. We demonstrate how scattering measurements of FRBs can be interpreted in terms of the internal properties of the scattering media, and apply this formalism to galaxy haloes intervening LoS to FRBs. We first assess scattering from the Milky Way halo using two case studies: FRB 121102 and FRB 180916. \deleted{These FRBs are seen towards the Galactic anti-center and have highly precise localizations and host galaxy associations, in addition to precise scattering measurements.} \added{These FRBs have the most comprehensive, precise scattering measurements currently available, in addition to highly precise localizations and host galaxy associations}. Due to their location close to the Galactic plane, the emission from these sources samples both the outer spiral arm of the Galaxy and the Galactic thick disk, and the scattering observed for these FRBs is broadly consistent with the scattering expected from the spiral arm and disk. Only a minimal amount of scattering is allowed from the Galactic halo along these LoS, thus providing an upper limit on the halo's scattering contribution. We then extrapolate this analysis to two FRBs that pass through haloes other than those of their host galaxies and the Milky Way, FRB 181112 and FRB 191108. \indent In Section~\ref{sec:theory} we summarize the formalism relating electron density fluctuations and the observables $\tau$, DM, $\Delta \nu_{\rm d}$, and $\theta_{\rm d}$, and describe our model for the scattering contribution of the Galactic halo. A new measurement of the fluctuation parameter of the Galactic thick disk is made in Section~\ref{sec:disk} using Galactic pulsars. An overview of the scattering measurements for FRB 121102 and FRB 180916 is given in Section~\ref{sec:frbs}, including an updated constraint on the scintillation bandwidth for FRB 121102 and a comparison of the scattering predictions made by Galactic electron density models NE2001 \citep{2002astro.ph..7156C, 2003astro.ph..1598C} and YMW16 \citep{2017ApJ...835...29Y}. The FRB scattering constraints are used to place an upper limit on the fluctuation parameter of the Galactic halo in Section~\ref{sec:halo}. A brief comparison of the FRB-derived limit with scattering observed towards the Magellanic Clouds is given in Section~\ref{sec:MCs} and scattering constraints for intervening galaxy haloes are discussed in Section~\ref{sec:conc}. \section{Modeling}\label{sec:theory} \subsection{Electron Density Fluctuations and Scattering} \indent We characterize the relationship between electron density fluctuations and scattering of radio emission using an ionized cloudlet model in which clumps of gas in the medium have a volume filling factor $f$, internal density fluctuations with variance $\epsilon^2 = \langle (\delta n_e)^2 \rangle/{n_e}^2$, and cloud-to-cloud variations described by $\zeta = \langle {n_e}^2 \rangle/\langle {n_e} \rangle^2$, where $n_e$ is the local, volume-averaged mean electron density \citep[][]{1991Natur.354..121C, 2002astro.ph..7156C, 2003astro.ph..1598C}. We assume that internal fluctuations follow a power-law wavenumber spectrum of the form \citep[][]{cfrc87} $P_{\delta n_e}(q) = {\rm C_n^2} q^{-\beta} \exp(-(ql_{\rm i} / 2\pi)^2)$ that extends over a wavenumber range $2\pi / l_{\rm o} \le q \lesssim 2\pi / l_{\rm i}$ defined by the outer and inner scales, $l_{\rm o}, l_{\rm i}$, respectively. We adopt a wavenumber index $\beta = 11/3$ that corresponds to a Kolmogorov spectrum. Typically, $l_{\rm i} \ll l_{\rm o}$, but their magnitudes depend on the physical mechanisms driving and dissipating turbulence, which vary between different regions of the ISM. \indent Multipath propagation broadens pulses by a characteristic time $\tau$ that we relate to DM and other quantities. For a medium with homogeneous properties, the scattering time in Euclidean space is $\tau({\rm DM}, \nu) = K_\tau A_\tau \nu^{-4} \widetilde{F} G_{\rm scatt} {\rm DM}^2$ \citep[][]{2016arXiv160505890C}. The coefficient $K_\tau = \Gamma(7/6) c^3 r_{\rm e}^2 / 4$, where $c$ is the speed of light and $r_{\rm e}$ is the classic electron radius, while the factor $A_\tau \lesssim 1$ scales the mean delay to the $1/e$ delay that is typically estimated from pulse shapes. Because $A_\tau$ is medium dependent, we include it in relevant expressions symbolically rather than adopting a specific value. The scattering efficacy is determined by the fluctuation parameter $\widetilde{F} = \zeta\epsilon^2 / f (l_{\rm o}^2l_{\rm i})^{1/3}$ combined with a dimensionless geometric factor, $G_{\rm scatt}$, discussed below. \indent Evaluation with DM in pc cm$^{-3}$, the observation frequency $\nu$ in GHz, the outer scale in pc units, and the inner scale in km, $\widetilde{F}$ has units pc$^{-2/3}$ km$^{-1/3}$\ and \begin{eqnarray} \label{eq:taudmnu} \tau({\rm DM},\nu) \approx 48.03~{\rm ns} \,A_\tau \nu^{-4} \widetilde{F} G_{\rm scatt} {\rm DM}^2 . \end{eqnarray} For reference, the NE2001 model uses a similar parameter, $F = \widetilde{F} l_i^{1/3}$ \citep[Eq. 11-13][]{2002astro.ph..7156C}, that relates the scattering measure SM to {\rm DM}\ and varies substantially between different model components (thin and thick disks, spiral arms, clumps). \indent The geometric factor $G_{\rm scatt}$ in Eq.~\ref{eq:taudmnu} depends on the location of the FRB source relative to the dominant scattering medium and is calculated using the standard Euclidean weighting $(s/d)(1-s/d)$ in the integral of ${\rm C_n^2}(s)$ along the LoS. If both the observer and source are embedded in a medium with homogeneous scattering strength, $G_{\rm scatt} = 1/3$, while $G_{\rm scatt} = 1$ if the source to observer distance $d$ is much larger than the medium's thickness and either the source or the observer is embedded in the medium. \indent For a thin scattering layer with thickness $L$ at distance $\delta d \gg L$ from the source or observer, $G_{\rm scatt} \simeq 2\delta d / L \gg 1$ because of the strong leverage effect. For thin-layer scattering of cosmological sources by, e.g., a galaxy disk or halo, $G_{\rm scatt} = 2d_{\rm sl} d_{\rm lo}/Ld_{\rm so}$ where $d_{\rm sl}, d_{\rm lo}$ and $d_{\rm so}$ are angular diameter distances for source to scattering layer, scattering layer to observer, and source to observer, respectively. The scattering time is also multiplied by a redshift factor $(1+ z_{\ell})^{-3}$ that takes into account time dilation and the higher frequency at which scattering occurs in the layer at redshift $z_{\ell}$, with ${\rm DM}_{\ell}$ representing the lens frame value. We thus have for distances in Gpc and $L$ in Mpc, \begin{eqnarray} \label{eq:taudmnuz} \tau({\rm DM},\nu, z) \approx 48.03~{\rm \mu s} \times \frac{A_\tau \widetilde{F}\, {\rm DM}_{\ell}^2 }{(1 + z_{\ell})^3 \nu^4} \left[\frac{2d_{\rm sl}d_{\rm lo}}{ Ld_{\rm so}} \right] . \end{eqnarray} If the layer's DM could be measured, it would be smaller by a factor $(1+z_{\ell})^{-1}$ in the observer's frame. The pulse broadening time is related to the scintillation bandwidth $\Delta \nu_{\rm d}$ through the uncertainty principle $2\pi \tau \Delta \nu_{\rm d} = C_1$, where $C_1 = 1$ for a homogeneous medium and $C_1=1.16$ for a Kolmogorov medium \citep{1998ApJ...507..846C}. Multipath propagation is also manifested as angular broadening, $\theta_{\rm d}$, defined as the FWHM of the scattered image of a point source. The angular and pulse broadening induced by a thin screen are related to the distance between the observer and screen, which will be discussed further in Section~\ref{sec:121102}. \indent Measurements of $\tau$, $\Delta \nu_{\rm d}$, and $\theta_{\rm d}$ can include both extragalactic and Galactic components. We use the notation $\tau_{\rm MW, d}$, $\tau_{\rm MW, h}$, and $\tau_{\rm i,h}$ to refer to scattering contributed by the Galactic disk (excluding the halo), the Galactic halo, and intervening haloes, respectively, and an equivalent notation for DM. To convert between $\Delta \nu_{\rm d}$ and $\tau$ we adopt $C_1 = 1$. Wherever we use the notation $\tau$ and $\theta_{\rm d}$ we refer to the $1/e$ delay and FWHM of the autcorrelation function that are typically measured. \subsection{Electron Density Model for the Galactic Halo}\label{sec:halomodels} Models of the Milky Way halo based on X-ray emission and oxygen absorption lines depict a dark matter halo permeated by hot ($T\sim 10^6$ K) gas with a virial radius between 200 and 300 kpc \citep[e.g.,][]{2019MNRAS.485..648P, 2020ApJ...888..105Y, 2020MNRAS.496L.106K}. Based on these models, the average DM contribution of the hot gas halo to FRBs is about 50 pc cm$^{-3}$, which implies a mean electron density $n_e \sim 10^{-4}$ cm$^{-3}$. However, the DM contribution of the Milky Way halo is still not very well constrained. \cite{2020MNRAS.496L.106K} compare the range of $\DM_{\rm MW,h}$ predicted by various halo models with the XMM-Newton soft X-ray background \citep{2013ApJ...773...92H} and find that the range of $\DM_{\rm MW,h}$ consistent with the XMM-Newton background spans over an order of magnitude and could be as small as about 10 pc cm$^{-3}$. Using a sample of DMs from 83 FRBs and 371 pulsars, \cite{2020ApJ...895L..49P} place a conservative upper limit on $\widehat{\DM}_{\rm MW, h}<123$ pc cm$^{-3}$, with an average value of $\widehat{\DM}_{\rm MW, h} \approx 60$ pc cm$^{-3}$. \indent Most models of the hot gas halo adopt a spherical density profile, but \cite{2020ApJ...888..105Y} and \cite{2020NatAs.tmp..214K} argue that a disk component with a scale height of about 2 kpc and a radial scale length of about 5 kpc should be added to the spherical halo based on the directional dependence of emission measure found in Suzaku and HaloSat X-ray observations \citep{2018ApJ...862...34N, 2020NatAs.tmp..214K}. In such a combined disk-spherical halo model, the disk would account for most of the observed X-ray emission attributed to the halo, while the diffuse, extended, spherical halo contains most of the baryonic mass. \cite{2020NatAs.tmp..214K} also suggest that significant, patchy variations may exist in the halo gas on scales $\sim400$ pc. The physical scales of the disk models fit to these recent X-ray observations are similar to the spatial scale of the warm ionized medium in the Galactic disk, and several orders of magnitude smaller than the spatial scales ($\sim 100$s of kpc) typical of spherical halo models. Whether such a disk component should really be attributed to the circumgalactic medium and not to the ISM of the Galactic disk is unclear. \indent \deleted{We adopt a fiducial model for the halo's density profile based on} \added{We use} the \citeauthor{2019MNRAS.485..648P} (PZ19) modified Navarro-Frenk-White (mNFW) profile \added{to model the halo density}. The mNFW profile adjusts the NFW profile's matter density cusp at the Galactic center with a more physical roll-off, giving a matter density of \begin{equation} \rho(y) = \frac{\rho_0}{y^{1-\alpha}(y_0 + y)^{2+\alpha}}, \end{equation} \deleted{where $y = K_c(r/r_{200})$} \added{where $y = K_c\times(r/r_{200})$}, $r$ is radial distance from the Galactic center, and $r_{200}$ is the virial radius within which the average density is 200 times the cosmological critical density. The characteristic matter density $\rho_0$ is found by dividing the total mass of the halo by the volume within the virial radius. The concentration parameter $K_c$ depends on the galaxy mass; e.g., $K_c = 7.7$ for a total Milky Way halo mass $M = 1.5 \times 10^{12} M_\odot$, and can range from $K_c = 13$ for $M = 10^{10} M_\odot$ to $K_c = 5$ for $M = 10^{14} M_\odot$ for redshifts $z<0.1$ \citep{1997ApJ...490..493N}. Like PZ19, we assume that $75\%$ of the baryonic matter in a galaxy is in the halo ($f_{\rm b} = 0.75$), and the fraction of the total matter density that is baryonic is $\Omega_{\rm b}/\Omega_{\rm m} $, the ratio of the baryonic matter density to the total matter density ($\Omega_{\rm b}/\Omega_{\rm m} = 0.16$ today). If $f_{\rm b}$ is smaller, then the electron density and the predicted scattering from a halo will be smaller. \indent The electron density profile of the halo is \deleted{$n_e(r) = f_{\rm b}(\Omega_{\rm b}/\Omega_{\rm m})\rho(r)\frac{\mu_{\rm e}}{m_{\rm p} \mu_{\rm H}}U(r)$} \added{\begin{equation}\label{eq:neh} n_e(r) \approx 0.86f_{\rm b}\times(\Omega_{\rm b}/\Omega_{\rm m})\frac{\rho(r)}{m_{\rm p}}U(r),\end{equation}} \deleted{where $\mu_{\rm e} = 1.12$ for fully ionized hydrogen and helium, $\mu_{\rm H} = 1.3$, and $m_{\rm p}$ is the proton mass. The function $U(r) = (1/2)\{1-{\rm tanh}[(r-r_c)/w]\}$ imposes a physical roll-off at a characteristic radius $r_c$ with a width set by $w$. Previous studies often implicitly assumed a physical boundary at the virial radius when integrating $n_e$ to obtain $\DM_{\rm MW,h}$, despite the fact that $\rho(r)$ extends well beyond the virial radius. Nonetheless, most of the halo gas likely lies within a few times the virial radius, so we set $r_c = 2r_{200} \approx 480$ kpc and $w = 20$ kpc. A comparison of our halo density profile with the PZ19 model, evaluated for the Milky Way, is shown in Figure~\ref{fig:halomod}.} \added{where $m_p$ is the proton mass and we have assumed a gas of fully ionized hydrogen and helium. The function $U(r) = (1/2)\{1-{\rm tanh}[(r-r_c)/w]\}$ imposes an explicit integration limit at a radius $r_c = 2r_{200}$ over a region of width $w = 20$ kpc so as to avoid sharp truncation of the model. Our implementation of the PZ19 model, evaluated for the Milky Way, is shown in Figure~\ref{fig:halomod}.} \begin{figure} \centering \includegraphics[width=0.47\textwidth]{halomod.pdf} \caption{Electron density model and resulting DM contribution of the Milky Way halo, for an observer 8 kpc from the Galactic center. The modified NFW profile of \cite{2019MNRAS.485..648P} for $\alpha = y_0 = 2$ is shown in orange, and our \replaced{adaptation}{implementation} of the PZ19 model is shown in blue. The maximum DM contribution of the halo predicted by the model is 63 pc cm$^{-3}$, similar to the predictions of other halo density models for lines of sight to the Galactic anti-center \citep[e.g.,][]{2020ApJ...895L..49P, 2020ApJ...888..105Y,2020MNRAS.496L.106K}.} \label{fig:halomod} \end{figure} \subsection{Scattering from the Galactic Halo} \indent Generally speaking, scattering from the Galactic halo traces the same plasma that gives rise to dispersion, weighted by the fluctuation parameter $\widetilde{F}$. To constrain $\widetilde{F}$ from measurements of $\tau$ and $\theta_{\rm d}$, we approximate the total scattering as a sum of two components: one from the disk and spiral arms of the Milky Way, which we denote with the subscript ($\rm MW,d$), and one from the Galactic halo, which we denote with the subscript ($\rm MW,h$). The total $\tau$ and $\theta_{\rm d}$ predicted by the model are therefore \begin{equation} \tau_{\rm MW}^{\rm total} = \tau_{\rm MW,d} + \tau_{\rm MW,h} \end{equation} and \begin{equation} \theta_{\rm d,MW}^{\rm total} = \sqrt{\theta_{\rm MW,d}^2 + \theta_{\rm MW,h}^2}. \end{equation} We adopt the NE2001 predictions for the $\rm MW$ components and model the halo components using Equations~\ref{eq:taudmnu} and~\ref{eq:ds}. The composite parameter $A_\tau(\widetilde{F} \times {\rm DM}^2)_{\rm MW,h}$ is constrained by maximizing the likelihood function \begin{equation}\label{eq:Like} \mathcal{L}((\widetilde{F} \times {\rm DM}^2)_{\rm MW,h} | \tau_j) = \prod_j N(\tau_{j,\rm MW}^{\rm total} - \tau_j^{\rm obs}, \sigma_{\tau,j}^2) \end{equation} using measurements $\tau^{\rm obs}$ and $\theta_{\rm d}^{\rm obs}$. The variance of the likelihood function $\sigma_{\tau_j}^2$ is taken from the measurement uncertainties, where we implicitly assume that measurements of $\tau$ and $\theta_{\rm d}$ are sufficiently approximated by Gaussian PDFs. An estimate of $\widetilde{F}_{\rm MW,h}$ can then be obtained by assuming a given halo density profile or constructing a PDF for $\DM_{\rm MW,h}$, and adopting a value for $A_\tau$. \section{The Milky Way Halo} \indent In order to determine how the Milky Way halo (and in turn other galaxy haloes) contributes to the scattering of FRBs, we must constrain the scattering contribution of the Galactic disk. In the following sections, we first determine the amount of scattering that can occur in the thick disk of the Galaxy using the distribution of pulsar scattering measurements and DMs at high Galactic latitudes. We then compare the scattering measurements of FRB 121102 and FRB 180916 to the scattering expected from the Galactic disk using NE2001, and explain discrepancies between the scattering predictions of the NE2001 and YMW16 Galactic disk models. Finally, in Section~\ref{sec:halo}, we constrain the scattering contribution of the Galactic halo, followed by discussion of scattering constraints from pulsars in the Magellanic Clouds. \subsection{Scattering from the Thick Disk}\label{sec:disk} Most currently known FRBs lie at high Galactic latitudes, and their LoS through the Galaxy predominantly sample the thick disk, which has a mean density at mid-plane of 0.015 cm$^{-3}$ and a scale height $\approx 1.6$ kpc \citep{2020ApJ...897..124O}. The distribution of $\tau/{\rm DM}^2$ for Galactic pulsars with measurements of $\tau$ \citep[][and references therein]{2016arXiv160505890C} and {\rm DM}\ and other parameters from \citet{2005AJ....129.1993M}\footnote{\url{http://www.atnf.csiro.au/research/pulsar/psrcat}} yields a direct constraint on $\widetilde{F}$: $\tau/{\rm DM}^2 \approx (16 \hspace{0.05in} {\rm ns})A_\tau\widetilde{F}$, for $\nu = 1$ GHz and $G_{\rm scatt} = 1/3$ for sources embedded in the scattering medium. The distribution of $\widetilde{F}$ for all Galactic pulsars, assuming $A_\tau\approx1$, is shown in Figure~\ref{fig:taudmb}. For the pulsars above $|20|^\circ$ Galactic latitude, the mean value of $\tau/{\rm DM}^2$ from a logarithmic fit is $(5.3^{+5.0}_{-3.3})\times10^{-8}$ ms pc$^{-2}$ cm$^{6}$, which yields $\widetilde{F} \approx (3\pm2)\times10^{-3}$ pc$^{-2/3}$ km$^{-1/3}$. The value of $\widetilde{F}$ based on high-latitude pulsars is consistent with the related $F = l_i^{1/3} \widetilde{F}$ factor used in the NE2001 model for scattering in the thick disk. \indent A structural enhancement to radio scattering for LoS below $|20|^\circ$ is reflected in the distribution of $\tau/{\rm DM}^2$ shown in Figure~\ref{fig:taudmb}, which shows a multiple orders of magnitude increase in $\widetilde{F}$ at low latitudes, with the largest values of $\widetilde{F}$ dominating LoS to the Galactic center. This latitudinal and longitudinal dependence of $\widetilde{F}$ is directly responsible for the ``hockey-stick" relation between $\tau$ and DM for Galactic pulsars, in which high-DM pulsars lying close to the Galactic plane and towards the Galactic center have a much steeper dependence on ${\rm DM}$ than pulsars lying high above the Galactic plane or towards the Galactic anti-center \citep[e.g.,][]{2004ApJ...605..759B, 2015ApJ...804...23K, 2016arXiv160505890C}. The implications of the directional dependence of $\widetilde{F}$ for FRB LoS are discussed further in Section~\ref{sec:ymw16}. \indent For the many FRBs in high Galactic latitude directions, the Galactic disk has a virtually undetectable contribution to the observed pulse broadening. The DM contribution of the thick disk is about ($23.5 \times {\rm csc}(|b|)$) pc cm$^{-3}$, which varies negligibly with longitude for $|b|>20^\circ$ \citep{2020ApJ...897..124O}. The pulse broadening at 1 GHz expected from the thick disk therefore ranges from $\tau < 0.25$ $\mu$s at $|b|=20^\circ$ to $\tau < 29$ ns at $|b| = 90^\circ$. As discussed in the following section, scattering from the Galactic thin disk and spiral arms increases dramatically for FRB LoS close to the Galactic plane. \begin{figure} \centering \includegraphics[width=0.47\textwidth]{taudm.pdf} \caption{The distribution of $\tau/{\rm DM}^2$ (which is directly proportional to $\widetilde{F}$) versus Galactic latitude for all Galactic pulsars, with $\tau$ in ms referenced to 1 GHz and DM in pc cm$^{-3}$. The average value and root-mean-square of the distribution for all pulsars above $\pm 20^\circ$ latitude is shown in blue. Pulsars closer to the Galactic center ($|b|<10^\circ$, $|l|<40^\circ$) are \replaced{highlighted in black}{shown as orange crosses}.} \label{fig:taudmb} \end{figure} \subsection{Scattering Constraints for Two FRB Case Studies}\label{sec:frbs} Unlike Galactic pulsars, for which the scintillation bandwidth and pulse broadening both result from the same electrons and conform to the uncertainty relation $2\pi\Delta\nu_{\rm d}\tau_{\rm d} = C_1$, some FRBs indicate that two \added{scattering} media are involved. \deleted{The scintillation bandwidth is caused by} \added{In these cases, the scintillation bandwidth is consistent with diffractive interstellar scintillation caused by} foreground Galactic turbulence while \added{the} pulse broadening \deleted{is extragalactic in origin, most likely from the host galaxy} \added{also has contributions from an extragalactic scattering medium \citep{ 2015Natur.528..523M, 2018ApJ...863....2G, 2019ARA&A..57..417C}}. Here we analyze the Galactic scintillations of two FRBs \added{with highly precise scattering measurements} in order to place constraints on any scattering in the Galactic halo. \subsubsection{FRB 121102}\label{sec:121102} \begin{figure} \centering \includegraphics[width=0.47\textwidth]{FRB121102_DISSBW_binned.pdf} \caption{Scintillation bandwidth vs. radio frequency for FRB 121102. The blue line and shaded region designates the least-squares fit and errors of ${\rm log}(\Delta \nu_{\rm d})$ vs. $\rm log(\nu)$. The green and orange lines are anchored to the lowest frequency point with the indicated frequency dependences. The corresponding pulse broadening time is shown on the right-hand axis assuming $\tau = 1/(2\pi\Delta \nu_{\rm d})$. Data points are from \cite{2019ApJ...876L..23H}, \cite{2018Natur.553..182M}, \cite{2018ApJ...863..150S}, and \cite{2018ApJ...863....2G}.} \label{fig:dissbw} \end{figure} FRB 121102 currently has the most comprehensive set of scattering constraints on an FRB source so far, with scintillation bandwidths $\Delta \nu_{\rm d} = 58.1 \pm 2.3$ kHz at 1.65 GHz \citep{2019ApJ...876L..23H}, 5 MHz at 4.5 GHz \citep{2018Natur.553..182M}, $6.4\pm1.4$ MHz at 4.85 GHz \citep{2018ApJ...863..150S}, and $10-50$ MHz between 5 and 8 GHz \citep{2018ApJ...863....2G}. All of these scintillation bandwidth measurements are assembled in Figure~\ref{fig:dissbw}, along with a power-law fit to the data using linear least squares that gives a mean value $\Delta \nu_{\rm d} = 3.8^{+2.5}_{-1.5}$ kHz at 1 GHz. \indent FRB 121102 also has a pulse broadening time upper limit of $\tau < 9.6$ ms at 500 MHz \citep{2019ApJ...882L..18J}, and angular broadening $\theta_{\rm d} = 2\pm 1$ mas at 1.7 GHz and $\theta_{\rm d} \sim 0.4-0.5$ mas at 5 GHz, which was measured in the \cite{2017ApJ...834L...8M} high-resolution VLBI study of the FRB and its persistent radio counterpart. These angular diameters are consistent with those reported in \cite{2017Natur.541...58C} and with the NE2001 prediction. The scattering measurements are shown in Table~\ref{tab:measures} and are referenced to 1 GHz assuming a $\tau \propto \nu^{-4}$ frequency scaling. \indent The NE2001 angular broadening and scintillation bandwidth predictions for FRB 121102 are broadly consistent with the corresponding empirical constraints (see Table~\ref{tab:measures}). In NE2001, the scattering for this LoS is dominated by an outer spiral arm located 2 kpc away and by the thick disk, which extends out to 17 kpc from the Galactic center \citep{2002astro.ph..7156C}. The ${\rm C_n^2}$, electron density, and DM predicted by NE2001 along the LoS to FRB 121102 are shown in Figure~\ref{fig:ne2001}. Modeling of the anti-center direction in NE2001 is \added{independent of our analysis and is} based on DM and scattering measurements of \added{Galactic} pulsars in the same general direction and upper bounds on the angular scattering of extragalactic sources. The \added{NE2001} model parameters were constrained through a likelihood analysis of these measurements, which revealed that the fluctuation parameter was smaller for LoS that probe the outer Galaxy compared to the inner Galaxy \citep{1998ApJ...497..238L}. This result required that the thick disk component of NE2001 have a smaller fluctuation parameter compared to the thin disk and spiral arm components that are relevant to LoS through the inner Galaxy. \indent Since the measured $\Delta \nu_{\rm d}$ and $\theta_{\rm d}$ for FRB 121102 are broadly consistent with the predicted amount of scattering from the Galactic disk, we use $\Delta \nu_{\rm d}$ and $\theta_{\rm d}$ to estimate the effective distance to the dominant scattering material. For thin-screen scattering of a source located at a distance $d_{\rm so}$ from the observer, the scattering diameter $\theta_{\rm s}$ is related to the observed angular broadening by \begin{equation} \theta_{\rm d} \sim \theta_{\rm s} ( d_{\rm sl} / d_{\rm so}) = \theta_s \bigg(1 - \frac{d_{\rm lo}}{d_{\rm so}}\bigg), \end{equation} where $d_{\rm sl}$ is the source-to-screen distance and $d_{\rm lo}$ is the screen-to-observer distance. The scattering diameter is related to the pulse broadening delay by $\tau \approx A_\tau d_{\rm so}(d_{\rm sl}/d_{\rm so})(1-d_{\rm sl}/d_{\rm so})\theta_{\rm s}^2/8 ({\rm ln} 2)c$ \citep{2019ARA&A..57..417C}. For a thin screen near the observer and an extragalactic source, $d_{\rm lo} \ll d_{\rm sl}$, giving $\theta_{\rm d} \approx \theta_{\rm s}$ and \begin{equation}\label{eq:ds} \theta_{\rm d} \approx \left(\frac{4({\rm ln}2) A_\tau C_1 c}{ \pi \Delta \nu_{\rm d} d_{\rm lo}} \right)^{1/2}. \end{equation} The scattering screen location can thus be directly estimated from measurements of $\theta_{\rm d}$ and $\Delta \nu_{\rm d}$. \indent Assuming that the same Galactic scattering material gives rise to both the angular broadening and the scintillation of FRB 121102, Equation~\ref{eq:ds} implies the scattering material has an effective distance $\hat{d}_{\rm lo} \approx 2.3$ kpc from the observer (assuming $A_\tau \approx 1$), which is consistent with the distance to the spiral arm, as shown in Figure~\ref{fig:ne2001}. A numerical joint-probability analysis of the uncertainties in $\Delta \nu_{\rm d}$ and $\theta_{\rm d}$, assuming both quantities follow normal distributions, allows the screen to be as close as 1.6 kpc or as far as 5.5 kpc (corresponding to the 15$\%$ and 85$\%$ confidence intervals). Figure~\ref{fig:thetad} shows a comparison of the relationship between $\theta_{\rm d}$ and $d_{\rm lo}$ for a thin screen and the measured $\theta_{\rm d}$ from \cite{2017ApJ...834L...8M}. Given that there is no known HII region along the LoS to FRB~121102, the most likely effective screen is in fact the spiral arm. \indent The scintillation bandwidth implies a pulse broadening contribution from the Milky Way disk and spiral arms $\tau_{\rm MW,d} \approx 0.04 \pm 0.02$ ms at 1 GHz. The upper limit on $\tau$ measured by \cite{2019ApJ...882L..18J} is an order of magnitude larger than the $\tau_{\rm MW,d}$ inferred from $\Delta \nu_{\rm d}$. Any additional scattering beyond the Galactic contribution is more likely from the host galaxy due to the lack of intervening galaxies along the LoS, and the small amount of scattering expected from the IGM \citep{2013ApJ...776..125M, 2020arXiv201108519Z}. \begin{figure} \centering \includegraphics[width=0.5\textwidth]{DM_vs_d_NE2001p_l_b_dm_174.95_-0.22_188.33012280240598.pdf} \caption{Galactic DM, electron density $n_e$, and ${\rm C_n^2}$ contribution predicted by NE2001 for FRB 121102. The maximum DM (excluding the Galactic halo) is 188 pc cm$^{-3}$. The sharp changes in $n_e$ and ${\rm C_n^2}$ between 0 and 0.3 kpc are due to structure in the local ISM. The shaded grey region indicates the distance to the scattering screen derived from a numerical joint-probability analysis of the measured scattering constraints for FRB~121102; see Figure~\ref{fig:thetad}.} \label{fig:ne2001} \end{figure} \begin{figure} \centering \includegraphics[width=0.47\textwidth]{FRB121102_thetad_screen_constraint.pdf} \caption{Scattering diameter vs. effective distance. The blue band indicates the angular diameter $\theta_{\rm d} = 2\pm1$ mas (1$\sigma$ errors) from \cite{2017ApJ...834L...8M}. The green band is the predicted angular diameter for a thin-screen that matches the least-square fit to scintillation bandwidth measurements and the uncertainties at $\pm1\sigma$. All values are expressed at 1.7 GHz. A numerical joint-probability estimate constraining the overlap of the green and blue regions gives a screen distance $\hat{d}_{\rm lo} \approx 2.3^{+3.2}_{-0.7}$ kpc. } \label{fig:thetad} \end{figure} \begin{deluxetable*}{c c c c c c }\label{tab:measures} \tablecaption{DM and Scattering Referenced to 1 GHz of FRB 121102 and FRB 180916} \tablewidth{0pt} \tablehead{\multicolumn{6}{c}{Measurements} \\ \hline \colhead{FRB} & \colhead{DM (pc cm$^{-3}$)} & \colhead{$\tau$ (ms)$^{(1, 2)}$} & $\Delta \nu_{\rm d}$ (kHz)$^{(3,4)}$ & \colhead{$\theta_{\rm d}$ (mas)$^{(5)}$} & \colhead{$\hat{d}_{\rm lo}$ (kpc)}} \startdata 121102 & $557$ & $<0.6$ & $3.8^{+2.5}_{-1.5}$ & $5.8 \pm 2.9$ & $2.3^{+3.2}_{-0.7}$ \\ 180916 & $349$ & $<0.026$ & $7.1\pm1.5$& \nodata & \nodata \\ \hline \hline \multicolumn{6}{c}{Models}\\ \hline FRB & DM (pc cm$^{-3}$) & $\tau$ (ms) & $\Delta \nu_{\rm d}$ (kHz) & $\theta_{\rm d}$ (mas) & $d_{\rm lo}$ (kpc) \\ \hline \multicolumn{6}{c}{NE2001}\\ \hline 121102 & $188$ & $0.016$ & $11$ & $6$ & $2.05$ \\ 180916 & $199$ & $0.015$ & $12$ & $5$ & $2.5$\\ \hline \multicolumn{6}{c}{YMW16}\\ \hline 121102 & $287$ & $0.84$ & $0.2$ & \nodata & \nodata \\ 180916 & $243$ & $0.42$ & $0.4$ & \nodata & \nodata \\ \enddata \tablecomments{The top of the table shows the observed DM and scattering for FRB 121102 and FRB 180916. Since the scintillation and angular broadening measurements are broadly consistent with Galactic foreground predictions by NE2001, we emphasize that they are Galactic, whereas the pulse broadening may have an extragalactic contribution from the host galaxy. The scattering measurements are referenced to 1 GHz assuming $\tau \propto \nu^{-4}$ unless otherwise noted.\\ \indent The bottom of the table shows the asymptotic DM and scattering predictions of NE2001 and YMW16. NE2001 adopts $C_1 = 1.16$ to convert between $\Delta \nu_{\rm d}$ and $\tau$, so we also use this value to calculate $\Delta \nu_{\rm d}$ from $\tau$ for YMW16. YMW16 predictions were calculated in the IGM mode, but we only report the Galactic component of DM predicted by the model for comparison with NE2001.\\ \indent References: (1) \cite{2019ApJ...882L..18J}; (2) \cite{2020ApJ...896L..41C}; (3) this work (see Figure~\ref{fig:dissbw}; referenced to 1 GHz using a best-fit power law); (4) \cite{2020Natur.577..190M}; (5) \cite{2017ApJ...834L...8M}.} \end{deluxetable*} \subsubsection{FRB 180916}\label{sec:180916} The scattering constraints for FRB 180916 consist of a scintillation bandwidth $\Delta \nu_{\rm d} = 59 \pm 13$ kHz at 1.7 GHz \citep{2020Natur.577..190M} and a pulse broadening upper limit $\tau < 1.7$ ms at 350 MHz \citep{2020ApJ...896L..41C}. The $\Delta \nu_{\rm d}$ and $\tau$ upper limit are entirely consistent with each other, so we again use $\Delta \nu_{\rm d}$ and the inferred $\tau_{\rm MW,d}$ for the rest of the analysis due to its higher precision. Based on $\Delta \nu_{\rm d}$, $\tau_{\rm MW,d} = 0.023\pm0.005$ ms at 1 GHz. As with FRB 121102 the NE2001 scattering predictions for this LoS are consistent with the empirical constraints to within the model's uncertainty, suggesting that the Galactic halo has a small ($\lesssim \mu$s level) contribution to the observed scattering. \subsubsection{Comparison with YMW16 Scattering Predictions}\label{sec:ymw16} The YMW16 model significantly overestimates the scattering of FRB 121102 and FRB 180916. The DM and scattering predictions for these FRBs are shown in Table~\ref{tab:measures}. Evaluating YMW16 for FRB 121102 using the \texttt{IGM} mode gives \replaced{$\log(\tau)=-3.012$}{$\log(\tau)=-3.074$} with $\tau$ in seconds, implying $\tau = 0.84$~ms at 1~GHz, corresponding to $\Delta \nu_{\rm d} \approx 0.2$~kHz, about 50 times smaller than the NE2001 value. Compared to the measured scattering, the nominal output of the YMW16 model overestimates the scattering \added{toward FRB 121102} by a factor of 28 to 35 (depending on whether a $\nu^{-4}$ or $\nu^{-4.4}$ scaling is used). Moreover, combining the measured $\theta_{\rm d}$ with the YMW16 estimate for $\tau$ implies a scattering screen distance $\sim 500$ kpc, beyond any local Galactic structure that could reasonably account for the scattering. For FRB 180916, YMW16 also overestimates $\tau$ to be 0.42~ms at 1~GHz, implying a scintillation bandwidth of 0.4~kHz at 1~GHz. \indent The discrepancies between the observed scattering and the YMW16 predictions are due to several important factors. Unlike NE2001, YMW16 does not explicitly model electron density fluctuations. Instead, it calculates DM for a given LoS and then uses the $\tau-{\rm DM}$ relation based on Galactic pulsars to predict $\tau$. In using the $\tau-{\rm DM}$ relation, the YMW16 model incorrectly adjusts for the scattering of extragalactic bursts. The waves from extragalactic bursts are essentially planar when they reach the Galaxy, \deleted{which means that the Galactic plasma will scatter them more than it would the spherical waves from a Galactic pulsar at a distance of a few scale lengths of the electron density} \added{which means they are scattered from wider angles than diverging spherical waves from a Galactic pulsar would be}. The differences between plane and spherical wave scattering are discussed in detail for FRBs in \cite{2016arXiv160505890C}. The YMW16 model accounts for this difference by reducing the Galactic prediction of $\tau$ by a factor of two, when \added{geometric weighting of the mean-square scattering angle implies that} the \added{Galactic} scattering \added{prediction} should really be larger by a factor of three \added{to apply to extragalactic FRBs (see Eq.~10 in \citealt{2016arXiv160505890C})}. This implies that values for $\tau$ in the output of YMW16 should be multiplied by a factor of six, which means that the model's overestimation of the scattering is really by a factor of 170 to 208 when one only considers the correction for planar wave scattering. \indent YMW16 may also overestimate the Galactic contribution to DMs of extragalactic sources viewed in the Galactic anti-center direction (and perhaps other low-latitude directions) because it significantly overestimates the observed DM distribution of Galactic pulsars that NE2001 is based on. In YMW16, the dominant DM contributions to extragalactic sources in this direction are from the thick disk and from the spiral arms exterior to the solar circle. Together these yield DM values of 287 pc cm$^{-3}$\ and 243 pc cm$^{-3}$\ for FRB~121102 and FRB~180916, respectively. These DM predictions are over $50\%$ and $20\%$ larger for each FRB than the NE2001 values, which may be due to overestimation of the densities or characteristic length scales of the outer spiral arm and thick disk components. \indent The primary cause for YMW16's scattering over-prediction is that the part of the pulsar-derived $\tau-{\rm DM}$ relation that applies to large values of DM should not be used for directions toward the Galactic anti-center. The $\tau-{\rm DM}$ relation has the empirical form \citep{2016arXiv160505890C} \begin{equation} \tau = (2.98\times10^{-7}\ {\rm ms})\, {\rm DM}^{1.4}(1+3.55\times10^{-5}{\rm DM}^{3.1}) \label{eq:taud_vs_DM} \end{equation} based on a fit to pulsar scattering data available through 2016. Similar fits were previously done by \cite{1997MNRAS.290..260R}, \cite{2004ApJ...605..759B}, and \cite{2015ApJ...804...23K}. It scales as ${\rm DM}^{1.4}$ for ${\rm DM} \lesssim 30$ pc cm$^{-3}$ and as ${\rm DM}^{4.5}$ for ${\rm DM} \gtrsim 100$ pc cm$^{-3}$. \indent The YMW16 model uses Krishnakumar's model for 327~MHz scattering times scaled to 1~GHz by a factor $(0.327)^4$, giving $\tau = (4.1\times10^{-8}\ {\rm ms})\ {\rm DM}^{2.2}(1+0.00194\times{\rm DM}^{2})$. This scaling law is in reasonable agreement with the expression in Equation~\ref{eq:taud_vs_DM} except at very low DM values. The Krishnakumar scaling law adopted the \cite{1997MNRAS.290..260R} approach of fixing the leading DM exponent to 2.2, which is based on the assumption that the relatively local ISM is uniform. This assumption is imperfect given our knowledge of the Local Bubble and other shells and voids in the local ISM. The steep $\tau\propto {\rm DM}^{4.2 \ {\rm to }\ 4.5}$ scaling for Galactic pulsars is from LoS that probe the inner Galaxy, where the larger star formation rate leads to a higher supernova rate that evidently affects the turbulence in the HII gas, and results in a larger $\widetilde{F}$, as shown in Section~\ref{sec:disk}. \indent If the YMW16 model were to use instead the shallow part of the $\tau-{\rm DM}$ relation, $\tau\propto {\rm DM}^{2.2 \ {\rm to} \ 1.4}$, which is more typical of LoS through the outer Galaxy, its scattering time estimates would be smaller by a factor of $\sim 1.94\times 10^{-3} \times (287)^{2} \sim 160$ or $\sim 3.55\times 10^{-5} \times (287)^{3.1} \sim 1500$, depending on which $\tau-{\rm DM}$ relation is used (and using FRB 121102 as an example). These overestimation factors could be considerably smaller if smaller DM values were used. While there is a considerable range of values for the overestimation factor based on the uncertainties in the empirical scaling law, it is reasonable to conclude that the high-DM part of the $\tau-{\rm DM}$ relation should not be used for the anti-center FRBs. \subsection{Fluctuation Parameter of the Galactic Halo}\label{sec:halo} The measurements of $\tau$ and $\theta_{\rm d}$ for FRBs 121102 and 180916, combined with the scattering predictions of NE2001, yield a maximum likelihood estimate for the pulse broadening contribution of the Milky Way halo (see Equation~\ref{eq:Like}). \deleted{The likelihood function is shown in Figure~6. The likelihood function is positive for values of $(\widetilde{F} \times {\rm DM}^2)_{\rm MW,h}$ extending to zero because the measured scattering from both FRBs is close enough to the NE2001 predictions that the halo could have a negligible scattering contribution.} The $95\%$ upper confidence interval yields $(\widetilde{F} \times {\rm DM}^2)_{\rm MW,h} < 250/A_\tau$ pc$^{4/3}$ km$^{-1/3}$ cm$^{-1/3}$. The maximum amount of pulse broadening expected from the Galactic halo is therefore $\tau_{\rm MW,h} < 12$ $\mu$s at 1 GHz, which is comparable to the scattering expected from the Galactic disk for LoS towards the Galactic anti-center or at higher Galactic latitudes. \indent Based on \deleted{a meta-analysis of} the broad range of $\DM_{\rm MW,h}$ currently consistent with the empirical and modeled constraints (see Section~\ref{sec:halomodels}), we construct a Gaussian probability density function (PDF) for $\widehat{{\rm DM}}_{\rm MW,h}$ with a mean of 60 pc cm$^{-3}$\ and $\sigma_{\rm \widehat{DM}} = 18$ pc cm$^{-3}$ \deleted{, which is shown in Figure~6}. \added{Combining} this PDF \added{with the maximum likelihood estimate for $(\widetilde{F} \times {\rm DM}^2)_{\rm MW,h}$} yields an upper limit $\widetilde{F}_{\rm MW,h} < 0.03/A_\tau$ pc$^{-2/3}$ km$^{-1/3}$. While $A_\tau$ is probably about 1, if $A_\tau$ is as small as $1/6$ then $\widetilde{F}_{\rm MW,h}$ could be up to 6 times larger. \indent \added{This estimate of $\widetilde{F}_{\rm MW,h}$ is based on just two LoS towards the Galactic anti-center, and it is unclear how much $\widetilde{F}_{\rm MW,h}$ will vary between different LoS through the halo. Given that sources viewed through the inner Galaxy (near $b = 0^\circ$) are more heavily scattered, it is unlikely that estimates of $\widetilde{F}_{\rm MW,h}$ will be obtainable for LoS that intersect the halo through the inner Galaxy. However, FRB 121102, FRB 180916, and most of the FRBs detected at higher latitudes do not show evidence of any intense scattering regions that might be associated with the halo \citep[e.g.,][]{2020MNRAS.497.1382Q}, suggesting that extremely scattered FRBs would be outliers and not representative of the Galactic halo's large-scale properties. All FRBs are ultimately viewed through not only the Galactic halo but also the haloes of their host galaxies and, in some cases, the haloes of intervening galaxies. Given the observed variations in scattering between different LoS through the Milky Way, it appears most likely that the heaviest scattered FRBs will be viewed through scattering regions within galaxy disks rather than haloes, and extrapolating our analysis to a larger sample of FRBs will require determining whether observed variations in $\widetilde{F}$ are due to variations between galaxy haloes, disks, or the sources' local environments.} In the following sections, we compare the Milky Way halo scattering contribution \added{inferred from FRBs 121102 and 180916} to scattering observed from the Magellanic Clouds and galaxy haloes intervening LoS to FRBs. \subsection{Constraints from Pulsars in the Magellanic Clouds}\label{sec:MCs} At distances of 50 to 60 kpc and latitudes around $-30^\circ$, pulsar radio emission from the Large and Small Magellanic Clouds (LMC/SMC) mostly samples the Galactic thick disk and a much smaller path length through the Galactic halo than FRBs. So far, twenty-three radio pulsars have been found in the LMC and seven in the SMC \citep[e.g.,][]{1991MNRAS.249..654M,2001ApJ...553..367C,2006ApJ...649..235M, 2013MNRAS.433..138R, 2019MNRAS.487.4332T}. Very few scattering measurements exist for these LoS. PSR B0540$-$69 in the LMC has a DM of 146.5 pc cm$^{-3}$\ and was measured to have a pulse broadening time $\tau = 0.4$ ms at 1.4 GHz \citep{2003ApJ...590L..95J}. The Galactic contribution to DM and scattering predicted by NE2001 towards this pulsar are ${\rm DM}_{\rm NE2001} = 55$ pc cm$^{-3}$, and $\tau_{\rm NE2001} = 0.3\times10^{-3}$ ms at 1 GHz. Based on this DM estimate, the pulsar DM receives a contribution of about $92$ pc cm$^{-3}$\ from the LMC and the Galactic halo. The lowest DMs of pulsars in the LMC have been used to estimate the DM contribution of the halo to be about 15 pc cm$^{-3}$\ for pulsars in the LMC \citep{2020ApJ...888..105Y}, which suggests that the LMC contributes about 77 pc cm$^{-3}$\ to the DM of B0540$-$69. \indent The scattering observed towards B0540$-$69 is far in excess of the predicted scattering from the Galactic disk. Since B0540$-$69 not only lies within the LMC but also within a supernova remnant, it is reasonable to assume that most of the scattering is contributed by material within the LMC. Using the upper limit $\widetilde{F}_{\rm MW,h} < 0.03/A_\tau$ pc$^{-2/3}$ km$^{-1/3}$\ and $\widehat{{\rm DM}}_{\rm MW,h} = 15$ pc cm$^{-3}$\ yields $\tau_{\rm MW,h} < 0.1$ $\mu$s at 1.4~GHz for this LoS, which is too small to explain the observed scattering. If we instead combine $\tau = 0.4$ ms at 1.4~GHz and the estimated $\widehat{{\rm DM}}_{\rm LMC} = 77$ pc cm$^{-3}$, \added{we find $\widetilde{F}_{\rm LMC} \approx 16/A_\tau$} \deleted{$\widetilde{F}_{\rm LMC} \approx 4.2/A_\tau$} pc$^{-2/3}$ km$^{-1/3}$. More scattering measurements for LMC and SMC pulsars are needed to better constrain the fluctuation parameters of the LMC and SMC, which in turn will improve our understanding of interstellar plasma in these satellite galaxies. \section{Constraints on Intervening Haloes along Lines of Sight to FRBs}\label{sec:conc} As of this paper, two FRBs are found to pass through galactic haloes other than those of their host galaxies and the Milky Way: FRB 181112, which passes within 30 kpc of the galaxy DES J214923.89$-$525810.43, otherwise known as FG$-$181112 \citep{2019Sci...366..231P}, and FRB 191108, which passes about 18 kpc from the center of M33 and 185 kpc from M31 \citep{2020MNRAS.tmp.2810C}. Both FRBs have measurements of $\tau$ which are somewhat constraining. \subsection{FRB 181112} \indent FRB 181112 was initially found to have $\tau < 40$ $\mu$s at 1.3 GHz by \cite{2019Sci...366..231P}; follow-up analysis of the ASKAP filterbank data and higher time resolution data for this burst yielded independent estimates of $\tau < 0.55$ ms \citep{2020MNRAS.497.1382Q} and $\tau \approx 21 \pm 1$ $\mu$s \citep{2020ApJ...891L..38C} at 1.3 GHz. We adopt the last value for our analysis, with the caveat that the authors report skepticism that the data is best fit by a pulse broadening tail following the usual frequency dependence expected from scattering in a cold plasma, and that the measured decorrelation bandwidth of the burst spectrum is in tension with the pulse broadening fit (for a full discussion, see Section 4 of \citealt{2020ApJ...891L..38C}). \indent We first place an upper limit on $(\widetilde{F} \times {\rm DM}^2)_{\rm i,h}$ for FG$-$181112 by assuming that the intervening halo may contribute up to all of the observed scattering of FRB 181112. The halo density profile (Equation~\ref{eq:neh}) is re-scaled to the lens redshift ($z_{\rm i,h} = 0.36$) and evaluated at the impact parameter $R_\perp = 29$ kpc. \cite{2019Sci...366..231P} constrain the mass of the intervening halo to be $M_{\rm halo}^{\rm FG-181112} \approx 10^{12.3}M_\odot$. Again assuming a physical extent to the halo of $2r_{200}$ gives \deleted{an effective} \added{a} path length through the halo $L \approx 930$ kpc. The observed scattering $\tau \approx 21$ $\mu$s is the maximum amount of scattering that could be contributed by the halo, i.e., $\tau_{\rm i,h} < 21$ $\mu$s at 1.3 GHz, which yields $(\widetilde{F} \times {\rm DM}^2)_{\rm i,h} < 13/A_\tau$ pc$^{4/3}$ km$^{-1/3}$ cm$^{-1/3}$\ using Equation~\ref{eq:taudmnuz}. \indent Assuming the halo density profile where $y_0 = \alpha = 2$ gives $\widehat{{\rm DM}}_{\rm i,h} \approx 135$ pc cm$^{-3}$\ in the frame of the intervening galaxy. This DM estimate for the halo is similar to the estimate of $122$ pc cm$^{-3}$\ from \cite{2019Sci...366..231P}, but as they note, the DM contribution is highly sensitive to the assumed density profile and could be significantly smaller if the physical extent and/or the baryonic fraction of the halo are smaller. This DM estimate yields $\widetilde{F}_{\rm i,h} < (7\times10^{-4})/A_\tau$ pc$^{-2/3}$ km$^{-1/3}$. If the DM contribution of the intervening halo is smaller, then $\widetilde{F}_{\rm i,h}$ could be up to an order of magnitude larger. The total observed DM of the FRB is broadly consistent with the estimated DM contributions of the Milky Way, host galaxy, and IGM alone \citep{2019Sci...366..231P}, so the uncertainty in ${\rm DM}_{\rm i,h}$ remains the greatest source of uncertainty in deconstructing $(\widetilde{F} \times {\rm DM}^2)_{\rm i,h}$. Both estimates of $(\widetilde{F} \times {\rm DM}^2)_{\rm i,h}$ and $\widetilde{F}_{\rm i,h}$ for FRB 181112 are within the upper limits for the Milky Way halo. \subsection{FRB 191108} \indent FRB 191108 passes through both the M31 and M33 haloes and has a source redshift upper limit $z\lesssim0.5$ based on DM. \cite{2020MNRAS.tmp.2810C} report an upper limit of $80$ $\mu$s on the intrinsic pulse width and scattering time at 1.37 GHz, but they demonstrate that this limit is likely biased by dispersion smearing. \cite{2020MNRAS.tmp.2810C} also report $25\%$ intensity modulations at a decorrelation bandwidth $\sim 40$ MHz. This decorrelation bandwidth may be attributable to scattering in the M33 halo and/or in the host galaxy (for a full discussion, see Section 3.4 of \citealt{2020MNRAS.tmp.2810C}). \indent Re-scaling our galactic halo density profile using halo masses $M_{\rm halo}^{\rm M33} \approx 5\times10^{11}M_\odot$ and $M_{\rm halo}^{\rm M31} \approx 1.5\times10^{12}M_\odot$ yields a total DM contribution from both haloes of about 110 pc cm$^{-3}$, nearly two times larger than the DM contribution estimated by \cite{2020MNRAS.tmp.2810C}, who use a generic model for the M33 and M31 haloes from \cite{2019MNRAS.485..648P} based on the same galaxy masses. We assume that the density profiles are independent; if there are dynamical interactions between the haloes then these may slightly modify the overall density distribution along the LoS, but it is unclear how turbulence in the plasma would be affected, if at all. Since the impact parameter of 18 kpc for M33 is significantly smaller than the 185 kpc for M31, M33 dominates the predicted DM contribution to FRB 191108 (with $\widehat{{\rm DM}}_{\rm i,h} \approx 90$ pc cm$^{-3}$), and therefore is more likely than M31 to also dominate the scattering. \indent If we were to assume that $\Delta \nu_{\rm d}\approx 40$ MHz (at 1.37 GHz, which translates to $\tau \approx 4$ ns) is attributable to scattering in the M33 halo, then we get $(\widetilde{F} \times {\rm DM}^2)_{\rm i,h} \approx 0.23/A_\tau$ pc$^{4/3}$ km$^{-1/3}$ cm$^{-1/3}$\ for $z_{\rm host} = 0.5$. A smaller source redshift would increase $d_{\rm sl} d_{\rm lo}/d_{\rm so}$, resulting in an even smaller value of $(\widetilde{F} \times {\rm DM}^2)_{\rm i,h}$. For a halo DM contribution of about 90 pc cm$^{-3}$\, this estimate of $(\widetilde{F} \times {\rm DM}^2)_{\rm i,h}$ yields $\widetilde{F}_{\rm i,h} \approx (2.7\times10^{-5})/A_\tau$ pc$^{-2/3}$ km$^{-1/3}$, which is three orders of magnitude smaller than the upper limit we infer for the Milky Way halo. Using a smaller ${\rm DM}_{\rm i,h} \approx 50$ pc cm$^{-3}$\ increases $\widetilde{F}$ to $\widetilde{F}_{\rm i,h} \approx (9\times10^{-5})/A_\tau$ pc$^{-2/3}$ km$^{-1/3}$. Generally speaking, if $\widetilde{F}$ is about a factor of 10 larger, then the pulse broadening from the halo would be 10 times larger and the scintillation bandwidth 10 times smaller. On the other hand, if M31 were to contribute more significantly to the DM then $\widetilde{F}_{\rm i,h}$ would be smaller than our estimate. While there is a range of reasonable values for $\widetilde{F}_{\rm i,h}$, it appears that scattering in the M33 halo is negligible. \indent \cite{2020MNRAS.tmp.2810C} use a different approach to evaluate the scattering of FRB 191108. They estimate a scattering angle from the decorrelation bandwidth in order to obtain an estimate of the diffractive scale and rms electron density fluctuations in the halo. Making assumptions about the outer scale and the relationship between the mean density and rms density fluctuations, they find a mean electron density for the halo that is larger than expected, and conclude that if the scattering occurs in M33, then it is more likely from cool clumps of gas embedded in the hot, extended halo. \cite{2019Sci...366..231P} use a similar methodology to estimate a mean density for the halo of FG$-$181112. Rather than make an indirect estimate of $n_e$ in each halo, our analysis yields a direct constraint on $(\widetilde{F} \times {\rm DM}^2)_{\rm i,h}$ from observable quantities. The corresponding estimates of $\widetilde{F}$ are sufficient to demonstrate that very little scattering occurs \added{along either of these FRB LoS through the} galaxy haloes. Further deconstructing $\epsilon^2$, $\zeta$, and $f$ from $\widetilde{F}$ will require more information about the outer and inner scales of turbulence, which may differ from halo to halo. \begin{figure} \centering \includegraphics[width=0.47\textwidth]{Fsummary_horiz.pdf} \caption{Nominal values of $\widetilde{F}$ for different components of the Milky Way (MW), the Large Magellanic Cloud (LMC), and for the foreground galaxies of FRB 181112 and FRB 191108. The Galactic anti-center and inner galaxy values are calculated by integrating NE2001 through the entire disk in the directions $(l = 130^\circ, b = 0^\circ)$ and $(l = 30^\circ, b=0^\circ)$, respectively. The nominal $\widetilde{F}$ for each halo was calculated assuming the modeled halo DMs discussed in the text. The orange error bars indicate the maximum values of $\widetilde{F}$ for $A_\tau > 1/6$, with $A_\tau = 1$ for the black points. The green error bars indicate a range of $\widetilde{F}$ for a representative range of halo DMs (and $A_\tau = 1$). The green lower and upper bounds correspond to: $20<{\rm DM}_{\rm MW,h}<120$ pc cm$^{-3}$\ for the Galactic halo, $50<{\rm DM}_{\rm i,h}<140$ pc cm$^{-3}$\ for FG$-$181112, and $50<{\rm DM}_{\rm i,h}<120$ pc cm$^{-3}$\ for M33. For each halo, the blue bar indicates that the scattering constraints are upper limits. The blue bar for the thick disk indicates the root-mean-square error in the distribution of $\widetilde{F}$ for high Galactic latitude pulsars.} \label{fig:Fsummaryplot} \end{figure} \section{Discussion} We present a straightforward methodology for constraining the internal electron density fluctuations of galaxy haloes using FRB scattering measurements. The pulse broadening time $\tau \propto \widetilde{F} \times {\rm DM}^2$, where the fluctuation parameter $\widetilde{F}$ quantifies the amount of scattering per unit DM and is directly related to the density fluctuation statistics. We analyze two case studies, FRB 121102 and FRB 180916, and find their scattering measurements to be largely consistent with the predicted scattering from the Galactic disk and spiral arms, plus a small or negligible contribution from the Galactic halo. A likelihood analysis of their scintillation bandwidths and angular broadening places an upper limit on the product of the Galactic halo DM and fluctuation parameter $(\widetilde{F} \times {\rm DM}^2)_{\rm MW,h} < 250/A_\tau$ pc$^{4/3}$ km$^{-1/3}$ cm$^{-1/3}$, where $A_\tau$ is the dimensionless constant relating the mean scattering time to the $1/e$ time of a scattered pulse. This estimate can be used to calculate the pulse broadening delay induced by electron density fluctuations in the halo, independent of any assumptions about the electron density distribution of the Galactic halo. The upper limit on $(\widetilde{F} \times {\rm DM}^2)_{\rm MW,h}$ implies a maximum amount of pulse broadening from the Galactic halo $\tau_{\rm MW,h} < 12$ $\mu$s at 1 GHz. \indent While the DM contribution of the Milky Way halo to FRB DMs is still poorly constrained, we adopt a Gaussian PDF for the observed DM of the halo to estimate $\widetilde{F}_{\rm MW,h} < 0.03/A_\tau$ pc$^{-2/3}$ km$^{-1/3}$. We compare this to the fluctuation parameter of the Galactic thick disk using the distribution of $\tau/{\rm DM}^2$ for all Galactic pulsars at high Galactic latitudes with pulse broadening measurements. We measure the fluctuation parameter of the thick disk to be $\widetilde{F}_{\rm disk}^{\rm thick} = (3\pm2)\times10^{-3}$ pc$^{-2/3}$ km$^{-1/3}$, about an order of magnitude smaller than the halo upper limit. At high Galactic latitudes, the thick disk will only cause a scattering delay on the order of tens of nanoseconds at 1 GHz. Larger samples of FRBs and continued X-ray observations of the Galactic halo will refine our understanding of the DM contribution of the halo and may modify our current constraint on $\widetilde{F}_{\rm MW,h}$\added{, which is only based on two LoS through the halo}. While we assume for simplicity that the density distribution of the halo is spherically symmetric, $\widetilde{F}_{\rm MW,h}$ and $\DM_{\rm MW,h}$ will vary between different LoS through the halo, and an extension of our analysis to a larger sample of FRBs may yield a more constraining limit on the average fluctuation parameter of the halo. \indent Extrapolating the scattering formalism we use for the Galactic halo to intervening galaxies, we examine two examples of FRBs propagating through intervening haloes, FRB 181112 and FRB 191108. The observed upper limits on each halo's contribution to $\tau$ are $\tau_{\rm i,h}<21$ $\mu$s at 1.3 GHz for FRB 181112 \citep{2020ApJ...891L..38C} and $\tau_{\rm i,h} < 4$ ns at 1.37 GHz for FRB 191108 \citep{2020MNRAS.tmp.2810C}. We find $(\widetilde{F} \times {\rm DM}^2)_{\rm i,h} < 13/A_\tau$ pc$^{4/3}$ km$^{-1/3}$ cm$^{-1/3}$\ for FRB 181112 and $(\widetilde{F} \times {\rm DM}^2)_{\rm i,h} < 0.2/A_\tau$ pc$^{4/3}$ km$^{-1/3}$ cm$^{-1/3}$\ for FRB 191108. Both estimates fall within the upper limit for the Milky Way halo, and all of these haloes have small to negligible scattering contributions \added{for the FRBs considered in this paper}. \indent We also model the DM contribution of each intervening halo to find nominal constraints on $\widetilde{F}$. The values of $\widetilde{F}$ from our analysis of FRB 181112, FRB 191108, the LMC, the Galactic halo, the Galactic thick disk, and the values of $\widetilde{F}$ used in NE2001 for the Galactic anti-center and inner Galaxy are all assembled in Figure~\ref{fig:Fsummaryplot}. The uncertainties associated with the conversion factor $A_\tau$ and the halo DMs are also shown. \added{The values of $\widetilde{F}$ for M33, FG$-$181112, the Galactic halo, and the LMC are essentially point estimates because they are based on individual sources, while the estimates provided for the Galactic thick disk, anti-center, and inner Galaxy are based on the population of Galactic pulsars.} Broadly speaking, the $\widetilde{F}$ upper limit for the Galactic halo is similar to that of the disk and spiral arms in the anti-center direction, and is about an order of magnitude larger than the fluctuation parameter of the thick disk. The value of $\widetilde{F}$ for the LMC is similar to that of the inner Milky Way because it is based on the pulse broadening of B0540$-$69, which lies within a supernova remnant and hence within an enhanced scattering region. Our estimates of $\widetilde{F}_{\rm i,h}$ for both FRB 181112 and FRB 191108 indicate that very little scattering occurs in the haloes intervening their LoS. \indent The fluctuation parameter is directly related to the inner and outer scales of turbulence as $\widetilde{F} \propto (\zeta \epsilon^2/f)(l_{\rm o}^2l_{\rm i})^{-1/3}$, where $\zeta$ and $\epsilon$ respectively describe changes in the mean density between different gas cloudlets and the variance of the density fluctuations within cloudlets. While the inner and outer scales in the Galactic warm ionized medium (WIM) are constrained by pulsar measurements to be on the order of \replaced{$l_{\rm i} \sim 1000$}{$100 \lesssim l_{\rm i} \lesssim 1000$} km and $l_{\rm o} \gtrsim 10$ pc \replaced{\citep{1995ApJ...443..209A}}{\citep{1990ApJ...353L..29S,1995ApJ...443..209A,2004ApJ...605..759B,2009MNRAS.395.1391R}} , the corresponding scales in hot halo gas are probably much larger. Given the size of the halo, $l_{\rm o}$ could be on the order of tens of kpc. The inner scale could also be larger if it is related to the proton gyroradius and the magnetic field strength is smaller in the halo than in the disk, which is probably the case given that the rotation measures of extragalactic sources tend to be larger closer to the Galactic plane \citep{2017ARA&A..55..111H}. Given that $f$, $l_{\rm o}$, and $l_{\rm i}$ are all probably larger in the halo than in the disk, we would expect $\widetilde{F}_{\rm MW,h}$ to be much smaller than $\widetilde{F}_{\rm disk}^{\rm thick}$. If we further expect the Milky Way halo to be similar to other galaxy haloes like FG$-$181112 and M33, then $\widetilde{F}_{\rm MW,h}$ would likely be less than $10^{-3}$ pc$^{-2/3}$ km$^{-1/3}$. However, our current constraints allow $\widetilde{F}$ to be larger in the halo than in the disk, which suggests that the upper limit for $\widetilde{F}_{\rm MW,h}$ is not constraining enough to make any further conclusions about $\zeta$, $\epsilon^2$, $f$, $l_{\rm o}$, and $l_{\rm i}$ in the halo. \indent \added{On the other hand, quasar absorption studies of the CGM of other galaxies (mostly at redshifts $z\gtrsim2$) indicate the presence of $\sim10^4$ K gas \citep{2015Sci...348..779H, 2016ApJS..226...25L, 2018MNRAS.473.5407M}, suggesting that the CGM is a two-phase medium consisting of warm gas clumps embedded in a hot ($10^6$ K) medium \citep{2018MNRAS.473.5407M}. Using a cloudlet model based on the simulations of \cite{2018MNRAS.473.5407M}, \cite{2019MNRAS.483..971V} demonstrate that a clumpy CGM could significantly scatter FRBs. Our empirical constraints on $\widetilde{F}$ are largely independent of any assumptions about the physical properties of the scattering medium. We assume a halo density model to estimate the DM contribution of a halo, although mapping of ionized and neutral high-velocity clouds in the Galactic CGM indicate that the DM is likely dominated by the hot gas \citep{2019MNRAS.485..648P}. As a composite parameter, $\widetilde{F}$ is insensitive to a broad range of assumptions about gas temperature or clumps, and could serve as an independent test of the two-phase model for the CGM. In a clumpy, cooler CGM, the inner and outer scales of turbulence would be similar to those in the WIM and $f \ll 1$, and $\widetilde{F}$ would be larger than it would be in a hot medium with a larger filling factor and scale size. Adopting fiducial values of $\epsilon^2 = \zeta = 1$, $f\sim10^{-4}$ (the value used by \cite{2019MNRAS.483..971V}), $l_{\rm i} \sim 100$ km, and $l_{\rm o} \sim 10$ pc gives $\widetilde{F} \sim 500$ pc$^{-2/3}$ km$^{-1/3}$. This estimate is orders of magnitude larger than our results for the Galactic halo and the foreground haloes of FRBs 181112 and 191108, suggesting that halo gas probed by these LoS is either not dominated by cooler clumps, or that $f$, $l_{\rm o}$, and $l_{\rm i}$ are significantly different in the clumpy CGM than otherwise assumed by \cite{2018MNRAS.473.5407M} and \cite{2019MNRAS.483..971V}. } \indent \deleted{A more stringent comparison of the hot halo and thick disk will require a stricter constraint on $\widetilde{F}$ for the halo.} \added{A more stringent comparison of hot gas in the halo and the WIM will require a larger sample of precise FRB scattering measurements.} Regardless, the nominal range of $\widetilde{F}$ constrained for the Galactic halo and the haloes intervening FRB 181112 and FRB 191108 demonstrate the range of internal properties that different galaxy haloes can have. A broader sample of FRB scattering measurements with intervening halo associations will expand this range and may potentially reveal an interesting diversity of galaxy haloes. \indent Many more FRBs with intervening galaxy haloes will likely be discovered in the near future. In these cases, the amount of scattering to be expected from the intervening haloes will depend not only on the fluctuation parameter $\widetilde{F}$ and DM of the halo, but also on the relative distances between the source, halo, and observer, and the effective path length through the halo. Depending on the relative configuration, an intervening halo may amplify the amount of scattering an FRB experiences by factors of 100 or more relative to the amount of scattering expected from the Milky Way halo. However, plausibly attributing scattering to an intervening halo will still require careful consideration of the FRB host galaxy, which in many cases may be the dominant source of FRB scattering. \acknowledgements The authors thank the referee for their useful comments and acknowledge support from the National Aeronautics and Space Administration (NASA 80NSSC20K0784) and the National Science Foundation (NSF AAG-1815242), and are members of the NANOGrav Physics Frontiers Center, which is supported by the NSF award PHY-1430284. \section{Introduction} Fast radio bursts (FRBs) propagate from as far as $\sim$Gpc distances through their local environments, the interstellar medium (ISM) and circumgalactic medium (CGM) of their host galaxy, the intergalactic medium (IGM) and any intervening galaxies or galaxy haloes, the halo and ISM of the Milky Way, and finally through the interplanetary medium (IPM) of our Solar System before arriving at the detector. Along their journey they experience dispersion and multi-path propagation from free electrons along the line-of-sight (LoS). The dispersion measure ${\rm DM} = \int n_e dl/(1+z)$, where $n_e$ is the electron density and $z$ is the redshift. Most FRBs are extragalactic and have DMs much larger than the expected contribution from our Galaxy, with the single possible exception being the Galactic magnetar source SGR 1935$+$2154 \citep{2020arXiv200510828B, 2020arXiv200510324T}. Many studies of FRB propagation have focused on the ``DM budget," constraining the relative contributions of intervening media to the total observed FRB DM, with particular attention paid to determining the DM contribution of the IGM, which in principle can be used to estimate the distance to an FRB without a redshift \citep[e.g.,][]{2015MNRAS.451.4277D,2019ApJ...886..135P}. For FRBs with redshifts the subsequent intergalactic ${\rm DM}(z)$ relationship can be used to measure the cosmic baryon density, as was first empirically demonstrated by \cite{2020Natur.581..391M}. Arguably the least constrained DM contribution to FRBs is that of their host galaxies, which has been estimated in only one case using Balmer line observations \citep[][]{2017ApJ...834L...7T}. \indent Understanding FRB propagation requires study of not just dispersion but also scattering. Bursts propagate along multiple ray paths due to electron density fluctuations, which leads to detectable chromatic effects like pulse broadening, scintillation, and angular broadening. These effects are respectively characterized by a temporal delay $\tau$, frequency bandwidth $\Delta \nu_{\rm d}$, and full width at half maximum (FWHM) of the scattered image $\theta_{\rm d}$. Scattering effects generally reduce FRB detectability, obscure burst substructure, or produce multiple images of the burst, and may contaminate emission signatures imprinted on the signal at the source \citep[e.g.,][]{2017ApJ...842...35C, 2019ApJ...876L..23H, 2020MNRAS.497.3335D}. On the other hand, scattering effects can also be used to resolve the emission region of the source \citep{2020ApJ...899L..21S} and to constrain properties of the source's local environment \citep[for a review of FRB scattering see][]{2019A&ARv..27....4P, 2019ARA&A..57..417C}. Since the relationship between $\tau$ and DM is known for Galactic pulsars \citep[e.g.,][]{1997MNRAS.290..260R, 2004ApJ...605..759B,2015ApJ...804...23K,2016arXiv160505890C}, it is a promising basis for estimating the DM contributions of FRB host galaxies based on measurements of $\tau$ (Cordes et al., in prep). In order to use scattering measurements for these applications, we need to assess how intervening media contribute to the observed scattering (i.e., a ``scattering budget"). To disentangle any scattering effects intrinsic to the host galaxy or intervening galaxies, we need to accurately constrain the scattering contribution of the Milky Way. \indent Broadly speaking, an FRB will encounter ionized gas in two main structural components of the Milky Way, the Galactic disk and the halo. The Galactic disk consists of both a thin disk, which has a scale height of about 100 pc and contains the spiral arms and most of the Galaxy's star formation \citep[e.g.,][]{2002astro.ph..7156C}, and the thick disk, which has a scale height of about 1.6 kpc and is dominated by the more diffuse, warm ($T\sim10^4$ K) ionized medium \citep[e.g.,][]{2020ApJ...897..124O}. The halo gas is \added{thought to be} dominated by the hot ($T\sim 10^6$ K) ionized medium, and most of this hot gas is contained within 300 kpc of the Galactic center \added{\citep[e.g.,][]{2017ApJ...835...52F}}. While the DMs and scattering measurements of Galactic pulsars and pulsars in the Magellanic Clouds predominantly trace plasma in the thin and thick disks, extragalactic sources like FRBs are also sensitive to gas in the halo. \indent In this paper we assess the contribution of galaxy haloes to the scattering of FRBs. We demonstrate how scattering measurements of FRBs can be interpreted in terms of the internal properties of the scattering media, and apply this formalism to galaxy haloes intervening LoS to FRBs. We first assess scattering from the Milky Way halo using two case studies: FRB 121102 and FRB 180916. \deleted{These FRBs are seen towards the Galactic anti-center and have highly precise localizations and host galaxy associations, in addition to precise scattering measurements.} \added{These FRBs have the most comprehensive, precise scattering measurements currently available, in addition to highly precise localizations and host galaxy associations}. Due to their location close to the Galactic plane, the emission from these sources samples both the outer spiral arm of the Galaxy and the Galactic thick disk, and the scattering observed for these FRBs is broadly consistent with the scattering expected from the spiral arm and disk. Only a minimal amount of scattering is allowed from the Galactic halo along these LoS, thus providing an upper limit on the halo's scattering contribution. We then extrapolate this analysis to two FRBs that pass through haloes other than those of their host galaxies and the Milky Way, FRB 181112 and FRB 191108. \indent In Section~\ref{sec:theory} we summarize the formalism relating electron density fluctuations and the observables $\tau$, DM, $\Delta \nu_{\rm d}$, and $\theta_{\rm d}$, and describe our model for the scattering contribution of the Galactic halo. A new measurement of the fluctuation parameter of the Galactic thick disk is made in Section~\ref{sec:disk} using Galactic pulsars. An overview of the scattering measurements for FRB 121102 and FRB 180916 is given in Section~\ref{sec:frbs}, including an updated constraint on the scintillation bandwidth for FRB 121102 and a comparison of the scattering predictions made by Galactic electron density models NE2001 \citep{2002astro.ph..7156C, 2003astro.ph..1598C} and YMW16 \citep{2017ApJ...835...29Y}. The FRB scattering constraints are used to place an upper limit on the fluctuation parameter of the Galactic halo in Section~\ref{sec:halo}. A brief comparison of the FRB-derived limit with scattering observed towards the Magellanic Clouds is given in Section~\ref{sec:MCs} and scattering constraints for intervening galaxy haloes are discussed in Section~\ref{sec:conc}. \section{Modeling}\label{sec:theory} \subsection{Electron Density Fluctuations and Scattering} \indent We characterize the relationship between electron density fluctuations and scattering of radio emission using an ionized cloudlet model in which clumps of gas in the medium have a volume filling factor $f$, internal density fluctuations with variance $\epsilon^2 = \langle (\delta n_e)^2 \rangle/{n_e}^2$, and cloud-to-cloud variations described by $\zeta = \langle {n_e}^2 \rangle/\langle {n_e} \rangle^2$, where $n_e$ is the local, volume-averaged mean electron density \citep[][]{1991Natur.354..121C, 2002astro.ph..7156C, 2003astro.ph..1598C}. We assume that internal fluctuations follow a power-law wavenumber spectrum of the form \citep[][]{cfrc87} $P_{\delta n_e}(q) = {\rm C_n^2} q^{-\beta} \exp(-(ql_{\rm i} / 2\pi)^2)$ that extends over a wavenumber range $2\pi / l_{\rm o} \le q \lesssim 2\pi / l_{\rm i}$ defined by the outer and inner scales, $l_{\rm o}, l_{\rm i}$, respectively. We adopt a wavenumber index $\beta = 11/3$ that corresponds to a Kolmogorov spectrum. Typically, $l_{\rm i} \ll l_{\rm o}$, but their magnitudes depend on the physical mechanisms driving and dissipating turbulence, which vary between different regions of the ISM. \indent Multipath propagation broadens pulses by a characteristic time $\tau$ that we relate to DM and other quantities. For a medium with homogeneous properties, the scattering time in Euclidean space is $\tau({\rm DM}, \nu) = K_\tau A_\tau \nu^{-4} \widetilde{F} G_{\rm scatt} {\rm DM}^2$ \citep[][]{2016arXiv160505890C}. The coefficient $K_\tau = \Gamma(7/6) c^3 r_{\rm e}^2 / 4$, where $c$ is the speed of light and $r_{\rm e}$ is the classic electron radius, while the factor $A_\tau \lesssim 1$ scales the mean delay to the $1/e$ delay that is typically estimated from pulse shapes. Because $A_\tau$ is medium dependent, we include it in relevant expressions symbolically rather than adopting a specific value. The scattering efficacy is determined by the fluctuation parameter $\widetilde{F} = \zeta\epsilon^2 / f (l_{\rm o}^2l_{\rm i})^{1/3}$ combined with a dimensionless geometric factor, $G_{\rm scatt}$, discussed below. \indent Evaluation with DM in pc cm$^{-3}$, the observation frequency $\nu$ in GHz, the outer scale in pc units, and the inner scale in km, $\widetilde{F}$ has units pc$^{-2/3}$ km$^{-1/3}$\ and \begin{eqnarray} \label{eq:taudmnu} \tau({\rm DM},\nu) \approx 48.03~{\rm ns} \,A_\tau \nu^{-4} \widetilde{F} G_{\rm scatt} {\rm DM}^2 . \end{eqnarray} For reference, the NE2001 model uses a similar parameter, $F = \widetilde{F} l_i^{1/3}$ \citep[Eq. 11-13][]{2002astro.ph..7156C}, that relates the scattering measure SM to {\rm DM}\ and varies substantially between different model components (thin and thick disks, spiral arms, clumps). \indent The geometric factor $G_{\rm scatt}$ in Eq.~\ref{eq:taudmnu} depends on the location of the FRB source relative to the dominant scattering medium and is calculated using the standard Euclidean weighting $(s/d)(1-s/d)$ in the integral of ${\rm C_n^2}(s)$ along the LoS. If both the observer and source are embedded in a medium with homogeneous scattering strength, $G_{\rm scatt} = 1/3$, while $G_{\rm scatt} = 1$ if the source to observer distance $d$ is much larger than the medium's thickness and either the source or the observer is embedded in the medium. \indent For a thin scattering layer with thickness $L$ at distance $\delta d \gg L$ from the source or observer, $G_{\rm scatt} \simeq 2\delta d / L \gg 1$ because of the strong leverage effect. For thin-layer scattering of cosmological sources by, e.g., a galaxy disk or halo, $G_{\rm scatt} = 2d_{\rm sl} d_{\rm lo}/Ld_{\rm so}$ where $d_{\rm sl}, d_{\rm lo}$ and $d_{\rm so}$ are angular diameter distances for source to scattering layer, scattering layer to observer, and source to observer, respectively. The scattering time is also multiplied by a redshift factor $(1+ z_{\ell})^{-3}$ that takes into account time dilation and the higher frequency at which scattering occurs in the layer at redshift $z_{\ell}$, with ${\rm DM}_{\ell}$ representing the lens frame value. We thus have for distances in Gpc and $L$ in Mpc, \begin{eqnarray} \label{eq:taudmnuz} \tau({\rm DM},\nu, z) \approx 48.03~{\rm \mu s} \times \frac{A_\tau \widetilde{F}\, {\rm DM}_{\ell}^2 }{(1 + z_{\ell})^3 \nu^4} \left[\frac{2d_{\rm sl}d_{\rm lo}}{ Ld_{\rm so}} \right] . \end{eqnarray} If the layer's DM could be measured, it would be smaller by a factor $(1+z_{\ell})^{-1}$ in the observer's frame. The pulse broadening time is related to the scintillation bandwidth $\Delta \nu_{\rm d}$ through the uncertainty principle $2\pi \tau \Delta \nu_{\rm d} = C_1$, where $C_1 = 1$ for a homogeneous medium and $C_1=1.16$ for a Kolmogorov medium \citep{1998ApJ...507..846C}. Multipath propagation is also manifested as angular broadening, $\theta_{\rm d}$, defined as the FWHM of the scattered image of a point source. The angular and pulse broadening induced by a thin screen are related to the distance between the observer and screen, which will be discussed further in Section~\ref{sec:121102}. \indent Measurements of $\tau$, $\Delta \nu_{\rm d}$, and $\theta_{\rm d}$ can include both extragalactic and Galactic components. We use the notation $\tau_{\rm MW, d}$, $\tau_{\rm MW, h}$, and $\tau_{\rm i,h}$ to refer to scattering contributed by the Galactic disk (excluding the halo), the Galactic halo, and intervening haloes, respectively, and an equivalent notation for DM. To convert between $\Delta \nu_{\rm d}$ and $\tau$ we adopt $C_1 = 1$. Wherever we use the notation $\tau$ and $\theta_{\rm d}$ we refer to the $1/e$ delay and FWHM of the autcorrelation function that are typically measured. \subsection{Electron Density Model for the Galactic Halo}\label{sec:halomodels} Models of the Milky Way halo based on X-ray emission and oxygen absorption lines depict a dark matter halo permeated by hot ($T\sim 10^6$ K) gas with a virial radius between 200 and 300 kpc \citep[e.g.,][]{2019MNRAS.485..648P, 2020ApJ...888..105Y, 2020MNRAS.496L.106K}. Based on these models, the average DM contribution of the hot gas halo to FRBs is about 50 pc cm$^{-3}$, which implies a mean electron density $n_e \sim 10^{-4}$ cm$^{-3}$. However, the DM contribution of the Milky Way halo is still not very well constrained. \cite{2020MNRAS.496L.106K} compare the range of $\DM_{\rm MW,h}$ predicted by various halo models with the XMM-Newton soft X-ray background \citep{2013ApJ...773...92H} and find that the range of $\DM_{\rm MW,h}$ consistent with the XMM-Newton background spans over an order of magnitude and could be as small as about 10 pc cm$^{-3}$. Using a sample of DMs from 83 FRBs and 371 pulsars, \cite{2020ApJ...895L..49P} place a conservative upper limit on $\widehat{\DM}_{\rm MW, h}<123$ pc cm$^{-3}$, with an average value of $\widehat{\DM}_{\rm MW, h} \approx 60$ pc cm$^{-3}$. \indent Most models of the hot gas halo adopt a spherical density profile, but \cite{2020ApJ...888..105Y} and \cite{2020NatAs.tmp..214K} argue that a disk component with a scale height of about 2 kpc and a radial scale length of about 5 kpc should be added to the spherical halo based on the directional dependence of emission measure found in Suzaku and HaloSat X-ray observations \citep{2018ApJ...862...34N, 2020NatAs.tmp..214K}. In such a combined disk-spherical halo model, the disk would account for most of the observed X-ray emission attributed to the halo, while the diffuse, extended, spherical halo contains most of the baryonic mass. \cite{2020NatAs.tmp..214K} also suggest that significant, patchy variations may exist in the halo gas on scales $\sim400$ pc. The physical scales of the disk models fit to these recent X-ray observations are similar to the spatial scale of the warm ionized medium in the Galactic disk, and several orders of magnitude smaller than the spatial scales ($\sim 100$s of kpc) typical of spherical halo models. Whether such a disk component should really be attributed to the circumgalactic medium and not to the ISM of the Galactic disk is unclear. \indent \deleted{We adopt a fiducial model for the halo's density profile based on} \added{We use} the \citeauthor{2019MNRAS.485..648P} (PZ19) modified Navarro-Frenk-White (mNFW) profile \added{to model the halo density}. The mNFW profile adjusts the NFW profile's matter density cusp at the Galactic center with a more physical roll-off, giving a matter density of \begin{equation} \rho(y) = \frac{\rho_0}{y^{1-\alpha}(y_0 + y)^{2+\alpha}}, \end{equation} \deleted{where $y = K_c(r/r_{200})$} \added{where $y = K_c\times(r/r_{200})$}, $r$ is radial distance from the Galactic center, and $r_{200}$ is the virial radius within which the average density is 200 times the cosmological critical density. The characteristic matter density $\rho_0$ is found by dividing the total mass of the halo by the volume within the virial radius. The concentration parameter $K_c$ depends on the galaxy mass; e.g., $K_c = 7.7$ for a total Milky Way halo mass $M = 1.5 \times 10^{12} M_\odot$, and can range from $K_c = 13$ for $M = 10^{10} M_\odot$ to $K_c = 5$ for $M = 10^{14} M_\odot$ for redshifts $z<0.1$ \citep{1997ApJ...490..493N}. Like PZ19, we assume that $75\%$ of the baryonic matter in a galaxy is in the halo ($f_{\rm b} = 0.75$), and the fraction of the total matter density that is baryonic is $\Omega_{\rm b}/\Omega_{\rm m} $, the ratio of the baryonic matter density to the total matter density ($\Omega_{\rm b}/\Omega_{\rm m} = 0.16$ today). If $f_{\rm b}$ is smaller, then the electron density and the predicted scattering from a halo will be smaller. \indent The electron density profile of the halo is \deleted{$n_e(r) = f_{\rm b}(\Omega_{\rm b}/\Omega_{\rm m})\rho(r)\frac{\mu_{\rm e}}{m_{\rm p} \mu_{\rm H}}U(r)$} \added{\begin{equation}\label{eq:neh} n_e(r) \approx 0.86f_{\rm b}\times(\Omega_{\rm b}/\Omega_{\rm m})\frac{\rho(r)}{m_{\rm p}}U(r),\end{equation}} \deleted{where $\mu_{\rm e} = 1.12$ for fully ionized hydrogen and helium, $\mu_{\rm H} = 1.3$, and $m_{\rm p}$ is the proton mass. The function $U(r) = (1/2)\{1-{\rm tanh}[(r-r_c)/w]\}$ imposes a physical roll-off at a characteristic radius $r_c$ with a width set by $w$. Previous studies often implicitly assumed a physical boundary at the virial radius when integrating $n_e$ to obtain $\DM_{\rm MW,h}$, despite the fact that $\rho(r)$ extends well beyond the virial radius. Nonetheless, most of the halo gas likely lies within a few times the virial radius, so we set $r_c = 2r_{200} \approx 480$ kpc and $w = 20$ kpc. A comparison of our halo density profile with the PZ19 model, evaluated for the Milky Way, is shown in Figure~\ref{fig:halomod}.} \added{where $m_p$ is the proton mass and we have assumed a gas of fully ionized hydrogen and helium. The function $U(r) = (1/2)\{1-{\rm tanh}[(r-r_c)/w]\}$ imposes an explicit integration limit at a radius $r_c = 2r_{200}$ over a region of width $w = 20$ kpc so as to avoid sharp truncation of the model. Our implementation of the PZ19 model, evaluated for the Milky Way, is shown in Figure~\ref{fig:halomod}.} \begin{figure} \centering \includegraphics[width=0.47\textwidth]{halomod.pdf} \caption{Electron density model and resulting DM contribution of the Milky Way halo, for an observer 8 kpc from the Galactic center. The modified NFW profile of \cite{2019MNRAS.485..648P} for $\alpha = y_0 = 2$ is shown in orange, and our \replaced{adaptation}{implementation} of the PZ19 model is shown in blue. The maximum DM contribution of the halo predicted by the model is 63 pc cm$^{-3}$, similar to the predictions of other halo density models for lines of sight to the Galactic anti-center \citep[e.g.,][]{2020ApJ...895L..49P, 2020ApJ...888..105Y,2020MNRAS.496L.106K}.} \label{fig:halomod} \end{figure} \subsection{Scattering from the Galactic Halo} \indent Generally speaking, scattering from the Galactic halo traces the same plasma that gives rise to dispersion, weighted by the fluctuation parameter $\widetilde{F}$. To constrain $\widetilde{F}$ from measurements of $\tau$ and $\theta_{\rm d}$, we approximate the total scattering as a sum of two components: one from the disk and spiral arms of the Milky Way, which we denote with the subscript ($\rm MW,d$), and one from the Galactic halo, which we denote with the subscript ($\rm MW,h$). The total $\tau$ and $\theta_{\rm d}$ predicted by the model are therefore \begin{equation} \tau_{\rm MW}^{\rm total} = \tau_{\rm MW,d} + \tau_{\rm MW,h} \end{equation} and \begin{equation} \theta_{\rm d,MW}^{\rm total} = \sqrt{\theta_{\rm MW,d}^2 + \theta_{\rm MW,h}^2}. \end{equation} We adopt the NE2001 predictions for the $\rm MW$ components and model the halo components using Equations~\ref{eq:taudmnu} and~\ref{eq:ds}. The composite parameter $A_\tau(\widetilde{F} \times {\rm DM}^2)_{\rm MW,h}$ is constrained by maximizing the likelihood function \begin{equation}\label{eq:Like} \mathcal{L}((\widetilde{F} \times {\rm DM}^2)_{\rm MW,h} | \tau_j) = \prod_j N(\tau_{j,\rm MW}^{\rm total} - \tau_j^{\rm obs}, \sigma_{\tau,j}^2) \end{equation} using measurements $\tau^{\rm obs}$ and $\theta_{\rm d}^{\rm obs}$. The variance of the likelihood function $\sigma_{\tau_j}^2$ is taken from the measurement uncertainties, where we implicitly assume that measurements of $\tau$ and $\theta_{\rm d}$ are sufficiently approximated by Gaussian PDFs. An estimate of $\widetilde{F}_{\rm MW,h}$ can then be obtained by assuming a given halo density profile or constructing a PDF for $\DM_{\rm MW,h}$, and adopting a value for $A_\tau$. \section{The Milky Way Halo} \indent In order to determine how the Milky Way halo (and in turn other galaxy haloes) contributes to the scattering of FRBs, we must constrain the scattering contribution of the Galactic disk. In the following sections, we first determine the amount of scattering that can occur in the thick disk of the Galaxy using the distribution of pulsar scattering measurements and DMs at high Galactic latitudes. We then compare the scattering measurements of FRB 121102 and FRB 180916 to the scattering expected from the Galactic disk using NE2001, and explain discrepancies between the scattering predictions of the NE2001 and YMW16 Galactic disk models. Finally, in Section~\ref{sec:halo}, we constrain the scattering contribution of the Galactic halo, followed by discussion of scattering constraints from pulsars in the Magellanic Clouds. \subsection{Scattering from the Thick Disk}\label{sec:disk} Most currently known FRBs lie at high Galactic latitudes, and their LoS through the Galaxy predominantly sample the thick disk, which has a mean density at mid-plane of 0.015 cm$^{-3}$ and a scale height $\approx 1.6$ kpc \citep{2020ApJ...897..124O}. The distribution of $\tau/{\rm DM}^2$ for Galactic pulsars with measurements of $\tau$ \citep[][and references therein]{2016arXiv160505890C} and {\rm DM}\ and other parameters from \citet{2005AJ....129.1993M}\footnote{\url{http://www.atnf.csiro.au/research/pulsar/psrcat}} yields a direct constraint on $\widetilde{F}$: $\tau/{\rm DM}^2 \approx (16 \hspace{0.05in} {\rm ns})A_\tau\widetilde{F}$, for $\nu = 1$ GHz and $G_{\rm scatt} = 1/3$ for sources embedded in the scattering medium. The distribution of $\widetilde{F}$ for all Galactic pulsars, assuming $A_\tau\approx1$, is shown in Figure~\ref{fig:taudmb}. For the pulsars above $|20|^\circ$ Galactic latitude, the mean value of $\tau/{\rm DM}^2$ from a logarithmic fit is $(5.3^{+5.0}_{-3.3})\times10^{-8}$ ms pc$^{-2}$ cm$^{6}$, which yields $\widetilde{F} \approx (3\pm2)\times10^{-3}$ pc$^{-2/3}$ km$^{-1/3}$. The value of $\widetilde{F}$ based on high-latitude pulsars is consistent with the related $F = l_i^{1/3} \widetilde{F}$ factor used in the NE2001 model for scattering in the thick disk. \indent A structural enhancement to radio scattering for LoS below $|20|^\circ$ is reflected in the distribution of $\tau/{\rm DM}^2$ shown in Figure~\ref{fig:taudmb}, which shows a multiple orders of magnitude increase in $\widetilde{F}$ at low latitudes, with the largest values of $\widetilde{F}$ dominating LoS to the Galactic center. This latitudinal and longitudinal dependence of $\widetilde{F}$ is directly responsible for the ``hockey-stick" relation between $\tau$ and DM for Galactic pulsars, in which high-DM pulsars lying close to the Galactic plane and towards the Galactic center have a much steeper dependence on ${\rm DM}$ than pulsars lying high above the Galactic plane or towards the Galactic anti-center \citep[e.g.,][]{2004ApJ...605..759B, 2015ApJ...804...23K, 2016arXiv160505890C}. The implications of the directional dependence of $\widetilde{F}$ for FRB LoS are discussed further in Section~\ref{sec:ymw16}. \indent For the many FRBs in high Galactic latitude directions, the Galactic disk has a virtually undetectable contribution to the observed pulse broadening. The DM contribution of the thick disk is about ($23.5 \times {\rm csc}(|b|)$) pc cm$^{-3}$, which varies negligibly with longitude for $|b|>20^\circ$ \citep{2020ApJ...897..124O}. The pulse broadening at 1 GHz expected from the thick disk therefore ranges from $\tau < 0.25$ $\mu$s at $|b|=20^\circ$ to $\tau < 29$ ns at $|b| = 90^\circ$. As discussed in the following section, scattering from the Galactic thin disk and spiral arms increases dramatically for FRB LoS close to the Galactic plane. \begin{figure} \centering \includegraphics[width=0.47\textwidth]{taudm.pdf} \caption{The distribution of $\tau/{\rm DM}^2$ (which is directly proportional to $\widetilde{F}$) versus Galactic latitude for all Galactic pulsars, with $\tau$ in ms referenced to 1 GHz and DM in pc cm$^{-3}$. The average value and root-mean-square of the distribution for all pulsars above $\pm 20^\circ$ latitude is shown in blue. Pulsars closer to the Galactic center ($|b|<10^\circ$, $|l|<40^\circ$) are \replaced{highlighted in black}{shown as orange crosses}.} \label{fig:taudmb} \end{figure} \subsection{Scattering Constraints for Two FRB Case Studies}\label{sec:frbs} Unlike Galactic pulsars, for which the scintillation bandwidth and pulse broadening both result from the same electrons and conform to the uncertainty relation $2\pi\Delta\nu_{\rm d}\tau_{\rm d} = C_1$, some FRBs indicate that two \added{scattering} media are involved. \deleted{The scintillation bandwidth is caused by} \added{In these cases, the scintillation bandwidth is consistent with diffractive interstellar scintillation caused by} foreground Galactic turbulence while \added{the} pulse broadening \deleted{is extragalactic in origin, most likely from the host galaxy} \added{also has contributions from an extragalactic scattering medium \citep{ 2015Natur.528..523M, 2018ApJ...863....2G, 2019ARA&A..57..417C}}. Here we analyze the Galactic scintillations of two FRBs \added{with highly precise scattering measurements} in order to place constraints on any scattering in the Galactic halo. \subsubsection{FRB 121102}\label{sec:121102} \begin{figure} \centering \includegraphics[width=0.47\textwidth]{FRB121102_DISSBW_binned.pdf} \caption{Scintillation bandwidth vs. radio frequency for FRB 121102. The blue line and shaded region designates the least-squares fit and errors of ${\rm log}(\Delta \nu_{\rm d})$ vs. $\rm log(\nu)$. The green and orange lines are anchored to the lowest frequency point with the indicated frequency dependences. The corresponding pulse broadening time is shown on the right-hand axis assuming $\tau = 1/(2\pi\Delta \nu_{\rm d})$. Data points are from \cite{2019ApJ...876L..23H}, \cite{2018Natur.553..182M}, \cite{2018ApJ...863..150S}, and \cite{2018ApJ...863....2G}.} \label{fig:dissbw} \end{figure} FRB 121102 currently has the most comprehensive set of scattering constraints on an FRB source so far, with scintillation bandwidths $\Delta \nu_{\rm d} = 58.1 \pm 2.3$ kHz at 1.65 GHz \citep{2019ApJ...876L..23H}, 5 MHz at 4.5 GHz \citep{2018Natur.553..182M}, $6.4\pm1.4$ MHz at 4.85 GHz \citep{2018ApJ...863..150S}, and $10-50$ MHz between 5 and 8 GHz \citep{2018ApJ...863....2G}. All of these scintillation bandwidth measurements are assembled in Figure~\ref{fig:dissbw}, along with a power-law fit to the data using linear least squares that gives a mean value $\Delta \nu_{\rm d} = 3.8^{+2.5}_{-1.5}$ kHz at 1 GHz. \indent FRB 121102 also has a pulse broadening time upper limit of $\tau < 9.6$ ms at 500 MHz \citep{2019ApJ...882L..18J}, and angular broadening $\theta_{\rm d} = 2\pm 1$ mas at 1.7 GHz and $\theta_{\rm d} \sim 0.4-0.5$ mas at 5 GHz, which was measured in the \cite{2017ApJ...834L...8M} high-resolution VLBI study of the FRB and its persistent radio counterpart. These angular diameters are consistent with those reported in \cite{2017Natur.541...58C} and with the NE2001 prediction. The scattering measurements are shown in Table~\ref{tab:measures} and are referenced to 1 GHz assuming a $\tau \propto \nu^{-4}$ frequency scaling. \indent The NE2001 angular broadening and scintillation bandwidth predictions for FRB 121102 are broadly consistent with the corresponding empirical constraints (see Table~\ref{tab:measures}). In NE2001, the scattering for this LoS is dominated by an outer spiral arm located 2 kpc away and by the thick disk, which extends out to 17 kpc from the Galactic center \citep{2002astro.ph..7156C}. The ${\rm C_n^2}$, electron density, and DM predicted by NE2001 along the LoS to FRB 121102 are shown in Figure~\ref{fig:ne2001}. Modeling of the anti-center direction in NE2001 is \added{independent of our analysis and is} based on DM and scattering measurements of \added{Galactic} pulsars in the same general direction and upper bounds on the angular scattering of extragalactic sources. The \added{NE2001} model parameters were constrained through a likelihood analysis of these measurements, which revealed that the fluctuation parameter was smaller for LoS that probe the outer Galaxy compared to the inner Galaxy \citep{1998ApJ...497..238L}. This result required that the thick disk component of NE2001 have a smaller fluctuation parameter compared to the thin disk and spiral arm components that are relevant to LoS through the inner Galaxy. \indent Since the measured $\Delta \nu_{\rm d}$ and $\theta_{\rm d}$ for FRB 121102 are broadly consistent with the predicted amount of scattering from the Galactic disk, we use $\Delta \nu_{\rm d}$ and $\theta_{\rm d}$ to estimate the effective distance to the dominant scattering material. For thin-screen scattering of a source located at a distance $d_{\rm so}$ from the observer, the scattering diameter $\theta_{\rm s}$ is related to the observed angular broadening by \begin{equation} \theta_{\rm d} \sim \theta_{\rm s} ( d_{\rm sl} / d_{\rm so}) = \theta_s \bigg(1 - \frac{d_{\rm lo}}{d_{\rm so}}\bigg), \end{equation} where $d_{\rm sl}$ is the source-to-screen distance and $d_{\rm lo}$ is the screen-to-observer distance. The scattering diameter is related to the pulse broadening delay by $\tau \approx A_\tau d_{\rm so}(d_{\rm sl}/d_{\rm so})(1-d_{\rm sl}/d_{\rm so})\theta_{\rm s}^2/8 ({\rm ln} 2)c$ \citep{2019ARA&A..57..417C}. For a thin screen near the observer and an extragalactic source, $d_{\rm lo} \ll d_{\rm sl}$, giving $\theta_{\rm d} \approx \theta_{\rm s}$ and \begin{equation}\label{eq:ds} \theta_{\rm d} \approx \left(\frac{4({\rm ln}2) A_\tau C_1 c}{ \pi \Delta \nu_{\rm d} d_{\rm lo}} \right)^{1/2}. \end{equation} The scattering screen location can thus be directly estimated from measurements of $\theta_{\rm d}$ and $\Delta \nu_{\rm d}$. \indent Assuming that the same Galactic scattering material gives rise to both the angular broadening and the scintillation of FRB 121102, Equation~\ref{eq:ds} implies the scattering material has an effective distance $\hat{d}_{\rm lo} \approx 2.3$ kpc from the observer (assuming $A_\tau \approx 1$), which is consistent with the distance to the spiral arm, as shown in Figure~\ref{fig:ne2001}. A numerical joint-probability analysis of the uncertainties in $\Delta \nu_{\rm d}$ and $\theta_{\rm d}$, assuming both quantities follow normal distributions, allows the screen to be as close as 1.6 kpc or as far as 5.5 kpc (corresponding to the 15$\%$ and 85$\%$ confidence intervals). Figure~\ref{fig:thetad} shows a comparison of the relationship between $\theta_{\rm d}$ and $d_{\rm lo}$ for a thin screen and the measured $\theta_{\rm d}$ from \cite{2017ApJ...834L...8M}. Given that there is no known HII region along the LoS to FRB~121102, the most likely effective screen is in fact the spiral arm. \indent The scintillation bandwidth implies a pulse broadening contribution from the Milky Way disk and spiral arms $\tau_{\rm MW,d} \approx 0.04 \pm 0.02$ ms at 1 GHz. The upper limit on $\tau$ measured by \cite{2019ApJ...882L..18J} is an order of magnitude larger than the $\tau_{\rm MW,d}$ inferred from $\Delta \nu_{\rm d}$. Any additional scattering beyond the Galactic contribution is more likely from the host galaxy due to the lack of intervening galaxies along the LoS, and the small amount of scattering expected from the IGM \citep{2013ApJ...776..125M, 2020arXiv201108519Z}. \begin{figure} \centering \includegraphics[width=0.5\textwidth]{DM_vs_d_NE2001p_l_b_dm_174.95_-0.22_188.33012280240598.pdf} \caption{Galactic DM, electron density $n_e$, and ${\rm C_n^2}$ contribution predicted by NE2001 for FRB 121102. The maximum DM (excluding the Galactic halo) is 188 pc cm$^{-3}$. The sharp changes in $n_e$ and ${\rm C_n^2}$ between 0 and 0.3 kpc are due to structure in the local ISM. The shaded grey region indicates the distance to the scattering screen derived from a numerical joint-probability analysis of the measured scattering constraints for FRB~121102; see Figure~\ref{fig:thetad}.} \label{fig:ne2001} \end{figure} \begin{figure} \centering \includegraphics[width=0.47\textwidth]{FRB121102_thetad_screen_constraint.pdf} \caption{Scattering diameter vs. effective distance. The blue band indicates the angular diameter $\theta_{\rm d} = 2\pm1$ mas (1$\sigma$ errors) from \cite{2017ApJ...834L...8M}. The green band is the predicted angular diameter for a thin-screen that matches the least-square fit to scintillation bandwidth measurements and the uncertainties at $\pm1\sigma$. All values are expressed at 1.7 GHz. A numerical joint-probability estimate constraining the overlap of the green and blue regions gives a screen distance $\hat{d}_{\rm lo} \approx 2.3^{+3.2}_{-0.7}$ kpc. } \label{fig:thetad} \end{figure} \begin{deluxetable*}{c c c c c c }\label{tab:measures} \tablecaption{DM and Scattering Referenced to 1 GHz of FRB 121102 and FRB 180916} \tablewidth{0pt} \tablehead{\multicolumn{6}{c}{Measurements} \\ \hline \colhead{FRB} & \colhead{DM (pc cm$^{-3}$)} & \colhead{$\tau$ (ms)$^{(1, 2)}$} & $\Delta \nu_{\rm d}$ (kHz)$^{(3,4)}$ & \colhead{$\theta_{\rm d}$ (mas)$^{(5)}$} & \colhead{$\hat{d}_{\rm lo}$ (kpc)}} \startdata 121102 & $557$ & $<0.6$ & $3.8^{+2.5}_{-1.5}$ & $5.8 \pm 2.9$ & $2.3^{+3.2}_{-0.7}$ \\ 180916 & $349$ & $<0.026$ & $7.1\pm1.5$& \nodata & \nodata \\ \hline \hline \multicolumn{6}{c}{Models}\\ \hline FRB & DM (pc cm$^{-3}$) & $\tau$ (ms) & $\Delta \nu_{\rm d}$ (kHz) & $\theta_{\rm d}$ (mas) & $d_{\rm lo}$ (kpc) \\ \hline \multicolumn{6}{c}{NE2001}\\ \hline 121102 & $188$ & $0.016$ & $11$ & $6$ & $2.05$ \\ 180916 & $199$ & $0.015$ & $12$ & $5$ & $2.5$\\ \hline \multicolumn{6}{c}{YMW16}\\ \hline 121102 & $287$ & $0.84$ & $0.2$ & \nodata & \nodata \\ 180916 & $243$ & $0.42$ & $0.4$ & \nodata & \nodata \\ \enddata \tablecomments{The top of the table shows the observed DM and scattering for FRB 121102 and FRB 180916. Since the scintillation and angular broadening measurements are broadly consistent with Galactic foreground predictions by NE2001, we emphasize that they are Galactic, whereas the pulse broadening may have an extragalactic contribution from the host galaxy. The scattering measurements are referenced to 1 GHz assuming $\tau \propto \nu^{-4}$ unless otherwise noted.\\ \indent The bottom of the table shows the asymptotic DM and scattering predictions of NE2001 and YMW16. NE2001 adopts $C_1 = 1.16$ to convert between $\Delta \nu_{\rm d}$ and $\tau$, so we also use this value to calculate $\Delta \nu_{\rm d}$ from $\tau$ for YMW16. YMW16 predictions were calculated in the IGM mode, but we only report the Galactic component of DM predicted by the model for comparison with NE2001.\\ \indent References: (1) \cite{2019ApJ...882L..18J}; (2) \cite{2020ApJ...896L..41C}; (3) this work (see Figure~\ref{fig:dissbw}; referenced to 1 GHz using a best-fit power law); (4) \cite{2020Natur.577..190M}; (5) \cite{2017ApJ...834L...8M}.} \end{deluxetable*} \subsubsection{FRB 180916}\label{sec:180916} The scattering constraints for FRB 180916 consist of a scintillation bandwidth $\Delta \nu_{\rm d} = 59 \pm 13$ kHz at 1.7 GHz \citep{2020Natur.577..190M} and a pulse broadening upper limit $\tau < 1.7$ ms at 350 MHz \citep{2020ApJ...896L..41C}. The $\Delta \nu_{\rm d}$ and $\tau$ upper limit are entirely consistent with each other, so we again use $\Delta \nu_{\rm d}$ and the inferred $\tau_{\rm MW,d}$ for the rest of the analysis due to its higher precision. Based on $\Delta \nu_{\rm d}$, $\tau_{\rm MW,d} = 0.023\pm0.005$ ms at 1 GHz. As with FRB 121102 the NE2001 scattering predictions for this LoS are consistent with the empirical constraints to within the model's uncertainty, suggesting that the Galactic halo has a small ($\lesssim \mu$s level) contribution to the observed scattering. \subsubsection{Comparison with YMW16 Scattering Predictions}\label{sec:ymw16} The YMW16 model significantly overestimates the scattering of FRB 121102 and FRB 180916. The DM and scattering predictions for these FRBs are shown in Table~\ref{tab:measures}. Evaluating YMW16 for FRB 121102 using the \texttt{IGM} mode gives \replaced{$\log(\tau)=-3.012$}{$\log(\tau)=-3.074$} with $\tau$ in seconds, implying $\tau = 0.84$~ms at 1~GHz, corresponding to $\Delta \nu_{\rm d} \approx 0.2$~kHz, about 50 times smaller than the NE2001 value. Compared to the measured scattering, the nominal output of the YMW16 model overestimates the scattering \added{toward FRB 121102} by a factor of 28 to 35 (depending on whether a $\nu^{-4}$ or $\nu^{-4.4}$ scaling is used). Moreover, combining the measured $\theta_{\rm d}$ with the YMW16 estimate for $\tau$ implies a scattering screen distance $\sim 500$ kpc, beyond any local Galactic structure that could reasonably account for the scattering. For FRB 180916, YMW16 also overestimates $\tau$ to be 0.42~ms at 1~GHz, implying a scintillation bandwidth of 0.4~kHz at 1~GHz. \indent The discrepancies between the observed scattering and the YMW16 predictions are due to several important factors. Unlike NE2001, YMW16 does not explicitly model electron density fluctuations. Instead, it calculates DM for a given LoS and then uses the $\tau-{\rm DM}$ relation based on Galactic pulsars to predict $\tau$. In using the $\tau-{\rm DM}$ relation, the YMW16 model incorrectly adjusts for the scattering of extragalactic bursts. The waves from extragalactic bursts are essentially planar when they reach the Galaxy, \deleted{which means that the Galactic plasma will scatter them more than it would the spherical waves from a Galactic pulsar at a distance of a few scale lengths of the electron density} \added{which means they are scattered from wider angles than diverging spherical waves from a Galactic pulsar would be}. The differences between plane and spherical wave scattering are discussed in detail for FRBs in \cite{2016arXiv160505890C}. The YMW16 model accounts for this difference by reducing the Galactic prediction of $\tau$ by a factor of two, when \added{geometric weighting of the mean-square scattering angle implies that} the \added{Galactic} scattering \added{prediction} should really be larger by a factor of three \added{to apply to extragalactic FRBs (see Eq.~10 in \citealt{2016arXiv160505890C})}. This implies that values for $\tau$ in the output of YMW16 should be multiplied by a factor of six, which means that the model's overestimation of the scattering is really by a factor of 170 to 208 when one only considers the correction for planar wave scattering. \indent YMW16 may also overestimate the Galactic contribution to DMs of extragalactic sources viewed in the Galactic anti-center direction (and perhaps other low-latitude directions) because it significantly overestimates the observed DM distribution of Galactic pulsars that NE2001 is based on. In YMW16, the dominant DM contributions to extragalactic sources in this direction are from the thick disk and from the spiral arms exterior to the solar circle. Together these yield DM values of 287 pc cm$^{-3}$\ and 243 pc cm$^{-3}$\ for FRB~121102 and FRB~180916, respectively. These DM predictions are over $50\%$ and $20\%$ larger for each FRB than the NE2001 values, which may be due to overestimation of the densities or characteristic length scales of the outer spiral arm and thick disk components. \indent The primary cause for YMW16's scattering over-prediction is that the part of the pulsar-derived $\tau-{\rm DM}$ relation that applies to large values of DM should not be used for directions toward the Galactic anti-center. The $\tau-{\rm DM}$ relation has the empirical form \citep{2016arXiv160505890C} \begin{equation} \tau = (2.98\times10^{-7}\ {\rm ms})\, {\rm DM}^{1.4}(1+3.55\times10^{-5}{\rm DM}^{3.1}) \label{eq:taud_vs_DM} \end{equation} based on a fit to pulsar scattering data available through 2016. Similar fits were previously done by \cite{1997MNRAS.290..260R}, \cite{2004ApJ...605..759B}, and \cite{2015ApJ...804...23K}. It scales as ${\rm DM}^{1.4}$ for ${\rm DM} \lesssim 30$ pc cm$^{-3}$ and as ${\rm DM}^{4.5}$ for ${\rm DM} \gtrsim 100$ pc cm$^{-3}$. \indent The YMW16 model uses Krishnakumar's model for 327~MHz scattering times scaled to 1~GHz by a factor $(0.327)^4$, giving $\tau = (4.1\times10^{-8}\ {\rm ms})\ {\rm DM}^{2.2}(1+0.00194\times{\rm DM}^{2})$. This scaling law is in reasonable agreement with the expression in Equation~\ref{eq:taud_vs_DM} except at very low DM values. The Krishnakumar scaling law adopted the \cite{1997MNRAS.290..260R} approach of fixing the leading DM exponent to 2.2, which is based on the assumption that the relatively local ISM is uniform. This assumption is imperfect given our knowledge of the Local Bubble and other shells and voids in the local ISM. The steep $\tau\propto {\rm DM}^{4.2 \ {\rm to }\ 4.5}$ scaling for Galactic pulsars is from LoS that probe the inner Galaxy, where the larger star formation rate leads to a higher supernova rate that evidently affects the turbulence in the HII gas, and results in a larger $\widetilde{F}$, as shown in Section~\ref{sec:disk}. \indent If the YMW16 model were to use instead the shallow part of the $\tau-{\rm DM}$ relation, $\tau\propto {\rm DM}^{2.2 \ {\rm to} \ 1.4}$, which is more typical of LoS through the outer Galaxy, its scattering time estimates would be smaller by a factor of $\sim 1.94\times 10^{-3} \times (287)^{2} \sim 160$ or $\sim 3.55\times 10^{-5} \times (287)^{3.1} \sim 1500$, depending on which $\tau-{\rm DM}$ relation is used (and using FRB 121102 as an example). These overestimation factors could be considerably smaller if smaller DM values were used. While there is a considerable range of values for the overestimation factor based on the uncertainties in the empirical scaling law, it is reasonable to conclude that the high-DM part of the $\tau-{\rm DM}$ relation should not be used for the anti-center FRBs. \subsection{Fluctuation Parameter of the Galactic Halo}\label{sec:halo} The measurements of $\tau$ and $\theta_{\rm d}$ for FRBs 121102 and 180916, combined with the scattering predictions of NE2001, yield a maximum likelihood estimate for the pulse broadening contribution of the Milky Way halo (see Equation~\ref{eq:Like}). \deleted{The likelihood function is shown in Figure~6. The likelihood function is positive for values of $(\widetilde{F} \times {\rm DM}^2)_{\rm MW,h}$ extending to zero because the measured scattering from both FRBs is close enough to the NE2001 predictions that the halo could have a negligible scattering contribution.} The $95\%$ upper confidence interval yields $(\widetilde{F} \times {\rm DM}^2)_{\rm MW,h} < 250/A_\tau$ pc$^{4/3}$ km$^{-1/3}$ cm$^{-1/3}$. The maximum amount of pulse broadening expected from the Galactic halo is therefore $\tau_{\rm MW,h} < 12$ $\mu$s at 1 GHz, which is comparable to the scattering expected from the Galactic disk for LoS towards the Galactic anti-center or at higher Galactic latitudes. \indent Based on \deleted{a meta-analysis of} the broad range of $\DM_{\rm MW,h}$ currently consistent with the empirical and modeled constraints (see Section~\ref{sec:halomodels}), we construct a Gaussian probability density function (PDF) for $\widehat{{\rm DM}}_{\rm MW,h}$ with a mean of 60 pc cm$^{-3}$\ and $\sigma_{\rm \widehat{DM}} = 18$ pc cm$^{-3}$ \deleted{, which is shown in Figure~6}. \added{Combining} this PDF \added{with the maximum likelihood estimate for $(\widetilde{F} \times {\rm DM}^2)_{\rm MW,h}$} yields an upper limit $\widetilde{F}_{\rm MW,h} < 0.03/A_\tau$ pc$^{-2/3}$ km$^{-1/3}$. While $A_\tau$ is probably about 1, if $A_\tau$ is as small as $1/6$ then $\widetilde{F}_{\rm MW,h}$ could be up to 6 times larger. \indent \added{This estimate of $\widetilde{F}_{\rm MW,h}$ is based on just two LoS towards the Galactic anti-center, and it is unclear how much $\widetilde{F}_{\rm MW,h}$ will vary between different LoS through the halo. Given that sources viewed through the inner Galaxy (near $b = 0^\circ$) are more heavily scattered, it is unlikely that estimates of $\widetilde{F}_{\rm MW,h}$ will be obtainable for LoS that intersect the halo through the inner Galaxy. However, FRB 121102, FRB 180916, and most of the FRBs detected at higher latitudes do not show evidence of any intense scattering regions that might be associated with the halo \citep[e.g.,][]{2020MNRAS.497.1382Q}, suggesting that extremely scattered FRBs would be outliers and not representative of the Galactic halo's large-scale properties. All FRBs are ultimately viewed through not only the Galactic halo but also the haloes of their host galaxies and, in some cases, the haloes of intervening galaxies. Given the observed variations in scattering between different LoS through the Milky Way, it appears most likely that the heaviest scattered FRBs will be viewed through scattering regions within galaxy disks rather than haloes, and extrapolating our analysis to a larger sample of FRBs will require determining whether observed variations in $\widetilde{F}$ are due to variations between galaxy haloes, disks, or the sources' local environments.} In the following sections, we compare the Milky Way halo scattering contribution \added{inferred from FRBs 121102 and 180916} to scattering observed from the Magellanic Clouds and galaxy haloes intervening LoS to FRBs. \subsection{Constraints from Pulsars in the Magellanic Clouds}\label{sec:MCs} At distances of 50 to 60 kpc and latitudes around $-30^\circ$, pulsar radio emission from the Large and Small Magellanic Clouds (LMC/SMC) mostly samples the Galactic thick disk and a much smaller path length through the Galactic halo than FRBs. So far, twenty-three radio pulsars have been found in the LMC and seven in the SMC \citep[e.g.,][]{1991MNRAS.249..654M,2001ApJ...553..367C,2006ApJ...649..235M, 2013MNRAS.433..138R, 2019MNRAS.487.4332T}. Very few scattering measurements exist for these LoS. PSR B0540$-$69 in the LMC has a DM of 146.5 pc cm$^{-3}$\ and was measured to have a pulse broadening time $\tau = 0.4$ ms at 1.4 GHz \citep{2003ApJ...590L..95J}. The Galactic contribution to DM and scattering predicted by NE2001 towards this pulsar are ${\rm DM}_{\rm NE2001} = 55$ pc cm$^{-3}$, and $\tau_{\rm NE2001} = 0.3\times10^{-3}$ ms at 1 GHz. Based on this DM estimate, the pulsar DM receives a contribution of about $92$ pc cm$^{-3}$\ from the LMC and the Galactic halo. The lowest DMs of pulsars in the LMC have been used to estimate the DM contribution of the halo to be about 15 pc cm$^{-3}$\ for pulsars in the LMC \citep{2020ApJ...888..105Y}, which suggests that the LMC contributes about 77 pc cm$^{-3}$\ to the DM of B0540$-$69. \indent The scattering observed towards B0540$-$69 is far in excess of the predicted scattering from the Galactic disk. Since B0540$-$69 not only lies within the LMC but also within a supernova remnant, it is reasonable to assume that most of the scattering is contributed by material within the LMC. Using the upper limit $\widetilde{F}_{\rm MW,h} < 0.03/A_\tau$ pc$^{-2/3}$ km$^{-1/3}$\ and $\widehat{{\rm DM}}_{\rm MW,h} = 15$ pc cm$^{-3}$\ yields $\tau_{\rm MW,h} < 0.1$ $\mu$s at 1.4~GHz for this LoS, which is too small to explain the observed scattering. If we instead combine $\tau = 0.4$ ms at 1.4~GHz and the estimated $\widehat{{\rm DM}}_{\rm LMC} = 77$ pc cm$^{-3}$, \added{we find $\widetilde{F}_{\rm LMC} \approx 16/A_\tau$} \deleted{$\widetilde{F}_{\rm LMC} \approx 4.2/A_\tau$} pc$^{-2/3}$ km$^{-1/3}$. More scattering measurements for LMC and SMC pulsars are needed to better constrain the fluctuation parameters of the LMC and SMC, which in turn will improve our understanding of interstellar plasma in these satellite galaxies. \section{Constraints on Intervening Haloes along Lines of Sight to FRBs}\label{sec:conc} As of this paper, two FRBs are found to pass through galactic haloes other than those of their host galaxies and the Milky Way: FRB 181112, which passes within 30 kpc of the galaxy DES J214923.89$-$525810.43, otherwise known as FG$-$181112 \citep{2019Sci...366..231P}, and FRB 191108, which passes about 18 kpc from the center of M33 and 185 kpc from M31 \citep{2020MNRAS.tmp.2810C}. Both FRBs have measurements of $\tau$ which are somewhat constraining. \subsection{FRB 181112} \indent FRB 181112 was initially found to have $\tau < 40$ $\mu$s at 1.3 GHz by \cite{2019Sci...366..231P}; follow-up analysis of the ASKAP filterbank data and higher time resolution data for this burst yielded independent estimates of $\tau < 0.55$ ms \citep{2020MNRAS.497.1382Q} and $\tau \approx 21 \pm 1$ $\mu$s \citep{2020ApJ...891L..38C} at 1.3 GHz. We adopt the last value for our analysis, with the caveat that the authors report skepticism that the data is best fit by a pulse broadening tail following the usual frequency dependence expected from scattering in a cold plasma, and that the measured decorrelation bandwidth of the burst spectrum is in tension with the pulse broadening fit (for a full discussion, see Section 4 of \citealt{2020ApJ...891L..38C}). \indent We first place an upper limit on $(\widetilde{F} \times {\rm DM}^2)_{\rm i,h}$ for FG$-$181112 by assuming that the intervening halo may contribute up to all of the observed scattering of FRB 181112. The halo density profile (Equation~\ref{eq:neh}) is re-scaled to the lens redshift ($z_{\rm i,h} = 0.36$) and evaluated at the impact parameter $R_\perp = 29$ kpc. \cite{2019Sci...366..231P} constrain the mass of the intervening halo to be $M_{\rm halo}^{\rm FG-181112} \approx 10^{12.3}M_\odot$. Again assuming a physical extent to the halo of $2r_{200}$ gives \deleted{an effective} \added{a} path length through the halo $L \approx 930$ kpc. The observed scattering $\tau \approx 21$ $\mu$s is the maximum amount of scattering that could be contributed by the halo, i.e., $\tau_{\rm i,h} < 21$ $\mu$s at 1.3 GHz, which yields $(\widetilde{F} \times {\rm DM}^2)_{\rm i,h} < 13/A_\tau$ pc$^{4/3}$ km$^{-1/3}$ cm$^{-1/3}$\ using Equation~\ref{eq:taudmnuz}. \indent Assuming the halo density profile where $y_0 = \alpha = 2$ gives $\widehat{{\rm DM}}_{\rm i,h} \approx 135$ pc cm$^{-3}$\ in the frame of the intervening galaxy. This DM estimate for the halo is similar to the estimate of $122$ pc cm$^{-3}$\ from \cite{2019Sci...366..231P}, but as they note, the DM contribution is highly sensitive to the assumed density profile and could be significantly smaller if the physical extent and/or the baryonic fraction of the halo are smaller. This DM estimate yields $\widetilde{F}_{\rm i,h} < (7\times10^{-4})/A_\tau$ pc$^{-2/3}$ km$^{-1/3}$. If the DM contribution of the intervening halo is smaller, then $\widetilde{F}_{\rm i,h}$ could be up to an order of magnitude larger. The total observed DM of the FRB is broadly consistent with the estimated DM contributions of the Milky Way, host galaxy, and IGM alone \citep{2019Sci...366..231P}, so the uncertainty in ${\rm DM}_{\rm i,h}$ remains the greatest source of uncertainty in deconstructing $(\widetilde{F} \times {\rm DM}^2)_{\rm i,h}$. Both estimates of $(\widetilde{F} \times {\rm DM}^2)_{\rm i,h}$ and $\widetilde{F}_{\rm i,h}$ for FRB 181112 are within the upper limits for the Milky Way halo. \subsection{FRB 191108} \indent FRB 191108 passes through both the M31 and M33 haloes and has a source redshift upper limit $z\lesssim0.5$ based on DM. \cite{2020MNRAS.tmp.2810C} report an upper limit of $80$ $\mu$s on the intrinsic pulse width and scattering time at 1.37 GHz, but they demonstrate that this limit is likely biased by dispersion smearing. \cite{2020MNRAS.tmp.2810C} also report $25\%$ intensity modulations at a decorrelation bandwidth $\sim 40$ MHz. This decorrelation bandwidth may be attributable to scattering in the M33 halo and/or in the host galaxy (for a full discussion, see Section 3.4 of \citealt{2020MNRAS.tmp.2810C}). \indent Re-scaling our galactic halo density profile using halo masses $M_{\rm halo}^{\rm M33} \approx 5\times10^{11}M_\odot$ and $M_{\rm halo}^{\rm M31} \approx 1.5\times10^{12}M_\odot$ yields a total DM contribution from both haloes of about 110 pc cm$^{-3}$, nearly two times larger than the DM contribution estimated by \cite{2020MNRAS.tmp.2810C}, who use a generic model for the M33 and M31 haloes from \cite{2019MNRAS.485..648P} based on the same galaxy masses. We assume that the density profiles are independent; if there are dynamical interactions between the haloes then these may slightly modify the overall density distribution along the LoS, but it is unclear how turbulence in the plasma would be affected, if at all. Since the impact parameter of 18 kpc for M33 is significantly smaller than the 185 kpc for M31, M33 dominates the predicted DM contribution to FRB 191108 (with $\widehat{{\rm DM}}_{\rm i,h} \approx 90$ pc cm$^{-3}$), and therefore is more likely than M31 to also dominate the scattering. \indent If we were to assume that $\Delta \nu_{\rm d}\approx 40$ MHz (at 1.37 GHz, which translates to $\tau \approx 4$ ns) is attributable to scattering in the M33 halo, then we get $(\widetilde{F} \times {\rm DM}^2)_{\rm i,h} \approx 0.23/A_\tau$ pc$^{4/3}$ km$^{-1/3}$ cm$^{-1/3}$\ for $z_{\rm host} = 0.5$. A smaller source redshift would increase $d_{\rm sl} d_{\rm lo}/d_{\rm so}$, resulting in an even smaller value of $(\widetilde{F} \times {\rm DM}^2)_{\rm i,h}$. For a halo DM contribution of about 90 pc cm$^{-3}$\, this estimate of $(\widetilde{F} \times {\rm DM}^2)_{\rm i,h}$ yields $\widetilde{F}_{\rm i,h} \approx (2.7\times10^{-5})/A_\tau$ pc$^{-2/3}$ km$^{-1/3}$, which is three orders of magnitude smaller than the upper limit we infer for the Milky Way halo. Using a smaller ${\rm DM}_{\rm i,h} \approx 50$ pc cm$^{-3}$\ increases $\widetilde{F}$ to $\widetilde{F}_{\rm i,h} \approx (9\times10^{-5})/A_\tau$ pc$^{-2/3}$ km$^{-1/3}$. Generally speaking, if $\widetilde{F}$ is about a factor of 10 larger, then the pulse broadening from the halo would be 10 times larger and the scintillation bandwidth 10 times smaller. On the other hand, if M31 were to contribute more significantly to the DM then $\widetilde{F}_{\rm i,h}$ would be smaller than our estimate. While there is a range of reasonable values for $\widetilde{F}_{\rm i,h}$, it appears that scattering in the M33 halo is negligible. \indent \cite{2020MNRAS.tmp.2810C} use a different approach to evaluate the scattering of FRB 191108. They estimate a scattering angle from the decorrelation bandwidth in order to obtain an estimate of the diffractive scale and rms electron density fluctuations in the halo. Making assumptions about the outer scale and the relationship between the mean density and rms density fluctuations, they find a mean electron density for the halo that is larger than expected, and conclude that if the scattering occurs in M33, then it is more likely from cool clumps of gas embedded in the hot, extended halo. \cite{2019Sci...366..231P} use a similar methodology to estimate a mean density for the halo of FG$-$181112. Rather than make an indirect estimate of $n_e$ in each halo, our analysis yields a direct constraint on $(\widetilde{F} \times {\rm DM}^2)_{\rm i,h}$ from observable quantities. The corresponding estimates of $\widetilde{F}$ are sufficient to demonstrate that very little scattering occurs \added{along either of these FRB LoS through the} galaxy haloes. Further deconstructing $\epsilon^2$, $\zeta$, and $f$ from $\widetilde{F}$ will require more information about the outer and inner scales of turbulence, which may differ from halo to halo. \begin{figure} \centering \includegraphics[width=0.47\textwidth]{Fsummary_horiz.pdf} \caption{Nominal values of $\widetilde{F}$ for different components of the Milky Way (MW), the Large Magellanic Cloud (LMC), and for the foreground galaxies of FRB 181112 and FRB 191108. The Galactic anti-center and inner galaxy values are calculated by integrating NE2001 through the entire disk in the directions $(l = 130^\circ, b = 0^\circ)$ and $(l = 30^\circ, b=0^\circ)$, respectively. The nominal $\widetilde{F}$ for each halo was calculated assuming the modeled halo DMs discussed in the text. The orange error bars indicate the maximum values of $\widetilde{F}$ for $A_\tau > 1/6$, with $A_\tau = 1$ for the black points. The green error bars indicate a range of $\widetilde{F}$ for a representative range of halo DMs (and $A_\tau = 1$). The green lower and upper bounds correspond to: $20<{\rm DM}_{\rm MW,h}<120$ pc cm$^{-3}$\ for the Galactic halo, $50<{\rm DM}_{\rm i,h}<140$ pc cm$^{-3}$\ for FG$-$181112, and $50<{\rm DM}_{\rm i,h}<120$ pc cm$^{-3}$\ for M33. For each halo, the blue bar indicates that the scattering constraints are upper limits. The blue bar for the thick disk indicates the root-mean-square error in the distribution of $\widetilde{F}$ for high Galactic latitude pulsars.} \label{fig:Fsummaryplot} \end{figure} \section{Discussion} We present a straightforward methodology for constraining the internal electron density fluctuations of galaxy haloes using FRB scattering measurements. The pulse broadening time $\tau \propto \widetilde{F} \times {\rm DM}^2$, where the fluctuation parameter $\widetilde{F}$ quantifies the amount of scattering per unit DM and is directly related to the density fluctuation statistics. We analyze two case studies, FRB 121102 and FRB 180916, and find their scattering measurements to be largely consistent with the predicted scattering from the Galactic disk and spiral arms, plus a small or negligible contribution from the Galactic halo. A likelihood analysis of their scintillation bandwidths and angular broadening places an upper limit on the product of the Galactic halo DM and fluctuation parameter $(\widetilde{F} \times {\rm DM}^2)_{\rm MW,h} < 250/A_\tau$ pc$^{4/3}$ km$^{-1/3}$ cm$^{-1/3}$, where $A_\tau$ is the dimensionless constant relating the mean scattering time to the $1/e$ time of a scattered pulse. This estimate can be used to calculate the pulse broadening delay induced by electron density fluctuations in the halo, independent of any assumptions about the electron density distribution of the Galactic halo. The upper limit on $(\widetilde{F} \times {\rm DM}^2)_{\rm MW,h}$ implies a maximum amount of pulse broadening from the Galactic halo $\tau_{\rm MW,h} < 12$ $\mu$s at 1 GHz. \indent While the DM contribution of the Milky Way halo to FRB DMs is still poorly constrained, we adopt a Gaussian PDF for the observed DM of the halo to estimate $\widetilde{F}_{\rm MW,h} < 0.03/A_\tau$ pc$^{-2/3}$ km$^{-1/3}$. We compare this to the fluctuation parameter of the Galactic thick disk using the distribution of $\tau/{\rm DM}^2$ for all Galactic pulsars at high Galactic latitudes with pulse broadening measurements. We measure the fluctuation parameter of the thick disk to be $\widetilde{F}_{\rm disk}^{\rm thick} = (3\pm2)\times10^{-3}$ pc$^{-2/3}$ km$^{-1/3}$, about an order of magnitude smaller than the halo upper limit. At high Galactic latitudes, the thick disk will only cause a scattering delay on the order of tens of nanoseconds at 1 GHz. Larger samples of FRBs and continued X-ray observations of the Galactic halo will refine our understanding of the DM contribution of the halo and may modify our current constraint on $\widetilde{F}_{\rm MW,h}$\added{, which is only based on two LoS through the halo}. While we assume for simplicity that the density distribution of the halo is spherically symmetric, $\widetilde{F}_{\rm MW,h}$ and $\DM_{\rm MW,h}$ will vary between different LoS through the halo, and an extension of our analysis to a larger sample of FRBs may yield a more constraining limit on the average fluctuation parameter of the halo. \indent Extrapolating the scattering formalism we use for the Galactic halo to intervening galaxies, we examine two examples of FRBs propagating through intervening haloes, FRB 181112 and FRB 191108. The observed upper limits on each halo's contribution to $\tau$ are $\tau_{\rm i,h}<21$ $\mu$s at 1.3 GHz for FRB 181112 \citep{2020ApJ...891L..38C} and $\tau_{\rm i,h} < 4$ ns at 1.37 GHz for FRB 191108 \citep{2020MNRAS.tmp.2810C}. We find $(\widetilde{F} \times {\rm DM}^2)_{\rm i,h} < 13/A_\tau$ pc$^{4/3}$ km$^{-1/3}$ cm$^{-1/3}$\ for FRB 181112 and $(\widetilde{F} \times {\rm DM}^2)_{\rm i,h} < 0.2/A_\tau$ pc$^{4/3}$ km$^{-1/3}$ cm$^{-1/3}$\ for FRB 191108. Both estimates fall within the upper limit for the Milky Way halo, and all of these haloes have small to negligible scattering contributions \added{for the FRBs considered in this paper}. \indent We also model the DM contribution of each intervening halo to find nominal constraints on $\widetilde{F}$. The values of $\widetilde{F}$ from our analysis of FRB 181112, FRB 191108, the LMC, the Galactic halo, the Galactic thick disk, and the values of $\widetilde{F}$ used in NE2001 for the Galactic anti-center and inner Galaxy are all assembled in Figure~\ref{fig:Fsummaryplot}. The uncertainties associated with the conversion factor $A_\tau$ and the halo DMs are also shown. \added{The values of $\widetilde{F}$ for M33, FG$-$181112, the Galactic halo, and the LMC are essentially point estimates because they are based on individual sources, while the estimates provided for the Galactic thick disk, anti-center, and inner Galaxy are based on the population of Galactic pulsars.} Broadly speaking, the $\widetilde{F}$ upper limit for the Galactic halo is similar to that of the disk and spiral arms in the anti-center direction, and is about an order of magnitude larger than the fluctuation parameter of the thick disk. The value of $\widetilde{F}$ for the LMC is similar to that of the inner Milky Way because it is based on the pulse broadening of B0540$-$69, which lies within a supernova remnant and hence within an enhanced scattering region. Our estimates of $\widetilde{F}_{\rm i,h}$ for both FRB 181112 and FRB 191108 indicate that very little scattering occurs in the haloes intervening their LoS. \indent The fluctuation parameter is directly related to the inner and outer scales of turbulence as $\widetilde{F} \propto (\zeta \epsilon^2/f)(l_{\rm o}^2l_{\rm i})^{-1/3}$, where $\zeta$ and $\epsilon$ respectively describe changes in the mean density between different gas cloudlets and the variance of the density fluctuations within cloudlets. While the inner and outer scales in the Galactic warm ionized medium (WIM) are constrained by pulsar measurements to be on the order of \replaced{$l_{\rm i} \sim 1000$}{$100 \lesssim l_{\rm i} \lesssim 1000$} km and $l_{\rm o} \gtrsim 10$ pc \replaced{\citep{1995ApJ...443..209A}}{\citep{1990ApJ...353L..29S,1995ApJ...443..209A,2004ApJ...605..759B,2009MNRAS.395.1391R}} , the corresponding scales in hot halo gas are probably much larger. Given the size of the halo, $l_{\rm o}$ could be on the order of tens of kpc. The inner scale could also be larger if it is related to the proton gyroradius and the magnetic field strength is smaller in the halo than in the disk, which is probably the case given that the rotation measures of extragalactic sources tend to be larger closer to the Galactic plane \citep{2017ARA&A..55..111H}. Given that $f$, $l_{\rm o}$, and $l_{\rm i}$ are all probably larger in the halo than in the disk, we would expect $\widetilde{F}_{\rm MW,h}$ to be much smaller than $\widetilde{F}_{\rm disk}^{\rm thick}$. If we further expect the Milky Way halo to be similar to other galaxy haloes like FG$-$181112 and M33, then $\widetilde{F}_{\rm MW,h}$ would likely be less than $10^{-3}$ pc$^{-2/3}$ km$^{-1/3}$. However, our current constraints allow $\widetilde{F}$ to be larger in the halo than in the disk, which suggests that the upper limit for $\widetilde{F}_{\rm MW,h}$ is not constraining enough to make any further conclusions about $\zeta$, $\epsilon^2$, $f$, $l_{\rm o}$, and $l_{\rm i}$ in the halo. \indent \added{On the other hand, quasar absorption studies of the CGM of other galaxies (mostly at redshifts $z\gtrsim2$) indicate the presence of $\sim10^4$ K gas \citep{2015Sci...348..779H, 2016ApJS..226...25L, 2018MNRAS.473.5407M}, suggesting that the CGM is a two-phase medium consisting of warm gas clumps embedded in a hot ($10^6$ K) medium \citep{2018MNRAS.473.5407M}. Using a cloudlet model based on the simulations of \cite{2018MNRAS.473.5407M}, \cite{2019MNRAS.483..971V} demonstrate that a clumpy CGM could significantly scatter FRBs. Our empirical constraints on $\widetilde{F}$ are largely independent of any assumptions about the physical properties of the scattering medium. We assume a halo density model to estimate the DM contribution of a halo, although mapping of ionized and neutral high-velocity clouds in the Galactic CGM indicate that the DM is likely dominated by the hot gas \citep{2019MNRAS.485..648P}. As a composite parameter, $\widetilde{F}$ is insensitive to a broad range of assumptions about gas temperature or clumps, and could serve as an independent test of the two-phase model for the CGM. In a clumpy, cooler CGM, the inner and outer scales of turbulence would be similar to those in the WIM and $f \ll 1$, and $\widetilde{F}$ would be larger than it would be in a hot medium with a larger filling factor and scale size. Adopting fiducial values of $\epsilon^2 = \zeta = 1$, $f\sim10^{-4}$ (the value used by \cite{2019MNRAS.483..971V}), $l_{\rm i} \sim 100$ km, and $l_{\rm o} \sim 10$ pc gives $\widetilde{F} \sim 500$ pc$^{-2/3}$ km$^{-1/3}$. This estimate is orders of magnitude larger than our results for the Galactic halo and the foreground haloes of FRBs 181112 and 191108, suggesting that halo gas probed by these LoS is either not dominated by cooler clumps, or that $f$, $l_{\rm o}$, and $l_{\rm i}$ are significantly different in the clumpy CGM than otherwise assumed by \cite{2018MNRAS.473.5407M} and \cite{2019MNRAS.483..971V}. } \indent \deleted{A more stringent comparison of the hot halo and thick disk will require a stricter constraint on $\widetilde{F}$ for the halo.} \added{A more stringent comparison of hot gas in the halo and the WIM will require a larger sample of precise FRB scattering measurements.} Regardless, the nominal range of $\widetilde{F}$ constrained for the Galactic halo and the haloes intervening FRB 181112 and FRB 191108 demonstrate the range of internal properties that different galaxy haloes can have. A broader sample of FRB scattering measurements with intervening halo associations will expand this range and may potentially reveal an interesting diversity of galaxy haloes. \indent Many more FRBs with intervening galaxy haloes will likely be discovered in the near future. In these cases, the amount of scattering to be expected from the intervening haloes will depend not only on the fluctuation parameter $\widetilde{F}$ and DM of the halo, but also on the relative distances between the source, halo, and observer, and the effective path length through the halo. Depending on the relative configuration, an intervening halo may amplify the amount of scattering an FRB experiences by factors of 100 or more relative to the amount of scattering expected from the Milky Way halo. However, plausibly attributing scattering to an intervening halo will still require careful consideration of the FRB host galaxy, which in many cases may be the dominant source of FRB scattering. \acknowledgements The authors thank the referee for their useful comments and acknowledge support from the National Aeronautics and Space Administration (NASA 80NSSC20K0784) and the National Science Foundation (NSF AAG-1815242), and are members of the NANOGrav Physics Frontiers Center, which is supported by the NSF award PHY-1430284.
\section{Introduction} Clusters of galaxies are not isolated structures, but rather the nodes of the large-scale cosmic web to which they are connected. Their birth and growth are intimately linked with the anisotropic nature of the gravitational collapse. Starting from nonspherical density peaks in the primordial density field \citep{Doroshkevich1970,Bardeen1986}, their asymmetries have been amplified by gravitation. Following the standard model of structure formation, clusters are also assumed to continuously grow by successive mergers and accretion along filamentary structures in the cosmic web \citep{Zeldovich1970}. The nonspherical shape of groups and clusters can therefore be used to test and validate the structure formation scenario \citep{Sereno2018} and the nature of dark matter \citep[DM,][]{Yoshida2000,Spergel2000,Dave2001,Peter2013}. On the one hand, the evidence of the nonsphericity of halos has been well established using cosmological N-body simulations \citep[see, e.g.,][]{Jing2002}. The elliptical shape of DM halos is expected to depend on their mass and redshift, as discussed in \cite{Allgood2006,Despali2014,Suto2016,Vega2017}, high-mass halos tend to be less spherical than low-mass objects. This mass-ellipticity correlation can be attributed to the formation time \citep{Despali2014} and the formation history \citep{Chen2019,Lau2021} of halos. Following the hierarchical formation scenario, more massive structures formed more recently and are thus expected to be more widely disturbed because they did not have enough time to relax. Investigating the link between the nonsphericity and the properties of groups and clusters is therefore an essential question for improving our understanding on the formation and growth of structures. These investigations are also crucial to reduce uncertainties on the cosmological constraints. Any departure from spherical symmetry in the matter distribution can bias the cluster mass estimation \citep[see, e.g.,][]{Lee2018}, which in turn affects the cosmological constraints inferred from, for instance, the concentration mass relation \citep[see, e.g.,][]{Maccio2007}. On the other hand, the large-scale environment of clusters is expected to affect their internal properties and their density profile \citep[see, e.g.,][]{Contigiani2020}. Much effort has recently been expended to probe relations between the brightest central galaxy (BCG) of groups and clusters with their local environment in the cosmic web \citep{Kuutma2020}. For example, \cite{Poudel2017} have probed the effect of cosmic web filaments on the properties of groups and their central galaxies. In addition, \cite{Darragh2019} have also investigated the relation of the number of filaments that are connected to groups and their BCG. The authors suggested that groups with high connectivity are more likely to have grown through a recent major merger, which tends to reduce the star-formation activity of the BCG. In general, the effect of cosmic web connectivity on the physical properties of galaxies has recently been investigated by \cite{Kraljic2020} and \cite{2019Lee}. Moreover, the local topology and geometry of the density field next to massive halos can be probed statistically through the connectivity, that is, the number of filaments branching out from a halo. The statistics of halo connectivity is expected to depend on the growth factor, and thus can constitute an new topological constraint on dark energy \citep{Codis2018} because the connectivity of halos must decrease with cosmic time due to the accelerated expansion of the Universe that disconnects cosmic nodes from the network of filaments \citep{Pichon2010}. More generally, the anisotropic environment of the cosmic web affects the assembly bias of halos, as was theoretically explored by \cite{Musso2018}, who found that early-formed low-mass halos preferentially lie along filaments, while massive young halos are closer to the nodes \citep[see also][]{Shim2020,Cadiou2020}. Cosmic web anisotropy is thus expected to be an indicator of halo assembly bias and is therefore strongly correlated with halo properties \citep[as discussed in][]{Paranjape2018,Ramakrishnan2019}. In this context, galaxy clusters and groups are ideal places to describe the anisotropic level of matter distribution: from their nonspherical shape to the filaments that channel in-falling matter to clusters. Recently, \cite{Gouin2020} have shown that the angular symmetries in the matter distribution increase with the distance from the cluster center. While matter inside clusters is well described by an ellipsoid (traced by quadrupolar moment), the filamentary pattern outside clusters show a complex azimuthal signature. Both anisotropy signatures, traced by either the ellipticity or the connectivity, constitute probes for the structure formation scenario and cosmology. It is therefore of interest to understand the link between the mass assembly of clusters and the geometrical properties of their mass distribution. In this study, we focus in particular on the three main questions: \begin{itemize} \item[$\bullet$] Does the anisotropic environment of groups and clusters influence their halo shape? \item[$\bullet$] Is the dynamical state of groups and clusters impacted by their anisotropic environment? \item[$\bullet$] Are the ellipticity and connectivity distributions resulting from different mass assembly histories? \end{itemize} To address these questions, we explore the shape of groups and clusters of galaxies and the large-scale filamentary structure that surrounds them using a large sample from the current cosmological hydrodynamical IllustrisTNG simulation \citep{ILLUSTRIS_TNG}. The paper is organized as follows. In Sect. 2 we define the sample of simulated groups and clusters and the quantities we used to describe the dynamical state and mass-assembly history of the halo. In Sect. 3 we explain how we estimated the shape and the connectivity of groups and clusters. The statistics of ellipticity and connectivity are presented in Sect 4., where we explore possible correlations with the dynamical state and accretion history of the halo. In Sect. 5 we discuss our findings in the context of recent studies of cluster evolution. Finally, Sect. 6 summarizes our main results. \section{History and dynamical state of groups\label{SECT:data}} \subsection{Groups and clusters from IllustrisTNG} The hydrodynamical cosmological simulation IllustrisTNG \citep{ILLUSTRIS_TNG} follows the evolution of dark matter, gas, stars, and black holes on a moving mesh \citep[code Arepo,][]{AREPO} from redshift $z = 127$ to $z = 0$. The input cosmology of the simulation is consistent with \textit{Planck} 2015 results \citep{Planck2016}, such that $\Omega_{\Lambda,0} = 0.6911$, $\Omega_{m,0} = 0.3089$, $\Omega_{b,0} = 0.0486$, $\sigma_{8} = 0.8159$, $n_s = 0.9667,$ and $h = 0.6774$. We focus on the largest simulation box IllustrisTNG300-1 with a size length of $302.6 \text{ Mpc}$ and with the highest mass resolution of $m_{\text{DM}} = 4.0 \times 10^7 M_{\odot}/h$ ($2500^3$ DM particles). We chose to use this high-resolution and large simulation box to accurately describe the shape and dynamical state of the massive halos. For each snapshot, the IllustrisTNG simulation provides a halo catalog, identified with a standard friends-of-friends (FoF) algorithm with linking length $b=0.2$ \citep{Davis1985}, and a subhalo sample derived with the Subfind algorithm to detect substructures inside host halos \citep{subfind}. Based on the FoF group sample from IllustrisTNG, we selected $2522$ halos representing galaxy groups and clusters with masses $M_{200} \geq 1 \times 10^{13} M_{\odot}/h$ at $z=0$. We defined $M_{200}$ and $R_{200}$ as the radius of the group. $R_{200}$ is the radius enclosing $M_{200}$ with a mean overdensity of 200 times the critical background density. We discarded $79$ halos that are closer than $3 \, R_{200}$ from the simulation box edges to focus our exploration on the large-scale halo environments. \subsection{Dynamical state of groups and clusters \label{SECT:DS}} In order to identify whether the anisotropies in matter distribution are correlated to the dynamical state, we categorized the groups and clusters by their level of relaxedness. The equilibrium state of each halo was assessed by computing three different parameters \citep[as defined in detail, e.g., by][]{Cui2017}. First, we quantified the center-of-mass offset, which measures the distance between the center of mass $r_\text{cm}$ and the density peak of the halo $r_\text{c}$, normalized by the virial radius ($\Delta_\text{r} = \vert r_\text{cm} - r_\text{c} \vert / R_\text{vir}$). We considered $r_\text{c}$ to be the position at which the potential energy is minimum inside the halo, and $r_\text{cm}$ was computed as the sum of the mass-weighted relative coordinates of all particles and cells in the FoF halo. Secondly, we determined the subhalo mass fraction which estimates the level of substructure in the halo. It is defined as $f_\text{sub} = \sum M_\text{sub} / M_\text{tot}$, where $M_\text{sub}$ is the mass of each subhalo without taking the mass of the main subhalo (i.e., the most massive subhalo) into account, and $M_\text{tot}$ is the total mass of the halo. Thirdly, we computed the virial ratio of groups and clusters. It represents the level of halo virialization and is defined as $\eta = 2 T/\vert W \vert$, where $T$ and $W$ are the kinetic energy and the gravitational potential energy, respectively. It is computed from all particles and cells in the FoF halo. A cluster can thus be considered as relaxed when it has a low subhalo mass fraction ($f_\text{sub}<0.1$), a low center-of-mass offset ($\Delta_\text{r}<0.07$), and is close to virial equilibrium ($\vert \eta -1 \vert <0.15$). Halos that do not satisfy these three criteria can be classified as unrelaxed \citep[similarly to][]{Neto2007,Power2012}. In addition, we combined these three parameters to obtain a continuous measure of the level of the so-called relaxedness $\chi_\text{DS}$, as introduced by \cite{Haggar2020}, \begin{equation} \label{EQ:relax} \chi_\text{DS} = \sqrt{ \frac{3}{ \left(\frac{\Delta_\text{r} }{0.07} \right)^2 + \left(\frac{f_\text{sub} }{0.1} \right)^2 + \left(\frac{\eta -1}{0.15} \right)^2 }}. \end{equation} Groups and clusters with $\chi_{DS} \geq 1$ were considered as dynamically relaxed \citep[see, e.g.,][]{Kuchner2020}. \subsection{Mass accretion history and formation time \label{SECT:MAR}} In order to probe the accretion history of groups and clusters, we estimated the instantaneous halo growth rate $dM/dt_{z\sim 0}$, the recent continuous mass accretion rate $\Gamma_{200\text{m}} (z=0.5)$, and the formation time $z_{\text{form}}$ of our sample. To do so, we used the merger tree of subhalos computed using the SubLink algorithm \citep[see][for details of the subhalo and merger tree computation in the Illustris simulation]{Rodriguez2015}. For each group, we focused on the merger tree of its main subhalo. Following the principal branch of the main subhalo merger tree, we extracted the mass ($M_{200\text{c}}$ and $M_{200\text{m}}$) of their associated halo at each time step. We hence assume that the main subhalo progenitor is associated with the main halo progenitor. This is almost always true, except in the occasional case of \textit{\textup{subhalo switching}} when a large number of particles from a given subhalo switch to a another subhalo between two consecutive snapshots \citep[this particular numerical case is fully described in][]{Poole2017}. By computing the mass growth of halos over cosmic time, we can calculate different proxies of their mass-assembly history. Following \cite{Cole1996}, we defined the formation redshift $z_{\text{form}}$ as the redshift at which the mass of the halo main progenitor $M_{200}(z)$ is equal to half its mass at $z=0,$ such that \begin{equation} \frac{M_{200}(z_\text{form})}{M_{200}(z=0)} = 1/2. \end{equation} The halo mass accretion controls the rate at which mass is deposited into halos. Previous works presented a large variety of definitions of the halo mass accretion rate. We focus on two of them. First, several studies describe the instantaneous mass accretion rate \citep[see, e.g., ][]{vandenBosch2002,Rodriguez2016} as \begin{equation} \frac{dM_{200\text{m}}}{dt} = \frac{M_{200\text{m}}(t+dt)-M_{200\text{m}}(t)}{dt}. \end{equation} Because we are interested in quantifying the accretion of halo at the present time, we computed $dM/dt_{z=0.05}$ by performing a linear regression on $M_{200\text{m}}(t)$ over ten snapshots from $z=0$ to $z=0.11$. We note that $57$ low-mass halos have a negative recent growth $dM/dt_{z\sim 0} < 0$, probably due to \textit{\textup{particle switching}} \citep{Poole2017}. We discarded them for the specific investigations of the halo growth at $z \sim 0$. Secondly, the logarithmic slope of the mass evolution $d \log M / d \log a $ is a natural description of the mass growth, following the parametric form of halo mass evolution over time $M(a) \propto \exp(-\alpha z)$, where $\alpha$ is related to the formation epoch of the redshift, and $a$ is the scale factor \citep[see, e.g.,][]{Wechsler2002}. This estimator of the continuous mass accretion history is defined as \begin{equation} \Gamma_{200\text{m}} = \frac{\Delta log(M_{200\text{m}})}{\Delta log(a)}. \end{equation} The halo mass changes through the physical accretion and the changes in the halo radius that are defined by the reference density. This definition of mass accretion rate $\Gamma$ thus accounts for the real physical accretion rate and has the advantage of isolating effects of pseudo-evolution in the cluster mass \citep{Diemer2013b}. Computing the accretion rate $\Gamma$ allows us to determine the accretion phase of halos between two times, from $z=0$ to $z\sim 0.5$. The redshift interval of $\Delta z =0.5$ corresponds reasonably well to the expected relaxation timescales of halos \citep{Power2012,Diemer2014,More2015,Chen2019}. By using the masses of halos at $z=0$ and their main progenitor at $z=0.5$, we thus computed the continuous accretion rate $\Gamma_{\text{200m}} (z=0.5)$ for each halo. $\text{Four}$ halos do not have a main progenitor at $z=0.5$ and were therefore discarded from the analyses for which the accretion history was used. \section{Probing the anisotropy of matter distribution \label{SECT:METHOD}} We aim to probe the anisotropic level of the density field in environments of massive objects. The anisotropy of matter distribution was estimated at two different radial scales: inside groups and clusters, and in their environments. \cite{Gouin2017,Gouin2020} have recently reported that deviations from spherical symmetry increase from the cluster centers to their external regions with two distinct regimes: inside halos, and outside the virial radius. Inside clusters, the matter distribution is highly quadrupolar, reflecting the ellipsoidal shape of the halos. In cluster outskirts, from $1 \times R_\text{vir}$ to $4 \times R_\text{vir}$, the matter distribution describes more complex angular symmetries up to high harmonic orders. These high levels of angular harmonics are induced by the filamentary pattern around clusters and increase for clusters that connected to a large number of filaments \citep{Gouin2020}. Following these previous investigations, we quantified the anisotropy inside groups and clusters by estimating their ellipticity, such that elongated shapes are defined as more anisotropic than spherical shapes. The anisotropy of the large-scale environment of groups and clusters was also estimated by counting the number of filaments that are connected to them. By extracting the cosmic filamentary structure, we considered as highly anisotropic environments those halo outskirts that are connected to a large number of preferentially accreting directions. \subsection{Ellipticity measurement} The anisotropy of the matter distribution in halos was estimated by modeling the halo shape as an ellipsoid and by computing its ellipticity. The ellipticity is commonly defined as in \cite{Jing2002}, \begin{equation} \epsilon = \frac{\lambda_1 - \lambda_3}{2 \tau}, \end{equation} where $\lambda_{\left[1,2,3\right]}$ are the axes of the ellipsoid with $\lambda_1 \geq \lambda_2 \geq \lambda_3$, and $\tau = \lambda_1 + \lambda_2 + \lambda_3 $. \\ For each group of clusters, we determined the major, intermediate, and minor axis vectors of the ellipsoid ($a>b>c$) by diagonalizing their mass tensor, \begin{equation} I_{\alpha \beta} = \sum^N_{i=1} x^{(i)}_{\alpha} x^{(i)}_{\beta}, \end{equation} where $x^{(i)}_\alpha$ ($\alpha = 1, 2, 3$) is the coordinate of the $i$th DM particle along the three axes. Following \cite{Suto2016}, we used all the DM particles including all substructures and non-FOF members. Starting from the sphere centered on the center of mass, we computed the eigenvalues of the mass tensor and fixed the size of the ellipsoid such that the total mass enclosed in the ellipsoid equaled $M_\text{ellipsoid}=M_{200}$. We then repeated the procedure until all the eigenvalues converged to within 1\%. The axes of the ellipsoid were defined by the square roots of the tensor eigenvalues. The ellipsoidal shapes of halos for different values of the ellipticity are shown in Fig. \ref{FIG_VISU}. Figure \ref{fig:FIG_E_mass} displays the cumulative distribution function of the ellipticity for several mass bins. We confirm the results from previous theoretical studies that were also based on numerical simulations \citep[see, e.g.,][]{Allgood2006,Despali2014,Bonamigo2015,Vega2017,Despali2017} and show that massive groups and clusters on average have a more elliptical and thus a more anisotropic matter distribution. This ellipticity-mass dependence can be attributed to the hierarchical formation scenario that implies that massive structures are formed more recently and thus have not had time to relax \citep{Despali2014}. \subsection{Connectivity measurement} The anisotropy in the large-scale environment of groups and clusters is quantified by the local number of filaments that are connected to them, the so-called connectivity $\kappa$. This proxy is a powerful tool for understanding the geometry of the underlying density field, as discussed in \cite{Codis2018}. Different methods are proposed in the literature to extract the skeleton of the cosmic web \cite[for a review of recent methods, see][]{Libeskind2017}. We used the recently developed cosmic web detection algorithm T-ReX \citep{Bonnaire2020}, which builds an estimate of the filamentary pattern based on a graph modeling of the subhalo distribution. T-ReX extracts a smooth version of the minimum spanning tree using a Gaussian mixture model to describe the spatial distribution of tracers. Two main parameters are used in the algorithm: one controls the smoothness of the graph, $\lambda,$ and one governs the level of the denoising pre-procedure, $l$. We considered here $\lambda=1$ and $l=5$ to capture the large-scale cosmic filaments and smaller bridges of matter. Following \cite{DANY_2020a, DANY_2020b}, we applied the cosmic web detection algorithm on subhalos from the IllustrisTNG simulation selected according to their stellar masses, $M_{*} \, [M_{\odot}] \geq 10^9$. From the output graph, we associated the closest node of the graph with each group and cluster, and the local connectivity $\kappa$ is the number of intersecting filaments in a sphere of $1.5\, R_{200}$ radius around the graph node \citep[similarly to][]{Darragh2019,Sarron2019}. We discarded 24 low-mass groups that were considered too distant from the graph ($>1$ Mpc/h). These objects are located in low-dense environments, and are thus not connected to the overall cosmic web. As a result, our final sample of groups and clusters consisted of $2419$ halos, for which we estimated the ellipticity and connectivity in order to probe the anisotropy inside and around halos. The cluster connectivity is illustrated in Fig. \ref{FIG_VISU}. The T-ReX filamentary structure (computed from the galaxy distribution) clearly traces the DM distribution around halos well. In addition, Fig. \ref{fig:FIG_K_mass} shows the probability distribution function of the connectivity for four mass bins. The histogram of the clusters ($M_{200} > 1\times 10^{14} M_{\odot}/h$) peaks around 3-4 (i.e., clusters are connected to three to four filaments) and is spread over high $\kappa$ values (up to $\kappa = 6$). In contrast, the connectivity statistics of the lowest-mass groups ($1\times 10^{13} <M_{200} [M_{\odot}/h] < 2\times 10^{13} $) strongly peaks at $\kappa=2$, suggesting that low-mass groups are preferentially located inside filaments, whereas massive clusters are more likely located at the nodes of the cosmic web. We thus confirm that massive structures have a higher connectivity than low-mass structures (as was also found by \citep[see, e.g.,][]{Aragon2010,Codis2018,Darragh2019,Sarron2019,Malavasi2020}). In addition to the mass-connectivity relation, we explored any possible correlation between anisotropic environments (via the connectivity) and the properties of the groups and clusters. \begin{figure} \centering \includegraphics[width=0.48\textwidth]{Final3_cdf_e.pdf} \caption{Ellipticity cumulative distribution for four different mass bins of groups and clusters at $z=0$. The short vertical lines at the bottom show the ellipticity median value for each mass bin. The number of groups and clusters per mass bin is written in the box. \label{fig:FIG_E_mass}} \end{figure} \begin{figure} \centering \includegraphics[width=0.48\textwidth]{Final3_pdf_K.pdf} \caption{Probability distribution function of group and cluster connectivities $\kappa$ for four mass bins. Because $\kappa$ is an integer, we artificially shift the connectivity of the different mass bins by adding $+0.1$ for the second mass bin, $+0.2$ for the third mass bin, and $+0.3$ for the most massive mass bin for clarity. \label{fig:FIG_K_mass}} \end{figure} \begin{figure*} \centering \includegraphics[width=0.42\textwidth]{Relax1.png} \includegraphics[width=0.42\textwidth]{UnRelax1.png} \includegraphics[width=0.42\textwidth]{Relax2.png} \includegraphics[width=0.42\textwidth]{UnRelax2.png} \caption{Ellipsoidal shapes and large-scale environments of four simulated galaxy clusters. The blue ellipsoids are computed by calculating the mass tensor of the DM distribution, following Sect. \ref{SECT:METHOD}. The red lines represent cosmic filaments reconstructed by the T-ReX algorithm for the galaxy distribution. The yellow spheres have a radius of $1.5 \times R_{200}$. \label{FIG_VISU} } \end{figure*} \section{Results} In this section, we assess the effect of the dynamical state and mass-accretion history on the anisotropies of the matter density field around simulated groups and clusters as traced by the ellipticity in their inner parts and the connectivity at larger scales where the groups and clusters are connected to the cosmic web. Both anisotropy proxies depend on the mass: Massive structures are more elliptical and more strongly connected to the cosmic web than low-mass structures (see Figs. \ref{fig:FIG_E_mass} and \ref{fig:FIG_K_mass}). Our purpose is to determine whether there are any other correlations between the anisotropy and the halo properties beyond the mass-driven trend. Therefore we adopted the strategy of exploring the relations of the physical halo properties and halo anisotropy proxies for different mass bins. For all figures, we display the mean quantity together with their associated error bars derived from bootstrap re-sampling. To further assess the correlation between a set of parameters representing either the physical properties or the anisotropy proxies, we list the Spearman rank correlation coefficient $\rho_\text{sp}$ and the associated \textit{p}-value in Table \ref{tab:correl}. \begin{table*}[] \renewcommand{\arraystretch}{1.2} \centering \begin{tabular}{c|c c|c c} & \multicolumn{2}{c|}{$M_{200}>1 \times 10^{13} M_{\odot}/h$} & \multicolumn{2}{c}{$M_{200}>5 \times 10^{13} M_{\odot}/h$} \\ \cline{2-5} & $\rho_\text{sp}$ & \textit{p}-value & $\rho_\text{sp}$ & \textit{p}-value \\ \specialrule{.12em}{.05em}{.05em} $\epsilon$ and $\kappa$ & $0.11$ & $2.15 \times 10^{-7}$ & $0.17$ & $5 \times 10^{-4}$ \\ \hline $\epsilon$ and $dM/dt (z\sim 0)$ & $0.37$ & $3.1 \times 10^{-78}$ & $0.31$ & $2 \times 10^{-10}$ \\ $\kappa$ and $dM/dt (z\sim 0)$ & $0.33$ & $3.8 \times 10^{-60}$ & $0.35$ & $4 \times 10^{-13}$ \\ \hline $\epsilon$ and $\chi_\text{DS}$ & $-0.44$ & $1.9 \times 10^{-7}$ & $-0.42$ & $1 \times 10^{-10}$ \\ $\kappa$ and $\chi_\text{DS}$ & $-0.13$ & $4.6 \times 10^{-11}$ & $-0.17$ & $5 \times 10^{-4}$ \\ \end{tabular} \caption{Spearman rank correlation coefficients $\rho_\text{sp}$ and corresponding \textit{p}-values of halo properties and their anisotropy proxies for all the groups and clusters in the sample ($M_{200}>1\times 10^{13} M_{\odot}/h$), and for the 408 most massive groups and clusters ($M_{200}>5 \times 10^{13} M_{\odot}/h$). \label{tab:correl}} \end{table*} \subsection{Effect of cosmic filament accretion on shapes} \begin{figure} \centering \includegraphics[width=0.45\textwidth]{Final3_eK.pdf} \caption{Mean ellipticity as a function of the mass for three connectivity bins: low ($\kappa \in \{1, 2\}$), medium ($\kappa =3$), or high ($\kappa > 3$). The error bars are the errors on the mean, derived from bootstrap resampling. In gray we show the point distribution of the sample. \label{fig:FIG_E_K} } \end{figure} \begin{figure*} \centering \includegraphics[width=0.8\textwidth]{Final3_dMdt_eK.pdf} \caption{Mean instantaneous mass growth $dM/dt$ computed at $z\simeq0$ as a function of the group mass for three ellipticity bin (left panel) and three connectivity bins (right panel). The ellipticity is binned according to an almost spherical ($\epsilon<0.05$), a quite elliptical ($0.05<\epsilon<0.1$), and an elliptical shape ($\epsilon>0.1$). The connectivity is binned such that clusters have a low ($\kappa \in \{1, 2\}$), medium ($\kappa =3$), or high ($\kappa > 3$) connectivity. The error bars are the errors on the mean, derived from bootstrap resampling. In gray we show the point distribution of the sample. \label{fig:dmdt} } \end{figure*} The effect of the anisotropic large-scale environment on the shape of groups and clusters is investigated first. Given the known correlations of mass and connectivity, and mass and ellipticity, we aim at investigating whether connectivity and ellipticity are correlated beyond the mass effect. Therefore Fig. \ref{fig:FIG_E_K} displays the mean halo ellipticity as a function of mass for three different connectivity bins. We separately consider weakly connected ($\kappa = \{1, 2\}$), medium connected ($\kappa = 3$), and highly connected ($\kappa > 3$) groups and clusters. At fixed mass, there is a trend for weakly connected objects to be more spherical than highly connected objects. In contrast, structures with a high connectivity ($\kappa>3$) are on average more elliptical than the other structures. This trend between connectivity and ellipticity is more significant for masses higher than $10^{13.5} M_{\odot}/h$, probably because the range of connectivities is wider for these mass bins. The connectivity of low-mass groups ($10^{13}<M_{200}<10^{13.5} M_{\odot}/h$) is low, with about $80\%$ with $\kappa \in \{1,2\}$, suggesting that they are preferentially located inside filaments \citep[as shown by][]{Cautun2014, Hellwing2020}. In contrast, most massive objects ($M_{200}>10^{14.2} M_{\odot}/h$) are largely connected to the cosmic web (about $70\%$ of them with a connectivity $\kappa>3$), showing that they are rather located at the nodes of the cosmic web. Furthermore, as Table \ref{tab:correl} shows, the correlation coefficient between ellipticity and connectivity increases for high-mass halos and reaches $\rho_\text{sp} \sim 0.24$ for $M_{200} \geq 1 \times 10^{14} M_{\odot}/h$. This correlation remains significant for masses $M_{200} > 5 \times 10^{13} M_{\odot}/h$ when the partial correlation coefficient is computed, where the effect of mass dependence is corrected for using the fitting formulae of $\epsilon(M_{200})$ and $\kappa(M_{200})$. We conclude that for masses higher than $10^{13.5} M_{\odot}/h$, the higher the connectivity, the more elliptical the cluster on average. To understand this anisotropic environmental effect on the shape, we probed the possible relations between the accretion of infalling matter at the present time and the halo anisotropy proxies (both ellipticity and connectivity). In addition to the overall picture that groups and clusters are preferentially aligned with their main connected filaments as supported by previous theoretical \citep{Gouin2017,Okabe2020_SIMU,Kuchner2020} and observational \citep{Einasto2020,Okabe2020_OBS,Gouin2020} studies, \citet{Morinaga2020} have recently shown that ellipticity is correlated with the filamentary accretion. The accretion of groups at $z=0$ can be quantified by the instantaneous mass accretion rate $dM/dt_{z \sim 0}$ (a proxy for the growth rate), as described in Sect. \ref{SECT:MAR}. Fig. \ref{fig:dmdt} shows the mean instantaneous accretion rate of groups and clusters as a function of their masses. As expected following the hierarchical structure formation scenario, massive halos grow more rapidly on average than low-mass halos. In addition to the mass-driven effect, the left panel of Fig. \ref{fig:dmdt} shows the instantaneous accretion rate for three bins of ellipticity: an almost spherical ($\epsilon<0.05$), a quasi-elliptical ($0.05<\epsilon<0.1$), and a strongly elliptical shape ($\epsilon>0.1$). This demonstrates that elliptical groups and clusters grow faster on average than spherical ones. The Spearman rank correlation coefficient for the ellipticity and instantaneous mass accretion rate, which is about $0.3$ (see Table \ref{tab:correl}), confirms the strong correlation between ellipticity and accretion rate \citep[also recently shown by][]{Lau2021}. This relation of ellipticity and accretion is significant for all masses ranging between $10^{13}$ and $10^{15} M_{\odot}/h$ and suggests that high-accretion flows strongly disturb the shapes of groups and clusters \citep[as discussed in][]{Morinaga2020}. The right panel of Fig. \ref{fig:dmdt} displays the evolution of the mass accretion rate as a function of mass, considering the three bins of connectivity defined above (little, medium, or highly connected halos). It shows for each mass bin that highly connected clusters tend to grow faster at the present time than other groups and clusters. The high value of the correlation coefficient for connectivity and the instantaneous mass accretion rate (see Table \ref{tab:correl}) also demonstrates that the accretion rate scales with connectivity. We may assume that more mass is infalling because of the large number of filaments to which the halo is connected. Moreover, in concordance with the theoretical investigations of \cite{Musso2018}, our result suggests that at fixed mass, halos in the nodes (with $\kappa>3$) have higher accretion rates than halos in filaments (with $\kappa<3$). From these results, we conclude that the anisotropy of the halo environment affects their shapes: the larger the number of filaments to which a group or cluster is connected, the more elongated its shape on average. For the first time, we highlight the correlation between ellipticity and connectivity and show that this is not only driven by the mass. Moreover, our results suggest that this link between anisotropic environment and halo shape can be due to their current growth. Regardless of their mass, connectivity and ellipticity are strongly correlated to the accretion of groups and clusters at the present time. Our results reveal that clusters that are highly connected to the cosmic web tend to grow faster, and these fast accretion flows must disturb their mass distribution, hence increase their ellipticity. \subsection{Effect of the dynamical state on group anisotropies \label{RES:DS}} To proceed in probing possible correlations between properties of groups and clusters and their environment, we investigated the effect of the dynamical state at $z=0$. The dynamical state is quantified by the relaxation level, relaxedness, using the three proxies defined in Sect. \ref{SECT:DS}: the center offset, the virial ratio, and the fraction of substructure. Figure \ref{fig:dynamic} shows the mean relaxedness $\chi_\text{DS}$ as a function of mass for three different ellipticity bins (right panel) and three different connectivity bins (left panel). The relation between relaxation and mass is displayed in the left panel of Fig. \ref{fig:dynamic} for all objects (independently of their ellipticity and connectivity). As expected, the level of relaxation decreases with mass, such that massive structures are less relaxed on average than low-mass structures \citep[see also][]{Kuchner2020}. The fact that the halo mass drives the dynamical state is indeed rather well established in theory based on large N-body simulation \citep[see, e.g.,][]{Power2012}. This can be explained by the fact that high-mass halos tend to form later and are still in formation phases \citep{Giocoli2012}. In our study, we focus on a correlation in addition to the mass-driven effect. In addition to this mass-relaxedness relation, we found that the large scatter in relaxedness can be attributed to the different shapes and connectivities that characterize groups and clusters. The left panel of Fig. \ref{fig:dynamic} shows that elliptical structures are less relaxed than spherical structures in all mass bins. Table \ref{tab:correl} shows that the high value of the correlation coefficient between ellipticity and relaxedness confirms that the shape is a good tracer of the dynamical state of clusters. The right panel of Fig. \ref{fig:dynamic} displays the relaxedness-mass relation for different connectivity values. The correlation coefficient $\rho_\text{sp} (\kappa,\chi_\text{DS}) = 0.13$ indicates a weak anticorrelation between relaxedness and connectivity. This value tends to increase when low-mass halos are excluded (see Table \ref{tab:correl}). At fixed mass, the right panel of Fig. \ref{fig:dynamic} shows that weakly connected groups and clusters are on average more relaxed than highly connected groups and clusters in all mass bins. This result argues in favor of a large-scale environmental dependence on the dynamical properties of groups and clusters. Another way to explore the link between the dynamical state and anisotropy proxies is to separately consider the ellipticity- and connectivity-mass relations for relaxed and unrelaxed clusters, as presented in the panels of Fig. \ref{fig:dynamic2}. As discussed in Sect \ref{SECT:DS}, groups and clusters are considered as relaxed if the relaxnedness condition $\chi_\text{DS} \geq 1$ is fulfilled. The left panel of Fig. \ref{fig:dynamic2} shows that relaxed structures are more spherical on average than unrelaxed structurse in each mass bin. This agrees with the result of \cite{Suto2016}, who found that halos populated by massive substructures are systematically less spherical than single halos. The right panel of Fig. \ref{fig:dynamic2} highlights the fact that unrelaxed groups and clusters are also more strongly connected to the cosmic web (i.e., with a higher value of connectivity) than relaxed groups and clusters. This result is significant for each mass bin. It consequently shows that regardless of the mass, the connectivity and ellipticity tend to trace different dynamical states of groups and clusters. Finally, we conclude that in addition to the mass effect on halo relaxation, internal and external indicators of anisotropy trace the dynamical state. Regardless of the mass, dynamically unrelaxed groups and clusters are more strongly connected to the cosmic web on average and are more elliptical than the relaxed groups and clusters. This second result, in addition to our previous finding on the effect of cosmic filament accretion on shapes, suggests that highly connected systems are strongly accreting matter, which in turn perturbs their matter distribution, and thus affects both their dynamical state and shape. \begin{figure*} \centering \includegraphics[width=0.85\textwidth]{Final3_Relaxness.pdf} \caption{ Mean relaxedness (computed with Eq. \ref{EQ:relax}) as a function of mass. In the right panel, the mean relaxedness is shown for three different ellipticity bins: almost spherical ($\epsilon<0.05$), quite elliptical ($0.05<\epsilon<0.1$), and elliptical ($\epsilon>0.1$). The gray line traces the mean relaxedness for all groups and clusters, regardless of their ellipticity. In the left panel, the mean relaxedness is shown for four different connectivity bins: $\kappa=1$, $\kappa=2$, $\kappa=3$, and $\kappa>3$. The error bars are the errors on the mean, derived from bootstrap resampling. \label{fig:dynamic}} \end{figure*} \begin{figure*} \centering \includegraphics[width=0.85\textwidth]{Final3_Relax_eK.pdf} \caption{Mean ellipticity (right panel) and mean connectivity (left panel) as a function of mass, separately considering relaxed and unrelaxed groups and clusters (relaxed groups have a relaxedness $\chi_\text{DS} \geq 1$). The error bars are the errors on the mean, derived from bootstrap resampling. In gray we show the point distribution of the sample. \label{fig:dynamic2}} \end{figure*} \subsection{Effect of mass growth history on anisotropy \label{Sect_res_final}} We found that both ellipticity and connectivity trace the dynamical state and the recent growth of groups and clusters. We now explore further whether these relations of anisotropy proxies and halo dynamics are the result of different growth histories. Previous studies have postulated that dynamical states of halos can be attributed to their mass-assembly history (MAH) \citep[see, e.g., ][]{Power2012, Mostoghiu2019}. Therefore we expect that the MAH also affects the anisotropy of the density field at $z=0$. We considered two quantities to describe the MAH of groups and clusters: the continuous mass accretion rate $\Gamma_{200\text{m}}(z=0.5)$, and the formation redshift $z_\text{form}$, as defined in Sect. \ref{SECT:MAR}. In Fig. \ref{fig:histogramm_zf_MAR} we plot the probability distribution function of the mass accretion rate $\Gamma_{200m}(z=0.5)$ (left panel) and the formation redshift $z_\text{form}$ (right panel) for relaxed and unrelaxed groups and clusters separately. We clearly observe that relaxed and unrelaxed structures are two different populations with different distributions of formation time and accretion rate. In agreement with \cite{Power2012}, we find that young objects are more likely to be dynamically unrelaxed than their older counterparts (in the right panel). Moreover, the left panel illustrates the fact that relaxed structures are on average in a slower accretion phase than unrelaxed structures. In order to select groups and clusters according to their MAH, we display in Fig. \ref{fig:hist_final} the distribution of formation redshift as a function of the continuous mass accretion rate for unrelaxed (left panel) and relaxed structures (right panel). Regardless of the dynamical state, we observe that $z_\text{form}$ and $\Gamma_{200\text{m}}$ are strongly correlated: Recently formed groups and clusters are in a faster accretion phase than early formed groups and structures. This relation of the formation time and accretion rate is caused by their definition; both are computed from the halo mass growth $M_{\mathrm{200m}}(t)$ as defined in Sect \ref{SECT:MAR}. These two MAH proxies are in principle related through the functional form proposed in \cite{Wechsler2002} such that $M_{200}(z)= M_{200}(z=0) \exp(-\alpha z)$ with $\alpha$ parametrizing the mass accretion rate of the halo. Our two MAH proxies, formation time and accretion rate, are assumed to account for only $\sim 70 \%$ of the scatter in mass accretion histories because of the stochastic effect of major mergers \cite[as discussed by][]{Wong2012,Chen2020}. This explains the degeneracy in the formation time - accretion rate relation that is plotted in Fig. \ref{fig:hist_final}. Fig. \ref{fig:FINAL_fig} shows that relaxed and unrelaxed groups and clusters have different ($z_{\mathrm{form}}$,$\Gamma_{\mathrm{200m}}$) distributions, with typically three main \textup{}evolutionary-dynamical populations. We highlight these populations by considering cuts in the tails of mass accretion and formation time distributions, as illustrated in Fig. \ref{fig:FINAL_fig}. Relaxed objects are formed long time ago and they are slowly accreting matter in their recent history. We also show unrelaxed halos that are also early-formed and low-accreting. The third population is constituted of late-formed unrelaxed halos that are in fast accretion phase. A small number of relaxed structures are formed late and accrete fast, but because they are rare, we did not consider them here. Focusing on these three \textit{\textup{evolutionary-dynamical populations}} of groups and clusters, we explore their anisotropy proxies in Fig. \ref{fig:FINAL_fig}. These populations are characterized by different anisotropies, that is, ellipticity and connectivity of groups and clusters, regardless of their mass. First, old and relaxed halos are rather spherical and weakly connected to their environment. These groups might have formed early enough to relax and thus lose memory of the directions of the accretion and mergers they experienced. Second, the population of the early-formed but still unrelaxed groups and clusters at the present time is characterized by intermediate connectivity and ellipticity values. This old unrelaxed sample of groups might be still in a transition\textup{} phase, that is, the halos did not have enough time to relax. They could be post-merger, that is, the result of merging systems that have not completely achieved their merger at the present time. Finally, the late-formed unrelaxed sample of clusters has significantly more anisotropic shapes, with a higher ellipticity value, and is highly connected to the large-scale cosmic web. These groups and clusters must typically be in formation phase and be strongly affected by the infalling material through connected filaments. These young unrelaxed structures might be merging or recent post-merging systems. Fast mass growth is dominated by major mergers (as detailed in \citep{Valles2020}). Moreover, as suggested by \cite{Darragh2019}, groups with the highest connectivities have encountered a major merger more recently than structures with lower connectivity. In agreement with these interpretations, previous studies have shown that unrelaxed halos tend to be the result of one or more recent significant mergers \citep[see, e.g.,][]{Hetznecker2006,DOnghia2007,Power2012,Klypin2016}. We conclude that regardless of the mass, systems still in formation phase (recently formed and in a high-accretion phase) are significantly more strongly connected to the cosmic web and have more disturbed and elliptical shapes on average than early-formed relaxed systems. \begin{figure*} \centering \includegraphics[width=0.85\textwidth]{Final3_pdf_zform_MAR.pdf} \caption{Probability distribution function of the continuous accretion rate $\Gamma_{200\text{m}}$ and the formation redshift $z_\text{form}$ for relaxed (red) and unrelaxed (blue) groups and clusters. The low \textit{p}-value of KS test (at the top of panels) confirms that relaxed and unrelaxed objects are two distinct populations in terms of their mass-assembly history. \label{fig:histogramm_zf_MAR}} \end{figure*} \begin{figure*} \centering \includegraphics[width=0.75\textwidth]{Final3_dist_pop.pdf} \caption{ Distribution of groups and clusters in formation redshift and mass accretion rate ($z_\text{form}$,$\Gamma_{200\text{m}}$) space for relaxed and unrelaxed populations separately. We highlight three main subsamples: 620 early-formed low-accreting and relaxed groups and clusters in red, 360 early-formed low-accreting and unrelaxed in yellow, and 482 late-formed fast-accreting and unrelaxed groups and clusters in blue. In gray we show the overall point distribution of the full sample. \label{fig:hist_final} } \end{figure*} \begin{figure*} \centering \includegraphics[width=0.85\textwidth]{Final3_eK_pop.pdf} \caption{Mean ellipticity (right panel) and mean connectivity (left panel) as a function of the mass, separately considering three subsamples of groups and clusters with different mass assembly histories and dynamical status: 620 early-formed low-accreting and relaxed in red, 360 early-formed low-accreting and unrelaxed in yellow, and 482 late-formed fast-accreting and unrelaxed in blue. In gray we show the point distribution of the full sample. \label{fig:FINAL_fig} } \end{figure*} \section{Discussion \label{DISCUSION}} Halo growth is commonly explored through the evolution of the halo density profile. Recently, \cite{Mostoghiu2019} have studied the density profiles of simulated clusters as a function of their mass-assembly history. They found that early-formed relaxed clusters have entered a slow-accretion phase, therefore their mass growth mostly occurs in their outskirts. In contrast, the authors showed that late-formed unrelaxed clusters are in their fast-accretion phase and their central regions are still growing. These results complement our analysis of the overall picture of cluster evolution well and show that young unrelaxed clusters are still growing in their center and thus appear nonspherical in our study, whereas old relaxed clusters are more spherical because their centers no longer grow. In addition, it is important to recall that both the evolutionary and the dynamical states of groups and clusters are most of all driven by their masses. The fraction of objects that are recently formed and/or are unrelaxed increases drastically with mass. This is the direct consequence of the hierarchical structure formation scenario in which most of the massive systems are still in formation phase because of their high accretion and recent merger activities \citep[as detailed in][e.g.]{Power2012, Giocoli2012}. Therefore this hierarchical mass assembly model explains the main effect of the mass in shaping the density field of group and cluster environments. We found that the ellipticity and connectivity are higher for massive halos because they are mostly recently formed systems \citep[also discussed in][for the ellipticity]{Despali2014}. Thus, our work tends to indicate that the mass assembly bias is indeed directly related to the intrinsic anisotropic nature of the density field imposed by the cosmic web. In agreement with \cite{Musso2018}, our results suggest that older halos with lower mass preferentially lie inside filaments or low-connected structures, while more massive and younger halos are located in the highly connected nodes. In addition to the trend governed by the mass assembly, we showed the additional contribution of the halo accretion history to the halo anisotropies. Finally, it is important to keep in mind that our results and discussions of the shape and connectivity of groups and clusters are theoretical predictions based on cosmological simulations. In observations, the measurement of group and cluster ellipticities remains uncertain given observational limitations (projection effects, resolution, signal-to-noise ratio, etc.). It is hence difficult to compare measured morphological indicators from different observables (X-ray, Sunyaev-Zeldovich effect, galaxy distribution, or lensing) with each other and with theoretical predictions. Gravitational lensing provides a unique technique for constraining the ellipticity of the total matter distribution that is directly comparable with theoretical predictions. Measuring the mean projected halo ellipticity from two-dimensional lensing shear maps, \cite{Oguri2010} reported the measurement of the ellipticity of $\sim 20$ clusters and found an excellent agreement with theoretical predictions \citep[see also][and citations within]{Evans2009, Clampitt2016B}. Recently, \cite{Gonzalez2021} measured the shape of the projected surface mass density distribution of redMaPPer galaxy clusters \citep{Redmapper} using a weak-lensing stacking technique, but did not find the expected mass-ellipticity relation from simulations. The authors discussed the possibility that the effects introduced by the contribution of the surrounding halos on the line of sight might induce an underestimation of the ellipticity, which mainly affects the high-mass halos. To the best of our knowledge, other cluster ellipticity measurements based on observations, such as using galaxy members \citep{Shin2018}, do not succeed in finding significant observational evidence that more massive clusters are more elliptical at the present time. \par\bigskip Regarding the relation between the dynamical state and the shape of clusters, \cite{Bartalucci2019} used the sparsity as a morphology proxy to recently highlight evidence that the shape of the total mass profile in massive clusters is governed by their dynamical state. In addition, \cite{Yuan2020} probed the dynamical state for 964 galaxy clusters from Chandra X-ray images and reported strong correlations of the X-ray morphology index and optical dynamical relaxation factor \citep[see also][]{Rossetti2016}. Nevertheless, it is important to note that the observational results based on both X-ray and Sunyaev-Zeldovich effect (SZ) only probe the intracluster medium of groups and clusters and mainly focus on the cluster core ($<R_{500}$). Moreover, given the collisional nature of the gaseous component of clusters, the gas mass distribution (and hence its X-ray surface brightness and the Compton $y$-parameter) is significantly more circular than the stellar and dark matter counterparts \citep[as predicted by][using hydrodynamical simulations]{Okabe2018, Harvey2021}. Moreover, simulations show that the shapes of different cluster-component distributions (stars, gas, and dark matter) qualitatively follow similar trends with halo mass, radius, and redshift \citep{Velliscig2015, Okabe2018}. \cite{Donahue2016} have confirmed this strong correlation of the morphological properties measured from X-ray (for the gas) and lensing maps (for the total mass) for $\sim 20$ CLASH galaxy clusters. In order to reach consensus about the classification of clusters in simulations and observations, \cite{DeLuca2020} explored the correlations of morphology indicators and dynamical state proxies extracted from both simulated clusters and their X-ray and Compton $y$-parameter mock images. The authors concluded that the offset parameters based on the centroids of X-ray and SZ maps are more sensitive to the dynamical state than to peak position offsets. By exploring the connection of clusters and their large-scale environment in observations, the theoretical expectation that more massive halos are more strongly connected to the cosmic web has been confirmed from large galaxy surveys \citep[see, e.g., ][]{Darragh2019, Kraljic2020}. Concerning the relation of halo environments and their dynamical state, no observational studies have statistically explored the relation of the cluster dynamical state and their connectivity so far. Only two peculiar galaxy clusters for which the connectivity and dynamical state have been individually estimated from observations can be used to illustrate our findings. First, \cite{Einasto2015,Einasto2018,Einasto2018B,Einasto2020} showed that the A2142 cluster is dynamically unrelaxed with many massive substructures that are highly connected to its large-scale environment and with an elongated shape \citep[see also][for the perturbed dynamics of A2142]{Rossetti2013}. The mass of the A2142 cluster is estimated to be $M_{200} = 1.3 \times 10^{15} M_{\odot}$ \citep{Munari2014} and is connected to approximately six or seven filaments \citep{Einasto2020}. Second, the well-studied Coma cluster \citep[see][for a review]{Biviano1998} is weakly connected to other structures in the field \citep{Mahajan2018} with a connectivity estimated between 3 and 4, as measured by \cite{Malavasi2020}. The Coma cluster seems to be in a low-accretion phase at the present time, with a mass growth of around $1/5$ since $z\sim0.2 - 0.3$ \citep{Adami2005}. However, the dynamical state of the Coma cluster is not completely established. While initially, it was classified as a relaxed system \citep{Kent1982} with a very high concentration parameter suggesting a compact and old object \citep{Lokas2003}, other observational evidence has argued in favor of a dynamically unrelaxed state: two BCGs \citep{Fitchett1987}, no cool core \citep{Neumann2003}, and its radio halo emission \citep{Thierbach2003}. In addition, \cite{Gavazzi2009} estimated that the mass of the Coma cluster is equal to $M_{200} = 5.3 \times 10^{14} M_{\odot}$. The two observational measurements of the connectivity $\kappa$ and mass of A2142 and the Coma cluster are plotted in Fig. \ref{fig:OBS}. Even though we did not statistically probe this very high mass range, the Coma cluster shows the connectivity-mass relation of an early-formed halo well (both relaxed and unrelaxed), while the A2142 cluster appears to follow the relation of late-formed unrelaxed halos that are still in the formation phase. \begin{figure} \centering \includegraphics[width=0.45\textwidth]{Final3_OBS_v2.pdf} \caption{Mean connectivity as a function of the two main populations in MAH and dynamical state, as discussed in Sect. \ref{Sect_res_final}. The two observational measurements of A2142 and the Coma cluster are shown in cyan and brown, respectively. \label{fig:OBS} } \end{figure} \section{Conclusion} It is crucial to study the anisotropic matter distribution inside and around density peaks to understand the formation and growth of massive structures. We have studied two proxies of the anisotropic matter distribution around halos: the shape (through the ellipticity), and the filamentary structure around them (through the connectivity). We probed these anisotropies for a large sample of galaxy groups and clusters with masses $>1 \times 10^{13} M_{\odot}/h$ in the IllustrisTNG hydrodynamical simulation at $z=0$ \citep{ILLUSTRIS_TNG}. The halo shape was approximated by a triaxial ellipsoid that encloses $M_{200}$ and was quantified by the ellipticity parameter, following the definition of \cite{Suto2016}. In the outskirts of groups and clusters, the anisotropic matter distribution was estimated by quantifying the number of cosmic filaments connected to halos, that is, the local connectivity. The filamentary structure detection algorithm T-ReX \citep{Bonnaire2020} was used to trace the cosmic web skeleton from the galaxy distribution in the simulation box. We then computed the connectivity by counting the number of filaments that are connected to a given halo within a sphere of $1.5 \times R_{200}$. We confirm that the halo mass is strongly related to the anisotropies in the density field. Namely, massive groups and clusters are on average significantly more elliptical \citep{Allgood2006} and more strongly connected to the cosmic web \citep{Codis2018} than low-mass groups and clusters. In additiont to the mass-driven effect, we explored additional correlations between connectivity and ellipticity, and the dynamical state and assembly history of groups and clusters of galaxies. Our major findings are summarized below.\begin{itemize} \item[(1)] In addition to the mass-driven effect, ellipticity and connectivity are correlated, such that highly connected groups and clusters tend to be more elliptical than weakly connected groups and clusters. \smallskip \item[(2)] The growth rate of groups and clusters is strongly correlated with the ellipticity and connectivity: Fast-accreting objects are on average more elliptical and more strongly connected to the cosmic web than low-accreting objects. This indicates that strongly connected objects are more elliptical because they accrete matter more rapidly, which in turn must disturb the associated matter distribution. Our results also indicate that the accretion rate scales with the connectivity such that at fixed mass, halos in nodes have a higher accretion rate than halos in filaments \citep[in agreement with the theoretical investigations of][]{Musso2018}. \smallskip \item[(3)] Both anisotropy proxies trace the dynamical state of halos: Quasi-spherical and weakly connected groups and clusters are strongly relaxed. In contrast, groups and clusters that are dynamically unrelaxed are on average significantly more elliptical and more connected. This trend holds for all mass bins. The large scatter in the well-known relaxedness-mass relation can indeed be attributed to the different anisotropic level in the density field around groups and clusters. \smallskip \item[(4)] We postulate that the relation between dynamical state and anisotropy proxies can be attributed to the different mass-assembly histories of halos. Relaxed and unrelaxed groups and clusters are two distinct populations. The dynamically unrelaxed gropus and clusters formed more recently on avearage and are in a faster accreting phase than relaxed halos. Our comprehensive analysis of the halo accretion history and dynamical state showed that there are mainly two distinct populations: the early-formed slowly accreting relaxed halo sample, and the late-formed fast-accreting unrelaxed halos. These two types of \textup{}evolutionary-dynamical states of halos present different anisotropies in their density field. Old relaxed groups and clusters acrrete matter slowly, are almost spherical, and have a weak connection to their environment. They should have lost their connection with their preferential directions of accretion and merging. In contrast, young fast-accreting and unrelaxed groups and clusters are much more elliptical and strongly connected to the overall cosmic web. This population must be in formation phase and strongly affected by the environment that feeds them abundantly. The two populations defined according to their evolutionary-dnymical state are significantly different in all mass bins, even if the fraction of recently formed objects increases with mass, in agreement with the hierarchical structure formation scenario. \end{itemize} With this first comprehensive analysis, we open new ways for relating the growth, dynamical state, and the shape of groups and clusters with their connection to the large-scale structure. Our results show that different recent accretion histories lead to different anisotropies in the matter distribution (with both distinct ellipticity and connectivity) as a second driving effect after the well-known mass effect. Our analyses show that the correlation between connectivity and halo properties is more significant for higher-mass clusters, given that low-mass groups are mainly located inside cosmic filaments \citep{Cautun2014}. We conclude that to significantly detect correlations of halo connectivity and halo properties, we need to focus on clusters with masses $M_{200}>10^{13.5} M_{\odot}/h$. By probing a larger sample of simulated clusters ($M_{200}>10^{14} M_{\odot}/h$), which are ideal structures for probing a wider range of connectivities, we intend to further explore the cosmic time evolution in the relations of the large-scale environment and cluster properties in a future work. From the observational point of view, the A2142 and Coma clusters both provide illustrations of two distinct cluster connectivities that might be the result of different mass-assembly histories. The new generation of large galaxy and cluster surveys, such as \textit{Euclid} and \textit{Dark Energy Survey}, will enable us to probe many massive clusters and to investigate the effect of large-scale structure connections on the dynamical properties of the halos. In addition, upcoming accurate multiwavelength observations of galaxy clusters such as the Cluster HEritage project \citep{Heritage2020} will allow us to probe the dynamical properties of clusters and their matter distributions from their central regions to their outskirts. They wil thus be used to test our theoretical predictions. \begin{acknowledgements} The authors acknowledge the useful comments of the anonymous referee. This research has been supported by the funding for the ByoPiC project from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation program grant agreement ERC-2015-AdG 695561 (ByoPiC, https://byopic.eu). The authors thank the very useful comments and discussions with all the members of the ByoPiC team. The authors acknowledge the use of the IllustrisTNG publicly available data. \end{acknowledgements} \bibliographystyle{aa} \input{40327corr.bbl} \end{document}
\section*{Results} \subsection{Representativeness of Facebook pages} \label{result:representativeness} Facebook friendships provides a meaningful representation of people's social ties. In the United States, the Facebook usage rate is not only high (69\% of adults), but also relatively constant across income groups, education groups, and racial groups among online US adults\cite{duggan2015social}. Furthermore, previous studies of online social networks have found a significant association between self-reported friendships and Facebook friendships\cite{gilbert2009predicting, jones2013inferring, hampton2011social}. However, while the representativeness of friendships in Facebook for real social relationships has been validated by previous studies and surveys, the representativeness of Facebook Pages for offline third places across the US has not been thorougly examined. To evaluate the representativeness of Facebook Pages, we compare the number of Facebook social place pages to the number of third place establishments observed in the County Business Patterns (CBP) dataset (See Methods). Note that it covers only a fraction of social spaces and thus falls short for our systematic investigation. \begin{figure*}[htpb] \footnotesize \centering \begin{subfigure}[t]{0.33\textwidth} \centering \includegraphics[width=\textwidth]{census_vs_fb_restaurants_log.pdf} \caption{Restaurants} \label{fig:naics_restaurant} \end{subfigure}% \begin{subfigure}[t]{0.33\textwidth} \centering \includegraphics[width=\textwidth]{census_vs_fb_places_of_worship_log.pdf} \caption{Places for Worship} \label{fig:naics_worship} \end{subfigure} \begin{subfigure}[t]{0.33\textwidth} \centering \includegraphics[width=\textwidth]{census_vs_fb_bars_log.pdf} \caption{Bars and Pubs} \label{fig:naics_bar} \end{subfigure}% \caption{Correlation between the number of establishments surveyed by the US Census and the number of Facebook's pages in similar categories (See Supplementary Information for per-capita plots, which still show significant correlation). All compared categories show significant correlations, which supports the representativeness of Facebook Pages to reveal the landscape of social places.} \label{fig:fb_vs_naics} \end{figure*} Figure~\ref{fig:fb_vs_naics}(a) to (c) show that there is a strong correlation between the logarithm of the number of social place pages and the estimated number of third place establishments per county in the CBP dataset. The Pearson's correlation coefficients range from 0.90 for Bars and Pubs to 0.98 for Restaurants. We also check the correlations of the per-capita numbers (See Supplementary Information), which still show significant correlations across all categories. Despite there still exists potential discrepancy caused by overlapped or fake Facebook Pages, the strong correlations between the number of Facebook's pages and the government-estimated number of businesses is a promising sign that Facebook Pages cover a sizeable number of real-world businesses. \subsection{Geographic and Demographic Landscape of Social Places} \label{result:landscape} Facebook Pages provide a means for individuals to connect over shared interests in hobbies, causes, businesses, or celebrities, to mention but a few categories which form the subjects of Facebook pages. Facebook Pages includes physical locations, which are of local interests. These pages on local places are arguably well-aligned with the concept of ``third places.'' Using an existing list of third place categories created by Jeffres et al.\cite{jeffres2009impact}, we systematically identify (See Methods) the pages of social places which connect people locally and may function as ``third places.'' \begin{figure*}[htpb] \centering \includegraphics[width=0.8\textwidth]{choropleth_figure.pdf} \caption{Prevalence maps of different social place categories across the United States. \textbf{(a)} Community Amenities, \textbf{(b)} Places of Worship, \textbf{(c)} Restaurants, \textbf{(d)} Bars and Pubs, \textbf{(e)} Clubs and Societies, and \textbf{(f)} Outdoor Recreation. Prevalence is measured as the number of establishiments per 1000 residents for each third place category. For visualization, each US county is assigned into a decile based on its prevalence. There exist several third place types heavily concetrating on a certain part of the US --- Places of Worship and Bars and Pubs. Also, the third places for Outdoor Recreation are distributed around famous mountain areas, which shows the association between natural environment and burgeoning types of social places. } \label{fig:cat_dist} \end{figure*} The maps of social place distribution exhibit that there is significant geographic heterogeneity between third place categories. `Bars and Pubs' and `Clubs and Societies' are more common in Midwest and Northeast, while Places for worship are more concentrated in the South. On the other hand, Community Amenities and Restaurants are more common in the West and Northeast (Figure~\ref{fig:cat_dist}(a) and (c)). Finally, Outdoor Recreation are distributed around famous mountain and lake areas, including the regions around Rocky Mountains, Appalachian, and Five Great Lakes (Figure~\ref{fig:cat_dist}(f)). \begin{figure*}[htpb] \centering \includegraphics[width=\textwidth]{parallel_figure.pdf} \caption{Comparison of the median numbers of each social places per 1000 residents in US counties across different levels of \textbf{(a)} urbanization, \textbf{(b)} median household income, \textbf{(c)} education, and \textbf{(d)} foreign-born population. Many third place types show distinct pattern based on demographic characteristics, such as Places of Worship having a dramatic decreasee with increasing urbanization, income, education, and foreign-born population. } \label{fig:cat_parallel} \end{figure*} Community characteristics and demographics play a large role in which establishments are created and persist. To better understand the relationship between demographics and prevalence of third places, we look at four characteristics and how they influence third place prevalence: urbanization, income, education, and foreign-born population. The results, shown in Figure~\ref{fig:cat_parallel}, reveals that prevalence of the four largest categories --- Retail, Beauty, Restaurants, and Places of Worship --- indeed varies with regional and demographic characteristics. Counties in the middle of the RUCC urbanization scale have the highest prevalence of retail stores, beauty shops, and restaurants (Figure~\ref{fig:cat_parallel}(a)). Places of Worship, Community Amenities, and Outdoor Recreations, in particular, are less prevalent in more urban counties. The prevalence of Places of Worship shows a stark decrease with increasing income levels. The counties in the lowest income decile tend to have about 2.5 times more places of worship per capita than the counterparts in the highest decile. By contrast, the numbers of beauty places in rich counties are higher than the number in poor counties in general. Other categories, such as Community Amenities, Bars and Pubs, Retail, and Restaurants, show the inverted-U shape, where the middle-class counties have more of those social places than either richer and poorer counterparts. As expected from the correlation between income and other demographic characteristics, the prevalence of Places of Worship shows a similar decreasing pattern with education level and foreign-born population. Community Amenities are more prevalent in the regions having medium education level and lower portion of foreign-born population, while the prevalence of Beauty and Restaurants are correlated with both the level of education and the portion of foreign-born population. The heterogeneous prevalence across the types of social place, depending on demographic characteristics of region, reveals the importance of comparative studies, in the future, to understand the role and effect of social places properly. \subsection{Social Networks of Social Places} \label{result:social_network} If types of available social places are strongly associated with geogrzphic and demographic characteristics, how about the social network around each type of social place? Are there certain characteristics of social networks that are associated with each type of social place? For instance, how does the social networks of people who frequent a Restaurant differ from those who frequent a Place of Worship? We answer this question by leveraging the Facebook friendship network of users who follow of a particular page in Facebook Pages, which we call ``follower friendship network''. This approach creates a user-to-user graph for each page, which allows us to analyze the structure of social relationships embedded in each social place. We first characterize the social network topologies around all third place categories by measuring various network features. We sampled 2,500 pages having between 50 and 50,000 followers --- to exclude extreme pages --- at random, from each of the twelve third place categories. Then, we compute multiple topological statistics of the social network of each sampled page (See Methods for more information on the extraction process). In particular, following a previous study to characterize social networks of US colleges\cite{overgoor2020structure}, we compute the following 18 network measurements with respect to the user-to-user friendship graph connecting followers of each page: density, number of edges, number of nodes, average degree, average clustering coefficient\cite{watts1998collective}, average degree assortativity\cite{newman2003mixing}, degree variance, average path length within the largest connected component, algebraic connectivity\cite{fiedler1973algebraic}, modularity of modularity-maximizing partition\cite{clauset2004finding}, and number of $k$-Cores\cite{bollobas2001cambridge} and $k$-Brace~\cite{ugander2012structural} for $k \in \{2, 4, 8, 16\}$. These measures examining various aspects in network structure allow us to capture the fragmentation and diversity of social networks, which we expect to differ by type of social place. \begin{figure*}[htpb] \includegraphics[width=\textwidth]{typical_networks.png} \caption{Typical networks for each third place category. Plot shows page follower networks that are nearest to the per-category mean ranks. Distance defined as the L2-norm against the per-category mean rank across all features, weighted by feature importance. The structure of frienship networks can provide hints about the functional role of the third places in our social lives. For instance, the prevalence of dyads and triads separated from a giant component (e.g, Restaurants) coincide with our intuition that restaurant visitors are likely to come with a small group of their existing friends, while less likely to know other people in the place. Also, the existance of core-periphery structure strongly suggests the existence of ``regulars''. } \label{fig:representative} \end{figure*} We first extract the `most representative' network for each third place category and visualize them (See Figure \ref{fig:representative}). We find that social networks for Parks and Monuments and Outdoor Recreation are sparser, less-centralized, while those for Clubs and Societies, Bars and Pubs, and Performing Arts venues are highly connected, having multiple cores. The structures of the representative friendship network reveals about the functional role of the third place type in our social lives. The coverage of the largest connected group of each friendship network may imply whether the type of third place is more for small groups of existing friends or for constructing a bigger community by bridging gaps between strangers. The representative networks that exibit many independent dyads and triads---those of Outdoor Recreation, Indoor Recreation, Restaurant, Parks and Monuments, for instance---potentially indicate that these social places are where people visit with a small group their existing friends. On the contrary, the social networks having a large connected subgraph covering most members may suggest that the social places where many visitors are likely to know each other or to be introduced to each other. Also, the existence of clear division between a group of densely-connected core members and the loosely-connected other members, called core-periphery structure, hints at the presence of ``regulars''; The friendship networks of the places having a group of core members who are densely connected to each other --- such as Places of Worship, Bars and Pubs, Community Amenities, and Indoor Recreation --- is consistent with the story that there are regulars who frequently visit the place, while other non-regulars are likely to be a friend of one of the regulars. \begin{figure*}[htpb] \footnotesize \centering \includegraphics[width=0.8\textwidth]{roc_auc_figure.pdf} \caption{\textbf{(a)} Similarity (AUC) matrix for third place categories based on their social network structure. ROC--AUC of 0.5 represents the maximal similarity (indistinguishable) and ROC--AUC of 1.0 represents the minimal similarity (perfectly distinguishable). The matrix shows roughly two groups: one with Parks and Monuments, Resturants, and Outdoor Recreation, and the other with most other categories, while Places of Worship exhibit the most distinct structure. \textbf{(b)} Descriptive statistics of the structure of friendship network associated with different third place categories. The statistics are the top ten features by importance, which is presented in Supplementary Information. } \label{fig:roc-auc} \end{figure*} We then quantify concretely the structural difference between third place categories by measuring network dissimilarity between each pair of third place categories. Here, we measure similarity between two categories as \emph{the difficulty of classification}. If a classifier cannot separate two groups of samples easily, we consider that the graphs that produced them are similar. This approach of measuring similarity with a prediction task has been used in recent studies\cite{gentzkow2019measuring, bertrand2018coming, overgoor2020structure}. For each pair of third place categories, we train a random forest classifier. We train the sampled social networks of the two categories using the 18 aforementioned topological characteristics as the features (See Methods for detail information). As a result of all possible pairs of the twelve categories, we obtain the cross-validated area under the curve (AUC) of the model for each pair of third place categories, as a measure of similarity distance between the cateogories. In other words, if the AUC is close to 0.5, the two categories cannot be easily distinguished, which can be considered as similar. On the other hand, if the AUC is close to 1.0, the two categories are easy to distinguish, which can be considered as different. The ROC--AUC distance matrix, as shown in Figure \ref{fig:roc-auc}(a), reveals that it is generally possible to distinguish between follower networks corresponding to different third place categories. Also, the matrix shows two clusters of third place categories having similar network structures to each other; 5-category cluster (Clubs and Societies, Indoor Recreation, Performing Arts, Bars and Pubs, and Community Amenities), and 3-category cluster (Outdoor Recreation, Resturants, Parks and Monuments). Places of Worship display the most distinctive pattern, indicating that social network around the Places of Worship is highly distinguishable from most other categories. Figure \ref{fig:roc-auc}(b) reveals the most informative characteristics of the friendship networks in distinguishing them across categories. We check the descriptive statistics for the top 10 features on average for each type of third place, ranked in order of importance across all classifiers (For the list of feature importance, See Supplementary Information). Aligning with the distant matrix, the topological features show clear similarity between the types within each group, while difference between the groups. Parks and Monuments, Resturants, and Outdoor Recreation are distinctive based on their Avg. Path Length, while not so regarding clustering measurements, such as Avg. Clustering, Degree Assortativity, and Density. At the same time, the third places in the 5-category cluster is distinguished from the others --- Beauty, Large Sports Venues, and Retail --- in terms of Variation of Degree, which is probably related to their core-periphery structure. It is noteworthy that the similarity of social network between third place categories is not much correlated with the types of activity or behavior in the places. For instance, social activities and behaviors in Resturants are more similar to those in Bars and Pubs than Community Amenities. However, in terms of the topology of friendship network, Bars and Pubs is closer to Community Amenities than Resturants, which is aligned with previous studies about the social role of pubs in rural area\cite{cabras2011industrial, hickman2013third, cabras2017third}. Hence, our results here imply that it is essential to take the cultural and environmental factors into account, beyond the type of activity, when studying the third places. \section*{Conclusion} In this study, we present a systematic measurement on the prevalence of various third places across the United States, by leveraging Facebook Pages dataset. Our results reveal differences in geographical distribution of social places (e.g. places of worship in the South, and bars in the Midwest), as well as the distribution with respect to demographic features, including the levels of urbanization, income, education, and foreign-born population. Our results also reveal that different kinds of third places draw upon (or facilitate) heterogeneous social network structures among the ``followers'' of their pages. For instance, Places of Worship tend to be associated with social networks that are highly clustered and feature short path lengths. Parks and Monuments, by contrast, have low clustering and longer path length, indicating a more sparsely-organized networks. Certain third place categories (e.g. Indoor Recreation and Clubs and Societies) have more similar social networks than others, and social networks systematically differ across categories. We expect that our study marks an important milestone towards the understanding of our social infrastructure and their roles in our society by exploring a unique dataset that covers all major types of social spaces and spans a whole country. Since our findings are decidedly descriptive, more work is required to ascertain the extent to which certain kinds of third places also help create and maintain social ties, as well as the extent to which third places benefit from existing social networks. A dynamic view is thus called for in future research, examining the interplay between social ties and third places. There are several limitations of this study. First, even with the strong correlation between the prevalence for third place categories in Facebook Pages and county-level CBP statistics, we cannot completely rule out the potential existence of systematic biases in our dataset. For instance, the delay between the actual opening (closing) of establishments and the creation (deletion) of their Facebook Pages may affect our findings. Second, given the existence of a digital divide, our observations may have been affected by the preferred social places for more online-friendly generations. For example, our ranking of the total number of Facebook pages (See Supplementary Information) are more consistent with the rankings presented in a previous survey based on three college town areas in Massachusetts\cite{mehta2010third}, than the social place ranking in another study based on a national telephone survey\cite{jeffres2009impact}. Even if our study could pinpoint the \emph{existence} of social places, it does not necessarily capture their \emph{size} or \emph{usage}. The number of places of worship may not reflect the number of people attending services, since the size of congregations can vary a great deal. Leveraging other datasets may address this issue in the future. During the last couple of decades, we have experienced a dramatic change in our social lives due to the emergence of a new type of social spaces --- social media. As we become more familiar with online social places such as Facebook or Twitter, this new social space becomes more related and embedded into the existing offline social places. As our favorite social places create their own websites and Facebook Pages to interact with customers online and offline social places become more interdependent. Hence, studying online and offline interactions can help us to understand the similarities and differences between these different spaces. Furthermore, examining the changes in the landscape of the social spaces --- particularly with respect to the COVID-19 pandemic and increasing interconnectedness of offline and online social lives --- as well as studying the associations between the abundance of social places and the characteristics and dynamics of local communities will be fruitful future studies. \begin{methods} \label{sec:methods} \subsection{Matching CBP cateogories with the corresponding categories in Facebook Pages} The County Business Patterns (CBP) dataset is created by surveying firms around the US and categorizing them into place categories by self-assessments to estimate the number of establishments in each category. We manually matched a subset of social place categories with their corresponding North American Industry Classification System (NAICS) codes. For each matched categories, we compare the estimated number of establishments in the CBP dataset to the number of Facebook pages in the category. The matching table between our social place categories and NAICS codes is presented in Supplementary Information. \subsection{Extraction of third place pages in Facebook Pages} Since Facebook pages can fall into a number of categories, we create a data-driven taxonomy of Facebook Pages that represents social places. In doing so we made use of a dataset of over 6 million local pages with between 50 and 50,000 US followers, people who clicked ``like'' or ``follow'' on the page to follow its posts and updates. In Facebook Pages, page administrators choose up to 3 page categories for their pages --- for instance, a page may be identified as both ``AMERICAN\_RESTAURANT'', ``RESTAURANT'', and ``FOOD'' in the Facebook page category. Using a set of page categories for each page, we trained a word2vec model\cite{mikolov2013distributed}\footnote{In particular, we applied the implemented version of word2vec model in the \texttt{gensim} package\cite{rehurek_lrec}}. For every broad category indicated by a previous work\cite{jeffres2009impact}, we choose a Facebook Pages' category that could reasonably represent the broader category. For instance, ``AMERICAN\_RESTAURANT'' was chosen for the ``restaurants'' categories. The top 300 terms, in terms of their distance in the embedded space were then examined for each category, with the research team filtering categories that were judged to not fit the notion of third place. For instance, categories such as ``COMPETITION'' were excluded for not indicating a place, whereas ``MEDICAL\_HEALTH'' was excluded due to the ambiguous nature of the category, and so on. We also removed ``SCHOOLS'' from our consideration as they represent workplace (``second places'', rather than ``third places'') for students. Inspection of the data further led us to combine ``Restaurants'' and ``Cafes'' into a single category, as we did with Community Centers, Senior Centers, and Libraries. Finally, we opted for a different categorization of recreation venues --- instead of distinguishing only between community centers, indoors recreation, and outdoors recreation, we focused on Community Amenities, Performing Arts venues, Parks and Monuments, Indoor Recreation, Non-Urban Outdoor Recreation, and Large Sports Venues. \begin{table} \scriptsize \centering \begin{tabular}{|c|l|} \hline \textbf{Third Place Types} & \textbf{Facebook Pages Category} \\ \hline Places of workship & \textbf{BUDDHIST\_TEMPLE, CHURCH, HINDU\_TEMPLE, CATHOLIC\_CHURCH, MOSQUE,} \\ & \textbf{SYNAGOGUE}, CHRISTIAN\_SCIENCE\_CHURCH, SEVENTH\_DAY\_ADVENTIST\_CHURCH, \\ & ASSEMBLY\_OF\_GOD, CHURCH\_OF\_CHRIST \\ \hline Restaurants & \textbf{AMERICAN\_RESTAURANT}, ITALIAN\_RESTAURANT, EASTERN\_EUROPEAN\_RESTAURANT, \\ & JAPANESE\_RESTAURANT, MONGOLIAN\_RESTAURANT, BUNSIK\_RESTAURANT \\ \hline Bars & \textbf{TOPIC\_BAR}, WHISKY\_BAR, TIKI\_BAR, IRISH\_PUB, BEER\_BAR, WINE\_BAR \\ \hline Community Amenities & \textbf{COMMUNITY\_CENTER, MODERN\_ART\_MUSEUM, SENIOR\_CENTER, TOPIC\_LIBRARY,}\\ & \textbf{TOPIC\_MUSEUM}, COMMUNITY\_MUSEUM, HISTORY\_MUSEUM, PUBLIC\_GARDEN, \\ & COMMUNITY\_GARDEN, ART\_MUSEUM \\ \hline Performing Arts & \textbf{LIVE\_MUSIC\_VENUE, SYMPHONY, THEATRE, TOPIC\_CONCERT\_VENUE}, COMEDY\_CLUB,\\ & OPERA\_HOUSE, PERFORMANCE\_ART, AUDITORIUM, PERFORMING\_ARTS \\ \hline Parks and Monuments & \textbf{AQUARIUM, ARBORETUM, DOG\_PARK, MONUMENT, PICNIC\_GROUND, PROMENADE, ZOO}, \\ & WATER\_PARK, PUBLIC\_GARDEN, STATUE\_FOUNTAIN, RESERVOIR, WILDLIFE\_SANCTUARY \\ \hline Indoor Recreation & \textbf{BOWLING\_ALLEY, MOVIE\_THEATRE}, DRIVING\_RANGE, DRIVEIN\_MOVIE\_THEATER, \\ & HAUNTED\_HOUSES, KARAOKE, GO\_KARTING \\ \hline Non-Urban Outdoor Recreation & \textbf{HIKING\_TRAIL}, TOPIC\_MOUNTAIN, ATV\_RENTAL\_SHOP, FISHING\_STORE, \\ & GLACIER, FISHING\_CHARTER \\ \hline Large Sports Venues & \textbf{FOOTBALL\_STADIUM}, FIELD, BASEBALL\_STADIUM, RUGBY\_PITCH, SOCCER\_STADIUM, \\ & CRICKET\_GROUND \\ \hline Clubs and Societies & \textbf{GYM, SOCIAL\_CLUB}, BASKETBALL\_COURT, BOWLING\_ALLEY, FENCING\_CLUB, \\ & SALSA\_CLUB, BOXING\_STUDIO \\ \hline Retail & \textbf{SHOPPING\_MALL}, CLOTHING\_STORE, SPORTSWEAR\_STORE, POPUP\_SHOP, \\ & FROZEN\_YOGURT\_SHOP, FASHION\_DESIGNER \\ \hline Beauty & \textbf{BARBER\_SHOP, HAIR\_SALON}, TANNING\_SALON\_SUPPLIER, COSMETICS\_BEAUTY\_SUPPLY, \\ & SKIN\_CARE\_SERVICES, HAIR\_REPLACEMENT, MASSAGE \\ \hline \end{tabular} \caption{Third place categories and matched Facebook Pages categories. Top categories for each type are presented in bolded text. See Supplementary Information for full listing.}\label{tab:cat_ex} \end{table} The full results of our categorization exercise are shown in Supplementary Information, which shows the list of the twelve social place categories and the examples of the Facebook page categories corresponding to each social place category. As a result of the previously-outlined procedure, 453 Facebook page categories matched with one of the 12 social place ``super-categories.'' Altogether these ``social place pages'' account for 37.3\% of all US local Facebook pages with between 50 and 50,000 fans. Based on this table, we then filtered and matched the local places in Facebook Pages belonging each of the following twelve social place categories: places of worship, restaurants, bars, community amenities, performing arts, parks and monuments, indoor recreation, non-urban outdoor recreation, large sports venues, clubs and societies, retail, and beauty. We use the number of pages in a category per one thousand residents, based on the county-level population estimates in 2018 by US Census, which allows us to control for the population of US counties. Since each page in Facebook pages has up to three categories, we adjust the weight of a page for counting, by dividing one by the number of categories that a page has. For instance, if one page has two categories, 0.5 pages are counted for the two categories, respectively. \subsection{Demographic records of counties} As a proxy of the urbanization level of a county, we use The 2013 Rural-Urban Continuum Codes (RUCC) created by the Office of Management and Budget (OMB) of the United States. RUCC is a classification scheme to distinguish metropolitan counties by the population size of their metro area, and nonmetropolitan counties by degree of urbanization and adjacency to a metro area. Under this scheme, US counties are coded from 1 (Counties in metro areas of 1 million population or more) to 9 (Completely rural or less than 2,500 urban population, not adjacent to a metro area), based on the population and adjacency to a metro area. For regional income, we utilized median household income records for each county from 2018 American Community Survey (ACS). Also, for education and foreign-born population, we use the number of people aged 25 or older who have higher than college degree in each county and the proportion of foreign-born residents in each county, respectively, from 2006-2010 ACS. To visualize demographic patterns in third place distributions, we compute the number of third places per 1000 residents for each county. We then compute the median for each RUCC code and for each decile in terms of the income, education, and foreign-born population proxies. \subsection{Extracting social graphs of Facebook Pages} For each of 2,500 randomly sampled Facebook Pages of each of the twelve third place categories, we extract the friendship network of the users who are the fan of the page. Then, we map the page to its corresponding third place category, and calculate the topological features of our interests, associated with the category. Finally, after mapping the topological features into each category, all network information is discarded. Since this study is only interested in the topological structure of each third place category, the entire process constitutes appropriate aggregations for each step, which carry no personally identifiable information. \subsection{Measuring similarity between social networks} We trained 66 binary random forest classifiers --- one for each possible pair of different third place categories. The classifiers were trained under 10-fold cross-validation, using the \texttt{scikit-learn} Python package\cite{pedregosa2011scikit} to distinguish between page follower networks coming from either one of the paired categories. Feature importance, averaged across all classifier runs, reveals average clustering, mean degree, and degree assortativity as the most discriminative features. The list of importance for all 18 features are presented in Supplementary Information. This ordering suggests that the classifier is picking up on non-trivial structural differences in the make-up of page follower networks, rather than simply focusing on the number of followers (10/18 in terms of average importance) or density (4/18). \end{methods}
\section{Introduction} \label{sec:introduction} In recent decade, deep learning has attracted increasing research interests for the studies of medical imaging computing and its applications. One of the biggest challenges in applying deep learning to the medical imaging domain is to learn generalizable feature patterns from small datasets or a limited number of annotated samples. Deep learning based methods require a large amount of annotated training samples to support the inference which is hard to be fulfilled on medical imaging analysis~\cite{roth2015improving,litjens2017survey,zhang2019multi}. In medical imaging tasks, annotations are conducted by radiologists with expert knowledge about the data and the related tasks. Benefit from increasingly released medical datasets and grand challenges, the shortage of dataset is relieved to some extent. However, those datasets are still in limited size as they inevitably require laborious work from radiologists~\cite{frid2018gan}. To overcome this problem, data augmentation has been popularly utilized. The most commonly used data augmentation strategy is dataset manipulation including various simple modifications of the data, such as translation, rotation, flip, crop, and scale~\cite{chen2020residual,chen2020momentum}. These data augmentation methods have been widely applied to enrich the training set, thereby improving the model performance in various computer vision tasks~\cite{zhu2017unpaired,liu2017unsupervised}. Image modification can introduce some pixel-level side information to improve the performance. However, pixel-level modification cannot introduce new images but only the variants of the original one, and hence is still likely to suffer from the over-fitting problem. Instead, synthetic data augmentation method is considered to be more reasonable alternative as it can generate sophisticated types of data based on the original images. Generative adversarial networks (GAN) is a representative of the synthetic data augmentation method~\cite{goodfellow2014generative} and capable of providing more variability to enrich the dataset. Inspired by the game theory, GAN aims to achieve the nash equilibrium~\cite{goodfellow2014generative} inside the model. GAN consists of two major networks which are trained jointly under an adversarial setting, where one network generates fake images based on inputs and the other network distinguishes the generated images from the real images. GANs have been increasingly applied to image synthesis~\cite{goodfellow2014generative,gulrajani2017improved}, such as denoising~\cite{yang2018low}, image translation~\cite{isola2017image}, etc. In addition, multiple variants of GANs were proposed to generate high quality realistic natural images~\cite{mirza2014conditional}, story visualization~\cite{li2019storygan}, and synthesize high-resolution images based on the low-resolution one~\cite{ledig2017photo}. \begin{figure*}[ht] \centering \includegraphics[width=\linewidth]{JBHI.pdf} \caption{Structure of the proposed model. Given an arbitrary class $c_t \in \mathcal{C}$, our model can generate the corresponding images based on sampled image $x_j$. Two different samples will be sampled from the given class $c_t$ each time to support the discriminator. $x_j$ will be encoded into a latent representation and concatenated with the Gaussian variable as the final representation to be used for generation. The generated image $x_g$ will be fed into discriminator together with real data $x_i,x_j$. The discriminator is designed to distinguish two distributions, i.e., true distribution $\{x_i,x_j\}$ and fake distribution $\{x_i,x_g\}$. The generator aims to make those two distributions as similar as possible.} \label{fig:structure} \end{figure*} Recently, several studies on medical imaging adopted the GANs and their variants as the main framework~\cite{frid2018gan,zhang2019noise,nie2017medical}. Most studies have employed the GAN technique for generating images or medical cross-modality translations. Zhang et al.~\cite{zhang2019noise} applied GAN to reduce the intrinsic noises in multi-sourced dataset as different devices would generate different types of noises and such site effects would significantly affect data distribution. Zhang et al.~\cite{zhang2019skrgan} proposed SkrGAN by incorporating the global contextual information which is fine foreground structures to improve the image quality. Xue et al. ~\cite{xue2018segan} used two GANs to learn the relationship between brain MRI images and a brain tumor segmentation map. Fird et al.~\cite{frid2018gan} utilized GAN to generate liver lesion images to improve the CNN classification performance. Besides, GANs have also been successfully applied to segmentation. Dong et al.~\cite{dong2019neural} adopted GAN to do the neural architecture search to find the best way to make the segmentation for chest organs. Khosravan et al.~\cite{khosravan2019pan} introduced a projection module into GAN to boost the performance of segmentor on the lung. However, most of the existing studies have been focusing on a specific task or domain, and there is no robust method that is generalizable across various domains. In this study, we aim to design a domain-free GAN structure which is suitable for any domains instead of a specific one. Specifically, the proposed method can be used in any domain such as X-Ray, CT scan, pathology etc. In addition, vanilla GANs suffer from the training instability problem which is hard to make the model converge~\cite{arjovsky2017wasserstein}. We employ the Wasserstein GAN as the main framework in our model as it has shown higher training stability. U-Net is a well-known structure on medical imaging analysis, especially in segmentation~\cite{chen2020residual,zhou2018unet++}. Segmentation aims to find the pixel-level abnormality, which requires strong feature extraction capability. The generator in GANs requires a similar capability. Hence, we utilize U-Net as the generator in our study. U-Net is similar to auto-encoder which can learn the latent representation and reconstruct the output with the same size as the input. In order to fulfill the generation requirement, we concatenate a Gaussian variable into the latent representation to ensure that it will not generate the same image each time. The major contribution of our study can be summarized as following: The contribution of this paper can be summarized as following: \begin{itemize} \item We propose a new variant of GAN named generative adversarial U-Net for the domain-free medical image augmentation. Images generated by the proposed method have a better quality than vanilla GANs and its well-known variant conditional GANs. \item To leverage the superior features extraction capability, we first dissemble U-Net into encoder and generator. Then, we assemble the generator into the GAN structure to generate images. \item Extensive experiments are conducted on eight different datasets in different domains include CT scan, Pathology, Chest X-Ray, Dermatoscope, Ultrasound, and Optical Coherence Tomography. Experimental results demonstrate high generalizability and robustness across various data domains. \end{itemize} \section{Methodology} In this section, the proposed generative adversarial U-Net will be briefly introduced. We will start by describing the overall structure of the developed deep learning model followed by explaining the components including Residual U-Net generator, discriminator and the training strategy. The overall flowchart of our developed method is illustrated in Fig.~\ref{fig:structure}. \subsection{Overview} U-Net was first proposed in~\cite{ronneberger2015u} and has been widely used in medical image segmentation~\cite{chen2020residual}. It is a type of artificial neural network by using the auto-encoder structure with skip connections. The encoder is designed to extract features from the given images and the decoder is to construct the segmentation map by using those extracted spatial features. The encoder follows a similar structure like fully convolutional networks (FCN)~\cite{long2015fully} with the stacked convolutional layers. To be specific, the encoder consists of a sequence of blocks for down-sampling operations, with each block including several convolution layers followed by max-pooling layers. The number of filters in the convolutional layers is doubled after each down-sampling operation. In the end, the encoder outputs a learned feature map for the input image. Differently, the decoder is designed for up-sampling and constructing the image segmentation. The decoder first utilizes a deconvolutional layer to up-sample the feature map generated by the encoder. The deconvolutional layer contains the transposed convolution operation and will halve the number of filters in the output. It is followed by a sequence of up-sampling blocks which consist of two convolution layers and a deconvolutional layer. Then, another convolutional layer is used as the final layer to generate the segmentation result. The final layer adopts Sigmoid function as the activation function while all other layers use ReLU function. In addition, the U-Net concatenates parts of the encoder features with the decoder, which is known as the skip-connection in ResNet~\cite{he2016deep}. For each block in the encoder, the result of the convolution before the max-pooling is transferred to the decoder symmetrically. In decoder, each block receives the feature representation learned from encoder, and concatenates them with the output of the deconvolutional layer. The concatenated result is then forwardly propagated to the consecutive block. This concatenation operation is useful for the decoder to capture the possible lost features by the max-pooling~\cite{zhou2018unet++}. \subsection{U-Net Based Generative Model} As mentioned previously, U-Net demonstrates state-of-the-art performance on medical image segmentation task, showing its superiority on the medical image feature extraction. Hence, we utilize the U-Net as the main structure for the proposed generative model. GANs $G(z)$ are generative models that aim to learn a mapping from a random noise vector $z$ to the output image $x_g$, $G:z\rightarrow x_g$~\cite{goodfellow2014generative}. \begin{align} z \in \mathcal{N}(0,I) \label{eq1} \end{align} However, the images generated by GANs are randomized which is hard to define the label. Hence, we use the conditional GANs~\cite{mirza2014conditional} instead. Conditional GANs learn a mapping from a random noise vector $z$ and observed images $x_i$ for class $c_{t}$ to the output image $x_g$, $G_c:(z,x_i)\rightarrow x_g$. Generator $G$ is trained to generate images that cannot be distinguished from the ``real'' images by an adversarial trained discriminator $D$. Discriminator $D$ is trained to detect fake images produced by generator. Alternatively, GANs are designed to conduct the distribution discrepancy measurement between the generated data and real data. \begin{table*}[ht] \centering \caption{Summary description for the datasets used in our experimental study.} \begin{tabular}{c|c|c|c|c|c} \hline Name & Modality & Tasks & \# Training & \# Validation & \# Test\\ \hline NCT-CRC-HE-100K & Pathology & Multi-Class(9) & 70,000 & 10,000 & 20,000 \\ ChestXray8 & Chest X-ray & Multi-Class(14) & 78,468 & 11,219 & 22,433 \\ HAM10000 & Dermatoscope & Multi-Class(7) & 7,007 & 1,003 & 2,005 \\ OCT 2017 & OCT & Multi-Class(4) & 76,516 & 10,930 & 21,863 \\ X-Ray OCT 2017 & Chest X-Ray & Binary(2) & 4,099 & 386 & 1,171 \\ LUNA & Lung CT & Multi-Class(3) & 622 & 88 & 178 \\ BreastUltra & Breast Ultrasound & Binary(2) & 546 & 78 & 156\\ LiTS & Abdominal CT & Multi-Class(11) & 41,195 & 5,885 & 11,770\\ \hline \end{tabular} \label{tab:stat} \end{table*} The objective function of the conditional GANs can be expressed as: \begin{align} \mathcal{L}_{c}(G_{c},D) = & \mathbb{E}_{x_{i},x_{g}}[\log D(x_{i},x_{g})] \nonumber\\ & + \mathbb{E}_{x_{i},z}[\log (1-D(x_{i},G_{c}(x_{i},z)))] \label{eq2} \end{align} where $G_c$ tries to minimize the objective function against $D$ that tries to maximize it. Mathematically, it is formulated as follows: \begin{align} G = \arg \min_{G_c}\max_D \mathcal{L}_c(G_c,D) \label{eq3} \end{align} where $G$ is the result generator when Eq.\eqref{eq3} reaches the Nash equilibrium. However, conditional GANs have similar limitations with the traditional GANs, which suffers from training instability and model collapse problems. Hence, we use the Wasserstein GAN~\cite{arjovsky2017wasserstein} as the main structure for our generative model. To be specific, a normal GAN minimizes JS-Divergence which is shown on Eq.\eqref{eq2}, whereas objective function for Wasserstein GAN is: \begin{align} \mathcal{L}_w(G_w,D_w) = &\mathbb{E}_{x_i,z}[(D_w(x_i,G_w(x_i,z)))]\nonumber\\ & - \mathbb{E}_{x_i,x_g}[D_w(x_i,x_g)] \label{eq4} \end{align} Furthermore, an gradient penalty is introduced~\cite{gulrajani2017improved} to enforce the Lipschitz constraint for Wasserstein GAN which is: \begin{align} \lambda \mathbb{E}_{\hat{x}\sim \mathbb{P}_{\hat{x}}}[(\|\nabla_{\hat{x}}D(\hat{x})\|_2 -1)^2] \label{eq5} \end{align} where the $\mathbb{P}_{\hat{x}}$ sampling uniformly along straight lines between pairs of points sampled from the data distribution and generator distribution. The $\hat{x}$ is the combination of the original images and generated ones sampled from an uniform distribution $\mathcal{U}(0,1)$ with a control factor $\epsilon$. A generative adversarial network could be used to conduct data augmentation. Given a certain class $c_t$ and corresponding data point $x$, we are able to learn a representation of the input image $r_x$ through the encoder such that $r_x = g(x)$ where $g(\cdot)$ represents the encoder network. In addition, a latent Gaussian variable $z_i$ is introduced into the learned representation to provide the variation with the following form \begin{align} z_i \in g_l(\mathcal{N}(0,I)) \end{align} where $g_l$ is the linear projection to project the Gaussian noise into vector form so that it can be concatenated with the learned representation. Once the representation is learned, it will be fed into the generator to generate images. In the proposed method, U-Net is split up into encoder and generator. The structure of U-Net can be found in the right side of Fig.~\ref{fig:structure}. The ResNet block is used as the basic unit, which is defined as \begin{align} F(k) = \sum_{j=1} w_jk_j + r_k \end{align} where $k_j$ is $k-th$ layer and $w_j$ is the corresponding trainable weight and $r_k$ is the residual. In addition, different from the traditional U-Net, we use leaky ReLU $f(x)$ as the activation function. \begin{align} f(x)=\begin{cases} 0.01x & x\leq 0 \\ x & x> 0 \end{cases} \end{align} It is worth noting that the generated image $x_g$ and original image $x_j$ are both provided to the discriminator. We want to ensure that the generator is capable of generating the image that is related to but different from the original image $x_j$. That is, the generated image $x_g$ is supposed to be drawn from the same class as $x_j$ other than just a duplicate or simple modification of $x_j$. By providing the current image $x_j$, we can prevent generator from simply encoding it. In addition, the class information is provided where the generator can better learn the generalized pattern across all classes. \subsection{Model Architectures} The generator contains eight blocks where each block has four $3\times 3$ convolutional layers with batch renormalization~\cite{ioffe2017batch} followed by a downscaling or upscaling layer. Downscaling layers are convolutions with stride 2 followed by leaky ReLU, batch normalization and dropout. Upscaling layers are deconvolution with stride $\frac{1}{2}$ followed by leaky ReLU, batch renormalization and dropout. As aforementioned, we also maintain the skip-connections inside the generator. We use the similar strategy with ResNet, we use a $1\times 1$ convolutional layer to pass features between blocks. DenseNet~\cite{huang2017densely} is adopted as the discriminator. Layer normalization is applied instead of batch normalization as we find it has a better performance. Discriminator contains four dense blocks and four transition layers where each dense block contains four convolutional layers and ends with a dropout layer. The reason why we apply the dropout at the last layer is that it can avoid the overfitting. \subsection{Optimization} To optimize our networks, we follow the standard approach introduced in~\cite{goodfellow2014generative}: alternately update one gradient descent step on $D$, then one step on $G$. As suggested in the original WGAN paper, we train the model based on the algorithm~\ref{alg:d}. \begin{algorithm}[ht] \SetAlgoLined \SetKwInOut{Input}{input} \Input{gradient penalty coefficient $\lambda$, Adam parameter $\alpha,\beta_1,\beta_2$, batch size $m$, input image $x_i$} \Input{discriminator parameter $w_0$, generator parameter $\theta_0$} \While{$\theta$ not converged}{ \For{$t=1,\cdots$}{ \For{$i=1,\cdots,m$}{ Sample real data $x_j$, random noise from Eq.\eqref{eq1}, random number $\epsilon\sim \mathcal{U}(0,1)$\; $x_g = G_\theta(z,x_j)$\; $\hat{x} = \epsilon x_i + (1-\epsilon) x_g$\; $L^i = $Eq.\eqref{eq4} + Eq.\eqref{eq5}\; } $w \leftarrow$ Adam($\nabla_w \frac{1}{m}\sum_{i=1}^m L^i,w,\alpha,\beta_1,\beta_2$)\; } Sample batch of latent variable $\{z_i\}_{i=1}^m \sim \mathcal{N}(0,I)$\; $\theta\leftarrow$ Adam($\nabla_\theta \frac{1}{m}\sum_{i=1}^m -D_w(x_g)),\theta,\alpha,\beta_1,\beta_2$)\; } \caption{Training algorithm for our model} \label{alg:d} \end{algorithm} \begin{table*}[ht] \centering \caption{Quantitative comparison of the quality of generated images with 95\% confidence interval.} \begin{tabular}{c|cc|cc|cc|cc} \hline & \multicolumn{2}{c|}{NCT-CRC-HE} & \multicolumn{2}{c|}{ChestXray8} & \multicolumn{2}{c|}{HAM10000} & \multicolumn{2}{c}{OCT 2017} \\ \hline & FID$\downarrow$ & PA$\uparrow$ & FID & PA & FID & PA & FID & PA \\ \hline GAN & 41.65 $\pm$ 0.12 & 0.52 $\pm$ 0.11 & 40.02 $\pm$ 0.22 & 0.51 $\pm$ 0.09 & 47.02 $\pm$ 0.12 & 0.40 $\pm$ 0.10 & 42.12 $\pm$ 0.18 & 0.51 $\pm$ 0.08\\ CGAN & 32.65 $\pm$ 0.05 & 0.65 $\pm$ 0.08 & 30.88 $\pm$ 0.09 & 0.59 $\pm$ 0.05 & 45.52 $\pm$ 0.11 & 0.44 $\pm$ 0.09 & 37.72 $\pm$ 0.15 & 0.58 $\pm$ 0.06\\ Ours & \textbf{29.65 $\pm$ 0.06} & \textbf{0.68 $\pm$ 0.07} & \textbf{20.78 $\pm$ 0.07} & \textbf{0.63 $\pm$ 0.06} & \textbf{42.22 $\pm$ 0.10} & \textbf{0.50 $\pm$ 0.06} & \textbf{34.22 $\pm$ 0.12} & \textbf{0.61 $\pm$ 0.04}\\\hline \end{tabular} \begin{tabular}{c|cc|cc|cc|cc} \hline & \multicolumn{2}{c|}{X-Ray OCT} & \multicolumn{2}{c|}{LUNA} & \multicolumn{2}{c|}{BreastUltra} & \multicolumn{2}{c}{LiTS} \\ \hline & FID$\downarrow$ & PA$\uparrow$ & FID & PA & FID & PA & FID & PA \\ \hline GAN & 47.02 $\pm$ 0.12 & 0.40 $\pm$ 0.10 & 62.65 $\pm$ 0.22 & 0.33 $\pm$ 0.08 & 63.02 $\pm$ 0.12 & 0.35 $\pm$ 0.10 & 43.12 $\pm$ 0.13 & 0.51 $\pm$ 0.07\\ CGAN & 45.32 $\pm$ 0.11 & 0.43 $\pm$ 0.09 & 60.15 $\pm$ 0.18 & 0.37 $\pm$ 0.07 & 61.62 $\pm$ 0.11 & 0.41 $\pm$ 0.09 & 42.01 $\pm$ 0.11 & 0.53 $\pm$ 0.09 \\ Ours & \textbf{41.88 $\pm$ 0.10} & \textbf{0.52 $\pm$ 0.08} & \textbf{52.15 $\pm$ 0.13} & \textbf{0.49 $\pm$ 0.08} & \textbf{55.62 $\pm$ 0.09} & \textbf{0.48 $\pm$ 0.07} & \textbf{37.98 $\pm$ 0.14} & \textbf{0.59 $\pm$ 0.07}\\\hline \end{tabular} \label{tab:gan_result} \end{table*} \begin{table*}[ht] \centering \caption{Classification results for top-5 with 95\% confidence interval with(W) and without(W/O) augmentation} \begin{tabular}{>{\rowmac}c>{\rowmac}c|>{\rowmac}c>{\rowmac}c>{\rowmac}c>{\rowmac}c|>{\rowmac}c>{\rowmac}c>{\rowmac}c>{\rowmac}c<{\clearrow}} \hline \multirow{2}{*}{} & & \multicolumn{4}{c|}{NCT-CRC-HE} & \multicolumn{4}{c}{ChestXray8} \\ \cline{3-10} & & Acc & Pre & Rec & AUC & Acc & Pre & Rec & AUC \\ \hline \multirow{2}{*}{ResNet18} & W & \setrow{\bfseries} 0.889 $\pm$ 0.07 & 0.859 $\pm$ 0.08 & 0.866 $\pm$ 0.09 & 0.980 $\pm$ 0.10 & 0.942 $\pm$ 0.10 & 0.920 $\pm$ 0.18 & 0.930 $\pm$ 0.16 & 0.970 $\pm$ 0.11\\ & W/O& 0.806 $\pm$ 0.09 & 0.783 $\pm$ 0.11 & 0.792 $\pm$ 0.14 & 0.945 $\pm$ 0.12 & 0.921 $\pm$ 0.11 & 0.908 $\pm$ 0.13 & 0.916 $\pm$ 0.13 & 0.958 $\pm$ 0.16\\ \hline \multirow{2}{*}{ResNet50} & W & \setrow{\bfseries} 0.892 $\pm$ 0.08 & 0.831 $\pm$ 0.06 & 0.866 $\pm$ 0.07 & 0.977 $\pm$ 0.05 & 0.959 $\pm$ 0.08 & 0.930 $\pm$ 0.07 & 0.941 $\pm$ 0.06 & 0.979 $\pm$ 0.06\\ & W/O & 0.846 $\pm$ 0.09 & 0.820 $\pm$ 0.09 & 0.831 $\pm$ 0.11 & 0.969 $\pm$ 0.08 & 0.947 $\pm$ 0.07 & 0.922 $\pm$ 0.08 & 0.931 $\pm$ 0.09 & 0.921 $\pm$ 0.09\\ \hline \multirow{2}{*}{DenseNet161} & W & \setrow{\bfseries} 0.888 $\pm$ 0.07 & 0.825 $\pm$ 0.08 & 0.860 $\pm$ 0.09 & 0.974 $\pm$ 0.07 & 0.949 $\pm$ 0.05 & 0.932 $\pm$ 0.06 & 0.940 $\pm$ 0.06 & 0.971 $\pm$ 0.07\\ & W/0 & 0.840 $\pm$ 0.09 & 0.812 $\pm$ 0.10 & 0.821 $\pm$ 0.10 & 0.958 $\pm$ 0.08 & 0.927 $\pm$ 0.09 & 0.902 $\pm$ 0.08 & 0.912 $\pm$ 0.09 & 0.910 $\pm$ 0.09\\ \hline \multirow{2}{*}{SVM} & W & \setrow{\bfseries} 0.791 $\pm$ 0.18 & 0.768 $\pm$ 0.17 & 0.770 $\pm$ 0.18 & 0.891 $\pm$ 0.12 & 0.823 $\pm$ 0.20 & 0.802 $\pm$ 0.19 & 0.814 $\pm$ 0.18 & 0.900 $\pm$ 0.19\\ & W/O & 0.721 $\pm$ 0.17 & 0.708 $\pm$ 0.16 & 0.710 $\pm$ 0.18 & 0.802 $\pm$ 0.13 & 0.800 $\pm$ 0.19 & 0.782 $\pm$ 0.16 & 0.790 $\pm$ 0.15 & 0.811 $\pm$ 0.13 \\ \hline \end{tabular} \begin{tabular}{>{\rowmac}c>{\rowmac}c|>{\rowmac}c>{\rowmac}c>{\rowmac}c>{\rowmac}c|>{\rowmac}c>{\rowmac}c>{\rowmac}c>{\rowmac}c<{\clearrow}} \hline \multirow{2}{*}{} & & \multicolumn{4}{c|}{HAM10000} & \multicolumn{4}{c}{OCT 2017} \\ \cline{3-10} & & Acc & Pre & Rec & AUC & Acc & Pre & Rec & AUC \\ \hline \multirow{2}{*}{ResNet18} & W & \setrow{\bfseries} 0.802 $\pm$ 0.07 & 0.788 $\pm$ 0.06 & 0.790 $\pm$ 0.07 & 0.932 $\pm$ 0.05 & 0.810 $\pm$ 0.07 & 0.775 $\pm$ 0.06 & 0.781 $\pm$ 0.07 & 0.940 $\pm$ 0.05\\ & W/O& 0.750 $\pm$ 0.09 & 0.722 $\pm$ 0.08 & 0.731 $\pm$ 0.07 & 0.911 $\pm$ 0.06 & 0.757 $\pm$ 0.07 & 0.729 $\pm$ 0.07 & 0.740 $\pm$ 0.06 & 0.904 $\pm$ 0.07\\ \hline \multirow{2}{*}{ResNet50} & W & \setrow{\bfseries} 0.800 $\pm$ 0.06 & 0.777 $\pm$ 0.07 & 0.781 $\pm$ 0.05 & 0.930 $\pm$ 0.06 & 0.801 $\pm$ 0.08 & 0.769 $\pm$ 0.07 & 0.775 $\pm$ 0.06 & 0.937 $\pm$ 0.05\\ & W/O & 0.744 $\pm$ 0.06 & 0.723 $\pm$ 0.07 & 0.732 $\pm$ 0.05 & 0.910 $\pm$ 0.06 & 0.751 $\pm$ 0.07 & 0.737 $\pm$ 0.06& 0.734 $\pm$ 0.05 & 0.902 $\pm$ 0.05\\ \hline \multirow{2}{*}{DenseNet161} & W & \setrow{\bfseries} 0.801 $\pm$ 0.08 & 0.775 $\pm$ 0.06 & 0.779 $\pm$ 0.07 & 0.925 $\pm$ 0.07 & 0.799 $\pm$ 0.07 & 0.753 $\pm$ 0.05 & 0.761$\pm$ 0.06 & 0.929$\pm$ 0.06\\ & W/O& 0.739 $\pm$ 0.06 & 0.718 $\pm$ 0.09 & 0.721 $\pm$ 0.08 & 0.899 $\pm$ 0.05 & 0.741 $\pm$ 0.07 & 0.703 $\pm$ 0.06 & 0.714 $\pm$ 0.07 & 0.890 $\pm$ 0.05\\ \hline \multirow{2}{*}{SVM} & W & \setrow{\bfseries} 0.701 $\pm$ 0.11 & 0.681 $\pm$ 0.10 & 0.690 $\pm$ 0.11 & 0.887 $\pm$ 0.09 & 0.732 $\pm$ 0.12 & 0.700 $\pm$ 0.09 & 0.711 $\pm$ 0.10 & 0.886 $\pm$ 0.08\\ & W/O & 0.678 $\pm$ 0.08 & 0.650 $\pm$ 0.09 & 0.660 $\pm$ 0.09 & 0.867 $\pm$ 0.08 & 0.699 $\pm$ 0.10 & 0.671 $\pm$ 0.07 & 0.679 $\pm$ 0.08 & 0.876 $\pm$ 0.06 \\ \hline \end{tabular} \begin{tabular}{>{\rowmac}c>{\rowmac}c|>{\rowmac}c>{\rowmac}c>{\rowmac}c>{\rowmac}c|>{\rowmac}c>{\rowmac}c>{\rowmac}c>{\rowmac}c<{\clearrow}} \hline \multirow{2}{*}{} & & \multicolumn{4}{c|}{X-Ray OCT} & \multicolumn{4}{c}{LUNA} \\ \cline{3-10} & & Acc & Pre & Rec & AUC & Acc & Pre & Rec & AUC \\ \hline \multirow{2}{*}{ResNet18} & W & \setrow{\bfseries} 0.877 $\pm$ 0.08 & 0.840 $\pm$ 0.06 & 0.851 $\pm$ 0.08 & 0.961 $\pm$ 0.08 & 0.852 $\pm$ 0.06 & 0.801 $\pm$ 0.06 & 0.821$\pm$ 0.05 & 0.944 $\pm$ 0.06 \\ & W/O & 0.843 $\pm$ 0.09 & 0.821 $\pm$ 0.07 & 0.833 $\pm$ 0.08 & 0.957 $\pm$ 0.07 & 0.822 $\pm$ 0.08 & 0.781 $\pm$ 0.06 & 0.791 $\pm$ 0.09 & 0.919 $\pm$ 0.08 \\ \hline \multirow{2}{*}{ResNet50} & W & \setrow{\bfseries} 0.880 $\pm$ 0.09 & 0.849 $\pm$ 0.07 & 0.858 $\pm$ 0.08 & 0.974 $\pm$ 0.06 & 0.850 $\pm$ 0.08 & 0.799 $\pm$ 0.07 & 0.818 $\pm$ 0.09 & 0.942 $\pm$ 0.05\\ & W/O & 0.861 $\pm$ 0.08 & 0.836 $\pm$ 0.07 & 0.844 $\pm$ 0.08 & 0.970 $\pm$ 0.07 & 0.817 $\pm$ 0.09 & 0.776 $\pm$ 0.08 & 0.780 $\pm$ 0.06 & 0.916 $\pm$ 0.05 \\ \hline \multirow{2}{*}{DenseNet161}& W & \setrow{\bfseries} 0.866 $\pm$ 0.08 & 0.831 $\pm$ 0.06 & 0.850 $\pm$ 0.05 & 0.951 $\pm$ 0.07 & 0.852 $\pm$ 0.08 & 0.797 $\pm$ 0.06 & 0.809 $\pm$ 0.05 & 0.939 $\pm$ 0.05\\ & W/O & 0.857 $\pm$ 0.09 & 0.819 $\pm$ 0.08 & 0.830 $\pm$ 0.08 & 0.949 $\pm$ 0.08 & 0.814 $\pm$ 0.10 & 0.770 $\pm$ 0.07 & 0.777 $\pm$ 0.08 & 0.913 $\pm$ 0.09\\ \hline \multirow{2}{*}{SVM} & W & \setrow{\bfseries} 0.821 $\pm$ 0.11 & 0.799 $\pm$ 0.09 & 0.801 $\pm$ 0.09 & 0.930 $\pm$ 0.08 & 0.822 $\pm$ 0.11 & 0.779 $\pm$ 0.08 & 0.791 $\pm$ 0.07 & 0.900 $\pm$ 0.08\\ & W/O & 0.800 $\pm$ 0.14 & 0.754 $\pm$ 0.11 & 0.769 $\pm$ 0.12 & 0.929 $\pm$ 0.10 & 0.788 $\pm$ 0.12 & 0.742 $\pm$ 0.10 & 0.750 $\pm$ 0.10 & 0.899 $\pm$ 0.09\\ \hline \end{tabular} \begin{tabular}{>{\rowmac}c>{\rowmac}c|>{\rowmac}c>{\rowmac}c>{\rowmac}c>{\rowmac}c|>{\rowmac}c>{\rowmac}c>{\rowmac}c>{\rowmac}c<{\clearrow}} \hline \multirow{2}{*}{} & & \multicolumn{4}{c|}{BreastUltra} & \multicolumn{4}{c}{LiTS} \\ \cline{3-10} & & Acc & Pre & Rec & AUC & Acc & Pre & Rec & AUC \\ \hline \multirow{2}{*}{ResNet18} & W & \setrow{\bfseries} 0.889 $\pm$ 0.07 & 0.842 $\pm$ 0.08 & 0.851 $\pm$ 0.07 & 0.909 $\pm$ 0.06 & 0.944 $\pm$ 0.08 & 0.899 $\pm$ 0.06 & 0.909 $\pm$ 0.06 & 0.981 $\pm$ 0.07\\ & W/O & 0.859 $\pm$ 0.08 & 0.820 $\pm$ 0.08 & 0.831 $\pm$ 0.07 & 0.897 $\pm$ 0.06 & 0.921 $\pm$ 0.08 & 0.881 $\pm$ 0.08 & 0.892 $\pm$ 0.06 & 0.979 $\pm$ 0.06\\ \hline \multirow{2}{*}{ResNet50} & W & \setrow{\bfseries} 0.900 $\pm$ 0.08 & 0.864 $\pm$ 0.07 & 0.871 $\pm$ 0.08 & 0.919 $\pm$ 0.06 & 0.941 $\pm$ 0.07 & 0.907 $\pm$ 0.06 & 0.915 $\pm$ 0.07 & 0.979 $\pm$ 0.06\\ & W/O & 0.878 $\pm$ 0.09 & 0.843 $\pm$ 0.08 & 0.850 $\pm$ 0.09 & 0.915 $\pm$ 0.08 & 0.923 $\pm$ 0.08 & 0.902 $\pm$ 0.05 & 0.911 $\pm$ 0.05 & 0.978 $\pm$ 0.06 \\ \hline \multirow{2}{*}{DenseNet161}& W & \setrow{\bfseries} 0.884 $\pm$ 0.09 & 0.839 $\pm$ 0.09 & 0.845 $\pm$ 0.09 & 0.907 $\pm$ 0.08 & 0.939 $\pm$ 0.08 & 0.890 $\pm$ 0.08 & 0.905 $\pm$ 0.07 & 0.979 $\pm$ 0.08\\ & W/O & 0.853 $\pm$ 0.08 & 0.821 $\pm$ 0.07 & 0.840 $\pm$ 0.08 & 0.879 $\pm$ 0.07 & 0.915 $\pm$ 0.07 & 0.889 $\pm$ 0.07 & 0.900 $\pm$ 0.06 & 0.976 $\pm$ 0.06\\ \hline \multirow{2}{*}{SVM} & W & \setrow{\bfseries} 0.833 $\pm$ 0.11 & 0.770 $\pm$ 0.12 & 0.781 $\pm$ 0.09 & 0.838 $\pm$ 0.08 & 0.899 $\pm$ 0.10& 0.859 $\pm$ 0.08 & 0.870 $\pm$ 0.09 & 0.955 $\pm$ 0.08 \\ & W/O & 0.810 $\pm$ 0.14 & 0.767 $\pm$ 0.13 & 0.779 $\pm$ 0.11 & 0.833 $\pm$ 0.12 & 0.889 $\pm$ 0.10 & 0.854 $\pm$ 0.11 & 0.866 $\pm$ 0.10 & 0.951 $\pm$ 0.09\\ \hline \end{tabular} \label{tab:class_result} \end{table*} \section{Experiment} \subsection{Experiments Setup} The experiments are conducted on multiple public available datasets which are: \begin{itemize} \item NCT-CRC-HE-100K~\cite{kather2019predicting}: A dataset contains $100,000$ non-overlapping image patches from hematoxylin and eosin stained histological images. Nine different types of tissues are involved. \item ChestXray8~\cite{wang2017chestx}: A dataset contains $112, 120$ frontal-view X-ray images of $30, 805$ unique patients with 14 disease image labels. \item HAM10000~\cite{tschandl2018ham10000}: A dataset contains $10,015$ multi-source dermatoscopic images of common pigmented skin lesions which belongs to seven different categories. \item Optical Coherence Tomography 2017 (OCT2017)~\cite{kermany2018identifying}: A dataset contains $109, 309$ optical coherence tomography images for four different type retinal diseases. \item X-Ray OCT 2017~\cite{kermany2018identifying}: A dataset extended from OCT2017 which contains $5, 856$ chest CT images from pneumonia and normal patients. \item LUNA~\cite{setio2017validation}: LUng Nodule Analysis is an open dataset consisting of 888 CT scans with three different classes: non-nodule, nodule $<$ 3 mm, and nodules $\geq$ 3 mm. \item BreastUltra~\cite{yap2017automated}: A dataset contains 780 breast ultrasound images belonging to three different classes: normal, benign, and malignant. \item LiTS~\cite{bilic2019liver}: Liver Tumor Segmentation Benchmark dataset which contains 3D computed tomography (CT). We use the similar method in~\cite{xu2019efficient} to transfer them into 2D images with the axial view. \end{itemize} OpenCV2 is utilized to resize all those medical images into $256\times 256\times 3$. We use the ratio 7:1:2 to split the datasets into training set, validation set and test set on patient level. The information of all these datasets is summarized on Table~\ref{tab:stat}. The experiments were conducted on a machine with eight GPUs which includes six NVIDIA TITAN X Pascal GPUs and two NVIDIA TITAN RTXs. The model is implemented in Tensorflow. Quality evaluation of the generated images is a challenging problem~\cite{salimans2016improved}. Traditional metrics, such as per-pixel mean square error, is hard to reflect the performance. Hence, we use the Fréchet Inception Distance (FID)~\cite{heusel2017gans} to measure the distance between the generated distribution and the real distribution. Lower FID indicates that the generated images have higher quality. In addition, we also use the Per-pixel Accuracy (PA) to measure the discriminability of the generated images~\cite{salimans2016improved,wang2016generative,isola2017image}. In order to demonstrate the superiority of the proposed method, we select the following baselines to compare the quality. \begin{itemize} \item Vanilla GAN~\cite{goodfellow2014generative}: the original version of the GAN. \item Conditional GAN~\cite{mirza2014conditional}: conditional GAN which consider about the label information. \end{itemize} It is worth to mention that U-Net is type of auto-encoder, but auto-encoders can not be used as baselines. Auto-encoders are widely used on reconstruction task instead of augmentation, it is not suitable in this manuscript. For classification, we use several different metrics which are: \begin{itemize} \item Accuracy, which measures the percentage of correctly classified samples over the whole dataset \item Precision, which measures the percentage of true positives (TP) over all predicted positive samples \item Recall, used to measure the percentage of TPs over all positive samples \item Area-under-the-curve (AUC) which measures the relation between FPs and TPs. \end{itemize} The following baselines are selected as the classifier: ResNet-18, ResNet-50, DenseNet-161 and Support Vector Machine (SVM). { \begin{figure*}[ht] \centering \includegraphics[width=0.95\linewidth]{all.pdf} \caption{Generated images on three different domains: Lung CT, Chest X-Ray and Ultrasound. From left to right are: original images, our method, GAN generated image, and conditional GAN generated image. It is obvious that the images generated by our method is more similar with the original ones.} \label{fig:vis} \end{figure*} } \subsection{Hyper Parameters Setting} In this part, we briefly present the parameters setting used in our experiments. The gradient penalty coefficient $\lambda$ is 10. For Adma optimizer~\cite{kingma2014adam}, we set $\alpha = 0.0001,\beta_1=0,\beta_2=0.9$. The growth rate for Dense Block $k=64$, the number of training epoch is $5,000$. The classifiers are trained for $5,000$ epoches with Adma optimizer with $\alpha=0.001, \beta_1=0.9, \beta_2=0.99$. \subsection{Results} We first compared the performance of image generation among GAN, cGAN, and our method. The results summarized in Table~\ref{tab:gan_result} show that our method achieves the best result compared with GAN and conditional GAN on both metrics. In order to better analyze the generated images, we provide the visualization for those generated images. We use three different datasets: Luna, ChestXray8 and BreatUltra as the demo datasets. The visualization can be found on Fig~\ref{fig:vis}. It's obviously that the image generated by our model are more similar with the ground truth. We also provide the classification results with and without augmentation on all the eight datasets with four different classifiers on Table~\ref{tab:class_result}. We found that the performance of all the classifiers improved significantly after augmentation. \section{Conclusion} The lack of annotated medical images leads to a significant challenge for imaging-based medical studies, such as quick diagnosis, disease prediction, etc. Data augmentation is a popular approach to relieve this problem. In this paper, we propose a new method named generative adversarial U-Net for medical image augmentation. It can be used to generate multi-modalities data to relieve the data shortage which is commonly faced in medical imaging research. Specifically, we adjust the structure of the generative adversarial network to fit into the U-Net. We conduct extensive experiments on eight datasets with different modalities from binary classification to multi-class classification. Our experimental results demonstrated the superior performance of the proposed method over the state-of-the-art approaches on all of these datasets. In the future, we plan to extend our work into the more challenging few-shot learning scenario or semi-supervised learning scenario~\cite{zhang2019adversarial,yao2016learning} in which only a few samples even no samples available for certain class. We plan to investigate the transfer learning to help with enriching the current model to augment the ability of dealing with unseen samples from a brand new class. \bibliographystyle{IEEEtran}
\section{Introduction} \label{sec:intro} In the industrial sector, production planning leans on efficient decision-making strategies in order for the company to gain an edge on the competitive market. Production planning aims at optimizing the resources of a company to meet its long, medium and short-term objectives. Roughly speaking, long-term decisions belong to the strategic level of production planning, when a company's global goals are defined. Tactical planning is responsible for efficiently using the available resources in order to fulfill the goals of the strategic planning. In the short-term planning level, known as operational planning, decisions related to the company's routine are made. Production planning for a variety of realistic scenarios involves deciding the number of lots of items to be produced (lot sizing), and the planning and sequencing of tasks to be performed for the production of the items (scheduling) \citep{Araujo2007,Marinelli2007,Ferreira2009,Boonmee2016}. One may define a production plan by considering lot sizing and scheduling separately, where the lot sizing problem is solved first so that the tasks can be scheduled. This approach is suitable for problems whose costs and machine setup time do not depend on the sequence of tasks performed during the production of the items. Nevertheless, when there is a dependence between machine setup and sequence of tasks, e.g, when capacity use violates an imposed limit, the results of the scheduling also affect the lot sizing. Therefore, it is not possible to approach lot sizing and scheduling in a hierarchical and separate manner. Better decision-making strategies to solve problems with sequence-dependent setup costs and times may be reached by simultaneously integrating the production plan considering lot sizing and scheduling (integrated) \citep{Guimaraes2013,Guimaraes14}. The resulting problem is known as integrated lot sizing and scheduling problem (ILSSP), which is recognized as being computationally challenging. Classic ILSSPs aim at defining a production plan that minimizes the total costs of production in a finite planning horizon. The ILSSP is an extension of the single item capacitated lot sizing problem (CLSP) with setup costs. Therefore, the problem of determining an optimal solution to the ILSSP is $\mathcal{NP}$-hard \citep{FL80}. Moreover, the feasibility problem of ILSSP is $\mathcal{NP}$-complete \citep{MM91}. Heuristic methods efficiently solve several variants of the ILSSP, even the significantly hard ins\-tances. Furthermore, the advances in computational power predicted by Moore's law enable the incorporation of characteristics in ILSSP models that better approximate the mathematical formulations to real scenarios. Considering these facts, we propose solution methods to efficiently solve a relevant problem that has not yet been extensively investigated by the literature, the ILSSP on parallel machines with non-triangular sequence-dependent setup\footnote{Producing an item $j$ immediately after an item $i$ may not be the best environmental option, since the production of an item $l$ that absorbs contamination as intermediary of $i$ and $j$ would diminish the costs and times of cleansing operations. In other words, considering that $s_{ij}$ is the setup cost/time necessary to stop the production of item $i$ and to start the production of item $j$, the triangular inequality $s_{il} + s_{lj} \geq s_{ij}$ does not hold and $l$ is said to be a shortcut item.} costs and times and setup carry-over, referred to here as ILSSP-NT on parallel machines. Important applications of the ILSSP-NT on parallel machines can be found in the food processing industry \citep{Claassen2016,Toso2009}, e.g., in the animal feed industry. In the last five years the production of animal feed increased by an average of 2.49\% a year \citep{Alltech2018} and, according to the IFIF (International Feed Industry Federation), it tends to soar until 2050 \citep{ifif}. The growth in the animal feed industry is one of the consequences of the rise in consumption of raw materials such as meat, milk and eggs provided by the livestock industry. To the best of our knowledge, a few solution methods to approach the ILSSP-NT on parallel machines can be found in the literature. \citet{Kang1999} proposed a branch-and-price-based approach to solve the ILSSP-NT on parallel machines without setup times. \citet{Meyr02} introduced four heuristics, which are combinations of the threshold acceptance and simulated annealing heuristics with dual re-optimization. On the other hand, many problems related to the ILSSP-NT on parallel machines have been investigated \citep{Toso2009,Menezes11,James2011,Guimaraes2013,Guimaraes14,clark2014,Xiao2015, Claassen2016,Martinez2018}. Mathematical programming-based heuristics, also known as matheuristics, e.g., the relax-and-fix and fix-and-optimize heuristics, have been widely suggested to approach problems related to the ILSSP-NT \citep{Toso2009,James2011,Guimaraes2013}. Moreover, the results presented in \citep{James2011} indicate that local search-based methods play an important role in improving the quality of the solutions. Therefore, in this paper we propose solution methods that combine the relax-and-fix and fix-and-optimize heuristics and that use intensification-based heuristics known as path-relinking \citep{glover1997} and kernel search \citep{angelelli2010} to refine the solutions. The introduced intensification strategies were designed to consider the particularities of the non-triangular setups to better approach the ILSSP-NT. Computational experiments were carried out with the proposed heuristics using instance sets obtained from studies in the literature. In the first experiment, we employed the introduced solution methods to approach the ILSSP-NT on a single machine on the instances introduced in \citep{Guimaraes2013}. The results obtained by our solution methods are contrasted to those found by the CPLEX v. 12.10 solver with an imposed time limit of 3600 seconds. In this experiment, the proposed heuristics were very competitive with CPLEX, achieving better average gaps in the problems tested. In the second experiment, we tested the heuristics presented here to address the ILSSP-NT on parallel machines. In this experiment, we used instances proposed in \citep{James2011} but modified the setup costs and times of some items so that they were shortcut items, as introduced in \citep{Guimaraes2013}, and compared the solutions obtained using the proposed heuristics with the solutions found by the CPLEX v. 12.10 software \citep{cplex2017} time limited to 3600 seconds. The results of this experiment demonstrate the outstanding performance of the proposed matheuristics with the intensification strategies in comparison to CPLEX. This paper is organized as follows: Section \ref{pidls} presents a review of problems related to the ILSSP; Section \ref{sec:problema} presents the main characteristics of the ILSSP-NT on parallel machines as well as the investigated mathematical formulation; Section \ref{sec:RFO} provides a thorough description of all the methods proposed to solve the ILSSP-NT on parallel machines; Section \ref{TestPre} presents a comparative analysis of the results obtained by the proposed heuristics and the CPLEX v. 12.10 solver when solving the ILSSP-NT on a single and parallel machines; and finally, Section \ref{conclu} presents the final remarks and directions for future research. \section{Integrated lot sizing and scheduling problem (ILSSP)} \label{pidls} In the context of this paper, for a finite planning horizon, the lot sizing problem aims at defining how much and when to produce items in a production line to satisfy their pre-established demands respecting the available resources and the machine capacity limit for each period of the planning horizon. The scheduling problem, on the other hand, makes sure that there are no conflicts of items sharing resources in the production process, e.g., the machines. For this, the scheduling problem defines the sequencing of operations that must be performed, such as machine setup and items production \citep{DK97}. The two problems can be considered separately when preparing the company planning \citep{KG03,Busch2010}. Nevertheless, integrating them into a single problem may provide a better production planning. In this sense, the goals of the ILSSP may vary. For example, a commonly studied variant of the ILSSP aims to minimize the production makespan, while another seeks to minimize the total costs involved in the production process. In both cases, demands for the items must be met, restrict to the available resources. Some literature reviews on the ILSSP can be found in the literature \citep{DK97,Zhu2006,Jans08,Clark11,Guimaraes14,Copil2017}. \citet{Zhu2006} focused their review on lot sizing and scheduling problems with sequence-dependent setup times and costs. Problems with different types of machine configuration were investigated, including those involving single machine, parallel machines, flow shop, and job shop systems. The authors highlight the relevance of studying these problems and draw attention to the lack of solution methods capable of efficiently solving them despite the considerable amount of attention they have received. In \citep{Clark11}, the authors emphasize the importance of integrating both the lot sizing and the scheduling problems, as well as considering the integration of other problems such as distribution and vehicle routing. In line with this, \citet{Clark11} point out the need for efficient solution methods and tight formulations mainly in cases where models incorporate many elements to describe integrated problems more precisely. In particular, to effectively solve these problems, the authors strongly suggest solution methods that are hybrids of exact and heuristic methods. The reviews on the ILSSP published in the last decade attempt to present models and solution methods to case studies found in the industry. \citet{Jans08} expose several extensions of the problems presented in \citep{DK97} to meet the needs of the industries. Moreover, the authors suggest that studying the lot sizing problem on parallel machines and more general models are interesting subjects for future works. Among the methods proposed to solve the ILSSP on parallel machines, \citep{Kang1999,Meyr02,James2011} deserve to be highlighted. \citet{Kang1999} approached a number of business problems provided by private companies, known as CHES (Chesapeake Decision Sciences) \citep{Baker1989}. They considered CHES to be an extension of the ILSSP on parallel machines with sequence-dependent setup costs, whose triangular inequality may or may not hold, and null setup times. The model used by the authors considers the splitting of the production sequence of each period into smaller split-sequences, as they call them, and restrict the number of items to be produced per split-sequence. To solve the problems, they apply a branch-and-bound/column generation-based approach with two heuristics they proposed. One of the proposed heuristics truncates the branch-and-bound tree according to the probability of achieving a good solution by branching the current node, the other is an improvement heuristic that uses a local search method to find the best solutions in the neighborhood of the current solution. The results obtained by the method were satisfactory for instances with up to 95\% of machine capacity utilization. However, the method required a high computational time. Study \citep{Meyr02} investigates the generalized lot sizing and scheduling problem on non-identical parallel machines with sequence-dependent setup costs and times that may or may not obey the triangular inequality. To solve the problem, the author proposes heuristics that combine the local search methods threshold accepting \citep{Dueck1990} and simulated annealing \citep{Kirkpatrick1983} with dual optimization. In the first step, local search methods are responsible for fixing setup patterns. Then, a solution is obtained for each fixed pattern by solving the dual re-optimization of a network flow problem using the algorithm proposed by \citet{Bertsekas1988}. The author observes that despite the competitive results with regard to those obtained in \citep{Kang1999}, the computational times of the proposed methods were very high. To the best of our knowledge, the most state-of-the-art solution methods to solve the ILSSP on parallel machines were proposed in \citep{James2011}. Several iterative MIP-based neighborhood search heuristics are introduced in \citep{James2011}. The main strategy is a stochastic MIP-based local search heuristic that consists of three steps. In the first step, an initial solution is obtained through a general relax-and-fix framework. In the second step, the solution is improved by an intensification heuristic (local search), identified by the authors as XPH. Several subMIPs are randomly selected by the intensification algorithm and solved through a fix-and-optimize heuristic \citep{Pochet2006}. The probability of a subMIP being selected is related to its frequency and time interval, which starts when the subMIP is last selected. In this sense, the higher the frequency and the shorter the referred time interval, the smaller the chances of this subMIP being selected again. Finally, the third step is responsible for the diversification of the solution method so that it does not get trapped in a local minimum through a Variable Neighborhood Search (VNS) \citep{Almada2010}. \citet{James2011} proposed the INSRF heuristic to solve the ILSSP on parallel machines whose initial solution is found by a relax-and-fix heuristic. They compared INSRF with other methods, among which XPHRF, FOHRF9 and CPLEX. XPHRF combines the stochastic MIP-based local search XPH with a constructive relax-and-fix heuristic. The FOHRF9 heuristic is the combination of the constructive heuristic relax-and-fix with the fix-and-optimize heuristic from \citet{Sahling2009}. With a time limit of 3600 seconds to solve each problem, the best results were obtained by the XPHRF heuristic. A practical application of ILSSP-NT on a single machine to heuristically solve the production planning of an animal feed factory is presented by \citet{Toso2009}. Due to the need for cleansing processes in the production process, the authors consider sequence-dependent setup times that do not obey the triangular inequality. The three solution methods they propose are based on the relax-and-fix heuristic. Experiments using real data demonstrated that the proposed modeling and methods significantly improved factory planning. Later, \citet{Clark2010} approached the same problem and proposed two models to address the ILSSP-NT based on the asymmetric traveling salesman problem (ATSP), where one considers setup carry-over and the other does not. Moreover, to solve the problems, the authors developed two methods: (i) an ATSP subtour elimination method; and (ii) an ATSP subtour elimination with a patching heuristic \citep{karp1979}. \citet{Guimaraes2013} also investigated the ILSSP-NT on a single machine. The authors heuristically solved the ILSSP-NT through a strategy that is a hybrid of a column generation method and a relax-and-fix heuristic to find an initial feasible solution. This method is followed by an improvement heuristic that combines a column generation method with a fix-and-optimize heuristic. The results of the experiments show the superiority of the proposed method over the methods proposed by \citet{Kang1999} and \citet{Meyr02} when solving the small-sized instances with 6 items and 9 periods proposed in \citep{Kang1999}. Experiments with the proposed methods to approach the ILSSP on a single machine attest the superiority of their results to those presented in \citep{James2011}, in particular, for larger instances. According to \citet{Guimaraes14}, in the last years, commercial solvers have satisfactorily solved the ILSSP not considering setup costs and sequence-dependent setup times. This was achieved in reasonable times. To deal with the subject, \citet{Guimaraes14} focused on analysing the performance of commercial solvers on four formulations proposed in the literature that approach ILSSPs with sequence-dependent setup costs and times. The analysis of the models conducted by \citet{Guimaraes14} also took into account the performance of a commercial solver considering different formulations of the ILSSP- NT. In addition, the authors introduced a new model to the ILSSP-NT and a facility location problem reformulation suggested by \citet{KB77}. Computational experiments indicated that, on average, the solver achieved the best performance when considering the introduced reformulation. Bearing this in mind, we opted to adapt such formulation to tackle the ILSSP-NT on parallel machines. The next section describes the problem under study and the suggested mathematical model. \section{Problem formulation} \label{sec:problema} This study approaches a single stage production planning problem with multiple items on non-identical parallel machines. The planning horizon is finite and subdivided into macro-periods. The machines have a pre-determined time limited production capacity and item demands are provided per period. In addition, to produce the demands of a given item, the machine setup must be performed. In particular, if a machine is ready to produce a certain item at the beginning of a period as it was the last item to be produced in previous periods, setup carry-over can be considered in order to avoid redundant machine setups. Therefore, one setup carry-over is allowed per pair of adjacent periods. In order to diminish the number of machine cleansing operations, non-triangular setups can be considered when items have the property of absorbing contamination during their production process. Due to non-triangular setup costs and times, a minimum lot size is considered to avoid fictitious setups associated to the production of empty lots. Furthermore, the production of multiple lots of an item is possible in the same period. The production plan must respect the production capacity to meet the item demands per period and to guarantee that operation conflicts do not happen during the production process. The goal of the problem is to find a production plan that meets all constraints by minimizing the setup and inventory costs. The mixed integer programming model used to solve the ILSSP-NT on parallel machines is based on the facility location problem \citep{KB77}. In the model, a feasible setup sequence is provided through a network flow as proposed in \cite{Guimaraes14}, where the node (vertex) of the network represents the production lot of an item and the arc connecting two nodes indicates the change in the production from an item to another. Before presenting the model, consider the following indexes, parameters and decision variables. \begin{center} \begin{longtable}{ccp{10cm}} Dimension parameters & & \\ $n$ & : & number of items; \\ $m$ & : & number of machines; \\ $p$ & : & number of periods; \\ Indexes & & \\ $i,j$ & : & indexes representing items, $i,j \in \{1,\ldots,n\}$; \\ $k$ & : & index representing the machines, $k \in \{1,...,m\}$; \\ $t,u$ & : & indexes representing the macro-periods, $t,u \in \{1,...,p\}$; \\ \noindent Parameters & & \\ $c_{ijk}$ & : & setup cost to change the state of machine $k$ from item $i$ to item $j$; \\ $h_{i}$ & : & unitary inventory cost of item $i$; \\ $d_{it}$ & : & demand of item $i$ in period $t$; \\ $b_{ijk}$ & : & setup time to change the state of machine $k$ from item $i$ to item $j$; \\ $M_{it}$ & : & maximum amount of item $i$ that can be produced in period $t$; \\ $f_{ikt}$ & : & processing time of item $i$ at machine $k$ in period $t$; \\ $m_{i}$ & : & minimum production lot size of item $i$; \\ $T_{kt}$ & : & production capacity of machine $k$ in period $t$; \\ $q_{ikt}$ & : & maximum number of times machine $k$ can be set up to produce item $i$ in period $t$; \\ Decision variables & & \\ $x_{iktu}$ & : & amount of item $i$ produced at machine $k$ in period $t$ to meet the demand of period $u$; \\ $x^{b}_{ikt}$ & : & amount of item $i$ produced at machine $k$ in the beginning of period $t$, before the first machine setup is performed in period $t$; \\ $x^{a}_{ikt}$ & : & amount of item $i$ produced at machine $k$ during period $t$, after the first machine setup is performed; \\ $z_{ikt}$ & : & binary variable that assumes value 1 if machine $k$ is ready to produce item $i$ at the beginning of period $t$ (setup carry-over) and 0, otherwise;\\ $y_{ijkt}$ & : & number of times a production process changes from item $i$ to item $j$ at machine $k$ in period $t$;\\ $R_{kt}$ & : & binary variable that receives value 1 if at least one setup is performed at machine $k$ in period $t$\textcolor{red}{, i.e., ($\mathop {\sum }\limits_{i=1}^{n} \mathop {\sum } \limits_{j=1}^{n}y_{ijkt} \geq 1$),} and 0, otherwise; \\ $G_{ikt}$ & : & binary variable that receives value 1 if machine $k$ is ready at least once to produce item $i$ during period $t$ and 0, otherwise; \\ $F_{ijkt}$ & : & commodity flow from node (item) $i$ to node (item) $j$ at machine $k$ in period $t$. \\ \end{longtable} \end{center} The ILSSP-NT on parallel machines is modeled as follows: \begin{align} \min \mathop {\sum }\limits_{i=1}^{n} \mathop {\sum }\limits_{k=1}^{m} \mathop {\sum }\limits_{t=1}^{p}\mathop {\sum }\limits_{u=t}^{p}(u-t)h_{i}x_{iktu} + \mathop {\sum }\limits_{i=1}^{n} \mathop {\sum } \limits_{j=1}^{n}\mathop {\sum }\limits_{k=1}^{m}\mathop {\sum }\limits_{t=1}^{p}c_{ijk}y_{ijkt} & \label{nt:fo} \end{align} subject to: \begin{align} & \mathop {\sum }\limits_{k} \mathop {\sum }\limits_{t=1}^{u}x_{iktu} = d_{iu} & \forall & \; (i,u) & \label{eqmod1}\\ &\mathop {\sum }\limits_{i}\left(\mathop {\sum }\limits_{u=t}^{p}f_{ikt}x_{iktu} + \mathop {\sum }\limits_{j}b_{jik}y_{jikt}\right) \leq T_{kt} & \forall & \; (k,t) & \label{eqmod2}\\ &x_{iktu} \leq M_{it}G_{ikt} & \forall & \; (i,k,t,u) &\label{eqmod3} \\ &\mathop {\sum }\limits_{i}z_{ikt} = 1 & \forall & \; (k,t) & \label{eqmod4} \\ &z_{ikt} + \mathop {\sum }\limits_{j} y_{jikt} = \mathop {\sum }\limits_{j}y_{ijkt} + z_{ik,t+1} & \forall & \; (i,k,t) &\label{eqmod5} \\ &z_{ikt} + \mathop {\sum }\limits_{j} y_{jikt} \geq G_{ikt} & \forall & \; (i,k,t) & \label{eqmod6} \\ &z_{ikt} + \mathop {\sum }\limits_{j} y_{jikt} \leq q_{ikt}G_{ikt} & \forall & \; (i,k,t) &\label{eqmod7} \\ &\mathop {\sum }\limits_{u=t}^{p} x_{iktu} = x^{a}_{ikt} + x^{b}_{ikt} & \forall & \; (i,k,t) &\label{eqmod12} \\ &x^{b}_{ikt} \leq M_{it} z_{ikt} & \forall & \; (i,k,t) &\label{eqmod13} \\ &x^{a}_{ikt} \geq m_{i}\left(\mathop {\sum }\limits_{j} y_{jikt} - z_{ik,t+1} \right) & \forall & \; (i,j,k,t) &\label{eqmod14} \\ &x^{a}_{ikt} + \mathop {\sum }\limits_{\lambda=t+1}^{u} x^{b}_{ik\lambda} \geq m_{i}\mathop {\sum }\limits_{j} y_{jikt} - M_{it}\left(\mathop {\sum }\limits^{u-1}_{\lambda=t+1} R_{k\lambda} + 1 - R_{ku} \right) & \forall & \; (i,k,t,u), u \neq t &\label{eqmod15} \\ & \mathop {\sum }\limits_{j}F_{0jkt} = \mathop {\sum }\limits_{i}G_{ikt} & \forall & \; (k,t) & \label{eqmod8} \\ &F_{0ikt}+\mathop {\sum }\limits_{j}F_{jikt} = G_{ikt} + \mathop {\sum }\limits_{j}F_{ijkt} & \forall & \; (i,k,t) & \label{eqmod9} \\ &F_{0ikt} \leq n z_{ikt} & \forall & \; (i,k,t) &\label{eqmod10} \\ &F_{ijkt} \leq n y_{ijkt} & \forall & \; (i,j,k,t) &\label{eqmod11}\\ &F_{ijkt} \geq 0 & \forall & \; (i,j,k,t) &\label{eqmod16} \\ &G_{ikt}, R_{kt} \in \{0,1\} & \forall & \; (i,k,t) &\label{eqmod17} \\ &z_{ikt} \in \{0,1\}, x_{iktu} \geq 0 & \forall & \; (i,k,t,u) & \label{eqmod18} \\ &y_{ijkt} \in \{0, \ldots, q_{jkt}\} & \forall & \; (i,j,k,t) & \label{eqmod19} \end{align} Objective function \eqref{nt:fo} expresses the sum of the machine setup and inventory costs to be minimized. Constraints \eqref{eqmod1}-\eqref{eqmod3} are the lot sizing constraints. Constraints \eqref{eqmod1} represent the inventory balance equations for each item and period. Constraints \eqref{eqmod2} limit the total production and setup times required by each machine and period. Constraints \eqref{eqmod3} guarantee that if an item is produced, its respective machine setup is considered. Constraints \eqref{eqmod4}-\eqref{eqmod7} are responsible for keeping track of the setup state sequence. Constraints \eqref{eqmod4} restrict the machine setup to a single item at the beginning of each period. Constraints \eqref{eqmod5} ensure that the number of times the machine setup was ready to an item $i$ in period $t$ is equal to the number of times that there was a setup from the machine state $i$ to another setup state $j$ plus the possibility of the setup of item $i$ to be carried over the next period. Constraints \eqref{eqmod6} guarantee that if the machine was ready to produce an item $i$ in period $t$, then the correspondent setup state was carried over into period $t$ or at least one setup state changeover from an item $j$ to another item $i$ occurred in period $t$. Constraints \eqref{eqmod7} limit the number of times that machine $k$ can be ready to produce item $i$ during period $t$. The production of a minimum lot size is enforced by Constraints \eqref{eqmod12}-\eqref{eqmod15} whenever a setup is performed. Constraints \eqref{eqmod12} split the total production of item $i$ at machine $k$ in period $t$ into the amount of item $i$ produced before the first machine setup is performed in period $t$ and the amount produced after the first setup up to the end of period $t$. Constraints \eqref{eqmod13} impose that the production of item $i$ before the first machine setup in period $t$ only happens if the machine setup to item $i$ was carried over into period $t$. Constraints \eqref{eqmod14} ensure that a minimum amount of item $i$ is produced in period $t$ when the machine is set up for its production in period $t$ and this setup is not carried over into the next period. \textcolor{red}{Constraints \eqref{eqmod15} ensure that a minimum amount of item $i$ is produced in the following situations: (i) machine $k$ is set up for its production in period $t$; (ii) the production of item $i$ at machine $k$ starts in period $t$ and is carried over to the next periods. In the latter case, the production lot of item $i$ in period $t$ can be split into consecutive periods $t+1, \ldots, u$. The split is possible if no setup occurs in periods $t+1, \ldots, u$, which is identified through the auxiliary decision variables $R_{k\lambda}$, where $\lambda=\{t+1,...,u\}$.} Constraints \eqref{eqmod8}-\eqref{eqmod11} are applied to guarantee that no sub-tour is created in the production sequencing. Constraints \eqref{eqmod8} set the origin (source) of the commodity flow in each period. Constraints \eqref{eqmod9} ensure the flow balance by sending a unitary flow to each selected node, generating single paths between every pair of items that begin at the origin and end at an item produced in that period. Constraints \eqref{eqmod10} and \eqref{eqmod11} impose that the number of items is the maximum capacity of the arcs in the flow. Finally, Constraints \eqref{eqmod16}, \eqref{eqmod17}, \eqref{eqmod18} and \eqref{eqmod19} define the decision variable domains. \section{Solution methods} \label{sec:RFO} As mentioned earlier, to the extent of our knowledge, only \citet{Kang1999} and \citet{Meyr02} approached the ILSSP-NT on parallel machines and introduced heuristic methods. Despite the satisfactory results in both studies, the computational times of the heuristics are compromised by some parameters of the small bucket models, such as the number of micro-periods per macro-period, that may increase the size of the problem and/or require the optimization of several problems with different parameter values. The best methods related to the ILSSP-NT on parallel machines rely on mathematical programming-based heuristics, such as relax-and-fix (RF) heuristics and fix-and-optimize (FO) heuristics \citep{James2011,Guimaraes2013}. Moreover, intensification approaches such as path-relinking \cite{glover1998tabu} and kernel search \citep{ang07} achieved outstanding results on solving lot sizing problems \citep{NT07,Guastaroba2017,Carvalho2018}. Bearing this in mind, we propose a solution method denoted by RFO, which combines a hybrid of RF and FO. Moreover, we propose two other solution methods referred to as RFO-PR and RFO-KS, which are the RFO combined with intensification heuristics. In both RFO-PR and RFO-KS, RFO searches for initial feasible solutions to the ILSSP-NT on parallel machines. Then, these solutions are used by the path-relinking and kernel search intensification strategies in, respectively, RFO-PR and RFO-KS. The proposed heuristics, i.e., relax-and-fix (RF), fix-and-optimize (FO), path-relinking (PR) and kernel search (KS) are described at length in the following sections, as well as RFO, RFO-PR and RFO-KS. \subsection{RF} \label{sec:RF} \textcolor{black}{The RF heuristic is a constructive strategy that iteratively solves relaxed mixed integer problems (MIPs) and then fixes the values of some integer variables until the point where all the integer variables are fixed and a feasible solution to the addressed problem is found or an infeasible problem is reached. The first problem solved by a standard RF heuristic is the linear relaxation of the problem. New MIPs are created by iteratively restricting the domain of the decision variables set, which is partitioned into an ordered sequence of $\Phi$ disjoint sets. The initial partition is usually defined according to the solution of the linear relaxation. The order of the sets is basically related to the relevance of their variables, which can be measured by the magnitude of the values in the solution of the linear relaxation of the problem.} Unlike the classical approach, in lot sizing it is common to design the initial partition of the RF heuristic by considering the sequence of periods, items and/or machines instead of, e.g., the appro\-xi\-mation provided by the linear relaxation solution. Therefore, the variables are assigned to the sets according to the range of the related items, periods and/or machines. For example, let the period be the relevance indicator of the partitioning of the decision variables $x_{iktu}$ into $\Phi$ sets. Each set $S^{\phi}$, $\phi=1,\ldots,\Phi$, is defined as presented in Equation \eqref{Sh}. \begin{equation} S^ {\phi} = \{ (i,k,t,u): i \in \{1,n\}, k \in \{1,\ldots,m\}; t \in [t_{\phi},p_{\phi}]; u \in \{t,\ldots,p\}\} \label{Sh} \end{equation} \noindent where $t_{\phi}$ and $p_{\phi} \in \{1, \ldots, p\}$. Given the disjoint sets of variables defined according to some criteria, to solve a certain MIP, the RF heuristic solves one MIP of a sequence of problems at each iteration $v$. In the $v$-th iteration of the RF heuristic, a subproblem of the linear relaxation of the original MIP is solved, where the domain of the variables associated to the tuples $(i,k,t,u)$ from $S^{v}$ is integer, and the domain of the variables associated to the tuples $(i,k,t,u)$ from $S^{v+1}, \ldots,S^{\Phi}$ is real. If $v>1$, the variables associated to the tuples $(i,k,t,u)$ from $S^{1},\ldots,S^{v-1}$ are fixed at integer values from the solutions of MIPs solved at previous iterations. At the first iteration, no variable is fixed in the MIP to be solved. The method halts when a feasible solution to the original problem is found, when it reaches the maximum number of iterations, $\Phi$, or when an MIP is infeasible. In \citep{James2011}, time-based partitioning is considered the most appropriate to approach the ILSSP due to the structure of the original MIP the authors use in the RF heuristic. Moreover, different from the aforementioned approach, part of the variables optimized\footnote{ Variables whose domain is integer in a given MIP.} in the MIP to be solved at an iteration $v$ is re-optimized at iteration $v+1$, which means that the variable domains remain integer in the corresponding MIP. Let $\lambda$ be the number of periods whose variable domains must be integer in the MIP of a given iteration $v$. A sequence of period intervals $[t'_{v},t^{"}_{v}]$ is created in such a way that successive intervals share $\gamma < \lambda$ periods, as shown in Figure \ref{jm:1}. In other words, the variables associated to $\gamma$ periods will be re-optimized, i.e., the domain of such variables will also be integer in the MIP of the next iteration. \begin{figure}[!h] \pgfplotsset{width=10cm,height=2cm,,compat=1.9} \centering \input{ExJames} \caption{\small{Representation of the variable domains associated to the period intervals $[t'_{v-1},t^{"}_{v-1}]$ and $[t'_{v},t^{"}_{v}]$ at iteration $v$.}} \label{jm:1} \end{figure} The strategy suggested in \citep{James2011} is motivated by the use of setup carry-over. The authors claim that disregard the overlapping of intervals when defining the MIPs of the RF heuristic could affect the production sequence once the first setup state of every machine in a given iteration $v$ is fixed at the previous iteration. The applied RF is a similar approach to the one presented in \citep{James2011} and relies on overlapping period intervals to define the variable domains along the iterations. \subsection{FO} \label{sec:FO} A classical FO heuristic consists in the successive re-op\-ti\-mi\-za\-tion of simpler MIPs than the original problem, where part of the decision variables is fixed and the other is re-optimized. Different from RF, the FO therefore needs an initial feasible solution whose values will define the values of the variables to be fixed. Similar to the RF heuristic, in the classical FO the decision variables to be fixed are partitioned into $\Phi$ disjoint sets $S^{\phi}$, $\phi = 1, \ldots, \Phi$, which are sorted in order of importance. The importance of the sets is directly related to the relevance of the variables that belong to them. In the FO heuristic, once again, the magnitude of the values in a feasible solution used as input to the method can be used as a criterion to measure the relevance of the variables. Once the partitioning is defined, the FO heuristic solves an MIP at each iteration $v$, where the variables associated to the tuples from $S^{v}$ are restricted to integer and the remainder variables are fixed at the values obtained for the best solution found up until that moment. The method halts after solving a sequence of $\Phi$ MIPs. This strategy has been extensively explored to solve MIPs found in the literature \citep{Pochet2006,Sahling2009,Helber2010,James2011,Guimaraes2013}, in particular, to approach lot sizing problems with excellent results \cite{James2011,Guimaraes2013}. Bearing this in mind and based on the aforementioned methodology, we apply an FO heuristic to improve the solution found by the RF heuristic. \textcolor{red}{Next, we present the steps of the proposed RF and FO and, then, the proposed RFO heuristic.} \subsection{RFO heuristic} \textcolor{red}{ RF and FO have virtually the same set of steps. For this reason, we present the methods together, for a better reading. It is important to highlight that the RF and FO steps are not performed simultaneously. Moreover, two of the six steps only occur in the FO heuristic, informed next and marked with~`(*)'.} \begin{enumerate} \item \textit{Definition of parameters and time-based variable partitioning} \\ In both RF and FO heuristics, the set of decision variables $y$ is partitioned into $p$ disjoint sets $\{y_{ijkt}: (i,j,k,t) \in S^{u}\}, \; u = 1, \ldots, p$, where set $S^{u}$ is composed of every tuple $(i,j,k,u)$. To define the MIP of a given iteration $v$, let $\lambda$ be a constant value that represents the number of periods whose variable domains are integer in the RF \textcolor{red}{and FO heuristics}. Consider also \textcolor{red}{$\gamma<\lambda$ an integer value that describes} the number of periods whose variable domains were integer in previous iterations and remained integer at iteration $v$ rather than being fixed in the MIP of the current iteration. Therefore, the period interval $[t'_{v},t^{"}_{v}]$ indicates the periods under investigation at iteration $v$, i.e., the domain of the variables associated to such periods must be integer. \textcolor{red}{Let $\theta$ be a constant value, where $\theta = \lceil(p-\lambda) /(\lambda -\gamma)\rceil+1$. On the one hand, $\theta$ indicates the last iteration counter in the RF heuristic. On the other, $\theta$ indicates the last iteration counter of a cycle of iterations in the FO heuristic\footnote{If the FO heuristic finds a new solution that is strictly better than the current best one after completing a cycle of iterations, we attempt to improve such a solution, by considering a new cycle of the FO heuristic having it as starting solution}. The methods employ $\theta$ to define the intervals $[t'_{v},t^{"}_{v}]$, as follows: (i) $t'_{1}=1$ and $t^{"}_{1} = t'_{1}+ \lambda -1$; (ii) for $v \in \{2,3,\ldots, \theta-1\}$, $t'_{v}=t^{"}_{v-1}- \gamma + 1$ and $t^{"}_{v} = t'_{v} + \lambda -1$; and (iii) $t'_{\theta}=p- \gamma + 1$ and $t^{"}_{\theta} = p$.} Let \textsf{TimeLimit-RF} and \textsf{TimeLimit-FO} be the maximum available time to perform the RF and FO heuristics, respectively. To ensure that the methods do not stop before the end of the last iteration of a cycle of the methods, we impose the respective time limits to solve each MIP: i) \textsf{MIP-RF}= \textsf{TimeLimit-RF}/ $\theta$, for RF; and ii) \textsf{MIP-FO}= \textsf{TimeLimit-FO}/$\theta$, for FO. For the FO heuristic, a parameter called \textsf{ElapsedTime-FO}, initialized with the value 0, keeps track of the time spent up to the end of a given iteration to update \textsf{MIP-FO} in the next iteration. \item \textit{Solve the \textcolor{red}{MIP of iteration $v$}} \textcolor{red}{The following MIP must be solved at iteration $v$ of the RF and FO heuristics, \textcolor{red}{within the given time limits, \textsf{MIP-RF} and \textsf{MIP-FO}, respectively}. The MIPs differ by Heuristic Constraints \eqref{rfeq:heur}, which are described next for each method.} \begin{align} (MIP)^{v}: & &\quad \min \quad \mathop {\sum }\limits_{i=1}^{n} \mathop {\sum }\limits_{k=1}^{m} \mathop {\sum }\limits_{t=1}^{p}\mathop {\sum }\limits_{u=t}^{p}(u-t)h_{i}x_{iktu} + \mathop {\sum }\limits_{i=1}^{n} \mathop {\sum } \limits_{j=1}^{m}\mathop {\sum }\limits_{k=1}^{m}\mathop {\sum }\limits_{t=1}^{p}c_{ijk}y_{ijkt} & \label{rf:1} \end{align} subject to: \begin{align} & \mbox{Constraints } \eqref{eqmod1} - \eqref{eqmod17}, & & \label{rfeq:1} \\ & \mbox{Heuristic Constraints} & & \label{rfeq:heur} \end{align} \textcolor{red}{Let $y^{(MIP)^{v-1}}_{ijkt}$ be the value associated to variable $y_{ijkt}$ in the solution of problem $(MIP)^{v-1}$ solved in the previous iteration of the method (either RF or FO).} \textcolor{red}{In the RF heuristic, the Heuristic Constraints \eqref{rfeq:heur} are:} \begin{align} &z_{ikt} \in [0,1], x_{iktu} \geq 0, & \forall & \; (i,k,t,u) & \label{eqM_1} \\ &y_{ijkt} = y^{(MIP)^{v-1}}_{ijkt} , & \forall & \; y_{ijkt}: (i,j,k,t) \in \mathop{\bigcup}\limits_{\phi =1}^{t'_{v}-1} S^{\phi} & \label{eqM_2}\\ &y_{ijkt} \in \{0,q_{ikt}\}, & \forall & \; y_{ijkt}: (i,j,k,t) \in \mathop{\bigcup}\limits_{\phi =t'_{v}}^{t^{"}_{v}} S^{\phi} & \label{eqM_3}\\ &y_{ijkt} \in [0,q_{ikt}], & \forall & \; y_{ijkt}: (i,j,k,t) \in \mathop{\bigcup}\limits_{\phi =t^{"}_{v}+1}^{p} S^{\phi} & \label{eqM_4} \end{align} \textcolor{red}{Note that} at the first iteration, Constraints \eqref{eqM_2} are not considered in problem $(MIP)^{1}$ since there is no variable to be fixed. \textcolor{red}{To define the Heuristic Constraints \eqref{rfeq:heur} in the FO heuristic,} let $(x^{*},y^{*},z^{*})$ and $(S^ {1}, \ldots, S^ {p})$ be the best feasible solution found up to the moment and the partitioning defined in Step 1, respectively. \textcolor{red}{Therefore, in the FO heuristic, the Heuristic Constraints \eqref{rfeq:heur} are:} \begin{align} & \mbox{Constraints } \eqref{eqmod18}, & & & \label{fo:1}\\ &y_{ijkt} = y_{ijkt}^{*} , & \forall & \; y_{ijkt}: (i,j,k,t) \in \mathop{\bigcup}\limits_{\phi =t'_{v}}^{t^{"}_{v}} S^{\phi} & \label{eqM2_2}\\ &y_{ijkt} \in \{0,q_{ikt}\}, & \forall & \; y_{ijkt}: (i,j,k,t) \in \mathop{\bigcup}\limits_{\phi =1, \phi \neq \{t'_{v},\ldots,t^{"}_{v}\}}^{p} S^{\phi} & \label{eqM2_3} \end{align} \item \textit{Update the best solution$^{(*)}$} \\ \textcolor{red}{This updating is exclusive of the FO heuristic.} In this case, let $Z^{*}$ and $Z^{(MIP)^{v}}$ be the objective function values of the overall best solution and of the solution to $(MIP)^{v}$, respectively. Solution $(x^{*},y^{*},z^{*})$ is updated with solution $(x^{(MIP)^{v}},y^{(MIP)^{v}},z^{(MIP)^{v}})$, in case $Z^{*} > Z^{(MIP)^{v}}$. \item \textit{Update $v$} \\ \textcolor{red}{In the RF heuristic,} after solving $(MIP)^{v}$, the value of $v$ is incremented by 1. \textcolor{red}{In the FO heuristic, if} $v<\theta$, the value of $v$ is incremented by 1. Otherwise, if an improved solution was found at any iteration of the current cycle, when $v$ reaches the value $\theta$, $v$ is updated with value 1. If no improved solution was found by the end of a cycle, when $v = \theta$, $v$ is fixed at value 0. \item \textit{Update \textup{\textsf{ElapsedTime-FO} and \textup{\textsf{MIP-FO}}$^{(*)}$}} \textsf{ElapsedTime-FO} is updated with the computational time spent up to this point of the FO heuristic. Then, \textsf{MIP-FO} is updated by making \textsf{MIP-FO}$\, = \,($\textsf{TimeLimit-FO} $-$ \textsf{ElapsedTime-FO}$)/(\theta-v+1)$, which is the available time divided by the number of remaining iterations to complete a cycle. \item \textit{Stop criteria} \\ RF stops if $v = \theta$ or if problem $(M1)^{v}$ is infeasible. Otherwise, the heuristic repeats Steps 2 to 4. If either \textsf{ElapsedTime-FO} is greater than or equal to \textsf{TimeLimit-FO} or no improved solution is found by the end of a cycle, the algorithm stops and returns $(x^*,y^*,z^*)$. Otherwise, the heuristic repeats Steps 2 to 6. \end{enumerate} \textcolor{red}{In the proposed RFO, i}f the RF heuristic returns a feasible solution to the ILSSP-NT on parallel machines, we apply the FO heuristic to the solution. \textcolor{red}{Appendix A shows pseudo-codes of the RF and FO heuristics. Algorithm~\ref{alg:RFO} shows a pseudo-code of the proposed RFO.} \begin{algorithm}[!h] \begin{small} \SetAlgoVlined \KwData{Instance, \textsf{TimeLimit-RF}, \textsf{TimeLimit-FO}.} \KwResult{\textcolor{black}{Solutions $(x^{RF},y^{RF},z^{RF})$, $(x^{RF^*},y^{RF^*},z^{RF^*})$ and $(x^{FO},y^{FO},z^{FO})$} or warning message.} \textcolor{black}{$\{(x^{RF},y^{RF},z^{RF})$, $(x^{RF^*},y^{RF^*},z^{RF^*})\}$ $\leftarrow$ RF heuristic(\textsf{TimeLimit-RF});} \\ \textcolor{black}{\textsf{TimeLimit-FO} $\leftarrow$ \textsf{TimeLimit-FO} $+$ \textsf{AvailTime-RF};} \\ \If{ \textcolor{black}{$(x^{RF^*},y^{RF^*},z^{RF^*})$} is feasible}{ \textcolor{black}{$(x^{FO},y^{FO},z^{FO})$} $\leftarrow$ FO heuristic(\textcolor{black}{$(x^{RF^*},y^{RF^*},z^{RF^*})$}, \textsf{TimeLimit-FO}); \\ Return \textcolor{black}{$\{(x^{RF},y^{RF},z^{RF})$, $(x^{RF^*},y^{RF^*},z^{RF^*}), (x^{FO},y^{FO},z^{FO})\}$}. }{ Return warning message: ``The method was not able to find a feasible solution to the ILSSP-NT on parallel machines''. } \caption{RFO heuristic}\label{alg:RFO} \end{small} \end{algorithm} Algorithm \ref{alg:RFO} presents a hybrid of the RF and FO heuristics, named RFO, to solve the ILSSP-NT. \textcolor{black}{It starts by calling the RF heuristic that returns \textcolor{red}{a pair of solutions. The first solution, represented by $(x^{RF},y^{RF},z^{RF})$, is} the solution obtained in \textcolor{red}{iteration $\theta-3$ of the RF heuristic, if the method reaches such an iteration. If a feasible solution is found in an earlier iteration, it is assigned to $(x^{RF},y^{RF},z^{RF})$. The reason to keep $(x^{RF},y^{RF},z^{RF})$ is better explained in the next section, in the first step of the PR description. The second solution, called $(x^{RF^*},y^{RF^*},z^{RF^*})$, is the best solution found by the RF heuristic. } Then, parameter \textsf{TimeLimit-FO} is updated if the RF heuristic spent less than \textsf{TimeLimit-RF}. In this case, we add to \textsf{TimeLimit-FO} the spare time of the RF heuristic, called \textsf{AvailTime-RF}. If $(x^{RF^*},y^{RF^*},z^{RF^*})$ is feasible, the FO heuristic uses it as starting solution to obtain an improved solution $(x^{FO},y^{FO},z^{FO})$, which is returned by the method along with $(x^{RF},y^{RF},z^{RF})$ and $(x^{RF^*},y^{RF^*},z^{RF^*})$. Otherwise, the RFO heuristic returns a warning message indicating that it was not able to find a feasible solution for the problem.} To improve the best solution found by RFO, we propose an improvement step through a PR and a KS heuristic. The PR strategy is performed only if the RFO heuristic provides two feasible solutions with distinct objective function values. To perform the KS heuristic, at least one feasible solution must be found by the RFO heuristic. The PR and KS heuristics are described at length in the following sections. \subsection{PR heuristic} \label{sec:PR} Path-relinking (PR) \citep{glover1998tabu} is an intensification strategy that uses a feasible solution as the starting point of a sequence of solutions, which progressively gets closer to another solution defined as guiding solution. PR is usually proposed conjointly with a diversification-based heuristic that provides the set of solutions in-between the sequence of solutions, also known as paths. In the standard form of the PR heuristic, the strategy uses an elite set of solutions, from which the \emph{initial} and \emph{guiding} (final) solutions are selected. Then, to perform a path between these two solutions, it is necessary to gradually add characteristics of the guiding solution to a copy of the initial solution. Variants of PR exploit different approaches to build such paths in \citep{GL00}. \citet{James2011} demonstrated that the performance of a method to solve ILSSP-NT is strongly related to the local search embedded in the strategy. Moreover, the PR heuristics proposed in \citep{NT07, Carvalho2016} obtained outstanding results when solving lot sizing problems. Together, these two facts make up the reasons why we employ in our solution method such a heuristic\textcolor{black}{, described next}. \begin{enumerate} \item \textit{Define parameters and elite set} Let $\mathcal{E}$ be the elite set of solutions composed of the two solutions found by the RF heuristic and one solution obtained by the FO heuristic. \textcolor{red}{The first solution, referred to as ($x^{\mathcal{E}(1)},y^{\mathcal{E}(1)},z^{\mathcal{E}(1)}$), is the solution obtained by the RF heuristic in the iteration where the variables associated to the periods $t'_{\theta-2}$ to $p$ have their domain relaxed. Therefore, there is no guarantee that this solution is feasible. The second solution of $\mathcal{E}$, referred to as ($x^{\mathcal{E}(2)}, y^{\mathcal{E}(2)}, z^{\mathcal{E}(2)}$), is the best solution between those found by the RF and PR heuristics. It is worth mentioning that if ($x^{\mathcal{E}(1)},y^{\mathcal{E}(1)},z^{\mathcal{E}(1)}$) is feasible, it will coincide with ($x^{\mathcal{E}(2)}, y^{\mathcal{E}(2)}, z^{\mathcal{E}(2)}$). The third solution, referred to as ($x^{\mathcal{E}(3)}, y^{\mathcal{E}(3)}, z^{\mathcal{E}(3)}$), is the best solution obtained by the FO heuristic.} \textcolor{red}{Along the iterations, the second solution is replaced by a better quality solution, if it is found during the search process. The objective function value of an infeasible solution is calculated using Equation~\eqref{rf:1}, with no penalty in the violated constraints. The initial solution in the proposed PR is ($x^{\mathcal{E}(3)}, y^{\mathcal{E}(3)}, z^{\mathcal{E}(3)}$), whereas the other two solutions of $\mathcal{E}$ are used as guiding solutions. On the one hand, by defining ($x^{\mathcal{E}(1)},y^{\mathcal{E}(1)},z^{\mathcal{E}(1)}$) as a guiding solution, we aim at allowing a better diversification of the method. On the other, our goal in employing ($x^{\mathcal{E}(2)}, y^{\mathcal{E}(2)}, z^{\mathcal{E}(2)}$) and ($x^{\mathcal{E}(3)}, y^{\mathcal{E}(3)}, z^{\mathcal{E}(3)}$) in PR is to ensure the intensification in the neighborhood of the feasible solutions found by the RF and FO heuristics.} \textcolor{red}{To restrict the periods whose associated variables are candidates to be fixed at 0, we define a parameter \textcolor{red}{$\zeta\leq p$. This means that we will never fix the variables associated with the last $ p-\lceil\zeta\rceil$ periods of the problems. Its tuning, also considering $\zeta=p$, which corresponds to the classical methodology, is discussed in Section~\ref{sec:tuning}.} } One of the stop criteria of the PR heuristic is the time limit, given by parameter \textsf{TimeLimit-PR}. \textsf{MIP-PR} is another time-related parameter, set with half of the value of \textsf{TimeLimit-PR}, used to define the maximum time to solve the problem described in Step \textcolor{red}{3}. The time spent up to a point of the PR heuristic is denoted by \textsf{ElapsedLimit-PR} and starts with the value 0. \item \textit{\textcolor{red}{Define set with shortcut items}} \textcolor{red}{The introduced PR strategy is specially tailored to approach the ILSSP-NT. For this reason, we define a set $\Psi$, $\Psi \subset \{1, \ldots, n\}$, that contains all items that can be used to diminish the costs and times of cleansing in setup changeovers, i.e., the shortcut items.} \item \textit{Solve \textcolor{red}{$(M1)$}} Given the solutions in $\mathcal{E}$, the PR strategy attempts to find a new feasible solution by solving problem $M1$, i.e., formulation \eqref{nt:fo}-\eqref{eqmod19} also subject to Constraints \eqref{preq:3}. \begin{align} & y_{ijkt} = 0 , \mbox{ if } (y_{ijkt}^{\mathcal{E}(1)} \wedge y_{ijkt}^{\mathcal{E}(2)} \wedge y_{ijkt}^{\mathcal{E}(3)}) \leq 0.001, & \forall & \; (i,j,k,t), \, \{i, j\} \notin \Psi, \, \textcolor{red}{t < \zeta} & \label{preq:3} \end{align} Constraints \eqref{preq:3} assign the null value to all variables $y_{ijkt}$, such that $i,j\notin \Psi$, \textcolor{red}{$t < \zeta$}, and whose $y_{ijkt}^{\mathcal{E}(1)}$, $y_{ijkt}^{\mathcal{E}(2)}$ and $y_{ijkt}^{\mathcal{E}(3)}$ are at most 0.001. To solve $(M1)$ we used the CPLEX solver time limited to \textsf{MIP-PR}. The solution to $(M1)$ is referred to as ($x^{(M1)}, y^{(M1)}, z^{(M1)}$). \item \textit{Update elite set} Let $Z^{\mathcal{E}(2)}$ and $Z^{(M1)}$ be the objective function values of ($x^{\mathcal{E}(2)},y^{\mathcal{E}(2)},z^{\mathcal{E}(2)}$) and \linebreak ($x^{(M1)}, y^{(M1)}, z^{(M1)}$), respectively. Solution ($x^{\mathcal{E}(2)}, y^{\mathcal{E}(2)}, z^{\mathcal{E}(2)}$) is updated with solution ($x^{(M1)},\linebreak y^{(M1)},z^{(M1)}$), in case $Z^{\mathcal{E}(2)} > Z^{(M1)}$. \item \textit{Update parameters \textup{\textsf{ElapsedTime-PR}} and \textup{\textsf{MIP-PR}}} After solving $(M1)$, \textsf{ElapsedTime-PR} is updated with the time consumed by the PR heuristic up to this point. Then, \textsf{MIP-PR} is set to (\textsf{TimeLimit-PR} $-$ \textsf{ElapsedTime})$/2$, which is half of the time available so far. \item \textit{Stop criteria} If either \textsf{ElapsedTime-PR} is greater than or equal to \textsf{TimeLimit-PR} or the objective function values $Z^{\mathcal{E}(2)}$ and $Z^{\mathcal{E}(3)}$ respectively associated to the solutions ($x^{\mathcal{E}(2)}, y^{\mathcal{E}(2)}, z^{\mathcal{E}(2)}$) and ($x^{\mathcal{E}(3)}, y^{\mathcal{E}(3)}, z^{\mathcal{E}(3)}$) are equal, the algorithm stops and returns $\mathcal{E}$. Otherwise, the heuristic repeats Steps 3 to 6. \end{enumerate} Algorithm \ref{alg:PR} presents a pseudo-code for the proposed PR heuristic, where the elite set with the three solutions is given as input. \begin{algorithm}[!h] \begin{small} \SetAlgoVlined \KwData{$\mathcal{E}$, \textsf{TimeLimit-PR}.} \KwResult{Updated solution set $\mathcal{E}$.} Define set $\Psi$; \\ \textsf{MIP-PR} $\leftarrow$ \textsf{TimeLimit-PR}$/2$; \\ \textsf{ElapsedTime-PR} $\leftarrow$ 0; \\ \While{\textup{\textsf{ElapsedTime-PR} $< $ \textup{\textsf{TimeLimit-PR}} and $Z^{\mathcal{E}(2)} \neq Z^{\mathcal{E}(3)}$}}{ $(x^{(M1)},y^{(M1)},z^{(M1)})$ $ \leftarrow $ solution of the problem $(M1)$ within the time limit of \textsf{MIP-PR};\\ \If{$Z^{(M1)} < Z^{\mathcal{E}(2)}$}{ $(x^{\mathcal{E}(2)},y^{\mathcal{E}(2)},z^{\mathcal{E}(2)}) \leftarrow (x^{(M1)},y^{(M1)},z^{(M1)})$; \\ } Update \textsf{ElapsedTime-PR}; \\ \textsf{MIP-PR} $\leftarrow($\textsf{TimeLimit-PR} - \textsf{ElapsedTime-PR}$)/2$. \\ } Return $\mathcal{E}$. \\ \caption{PR heuristic}\label{alg:PR} \end{small} \end{algorithm} To solve the ILSSP-NT, we propose a hybrid solution method, named RFO-PR, that combines the RF, FO and the PR heuristics. We present a pseudo-code of the RFO-PR heuristic in Algorithm \ref{alg:RFO-PR}. \begin{algorithm}[!h] \begin{small} \SetAlgoVlined \KwData{Instance, \textcolor{black}{$(x^{RF},y^{RF},z^{RF})$, $(x^{RF^*},y^{RF^*},z^{RF^*})$, $(x^{FO},y^{FO},z^{FO})$, \textsf{AvailTime-RFO}, \textsf{TimeLimit-PR}}.} \KwResult{A solution to the problem or a warning message.} \textcolor{black}{$(x^{\mathcal{E}(1)},y^{\mathcal{E}(1))},z^{\mathcal{E}(1)})$ $\leftarrow$ $(x^{RF},y^{RF},z^{RF})$;} \\ \textcolor{black}{$(x^{\mathcal{E}(2)},y^{\mathcal{E}(2))},z^{\mathcal{E}(2)})$ $\leftarrow$ $(x^{RF^*},y^{RF^*},z^{RF^*})$;} \\ \textcolor{black}{$(x^{\mathcal{E}(3)},y^{\mathcal{E}(3))},z^{\mathcal{E}(3)})$ $\leftarrow$ $(x^{FO},y^{FO},z^{FO})$;} \\ \textcolor{black}{\textsf{AvailTime-PR} $\leftarrow$ \textsf{TimeLimit-PR} + \textsf{AvailTime-RFO};} \\ \While{\textcolor{black}{\textup{\textsf{AvailTime-PR}} $> 0$ and $Z^{\mathcal{E}(2)} \neq Z^{\mathcal{E}(3)}$}}{ \textcolor{black}{$Z^{PR} \leftarrow Z^{\mathcal{E}(2)}$;} \\ \textcolor{black}{$\mathcal{E} \leftarrow$ PR heuristic($\mathcal{E}$, \textsf{AvailTime-PR});} \\ \textcolor{black}{Update \textsf{AvailTime-PR};} \\ \If{\textcolor{black}{\textup{\textsf{AvailTime-PR}} $> 0$ and $Z^{PR} > Z^{\mathcal{E}(2)}$ and $Z^{\mathcal{E}(2)} \neq Z^{\mathcal{E}(3)}$} }{ \textcolor{black}{$(x^{\mathcal{E}(3)},y^{\mathcal{E}(3)},z^{\mathcal{E}(3)})$ $\leftarrow$ FO heuristic($(x^{\mathcal{E}(2)},y^{\mathcal{E}(2)},z^{\mathcal{E}(2)})$, \textsf{AvailTime-PR});} \\ \textcolor{black}{Update \textsf{AvailTime-PR};} \\ } } \eIf{\textcolor{black}{$Z^{\mathcal{E}(2)}$ or $Z^{\mathcal{E}(3)}$ is feasible}} { \eIf{\textcolor{black}{$Z^{\mathcal{E}(2)} < Z^{\mathcal{E}(3)}$}} { \textcolor{black}{Return $(x^{\mathcal{E}(2)},y^{\mathcal{E}(2)},z^{\mathcal{E}(2)})$.} \\ }{ \textcolor{black}{Return $(x^{\mathcal{E}(3)},y^{\mathcal{E}(3)},z^{\mathcal{E}(3)})$.} \\ } }{ Return warning message indicating that the method has not found a feasible solution to the ILSSP-NT on parallel machines. } \caption{RFO-PR heuristic}\label{alg:RFO-PR} \end{small} \end{algorithm} Note that, in Algorithm \ref{alg:RFO-PR}, in lines 1 to 3, the elite set to be used by the PR heuristic is built using the solutions of the RFO heuristic given as input. After that, the maximum running time of RFO-PR, referred to as \textsf{AvailTime-PR}, is set with the imposed time limit to the PR heuristic -- \textsf{TimeLimit-PR} -- plus \textsf{AvailTime-RFO}, which is the spare time of the RFO heuristic. In the sequence, the main loop of the RFO-PR heuristic starts. In the loop, the PR and FO heuristics are performed respectively while \textsf{AvailTime-PR} is greater than zero and the objective function values associated with $(x^{\mathcal{E}(2)},y^{\mathcal{E}(2)},z^{\mathcal{E}(2)})$ and $(x^{\mathcal{E}(3)},y^{\mathcal{E}(3)},z^{\mathcal{E}(3)})$ are different. If a solution with a better objective function value in comparison to $(x^{\mathcal{E}(2)},y^{\mathcal{E}(2)},z^{\mathcal{E}(2)})$ is found by the PR heuristic, the FO heuristic is applied to such a solution. The solution found by the FO heuristic is assigned to $(x^{\mathcal{E}(3)},y^{\mathcal{E}(3)},z^{\mathcal{E}(3)})$ whenever this heuristic is called. Finally, in lines 12 to 18, the RFO-PR heuristic returns the best solution found or a warning message indicating that the method has not found a feasible solution to the problem. \subsection{KS heuristic} \label{sec:KS} The main idea behind KS consists, basically, in reducing an original integer problem by re-optimizing the variables most likely to be in the optimal solution and fixing the remaining variables at 0. This means that the reduced problem does not consider part of the decision variables, i.e., it considers just a set of variables denoted by \emph{kernel}. The standard framework of a KS has two phases known as Initialization and Extension phases. In the Initialization phase, the method decides which variables have the best chance of belonging to the optimal solution of the problem and builds the main structure of a KS, which is a kernel and a sequence of buckets. In an attempt to guide the decision on the most promising variables for the optimal solution, KS strategies usually employ a linear relaxation of the problem under study \citep{ang07,angelelli2010}. In line with this, in a minimization problem, the variables with the reduced costs less than a threshold are assigned to the kernel. The remaining variables are arranged as a sequence of equally-sized $nb$ buckets organized in order of reduced costs. Once the kernel and the sequence of buckets is created, a reduced subproblem is solved by considering the re-optimization of the variables in the kernel and fixing the variables assigned to the buckets at 0. The Extension phase is responsible for investigating the solutions of the kernel problem modified by not considering the values of the variables of each bucket to be fixed. The investigation is then performed iteratively by solving, at each iteration $v$, where $v \in \{1, \ldots, nb\}$, a subproblem restricted to the kernel and the $v$-th bucket and by fixing at 0 all the remaining variables. Moreover the subproblem is also subject to two additional constraints. The first constraint limits the objective function value to an upper bound in order to restrict the solution space and provide a faster search. The second constraint is responsible for the enlargement of the kernel by considering to add at least one promising variable from the bucket investigated at iteration $v$ to the kernel in an attempt to obtain a better solution. If a feasible solution is found at iteration $v$, the variables from the $v$-th bucket whose values in the solution are greater than 0 are added to the kernel. The Extension phase halts when all the $nb$ buckets have been investigated. In this paper, we propose a KS specially designed to approach the ILSSP-NT, whose definition of the kernel and the buckets depend on the items with cleansing properties. Solutions found by the RF and FO heuristics also guide the construction of the kernel and the buckets, the reason we named as RFO-KS the introduced solution method. Next, we thoroughly describe both the Initialization and the Extension phases of the RFO-KS heuristic. \subsubsection*{\textbf{Initialization phase}} \label{sec:PI} Different from most KSs found in the literature, besides using the reduced costs related to the variables of the linear relaxation of the problem, a feasible solution obtained by the RF and FO heuristics \textcolor{black}{and the cleansing properties of some items} also guide the construction of the kernel and the buckets. The steps of this phase are described next. \begin{enumerate} \item \textit{Define parameters} \\ Let $(x^{RF^*},y^{RF^*},z^{RF^*})$ and $(x^{FO},y^{FO},z^{FO})$ be the best solutions found by the RF and FO heuristics, respectively. The best solution obtained by the KS heuristic is represented by $(x^{*},y^{*},z^{*})$ and initialized with the solution $(x^{FO},y^{FO},z^{FO})$. The maximum time for the KS heuristic to search for solutions is given by parameter \textsf{AvailTime-KS} that is the sum of two parameters: a pre-defined value in seconds called \textsf{TimeLimit-KS} and the spare time of the RFO heuristic. A parameter called \textsf{MIP-KS}, set with one-third of the value of \textsf{AvailTime-KS}, defines the maximum amount of time to solve each reduced subproblem introduced in the next step of this phase. \textcolor{red}{The set of shortcut items defined as $\Psi$ in the PR heuristic will be used in the KS strategy to guide the construction of the kernel and the buckets, as discussed in the third step of the method.} \item \textit{Solve the linear relaxation of the ILSSP-NT on parallel machines} \\ \textcolor{red}{The method solves problem \eqref{nt:fo}-\eqref{eqmod19}, denoted here to as $(LP)$, with all integrality constraints relaxed.} The optimal solution to $(LP)$ and the reduced costs associated with its variables are represented by tuples $(x^{(LP)},y^{(LP)},z^{(LP)})$ and $(rc^{x},rc^{y},rc^{z})$, respectively. \item \textit{Build the kernel and sequence of buckets}\\ Let $\Delta = (XZ,K)$ be the set responsible for keeping the variables of the kernel, where $XZ$ comprises variables $x_{iktu}$ and $z_{ikt}$, $\forall \, i,k,t,u$. $K$ is composed of the setup state variables $y_{ijkt}$ $\forall\{i,j\} \in \Psi$ plus the variables that satisfy at least one of the following conditions: (i) associated reduced costs $rc^{y}_{ijkt}$ are lower than or equal to 0; (ii) $y_{ijkt}^{(LP)}$ is greater than 0; (iii) either $y_{ijkt}^{RF^*}$ or $y_{ijkt}^{FO}$ is equal to 1. The complementary set $\bar{K}$ with all the variables $y_{ijkt}$ that are not in the kernel are sorted in increasing order according to their associated values in the relaxed solution $y^{(LP)}_{ijkt}$. Next, the variables from $\bar{K}$ are evenly distributed into $nb$ buckets, considering the priority of indexes $i\rightarrow j \rightarrow k \rightarrow t$. Therefore, $\lceil|\bar{K}|/nb \rceil$ binary variables are assigned to each bucket $B_{v}$, where $v \in \{1,\ldots,nb\}$. \item \textit{Solve the MIP of the ILSSP-NT on parallel machines restrict to $\Delta$}\\ \textcolor{red}{The method searches for the first feasible solution by solving problem $(M2)$, whose formulation is the same as $(LP)$, subject to two additional constraints: (i) one that ensures that the solution quality of the problem is lower than or equal to the value of the objective function of solution $(x^{FO},y^{FO},z^{FO})$ returned by RFO; and (ii) a set of constraints that fixes at 0 all variables $y_{ijt}$ that belong to the set of unpromising variables $\bar{K}$.} \item \textit{Update the best solution}\\ If a feasible solution to problem $(M2)$ is found by CPLEX within the time limit of \textsf{MIP-KS} seconds, the method updates the best solution $(x^{*},y^{*},z^{*})$. \end{enumerate} \subsubsection*{\textbf{Extension phase}} \label{sec:FE} The Extension phase iteratively exploits a subproblem restrict to set $\Delta$ combined with the $v$-th bucket, where $v$ represents the current iteration. In \citep{Guastaroba2017}, after testing different configurations to find a good value to the number of buckets $nb$, the authors conclude that $nb$ equals to the number of elements in the complementary set $\bar{K}$ divided by the number of elements in the kernel $K$ leads to a good trade-off between the solution quality and the algorithm efficiency. Therefore, in this paper, we use $\lceil|\bar{K}|/|K|\rceil$ to define the number of buckets to be investigated during the Extension phase of the proposed KS heuristic. \begin{enumerate} \item \textit{Update \textup{\textsf{MIP-KS}}}\\ At each iteration $v$, starting from 1 and ending at $nb$, the updating of parameter \textsf{AvailTime-KS} occurs. This updating is required to calculate the \textsf{MIP-KS} value, which is the division of \textsf{AvailTime-KS} by the number of remaining iterations of the Extension phase. This ensures that the method goes over all buckets. \item \textit{Solve subproblem restrict to $K\cup B_v$}\\ \textcolor{red}{At each iteration $v$, the method solves subproblem $(M3)^{v}$, whose formulation is the same as $(LP)$, subject to three additional constraints: (i) one that ensures that the objective function is lower than or equal to the best solution found so far; (ii) a set of constraints that fixes at 0 all variables $y_{ijt}$ that belong to the set of unpromising variables $\left(\mathop \bigcup \limits_{h=1,h \neq v}^{nb}B_h\right)$; and (iii) a constraint which demands that at least one of the variables from bucket $B_v$ must belong to the solution of subproblem $(M3)^{v}$.} \item \textit{Update the best solution and kernel} \\ If a feasible solution to the subproblem $(M3)^{v}$ is found by CPLEX within the time limit of \textsf{MIP-KS} seconds, the method updates the solution $(x^{*},y^{*},z^{*})$ and the kernel. To update the kernel let $B_{v}^+$ be the set with the promising setup state variables with value 1 in the solution of $(M3)^{v}$. Then, the enlargement criterion of the kernel is performed by adding $B_{v}^+$ into $K$, i.e., $K := (K \cup B_{v}^+)$. Moreover, $B_{v}$ is updated by making $B_{v} := B_{v} \setminus B_{v}^{+}$. \item \textit{Stop criterion} \\ The value of $v$ is incremented by 1. If $v \leq nb$, the Extension phase repeats Steps 1 to 4. Otherwise, the Extension phase halts and the RFO-KS heuristic returns solution $(x^{*},y^{*},z^{*})$ \textcolor{black}{ or a message warning that no feasible solution has been found}. \end{enumerate} A pseudo-code of RFO-KS is presented in Algorithm \ref{alg:KS}. \begin{algorithm}[!h] \begin{small} \SetAlgoVlined \KwData{\textcolor{black}{$(x^{RF^*},y^{RF^*},z^{RF^*})$, $(x^{FO},y^{FO},z^{FO})$, \textsf{AvailTime-RFO}, \textsf{TimeLimit-KS}.}} \KwResult{ A solution to the problem or a warning message.} \tcc{Initialization phase} \textsf{AvailTime-KS} $\leftarrow$ \textsf{TimeLimit-KS} $+$ \textsf{AvailTime-RFO};\\ $(x^{*},y^{*},z^{*}) \leftarrow (x^{FO},y^{FO},z^{FO})$; \\ Define set $\Psi$; \\ Solve the relaxed problem $(LP)$;\\ Build kernel $\Delta = (XZ,K)$ and sequence of buckets $B_v$, with $v\in\{1,\ldots,nb\}$;\\ \textsf{MIP-KS} $\leftarrow$ \textsf{AvailTime-KS}$/3$; \\ $(x^{(M2)},y^{(M2)},z^{(M2)}) \leftarrow$ solution of the problem $(M2)$ found within the time limit of \textsf{MIP-KS};\\ \If{$(x^{(M2)},y^{(M2)},z^{(M2)})$ is feasible}{ $(x^{*},y^{*},z^{*}) \leftarrow (x^{(M2)},y^{(M2)},z^{(M2)})$; \\ } \tcc{Extension phase} \For{$v = 1$ \KwTo $nb$}{ Update \textsf{AvailTime-KS}; \\ \textsf{MIP-KS} $\leftarrow$ \textsf{AvailTime-KS}$/(nb-v+1)$; \\ $(x^{(M3)^{v}},y^{(M3)^{v}},z^{(M3)^{v}}) \leftarrow$ solution of the subproblem $(M3)^{v}$ solved within the time limit of \textsf{MIP-KS};\\ \If{$(x^{(M3)^{v}},y^{(M3)^{v}},z^{(M3)^{v}})$ is feasible}{ $(x^{*},y^{*},z^{*}) \leftarrow (x^{(M3)^{v}},y^{(M3)^{v}},z^{(M3)^{v}})$; \\ Update subsets $K$ and $B_{v}$; \\ } } \eIf{ $(x^{*},y^{*},z^{*})$ is feasible}{ Return $(x^{*},y^{*},z^{*})$. \\ }{ Return warning message stating that the method has not found a feasible solution to ILSSP-NT on parallel machines. } \caption{RFO-KS heuristic}\label{alg:KS} \end{small} \end{algorithm} \section{Computational experiments} \label{TestPre} This section presents the computational experiments carried out for the comparative analysis with the proposed heuristics. Since the only strategies in the revised literature to specifically solve the ILSSP-NT on parallel machines were tested to solve a small set of problems, we performed two experiments to verify the quality of the solutions obtained by the RFO, RFO-PR and RFO-KS heuristics. In the first experiment, we test the solution methods on the ILSSP-NT on a single machine as in \citep{Guimaraes2013}. In the second experiment, the heuristic methods were used to solve the instance set introduced in \citep{James2011} adapted in this paper to the MIP of the ILSSP-NT on parallel machines and their solutions were analyzed. The results obtained by the proposed heuristics \textcolor{red}{in each experiment} are compared with those found by CPLEX v. 12.10 solver, time limited in 3600 seconds \textcolor{red}{and by RFO-PR* and RFO-KS*, which are variants of RFO-PR and RFO-KS, respectively. Different from RFO-PR and RFO-KS, RFO-PR* and RFO-KS* do not consider the adjustment in the methods to consider the shortcut item characteristics found in the ILSSP-NT. In other words, RFO-PR* and RFO-KS* define $\Psi$ as an empty set in RFO-PR and RFO-KS, respectively. The main idea of using RFO-PR* and RFO-KS* in the experiments is to demonstrate the relevance in considering the shortcut items in designing the RFO-PR and RFO-KS heuristics to solve the ILSSP-NT.} The computational tests were carried out in a cluster with 104 computer nodes with two Intel Xeon E5-2680v2 tencore processor of 2.8 GHz, 128 GB DDR3 RAM each. To run the RFO, \textcolor{red}{RFO-PR*, RFO-KS*,} RFO-PR and RFO-KS heuristics, and CPLEX v. 12.10, we used 1 thread and imposed a time limit of 3600 seconds to solve each instance. All algorithms are implemented in C++ language. \subsection{Sets of instances} In the first experiment, we used the 16 classes of 10 instances that \citet{Guimaraes2013} suggested to approach the ILSSP on a single machine with non-triangular setup costs and times. The 160 instances in question have 15 and 25 items ($n$); 10 and 15 periods ($p$); machine capacity usage ($Cut$) of 80\% and 60\%; and setup costs proportional to setup times by a factor ($\Theta$) of 50 and 100. In this sense, each class of instances is referred to as Data$m$-$n$-$p$-$Cut$-$\Theta$. To the second experiment, we adapted the 10 classes of 10 instances initially introduced by \citet{James2011} to approach the ILSSP on parallel machines with capacity variation. The modification was necessary to ensure non-triangular setup costs and times in the 100 instances. The instances used have 2 and 3 parallel machines ($m$); 15 and 20 items ($n$); 5 and 10 periods ($p$); machine capacity usage ($Cut$) of 80\% and 60\%; capacity variation ($CutVar$) of 50\%; setup costs proportional to setup times by a factor ($\Theta$) of 50 and 100; probability of 80\% and 60\% of an extra machine being able to produce a given item ($MProb$); and maximum difference in percentage of the number of items that could be processed in different machines ($MBal$) of 10\% and 20\%. Accordingly, each class of instances is referred to as Data$m$-$n$-$p$-$Cut$-$\Theta$-$MProb$-$MBal$. Tables \ref{tab:1.1} and \ref{tab:1.2} also show how the parameters were defined to the ILSSP-NT on a single machine and parallel machines according to \citet{James2011} and \citet{Guimaraes2013}. \begin{table}[!h] \renewcommand{\arraystretch}{1.5} \centering \begin{scriptsize} \begin{threeparttable}[b] \caption{Parameter definitions shared by all the 26 classes of instances designed for the ILSSP-NT on a single and parallel machines. Each row presents the problem and the uniform distribution (U$[a,b]$) or value used to define their parameters.} \label{tab:1.1} \begin{tabular}{llllll} \hline Problem & $b_{ijt}$ & $b{\tnote{*}}_{ijt}$ &$h_{it}$ &$d_{it}$ & $f_{ikt}$ \\ \hline ILSSP-NT on a single and parallel machines & U$[5,10]$ & U$[2,4]$ & U$[2,9]$ & U$[40,59]$ & 1 \\ \hline \end{tabular} \begin{tablenotes} \item[*] Setup times associated to the items (shortcut items) with cleansing properties that incur in cheaper and faster setup costs and times, which can lead to the violation of the triangular inequalities. \end{tablenotes} \end{threeparttable} \end{scriptsize} \end{table} \begin{table}[!h] \renewcommand{\arraystretch}{2.0} \centering \begin{scriptsize} \caption{Parameter definitions of the 26 classes of instances designed for the ILSSP-NT on a single and parallel machines. Each row presents a class of instances and the uniform distribution (U$[a,b]$) or value used to define their parameters.} \label{tab:1.2} \begin{tabular}{l|l|lccl|l|l} \cline{1-3}\cline{6-8} \multicolumn{3}{c}{ILSSP-NT on a single machine} & & \multicolumn{1}{l}{} & \multicolumn{3}{c}{ILSSP-NT on parallel machines} \\ \cline{1-3}\cline{6-8} \multicolumn{1}{l|}{Class of instances}& $T_{kt}$ & $c_{ijk}$ & & \multicolumn{1}{l}{} & \multicolumn{1}{l|}{Class of instances}& $T_{kt}$ & $c_{ijk}$ \\ \cline{1-3}\cline{6-8} Data1-15-10-0.6-50 & \multirow{4}{*}{$\left(\mathop {\sum }\limits_{i}d_{it}\times 0.6\right)$} & \multirow{8}{*}{$(b_{ijt}\times 50)$} & & & Data2-15-5-0.8-50-80-20 & \multirow{4}{*}{$\left(\mathop {\sum }\limits_{i}d_{it}\times 0.8\right)$} & \multirow{4}{*}{$(b_{ijt}\times 50)$} \\ Data1-15-15-0.6-50 & & & & & Data2-15-10-0.8-50-80-20 & & \\ Data1-25-10-0.6-50 & & & & & Data3-15-5-0.8-50-80-20 & & \\ Data1-25-15-0.6-50 & & & & & Data3-15-10-0.8-50-80-20 & & \\ \cline{1-2}\cline{6-8} Data1-15-10-0.8-50 & \multirow{4}{*}{$\left(\mathop {\sum }\limits_{i}d_{it}\times 0.8\right)$} & & & & Data3-15-10-0.6-100-60-20 & \multirow{1}{*}{$\left(\mathop {\sum }\limits_{i}d_{it}\times 0.6\right)$} & \multirow{6}{*}{$(b_{ijt}\times 100)$} \\ \cline{6-7} Data1-15-15-0.8-50 & & & & & Data2-15-10-0.8-100-80-20 & \multirow{5}{*}{$\left(\mathop {\sum }\limits_{i}d_{it}\times 0.8\right)$} & \\ Data1-25-10-0.8-50 & & & & & Data2-20-10-0.8-100-80-20 & & \\ Data1-25-15-0.8-50 & & & & & Data2-15-10-0.8-100-60-20 & & \\ \cline{1-3} Data1-15-10-0.6-100 & \multirow{4}{*}{$\left(\mathop {\sum }\limits_{i}d_{it}\times 0.6\right)$} & \multirow{8}{*}{$(b_{ijt}\times 100)$} & & & Data2-15-10-0.8-100-80-10 & & \\ Data1-15-15-0.6-100 & & & & & Data3-15-10-0.8-100-60-20 & & \\ \cline{6-8} Data1-25-10-0.6-100 & & & & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} \\ Data1-25-15-0.6-100 & & & & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} \\ \cline{1-2} Data1-15-10-0.8-100 & \multirow{4}{*}{$\left(\mathop {\sum }\limits_{i}d_{it}\times 0.8\right)$} & & & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} \\ Data1-15-15-0.8-100 & & & & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} \\ Data1-25-10-0.8-100 & & & & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} \\ Data1-25-15-0.8-100 & & & & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} \\ \cline{1-3} \end{tabular} \end{scriptsize} \end{table} To ensure that the instances generated in \citep{James2011} and adapted to tackle the ILSSP-NT on single and parallel machines do not obey the triangular inequality, only the values of the setup costs ($c_{ijk}$) and times ($b_{ijt}$) were modified by inserting shortcut items. Therefore, for each machine of every instance we randomly chose $\lceil n/10 \rceil$ shortcut items and the setup times associated to these items were modified to follow the uniform distribution U$[2,4]$. The remainder setup times preserved the same values defined for the instances of the ILSSP on parallel machines with uniform distribution U$[5,10]$. To maintain the proportionality of the setup costs with the setup times, the setup costs $c_{ijk}$ associated to the shortcut items were modified to ensure the proportionality relation presented in Table \ref{tab:1.2}. Moreover, to guarantee the appropriate cleansing of the machines when producing shortcut items, a minimum of 25 units per production lot was imposed. \subsection{Evaluation metric} \textcolor{black}{In the experiments, we assess the optimality gap of CPLEX v.12.10 time limited in 3600 seconds and the gap between the upper bounds found by the introduced heuristics and the lower bounds found by CPLEX. For this, let $gap_{L}$ be the gap distance between lower bound $Z_{LB}$ provided by CPLEX v.12.10 in 3600 seconds and a given upper bound $Z_{UB}$. The formula of $gap_{L}$ is presented in Equation \eqref{gapT}.} \begin{equation} gap_{L} = 100 \times \frac{Z_{UB} - Z_{LB}}{Z_{LB}} \; \% \label{gapT} \end{equation} \subsection{Parameter tuning}\label{sec:tuning} In the attempt to reach the best results with the RFO, RFO-PR and RFO-KS heuristics, the fine tuning of parameters $\lambda$ and $\gamma$ of \textcolor{red}{the RF and FO heuristics} was performed by testing combinations of the values 1, 2, 3, 4 and 5 for all the parameters. \textcolor{red}{In experiments, we observed that the proposed heuristics provided better results on average to solve instances of the ILSSP-NT when $\lambda=4$, $\gamma=3$, in the RF heuristic, and $\lambda = 4$ and $\gamma = 2$, in the FO heuristic.} \textcolor{red}{We also tuned $\zeta$, which is a parameter of RFO-PR. The tested values for $\zeta$ were $p/2$, $2p/3$ and $p$. The results of the experiments indicated that the solutions obtained by RFO-PR are better when $\zeta$ is equal to $2p/3$.} Therefore, the subsequent tests and experiments were carried out considering these parameter values in all heuristics. All computational experiments were performed considering \textsf{TimeLimit-RF}, \textsf{TimeLimit-FO}, \textsf{TimeLimit-KS} and \textsf{TimeLimit-PR} equal to 1200 seconds. Therefore, the maximum amount of time for the RFO heuristic to obtain a solution was 2400 seconds while for the RFO-PR*, RFO-KS*, RFO-KS and RFO-PR heuristics was 3600 seconds. \subsection{Experiment I} To validate the RFO, RFO-PR and RFO-KS heuristics, such heuristics were adapted to solve the ILSSP-NT on a single machine and their results were compared to those obtained by the CPLEX v. \textcolor{black}{12.10} solver \textcolor{red}{and by the RFO-PR* and RFO-KS* heuristics also adapted to solve the ILSSP-NT on a single machine}. We do not compare our results with those obtained by the solution methods reported in \citep{Guimaraes2013} because of the significant differences between the computer configurations used in the experiments, and the CPLEX versions implemented in the matheuristics. Table \ref{tab:1.3} presents the average $gap_{L}$ per class of instances, referred to as $AG_{L}$, as well as the average time (AT) in seconds required by CPLEX, RFO, RFO-PR*, RFO-KS*, RFO-PR and RFO-KS. \begin{table}[!h] \renewcommand{\arraystretch}{1.3} \centering \begin{scriptsize} \caption{Results obtained by CPLEX v. 12.10, RFO, RFO-PR*, RFO-KS*, RFO-PR and RFO-KS to the ILSSP-NT on a single machine. Each row reports the average $gap_L$ ($AG_{L}$) of the upper bounds found by the methods and the average time (AT) to solve each class of instances. } \label{tab:1.3} \begin{tabular}{lrrrrrrrrrrrr} \cline{2-13} & \multicolumn{2}{c}{CPLEX} & \multicolumn{2}{c}{RFO} & \multicolumn{2}{c}{RFO-PR*} & \multicolumn{2}{c}{RFO-KS*} & \multicolumn{2}{c}{RFO-PR} & \multicolumn{2}{c}{RFO-KS} \\ \hline Class of instances & \multicolumn{1}{c}{$AG_{L}$} & \multicolumn{1}{c}{AT} & \multicolumn{1}{c}{$AG_{L}$} & \multicolumn{1}{c}{AT} & \multicolumn{1}{c}{$AG_{L}$} & \multicolumn{1}{c}{AT} & \multicolumn{1}{c}{$AG_{L}$} & \multicolumn{1}{c}{AT} & \multicolumn{1}{c}{$AG_{L}$} & \multicolumn{1}{c}{AT} & \multicolumn{1}{c}{$AG_{L}$} & \multicolumn{1}{c}{AT} \\ \hline Data1-15-10-0.6-50 & \textbf{0.00} & 7 & 0.01 & 15 & 0.01 & 20 & 0.01 & 21 & 0.01 & 22 & 0.01 & 24 \\ Data1-15-10-0.6-100 & \textbf{0.00} & 361 & 0.10 & 54 & 0.08 & 784 & 0.09 & 184 & 0.06 & 1177 & 0.02 & 709 \\ Data1-15-10-0.8-50 & \textbf{0.00} & 77 & 0.04 & 32 & 0.04 & 42 & 0.03 & 42 & 0.03 & 407 & \textbf{0.01} & 63 \\ Data1-15-10-0.8-100 & \textbf{0.01} & 1615 & 0.20 & 181 & 0.20 & 245 & 0.17 & 813 & 0.16 & 1471 & 0.08 & 1775 \\ Data1-15-15-0.6-50 & \textbf{0.00} & 78 & 0.06 & 37 & 0.06 & 48 & 0.06 & 55 & 0.05 & 410 & 0.04 & 91 \\ Data1-15-15-0.6-100 & \textbf{0.34} & 3343 & 0.43 & 222 & 0.43 & 333 & 0.41 & 1722 & 0.40 & 2361 & 0.40 & 2871 \\ Data1-15-15-0.8-50 & \textbf{0.02} & 1082 & 0.05 & 91 & 0.05 & 472 & 0.05 & 239 & 0.05 & 516 & 0.05 & 599 \\ Data1-15-15-0.8-100 & 0.87 & 3600 & \textbf{0.83} & 208 & \textbf{0.83} & 324 & \textbf{0.83} & 2090 & \textbf{0.83} & 2090 & \textbf{0.83} & 3599 \\ Data1-25-10-0.6-50 & \textbf{0.00} & 97 & 0.04 & 70 & 0.04 & 95 & 0.04 & 99 & 0.03 & 455 & 0.02 & 132 \\ Data1-25-10-0.6-100 & \textbf{0.14} & 2980 & 0.22 & 377 & 0.21 & 815 & 0.19 & 2109 & 0.17 & 2311 & 0.17 & 2750 \\ Data1-25-10-0.8-50 & \textbf{0.00} & 128 & 0.03 & 105 & 0.03 & 130 & 0.03 & 178 & 0.03 & 154 & 0.03 & 397 \\ Data1-25-10-0.8-100 & \textbf{0.44} & 3600 & 0.46 & 1388 & \textbf{0.44} & 2015 & 0.46 & 3100 & 0.45 & 2765 & 0.45 & 3357 \\ Data1-25-15-0.6-50 & \textbf{0.01} & 961 & 0.03 & 160 & 0.03 & 550 & 0.03 & 206 & 0.02 & 900 & 0.03 & 343 \\ Data1-25-15-0.6-100 & 0.70 & 3600 & 0.58 & 742 & 0.57 & 1814 & 0.58 & 3585 & \textbf{0.54} & 3406 & 0.58 & 3600 \\ Data1-25-15-0.8-50 & \textbf{0.01} & 1815 & 0.05 & 490 & 0.05 & 1496 & 0.05 & 811 & 0.05 & 2233 & 0.05 & 1452 \\ Data1-25-15-0.8-100 & 1.21 & 3600 & 0.75 & 1715 & 0.75 & 2820 & 0.75 & 3582 & \textbf{0.74} & 3221 & 0.75 & 3600 \\ \hline Average & 0.23 & 1684 & 0.24 & 368 & 0.24 & 750 & 0.24 & 1177 & 0.23 & 1494 & \textbf{0.22} & 1585 \\ \hline \end{tabular} \end{scriptsize} \end{table} One can observe in Table \ref{tab:1.3} that, on average, the RFO, \textcolor{red}{RFO-PR*, RFO-KS*,} RFO-PR and RFO-KS heuristics obtained competitive results to those found by CPLEX, which proved the optimality of 6 classes of instances. RFO-KS had the best mean $AG_L$, followed by RFO-PR\textcolor{red}{, CPLEX, RFO-PR*, RFO-KS* and RFO}. In particular, \textcolor{red}{all the} solution methods achieved upper bounds significantly better than those found by CPLEX in the classes of instances Data1-25-15-0.6-100 and Data1-25-15-0.8-100. \textcolor{red}{RFO-PR* and RFO-KS* had the lowest improvement rates to the initial solutions provided by the RFO heuristic, showing a better performance of the RFO-PR and RFO-KS heuristics.} Table \ref{tab:1.4} shows the average results of this experiment considering the instances divided into pairs of disjoints groups according to their main characteristics. Each row of this table indicates the average $gap_L$ per group of instances ($AG_L$) that share the following characteristics: number of periods ($p$), number of items ($n$), capacity usage ($Cut$) and proportionality factor between setup costs and times ($\Theta$). The $AG_L$ values marked with a `$\dag$' sign indicate that the results highlighted in bold in the corresponding rows are statistically better than the marked gaps. To assess the statistical significance of the results, we conducted a pairwise t-test~\cite{student1908probable}. We ran this test with the standard significance level of $5\%$. \begin{table}[!h] \renewcommand{\arraystretch}{1.3} \centering \begin{scriptsize} \caption{Results obtained by CPLEX v. 12.10, RFO, RFO-PR*, RFO-KS*, RFO-PR and RFO-KS per group of instances combined according to their main characteristics: $p$ (15 and 25), $n$ (10 and 15), $Cut$ (0.6 and 0.8) and $\Theta$ (50 and 100). Each row reports the average $gap_L$ ($AG_{L}$) of the upper bounds obtained by the methods to solve each group of instances.} \label{tab:1.4} \begin{tabular}{lllrrrrrrrrrrr} \cline{4-14} & & & \multicolumn{1}{l}{CPLEX} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{RFO} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{RFO-PR*} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{RFO-KS*} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{RFO-PR} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{RFO-KS} \\ \cline{1-2} \cline{4-4} \cline{6-6} \cline{8-8} \cline{10-10} \cline{12-12} \cline{14-14} Parameter & Values & & \multicolumn{1}{c}{$AG_{L}$} & \multicolumn{1}{l}{} & \multicolumn{1}{c}{$AG_{L}$} & \multicolumn{1}{l}{} & \multicolumn{1}{c}{$AG_{L}$} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{$AG_{L}$} & \multicolumn{1}{l}{} & \multicolumn{1}{c}{$AG_{L}$} & \multicolumn{1}{l}{} & \multicolumn{1}{c}{$AG_{L}$} \\ \hline \multirow{2}{*}{$p$} & 15 & & \textbf{0.155} & & 0.216$^{\dag}$ & & 0.213$^{\dag}$ & & 0.208$^{\dag}$ & & 0.201$^{\dag}$ & & 0.181$^{\dag}$ \\ & 25 & & 0.313$^{\dag}$ & & 0.269$^{\dag}$ & & 0.264 & & 0.267$^{\dag}$ & & \textbf{0.252} & & 0.259$^{\dag}$ \\ \hline \multirow{2}{*}{$n$} & 10 & & \textbf{0.072} & & 0.135$^{\dag}$ & & 0.130$^{\dag}$ & & 0.127$^{\dag}$ & & 0.119$^{\dag}$ & & 0.099$^{\dag}$ \\ & 15 & & 0.395$^{\dag}$ & & 0.350$^{\dag}$ & & 0.347$^{\dag}$ & & 0.347$^{\dag}$ & & \textbf{0.334} & & 0.342 \\ \hline \multirow{2}{*}{$Cut$} & 0.6 & & \textbf{0.148} & & 0.184$^{\dag}$ & & 0.179$^{\dag}$ & & 0.178 & & 0.160 & & 0.158 \\ & 0.8 & & 0.320 & & 0.302$^{\dag}$ & & 0.298 & & 0.297$^{\dag}$ & & 0.293 & & \textbf{0.282} \\ \hline \multirow{2}{*}{$\Theta$} & 50 & & \textbf{0.005} & & 0.040$^{\dag}$ & & 0.039$^{\dag}$ & & 0.039$^{\dag}$ & & 0.034$^{\dag}$ & & 0.030$^{\dag}$ \\ & 100 & & 0.463$^{\dag}$ & & 0.446$^{\dag}$ & & 0.438$^{\dag}$ & & 0.436$^{\dag}$ & & 0.419 & & \textbf{0.410} \\ \hline \end{tabular} \end{scriptsize} \end{table} \textcolor{black}{According to Table \ref{tab:1.4}, RFO-PR outperformed \textcolor{red}{with statistical significance: (i) RFO in every group of instances; (ii) RFO-PR* in all the groups except for the one with the highest $Cut$ value; (iii) RFO-KS* in the groups with the highest values of $p$ and $n$, with $Cut$ equals to 0.6, and in the groups with both values of $\Theta$; and (iv) } CPLEX in the groups with the highest $p$ and $n$ values. RFO-KS performed \textcolor{red}{statistically better than: (i) RFO and RFO-KS* in all the groups; (ii) RFO-PR* in the group with the highest $\Theta$ besides the groups with the lowest parameter values; and (iii) CPLEX in the groups with the highest values of $p$, $n$ and $\Theta$}. CPLEX outperformed RFO, RFO-PR*, RFO-KS*, RFO-PR and RFO-KS with statistical significance in the groups with the lowest parameter values.} \textcolor{black}{In Figure~\ref{fig:dolanexp1}, we present the performance profiles introduced in \cite{Dolan2002} contrasting the upper bounds found by the \textcolor{red}{six} methods. In this evaluation, the performance profile of a method consists of the cumulative distribution function for the objective function. It is possible to observe that CPLEX achieved the best upper bounds in 76\% of the instances, whereas RFO-PR and RFO-KS obtained the best solutions in approximately 54\% of the tested instances. RFO found the best solutions in around 47\% of the instances, \textcolor{red}{followed by RFO-KS* and RFO-PR* with the best solutions in approximately 48\% and 50\% of the instances, respectively}. It is possible to observe in the graphic that RFO-KS had the best results in almost all instances when $\tau$ is just 1.002. This means that in almost all the 46\% of instances that such method did not obtain the best upper bounds, its values were worse than the best by a factor of at most 0.2\%. Besides, the curve of CPLEX crossed with the profiles of \textcolor{red}{RFO-KS* and} RFO-PR for $\tau$ equals \textcolor{red}{1.0015}. This means that the \textcolor{red}{three} solution methods have the same percentage of solutions whose quality is at most 0.15\% worst than the best overall solutions. Moreover, according to the performance profiles, \textcolor{red}{RFO-KS dominates CPLEX and the other methods} for $\tau\geq 1.0013$.} \begin{figure}[htbp] \center \begin{tikzpicture} \pgfplotsset{every axis legend/.append style={ at={(0.8,0.05)}, anchor=south} }, \begin{axis}[ width=14cm, height=7cm, legend columns=1, xmin=0.99997, xmax=1.0051, xtick={1,1.001,1.002,1.003,1.004,1.005}, xticklabels={1,1.001,1.002,1.003,1.004,1.005}, ymin=0.45, ymax=1.02, grid=major, xlabel={$\tau$}, ylabel={$\Theta(\tau)$ }, ] \addplot[/tikz/solid, blue!50!white,line width=1pt] table[x=x,y=y] {Tudo-SM-CPLEX.txt}; \addplot[/tikz/solid, red!70!white,line width=1.5pt] table[x=x,y=y] {Tudo-SM-RFO.txt}; \addplot[/tikz/solid, black!60!white,line width=2pt] table[x=x,y=y] {Tudo-SM-RFO-PR1.txt}; \addplot[/tikz/densely dashed, green!70!black,line width=2pt] table[x=x,y=y] {Tudo-SM-RFO-KS1.txt}; \addplot[/tikz/dotted, orange!70!white,line width=3pt] table[x=x,y=y] {Tudo-SM-RFO-PR2.txt}; \addplot[/tikz/dashdotdotted, violet!70!white,line width=2.5pt] table[x=x,y=y] {Tudo-SM-RFO-KS2.txt}; \legend{CPLEX, RFO, RFO-PR*, RFO-KS*, RFO-PR, RFO-KS} \end{axis} \end{tikzpicture} \caption{Performance profiles associated to the upper bounds obtained by CPLEX, RFO, RFO-PR*, RFO-KS*, RFO-PR and RFO-KS to solve the ILSSP-NT on a single machine.} \label{fig:dolanexp1} \end{figure} \textcolor{black}{Therefore, the results of this experiment indicate that the introduced methods, in particular, RFO-KS, have a good performance in solving ILSSP-NT on a single machine. The next section presents the results of the introduced methods to the ILSSP-NT on parallel machines.} \subsection{Experiment II} This section is dedicated to attest the good performance of the RFO, RFO-PR and RFO-KS heuristics proposed to solve ILSSP-NT on parallel machines. Table \ref{tab:2.1} presents the average $gap_{L}$, denoted by $AG_{L}$, obtained by the methods and the respective average times (AT) in seconds. \begin{table}[!h] \renewcommand{\arraystretch}{1.3} \centering \begin{scriptsize} \caption{Results obtained by CPLEX v. 12.10, RFO, RFO-PR*, RFO-KS*, RFO-PR and RFO-KS to the ILSSP-NT on parallel machines. Each row reports the average $gap_L$ ($AG_{L}$) of the upper bounds found by the methods and the average time (AT) in seconds to solve each class of instances.} \label{tab:2.1} \begin{tabular}{llrrrrrrrrrrr} \cline{2-13} & \multicolumn{2}{c}{CPLEX} & \multicolumn{2}{c}{RFO} & \multicolumn{2}{c}{RFO-PR*} & \multicolumn{2}{c}{RFO-KS*} & \multicolumn{2}{c}{RFO-PR} & \multicolumn{2}{c}{RFO-KS} \\ \hline Class of instances & $AG_{L}$ & AT & $AG_{L}$ & AT & $AG_{L}$ & AT & $AG_{L}$ & AT & $AG_{L}$ & AT & $AG_{L}$ & AT \\ \hline Data2-15-5-0.8-50-80-20 & \textbf{0.00} & 24 & 0.08 & 36 & 0.08 & 37 & 0.08 & 38 & 0.08 & 52 & 0.08 & 39 \\ Data2-15-10-0.8-50-80-20 & 0.81 & 3504 & 0.82 & 51 & 0.77 & 718 & 0.81 & 52 & \textbf{0.68} & 1857 & 0.81 & 676 \\ Data2-15-10-0.8-100-60-20 & \textbf{1.32} & 3289 & 1.40 & 62 & 1.34 & 873 & 1.40 & 713 & 1.33 & 2133 & 1.36 & 1243 \\ Data2-15-10-0.8-100-80-10 & 4.66 & 3600 & 3.76 & 2125 & 3.70 & 3062 & 3.70 & 2426 & 3.51 & 2816 & \textbf{3.48} & 2222 \\ Data2-15-10-0.8-100-80-20 & 3.70 & 3600 & 3.50 & 1951 & 3.46 & 2936 & 3.46 & 2085 & \textbf{3.16} & 2745 & \textbf{3.16} & 1998 \\ Data2-20-10-0.8-100-80-20 & 2.45 & 3600 & 2.28 & 2271 & 2.26 & 3393 & 2.26 & 2594 & 2.08 & 3282 & \textbf{2.08} & 2496 \\ Data3-15-5-0.8-50-80-20 & \textbf{0.31} & 1475 & 0.46 & 780 & 0.43 & 1197 & 0.45 & 788 & 0.40 & 1738 & 0.45 & 897 \\ Data3-15-10-0.6-100-60-20 & 1.69 & 3275 & 1.70 & 841 & 1.67 & 1068 & 1.70 & 860 & \textbf{1.54} & 2819 & 1.66 & 1512 \\ Data3-15-10-0.8-50-80-20 & 2.30 & 3600 & 2.17 & 1592 & 1.95 & 2388 & 2.16 & 1621 & \textbf{1.82} & 2411 & 2.01 & 1645 \\ Data3-15-10-0.8-100-60-20 & 4.79 & 3600 & 5.07 & 1954 & 4.94 & 2995 & 5.02 & 2013 & \textbf{4.50} & 3007 & 4.55 & 2021 \\ \hline Average & 2.20 & 2957 & 2.12 & 1269 & 2.06 & 1867 & 2.10 & 1367 & \textbf{1.91} & 2286 & 1.96 & 1475 \\ \hline \end{tabular} \end{scriptsize} \end{table} Table~\ref{tab:2.1} shows that RFO, RFO-PR*, RFO-KS*, RFO-PR and RFO-KS obtained very competitive results to those found by CPLEX. Both RFO-PR and RFO-KS achieved the best overall averages \textcolor{red}{1.91\% and 1.96\%, respectively, in contrast to} the average of 2.20\% obtained by CPLEX. \textcolor{red}{Regarding} the mean running times, RFO-KS was significantly faster than RFO-PR and CPLEX. \textcolor{red}{In comparison to the solutions obtained by RFO, RFO-KS* provided the worst improvement rates, on average, followed by RFO-PR*.} A second analysis of the results considering the instances divided into pairs of disjoint groups in 7 different ways according to the parameters $m$, $p$, $n$, $Cut$, $\Theta$, $MProb$ and $MBal$ is presented in Table \ref{tab:2.2}. Each row of Table \ref{tab:2.2} indicates the average $gap_L$ ($AG_L$) per group of instances that share the same parameter values indicated in the first columns. The $AG_L$ values marked with a `$\dag$' sign indicate that the results highlighted in bold in the corresponding rows are statistically better than the marked gaps. Again, to assess the statistical significance of the results, we conducted a pairwise t-test ~\cite{student1908probable}. We ran this test with the standard significance level of $5\%$. \begin{table}[!h] \renewcommand{\arraystretch}{1.3} \centering \begin{scriptsize} \caption{Results obtained by CPLEX v. 12.10, RFO, RFO-PR*, RFO-KS*, RFO-PR and RFO-KS per group of instances combined according to their main characteristics: $m$ (2 and 3), $p$ (15 and 20), $n$ (5 and 10), $Cut$ (0.6 and 0.8), $\Theta$ (50 and 100), $MProb$ (60 and 80) and $MBal$ (10 and 20). Each row reports the average $gap_L$ ($AG_{L}$) of the upper bounds found by the methods after solving each group of instances.} \label{tab:2.2} \begin{tabular}{cclrrrrrrrrrrr} \cline{4-14} & & & \multicolumn{1}{c}{CPLEX} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{RFO} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{RFO-PR*} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{RFO-KS*} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{RFO-PR} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{RFO-KS} \\ \cline{1-2} \cline{4-4} \cline{6-6} \cline{8-8} \cline{10-10} \cline{12-12} \cline{14-14} Parameter & Value & & \multicolumn{1}{c}{$AG_{L}$} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{$AG_{L}$} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{$AG_{L}$} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{$AG_{L}$} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{$AG_{L}$} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{$AG_{L}$} \\ \hline \multirow{2}{*}{$m$} & 2 & & 2.139$^{\dag}$ & & 1.954$^{\dag}$ & & 1.918$^{\dag}$ & & 1.936$^{\dag}$ & & \textbf{1.790} & & 1.814 \\ & 3 & & 2.276$^{\dag}$ & & 2.351$^{\dag}$ & & 2.252$^{\dag}$ & & 2.337$^{\dag}$ & & \textbf{2.070} & & 2.173$^{\dag}$ \\ \hline \multirow{2}{*}{$p$} & 15 & & 2.204$^{\dag}$ & & 2.129$^{\dag}$ & & 2.062$^{\dag}$ & & 2.113$^{\dag}$ & & \textbf{1.915} & & 1.976$^{\dag}$ \\ & 20 & & 2.451$^{\dag}$ & & 2.282 & & 2.269 & & 2.266 & & 2.085 & & \textbf{2.083} \\ \hline \multirow{2}{*}{$n$} & 5 & & \textbf{0.166} & & 0.280$^{\dag}$ & & 0.265$^{\dag}$ & & 0.280$^{\dag}$ & & 0.250$^{\dag}$ & & 0.280$^{\dag}$ \\ & 10 & & 2.719$^{\dag}$ & & 2.588$^{\dag}$ & & 2.515$^{\dag}$ & & 2.567$^{\dag}$ & & \textbf{2.331} & & 2.393$^{\dag}$ \\ \hline \multirow{2}{*}{$Cut$} & 0.6 & & 1.696 & & 1.700$^{\dag}$ & & 1.674$^{\dag}$ & & 1.700$^{\dag}$ & & \textbf{1.546} & & 1.665 \\ & 0.8 & & 2.289$^{\dag}$ & & 2.195$^{\dag}$ & & 2.129$^{\dag}$ & & 2.176$^{\dag}$ & & \textbf{1.975} & & 2.023$^{\dag}$ \\ \hline \multirow{2}{*}{$\Theta$} & 50 & & 0.880 & & 0.902 & & 0.828 & & 0.902 & & \textbf{0.764} & & 0.862 \\ & 100 & & 3.106$^{\dag}$ & & 2.953$^{\dag}$ & & 2.899$^{\dag}$ & & 2.925$^{\dag}$ & & \textbf{2.691} & & 2.719$^{\dag}$ \\ \hline \multirow{2}{*}{$Mprob$} & 60 & & 2.603 & & 2.725$^{\dag}$ & & 2.655$^{\dag}$ & & 2.707$^{\dag}$ & & \textbf{2.462} & & 2.527$^{\dag}$ \\ & 80 & & 2.067$^{\dag}$ & & 1.893$^{\dag}$ & & 1.834$^{\dag}$ & & 1.877$^{\dag}$ & & \textbf{1.702} & & 1.752 \\ \hline \multirow{2}{*}{$Mbal$} & 10 & & 4.668$^{\dag}$ & & 3.762 & & 3.700 & & 3.700 & & 3.515 & & \textbf{3.487} \\ & 20 & & 1.955$^{\dag}$ & & 1.963$^{\dag}$ & & 1.902$^{\dag}$ & & 1.952$^{\dag}$ & & \textbf{1.754} & & 1.819$^{\dag}$ \\ \hline \end{tabular} \end{scriptsize} \end{table} According to Table \ref{tab:2.2}, both RFO-PR and RFO-KS outperformed CPLEX with statistical significance in at least one of the groups per parameter. In particular, when the instances were grouped considering parameters $p$ and $MBal$, RFO-PR and RFO-KS outperformed CPLEX in both groups. \textcolor{red}{RFO-PR* and RFO-KS* were better than CPLEX in the groups with the lowest $m$ and $Mbal$ values, and in the group with the highest $Mprob$. Moreover, RFO-PR* also outperformed CPLEX in the groups with the highest $n$ and $Cut$ values.} CPLEX outperformed \textcolor{red}{RFO-PR*, RFO-KS*,} RFO-PR and RFO-KS with statistical significance in only one of the groups of instances\textcolor{red}{, and RFO in two groups}. These results show that RFO-PR and RFO-KS excelled at solving the ILSSP-NT on parallel machines. \textcolor{red}{Besides, considering the results presented in Table~\ref{tab:2.2}, we carried out a pairwise t-test to assess the impact of the intensification strategies on the quality of the obtained solutions and the superiority of RFO-KS and RFO-PR over the other methods. The results indicated that RFO-PR and RFO-KS had significantly better gaps \textcolor{red}{in all the groups with the highest values per parameter. Apart from the groups with the lowest values of $n$, $\Theta$ and $Mbal$, and with the highest $p$, RFO-PR outperformed RFO, RF-PR* and RFO-KS* in all other groups. RFO-KS was better than RFO and RFO-KS* in the groups with the lowest values of $m$, $p$ and $Mprob$, and highest $n$, $Cut$ and $Mbal$ values. Moreover, RFO-KS outperformed RFO-PR* with statistical significance in the groups with the lowest $m$, and highest values of $n$, $Cut$, $\Theta$ and $Mbal$.} These results demonstrate that (i) the hybridization of RFO with the intensification strategies provided a significant improvement in the method; and (ii) the consideration of shortcut items in KS and PR provided better results for the hybrid heuristics.} Figure~\ref{fig:dolanexp2} shows the performance profiles introduced in \cite{Dolan2002} contrasting the upper bounds found by the six methods. It is possible to observe that RFO-KS and RFO-PR achieved the best upper bounds in 66\% and 63\% of the instances, respectively, whereas \textcolor{red}{RFO, RFO-PR*, RFO-KS* and CPLEX obtained the best solutions in approximately 33\%, 40\%, 34\% and 42\%}, respectively. It is also possible to observe in the graphic that RFO-PR had the best results in all instances when $\tau$ is just \textcolor{red}{1.006}. Besides, the curves of RFO-KS and RFO-PR dominated the CPLEX\textcolor{red}{, RFO, RFO-PR* and RFO-KS*} curves. These results state the outstanding results of both RFO-KS and RFO-PR to the ILSSP-NT on parallel machines. \begin{figure}[htbp] \center \begin{tikzpicture} \pgfplotsset{every axis legend/.append style={ at={(0.8,0.05)}, anchor=south} }, \begin{axis}[ width=14cm, height=7cm, legend columns=1, xmin=0.9998, xmax=1.023, xtick={1.000,1.005,1.010,1.015,1.020}, xticklabels={1,1.005,1.010,1.015,1.020}, ymin=0.3, ymax=1.02, grid=major, xlabel={$\tau$}, ylabel={$\Theta(\tau)$ }, ] \addplot[/tikz/solid, blue!50!white,line width=1pt] table[x=x,y=y] {Tudo-PM-CPLEX.txt}; \addplot[/tikz/solid, red!70!white,line width=2pt] table[x=x,y=y] {Tudo-PM-RFO.txt}; \addplot[/tikz/solid, black!60!white,line width=3pt] table[x=x,y=y] {Tudo-PM-RFO-PR1.txt}; \addplot[/tikz/densely dashed, green!70!black,line width=2pt] table[x=x,y=y] {Tudo-PM-RFO-KS1.txt}; \addplot[/tikz/dotted, orange!70!white,line width=3pt] table[x=x,y=y] {Tudo-PM-RFO-PR2.txt}; \addplot[/tikz/dashdotdotted, violet!70!white,line width=2.5pt] table[x=x,y=y] {Tudo-PM-RFO-KS2.txt}; \legend{CPLEX, RFO, RFO-PR*, RFO-KS*, RFO-PR, RFO-KS} \end{axis} \end{tikzpicture} \caption{Performance profiles associated to the upper bounds obtained by CPLEX, RFO, RFO-PR*, RFO-KS*, RFO-PR and RFO-KS to solve the ILSSP-NT on parallel machine.} \label{fig:dolanexp2} \end{figure} \section{Final remarks} \label{conclu} This paper tackled the integrated lot sizing and scheduling problem on non-identical parallel machines with capacity constraints, setup carry-over and sequence-dependent setup costs and times that are not-triangular, referred to here as ILSSP-NT on parallel machines. The ILSSP-NT on parallel machines is of utmost importance to the rising sector of food processing industry, for example. It is a very challenging problem and, to the best of our knowledge, \cite{Kang1999} and \cite{Meyr02} were the only studies to address this problem. More attention was given to its variants such as the ILSSP-NT on a single machine and the ILSSP on parallel machines. After a thorough literature review on related problems, we decided to adapt the mathematical formulation proposed in \citep{Guimaraes14} to approach the ILSS-NT on parallel machines. MIP-based heuristics have been extensively used to solve most of the problems related to the ILSSP-NT on parallel machines. Bearing this in mind, in order to efficiently solve the ILSSP-NT on parallel machines, in this paper we proposed three matheuristics referred to as RFO, RFO-PR and RFO-KS. The RFO heuristic is a one-step method that combines a simple version of the RF and the FO heuristics to find solutions to the ILSSP-NT on parallel machines. The RFO-PR and RFO-KS heuristics are two-step methods: in the first step the RF and the FO heuristics are combined (RFO) to find initial solutions; and in the second step, the intensification-based heuristics path-relinking and kernel search are used to refine the initial solutions in the RFO-PR and RFO-KS, respectively. For a thorough comparative analysis, \textcolor{red}{two experiments were performed with} the proposed methods to approach the ILSSP-NT on a single machine and the ILSSP-NT on parallel machines using the instance sets introduced in \citep{Guimaraes2013} and in \citep{James2011}, respectively. In the first experiment, we attest that the RFO, RFO-PR and RFO-KS heuristics can offer good quality solutions to the ILSSP-NT on a single machine as well as the CPLEX v. 12.10 solver time limited in 3600 seconds. The second experiment contrasting the results obtained by the RFO, RFO-PR and RFO-KS heuristics and CPLEX v. 12.10 solver time limited to solve the ILSSP-NT on parallel machines demonstrates the best performance of the proposed heuristics. Moreover, we show that RFO-KS and RFO-PR improved the solutions found by RFO in most of the cases with statistical significance. \textcolor{red}{In addition, to validate the adjustments specially designed to tackle the ILSSP-NT, we considered the variants of RFO-PR and RFO-KS without the adjustments, called RFO-PR* and RFO-KS*, respectively. Both experiments provide an analysis that shows the better performance of the proposed RFO-PR and RFO-KS over RFO-PR* and RFO-KS*, respectively.} \section{Acknowledgments} \label{agradecimentos} We are thankful to the financial support from the Coordenação de Aperfeiçoamento de Pessoal de Nível Superior (CAPES), to Fundação de Amparo à Pesquisa do Estado de São Paulo (FAPESP) under grant numbers 16/02537-0 and 15/21660-4, and to Conselho Nacional de Desenvolvimento Científico e Tecnológico (CNPq) under grant number 306036/2018-56. Research carried out using the computational resources of the Center for Mathematical Sciences Applied to Industry (CeMEAI) funded by FAPESP (grant 2013/07375-0). The second author also thanks Leonardo V. Rosset for giving her a hand. We are also very thankful for the valuable comments of the anonymous referees. \section*{References} \bibliographystyle{apa} \section{Pseudo-codes of the RF and FO heuristics} \label{appendix} \textcolor{red}{This section presents the pseudo-codes of RF and FO heuristics in Algorithms \ref{alg:RF} and \ref{alg:FO}, respectively}. \begin{algorithm}[!h] \begin{small} \SetAlgoVlined \KwData{Instance, $\lambda$, $\gamma$, \textsf{TimeLimit-RF}.} \KwResult{The solution found in iteration $\theta-3$ and the best solution found to the problem.} $S^ {\phi} \leftarrow \{ (i,k,\phi,u): i \in \{1,\ldots,n\}, k \in \{1,\ldots,m\}; u \in \{\phi,\ldots,p\}\}, \quad \forall \; \phi = 1, \ldots, p$; \\ \textcolor{black}{$\theta \leftarrow \lceil(p-\lambda) /(\lambda -\gamma)\rceil+1$;} \\ \textcolor{black}{Define $[t'_{v},t^{"}_{v}],\, \forall \; v = 1, \ldots, \theta$, as described in Step 1 of RF heuristic;}\\ \textcolor{black}{\textsf{MIP-RF} $\leftarrow$ \textsf{TimeLimit-RF}$/\theta$;} \\ $v \leftarrow 1$;\\ \While{ any stop criteria is not reached}{ $(x^{(MIP)^{v}},y^{(MIP)^{v}},z^{(MIP)^{v}})$ $\leftarrow $ solution of problem $(MIP)^{v}$ \textcolor{black}{within the time limit of \textsf{MIP-RF};}\\ $v \leftarrow v + 1$;\\ } Return \textcolor{black}{$\{(x^{(MIP)^{\theta -3}},y^{(MIP)^{\theta -3}},z^{(MIP)^{\theta -3}}), (x^{(MIP)^{v}},y^{(MIP)^{v}},z^{(MIP)^{v}})\}$}. \\ \caption{RF heuristic}\label{alg:RF} \end{small} \end{algorithm} \begin{algorithm}[!h] \begin{small} \SetAlgoVlined \KwData{$(x^{*},y^{*},z^{*})$, $\lambda$, $\gamma$, \textsf{TimeLimit-FO}.} \KwResult{Updated $(x^{*},y^{*},z^{*})$.} $S^ {\phi} \leftarrow \{ (i,k,t,u): i \in \{1,\ldots,n\},\, k \in \{1,\ldots,m\};\, t = \phi;\, u \in \{1,\ldots,p\}\}, \quad \forall \; \phi = 1, \ldots, p$; \\ $\theta \leftarrow \lceil(p-\lambda)/(\lambda -\gamma)\rceil+1$; \\ Define period intervals $[t'_{v},t^{"}_{v}],\, \forall \; v = 1, \ldots, \theta$, as described in Step 1 of the FO heuristic;\\ \textsf{MIP-FO} $\leftarrow$ \textsf{TimeLimit-FO}$/\theta$; \\ \textsf{ElapsedTime-FO} $\leftarrow$ 0; \\ \textcolor{black}{$v \leftarrow 1$;}\\ \textcolor{black}{$search \leftarrow 0$;} \\ \While{\textcolor{black}{\textup{\textsf{ElapsedTime-FO}} $< $ \textup{\textsf{TimeLimit-FO}} and $v \neq 0$}}{ \textcolor{black}{$(x^{(MIP)^{v}},y^{(MIP)^{v}},z^{(MIP)^{v}})\leftarrow $ solution of problem $(MIP)^{v}$ within the time limit of \textsf{MIP-FO};} \\ \If{\textcolor{black}{$Z^{(MIP)^{v}} < Z^{*}$}}{ \textcolor{black}{$(x^{*},y^{*},z^{*}) \leftarrow (x^{(MIP)^{v}},y^{(MIP)^{v}},z^{(MIP)^{v}})$;}\\ \textcolor{black}{$search \leftarrow 1$;} \\ } \eIf{\textcolor{black}{$v < \theta$}}{ \textcolor{black}{$v \leftarrow v + 1$;} \\ } { \eIf{\textcolor{black}{$search == 1$}}{ \textcolor{black}{$v \leftarrow 1$;} \\ \textcolor{black}{$search \leftarrow 0$;} \\ } { \textcolor{black}{$v \leftarrow 0$;} \\ } } \textcolor{black}{Update \textsf{ElapsedTime-FO};} \\ \textcolor{black}{\textsf{MIP-FO} $\leftarrow($\textsf{TimeLimit-FO} - \textsf{ElapsedTime-FO}$)/(\theta-v+1)$;} \\ } Return $(x^{*},y^{*},z^{*})$; \\ \caption{FO heuristic}\label{alg:FO} \end{small} \end{algorithm} \end{document}
\section{Introduction}\label{introduction} Wireless sensor networks (WSNs) consist of small and low-cost sensor devices used to monitor the environment and transfer the sensed information through wireless channels to dedicated fusion centers. WSNs can be classified into either homogeneous WSNs \cite{guo2020energy, guo2018source, cortes2005spatially, chunawale2014minimization, benaddy2017mutlipath}, in which sensors share the same characteristics such as storage, antennas, sensitivity etc., or heterogeneous WSNs where sensor nodes have different characteristics \cite{karimi2019using, hou2005energy, karimi2020energy, noori2012design, guo2019quantizers, guo2016sensor}. Based on the network architecture, WSNs can be divided into either hierarchical WSNs, where sensors are often grouped into clusters with some of them chosen to be cluster heads, or non-hierarchical WSNs where sensors have identical functionality and multi-hop wireless communications is used to maintain the connectivity of the network. Sensor nodes can also be classified as either static \cite{karimi2020energy, guo2016sensor, zafar2009improved, shams2008fast}, in which each node remains at its deployed position, or mobile where nodes can move to their optimal locations to improve the energy efficiency and sensing quality of the WSNs \cite{guo2019movement, song2013distributed, zou2004sensor, yong2009sensor, senouci2013localized, chellappan2007deploying}. Energy efficiency is a key determinant in longevity of the WSNs since sensors have limited energy resources and it is difficult or infeasible to recharge the batteries of densely deployed sensors. In general, many factors contribute to the energy consumption of the WSNs, e.g. communication energy, movement energy, sensing energy and computation energy \cite{yousefi2004power, heinzelman2000application}. Empirical measurements in many applications have shown that the data processing and computation energy is negligible compared to communication energy \cite{anastasi2009energy, razzaque2014energy}. Moreover, the sensing energy for passive sensors, such as light or thermal sensors, is considerably small. Therefore, wireless communication dominates the energy consumption in static sensors in practice while movement energy dominates the energy consumption in mobile wireless sensor networks \cite{karimi2020energy, dantu2005robomote, wu2007optimal}. According to the study in \cite{wang2005optimizing}, for the optimal angular velocity and acceleration, the movement energy consumption is approximately linear to the distance that the sensor has to travel, and this linear model is a widely adopted assumption in the literature \cite{liao2012minimizing, liao2014minimizing, wichmann2015analysis, chen2016ptas}. Several methods have been proposed in the literature to reduce the energy consumption of wireless communication in WSNs. Topology control has been adopted in \cite{li2008survey, xinlian2014sensor} to circumvent excess energy consumption by appropriately switching sensors between awake and asleep states. Energy efficient routing protocols have been established in \cite{benaddy2017mutlipath, hao2013energy} to find optimal paths to transfer data from sensors to fusion centers. Power control protocols reduce the energy consumption of WSNs by calibrating the transmission power of sensors while a reliable communication is maintained \cite{kawadia2003power, narayanaswamy2002power}. Clustering methods \cite{kawadia2003power, younis2004distributed} iterate among cluster heads to balance the energy consumption among the sensor nodes. The common assumption of these approaches is that the node deployment is assumed to be known and fixed while a proper deployment can significantly affect the energy consumption of the WSNs. Furthermore, the above MAC protocols require a large number of message exchanges since the geometry and energy of the network is needed for the operation \cite{younis2004distributed, koyuncu2018asynchronous}. Inspired by dynamics of swarm behavior, a population based iterative algorithm called particle swarm optimization (PSO) is proposed in \cite{dandekar2013energy} to find optimal node locations. An iterative algorithm is proposed in \cite{vincze2007deploying} to determine the position of nodes such that the average sensors' distance to the nearest fusion center is minimized. Given a maximum length on the cluster diameter, a cluster formation algorithm is proposed in \cite{chatterjee2015multiple} to enhance the network lifetime and reduce the average number of hops for data packets to reach fusion centers. An efficient routing scheme is proposed in \cite{jain2015lifetime} to minimize the maximum energy consumed by each fusion center. The optimal node deployment in two-tier WSNs has been studied for heterogeneous networks in \cite{karimi2020energy}; however, the WSN is restricted to a two-tier architecture while a multi-hop model can provide more degrees of freedom to optimize the data routing. The optimal deployment and trajectory of UAVs with a fixed altitude is discussed in \cite{koyuncu2018deployment} to maintain a reliable communication with ground terminal stations. Many methods have been developed for mobile WSNs, where movement energy dominates the energy consumption of nodes, to find the optimal deployment given a constraint on available movement energy. The Lloyd$-\alpha$ and DEED algorithms proposed in \cite{song2013distributed} use a movement-dependent penalty term to implement centroidal Voronoi tessellation for sensor deployment. In Lloyd$-\alpha$ algorithm, each movement iteration is scaled by a factor of $\alpha \in [0, 1]$ to compensate for limited movement energy resources. In DEED, the gradient and Hessian matrix of the objective function are used to optimize the sensor movements. Several virtual force based algorithms are proposed in \cite{zou2004sensor, yong2009sensor, senouci2013localized} to determine virtual motion trajectories and the rate of sensor movements using a combination of attractive and repulsive forces. A minimum cost maximum weighted flow based algorithm is developed to determine the optimal movement plan of sensors and encourage a minimum number of sensor nodes in each region of a square field \cite{chellappan2007deploying}; however, the proposed algorithm regards sensor movements as hops between neighboring grid points and lacks a rigorous formulation of movement distance. Similarly, other methods also lack a theoretical framework for a movement efficient sensor deployment that prolongs the network lifetime, e.g., the scaling parameter $\alpha \in [0, 1]$ in the Lloyd$-\alpha$ algorithm has to be specified empirically to meet the movement energy constraints given an initial node deployment. Furthermore, many of the existing work explore the one-tier network architecture while a two-tier or multi-hop protocol provides more flexibility on how sensory data from the physical environment is transferred to the virtual information world. In this paper, we study the node deployment in heterogeneous multi-hop WSNs consisting of homogeneous densely deployed sensors, heterogeneous APs and heterogeneous FCs, to minimize the total wireless communication power consumption with and without movement energy constraints. The energy efficient node deployment is studied in \cite{karimi2020energy} for heterogeneous WSNs; however, the network is restricted to a two-tiered architecture. In \cite{guo2020energy}, we studied the necessary conditions for an optimal node deployment in homogeneous multi-hop WSNs; however, the homogeneous setting in \cite{guo2020energy} does not address many challenges that is inherent in heterogeneous WSNs, e.g., non-convexity or discontinuity of cells in the optimal partitioning of the sensing environment. To the best of our knowledge, the energy efficient node deployment in heterogeneous multi-hop WSNs is still an open problem. By deriving the necessary conditions of the optimal deployments that minimizes the total wireless communication power consumption of such heterogeneous multi-hop WSNs, we design iterative algorithms to deploy nodes. In addition, we study the optimal node deployment in such networks with limited movement energy for mobile nodes. The rest of this paper is organized as follows: In Section \ref{system-model}, we provide the system model and problem formulation. In Section \ref{optimal_deployment-without-movement-energy-constraint}, we study the optimal node deployment in static heterogeneous multi-hop WSNs, and propose an iterative algorithm based on the derived necessary conditions. The analysis of optimal node deployment with network's total movement energy constraint is provided in Section \ref{Total-Energy-Constraint}. In Section \ref{Network-Lifetime-Constraint}, we study an energy efficient node deployment that guarantees a given network's lifetime in mobile WSNs. Experimental results are provided in Section \ref{Experiments} and Section \ref{Conclusion} concludes the paper. \section{System Model and Problem Formulation}\label{system-model} In this section, we study the system model of heterogeneous multi-hop WSNs, as shown in Fig. \ref{Example1}, consisting of three types of nodes: homogeneous sensors, heterogeneous APs and heterogeneous FCs. Given the target region $\Omega\in\mathbb{R}^2$ which is a convex polygon including its interior, $N$ APs and $M$ FCs are deployed to collect information from densely deployed sensors. Let $\mathcal{I_A}=\{1, \cdots, N\}$ and $\mathcal{I_F}=\{N+1, \cdots, N+M\}$ denote the set of node indices for APs and FCs, respectively. If $n\in \mathcal{I_A}$, Node $n$ refers to AP $n$; however, when $n\in\mathcal{I_F}$, Node $n$ refers to FC $(n-N)$. The location of Node $n$ is denoted by $p_n\subset \Omega$ and collectively the node deployment is denoted by $\mathbf{P} = \left(p_1, \cdots, p_N, p_{N+1}, \cdots, p_{N+M} \right)$. Throughout this paper, we assume that each sensor only sends data to one AP; therefore, for each $n\in \mathcal{I_A}$, AP $n$ gathers data from sensors within the region $W_n\subseteq \Omega$, and $\mathbf{W}=\left(W_1, \cdots, W_N \right)$ provides a set partitioning of the target region. The density of sensors is denoted via a continuous and differentiable function $f:\Omega\longrightarrow \mathbb{R}^+$. The total amount of data collected from sensors within the region $W_n$ in one time unit is $R_b\int_{W_n}f(\omega)d\omega$, where the bit-rate $R_b$ is a constant due to the homogeneity of sensors \cite{guo2018source}. For each $n\in\mathcal{I_A}$, the volume and centroid of the region $W_n$ is defined as $v(W_n)\triangleq\int_{W_n}f(\omega)d\omega$ and $c(W_n)\triangleq\frac{\int_{W_n}\omega f(\omega)d\omega}{\int_{W_n}f(\omega)d\omega}$, respectively. The data gathered from each sensor is forwarded to other nodes in the network until it eventually reaches to one or more FCs. \begin{figure}[!htb] \setlength\abovecaptionskip{0pt} \setlength\belowcaptionskip{0pt} \centering \includegraphics[width=4.0in]{figures/system_model.eps} \captionsetup{justification=justified} \vspace{5mm} \caption{System model.} \label{Example1} \end{figure} As shown in Fig. \ref{Example1}, the network can be regarded as a directed acyclic graph $\mathcal{G}(\mathcal{I}_{A}\bigcup \mathcal{I}_{F},\mathcal{E})$ where APs and FCs are source and sink nodes, respectively, and $\mathcal{E}$ is the set of directed edges $(i, j)$ such that $i\in \mathcal{I_A}$ and $j\in \mathcal{I_A}\bigcup \mathcal{I_F}$ \cite{chang2000energy}. Note that any cycle in the network's graph can be removed by reducing the flow of data along the cycle without changing the in-flow and out-flow links to that cycle. Let $\mathbf{F}=[F_{i,j}]_{N\times (N+M)}$ be the flow matrix, where $F_{i,j}$ is the amount of data transmitted through the link $(i,j)$ in one time unit. Since the in-flow to each AP, say $i$, should be equal to the out-flow, we have $\sum_{j=1}^{N}F_{j,i} + R_b\int_{W_i}f(\omega)d\omega = \sum_{j=1}^{N+M}F_{i,j}$. For $i\in\mathcal{I_A}$, we define $F_i \triangleq \sum_{j=1}^{N+M}F_{i,j}$ to be the total flow originated from AP $i$. Let $\mathbf{S}=[s_{i,j}]_{N\times (N+M)}$ be the normalized flow matrix, where $s_{i,j}\triangleq\frac{F_{i,j}}{\sum_{j=1}^{N+M}F_{i,j}}$ is the ratio of the in-flow data to AP $i$ that is transmitted to node $j$. The normalized flow matrix $\mathbf{S}$ satisfies the following properties: (a) $s_{i,j}\in[0, 1]$;\footnote{For time-invariant routing algorithms, such as Bellman-Ford Algorithm \cite{ford1956network, bellman1958routing}, the flows construct a tree-structured graph in which each node has only one successor. Under such circumstances, the normalized flow from Node $i$ to Node $j$ is either $0$ or $1$, i.e., $s_{i,j}\in\{0,1\}$. However, the time-variant routing algorithms, such as Flow Augmentation Algorithm \cite{chang2000energy}, generate different flows during different time periods. As a result, the overall normalized flow from Node $i$ to Node $j$ can be a real number between $0$ and $1$, i.e., $s_{i,j}\in[0,1]$.} (b) $\sum_{j=1}^{N+M}s_{i,j}=1$, $\forall i\in\{1, \cdots, N\}$; (c) No cycle: if there exists a path in the network's graph such as $l_0 \rightarrow l_1 \rightarrow \cdots \rightarrow l_K$, i.e., $\prod_{k=1}^{K}s_{l_{k-1},l_k}>0$, then we have $s_{l_K,l_0}=0$. In particular, we have $s_{i.i}=0$, $\forall i\in \{1, \cdots, N\}$. Since the flow matrix $\mathbf{F}$ can be uniquely determined by the set partitioning $\mathbf{W}$ and the normalized flow matrix $\mathbf{S}$, in the remaining of this paper, we use the notation $\mathbf{F}\left(\mathbf{W}, \mathbf{S}\right)$ instead of $\mathbf{F}$. The following example describes how to calculate $\mathbf{F}\left(\mathbf{W}, \mathbf{S}\right)$ in terms of $\mathbf{W}$ and $\mathbf{S}$. \emph{Example 1.} We consider a heterogeneous multi-hop WSN with three APs and one FC, i.e. $N=3$ and $M=1$, and the bit-rate $R_b=20$. For a cell partitioning $\mathbf{W}$ with cell volumes $v(W_1)=v(W_2)=0.3$, $v(W_3)=0.4$, and the normalized flow matrix $S=\left[s_{i,j} \right]_{N\times(N+M)}$ with non-zero entries $s_{1,2} = 0.4$, $s_{1,3} = 0.6$, $s_{2,3} = 0.25$, $s_{2,4} = 0.75$ and $s_{3,4} = 1$, the corresponding flow network is illustrated in Fig. \ref{Example1}. The amount of data generated from sensors within each cell can be calculated as: $\Gamma(W_1)\!=\!R_b v(W_1)\!=\!6$, $\Gamma(W_2)\!=\!R_b v(W_2)\!=\!6$, and $\Gamma(W_3)\!=\!R_b v(W_3)\!=\!8$. AP $1$ does not receive data from any other AP, and only transmits its collected sensed data; thus, $F_1(\mathbf{W},\mathbf{S})\!=\!\Gamma(W_1)\!=\!6$. The flows from AP $1$ are then $F_{1,2}(\mathbf{W},\mathbf{S})\!=\!s_{1,2}\!\times\!F_{1}(\mathbf{W},\mathbf{S})\!=\!2.4$ and $F_{1,3}(\mathbf{W},\mathbf{S})\!=\!s_{1,3}\!\times\!F_{1}(\mathbf{W},\mathbf{S})\!=\!3.6$, respectively. AP $2$'s flows come from $F_{1,2}(\mathbf{W},\mathbf{S})$ and the data gathered from the region $W_2$. Hence, $F_2(\mathbf{W},\mathbf{S})\!=\!\Gamma(W_2)\!+\!F_{1,2}(\mathbf{W},\mathbf{S})\!=\!8.4$. Therefore, the flows from AP $2$ are $F_{2,3}(\mathbf{W},\mathbf{S})\!=\!s_{2,3}\!\times\!F_{2}(\mathbf{W},\mathbf{S})\!=\!2.1$ and $F_{2,4}(\mathbf{W},\mathbf{S})\!=\!s_{2,4}\!\times\!F_{2}(\mathbf{W},\mathbf{S})\!=\!6.3$. Similarly, for AP $3$, we have $F_3(\mathbf{W},\mathbf{S})\!=\!\Gamma(W_3)\!+\!F_{1,3}(\mathbf{W},\mathbf{S})\!+\!F_{2,3}(\mathbf{W},\mathbf{S})\!=\!13.7$; hence, the unique flow from AP $3$ is $F_{3,4}(\mathbf{W},\mathbf{S})\!=\!s_{3,4}\times F_3(\mathbf{W},\mathbf{S})\!=\!13.7$. In what follows, we formulate the wireless communication power consumption of the network. Also, we focus on the power consumption of sensors and APs, since FCs are usually supplied with reliable energy sources and their power consumption is not the main concern. First, we focus on the sensor's power consumption. According to \cite{guo2018source}, due to the path-loss, the instant transmission power is equal to the square of the distance between the two nodes multiplied by a constant that depends on the characteristics of both nodes, i.e., $\eta\times \|p_n - \omega\|^2$ for a sensor positioned at $\omega$ that transmits its data to AP $n$, $n\in\mathcal{I_A}$. As shown in \cite{heinzelman2000application}, the parameter $\eta$ is given by $\eta = \frac{P_{th} \left(4 \pi \right)^2}{R_b G_t G_r \lambda_c^2}$, where $P_{th}$ is the minimum receiver power threshold for successful reception, $R_b$ is the bit-rate, $G_t$ and $G_r$ are the antenna gains of the transmitter and receiver, respectively, and $\lambda_c$ is the carrier signal wavelength. In the homogeneous setting, all nodes have the same characteristics; thus, the parameter $\eta$ is the same and will not affect the optimization. However, in a heterogeneous multi-hop WSN, AP nodes can have different antenna gains and SNR thresholds; hence, the parameter $\eta$ will be a function of the node index. Therefore, the sensors' transmission power consumption can be written as \begin{equation}\label{sensor-power} \overline{\mathcal{P}}^T_{\mathcal{S}}\left(\mathbf{P}, \mathbf{W} \right) = \sum_{n=1}^{N} \int_{W_n} \eta_n \|p_n - \omega \|^2 R_b f(\omega)d\omega. \end{equation} Similarly, the instant transmission power from Node $i$ to Node $j$ can be written as $\beta \times \|p_i - p_j \|^2$ where the parameter $\beta$ depends on the antenna gain and SNR threshold of Node $j$ and the antenna gain of Node $i$ \cite{heinzelman2000application}. Therefore, it is the same for the homogeneous setting and will not affect the optimization. However, in a heterogeneous multi-hop WSN, the heterogeneity of the nodes causes the parameter $\beta$ to be a function of the node indices. Hence, the average transmission power through link $(i,j)$ is equal to $\beta_{i,j} \|p_i - p_j \|^2 F_{i,j}(\mathbf{W}, \mathbf{S})$, and the APs' total transmission power consumption can be written as \begin{equation}\label{access-point-power} \overline{\mathcal{P}}^T_{\mathcal{A}}\left(\mathbf{P}, \mathbf{W}, \mathbf{S} \right) = \sum_{i=1}^{N}\sum_{j=1}^{N+M} \beta_{i,j} \|p_i - p_j\|^2 F_{i,j}\left(\mathbf{W}, \mathbf{S} \right). \end{equation} According to \cite{hou2005energy}, power at the receiver of AP $n$ can be modeled as $\sum_{i=1}^{N}\rho_n F_{i,n}(\mathbf{W}, \mathbf{S}) + \rho_n R_b \int_{W_n}f(\omega)d\omega$, where $\rho_n$ is the power consumption coefficient for receiving data at AP $n$, and depends on digital coding, modulation and filtering of the signal before transmission \cite{heinzelman2000application}. Therefore, the APs' total receiver power consumption can be written as: \begin{equation}\label{ap-receiver-power} \overline{\mathcal{P}}^R_{\mathcal{A}}\left(\mathbf{W}, \mathbf{S} \right) = \sum_{n=1}^{N}\rho_n \left[ \sum_{i=1}^{N} F_{i,n}\left(\mathbf{W}, \mathbf{S} \right) + R_b\int_{W_n}f(\omega)d\omega \right]. \end{equation} Thus, the total communication power consumption of the multi-hop WSN can be written as: \begin{align}\label{total-power-consumption} \mathcal{D}\left(\mathbf{P}, \mathbf{W}, \mathbf{S} \right) = \overline{\mathcal{P}}^T_{\mathcal{S}}\left(\mathbf{P}, \mathbf{W} \right) + \lambda \left[\overline{\mathcal{P}}^T_{\mathcal{A}}\left(\mathbf{P}, \mathbf{W}, \mathbf{S} \right) + \overline{\mathcal{P}}^R_{\mathcal{A}}\left(\mathbf{W}, \mathbf{S} \right) \right], \end{align} where the Lagrangian multiplier $\lambda\geq 0$ provides a trade-off between the sensor and AP power consumption. Our main objective in this paper is to minimize the multi-hop power consumption defined in (\ref{total-power-consumption}) over the node deployment $\mathbf{P}$, cell partitioning $\mathbf{W}$, and the normalized flow matrix $\mathbf{S}$ in both static and mobile WSNs with constrained movement energy. \section{Optimal Node Deployment in Static Heterogeneous Multi-Hop WSNs}\label{optimal_deployment-without-movement-energy-constraint} As shown in (\ref{total-power-consumption}), the total power consumption depends on three variables $\mathbf{P}$, $\mathbf{W}$ and $\mathbf{S}$. Thus, our goal is to find the optimal AP and FC deployments, cell partitioning and normalized flow matrix, denoted by $\mathbf{P}^* = \left(p_1^*, \cdots, p_N^*, p_{N+1}^*, \cdots, p_{N+M}^* \right)$, $\mathbf{W}^* = \left(W_1^*, \cdots, W_N^* \right)$ and $\mathbf{S}^* = \left[s^*_{i,j}\right]_{N\times(N+M)}$, respectively, that minimizes the multi-hop power consumption. Note that not only the variables $\mathbf{P}$, $\mathbf{W}$ and $\mathbf{S}$ are interdependent, i.e., the optimal value for each of them depends on the value of the other two variables, but also this optimization problem is NP-hard. Our aim is to design an iterative algorithm that optimizes the value of one variable while the other two variables are held fixed. For this purpose, first we introduce a few concepts, and then we derive the necessary conditions for optimal deployment at each step. Without loss of generality, we assume that AP $n$'s gathered data goes through $K_n$ paths in the network's graph before it reaches to one or more fusion centers. We denote these paths by $\left\{L_k^{(n)}\left(\mathbf{S}\right) \right\}_{k\in\{1, \cdots, K_n\}}$, where $L_k^{(n)}\left(\mathbf{S}\right) = l_{k,0}^{(n)}\rightarrow l_{k,1}^{(n)}\rightarrow\cdots\rightarrow l_{k,J_k^{(n)}}^{(n)}$, $l_{k,0}^{(n)} = n$, $l_{k,i}^{(n)}\in\mathcal{I_A}$ for $i\in\{0, \cdots, J_k^{(n)}-1\}$, $l_{k,J_k^{(n)}}^{(n)} \in \mathcal{I_F}$ and $J_k^{(n)}$ is the number of nodes on the $k$-th path excluding Node $n$. The portion of the total flow originated from AP $n$ that goes through the $k$-th path can then be calculated as \begin{equation}\label{data-rate-kth-path} \mu_k^{(n)}\left(\mathbf{W}, \mathbf{S} \right) = F_n\left(\mathbf{W}, \mathbf{S} \right)\prod_{i=1}^{J_k^{(n)}}s_{l_{k,i-1}^{(n)}, l_{k,i}^{(n)}}. \end{equation} In particular, we have $\sum_{k=1}^{K_n} \mu_k^{(n)}\left(\mathbf{W}, \mathbf{S} \right) = F_n\left(\mathbf{W}, \mathbf{S} \right)$ that indicates the data from AP $n$ eventually reaches to one or more FCs. Next, for each link $(i,j)$ in the network's graph, we define the energy cost (Watt/bit) to be: \begin{equation}\label{energy-cost} e_{i,j}\left(\mathbf{P} \right)\triangleq \begin{cases} \beta_{i,j}\|p_i - p_j\|^2 + \rho_j, & \text{if}\ j\in \mathcal{I_A} \\ \beta_{i,j}\|p_i - p_j\|^2, & \text{if}\ j\in \mathcal{I_F}. \end{cases} \end{equation} Hence, we define the path cost corresponding to the $k$-th path from AP $n$ to FCs as: \begin{equation}\label{path-cost} \overline{e}_k^{(n)}\left(\mathbf{P}, \mathbf{S} \right)=\sum_{i=1}^{J_k^{(n)}}e_{l_{k,i-1}^{(n)}, l_{k,i}^{(n)}}\left(\mathbf{P} \right). \end{equation} Now, AP $n$'s power coefficient, denoted by $g_n\left(\mathbf{P}, \mathbf{S} \right)$ is defined to be the power consumption (Joules/bit) for transmitting $1$ bit data from AP $n$ to the FCs, i.e., we have: \begin{align}\label{power-coefficient} g_n\left(\mathbf{P}, \mathbf{S} \right) &= \frac{\sum_{k=1}^{K_n}\mu_k^{(n)}\left(\mathbf{W}, \mathbf{S} \right)\overline{e}_k^{(n)}\left(\mathbf{P}, \mathbf{S} \right)}{F_n\left(\mathbf{W}, \mathbf{S} \right)}\\ &=\sum_{k=1}^{K_n}\left[\prod_{i=1}^{J_k^{(n)}}s_{l_{k,i-1}^{(n)}, l_{k,i}^{(n)}}\left(\sum_{j=1}^{J_k^{(n)}}\beta_{l_{k,j-1}^{(n)}, l_{k,j}^{(n)}} \Big|\! \Big|p_{l_{k,j-1}^{(n)}} - p_{l_{k,j}^{(n)}} \Big| \! \Big|^2 +\sum_{j=1}^{J_k^{(n)}-1}\rho_{l_{k,j}^{(n)}} \right) \right]. \end{align} Note that the term $F_n\left(\mathbf{W}, \mathbf{S} \right)$ is canceled in (\ref{power-coefficient}), implying that power coefficient $g_n\left(\mathbf{P}, \mathbf{S} \right)$ is independent of $\mathbf{W}$. Below we provide an example to clarify how to calculate the AP power coefficients. \emph{Example 2.} Consider the WSN described in Example 1, and let $\mathbf{P}=((0,0), (0,1), (1,0), (1,1))$, $\beta_{i,j}\!=\!1$ and $\rho_i\!=\!1$ for all $i\in\mathcal{I_A}$ and $j\in\mathcal{I_A}\bigcup\mathcal{I_F}$. We aim to find AP $1$'s power coefficient $g_1(\mathbf{P},\mathbf{S})$. The link energy costs for this network can be calculated as $e_{1,2}(\mathbf{P})=e_{1,3}(\mathbf{P})\!=\!2$, $e_{2,3}(\mathbf{P})\!=\!3$, and $e_{2,4}(\mathbf{P})\!=\!e_{3,4}(\mathbf{P})\!=\!1$. Note that AP $1$'s data goes through the following $3$ paths: $L^{(1)}_{1}(\mathbf{S})\!=\!1\!\to\!2\!\to\!4$, $L^{(1)}_{2}(\mathbf{S})\!=\!1\!\to\!3\!\to\!4$, and $L^{(1)}_{3}(\mathbf{S})\!=\!1\!\to\!2\!\to\!3\!\to\!4$. The data rate through the above paths are, respectively, $\mu_1^{(1)}(\mathbf{W},\mathbf{S})\!=\!F_1(\mathbf{W},\mathbf{S})\!\times\!s_{1,2}\!\times\!s_{2,4}\!=\!0.3F_1(\mathbf{W},\mathbf{S})$, $\mu_2^{(1)}(\mathbf{W},\mathbf{S})\!=\!F_1(\mathbf{W},\mathbf{S})\!\times\!s_{1,3}\!\times\!s_{3,4}\!=\!0.6F_1(\mathbf{W},\mathbf{S})$, and $\mu_3^{(1)}(\mathbf{W},\mathbf{S})\!=\!F_1(\mathbf{W},\mathbf{S})\!\times\!s_{1,2}\!\times\!s_{2,3}\!\times\!s_{3,4}\!=\!0.1F_1(\mathbf{W},\mathbf{S})$. Moreover, we can calculate the path costs using (\ref{path-cost}) as follows: $\overline{e}^{(1)}_{1}(\mathbf{P})=e_{1,2}(\mathbf{P})+e_{2,4}(\mathbf{P})=3$, $\overline{e}^{(1)}_{2}(\mathbf{P})=e_{1,3}(\mathbf{P})+e_{3,4}(\mathbf{P})=3$, and $\overline{e}^{(1)}_{3}(\mathbf{P})=e_{1,2}(\mathbf{P})+e_{2,3}(\mathbf{P})+e_{3,4}(\mathbf{P})=6$. Then, AP $1$'s power coefficient is $g_1(\mathbf{P},\mathbf{S})=0.3\times3+0.6\times3+0.1\times6=3.3$. To derive the necessary condition for an optimal cell partitioning, first, we need to rewrite the objective function in (\ref{total-power-consumption}). \begin{lemma}\label{power-coef-equality} For the AP power coefficient defined in (\ref{power-coefficient}), we have: \begin{equation}\label{power-coef-equality-eq} \sum_{n=1}^{N}g_n\left(\mathbf{P}, \mathbf{S} \right)R_b \int_{W_n}f(\omega)d\omega = \sum_{i=1}^{N}\left[\sum_{j=1}^{N+M} \beta_{i,j} \|p_i - p_j\|^2 F_{i,j}\left(\mathbf{W}, \mathbf{S} \right) + \sum_{j=1}^{N}\rho_j F_{i,j}\left(\mathbf{W}, \mathbf{S} \right) \right]. \end{equation} \end{lemma} The proof is provided in Appendix \ref{proof-power-coef-equality}. Using Lemma \ref{power-coef-equality}, the objective function is: \begin{equation}\label{rewrite-objective-function} \mathcal{D}\left(\mathbf{P}, \mathbf{W}, \mathbf{S} \right) = \sum_{n=1}^{N} \int_{W_n} \left(\eta_n \|p_n - \omega \|^2 R_b + \lambda g_n\left(\mathbf{P}, \mathbf{S} \right)R_b + \lambda \rho_n R_b \right) f(\omega)d\omega. \end{equation} Now, we study the properties of the optimal cell partitioning. For each $n\in\mathcal{I_A}$, the Voronoi cell $\mathcal{V}_n$ for a node deployment $\mathbf{P}$ and normalized flow matrix $\mathbf{S}$ is defined to be: \begin{align}\label{voronoi-cell} \mathcal{V}_n\!\left(\mathbf{P}, \mathbf{S} \right) \!\triangleq\! \big \{\omega\!:\!\eta_n \|p_n \!-\! \omega \|^2 \!+\! \lambda g_n\!\left(\mathbf{P}, \mathbf{S} \right) \!+\! \lambda \rho_n \leq \eta_k \|p_k \!-\! \omega \|^2 \!+\! \lambda g_k\!\left(\mathbf{P}, \mathbf{S} \right) \!+\! \lambda \rho_k , \forall k\neq n \big \}. \end{align} Ties are broken in the favor of the smaller index to ensure that each Voronoi cell $\mathcal{V}_n$ is a Borel set. For brevity, we write $\mathcal{V}_n$ instead of $\mathcal{V}_n\left(\mathbf{P}, \mathbf{S} \right)$ when it is clear from the context. The collection \begin{equation}\label{generalized-voronoi-diagram} \mathbf{\mathcal{V}}\left(\mathbf{P}, \mathbf{S} \right) = \left(\mathcal{V}_1, \mathcal{V}_2, \cdots, \mathcal{V}_N \right) \end{equation} is referred to as the generalized Voronoi diagram \cite{karimi2020energy}. Note that in contrast to the regular Voronoi diagrams, the Voronoi cells defined in (\ref{voronoi-cell}) can be non-convex, not star-shaped and even disconnected. The following proposition indicates that given a node deployment $\mathbf{P}$ and normalized flow matrix $\mathbf{S}$, the generalized Voronoi diagram provides the optimal cell partitioning. \begin{prop}\label{optimal-cell-partitioning} For any node deployment $\mathbf{P}$, cell partitioning $\mathbf{W}$ and normalized flow matrix $\mathbf{S}$, we have: \begin{equation}\label{optimal-partitoning-proposition} \mathcal{D}\left(\mathbf{P}, \mathbf{W}, \mathbf{S} \right) \geq \mathcal{D}\left(\mathbf{P}, \mathbf{\mathcal{V}}\left(\mathbf{P}, \mathbf{S} \right), \mathbf{S} \right). \end{equation} \end{prop} The proof is provided in Appendix \ref{proof-voronoi-optimality}. Now, given the link costs $\{e_{i,j}\left(\mathbf{P} \right)\}$s and generated sensing data rate from each cell partition, the total multi-hop power consumption can be minimized by Bellman-Ford Algorithm \cite{ford1956network, bellman1958routing}. For convenience, we show the functionality of Bellman-Ford Algorithm by $\mathcal{R}\left(\mathbf{P},\mathbf{W} \right)$, where $\mathbf{P}$ and $\mathbf{W}$ are inputs and $\mathbf{S}$ is the output, i.e., $\mathcal{R}\left(\mathbf{P},\mathbf{W} \right)=\argmin_{\mathbf{S}}\left[\overline{\mathcal{P}}^T_{\mathcal{A}}\left(\mathbf{P},\mathbf{W},\mathbf{S} \right) + \overline{\mathcal{P}}^R_{\mathcal{A}}\left(\mathbf{W},\mathbf{S} \right) \right]$. Since the sensors' power consumption is independent of $\mathbf{S}$, we have: \begin{equation}\label{bellman-ford-functionality} \mathcal{R}\!\left(\mathbf{P},\mathbf{W} \right) = \argmin_{\mathbf{S}} \overline{\mathcal{P}}^T_{\mathcal{S}}\!\left(\mathbf{P}, \mathbf{W} \right) + \lambda \left[\overline{\mathcal{P}}^T_{\mathcal{A}}\!\left(\mathbf{P}, \mathbf{W}, \mathbf{S} \right) + \overline{\mathcal{P}}^R_{\mathcal{A}}\!\left(\mathbf{W}, \mathbf{S} \right) \right] = \argmin_{\mathbf{S}}\mathcal{D}\!\left(\mathbf{P}, \mathbf{W}, \mathbf{S} \right). \end{equation} Hence, the optimal flow matrix for a given $\mathbf{P}$ and $\mathbf{W}$ is $\mathbf{F}\left(\mathbf{W}, \mathcal{R}\left(\mathbf{P},\mathbf{W} \right) \right)$. For notational brevity, we define the point $z_i\left(\mathbf{P}, \mathbf{W}, \mathbf{S} \right)$, or $z_i$ for short, to be: \begin{align}\label{z1-AP} z_i = \frac{\eta_i R_b v_i c_i + \lambda\left(\sum_{j=1}^{N+M}\beta_{i,j}F_{i,j} p_j + \sum_{j=1}^{N}\beta_{j,i}F_{j,i} p_j \right)}{\eta_i R_b v_i + \lambda\left(\sum_{j=1}^{N+M}\beta_{i,j}F_{i,j} + \sum_{j=1}^{N}\beta_{j,i}F_{j,i} \right)}, \qquad \forall i\in \mathcal{I_A} \\ z_i = \frac{\sum_{j=1}^{N}\beta_{j,i}F_{j,i} p_j}{\sum_{j=1}^{N}\beta_{j,i}F_{j,i}}.\qquad\qquad\qquad\qquad \forall i\in \mathcal{I_F} \label{z1-FC} \end{align} The following theorem provides the necessary conditions for the optimal deployment. \begin{prop}\label{necessary-condition-optimal-deployment} The necessary conditions for the optimal deployments in heterogeneous multi-hop WSNs with communication power consumption defined in (\ref{total-power-consumption}) are \begin{align}\label{necessary-condition-optimal-deployment-APs} p_i^* &= z_i^*, \qquad\qquad \forall i\in \mathcal{I_A} \bigcup \mathcal{I_F} \\ \mathbf{W}^* &= \mathcal{V}\left(\mathbf{P}^*, \mathbf{S}^* \right),\label{necessary-condition-optimal-deployment-partitioning} \\ \mathbf{S}^* &= \mathcal{R}\left(\mathbf{P}^*, \mathbf{W}^* \right),\label{necessary-condition-optimal-deployment-S} \end{align} where $z^*_i=z_i\left(\mathbf{P}^*, \mathbf{W}^*, \mathbf{S}^* \right)$ is given by Eqs. (\ref{z1-AP}) and (\ref{z1-FC}). \end{prop} The proof of Proposition \ref{necessary-condition-optimal-deployment} is provided in Appendix \ref{proof-necessary-condition-optimal-deployment}. Note that depending on the cell partitioning and normalized flow matrix, there may not be any flow through some links in the network's graph. Let $\mathcal{N}^P_i(\mathbf{S})\triangleq\{j|F_{j,i}(\mathbf{W},\mathbf{S})>0\}$ be the set of Node $i$'s predecessors, and $\mathcal{N}^S_i(\mathbf{S})\triangleq\{j|F_{i,j}(\mathbf{W},\mathbf{S})>0\}$ be the set of Node $i$'s successors. We can then simplify Eq. (\ref{necessary-condition-optimal-deployment-APs}) as: \begin{equation}\label{rewrite-AP-necessary-conditions} p^*_i = \frac{\eta_i R_b v^*_i c^*_i + \lambda \left( \sum\limits_{j\in\mathcal{N}^S_i(\mathbf{S}^*)}\beta_{i,j}F^*_{i,j}p^*_j + \sum\limits_{j\in\mathcal{N}^P_i(\mathbf{S}^*)}\beta_{j,i}F^*_{j,i}p^*_j \right) }{\eta_i R_b v^*_i+\lambda\left(\sum\limits_{j\in\mathcal{N}^S_i(\mathbf{S}^*)}\beta_{i,j}F_{i,j}^*+\sum\limits_{j\in\mathcal{N}^P_i(\mathbf{S}^*)}\beta_{j,i}F^*_{j,i}\right)}, \qquad \forall i\in\mathcal{I_A} \end{equation} \begin{equation}\label{rewrite-FC-necessary-conditions} p^*_i=\frac{\sum\limits_{j\in\mathcal{N}^P_i(\mathbf{S}^*)}\beta_{j,i}F^*_{j,i}p^*_j}{\sum\limits_{j\in\mathcal{N}^P_i(\mathbf{S}^*)}\beta_{j,i}F^*_{j,i}}, \qquad \forall i\in\mathcal{I_F}. \end{equation} In other words, AP $i$'s optimal location is a linear combination of its geometric centroid, predecessors, and successors while FC $i$'s optimal location is a linear combination of its predecessors. In what follows, first, we quickly review the conventional Lloyd Algorithm \cite{lloyd1982least}, then we propose an algorithm to optimize the communication power consumption defined in Eq. (\ref{total-power-consumption}) for heterogeneous multi-hop WSNs. Lloyd Algorithm iterates between two steps: (i) Voronoi partitioning and (ii) Moving each node to the geometric centroid of its corresponding Voronoi region. Although the conventional Lloyd Algorithm can be used for one-tier quantizers or one-tier node deployment tasks \cite{guo2016sensor}, it cannot be applied to WSNs with multi-hop wireless communications. Based on the properties explored in this section, we design a Routing-aware Lloyd (RL) Algorithm, as outlined in Algorithm \ref{RL}, to optimize the node deployment in heterogeneous multi-hop WSNs and minimize the objective function in (\ref{total-power-consumption}). \begin{algorithm}[ht!] \SetAlgoLined \SetKwRepeat{Do}{do}{while} \KwResult{Optimal node deployment $\mathbf{P}$, cell partitioning $\mathbf{W}$ and normalized flow matrix $\mathbf{S}$.} Input: Convergence error threshold $\epsilon\in \mathbb{R}^+$ \; \Do{$\frac{\mathcal{D}_{\mathrm{old}} - \mathcal{D}_{\mathrm{new}}}{\mathcal{D}_{\mathrm{old}}} \geq \epsilon$}{ -- Calculate the objective function $\mathcal{D}_{\textrm{old}}=\mathcal{D}\left(\mathbf{P},\mathbf{W},\mathbf{S}\right)$\; 1. Update the cell partitioning $\mathbf{W}$ according to the Eq. (\ref{necessary-condition-optimal-deployment-partitioning})\; 2. Update the normalized flow matrix $\mathbf{S}$ using to the Bellman-Ford algorithm\; 3. Update the node deployment $\mathbf{P}$ as follows:\ $$p_n = \frac{\eta_n R_b v_nc_n + \lambda\left(\sum_{j=1}^{N+M}\beta_{n,j}F_{n,j} p_j + \sum_{j=1}^{N}\beta_{j,n}F_{j,n} p_j \right)}{\eta_n R_b v_n + \lambda\left(\sum_{j=1}^{N+M}\beta_{n,j}F_{n,j} + \sum_{j=1}^{N}\beta_{j,n}F_{j,n} \right)}, \qquad \forall n\in \mathcal{I_A}$$\ $$p_n = \frac{\sum_{j=1}^{N}\beta_{j,n}F_{j,n} p_j}{\sum_{j=1}^{N}\beta_{j,n}F_{j,n}},\qquad \forall n\in \mathcal{I_F}$$\ -- Calculate the objective function $\mathcal{D}_{\textrm{new}}=\mathcal{D}\left(\mathbf{P},\mathbf{W},\mathbf{S}\right)$\; } \caption{Routing-aware Lloyd Algorithm} \label{RL} \end{algorithm} \begin{prop}\label{RL-convergence} RL Algorithm is an iterative improvement algorithm, i.e., the objective function is non-increasing and the algorithm converges. \end{prop} The proof of Proposition \ref{RL-convergence} is provided in Appendix \ref{proof-RL-convergence}. \section{The Node Deployment with a Total Energy Constraint in Mobile WSNs}\label{Total-Energy-Constraint} \subsection{Problem formulation}\label{Total-Energy-Constraint-problem-formulation} In Section \ref{optimal_deployment-without-movement-energy-constraint}, we studied the scenario where nodes are directly placed at the optimal locations calculated via RL Algorithm. However, here we study mobile heterogeneous multi-hop WSNs in which each node moves from its initial position to its optimal location that minimizes the communication power consumption in (\ref{total-power-consumption}) while the total movement energy consumption of the network is constrained. More precisely, given the linear model for movement energy consumption in \cite{wang2005optimizing}, for each $n\in \mathcal{I_A}\bigcup\mathcal{I_F}$, Node $n$'s movement energy can be modeled as: \begin{equation}\label{movement-energy} E_n\left(\mathbf{P}\right) = \zeta_n \|p_n - \tilde{p}_n \|, \end{equation} where the moving cost parameter $\zeta_n$ depends on Node $n$'s energy efficiency, $p_n$ and $\tilde{p}_n$ are its destination and initial locations, respectively. Therefore, the total movement energy consumption of the network is \begin{equation}\label{total-movement-energy} E\left(\mathbf{P} \right) = \sum_{n=1}^{N+M} E_n\left(\mathbf{P}\right) = \sum_{n=1}^{N+M}\zeta_n \|p_n - \tilde{p}_n \|. \end{equation} Our main objective in this section is to minimize the multi-hop communication power consumption in Eq. (\ref{total-power-consumption}) while the total movement energy is limited, i.e., the constrained optimization problem is defined as \begin{align}\label{total-movement-constraint-objective} \minimize_{\mathbf{P}, \mathbf{W}, \mathbf{S}} \mathcal{D}\left(\mathbf{P}, \mathbf{W}, \mathbf{S} \right), \\ \textrm{s.t.}\qquad E\left(\mathbf{P}\right) \leq \gamma \label{movement-constraint} \end{align} where $\gamma \geq 0$ is the maximum movement energy consumption of the network. \subsection{The Optimal Node Deployment}\label{Optimal-Node-Deployment-Total-Move-Constraint} Here, we aim to find the optimal node deployment $\mathbf{P}^*$, cell partitioning $\mathbf{W}^*$ and normalized flow matrix $\mathbf{S}^*$ that minimizes the total multi-hop communication power consumption while the movement energy consumption is constrained. Note that the movement energy in (\ref{movement-constraint}) is independent of the cell partitioning and normalized flow matrix; therefore, the generalized Voronoi diagram and Bellman-Ford Algorithm, represented in Eqs. (\ref{generalized-voronoi-diagram}) and (\ref{bellman-ford-functionality}), respectively, still provide the optimal cell partitioning and normalized flow matrix. Now, we discuss the optimal node deployment for the constrained optimization problem in Eqs. (\ref{total-movement-constraint-objective}) and (\ref{movement-constraint}). \begin{lemma}\label{total-movment-constraint-between-initial-and-optimal} Let $\mathbf{P}^*$, $\mathbf{W}^*$ and $\mathbf{S}^*$ be the optimal node deployment, cell partitioning and normalized flow matrix for the constrained optimization problem in Eqs. (\ref{total-movement-constraint-objective}) and (\ref{movement-constraint}). We have: \begin{align}\label{total-movment-constraint-between-initial-and-optimal-eq1} p^*_i = \delta_i \tilde{p}_i + (1-\delta_i)\times z_i^*, \qquad \forall i\in \mathcal{I_A} \bigcup \mathcal{I_F} \end{align} where $\delta_i\in [0, 1]$ and $\tilde{p}_i$ is the initial location of Node $i$. \end{lemma} The proof is provided in Appendix \ref{optimal-between-initial-z}. Lemma \ref{total-movment-constraint-between-initial-and-optimal} states that the optimal location for Node $i$ is on the line connecting its initial position to the point $z^*_i=z_i\left(\mathbf{P}^*, \mathbf{W}^*, \mathbf{S}^* \right)$. Note that this is in contrast to the optimal node deployment without movement energy constraint in Section \ref{optimal_deployment-without-movement-energy-constraint}, i.e., $p_i^* = z_i^*$, as shown in Proposition \ref{necessary-condition-optimal-deployment}. The difference is because of the constraint in Eq. (\ref{movement-constraint}). Intuitively, for $\gamma = 0$ we have $\delta_i=1$ for all $i\in\mathcal{I_A}\bigcup\mathcal{I_F}$, i.e., each node will remain at its initial position since there is zero total available movement energy. However, for sufficiently large enough $\gamma$, we have $\delta_i=0$, i.e., $p_i^*=z_i^*$ for all $i\in\mathcal{I_A}\bigcup\mathcal{I_F}$. In general, nodes can be classified into two groups based on whether they have positive moving distance or they stand still. Let $\mathcal{I}_d=\left\{n \mid \|p_n-\tilde{p}_n\| > 0, \forall n\in \mathcal{I_A}\bigcup\mathcal{I_F} \right\}$ and $\mathcal{I}_s=\left\{n \mid \|p_n-\tilde{p}_n\| = 0, \forall n\in \mathcal{I_A}\bigcup\mathcal{I_F} \right\}$ be the set of dynamic and static nodes, respectively. The following theorem provides the necessary condition for the optimal node deployment in multi-hop WSNs with total movement energy constraint: \begin{prop}\label{necessary-condition-total-move-constraint} Let $\mathbf{P}^*, \mathbf{W}^*$ and $\mathbf{S}^*$ be the optimal node deployment, cell partitioning and normalized flow matrix for the constrained optimization problem in Eqs. (\ref{total-movement-constraint-objective}) and (\ref{movement-constraint}). Then: \begin{align}\label{necessary-condition-total-move-constraint-eq} \chi^*_n &= \chi^*_m\geq \chi^*_k, \qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad \forall n,m\in\mathcal{I}_d , k\in\mathcal{I}_s \\ p_n^* &= \tilde{p}_n + \Gamma_n^*\times\left[1-\frac{\max\left(0, \sum_{i\in\mathcal{I}_d}\zeta_i \|\Gamma_i^*\| - \gamma \right)}{\|\Gamma_n^*\| \times \frac{\psi_n^*}{\zeta_n}\times\sum_{i\in\mathcal{I}_d}\frac{\zeta_i^2}{\psi_i^*}} \right], \qquad \forall n\in\mathcal{I}_d \label{necessary-condition-total-move-constraint-eq2} \end{align} where $\Gamma_n^* = z_n^* - \tilde{p}_n$ and $\psi^*_n$ is defined to be \begin{equation}\label{psi} \psi_n^*\triangleq \begin{cases} \eta_n R_b v^*_n + \lambda\left[\sum_{k=1}^{N+M} \beta_{n,k}F_{n,k}^* + \sum_{k=1}^N \beta_{k,n}F_{k,n}^* \right], & \text{if}\ n\in \mathcal{I_A} \\ \lambda\sum_{k=1}^N \beta_{k,n}F_{k,n}^*, & \text{if}\ n\in \mathcal{I_F} \end{cases} \end{equation} and the moving efficiency $\chi^*_n$ is defined as \begin{equation}\label{chi} \chi^*_n = \frac{\psi^*_n \|p^*_n - z^*_n\|^2}{\zeta_n\|p^*_n - z^*_n\|}= \frac{\psi^*_n}{\zeta_n}\|p^*_n - z^*_n\|, \qquad\qquad\qquad \forall n\in \mathcal{I_A}\bigcup\mathcal{I_F} \end{equation} to reflect Node $n$'s ability to reduce the communication power consumption by movement. \end{prop} The proof is provided in Appendix \ref{proof-necessary-condition-total-constraint}. Proposition \ref{necessary-condition-total-move-constraint} captures the intuition in Lemma \ref{total-movment-constraint-between-initial-and-optimal} that in an optimal deployment, Node $n$ is located on the line connecting its initial position $\tilde{p}_n$ to the point $z^*_n$, for all $n\in\mathcal{I_A}\bigcup\mathcal{I_F}$. Furthermore, for a sufficiently large enough available movement energy $\gamma$, say $\gamma\geq \sum_{i\in\mathcal{I}_d}\zeta_i \|\Gamma_i^*\|$, we have $p^*_n=z^*_n$ for all $n\in\mathcal{I}_d$. Based on the necessary conditions in Proposition \ref{necessary-condition-total-move-constraint}, we propose a Movement-Efficient Routing-aware Lloyd (MERL) Algorithm, as outlined in Algorithm \ref{MERL}, to optimize the node deployment in heterogeneous multi-hop WSNs with constrained movement energy, and minimize the objective function in Eqs. (\ref{total-movement-constraint-objective}) and (\ref{movement-constraint}). \begin{algorithm}[ht!] \SetAlgoLined \SetKwRepeat{Do}{do}{while} \KwResult{Optimal node deployment $\mathbf{P}$, cell partitioning $\mathbf{W}$ and normalized flow matrix $\mathbf{S}$.} Input: Initial node deployment $\tilde{\mathbf{P}}$, convergence error threshold $\epsilon\in \mathbb{R}^+$ \; \Do{$\frac{\mathcal{D}_{\mathrm{old}} - \mathcal{D}_{\mathrm{new}}}{\mathcal{D}_{\mathrm{old}}} \geq \epsilon$}{ -- Calculate the objective function $\mathcal{D}_{\textrm{old}}=\mathcal{D}\left(\mathbf{P},\mathbf{W},\mathbf{S}\right)$\; 1. Update the cell partitioning $\mathbf{W}$ according to the Eq. (\ref{necessary-condition-optimal-deployment-partitioning})\; 2. Update the normalized flow matrix $\mathbf{S}$ using to the Bellman-Ford algorithm\; 3. Set $\mathcal{I}_d = \{1,\cdots,N+M\}$ and calculate $r_n \triangleq \left[1-\frac{\max\left(0, \sum_{i\in\mathcal{I}_d}\zeta_i \|\Gamma_i\| - \gamma \right)}{\|\Gamma_n\| \times \frac{\psi_n}{\zeta_n}\times\sum_{i\in\mathcal{I}_d}\frac{\zeta_i^2}{\psi_i}} \right]$, $\forall n\in \mathcal{I}_d$\; 4. \While{$\exists n\in \mathcal{I}_d$ \textnormal{such that} $r_n\leq 0$}{ 4.1. Update $\mathcal{I}_d = \mathcal{I}_d - \bigcup_{r_n\leq 0} n$\; 4.2. Update $\{r_n\}_{n\in\mathcal{I}_d}$; } 5. $p_n = \tilde{p}_n + \Gamma_n\times\left[1-\frac{\max\left(0, \sum_{i\in\mathcal{I}_d}\zeta_i \|\Gamma_i\| - \gamma \right)}{\|\Gamma_n\| \times \frac{\psi_n}{\zeta_n}\times\sum_{i\in\mathcal{I}_d}\frac{\zeta_i^2}{\psi_i}} \right]\times \mathbf{1}_{\mathcal{I}_d}(n), \qquad\qquad\qquad \forall n\in\mathcal{I_A}\bigcup\mathcal{I_F}$\; -- Calculate the objective function $\mathcal{D}_{\textrm{new}}=\mathcal{D}\left(\mathbf{P},\mathbf{W},\mathbf{S}\right)$\; } \caption{Movement-Efficient Routing-aware Lloyd Algorithm} \label{MERL} \end{algorithm} \begin{prop}\label{MERL-convergence} MERL Algorithm is an iterative improvement algorithm, i.e., the objective function is non-increasing and the algorithm converges. \end{prop} The proof of Proposition \ref{MERL-convergence} is provided in Appendix \ref{proof-MERL-convergence}. \section{The Node Deployment with a Network Lifetime Constraint in Mobile WSNs}\label{Network-Lifetime-Constraint} \subsection{Problem formulation}\label{Network-Lifetime-Constraint-problem-formulation} In Section \ref{Total-Energy-Constraint}, we studied the node deployment with a total movement energy constraint, which can be seen as a resource allocation problem. This is because we can calculate how much movement energy each node requires once an optimal deployment is obtained. In this section, we focus on minimizing the communication power consumption given a constraint on the network lifetime. Let $\nu_n$ be the residual movement energy on Node $n$, and $\alpha_n$ be the power consumption for Node $n$ after relocation. To ensure a network lifetime of $T$, the following condition \begin{equation}\label{network-lifetime-first-condition} \nu_n - E_n\left(\mathbf{P}\right) \geq \alpha_n T, \qquad \forall n\in\mathcal{I_A}\bigcup\mathcal{I_F} \end{equation} has to be satisfied. Hence, the network lifetime of $T$ can be achieved by setting a maximum individual movement energy consumption for each node. Here, our main objective is to find the optimal node deployment for the following constrained optimization problem: \begin{align}\label{network-lifetime-objective} \minimize_{\mathbf{P}, \mathbf{W}, \mathbf{S}} \mathcal{D}\left(\mathbf{P}, \mathbf{W}, \mathbf{S} \right)& \\ \textrm{s.t.}\qquad E_n\left(\mathbf{P}\right) \leq \gamma_n,& \qquad \forall n\in\mathcal{I_A}\bigcup\mathcal{I_F} \label{lifetime-constraint} \end{align} where $\gamma_n = \nu_n - \alpha_n T$ is the maximum individual movement energy consumption of Node $n$. \subsection{The Optimal Node Deployment} Here, our goal is to find the optimal node deployment $\mathbf{P}^*$, cell partitioning $\mathbf{W}^*$ and normalized flow matrix $\mathbf{S}^*$ that minimizes the multi-hop communication power consumption while each individual movement energy consumption is constrained. The following theorem provides the necessary condition for optimal node deployment in the constrained optimization problem in Eqs. (\ref{network-lifetime-objective}) and (\ref{lifetime-constraint}). \begin{prop}\label{necessary-condition-network-lifetime} Let $\mathbf{P}^*$, $\mathbf{W}^*$ and $\mathbf{S}^*$ be the optimal node deployment, cell partitioning and normalized flow matrix for the constrained optimization problem in Eqs. (\ref{network-lifetime-objective}) and (\ref{lifetime-constraint}). Then, \begin{equation}\label{necessary-condition-network-lifetime-eq} p^*_n = \tilde{p}_n + \Gamma^*_n \times \min\left(1, \frac{\gamma_n}{\zeta_n\|\Gamma^*_n\|} \right), \qquad \forall n\in\mathcal{I_A}\bigcup\mathcal{I_F} \end{equation} where $\Gamma_n^* = z_n^* - \tilde{p}_n$. \end{prop} The proof of Proposition \ref{necessary-condition-network-lifetime} is provided in Appendix \ref{proof-necessary-condition-network-lifetime}. Based on the optimal condition in Proposition \ref{necessary-condition-network-lifetime}, we design the Lifetime-Optimized Routing-aware Lloyd (LORL) Algorithm, as outlined in Algorithm \ref{LORL}, to optimize the node deployment in heterogeneous multi-hop WSNs with network lifetime constraint, and minimize the objective function in Eqs. (\ref{network-lifetime-objective}) and (\ref{lifetime-constraint}). \begin{algorithm}[ht!] \SetAlgoLined \SetKwRepeat{Do}{do}{while} \KwResult{Optimal node deployment $\mathbf{P}$, cell partitioning $\mathbf{W}$ and normalized flow matrix $\mathbf{S}$.} Input: Initial node deployment $\tilde{\mathbf{P}}$, convergence error threshold $\epsilon\in \mathbb{R}^+$ \; \Do{$\frac{\mathcal{D}_{\mathrm{old}} - \mathcal{D}_{\mathrm{new}}}{\mathcal{D}_{\mathrm{old}}} \geq \epsilon$}{ -- Calculate the objective function $\mathcal{D}_{\textrm{old}}=\mathcal{D}\left(\mathbf{P},\mathbf{W},\mathbf{S}\right)$\; 1. Update the cell partitioning $\mathbf{W}$ according to the Eq. (\ref{necessary-condition-optimal-deployment-partitioning})\; 2. Update the normalized flow matrix $\mathbf{S}$ using to the Bellman-Ford algorithm\; 3. $ p_n = \tilde{p}_n + \Gamma_n \times \min\left(1, \frac{\gamma_n}{\zeta_n\|\Gamma_n\|} \right), \qquad\qquad\qquad\qquad\qquad\qquad\qquad \forall n\in\mathcal{I_A}\bigcup\mathcal{I_F}$\; -- Calculate the objective function $\mathcal{D}_{\textrm{new}}=\mathcal{D}\left(\mathbf{P},\mathbf{W},\mathbf{S}\right)$\; } \caption{Lifetime-Optimized Routing-aware Lloyd Algorithm} \label{LORL} \end{algorithm} \begin{prop}\label{LORL-convergence} LORL Algorithm is an iterative improvement algorithm, i.e., the objective function is non-increasing and the algorithm converges. \end{prop} The proof of Proposition \ref{LORL-convergence} is provided in Appendix \ref{proof-LORL-convergence}. \section{Experiments}\label{Experiments} Simulations are carried out for a heterogeneous wireless sensor network consisting of $30$ APs and $3$ FCs. We consider a square field of size $10$km $\times$ $10$km, i.e., $\Omega = \left[0, 10000\right]^2$. Simulations are performed for two different sensor density functions, i.e., a uniform distribution $f\left(\omega\right) = \frac{1}{\int_{\Omega}d\omega} = 10^{-8}$, and a mixture of Gaussian where sensors are distributed according to: \begin{align}\label{Mixture_of_Gaussian_Distribution} f(\omega) &= \frac{1}{2} \! \times \mathcal{N}\! \left(\! \begin{bmatrix} 3e\!+\!3 \\ 3e\!+\!3 \end{bmatrix} \! , \! \begin{bmatrix} 1.5e\!+\!6 & 0 \\ 0 & 1.5e\!+\!6 \end{bmatrix} \! \right)\! + \frac{1}{4} \! \times \mathcal{N}\! \left(\! \begin{bmatrix} 6e\!+\!3 \\ 7e\!+\!3 \end{bmatrix} \! , \! \begin{bmatrix} 2e\!+\!6 & 0 \\ 0 & 2e\!+\!6 \end{bmatrix}\! \right) \! \nonumber\\&+ \frac{1}{4} \! \times \mathcal{N}\! \left(\! \begin{bmatrix} 7.5e\!+\!3 \\ 2.5e\!+\!3 \end{bmatrix} \! , \! \begin{bmatrix} 1e\!+\!6 & 0 \\ 0 & 1e\!+\!6 \end{bmatrix} \! \right). \end{align} All homogeneous densely deployed sensors share the transmitter antenna gain of $G_{t_{\textrm{sensor}}} = 1$. We consider a radio bit-rate of $R_b = 1$Mbps, and assume that the wavelength of the carrier signal is $\lambda_c = 0.3$m. In order for APs and FCs to receive the signal without error, the received power at each node $n \in \mathcal{I_A}\bigcup\mathcal{I_F}$ should be greater than some threshold $P_{th_n}$. Moreover, the transceiver electronics in each AP $n$ consumes $\rho_n$ Joules per bit for digital coding, modulation and filtering before signal transmission. Table \ref{P_threshold_rho} summarizes the values of $P_{th_n}$ and $\rho_n$ for all nodes \cite{heinzelman2000application}. \begin{table}[!bth] \centering \caption{Simulation parameters} \vspace{-3mm} \begin{tabular}{ccccccccc} \toprule \multicolumn{4}{c}{{\bf minimum received power (nW)}} && \multicolumn{4}{c}{{\bf electronics energy dissipation (nJ/bit)}} \\\cline{1-4}\cline{6-9} $\mathbf{P_{th_{1:15}}}$&$\mathbf{P_{th_{16:30}}}$&$\mathbf{P_{th_{31}}}$&$\mathbf{P_{th_{32:33}}}$&&$\mathbf{\rho_{1:7}}$ &&$\mathbf{\rho_{8:16}}$&$\mathbf{\rho_{17:30}}$\\ $10$ & $6$ & $6$ & $10$ && $40$ && $50$ & $60$ \\ \bottomrule \end{tabular} \label{P_threshold_rho} \end{table} For each AP $n$, we denote its transmitter antenna gain via $G_{t_n}$. In addition, for each node $n\in\mathcal{I_A}\bigcup\mathcal{I_F}$, let $G_{r_n}$ be its receiver antenna gain. Table \ref{antenna_gains} summarizes the values of the transmitter and receiver antenna gains for all nodes \cite{heinzelman2000application}. \begin{table}[!bth] \centering \caption{Transmitter and receiver antenna gains} \vspace{-3mm} \begin{tabular}{ccccc} \toprule \multicolumn{2}{c}{{\bf transmitter antenna gain}}&& \multicolumn{2}{c}{{\bf receiver antenna gain}} \\\cline{1-2}\cline{4-5} $\mathbf{G_{t_{1:7,15:22}}}$&$\mathbf{G_{t_{8:14,23:30}}}$&&$\mathbf{G_{r_{1:3,8:11,15:18,23:26,31:32}}}$ &$\mathbf{G_{r_{4:7,12:14,19:22,27:30,33}}}$\\ $1$ & $2$ && $1$ & $2$ \\ \bottomrule \end{tabular} \label{antenna_gains} \end{table} Note that parameters $\eta_i$ and $\beta_{i,j}$, for all $i\in\mathcal{I_A}$ and $j\in\mathcal{I_A}\bigcup\mathcal{I_F}$, can be calculated using the explained experimental setup. For example, we have $\eta_7 = \frac{P_{th_7} \times \left(4\pi\right)^2}{R_b G_{t_{\textrm{sensor}}} G_{r_7} \lambda_c^2} = \frac{10^{-8}\times \left(4\pi\right)^2}{10^6 \times 1 \times 2 \times (0.3)^2}=8.77 \textrm{ pJ/bit/}\textrm{m}^2$ and $\beta_{10, 20} = \frac{P_{th_{20}} \times \left(4\pi\right)^2}{R_b G_{t_{10}} G_{r_{20}} \lambda_c^2} = \frac{6\times 10^{-9}\times \left(4\pi\right)^2}{10^6 \times 2 \times 2 \times (0.3)^2}=2.63 \textrm{ pJ/bit/}\textrm{m}^2$. For performance evaluation, $10$ initial AP and FC deployments are generated randomly on $\Omega$, i.e., the location of each node is generated according to a uniform distribution on $\Omega$. The maximum number of iterations for all algorithms is set to $200$ and the Lagrangian multiplier is set to $\lambda = 0.25$. \subsection{Static Heterogeneous Multi-Hop WSNs}\label{Static_Heterogeneous_Simulations} We compare the total weighted communication power consumption of our proposed RL Algorithm with Cluster-Formation Algorithm \cite{chatterjee2015multiple}, Global Algorithm \cite{vincze2007deploying}, HTTL Algorithm \cite{karimi2020energy}, PSO Algorithm \cite{dandekar2013energy}, and SHMS Algorithm \cite{jain2015lifetime}. To reduce the number of hops that data packets have to travel to reach the fusion centers, the Cluster-Formation algorithm employs a graph theoretic approach to optimize both the number of clusters and their corresponding diameters. To reduce the communication distance between the nodes, the Global algorithm deploys nodes such that the average Euclidean distance between access points and their corresponding fusion centers is minimized. For a two-tier hierarchy of APs and FCs, the HTTL algorithm iteratively updates the node deployment, cell partitioning, and connections between APs and FCs while the flow of data from each sensor to its corresponding FC is mediated by exactly one access point. PSO is a population based iterative algorithm for finding the optimal node deployment and minimizing the non-linear objective function. For a given node deployment, the SHMS algorithm determines the connections between APs and FCs such that the maximum energy consumed by each node is minimized. The weighted power consumption of Cluster-Formation, Global, HTTL, PSO, SHMS and RL algorithms for the uniform sensor density function are summarized in Table \ref{weighted_power_static_uniform}. The RL algorithm outperforms other algorithms, and achieves a lower weighted communication power consumption. Note that although the HTTL algorithm proposed in \cite{karimi2020energy} deploys nodes based on the necessary conditions of optimality, the network architecture is restricted to a two-tier hierarchy while the RL algorithm simultaneously optimizes over the node deployment and data routing. As a result, the node deployment based on the RL algorithm results in a WSN that saves about $21\%$ of the energy consumed by the node deployment based on HTTL Algorithm. \begin{table}[!bth] \centering \caption{Weighted power comparison for the uniform sensor density function} \vspace{-3mm} \begin{tabular}{cccccc} \toprule {\bf Cluster-Formation}&{\bf Global}&{\bf HTTL}&{\bf PSO}&{\bf SHMS}& {\bf RL} \\ $15.49$ & $14.98$ & $12.80$ & $19.98$ & $22.39$ &$\mathbf{10.12}$\\ \bottomrule \end{tabular} \label{weighted_power_static_uniform} \end{table} Table \ref{weighted_power_static_gaussian} summarizes the weighted communication power consumption of Cluster-Formation, Global, HTTL, PSO, SHMS and RL algorithms for the mixture of Gaussian sensor density function in Eq. (\ref{Mixture_of_Gaussian_Distribution}). The RL algorithm results in a power consumption of $5.58$ Watts, and outperforms other methods. Furthermore, the RL algorithm leads to a network architecture that exhaust its available communication energy in a time period that is longer by about $10\%$ of that of HTTL Algorithm. Figure \ref{Gaussian_static_sample_deployment} shows the optimal node deployment for different algorithms where APs and FCs are denoted by red squares and black circles, respectively. \begin{table}[!bth] \centering \caption{Weighted power comparison for the mixture of Gaussian sensor density function} \vspace{-3mm} \begin{tabular}{cccccc} \toprule {\bf Cluster-Formation}&{\bf Global}&{\bf HTTL}&{\bf PSO}&{\bf SHMS}& {\bf RL} \\ $7.07$ & $6.81$ & $6.23$ & $9.97$ & $16.62$ &$\mathbf{5.58}$ \\ \bottomrule \end{tabular} \label{weighted_power_static_gaussian} \end{table} \begin{figure}[!htb] \centering \subfloat[]{\includegraphics[width=50.5mm]{figures/Sample_Deployments/Heterogeneous/cluster.eps}} \label{Gaussian_static_sample_deployment_cluster} \hspace{3.0mm} \subfloat[]{\includegraphics[width=50.5mm]{figures/Sample_Deployments/Heterogeneous/global.eps}} \label{Gaussian_static_sample_deployment_global} \hspace{3.0mm} \subfloat[]{\includegraphics[width=50.5mm]{figures/Sample_Deployments/Heterogeneous/httl.eps}} \label{Gaussian_static_sample_deployment_httl} \hspace{3.0mm} \vspace{1mm} \subfloat[]{\includegraphics[width=50.5mm]{figures/Sample_Deployments/Heterogeneous/pso.eps}} \label{Gaussian_static_sample_deployment_pso} \hspace{3.0mm} \subfloat[]{\includegraphics[width=50.5mm]{figures/Sample_Deployments/Heterogeneous/shms.eps}} \label{Gaussian_static_sample_deployment_shms} \hspace{3.0mm} \subfloat[]{\includegraphics[width=50.5mm]{figures/Sample_Deployments/Heterogeneous/RL.eps}} \label{Gaussian_static_sample_deployment_rl} \captionsetup{justification=justified} \caption{\small{Node deployment for different algorithms and the mixture of Gaussian sensor density function. (a) Cluster-Formation (b) Global (c) HTTL (d) PSO (e) SHMS (f) RL.}} \label{Gaussian_static_sample_deployment} \end{figure} \subsection{Mobile Heterogeneous Multi-Hop WSNs with a Total Movement Energy Constraint}\label{Mobile_Total_Movement_Energy_Simulations} The underlying assumption in all deployment strategies studied in Section \ref{Static_Heterogeneous_Simulations} is that the optimal node locations are calculated offline, then each node is placed at its corresponding position. However, in many applications, e.g. when the target region is a hostile environment, static deployment is not feasible. Instead, nodes are initially deployed in the target region, e.g. by airdropping them using small drones or manual placement in an accessible sub-region of the field, then each node moves to its optimal location based on the initial deployment and available movement energy. When the total available movement energy is constrained, the optimization problem is translated into a resource allocation problem where the optimal energy supply for each node is determined such that the resulting total communication power consumption after optimal deployment is minimized. The performance evaluation under this scenario is the focus of this section. In Section \ref{Mobile_Lifetime_Simulations}, we study the performance evaluation when the available movement energy for each node is predetermined, and the optimization problem is translated to that of enhancing the network lifetime. The same experimental setup described at the beginning of Section \ref{Experiments} and in Tables \ref{P_threshold_rho} and \ref{antenna_gains} is used for the simulations. Furthermore, Table \ref{Moving_cost_parameters} provides the moving cost parameters $\zeta_n$ for each node $n\in\mathcal{I_A}\bigcup\mathcal{I_F}$ \cite{shigei2012battery, el2011mobile}. We consider a total available movement energy of $\gamma = 40000$ Joules for the constrained objective function in Eqs. (\ref{total-movement-constraint-objective}) and (\ref{movement-constraint}). \begin{table}[!bth] \centering \caption{Moving cost parameters (J/m)} \vspace{-3mm} \begin{tabular}{cccccc} \toprule $\mathbf{\zeta_{1:8}}$&$\mathbf{\zeta_{9:22}}$&$\mathbf{\zeta_{23:30}}$&$\mathbf{\zeta_{31}}$&$\mathbf{\zeta_{32}}$&$\mathbf{\zeta_{33}}$\\ $2$ & $4$ & $6$ & $4$ & $5$ & $6$ \\ \bottomrule \end{tabular} \label{Moving_cost_parameters} \end{table} We compare the total weighted communication power consumption of our proposed MERL Algorithm with Lloyd-$\alpha$ Algorithm \cite{song2013distributed}, OMF Algorithm \cite{chellappan2007deploying}, and VFA Algorithm \cite{zou2004sensor}. The Lloyd-$\alpha$ algorithm applies a penalty term to the Lloyd algorithm to reduce the movement steps and save traveling energy while guaranteeing the convergence property. The OMF algorithm optimizes the movement plan for nodes such that each region in the network has a minimum number of nodes to relay the data to fusion centers while the sum of nodes' traveling distances is minimized. The VFA algorithm uses attractive and repulsive virtual forces on nodes such that not only every two nodes in the final deployment maintain a minimum distance from each other, but also the communication distances are minimized by avoiding nodes to be located very far from each other. For a fair comparison, the same initial deployment is used for all algorithms. The weighted communication power consumption of Lloyd-$\alpha$, OMF, VFA, and MERL algorithms for the uniform sensor density function are summarized in Table \ref{weighted_power_mobile_total_uniform}. All algorithms exhausted the available movement energy $\gamma$ to move the AP and FC nodes from their initial deployment to their designated optimal locations. The MERL algorithm leads to a deployment that consumes communication energy in a rate that is almost half of other algorithms. The superior performance of the MERL algorithm is due to the optimal energy allocation among nodes, as it is implicit in Eq. (\ref{necessary-condition-total-move-constraint-eq2}). Note that if the total movement energy $\gamma$ is large enough, e.g. $\gamma \geq \sum_{i=1}^{N+M}\zeta_i \|\tilde{p}_i - z^*_i \|$, then the performance of the MERL algorithm will converge to that of the RL algorithm. However, since the value of $\gamma$ in our experiments is not large enough, nodes will run out of their allocated movement energy, and MERL algorithm leads to a communication power consumption that is larger than that of the RL algorithm in Section \ref{Static_Heterogeneous_Simulations}. \begin{table}[!bth] \centering \caption{Weighted power comparison for the uniform sensor density function} \vspace{-3mm} \begin{tabular}{cccc} \toprule {\bf Lloyd-$\alpha$}&{\bf OMF}&{\bf VFA} & {\bf MERL} \\ $29.12$ & $27.35$ & $27.85$ &$\mathbf{14.49}$\\ \bottomrule \end{tabular} \label{weighted_power_mobile_total_uniform} \end{table} Table \ref{weighted_power_mobile_total_gaussian} also summarizes the weighted communication power consumption of Lloyd-$\alpha$, OMF, VFA, and MERL algorithms for the mixture of Gaussian sensor density function in Eq. (\ref{Mixture_of_Gaussian_Distribution}). The MERL algorithm significantly outperforms other methods and leads to a communication power consumption that is less than half of what other algorithms achieve. This is because the MERL algorithm can optimally adapt to any underlying sensor density function $f(\omega)$ and deploy nodes accordingly, as we studied in Section \ref{Total-Energy-Constraint}. \begin{table}[!bth] \centering \caption{Weighted power comparison for the mixture of Gaussian sensor density function} \vspace{-3mm} \begin{tabular}{cccc} \toprule {\bf Lloyd-$\alpha$}&{\bf OMF}&{\bf VFA} & {\bf MERL} \\ $17.38$ & $17.29$ & $18.76$ &$\mathbf{7.64}$ \\ \bottomrule \end{tabular} \label{weighted_power_mobile_total_gaussian} \end{table} Figure \ref{Gaussian_mobile_total_sample_deployment} shows the final deployment for different algorithms where APs and FCs are denoted by red squares and black circles, respectively. \begin{figure}[!htb] \centering \subfloat[]{\includegraphics[width=37.5mm]{figures/Sample_Deployments/Total_Energy_Constraint/lloyd_alpha.eps}} \label{Gaussian_mobile_total_sample_deployment_lloyd_alpha} \hspace{2mm} \subfloat[]{\includegraphics[width=37.5mm]{figures/Sample_Deployments/Total_Energy_Constraint/omf.eps}} \label{Gaussian_mobile_total_sample_deployment_OMF} \hspace{2mm} \subfloat[]{\includegraphics[width=37.5mm]{figures/Sample_Deployments/Total_Energy_Constraint/vfa.eps}} \label{Gaussian_mobile_total_sample_deployment_VFA} \hspace{2mm} \subfloat[]{\includegraphics[width=37.5mm]{figures/Sample_Deployments/Total_Energy_Constraint/MERL.eps}} \label{Gaussian_mobile_total_sample_deployment_MERL} \vspace{-2mm} \captionsetup{justification=justified} \caption{\small{Node deployment for different algorithms and the mixture of Gaussian sensor density function. (a) Lloyd-$\alpha$ (b) OMF (c) VFA (d) MERL.}} \label{Gaussian_mobile_total_sample_deployment} \end{figure} \subsection{Mobile Heterogeneous Multi-Hop WSNs with a Network Lifetime Constraint}\label{Mobile_Lifetime_Simulations} While in Section \ref{Mobile_Total_Movement_Energy_Simulations} we studied the performance evaluation of mobile WSNs under a total movement energy constraint, here we focus on enhancing the network lifetime, which necessitates nodes to have individual movement energy constraints, as formulated in Eqs. (\ref{network-lifetime-objective}) and (\ref{lifetime-constraint}). We use the same experimental setup and node characterization as described at the beginning of Section \ref{Experiments} and in Tables \ref{P_threshold_rho}, \ref{antenna_gains} and \ref{Moving_cost_parameters} for performance evaluation. In addition, Table \ref{gamma_ns} provides the maximum individual movement energy consumption $\gamma_n$ for all nodes $n\in\mathcal{I_A}\bigcup\mathcal{I_F}$. \begin{table}[!bth] \centering \caption{Movement energy constraints (J)} \vspace{-3mm} \begin{tabular}{cccccc} \toprule $\mathbf{\gamma_{1:8}}$&$\mathbf{\gamma_{9:22}}$&$\mathbf{\gamma_{23:30}}$&$\mathbf{\gamma_{31}}$&$\mathbf{\gamma_{32}}$&$\mathbf{\gamma_{33}}$\\ $800$ & $1100$ & $1400$ & $2000$ & $2400$ & $2600$ \\ \bottomrule \end{tabular} \label{gamma_ns} \end{table} We compare the weighted communication power consumption of our proposed LORL Algorithm with those of Lloyd-$\alpha$ Algorithm, OMF Algorithm, and VFA Algorithm described in Section \ref{Mobile_Total_Movement_Energy_Simulations}. For a fair comparison, the same initial deployment as in Section \ref{Mobile_Total_Movement_Energy_Simulations} is used for all algorithms. The weighted communication power consumption of Lloyd-$\alpha$, OMF, VFA, and LORL algorithms for the uniform sensor density function are provided in Table \ref{weighted_power_mobile_individual_uniform}. The LORL algorithm outperforms other methods, and achieves a significantly lower power consumption. For instance, the LORL algorithm leads to a node deployment in which the network consumes its residual energy with a rate that is less than $70\%$ of that of the VFA algorithm. This in turn prolongs the network lifetime, which is a prominent factor in wireless sensor networks. \begin{table}[!bth] \centering \caption{Weighted power comparison for the uniform sensor density function} \vspace{-3mm} \begin{tabular}{cccc} \toprule {\bf Lloyd-$\alpha$}&{\bf OMF}&{\bf VFA} & {\bf LORL} \\ $27.64$ & $30.12$ & $25.24$ &$\mathbf{17.33}$\\ \bottomrule \end{tabular} \label{weighted_power_mobile_individual_uniform} \end{table} Table \ref{weighted_power_mobile_individual_gaussian} also summarizes the weighted power consumption of different algorithms for the mixture of Gaussian sensor density function given in Eq. (\ref{Mixture_of_Gaussian_Distribution}). The LORL algorithm achieves a power consumption of $9.59$ Watts and outperforms other methods. Figure \ref{Gaussian_mobile_individual_sample_deployment} shows the final node deployment for different algorithms. \begin{table}[!bth] \centering \caption{Weighted power comparison for the mixture of Gaussian sensor density function} \vspace{-3mm} \begin{tabular}{cccc} \toprule {\bf Lloyd-$\alpha$}&{\bf OMF}&{\bf VFA} & {\bf LORL} \\ $17.24$ & $20.12$ & $14.60$ &$\mathbf{9.59}$ \\ \bottomrule \end{tabular} \label{weighted_power_mobile_individual_gaussian} \end{table} The sum of individual movement energies in Table \ref{gamma_ns}, i.e. $\sum_{i=1}^{N+M}\gamma_i$, is equal to the value of $\gamma$ in Section \ref{Mobile_Total_Movement_Energy_Simulations}. In other words, Table \ref{gamma_ns} represents one exemplary distribution of the total movement energy $\gamma$ among the AP and FC nodes; however, it is different from the optimal energy allocation provided by the MERL algorithm in Section \ref{Mobile_Total_Movement_Energy_Simulations}. The results in Tables \ref{weighted_power_mobile_total_uniform}, \ref{weighted_power_mobile_total_gaussian}, \ref{weighted_power_mobile_individual_uniform} and \ref{weighted_power_mobile_individual_gaussian} verify that the MERL algorithm achieves a lower total power consumption compared to the LORL algorithm although it does not guarantee any individual power constraint. \begin{figure}[!htb] \centering \subfloat[]{\includegraphics[width=37.5mm]{figures/Sample_Deployments/Network_Lifetime/lloyd_alpha.eps}} \label{Gaussian_mobile_individual_sample_deployment_lloyd_alpha} \hspace{2mm} \subfloat[]{\includegraphics[width=37.5mm]{figures/Sample_Deployments/Network_Lifetime/omf.eps}} \label{Gaussian_mobile_individual_sample_deployment_OMF} \hspace{2mm} \subfloat[]{\includegraphics[width=37.5mm]{figures/Sample_Deployments/Network_Lifetime/vfa.eps}} \label{Gaussian_mobile_individual_sample_deployment_VFA} \hspace{2mm} \subfloat[]{\includegraphics[width=37.5mm]{figures/Sample_Deployments/Network_Lifetime/LORL.eps}} \label{Gaussian_mobile_individual_sample_deployment_LORL} \vspace{-2mm} \captionsetup{justification=justified} \caption{\small{Node deployment for different algorithms and the mixture of Gaussian sensor density function. (a) Lloyd-$\alpha$ (b) OMF (c) VFA (d) LORL.}} \label{Gaussian_mobile_individual_sample_deployment} \end{figure} \section{Conclusion}\label{Conclusion} In this work, a heterogeneous multi-hop wireless sensor network is discussed where data is collected from densely deployed sensors and transferred to heterogeneous fusion centers using heterogeneous access points as relay nodes. We modeled the minimum communication power consumption of such networks as an optimization problem, and studied the necessary conditions of optimal deployment under both static and mobile network settings. A novel generalized Voronoi diagram is proposed to provide the best cell partition for the heterogeneous multi-hop network. When manual deployment is feasible, the necessary conditions of optimal deployment are explored under the static network setup, and accordingly a Routing-aware Lloyd algorithm is proposed to deploy nodes. However, when static placement is not doable, the necessary conditions of the optimal deployment are studied under a mobile network setting where nodes move from their initial locations to their optimal positions. We consider both total and individual movement energy constraints and formulate them as resource allocation and lifetime optimizations, respectively. Based on the derived necessary conditions, we propose Movement-Efficient Routing-aware Lloyd and Lifetime-Optimized Routing-aware Lloyd algorithms to deploy nodes under total and individual energy constraints, respectively. Simulation results show that our proposed RL, MERL, and LORL algorithms significantly save communication power in such networks and provide superior results compared to other methods in the literature. \appendices \section{}\label{proof-power-coef-equality} Proof of Lemma \ref{power-coef-equality}: The AP power coefficient $g_n\left(\mathbf{P}, \mathbf{S}\right)$ defined in Eq. (\ref{power-coefficient}) is the power consumption for transmitting $1$ bit data from AP $n$ to the FCs. This includes both the transmission power at each node, including AP $n$, on the paths connecting AP $n$ to the FCs, and the receiver power at each node, excluding AP $n$, on the paths connecting AP $n$ to the FCs. Since $R_b\int_{W_n}f(\omega)d\omega$ is the total amount of data collected by AP $n$ from sensors within the region $W_n$ in a unit time, the term $g_n\left(\mathbf{P}, \mathbf{S}\right)R_b\int_{W_n}f(\omega)d\omega$ is the required communication power for transmitting the sensory data collected within the region $W_n$ from AP $n$ to the FCs. Hence, the left-hand-side of Eq. (\ref{power-coef-equality-eq}) is the required communication power for transmitting the sensory data collected within the target region from APs to FCs. This can be decomposed into the APs' total transmission power in addition to the required receiver power for the data to reach FCs from AP nodes. This proves Eq. (\ref{power-coef-equality-eq}) since the right-hand-side of Eq. (\ref{power-coef-equality-eq}) can be rewritten as $\overline{\mathcal{P}}^T_{\mathcal{A}} + \sum_{i=1}^{N}\sum_{j=1}^{N}\rho_j F_{i,j}\left(\mathbf{W},\mathbf{S}\right)$, i.e. the sum of APs' total transmission power and the receiver power for all links $(i,j)$ connecting AP $i$ and AP $j$. $\hfill\blacksquare$ \section{}\label{proof-voronoi-optimality} Proof of Proposition \ref{optimal-cell-partitioning}: Using Eq. (\ref{rewrite-objective-function}), we have: \begin{align}\label{proof-voronoi-optimality-equations} \mathcal{D}\left(\mathbf{P}, \mathbf{W}, \mathbf{S} \right) &= \sum_{n=1}^{N} \int_{W_n} \left(\eta_n \|p_n - \omega \|^2 R_b + \lambda g_n\left(\mathbf{P}, \mathbf{S} \right)R_b + \lambda \rho_n R_b \right) f(\omega)d\omega \nonumber \\ & \geq \sum_{n=1}^{N} \int_{W_n} \min_j \left(\eta_j \|p_j - \omega \|^2 R_b + \lambda g_j\left(\mathbf{P}, \mathbf{S} \right)R_b + \lambda \rho_j R_b \right) f(\omega)d\omega \nonumber \\ &= \int_{\Omega} \min_j \left(\eta_j \|p_j - \omega \|^2 R_b + \lambda g_j\left(\mathbf{P}, \mathbf{S} \right)R_b + \lambda \rho_j R_b \right) f(\omega)d\omega \nonumber \\ &= \sum_{n=1}^{N} \int_{\mathcal{V}_n} \min_j \left(\eta_j \|p_j - \omega \|^2 R_b + \lambda g_j\left(\mathbf{P}, \mathbf{S} \right)R_b + \lambda \rho_j R_b \right) f(\omega)d\omega \nonumber \\ &= \sum_{n=1}^{N} \int_{\mathcal{V}_n} \left(\eta_n \|p_n - \omega \|^2 R_b + \lambda g_n\left(\mathbf{P}, \mathbf{S} \right)R_b + \lambda \rho_n R_b \right) f(\omega)d\omega \nonumber \nonumber \\ &= \mathcal{D}\left(\mathbf{P},\mathcal{V}\left(\mathbf{P},\mathbf{S} \right),\mathbf{S} \right). \end{align} Hence, the generalized Voronoi diagram provides the optimal cell partitioning for any given node deployment $\mathbf{P}$ and normalized flow matrix $\mathbf{S}$. $\hfill \blacksquare$ \section{}\label{proof-necessary-condition-optimal-deployment} Proof of Proposition \ref{necessary-condition-optimal-deployment}: Eq. (\ref{necessary-condition-optimal-deployment-partitioning}) is a direct implication of Proposition \ref{optimal-cell-partitioning}. Eq. (\ref{necessary-condition-optimal-deployment-S}) is directly followed from Eq. (\ref{bellman-ford-functionality}). Here, we prove Eq. (\ref{necessary-condition-optimal-deployment-APs}) for the optimal locations of APs and FCs. First, we study the shape of the Voronoi regions in (\ref{voronoi-cell}). Let $\mathcal{B}(c,r)=\{\omega|\|\omega-c\|\leq r\}$ be a disk centered at $c$ with radius $r$ in two-dimensional space. In particular, $\mathcal{B}(c,r)=\varnothing$ when $r < 0$. Let $\mathcal{HS}(a, b) = \left\{\omega|a\cdot\omega + b\leq 0\right\}$ be a half space, where $a\in\mathbb{R}^2$ is a vector and $b\in\mathbb{R}$ is a constant. For $i,j \in \mathcal{I_A}$, we define \begin{equation} \mathcal{V}_{ij}(\mathbf{P}, \mathbf{S})\triangleq\{\omega|\eta_i \|p_i - \omega \|^2 + \lambda g_i\left(\mathbf{P}, \mathbf{S} \right) + \lambda \rho_i \leq \eta_j \|p_j - \omega \|^2 + \lambda g_j\left(\mathbf{P}, \mathbf{S} \right) + \lambda \rho_j \} \label{Vij} \end{equation} to be the pairwise Voronoi region of AP $i$ where only APs $i$ and $j$ are considered. Then, AP $i$'s Voronoi region can be represented as $\mathcal{V}_i(\mathbf{P}, \mathbf{S}) = \left[\bigcap_{j\neq i}\mathcal{V}_{ij}(\mathbf{P},\mathbf{S})\right]\bigcap\Omega$. By expanding (\ref{Vij}) and straightforward algebraic calculations, the pairwise Voronoi region $\mathcal{V}_{ij}$ is derived as: \begin{align} V_{ij}=\Omega\cap\begin{cases} \mathcal{HS}\left(a_{ij}, b_{ij}\right)& \quad , \eta_i=\eta_j \\ \mathcal{B}\left(c_{ij}, r_{ij}\right) &\quad , \eta_i>\eta_j , L_{ij}\geq 0\\ \varnothing & \quad , \eta_i>\eta_j , L_{ij}< 0\\ \mathcal{B}^c\left(c_{ij}, r_{ij}\right) &\quad , \eta_i<\eta_j , L_{ij} \geq 0 \\ \mathbb{R}^2 & \quad , \eta_i<\eta_j , L_{ij}< 0 \end{cases}, \end{align} where $a_{ij} = \eta_j p_j - \eta_i p_i$, $b_{ij}=\frac{\left(\eta_i\|p_i\|^2-\eta_j\|p_j\|^2+\lambda g_i\left(\mathbf{P}, \mathbf{S} \right) + \lambda \rho_i - \lambda g_j\left(\mathbf{P}, \mathbf{S} \right) - \lambda \rho_j\right)}{2}$, $c_{ij}=\frac{\eta_ip_i-\eta_jp_j}{\eta_i-\eta_j}$, $L_{ij} = \frac{\eta_i\eta_j\|p_i-p_j\|^2}{\left(\eta_i-\eta_j\right)^2} -\lambda \times \frac{g_i\left(\mathbf{P}, \mathbf{S} \right) + \rho_i - g_j\left(\mathbf{P}, \mathbf{S} \right) - \rho_j}{(\eta_i-\eta_j)}$, $r_{ij} = \sqrt{\max\left(L_{ij}, 0\right)}$, and $\mathcal{B}^c(c_{ij},r_{ij})$ is the complementary of $\mathcal{B}(c_{ij},r_{ij})$. Note that for two distinct indices such as $i,j\in \mathcal{I_A}$, if $\eta_i>\eta_j$ and $L_{ij}<0$, then two regions $\Omega\cap\mathcal{B}(c_{ij},r_{ij})$ and $\varnothing$ differ only in the point $c_{ij}$. Similarly, for $\eta_i<\eta_j$ and $L_{ij}<0$, two regions $\Omega\cap\mathcal{B}^c(c_{ij},r_{ij})$ and $\Omega$ differ only in the point $c_{ij}$. If we define: \begin{equation}\label{voronoi_v_n} \overline{V}_k = \left [ \bigcap_{i:\eta_k>\eta_i} \mathcal{B}(c_{ki},r_{ki}) \right] \bigcap \left[\bigcap_{i:\eta_k=\eta_i} \mathcal{HS}(a_{ki},b_{ki}) \right] \bigcap \left[ \bigcap_{i:\eta_k<\eta_i} \mathcal{B}^c(c_{ki},r_{ki}) \right] \bigcap \Omega, \end{equation} then two regions $\overline{V}_k$ and $V_k$ differ only in finite number of points. As a result, integrals over both $\overline{V}_k$ and $V_k$ have the same value since the density function $f$ is continuous and differentiable, and removing finite number of points from the integral region does not change the integral value. Note that if $V_k$ is empty, the Proposition 1 in \cite{guo2016sensor} holds since the integral over an empty region is zero. If $V_k$ is not empty, the same arguments as in Appendix A of \cite{guo2016sensor} can be replicated since $\overline{V}_k$ in (\ref{voronoi_v_n}) is similar to (31) in \cite{guo2016sensor}. Using parallel axis theorem \cite{paul1979kinematics}, the heterogeneous multi-hop communication power consumption can be written as: \begin{align} & \mathcal{D}\left(\mathbf{P}, \mathbf{W}, \mathbf{S} \right) = \sum_{n=1}^{N} \int_{W_n} \eta_n \|c_n - \omega \|^2 R_b f(\omega)d\omega + \sum_{n=1}^{N}\eta_n\|p_n - c_n\|^2R_b v_n \nonumber \\ & + \lambda\sum_{i=1}^{N}\sum_{j=1}^{N+M} \beta_{i,j} \|p_i - p_j\|^2 F_{i,j}\left(\mathbf{W}, \mathbf{S} \right) + \lambda\sum_{n=1}^{N}\rho_n \left[ \sum_{i=1}^{N} F_{i,n}\left(\mathbf{W}, \mathbf{S} \right) + R_b\int_{W_n}f(\omega)d\omega \right], \label{objective-after-parallel-axis-theorem} \end{align} where $v_n=v\left(W_n\right)$ and $c_n$ are the volume and centroid of the region $W_n$, respectively. Using Proposition 1 in \cite{guo2016sensor}, since the optimal deployment $\mathbf{P}^*$ should have a zero gradient, we take the partial derivatives of (\ref{objective-after-parallel-axis-theorem}) with respect to node locations. For each $i\in \mathcal{I}_{A}$, we have \begin{equation}\label{pd1} \frac{\partial \mathcal{D}}{\partial p^*_i} = 2\eta_i(p^*_i-c^*_i)R_bv^*_i +2\lambda\sum\limits_{j=1}^{N+M}\beta_{i,j}(p^*_i-p^*_j)F^*_{i,j} +2\lambda\sum\limits_{j=1}^{N}\beta_{j,i}(p^*_i-p^*_j)F^*_{j,i} = 0, \end{equation} and for each $i\in\mathcal{I_F}$, we have \begin{equation}\label{pd2} \frac{\partial \mathcal{D}}{\partial p^*_i} = 2\lambda\sum\limits_{j=1}^{N}\beta_{j,i}(p^*_i-p^*_j)F^*_{j,i} = 0. \end{equation} By solving Eqs. (\ref{pd1}) and (\ref{pd2}), we obtain Eq. (\ref{necessary-condition-optimal-deployment-APs}) and the proof is complete. $\hfill\blacksquare$ \section{}\label{proof-RL-convergence} Proof of Proposition \ref{RL-convergence}: Note that RL Algorithm iterates between three steps. In what follows, we show that none of these steps will increase the objective function $\mathcal{D}\left(\mathbf{P}, \mathbf{W}, \mathbf{S}\right)$. For a fixed node deployment $\mathbf{P}$ and normalized flow matrix $\mathbf{S}$, the cell partitioning $\mathbf{W}$ is updated according to Eq. (\ref{necessary-condition-optimal-deployment-partitioning}) which was shown to be optimal for a given $\mathbf{P}$ and $\mathbf{S}$ in Proposition \ref{optimal-cell-partitioning}. Therefore, the first step of RL Algorithm does not increase the objective function. Next, since $\mathcal{R}\left(\mathbf{P},\mathbf{W}\right)$ is the optimal normalized flow matrix for a given node deployment $\mathbf{P}$ and cell partitioning $\mathbf{W}$, the second step of RL Algorithm does not increase the objective function either. Finally, note that when $\mathbf{W}$, $\mathbf{S}$ and $\left\{p_j \right\}_{j\neq i}$ are fixed, the objective function $\mathcal{D}\left(\mathbf{P}, \mathbf{W}, \mathbf{S}\right)$ in Eq. (\ref{total-power-consumption}) is a convex function of the node position $p_i$; hence, by solving the zero-gradient equations and updating the node locations according to the Eq. (\ref{necessary-condition-optimal-deployment-APs}), the objective function does not increase. Therefore, the objective function of RL Algorithm is nonincreasing. In addition, the objective function is lower bounded by $0$, i.e., $\mathcal{D}\left(\mathbf{P},\mathbf{W},\mathbf{S}\right)\geq 0$. As a result, RL Algorithm is an iterative improvement algorithm and it converges. $\hfill\blacksquare$ \section{}\label{optimal-between-initial-z} Proof of Lemma \ref{total-movment-constraint-between-initial-and-optimal}: Before going through the proof, we state the following lemma: \begin{lemma}\label{geometric-locus-weighted-sum-square-distances} Given a set of points $q_i\in\mathbb{R}^2$ and non-negative scalar weights $a_i$ for $i\in\{1,\cdots,K\}$, and a scalar $m$, the geometric locus of the point $p\in\mathbb{R}^2$ such that the equality \begin{equation}\label{geometric-locus-weighted-sum-square-distances-eq} \sum_{i=1}^K a_i \|p - q_i\|^2 = m \end{equation} holds, is either an empty set, a single point, or a circle centered at the point $c = \frac{\sum_{i=1}^K a_i q_i}{\sum_{i=1}^K a_i}$. \end{lemma} Proof: Let $p=\left(p_x, p_y\right)$ and $q_i = \left( q_{i,x}, q_{i,y}\right)$. Then, we can rewrite Eq. (\ref{geometric-locus-weighted-sum-square-distances-eq}) as \begin{align}\label{expand-equation} \left(\sum_{i=1}^K a_i \right) \left( p_x^2 + p_y^2 \right) - 2\left(\sum_{i=1}^K a_i q_{i,x} \right) p_x - 2\left(\sum_{i=1}^K a_i q_{i,y} \right) p_y = m - \sum_{i=1}^K a_i \|q_i\|^2 . \end{align} By manipulating both sides, we can rewrite Eq. (\ref{expand-equation}) as follows: \begin{align}\label{manipulated-expanded-equation} \left[p_x - \frac{\sum\limits_{i=1}^K a_i q_{i,x}}{\sum\limits_{i=1}^K a_i} \right]^2 \!+\! \left[p_y - \frac{\sum\limits_{i=1}^K a_i q_{i,y}}{\sum\limits_{i=1}^K a_i} \right]^2 \!=\! \frac{m - \sum\limits_{i=1}^K a_i \|q_i\|^2}{\sum\limits_{i=1}^K a_i} + \frac{\left(\sum\limits_{i=1}^K a_i q_{i,x} \right)^2 \!+\! \left(\sum\limits_{i=1}^K a_i q_{i,y} \right)^2}{\left(\sum\limits_{i=1}^K a_i\right)^2}. \end{align} Hence, the geometric locus of the point $p=\left(p_x, p_y\right)$ is an empty set or a single point if the right-hand-side of Eq. (\ref{manipulated-expanded-equation}) is negative or zero, respectively; otherwise, the geometric locus is a circle centered at the point $c = \frac{\sum_{i=1}^K a_i q_i}{\sum_{i=1}^K a_i}$ with the radius $r = \sqrt{\frac{m - \sum_{i=1}^K a_i \|q_i\|^2}{\sum_{i=1}^K a_i} + \frac{\left(\sum_{i=1}^K a_i q_{i,x} \right)^2 + \left(\sum_{i=1}^K a_i q_{i,y} \right)^2}{\left(\sum_{i=1}^K a_i\right)^2}}$, and Lemma \ref{geometric-locus-weighted-sum-square-distances} is proved. \begin{corollary}\label{point_inside_circle} If the geometric locus in Lemma \ref{geometric-locus-weighted-sum-square-distances} is a circle centered at $c$ with radius $r$, then for any point $p$ within this circle we have $\sum_{i=1}^{K}a_i \|p - q_i\|^2 < m$, i.e. moving the point $p$ inside this circle reduces the weighted squared sum in Eq. (\ref{geometric-locus-weighted-sum-square-distances-eq}). \end{corollary} Now, assume that there exists at least one node, say $n$, for which Eq. (\ref{total-movment-constraint-between-initial-and-optimal-eq1}) in Lemma \ref{total-movment-constraint-between-initial-and-optimal} does not hold for an optimal node deployment $\mathbf{P}^*$, cell partitioning $\mathbf{W}^*$ and normalized flow matrix $\mathbf{S}^*$, i.e. $p^*_n$ does not lie on the segment $\overline{z^*_n\tilde{p}_n}$. We aim to find another deployment such as $\mathbf{P}'$, $\mathbf{W}'$ and $\mathbf{S}'$ so that $E\left(\mathbf{P}' \right)\leq \gamma$ and $\mathcal{D}\left(\mathbf{P}',\mathbf{W}',\mathbf{S}'\right) < \mathcal{D}\left(\mathbf{P}^*,\mathbf{W}^*, \mathbf{S}^* \right)$; hence, contradicting the optimality assumption of $\mathbf{P}^*$, $\mathbf{W}^*$ and $\mathbf{S}^*$, and concluding that Eq. (\ref{total-movment-constraint-between-initial-and-optimal-eq1}) holds for all nodes. For this purpose, let $\mathbf{W}' = \mathbf{W}^*$, $\mathbf{S}' = \mathbf{S}^*$ and $p'_i = p^*_i$ for all $i\in\mathcal{I_A}\bigcup\mathcal{I_F}\backslash \{n\}$. We aim to determine the node location $p'_n$ accordingly. Using the parallel axis theorem \cite{paul1979kinematics}, we can rewrite $\mathcal{D}\left(\mathbf{P}^*,\mathbf{W}^*,\mathbf{S}^* \right)$ as: \begin{align}\label{proof-lemma2-parallel-axis} \mathcal{D}\left(\mathbf{P}^*,\mathbf{W}^*,\mathbf{S}^*\right) & = \sum_{i=1}^{N}\int_{W^*_i}\eta_i \|c^*_i - \omega\|^2 R_b f(\omega)d\omega + \sum_{i=1}^{N}\eta_i R_b v^*_i \|p^*_i - c^*_i\|^2 \nonumber \\& + \lambda \sum_{i=1}^{N}\sum_{j=1}^{N+M} \beta_{i,j} \|p^*_i - p^*_j\|^2 F_{i,j}\left(\mathbf{W}^*, \mathbf{S}^* \right) + \lambda\overline{\mathcal{P}}^R_{\mathcal{A}}\left(\mathbf{W}^*,\mathbf{S}^*\right), \end{align} where $v^*_i$ and $c^*_i$ are the volume and centroid of the region $W^*_i$, respectively. In what follows, we assume that $n\in\mathcal{I_A}$, i.e. node $n$ is an AP. Similar proof can be carried out for $n\in\mathcal{I_F}$. Note that Eq. (\ref{proof-lemma2-parallel-axis}) can be split as $\mathcal{D}\left(\mathbf{P}^*,\mathbf{W}^*,\mathbf{S}^*\right) = \mathcal{D}_1\left(\mathbf{P}^*,\mathbf{W}^*,\mathbf{S}^*\right) + \mathcal{D}_2\left(\mathbf{P}^*,\mathbf{W}^*,\mathbf{S}^*\right)$, where \begin{align}\label{D1} \mathcal{D}_1\!\left(\mathbf{P}^*,\mathbf{W}^*,\mathbf{S}^*\right) \!=\! \eta_n R_b v^*_n \|p^*_n \!-\! c^*_n \|^2 +\! \sum_{j=1}^{N+M}\lambda\beta_{n,j}F^*_{n,j} \|p^*_n \!-\! p^*_j \|^2 +\! \sum_{j=1}^{N}\lambda\beta_{j,n}F^*_{j,n} \|p^*_n \!-\! p^*_j \|^2, \end{align} i.e. $\mathcal{D}_1$ includes those terms in Eq. (\ref{proof-lemma2-parallel-axis}) that involve $p^*_n$. In particular, regardless of the node $n$'s position, we have $\mathcal{D}_2\left(\mathbf{P}^*,\mathbf{W}^*,\mathbf{S}^* \right) = \mathcal{D}_2\left(\mathbf{P}',\mathbf{W}',\mathbf{S}' \right)$. According to Lemma \ref{geometric-locus-weighted-sum-square-distances}, the geometric locus of points such as $p^*_n$ for which the value of $\mathcal{D}_1\left(\mathbf{P}^*,\mathbf{W}^*,\mathbf{S}^* \right)$ in Eq. (\ref{D1}) remains the same is a circle $\Phi^*_n$ centered at the point $z^*_n = z_n\left(\mathbf{P}^*,\mathbf{W}^*,\mathbf{S}^* \right)$ defined in Eq. (\ref{z1-AP}), with radius $r^*_n = \|z^*_n - p^*_n \|$. Note that if $\|z^*_n - \tilde{p}_n\| < \|z^*_n - p^*_n\|$, then setting $p'_n=\tilde{p}_n$ not only leads to the movement energy $E\left(\mathbf{P}' \right)<E\left(\mathbf{P}^*\right)$, but also results in $\mathcal{D}_1\left(\mathbf{P}',\mathbf{W}',\mathbf{S}' \right) < \mathcal{D}_1\left(\mathbf{P}^*,\mathbf{W}^*,\mathbf{S}^* \right)$ since $p'_n$ lies inside $\Phi^*_n$. Therefore, we have $\mathcal{D}\left(\mathbf{P}',\mathbf{W}',\mathbf{S}' \right) < \mathcal{D}\left(\mathbf{P}^*,\mathbf{W}^*,\mathbf{S}^* \right)$ which is in contradiction with the optimality of $\mathbf{P}^*$, $\mathbf{W}^*$ and $\mathbf{S}^*$; hence, we have $\|z^*_n - \tilde{p}_n\| \geq \|z^*_n - p^*_n \|$. Let $\hat{p}_n$ be the intersection point of the circle $\Phi^*_n$ and segment $\overline{z^*_n \tilde{p}_n}$. Since $\|\tilde{p}_n - \hat{p}_n\| < \|\tilde{p}_n - p^*_n \|$, there exists an $\epsilon_n\in\mathbb{R}^+$ such that $\|\tilde{p}_n - \hat{p}_n\| + \epsilon_n < \|\tilde{p}_n - p^*_n \|$. If $p'_n = \hat{p}_n + \epsilon_n\times\frac{z^*_n - \hat{p}_n}{\|z^*_n - \hat{p}_n\|}$, then not only we have $E\left(\mathbf{P}'\right) < E\left(\mathbf{P}^*\right)$ since $E\left(\mathbf{P}^*\right) - E\left(\mathbf{P}'\right) > \zeta_n \epsilon_n > 0 $, but also $\mathcal{D}_1\left(\mathbf{P}',\mathbf{W}',\mathbf{S}' \right) < \mathcal{D}_1\left(\mathbf{P}^*,\mathbf{W}^*,\mathbf{S}^* \right)$ since $p'_n$ lies inside the circle $\Phi^*_n$. Therefore, we have $\mathcal{D}\left(\mathbf{P}',\mathbf{W}',\mathbf{S}' \right) < \mathcal{D}\left(\mathbf{P}^*,\mathbf{W}^*,\mathbf{S}^* \right)$ which contradicts the optimality of $\mathbf{P}^*$, $\mathbf{W}^*$ and $\mathbf{S}^*$ and concludes the proof. $\hfill\blacksquare$ \section{}\label{proof-necessary-condition-total-constraint} Proof of Proposition \ref{necessary-condition-total-move-constraint}: If $p^*_i = z^*_i$ for all $i\in\mathcal{I}_d$, then Eq. (\ref{movement-constraint}) implies that $E\left(\mathbf{P}^*\right) = \sum_{i\in\mathcal{I}_d}\zeta_i \|\Gamma^*_i\| \leq \gamma$; hence, Eq. (\ref{necessary-condition-total-move-constraint-eq2}) reduces to the trivial statement $p^*_n = \tilde{p}_n + \Gamma^*_n$ and the proof is complete. Therefore, we assume that there exists at least one node, say $n$, for which $p^*_n \neq z^*_n$. Note that if any residual movement energy is left in the optimal deployment, i.e. $E\left(\mathbf{P}^*\right)<\gamma$, then there exists an $\epsilon\in\mathbb{R}^+$ such that $E\left(\mathbf{P}^*\right) + \epsilon < \gamma$ and $\overline{p}_n=p^*_n + \epsilon\times\frac{z^*_n-p^*_n}{\|z^*_n-p^*_n\|}$ lies inside the circle centered at $z^*_n$ and radius $\|z^*_n - p^*_n \|$. Then, according to Lemma \ref{geometric-locus-weighted-sum-square-distances} and Corollary \ref{point_inside_circle}, by fixing the cell partitioning, normalized flow matrix and the location of all nodes except Node $n$, and placing Node $n$ at $\overline{p}_n$ we can achieve a lower total multi-hop communication power without exhausting the available movement energy, which contradicts the optimality of $\mathbf{P}^*$, $\mathbf{W}^*$ and $\mathbf{S}^*$. Therefore, $p^*_n\neq z^*_n$ implies that $E\left(\mathbf{P}^*\right)=\gamma$. Now, given the optimal node deployment $\mathbf{P}^*$, $\mathbf{W}^*$ and $\mathbf{S}^*$, we construct the node deployment $\mathbf{P}'$, $\mathbf{W}'$ and $\mathbf{S}'$ as follows. Let $\mathbf{W}' = \mathbf{W}^*$, $\mathbf{S}' = \mathbf{S}^*$ and $p'_i = p^*_i$ for all $i\in\mathcal{I_A}\bigcup\mathcal{I_F}\backslash\{m, n\}$. Let $\epsilon_m, \epsilon_n \in \mathbb{R}^+$ be small values and define \begin{equation}\label{proof-eq1} p'_m = p^*_m - \epsilon_m\times \frac{z^*_m - \tilde{p}_m}{\|z^*_m - \tilde{p}_m\|} \qquad , \qquad p'_n = p^*_n + \epsilon_n\times \frac{z^*_n - \tilde{p}_n}{\|z^*_n - \tilde{p}_n\|}. \end{equation} To satisfy the equality $E\left(\mathbf{P}'\right) = \gamma$, we have $\zeta_n \epsilon_n = \zeta_m \epsilon_m$. Now, we calculate the change in the multi-hop communication power, i.e. $\mathcal{D}\left(\mathbf{P}',\mathbf{W}',\mathbf{S}'\right) - \mathcal{D}\left(\mathbf{P}^*,\mathbf{W}^*,\mathbf{S}^*\right)$. Assume that Node $m$ is fixed at $p^*_m$ and we move Node $n$ from $p^*_n$ to $p'_n$. Note that this movement only changes the term $\mathcal{D}_1$ defined in Eq. (\ref{D1}); thus, according to Lemma \ref{geometric-locus-weighted-sum-square-distances} and Eq. (\ref{manipulated-expanded-equation}), this change is proportional to the difference between the squared radii, i.e. \begin{equation}\label{delta_1} \Delta_1 = \left[\|p'_n - z^*_n \|^2 - \|p^*_n - z^*_n \|^2 \right]\times \psi^*_n, \end{equation} where $\psi^*_n$ is defined in Eq. (\ref{psi}). Now, with Node $n$ placed at $p'_n$, we move Node $m$ from $p^*_m$ to $p'_m$. Similar to the above argument, the term $\Delta_2$ defined as \begin{equation}\label{delta_2} \Delta_2 = \left[\|p'_m - z^*_m \|^2 - \|p^*_m - z^*_m \|^2 \right]\times \psi^*_m \end{equation} captures the change in $\mathcal{D}$ with the assumption that Node $n$ was located at $p^*_n$. Now, we take into account that Node $n$ was located at $p'_n$ instead of $p^*_n$ during Node $m$'s movement. \begin{align}\label{delta_3} \Delta_3 &= \lambda \beta_{n,m} F^*_{n,m}\times\left[\left(\|p'_n - p'_m \|^2 - \|p'_n - p^*_m \|^2 \right) - \left(\|p^*_n - p'_m \|^2 - \|p^*_n - p^*_m\|^2 \right) \right] \\ &= \lambda \beta_{n,m} F^*_{n,m}\times\big[\left(\|p'_n - p^*_m \|^2 + \epsilon_m^2 - 2\epsilon_m\|p'_n - p^*_m \| \cos{\measuredangle p'_n p^*_m p'_m} - \|p'_n - p^*_m \|^2 \right) \nonumber \\ &- \left(\|p^*_n - p'_m\|^2 - \|p^*_n - p'_m \|^2 - \epsilon_m^2 - 2\epsilon_m \|p^*_n - p'_m\| \cos{\measuredangle p^*_n p'_m \tilde{p}_m} \right) \big] \label{delta_3_eq_2} \\ &= \lambda \beta_{n,m} F^*_{n,m}\times\left[2\epsilon_m^2 - 2\epsilon_m\left(\|p'_n - p^*_m \| \cos{\measuredangle p'_n p^*_m p'_m} - \|p^*_n - p'_m\| \cos{\measuredangle p^*_n p'_m \tilde{p}_m} \right) \right] \label{delta_3_eq_3} \\ &= \lambda \beta_{n,m} F^*_{n,m}\times\left[2\epsilon_m^2 - 2\epsilon_m \left(\epsilon_m - \epsilon_n \cos{\theta} \right) \right] \label{delta_3_eq_4} \\ &= \lambda \beta_{n,m} F^*_{n,m}\times\left[2\frac{\zeta_m}{\zeta_n}\epsilon_m^2 \cos{\theta} \right], \label{delta_3_eq_5} \end{align} where $s$ and $\theta = \measuredangle z^*_n s z^*_m$ are the intersection point and the angle between the lines $\overline{z^*_n\tilde{p}_n}$ and $\overline{z^*_m\tilde{p}_m}$, respectively. Note that in Eq. (\ref{delta_3}), without any loss of generality, we have assumed that the direction of the flow of data, if any, is from Node $n$ to Node $m$. Moreover, Eq. (\ref{delta_3_eq_2}) follows from the law of cosines and Eq. (\ref{delta_3_eq_5}) follows from the equation $\zeta_n\epsilon_n = \zeta_m\epsilon_m$. Hence, we have: \begin{align}\label{d_deltas} &\mathcal{D}\left(\mathbf{P}',\mathbf{W}',\mathbf{S}'\right) - \mathcal{D}\left(\mathbf{P}^*,\mathbf{W}^*,\mathbf{S}^*\right) = \Delta_1 + \Delta_2 + \Delta_3 \\ &= \left[\frac{\zeta_m^2}{\zeta_n^2}\epsilon_m^2 - 2\frac{\zeta_m}{\zeta_n}\epsilon_m \|p^*_n - z^*_n \| \right]\times \psi^*_n + \left[\epsilon_m^2 + 2\epsilon_m \|p^*_m - z^*_m \| \right] \times \psi^*_m + 2\lambda\beta_{n,m}F^*_{n,m}\frac{\zeta_m}{\zeta_n}\epsilon_m^2 \cos{\theta}. \nonumber \end{align} Due to the optimality of $\mathbf{P}^*$, $\mathbf{W}^*$ and $\mathbf{S}^*$, Eq. (\ref{d_deltas}) should be non-negative, or equivalently: \begin{equation}\label{epsilon_very_small} \epsilon_m \left(\frac{\zeta_m^2}{\zeta_n^2}\psi^*_n + \psi^*_m + 2\lambda\beta_{n,m}F^*_{n,m}\frac{\zeta_m}{\zeta_n}\cos{\theta} \right) \geq 2\left(\frac{\zeta_m}{\zeta_n}\psi^*_n \|p^*_n - z^*_n\| - \psi^*_m \|p^*_m - z^*_m \| \right). \end{equation} According to Eq. (\ref{psi}), the term $\lambda\beta_{n,m}F^*_{n,m}$ is included in both $\psi^*_n$ and $\psi^*_m$, i.e. $\psi^*_n \geq \lambda\beta_{n,m}F^*_{n,m}$ and $\psi^*_m \geq \lambda\beta_{n,m}F^*_{n,m}$; therefore, we have: \begin{align}\label{always_positive} \frac{\zeta_m^2}{\zeta_n^2}\psi^*_n + \psi^*_m + 2\lambda\beta_{n,m}F^*_{n,m}\frac{\zeta_m}{\zeta_n}\cos{\theta} &\geq \frac{\zeta_m^2}{\zeta_n^2}\lambda\beta_{n,m}F^*_{n,m} + \lambda\beta_{n,m}F^*_{n,m} + 2\lambda\beta_{n,m}F^*_{n,m}\frac{\zeta_m}{\zeta_n}\cos{\theta} \\&\geq \lambda\beta_{n,m}F^*_{n,m} \left(\frac{\zeta_m}{\zeta_n} - 1 \right)^2 \geq 0, \end{align} thus, the term inside the parentheses on the left hand side of Eq. (\ref{epsilon_very_small}) is always non-negative. Note that if the right hand side of Eq. (\ref{epsilon_very_small}) is strictly positive, then we can choose a small enough $\epsilon_m$ such that the inequality in Eq. (\ref{epsilon_very_small}) is contradicted. Hence, we have: \begin{equation}\label{first_inequality} \zeta_m\psi^*_n \|p^*_n - z^*_n\| \leq \zeta_n \psi^*_m \|p^*_m - z^*_m \|. \end{equation} By swapping the indices $m$ and $n$ in Eq. (\ref{proof-eq1}) and repeating the same argument, we have: \begin{equation}\label{second_inequality} \zeta_m\psi^*_n \|p^*_n - z^*_n\| \geq \zeta_n \psi^*_m \|p^*_m - z^*_m \|. \end{equation} Eqs. (\ref{first_inequality}) and (\ref{second_inequality}) imply that: \begin{equation}\label{third_equality} \zeta_m\psi^*_n \|p^*_n - z^*_n\| = \zeta_n \psi^*_m \|p^*_m - z^*_m \|. \end{equation} Note that Eq. (\ref{proof-eq1}) indicates that Eq. (\ref{first_inequality}) holds for any $n$ but only for a dynamic index $m\in\mathcal{I}_d$, and similarly Eq. (\ref{second_inequality}) holds for any $m$ but only for a dynamic index $n\in\mathcal{I}_d$. Hence, Eqs. (\ref{first_inequality}) and (\ref{third_equality}) imply that $\chi^*_m \geq \chi^*_n$ if $n\in\mathcal{I}_s, m\in\mathcal{I}_d$ and $\chi^*_m = \chi^*_n$ if $n,m\in\mathcal{I}_d$, and Eq. (\ref{necessary-condition-total-move-constraint-eq}) is proved. Now, by using Eq. (\ref{third_equality}) and the equality $E\left(\mathbf{P}^*\right)=\gamma$, we can write: \begin{align}\label{solve_for_unknown} \sum_{i\in\mathcal{I}_d}\zeta_i \|\Gamma^*_i\| - \gamma &= \sum_{i\in\mathcal{I}_d}\zeta_i \|p^*_i - z^*_i\| = \sum_{i\in\mathcal{I}_d}\frac{\zeta_i^2\psi^*_n}{\zeta_n\psi^*_i} \|p^*_n - z^*_n\| = \frac{\psi^*_n}{\zeta_n}\|p^*_n - z^*_n\| \sum_{i\in\mathcal{I}_d}\frac{\zeta_i^2}{\psi^*_i}, \end{align} or equivalently: \begin{equation}\label{solved_unknown} \|p^*_n - z^*_n\| = \frac{\sum_{i\in\mathcal{I}_d}\zeta_i\|\Gamma^*_i\| - \gamma}{\frac{\psi^*_n}{\zeta_n}\sum_{i\in\mathcal{I}_d}\frac{\zeta_i^2}{\psi^*_i}}. \end{equation} Hence, we have: \begin{equation}\label{final_formula} p^*_n = \tilde{p}_n + \frac{\Gamma^*_n}{\|\Gamma^*_n\|}\left(\|\Gamma^*_n\| - \|p^*_n - z^*_n\| \right) = \tilde{p}_n + \Gamma^*_n\left(1 - \frac{\sum_{i\in\mathcal{I}_d}\zeta_i\|\Gamma^*_i\| - \gamma}{\|\Gamma^*_n\|\times \frac{\psi^*_n}{\zeta_n}\times\sum_{i\in\mathcal{I}_d}\frac{\zeta_i^2}{\psi^*_i}} \right), \end{equation} and the proof is complete. $\hfill\blacksquare$ \section{}\label{proof-MERL-convergence} Proof of Proposition \ref{MERL-convergence}: We show that none of the steps in MERL Algorithm increases the multi-hop communication power $\mathcal{D}\left(\mathbf{P},\mathbf{W},\mathbf{S}\right)$. Since the movement energy constraint in Eq. (\ref{movement-constraint}) does not depend on the cell partitioning and normalized flow matrix, same reasoning as in Appendix \ref{proof-RL-convergence} shows that updating $\mathbf{W}$ and $\mathbf{S}$ according to the generalized Voronoi diagram and Bellman-Ford Algorithm, respectively, does not increase $\mathcal{D}\left(\mathbf{P},\mathbf{W},\mathbf{S}\right)$. In what follows, we show that updating the node deployment according to steps 4 and 5 in Algorithm \ref{MERL} will not increase the objective function as well. To show this, we first need the following concepts: Let $\mathbf{P}^k = \left(p_1^k, \cdots ,p_N^k, p_{N+1}^k, \cdots, p_{N+M}^k \right)$ denote the node deployment after the $k$-th iteration. In particular, $\mathbf{P}^0 = \tilde{\mathbf{P}}$ is the initial deployment. We define the energy allocation after the $k$-th iteration as $\mathbf{E}^k = \left(e_1^k, \cdots, e_N^k, e_{N+1}^k, \cdots, e_{N+M}^k \right)$ where $e_n^k = \zeta_n \|p_n^k - \tilde{p}_n \|$ is node $n$'s movement energy consumption. Note that after the cell partitioning using the generalized Voronoi diagram, the partitions are fixed as $\mathcal{V}\left(\mathbf{P}^{k-1}, \mathbf{S}^{k-1} \right)$. Moreover, let $v_n^k$ and $c_n^k$ denote the volume and centroid of $\mathcal{V}_n\left(\mathbf{P}^{k}, \mathbf{S}^{k} \right)$, respectively, and define $\Gamma_n^k = z_n^k - \tilde{p}_n$ where $z_n^k$ is expressed as in Eqs. (\ref{z1-AP}) and (\ref{z1-FC}). We denote the energy consumed by moving node $n$ from its initial location to $z^k_n$ by $\tau_n^k = \zeta_n \|\Gamma_n^k \|$, and define $\kappa_n^k = \kappa_n\left(\mathbf{P}^k, \mathbf{S}^k \right) = \frac{\zeta_n^2}{\psi_n^k}$ where $\psi_n^k$ is given by Eq. (\ref{psi}). Finally, we define an auxiliary function $\hat{\chi}_n^k: \mathbb{R}^{N+M}\longrightarrow \mathbb{R}$ to be $\hat{\chi}_n^k\left(\mathbf{E} \right) = \frac{\tau_n^k - e_n}{\kappa_n^k}$. Note that $\hat{\chi}_n^k$ differs from $\chi_n$ defined in Eq. (\ref{chi}) in the sense that it depends on the energy allocation $\mathbf{E}$ rather than the node deployment and data routing. \begin{lemma}\label{aux_lemma_1} Let $\mathcal{I}_d^k$ and $\mathcal{I}_s^k$ denote the set of dynamic and static nodes after the $k$-th iteration of the MERL algorithm, respectively. Then, we have: \begin{align}\label{aux_lemma_1_eq} \hat{\chi}_i^{k-1}\left(\mathbf{E}^k \right) &= \hat{\chi}_j^{k-1}\left(\mathbf{E}^k \right), \qquad\qquad \forall i,j\in \mathcal{I}_d^k \\ \hat{\chi}_i^{k-1}\left(\mathbf{E}^k \right) &\geq \hat{\chi}_j^{k-1}\left(\mathbf{E}^k \right), \qquad\qquad \forall i\in \mathcal{I}_d^k, j\in \mathcal{I}_s^k \label{aux_lemma_1_eq_1} \end{align} Proof: At the end of the deployment step, dynamic node $n$'s location in the $k$-th iteration is: \begin{equation}\label{app_G_eq1} p_n^k = \tilde{p}_n + \Gamma^{k-1}_n\left(1 - \frac{\sum_{i\in\mathcal{I}^k_d}\zeta_i\|\Gamma^{k-1}_i\| - \gamma}{\|\Gamma^{k-1}_n\|\times \frac{\psi^{k-1}_n}{\zeta_n}\times\sum_{i\in\mathcal{I}^k_d}\frac{\zeta_i^2}{\psi^{k-1}_i}} \right), \end{equation} thus, its movement energy consumption is: \begin{align}\label{app_G_eq2} e_n^k &= \zeta_n \|p_n^k - \tilde{p}_n \| = \zeta_n \|\Gamma_n^{k-1}\| \times \left |\!\left|1 - \frac{\sum_{i\in\mathcal{I}^k_d}\zeta_i\|\Gamma^{k-1}_i\| - \gamma}{\|\Gamma^{k-1}_n\|\times \frac{\psi^{k-1}_n}{\zeta_n}\times\sum_{i\in\mathcal{I}^k_d}\frac{\zeta_i^2}{\psi^{k-1}_i}} \right |\! \right| \\ &= \left |\! \left | \tau_n^{k-1} - \frac{\kappa_n^{k-1}\left(\sum_{i\in\mathcal{I}_d^k}\tau_i^{k-1} - \gamma \right)}{\sum_{i\in\mathcal{I}_d^k}\kappa_i^{k-1}} \right |\! \right |, \qquad\qquad\qquad\qquad \forall n \in \mathcal{I}_d^k \label{app_G_eq2_1} \end{align} where $\mathcal{I}_d^k$ is the set of dynamic nodes in the $k$-th iteration, determined by the inner loop in steps 3 and 4 of the MERL algorithm. According to this inner loop, the term inside the vertical bars in Eq. (\ref{app_G_eq2_1}) is positive; hence, we have: \begin{equation}\label{app_G_eq3} e_n^k = \tau_n^{k-1} - \frac{\kappa_n^{k-1}\left(\sum_{i\in\mathcal{I}_d^k}\tau_i^{k-1} - \gamma \right)}{\sum_{i\in\mathcal{I}_d^k}\kappa_i^{k-1}} , \qquad\qquad \forall n \in \mathcal{I}_d^k. \end{equation} Now, by substituting Eq. (\ref{app_G_eq3}) into the definition of $\hat{\chi}_n^k$, we have: \begin{equation}\label{app_G_eq4} \hat{\chi}_n^{k-1}\left(\mathbf{E}^k\right) = \frac{\tau_n^{k-1} - e_n^k}{\kappa_n^{k-1}} = \frac{\left[\sum_{i\in\mathcal{I}_d^k}\tau_i^{k-1} \right] - \gamma}{\sum_{i\in\mathcal{I}_d^k}\kappa_i^{k-1}}, \qquad\qquad \forall n\in\mathcal{I}_d^k. \end{equation} Therefore, all $\hat{\chi}_n^{k-1}\left(\mathbf{E}^k\right)$ for dynamic nodes are the same and Eq. (\ref{aux_lemma_1_eq}) is proved. In order to prove Eq. (\ref{aux_lemma_1_eq_1}), we assume that $L_k$ inner iterations are performed in steps 3 and 4 of the MERL algorithm to determine the dynamic node set in the $k$-th iteration of the algorithm. For $l\in\{1, \cdots, L_k\}$, let $\mathcal{J}_l^k$ be the dynamic node set after the $l$-th inner iteration, where $k$ is the iteration index of the MERL algorithm. In particular, we have $\mathcal{J}_0^k = \mathcal{I_A}\bigcup\mathcal{I_F}$ and: \begin{equation}\label{app_G_eq5} \mathcal{I}_d^k = \mathcal{J}_{L_k}^k \subsetneq \mathcal{J}_{L_k-1}^k \subsetneq \cdots \subsetneq \mathcal{J}_0^k \end{equation} In other words, in the $l$-th inner iteration, nodes within the set $\mathcal{J}_{l-1}^k - \mathcal{J}_{l}^k$ are removed from $\mathcal{J}_{l-1}^k$ due to their non-positive energy allocation, i.e., we have: \begin{equation}\label{app_G_eq6} e_j^k = \tau_j^{k-1} - \frac{\kappa_j^{k-1}\left(\sum_{i\in\mathcal{J}_{l-1}^k}\tau_i^{k-1} - \gamma \right)}{\sum_{i\in\mathcal{J}_{l-1}^k}\kappa_i^{k-1}} \leq 0 , \qquad\qquad \forall j \in \mathcal{J}_{l-1}^k - \mathcal{J}_{l}^k \end{equation} hence, by rearranging the terms in Eq. (\ref{app_G_eq6}), and summation over all $j \in \mathcal{J}_{l-1}^k - \mathcal{J}_{l}^k$, we have: \begin{equation}\label{app_G_eq7} \left(\sum_{j\in \mathcal{J}_{l-1}^k - \mathcal{J}_{l}^k} \tau_j^{k-1}\right) \left(\sum_{i\in\mathcal{J}_{l-1}^k}\kappa_i^{k-1} \right) \leq \left(\sum_{j\in \mathcal{J}_{l-1}^k - \mathcal{J}_{l}^k} \kappa_j^{k-1} \right) \left(\sum_{i\in\mathcal{J}_{l-1}^k}\tau_i^{k-1} - \gamma \right). \end{equation} Let the auxiliary function $\tilde{\chi}^k\left(\mathcal{J}\right) = \frac{\left(\sum_{i\in\mathcal{J}}\tau_i^k\right) - \gamma}{\sum_{i\in\mathcal{J}}\kappa_i^k}$ be a mapping from the node set $\mathcal{J}$ to the real numbers. For an inner iteration index $l\in\{1,\cdots,L_k\}$, we have: \begin{align}\label{app_G_eq8} &\tilde{\chi}^{k-1}\left(\mathcal{J}_l^k \right) - \tilde{\chi}^{k-1}\left(\mathcal{J}_{l-1}^k \right) \\&= \frac{\left(\sum_{i\in\mathcal{J}_l^k}\tau_i^{k-1}\right) - \gamma}{\sum_{i\in\mathcal{J}_l^k}\kappa_i^{k-1}} - \frac{\left(\sum_{i\in\mathcal{J}_{l-1}^k}\tau_i^{k-1}\right) - \gamma}{\sum_{i\in\mathcal{J}_{l-1}^k}\kappa_i^{k-1}}\\ &= \frac{\left(\sum_{i\in\mathcal{J}_{l-1}^k}\kappa_i^{k-1}\right)\left[\left(\sum_{i\in\mathcal{J}_l^k}\tau_i^{k-1}\right) - \gamma\right] -\left(\sum_{i\in\mathcal{J}_l^k}\kappa_i^{k-1}\right)\left[\left(\sum_{i\in\mathcal{J}_{l-1}^k}\tau_i^{k-1}\right) - \gamma \right] }{\left(\sum_{i\in\mathcal{J}_l^k}\kappa_i^{k-1}\right)\left (\sum_{i\in\mathcal{J}_{l-1}^k}\kappa_i^{k-1}\right)} \\&= \frac{\left(\sum_{i\in\mathcal{J}_{l-1}^k}\kappa_i^{k-1}\right) \left[\left(\sum_{i\in\mathcal{J}_{l-1}^k}\tau_i^{k-1}\right) - \left(\sum_{i\in\mathcal{J}_{l-1}^k-\mathcal{J}_l^k}\tau_i^{k-1}\right) - \gamma\right]}{\left(\sum_{i\in\mathcal{J}_l^k}\kappa_i^{k-1}\right)\left (\sum_{i\in\mathcal{J}_{l-1}^k}\kappa_i^{k-1}\right)} \\ &- \frac{\left[\left(\sum_{i\in\mathcal{J}_{l-1}^k}\kappa_i^{k-1}\right) - \left(\sum_{i\in\mathcal{J}_{l-1}^k-\mathcal{J}_l^k}\kappa_i^{k-1}\right) \right]\left[\left(\sum_{i\in\mathcal{J}_{l-1}^k}\tau_i^{k-1}\right) - \gamma \right]}{\left(\sum_{i\in\mathcal{J}_l^k}\kappa_i^{k-1}\right)\left (\sum_{i\in\mathcal{J}_{l-1}^k}\kappa_i^{k-1}\right)} \\ &= \frac{\left(\sum\limits_{i\in\mathcal{J}_{l-1}^k - \mathcal{J}_{l}^k}\kappa_i^{k-1}\right)\left[\left(\sum\limits_{i\in\mathcal{J}_{l-1}^k}\tau_i^{k-1}\right) - \gamma\right] - \left(\sum\limits_{i\in\mathcal{J}_{l-1}^k- \mathcal{J}_{l}^k}\tau_i^{k-1}\right)\left(\sum\limits_{i\in\mathcal{J}_{l-1}^k}\kappa_i^{k-1}\right) }{\left(\sum_{i\in\mathcal{J}_l^k}\kappa_i^{k-1}\right)\left (\sum_{i\in\mathcal{J}_{l-1}^k}\kappa_i^{k-1}\right)} \geq 0, \end{align} where the last inequality follows from Eq. (\ref{app_G_eq7}). Thus, we have the following ordered sequence: \begin{equation}\label{app_G_eq9} \tilde{\chi}^{k-1}\left(\mathcal{J}_{0}^k \right) \leq \tilde{\chi}^{k-1}\left(\mathcal{J}_{1}^k \right) \leq \cdots \leq \tilde{\chi}^{k-1}\left(\mathcal{J}_{L_k}^k \right) = \tilde{\chi}^{k-1}\left(\mathcal{I}_{d}^k \right) = \hat{\chi}_n^{k-1}\left(\mathbf{E}^k \right),\qquad \forall n\in \mathcal{I}_d^k. \end{equation} Let the tentative energy allocation in the $l$-th inner iteration be $\tilde{\mathbf{E}}^k(l) = \left(\tilde{e}_1^k(l), \cdots, \tilde{e}_{N+M}^k(l) \right)$. The tentative movement energy consumption of node $n$ in the $l$-th inner iteration is given by: \begin{align}\label{app_G_eq10} \tilde{e}_n^k(l) = \tau_n^{k-1} - \frac{\kappa_n^{k-1}\left[\left(\sum_{i\in\mathcal{J}_l^k}\tau_i^{k-1}\right) - \gamma\right]}{\sum_{i\in\mathcal{J}_l^k}\kappa_i^{k-1}}, \qquad\qquad \forall n \in \mathcal{J}_l^k \end{align} hence, we can rewrite $\tilde{\chi}^{k-1}\left(\mathcal{J}_l^k \right)$ as: \begin{equation}\label{app_G_eq11} \tilde{\chi}^{k-1}\left(\mathcal{J}_l^k \right) = \frac{\left[\left(\sum_{i\in\mathcal{J}_l^k}\tau_i^{k-1}\right) - \gamma\right]}{\sum_{i\in\mathcal{J}_l^k}\kappa_i^{k-1}} = \frac{\tau_n^{k-1} - \tilde{e}_n^k(l)}{\kappa_n^{k-1}}, \qquad\qquad \forall n \in \mathcal{J}_l^k. \end{equation} Note that each node $j\in \mathcal{J}_{l-1}^k - \mathcal{J}_l^k$ is removed from the dynamic node set in the $l$-th inner iteration of the MERL algorithm due to its non-positive tentative energy $\tilde{e}_j^k(l) \leq 0$; therefore, we have $j\in\mathcal{I}_s^k$ and its allocated movement energy consumption is $e_j^k = 0$. Then, we have: \begin{equation}\label{app_G_eq12} \hat{\chi}_j^{k-1}\left(\mathbf{E}^k\right) = \frac{\tau_j^{k-1} - e_j^k}{\kappa_j^{k-1}} = \frac{\tau_j^{k-1}}{\kappa_j^{k-1}} \leq \frac{\tau_j^{k-1} - \tilde{e}_j^k(l)}{\kappa_j^{k-1}} = \tilde{\chi}^{k-1}\left(\mathcal{J}_l^k\right), \qquad \forall j \in \mathcal{J}_{l-1}^k - \mathcal{J}_l^k. \end{equation} Using Eqs. (\ref{app_G_eq9}) and (\ref{app_G_eq12}), we have: \begin{equation}\label{app_G_eq13} \hat{\chi}_j^{k-1}\left(\mathbf{E}^k\right) \leq \hat{\chi}_i^{k-1}\left(\mathbf{E}^k\right), \qquad\qquad \forall i\in\mathcal{I}_d^k, j\in \mathcal{J}_{l-1}^k - \mathcal{J}_l^k, l\in\{1, \cdots, L_k\}. \end{equation} Note that the static node set $\mathcal{I}_s^k$ consists of all nodes that are removed in the inner loop, i.e. $\mathcal{I}_s = \bigcup_{l\in\{1,\cdots,L_k\}}\left(\mathcal{J}_{l-1}^k - \mathcal{J}_l^k \right)$; hence, Eq. (\ref{aux_lemma_1_eq_1}) follows from Eq. (\ref{app_G_eq13}) and the proof is finished. \end{lemma} \begin{lemma}\label{aux_lemma_2} For a fixed cell partitioning and normalized flow matrix, the node deployment $\mathbf{P}^k$ given by the $k$-th iteration of MERL Algorithm is the unique minimizer to the objective function in Eqs. (\ref{total-movement-constraint-objective}) and (\ref{movement-constraint}). Proof: Using parallel axis theorem \cite{paul1979kinematics}, the objective function in the $k$-th iteration is: \begin{align}\label{app_g_eq1} \mathcal{D} &= \sum_{i=1}^{N}\int_{\mathcal{V}_i^{k-1}}\eta_i \|c_i^{k-1} - \omega\|^2 R_b f(\omega)d\omega + \sum_{i}^{N}\eta_i R_b v_i^{k-1} \|p_i - c_i^{k-1} \|^2 \nonumber \\& + \lambda \sum_{i=1}^{N}\sum_{j=1}^{N+M} \beta_{i,j} \|p_i - p_j\|^2 F_{i,j}^{k-1} + \lambda \overline{\mathcal{P}}^R_{\mathcal{A}}\left(\mathbf{W}^{k-1}, \mathbf{S}^{k-1} \right). \end{align} For a fixed partitioning and routing, a similar reasoning as in the proof of Lemma \ref{total-movment-constraint-between-initial-and-optimal} shows that node $n$'s optimal location at the end of $k$-th iteration should be placed on the segment connecting its initial location $\tilde{p}_n$ to the point $z_n^{k-1}$ given in Eqs. (\ref{z1-AP}) and (\ref{z1-FC}), i.e., if we denote the node $n$'s movement energy by $e_n$, we have: \begin{align}\label{app_g_eq2} p_n(e_n) = \tilde{p}_n + \frac{e_n}{\zeta_n} \times \frac{\Gamma_n^{k-1}}{\|\Gamma_n^{k-1}\|}, \qquad\qquad \forall n\in\mathcal{I_A}\bigcup\mathcal{I_F}. \end{align} By substituting the Eq. (\ref{app_g_eq2}) into Eq. (\ref{app_g_eq1}), we can rewrite the objective function as: \begin{align}\label{app_g_eq3} &\qquad\qquad\qquad\qquad\qquad \minimize_{\mathbf{E}}\mathcal{D}(\mathbf{E}) \nonumber \\ &\qquad \textrm{s.t.}\qquad \left(\sum_{n=1}^{N+M}e_n \right) \leq \gamma, \qquad 0\leq e_n \leq \zeta_n\|\Gamma_n^{k-1}\|,\quad \forall n\in \mathcal{I_A}\bigcup\mathcal{I_F}. \end{align} where: \begin{align}\label{app_g_eq4} &\mathcal{D}(\mathbf{E}) = \sum_{i=1}^{N}\int_{\mathcal{V}_i^{k-1}}\eta_i \|c_i^{k-1} - \omega\|^2 R_b f(\omega)d\omega + \sum_{i}^{N}\eta_i R_b v_i^{k-1} \bigg|\! \bigg|\tilde{p}_i + \frac{e_i}{\zeta_i} \times \frac{\Gamma_i^{k-1}}{\|\Gamma_i^{k-1}\|} - c_i^{k-1} \bigg |\! \bigg |^2 \nonumber \\& + \lambda \sum_{i=1}^{N}\sum_{j=1}^{N+M} \beta_{i,j} \bigg|\! \bigg|\tilde{p}_i + \frac{e_i}{\zeta_i} \times \frac{\Gamma_i^{k-1}}{\|\Gamma_i^{k-1}\|} - \tilde{p}_j - \frac{e_j}{\zeta_j} \times \frac{\Gamma_j^{k-1}}{\|\Gamma_j^{k-1}\|}\bigg|\!\bigg|^2 F_{i,j}^{k-1} + \lambda \overline{\mathcal{P}}^R_{\mathcal{A}}\left(\mathbf{W}^{k-1}, \mathbf{S}^{k-1} \right), \end{align} Note that the objective function in Eq. (\ref{app_g_eq3}) and its constraints are convex; hence, it has a unique minimizer for a fixed partitioning and routing. If $\left(\sum_{n=1}^{N+M}\zeta_n\| \Gamma_n^{k-1}\| \right) \leq \gamma$, then the MERL algorithm moves each node $n$ to $z_n^{k-1}$ without violating the total energy constraint, indicating an optimal deployment. On the other hand, if $\left(\sum_{n=1}^{N+M}\zeta_n\| \Gamma_n^{k-1}\| \right) > \gamma$, then nodes will run out of movement energy before they can reach to their corresponding $z_n^{k-1}$, and the same reasoning as in Appendix \ref{proof-necessary-condition-total-constraint} shows that $\left(\sum_{n=1}^{N+M}e_n \right) = \gamma$. For the fixed partitioning and routing, let $\mathbf{E}^* = \left(e_1^*, \cdots, e_{N+M}^* \right)$ be the optimal energy allocation for the constrained objective function in Eq. (\ref{app_g_eq3}), and let $\mathbf{P}^* = \left(p_1^*, \cdots, p_{N+M}^* \right)$ be the corresponding optimal deployment. Assume that the movement energy allocation $\mathbf{E}^k$ in the $k$-th iteration is different from the optimal one, i.e., $\mathbf{E}^* \neq \mathbf{E}^k$. Since $\left(\sum_{n=1}^{N+M}e^*_n \right) = \left(\sum_{n=1}^{N+M}e^k_n \right) = \gamma$, there exist two distinct indices $i$ and $j$ such that $ 0 \leq e_i^k < e^*_i$ and $0 \leq e_j^* < e_j^k$. Note that $e_j^k > 0$ indicates that $j\in\mathcal{I}_d^k$, i.e., node $j$ is a dynamic node in the $k$-th iteration. Therefore, using Lemma \ref{aux_lemma_1} we have: \begin{align}\label{app_g_eq5} \frac{\zeta_i \|\Gamma_i^{k-1}\| - e_i^*}{\frac{\zeta_i^2}{\psi_i^{k-1}}} < \frac{\zeta_i \|\Gamma_i^{k-1}\| - e_i^k}{\frac{\zeta_i^2}{\psi_i^{k-1}}} \leq \frac{\zeta_j \|\Gamma_j^{k-1}\| - e_j^k}{\frac{\zeta_j^2}{\psi_j^{k-1}}} < \frac{\zeta_j \|\Gamma_j^{k-1}\| - e_j^*}{\frac{\zeta_j^2}{\psi_j^{k-1}}}. \end{align} Now, we consider a new energy allocation $\overline{\mathbf{E}} = \left(\overline{e}_1, \cdots, \overline{e}_{N+M} \right)$, where $\overline{e}_i = e_i^* - \epsilon$, $\overline{e}_j = e_j^* + \epsilon$ and $\overline{e}_t = e_t^*$ for all $t\in\mathcal{I_A}\bigcup\mathcal{I_F}\backslash \{i, j\}$. Note that $\left(\sum_{n=1}^{N+M}\overline{e}_n\right) = \gamma$, and for a sufficiently small positive value of $\epsilon$, we have $0 \leq e_i^* - \epsilon = \overline{e}_i < e_i^*\leq \zeta_i\|\Gamma_i^{k-1}\|$ and $0\leq e_j^* < \overline{e}_j = e_j^* + \epsilon \leq e_j^k \leq \zeta_j \|\Gamma_j^{k-1}\|$, i.e., $\overline{\mathbf{E}}$ satisfies the constraints in Eq. (\ref{app_g_eq3}) and it is a valid energy allocation. Similar argument as in Appendix \ref{proof-necessary-condition-total-constraint}, that led to the Eq. (\ref{first_inequality}), shows that in order for the energy allocation $\overline{\mathbf{E}}$ not to achieve a lower objective function value in Eq. (\ref{app_g_eq3}) than $\mathcal{D}\left(\mathbf{E}^*\right)$, which contradicts the optimality of the movement energy allocation $\mathbf{E}^*$, we should have: \begin{equation}\label{app_g_eq6} \zeta_i \psi_j^{k-1}\|p_j^* - z_j^{k-1} \| \leq \zeta_j \psi_i^{k-1} \|p_i^* - z_i^{k-1} \|, \end{equation} or equivalently: \begin{equation}\label{app_g_eq7} \frac{\zeta_j \|p_j^* - z_j^{k-1} \|}{\frac{\zeta_j^2}{\psi_j^{k-1}}} \leq \frac{\zeta_i \|p_i^* - z_i^{k-1} \|}{\frac{\zeta_i^2}{\psi_i^{k-1}}}. \end{equation} According to Eq. (\ref{app_g_eq2}), each node $n\in\mathcal{I_A}\bigcup\mathcal{I_F}$ is located on the segment connecting $\tilde{p}_n$ to $z_n^{k-1}$; hence: we can rewrite the Eq. (\ref{app_g_eq7}) as: \begin{equation}\label{app_g_eq8} \frac{\zeta_j \|\Gamma_j^{k-1} \| - e_j^*}{\frac{\zeta_j^2}{\psi_j^{k-1}}} \leq \frac{\zeta_i \|\Gamma_i^{k-1} \| - e_i^*}{\frac{\zeta_i^2}{\psi_i^{k-1}}}. \end{equation} But Eq. (\ref{app_g_eq8}) is in contradiction with Eq. (\ref{app_g_eq5}); thus, the assumption $\mathbf{E}^* \neq \mathbf{E}^k$ is wrong and we have $\mathbf{E}^* = \mathbf{E}^k$, i.e. the deployment given by the MERL algorithm is the unique minimizer of the constrained objective function and the proof is complete. \end{lemma} Now, we have enough materials to prove the convergence of the MERL algorithm. As mentioned in the beginning of the Appendix \ref{proof-MERL-convergence}, updating the partitioning and normalized flow matrix using the generalized Voronoi diagram and Bellman-Ford Algorithm, respectively, does not increase the objective function. Now, for a fixed partitioning and routing, Lemma \ref{aux_lemma_2} indicates that the deployment given by the MERL algorithm is the unique minimizer of the constrained objective function, i.e., the deployment step in the MERL algorithm does not increase the objective function either. Hence, the MERL algorithm generates a sequence of positive non-increasing values for the objective function $\mathcal{D}$; thus, it converges. $\hfill\blacksquare$ \section{}\label{proof-necessary-condition-network-lifetime} Proof of Proposition \ref{necessary-condition-network-lifetime}: If $p^*_n = z^*_n$ is an optimal deployment $\mathbf{P}^*$, $\mathbf{W}^*$ and $\mathbf{S}^*$, then Eq. (\ref{lifetime-constraint}) implies that $E_n\left(\mathbf{P}^*\right) = \zeta_n \|\Gamma^*_n\| \leq \gamma_n$. Therefore, Eq. (\ref{necessary-condition-network-lifetime-eq}) reduces to the trivial statement $p^*_n = \tilde{p}_n + \Gamma^*_n$ and the proof is complete. Hence, we assume that $p^*_n \neq z^*_n$. Now, if any residual movement energy is left in Node $n$, i.e. if $E_n\left(\mathbf{P}^*\right) < \gamma_n$, then there exists an $\epsilon_n\in\mathbb{R}^+$ such that $E_n\left(\mathbf{P}^*\right) + \epsilon_n < \gamma_n$ and the point $\overline{p}_n = p^*_n + \epsilon_n \times \frac{z^*_n - p^*_n}{\|z^*_n - p^*_n\|}$ lies inside the circle centered at $z^*_n$ with radius $\|z^*_n - p^*_n\|$. Then, according to Lemma \ref{geometric-locus-weighted-sum-square-distances}, by fixing the cell partitioning, normalized flow matrix and the location of all nodes except Node $n$, and placing Node $n$ at $\overline{p}_n$, we can achieve a lower total multi-hop communication power without exhausting the available movement energy in Node $n$, which contradicts the optimality of $\mathbf{P}^*$, $\mathbf{W}^*$ and $\mathbf{S}^*$. Therefore, $p^*_n\neq z^*_n$ implies that $E_n\left(\mathbf{P}^*\right) = \gamma_n$, that is \begin{equation}\label{appendix-H-eq1} \zeta_n\|p^*_n - \tilde{p}_n \| = \gamma_n. \end{equation} According to Lemma \ref{total-movment-constraint-between-initial-and-optimal}, we have \begin{equation}\label{appendix-H-eq2} p^*_n = \delta_n \tilde{p}_n + \left(1-\delta_n\right)z^*_n, \end{equation} where $\delta_n\in\left[0, 1\right]$, which indicates that \begin{equation}\label{appendix-H-eq3} \|p^*_n - \tilde{p}_n\| = \left(1-\delta_n \right) \|z^*_n - \tilde{p}_n\|. \end{equation} Eqs. (\ref{appendix-H-eq1}) and (\ref{appendix-H-eq3}) imply that $\delta_n = 1 - \frac{\gamma_n}{\zeta_n \|z^*_n - \tilde{p}_n\|}$. Therefore, Eq. (\ref{appendix-H-eq2}) can be written as: \begin{align}\label{appendix-H-eq4} p^*_n &= \left(1 - \frac{\gamma_n}{\zeta_n \|z^*_n - \tilde{p}_n\|}\right)\tilde{p}_n + \left(\frac{\gamma_n}{\zeta_n \|z^*_n - \tilde{p}_n\|}\right) z^*_n \\ &= \tilde{p_n} + \left(\frac{\gamma_n}{\zeta_n \|z^*_n - \tilde{p}_n\|}\right) \left(z^*_n - \tilde{p}_n \right) \\ &= \tilde{p}_n + \frac{\gamma_n}{\zeta_n\|\Gamma^*_n\|}\Gamma^*_n. \label{appendix-H-eq5} \end{align} Eqs. (\ref{appendix-H-eq1}) and (\ref{appendix-H-eq2}) imply that $\gamma_n = \zeta_n \|p^*_n-\tilde{p}_n\| \leq \zeta_n \|z^*_n-\tilde{p}_n\| = \zeta_n\|\Gamma^*_n\|$, i.e. $\frac{\gamma_n}{\zeta_n\|\Gamma^*_n\|} \leq 1$. Thus, Eq. (\ref{appendix-H-eq5}) can be rewritten as $p^*_n = \tilde{p}_n + \min\left(1, \frac{\gamma_n}{\zeta_n\|\Gamma^*_n\|}\right) \Gamma^*_n$ which concludes the proof. $\hfill\blacksquare$ \section{}\label{proof-LORL-convergence} Proof of Proposition \ref{LORL-convergence}: In what follows, we show that none of the three steps in LORL Algorithm will increase the communication power $\mathcal{D}\left(\mathbf{P}, \mathbf{W}, \mathbf{S}\right)$. Note that the movement energy constraint in Eq. (\ref{lifetime-constraint}) does not depend on the cell partitioning and normalized flow matrix. Hence, it can be shown via the same argument as in Appendix \ref{proof-RL-convergence} that updating $\mathbf{W}$ and $\mathbf{S}$ according to the generalized Voronoi diagrams and Bellman-Ford Algorithm, respectively, does not increase $\mathcal{D}\left(\mathbf{P}, \mathbf{W}, \mathbf{S}\right)$. Note that for a fixed $\mathbf{W}$, $\mathbf{S}$ and $\left\{p_i \right\}_{i\neq n}$, according to Lemma \ref{geometric-locus-weighted-sum-square-distances}, the geometric locus of node $n$ for which the objective function $\mathcal{D}\left(\mathbf{P}, \mathbf{W}, \mathbf{S}\right)$ remains the same is a circle $\Phi_n$ centered at $z_n$ with radius $\|z_n - p_n\|$. Note that the update rule in Eq. (\ref{necessary-condition-network-lifetime-eq}) always keeps node $n$ in its \emph{valid region} determined by its limited movement energy, which is a circle centered at $\tilde{p}_n$ and radius $\frac{\gamma_n}{\zeta_n}$. A simple geometric reasoning indicates that by updating the position of node $n$ according to Eq. (\ref{necessary-condition-network-lifetime-eq}), node $n$ will either remain the same or move to the point inside its valid region that is closest to the point $z_n$, i.e., node $n$ will either remain on the circle $\Phi_n$ or move inside it, and the objective function $\mathcal{D}\left(\mathbf{P}, \mathbf{W}, \mathbf{S}\right)$ does not increase. Since the objective function has a lower bounded, i.e. $\mathcal{D}\left(\mathbf{P}, \mathbf{W}, \mathbf{S}\right) \geq 0$, and it is nonincreasing, LORL Algorithm is in iterative improvement algorithm and it converges. $\hfill\blacksquare$ \ifCLASSOPTIONcaptionsoff \newpage \fi \bibliographystyle{ieeetr}
\section{Introduction} Since its launch in 2018, NASA's {\it TESS}{} mission has attempted to detect small transiting planets around bright, nearby stars amenable to confirmation with radial velocity observations \citep{ricker2016transiting}. The {HARPS}{} spectrograph on the 3.6m telescope at La Silla, Chile \citep{2003Msngr.114...20M} has been deeply involved in this follow-up effort, beginning with its first detection, the hot super-Earth Pi Mensae c \citep{huang2018tess}, and continuing with the first multi-planet system \citep[TOI-125][]{quinn2019near,nielsen2020mass}, This unique combination of space-based photometry (which provides planetary radius) and precise radial velocities (which provide planetary mass) also allows for the determination of exoplanet densities, and, therefore, an insight into the internal structure of worlds outside our solar system. These analyses have revealed a diversity of planet structures in the regime between Earth and Neptune, from high-density evaporated giant planet cores like TOI-849b \citep[5.2\,\gcm{}][]{armstrong2020remnant}, to low-density mini-Neptunes such as TOI-421\,c \citep{carleo2020multi}, as well as planets which follow a more linear track from rocky super-earths to Neptunes dominated by gaseous envelopes, such as the two inner planets orbiting $\nu^2$ Lupi \citep{kane2020transits} and TOI-735 \citep{cloutier2020pair,nowak2020carmenes}. The detection of exoplanets with well-constrained physical parameters can also lead to the discovery of statistical trends within the planet population which encode information on planetary formation and evolution. The "valley" seen around $1.8$\,R$_{\oplus}${} in Kepler data \citep{fulton2017california, van2018asteroseismic} is one such feature. According to current theory planets that first formed with gaseous envelopes within this valley have, due to heating from either their stars \citep[e.g. evaporation,][]{owen2017evaporation} or from internal sources \citep[e.g. core-powered mass loss,][]{ginzburg2018core}, lost those initial gaseous envelopes, thereby evolving to significantly smaller radii to become "evaporated cores". By observing the physical parameters of small, hot exoplanets, the exact mechanisms of this process can be revealed. In this paper, we present the detection, confirmation and RV characterisation of two exoplanets orbiting the star HD 110113 --- the hot mini-Neptune HD\,110113\,b{} and the non-transiting HD\,110113\,c{}. The observations from which these planets were detected are described in section \ref{sect:observations}, while the analysis of that data is described in section \ref{sect:analysis}. In section \ref{sect:discus} we discuss the validity of the outer planet RV signal (\ref{sect:planetc}), whether HD\,110113{} is a solar analogue (\ref{sect:solaranal}) the internal structure and evaporation of planet b (\ref{sect:internal} \& \ref{sect:evap}), and potential future observations of the system (\ref{sect:future}). We summarize our conclusions in section~\ref{sec:conclusion}. \section{Observations} \label{sect:observations} \subsection{TESS photometry} HD\,110113{} was observed during {\it TESS}{} sector 10 with 2-minute cadence for 22.5 days, excluding a 2.5 day gap between {\it TESS}{} orbits to downlink data. The lightcurve was extracted using the SPOC \citep[Science Processing Operations Centre;][]{jenkins2016tess} SAP (simple aperture photometry) pipeline. It was then processed using the Pre-Search Data Conditioning \citep[PDC,][]{stumpe2012kepler,2012PASP..124.1000S,stumpe2014multiscale} pipeline, producing precise detrended photometry with typical precision of 150\,ppm/hr for this star, and then searched for exoplanetary candidates with the Transiting Planet Search \citep[TPS;][]{2010SPIE.7740E..0DJ}. This identified a strong candidate with a period of 2.54\,d, a depth of only 410\,ppm{} and a Signal to Noise Ratio (SNR) of 7.6. Automated and human vetting subsequently designated this candidate a planet candidate and it was assigned {\it TESS}{} Object of Interest (TOI) 755.01. We inspected the {\it TESS}{} aperture using \texttt{tpfplotter} \citep[plotted in Figure \ref{fig:tpf};][]{2020A&A...635A.128A} to ensure no nearby contaminant stars could be causing the transit. We found five stars within the aperture with contrast less than 8\,mag, with the brightest with a $\Delta{\rm mag}$ of only 3.5. However, to cause the observed 410\,ppm{} transit, this star would need to host eclipses of at least 1\%. Furthermore, being more than 1.2\,pix, and therefore almost one full-width-half-maximum (FWHM) of the point-spread function (PSF), away from the target star, we would expect to see a significant centroid shift. However, the SPOC data validation modelling \citep{Twicken:DVdiagnostics2018,Li:DVmodelFit2019} shows no such shift and suggests the transit occurs within 0.25 pixels from the target position\footnote{As shown by the SPOC DV report accessed at \url{https://mast.stsci.edu/api/v0.1/Download/file/?uri=mast:TESS/product/tess2019085221934-s0010-s0010-0000000073228647-00212_dvr.pdf}.}. The other stars present are also $>1$ pixel away, and are increasingly fainter ($\Delta{\rm mag}$ of 6.9--7.9), requiring eclipse depths of 25--75\%. Causing the observed transit with such a blend scenario therefore becomes increasingly unlikely given the flat-bottomed transit shape of TOI-755.01. We conclude that a blend scenario from a known contaminant is unlikely, however we pursue additional photometry to confirm. \begin{figure} \centering \includegraphics[width=\columnwidth, trim={0 0.8cm 1.8cm 0.1cm}]{TPF_Gaia_TIC73228647_S10} \caption{TESS photometric aperture plotted with \texttt{tpfplotter} \citep{2020A&A...635A.128A}. The default TESS aperture used by SAP is overplotted in red, and nearby stars down to $\Delta{\rm mag}=8$ from Gaia DR2 \citep{brown2018gaia} are plotted as red circles. The target HD\,110113{} is marked with a white cross.} \label{fig:tpf} \end{figure} \subsection{Ground-based Photometric Follow-up}\label{sect:groundfu} We observed a full transit of TOI-755.01 continuously for 443 minutes in Pan-STARSS $z$-short band on UTC 2020 March 13 from the LCOGT \citep{Brown:2013} 1-m network node at Cerro Tololo Inter-American Observatory. The $4096\times4096$ LCOGT SINISTRO cameras have an image scale of $0\farcs389$ per pixel, resulting in a $26\arcmin\times26\arcmin$ field of view. The images were calibrated by the standard LCOGT {\tt BANZAI} pipeline \citep{McCully:2018}. Photometric data were extracted using {\tt AstroImageJ} \citep{Collins:2017}. The mean stellar PSF in the image sequence had a FWHM of $2\farcs8$. Circular apertures with radius $3\farcs1$ were used to extract the differential photometry. The TOI-755 SPOC pipeline transit depth of 397\,ppm is too shallow to reliably detect with ground-based observations, so we instead checked for possible nearby eclipsing binaries (NEBs) that could be contaminating the irregularly shaped SPOC aperture that generally extends $\sim1\arcmin$ from the target star. To account for possible contamination from the wings of neighboring star PSFs, we searched for NEBs out to $2\farcm5$ from the target star. If fully blended in the SPOC aperture, a neighboring star that is fainter than the target star by 8.54 magnitudes in TESS-band could produce the SPOC-reported flux deficit at mid-transit (assuming a 100\% eclipse). To account for possible delta-magnitude differences between TESS-band and Pan-STARSS $z$-short band, we searched an extra 0.5 magnitudes fainter (down to \textit{TESS}-band magnitude 18.5). The brightness and distance limits resulted in a search for NEBs in 90 Gaia DR2 stars, which includes all stars marked in red in Figure \ref{fig:tpf} and a further 67 contaminants with $\Delta{\rm mag}>8$. We estimated the expected NEB depth in each neighboring star by taking into account both the difference in magnitude relative to TOI-755 and the distance to TOI-755 (to account for the estimated fraction of the star's flux that would be contaminating the TOI-755 SPOC aperture). If the RMS of the 10-minute binned light curve of a neighboring star is more than a factor of 3 smaller than the expected NEB depth, we consider an NEB to be tentatively ruled out in the star over the observing window. We then visually inspect each neighboring star's light curve to ensure no obvious eclipse-like signal. The LCOGT data rule out possible contaminating NEBs at the SPOC pipeline nominal ephemeris and over a -$1.7\sigma$ to +$2.3\sigma$ ephemeris uncertainty window. By process of elimination, we conclude that the transit is indeed occurring in TOI-755, or a star so close to TOI-755 that it was not detected by Gaia DR2, or the event occurred outside our observing window. \subsection{Ground-based Archival Photometry} Although detecting the transits of HD\,110113\,b{} required precise space-based photometry, ground-based photometric surveys have observed HD\,110113{} and can provide constraints on stellar variability, and therefore an independent measure of the stellar rotation period. WASP-South was a wide-field array of 8 cameras forming the Southern station of the WASP transit-search survey \citep{2006PASP..118.1407P}. The field of HD\,110113{} was observed over 150-night spans in each of 2007 and 2008, and then again over 2011 and 2012, acquiring a total of 30\,000 photometric data points. WASP-South was at that time equipped with 200-mm, f/1.8 lenses, observing with a 400--700 nm passband, and with a photometric extraction aperture of 48 arcsecs. There are other stars in the aperture around HD\,110113{}, but the brightest has $\Delta{\rm mag}=3$ while the others have $\Delta{\rm mag}>5$. Therefore any rotation signal is likely from HD\,110113{}. We searched the data for rotational modulations using the methods from \citet{2011PASP..123..547M}. The data from 2011 and 2012 show a modulation at a period of 21\,$\pm$\,2 d (see Figure \ref{fig:wasp}). This is significant at the 1\%\ false-alarm level with an amplitude of 2 mmag, both in each year separately, and when the data from the two years are combined. The data from 2007 and 2008 combined show a significant modulation at twice this period of $\sim42$\,$\pm$\,4 d. There is also power near 21 d in the 2007/2008 periodogram, but it is not significant in its own right. Although it would seem more likely from these data alone that the rotational period of HD\,110113{} is 42\,$\pm$\,4 days, with the $21$\,d period coming from the first harmonic, the WASP data cannot on its own distinguish between these two possible periods. \begin{figure} \centering \includegraphics[width=\columnwidth]{toi755_wasp.pdf} \caption{Periodograms of the WASP-South data for TOI-755. The top panel shows data from 2007 \&\ 2008 combined, with a significant 42-d periodicity. The lower panels show data from 2011 \&\ 2012, separately and combined, which show more strongly a periodicity of 21-d. The dotted horizontal lines are the estimated 1\%-likelihood false-alarm levels.} \label{fig:wasp} \end{figure} \subsection{High-resolution imaging} High-angular-resolution imaging is needed to search for nearby sources that can contaminate the {\it TESS}{} photometry, resulting in an underestimated planetary radius, or that can be the source of astrophysical false positives, such as background eclipsing binaries. Through the TESS Follow-Up Program (TFOP), three such images were obtained across two telescopes, with the results shown in Figure \ref{fig:imaging}. \begin{figure} \centering \includegraphics[width=\columnwidth, trim={0 2cm 0.6cm 1.2cm}]{Imaging} \caption{Contrast curves and images from Gemini/Zorro (blue \& red for 562 and 832nm respectively), and SOAR (green).} \label{fig:imaging} \end{figure} \subsubsection{SOAR} We searched for stellar companions to TOI-755 with speckle imaging on the 4.1-m Southern Astrophysical Research (SOAR) telescope \citep{tokovinin2018ten} on 14 July 2019 UT, observing in Cousins I-band, a similar visible bandpass as {\it TESS}{}. More details of the observation are available in \citet{ziegler2020vizier}. The $5\sigma$ detection sensitivity and speckle auto-correlation functions from the observations are shown in Figure \ref{fig:imaging}. No nearby stars with magnitudes brighter than $I=16$ were detected within 3\arcsec{} of HD\,110113{} in the SOAR observations. \subsubsection{Gemini/Zorro} High-resolution speckle interferometric images of HD\,110113{} were obtained on 14 January 2020 UT using the Zorro instrument mounted on the 8-meter Gemini South telescope located on the summit of Cerro Pachon in Chile. Zorro simultaneously observes in two bands, (832\,nm \& 562\,nm with widths of 40 \& 54\,nm respectively), obtaining diffraction-limited images with inner working angles 0.017 and 0.028 arcsec, respectively. The observation consisted of 3-minute sets of 1000$\times$0.06-second images. All the images were combined and subjected to Fourier analysis, leading to the production of final data products, including speckle reconstructed imagery \citep[see][]{2011AJ....142...19H}. Figure \ref{fig:imaging} shows the $5\sigma$ contrast curves in both filters for the Zorro observation and includes an inset showing the 832 nm reconstructed image. The resulting contrast limits reveal that HD\,110113{} is a single star to contrast limits of 5 to 8 magnitudes, ruling out most main sequence companions to the star within the spatial limits of $\sim$11 to 320\,au (for $d=106.3$pc). \subsection{HARPS High Resolution Spectroscopy} Over the course of two observing seasons in 2018 and 2019, a total of 114 high-resolution spectra were taken with the High Accuracy Radial velocity Planet Searcher \citep[HARPS,][]{Pepe:2002,2003Msngr.114...20M} on the ESO 3.4m telescope at La Silla, Chile. These spectra were taken as part of the \textit{NCORES} program (PI:Armstrong, 1102.C-0249) designed to specifically study the internal structure of hot worlds. We used the high-accuracy mode of HARPS with a $1\arcsec$ science fibre on the star and a second on-sky fibre monitoring the background flux during exposure. The nominal exposure time was 1800 seconds, with a few exceptions of slightly longer or shorter integration, depending on observing conditions and schedule. Spectra and RV information were extracted using the offline HARPS data reduction pipeline hosted at Geneva Observatory. We use a flux template matching a G1 star to correct the continuum-slope in each echelle order. The spectra were cross correlated with a binary G2 mask to derive the cross correlation function (CCF) \citep{1996A&AS..119..373B}, on which we fit a Gaussian function to obtain RVs, FWHM and contrast. Additionally, we compute the bisector-span \citep{2001A&A...379..279Q} of the CCF and spectral indices tracing chromospheric activity \citep{2011A&A...534A..30G,2009A&A...495..959B}. We reach a typical SNR per pixel of 75 (order 60, 631nm) in individual spectra, corresponding to an RV error of 1.41m\,s$^{-1}${}. The HARPS spectra and derived RVs were accessed and downloaded through the DACE portal hosted at the University of Geneva \citep{2015ASPC..495....7B} under the target name HD 110113\footnote{\url{https://dace.unige.ch/radialVelocities/?pattern=HD110113}}. \section{Analysis}\label{sect:analysis} \subsection{Stellar Parameters} \begin{table} \centering \begin{tabular}{lc|lc} \hline \hline Parameter & Value & Parameter & Value \\ \hline \hline TOI ID & TOI-755 & R.A. [$^{\circ}$] & $190.0365636$\,$^{a}$ \\ TIC ID & 73228647 $^{b}$ & R.A. [hms] & 12:40:08.78 $^{a}$ \\ HD & HD\,110113 & Dec. [$^{\circ}$] & $-44.3120777$\,$^{a}$\\ HIP & HIP 61820 & Dec. [dms] & -44:18:43.48 $^{a}$ \\ Gaia ID & {\scriptsize 6133384959942131968 $^{a}$} & $\delta{\rm RA}$ [mas\,${\rm yr}^{-1}$] & $-3.72 \pm 0.1$\,$^{a}$ \\ $\pi{} [{\rm mas}]$ & $9.38 \pm 0.036$\,$^{a}$ & $\delta{\rm DEC}$ [mas\,${\rm yr}^{-1}$] & $-13.68 \pm 0.12$\,$^{a}$ \\ $d$ [pc] & $ 106.3\pm0.72$\,$^{e}$ & $R_s$ [\mbox{$R_{\odot}$}{}] & $ 0.968 \pm 0.018 $ {}$^{e}$ \\ B & $10.71\pm0.032$\,$^{c}$ & $M_s$ [\mbox{$M_{\odot}$}{}] & $ 0.997 \pm 0.06 $ {}$^{e}$ \\ V & $10.063\pm0.027$\,$^{c}$ & $\log g${} & $ 4.46 \pm 0.05 $ {}$^{e}$ \\ Gaia $G$ & $9.91\pm0.0004$\,$^{a}$ & $T_{\rm eff}${} [K] & $ 5732 \pm 50 $ {}$^{e}$ \\ TESS mag & $9.4628\pm0.006$\,$^{b}$ & \mbox{$\rm [Fe/H]$}{} & $ 0.14 \pm 0.02 $ {}$^{e}$ \\ J & $8.903 \pm 0.037$\,$^{c}$ & $v\sin{i}${} [km\,s$^{-1}${}]& $1.74\pm0.15$\,$^{e}$\\ H & $8.594 \pm 0.063$\,$^{c}$ & $P_{\rm rot}$ [d] & $ 20.8 \pm 1.2 $ {}$^{f}$\\ K & $8.502 \pm0.024$\,$^{c}$ & Age $[{\rm Gyr}]$ & 4.0\,$\pm$\,0.5 Gyr{} $^{g}$ \\ \hline \hline \end{tabular} \caption{Stellar parameters. $^{a}$\,From Gaia DR2\citep{brown2018gaia}. $^{b}$\,From the {\it TESS}{} Input Catalogue v8 \citep{stassun2019revised}. $^{c}$\,Johnson magnitudes from APASS \citep{apass}. $^{d}$\,From 2MASS \citep{skrutskie2006two}. $^{e}$\,Derived from {HARPS}{} spectra and archival data - see sect \ref{sect:starpars}. $^{f}$\,Determined using the GP fit to activity indicators and RVs as described in \ref{sect:rvs}. $^{g}$\,Derived from $[\rm{Y}/\rm{Al}]$ abundance-age relation as described in sect \ref{sect:abunds}.} \label{tab:starpars} \end{table} \subsubsection{Global Stellar Parameters}\label{sect:starpars} The star's effective temperature ($T_{\rm eff}${}), surface gravity ($\log g${}), and metallicity (\mbox{$\rm [Fe/H]$}{}) were derived using a recent version of the MOOG code \citep{1973ApJ...184..839S} and a set of plane-parallel ATLAS9 model atmospheres \citep{Kurucz-93}. The analysis was done in LTE. The methodology used is described in detail in \citet{2011A&A...533A.141S} and \citet{2013A&A...556A.150S}. The full spectroscopic analysis is based on the Equivalent Widths (EWs) of 233 Fe \rom{1} and 34 Fe \rom{2} weak lines by imposing ionization and excitation equilibrium. The line-list used was taken from \citet{2008A&A...487..373S}. We obtained resulting parameters of $T_{\rm eff}${}=$5732\pm16$K, $\log g${}$=4.46\pm0.05$ and \mbox{$\rm [Fe/H]$}{}$=0.14\pm0.02$. To account for potential systematic uncertainties, we increased the error bars to $50$K and 0.05 dex for $T_{\rm eff}${} and $\log g${} respectively. To constrain the physical stellar parameters of HD\,110113{} given the observed information, we applied three techniques. The first technique was to use the main-sequence calibrations of \citet{2010A&ARv..18...67T} which derive $R_s$ and $M_s$ using polynomial functions of $T_{\rm eff}${}, $\log g${} and \mbox{$\rm [Fe/H]$}{}, which are built using the observed properties of calibration stars. Uncertainties were propagated using 10000 Monte Carlo draws and the mass was corrected using the calibration of \citet{Santos-13}. This produced a mass and radius of $ 0.989 \pm 0.01 $ {}\,\mbox{$M_{\odot}$}{} and $ 0.998 \pm 0.025 $ {}\,\mbox{$R_{\odot}$}{} respectively, although \citet{2010A&ARv..18...67T} suggest minimum uncertainties of 0.06\mbox{$M_{\odot}$}{} and 0.03\mbox{$R_{\odot}$}{} respectively. The second was using theoretical isochrones \citep[MIST,][]{2016ApJ...823..102C} as well as observed properties (e.g. colours) to constrain stellar parameters, which we performed using \texttt{isoclassify} \citep{2017zndo....573372H,2020AJ....159..280B}. Inputs included the derived spectral properties $T_{\rm eff}${}, $\log g${} and \mbox{$\rm [Fe/H]$}{}, as well as archival data for HD\,110113{} including {\it APASS} B \& V magnitudes \citep{apass}, {\it Gaia} parallax, Gp, Rp, Bp and luminosity \citep{brown2018gaia}, \textit{SkyMapper} ugriz observations \citep{2020arXiv200810359O} and {\it 2MASS} JHK observations \citep{skrutskie2006two}. This resulted in a mass \& radius of $ 1.004^{+0.042}_{-0.047} $ {}\,\mbox{$M_{\odot}$}{} and $ 1.002 \pm 0.028 $ {}\,\mbox{$R_{\odot}$}{} respectively. The well-constrained nature of the input measurements mean that we are limited by the gridsize of the theoretical isochrones, which despite an initial array of more than 3 million points, resulted in only 112 samples within all available constraints. As a final independent determination of the basic stellar parameters for HD\,110113, we performed an analysis of the broadband spectral energy distribution (SED) of the star together with the {\it Gaia\/} DR2 parallax \citep[adjusted by $+0.08$~mas to account for the systematic offset reported by][]{StassunTorres:2018}, in order to determine an empirical measurement of the stellar radius, following the procedures described in \citet{Stassun:2016,Stassun:2017,Stassun:2018}. We pulled the $B_T V_T$ magnitudes from {\it Tycho-2}, the $BVgri$ magnitudes from {\it APASS}, the $JHK_S$ magnitudes from {\it 2MASS}, the W1--W4 magnitudes from {\it WISE}, the $G G_{\rm BP} G_{\rm RP}$ magnitudes from {\it Gaia}, and the NUV magnitude from {\it GALEX}. Together, the available photometry spans the full stellar SED over the wavelength range 0.2--22~$\mu$m (see Figure~\ref{fig:sed}). \begin{figure} \centering \includegraphics[width=\linewidth,trim=100 75 95 95,clip]{toi_755_sed.pdf} \caption{Spectral energy distribution of HD\,110113. Red symbols represent the observed photometric measurements, where the horizontal bars represent the effective width of the passband. Blue symbols are the model fluxes from the best-fit Kurucz atmosphere model (black).} \label{fig:sed} \end{figure} We performed a fit using Kurucz stellar atmosphere models, with the $T_{\rm eff}$, [Fe/H] and $\log g$ adopted from the spectroscopic analysis. The only additional free parameter is the extinction ($A_V$), which we restricted to the maximum line-of-sight value from the dust maps of \citet{Schlegel:1998}. The resulting fit is very good (Figure~\ref{fig:sed}) with a reduced $\chi^2$ of 1.4 and best-fit $A_V = 0.03 \pm 0.03$. Integrating the (unreddened) model SED gives the bolometric flux at Earth, $F_{\rm bol} = 2.597 \pm 0.091 \times 10^{-9}$ erg~s$^{-1}$~cm$^{-2}$. Taking the $F_{\rm bol}$ and $T_{\rm eff}$ together with the {\it Gaia\/} DR2 parallax gives the stellar radius, $R_\star = 0.968 \pm 0.018 R_\odot$. In addition, we can use the $R_\star$ together with the spectroscopic $\log g$ to obtain an empirical mass estimate of $M_\star = 0.99 \pm 0.08 M_\odot$. Taken together, all the stellar parameters as derived above are consistent, and all suggest that HD\,110113{} is a solar analogue with mass and radius very close to the Sun. As the SED radius measurement is least affected by sample size or systematic uncertainty, we assume this as a final radius. Similarly, the mass obtained from the $\log g${} and the SED-derived \mbox{$R_{\star}$}{} ($0.99 \pm 0.08 M_\odot$) is nearly identical to that from the MR relationship ( $ 0.989 \pm 0.01 $ {}\,\mbox{$M_{\odot}$}{}), suggesting they converge on the same value. We therefore use the mass as defined from the offset-corrected \citet{2010A&ARv..18...67T} calibrations, with the uncertainty inflated to reflect the typical systematic error ($0.06M_{\odot}$). To compute the $v\sin{i}${} from the FWHM, we used the relations of \citet{dos2016solar}, who studied the {HARPS}{} spectra of a large number of solar twins. We used this to first estimate the $v_{\rm macro}$ from the $T_{\rm eff}${} and $\log g${} derived in section \ref{sect:starpars} ($3.64\pm0.1$\,km\,s$^{-1}${}), and then combined this with the measured FWHM to estimate a $v\sin{i}${} of $1.74\pm0.15$\,km\,s$^{-1}${}, although the uncertainties here may be underestimated due to systematic uncertainties. Using the calculated $R_s$, this corresponds to a maximum rotation period ($P_{\rm max}$) of $28\pm3$\,d, assuming an aligned system. \subsubsection{Chemical abundances} \label{sect:abunds} Stellar abundances of the elements were also derived using the same tools and models as for stellar parameter determination as well as using the classical curve-of-growth analysis method assuming local thermodynamic equilibrium. Although the EWs of the spectral lines were automatically measured with ARES, for the elements with only two to three lines available we performed careful visual inspection of the EWs measurements. For the derivation of chemical abundances of refractory elements, we closely followed the methods described in the literature \citep[e.g.][]{Adibekyan-12, Adibekyan-15, Delgado-14, Delgado-17}. Abundances of the volatile elements, O and C, were derived following the method of \cite{Delgado-10, 2015A&A...576A..89B}. Since the two spectral lines of oxygen are usually weak and the 6300.3\,\AA{} line is blended with Ni and CN lines, the EWs of these lines were manually measured with the task \texttt{splot} in IRAF. Lithium and sulfur abundances were derived by performing spectral synthesis with MOOG, following the works by \citet{Delgado-14} and \citet{Costa_Silva2020} respectively. Both abundance indicators are very similar to the solar values. All the [X/H] ratios are obtained by doing a differential analysis with respect to a high S/N solar (Vesta) spectrum from HARPS. The stellar parameters and abundances of the elements are presented in Table \ref{tab:abunds}. We find that the [X/Fe] ratios of most elements are close to solar as expected for a star with this metallicity whereas [O/Fe] and [C/Fe] are slightly subsolar, since these ratios tend to slightly decrease above solar metallicity \cite[e.g.][]{Bertrandelis-15,Franchini2020}. Moreover, we used the chemical abundances of some elements to derive ages through the so-called chemical clocks (i.e. certain chemical abundance ratios which have a strong correlation with age). We applied the 3D formulas described in \citet{Delgado-19}, which also consider the variation in age produced by the effective temperature and iron abundance. The chemical clocks [Y/Mg], [Y/Zn], [Y/Ti], [Y/Si], and [Y/Al] were derived. We selected the [Y/Al] age, 4.0\,$\pm$\,0.5 Gyr{}, as the representative age, as it is consistent with all others and has the smallest uncertainty. \begin{table} \centering \begin{tabular}{lcc} \hline \hline Parameter & Value & Error \\ \hline \hline \multicolumn{3}{c}{\it Abundances}\\ A(Li) & $1.09$ & $0.08$ \\ $[\rm{Fe}/\rm{H}]$ & $0.14$ & $0.02$ \\ $[\rm{S}/\rm{H}]$ & $0.03$ & $0.04$ \\ $[\rm{Na}/\rm{H}]$ & $0.141$ & $0.038$ \\ $[\rm{Mg}/\rm{H}]$ & $0.129$ & $0.021$ \\ $[\rm{Al}/\rm{H}]$ & $0.105$ & $0.014$ \\ $[\rm{Si}/\rm{H}]$ & $0.097$ & $0.022$ \\ $[\rm{Ca}/\rm{H}]$ & $0.092$ & $0.062$ \\ $[\rm{Ti}/\rm{H}]$ & $0.140$ & $0.030$ \\ $[\rm{Cr}/\rm{H}]$ & $0.156$ & $0.032$ \\ $[\rm{Ni}/\rm{H}]$ & $0.130$ & $0.024$ \\ $[\rm{O}/\rm{H}]$ & $-0.012$ & $0.083$ \\ $[\rm{C}/\rm{H}]$ & $0.032$ & $0.012$ \\ $[\rm{Cu}/\rm{H}]$ & $ 0.116 $ & $ 0.016 $ \\ $[\rm{Zn}/\rm{H}]$ & $ 0.050 $ & $ 0.012 $ \\ $[\rm{Sr}/\rm{H}]$ & $ 0.170 $ & $ 0.073 $ \\ $[\rm{Y}/\rm{H}]$ & $ 0.170 $ & $ 0.039 $ \\ $[\rm{Zr}/\rm{H}]$ & $ 0.152 $ & $ 0.045 $ \\ $[\rm{Ba}/\rm{H}]$ & $ 0.123 $ & $ 0.047 $ \\ $[\rm{Ce}/\rm{H}]$ & $ 0.120 $ & $ 0.051 $ \\ $[\rm{Nd}/\rm{H}]$ & $ 0.135 $ & $ 0.056 $ \\ \hline \multicolumn{3}{c}{\it Derived Abundance Ratios}\\ Mg/Si & $ 1.32 $ & $ 0.09 $ \\ Fe/Si & $ 1.08 $ & $ 0.07 $ \\ Mg/Fe & $ 1.23 $ & $ 0.08 $ \\ \hline \multicolumn{3}{c}{\it Ages}\\ $[\rm{Y}/\rm{Mg}]$ Age [Gyr] & $ 4.09 $ & $ 0.75 $ \\ $[\rm{Y}/\rm{Ti}]$ Age [Gyr] & $ 4.09 $ & $ 0.95 $ \\ $[\rm{Y}/\rm{Zn}]$ Age [Gyr] & $ 3.29 $ & $ 0.77 $ \\ $[\rm{Y}/\rm{Si}]$ Age [Gyr] & $ 3.95 $ & $ 0.86 $ \\ $[\rm{Y}/\rm{Al}]$ Age [Gyr] & $ 4.00 $ & $ 0.54 $ \\ \hline \hline \end{tabular} \caption{Derived stellar abundances. [Y/X] based ages using the 3D formula of \citet{Delgado-19} (Table 10: age \& $a + b \times$$T_{\rm eff}${}$+ c \times$\mbox{$\rm [Fe/H]$}{}$ + d \times$\mbox{$\rm [Y/Mg]$}{}).} \label{tab:abunds} \end{table} \subsection{Combined modelling of RV \& Photometry} \subsubsection{Treatment of Radial Velocities}\label{sect:rvs} All activity indicators showed clear signs of stellar variability, likely due to the presence of starspots. To remove this stellar activity, we first turned to linear decorrelation of the RV signal using activity indicators. The FWHM and S-index showed the clearest rotational signals, so we selected these and used the decorrelation technique provided with the DACE spectroscopy Python package \citep{2015ASPC..495....7B}\footnote{\url{https://dace.unige.ch/tutorials/?tutorialId=34}}. Despite this decorrelation removing much of the stellar variability signal, the peak at $\sim22$d remained the single strongest signal in the radial velocity time series (see Figure \ref{fig:rv_decorr}). To remove the rotation signal at $23.68\pm0.08$\,d, we fitted a 5-parameter Keplerian model (with eccentricity $e$, argument of periastron $\Omega$, \& semi-amplitude $K$ as free parameters, with period $P$ and time of transit $t_0$ constrained from the periodogram). The next strongest signals were at $6.73\pm0.03$\,d and $2.541\pm0.0008$\,d with amplitudes of $3.88\pm0.31$\,m\,s$^{-1}${} and $2.55\pm0.31$\,m\,s$^{-1}${} respectively. This was followed by signals on longer periods, which are most likely spurious due to rotational and observational aliases. Although this linear decorrelation and Keplerian-fitted rotation period was able to reveal the planetary RV signals, stellar variability cannot in general be modelled as a Keplerian. Instead we turned to a Gaussian process (GP) to model the impact of rotation on the RVs. GPs have frequently been used in the analysis of radial velocities affected by activity \citep[e.g.][]{2014MNRAS.443.2517H,2019A&A...627A..43D}. One GP kernel well-suited to stellar rotation is a mix of simple harmonic oscillator (SHO) terms corresponding to $P_{\rm rot}$ and $P_{\rm rot}/2$, which we built using \texttt{exoplanet} and \texttt{celerite} packages\footnote{We used the \texttt{exoplanet.gp.terms.RotationTerm} implementation}. In order to limit the impact of the GP on the planetary RV signal, we fitted activity indicators and RV time-series simultaneously with the same GP kernel, as these should follow the same underlying variations with the exception of planetary reflex motion. A similar approach was previously used by \citet{grunblatt2015determining} to model stellar variability in the Kepler-78b system, and by \citet{2020A&A...639A..77S} to find an outer candidate orbiting Proxima Centauri. By explicitly linking the variation found across activity indicators and RVs, this method has the same effect as "training" a GP on an activity indicator \citep[e.g.][]{2019A&A...627A..43D}. However, it avoids having to run multiple models consecutively and transfer the output PDF of a training sample into a second model---a process which loses information intrinsic to the likely non-Gaussian distributions of the GP hyper-parameters as well as information about the correlations between parameters. This technique also enables the use of multiple time-series. In this case, we chose S-index and FWHM to co-fit the covariance function with the RVs, as these showed the clearest rotation signal. To achieve this, the hyper-parameters for rotation period, mix factor between $P_{\rm rot}$ and $P_{\rm rot}/2$ terms, signal quality ($Q$), and the difference in signal quality between modes ($\Delta Q$) were kept constant between S-index, FWHM and RV time-series, while the signal amplitude and mean, which are not shared across parameters, were set as separate parameters. For each time-series we also used a jitter term to model noise not included by measurement errors and to prevent GP over-fitting. All hyper-parameters were given broad priors, although the rotation period was constrained to the value obtained from a Lomb-Scargle periodogram \citep{Lomb1976, Scargle1982} with a standard deviation of 20\%. All parameter priors are listed in Table \ref{tab:planetparlong}. We also noted that the FWHM errors produced by the {HARPS}{} pipeline appeared over-estimated---more than twice the estimated error derived from the median absolute difference between measurements. Therefore the FWHM errors were multiplied by a factor of 0.4386 such that the median error matched the point-to-point RMS as calculated from the median absolute difference. While we used the GPs to model the covariance between points in each timeseries, a mean function is also required to calibrate the average value over time, which we applied separately to each of the three timeseries. A 2-parameter (i.e. linear) trend term was included to model potential long-term drift in the RVs, although the resulting gradient was not significant ($-0.14\pm0.73$\,m\,s$^{-1}${}d$^{-1}$). Single-parameter mean values were included to model the offset of S-index and FWHM from zero. \begin{figure} \includegraphics[width=\columnwidth, trim={0.3cm 1.1cm 0.8cm 1.3cm}]{TOI755_decorrelation_periodograms} \caption{Periodograms of RVs after linear decorrelation with S-index and FWHM. The upper panel shows the raw periodogram, while subsequent panels show the periodogram after the removal of the previously marked peak. The 2.54\,d peak is accompanied by a significant peak at the 1-day sampling alias (1.65\,d), but the knowledge of a 2.54\,d planet in the {\it TESS}{} photometry breaks this degeneracy. The remaining peaks in the final periodogram are likely due to sampling aliases associated with the $\sim60$\,d span of observations.} \label{fig:rv_decorr} \end{figure} \begin{figure*} \includegraphics[width=\textwidth, trim={0.85cm 0.8 1.9cm 0.4cm}]{Combined_RV_plots_3_GPs_final.pdf} \caption{S-index, FWHM and RV timeseries of HD110113 for two seasons of HARPS monitoring, with GP models and 2-sigma uncertainty regions overplotted in green. Below the raw RV timeseries is the GP-removed RV timeseries, with the modelled planetary reflex motion and background trend (turquoise). At the very bottom the full model residuals are shown, with an RMS of only 1.31\,m\,s$^{-1}${}---extremely close to the median HARPS measurement uncertainty (1.36\,m\,s$^{-1}${}).} \label{fig:RVs} \end{figure*} \begin{figure} \includegraphics[width=\columnwidth, trim={0.1cm 0.8cm 1.0cm 0.85cm}]{Phase_folded_RV_plots_3_GPs_final.pdf} \caption{Phase-folded RVs (with the best-fit GP model, linear trend, and the other planetary signal removed) for HD\,110113\,b{} (top) and HD\,110113\,c{} (bottom), with model-subtracted residuals. } \label{fig:phase_fold_rvs} \end{figure} \subsubsection{Treatment of Photometry} We downloaded the \texttt{PDC\_SAP} lightcurve from the Mikulski Archive for Space Telescopes (MAST). As high-resolution imaging revealed no close stellar neighbours missed by e.g. the {\it TESS}{} input catalogue \citep{stassun2019revised}, we made the assumption that the PDC-extracted and dilution-corrected lightcurve for this target was accurate. We then normalised the \texttt{PDC\_SAP} timeseries by its median and masked anomalous flux points from the timeseries by cutting data more than $4.2\sigma$ different from both preceding and succeeding neighbours. We initially tried to use the same \texttt{celerite} GP kernel to predict both RV and photometric time-series deviations. This proved to not be possible, likely because the effect of stellar variability on photometry is not necessarily at the same timescale as for RVs \citep{10.1111/j.1365-2966.2011.19960.x}. Similarly, although a Lomb-Scargle periodogram of the raw {\it TESS}{} lightcurve does show a peak with a period around 25d, the processed \texttt{PDC\_SAP} lightcurve is flat, likely as variability on the order of a {\it TESS}{} orbit ($\sim 14$\,d) is removed during processing. The remaining variability is therefore likely to be the result of stellar granulation, which is well-suited to be modelled with a single GP SHO kernel with quality $Q=1/\sqrt{2}$ \citep{2020A&A...634A..75B, exoplanet:foremanmackey17}. To produce the initial hyperparameters ($\omega_0$ \& $S_0$) and priors for the combined analysis and reduce the possibility of the GPs attempting to model the transits themselves, we first fitted this GP to the photometry with planetary transits cut. The interpolated posterior distributions from this analysis then provided the priors for the combined analysis. A jitter term was also included to model the effect of high-frequency noise not fully encapsulated by the photon noise (e.g. stellar \& spacecraft jitter). We modelled the limb darkening using two approaches: one where limb darkening is a free parameter, reparameterised using the approach of \citet{kipping2013efficient} and fitted to the transit with uninformative priors that cover the physical parameter space; and another where the expected theoretical limb darkening parameters for the star as generated by \citet{claret2017limb} are used as priors for the analysis. We found the resulting distributions to be consistent, and chose to use the second, constrained approach in the final modelling. This used a normal prior with the mean, $\mu$, set from the theoretical parameter and $\sigma$ set as 0.1 which we chose instead of the uncertainty found when propagating the stellar parameters through the \citet{claret2017limb} relation, which was likely too contsraining and did not account for systematic uncertainties. The radius ratio $R_p/R_s$ was treated using the log amplitude to avoid negative values, and b was reparameterised with $R_p/R_s$ following the \texttt{exoplanet} implementation of \citet{espinoza2018efficient}. As ground-based photometry was not precise enough to observe a transit (see Sect. \ref{sect:groundfu}), we restrict this analysis to only the {\it TESS}{} photometry and {HARPS}{} spectroscopy. \subsubsection{Combined Model} We modelled full Keplerian orbits for the two planets, with eccentricity priors according to the \citet{kipping2013parametrizing} beta distribution. Monte Carlo sampling, while able to explore the parameter space around a best-fit solution, does not deal well with exploring unconstrained parameters with multiple local minima. Therefore, in order to allow our model to explore a single solution, we included normal priors on period and $t_0$ using the values and uncertainties from the TOI catalogue in the case of the $2.54$d planet, and from the RV periodogram in the case of the $6.7$d planet. In all cases, we artificially inflated these uncertainties to make sure the parameters were not over-constrained by their priors, which is confirmed by noting that the posterior distributions are, in all cases, narrower than the priors. The combined model, built using the \textsf{exoplanet} \citep{exoplanet:exoplanet} package, was sampled using the No-U Turn Sampler (NUTS) in the Hamiltonian Monte Carlo \texttt{PyMC} back-end \citep{exoplanet:pymc3} using 5 independent chains with 2000 steps and an additional 500 steps burn-in. This produced 10000 independent samples. Model priors and posteriors are displayed in table \ref{tab:planetparlong}. The results from the combined model are shown in tables \ref{tab:derived_pars} and \ref{tab:planetparlong}, with the {HARPS}{} RV timeseries and best-fit models shown in figure \ref{fig:RVs}, phase-folded RVs and model shown in figure \ref{fig:phase_fold_rvs}, and {\it TESS}{} photometry and best-fit light curves shown in figure \ref{fig:photometry}. \begin{figure*} \includegraphics[width=\textwidth, trim={1.45cm 0.2 0.95cm 0.5}]{Combined_phot_plot_3_GPs_final.pdf} \caption{{\it TESS}{} photometry, where black dots represent individual 2-minute cadence data and dark circles (with errorbars) represent 30-minute bins. Upper left: {\it TESS}{} \texttt{PDC\_SAP} time series with best-fit GP model (both offset by 3.5ppt), and GP-subtracted lightcurve with the best-fit transit model over-plotted (no offset). Lower left: residuals, with both GP model and transit models subtracted from the lightcurve. Upper right: phase-folded lightcurve of HD\,110113\,b{} zoomed to the transit. Lower right: phase-folded residuals. } \label{fig:photometry} \end{figure*} \begin{table} \centering \begin{tabular}{lcc} \hline \hline Parameter & HD\,110113\,b{} & HD\,110113\,c{}\\ \hline \hline Epoch, $t_0$ [BJD-2457000] & $ 1570.101^{+0.004}_{-0.005} $ {} & $ 1798.17 \pm 0.19 $ \\ Orbital Period, $P$ [d] & $ 2.541^{+0.0005}_{-0.001} $ {} & $ 6.744^{+0.008}_{-0.009} $ {} \\ Semi-major Axis, $a$ [AU] & $ 0.035 \pm 0.001 $ {} & $ 0.068^{+0.001}_{-0.002} $ {} \\ Orbital Eccentricity, $e$ & $ 0.093^{+0.079}_{-0.064} $ {} & $ 0.045^{+0.079}_{-0.038} $ {} \\ Argument of periastron, $\Omega$ & $ -0.47 \pm 0.68 $ {} & $ -0.1 \pm 1.2 $ {} \\ Radius ratio [$R_p/R_s$] & $ 0.018 \pm 0.001 $ {} & --- \\ Radius, $R_p$ [$R_\oplus$] & $ 2.05 \pm 0.12 $ {} & --- \\ Impact Parameter, b & $ 0.31 \pm 0.22 $ {} & --- \\ Transit duration, $t_D$ [d] & $ 0.099^{+0.005}_{-0.007} $ {} & --- \\ RV semi-amplitude, $K$ [m\,s$^{-1}${}] & $ 2.15 \pm 0.28 $ {} & $ 3.58 \pm 0.37 $ {} \\ Planet Mass, $M_p$ [$M_\oplus$] & $ 4.55 \pm 0.62 $ {} & $ 10.5 \pm 1.2 $ {}$^{\star}$ \\ Planet Density, $\rho_p$ [${\rm gcm}^{-3}$] & $ 2.90^{+0.75}_{-0.59} $ {} & --- \\ Insolation, $S$ [${\rm kW m}^{-2}$] & $ 1001.0 \pm 40.0 $ {} & $ 272.0 \pm 11.0 $ {} \\ Surface Temperature, $T_p$ [K]$^{\dagger{}}$ & $ 1371.0 \pm 14.0 $ {} & $ 990.0 \pm 10.0 $ {} \\ \hline \hline \end{tabular} \caption{Derived planet properties. $^{\star}$ The mass of planet c refers to the $M_p\sin{i}$. $^{\dagger{}}$ Surface temperature assumes a uniform surface and an albedo of 0.2.} \label{tab:derived_pars} \end{table} \section{Discussion}\label{sect:discus} \subsection{Evidence for HD\,110113\,c{}}\label{sect:planetc} The periodogram of the activity-corrected radial velocity timeseries showed a clear signal at $6.75$\,d, even stronger than that of the planet at $2.54$\,d (Figure \ref{fig:rv_decorr}). No such signal was found by TESS' automatic TPS; however, there is a chance such a signal may have been missed. A search using the \texttt{transit least squares} algorithm \citep{hippke2019optimized} on the HD\,110113\,b{}-subtracted lightcurve found no signal around 6.7\,d, and a visual inspection of the lightcurve around the likely epochs of transits (given the limits from the RV detection) reveals no candidate dips associated with an outer candidate. Indeed, when running a combined model of two transiting planets, with constraints on orbits from the RVs, the posteriors for the radius of the outer planet were $<0.64$\,R$_{\oplus}${} at $1-\sigma$ which, given the $ 10.5 \pm 1.2 $ {}\,M$_{\oplus}${} mass of HD\,110113\,c{}, would be physically impossible, even with an iron-core. Therefore, we come to the conclusion that HD\,110113\,c{} is likely non-transiting. In order to assess whether the RV signal alone warrants calling HD\,110113\,c{} a confirmed planet or merely a candidate, we ran two combined models with identical priors and with one model including a non-transiting planet around $6.7$d. We then burned-in each model for 500 samples and ran the \texttt{find\_MAP} function in \texttt{PyMC3} to find the maximum likelihood for each model, allowing us to compare the difference in Bayesian Information Criterion ($\Delta{\rm BIC}$) between the models. The resulting value of $\Delta{\rm BIC}= $\,$16.32${} clearly favours a two-planet model over a single planet model, with $\Delta{\rm BIC}>10$ suggesting "Very Strong" evidence over the null hypothesis. Another test for the RV signal of HD\,110113\,c{} is the coherence of the signal over time, as radial velocity variation due to, e.g., stellar variability is not likely to remain coherent over multiple observing seasons. We verified this two ways using the decorrelated and rotation-subtracted radial velocities previously used to form RV periodograms (see Figure \ref{fig:rv_decorr}). First we processed each season individually, finding that the signals at 2.451\,d and 6.75\,d coincide with peaks during both seasons, albeit at lower signal strength. Next we applied the Bayesian generalised Lomb-Scargle periodogram \citep[BGLS,][]{mortier_2015_bgls} to subsets of our RV time series to test signal coherence as per the technique of \citet{mortier_2017_bgls2}. Figure \ref{fig:RVSignalCoherence} shows that the signal of HD\,110113\,c{} passes this test - remaining evident even in datasets with only a handful of datapoints. \begin{figure} \includegraphics[width=\columnwidth, trim={0.2cm 0.6cm 0.9cm 0.6cm}]{RV_river_plot} \caption{A 2D BGLS periodogram of HD\,110113{} radial velocities (after decorrelation and subtraction of the strongest rotation signal) performed on increasing numbers of radial velocity points, as proposed by \citet{mortier_2017_bgls2}. Periods which maintain signal-strength and periodicity as a function of observation number suggest coherent (and therefore planetary) signals. The two white vertical bands show our modelled periods of each planet. The vertical bands seen are due to signal aliases in the second observing season due to the data gap, which is marked with a black horizontal line. \label{fig:RVSignalCoherence} } \end{figure} It should be noted that the period of HD\,110113\,c{}, at $ 6.744^{+0.008}_{-0.009} $ {}\,d, is close to the $P_{\rm rot}/3$ harmonic. However, there appears little evidence of a signal in the RV periodogram at $P_{\rm rot}/2$, so a large coherent signal at $P_{\rm rot}/3$ would be unexpected. However, it is possible that with certain inclinations and spot locations such harmonics may be boosted \citep{vanderburg2016radial,boisse2011disentangling}. Interestingly the periodogram of the S-index data does show a strong peak at $P_{\rm rot}/2$ and a weaker peak at $P_{\rm rot}/3$, but this occurs at $7.25$\,d---significantly separated from the RV peak at $ 6.744^{+0.008}_{-0.009} $ {}. While we confirm the presence of this second planet, as given $\Delta{\rm BIC}>10$, the amplitude of the signal may be affected by the presence of a signal at $P_{\rm rot}/3$, therefore the mass of HD\,110113\,c{} should be treated as uncertain. Multiple lines of evidence point to the signal of HD\,110113\,c{} being planetary in origin. Future RV measurements should help further disentangle stellar rotation and the signal amplitude, and may even reveal new candidates in this system. The majority of short-period multi-planet systems are typically aligned with mutual inclinations of only a few degrees \citep{lissauer2011architecture, 2012A&A...541A.139F,winn2015occurrence}. To investigate whether this could also be true for HD\,110113{}, we used the derived impact parameter of planet b and the semi-major axis ratio of b \& c to calculate the expected impact parameter of planet c in a perfectly co-planar scenario ($b_c = 0.60\pm0.42$) and the minimum mutual inclination ($\Delta{}i = 1.6^{+1.4 \circ}_{-1.6}$). Therefore, the HD\,110113{} planetary system is still consistent with an aligned planetary system. Throughout this work we quote $M_p\sin{i}$ for HD\,110113\,c{}. However, a clear non-detection of transits can constrain a planet's inclination, and therefore also reduce the lower limit on a planet's mass. However, in this case, the reduction in minimum mass caused by assuming $b>1.0$ is smaller than 0.25\%. Therefore, including this factor would not significantly change the mass estimate from $M_p\sin{i}$. It is also worth noting that planets b \& c have an orbital period ratio near 8/3, although harmonics beyond $2:1$ are highly unlikely to create measurable TTVs \citep{deck2015measurement}. \subsection{A solar analogue?}\label{sect:solaranal} It is remarkable to note just how sun-like HD\,110113{} is, with a radius, $T_{\rm eff}${} and $\log g${} all within 1-sigma uncertainties of solar values, with the exception of its slightly higher metallicity (\mbox{$\rm [Fe/H]$}{}$ = 0.14\pm0.02$), and correspondingly lower C \& O (see Table \ref{tab:abunds}) \citep[e.g.][]{Franchini2020,2015A&A...576A..89B}. We speculate that the higher metallicity may explain why HD\,110113{} was able to form close-in mini-Neptunes \citep{mulders2016super,bitsch2020influence}, which do not exist in our solar system. HD\,110113{} is also nearly the same age as the Sun, as can be seen in both the Yttrium-based ages (Table \ref{tab:abunds}), and from the rotation rate ($\sim$22\,d from archival photometry, spectroscopy timeseries, \& $v\sin{i}${}). Indeed, this rotation rate is marginally faster than the Sun \citep[25--26.5\,d when measured with HARPS-N and converted to sidereal period,][]{milbourne2019harps}. This could be explained by the fact that HD\,110113{} is slightly younger, the Sun rotates slower than average \citep{2008ApJ...684..691R}, or the presence of short-period planets has tidally inhibited the slow-down of HD\,110113{}, although the effect for such small planets is likely to be small \citep{bolmont2012effect}. Thanks to their similarities, HD\,110113{} and its planets could prove a useful comparison to the Sun and the solar system in the future. \subsection{Composition}\label{sect:internal} \begin{figure} \includegraphics[width=\columnwidth]{MR-755} \caption{Mass-radius diagram of exoplanets with accurate mass and radius determination (Otegi et al. 2019). Also shown are the mass-radius relations for Earth-like and pure water compositions.\label{fig:MR_Diagram} } \end{figure} To explore the composition of HD\,110113\,b{}, we performed 4-layer interior structure modelling, using as inputs the mass and radius determined by our joint modelling of {\it TESS}{} photometry and {HARPS}{} RVs. We followed the method of \citet{otegi2020revisited}, which assumes a pure iron core, a silicate mantle, a non-gaseous water layer, and a H-He atmosphere. In order to quantify the degeneracy between the different interior parameters and produce posterior probability distributions, we use a generalized Bayesian inference analysis with a Nested Sampling scheme \citep[e.g.][]{2014A&A...564A.125B}. The interior parameters that are inferred include the masses of the pure-iron core, silicate mantle, water layer and H-He atmosphere. The ratios of Fe/Si and Mg/Si found in stars is expected to be mirrored in the protoplanetary material, and therefore in the internal structures of exoplanets \citep{dorn2015}. Hence, we use the values found by our stellar abundance analysis as a proxy for the core-to-mantle ratio. Given the observed molar ratio of Fe/Si ($1.08\pm0.07$, Table \ref{tab:abunds}) is higher than that of the Sun \citep[0.85,][]{lodders2009}, we would expect planetary material around HD\,110113{} to be more iron-rich than Earth. Table \ref{tab:interior} lists the inferred mass fractions of the core, mantle, water-layer and H-He atmosphere from the interior models. Due to the nature of the measurements, interior models cannot distinguish between water and H-He as the source of low-density material. Therefore, we ran both a 4-layer model and two 3-layer models, which leave out the H$_{2}$O and H-He envelopes, respectively. In the case of a H-He envelope, we find that the planet is only $\sim1$\% H-He by mass, with an iron-rich rocky interior making up 99\% of the planet. Any water present would likely decrease the core, mantle \& gaseous envelope fractions. However, a gas-free model would require $73 ^{+10} _{-13}$\% water. Such a high water-to-rock ratio is challenging from formation point of view. Therefore HD\,110113\,b{} almost certainly has a significant gaseous envelope. Stars with super-solar metallicities are also less likely to host water-rich planets due to a higher C/O ratio \citep{bitsch2020influence}, making a water-rich composition even less likely. Figure \ref{fig:MR_Diagram} shows the mass radius relation (M-R relation) for Earth-like and pure water compositions (where the pure water line corresponds to a surface pressure of 1 bar, and without a water-vapor atmosphere). Also shown are exoplanets with accurate mass and radius determinations from \citet{otegi2020revisited}. The position of HD\,110113\,b{} makes it one of the lowest-density worlds found with $M_p<5$\,M$_{\oplus}${}, and among a small class of low-density low-mass planets which includes $\pi{}$ Men c \citep{huang2018tess} and GJ 9827 b \citep{niraula2017three}. \begin{table} \caption{Inferred interior structure properties of TOI-755b.} \label{tab:interior} \begin{tabular}{lccc} \hline \hline Constituent & With H-He [\%] & With H$_{2}$O [\%] & 4-layer [\%] \\ \hline \hline $M_{\rm core}/M_{\rm total}$ & $47 ^{+26} _{-24} $ & $8 ^{+7} _{-6}$ & $25 ^{+28} _{-18}$\\ $M_{\rm mantle}/M_{\rm total}$ & $ 53 ^{+23} _{-24} $ & $17 ^{+11} _{-9}$ & $36 ^{+31} _{-19}$\\ $M_{\rm water}/M_{\rm total}$ & --- & $73 ^{+10} _{-13}$ & $38 ^{+31} _{-24}$\\ $M_{\rm H-He}/M_{\rm total}$ & $1.0 ^{+0.3} _{-0.5}$ & --- & $0.102 ^{+0.04} _{-0.03}$\\ \hline \hline \end{tabular} \end{table} \begin{figure} \includegraphics[width=\columnwidth, trim={0.8cm 0.5cm 1.05cm 0.2cm}]{Insolation_TOI755} \caption{The distribution of Kepler planets by both insolation \& planetary radius plot, with underlying occurrence distributions adapted from \citep{martinez2019spectroscopic}. HD\,110113\,b{} is included as a purple star. The best-fit positions of radius valleys from both \citet{martinez2019spectroscopic} (dashed) and \citet{van2018asteroseismic} (dotted) are plotted in blue, with conversion from period to insolation performed using the average stellar parameters in the Kepler samples. Typical uncertainties for both HD\,110113\,c{} and for the Kepler sample are shown in the top left.\label{fig:insolation} } \end{figure} \subsection{Evaporation}\label{sect:evap} With an insolation of $ 1001.0 \pm 40.0 $ {}\,kW\,m$^{-2}$ ($\sim736\,S_\oplus$), it is extremely likely that HD\,110113\,b{} has been moulded by strong stellar radiation in some way. This is further suggested by placing HD\,110113\,b{} on the insolation-radius plots of \citet{fulton2017california} and \citet{martinez2019spectroscopic}, which clearly show the "radius valley" (see Fig. \ref{fig:insolation}. The negative slope of the valley with insolation means that, even with a radius of $ 2.05 \pm 0.12 $ {}\,R$_{\oplus}${}, HD\,110113\,b{} is positioned exactly within it. Using both rotation and age, we predict a current X-ray luminosity ($L_x/L_{\rm bol}$) of between $8.5\times10^{-7}$ \citep[with Prot;][]{wright2018stellar} and $2.74\times10^{-6}$ \citep[with age;][]{jackson2012coronal}. This implies total X-ray luminosities on the order of $3.3\times10^{27}$ to $2.7\times10^{28}$ erg and mass-loss rates (assuming an energy-limited regime) of between $5\times10^{9}$ and $9\times10^{9}$\,gs$^{-1}$ (0.026-- 0.05\,$M_\oplus {\rm Gyr}^{-1}$). This is comparable to both GJ 436 b and Pi Men c under similar assumptions \citep{king2019xuv}. Therefore, while it is currently highly irradiated, HD\,110113\,b{} is unlikely to currently be losing large quantities of its H-He atmosphere to space. However, the integrated sum of mass-loss since the planet's formation is substantial, as young stars are typically far more active and far more X-ray luminous. We calculate that, assuming the current mass and radius, as much as 10\% of the planet's mass may have been lost through evaporation. The models of \citet{zeng2019growth} suggest that a 1000\,K planet with $>5$\% hydrogren and a $5.25M_\oplus$ core would have been $>8.5$\,R$_{\oplus}${} in radius, suggesting that HD\,110113\,b{} potentially started as an extremely low-density Jupiter-radius world which was quickly stripped. How such a low-mass world came to possess such a large gaseous atmosphere raises more questions. In any case, it is highly likely that HD\,110113\,b{} started with a thicker atmosphere of H-He, which, due to both evaporative and core-powered mass-loss, it lost much of over time. However, this is typically a runaway process: planets which lose the majority of their gas (i.e. those in the radius valley) typically lose it all \citep{owen2017evaporation}. Therefore the main unanswered question is: how did HD\,110113\,b{} escape becoming a naked core devoid of volatile envelope? Here we propose two solutions to this: 1) HD\,110113\,b{} started with a large envelope of H-He, perhaps as much as 10\%, which was gradually lost to evaporation and core-powered heating over time. But it had just enough gas to walk the tight-rope between keeping hold of a thick atmosphere and being completely stripped such that, at the point that evaporative forcing stopped, HD\,110113\,b{} still had $\sim1\%$ of H-He by mass. The models of \citet[][Figure 4]{rogers2020unveiling} suggest such a scenario is possible and may occur for planets that start gas-rich with around 4\% H-He. 2) HD\,110113\,b{} did lose almost all of its H-He to evaporation and core-powered mass-loss. The current density is therefore explained by the planet having a large water content (e.g. an icy core), with potential out-gassing of a He-depleted secondary atmosphere contributing to the extended radius. Indeed, our composition calculations include water in only solid \& liquid states; therefore a thick steam \citep[or supercritical;][]{mousis2020irradiated} H$_{2}$O atmosphere could reduce the density without requiring $>50\%$ H$_{2}$O. One final solution might be that HD\,110113\,b{} and HD\,110113\,c{} underwent late-stage migration to their current positions, thereby avoiding much of the evaporative forcing caused by the X-ray emissions of the young star. However, there is no theoretical mechanism in which a low-eccentricity 2-planet system could undergo such late-stage migration long after the dispersal of the protoplanetary disc. Instead, multi-planet systems are capabale of undergoing early-stage migration damped by the protoplanetary gas disc \citep{2006A&A...450..833C,2019MNRAS.486.3874C}, and massive single planets are thought capable of undergoing late-stage, high-eccentricity scattering onto shorter orbits \citep{2008ApJ...686..621F,2012ApJ...751..119B}. We therefore consider a solution through in-situ processes more plausible than through migration. These two predictions may be testable with future transmission spectroscopy observations, e.g. with \textit{JWST} \citep{2016ApJ...817...17G,2014PASP..126.1134B}. \subsection{Potential for future observations}\label{sect:future} The low-density nature of this hot mini-Neptune, combined with its bright host star, may enable transmission spectroscopy observations. Such measurement could test the hypotheses noted above, and search for a low-molecular weight primary atmosphere dominated by H-He, or a high molecular weight secondary atmosphere dominated by an overabundance of water vapour \citep{2020arXiv201011867B}. To test this, we computed the emission and transmission spectroscopy metrics from \citet{kempton2018framework}. We find that, amongst small planets with $R_p<4R_\oplus$ \citep{akeson2013nasa}\footnote{\url{https://exoplanetarchive.ipac.caltech.edu/cgi-bin/nstedAPI/nph-nstedAPI?table=exoplanets&select=*&format=csv}, accessed 2020-Oct-18}, HD\,110113\,b{} ranks in the top 3\% most amenable for emission and the top 5\% for transmission spectroscopy with \textit{JWST}. Although, when compared to one of the most favourable \textit{JWST} targets: the low-density mini-Neptune GJ\,1214\,b, HD\,110113\,b{} provides only around 10\% the SNR in both transmission \& emission --- as is expected when comparing with a planet whose transits are 36 times deeper. HD\,110113\,b{} will be also re-observed by {\it TESS}{} during Sector 37\footnote{\url{https://heasarc.gsfc.nasa.gov/cgi-bin/tess/webtess/wtv.py?Entry=73228647}}, and could also be observed by ESA's \textit{CHEOPS} telescope \citep{benz2020cheops}, both of which would improve the radius precision below the currently measured value of 7\%, thereby improving our knowledge of the internal structure of HD\,110113\,b{}. \section{Conclusion} \label{sec:conclusion} We have presented the detection and confirmation of HD\,110113\,b{}, which was initially spotted as TOI-755.01{} in {\it TESS}{} with an SNR of only $7.6\sigma$ and transit depth of 410\,ppm{}. This marks one of the lowest-SNR signals yet to be confirmed from {\it TESS}{}, and is testament to the unique ability of {\it TESS}{} to find planet candidates around bright stars which can be redetected and characterised through independent RV campaigns. High-resolution imaging and ground-based photometry rules out the presence of nearby companions and potential nearby eclipsing binaries, thereby limiting the number of false-positives and giving us confidence to follow such a low-SNR signal. Our subsequent HARPS campaign obtained more than 100 {HARPS}{} spectra in order to characterise both HD\,110113\,b{} and its bright ($G=9.9$\,mag) star. Analysis of these spectra revealed HD\,110113{} to be a Sun-like G-type star with slightly super-solar metallicity, but solar $T_{\rm eff}${}, $\log g${} and age. The RV timeseries also revealed strong activity on HD\,110113{} with a rotation period of $ 20.8 \pm 1.2 $ {}\,d---a timescale corroborated by archival WASP photometry. Removing this rotation period using both linear decorrelation and a co-fitted GP using S-index and FWHM activity indicators revealed the presence of two Keplerian signals, at $ 2.541^{+0.0005}_{-0.001} $ {}\,d and $ 6.744^{+0.008}_{-0.009} $ {}\,d. The inner signal, from a planet with mass $ 4.55 \pm 0.62 $ {}\,M$_{\oplus}${}, corresponded to the detected {\it TESS}{} candidate with a radius, as modelled from the {\it TESS}{} photometry, of $ 2.05 \pm 0.12 $ {}\,R$_{\oplus}${}. The outer signal, from a planet with $M_p\sin{i}$ of $ 10.5 \pm 1.2 $ {}\,M$_{\oplus}${} did not correspond to any transit events in the {\it TESS}{} lightcurve, and therefore is likely non-transiting. We were able to confirm it as a planet through Bayesian model comparison which showed $\Delta{\rm BIC}= $$16.32${} in favour of a 2-planet model. The estimated density of HD\,110113\,b{} is $ 2.90^{+0.75}_{-0.59} $ {}\,\gcm{}---far lower than would be expected from a rocky core. By modelling four potential constituents---an iron core, silicate mantle, water ocean and H-He atmosphere---we were able to rule out a gasless composition for HD\,110113\,b{}, suggesting that it has between 0.07 and 1.5\% H-He by mass. This is surprising given HD\,110113\,b{}'s position in the "radius valley" between gaseous mini-Neptunes and rocky super-Earths, and we suggest two possibilities for this unexpectedly low density: either HD\,110113\,b{} has a water-rich core and secondary atmosphere, or it began with a thick H-He envelope and managed to retain a small fraction of it despite significant evaporation and/or heating. Follow-up spectroscopy observations with the next generation of telescopes may reveal the answer, as well as far more about this interesting system. \section*{Acknowledgements} {\footnotesize We thank Rapha{\"e}lle Haywood, Maximillian G{\"u}nther and Francois Bouchy for discussion on disentangling RV activity from signals.\\ This paper includes data collected by the {\it TESS}{} mission. Funding for the {\it TESS}{} mission is provided by the NASA Explorer Program and NASA's Science Mission directorate. We acknowledge the use of public {\it TESS}{} Alert data from pipelines at the {\it TESS}{} Science Office and at the {\it TESS}{} Science Processing Operations Center. This paper includes data collected by the {\it TESS}{} mission, which are publicly available from the Mikulski Archive for Space Telescopes (MAST).\\ This research has made use of the Exoplanet Follow-up Observation Program website, which is operated by the California Institute of Technology, under contract with the National Aeronautics and Space Administration under the Exoplanet Exploration Program. \\ Resources supporting this work were provided by the NASA High-End Computing (HEC) Program through the NASA Advanced Supercomputing (NAS) Division at Ames Research Center for the production of the SPOC data products. \\ This study is based on observations collected at the European Southern Observatory under ESO programme 1102.C-0249.\\ We thank the Swiss National Science Foundation (SNSF) and the Geneva University for their continuous support to our planet search programs. This work has been in particular carried out in the frame of the National Centre for Competence in Research {\it PlanetS} supported by the Swiss National Science Foundation (SNSF).\\ This publication makes use of The Data \& Analysis Center for Exoplanets (DACE), which is a facility based at the University of Geneva (CH) dedicated to extrasolar planets data visualisation, exchange and analysis. DACE is a platform of the Swiss National Centre of Competence in Research (NCCR) PlanetS, federating the Swiss expertise in Exoplanet research. The DACE platform is available at \url{https://dace.unige.ch}. \\ This work makes use of observations from the LCOGT network.\\ (Some of the) Observations in the paper made use of the High-Resolution Imaging instrument(s) ‘Alopeke (and/or Zorro). ‘Alopeke (and/or Zorro) was funded by the NASA Exoplanet Exploration Program and built at the NASA Ames Research Center by Steve B. Howell, Nic Scott, Elliott P. Horch, and Emmett Quigley. Data were reduced using a software pipeline originally written by Elliott Horch and Mark Everett. ‘Alopeke (and/or Zorro) was mounted on the Gemini North (and/or South) telescope of the international Gemini Observatory, a program of NSF’s OIR Lab, which is managed by the Association of Universities for Research in Astronomy (AURA) under a cooperative agreement with the National Science Foundation. on behalf of the Gemini partnership: the National Science Foundation (United States), National Research Council (Canada), Agencia Nacional de Investigación y Desarrollo (Chile), Ministerio de Ciencia, Tecnología e Innovación (Argentina), Ministério da Ciência, Tecnologia, Inovações e Comunicações (Brazil), and Korea Astronomy and Space Science Institute (Republic of Korea).\\ Based in part on observations obtained at the Southern Astrophysical Research (SOAR) telescope, which is a joint project of the Minist\'{e}rio da Ci\^{e}ncia, Tecnologia e Inova\c{c}\~{o}es (MCTI/LNA) do Brasil, the US National Science Foundation’s NOIRLab, the University of North Carolina at Chapel Hill (UNC), and Michigan State University (MSU), and the international Gemini Observatory, a program of NSF’s NOIRLab, which is managed by the Association of Universities for Research in Astronomy (AURA) under a cooperative agreement with the National Science Foundation. on behalf of the Gemini Observatory partnership: the National Science Foundation (United States), National Research Council (Canada), Agencia Nacional de Investigaci\'{o}n y Desarrollo (Chile), Ministerio de Ciencia, Tecnolog\'{i}a e Innovaci\'{o}n (Argentina), Minist\'{e}rio da Ci\^{e}ncia, Tecnologia, Inova\c{c}\~{o}es e Comunica\c{c}\~{o}es (Brazil), and Korea Astronomy and Space Science Institute (Republic of Korea).\\ \\ H.P.O. acknowledges support from NCCR/Planet-S via the CHESS fellowship.\\ D.J.A. acknowledges support from the STFC via an Ernest Rutherford Fellowship (ST/R00384X/1).\\ V.A., E.D.M., N.C.S., O.D.S.D. \& S.C.C.B. acknowledge support by FCT - Funda\c{c}\~ao para a Ci\^encia e a Tecnologia (Portugal) through national funds and by FEDER through COMPETE2020 - Programa Operacional Competitividade e Internacionaliza\c{c}\~ao by these grants: UID/FIS/04434/2019; UIDB/04434/2020; UIDP/04434/2020; PTDC/FIS-AST/32113/2017 \& POCI-01-0145-FEDER-032113; PTDC/FIS-AST/28953/2017 \& POCI-01-0145-FEDER-028953.\\ V.A. and E.D.M. further acknowledge the support from FCT through Investigador FCT contracts IF/00650/2015/CP1273/CT0001 and IF/00849/2015/CP1273/CT0003.\\ O.D.S.D. and S.C.C.B. are supported through Investigador contract (DL 57/2016/CP1364/CT0004) funded by FCT.\\ J.L-B. is supported by the Spanish State Research Agency (AEI) Projects No.ESP2017-87676-C5-1-R and No. MDM-2017-0737 Unidad de Excelencia "Mar\'ia de Maeztu"- Centro de Astrobiolog\'ia (INTA-CSIC)\\ D.D. acknowledges support from the TESS Guest Investigator Program grant 80NSSC19K1727 and NASA Exoplanet Research Program grant 18-2XRP18\_2-0136.\\ B.V.R. thanks the Heising-Simons Foundation for support.\\ T.D. acknowledges support from MIT's Kavli Institute as a Kavli postdoctoral fellow\\ A.O. acknowledges support from an STFC studentship.\\ S.H. acknowledges CNES funding through the grant 837319\\ D.J.A.B. acknowledges support by the UK Space Agency.\\ This research made use of the following python software: \texttt{exoplanet} \citep{exoplanet:exoplanet} and its dependencies \citep{exoplanet:agol19, exoplanet:astropy13, exoplanet:astropy18, exoplanet:exoplanet, exoplanet:foremanmackey17, exoplanet:foremanmackey18, exoplanet:luger18, exoplanet:pymc3, exoplanet:theano}; \texttt{numpy} \citep{harris2020array}; \texttt{scipy} \citep{virtanen2020scipy}; \texttt{pandas} \citep{mckinney2011pandas}; \texttt{astropy} \citep{robitaille2013astropy}; \texttt{matplotlib} \citep{hunter2007matplotlib}; \texttt{AstroImageJ} \citep{Collins:2017},; \texttt{TAPIR} \citep{Jensen:2013}. } \section{Data availability} The data underlying this article is publicly available - {\it TESS}{} data is stored on the Mikulski Archive for Space Telescopes (MAST) at \url{https://archive.stsci.edu/tess/}, while {HARPS}{} data is both available on the Data \& Analysis Center for Exoplanets (DACE) at \url{https://dace.unige.ch/}, and in Appendix tables \ref{tab:spec1} \& \ref{tab:spec2}. \bibliographystyle{mnras}
\section{Introduction} The fascinating ability to synthesize images using the state-of-the-art (SOTA) Generative Adversarial Networks (GANs) \citep{goodfellow2014generative} display a great potential of GANs for many intriguing real-life applications, such as image translation, photo editing, and artistic creation. However, expensive computing cost and the vast amount of required training data limit these SOTAs in real applications with only small image sets and low computing budgets. In real-life scenarios, the available samples to train a GAN can be minimal, such as the medical images of a rare disease, a particular celebrity's portrait set, and a specific artist's artworks. Transfer-learning with a pre-trained model \citep{mo2020freeze,wang2020minegan} is one solution for the lack of training images. Nevertheless, there is no guarantee to find a compatible pre-training dataset. Furthermore, if not, fine-tuning probably leads to even worse performance \citep{zhao2020differentiable}. \begin{figure}[h] \begin{center} \includegraphics[width=\linewidth]{landscape-ffhq.pdf} \end{center} \caption{\textbf{Synthetic results on $1024^2$ resolution} of our model, trained from scratch on single RTX 2080-Ti GPU, with only 1000 images. Left: 20 hours on Nature photos; Right: 10 hours on FFHQ.} \label{fig:quality-ours} \end{figure} In a recent study, it was highlighted that in art creation applications, most artists prefers to train their models from scratch based on their own images to avoid biases from fine-tuned pre-trained model. Moreover, It was shown that in most cases artists want to train their models with datasets of less than 100 images \citep{elgammal2020artists}. Dynamic data-augmentation \citep{karras2020training,zhao2020differentiable} smooths the gap and stabilizes GAN training with fewer images. However, the computing cost from the SOTA models such as StyleGAN2 \citep{karras2020analyzing} and BigGAN \citep{brock2018large} remain to be high, especially when trained with the image resolution on $1024\times1024$. In this paper, our goal is to learn an unconditional GAN on high-resolution images, with low computational cost and few training samples. As summarized in Fig.~\ref{fig:challenges}, these training conditions expose the model to a high risk of overfitting and mode-collapse~\citep{arjovsky2017towards,zhang2018pa}. To train a GAN given the demanding training conditions, we need a generator $G$ that can learn fast, and a discriminator $D$ that can continuously provide useful signals to train $G$. To address these challenges, we summarize our contribution as: \begin{itemize} \item We design the Skip-Layer channel-wise Excitation (SLE) module, which leverages low-scale activations to revise the channel responses on high-scale feature-maps. SLE allows a more robust gradient flow throughout the model weights for faster training. It also leads to an automated learning of a style/content disentanglement like StyleGAN2. \item We propose a self-supervised discriminator $D$ trained as a feature-encoder with an extra decoder. We force $D$ to learn a more descriptive feature-map covering more regions from an input image, thus yielding more comprehensive signals to train $G$. We test multiple self-supervision strategies for $D$, among which we show that auto-encoding works the best. \item We build a computational-efficient GAN model based on the two proposed techniques, and show the model's robustness on multiple high-fidelity datasets, as demonstrated in Fig.~\ref{fig:quality-ours}. \end{itemize} \section{Related Works} \begin{wrapfigure}{r}{0.5\textwidth} \centering \includegraphics[width=1\linewidth]{challenges.pdf} \caption{The causes and challenges for training GAN in our studied conditions.} \label{fig:challenges} \end{wrapfigure} \textbf{Speed up the GAN training}: Speeding up the training of GAN has been approached from various perspectives. \citeauthor{ngxande2019depthwisegans} propose to reduce the computing time with depth-wise convolutions. \citeauthor{zhong2020improving} adjust the GAN objective into a min-max-min problem for a shorter optimization path. \citeauthor{sinha2019small} suggest to prepare each batch of training samples via a core-set selection, leverage the better data preparation for a faster convergence. However, these methods only bring a limited improvement in training speed. Moreover, the synthesis quality is not advanced within the shortened training time. \textbf{Train GAN on high resolution}: High-resolution training for GAN can be problematic. Firstly, the increased model parameters lead to a more rigid gradient flow to optimize $G$. Secondly, the target distribution formed by the images on $1024\times1024$ resolution is super sparse, making GAN much harder to converge. \cite{denton2015deep,zhang2017stackgan,huang2017stacked,wang2018high,karras2019style,karnewar2019msg,karras2020analyzing,liu2020time} develop the multi-scale GAN structures to alleviate the gradient flow issue, where $G$ outputs images and receives feedback from several resolutions simultaneously. However, all these approaches further increase the computational cost, consuming even more GPU memory and training time. \textbf{Stabilize the GAN training}: Mode-collapse on $G$ is one of the big challenges when training GANs. And it becomes even more challenging given fewer training samples and a lower computational budget (a smaller batch-size). As $D$ is more likely to be overfitting on the datasets, thus unable to provide meaningful gradients to train $G$ \citep{gulrajani2017improved}. Prior works tackle the overfitting issue by seeking a good regularization for $D$, including different objectives \citep{arjovsky2017wasserstein,lim2017geometric,tran2017deep}; regularizing the gradients \citep{gulrajani2017improved,mescheder2018training}; normalizing the model weights \citep{miyato2018spectral}; and augmenting the training data \citep{karras2020training,zhao2020differentiable}. However, the effects of these methods degrade fast when the training batch-size is limited, since appropriate batch statistics can hardly be calculated for the regularization (normalization) over the training iterations. Meanwhile, self-supervision on $D$ has been shown to be an effective method to stabilize the GAN training as studied in \cite{tran2019self,chen2019self}. However, the auxiliary self-supervision tasks in prior works have limited using scenario and image domain. Moreover, prior works only studied on low resolution images ($32^2$ to $128^2$), and without a computing resource limitation. \section{Method} We adopt a minimalistic design for our model. In particular, we use a single conv-layer on each resolution in $G$, and apply only three (input and output) channels for the conv-layers on the high resolutions ($\geq512\times512$) in both $G$ and $D$. Fig.~\ref{fig:g_overview} and Fig.~\ref{fig:d_overview} illustrate the model structure for our $G$ and $D$, with descriptions of the component layers and forward flow. These structure designs make our GAN much smaller than SOTA models and substantially faster to train. Meanwhile, our model remains robust on small datasets due to its compact size with the two proposed techniques. \begin{figure}[h] \begin{center} \includegraphics[width=0.9\linewidth,height=3.9cm]{G_overview.pdf} \end{center} \caption{The structure of the skip-layer excitation module and the Generator. Yellow boxes represent feature-maps (we show the spatial size and omit the channel number), blue box and blue arrows represent the same up-sampling structure, red box contains the SLE module as illustrated on the left.} \label{fig:g_overview} \end{figure} \subsection{Skip-Layer channel-wise Excitation} For synthesizing higher resolution images, the generator $ G $ inevitably needs to become deeper, with more conv-layers, in concert with the up-sampling needs. A deeper model with more convolution layers leads to a longer training time of GAN, due to the increased number of model parameters and a weaker gradient flow through $G$ \citep{zhang2017stackgan,karras2017progressive,karnewar2019msg}. To better train a deep model, \citeauthor{he2016deep} design the Residual structure (ResBlock), which uses a skip-layer connection to strengthen the gradient signals between layers. However, while ResBlock has been widely used in GAN literature \citep{wang2018high,karras2020analyzing}, it also increases the computation cost. We reformulate the skip-connection idea with two unique designs into the \textit{Skip-Layer Excitation} module (SLE). First, ResBlock implements skip-connection as an element-wise addition between the activations from different conv-layers. It requires the spatial dimensions of the activations to be the same. Instead of addition, we apply channel-wise multiplications between the activations, eliminating the heavy computation of convolution (since one side of the activations now has a spatial dimension of $1^2$). Second, in prior GAN works, skip-connections are only used within the same resolution. In contrast, we perform skip-connection between resolutions with a much longer range (e.g., $8^2$ and $128^2$, $16^2$ and $256^2$), since an equal spatial-dimension is no longer required. The two designs make SLE inherits the advantages of ResBlock with a shortcut gradient flow, meanwhile without an extra computation burden. Formally, we define the Skip-Layer Excitation module as: \begin{align} \mathbf{y} = \mathcal{F}(\mathbf{x}_{low}, \{\mathbf{W}_{i}\}) \cdot \mathbf{x}_{high} \end{align} Here $\mathbf{x}$ and $\mathbf{y}$ are the input and output feature-maps of the SLE module, the function $\mathcal{F}$ contains the operations on $\mathbf{x}_{low}$, and $\mathbf{W}_i$ indicates the module weights to be learned. The left panel in Fig.~\ref{fig:g_overview} shows an SLE module in practice, where $\mathbf{x}_{low}$ and $\mathbf{x}_{high}$ are the feature-maps at $8\times8$ and $128\times128$ resolution respectively. An adaptive average-pooling layer in $\mathcal{F}$ first down-samples $\mathbf{x}_{low}$ into $4\times4$ along the spatial-dimensions, then a conv-layer further down-samples it into $1\times1$. A LeakyReLU is used to model the non-linearity, and another conv-layer projects $\mathbf{x}_{low}$ to have the same channel size as $\mathbf{x}_{high}$. Finally, after a gating operation via a Sigmoid function, the output from $\mathcal{F}$ multiplies $\mathbf{x}_{high}$ along the channel dimension, yielding $\mathbf{y}$ with the same shape as $\mathbf{x}_{high}$. SLE partially resembles the Squeeze-and-Excitation module (SE) proposed by \citeauthor{hu2018squeeze}. However, SE operates within one feature-map as a self-gating module. In comparison, SLE performs between feature-maps that are far away from each other. While SLE brings the benefit of channel-wise feature re-calibration just like SE, it also strengthens the whole model's gradient flow like ResBlock. The channel-wise multiplication in SLE also coincides with Instance Normalization \citep{ulyanov2016instance,huang2017arbitrary}, which is widely used in style-transfer. Similarly, we show that SLE enables $G$ to automatically disentangle the content and style attributes, just like StyleGAN \citep{karras2019style}. As SLE performs on high-resolution feature-maps, altering these feature-maps is shown to be more likely to change the style attributes of the generated image \citep{karras2019style,liu2020time}. By replacing $\mathrm{x}_{low}$ in SLE from another synthesized sample, our $G$ can generate an image with the content unchanged, but in the same style of the new replacing image. \subsection{Self-supervised discriminator} Our approach to provide a strong regularization for $D$ is surprisingly simple. We treat $D$ as an encoder and train it with small decoders. Such auto-encoding training forces $D$ to extract image features that the decoders can give good reconstructions. The decoders are optimized together with $D$ on a simple reconstruction loss, which is only trained on real samples: \begin{align} &\mathcal{L}_{recons}= \mathbb{E}_{ \mathbf{f} \sim D_{encode}(x), \; x \sim I_{real} } [ || \mathcal{G} ( \mathbf{f} ) - \mathcal{T}(x) || ], \label{eq:rec} \end{align} where $\mathbf{f}$ is the intermediate feature-maps from $D$, the function $\mathcal{G}$ contains the processing on $\mathbf{f}$ and the decoder, and the function $\mathcal{T}$ represents the processing on sample $x$ from real images $I_{real}$. \begin{figure}[h] \begin{center} \includegraphics[width=0.9\linewidth,height=3.6cm]{D_overview.pdf} \end{center} \caption{The structure and the forward flow of the Discriminator. Blue box and arrows represent the same residual down-sampling structure, green boxes mean the same decoder structure.} \label{fig:d_overview} \end{figure} Our self-supervised $D$ is illustrated in Fig.~\ref{fig:d_overview}, where we employ two decoders for the feature-maps on two scales: $\mathbf{f}_1$ on $16^2$ and $\mathbf{f}_2$ on $8^2$ . The decoders only have four conv-layers to produce images at $128\times128$ resolution, causing little extra computations (much less than other regularization methods). We randomly crop $\mathbf{f}_1$ with $\frac{1}{8}$ of its height and width, then crop the real image on the same portion to get $I_{part}$. We resize the real image to get $I$. The decoders produce $I'_{part}$ from the cropped $\mathbf{f}_1$, and $I'$ from $\mathbf{f}_2$. Finally, $D$ and the decoders are trained together to minimize the loss in eq.~\ref{eq:rec}, by matching $I'_{part}$ to $I_{part}$ and $I'$ to $I$. Such reconstructive training makes sure that $D$ extracts a more comprehensive representation from the inputs, covering both the overall compositions (from $\mathbf{f}_2$) and detailed textures (from $\mathbf{f}_1$). Note that the processing in $\mathcal{G}$ and $\mathcal{T}$ are not limited to cropping; more operations remain to be explored for better performance. The auto-encoding approach we employ is a typical method for self-supervised learning, which has been well recognized to improve the model robustness and generalization ability \citep{he2020momentum,hendrycks2019using,jing2020self,goyal2019scaling}. In the context of GAN, we find that a regularized $D$ via self-supervision training strategies significantly improves the synthesis quality on $G$, among which auto-encoding brings the most performance boost Although our self-supervision strategy for $D$ comes in the form of an auto-encoder (AE), this approach is fundamentally different from works trying to combine GAN and AE \citep{larsen2016autoencoding,guo2019auto,zhao2016energy,berthelot2017began}. The latter works mostly train $ G $ as a decoder on a learned latent space from $ D $, or treat the adversarial training with $ D $ as an supplementary loss besides AE's training. In contrast, our model is a pure GAN with a much simpler training schema. The auto-encoding training is only for regularizing $D$, where $G$ is not involved. In sum, we employ the hinge version of the adversarial loss (\cite{lim2017geometric,tran2017deep}) to iteratively train our D and G. We find the different GAN losses make little performance difference, while hinge loss computes the fastest: \begin{align} \mathcal{L}_{D}= &- \mathbb{E}_{ x \sim I_{real} } [ min(0, -1 + D(x)) ] -\mathbb{E}_{ \hat{x} \sim G(z) }[ min(0, -1 - D(\hat{x}) ] + \mathcal{L}_{recons} \\ \mathcal{L}_{G}= &-\mathbb{E}_{ z \sim \mathcal{N} }[ D( G(z) ) ] , \end{align} \section{Experiment} \textbf{Datasets}: We conduct experiments on multiple datasets with a wide range of content categories. On $256\times256$ resolution, we test on Animal-Face Dog and Cat \citep{si2011learning}, 100-Shot-Obama, Panda, and Grumpy-cat \citep{zhao2020differentiable}. On $1024\times1024$ resolution, we test on Flickr-Face-HQ (FFHQ) \citep{karras2019style}, Oxford-flowers \citep{Nilsback06}, art paintings from WikiArt (wikiart.org), photographs on natural landscape from Unsplash (unsplash.com), Pokemon (pokemon.com), anime face, skull, and shell. These datasets are designed to cover images with different characteristics: photo realistic, graphic-illustration, and art-like images. \textbf{Metrics}: We use two metrics to measure the models' synthesis performance: 1) Fréchet Inception Distance (FID)~\citep{heusel2017gans} measures the overall semantic realism of the synthesized images. For datasets with less than 1000 images (most only have 100 images), we let $G$ generate 5000 images and compute FID between the synthesized images and the whole training set. 2) Learned perceptual similarity (LPIPS)~\citep{zhang2018unreasonable} provides a perceptual distance between two images. We use LPIPS to report the reconstruction quality when we perform latent space back-tracking on $G$ given real images, and measure the auto-encoding performance. We find it unnecessary to involve other metrics, as FID is unlikely to be inconsistent with the others, given the notable performance gap between our model and the compared ones. For all the testings, we train the models 5 times with random seeds, and report the highest scores. The relative error is less than five percent on average. \textbf{Compared Models}: We compare our model with: 1) the state-of-the-art (SOTA) unconditional model, StyleGAN2, 2) a baseline model ablated from our proposed one. Note that we adopt StyleGAN2 with recent studies from \citep{karras2020training,zhao2020differentiable}, including the model configuration and differentiable data-augmentation, for the best training on few-sample datasets. Since StyleGAN2 requires much more computing-cost (cc) to train, we derive an extra baseline model. In sum, we compare our model with StyleGAN2 on the absolute image synthesis quality regardless of cc, and use the baseline model for the reference within a comparable cc range. The baseline model is the strongest performer that we integrated from various GAN techniques based on DCGAN \citep{radford2015unsupervised}: 1) spectral-normalization \citep{miyato2018spectral}, 2) exponential-moving-average \citep{yazici2018unusual} optimization on $G$, 3) differentiable-augmentation, 4) GLU \citep{dauphin2017language} instead of ReLU in $G$. We build our model upon the baseline with the two proposed techniques: the skip-layer excitation module and the self-supervised discriminator. \begin{table}[h] \caption{Computational cost comparison of the models.} \label{table:compute-cost} \begin{center} \resizebox{\linewidth}{!}{ \begin{tabular}{l|l| r r r r r} \toprule \multicolumn{2}{c}{} & [email protected] & [email protected] & StyleGAN2 & Baseline & Ours \\ \cmidrule{1-7} \multirow{3}{*}{\begin{tabular}[c]{@{}l@{}}Resolution: $256^2$ \\ Batch-size: 8\end{tabular}} & Training time (hour / 10k iter) & 1 & 1.8 & 3.8 & 0.7 & 1 \\ & Training vram (GB) & 7 & 16 & 18 & 5 & 6.5 \\ & Model parameters (million) & 27.557 & 45.029 & 108.843 & 44.359 & 47.363 \\ \midrule \multirow{3}{*}{\begin{tabular}[c]{@{}l@{}}Resolution: $1024^2$\\ Batch-size: 8\end{tabular}} & Training time (hour / 10k iter) & 3.6 & 5 & 7 & 1.3 & 1.7 \\ & Training vram (GB) & 12 & 23 & 36 & 9 & 10 \\ & Model parameters (million) & 27.591 & 45.15 & 109.229 & 44.377 & 47.413 \\ \bottomrule \end{tabular} } \end{center} \end{table} Table.~\ref{table:compute-cost} presents the normalized cc figures of the models on Nvidia's RTX 2080-Ti GPU, implemented using PyTorch \citep{paszke2017automatic}. Importantly, the slimed StyleGAN2 with $\frac{1}{4}$ parameters cannot converge on the tested datasets at $1024^2$ resolution. We compare to the StyleGAN2 with $\frac{1}{2}$ parameters (if not specifically mentioned) in the following experiments. \subsection{Image synthesis performance} \textbf{Few-shot generation}: Collecting large-scale image datasets are expensive, or even impossible, for a certain character, a genre, or a topic. On those few-shot datasets, a data-efficient model becomes especially valuable for the image generation task. In Table.~\ref{table:fid-256} and Table.~\ref{table:fid-1024}, we show that our model not only achieves superior performance on the few-shot datasets, but also much more computational-efficient than the compared methods. We save the checkpoints every 10k iterations during training and report the best FID from the checkpoints (happens at least after 15 hours of training for StyleGAN2 on all datasets). Among the 12 datasets, our model performs the best on 10 of them. Please note that, due to the VRAM requirement for StyleGAN2 when trained on $1024^2$ resolution, we have to train the models in Table.~\ref{table:fid-1024} on a RTX TITAN GPU. In practice, 2080-TI and TITAN share a similar performance, and our model runs the same time on both GPUs. \begin{table}[h] \vspace{-0mm} \caption{FID comparison at $256^2$ resolution on few-sample datasets.} \label{table:fid-256} \vspace{-2mm} \begin{center} \resizebox{\linewidth}{!}{ \begin{tabular}{l|l|l|r r r r r} \toprule \multicolumn{3}{c}{} & Animal Face - Dog & Animal Face - Cat & Obama & Panda & Grumpy-cat \\ \midrule \multicolumn{3}{c|}{Image number} & 389 & 160 & 100 & 100 & 100 \\ \midrule \multirow{6}{*}{\begin{tabular}[c]{@{}l@{}}Training time on\\ one RTX 2080-Ti\end{tabular}} & \multirow{2}{*}{20 hour} & StyleGAN2 & 58.85 & 42.44 & 46.87 & 12.06 & 27.08 \\ & & StyleGAN2 finetune & 61.03 & 46.07 & \textbf{35.75} & 14.5 & 29.34 \\ \cmidrule{2-8} & \multirow{4}{*}{5 hour} & Baseline & 108.19 & 150.3 & 62.74 & 15.4 & 42.13 \\ & & Baseline+Skip & 94.21 & 72.97 & 52.50 & 14.39 & 38.17 \\ & & Baseline+decode & 56.25 & 36.74 & 44.34 & 10.12 & 29.38 \\ & & Ours (B+Skip+decode) & \textbf{50.66} & \textbf{35.11} & 41.05 & \textbf{10.03} & \textbf{26.65} \\ \bottomrule \end{tabular}} \end{center} \vspace{-2mm} \end{table} \textbf{Training from scratch vs. fine-tuning}: Fine-tuning from a pre-trained GAN \citep{mo2020freeze,noguchi2019image,wang2020minegan} has been the go-to method for the image generation task on datasets with few samples. However, its performance highly depends on the semantic consistency between the new dataset and the available pre-trained model. According to \citeauthor{zhao2020differentiable}, fine-tuning performs worse than training from scratch in most cases, when the content from the new dataset strays away from the original one. We confirm the limitation of current fine-tuning methods from Table.~\ref{table:fid-256} and Table.~\ref{table:fid-1024}, where we fine-tune StyleGAN2 trained on FFHQ use the Freeze-D method from \citeauthor{mo2020freeze}. Among all the tested datasets, only Obama and Skull favor the fine-tuning method, making sense since the two sets share the most similar contents to FFHQ. \textbf{Module ablation study}: We experiment with the two proposed modules in Table.~\ref{table:fid-256}, where both SLE (skip) and decoding-on-$D$ (decode) can separately boost the model performance. It shows that the two modules are orthogonal to each other in improving the model performance, and the self-supervised $D$ makes the biggest contribution. Importantly, the baseline model and StyleGAN2 diverge fast after the listed training time. In contrast, our model is less likely to mode collapse among the tested datasets. Unlike the baseline model which usually model-collapse after trained for 10 hours, our model maintains a good synthesis quality and won't collapse even after trained for 20 hours. We argue that it is the decoding regularization on $ D $ that prevents the model from divergence. \begin{table}[h] \vspace{-0mm} \caption{FID comparison at $1024^2$ resolution on few-sample datasets.} \vspace{-2mm} \label{table:fid-1024} \begin{center} \resizebox{\linewidth}{!}{ \begin{tabular}{l|l|l|r r r r r r r } \toprule \multicolumn{3}{c}{} & Art Paintings & FFHQ & Flower & Pokemon & Anime Face & Skull & Shell \\ \midrule \multicolumn{3}{c|}{Image number} & 1000 & 1000 & 1000 & 800 & 120 & 100 & 60 \\ \midrule \multirow{4}{*}{\begin{tabular}[c]{@{}l@{}}Training \\time on one \\ RTX TITAN\end{tabular}} & \multirow{2}{*}{24 hour} & StyleGAN2 & 74.56 & 25.66 & 45.23 & 190.23 & 152.73 & 127.98 &241.37 \\ & & StyleGAN2 finetune & N/A & N/A & 36.72 & 60.12 & 61.23& \textbf{107.68} & 220.45 \\ \cmidrule{2-10} & \multirow{2}{*}{8 hour} & Baseline & 62.27 & 38.35 & 42.25 & 67.86 & 101.23 & 186.45 & 202.32 \\ & & Ours & \textbf{45.08} & \textbf{24.45} & \textbf{25.66} & \textbf{57.19} & \textbf{59.38} & 130.05 & \textbf{155.47} \\ \bottomrule \end{tabular}} \end{center} \vspace{-0mm} \end{table} \begin{table}[h] \vspace{-2mm} \caption{FID comparison at $1024^2$ resolution on datasets with more images.} \label{table:fid-1024-more} \vspace{-2mm} \begin{center} \resizebox{0.96\linewidth}{!}{ \begin{tabular}{l | l | l l l | l l l l | l l l} \toprule \multirow{2}{*}{\begin{tabular}[c]{@{}l@{}} Model \end{tabular}} & Dataset & \multicolumn{3}{c}{Art Paintings} & \multicolumn{4}{c}{FFHQ} & \multicolumn{3}{c}{Nature Photograph} \\ \cmidrule{2-12} & Image number & 2k & 5k & 10k & 2k & 5k & 10k & 70k & 2k & 5k & 10k\\ \midrule \multicolumn{2}{l|}{StyleGAN2} & 70.02 & 48.36 & \textbf{41.23} & \textbf{18.38} & \textbf{10.45} & \textbf{7.86} & \textbf{4.4} & 67.12 & \textbf{41.47} & \textbf{39.05} \\ \midrule \multicolumn{2}{l|}{Baseline} & 60.02 & 51.23 & 49.38 & 36.45 & 27.86 & 25.12 & 17.62 & 71.47 & 66.05 & 62.28\\ \midrule \multicolumn{2}{l|}{Ours} & \textbf{44.57} & \textbf{43.27} & 42.53 & 19.01 & 17.93 & 16.45 & 12.38 & \textbf{52.47} & 45.07 & 43.65 \\ \bottomrule \end{tabular}} \end{center} \vspace{-0mm} \end{table} \textbf{Training with more images}: For more thorough evaluation, we also test our model on datasets with more sufficient training samples, as shown in Table.~\ref{table:fid-1024-more}. We train the full StyleGAN2 for around five days on the Art and Photograph dataset with a batch-size of 16 on two TITAN RTX GPUs, and use the latest official figures on FFHQ from \citeauthor{zhao2020differentiable}. Instead, we train our model for only 24 hours, with a batch-size of 8 on a single 2080-Ti GPU. Specifically, for FFHQ with all 70000 images, we train our model with a larger batch-size of 32, to reflect an optimal performance of our model. In this test, we follow the common practice of computing FID by generating 50k images and use the whole training set as the reference distribution. Note that StyleGAN2 has more than double the parameters compared to our model, and trained with a much larger batch-size on FFHQ. These factors contribute to its better performances when given enough training samples and computing power. Meanwhile, our model keeps up well with StyleGAN2 across all testings with a considerably lower computing budget, showing a compelling performance even on larger-scale datasets, and a consistent performance boost over the baseline model. \textbf{Qualitative results}: The advantage of our model becomes more clear from the qualitative comparisons in Fig.~\ref{fig:quality-compare}. Given the same batch-size and training time, StyleGAN2 either converges slower or suffers from mode collapse. In contrast, our model consistently generates satisfactory images. Note that the best results from our model on Flower, Shell, and Pokemon only take three hours' training, and for the rest three datasets, the best performance is achieved at training for eight hours. For StyleGAN2 on “shell”, “anime face”, and “Pokemon”, the images shown in Fig.~\ref{fig:quality-compare} are already from the best epoch, which they match the scores in Table.~\ref{table:fid-256} and Table.~\ref{table:fid-1024}. For the rest of the datasets, the quality increase from StyleGAN2 is also limited given more training time. \subsection{More Analysis and Applications} \begin{table} \begin{minipage}{0.56\linewidth} \centering \hspace{-1cm} \includegraphics[width=\linewidth,height=0.8\linewidth]{back-track-interpolate.pdf} \captionof{figure}{Latent space back-tracking and interpolation.} \label{fig:back-track-interpolate} \end{minipage}\hfill \begin{minipage}{0.4\linewidth} \caption{LPIPS of back-tracking with $G$} \label{table:lpips-back-track} \resizebox{\linewidth}{!} \begin{tabular}{l | l l l l} \toprule & Cat & Dog & FFHQ & Art \\ \midrule Resolution & \multicolumn{2}{c|}{256} & \multicolumn{2}{c}{1024} \\ \midrule Baseline @ 20k iter & 2.113 & 2.073 & 2.589 & 2.916\\ Baseline @ 40k iter & 2.513 & 2.171 & 2.583 & 2.812\\ Ours @ 40k iter & \textbf{1.821} & \textbf{1.918} & 2.425 & 2.624\\ Ours @ 80k iter & 1.897 & 1.986 & \textbf{2.342} & \textbf{2.601} \\ \bottomrule \end{tabular}} \vspace{8mm} \caption{FID of self-supervisions for $D$} \label{table:fid-self-supervise} \resizebox{\linewidth}{!} \begin{tabular}{l | c c } \toprule & Art paintings & Nature photos \\ \midrule a. contrastive loss & 47.14 & 57.04\\ b. predict aspect ratio & 49.21 & 59.22 \\ c. auto-encoding & \textbf{42.53} & \textbf{43.65} \\ d. a+b & 46.02 & 54.23 \\ e. a+b+c & 44.21 & 47.65 \\ \bottomrule \end{tabular}} \end{minipage} \end{table} \textbf{Testing mode collapse with back-tracking}: From a well trained GAN, one can take a real image and invert it back to a vector in the latent space of $ G $, thus editing the image's content by altering the back-tracked vector. Despite the various back-tracking methods \citep{zhu2016generative,lipton2017precise,zhu2020domain,abdal2019image2stylegan}, a well generalized $G$ is arguably as important for the good inversions. To this end, we show that our model, although trained on limited image samples, still gets a desirable performance on real image back-tracking \begin{figure} \begin{center} \includegraphics[width=1\linewidth,height=1.46\linewidth]{quality_long_compressed.pdf} \end{center} \caption{\textbf{Qualitative comparison between our model and StyleGAN2} on $1024^2$ resolution datasets. The left-most panel shows the training images, and the right two panels show the uncurated samples from StyleGAN2 and our model. Both models are trained from scratch for 10 hours with a batch-size of 8. The samples are generated from the checkpoint with the lowest FID. } \label{fig:quality-compare} \end{figure} In Table~\ref{table:lpips-back-track}, we split the images from each dataset with a training/testing ratio of 9:1, and train $G$ on the training set. We compute a reconstruction error between all the images from the testing set and their inversions from $G$, after the same update of 1000 iterations on the latent vectors (to prevent the vectors from being far off the normal distribution). The baseline model's performance is getting worse with more training iterations, which reflects mode-collapse on $ G $. In contrast, our model gives better reconstructions with consistent performance over more training iterations. Fig.~\ref{fig:back-track-interpolate} presents the back-tracked examples (left-most and right-most samples in the middle panel) given the real images. The smooth interpolations from the back-tracked latent vectors also suggest little mode-collapse of our $G$ \citep{radford2015unsupervised,zhao2020differentiable,robb2020few}. In addition, we show qualitative comparisons in appendix D, where our model maintains a good generation while StyleGAN2 and baseline are model-collapsed. \textbf{The self-supervision methods and generalization ability on $D$}: Apart from the auto-encoding training for $ D $, we show that $ D $ with other common self-supervising strategies also boost GAN's performance in our training settings. We test five self-supervision settings, as shown in Table~\ref{table:fid-self-supervise}, which all brings a substantial performance boost compared to the baseline model. Specifically, setting-a refers to contrastive learning which we treat each real image as a unique class and let $ D $ classify them. For setting-b, we train $D$ to predict the real image's original aspect-ratio since they are reshaped to square when fed to $D$. Setting-c is the method we employ in our model, which trains $ D $ as an encoder with a decoder to reconstruct real images. To better validate the benefit of self-supervision on $D$, all the testings are conducted on full training sets with 10000 images, with a batch-size of 8 to be consistent with Table~\ref{table:fid-1024-more}. We also tried training with a larger batch-size of 16, which the results are consistent to the batch-size of 8. \begin{figure} \centering \includegraphics[width=1\linewidth,height=0.6\linewidth]{style-mixing_compressed.pdf} \caption{\textbf{Style-mixing results} from our model trained for only 5 hours on single GPU. } \label{fig:style-mixing} \end{figure} Interestingly, according to Table~\ref{table:fid-self-supervise}, while setting-c performs the best, combining it with the rest two settings lead to a clear performance downgrade. The similar behavior can be found on some other self-supervision settings, e.g. when follow \cite{chen2019self} with a "rotation-predicting" task on art-paintings and FFHQ datasets, we observe a performance downgrade even compared to the baseline model. We hypothesis the reason being that the auto-encoding forces $D$ to pay attention to more areas of the input image, thus extracts a more comprehensive feature-map to describe the input image (for a good reconstruction). In contrast, a classification task does not guarantee $D$ to cover the whole image. Instead, the task drives $D$ to only focus on small regions because the model can find class cues from small regions of the images. Focusing on limited regions (i.e., react to limited image patterns) is a typical overfitting behavior, which is also widely happening for $D$ in vanilla GANs. More discussion can be found in appendix B. \textbf{Style mixing like StyleGAN}. With the channel-wise excitation module, our model gets the same functionality as StyleGAN: it learns to disentangle the images' high-level semantic attributes (style and content) in an unsupervised way, from $G$'s conv-layers at different scales. The style-mixing results are displayed in Fig.~\ref{fig:style-mixing}, where the top three datasets are $256\times256$ resolution, and the bottom three are $1024\times1024$ resolution. While StyleGAN2 suffers from converging on the bottom high-resolution datasets, our model successfully learns the style representations along the channel dimension on the ``excited" layers (i.e., for feature-maps on $256\times256$, $512\times512$ resolution). Please refer to appendix A and C for more information on SLE and style-mixing. \section{Conclusion} We introduce two techniques that stabilize the GAN training with an improved synthesis quality, given sub-hundred high-fidelity images and a limited computing resource. On thirteen datasets with a diverse content variation, we show that a skip-layer channel-wise excitation mechanism (SLE) and a self-supervised regularization on the discriminator significantly boost the synthesis performance of GAN. Both proposed techniques require minor changes to a vanilla GAN, enhancing GAN's practicality with a desirable plug-and-play property. We hope this work can benefit downstream tasks of GAN \citep{liu2020oogan,Liu_2020_ACCV,elgammal2017can} and provide new study perspectives for future research.
\section{Introduction} For the foreseeable future, quantum computing will be performed in very resource restricted environments, where the number of qubits (e.g. hardware) is the biggest constraint. Practical problems (e.g. quantum chemistry) are solved by executing a quantum circuit. The goal is to use the smallest possible amount of hardware for executing a computation, error-corrected or not. When assuming only circuit widths the decisions are straightforward, but circuit depth has to be considered too. A circuit's depth is indicative for the execution time of the computation, and its width is the number of qubits required. Recent works concerned with resource estimations of fault-tolerant computations assumed that Clifford operations have negligible cost, and that the runtime of a quantum computer is dominated by the cost of executing non-Clifford gates \cite{sanders2020compilation, chakrabarti2020threshold}. However, this is not necessarily a realistic assumption. In asymptotic worst case estimations, constant factors are insignificant. Nonetheless, as we will show in this paper, the depth could be underestimated by up to 1/3. Such ratios impact, for example, the distance of the code required to protect the quantum error-corrected (QECC) version of the computation. It is assumed that the Toffoli+H gate set is at a higher level than the Clifford+T one. The Clifford+T to Toffoli+H compilation is not being realised in the literature yet. This work focuses on the optimisation potential when translating circuits from the Toffoli+H to the Clifford+T gate set. The Clifford+T gate set is very often used for preparing QECC circuits. To this end, the Clifford+T form of Toffoli gates has received considerable attention with respect to QECCs. When departing from the asymptotic method, how should realistic worst case resource estimations be performed? We argue that significant optimisations can be achieved by making appropriate Toffoli gate decomposition choices. We find out that: \begin{itemize} \item T-count optimisation can be detrimental to a circuit's depth: reducing T-count can increase the overall depth; \item due to low connectivity and complexity of noisy intermediate-scale quantum (NISQ) circuit compilation, it may be useful to replace circuit CNOTs with measurements; \item ripple-carry arithmetic is more resource efficient than carry-lookahead for particular width ranges (cf. ripple-carry based multiplier has the width of a carry-lookahead adder). \end{itemize} This work is structured as follows: Section~\ref{sec:back} introduces the circuit types analysed in this work, as well as the Toffoli gate decompositions. Section~\ref{sec:methods} describes the methodology of how we optimise resources of the arithmetic circuits. Section~\ref{sec:res} presents the contributions. We conclude by formulating future work related to the automatic optimisation of large-scale quantum circuits. \section{Background} \label{sec:back} Quadratic speedups seem to be not sufficient for achieving a quantum computing advantage. This observation was first made by \cite{gheorghiu2019benchmarking} and then extended, for example, by \cite{sanders2020compilation}. The optimisation of arithmetic circuits for applications with an exponential speedup becomes even more important. Due to their logarithmic depth, carry-lookahead adders started receiving increased attention. Recent examples are \cite{thapliyal2020quantum, oonishi2020efficient} which consider the adaptation of the circuits to both NISQ and surface QECC. The cost of a circuit is generally considered being determined either by the number of T gates (T-count, for QECC protected circuits, \cite{gheorghiu2019benchmarking}), or the number of CNOT gates (CNOT-count, for NISQ circuits \cite{nash2020quantum}). \subsection{Gate Parallelism} We make the following realistic assumptions. First, gate parallelism is possible, but T state distillations are sequential in time (one at a time). This is because parallelising distillations is truly a luxury wrt. the available hardware: One will choose to operate additional logical qubits instead of executing more distillations in parallel. This does not mean that T gates cannot be executed in parallel: T states may be distilled and stored in a queue when T gates are not used \cite{paler2019clifford}. Secondly, single-control-multiple-target CNOT gates have depth 1. This kind of CNOT parallelism is not necessarily always possible with all hardware platforms. However, the lack of CNOT parallelism is one of the least problems, because of the restricted connectivity: Not all NISQ machines support all-to-all connectivity between qubits. Connectivity plays a significant role in the success of executing a quantum circuit: The more the better. In general, all-to-all (logical) qubit connectivity exists in QECC protected circuits. There are hardware proposals where connectivity is better than 2D nearest neighbour, as available in superconducting circuits \cite{linke2017experimental, wright2019benchmarking}. \begin{figure}[!t] \includegraphics[width=\columnwidth]{toffoli_4_ancilla.png} \caption{Four ancillae T-depth 1 (4AT1) Toffoli gate decomposition. The upper three wires are for the Toffoli gate. The ancillae are initialised to $\ket{0}$.} \label{fig:4at1} \end{figure} \begin{figure}[!t] \centering \includegraphics[width=\columnwidth]{toffoli_0_ancilla.png} \caption{Zero ancilla T-depth 3 (0AT3) Toffoli decomposition \cite{selinger2013quantum}. This circuit has a depth of 9 compared to depth 10 presented in \cite{munoz2018quantum}.} \label{fig:0at3} \end{figure} \subsection{Toffoli Gate Decompositions} The literature includes two types of Toffoli gate decompositions: 1) the exact ones having 7 T gates and a various number of ancillae; 2) the relative phase decompositions using 4 T gates and various numbers of CNOTs and ancillae. In the latter case, the number of CNOT gates in the decomposition influences the implemented relative phase, and there cannot be less than 3 CNOTs \cite{song2003simplified}. The relative phase Toffoli gate is also known as the Margolus gate, or the simplified Toffoli gate. It has been presented in different formulations, for example, by \cite{selinger2013quantum, jones2013low,gidney2018halving,maslov2016}. The work of \cite{maslov2016} mentions that there is a relation between T-count and CNOT-count in the Toffoli gate decompositions and conjectures that the optimisation of quantum circuits could benefit from using it. The standard Toffoli gate decomposition is the one from \cite{nielsen} (abrv. ST, see Fig.~\ref{fig:ntoff} in Appendix). The inverse of the relative phase Toffoli gate has been implemented by now in two manners. The first is by running in reverse the Clifford+T decomposition of the gate. The second implementation is a measurement-based circuit applied when the target of the relative phase gate is treated like an ancilla to reset the ancilla and to correct the wrong phase on the control wires. In the Appendix, we show that the same uncomputation circuit can be used for multiple types of relative phase Toffoli gates. \subsection{Quantum Arithmetic Circuits} Quantum addition circuits can be classified \cite{rines2018high} at least into: a) ripple-carry \cite{vedral1996quantum}; and b) carry-lookahead \cite{draper2006logarithmic}. The first have a smaller width but are deeper, whereas the latter are wider and shallower. Carry-lookahead adders are very often used in classical computers, and have a logarithmic depth at the expense of introducing more ancillae: $\mathcal{O}(4n)$ width. Although carry-lookahead seems more expensive than a ripple-carry circuit, there has been so far no exhaustive quantitative analysis between the two adder approaches in the literature. In this paper, we perform such an analysis. Our analysis considers the ripple-carry \cite{munoz2018quantum} and the carry-lookahead \cite{thapliyal2020quantum, oonishi2020efficient} adders. The first introduced a controlled-adder (ripple-carry) that has a total width of $2n+3$ qubits and a depth of $5n-1$. The second optimised the carry-lookahead circuit from \cite{draper2006logarithmic} by replacing exact Toffoli gates with relative phase Toffoli gates similar to how this was realised by \cite{thapliyal2020quantum}. \section{Methods} \label{sec:methods} We replace Toffoli gates with exact (Figs.~\ref{fig:4at1} and~\ref{fig:0at3}) or relative phase (Figs.~\ref{fig:rt3} and~\ref{fig:rt4}) Clifford+T decompositions. We either replace single or pairs of Toffoli gates (e.g. Fig.~\ref{fig:rel}). We will call \emph{optimise depth beneficial} (ODB) the replacement circuit when the first relative phase Toffoli is replaced with one of the decompositions from Table~\ref{tbl:analysis} and the second with the measurement-based uncomputation. The replacement method from Fig.~\ref{fig:rel} was used, for example, in \cite{thapliyal2020quantum, oonishi2020efficient}. The replacement: a) guarantees the correctness of the resulting circuit without laying it out and verifying it; b) introduces, however, an ancilla which controls a CNOT on the initial target of the Toffoli. This is effectively the method used by \cite{gidney2018halving} as well: Two Toffoli gates which a) share the control wires and b) their target qubit is used during its entire lifetime only as control by further operations, can be simplified to a relative phase gate and measurement-based uncomputation. \begin{figure} \centering \includegraphics[width=0.8\columnwidth]{rt3.png} \caption{RT3. A relative phase Toffoli decomposition with 3 CNOT gates. Running this circuit in reverse is called IRT3, and is the same as RT3.} \label{fig:rt3} \end{figure} \begin{figure} \centering \includegraphics[width=0.85\columnwidth]{rt4.png} \caption{RT4. A relative phase Toffoli decomposition with 4 CNOT gates. Running this circuit in reverse is called IRT4.} \label{fig:rt4} \end{figure} Our method is based on the investigation on the adder and multiplier circuits, and choosing the best way to compile the circuit based on its overall depth, T-depth and width (e.g. number of qubits). We use QUANTIFY \cite{oumarou2020quantify} to count exactly the gates and determine the depth of the circuits. The work of \cite{oonishi2020efficient} analyses the role of Toffoli gate decompositions for improving carry-lookahead adder circuits. Such circuits have logarithmic depth but their width is almost double compared to the ripple-carry ones. It is interesting to analyse the trade-off between these two types of arithmetic circuits and to determine which one is most compatible with computers where quantum hardware is definitely the limiting factor to scalability. \begin{figure} \centering \includegraphics[width=0.6\columnwidth]{relscheme.png} \caption{Simple method for replacing exact Toffoli gates with relative phase Toffoli gates. The double-controlled gates with a triangle are relative phase Toffoli gates. These come in pairs, and the second gate is uncomputing the ancilla initialised in $\ket{0}$. We call this circuit \emph{optimise depth beneficial} (ODB) when the first gate is replaced with one from Table~\ref{tbl:analysis} and the last gate is replaced with a measurement-based uncomputation. When both gates are replaced with one of the decompositions from Table~\ref{tbl:analysis} the notation is, for example, \emph{ST/ST}. This scheme is also known as the Bennett trick.} \label{fig:rel} \end{figure} \begin{table}[!t] \centering \begin{tabular}{ l c c c c} $Tof. Dec.$ & $Depth$ & $CNOT_c$ & $T_d$ & $T_c$\\ \hline 0AT3 & 10 (9) & 7 & 3 & 7\\ 4AT1 & 7 & 16 & 1 & 7\\ RT3 & 9 & 3 & 4 & 4\\ RT4 & 10 & 4 & 4 & 4\\ \hline ST & 13 & 6 & 6 & 7 \\ AND & 9 & 6 & 2 & 4 \end{tabular} \caption{The costs of the different Toffoli gate decompositions. For 0AT3, we consider wrt. the arithmetic circuits the depth of the circuit from \cite{munoz2018quantum}, although 0AT3 can have depth 9. RT3 and RT4 do not include the uncomputation (depth 4). ST is the standard Toffoli decomposition from \cite{nielsen} and AND is the relative phase Toffoli gate from \cite{gidney2018halving}.} \label{tbl:analysis} \end{table} \begin{figure}[!t] \centering \includegraphics[width=0.35\columnwidth]{uncompute.png} \caption{Measurement-based uncomputation for relative phase Toffoli gates. This circuit can be used to replace the CNOT and the second relative phase gate from Fig.~\ref{fig:rel}.} \label{fig:uncompute} \end{figure} The work of \cite{gidney2020quantum} appeared in parallel and independent to our efforts and analysis. The author noticed the comparison potential opened by the method from \cite{oonishi2020efficient} and performed a quantum resource analysis of the space-time volume of surface code protected quantum circuits. Compared to \cite{gidney2020quantum}, we offer an exhaustive and systematic comparison of the resources required by the adders, and do not focus directly on surface code volumes because of the reasons discussed in Section~\ref{sec:space}. \section{Results} \label{sec:res} T-counts are usually reduced because of the requirements of the QECCs. For NISQ purposes, the T gate doesn't play any special role in NISQ and is treated on the same footing as any other single qubit gate. The CNOT-count is more important because of the high error rates associated with two qubit gates. We will show that relative phase Toffoli gates can be used for reducing the CNOT-count, too. This section presents the results of optimising the controlled-adder and multiplier from \cite{munoz2018quantum} using different decompositions \cite{selinger2013quantum}. We have chosen these circuits because of their modularity, low resources and representative ripple-carry structure. For the circuits, we derive formulas to express the depth $D$, the T-depth $T_d$, the number of qubits (e.g. wires) $Qub$. The expressions are used afterwards for the trade-off analysis of using different Toffoli gate decompositions. \subsection{Reducing T-count Can Increase Depth} \label{sec:rptg} A circuit's depth increases whenever the gate parallelism is lost, for example, due to suboptimal baseline decompositions. In other words, although it looks like the T-count and the depth have been reduced, only the T-count is reduced but the depth is actually increased. This is the case for \cite{oonishi2020efficient} where the authors have chosen ST with a depth of 13. They replaced ST/ST decompositions with RT3/IRT3 and RT4/IRT4 for optimising their circuits. There are two alternative replacements which would have generated different results. First, if the authors would have used 0AT3 (depth 9) instead of ST, their depth optimisations would have been minimal. In particular, the total depth of RT3/IRT3 equals to the one of 0AT3/0AT3, but RT4/IRT4 (total 20) increases actually the depth by two for each pair of replaced Toffoli gates (total 18 with 0AT3/0AT3). Without further gate level circuit optimisations, the circuit has a 10\% increase in depth. The second scenario is when T-count reductions are generating an increased T-depth. If in \cite{oonishi2020efficient} they would have used 4AT1 as baseline, the T-depth would have actually increased for Toffoli gate pairs (from 2 to 8), and the total depth would have increased, as well. The third example is a particularly inefficient replacement when ODB is used for a single Toffoli (instead of pair), and taking 0AT3 as baseline. The T-count is reduced but the total depth increases from 9 (0AT3) to 12 = 9 + 1 (CNOT) + 2 (Hadamard and CZ). The third example is of practical importance, because it shows that whenever ODB is used for circuit optimisation, at least 30\% of the total depth may be generated by measurements and corrective CZ gates (the uncomputation circuit from Fig.~\ref{fig:uncompute} represents 1/3 of the total depth of ODB). In case the highly parallel 4AT1 would have been used, the resulting ratio between measurements and depth would be significantly higher and close to 1/2. \subsection{Trading CNOT for Measurements Is Beneficial } The ODB scheme is not considered being NISQ compatible, because physical measurement gates have high error rates. We show that, as long NISQ circuit compilers have the efficiencies observed, for example, in \cite{bochen}, replacing CNOTs with measurements can be beneficial for depth and total circuit error-rate. We assume that measurements have a \emph{40 times} higher probability of failure compared to CNOTs (assuming single qubit gates with errors about 0.1\%, two qubit gates ten times higher at about 1\%, such that a worst case is having measurements almost random at 40\% error rate). This may be a very pessimistic overestimation of the error rates for some NISQ architectures such as \cite{wright2019benchmarking}. Furthermore, we assume that CNOTs have an overhead: NISQ chips have a reduced connectivity and these gates have to be routed/compiled to the underlying hardware. Next, we show that it could be a good idea to replace at least 40 physical CNOTs with a measurement. Connectivity of the hardware plays an important role. Toffoli gate decompositions seem to be close to compatibility with 2D nearest neighbour interactions. However, for the example in Fig.~\ref{fig:th_ctrl_add}, the compilation of the very long range Toffoli gates will be expected to significantly increase the total depth. Moreover, the CNOT gate set is not native for ion traps and has to be compiled to MS gates \cite{maslov2017basic}. Although the translation between CNOT and MS is direct, the optimisation of the circuit gate counts and depths is not. \begin{figure}[!t] \centering \includegraphics[width=1.0\columnwidth]{thaplyal_ctrl_adder.png} \caption{Four qubit controlled adder according to \cite{munoz2018quantum}.} \label{fig:th_ctrl_add} \end{figure} We consider a best case CNOT overhead of $5$ physical CNOTs. This is to say that a circuit's CNOT is compiled to five CNOTs on the NISQ device. The CNOT overhead value was estimated after calculating the characteristic path length (CPL, cf. Appendix) for the graphs of the most common NISQ devices. The CPL for Sycamore is 5, and Hummingbird has a CPL of almost 8. According to \cite{bochen}, circuits which are structurally similar to Toffoli circuits (called TFL circuits in \cite{bochen}) get compiled with an increased depth by a factor between 5 and 20 depending on the used compiler. Thus, we consider the pessimistic and optimistic cases for the failure rate of measurements and CNOT overhead respectively. Whenever \emph{pairs of Toffoli gates} can be replaced, one of the Toffoli gates is replaced with a measurement-based uncomputation, and this is effectively the ODB scheme from Fig.~\ref{fig:rel}. If the pair is 0AT3/0AT3, and counting the middle CNOT too, there are 15 CNOTs in total. If the ST decomposition would have been used, the total would have been 13 CNOTs. Using the ODB circuit with RT3 reduces the number of CNOTs to 5, because we assume the worst case that CZs are always applied. Thus, the ODB circuit has cut by 10 the CNOT-count per pair of Toffoli gate pair (8 in case of ST). Reducing 8-10 circuit CNOTs means that about 40-50 physical CNOTs are replaced with a measurement gate ($8 \times 5 = 40$). If the measurement error rate is lower, it may be possible to directly replace any Toffoli with a relative phase one. As a result, there may be situations where the ODB scheme is compatible with NISQ circuits. This could be the case for topologies with low values of CPL. \subsection{Lower Depth Controlled-adder} \label{sec:caa} In the previous section, if we would have used 4AT1 (16 CNOTs) instead of 0AT3 (7 CNOTs), the CNOT-count optimisation would have been even more dramatic. One should not consider 4AT1 for arbitrary circuits without making sure that it is a realistic worst case: Comparing ODB against 4AT1 would skew the magnitude of the optimisation. When designing circuits and estimating the worst case, the estimations should not be too pessimistic, but realistic. We will show that this was not the case for the ripple-carry arithmetic circuits from \cite{munoz2018quantum}. We assume that the number of wires (e.g. qubits/width) cannot be reduced in a ripple-carry adder, and the next optimisation goal is the depth. All the Toffoli gates in the adder are sequential and not parallel. This property favours Clifford+T circuits with shorter depths even at the cost of additional ancillae. Because the Toffoli gates are sequential, the ancillae can be reused without losing any Toffoli gate parallelism (there is no parallelism anyway). The original work of \cite{munoz2018quantum} used the 0AT3 decomposition, but we propose to use the 4AT1 decomposition. The extra four ancillae can be reused in favor of a shorter depth. Further optimisations may be possible by using ODB like in \cite{maslov2016, gidney2018halving, oonishi2020efficient}. For $n$-bit integers, the adder has: a) $3n+2$ sequential Toffoli gates; b) $n-1$ parallel CNOT gates at the beginning of the circuit which contribute to the depth by $1$ only, c) $n-2$ sequential CNOT gates in the first half of the circuit. As a result, the sequence of CNOT gates have an overall depth of $n-1$. At the end of the circuit, these CNOT gates are used again to reset the qubit of the first input integer to its original value and one of the CNOTs is parallel with the last Toffoli gate. Hence, the total depth of the CNOT gates is $2(n-1)-1$ and the depth of the adder circuit is the sum of the depth of the Toffoli gates and the CNOT gates. Since the Toffoli gates are all sequential, the T-depth equals the T-depth of the used Toffoli decomposition multiplied by the number of Toffolis which is $3n+2$. Concerning the width, a constant number of ancillae will be added to the original width of $2n+3$, namely the number of ancillae in the used Toffoli decomposition. The general depth, T-depth and total number of qubits formulas are the following: \begin{align} D_{add} &= (3n+2)D_t + 2n-3\\ T_{add} &= (3n+2)T_d\\ Qub_{add} &= 2n+3+A\\ CNOT_{count} &= 2(2n+3)+C(3n+2) \end{align} where $D_t$, $T_d$, $A$ and $C$ are the depth, T-depth, additional ancillae and the CNOT-count of the chosen Toffoli decomposition respectively. After replacing $C$ with the values from the $CNOT_{c}$ column of Table~\ref{tbl:analysis}, we obtain the following: \begin{align} CNOT_{4AT1} &= 52n + 26 \label{eq:cnot4} \\ CNOT_{0AT3} &= 25n + 8 \end{align} Our choice of the 4AT1 decomposition performs better than 0AT3, because it reduces the circuit depth by approximately 30\% and the T-depth by 66.6\% at the cost of four additional qubits only (cf. the ratio between the Depth and T-count of the decompositions in Table~\ref{tbl:analysis}). \begin{figure}[!t] \centering \includegraphics[scale=0.5]{figure.png} \caption{KQ (Depth $\times$ Width) as a function $n$ for the control-adder when decomposed. OAT3 and 4AT1 refer to the zero ancilla T-depth three and four ancillae T-depth one Toffoli decompositions respectively.} \label{fig:depth_width} \end{figure} \subsection{Multiplier Using Hybrid Decompositions} \begin{figure}[!t] \centering \includegraphics[width=0.5\columnwidth]{thaplyal_multiplier.png} \caption{Four qubit multiplier according to \cite{munoz2018quantum}.} \label{fig:th_multiplier} \end{figure} The multiplier from \cite{munoz2018quantum} is built using the controlled-adder from Section \ref{sec:caa}. The multiplier includes: a) a sequence of $n$ Toffoli gates; b) a succession of $n-1$ controlled-adders. There are $n-1$ adders, and each adder has $3n+2$ Toffoli and $2n-3$ CNOTs. They contribute to the depth of the multiplier by $n+(3n+2)(n-1)$ and $(2n-3)(n-1)$. For the general case, we have: \begin{align} D_{mult} &= (3n^2-2)D_t + (n-1)(2n-3) \\ T_{mult} &= (3n^2-n-2)T_d \\ Qub_{mult} &= 4n+1+A \end{align} where $D_t$, $T_d$ and $A$ have the same meaning like in Section~\ref{sec:caa}. Note that the sequence of $n$ Toffoli gates at the beginning is considered not to be parallel in Eq. 7. This is because, it can not be ensured that after the decomposition those still remain parallel. Hence, the choice of the correct decomposition plays an essential role in the optimisation, as we will show it next. The structure of the multiplication circuit allows us to consider two distinct Toffoli gate decompositions, one type for each region. We will use the formulas from Section \ref{sec:caa} to determine the costs of the multiplier. We decompose the first set of parallel $n$ Toffoli gates using the 0AT3 decomposition. We maintain the parallelism of these gates without introducing ancillae. If we use a Toffoli decomposition with ancillae, we then have to introduce a linear number of ancillae to maintain the parallelism. Otherwise we introduce a constant number of ancillae but increase the depth to linear. The 0AT3 is an optimal choice in this case since we maintain the parallelism (a constant depth of 10) and don't introduce any ancilla. The second part of the circuit consisting of $n-1$ controlled-adder is decomposed using 4AT1, similar to how it was performed in Section \ref{sec:caa}. Due to the parallel decomposition of the first $n$ Toffoli gates, the corresponding T-depth is constant and equals 3. The T-depth of the rest of the circuit is equal to the product between the number of controlled-adders, $n-1$, and the T-depth of the 4AT1. Lastly, we add four ancillae to the original width of the multiplier when undecomposed. One can observe that ripple-carry multiplier has the same width as a carry-lookahead adder, namely $\mathcal{O}(4n)$ \cite{munoz2018quantum, oonishi2020efficient} (cf. Eq.~\ref{eq:qmult} for multiplier width). \begin{align} D_{mult} &= 10 + 7(3n^2-n-2) + (2n-3)(n-1) \\ T_{mult} &= 3 + (3n^2-n-2)\\ Q &= 4n+1+4 \label{eq:qmult} \end{align} \subsection{Area and Space-time Volume vs Worst Case} \label{sec:space} \begin{figure}[t!] \centering \includegraphics[scale=0.5]{tdepth.png} \caption{KQ$_T$ (T-depth $\times$ Width) as a function $n$ for the control-adder when decomposed. OAT3 and 4AT1 refer to the zero ancilla T-depth three and four ancillae T-depth one Toffoli decompositions respectively.} \label{fig:width_T-depth} \end{figure} The worst case space-time volume of large computations is not trivial to estimate correctly. This holds even when distillations are sequentialised like in \cite{paler2019clifford}. The best option is to compile the space-time volumes using \cite{paler2019opensurgery} and \cite{paler2017synthesis}, schedule the distillation procedures \cite{paler2019clifford} and then check the resulting worst case depth. However, those compilers take the circuit level description as input, such that worst case volume estimations are as good as the worst case circuit level estimations. Furthermore, there are different tricks that can be applied to worsen or improve the volumes or other volume related costs, such that space-time volume estimations may be misleading. We will illustrate this with a simple example, in the following. We analyse the applicability of the KQ metric \cite{oonishi2020efficient}: \emph{the product of the number of qubits and the depth of the circuit}. There are variations of the metric such as KQ$_{CX}$ for the CNOT-depth, and KQ$_{T}$ for the T-depth. We are interested in the relevance of KQ$_{T}$. While comparing Figs.~ \ref{fig:depth_width} with \ref{fig:width_T-depth}, we notice the drastic improvements (blue vs orange -- our choice) when comparing KQ$_{T}$ with the generic KQ (the distance between blue and orange lines is not drastic). The KQ$_{T}$ metric does not necessarily reflect the amount of improvements or degradation of the adopted decomposition methods. The same effect will be obtained when the worst case space-time volume of surface code computations is optimised when considering the T-count as an approximation of the depth after using ODB. Clifford gates and measurements have to be accounted when estimating the area and space-time volumes of a circuit. Otherwise optimisation results are misinterpreted. \subsection{Ripple-carry vs Carry-lookahead} Considering the fact that distillations are sequential, and that qubits are very scarce, ripple-carry is wrt. hardware more efficient than carry-lookahead. Nevertheless, despite the fact that the carry-lookahead has logarithmic depth, there has to be a width range for which ripple-carry is wrt. the KQ metric also efficient. We use the following scenarios to compare the two different adders: \begin{enumerate} \item RC: 4AT1 (Thaplyal Ctrl-Adder) is the controlled-adder discussed in Section~\ref{sec:caa} from \cite{munoz2018quantum} which we decompose using 4AT1; \item RC: 4AT1 (Takahashi) from \cite{takahashi2009quantum} is the adder used in the construction of the controlled-adder, and we decompose it with 4AT1 too; \item CL: RT3 \& RT4 (Oonishi/Draper) is the carry-lookahead from \cite{draper2006logarithmic} adder decomposed with the relative phase decompositions like in \cite{oonishi2020efficient}; \item CL: 4AT1 (Oonishi/Draper) is the original adder from \cite{draper2006logarithmic} which we penalise with 4 ancillae per Toffoli (4AT1) in order to minimise the T-depth; \item CL: 4AT1 - (Draper w/ all Toffoli gates seq.) is the absolute unrealistic worst case when taking the 4AT1 adder and executing it in a very resource restricted environment where a single distillation can be executed at a time -- this is to show that circuit designs have to be adapted to the environment. \end{enumerate} \begin{figure}[t!] \centering \includegraphics[width=\columnwidth]{plots_compare.png} \caption{Comparison between ripple-carry (RC) and carry lookahead (CL) using the KQ cost metric that is the product between depth and width. Blue and orange lines with markers are RC. It can be observed that RC is more efficient than CL: a) up to 50 qubits when CL uses relative phase Toffoli gate decompositions (green); b) 96 qubits when CL uses exact Toffoli decompositions (red). The absolute unrealistic worst case (magenta) is when CL is decomposed with 4AT1 such that T gates are sequential due to the low distillation rate of T states. This effectively forces all Toffoli gates to be sequential and the logarithmic depth of the adder is lost.} \label{fig:compare} \end{figure} Fig.~\ref{fig:compare} illustrates the obtained results of our analysis, where the X-axis denotes the size of the integer and the Y-axis presents the KQ (width times depth) metric. Among the five different scenarios, "CL:4AT1" of Draper is not efficient wrt KQ metric for more than eight qubits. Practically, as expected, carry-lookahead does not seem viable for less than eight qubits. In realistic worse case scenarios, where hardware is scarce and distillations can be performed only sequentially, ripple-carry addition ("RC:4AT1" of Takahashi) is more efficient for up to approx. 50 qubits. The carry-lookahead adder has on the order of $10n$ Toffoli gates \cite{draper2006logarithmic} which are executed to a high level of parallelism. It is very unfortunate if the circuit is compiled in such a way that distillations need to be sequentialised. This is the case for RT3 and RT4. The extreme situation is when all T-gate parallelism is lost because of sequential distillations. Regarding the QECC cost of the adders, one should consider that connecting distillations to the main computation \cite{paler2017synthesis, litinski2019game, lin2017layout} uses also hardware. Another aspect is that the volume of the distillation procedures could be further lowered, or in the extreme case maybe even be embedded into empty regions of the main computation space-time volume. Moreover, distillation space-time volume costs are a function of the total space-time, but which is difficult to estimate correctly (see Section~\ref{sec:space}). Therefore, the plot from Fig.~\ref{fig:compare} should be seen as a recommendation. \section{Conclusion} The constants in asymptotic worst case estimations play a role when computing a circuit's execution time or failure rate. We have showed that relative phase Toffoli gate decompositions are optimal in specific contexts. Inappropriate usage of optimisations may result in worsening other costs in unexpected ways. More precisely, reducing T-depth increases the depth of the circuit and we exemplified this using the carry-lookahead adder from \cite{oonishi2020efficient}. Compiling CNOTs to NISQ architectures can be very costly and we showed this through a simple analysis of chip topologies and worst case measurement error rates. We showed that when using measurement-based uncomputations at least one third of the circuit's depth is occupied by classical processing. We lowered the depth of a controlled-adder by replacing the Toffoli gate decomposition. Using the controlled-adder we showed that area and volume cost metrics can be sometimes misleading. We went one step further and reduced the resources needed for multiplication by using two types of Toffoli gate decompositions. Finally, we illustrated that for up to 50-bit numbers ripple-carry adders are more resource efficient than carry-lookahead. \section*{Acknowledgement} We thank Vlad Gheorghiu for suggestions about how to improve the manuscript. AP was supported by a Fulbright fellowship and Google Faculty Research Awards. \bibliographystyle{plain}
\section{Introduction} \label{sec:intro}} Statistical studies of microlensing planets have shown that while the mass-ratio function for giant planets increases with decreasing mass ratio, $q$, there appears to be a break in the mass-ratio function at small mass ratios. \citet{Suzuki16} presented the first study to fit a broken power-law to the microlensing planet distribution. They analyzed a sample of 1474 events with 23 planets from the Microlensing Observations in Astrophysics (MOA) survey. Combining their sample with planets from other work \citep{Gould10, Cassan12}, they report a power-law slope for planets with $q < q_{\rm br}$ of $p = 0.6$ in contrast to $p = -0.93$ for larger planets (for $dN / d\log q \propto q^p$) for a fiducial break at $q_{\rm br} = 1.7 \times 10^{-4}$. Independently, \citet{Udalski18} later used a $V/V_{\rm max}$ analysis and a complementary sample to confirm this turnover. \citet{Jung19_0165} then suggested a much smaller $q_{\rm br} = 0.55\times 10^{-4}$ and a change in $p$ above and below the break of $ p( q < q_{\rm br}) - p(q > q_{\rm br}) > 3.3$. While this $q_{\rm br}$ is substantially smaller than that of \citet{Suzuki16}, it is consistent within the uncertainty contours of \citet{Suzuki16} (see their Figure 15). These studies strongly suggest that Neptune/Sun mass-ratio planets are the most common planets at separations of a few au around microlensing host stars. However, the power-law slope of the mass-ratio distribution below $q_{\rm br}$ and even the exact location of $q_{\rm br}$ are highly uncertain due to a lack of planet detections below this break. In \citet{Suzuki16}, the smallest planet had $q = 0.58 \times 10^{-4}$, while in \citet{Jung19_0165}, the smallest planet had $q = 0.46 \times 10^{-4}$. The analysis by \citet{Jung19_0165} is consistent with a very sharp break at $q_{\rm br}$, i.e., it suggests the possibility that smaller planets might not exist. Hence, depending on the strength of the break, it could be quite difficult to find such planets and so to measure their distribution. Since that time, three planets have been discovered with mass ratios $q < 0.55\times 10^{-4}$, largely due to the Korea Microlensing Telescope Network \citep[KMTNet; ][]{Kim16_KMTNet}. With its $4\ {\rm deg}^2$ field of view and telescopes at three sites (CTIO, SAAO, SSO; i.e. KMTC, KMTS, KMTA), KMTNet can achieve near-continuous observations of $92\ {\rm deg}^2$ of the bulge at a high cadence. (92, 84, 40, 12 deg$^2$) are covered at cadences of $\Gamma \ge $ (0.2, 0.4, 1, 4) obs hr$^{-1}$. This has led to the discovery of KMT-2018-BLG-0029Lb \citep{Gould20_0029} and KMT-2019-BLG-0842Lb \citep{Jung20_0842} with mass ratios $q = 0.18\times10^{-4}$ and $q = 0.41\times10^{-4}$, respectively. A third planet, in OGLE-2019-BLG-0960, is reported in this work and was discovered through a combination of KMTNet observations and followup data. While the KMTNet data were crucial to the discovery of the planet in OGLE-2019-BLG-0960, the initial discovery of the event by the Optical Gravitational Lens Experiment (OGLE) was critical for identifying this event as a potential {\em Spitzer}\ target. The early OGLE alert triggered reduction of KMTNet real-time data almost three weeks before the event was discovered by KMTNet. As a result, OGLE-2019-BLG-0960\ was under consideration as a potential {\em Spitzer}\ target prior to its discovery by KMTNet. Later, the event was identified as high-magnification, which triggered additional followup observations. A detailed timeline of the observations is given in Section \ref{sec:obs}. The analysis of the light curve including the parallax is described in Sections \ref{sec:ground_anal} and \ref{sec:parallax_ground_space}. We derive the properties of the source and the physical parameters of the lens including the planet in Section \ref{sec:phys}. Then, in Section \ref{sec:discussion}, we consider whether or not the planet was detectable in survey data alone (Section \ref{sec:survey-only}), and we consider how the sample of small planets can be increased to enable a precise measurement of $q_{\rm br}$ and $p$ for planets with $q < q_{\rm br}$ (Section \ref{sec:obs-strategy}). We also explore events with both $(s > 1)$ and $(s < 1)$ solutions and the relationship to the ``close"/``wide" degeneracy of \citet{GriestSafizadeh98} (Section \ref{sec:close-wide}). We conclude in Section \ref{sec:conclusions}. \vspace{12pt} {\section{Observations} \label{sec:obs}} \subsection{Ground-Based Survey Observations} OGLE-2019-BLG-0960\ was alerted by the OGLE-IV Early Warning System \citep{Udalski03,Udalski15_OGLEIV} on 23 June 2019 at UT 21:04 (HJD$^{\prime}=$HJD$-2,450,000=8658.38$). Its coordinates were ${\rm R.A.} =$ 18:16:03.43, ${\rm Decl.} =$ -25:46:28.8 corresponding to $(\ell, b) = (6.10, -4.30)$. It is in OGLE-IV field BLG522, which was observed in the $I$ band with a cadence of $\Gamma\sim2\, {\rm night}^{-1}$. This event was independently discovered as KMT-2019-BLG-1591 by KMTNet \citep{Kim18_AF} on 11 Jul 2019 at UT 03:05 (HJD$^{\prime}=8675.63$) and as MOA-2019-BLG-324 by Microlensing Observations in Astrophysics \citep[MOA; ][]{Bond01} on 17 July 2019 at UT 16:07 (HJD$^{\prime}=8682.17$). This field is observed by KMTNet at a cadence of $\Gamma \sim 0.4\, {\rm hr}^{-1}$. Most of the KMTNet observations were taken in the $I$ band with about 10 in the $V$ band for the purpose of measuring colors. MOA observed the field containing OGLE-2019-BLG-0960\, using a custom $R$ filter (which covers standard $R$ and $I$ bands) at a nominal cadence of $\Gamma \sim 0.6\ {\rm hr}^{-1}$, but see below (Section \ref{sec:followup}). \subsection{{\em Spitzer}\, Observations} OGLE-2019-BLG-0960\ was selected for {\em Spitzer}\, observations and announced as a {\em Spitzer}\, target on HJD$^{\prime}=8676.23$ with the condition that it must reach $I<17.45$ prior to HJD$^{\prime}=8679.5$, i.e., the decision point for the next {\em Spitzer}\, target upload. Thus, it was initially selected as a {\it ``subjective, conditional"} target, and observations began at HJD$^{\prime} = 8685.21$. The following week HJD$^{\prime}\sim 8687$, the event met the {\it ``objective"} criteria for selecting {\em Spitzer}\, targets. Thus, observations taken after HJD$^{\prime} = 8691.5$ may be considered ``objective". See \citet{Yee15_Criteria} for a detailed explanation of different types of selection and their implications and criteria. {\subsection{Ground-Based Followup Observations} \label{sec:followup}} Once OGLE-2019-BLG-0960\, was selected for {\em Spitzer}\, observations, we began to monitor it with the dual-channel imager, ANDICAM \citep{DePoy03} on the SMARTS 1.3m telescope at CTIO in Chile (CT13). Observations were taken simultaneously in both the $I$ and $H$ bands for the purpose of tracking its evolution and obtaining an $I-H$ color for the source. Starting at HJD$^{\prime}\sim 8683.5$, we increased the cadence to a few points per night to supplement the survey data in the hopes of better characterizing any planetary perturbations. We also began monitoring the event with the telescopes in the LCO 1-m network at SAAO (South Africa; LCOS) and SSO (Australia; LCOA01, LCOA02). On 20 Jul 2019, the {\em Spitzer}\ team realized that the event was consistent with high magnification ($A>100$) and sent an alert to the Microlensing Follow-Up Network (MicroFUN) at UT 13:06 (HJD$^{\prime}=8685.05$) encouraging dense followup observations to capture the peak of the event. Auckland, Farm Cove, and Kumeu Observatories in New Zealand (AO, FCO, and Kumeu, respectively) all responded to the alert and began intensive observations of the event. MOA also increased its cadence in response to the alert. At the same time, we scheduled dense observations with CT13 and the LCO 1-m telescopes at SAAO and SSO. Two days later at HJD$^{\prime} = 8687.05$, we called off the alert because the event was declining and no significant perturbations had been observed over the peak. At this point, most followup observations ceased. However, we continued to observe this event at a cadence of a few per night with CT13, while Kumeu Observatory took an additional hour of normalizing data, which would prove crucial for recognizing and characterizing the planetary perturbation. On 23 July 2019 (HJD$^{\prime} = 8688.06$), a routine inspection of the CT13 data led to the discovery of a $\sim 0.5$ mag outlier in the light curve. The outlier was confirmed by a data point in the KMTC light curve taken nearly simultaneously. This triggered additional dense observations with the LCO network. We did not realize the existence of Kumeu observations that characterized the falling side of the perturbation until HJD$^{\prime}\sim 8689.05$. \subsection{Data Reduction and Error Renormalization} The data were reduced by each collaboration and the photometric error bars were renormalized according to the prescription in \citet{Yee12}. Table \ref{tab:data} gives the specific reduction method, the error renormalization factors, and other properties for each data set. In the case of KMTNet data from CTIO and SAAO, we restricted the data to points taken after HJD$^{\prime}= 8616$ to control for possible effects of systematics on the parallax measurement. Likewise, data from KMTA were restricted to $\pm 5$ days from the peak of the event. \vspace{12pt} \section{{Ground-Based Light-Curve Analysis} \label{sec:ground_anal}} \begin{figure} \begin{centering} \includegraphics[height=0.75\textheight]{OB190960_full.pdf} \caption{Light curve of OGLE-2019-BLG-0960\ with best-fit models. Although the primary evidence for the planet is a strong bump in the light curve at HJD$^{\prime} \sim 8687.8$, the points before and after the bump also show a negative deviation relative to the best-fit point lens model (dashed gray line), which contributes to the detection. Note that KMTC and CT13 each have a datapoint at HJD$^{\prime} = 8687.796$, but because they are contemporaneous, they do not appear as distinct points on the plot. The two best-fit planetary models are shown as the solid black and cyan lines. Although one model has $s>1$ and one has $s<1$, this degeneracy is far from the regime of the ``close"/``wide" degeneracy identified by \citet[][see Section \ref{sec:close-wide}]{GriestSafizadeh98}. \label{fig:lc}} \end{centering} \end{figure} \begin{figure} \includegraphics[width=0.5\textwidth]{grid_full.pdf} \includegraphics[width=0.5\textwidth]{grid_survey.pdf} \caption{Results of the $s$-$q$ grid-search for the best-fit solutions to the light curve of OGLE-2019-BLG-0960. {\em Left:} the fits including all ground-based data yield two distinct minima, one with $s < 1$ and one with $s > 1$, but not centered around $s = 1$. {\em Right:} the fits to just the ground-based survey data (OGLE, MOA, KMT) give an additional pair of minima because the caustic crossing is less well-characterized (see Section \ref{sec:survey-only}). \label{fig:grid}} \end{figure} \begin{figure} \begin{centering} \includegraphics[height=0.85\textheight]{cau_ob190960.pdf} \caption{Caustics (red dashed lines) and source trajectory (solid black line and arrow) for the two degenerate solutions for OGLE-2019-BLG-0960. The top two panels show the ``$s>1$" solution, and the bottom two panels show the ``$s<1$" solution. The top panel in each pair shows the full view of the caustic, while the bottom panel in the pair shows a close up of the caustic crossing. The locations of the source at the times of the observations are indicated by the dots/circles; the size of each circle is set by $\rho$. \label{fig:caustics}} \end{centering} \end{figure} The full light curve of this event is shown in Figure \ref{fig:lc}. With the exception of a brief, 0.2 day, bump that occurs 1.4 days after the peak, the light curve is well described by a standard single-lens single-source (1L1S) \citet{Paczynski86b} fit, which is specified by three geometric parameters, the lens-source closest approach $t_0$, the impact parameter $u_0$ (normalized to the Einstein radius, $\theta_{\rm E}$), and the Einstein radius crossing time $t_{\rm E}$. In principle, the bump could be explained by either an additional lens (2L1S) or additional source (1L2S), but we begin by focusing on the former. This requires three additional parameters: the companion-host separation $s$ (normalized to $\theta_{\rm E}$), the companion-host mass ratio $q$, and the companion-host orientation $\alpha$ (relative to the direction lens-source relative motion). Because the source transits (or comes very close to) a caustic structure generated by the lens system, we must also specify $\rho\equiv\theta_*/\theta_{\rm E}$, where $\theta_*$ is the angular radius of the source. \subsection{{Static Analysis} \label{sec:static}} We search for the best-fit models following the method of \cite{Yang20_1836}. In brief, we initially conduct a grid search over ($\log s, \log q$) to locate the solutions. For each set of ($\log s, \log q$), we fix $\log s, \log q$, and free $t_0, u_0, t_{\rm E}, \alpha$ and $\rho$. For the initial values of $t_0$, $u_0$, and $t_{\rm E}$, we use the values from 1L1S fitting to the light curve excluding the planetary anomaly. The initial values of $\alpha$ and $\rho$ are estimated from the 1L1S parameters as follows: \begin{equation} \alpha = \tan^{-1}\frac{t_{\rm eff}}{t_{0,{\rm anom}} - t_0} = 0.266~(15.2^\circ); \qquad t_{\rm eff} = u_0 t_{\rm E} \end{equation} where $t_{0,{\rm anom}} = 8687.78$. Using the method of \cite{Street16}, $\rho$ can be estimated by \begin{equation} \rho \sim \frac{t_{0,{\rm anom}} - t_{\rm cc}}{t_{\rm E}} \times \sin{\alpha} = 3.2\times10^{-4}, \end{equation} where $t_{\rm cc} \sim 8687.70$ is the time of caustic entry. Then, we search for the best-fit parameters using Markov chain Monte Carlo (MCMC) $\chi^2$ minimization as implemented in the \texttt{emcee} ensemble sampler \citep{ForemanMackey13}. We use the advanced contour integration code \texttt{VBBinaryLensing} \citep{Bozza10}\footnote{\url{http://www.fisica.unisa.it/GravitationAstrophysics/VBBinaryLensing.htm}} to compute the binary-lens magnification. This code uses multiple rings to account for the limb-darkening effect and sets the number of rings automatically based on the required light curve precision. We use linear limb-darkening coefficients for a $T_{\rm eff} = 5250$K star: $\Gamma_I = 0.43$, $\Gamma_R = 0.52$, $\Gamma_L = 0.15$ \citep{Claret11}. This grid search yields only two local minima (left panel of Figure \ref{fig:grid}). We then further refine these minima by allowing all seven parameters to vary in an MCMC. The results are shown in Table \ref{tab:parm1}, and the caustics and source trajectories are shown in Figure \ref{fig:caustics}. As with many events, the two solutions appear to be related by the famous $s\leftrightarrow s^{-1}$ (a.k.a. ``close"/``wide") degeneracy \citep{GriestSafizadeh98,Dominik99} because one solution has $s<1$ and the other $s>1$. In fact, this is not the case, as we discuss in Section \ref{sec:close-wide}. Regardless, the two solutions are very similar in their physical implications. First, the mass ratio is $q = 1.27\pm0.07$ or $q = 1.45\pm0.15 \times 10^{-5}$, making this the smallest mass-ratio planet discovered by microlensing to date. Second, although the two solutions are distinct, $s$ is very close to 1, so the separation of the planet from the host star is similar in the two cases. Third, the relatively long Einstein timescale, $t_{\rm E}\sim 62\,$days, suggests that it may be possible to measure the annual parallax effect for this event. \subsection{{Ground-based Parallax Analysis} \label{sec:ground-parallax}} \begin{figure} \begin{centering} \includegraphics[height=0.75\textheight]{OB190960_cum_parallax.pdf} \caption{Cumulative distribution of $\Delta\chi^2$ as a function of time between the best-fit parallax and static models. For clarity, we only show the $\Delta\chi^2$ contributions from the survey data (and we exclude KMTA because only the data over the peak and anomaly are used in the modeling). The top panel shows the model light curve for reference. \label{fig:cumchi2}} \end{centering} \end{figure} \begin{figure} \begin{centering} \includegraphics[height=0.8\textheight]{OB190960_annual.pdf} \caption{ (1, 2, 3, 4, 5, 6, 7)$\sigma$ contours (black, red, yellow, green, cyan, blue, purple) for the parallax vector. The large ellipses in the top panels show the measurement from the annual parallax effect in the ground-based data. These data give a strong constraint on $\pi_{\rm E, \parallel}$, the component of the parallax parallel to the projected position of the Sun, but a relatively weak constraint on $\pi_{\rm E, \perp}$, resulting in highly elliptical error contours. The arcs in the bottom panels are the constraint from the {\em Spitzer}-``only" parallax analysis and are overlaid on the annual parallax contours. These show tension with the annual parallax measurement at the $\sim 3\sigma$ level; limits from the blended light are also in tension with the {\em Spitzer}-``only" parallaxes. Together, these suggest systematics in the {\em Spitzer}\ light curve may be affecting the parallax measurement. \label{fig:piEcontours}} \end{centering} \end{figure} Thus, we are immediately led to introduce two additional parameters ${\bdv\pi}_{\rm E} = (\pi_{{\rm E},N},\pi_{{\rm E},E})$, i.e., the north and east components of the parallax vector \citep{Gould04} in equatorial coordinates. Because the effect of Earth's motion can be partially mimicked by lens orbital motion \citep{Batista11,Skowron11}, we initially introduce two further additional parameters ${\bdv\gamma} = ((ds/dt)/s,d\alpha/dt)$, i.e., the instantaneous angular velocity at $t_0$. We find that ${\bdv\gamma}$ is poorly constrained, so we impose a limit on the ratio of projected kinetic to potential energy \citep{Dong09_071} \begin{equation} \beta = \bigg|{\frac{\rm KE_{\perp}}{\rm PE_{\perp}}}\bigg| = {\frac{\kappa M_\odot{\rm yr}^2}{8\,\pi^2}}{\frac{\pi_{\rm E}}{\theta_{\rm E}}}\gamma^2 \biggl({\frac{s}{\pi_{\rm E} + \pi_s/\theta_{\rm E}}}\biggr)^3 , \label{eqn:beta} \end{equation} where $\pi_s$ is the source parallax. We only accept links on the chain for which $\beta<0.8$.\footnote{Strictly speaking, only $\beta>1$ solutions are ruled out by the requirement of a bound system. However, $0.8<\beta<1$ would require a system with an extremely high eccentricity that was observed at a rare epoch and in a rare orientation.} We find that ${\bdv\gamma}$ is neither significantly constrained in the fit nor significantly correlated with ${\bdv\pi}_{\rm E}$, so we suppress these two degrees of freedom. The final parallax solutions are summarized in Table \ref{tab:parm1}. Figure \ref{fig:cumchi2} shows the cumulative $\Delta\chi^2$ diagram between the best-fit parallax and static solutions. All of the survey datasets that span the event (OGLE, MOA, KMTC, KMTS) contribute positively and consistently to the parallax signal. This meets our expectation that a real parallax signal should affect data from all observatories and makes it extremely unlikely that the signal has a non-astrophysical origin. We show in Figure \ref{fig:piEcontours} the $\chi^2$ contours projected on the ${\bdv\pi}_{\rm E}$ plane, which are in the form of an ellipse with a large axis ratio $a/b \sim 8$ . Such ``1-D parallax'' measurements were predicted by \citet{GouldMB94} and explored in greater detail by \citet{Smith03} and \citet{Gould04} for moderately long microlensing events. They arise because $\pi_{{\rm E},\parallel}$, the component of ${\bdv\pi}_{\rm E}$ that is parallel to the projected position the Sun at $t_0$, is directly constrained by the asymmetry in the light curve that is induced by Earth's instantaneous acceleration near the peak of the event. The first clear example of this in a planetary event was OGLE-2005-BLG-071 \citep{Udalski05,Dong09_071}. Indeed, the orientations (north through east) of the short axes of the ellipses for OGLE-2019-BLG-0960\ are close to the projected position of the Sun. Hence, $\pi_{{\rm E},\parallel}$ is both relatively large and well-constrained from the ground-based photometry even though there are substantial uncertainties in the total value of $\pi_{{\rm E}}$. \subsection{Binary Source Models} \begin{figure} \begin{centering} \includegraphics[width=0.75\textwidth]{OB190960_res.pdf} \caption{OGLE-2019-BLG-0960\ cannot be explained by a point-lens, binary-source (1L2S) model, which is shown in two different bands ($R$, red line, corresponding to the Kumeu Observatory data; $I$, black line, corresponding to CT13 and KMT data). The dotted gray line shows the best-fit point-source/point-lens model. \label{fig:1L2S}} \end{centering} \end{figure} In principle, a short duration bump on an otherwise point-lens--like light curve can also be caused by a binary source with a large flux ratio \citep{Gaudi98}. Hence, we also search for 1L2S solutions. For this search, we introduce the additional parameters $t_{0, 2}$ and $u_{0, 2}$ to describe the trajectory of the second source and $\rho_2$ for its radius. We also introduce $q_{\rm F, I}$, the flux ratio between the two sources, as a fit parameter. The results of these fits are given in Table \ref{tab:binary-source} and show that such solutions are disfavored by $\Delta\chi^2 > 1000$. Figure \ref{fig:1L2S} shows that the best-fit 1L2S model fails to reproduce the decrease in magnification (relative to a point lens) seen before and after the bump. \section{{{\em Spitzer}\ Parallax Analysis} \label{sec:parallax_ground_space}} \begin{figure} \begin{centering} \includegraphics[width=0.7\textwidth]{OB190960_spitzer.pdf} \caption{{\em Spitzer}\ light curve (red points) in instrumental-flux units, together with the best-fit {\em Spitzer}-``only" model in black. The fact that the event is clearly faint from {\em Spitzer}\ indicates a significant parallax effect. A rising light curve is also consistent with the annual parallax measurement. That is, $\pi_{{\rm E},E}<0$ implies that the event peaked later as seen from {\it Spitzer}, which lay to the west of Earth. \label{fig:spitz_lc}} \end{centering} \end{figure} According to the original conception of \citet{refsdal66}, the microlens parallax (${\bdv\pi}_{\rm E}$ in modern notation) could be determined up to a four-fold degeneracy by combining information from the ground-based and space-based Paczy\'nski parameters $(t_0,u_0,t_{\rm E})$ for the event, \begin{equation} {\bdv\pi}_{\rm E} = {\frac{\au}{ D_{\perp}}} \biggl({t_{0,\rm sat} - t_{0,\oplus}\over t_{\rm E}},u_{0,\rm sat} - u_{0,\oplus}\biggr) , \label{eqn:refsdal} \end{equation} where ${\bf D_{\perp}}$ is the Earth-satellite separation projected on the plane of the sky and $t_{\rm E}$ is approximated as being the same for both Earth and the satellite. The two terms in Equation~(\ref{eqn:refsdal}) are then the components of ${\bdv\pi}_{\rm E}$ that are, respectively, parallel and perpendicular to ${\bf D_{\perp}}$. A four-fold degeneracy arises because $u_0$ is a signed quantity, but generally only its magnitude can be determined from the light curve. See Figure~1 of \citet{gould94}. Figure~\ref{fig:spitz_lc} shows the {\it Spitzer} light curve in instrumental-flux units. Because the {\em Spitzer}\ observations cover the peak of the event (which was very bright, $I=14.3$), the lack of a strong microlensing signal (i.e., a substantial change in the flux) indicates a significant parallax effect. In fact, the {\em Spitzer}\ light curve is rising throughout the observations, which begin approximately at $t_{0,\oplus}$. Because {\it Spitzer} was almost due west of Earth at these times, this rising light curve implies that $\pi_{{\rm E},E} < 0$, in good agreement with the ground-based results. However, the total {\em Spitzer}\ flux variation of OGLE-2019-BLG-0960\ is extremely small (only 1.5 flux units). Recent experience with KMT-2018-BLG-0029 \citep{Gould20_0029}, OGLE-2017-BLG-0406 \citep{Hirao20}, and OGLE-2018-BLG-0799 \citep{Zang20_0799} has shown that there can be systematics in the {\em Spitzer}\ parallax measurements for {\em Spitzer}\ light curves with weak signals. Hence, while the {\em Spitzer}\ light curve for OGLE-2019-BLG-0960\ shows a clear parallax signal, we must be cautious in interpreting it. We carry out a quantitative investigation of the {\em Spitzer}\ parallax signal following the method described in \citet{Gould20_0029}. {\it Spitzer}-``only'' light curves are obtained by fitting only the {\it Spitzer} data, while fixing the non-parallax ground-based parameters $(t_0, u_0, t_{\rm E}, s, q, \alpha, \rho)$ at their best-fit, ground-based values. In particular, because {\it Spitzer}-``only'' fits are used primarily to analyze information flow rather than to obtain final results, it is best to keep them as simple as possible without tracking finer details. In addition, one must specify the {\it Spitzer} source flux (and error bar), both of which can be derived from a {\it Spitzer}-ground color-color (e.g., $IHL$) relation together with the $I$-band source flux. For this color-constraint, we cross-match stars from the $6^{\prime}\times6^{\prime}$ CT13 $I$-band field with VVV \citep{Minniti17VVV} to construct an $I-H$ CMD. While the VVV $H$-band is calibrated, CT13 is not, so the resulting colors are instrumental rather than absolute. In this system, we find the source color is $I_{\rm CT13}-H_{\rm VVV} = 3.433 \pm 0.013$ (see Section \ref{sec:cmd}). When cross-matched to stars in the {\em Spitzer}\ field, this yields a color-color relation: \begin{equation} I_{\rm CT13}-L = 2.681 \pm 0.019 . \end{equation} The resulting parallax contours are shown in Figure~\ref{fig:piEcontours}. This figure shows that the ground-only and {\it Spitzer}-``only'' contours are inconsistent at the $\sim3\sigma$ level. Furthermore, we will show in Section \ref{sec:lens} that the best-fit value for the {\em Spitzer}-``only" parallax, $\pi_{\rm E} = 0.25$, is in tension with constraints on the lens due to the blended light (unless the host is a stellar remnant). Because of these tensions, for the remainder of the paper, we focus on what can be derived from the ground-based data alone. In the future, we will carry out a systematic study of low-amplitude {\em Spitzer}\ light curves. Once the impact of systematics on the {\em Spitzer}\ parallax measurements is better understood, we can reassess the constraints from the {\em Spitzer}\ data on this event and assess whether or not it can be included in the {\em Spitzer}\ statistical sample of planets. Ultimately, these tensions can be resolved by separately resolving the source and the lens (assuming that the lens is luminous). This would allow both a measurement of the lens flux and a measurement of the direction of the lens-source relative proper motion \citep[e.g., ][]{Batista15,Bennett15,Bhattacharya20,Vandorou20}. This would both independently constrain the mass of the lens and the direction of the parallax vector (because $\hat{\pi}_{\rm E} \equiv \hat{\mu}_{\rm rel}$). \vspace{12pt} {\section{Physical Properties} \label{sec:phys}} {\subsection{CMD \& Source Properties} \label{sec:cmd}} \begin{figure*}[htb] \centering \includegraphics[width=0.49\textwidth]{OB190960_CMD_OGLE.pdf} \includegraphics[width=0.49\textwidth]{OB190960_CMD_CT13.pdf} \caption{Left: OGLE CMD (calibrated to OGLE-III) of a $120^{\prime\prime}$ square centered on OGLE-2019-BLG-0960. Right: CT13-VVV CMD of a $240^{\prime\prime}$ square centered on the event. In each panel, the red asterisk and blue dot show the centroid of the red clump and the position of the microlens source, respectively. In the left plot, the green and magenta dots show the positions of the blend and the baseline object, respectively. The cyan lines show a naive estimate (see Section \ref{sec:lens}) for the lens color and magnitude calculated for $\theta_{\rm E} \pm 1\sigma$ (solid and dashed lines, respectively); the cyan dot shows the position for $M_{\rm L} = 0.5\ M_{\odot}$.} \label{fig:cmd} \end{figure*} We measure the intrinsic color and magnitude of the source by finding its location in a color-magnitude diagram (CMD) relative to the red clump \citep{Yoo04}. We do this in two ways. First, we use the OGLE-IV photometry to find $(V-I, I)_{\rm S} = (1.53, 19.81) \pm (0.04, 0.03)$, and we find the centroid of the red clump is $(V-I, I)_{\rm cl} = (1.73, 15.24) \pm (0.02, 0.04)$ (see Figure \ref{fig:cmd}). The intrinsic color and magnitude of the red clump along this line of sight is $(V-I, I)_{0, \rm cl} = (1.06, 14.27)$ \citep{Bensby11,Nataf13}. This implies that $A_I=0.97$ and $E(V-I) = 0.67$ for this field. Hence , assuming the source experiences the same reddening and extinction as the clump, we find $(V-I, I)_{0, \rm S} = (0.86, 18.84) \pm (0.05, 0.05)$. The OGLE magnitudes reported here and elsewhere have all been calibrated from the OGLE-IV system to the standard OGLE-III Johnson-Cousins system. Using the color/surface-brightness relation of \cite{Adams18}, we obtain $\theta_* = 0.628 \pm 0.040\ \mu {\rm as}$. As a check, we also derive the $(V-I)$ color from the KMTC data. We obtain $(V-I)_{0, \rm S} = 0.81$, in good agreement with the OGLE-IV color. We also construct an $I - H$ versus $I$ CMD by cross-matching the CT13 $I$-band and the VVV $H$-band stars within a $4' \times 4'$ square centered on the event (see Figure \ref{fig:cmd}). We measure the centroid of the red giant clump as $(I - H, I)_{\rm cl} = (3.81 \pm 0.01, 17.04 \pm 0.03)$, and find the intrinsic centroid of the red giant clump to be $(I - H, I)_{0, \rm cl} = (1.30, 14.27)$ \citep{Nataf13,Nataf16}. For the source color, which is independent on any model, we first get $(I - H)_{\rm CT13, S} = -1.766 \pm 0.012$ by regression of CT13 $H$ versus $I$ flux as the source magnification changes. We then measure the offset between CT13 $H$-band stars and VVV stars to be $H_{\rm CT13}$ - $H_{\rm VVV} = 5.199 \pm 0.004$, yielding $(I - H)_{\rm S} = 3.433 \pm 0.013$. Therefore, we obtain the intrinsic color and brightness of the source $(I - H, I)_{0, \rm S} = (0.92 \pm 0.03, 18.85 \pm 0.05)$. Then, from \cite{Adams18}, we obtain $\theta_* = 0.623 \pm 0.037~\mu {\rm as}$. As our final value, we adopt the weighted mean of the OGLE and CT13 measurements, $\theta_{*,0} = 0.625 \pm 0.028$. For the source apparent brightness, we note that the source magnitude depends on the model. For simplicity, we have explicitly derived results for $I_{\rm OGLE, S} = 19.81$. Then, for different source magnitude, one can derive $\theta_*$ of a solution with a particular $I_{\rm S}$ by $\theta_* = \theta_{*,0} \times 10^{-0.2(I_{\rm S} - 19.81)}$. We use this formula to account for slight variations in $f_{{\rm S}, I_{\rm OGLE}}$ for different degenerate solutions. Finally, the measured value of $\rho$ implies $\theta_{\rm E} = 1.9-2.1\ {\rm mas}$ depending on the solution (see Table \ref{tab:lens_prop}). {\subsection{Lens Constraints from Blend and Baseline Object} \label{sec:blend}} \begin{figure} \begin{centering} \includegraphics[width=0.75\textwidth]{ob0960_mldl.pdf} \caption{Constraints on the lens mass and distance. Magenta lines show the mass-distance relation calculated from $\theta_{\rm E}$ (solid) with the $1\sigma$ limits (dotted) for the $(s > 1, u_0 < 0)$. Blue lines show the mass-distance relation and $1\sigma$ limits from the ground-based parallax for that solution (solid and dotted, respectively). Red, dashed line shows the mass-distance relation for $\pi_{\rm E} = 0.25$, i.e., the best-fit value for the {\em Spitzer}-``only" parallax. The black lines are the $3\sigma$ upper limits derived from the blended light in I band. The cyan lines are the $3\sigma$ limits derived from the color of the baseline object. These give upper limits on the lens mass if it is behind all of the dust (solid) or in front (dot-dashed). Lenses {\em below} these lines are allowed. \label{fig:constraints}} \end{centering} \end{figure} Independent of any other constraints, the observed flux constrains the mass of the lens. First, there is a constraint from the blend flux. Because the blend consists of light from stars other than the lensed source (i.e., the lens and any other stars blended into the PSF), the lens cannot be brighter than the blend. In principle, because the background in the bulge consists of unresolved stars rather than blank sky, OGLE-2019-BLG-0960\ could be sitting on a ``hole" in the background \citep{Park04} and, therefore, the blend could be slightly brighter than measured. To place a $3\,\sigma$ upper limit on the flux from the lens, we take account of this effect in addition to the ordinary photon-based error in the measurement of the flux from the baseline object. These must be handled separately because the photon noise is Gaussian but the effect of the mottled background, including a possible ``hole'', is highly non-Gaussian. For the photon noise, we estimate the photometric error in the baseline object to be 0.020 mag. Subtracting the measured source flux (taking accont of its very small error), and propagating the errors, we find that this term contributes 0.0285 mag at $1\,\sigma$ and so 0.085 mag at $3\,\sigma$. To account for the mottled background, we follow the method of \citet{Gould20_0029}. We model the bulge stellar distribution using the \citet{Holtzman98} luminosity function, scaled down by a factor 0.50 according the bulge projected clump-star density map of \citet{Nataf13} and D.\ Nataf (2019, private communication). We estimate that OGLE-IV imaging captures field stars $I<20$ but leaves fainter stars unresolved, and that this map is constructed from FWHN$\sim 0.9^{\prime\prime}$ images. We then evaluate the impact of random field stars on the baseline-object (hence, blend) photometry by Monte Carlo. We find that at $(1,2,3)\sigma$ [i.e., (84.1,97.7,99.9) percentiles], the blend could be brighter than its naive value by (0.08,0.12,0.13) mag. Hence, the combined three sigma limit due to both photon noise and mottled background is 0.16 mag. Hence, the $3\,\sigma$ limit on the brightness of the lens is $I_L > 18.38$. Figure \ref{fig:constraints} shows the resulting limits on the lens mass and distance. For this figure, we have converted the limit on $I_{\rm L}$ to a limit on $M_{\rm L}$ using \citet{PecautMamajek13}. To show the effect of dust, we have calculated these limits for both $I = 18.38$ and $I_0 = I - A_I = 17.41$. Second, the color of the baseline object provides an additional constraint on the lens. The baseline object (measured when the source is unmagnified) consists of light from the source, the lens, companions to those stars, and ambient stars blended into the PSF. We have measured the astrometic offset between the baseline object in higher-resolution CFHT imaging and the KMTNet microlensing event. We find $\Delta\theta_{\rm CFHT} = (23.1, 7.6) \pm (12.2, 18.4)\ $ mas, which is consistent with zero offset. Hence, all or most of the light from the baseline object (and blend) is likely to be associated with the event as either the source, the lens, or a companion to one or both of them. In this case, the baseline object in OGLE is very red: $(V-I)_{\rm base} = 2.18 \pm 0.13$. In the KMTC pyDIA CMD, the baseline object is the same, very red, color within errors. Because the source is blue relative to the clump, this necessarily implies that the blended light is at least as red or even redder than the baseline object. Hence, either the lens is also very red or it is much fainter than the blend. Even if the lens is behind all of the dust, this implies $(V-I)_{0, \rm L} > 1.12$ at $3\sigma$, assuming $E(V-I) = 0.67$. Then, using \citet{PecautMamajek13} to convert this color to a mass limit gives a limit of $M_{\rm L} \lesssim 0.73 M_{\odot}$. This limit is shown in Figure \ref{fig:constraints} as is the limit for $(V-I)_{\rm L} > 1.79$, which would imply the lens is in front of all of the dust. {\subsection{Tension with {\em Spitzer}-``only" Parallax} \label{sec:tension}} If we combine the flux constraints on the mass of the lens with the measurement of $\theta_{\rm E}$, we can then place a constraint on the microlens parallax and the distance to the lens: \begin{equation} M_{\rm L} = \frac{\theta_{\rm E}}{\kappa \pi_{\rm E}}; \quad \pi_{{\rm rel}} = \frac{\theta_{\rm E}^2}{\kappa M} = \left( \frac{\au}{D_{\rm L}} - \frac{\au}{D_{\rm S}} \right) \end{equation} where we assume that the source is at the mean distance to the red clump, i.e., $D_{\rm S} = 7.56\ $ kpc. Given that $\theta_{*,0} \simeq 0.625\ \mu$as, the Einstein radius is quite large $\theta_{\rm E} = \theta_{*}/\rho \simeq 1.9\,{\rm mas}$. Hence, a mass limit of $M_{\rm L} < 0.73\ M_{\odot}$ (from $(V-I)_{\rm base}$) implies $\pi_{\rm E} > 0.32$ and $D_{\rm L} < 1.35\ $ kpc. However, this estimate is not fully self-consistent because, even if the lens were behind all of the dust, a $0.73\ M_{\odot}$ star at 1.35 kpc would be brighter than the observed blend (i.e., in Figure \ref{fig:constraints} the intersection of the cyan and magenta lines is above the black lines). Combining the blended light constraint with the $\theta_{\rm E}$ measurement results in an upper limit on the lens mass of $\sim 0.55\ M_{\odot}$, so $\pi_{\rm E} > 0.42$ and $D_{\rm L} \lesssim 1\ $kpc (intersection of the black and magenta lines in Figure \ref{fig:constraints}). From the ground-based parallax alone, we have a robust measurement of $\pi_{\rm E, \parallel}$. This gives a lower limit on the microlens parallax of $\pi_{\rm E} \gtrsim 0.3$. Combined with $\theta_{\rm E}$, $\pi_{\rm E, \parallel}$ alone implies $M_{\rm L} \lesssim 0.78 M_{\odot}$. These limits are consistent with our expectations based on $\theta_{\rm E}$ and the blended light. The mass-distance relation calculated from the full ground-based $\pi_{\rm E}$ for the $(s > 1, u_0 < 0)$ solution is shown in Figure \ref{fig:constraints} with $1\sigma$ limits. This shows that there are regions of overlap between this relation and the $\theta_{\rm E}$ relation that are consistent with the constraints from the blended light. However, the constraints from the blend and baseline object support the conclusion that the low-amplitude signal in the {\em Spitzer}\ light curve should be treated with caution. The preferred value of the {\em Spitzer}-``only" parallax gives $\pi_{\rm E} = 0.25$ (red line in Figure \ref{fig:constraints}). This value is in tension with the ground-based parallax values at $\sim 3\sigma$, but, when combined with $\theta_{\rm E}$, it also implies $M_{\rm L} \simeq 0.93\ M_{\odot}$, which is too blue and too bright for the blended light\footnote{One exception to this limit would be if the lens were a white dwarf and the blend were instead a lower-mass companion to that lens.}. At the same time, the full $7\sigma$ arc from the {\em Spitzer}-``only" parallaxes includes regions that overlap with the ground-based parallax contours at $< 2\sigma$ (see Figure \ref{fig:piEcontours}) and which is also more compatible with the blended light. Thus, this tension may be resolved in the future once the constraints from the {\em Spitzer}\ light curve are better understood. {\subsection{Physical Properties of the Lens} \label{sec:lens}} For now, we focus on constraints on the lens properties that may be derived from the ground-based analysis. Table \ref{tab:lens_prop} gives the physical properties of the lens derived from each solution to the microlensing light curve. These values are both consistent with the constraints from the blended light and baseline object and suggest that the lens is responsible for most of the blend. For example, for the $(s > 1), (u_0 < 0)$ solution, we have $M_L = 0.50 \pm 0.12 M_{\odot}$ and $D_{\rm L} = 0.98 \pm 0.2$ kpc. For a 0.5 $M_{\odot}$ star, \citet{PecautMamajek13} give $M_{\rm I} = 7.6$ and $(V-I)_0 = 2.0$. Hence, for a lens at 0.98 kpc, \begin{eqnarray} I_{\rm L} & = & 17.6 + A_I f_{\rm dust}, \\ (V-I)_{\rm L} & = & 2.0 + E(V-I) f_{\rm dust}, \end{eqnarray} where $f_{\rm dust}$ is the fraction of the dust {\em in front of} the lens. We make the naive assumption that the dust follows an exponential profile such that $f_{\rm dust} = 1 - \exp(- D_{\rm L} / (1.334\ {\rm kpc}) )$. Then, this yields $I_{\rm L} = 18.07$ and $(V-I)_{\rm L} = 2.35$, which is shown as the cyan point (``naive lens") in Figure \ref{fig:cmd}. The solid cyan line shows the values of $I_{\rm L}$ and $(V-I)_{\rm L}$ calculated for $\theta_{\rm E} = 1.90\ $ mas for the $1\sigma$ ranges for $\pi_{\rm E}$. The dotted lines show the results evaluated at $\theta_{\rm E} \pm 1\sigma$. Because of the simplified assumption about the dust, these calculations are simply meant to be illustrative. Nevertheless, they indicate that, within the uncertainties, the lens mass and distance are consistent with the blended light constraints within $1\sigma$ and suggest that the lens could be responsible for most or all of the blended light. The hypothesis that the blend is the lens could be tested immediately with adaptive optics observations. These observations could give a stronger constraint associating the blended light with the event as well as a more precise measurement of that light by resolving out unrelated stars. Given the high lens-source relative proper motion ($\mu_{\rm rel} = 11.4\pm 0.8\,{\rm mas\,yr^{-1}}$ or $\mu_{\rm rel} = 12.2\pm 0.7\,{\rm mas\,yr^{-1}}$), it will be possible by $\sim 2025$ to separately resolve the source and lens \citep[e.g.,][]{Terry20}, provided that the lens is responsible for a substantial fraction of the blended light. Such observations would confirm that the blended light is moving with the lens, i.e., that the separation matches the expectations from the lens-source relative proper motion given in Table \ref{tab:lens_prop}. As discussed in Section \ref{sec:parallax_ground_space}, this would also give an independent measurement of the direction of that motion, which could be compared to the constraints from the parallax. \FloatBarrier \vspace{12pt} {\section{Discussion} \label{sec:discussion}} OGLE-2019-BLG-0960 Lb is the smallest mass-ratio microlensing planet ever found. With its discovery, there are now nineteen known planets with mass ratios below the fiducial break proposed by \citet{Suzuki16}, and four planets with mass ratios below the break found by \citet{Jung19_0165}. Measuring the slope of the mass-ratio distribution below $q_{\rm br}$ requires a statistically robust sample, and while the current sample does not meet that criterion, it does offer insight into how such a sample might be obtained. First, in Section \ref{sec:survey-only}, we consider whether or not the planetary perturbation can be characterized with only the survey data. Then, we note in Section \ref{sec:obs-strategy} that most of the known microlensing planets with $q < 10^{-4}$ have $s \sim 1$. We explore the implications of this for designing a search strategy for such planets, e.g., in either existing data or with targeted followup observations. Finally, we discuss in Section \ref{sec:close-wide} the fact that $s\sim1$ is far from the regime for which the $s \rightarrow 1/s$ degeneracy was derived, how the persistence of an $(s < 1)$ vs. $(s > 1)$ degeneracy suggests a deeper symmetry in the lens equation, and how the departure from the original ideal affects our ability to measure and interpret the mass-ratio function. {\subsection{Characterization with Survey Data} \label{sec:survey-only}} \begin{figure} \begin{centering} \includegraphics[height=0.5\textheight]{OB190960_survey.pdf} \caption{Zoom of the planetary perturbation for best-fit models to only the ground-based survey data. We recover the two solutions found when including all the data (``$s>1$, Single" and ``$s<1$, Single", black and cyan, respectively). However, the sparseness of the data allows two additional solutions to the light curve, with a much smaller source and two distinct caustic crossings (``$s>1$, Double" and ``$s<1$, Double", yellow and magenta, respectively). Nevertheless, the mass-ratio of the planet remains small for these solutions. The 1L2S solution (dashed red line) is still strongly ruled out by the survey data that are de-magnified relative to the 1L1S model (gray dashed line). \label{fig:survey_lc}} \end{centering} \end{figure} Naively, we would not expect such a small mass-ratio planet to be found in such a low-cadence survey field unless, as in this case, there are additional followup observations. Such planetary perturbations would typically last \begin{equation} t_{\rm p} \sim \sqrt{q} t_{\rm E} = 4.8\ \mathrm{hr} \left(\frac{q}{10^{-4}}\right)^{1/2}\left(\frac{t_{\rm E}}{20\ \mathrm{d}}\right). \label{eqn:tp} \end{equation} By contrast, all of the surveys observe this field at a cadence of less than one observation per hour (see Section \ref{sec:obs}). The highest survey cadence is for the MOA survey at $0.6\ \mathrm{hr}^{-1}$, which was not able to observe the night of the anomaly. Hence, the mass-ratio of this planet is an order of magnitude smaller than the expected minimum mass ratio for this field if we require 3 observations during the anomaly. Indeed, there is only a single survey observation over the main bump caused by the planet. However, because we know that the planet is real, we can ask whether this planet can be recovered and characterized with the sparse survey data \citep{Yee12}. Then, we can consider whether or not this is evidence that short duration signals with only one to a few observations during the anomaly (the most likely case for the smallest planets) in general can be reliably and meaningfully recovered from sparse survey fields. Therefore, we repeat the search for solutions using only the survey data (i.e., the data from OGLE, MOA, and KMTNet). The grid search over $s$, $q$, and $\alpha$ finds the previous two solutions but also a second pair of degenerate solutions (see Table \ref{tab:survey-only} and Figure \ref{fig:grid}). The new set of solutions corresponds to the case in which the source is much smaller than the caustic and the single KMTC datapoint at 8687.796 falls in the trough between two caustic crossings (see Figure \ref{fig:survey_lc}). Hence, this is an observational degeneracy that could be resolved with the addition of more data. Nevertheless, all four solutions lead to the same conclusions regarding the planetary parameters: the planetary perturbation is created by an extremely small mass-ratio planet at $s \sim 1$. We also find that the 1L2S solution is still strongly ruled out (by $\Delta\chi^2 \sim 300$, see Table \ref{tab:binary-source}). In some ways, it is not surprising that the planet parameters are so well constrained. Because observations are taken every $\sim2.5\ $hr, the maximum duration of the bump is $\sim 5\ $ hr. Then, given Equation (\ref{eqn:tp}) and $t_E\sim 62\ $ days, we would expect $q \lesssim 1.2\times 10^{-5}$. Then, the fact that the event does not produce a perturbation over the peak, despite the extremely high magnification, suggests a planetary caustic-like perturbation. At the same time, the perturbation occurs only 1.4 days after the peak, which places the ``planetary" caustic very close to the central caustic, i.e., in a resonant or close-to-resonant configuration. However, if the planetary perturbation were found and characterized based a single outlier, this would raise substantial questions as to the believability (or publishability) of the planet. In this case, we are fortunate to have extensive follow-up data, so the existence of the perturbation is well-supported. However, the detection of this planet in the survey data is strengthened by several other factors. First, this event has a longer timescale than average ($t_{\rm E} = 62$ days), which enhances the duration of the perturbation via Equation (\ref{eqn:tp}), and hence, the likelihood of obtaining observations during the anomaly. Second, similar to KMT-2019-BLG-0842 \citep{Jung20_0842}, the source trajectory passes at an oblique angle with respect to the binary axis, which further lengthens the duration of the perturbation. As a result, we see from Figure \ref{fig:survey_lc} that there are five additional points that are significantly demagnified relative to the point-lens light curve. Hence, the perturbation lasts for almost a day and the detection does not, in fact, rely solely on a single outlier. In terms of the broader implications for characterizing planetary perturbations based on sparse survey data, it is interesting to compare this event to other cases. The first such case was described in \citet{DominikHirshfeld96}, who showed that a number of different 2L1S models could explain two outliers in MACHO-LMC-001. Another case was described in \citet{GaudiHan04}, who found multiple 2L1S models that fit a single outlier in OGLE-2002-BLG-055. One major contrast between these two events and OGLE-2019-BLG-0960\ is the cadence of observations relative to the Einstein timescale. In both MACHO-LMC-001 and OGLE-2002-BLG-055, observations were only obtained once per few days during the perturbation, which allows for a much broader range of potential models. For example, the perturbation could always be much shorter, resulting in a relatively weak constraint on $q$ using Equation (\ref{eqn:tp}). Hence, even though the survey observations of OGLE-2019-BLG-0960\ were relatively sparse compared to the duration of the perturbation, they are dense compared to $t_{\rm E}$, leading to good constraints on the planet. However, further investigation of short and sparsely-observed perturbations (but that might have well-constrained models) is needed to determine whether or not they are publishable in general. {\subsection{Finding Small Mass-Ratio Planets} \label{sec:obs-strategy}} \begin{figure} \centering \includegraphics[width=0.7\textwidth]{ob0960_small_planets.pdf} \caption{Known microlensing planets with $q < 10^{-3}$ (NASA Exoplanet Archive, accessed 10/27/20). Solid points show planets with a single solution. Planets with multiple degenerate solutions are shown as open circles (one for each solution) connected by dotted lines (excludes planets with mass ratios that are ambiguous by more than a factor of 2). The two degenerate solutions for OGLE-2019-BLG-0960 Lb are shown as the red stars. The gray lines show the fiducial $q_{\rm br} = 1.7\times 10^{-4}$ as proposed by \citet{Suzuki16} (dotted) and the value proposed by \citet{Jung19_0165} (solid). Black solid lines show the boundary between resonant and non-resonant caustics, and the dashed lines show $(3, 1.8) \log s_{\rm resonant}$ for $(s<1)$ and $(s>1)$ caustic structures. The vast majority of planets are found between the dashed lines (so in resonant or close-to-resonant caustics, see Figure \ref{fig:perturbed_widths}), and two are found at $\log s \sim 0.2$ in Hollywood events. \label{fig:small_planets}} \end{figure} \begin{figure} \includegraphics[width=\textwidth]{widths.pdf} \caption{{\em Left}: The horizontal extent of the caustics; for non-resonant caustics, the extent is the sum of the widths of the planetary and central caustics. {\em Center}: The total extent of the region(s) along the binary axis that is perturbed by at least 10\% relative to a point lens. The extents are measured as fractions of an Einstein ring. {\em Right}: Ratio of the 10\% width to the caustic width. The black lines are as in Figure \ref{fig:small_planets}. The dashed lines were chosen to roughly correspond to the value of $s$ for which the extent of the 10\% region is maximized at fixed $q$ (they are the same as those in Figure \ref{fig:small_planets}.). The range of $s$ over which the source plane is significantly perturbed by the planet is substantially larger than the range of $s$ for which the caustic size is maximized. Thus, the cross-section for a planetary perturbation to occur is substantially enhanced over the raw size of the caustics. \label{fig:perturbed_widths}} \end{figure} \begin{figure} \includegraphics[width=\textwidth]{maps.pdf} \caption{Maps showing the difference between the planetary magnification and the magnification of a point lens: $\log q = -4.85$ and $\log s = 1.8 \log s_{\rm resonant, wide} = 0.0278$ (top) and $\log s = 3 \log s_{\rm resonant, close} = -0.0238$ (bottom). Planets just outside of resonance produce significant deviations to the point lens magnification extending between the two caustic structures (magenta), which may be either positive (white) or negative (black). \label{fig:mag_map}} \end{figure} \begin{figure} \includegraphics[width=\textwidth]{max_u.pdf} \caption{Black (dashed, solid): maximum radial extent ``max u" of the $(s < 1)$ and $(s>1)$ resonant caustic structures for a given value of $\log q$. Blue: maximum value of $|x|$ (which we use as a proxy for $u$) along the binary axis for which the magnification pattern is perturbed by at least 10\% relative to a point lens. The value of $s$ is chosen such that the extent of the region is maximized for a given $q$ (see text, Figure \ref{fig:perturbed_widths}). Magenta: same as blue but for a 20\% perturbation. Gray lines as in Figure \ref{fig:small_planets}. Fully probing the region perturbed by the planet requires continuously monitoring the light curve through $\pm$ ``max u". \label{fig:u_extent}} \end{figure} Given that there appear to be a number of factors that make this planetary perturbation ``special," we now consider how detections of small planets in general can be enhanced. Previously, \citet{Abe13} had suggested that the sensitivity of microlensing events to small planets was enhanced for moderate magnification events ($A > 50$). Indeed, examining the published microlensing planets\footnote{NASA Exoplanet Archive, accessed 10/27/20.} with $q < q_{\rm br} = 1.7\times 10^{-4}$ supports this conclusion. Here, we include events with multiple degenerate solutions if all solutions are planetary and at least one solution has $q < q_{\rm br}$. Seven out of nineteen planets with $q < q_{\rm br}$ have been in events with $u_0 \le 0.02$ (i.e., $A \ge 50$). Another seven are found in events with $0.02 < u_0 \le 0.1$ and two more in events with $0.1 < u_0 \le 0.2$. The remaining three planets were all found in ``Hollywood'' events, in which the source was a giant. The second thing to notice about the known small planets is that about half of them are found in events with resonant caustics and many of the others have separations that are close to resonance (see Figure \ref{fig:small_planets} in which we {\em exclude} planets with ambiguous mass ratios, see caption). On the one hand, resonant caustics are larger than planetary caustics \citep[the size of the resonant caustic scales as $q^{1/3}$ whereas the size of the planetary caustic scales as $q^{1/2}$;][]{Dominik98,Han06}, enhancing the probability that the images of the source are perturbed. On the other hand, resonant caustics are generally expected to produce weaker perturbations \citep{Gaudi12}, which might not be significant enough to be detected. Empirically, Figure \ref{fig:small_planets} shows that the majority of the detected planets are in resonant or near-resonant configurations, suggesting that the enhanced cross-section is the dominant effect and extends to configurations outside of resonance. It also suggests that the ``enhancement" for detectability extends to planets with separations $s$ well outside the formal range for resonant caustics. The enhanced cross-section for a perturbation for caustics close to, but outside of resonance, comes about because the perturbed magnification pattern extends out from and stretches all the way between the planetary and central caustics. Figure \ref{fig:perturbed_widths} compares the width of the caustics and the width of the region for which the magnification of a star+planet lens deviates by at least 10\% compared to the star alone. For this exercise, we choose a 10\% deviation as a reasonable threshold for producing a detectable perturbation. The ``width of the caustics" is measured as the horizontal extent of the caustics (i.e., measured along the binary axis) and, if the caustic is not resonant, is the sum of the widths of the planetary and central caustics. The width of the deviation from a point lens is measured along a slice through the binary axis. We usually think of the cross-section for detecting planetary perturbations as being equal to (or proportional to) the size of the caustics. However, Figure \ref{fig:perturbed_widths} shows that when measured in terms of a 10\% deviation, the cross-section is largest for separations just outside of resonance and is significantly larger at that boundary than one would expect from strict proportionality. The decreased width of the 10\% perturbation region for $\log s = 0$ reflects the relative ``weakness" of true resonant caustics\footnote{The form of the right panel in Figure \ref{fig:perturbed_widths} also has a similarity to the detection sensitivity diagram for OGLE-2008-BLG-279 \citep[see Figure 7 of ][]{Yee09} arising from the same effect.}. The maximum size of a 10\% deviation for fixed $q$ peaks at $\sim3\log s_{\rm resonant}$ for $s < 1$ and $\sim1.8\log s_{\rm resonant}$ for $s > 1$, where $s_{\rm resonant}$ is the boundary between resonant and non-resonant caustics \citep[i.e., Equations (57) and (58) from][]{Dominik98}. Even though caustics in this region are not formally resonant, they are clearly influencing each other. Thus, we refer to caustics in this range as ``semi-resonant." \citet{Abe13} noted this effect for caustic structures with $s < 1$ and referred to it as a ``cooperative effect." For such caustics, there is an extended ``trough" (negative magnification deviation) along the binary axis connecting the planetary and central caustics (bottom panel of Figure \ref{fig:mag_map}). However, we also see this effect for $s > 1$ caustics but in the form of a narrow ``ridge" (positive magnification deviation) connecting the planetary and central caustics (top panel of Figure \ref{fig:mag_map}). These effects can also be seen in Figure 10 of \citet{Gaudi10}. In terms of detectability, it may be that $s < 1$ caustic perturbations are easier to detect because the vertical extent of the 10\% deviation region is larger\footnote{Compared to Figure \ref{fig:mag_map}, the separation between the planetary caustics for $s < 1$ will grow much faster with $q$ than the height of the planetary caustic for $s>1$ \citep{Han06}.}, and thus, a typical perturbation will last longer. Empirically, we do see that there are more $s < 1$ planets than $s>1$ planets for $q < 1.7\times 10^{-4}$, but the total numbers are still too small for this to be a statistically meaningful result. By contrast, \citet{Jung20_0842} noted that published perturbations crossing ``ridges" found in $s > 1$ events tend to have source trajectories with oblique angles. Such trajectories will result in proportionally longer perturbations, but represent only a small fraction of possible trajectories, suggesting many such perturbations are missed due to insufficient cadence. In terms of detection strategy, Figure \ref{fig:u_extent} shows the maximum value of $u$ for which the magnification pattern due to a planet is perturbed by at least 10\% relative to a point lens. Because the orientation of the caustic structure relative to the source trajectory is random, this suggests that events should be monitored continuously for $\tau = \pm u$ in order to probe this full structure. In the case of OGLE-2019-BLG-0960, we called off the alert at $\tau \sim +0.01$, and thus, the planet was nearly missed. This investigation suggests that to search for planets with $\log q < -4.5$, events should be densely monitored for $\tau = \pm 0.2$, i.e. $A > 5$. Indeed, \citet{Han20_1025} report the detection of a planet in KMT-2018-BLG-1025 with $q\sim 10^{-4}$ in which the perturbation occurred at $\tau \sim 0.05$. {\subsection{``Close"/``Wide" Degeneracy for Semi-Resonant Caustics?} \label{sec:close-wide}} \begin{figure} \includegraphics[width=\textwidth]{ob0960_degen.pdf} \caption{{\em Left}: microlensing planets with two degenerate solutions (NASA Exoplanet Archive, accessed 10/27/20). Dotted line at $\log s = 0$, solid and dashed lines as in Figures \ref{fig:small_planets} and \ref{fig:perturbed_widths}. Points are colored by impact parameters, $u_0$, and the symbol types indicate whether the caustics are near-resonant/resonant (triangles) or non-resonant (circles), i.e., inside or outside the dashed lines. OGLE-2019-BLG-0960\ is marked by black stars. {\em Right}: difference from a ``true" ``close"/``wide" degeneracy. Events with a perfect $s \leftrightarrow s^{-1}$ degeneracy should have mean$(\log s) \rightarrow 0$. By contrast, most of the events shown, including OGLE-2019-BLG-0960, have resonant or semi-resonant caustics (triangles), i.e., are not in the $|\log s| \gg 0$ regime, and many do {\em not} have mean$(\log s) \rightarrow 0$. For these events, the different degenerate solutions can have significant fractional deviations in $q$, in contrast to the expectation that $q$ is invariant to the ``close"/``wide" degeneracy for the limit as $|\log s| \gg 0$. \label{fig:degen}} \end{figure} Figure \ref{fig:small_planets} also shows that many planets have multiple, degenerate solutions. These degenerate solutions usually have one solution with $s < 1$ and another with $s > 1$ and are often referred to as arising from the ``close"/``wide" degeneracy. However, we will see that this degeneracy is more complex than the degeneracy that was first described by \citet{GriestSafizadeh98} and expanded upon by \citet{Dominik98} and \citet{An05}. As an example, the two solutions for OGLE-2019-BLG-0960\ nominally have the hallmarks of the ``close"/``wide" degeneracy for central caustics. First, the event is in the ``high-magnification" regime ($u_0 < 0.01$). Second, one of the solutions has $s < 1$ while the other has $s > 1$. However, the two solutions are not centered around $\log s = 0$, i.e., $s_{\rm close} \neq s_{\rm wide}^{-1}$. Furthermore, the ``close"/``wide" degeneracy was derived by \citet{GriestSafizadeh98} and \citet{Dominik98} from the lensing equation in the regime where $|\log s|$ is large, i.e., the regime in which the central and planetary caustics are well-separated from each other. \citet{GriestSafizadeh98} even state ``We expect the formula to break down when $q \rightarrow 1$ or $x_p \rightarrow 1$" (where they use $x_p$ in place of $s$). OGLE-2019-BLG-0960\, is clearly not in this regime: in both solutions, $s \sim 1$ and the caustic structure is resonant. Thus, it is interesting to consider whether this is in fact a case of the ``close"/``wide" degeneracy. Because the two solutions are not centered around $\log s = 0$, they may in fact be more analogous to the ``inner"/``outer" degeneracy described by \citep{CalchiNovati19_1067} in which the source trajectory may pass either inside or outside the planetary caustic relative to the central caustic. An examination of the caustic structures for OGLE-2019-BLG-0960\, (see Figure \ref{fig:caustics}), shows that the ``close" solution passes to the {\it outside} the caustic whereas the ``wide" solution passes over the bridge in the resonant caustic created {\it in between} what would be the central and planetary caustics. Two other small planets, OGLE-2016-BLG-1195Lb and KMT-2019-BLG-0842Lb, also show this degeneracy \citep{Bond17_1195,Shvartzvald17_1195,Jung20_0842}. The ``inner"/``outer'' degeneracy in these four events appears to result from the planetary caustic degeneracy that was first derived in the Chang-Refsdal limit \citep{ChangRefsdal79} by \citet{GaudiGould97}. This degeneracy is intrinsic, i.e. rooted in mathematical symmetries in the lens equation rather than ``accidental," which refers to degeneracies arising due to insufficient observational coverage of the perturbation. However, again it was derived in the limit that $|\log s|$ was large, and it was expected to break down as $|\log s| \rightarrow 0$. None of these events is in the limit that $|\log s|$ is large, yet a degeneracy persists. This suggests that while the ``close"/``wide" degeneracy of \citet{GriestSafizadeh98} and the ``inner"/``outer" degeneracy of \citet{GaudiGould97} were derived in the limit that $|\log s|$ is large, as $|\log s| \rightarrow 0$, instead of breaking down, the two degeneracies merge. To investigate this possibility in more detail, we review the known microlensing planets with two degenerate ``geometric" solutions. These may refer to either two distinct caustic topologies or two distinct source trajectories relative to the caustic. As shown in Figure \ref{fig:degen}, of the planets with one $s < 1$ and one $s > 1$ solution, very few can be described as having well-separated caustics, i.e., are in the ``close"/``wide" regime as described by \citet{GriestSafizadeh98}. The vast majority of planets with degenerate solutions are either in the resonant or semi-resonant regime, similar to OGLE-2019-BLG-0960. Events in the resonant or semi-resonant regime share the characteristics that the degenerate solutions tend not to be perfectly symmetric about $|\log s| = 0$. Also, in contrast to the \citet{GriestSafizadeh98} limit, the degenerate solutions tend to have slightly different values of $q$. This is especially true for events in the moderate magnification regime ($0.01 < u_0 < 0.1$), which is precisely the region where we expect the smallest planets to be found. Fortunately, because $|\log s|$ is very close to 0 in both cases, this degeneracy does not meaningfully affect the interpretation of the projected separation between the planet and its host star. However, the small differences in $q$ will have to be taken into account when interpreting statistical samples of such planets. \vspace{12pt} {\section{Conclusions} \label{sec:conclusions}} With a mass ratio of $q \sim 1.27\pm0.07$ or $\sim 1.45\pm0.15 \times 10^{-5}$, OGLE-2019-BLG-0960 Lb is the smallest mass-ratio microlensing planet ever found. The annual parallax effect combined with the finite source effect indicate the host star is an M-dwarf at $D_{\rm L} \lesssim 1\,$ kpc with a super-Earth planet orbiting between 1 and 2 au (see Table \ref{tab:lens_prop} for exact values for each solution). The lens is plausibly responsible for all or most of the blended light, a hypothesis that can be tested immediately by taking adaptive optics or HST observations to determine whether the blend is associated with the event. OGLE-2019-BLG-0960 Lb is the 19th microlensing planet with a mass-ratio below the fiducial power-law break in the mass-ratio distribution, $q_{\rm br} = 1.7\times10^{-4}$, posited by \citet{Suzuki16}. It is the fourth planet below the revised break of $q_{\rm br} = 0.55\times10^{-4}$ from \citet{Jung19_0165}. The three smallest planets (including this one) have all been discovered since the advent of continuous survey observations from KMTNet. This indicates that the current generation of microlensing experiments is now capable of measuring both the precise location of $q_{\rm br}$ and the power-law slope, $p$, of the mass-ratio distribution below $q_{\rm br}$. By comparing OGLE-2019-BLG-0960\ with other published planets below $q_{\rm br}$ (Section \ref{sec:obs-strategy}), we found that they are primarily found in moderate magnification and ``Hollywood'' \citep{Gould97Hollywood} events. Moderate magnification events are the primary source of small planets because the cross-section for a planetary perturbation is largest when the planetary caustics are near resonance. In fact, the planet sensitivity is maximized for planets just outside resonance ($|\log s| > |\log s_{\rm resonant}|$) because significant perturbations to the magnification field extend well beyond the caustic structures. However, the planet sensitivity decreases rapidly for $|\log s| \gtrsim {\rm few} |\log s_{\rm resonant}|$. Three of the nineteen planets with mass ratios smaller than $q = 1.7 \times 10^{-4}$ were found in ``Hollywood" events, for which the cross-section for light-curve anomalies is set by the source size rather than the caustic size. For these planets $s \gg s_{\rm resonant}$. The expected yield for such events is likely to be much lower than for moderate magnification events. Typical source sizes are $\rho \sim 0.01$, and thus, the cross-section is a factor of $\sim 10$ smaller than for moderate magnification events. At the same time, events with giant sources represent only a fraction of all microlensing events, making intensive work on such events tractable. Hence, the focus for discovering planets with $\log q \lesssim -4$ should be on moderate magnification events and events with giant sources. This search could be conducted within existing survey data or be supplemented by a followup campaign. Even though OGLE-2019-BLG-0960 Lb could be recovered from survey data alone (Section \ref{sec:survey-only}), this recovery was aided by the special geometry of the light curve \citep{Jung20_0842} and suggests that similar, but shorter and potentially more numerous, perturbations would be missed in the low-cadence survey fields. For followup observations, \citet{Abe13} previously suggested that the focus for small planets should be events with $50 < A_{\rm max} < 200$. Our investigation shows that events should be monitored for the full time that they have $A > 5$, which suggests this focus should be extended to events with peak magnification $A_{\rm max} > 10$ or even smaller. If additional resources are available, followup observations could be further extended to include events with giant sources. This strategy will maximize the number of small planets found and enable a robust measurement of the mass-ratio distribution of microlensing planets with $q < q_{\rm br}$. Finally, OGLE-2019-BLG-0960\ and many of the other planets in moderate magnification events suffer from a degeneracy that results in two solutions for the light curve: one with $s > 1$ and one with $s < 1$. For this event (and most small planets), such degeneracies have little effect on the interpretation of the separation of the planet from the host star, because $s \sim 1$. However, we showed in Section \ref{sec:close-wide} that it does have some effect on the value of $q$. This is contrary to the expectation of \citet{GriestSafizadeh98} that $q$ should be very similar under the ``close"/``wide" degeneracy, likely because $s \sim 1$ is very far from the regime in which this degeneracy was derived. It seems likely that the origin of these degenerate solutions arises from some previously undiscovered symmetry in the lens equation of which the classical ``close"/``wide" degeneracy may be a limiting case. However, truly understanding this symmetry requires going beyond the purely empirical investigation carried out in this paper. \acknowledgements{Work by JCY was supported by JPL grant 1571564. W.Z. and S.M. acknowledge support by the National Science Foundation of China (Grant No. 11821303 and 11761131004). This research has made use of the KMTNet system operated by the Korea Astronomy and Space Science Institute (KASI) and the data were obtained at three host sites of CTIO in Chile, SAAO in South Africa, and SSO in Australia. The OGLE has received funding from the National Science Centre, Poland, grant MAESTRO 2014/14/A/ST9/00121 to AU. This research uses data obtained through the Telescope Access Program (TAP), which has been funded by the National Astronomical Observatories of China, the Chinese Academy of Sciences, and the Special Fund for Astronomy from the Ministry of Finance. The MOA project is supported by JSPS KAKENHI Grant Number JSPS24253004, JSPS26247023, JSPS23340064, JSPS15H00781, JP16H06287, and JP17H02871. This work is based (in part) on observations made with the {\it Spitzer} Space Telescope, which is operated by the Jet Propulsion Laboratory, California Institute of Technology under a contract with NASA. Support for this work was provided by NASA through an award issued by JPL/Caltech. Work by AG was supported by AST-1516842 and by JPL grant 1500811. AG received support from the European Research Council under the European Unions Seventh Framework Programme (FP 7) ERC Grant Agreement n. [321035]. Work by CH was supported by the grants of National Research Foundation of Korea (2019R1A2C2085965 and 2020R1A4A2002885). Wei Zhu was supported by the Beatrice and Vincent Tremaine Fellowship at CITA. YT acknowledges the support of DFG priority program SPP 1992 ``Exploring the Diversity of Extrasolar Planets" (WA 1047/11-1). This research has made use of the NASA Exoplanet Archive, which is operated by the California Institute of Technology, under contract with the National Aeronautics and Space Administration under the Exoplanet Exploration Program.} \FloatBarrier
\section{Introduction} \label{sec:intro} \vspace*{-0.05in} Compared to other kinds of inputs (\eg, sketches and object masks), descriptive sentences are an intuitive and flexible way to express visual concepts for generating images. The main challenge for text-to-image synthesis lies in learning from unstructured description and handling the different statistical properties between vision and language inputs. \begin{figure} \centering \includegraphics[width=\linewidth]{figures/overview.pdf} \vspace{-10pt} \caption{Inter-modal and intra-modal contrastive losses in our proposed \CLGAN text-to-image synthesis model.} \label{fig:overview} \end{figure} Generative Adversarial Networks (GANs)~\cite{goodfellow2014generative} have shown promising results on text-to-image generation \cite{reed2016generative,Han17,Han17stackgan2}, using a conditional GAN formulation~\cite{gauthier2015conditional}. AttnGAN~\cite{xu18} proposes a multi-stage refinement framework to generate fine-grained details by attending to relevant words in the description. These models generate high fidelity images on single domain datasets (\eg, birds~\cite{WahCUB_200_2011} and flowers~\cite{Nilsback08}), but struggle on complex scenes with many objects---such as those in MS-COCO~\cite{LinMBHPRDZ14}. Recent methods~\cite{HongYCL18,objgan19,HinzHW19,trecs2020} propose object-driven, hierarchical approaches that explicitly model object instances within an image. Given the text description, they first infer a semantic layout (\eg, object bounding boxes, segmentation masks, or a combination), and then generate an image from the layout. These hierarchical methods are cumbersome to apply to real-world scenarios; generation becomes a multi-step process (box-to-mask-to-image), and the model requires much more fine-grained object labels to train. We study contrastive learning in the context of text-to-image synthesis and demonstrate that a simple one-stage GAN \textit{without} object-level annotation can outperform prior object-driven and multi-stage approaches. Besides generating realistic images, we also hope (1) the image should holistically match the description; (2) generated images should match real images when they are conditioned on the same description; (3) individual image regions should be recognizable and consistent with words in the sentence. To fulfill these desiderata and achieve strong language alignment, we propose to maximize the mutual information between the corresponding pairs through contrastive learning. Our method, the Cross(X)-Modal Contrastive Generative Adversarial Network (\CLGAN), uses image to sentence, image region to word, and image to image contrastive losses to enforce alignment between generated images and their captions (Fig.~\ref{fig:overview}). Our primary contributions include: \begin{itemize}[noitemsep] \item We propose \CLGAN, a simple one-stage GAN that employs several contrastive losses. \CLGAN produces dramatic improvements over previous models, e.g. reducing FID~\cite{FID} from 24.70 to 9.33 on MS-COCO\xspace and from 48.70 to 14.12 on LN-COCO\xspace (the MS-COCO\xspace portion of Localized Narratives~\cite{pont2019connecting}). \item We conduct thorough human evaluations comparing \CLGAN to three recent models. These show that people prefer \CLGAN 77.3\% of the time for image realism, and 74.1\% for image-text alignment. \item We establish a strong benchmark on the challenging LN-OpenImages\xspace (Open Images subset of Localized Narratives). To the best of our knowledge, this is the first text-to-image results training and testing on the diverse images and descriptions for Open Images. \item We conduct a thorough analysis of contrastive losses used in \CLGAN to provide general modeling insights for contrastive learning in conditional GANs. \end{itemize} \noindent \CLGAN consistently produces images that are more coherent and detailed than previous models. In addition to greater realism (with clearer, more delineated objects), they better capture the full image description, including the presence of named objects and background compositions. \vspace*{-0.05in} \section{Related Work} \label{sec:related_work} \vspace*{-0.05in} \paragraph{Text-to-image synthesis} Generating images from text descriptions has been quickly improved with deep generative models, including pixelCNN~\cite{Oord16, Reed17parallel}, approximate Langevin sampling~\cite{NguyenYBDC17}, variational autoencoders (VAEs)~\cite{KingmaW14, Gregor15DRAW} and Generative Adversarial Networks (GANs)~\cite{goodfellow2014generative, reed2016generative}. GAN-based models in particular have shown better sample quality~\cite{Han17,zhang2018photographic, xu18, zhu2019dm,yin2019semantics,li2019control,Tan2019SemanticsEnhancedAN, qiao2019learn, lao2019dual}. GAN-INT-CLS~\cite{reed2016generative} was the first to use conditional GANs for text to image generation. StackGAN~\cite{Han17, Han17stackgan2} improves this with a coarse-to-fine framework that progressively generates images at different resolutions for high-resolution synthesis. AttnGAN~\cite{xu18} introduces cross-modal attention to better capture details. DM-GAN~\cite{zhu2019dm} adaptively refines generated images with a memory module that writes and reads text and image features. MirrorGAN~\cite{qiao2019mirrorgan} enforces text-image consistency via caption generation on the generated images. SD-GAN~\cite{yin2019semantics} proposes word-level conditional batch normalization and dual encoder structure with triplet loss to improve text-image alignment. Compared with the triplet loss, our contrastive loss does not require mining for informative negatives and thus lowers training complexity. CP-GAN~\cite{liang2019cpgan} proposes an object-aware image encoder and fine-grained discriminator. Its generated images obtain high Inception Score~\cite{salimans2016improved}; however, we show it performs poorly when evaluated with the stronger FID~\cite{FID} metric and in human evaluations (see Sec.~\ref{sec:compareprevious}). To create a final high resolution image, these approaches rely on multiple generators and discriminators to generate images at different resolutions. Others have proposed hierarchical models that explicitly generate different objects after inferring semantic layouts \cite{HongYCL18,HinzHW19,trecs2020}. A drawback of these is that they need fine-grained object labels (\eg, object bounding boxes or segmentation maps), so generation is a multi-step process. Compared to these multi-stage and multi-step frameworks, our proposed \CLGAN only has a single generator and discriminator trained end-to-end, and it generates much higher quality images. \vspace*{-0.12in} \paragraph{Contrastive learning and its use in GANs} Contrastive learning is a powerful scheme for self-supervised representation learning~\cite{oord2018representation, he2019moco, chen2020simple, wu2018unsupervised}. It enforces consistency of image representations under different augmentations by contrasting positive pairs with negative ones. It has been explored under several adversarial training scenarios~\cite{lee2020infomax, zhao2020image, deng2020disentangled, qiao2018geometry}. Cntr-GAN~\cite{zhao2020image} uses a contrastive loss as regularization on image augmentations for unconditional image generation. ContraGAN~\cite{kang2020contrastive} explores contrastive learning for class-conditional image generation. DiscoFaceGAN~\cite{deng2020disentangled} adds contrastive learning to enforce disentanglement for face generation. CUT~\cite{park2020contrastive} proposes patch-based contrastive learning for image-to-image translation by using positive pairs from the same image location in input and output images. Unlike prior work, we use intra-modality (image-image) and inter-modality (image-sentence and region-word) contrastive learning in text-to-image synthesis (Fig.~\ref{fig:overview}). \begin{figure*} \centering \includegraphics[width=\linewidth]{figures/model.pdf} \vspace{-10pt} \caption{Overview of the proposed \CLGAN.} \label{fig:model} \end{figure*} \vspace*{-0.05in} \section{Preliminaries} \vspace*{-0.05in} \subsection{Contrastive Representation Learning} \label{sec:contrastive} \vspace*{-0.05in} \vspace*{-0.05in} Contrastive learning aims to learn useful features given different views of data~\cite{Tian0PKSI20}. For example, note that $v_1$ and $v_2$ are two random variables to represent two different views of data. Feature representations are learned by measuring the mutual dependence $I(v_1; v_2)$ between these two variables. As directly maximizing the mutual information is challenging~\cite{paninski2003estimation, belghazi2018mutual,song2019understanding}, the InfoNCE loss~\cite{oord2018representation} was proposed to maximize a lower bound of the mutual information $I(v_1; v_2)$ Specifically, given a query sample $v_{1,i}$, minimizing the InfoNCE loss is to score the matching positive sample $v_{2,i} \sim p(v_2|v_{1,i})$ higher than $M{-}1$ negative samples $v_{2,j} \sim p(v_2)$. The overall objective can be summarized as follows: \begin{equation} \label{equation:loss_nce} \begin{split} & I(v_1;v_2) \geq \log(M) - \mathcal{L}_{NCE},\\ \text{where } \mathcal{L}_{NCE} &= -\mathbb{E}\Bigg[ \log \frac{\exp(\mathcal{S}(v_{1,i}, v_{2,i}))}{\sum_{j=1}^{M}\exp(\mathcal{S}(v_{1,i}, v_{2,j}))}\Bigg]. \\ \end{split} \end{equation} Here, $\mathcal{S}(\cdot, \cdot)$ is the score function, which usually has two parameterized feature encoders for $v_1$ and $v_2$. The encoders can share parameters if $v_1$ and $v_2$ are from the same modality. There are many ways to construct $v_1$ and $v_2$: different image augmentations \cite{he2019moco,chen2020simple}; spatially adjacent image patches \cite{oord2018representation}; a video as $v_1$ and its aligned audio as $v_2$ for video representation learning \cite{morgado2020audio, chung2019perfect}. \vspace*{-0.05in} \subsection{Generative Adversarial Networks (GANs)} \vspace*{-0.05in} \label{sec:gans} GANs \cite{goodfellow2014generative} are generative models that employ both a generator and a discriminator. The generator $G$ maps a latent variable $z{\sim}p{(z)}$ (usually sampled from a Gaussian distribution) to a real data distribution $p_\text{data}$. The discriminator $D$ is trained to distinguish whether inputs are synthesized by $G$ or sampled from real data. The generator $G$ is trained to synthesize images that the discriminator will classify as real. A large amount of work has focused on designing the adversarial objective to improve training~\cite{goodfellow2014generative, WGAN, Mao2016, Salimans18, lim2017, Tran2017}. A notable example is the hinge loss: \begin{equation} \begin{split} \mathcal{L}_D=&-\mathbb{E}_{x \sim p_\text{data}}\left[\min(0, -1+D(x))\right] \\ &- \mathbb{E}_{z \sim p(z)}\left[\min(0, -1-D(G(z)))\right], \\ \mathcal{L}_G=&- \mathbb{E}_{z \sim p(z)}\left[D(G(z))\right]. \end{split} \label{eq:hinge_gan} \end{equation} \noindent The hinge loss has been used in state-of-the-art GANs for image generation~\cite{Miyato18a,SAGAN, BIGGAN, zhang2019consistency}. For conditional GANs, the generator and the discriminator are provided with an additional condition $c$, yielding $G(z, c)$ and $D(x, c)$. For conditional generation, the generated sample should be both realistic and also match the condition $c$. \vspace*{-0.05in} \section{Method} \label{sec:method} \vspace*{-0.05in} We describe the losses and components of \CLGAN below. See Fig.~\ref{fig:model} for an overview. \vspace*{-0.05in} \subsection{Contrastive Losses for Text-to-Image Synthesis} \vspace*{-0.05in} Text-to-image synthesis is a conditional generation task. Generated images should both be realistic and well-aligned with a given description. To achieve this, we propose to maximize the mutual information between the corresponding pairs: (1) image and sentence, (2) generated image and real image with the same description, and (3) image regions and words. Directly maximizing mutual information is difficult (see Sec.~\ref{sec:contrastive}), so we maximize the lower bound of the mutual information by optimizing contrastive (\ie, InfoNCE) losses. \vspace*{-0.12in} \paragraph{Image-text contrastive loss.} Given an image $x$ and its corresponding description $s$, we define the score function following previous work in contrastive learning~\cite{he2019moco,chen2020simple, oord2018representation}: \begin{align} \label{eq:score_function} \mathcal{S}_{\text{sent}}(x, s) = \cos(f_{\text{img}}(x), f_{\text{sent}}(s))/\tau, \end{align} where $\cos(u, v) = u^T v / \Vert u \Vert \Vert v \Vert$ denotes cosine similarity, and $\tau$ denotes a temperature hyper-parameter. $f_{\text{img}}$ is an image encoder to extract the overall image feature vector and $f_{\text{sent}}$ is a sentence encoder to extract the global sentence feature vector. This maps the image and sentence representations into a joint embedding space $\mathbb{R}^D$. The contrastive loss between image $x_i$ and its paired sentence $s_i$ is computed as: \begin{align}\label{eq: sentence_contrastive} \mathcal{L}_{\text{sent}} (x_i, s_i) = - \log \frac{\exp(\cos(f_{\text{img}}(x_i), f_{\text{sent}}(s_i))/\tau)}{\sum_{j=1}^{M}\exp(\cos(f_{\text{img}}(x_i), f_{\text{sent}}(s_j))/\tau)}. \end{align} This form of contrastive loss is also known as the normalized temperature-scaled cross entropy loss (\textit{NT-Xent})~\cite{chen2020simple}. \vspace*{-0.12in} \paragraph{Contrastive loss between fake and real images with shared description.} This contrastive loss is also defined with \textit{NT-Xent}. The main difference is that a shared image encoder $f_{\text{img}}^{\prime}$ extracts features for both real and fake images. The score function between two images is $\mathcal{S}_{\text{img}}(x, \tilde{x})=\cos(f_{\text{img}}^{\prime}(x), f_{\text{img}}^{\prime}(\tilde{x}))/\tau$. The image-image contrastive loss between real image $x_i$ and generated image $G(z_i, s_i)$ is: \begin{equation}\label{eq: image_contrastive} \begin{split} \mathcal{L}_{\text{img}} (x_i, G(z_i, s_i)) = - \log \frac{\exp(\mathcal{S}_{\text{img}}(x_i, G(z_i, s_i)))}{\sum_{j=1}^{M}\exp(\mathcal{S}_{\text{img}}(x_i, G(z_j, s_j)))}. \end{split} \end{equation} \vspace*{-0.12in} \paragraph{Contrastive loss between image regions and words.} Individual image regions should be consistent with corresponding words in an input description. We use attention~\cite{xu18} to learn connections between regions in image $x$ and words in sentence $s$, without requiring fine-grained annotations that align words and regions. We first compute the pairwise cosine similarity matrix between all words in the sentence and all regions in the image; then, we compute the soft attention $\alpha_{i,j}$ for word $w_i$ to region $r_j$ as: \begin{align}\label{equation: attn_region} \alpha_{i,j} = \frac{\exp(\rho_1 \cos(f_{\text{word}}(w_i), f_{\text{region}}(r_j)))}{\sum_{h=1}^{R}\exp( \rho_1\cos(f_{\text{word}}(w_i),f_{\text{region}}(r_h)))}, \end{align} where $f_{\text{word}}$ and $f_{\text{region}}$ represent word and region feature encoders respectively, $R$ is the total number of regions in the image and $\rho_1$ is a sharpening hyper-parameter to reduce the entropy of the soft attention. The aligned region feature for the $i^{th}$ word is defined as $c_i = \sum_{j=1}^{R} \alpha_{i,j} f_{\text{region}}(r_j)$. The score function between all the regions in image $x$ and all words in sentence $s$ can then be defined as: \small \begin{align} \mathcal{S}_{\text{word}} (x, s) = \log \Big(\sum_{h=1}^{T} \exp(\rho_2 \cos(f_{\text{word}}(w_h), c_h))\Big)^{\frac{1}{\rho_2}}/\tau, \end{align} \normalsize where $T$ is the total number of words in the sentence. $\rho_2$ is a hyper-parameter that determines the weight of the most aligned word-region pair, \eg, as $\rho_2 \rightarrow \infty$, the score function approximates to $\max_{h=1}^{T} \cos(f_{\text{word}}(w_h), c_h)$. Finally the contrastive loss between the words and regions in image $x_i$ and its aligned sentence $s_i$ can be defined as: \begin{align} \mathcal{L}_{\text{word}} (x_i, s_i) = - \log \frac{\exp(\mathcal{S}_{\text{word}}(x_i, s_i))}{\sum_{j=1}^{M}\exp(\mathcal{S}_{\text{word}}(x_i, s_j))}. \end{align} \vspace*{-0.05in} \subsection{Attentional Self-Modulation Generator} \label{sec:generator} \vspace*{-0.05in} We propose a one-stage generator to directly generate the image at the desired resolution. This is much simpler than previous multi-stage generators that create images at multiple, different resolutions. We first sample noise $z$ from a standard Gaussian distribution. We obtain the global sentence embedding $e_s$ and the word embeddings $e_w$ from a pretrained BERT~\cite{devlin2018bert} module. $e_s$ and $z$ are concatenated to form the global condition, which is passed through several up-sampling blocks (see appendix for details) to generate a $16 \times 16$ feature map. The global condition is also used as the condition to calculate scale parameter $\gamma$ and shift parameter $\beta$ in conditional batch normalization layers. This formulation is also known as self-modulation~\cite{chen2018self}. The self-modulation layer improves consistency of the hidden feature with the conditional inputs, but it lacks finer details for each sub-region. To generate fine-grained, recognizable regions, we propose the \textit{attentional self-modulation layer}. Specifically, besides random noise $z$ and global sentence embedding $e_s$, we modify the attention mechanism~\cite{xu18} to calculate the word-context vector as the additional modulation parameter for each sub-region. For the $j^{th}$ region with feature $h_j$, the word-context vector $c_j$ is: \small \begin{equation} \begin{split} c_j = \sum_{i=1}^{T} \tilde{\alpha}_{j, i} e_{w_i}, \text{where } \tilde{\alpha}_{j,i} = \frac{\exp(\rho_0 \cos(e_{w_i}, h_j))}{\sum_{k=1}^{T}\exp(\rho_0 \cos(e_{w_k},h_j))}, \end{split} \label{eq:hinge_gan} \end{equation} \normalsize where $T$ is the total number of words in the sentence and $\rho_0$ is a sharpening hyper-parameter. Then, the modulated feature $h_j^{\prime}$ for the $j^{th}$ region can be defined as: \small \begin{equation} \begin{split} h_j^{\prime} = \gamma_j (\text{concat}(z, e_s, c_j)) \odot \frac{h_j -\mu}{\sigma} + \beta_j(\text{concat}(z, e_s, c_j)), \end{split} \label{eq:hinge_gan} \end{equation} \normalsize where $\mu$ and $\sigma$ are the estimated mean and standard deviation from aggregating both batch and spatial dimensions. $\gamma_j(\cdot)$ and $\beta_j(\cdot)$ represent any function approximators; in our work we simply use linear projection layers. Further details of the generator can be found in the appendix. \begin{algorithm}[t] \caption{\CLGAN Training Algorithm.} \label{alg:main} \begin{algorithmic}[1] \renewcommand{\algorithmicrequire}{\textbf{Input:}} \renewcommand{\algorithmicensure}{\textbf{Output:}} \Require generator and discriminator parameters $\theta_G, \theta_D$, contrastive loss coefficients $\lambda_1$, $\lambda_2$, $\lambda_3$, Adam hyperparameters $\beta_1, \beta_2$, generator and discriminator learning rate $lr_G$, $lr_D$, batch size $M$, number of discriminator iterations per generator iteration $N_D$ \For{number of training iterations} \For{$t=1,...,N_D$} \State Sample $\{z_{i}\}_{i=1}^{M} \sim p(z)$ \State Sample $\{(x_i, s_i)\}_{i=1}^{M} \sim p_\text{data}(x,s)$ \State $\mathcal{L}_{\text{sent}}^{\text{r}} \gets \frac{1}{M} \sum_{i=1}^M \mathcal{L}_{\text{sent}}(x_i, s_i)$ \State $\mathcal{L}_{\text{word}}^{\text{r}} \gets \frac{1}{M} \sum_{i=1}^M \mathcal{L}_{\text{word}}(x_i, s_i)$ \State $\mathcal{L}_{\text{GAN}}^{D} \gets -\frac{1}{M} \sum_{i=1}^M \min(0, -1+D(x_i, s_i)) -$ \myindent{1.8} $\frac{1}{M} \sum_{i=1}^M \min(0, -1-D(G(z_i, s_i), s_i))$ \State $\mathcal{L}_{D} \gets \mathcal{L}_{\text{GAN}}^{D} + \lambda_1 \mathcal{L}_{\text{sent}}^{\text{r}} + \lambda_2 \mathcal{L}_{\text{word}}^{\text{r}}$ \State $\theta_D \gets \text{Adam}(\mathcal{L}_D, lr_{D}, \beta_1, \beta_2)$ \EndFor \State Sample $\{z_{i}\}_{i=1}^{M} \sim p(z)$, $\{(x_i, s_i)\}_{i=1}^{M} \sim p_\text{data}(x,s)$ \State $\mathcal{L}_{\text{sent}}^{\text{f}} \gets \frac{1}{M} \sum_{i=1}^M \mathcal{L}_{\text{sent}}(G(z_i, s_i), s_i)$ \State $\mathcal{L}_{\text{word}}^{\text{f}} \gets \frac{1}{M} \sum_{i=1}^M \mathcal{L}_{\text{word}}(G(z_i, s_i), s_i)$ \State $\mathcal{L}_{\text{img}} \gets \frac{1}{M} \sum_{i=1}^M \mathcal{L}_{\text{img}}(G(z_i, s_i), x_i)$ \State $\mathcal{L}_{\text{GAN}}^{G} \gets \frac{1}{M} \sum_{i=1}^M -(D(G(z_i, s_i), s_i))$ \State $\mathcal{L}_{G} \gets \mathcal{L}_{\text{GAN}}^{G} + \lambda_1 \mathcal{L}_{\text{sent}}^{\text{f}} + \lambda_2 \mathcal{L}_{\text{word}}^{\text{f}} + \lambda_3 \mathcal{L}_{\text{img}}$ \State $\theta_{G} \gets \text{Adam}(\mathcal{L}_G, lr_G, \beta_1, \beta_2)$ \EndFor \end{algorithmic} \end{algorithm} \vspace*{-0.05in} \subsection{Contrastive Discriminator} \label{sec:discriminator} \vspace*{-0.05in} Our proposed discriminator has two roles: (1) to act as a critic to determine whether an input image is real or fake, and (2) to act as an encoder to compute global image and region features for the contrastive loss. The image is passed through several down-sampling blocks until its spatial dimensions are reduced to $16{\times}16$ (see Fig.~\ref{fig:model}, bottom left). Then, a $1{\times}1$ convolution is applied to obtain region features, where the feature dimensions are consistent with the dimensions of the word embedding. The original image feature is fed through two more down-sampling blocks and a global pooling layer. Finally, a projection head computes the logit for the adversarial loss, and a separate projection head computes image features for the image-sentence and image-image contrastive loss. Note that it is important to only use the \textit{real images} and their descriptions to train these discriminator projection heads. The reason is that the generated images are sometimes not recognizable, especially at the start of training. Using such generated image and sentence pairs hurts the training of the image feature encoder projection heads. Therefore, the contrastive losses from \textit{fake images} are only applied to the generator. In addition to the discriminator projection layers, we use a pretrained VGG network~\cite{VGGNet} as an image encoder for an additional supervisory image-image contrastive loss (see Sec.~\ref{sec:componentanalysis}). Algorithm~\ref{alg:main} summarizes the \CLGAN training procedure. For simplicity, we set all contrastive loss coefficients ($\lambda_1, \lambda_2, \lambda_3$ in Algorithm~\ref{alg:main}) to 1.0 in our experiments. \vspace*{-0.05in} \section{Evaluation} \vspace*{-0.05in} \subsection{Data} \label{sec:datasets} \vspace*{-0.05in} We perform a comprehensive evaluation of \CLGAN on three challenging datasets (summarized in Table~\ref{tab:dataset}). \textbf{MS-COCO\xspace}~\cite{LinMBHPRDZ14} is commonly used for text-to-image synthesis. Each image is paired with 5 short captions. We follow most prior work to use the 2014 split (COCO-14\xspace) for evaluation. \begin{table}[bt] \begin{center} \small \resizebox{\linewidth}{!}{% \begin{tabular}{lcccccccc} \hline \multirow{2}{4em}{\textbf{Dataset}}&\multicolumn{2}{c}{\textbf{COCO-14\xspace}} & \multicolumn{2}{c}{\textbf{LN-COCO\xspace}} & \multicolumn{2}{c}{\textbf{LN-OpenImages\xspace}} \\ \cline{2-7} &train &val &train &val &train &val\\ \hline \#samples & 82k & 40k & 134k & 8k & 507k & 41k\\ \hline caption/image& \multicolumn{2}{c}{5} & \multicolumn{2}{c}{1} & \multicolumn{2}{c}{1} \\ \hline avg. caption length& \multicolumn{2}{c}{10.5} & \multicolumn{2}{c}{42.1} & \multicolumn{2}{c}{35.6} \\ \hline \end{tabular} } \end{center} \vspace{-10pt} \caption{Statistics of datasets.} \vspace{-10pt} \label{tab:dataset} \end{table} Localized Narratives~\cite{pont2019connecting} contains long form image descriptions for several image collections. We benchmark results on \textbf{LN-COCO\xspace}, which contains \textit{narratives} for images in the 2017 split of MS-COCO\xspace (COCO-17\xspace). Narratives are four times longer than MS-COCO\xspace captions on average and they are much more descriptive (see Figure~\ref{fig:compare_coco}). Narratives also contain disfluencies since they are spoken and then transcribed. These factors make text-to-image synthesis for LN-COCO\xspace much more challenging than MS-COCO\xspace. We also train and evaluate using \textbf{LN-OpenImages\xspace}, the Open~Images\xspace~\cite{kuznetsova2018open} split of Localized Narratives. Its images are both diverse and complex (8.4 objects on average). LN-OpenImages\xspace is also much larger than MS-COCO\xspace and LN-COCO\xspace (see Table~\ref{tab:dataset}). To the best of our knowledge, we are the first to train and evaluate a text-to-image generation model for Open~Images\xspace. \CLGAN is able to generate high quality results, and sets a strong benchmark for this very challenging task. \begin{table*} \begin{center} \resizebox{0.7\linewidth}{!}{% \begin{tabular}{l@{\hspace{8mm}}c@{\hspace{4mm}}c@{\hspace{4mm}}c@{\hspace{4mm}}c@{\hspace{4mm}}c@{\hspace{4mm}}} \hline \textbf{Model} & \textbf{IS} $\uparrow$ & \textbf{FID} $\downarrow$ & \textbf{R-prec (CC) $\uparrow$} & \textbf{SOA-C} $\uparrow$ & \textbf{SOA-I} $\uparrow$ \\ \hline Real Images & 34.88 & 6.09 & 69.36 & 74.97 & 80.84 \\ \hline AttnGAN \cite{xu18} & 23.61 & 33.10 & - & 25.88 & 39.01 \\ Obj-GAN \cite{objgan19} & 24.09 & 36.52 & - & 27.14 & 41.24 \\ DM-GAN \cite{zhu2019dm} & 32.32 & 27.34 & - & 33.44 & 48.03 \\ OP-GAN \cite{hinz2020semantic} & 27.88 & 24.70 & 49.80 & 35.85 & 50.47 \\ SD-GAN \cite{yin2019semantics} & 35.69 & \pz29.35$^\dagger$ & 51.68 & - & - \\ CP-GAN \cite{liang2019cpgan} & \textbf{52.73} & \pz55.82$^\ddagger$ & 59.05 & \textbf{77.02} & \textbf{84.55} \\ \CLGAN (ours) & 30.45 & \hphantom{0}\textbf{9.33} & \textbf{71.00} & 50.94 & 71.33 \\ \hline \end{tabular} } \end{center} \vspace{-10pt} \caption{Comparison of \CLGAN with previous models on COCO-14\xspace. \textit{R-prec (CC)} are R-precision scores computed from a model trained on Conceptual Captions (see Sec.~\ref{sec:evaluation}). $^\dagger$ indicates scores computed from images shared by the original paper authors, and $^\ddagger$ indicates scores computed from images generated from the open-sourced models.} \label{tab:compare_others} \vspace*{-0.2in} \end{table*} \vspace*{-0.05in} \subsection{Evaluation Metrics} \label{sec:evaluation} \vspace*{-0.05in} Following previous work, we report validation results by generating images for 30,000 random captions\footnote{We oversample the images and captions if there are less than 30,000 samples in the validation set.}. We evaluate comprehensively using several measures. \vspace*{-0.12in} \paragraph{Image quality.} We use standard automated metrics for assessing image quality. \textit{Inception Score (IS\xspace)}~\cite{salimans2016improved} calculates \textit{KL}-divergence between the conditional class distribution and the marginal class distribution given a pre-trained image classifier. \textit{Fr\'echet Inception Distance (FID\xspace)}~\cite{FID} is the Fr\'echet distance between two multivariate Gaussians fit to Inception~\cite{Szegedy2016} features of generated and real images. While IS\xspace and FID\xspace have both been shown to correlate with human judgements of generated image quality, IS is likely less informative as it overfits easily and can be manipulated to achieve much higher scores using simple tricks \cite{ISISSUES,hinz2020semantic}. This is further emphasized by our results (Sec. \ref{sec:compareprevious}) showing that FID correlates better with human judgments of realism. \vspace*{-0.12in} \paragraph{Text-Image Alignment.} Following previous work~\cite{xu18,objgan19}, we use \textit{R-precision} to assess whether a generated image can be used to retrieve its conditioning description. However, we notice that previous work computes R-precision using image-text encoders from AttnGAN~\cite{xu18}, and many others use these encoders as part of their optimization function during training. This skews results: many generated models report R-precision scores significantly higher than real images. To alleviate this, we use an image-text dual-encoder\footnote{This model will be publicly released to facilitate future evaluations.}~\cite{crisscross_2020} pretrained on \textit{real images} in the Conceptual Captions dataset~\cite{sharma2018conceptual}, which is disjoint from MS-COCO\xspace. We find that computing R-precision with independent encoders better correlates with human judgments. Caption retrieval metrics assess whether the entire image matches the caption. In contrast, \textit{Semantic Object Accuracy (SOA})~\cite{hinz2020semantic} evaluates the quality of individual regions and objects within an image. Like previous work, we report SOA-C (\ie, the percentage of images per class in which a desired object is detected) and SOA-I (\ie, the percentage of images in which a desired object is detected). Further details of SOA can be found in~\cite{hinz2020semantic}. SOA was originally designed for COCO-14\xspace, and can take very long to compute as it requires generating multiple samples for each MS-COCO\xspace class label. We use the official code to compute the metrics reported in Table~\ref{tab:compare_others}, but approximate results for LN-COCO\xspace and other ablation experiments where we compute results over 30,000 random samples. \vspace*{-0.12in} \paragraph{Human evaluation.} Automated metrics are useful while iterating on models during experimentation, but they are no substitute for human eyes. We conduct thorough human evaluations on generated images from 1000 randomly selected captions. For each caption, we request 5 independent human annotators to rank the generated images from best to worst based on (1) realism, and (2) language alignment. \begin{figure} \centering \includegraphics[width=\linewidth]{figures/coco_human_evals.pdf} \caption{Human evaluation on COCO-14\xspace for image quality and text alignment. Annotators rank (anonymized and order-randomized) generated images from best to worst.} \label{fig:humanevals} \end{figure} \vspace*{-0.05in} \section{Experiments} \label{sec:experiment} \vspace*{-0.05in} \subsection{Results} \label{sec:compareprevious} \vspace*{-0.05in} \paragraph{COCO-14\xspace.} Figure \ref{fig:humanevals} shows \textit{human evaluations} comparing \CLGAN to three recent strong models: CP-GAN~\cite{liang2019cpgan}, SD-GAN~\cite{yin2019semantics}, and OP-GAN~\cite{hinz2020semantic}. Given images (anonymized and randomly ordered) generated from the same caption by the four models, annotators are asked to rank them from best to worst. Realism and text alignment judgments are collected independently. \CLGAN is the clear winner on both: its output is ranked best in 77.3\% of realism comparisons, and 74.1\% of text alignment ones. OP-GAN is a distant second, at 9.90\% and 9.70\%, respectively. \CLGAN achieves this while being a simpler, one-stage model, whereas OP-GAN is multi-stage and needs object bounding boxes. Visual inspection of selected images (Fig. \ref{fig:compare_coco}) convincingly shows the large quality improvement. \CLGAN's images are much higher fidelity compared to others, and depict clearer objects and more coherent scenes. This also holds for more random samples (see appendix). \begin{figure*} \small \begin{center} \begin{tabular}{>{\arraybackslash}m{0.1\linewidth}@{\hskip 0.5em}c@{\hskip 0.1em}c@{\hskip 0.1em}c@{\hskip 0.1em}c@{\hskip 0.2em}|>{\arraybackslash}m{0.2\linewidth}@{\hskip 0.5em}c@{\hskip 0.1em}c@{\hskip 0.1em}c@{\hskip 0.1em}} \textbf{MS-COCO\xspace Caption} & \textbf{OP-GAN} & \textbf{SD-GAN} & \textbf{CP-GAN} & \textbf{\CLGAN} & \textbf{LN-COCO\xspace Caption} & \textbf{AttnGAN} & \textbf{TReCS} & \textbf{\CLGAN} \\ \midrule \addlinespace[-0.05em] \compareexamplesmall{a green train is coming down the tracks}{COCO_val2014_000000000923} & \compareexamplelnnooriginal{There is a group of people. They are standing on ski board. They are smiling. They are holding a sticks. In the center of the person is wearing a helmet. On the right side ...}{470779_71}{000000470779} \\ \compareexamplesmall{A group of skiers are preparing to ski down a mountain.}{COCO_val2014_000000000761} & \compareexamplelnnooriginal{In this image I can see people are sitting on chairs. I can also see few of them are wearing shades. Here I can see few more chairs and tables. On this table I can see food ...}{470924_85}{000000470924} \\ \compareexamplesmall{A small kitchen with low a ceiling}{COCO_val2014_000000000164} & \compareexamplelnnooriginal{This picture shows an inner view of a restroom we see a wash basin with tap and a mirror on the wall and we see a light on it and we see a toilet seat and a frame on the wall and ...}{489091_37}{000000489091} \\\addlinespace[0.1em] \compareexamplesmall{A child eating a birthday cake near some balloons.}{COCO_val2014_000000000428} & \compareexamplelnnooriginal{In this image we can see a red color train on the railway track. Here we can see platform}{539445_12}{000000539445} \\ \compareexamplesmall{A living area with a television and a table}{COCO_val2014_000000000139} & \compareexamplelnnooriginal{In this picture there are two members lying on the beach in the sand under an umbrella. There are some people standing here. In the background there is water}{262048_39}{000000262048} \\ \end{tabular} \end{center} \vspace{-10pt} \caption{Generated images for selected examples from COCO-14\xspace and LN-COCO\xspace. \CLGAN generated images are generally of much higher quality and depict clearer scenes. More random samples are available in the appendix.} \label{fig:compare_coco} \end{figure*} \begin{table} \begin{center} \resizebox{\linewidth}{!}{% \begin{tabular}{lccccc} \hline \textbf{Model} & \textbf{IS} $\uparrow$ & \textbf{FID} $\downarrow$ & \textbf{R-prec\xspace} $\uparrow$ & \textbf{SOA-C} $\uparrow$ & \textbf{SOA-I} $\uparrow$ \\ \hline Real Images & 34.40 & 8.01 & 61.52 & 66.08 & 67.39 \\ \hline AttnGAN~\cite{xu18} & 20.80 & 51.80 & 43.88 & - & - \\ \textsc{TReCS}~\cite{trecs2020} & 21.30 & 48.70 & 37.88 & - & - \\ \CLGAN (ours) & \textbf{28.37} & \textbf{14.12} & \textbf{66.92} & 36.76 & 48.14 \\ \hline \end{tabular} } \end{center} \vspace{-10pt} \caption{Comparison of \CLGAN on LN-COCO\xspace. SOA metrics together with others are computed from 30,000 random examples.} \label{tab:compare_ln} \vspace*{-0.2in} \end{table} Table~\ref{tab:compare_others} provides comprehensive COCO-14\xspace results for \textit{automated} metrics. \CLGAN dramatically improves FID from 24.70 to 9.33, a 62.2\% relative improvement over the next best model, OP-GAN~\cite{hinz2020semantic}. \CLGAN also outperforms others (71\% vs.~59\%) for R-precision computed with our \textit{independently trained} encoders, indicating a large improvement in fidelity of generated images to the captions they are conditioned on---and consistent with human judgments. Although CP-GAN achieves higher IS and SOA scores, both our human evaluations and visual inspection of randomly selected images indicates \CLGAN's image quality is much higher than CP-GAN's. This may be due to the issue that IS\xspace and SOA do not penalize intra-class mode dropping (low diversity within a class)---a model that generates one ``perfect" sample for each class can achieve good scores on IS\xspace and SOA. Our findings are consistent with other works~\cite{objgan19,ISISSUES}, which suggest that FID\xspace may be a more reliable metric for measuring text-to-image synthesis quality. \vspace*{-0.12in} \paragraph{LN-COCO\xspace.} Localized Narratives~\cite{pont2019connecting} contains much longer descriptions, which increases the difficulty of text-to-image synthesis (see Sec. \ref{sec:datasets}). Table~\ref{tab:compare_ln} shows that \CLGAN provides massive improvements over prior work. Compared to TReCS~\cite{trecs2020}, \CLGAN improves IS and FID, by 7.07 and 34.58 (absolute), respectively. It also improves R-precision by 23.04\% absolute over AttnGAN~\cite{xu18}, indicating much better text alignment. This is supported by qualitative comparison of randomly selected outputs: \CLGAN's images are decisively clearer and more coherent (see Fig.~\ref{fig:compare_coco}). We stress that TReCS exploits LN-COCO\xspace's mouse trace annotations---incorporating this training signal in \CLGAN in future should further boost performance. \begin{table}[t] \begin{center} \resizebox{\linewidth}{!}{% \begin{tabular}{cccccccc} \hline \textbf{S} & \textbf{W} & \textbf{I} & \textbf{IS} $\uparrow$ & \textbf{FID} $\downarrow$ & \textbf{R-prec} $\uparrow$ & \textbf{SOA-C} $\uparrow$ & \textbf{SOA-I} $\uparrow$ \\ \hline \multicolumn{3}{c}{Real Images~\cite{hinz2020semantic}} & 34.88 & \hphantom{0} 6.09 & 69.36 & 76.17 & 80.12 \\ \hline & & & 15.89 & 39.28 & 21.41 & 8.99 & 25.72 \\ \checkmark & & & 23.50 & 19.25 & 53.57 & 24.57 & 45.41 \\ & \checkmark & & 20.72 & 24.38 & 44.42 & 20.50 & 39.12 \\ & & D & 18.90 & 29.71 & 31.16 & 12.73 & 30.89 \\ & & VGG & 21.54 & 39.58 & 35.89 & 17.41 & 35.08 \\ & & D + VGG & 23.61 & 21.14 & 47.04 & 23.87 & 44.41 \\ \checkmark & \checkmark & & 26.02 & 14.25 & 64.94 & 30.49 & 51.60 \\ \checkmark & \checkmark & D & 28.06 & 12.96 & 65.36 & 34.21 & 54.23 \\ \checkmark & \checkmark & VGG & 30.55 & \textbf{11.12} & \textbf{70.98} & 39.36 & 59.10 \\ \checkmark & \checkmark & D + VGG & \textbf{30.66} & 11.93 & 69.86 & \textbf{39.85} & \textbf{59.78} \\ \hline \end{tabular} } \end{center} \vspace{-10pt} \caption{Ablation results with different contrastive losses on COCO-14\xspace. \textbf{S} indicates the sentence-image loss. \textbf{W} indicates the region-word loss. \textbf{I} indicates the image-image loss, where D represents using the discriminator to extract image features, and VGG represents using a pre-trained VGG network to extract image features.} \vspace{-10pt} \label{tab:ablation_2014} \end{table} \vspace*{-0.12in} \paragraph{LN-OpenImages\xspace.} We train \CLGAN on Open~Images\xspace dataset, which is much more challenging than MS-COCO\xspace due to greater diversity in images and descriptions. \CLGAN achieves an IS\xspace of 24.90, FID of 26.91, and R-precision of 57.55, and manages to generate high quality images (see appendix). To the best of our knowledge, \CLGAN is the first text-to-image model trained and evaluated on Open~Images\xspace. Its strong automated scores establish strong benchmark results on this challenging dataset. \vspace*{-0.05in} \subsection{Ablations} \label{sec:componentanalysis} \vspace*{-0.05in} We thoroughly evaluate the different components of \CLGAN and analyze their impact. Table~\ref{tab:ablation_2014} summarizes our ablations\footnote{All ablation results (Fig.~\ref{fig:contrasive_head_ablation}, Tables~\ref{tab:ablation_2014}, \ref{tab:ablation_modulation}, and \ref{tab:ablation_vgg}) are reported using metrics re-implemented in TensorFlow. SOA is approximated using 30,000 random samples. Ablation models use a reduced base channels dimension of 64. Implementation details are provided in the appendix.} on the COCO-14\xspace validation set. To study the effects of each contrastive loss component used in \CLGAN, we experiment with four losses: (1) image-sentence, (2) region-word, (3) image-image using discriminator features, and (4) image-image using VGG features. For (3), we use the discriminator encoder projection (indicated by D in Table~\ref{tab:ablation_2014}) to extract image features. For (4), we extract image features from a VGG-19 network~\cite{VGGNet} pretrained on ImageNet. \vspace*{-0.12in} \paragraph{Individual contrastive losses.} Table~\ref{tab:ablation_2014} shows that using any of the contrastive losses improves all metrics compared to the baseline. During experimentation, we also found that including any contrastive loss greatly improves training stability. The largest improvements come from the \textit{inter-modal} image-sentence and region-word contrastive losses, which improve FID from 39.28 to 19.25 and 24.38, respectively. This is much larger compared to the image-image \textit{intra-modal} contrastive losses, \eg, including the loss from the discriminator feature encoder (D) only improves FID to 29.71. These ablations highlight the effectiveness of inter-modal contrastive losses: sentence and word contrastive losses each greatly improve the text-alignment metrics, as well as improving image quality. \vspace*{-0.12in} \paragraph{Combined contrastive losses.} Combining contrastive losses provides further gains. For example, using both image-sentence and region-word losses achieves better performance (FID 14.25) than alone (FID 19.25 and 24.38, respectively). This demonstrates that local and global conditions are complementary. Moreover, using both inter-modal losses (sentence and words) outperforms the intra-modal losses (D + VGG): FID scores are 14.25 and 21.14, respectively. These results further emphasize the effectiveness of cross-modal contrastive learning. Nevertheless, the \textit{inter-modal} and \textit{intra-modal} contrastive losses also complement each other: the best FID\xspace score comes from combining image-sentence, region-word, and image-image (VGG) losses. Performance on IS and text alignment further improves when using the image-image (D + VGG) loss. To obtain our final results (Table~\ref{tab:compare_others}), we train a model (with base channels dimension 96) using all 4 contrastive losses. \begin{table} \begin{center} \resizebox{\linewidth}{!}{% \begin{tabular}{lccccc} \hline \textbf{Modulation} & \textbf{IS} $\uparrow$ & \textbf{FID} $\downarrow$ & \textbf{R-prec\xspace} $\uparrow$ & \textbf{SOA-C} $\uparrow$ & \textbf{SOA-I} $\uparrow$ \\ \hline Self-modulation & 28.98 & 13.59 & 64.65 & 35.18 & 55.54 \\ Attentional self-modulation & \textbf{30.66} & \textbf{11.93} & \textbf{69.86} & \textbf{39.85} & \textbf{59.78} \\ \hline \end{tabular} } \end{center} \vspace{-10pt} \caption{Comparison of different modulation layers.} \label{tab:ablation_modulation} \end{table} \begin{table} \begin{center} \resizebox{\linewidth}{!}{% \begin{tabular}{lccccc} \hline \textbf{VGG Loss} & \textbf{IS} $\uparrow$ & \textbf{FID} $\downarrow$ & \textbf{R-prec\xspace} $\uparrow$ & \textbf{SOA-C} $\uparrow$ & \textbf{SOA-I} $\uparrow$ \\ \hline $l_2$ loss & 12.46 & 52.86 & 22.62 & 8.27 & 25.48 \\ Contrastive (InfoNCE) loss & \textbf{21.54} & \textbf{39.58} & \textbf{35.89} & \textbf{17.41} & \textbf{35.08} \\ \hline \end{tabular} } \end{center} \vspace{-10pt} \caption{Comparison of different VGG losses.} \vspace{-10pt} \label{tab:ablation_vgg} \end{table} \begin{figure} \centering \includegraphics[width=\linewidth]{figures/contrastive.pdf} \vspace{-15pt} \caption{Comparison between different contrastive heads.} \label{fig:contrasive_head_ablation} \vspace{-15pt} \end{figure} \paragraph{Deeper contrastive heads.} In unsupervised representation learning~\cite{chen2020simple,chen2020improved}, adding non-linear layers generally improves performance. To study this, we increase the depth of the projection head in the discriminator. Training curves for FID and contrastive accuracy~\cite{chen2020simple} on fake images are in Fig.~\ref{fig:contrasive_head_ablation}, across 1000 epochs. We find that using no additional projection layers gives the best FID\xspace (12.61, compared to 19.42 of the 2-layer MLP). Moreover, we also find that the contrastive accuracy increases on fake images (from 76.56\% to 88.55\%) when more layers are added to the projection head. We posit that the discriminator overfits to the contrastive learning task in this configuration, resulting in poorer performance on the adversarial task as a critic and hence worse as a supervisory signal for the generator. \vspace*{-0.12in} \paragraph{Attentional Self-Modulation.} We compare two generator setups: (1) self-modulation layers~\cite{chen2018self} in all residual blocks, and (2) attentional self-modulation layers (see Sec.~\ref{sec:generator}) for blocks with input resolution larger than $16{\times}16$. Table~\ref{tab:ablation_modulation} shows that the proposed attentional self-modulation layer outperforms self-modulation on all metrics. \vspace*{-0.12in} \paragraph{Loss types.} A frequently used loss function in generative models is the $l_2$ loss over VGG~\cite{VGGNet} outputs between fake images and corresponding real images. This is also commonly known as the perceptual loss~\cite{JohnsonAF16}. Table~\ref{tab:ablation_vgg} shows that contrastive losses outperform such perceptual losses. This demonstrates that repelling mismatched samples is more effective than simply pulling together aligned samples. Given this superior performance, replacing perceptual losses with contrastive losses may help other generative tasks. \vspace*{-0.05in} \section{Conclusion} \label{sec:conclusion} \vspace*{-0.05in} In this work, we present a cross-modal contrastive learning framework to train GAN models for text-to-image synthesis. We investigate several cross-modal contrastive losses that enforce correspondence between image and text. With both human and automated evaluations on multiple datasets, \CLGAN establishes a marked improvement over previous models: it generates higher quality images that better match their input descriptions, including for long, detailed narratives. It does so while being a simpler, end-to-end model. We believe that these advances are strong leaps towards creative applications for image generation from natural language descriptions. {\small \bibliographystyle{ieee_fullname}
\section{Introduction} Variability has been a nearly ubiquitous feature of accreting, pre-main-sequence, low-mass stars known as Classical T Tauri stars (CTTS) since their discovery \citep{joy45, herbig62}, and has been observed on timescales ranging from minutes to decades \citep{siwak18}. One of the major sources of variability that occurs on timescales of hours to weeks is variability in the accretion rate onto the star \citep{herbst94}. These changes are most readily apparent in near-ultraviolet (NUV) and the optical. Our current understanding of how matter is accreted from the innermost region of the disk onto the stellar surface is through the process of magnetospheric accretion \citep[see][for a review]{hartmann16}. Magnetic fields on young stars are remarkably strong, with surface strengths reaching red up to several kiloGauss \citep{basri92, johnskrull99, valenti04, johnskrull07}, which is strong enough to disrupt the Keplerian motion of the disk and force flow along magnetic field lines red if the large-scale structure of the magnetic field is sufficiently globally ordered \citep{koenigl91, shu94}. The disrupted material falls along the magnetic field lines toward the star, reaching free fall speeds of 300--500 km/s. When this material collides with the stellar photosphere, it shocks and is heated to roughly $10^6$K \citep{calvet98}. As the material falls and cools, it thermally emits this energy primarily in the form of X-rays both downward toward the stellar surface and upward into the preshock region. In these regions, the high-energy radiation is reprocessed and emitted as far-ultraviolet (FUV), near-ultraviolet (NUV), and optical continuum emission, along with a plethora of emission lines \citep{gullbring98, ardila13}. Recent space-based long-timescale optical photometric monitoring campaigns from CoRoT \citep{cody14, stauffer14, stauffer15, stauffer16, mcginnis15} and K2 \citep{cody18} have been successful in classifying CTTS variability in several categories based on their light-curve symmetry and periodicity by-eye and subsequently using statistical metrics to separate objects by light-curve periodicity and symmetry ($Q$ and $M$, respectively). These classifications include bursters, quasiperiodic symmetric objects, purely stochastic objects, and purely periodic objects, whose variability has in part been attributed to changes in the accretion rate and/or to rotational effects from stable accretion hot spots \citep{stauffer14, venuti15}. Young stars that predominantly show decreases in observed flux are classified as quasiperiodic dippers and aperiodic dippers \citep[e.g.,][]{stauffer15, kesseli16, nagel19}. Objects that do not fit into these categories are placed into the classes of long timescale, unclassifiable, non-variable, or eclipsing binary \citep[e.g.,][]{cody18}. Many works have described the accretion variability and the inner regions of protoplanetary disks under the constraint of magnetically controlled accretion. Steady-state solutions of 1D flow along the accretion column have been studied analytically by several authors \citep[e.g.,][]{hartmann94, li96, koldoba02}. Additional work has been done with 3D MHD simulations of the inner regions of the disk \citep[e.g.,][]{romanova03, romanova04, romanova08, long11, romanova11, kurosawa13, romanova13}. These works identify numerous sources of variability including rotational modulation and Rayleigh--Taylor instabilities. One example of a semi-analytic approach is the work of \citet{adams12}, which described steady-state 1D solutions within a coordinate system that follows along a corotating magnetic field line connecting the star to the disk. That work was expanded upon by \citet{robinson17} using simulations that demonstrated the formation of traveling shocks along the magnetospheric accretion column under smoothly varying disk input conditions. These shocks cause rapid sawtooth-like changes in the accretion rate that qualitatively resemble the variability seen in objects under the burster classification. However, the variability in those simulations is induced through density perturbations controlled by an overly simplified sinusoidal driving function. Additionally, those simulations were not used to make direct predictions of the accretion events to compare against observations. Here, we combine the 1D hydrodynamic fluid simulations of the accretion column of \citet{robinson17} and radiative transfer accretion shock models \citep{calvet98, robinson19} to produce the expected excess from accretion under a variety of physical conditions in the inner disk. This excess is then characterized using the same metrics that have been applied in long-timescale optical monitoring studies of CTTS. In \S 2, we present our models and describe the process of obtaining the metrics. In \S 3, we demonstrate how different physical parameters affect light curves. In \S 4, we discuss our findings within the context of other studies and possible future work. We conclude with a summary of our primary findings in \S 5. \section{Methods} \subsection{Overview} To create synthetic light curves, we couple three models together. These include a 1D hydrodynamic (HD) simulation of the accretion column; nonlocal thermodynamic equilibrium (nLTE) accretion shock models of the preshock, postshock, and heated photosphere; and a geometric rotational modulation model. We run the 1D HD simulations of the accretion column to obtain the density and velocity of the flow near the surface of the star. The emission arising from the shock is then found with the nLTE accretion shock model by using the conditions of the flow from the HD simulations as input. That emission is then scaled by the fraction of the accretion hot spot that is visible based on the rotational phase, inclination, and spot latitude (i.e., a filling factor). We note that no feedback is included in the HD simulations from the nLTE shock models and that the solutions from the nLTE models are obtained in a time-independent manner. If the radiative timescales are longer than the accretion variability, then this approach may break down. However, we note that the hydrogen recombination timescales within the pre- and post-shock regions are likely several orders of magnitude shorter than the variability considered here. We finish this section by describing the metrics and relevant variability classes that have been developed to describe observed light curves of CTTS that we then apply to the light curves from our models. Definitions for commonly reoccurring symbols used in this work are listed in Table \ref{tab:vartab}. \input{vartab.txt} \subsection{Hydrodynamic Simulations} To model the accretion column connecting the star to the inner edge of the disk, we turn to the 1D HD fluid simulations of \citet{robinson17}. These simulations follow along the magnetic field line that connects the inner gas disk to the star, following the curvilinear coordinate system developed by \citet{adams12}. These simulations operate under several simplifying assumptions that enable the use of a 1D approach. The assumptions and the implication for each assumptions are described below. \subsubsection{Assumptions} The magnetic field is assumed to be current free, and therefore curl free, and thus can be expressed as the gradient of a scalar field. We take advantage of this assumption by constructing a set of orthogonal curvilinear coordinates to describe the magnetic field lines. The coordinate $p$ describes the distance from the origin (which is at the center of the star) along a field line, while the orthogonal coordinate $q$ describes which field line is being traced. The third coordinate, $\phi$, describes the position in the azimuthal direction. The magnetic field is assumed to be strong enough to force flow solely along the field line, which allows us to work in a 1D space described solely by $p$ under a fixed $q$ and $\phi$. Thus, many complexities that can arise in higher dimensions (e.g., several types of instabilities) are suppressed. Compression from converging field lines is included through curvilinear scale factors. The assumed magnetic field structure is that of a rotation-axis-aligned multipolar field. While measurements of the magnetic field structure of some CTTS have shown evidence for complex toroidal fields \citep{donati11c}, many CTTS can be well described by composite fields consisting of dipole and octupole components \citep[e.g., ][]{donati10a, donati11b}. Following \citet{gregory10, gregory11, adams12}, the ratio of the polar field strengths of the dipole and octupolar magnetic field components is parameterized by $\Gamma \equiv \frac{B_{oct}}{B_{dip}}$ with the magnetic field described by \begin{equation} \begin{split} \mathbf{B} = \frac{B_{oct}}{2} \xi^{-5} \Big[(5\cos^2\theta - 3)\cos\theta \, \hat{r} + \frac{3}{4}(5\cos^2\theta - 1)\sin \theta \, \hat{\theta}\Big] + \\ \frac{B_{dip}}{2} \xi^{-3} (2\cos\theta \, \hat{r} + \sin\theta \, \hat{\theta}), \end{split} \end{equation} where $\xi \equiv \frac{r}{R_\star}$. In the aligned case where the dipole and octupole moments are parallel, $\Gamma$ is positive. In the anti-aligned case where either of the moments are flipped, $\Gamma$ is negative and the positive pole of the dipole field coincides with the main negative pole of the octupole field. In both cases, we make the assumption that the magnetic moments of both the dipole and octupole fields are perfectly aligned with the rotational axis of the star. Our final assumption is that the solution for flow along the magnetic field line at the corotation radius (defined here as $R_{co}$) is an appropriate approximation of the entire column. By definition, the magnetic footprints at the star and the disk have the same angular velocity for the magnetic field line that crosses the disk at the corotation point. This eliminates the possibility of shear flows at either boundary. Following \citet{getman08a, getman08b, gregory08}, we make the assumption that the inner edge of the region where the magnetic field line draws material from the disk (i.e., the truncation radius) is $R_{T} = 0.5 R_{co}$ and the outer edge is $R_{co}$. Under the construction of our model, these two radii, along with $\Gamma$, set the upper and lower latitudes of the accretion hot spot, $\gamma_U$ and $\gamma_L$. A more complete description of the simulations is shown in \citet{robinson17}, and more discussion on the curvilinear coordinate system can be found in \citet{adams12}. The top panel of Figure \ref{fig:schematic} shows a schematic of the system under several magnetic field constructions. \subsubsection{1D HD Simulation Scheme and Boundary Conditions} A ZEUS-style upwind finite difference scheme was used to solve the 1D fluid equations \citep{stone92}. Under this scheme, the density, velocity, and internal energy of the flow are solved on a staggered mesh. In this work, we restrict the flow along the accretion column to be isothermal at a temperature of 10,000K from UV heating, which sets the sound speed in the simulation. Simulations with non-isothermal equations of state demonstrated variability with similar characteristics as isothermal simulations in the work of \citet{robinson17}. The internal structure of the solver remains unchanged between this work and \citet{robinson17}, with the exception of the outer boundary conditions. The new boundary condition that has been implemented at the outer boundary mimics Kolmogorov turbulence \citep[see][]{kolmogorov41} in the inner disk by using a velocity driving function. The upper bound on the turnover frequency is set by a cutoff on events happening on timescales shorter than 30 minutes. The lower frequency bound is set by the travel time of a sound wave around the circumference of the inner disk of our base model (described in \S 3.2). A turbulence spectrum with these bounds is then used to generate velocity driving functions composed of sine curves with random phase offsets. We do not restrict outflow from the system, and as such, these boundary conditions result in solutions and values of $\dot{M}$ similar to those under steady-state boundary conditions with the addition of stochastic perturbations. The system is allowed to evolve for 18 days ($\sim14$ sound crossing times) to allow transients from initialization to disappear before the simulation is sampled. An example of one of the driving functions that mimics turbulence is shown in the bottom panel of Figure \ref{fig:schematic}. \begin{figure} \centering \includegraphics[width = .97\linewidth]{schematic.pdf} \caption{\textit{Top:} magnetic field line geometry for several values of the ratio between the polar strength of the octupole and dipole components, $\Gamma$, and corotation radius, $R_{co}$. Changes in $\gamma_{U}$ and $\gamma_L$, the angles between the upper and lower bound of the hot spot and the rotation axis, respectively, affect the degree of rotational modulation (see Figure \ \ref{fig:spotplot}). After normalizing to the area of the magnetic footprint at the disk, the effective cross-sectional area near the star decreases with increasing $\Gamma$ and $R_{co}$. This schematic is to scale, and the axes are in Cartesian coordinates in units of stellar radii. \textit{Bottom:} A 1.5 d sample of the turbulent driving function with several Mach number rms amplitudes, $A$. } \label{fig:schematic} \end{figure} \subsection{Accretion Shock Model} The nLTE accretion shock models of \citet{calvet98}, which were recently adapted by \citet{robinson19} to use a recent release of Cloudy \citep{ferland17}, were used to generate the emission from accretion. This model consists of a 1D plane-parallel accretion column with three parts: the preshock, the post-shock, and the heated photosphere. The post-shock is hot ($\sim10^6$ K) due to the kinetic energy of the flow being converted into thermal energy in the shock. As the material cools and falls, it re-radiates that energy (primarily as X-rays) into the preshock region and the underlying photosphere. The combined emission from these two regions forms the outgoing flux. Previous work has demonstrated the need to include accretion columns with different densities to reproduce observations \citep{ingleby13, ingleby15, robinson19}. Here, we slightly modify the \citet{robinson19} models by using the density and velocity information from the 1D fluid simulations as the preshock conditions rather than assuming that the flow is at the freefall velocity. In general, this causes the accretion column to be denser and slower than previous models at the same kinetic energy flux. This in turn causes the post-shock region to narrow (typically by factor of $\sim0.7$) since the region is assumed to be optically thin and the velocity at the top of the region depends on the preshock velocity via the Rankine--Hugoniot strong shock conditions. Apart from this change, the accretion shock model remains unchanged from the version presented in \citet{robinson19}. \subsection{Rotational Modulation Model \label{ss:rotation}} The emission from the accretion shock model is scaled by a filling factor $f$, which represents the fraction of the visible stellar disk covered by accretion shocks. To estimate $f$, we have modeled the accretion hot spots on the surface of the star as an equilatitudinal, roughly rectangular, strip with angular length defined as $\alpha$ and angular width defined by the magnetic field. The filling factors are calculated by numerically integrating the projected area of the strip along the line of sight. An example of the geometry of this model is shown in Figure \ref{fig:sphereplot}. \begin{figure} \centering \includegraphics[width = \linewidth]{sphereplot.png} \caption{Schematic showing the the geometry of the rotational modulation model. The green, red, and blue lines represent the $x$, $y$, and $z$ axes, respectively. The observer is located along the $z$-axis. The black arrow represents the rotation axis of the star, shown here at an inclination of $60^\circ$. The white, equilatitudinal, rectangular strip is the accretion hot spot for a model with $\alpha = 90^\circ$, $\Gamma = 5$, and $R_{co} = 5 \, \mathrm{R_{\star}}$ (i.e., the base model, see \S \ref{ss:basemodel}). The white arrow shows the path of the hot spot as the star rotates. } \label{fig:sphereplot} \end{figure} The lower and upper bounds ($\gamma_{L}$ and $\gamma_{U}$) of the strip are set by the magnetic field geometry by following the magnetic field lines that intercept the disk at 0.5 $R_{co}$ and $1.0 R_{co}$, respectively. These bounds can be calculated under our assumption of flow solely along the rotation-axis-aligned dipole + octupole field. Following \citet{adams12}, the general expression for the coordinate $q$, which is constant along field lines, is given by \begin{equation} q = \frac{1}{4}\xi^{-3} \Gamma (5\cos^2\theta - 1)\sin^2\theta + \xi^{-1}\sin^{2}\theta ~~. \label{generalq} \end{equation} The value of the coordinate $q$ that describes a field line that crosses the midplane at a given radius can be written \begin{equation} q = \frac{1}{\xi}\left(1 - \frac{\Gamma}{4 \xi^2}\right) ~~. \label{q_cross} \end{equation} Because $q$ is a fixed quantity along field lines, Eq. \ \ref{generalq} can be solved for $\theta$ at the stellar surface with the value of $q$ from Eq. \ref{q_cross}. Under our construction, $\theta$ is equivalent to $\gamma_L$ and $\gamma_U$ for the inner and outer bounds of the disk--star interaction region, respectively. The length of the spot, $\alpha$, and the viewing inclination, $i$, remain as free parameters. The projected area of the strip as a function of phase is approximated by breaking the strip into several equilatitudinal rows of triangular cells and numerically integrating the projected area of each cell along the line of sight. Regions behind the disk of the star are discarded when summing the contribution from each cell. The numbers of rows and cells were selected to be large enough to avoid potential numerical issues associated with discretization. Examples of the filling factor as a function of $\phi$, $\Gamma$, and $i$ with $\alpha = 90^\circ$ are shown in Figure \ref{fig:spotplot}. \begin{figure*} \centering \includegraphics[width = \linewidth]{stripplot.pdf} \caption{ \textit{Top row:} filling factor (expressed as a percentage) as a function of rotational phase, inclination, and magnetic field geometry for a single hot spot modeled as an equilatitudinal strip. The examples shown here have a fixed angular strip length of $\alpha = 90^\circ$ and $R_{co} = 5 \, \mathrm{R_\star}$. As $\Gamma$ increases, the magnetic footprint of the corotating field line on the star approaches the rotation axis. The upper and lower bounds of the strip, as measured from the rotation axis, are $\gamma_U$ and $\gamma_L$, respectively. Due to the construction of the magnetic field, $\gamma_U$ and $\gamma_L$ are also anticorrelated with the inner disk radius. \textit{Bottom row:} filling factors as a function of $\phi$, normalized to their peak value to show the relative change between their minimum and maximum values.} \label{fig:spotplot} \end{figure*} \subsection{Statistical Metrics $Q$ and $M$} The metrics $Q$ and $M$ have recently been developed to classify light curves obtained using K2 and CoRoT \citep[see ][]{cody14, cody18}. Here, we apply these metrics to light curves produced using our simulations and models to provide physical insight to previous classifications of observations. The metric $Q$ describes the degree of periodicity in a given light curve, while $M$ quantifies the symmetry of the light curve around the mean to determine if the light curve in general shows bursts, dips, or no preference. \subsubsection{Determining $Q$} $Q$ is calculated following the steps outlined in \citet{cody14}, with a few modifications. The first step is identifying the rotation period. While the rotation period is known a priori in our simulations, we wish to conduct our analysis without including this prior knowledge. Additionally, we have injected a small amount of white noise into our synthetic light curves with amplitudes of $\sigma = 0.01\%$ of the mean value. Such a small value was chosen to avoid white noise from interfering with small amplitude variations since we are attempting to identify trends with free parameters rather than reproducing observations exactly. The process to measure $Q$ is described below and an example of the process is depicted visually in its entirety in Figure \ref{fig:gettingQ}. The unmodified light curve is shown in Figure \ref{fig:gettingQ}(a). The rotation period is estimated using two approaches: the autocorrelation function (ACF; Fig.\ \ref{fig:gettingQ}(b)) and a Lomb--Scargle periodogram \citep{lomb76,scargle82} (Figure \ref{fig:gettingQ}(c)). The synthetic light curve is resampled to a linear grid when calculating the ACF and is smoothed using a Savitzky--Golay filter with a window size of three points to help avoid issues with local minima \citep{savitzky64}. The shortest period local maximum of the smoothed ACF that is 0.05 larger than than the surrounding local minima is identified. In the method of \citet{cody14}, the largest peak in the Lomb--Scargle periodogram that is within $\pm20\%$ of the previously identified period in the ACF is chosen as the rotation period of the star. However, we found that this method occasionally selected harmonics rather than the true period of our models, so we deviate from the approach of those authors slightly. Instead, we multiply the periodogram by a Gaussian centered on the selected peak of the ACF with a width of $30\%$ of the period from the ACF, and then select the peak from this weighted periodogram. We found that this method was effective at recovering the true period of our models even in the cases where the selected peak of the ACF was a harmonic. The periodic behavior of the light curve was then identified by horizontally stacking three copies of the phase-folded data and modeling the trend using Gaussian processes (GP), as shown by Figures \ref{fig:gettingQ}(d) and (e). By stacking the phased light curve in this manner and making predictions with GP for the central copy of the stacked curves, we avoid edge effects and recover a smooth, periodic, nonparametric curve that can be modified to smooth over features with different timescales. The covariance function selected for this approach is a Gaussian with a characteristic covariance length of 0.3 in phase space. The predicted values from this GP approach for the central copy of our stacked phased light curve are then subtracted from the original light curve, as shown by Figure \ref{fig:gettingQ}f to eliminate periodic components. Using the results from this analysis, $Q$ is defined by \begin{equation} Q = \frac{(\mbox{rms}_{\mbox{resid}}^2 - \sigma^2)}{(\mbox{rms}_{\mbox{raw}}^2 - \sigma^2)} ~~, \end{equation} where $\mbox{rms}_{\mbox{resid}}$ is the rms value of the residuals after subtracting the periodic behavior, and $\mbox{rms}_{\mbox{raw}}$ is the rms of the original light curve. $Q$ is smaller for curves with stronger periodic components and larger for more stochastic light curves. \begin{figure*} \centering \includegraphics[width = 0.9\linewidth]{Q_process.pdf} \caption{Illustration of the steps to obtain the metric $Q$, which measures the periodicity of the light curve (see \S 2.5.1 for details on the process). This light curve is the base model described in \S3.2 viewed from an inclination of $60^\circ$. Panel (a) shows the raw light curve. Panel (b) is the autocorrelation function (ACF) with the period as measured by the ACF and the Lomb--Scargle periodogram marked by purple and orange lines, respectively. Panel (c) shows the Lomb--Scargle periodogram with the periods marked in the same fashion. We show the periodogram weighted by a Gaussian whose parameters are derived from the ACF in purple. Panel (d) shows the folded light curve with the GP solution shown in red. Panel (e) shows the raw light curve with the GP solution overlaid in red. Panel (f) shows the residuals after removing the GP solution. The horizontal red, blue, and green lines show the mean, $\mbox{rms}_{\mbox{resid}}$, and $\mbox{rms}_{\mbox{raw}}$, respectively. $Q$ in this example is 0.51.} \label{fig:gettingQ} \end{figure*} \subsubsection{Determining $M$} Again following \citet{cody14} and \citet{cody18}, the first step for calculating $M$ is to remove outliers. This is accomplished by subtracting a smoothed version of our light curve from the raw light curve (Figures \ref{fig:gettingM}(a) and (b)). We again employ GP with a Gaussian covariance function to produce a smooth version of our light curve that is subtracted from the original curve (Figure \ref{fig:gettingM}(c)) in a flexible manner. The covariance length in this case was selected to be 2 hr. Outliers were identified as points in the residuals whose absolute values were greater than five times the rms. After clipping these outliers, the mean of the top and bottom $5\%$ of points from the original curve is found, $\langle d_{5\%} \rangle$ (Figure \ref{fig:gettingM}(d)). Using this mean, the median of the entire clipped light curve, $d_{med}$, and the rms of the clipped light curve, $\sigma_d$, the metric $M$ is defined \begin{equation} M = - \frac{\langle d_{5\%} \rangle - d_{med}}{\sigma_d} ~~. \end{equation} Here a negative sign is included since the original metric was constructed for use with magnitudes in \citet{cody14}. More negative values of $M$ indicate that the light curve features bursting behavior, while positive values of $M$ suggest preferential dimming. Values of $M$ closer to zero indicate symmetric variability. \begin{figure*} \centering \includegraphics[width = 0.9\linewidth]{M_process.pdf} \caption{Illustration of the steps to obtain the metric $M$, which measures the symmetry of the light curve around the mean (see \S2.5.2). This light curve is produced using the base model described in \S3.2 with an inclination of $60^\circ$. Panel (a) shows the raw light curve. Panel (b) shows the light curve with the GP solution overlaid in red. Panel (c) shows the residuals after subtracting this fit. Points above the $5\sigma$ green lines are considered outliers. Panel (d) identifies the top and bottom 5\% of photometry points in purple, with the mean, $\langle d_{5\%}\rangle$, shown by the blue line. The median of all of the data, $d_{med}$, is shown by the red line. $M$ in this example is -0.39.} \label{fig:gettingM} \end{figure*} \subsection{Variability Classes} The bivariate plot of $Q$ versus $M$ can be broken into rough regions that display different forms of variability \citep[e.g.,][]{cody14, cody18} based on visual classification. The definitions for the regions that we adopt \citep[from][]{cody18} are: \begin{itemize} \item \textit{Burster} \\ $M < -0.25$ \item \textit{Purely periodic symmetric} \\ $Q < 0.15$ and $-0.25 < M < 0.25$ \item \textit{Quasiperiodic symmetric} \\ $0.15 < Q < 0.85$ and $-0.25 < M < 0.25$ \item \textit{Purely stochastic} \\ $Q > 0.85$ and $-0.25 < M < 0.25$ \item \textit{Quasiperiodic dipper} \\ $0.15 < Q < 0.85$ and $M > 0.25$ \item \textit{Aperiodic dipper} \\ $Q > 0.85$ and $M > 0.25$~~. \end{itemize} In addition to these categories, which can be sorted by their position in $Q$ and $M$ space, \citet{cody18} and \citet{cody14} include classifications by-eye for long-timescale, unclassifiable, non-variable, and eclipsing binaries. Here we primarily focus on the types of variability that are thought to be caused in part by accretion-related phenomena (burster, purely periodic symmetric, quasiperiodic symmetric, and purely stochastic). \section{Results} After linking the HD simulation, the nLTE shock model, and the model of rotational modulation, we explored which parameters had an effect on the observed variability through the $Q$ and $M$ metrics. Below we discuss each of the parameters and their effect on the light curve. \subsection{Free Parameters} The relevant parameters that can be readily changed in our models are as follows: the polar strength of the octupole relative to the dipole, $\Gamma$, which sets the magnetic field geometry (see Figure \ref{fig:schematic}); the corotation radius, $R_{co}$; the rms of the turbulent driving function, $A$; the stellar parameters, $M_\star$, $R_\star$, and $T_{\mathrm{eff}}$; the density of the accretion column at the disk, $n_{0}$; the inclination, $i$, of the star; the upper and lower latitudinal bounds of the hot spot strip (measured from the rotational axis), $\gamma_U$ and $\gamma_L$; the angular length of the hot spot strip, $\alpha$; the rotational period; and the filter bandpass. While the number of free parameters initially appears daunting, several of them can be eliminated or combined into a single variable. The three stellar parameters, $M_\star$, $R_\star$ and $T_{\mathrm{eff}}$ can be reduced to the single parameter of $M_\star$ if an age is assumed using isochrones. We used the MESA Isochrones and Stellar Tracks (MIST) with solar metallicity at an age of 2 Myr \citep{choi16, dotter16}. As noted in \S\ref{ss:rotation}, under our assumption of a multipolar field and an assumption on the inner/outer radius from which to draw material from the disk, we can solve for the spot latitude, which eliminates $\gamma_U$ and $\gamma_L$ as free parameters. The fluid equations can be solved in a dimensionless manner, which means that changing $n_0$ does not affect the flow structure along the column. While the value of $n_0$ affects the output spectra, $\dot{M}$, and magnetic field strength, changing it will not strongly affect the measured $Q$ and $M$ with the small value of $\sigma$ that we have adopted. Here, we fix $n_0$ to a single value of $10^{13}$~cm$^{-3}$, which results in kinetic energy fluxes between roughly $10^{10}$ and $10^{12} \, \mathrm{erg \, s^{-1} \, cm^{-2}}$ which is typical for young stars \citep{ingleby13, ingleby15, robinson19}. The rotational period of the star can be determined from the specified parameters above using Kepler's third law for circular orbits at the $R_{co}$. Unless stated otherwise, the light curves are generated using the Johnson V filter \citep{johnson53}. From test runs of the model, we found that $Q$ and $M$ were generally only weakly dependent on the length of the hot spot, $\alpha$. Given this, we fix $\alpha = 90^\circ$, which for a pure dipole field results in a total surface coverage fraction of about $1.5\%$ (or $0.15\%$ for $\Gamma = 5$) for a single hot spot. \subsection{Base Model \label{ss:basemodel}} After the above simplifications, five relevant free parameters remain: $\Gamma$, $R_{co}$, $A$, $M_\star$, and $i$. To explore this parameter space, we first construct a base model with parameters thought to be somewhat typical of young stars. The base model has $\Gamma = 5.0$, $R_{co} = 5.0 \, \mathrm{R_{\star}}$, $M_{\star} = 1.0 \, \mathrm{M_\odot}$, and a period of 3.3 days. Ten inclinations were evenly sampled between $0^\circ$ and $90^\circ$. Figure \ref{fig:U-V} shows the $U-V$ color against $V$ for this base model viewed at an inclination of $60^\circ$ for synthetic observations lasting 30 days. Fig \ref{fig:U-V} also demonstrates the degeneracy between the filling factor, $f$, and the kinetic energy flux of the flow at the shock, $F$, which can be written as \begin{equation} F = \frac{1}{2}\rho v^3 \end{equation} where $\rho$ and $v$ are taken from the HD simulation at the stellar surface. Our base model was then run three times using the turbulent driving functions described above, each with a different random seed value. $Q$ and $M$ were then calculated for each of these models. As a rough estimate of the uncertainty in $Q$ and $M$, we adopt the mean of the standard deviations between the three realizations at each inclination. The process of determining $Q$ and $M$ for one of the light curves from a model realization at $i = 60^\circ$ is illustrated in Figures \ref{fig:gettingQ} and \ref{fig:gettingM}, respectively. Typical, instantaneous $\dot{M}$ values for the selected base parameters with a single spot are on the order of $3 \times 10^{-10} \, \mathrm{M_\odot \, yr^{-1}}$. With these accretion rates and the approximation that the $R_T$ is set by the dipole field component, by inverting the typical calculation for the $R_T$ \citep[e.g., the derivation in ][]{hartmann16} we find that typical values of $B_{dip}$ for the base model are around $60$ G with a total field strength of $|B| \sim 360$ G near the poles. This value of $B_{dip}$ is low compared to those found many spectropolarimetric studies \citep[e.g.,][]{donati08b, donati10b, donati11a, donati11b}, but we note that many of the values of $B_{dip}$ for the model variants discussed in the following section are closer to the observed values. \begin{figure} \centering \includegraphics[width = .95\linewidth]{U-V.pdf} \caption{ $U-V$ vs. $V$ diagrams created using the timesteps from the base model at an inclination of $60^\circ$. The top panel is colored by the filling factor, $f$ (expressed as a percentage), while the bottom panel is colored by the kinetic energy flux, $F$. We find a gradient along the narrow diagonal locus of points for both of these quantities, demonstrating the degeneracy between both parameters at these wavelengths.} \label{fig:U-V} \end{figure} \subsection{Variants on the Base Model} Next, we consider variants on the base model, where one parameter is changed at a time. To gain insight on the parameters, simulations were first run with simple steady input/output boundary conditions that do not restrict the flow. These simulations converge to steady state and match both the analytic results from \citet{adams12} and the simulations from \citet{robinson17}. The density and velocity solutions are shown in Figure \ref{fig:steady_state}. Next, the steady-state boundary conditions were replaced with the turbulent boundary conditions described in \S 2.2.2. To minimize variation from random effects between models, the random number seed selected for the generation of the turbulent driving function for each model variant is fixed to be the same as the base model shown in Figures \ref{fig:gettingQ} and \ref{fig:gettingM}. In the following sections, the importance of each parameter on variability classification is discussed. The results for all of the models are shown in Figure \ref{fig:QM_variants} displayed in the form of $Q$ vs.\ $M$ bivariate plots. Figure \ref{fig:QMi} shows $Q$ and $M$ as a function of $i$ for the model variants, while Figure \ref{fig:paramplots} demonstrates the effect of changing the other model parameters parameters ($\Gamma$, $R_{co}$, $A$, and $M_\star$). \begin{figure*} \centering \includegraphics[width = 0.9\linewidth]{steady_state_solns.pdf} \caption{Steady-state solutions for the different values of $M_\star$, $\Gamma$, and $R_{co}$ from the set of models discussed in \S3.3. For the set of parameters we have explored, changes in the kinetic energy flux, $F$, are primarily caused by differences in the density near the star rather than the velocity.} \label{fig:steady_state} \end{figure*} \begin{figure*}[h] \centering \includegraphics[width = 0.9\linewidth]{all_QM_variants.pdf} \caption{Bivariate plots of metrics $Q$ and $M$ that describe the degree of periodicity and symmetry of the light curves for different parameters. Here, variants on $M_\star$, $\Gamma$, $R_{co}$, and $A$ are shown from a base model of $M_\star = 1.0 \mathrm{M_\odot}$, $\Gamma = 5.0$, $R_{co} = 5.0$ and $A = 0.1$. Individual model realizations are shown as black points along the colored lines. The inclination, $i$, is shown by the darkness of the lines. The dashed grey lines mark the boundaries between variability classes listed on the top and right axes. An estimate of the model uncertainty is shown by the symbol in the lower left (see \S 3.2). $Q$ and $M$ values from K2 light curves from \citet{cody18} are shown as gray points.} \label{fig:QM_variants} \end{figure*} \begin{figure*} \centering \includegraphics[width = 0.98\linewidth]{altQMplot.pdf} \caption{$Q$ and $M$ values as functions of the inclination. Each vertical pair of panels shows model variants of $M_\star$, $\Gamma$, $R_{co}$, and $A$. Individual model realizations are shown by the black points. An estimate of the uncertainty is shown in the upper right, which was derived by changing the seed value of the turbulent driving function for the base model. The dashed gray lines mark the boundaries between the variability classes listed on the far right axis.} \label{fig:QMi} \end{figure*} \begin{figure*} \centering \includegraphics[width = 0.98\linewidth]{paramplot.pdf} \caption{$Q$ and $M$ values as functions of $M_\star$, $\Gamma$, $R_{co}$, and $A$. Individual model realizations are shown by the black points. Darker colors represent models with higher inclinations, with values evenly sampled between $0$ and $90^\circ$. Estimates of the model uncertainties on $Q$ and $M$ are shown by the marker in the upper right corner of each panel. The dashed grey lines mark the boundaries between the variability classes listed on the far right axis.} \label{fig:paramplots} \end{figure*} \subsubsection{Inclination, $i$} Under our model construction, $i$ plays a strong role in determining how periodic the observed signal appears. Objects with low inclinations typically show weaker periodic variations, while objects that are more edge-on show significant rotational modulation. While the inclination at which the model turns from aperiodic to quasiperiodic to periodic depends on the other parameters described above, the trend of an increasing $i$ leading to decreasing $Q$ holds true for all of the models. This is demonstrated in Figure \ref{fig:QMi}. We also find that increasing the inclination tends to lead to light curves that appear more burst dominated. \subsubsection{Stellar Mass, $M_\star$} At a fixed age, increasing the stellar mass also increases the effective temperature and the radius of the star. This changes the depth of the potential well, which changes the flow structure along the accretion column. Under the unitless approach we have taken in the 1D HD simulations, the depth of the potential well is parameterized by the single dimensionless quantity $b \equiv \frac{GM_\star}{R_\star c_s^{2}}$. The effect on $b$ from changing $M_\star$ depends on the age of the star because the radius is set using stellar isochrones \citep{choi16, dotter16}. At an age of 2 Myr, as $M_\star$ increases, $b$ also increases. Here, we have explored values of $M_\star$ = 0.6, 0.8, 1.0, 1.2, and $1.4 \mathrm{M_\odot}$, which results in $b$ = 511, 618, 711, 794, and 855, respectively. The first-order effect of increasing $b$ on the flow structure is an increase in the steady-state Mach number of the flow at the stellar surface due to the deeper potential well. However, under our assumption that the outer boundary of the region from which the column draws mass is $R_{co}$, changing the stellar mass also affects rotation. The effect of this on our simulations is parameterized with a dimensionless rotation parameter $\omega \equiv \big(\frac{\Omega R_\star}{c_s}\big)^2$, where $\Omega$ is the rotation rate of the star. Under our assumptions, this can be written as $\omega = \frac{b R_\star^3}{R_{co}^3}$. While increasing $M_\star$ creates a stronger outward centrifugal force in the non-inertial frame, ultimately the effect of increasing gravity is stronger, and the Mach number of the flow increases along the column with increasing $M_\star$. Changing the rotation rate via $M_\star$ in part also controls spot modulation since it sets the rotation period of the star under the constraint of corotation. The range of masses for these models results in rotational periods ranging between 3.3 and 3.5 days. The coordinate system that is used to describe the system is independent of $b$, so changing $M_\star$ does not affect the degree of compression by the magnetic field nor does it change $\gamma_L$ or $\gamma_U$. We find that linear relationships between both $Q$ and $M$ and $M_\star$ are not readily apparent. This is best shown by Figure \ref{fig:paramplots}. While there may be a slight general trend toward more burst-dominated light curves at higher $M_\star$, particularly at low inclinations, it does not appear to be a monotonic relationship. The $Q$ metric shows a small peak for the $M_\star = 1.2 \mathrm{M_\odot}$ model at moderate inclinations, but returns to the typical value at $M_\star = 1.4 \mathrm{M_\odot}$. As $M_\star$ increases, the density near the star decreases (see Fig.\ \ref{fig:steady_state}). Interestingly, this leads to a column with a lower kinetic energy flux, since the increased speed of the flow from the larger gravitational potential does not offset the decreased density. This result matches the analytic results presented by \citet{adams12}. Using the same assumptions discussed in \S \ref{ss:basemodel}, we find values of $\dot{M}$ of $2 \times 10^{-10} $ to $6 \times 10^{-10} \, \mathrm{M_\odot \, yr^{-1}}$ (decreasing with $M_\star$) which results in $|B|$ at the poles ranging from 275 to 580 G (also decreasing with $M_\star$). \subsubsection{Magnetic Field Configuration, $\Gamma$} The ratio between the dipole and octupole components, $\Gamma$, sets the overarching magnetic field structure of our model. The scale factors of the curvilinear coordinate system set the effective cross-sectional area of the accretion column as a function of radius. These scale factors are a function of $\Gamma$, and as $|\Gamma|$ increases, the flow becomes more constricted near the star \citep[see][for more discussion regarding scale factors]{adams12, robinson17}. Changing $\Gamma$ also changes the shape of the accretion column, which affects components of force vectors along the magnetic field line ($\hat{x} \cdot \hat{p}$ term in the centrifugal force and $\hat{r} \cdot \hat{p}$ term in the gravitational force term). As shown by Figure \ref{fig:schematic}, increasing $\Gamma$ decreases $\gamma_U$ and $\gamma_L$. Here, we explore variants with $\Gamma =$ -7.5, -5.0, -2.5, 0.0, 2.5, 5.0, and 7.5. This results in $\gamma_U =$ 58.4, 56.1, 50.2, 26.6, 14.0, 10.4, and $8.6^\circ$, respectively. As $\Gamma$ increases, the steady-state velocity distribution remains relatively unchanged, and the density across most of the column tends to decrease (see Fig.\ \ref{fig:steady_state}). However, near the star, the relation between density and $\Gamma$ is no longer monotonic, and we see a local density maximum around $\Gamma = 2.5$. After implementing the turbulent boundary conditions, we also find a maximum in the $M$ metric near $\Gamma = 2.5$. For values of $\Gamma$ greater than this, we find that as $\Gamma$ increases, $M$ decreases, and the light curve appears more dominated by accretion bursts. The pure dipole case shows a more negative value of $M$ than both the $\Gamma = 2.5$ and $5.0$ cases. In the case of $\Gamma = 7.5$, we find that all models appear as bursters. For negative values of $\Gamma$, we found that $M$ was essentially flat with values slightly more positive than that of the pure dipole case at all inclinations. As expected, based on the relationship between $\Gamma$ and $\gamma_L$ and $\gamma_U$, objects smoothly become more aperiodic as $\Gamma$ increases as measured by the $Q$ metric (see the the top panel of Figure \ref{fig:paramplots}). $\dot{M}$ for models with positive, nonzero values of $\Gamma$ under our assumptions range from $7\times 10^{-11}$ to $9\times10^{-10} \, \mathrm{M_\odot \, yr^{-1}}$, and $|B|$ at the poles ranges between $250$ to $360$ G, both decreasing with $\Gamma$. We found that our models with negative values of $\Gamma$ had $\dot{M}$ between $2\times10^{-9}$ to $3\times10^{-9} \mathrm{M_\odot \, yr^{-1}}$, and $|B|$ of $230$ to $1250$ G, both increasing with $|\Gamma|$. For the dipole model, we found $\dot{M} = 1.6\times10^{-9} \, \mathrm{M_\odot \, yr^{-1}}$ and $|B| = 140$ G near the poles. \subsubsection{Corotation Radius, $R_{co}$} The field line along which the 1D fluid equations are solved in our model connects the star to disk at the corotation point ($R_{co}$) and the truncation radius is set such that $R_T = 0.5 R_{co}$. Under our model framework, the choice of $R_{co}$ influences both the rotation rate of the star and which magnetic field lines are traced (see Figure \ref{fig:schematic}). As a consequence, $\gamma_U$ and $\gamma_L$ monotonically decrease with $R_{co}$. Here we have explored inner disk radii of $R_{co} = 5.0$, $6.0$, $7.0$, $8.0$, and $9.0 \, R_\star$. For these values of $R_{co}$, $\gamma_U =$ 10.4, 9.6, 8.9, 8.3, and $7.8^\circ$, respectively. These values of $R_{co}$ result in rotational periods between 3.3 and 8.1 days. Changing the inner disk has large consequences on the density distribution along the column in the steady-state solution (see Figure \ref{fig:steady_state}). The density at the stellar surface spans a full two orders of magnitude between $R_{co} = 5.0 R_\star$ and $R_{co} = 9.0 R_\star$. This is in part because of the decreased effective area of the accretion column near the star in the $R_{co} = 9.0 R_\star$ case due to the associated curvilinear scale factors. However, the additional compression for the field line that crosses the disk at $R_{co}$ is only a factor of about five, which implies that the model is less restrictive to additional mass entering the simulation through the outer boundary as $R_{co}$ increases. This is supported by examining the time-dependent models that show increasing $\dot{M}$ with $R_{co}$, with values ranging between $3 \times 10^{-10}$ and $9\times10^{-9} \, \mathrm{M_\odot \, yr^{-1}}$. Under these values of $\dot{M}$, $|B|$ near the poles ranges between 376 and 5450 G (also increasing with $R_{co}$). As $R_{co}$ increases, our models tend to be slightly more periodic. This is counter to what the changes in $\gamma_U$ and $\gamma_L$ would suggest, but the changes are relatively small (see the changes in $\gamma_U$ and $\gamma_L$ from changing $\Gamma$). We found that models with small values of $R_{co}$ showed much stronger bursting behavior for all inclinations. \subsubsection{Turbulent Amplitude, $A$} The turbulent driving function introduces gradients in velocity and density structure near the disk. These gradients lead to the formation of traveling shocks along the accretion column \citep[see][]{robinson17}. The turbulent amplitude, $A$, is the Mach number of the rms velocities of these perturbations at the boundary. Under a \citet{shakura73} $\alpha_\nu$-disk prescription, turbulent perturbations scale as $A = \sqrt{\alpha_\nu}$. This $\alpha_\nu$, not to be confused with the angular spot length, is a dimensionless parameterization of turbulent viscosity. Typical values of $\alpha_\nu$ from modeling protoplanetary disks are on the order of 0.01 \citep[with some scatter; e.g.,][]{hartmann98, andrews09}. Motivated by this, we tested model variants with values of $A = 0.01$, $0.05$, $0.10$, $0.20$, and $0.30$, but caution that $\alpha_\nu$ is generally inferred much further out in the disk than the region that we are simulating. Recall that the random number seed used to generate the turbulent driving function is fixed across all model variants. As $A$ increases, we find that models monotonically appear more aperiodic as described by the $Q$ metric. Likewise, as $A$ increases, we find that the objects are more dominated by bursts (i.e., $M$ decreases). We find that increasing $A$ also increases the amount of material entering the simulation available for accretion (see Figure \ref{fig:A_vs_F}), which may lead to the some of the differences in the measured $Q$ and $M$ values. Additionally, larger values of $A$ lead to steeper gradients in the outer disk, which aid the formation of the traveling shocks. For this set of models, we found $\dot{M}$ ranging between $1\times10^{-10}$ to $5\times10^{-10} \, \mathrm{M_\odot \, yr^{-1}}$, with $|B|$ between 242 and 475 G near the poles, both increasing with $A$. \begin{figure} \centering \includegraphics[width = .95\linewidth]{A_vs_F.pdf} \caption{ Histograms showing kinematic energy flux, $F$, at the surface of the star for each time step for different values of turbulent driving amplitude, $A$. The changes in the median value of $F$ (shown by the dashed lines) are nearly entirely due to increased density, as the median velocity at the star changed very little between different values of $A$.} \label{fig:A_vs_F} \end{figure} \section{Discussion} We have connected a simple 1D HD simulation of the accretion column \citep[first presented in][] {robinson17} to the accretion shock models of \citet{calvet98, robinson19} and introduced rotational modulation by modeling accretion hot spots as equilatitudinal strips. The output from these simulations was studied using the same tools that have been applied to recent photometric monitoring surveys of accreting young stars in nearby low-mass star-forming regions. Here we place the results from our simulations in context with these campaigns and discuss implications on variability classifications for different parameters. We also briefly consider two additional complexities that could be explored more in the future: non-rotation-axis-aligned fields and multiple accretion spots. \subsection{Implications for Variability Classes} Within this work, we have included only mechanisms that can result in variability caused by changes in $\dot{M}$ and rotational effects, so we focus on objects with burster, purely periodic symmetric, quasiperiodic symmetric, and purely stochastic classes. Several of the other classes (quasiperiodic dipper, aperiodic dipper, and eclipsing binary) likely rely on the presence of occulting bodies. Because we do not include any such bodies in our analysis, discussion of these types of objects in general is not included here. Likewise, the choice of our boundary condition and fixed parameters likely excludes objects that would be classified as long-timescale, unclassifiable, and non-variable. Under the constraints imposed by our model, we found that inclination plays a large role in determining the periodic behavior of the star as quantified by $Q$. Under the parameters that we explored, we found that typically only objects with low inclinations ($ i \leq 30^\circ$) would be classified as purely stochastic objects. Objects with intermediate inclinations ($ 30^\circ < i < 80^\circ$) tend to fall into the quasiperiodic symmetric classification. Finally, objects that have the highest inclinations ($i \geq 80^\circ$) tend to fall into the category of purely periodic. However, while $i$ is the primary parameter that determines $Q$, the inclination at which the model appears as periodic, quasiperiodic, or aperiodic depends strongly on the other parameters considered here (see Figure \ref{fig:QMi}). For example, the model variant with $\Gamma = 7.5$ is on the border of being classified as stochastic up to an inclination of roughly $40^\circ$. In contrast, the model with $\Gamma = -7.5$ is on the border between quasiperiodic and periodic classifications at the same inclination. Therefore, inclination is likely not the only driver when determining periodic variability class. We found that the magnetic field geometry (parameterized by $\Gamma$ and $R_{co}$) and the amplitude of the turbulent driving function all had a large impact on $M$, while $M_\star$ did not. We found that models with small $R_{co}$ or large positive values of $\Gamma$ both exhibit bursting behavior with relatively low accretion column densities near the star (see Figure \ref{fig:steady_state}). In contrast, models with large values of $A$ also show bursts with increasing column density (Figure \ref{fig:A_vs_F}). Contemporaneous NUV - NIR spectra can be used to break degeneracies between accretion column density and surface coverage \citep[e.g.,][]{ingleby13, ingleby15, robinson19}, and the magnetic field can be directly probed with spectropolarimetric observations, \citep[e.g.,][]{donati10a}. Combined, these techniques may be able to distinguish between these scenarios. With regards to $M_\star$, \citet{cody18} did not find an obvious relationship between variability classification and $M_\star$ using K2 observations and spectral types as proxies for stellar masses. This is in agreement with the non-monotonic relationships we found between $M_\star$ and $Q$ and $M$. While the range of models that we explored does not cover all of parameter space, we can speculate on some basic generalizations about variability class populations given that our selection of base model parameters is somewhat representative of a typical CTTS. We found that most of our models fell into the quasiperiodic symmetric classification, suggesting that these types of light curves might be common. This is in agreement with previous photometric monitoring campaigns that also showed the largest fraction of stars in the quasiperiodic symmetric class \citep[$17\pm3 \%$ to $29 \pm 3\%$, depending on the star-forming region;][]{cody18}. We also found that under the range of parameters that we explored, this model can produce light curves that fall into all of the classifications associated with changes in $\dot{M}$. This suggests that the some of the observed variability could feasibly be driven by Kolmogorav-style turbulence in the inner disk. However, we caution further conjecture at this point regarding the entire population because the variability classification of the model variants strongly depends on the base model parameters. Additionally, observational biases that affect studies of variability in young stars are not considered here (e.g., the star is unlikely to be observable at high inclinations due to disk obscuration). These models also lack the ability to reproduce fluid instabilities that 3D simulations can reveal. Additionally, only a single hot spot has been considered (see \S \ref{ss:multiplespots}). \subsection{Nonaligned Magnetic Field Structure} One of the largest assumptions in our model is the presence of a perfectly rotation-axis-aligned magnetic field that can be described using a multipole decomposition. Zeeman-Doppler imaging of the magnetic field structure of young stars has shown that the magnetic fields are not necessarily perfectly aligned with the rotation axis \citep{donati07, donati10b}. This misalignment, along with any possible toroidal components, causes the accretion hot spot geometry to become significantly more complex. We can begin to consider the effects of such a misaligned field on our model construction. If deviations from a purely rotation-axis-aligned magnetic field are included, the easiest effect to consider without detailed HD simulations is the change in $\gamma_U$ and $\gamma_L$. Models with larger values of $\gamma_U$ and $\gamma_L$ tend to be more periodic since the effect of rotational modulation of the light curve is enhanced. With the introduction of a misalignment, the magnetic field connecting the disk to the star becomes a function of $\phi$ in the corotating frame. If magnetic field lines further from the axis of rotation are favored for mass loading because the gravitational force vector is more closely aligned with the magnetic field line at the magnetic footprint at the inner edge of the disk \citep[predicted by 3D MHD simulations, e.g., ][]{romanova03, romanova04}, then misalignments would tend to increase the periodicity of the observed light curve. However, as demonstrated in this work, changing the magnetic field geometry can drastically change the flow along the accretion column, thus making more detailed modeling required for more concrete predictions. \subsection{Multiple Spots \label{ss:multiplespots}} The mass deposited onto the star in our models is uniformly spread across a single hot spot. Modeling of NUV spectra, which can break the degeneracy in Figure \ref{fig:U-V}, has shown that multiple accretion column densities are typically necessary to fully reproduce observations within single observations \citep{ingleby13, ingleby15, robinson19}. This suggests either that multiple accretion hot spots exist with different densities and/or that gradients occur across the single spot. Adding more spots introduces several new free parameters that were not necessary to consider in the single-column case. In this work, we also did not consider the conjugate spot on the opposite pole. This spot may be visible for specific models at higher inclinations (e.g., models with negative values of $\Gamma$). Using two of the base model realizations with different random seeds (see \S 3.2), we performed exploratory tests to examine the effect of adding a second nonoverlapping spot. The phase offset and the ratio between spot areas was varied while the total area covered was fixed to be the same as a single spot with $\alpha = 90^\circ$. We also fixed $i = 60^\circ$ for simplicity. $Q$ and $M$ were then measured for each phase-ratio pair. We explored five spot area ratio cases: $5:1$, $3:1$, $1:1$, $1:3$, and $1:5$ and five evenly sampled phase offsets between $120^\circ$ and $240^\circ$ for each ratio. We found limited impact on $Q$ and $M$ between different phase offsets of the spots. The mean standard deviation for $Q$ and $M$ when fixing the spot size ratio and varying the phase offset was 0.04 and 0.07, respectively. We found that changing the ratio of spot sizes has a larger effect on $Q$ and $M$. The mean standard deviations of $Q$ and $M$ between models with a fixed phase offset and a varied spot ratio were 0.15 and 0.14, respectively. The mean $Q$ and $M$ values for the two-column realizations were 0.77, and -0.35, which are similar to the the two single-column models with values of 0.51 and 0.72 for $Q$ and -0.38 and -0.43 for $M$. However, trends between the spot area ratio and the change in $Q$ and $M$ are not easily identified. Even light curves of conjugate pairs of spot size ratios (e.g., $3:1$ and $1:3$) with the same phase offset can appear remarkably different. This reflects the dependence on the stochastic nature of the chosen driving functions, and the spread in the metrics is similar to that calculated between single-column models with different random seeds \S 3.2. Ultimately, adding additional spots, via either multiple accretion streams or conjugate spots on the opposite hemisphere, tends to act as a contributing source of uncertainty that has not been considered in the single-column analysis presented in this work and merits further exploration. \section{Summary} We created synthetic light curves of accreting pre-main-sequence stars using a set of 1D HD simulations of the magnetosphere that are coupled with an nLTE accretion shock model and a simple model of rotational modulation. Our models were constructed under the assumption of a dipole or a dipole + octupole rotation-axis-aligned magnetic field. Perturbations were introduced to steady-state flow solutions using boundary conditions that aimed to mimic turbulence in the inner disk. Specifically, we tested the effect of the stellar mass, inclination, magnetic field geometry, the inner disk radius, and the level of turbulence in the inner disk. We then used the previously developed metrics $Q$ and $M$ to measure the light curve periodicity and symmetry around the mean, respectively, in order to facilitate comparisons between patterns present in our model variants and the results from month-long photometric monitoring campaigns of young stars \citep[e.g., ][]{cody14, cody18}. We focus on variability classes that can, in part, be explained by changes in $\dot{M}$. These include bursters, purely periodic symmetric, quasiperiodic symmetric, and purely stochastic classes. We found that Kolmogorav turbulence in the inner disk can drive a wide degree of variability behavior associated with these classes. Our major findings are summarized as follows. \begin{enumerate} \item Clear monotonic trends between $M_\star$ and the $Q$ and $M$ metrics are difficult to identify, which is in agreement with previous observations of CTTS. \item We found that the periodic behavior of the light curve as measured by $Q$ is primarily controlled by the inclination, $i$. Typically, we find that objects with $i \leq 30^\circ$ appear as purely stochastic, $30^\circ < i < 80^\circ$ as quasiperiodic, and $i \geq 80^\circ$ as purely periodic. However, the value of $i$ where the object appears periodic, quasiperiodic, or aperiodic depends to some degree on the magnetic field geometry, the inner disk radius, and the level of turbulence in the inner disk. \item We found that the symmetric behavior of the light curve as measured by $M$ is also a function of the inclination, magnetic field composition, inner disk radius, and turbulent amplitude. Objects with either a pure dipole field, large aligned octupole components, or a small $R_{co}$ tend to exhibit more burst-dominated behavior. Objects with anti-aligned octupole components tend to show slightly less burst-dominated light curves than objects with pure dipolar fields at identical inclinations. Increasing the amplitude of the turbulent perturbations also led to more bursts. \item Our models suggest that it may be possible to separate driving parameters behind variability observed in light curves using NUV spectra to measure the kinetic energy flux of the accretion flow and spectropolarimetric measurements of the magnetic field. \item Complexities such as multiple columns and non-axis-aligned magnetic fields can modify the measured $Q$ and $M$ parameters. We suggest that a non-axis-aligned field may lead to more periodic light curves. Our initial tests found that when additional columns are included, $Q$ remains similar to the single column model while $M$ varies widely as a function of the ratio between spot sizes. We note that more work is necessary to make further predictions for either additional complexity. \item We suggest a slight adjustment to the algorithm for measuring rotation periods when measuring $Q$. We found that weighting the Lomb--Scargle periodogram with a Gaussian whose parameters are derived from the ACF gave a more accurate estimate than previous methods for our synthetic light curves (whose true period is known a priori). \end{enumerate} More continuous light curves of well-studied CTTS will become available from TESS in the upcoming years. This work attempts to establish the groundwork for interpretation of those data with a relatively simple approach. C.E.R. and C.C.E. acknowledge support from the National Science Foundation under CAREER grant No. AST-1455042 and the Sloan Foundation. The authors also acknowledge funding support from NASA grant No. 80NSSC19K1712. J.E.O. is supported by a Royal Society Univiersity Research Fellowship. The authors thank the referee, S. Gregory, whose insightful comments have greatly improved the quality of this work.
\section*{\refname}} \usepackage{listings} \lstset{% backgroundcolor=\color{gray!15}, basicstyle=\small\ttfamily, breaklines=true, columns=fullflexible, keywordstyle=\bfseries, language=Python } \usepackage{physics} \usepackage{xparse} \newcommand{\mcal}[1]{\ensuremath{\mathcal{#1}}} \newcommand{\mbf}[1]{\ensuremath{\mathbf{#1}}} \NewDocumentCommand{\rep}{s d<| d|>}{% \IfBooleanTF{#1}{ \IfValueTF{#2}{ \IfValueTF{#3}{\braket{#2}{#3}}{\bra{#2}} }{ \IfValueTF{#3}{\ket{#3}}{} } }{ \IfValueTF{#2}{ \IfValueTF{#3}{\braket*{#2}{#3}}{\bra*{#2}} }{ \IfValueTF{#3}{\ket*{#3}}{} } } } \NewDocumentCommand{\rbra}{sm}{\IfBooleanTF{#1}{\rep<#2|}{\rep*<#2|}} \NewDocumentCommand{\rket}{sm}{\IfBooleanTF{#1}{\rep|#2>}{\rep*|#2>}} \NewDocumentCommand{\rbraket}{smom}{ \IfBooleanTF{#1}{ \IfNoValueTF{#3}{\rep*<#2||#4>}{\matrixel{#2}{#3}{#4}} }{ \IfNoValueTF{#3}{\rep<#2||#4>}{\matrixel*{#2}{#3}{#4}} } } \NewDocumentCommand{\cg}{m m m}{\rep<#1; #2||#3>} \NewDocumentCommand{\field}{o m e{_} e{^} o e{_} e{^}}{ \IfValueTF{#5}{\overline{ #2\IfValueT{#3}{_#3}\IfValueT{#4}{^{\otimes #4}} % \otimes #5\IfValueT{#6}{_#6}\IfValueT{#7}{^{\otimes #7}} % \IfValueT{#1}{;#1} }}{ \IfValueTF{#4}{\overline{ #2\IfValueT{#3}{_#3}\IfValueT{#4}{^{\otimes #4}} \IfValueT{#1}{;#1} }} {#2\IfValueT{#3}{_#3}} } } \NewDocumentCommand{\frho}{o e{_} e{^}}{ \field[#1]{\rho}_{#2}^{#3} } \NewDocumentCommand{\fdelta}{o e{_} e{^}}{ \field[#1]{\delta}_{#2}^{#3} } \newcommand{\e}{a} % \newcommand{\mbf{r}}{\mbf{r}} \newcommand{\mbf{x}}{\mbf{x}} \newcommand{\hat{\mbf{x}}}{\hat{\mbf{x}}} \newcommand{\hat{\mbf{r}}}{\hat{\mbf{r}}} \NewDocumentCommand{\ex}{e_}{ \IfValueTF{#1}{\e_{#1}\mbf{x}_{#1}}{\e\mbf{x}} } % \NewDocumentCommand{\lm}{e_}{ \IfValueTF{#1}{l_{#1}m_{#1}}{lm} } \NewDocumentCommand{\nlm}{e_}{ \IfValueTF{#1}{n_{#1}\lm_{#1}}{n\lm} } \NewDocumentCommand{\enlm}{e_}{ \IfValueTF{#1}{\e_{#1}\nlm_{#1}}{\e\nlm} } \NewDocumentCommand{\en}{e_}{ \IfValueTF{#1}{\e_{#1}n_{#1}}{\e n} } \NewDocumentCommand{\nlk}{e_}{ \IfValueTF{#1}{n_{#1}l_{#1}k_{#1}}{nlk} } \NewDocumentCommand{\enlk}{e_}{ \IfValueTF{#1}{\e_{#1}\nlk_{#1}}{\e\nlk} } \NewDocumentCommand{\enl}{e_}{ \IfValueTF{#1}{\en_{#1}l_#1}{\en l} } \NewDocumentCommand{\nl}{e_}{ \IfValueTF{#1}{n_{#1}l_#1}{n l} } \NewDocumentCommand{\nnl}{s}{ \IfBooleanTF{#1}{n_1 n_2 l}{n_1; n_2; l} } \NewDocumentCommand{\ennl}{s}{ \IfBooleanTF{#1}{\en_1 \en_2 l}{\en_1; \en_2; l} } \NewDocumentCommand{\gslm}{s}{ \IfBooleanTF{#1}{\sigma\lambda\mu}{\sigma;\lambda\mu} } \NewDocumentCommand{\glm}{}{\lambda\mu} \usepackage{bm,upgreek} \newcommand{\mbf{h}}{\mbf{h}} \newcommand{\mbf{F}}{\mbf{F}} \newcommand{\mbf{u}}{\mbf{u}} \newcommand{\mbf{k}}{\mbf{k}} \newcommand{\mbf{P}}{\mbf{P}} \newcommand{\mbf{q}}{\mbf{q}} \newcommand{\nlF}[0]{\tilde{F}} \newcommand{\krn}[0]{\operatorname{k}} \newcommand{\dst}[0]{\operatorname{d}} \newcommand{\lD}[0]{D} \newcommand{\Q}[0]{Q} \newcommand{\q}[0]{q} \newcommand{\y}[0]{y} \newcommand{\yt}[0]{\tilde{y}} \newcommand{\by}[0]{\mbf{\y}} \newcommand{\upxi}{\upxi} \newcommand{\bfeat}[0]{\ensuremath{\bm{\upxi}}} \newcommand{\bfeatc}[0]{\ensuremath{\bm{\upchi}}} \newcommand{\bm{\Xi}}{\bm{\Xi}} \newcommand{\bm{\upvarphi}}{\bm{\upvarphi}} \newcommand{\D}[2][]{\ensuremath{\mathop{}\!\mathrm{d}^{#1}{#2}\,}} \newcommand{\ensuremath{\mathrm{i}}}{\ensuremath{\mathrm{i}}} \newcommand{\hat{t}}{\hat{t}} \newcommand{\hat{i}}{\hat{i}} \newcommand{\hat{R}}{\hat{R}} \newcommand{{\mathbb{R}^3}}{{\mathbb{R}^3}} \newcommand{{O(3)}}{{O(3)}} \newcommand{{SO(3)}}{{SO(3)}} \newcommand{Y^m_l}{Y^m_l} \newcommand{r_{ij}}{r_{ij}} \newcommand{\hat{\bm{r}}_{ij}}{\hat{\bm{r}}_{ij}} \newcommand{\CHF}[3]{{}_{1}F_{1}\left(#1 ,#2, #3 \right)} \newcommand{\GA}[1]{\Gamma\left(#1\right)} \newcommand{\textrm{d}}{\textrm{d}} \newcommand{\rrho}[2]{\overline{\rho_{#2}^{\otimes #1}}} \newcommand{\rrhoi}[1]{\rrho{#1}{i}} \newcommand{\rrhoislm}[1]{\frho[\gslm]_i^{#1}} \newcommand{\lmax}[0]{{l_\text{max}} } \newcommand{\nmax}[0]{{n_\text{max}} } \newcommand{\fcut}[0]{{f_\text{cut}} } \newcommand{\rcut}[0]{{r_\text{cut}} } \newcommand{\sigmaa}[0]{{\sigma_{\e}} } \newcommand{\nneigh}[0]{n_\text{neigh}} \newcommand{\nfeat}[0]{n_\text{feat}} \newcommand{\qmax}[0]{\q_\text{max}} \newcommand{\rotatebox{90}{$\;\equiv\;$}}{\rotatebox{90}{$\;\equiv\;$}} \newcommand{\smmat}[1]{ \left(\begin{smallmatrix} #1 \end{smallmatrix}\right) } \begin{document} \title{Physics-inspired structural representations for molecules and materials} \author{Felix Musil} \affiliation{Laboratory of Computational Science and Modeling, IMX, \'Ecole Polytechnique F\'ed\'erale de Lausanne, 1015 Lausanne, Switzerland} \affiliation{National Centre for Computational Design and Discovery of Novel Materials (MARVEL), \'Ecole Polytechnique F\'ed\'erale de Lausanne, Lausanne, Switzerland} \author{Andrea Grisafi} \affiliation{Laboratory of Computational Science and Modeling, IMX, \'Ecole Polytechnique F\'ed\'erale de Lausanne, 1015 Lausanne, Switzerland} \author{Albert P. Bart\'ok} \affiliation{Department of Physics and Warwick Centre for Predictive Modelling, School of Engineering, University of Warwick, Coventry CV4 7AL, United Kingdom} \author{Christoph Ortner} \affiliation{University of British Columbia, University of British Columbia, Vancouver, BC, Canada V6T 1Z2} \author{G\'abor Cs\'anyi} \affiliation{Engineering Laboratory, University of Cambridge, Trumpington Street, Cambridge CB2 1PZ, United Kingdom} \author{Michele Ceriotti} \email{<EMAIL>} \affiliation{Laboratory of Computational Science and Modeling, IMX, \'Ecole Polytechnique F\'ed\'erale de Lausanne, 1015 Lausanne, Switzerland} \affiliation{National Centre for Computational Design and Discovery of Novel Materials (MARVEL), \'Ecole Polytechnique F\'ed\'erale de Lausanne, Lausanne, Switzerland} \date{\today} \raggedbottom \begin{abstract} The first step in the construction of a regression model or a data-driven analysis, aiming to predict or elucidate the relationship between the atomic scale structure of matter and its properties, involves transforming the Cartesian coordinates of the atoms into a suitable \emph{representation}. The development of atomic-scale representations has played, and continues to play, a central role in the success of machine-learning methods for chemistry and materials science. This review summarizes the current understanding of the nature and characteristics of the most commonly used structural and chemical descriptions of atomistic structures, highlighting the deep underlying connections between different frameworks, and the ideas that lead to computationally efficient and universally applicable models. It emphasizes the link between properties, structures, their physical chemistry and their mathematical description, provides examples of recent applications to a diverse set of chemical and materials science problems, and outlines the open questions and the most promising research directions in the field. \end{abstract} \maketitle \tableofcontents \todorev{ \begin{itemize} \item Z-matrix figure \item Decide what to do with universal SOAP (GC) \item librascal benchmarks? \item harmonize notation with other chemrev. $F->y$ perhaps? Kernel? feature vectors. \end{itemize} 1.) References section must have a heading (References, Literature Cited, Bibliography, etc. -Works Cited, however, is not permitted). 2.) References must adhere to ACS journal format: include the list of authors, article titles, journal abbreviation, publishing year, volume and full-page range; for example: (1.) Hammes-Schiffer, S.; Soudackov, A. V. Proton-Coupled Electron Transfer in Solution, Proteins, and Electrochemistry. J. Phys. Chem. B 2008, 112, 14108-14123 - Abbreviate all journal names in references. -All titles in references should have the same format -Title Case (preferred) or non-title case; mixed references formatting is not allowed. - Include full page range in journal references. - Include a volume number in all journal references - References with more than 10 authors should list the first 10 authors followed by “et al.” 3.) A TOC graphic is required and make sure that it is no bigger than 5cm by 5cm. } \section{Introduction} The last decade has seen a tremendous increase in the use of data-driven approaches for the modeling of molecules and materials. Atomistic simulation has been a particularly fertile field of use; applications range from the analysis of large databases of materials properties,\cite{isay+15cm} to the design of molecules with the desired behavior for a given application.\cite{sanc-aspu18science} Machine learning techniques have been applied to devise coarse-grained descriptions of complex molecular systems,\cite{das+06pnas,ceri+11pnas,spiw-kral11jcp,rohr+13arpc,Kanekal2019, Jackson2019, Wang2019} to build accurate and comparatively inexpensive interatomic potentials,\cite{behl-parr07prl,braa-bowm09irpc,bart+10prl,soss+12prb,behl16jcp,deri-csan17prb,drag+18prm,chen+20nature,deri+21nature} and more generally to predict, or rationalize, the relationship between a specific atomic configuration and the properties that can be computed by electronic-structure calculations\cite{rupp+12prl,smit+17cs,schu+18jcp,paru+18ncomm,gris+19acscs,wilk+19pnas,schu+19nc,kali+21acr}. All of these applications to atomic-scale systems share the need to map an atomic configuration $A$ -- identified by the positions and chemical identity of its $N$ atoms $\left\{\mbf{r}_i,\e_i\right\}$, and possibly by the basis vectors of the periodic repeat unit $\mbf{h}$ -- into a more suitable representation. This mapping associates $A$ with a point in a feature space, which is then used to construct a machine-learning model to regress (fit) a structure-property relation, to cluster (group together) configurations that share similar structural patterns, or to further map the conformational landscape of a data set onto a low-dimensional visualization. The terms \emph{descriptor} or \emph{fingerprint} are used, usually interchangeably, in chemical and materials informatics to indicate heuristically-determined properties that are easier to compute than the quantities one ultimately wants to predict, but correlate strongly with them, facilitating the construction of transferable and accurate models.\cite{ouya+18prm} Examples of descriptors include the fractional composition of a compound, the electronegativity of its atoms, a low-level-of-theory determination of the HOMO-LUMO gap of a molecule. In this review we focus on a more systematic class of mappings that use exclusively atomic composition and geometry as inputs, and aim to characterize precisely the instantaneous arrangement of the atoms, for which we use the term \emph{representation}. We will be especially interested in those representations that apply geometric and algebraic manipulations to the Cartesian coordinates, to transform them in a way that fulfills physically-informed requirements: smoothness and symmetry with respect to isometries. Commonly used representations include atom-centered symmetry functions\cite{behl+07jcp,behl-parr07prl}, Coulomb matrices\cite{rupp+12prl}, and the smooth overlap of atomic positions (SOAP)\cite{bart+13prb}. It is important to note that representations can be expressed using different mathematical entities. In the most straightforward realisation, the space of features takes the form of a vector space, in which each configuration is associated with a finite-dimensional vector whose entries are explicitly computed by the mapping procedure. Depending on the application, however, it may be simpler or more natural to describe the relationship between pairs of configurations. Such relationship can be expressed in terms of a kernel function $\krn(A,A')$ (e.g. the scalar product between feature vectors), or in terms of a distance between configurations $\dst(A,A')$ (e.g. the Euclidean distance between associated features). As we will see, distance or kernel-based formulations implicitly define a feature space, that in most cases can be expressed (at least approximately) in terms of a vector of features, and so can be seen as equivalent to a representation of individual structures, even in cases in which the distance or the kernel are not explicitly computed from a pair of feature vectors.% While one can trace the origins of different representations to specific subfields of computational chemistry and materials science, the fact that representations should describe precisely the nature and positions of each atom means that they often are not specialized to a given application, but can be used with little modification for any atomistic system, from gas-phase molecules to bulk solids\cite{bart+17sa,huo-rupp17arxiv,chen+19cm}. This generality, however, does not mean that representations are completely abstract or disconnected from physical and chemical concepts. Over the past few years, it has become clear that representations that reflect more closely some fundamental principles -- such as locality, the multi-scale nature of interactions, the similarities in the behavior of elements from the same group in the periodic table -- usually yield models that are more robust, transferable and data-efficient. The link between a representation and the physical concepts it incorporates is usually mediated by the strategy one uses to fit the desired structure-property relations: % it is often possible to show an explicit relationship between linear regression models built on the representation of a structure and well-known empirical forms of interatomic potentials (such as body-ordered, or multipole expansions), and more complex, non-linear machine-learning schemes built on the same features improve the flexibility in describing structure-property relations, albeit at the price of a less transparent interpretation of their behavior.% Given the central role of structural representations in the application of data-driven methods to atomistic modeling, it is perhaps not surprising that considerable effort is being dedicated to understanding and improving their properties. These efforts follow several directions. First, the efficient, scalable, and parallel implementation of the construction of a given set of features is essential to ensure computational efficiency. Second, reduction in the number of features that is used to describe the system reduces the computational effort, and often improves the robustness of the model: feature selection aims at identifying the most expressive, yet concise, description of the system at hand. Third, it is often desirable to fine-tune a representation so that it facilitates training a model on a small number of reference structures, by incorporating more explicitly the available prior knowledge. This review aims to summarize recent work on the construction of efficient and mathematically sound representations of atomic and molecular structures, with a particular focus on the use for the regression of atomic-scale properties. It is part of a special issue that covers the many facets of the application of machine learning to chemical simulations, and the interested reader may find, among others, discussions of machine learning models based on Gaussian process regression, using some of the descriptors we discuss here\cite{chemrev2021deringer}, of the construction of potentials for molecules\cite{chemrev2021gdml,chemrev2021smallmolecules} and materials\cite{chemrev2021behler}, the description of excited states\cite{chemrev2021excited}, and of unsupervised machine learning schemes\cite{chemrev2021unsupervised}. Rather than focusing on a historical overview, we intend to provide a snapshot of the current insights on what makes a good representation, supporting our considerations with recent publications, and providing a perspective of the most promising research directions in the field. \setlength{\glsdescwidth}{0.8\linewidth} \setglossarysection{section} \section{List of symbols} \renewcommand{\glossarysection}[2][]{} \glsxtrnewsymbol[description={An atomic structure}]{A}{\ensuremath{A}} \glsxtrnewsymbol[description={An environment centered on the $i$-th atom of the structure $A$}]{Ai}{\ensuremath{A_i}} \glsxtrnewsymbol[description={Position of the $i$-th atom}]{bri}{\ensuremath{\mbf{r}_i}} \glsxtrnewsymbol[description={Vector separating the $i$-th atom and its $j$-th neighbor, $\mbf{r}_j-\mbf{r}_i$}]{brji}{\ensuremath{\mbf{r}_{ji}}} \glsxtrnewsymbol[description={Generic continuous index enumerating the components of an atomic representation}]{S}{\ensuremath{\Q}} \glsxtrnewsymbol[description={Generic discrete index enumerating the components of an atomic representation}]{x}{\ensuremath{\q}} \glsxtrnewsymbol[description={A representation of a structure $A$ indexed by an unspecified label or set of labels $\Q$ }]{repSA}{\ensuremath{\rep<\Q||A>}} \glsxtrnewsymbol[description={Feature vector (with elements indexed by $\q$) associated with an atom-centered environment, $\upxi_\q(A_i)=\rep<\q||A_i>$}]{bfeatAi}{\ensuremath{\bfeat(A_i)}} \glsxtrnewsymbol[description={Feature matrix combining the features associated with multiple structures/environments} ]{bFeat}{\ensuremath{\bm{\Xi}}} \glsxtrnewsymbol[description={A column in a feature matrix, where $({\bfeatc}_{\q})_i =\upxi_\q(A_i)$} ]{bfeatc}{\ensuremath{\bfeatc_\q}} \glsxtrnewsymbol[description={An atom-centered property, or its systematic approximation in terms of an atom-centered representation $\rep|A_i>$ }]{yAi}{\ensuremath{\y(A_i)}} \glsxtrnewsymbol[description={A non-linear model that approximates \gls{yAi} using the feature vector \gls{bfeatAi} }]{yt}{\ensuremath{\yt(\bfeat)}} \glsxtrnewsymbol[description={A (non-)linear kernel computed between two structures or environments, represented by the corresponding feature vectors $\bfeat(A)$ }]{Kt}{\ensuremath{\krn(A,A')}} \glsxtrnewsymbol[description={A distance computed between two structures or environments }]{D}{\ensuremath{\dst(A,A')}} \glsxtrnewsymbol[description={Structure representation based on a smooth atom density }]{rrho}{\ensuremath{\rep|\rho>}} \glsxtrnewsymbol[description={Representation of an environment centered on atom $i$, that can be obtained by symmetrizing \gls{rrho} over translations }]{rrhoi}{\ensuremath{\rep|\rho_i>}} \glsxtrnewsymbol[description={Symmetrized $\nu$-point correlation of the atomic density built on the atom-centered representation \gls{rrhoi} }]{rrhoinu}{\ensuremath{\rep|\frho_i^\nu>}} \glsxtrnewsymbol[description={Dirac-$\delta$ limit of the smooth atom density \gls{rrho}. Analogous symmetrized versions are indicated as $\rep|\fdelta_i>$ and $\rep|\fdelta_i^\nu>$ }]{rdelta}{\ensuremath{\rep|\delta>}} \glsxtrnewsymbol[description={Atom-density field representation, suitable to describe long-range correlations}]{rv}{\ensuremath{\rep|V>}} \printunsrtglossary[type=symbols,style=long] \section{Representations for materials and molecules} \label{sec:history-wishes} Even though this review has no intention of providing an exhaustive historical account of the development of descriptors for atomic structures, it is worth providing a brief overview. A ``data-driven'' philosophy emerged early in the field of chemical and molecular science, where the combinatorial extent of the space of possible molecules,\cite{blum-reym09jacs} and the possibility of accessing this space with comparatively simple synthetic strategies, encouraged the development of quantitative structure/property relationships (QSPR) techniques, attempting to map\cite{kare00book} descriptors of molecular structure -- based on cheminformatics fingerprints,\cite{wein88jcim, Todeschini2010}chemical-intuition driven descriptors\cite{will+20jcim}, molecular graphs,\cite{schn-fech05nrdd} or indicators obtained from quantum chemical calculations\cite{kare+96cr} -- to the behavior of a selected compound, usually focusing on properties of direct applicative interest\cite{Gaulton2012, Sterling2015, Kim2016} such as solubility, toxicity,\cite{Wu2018} or pharmacological activity.\cite{obre+07jcim,Mysinger2012} \begin{figure}[tbp] \centering \includegraphics[width=1.0\linewidth]{fig1.pdf} \caption{A schematic overview of the requirements for an effective structural representation. The mapping between structures and feature space should obey fundamental physical symmetries (equivalent structures should be mapped to the same features); should be complete (inequivalent structures should be mapped to distinct features); should be smooth (continuous deformations of a structure should map to a smooth deformation of the associated features). Furthermore, whenever dealing with datasets that are not homogeneous in molecular size, the representation should be additive: a structure should be decomposed in a sum of local environments (usually atom-centered), ensuring transferability and extensivity of predictions. % } \label{fig:rep-wishes} \end{figure} \begin{figure*}[tbp] \centering \includegraphics[width=1.0\linewidth]{fig2.pdf} \caption{A phylogenetic tree of structural representations for materials and molecules. Arrows indicate the relationship between different groups of features. Lists of names, in gray, indicate the most common implementations for each class. Classes that appear as ``leaves'' of the tree are fully symmetric. \label{fig:tree} } \end{figure*} This approach should be contrasted with that of ``bottom-up'' predictions, that aim to use models of the interactions between the atomic constituents of a material to simulate the behavior of the system on an atomic time and length scale. Starting from the early days of molecular simulations\cite{jone24prsa,Alder1970, rahm-stil71jcp,car-parr85prl} the objective was to predict the energy, the forces, or any other observable of interest, for a specific molecular configuration, and use them to search for (meta-)stable configurations, or to simulate the evolution of the system by molecular dynamics\cite{alle-tild90book,fren-smit02book}. In the absence of reliable reference values for the properties of specific atomic configurations, interatomic potentials (also called empirical force fields) were built using physically-inspired functional forms, combining harmonic terms to describe chemical bonds with Coulomb and $1/r^6$ terms to describe electrostatics and dispersion. Their (few) parameters were determined by matching the values of experimental observables, such as cohesive energies, lattice vectors and elastic constants. The continuous increase in computational power, and the availability of electronic-structure techniques with a better cost-accuracy ratio\cite{parr-yang94book,burk12jcp,boot+13nature} has made it possible to compute extremely accurate energies and properties of specific configurations. This has opened the way to \emph{ab initio} simulations of materials\cite{car-parr85prl}, but also provided a viable alternative to empirical functional forms for the construction of interatomic potentials. Starting from the simplest compounds\cite{part-schw97jcp}, and then gradually increasing in complexity\cite{huan+05jcp}, molecular potential energy surfaces fitted by interpolating between a comparatively small number of \emph{ab initio} reference calculations provided the first practical applications of this idea. The possibility of combining very accurate calculations of the electronic structure of atomic systems with sampling of the statistics and dynamics of the nuclei on the electronic potential energy surface has allowed theoretical predictions that do not only agree with experimental results\cite{part-schw97jcp} -- they can predict experiments\cite{russ-mano96cpl} two decades before measurements become precise enough to verify the theoretical values.\cite{kim+15science} Even though the ultimate goal of QSPR models and machine-learned potentials is the same -- predicting scientifically and/or technologically relevant properties of molecules and materials -- the approaches they follow to achieve this goal are quite different, which is reflected in the way an atomic structure is translated into an input for a machine-learning model. Cheminformatics descriptors, or fingerprints, are built \textit{ad hoc}, incorporating both descriptors of molecular structure and composition, and easy-to-estimate molecular properties. They usually rely on a considerable amount of prior knowledge, are often system and problem specific, and are meant to label a compound rather than a specific configuration of its atoms. This is a logical consequence of the fact that QSPR aims for an end-to-end description of a thermodynamic property, which is not an attribute of an individual configuration, but of a thermodynamic state of matter. In the case of bottom-up modeling, instead, one aims first at building a very accurate surrogate model that is capable of reproducing precisely and inexpensively the outcome of quantum calculations for a specific configuration of the atoms. The end goal of predicting thermodynamic properties is achieved by coupling these prediction with statistical sampling methods\cite{alle-tild90book,fren-smit02book,tuck08book} aimed at computing averages over the appropriate classical (or quantum\cite{feyn-hibb65book,mark-ceri18nrc}) distribution of atomic configurations. As a consequence, the representations used as inputs of these surrogate quantum models are usually rather generic, constructed based exclusively on atomic coordinates and chemical species. They aim to establish a precise mapping between a specific structure and the associated atomic-scale quantities, and for this reason have also proven very useful to \emph{analyze} atomistic configurations\cite{sade+13jcp,de+16pccp,bern+19acie}, an application we discuss in detail in Section~\ref{sec:maps}. Even though we focus our discussion on this latter class of features, it is worth mentioning the recent, and rather successful, attempts to use descriptors that incorporate information from electronic-structure calculations, that we briefly summarize in Section~\ref{sub:electronic-structure-descriptors}. In the rest of this section, we discuss the properties that are desirable for a representation used in atomistic machine learning, which are graphically summarized in Figure~\ref{fig:rep-wishes}. The mapping between structures and features should be consistent with basic symmetries -- i.e. reflect the fact that the properties associated with a structure do not change when the reference system or the labelling of identical atoms are modified; be smooth, so that models built on the features inherit a regular behavior with changing atomic coordinates; be complete, so that fundamentally distinct configurations are never mapped to the same set of features. Furthermore, many machine-learning tasks benefit greatly from being based on \emph{local} features, which describe atoms or groups of atoms. Even though this is a less stringent requirement and, as we discuss below, global descriptors have been used very successfully, representations based on local environments are usually associated with higher transferability, reflecting a ``divide and conquer'' approach to materials modeling\cite{yang91prl,gall-parr92prl}. Finally, less fundamental but not less important requirements are the numerical stability and computational efficiency of the structure-representation mapping, which we discuss in Section~\ref{sec:efficiency}. \subsection{Symmetry} The Cartesian coordinates of the atoms encode all the information that is needed to reconstruct the geometry of a structure. Yet, it is obvious that they cannot be used directly as the input of a regression model. The fact that the Cartesian description of a molecule depends on its absolute position and orientation in space, and the order by which atoms are listed, means that configurations that are completely equivalent can be represented by many different Cartesian values, which makes any regression, classification or clustering scheme inefficient and potentially misleading. Over the years, many different approaches have been proposed by which translations, rotations, inversion and atom permutation symmetries can be enforced, which is reflected in the variety of alternative frameworks to achieve an effective representation to be used of the input of an atomistic machine-learning scheme. In fact, symmetry is such a central principle underpinning these efforts that it can be used to construct a ``phylogenetic tree'' of representations, organized according to the strategy that is used to incorporate symmetry in their construction, as shown in Figure~\ref{fig:tree}. The need to remove the trivial symmetries, namely the dependency of the Cartesian coordinates on the origin and orientation of the reference system, has been recognized very early in the field of chemical and materials modeling. Different sets of internal coordinates\cite{pula+79jacs} (bonds, angles, torsions) have been proposed, based on chemical intuition, as invariant descriptors of molecular geometry, and most of the molecular forcefields that have been so effective in the modeling of biological systems\cite{mayo+90jpc,vano+09jcc,halg96jcc,damm+97jcc} rely on internal coordinates to define bonded interactions. A collection of internal coordinates that is sufficient to fully characterize the geometry of a structure, often referred-to as the Z-matrix, is a paradigmatic example of this class of representations. Even though the efficiency of this approach has often been questioned\cite{bake-hehr91jcc,bake-chan96jcc}, particularly because there is no unique way to define the Z-matrix, internal coordinates are still ubiquitous, and are effective whenever the system being studied has a well-defined, persistent bonding pattern (see Ref.~\citenum{Harrison2018} for a recent review). In these cases, internal coordinates can be seen as the initial step in the construction of discretized molecular representations, such as a molecular graph. Even though very widely used in chemical machine learning\cite{duve+15nips,sanc-aspu18science}, these graph based schemes are not meant to describe the exact arrangement of the atoms, but just their bonding pattern, and so fall outside the scope of this review. The limitations of an internal-coordinates description become most apparent when one wants to model a chemically-active system, as the bonding patterns can change during the course of a simulation, and therefore the invariance to atom index permutations becomes crucial to achieve a consistent model. The Empirical Valence Bond (EVB) method\cite{kame-wars11wcms} has been used to simulate bond-breaking events, but the generality of the EVB approach is limited as the possible assignments need be pre-determined. This led to the development of representations that are intrinsically independent on the ordering of the atoms, such as permutation-invariant polynomials (PIPs)\cite{brow+04jcp,braa-bowm09irpc,bowm+10jpcl,xie-bowm10jctc,jian-guo13jcp} which are obtained by summing functions of the internal coordinates over all possible orderings. In their original implementation, the exponentially increasing cost of evaluating these sums limited their applicability to molecules with a small number of degrees of freedom. It is worth mentioning that the problem of fitting molecular potential energy surfaces, particularly for applications to gas-phase physical chemistry, has led to approaches that anticipate several of the ideas that have become central to modern machine-learning techniques: the need to symmetrize appropriately atomic structures,\cite{coll-pars93jcp} the systematic fitting to databases of configurations computed with high levels of quantum chemistry,\cite{part-schw97jcp} and even the use of ``neural network potentials'' \cite{blan+95jcp,gass+98jpca} are just a few examples of the pioneering contributions from this field. In the condensed phase, a similar pioneering role was played by the construction of systematic expansions of the potential energy of alloys\cite{sanc+84pa}, and of bond order potentials based on the moments of the density of states \cite{pett89prl,hors+96prb2,ozak+00prb}. Both anticipate the use of an atom-centered description of the energy, the role of symmetry, and the notion of building a systematic expansion of the target property in terms of a convergent hierarchy of terms of increasing complexity. The first successful attempt of explicitly bringing machine-learning ideas to the construction of interatomic potentials for condensed-phase materials can be attributed to Behler and Parrinello, who in Ref.~\citenum{behl-parr07prl} introduced the concept of atom-centered symmetry functions (ACSF), which rely on a local expansion of the energy and on the construction of a symmetric description of atomic environments. Similarly to PIPs, ACSF are translationally and rotationally invariant because they are functions of angles and distances, and permutationally invariant because they are summed over all possible atomic pairs and triplets within an atomic environment. The computational cost of ACSF is kept under control by restricting the range of interactions (which we discuss further in subsection~\ref{sub:locality}) and the body order of the correlations considered. Despite these restrictions, ACSF models have been shown to achieve comparable accuracy to that reached by PIPs\cite{nguy+18jcp}. Indeed, the recently proposed \emph{atomic PIPs}\cite{vand+20mlst} use the same polynomial basis as global PIPs, but avoid the unfavorable scaling with increasing molecule size by combining locality (via a distance cutoff) and a truncation of the order of the expansion. Internal coordinates are also the fundamental building block of molecular matrix representations, which are based on functions of the interatomic distances within a structure. Coulomb matrices, which list the formal electrostatic interactions $q_i q_j / r_{ji}$ between each atomic pair in a structure, have been extensively explored in early applications of the machine learning of molecular properties\cite{rupp+12prl}, with the main limitation being connected to the lack of permutation invariance\cite{mous12prl}, which has also been tackled by approximate symmetrization, summing over a manageable number of randomized orderings of the atoms\cite{mont+12nips,hans+13jctc}. We discuss alternative approaches to symmetrizing Coulomb matrices, as well as other representations based on molecular matrices, in Subsection~\ref{sub:smoothness}. The phylogenetic tree in Fig.~\ref{fig:tree} shows that a large number of existing representation take a different strategy to achieve symmetrization: rather than using internal coordinates that are inherently invariant to rotations and translations, they first -- implicitly or explicitly -- describe the system as an atom density $\sum_i g(\mbf{x}-\mbf{r}_i)$, obtained by summing over localized functions centered on the positions $\mbf{r}_i$ of all atoms in the system. Such a density is naturally invariant to permutations, and only at a later stage one proceeds to symmetrize it over translations and rotations. We discuss in great detail this second approach in Section~\ref{sec:symmetry-fields}. It suffices to say, at this point, that even if the construction of symmetrized density representations is conceptually very different from those based on internal coordinates, there are many direct and indirect links between the two branches, sketched in Figure~\ref{fig:tree}, which we will discuss when reviewing specific classes of representations. \subsection{Smoothness} \label{sub:smoothness} The overwhelming majority of atomic-scale properties are continuous, smooth functions of the atomic coordinates. Function regularity is crucial for creating efficient ML models, and is therefore one of the requirements for a good structural representation. Features constructed from a symmetrized atom density % are naturally smooth functions of atomic coordinates, and it is usually not a problem to maintain this regular behavior upon symmetrization over translations and rotations. The level of smoothness can be adjusted by smearing the atomic density, or by expanding it on a smooth basis (effectively a Fourier smoothing), as we discuss more extensively in Section~\ref{sec:symmetry-fields}. Internal coordinates are also usually smooth, but the process of manipulating them to achieve a permutation invariant representation can affect the smoothness of the mapping. % One way to obtain permutation invariance without incurring the exponential scaling of the cost associated with enumerating all possible permutations of atomic indices involves sorting the entries in a distance or Coulomb matrix\cite{mont+12nips,rupp+15jpcl}, an approach that has also been used with permutation invariant vectors (PIV)\cite{pipo+17prl}, ``bag of bonds'' features (BoB)\cite{hans+15jpcl}. Similar descriptors based on sorted distances have been also used to identify recurring structures in structure optimization algorithms\cite{vilh-hamm12prl,vilh-hamm14jcp}, and more recently generalized to lexicographically-sorted lists of $k$-neighbors distances\cite{chen+18jctc}. Computing the eigenvalues of (functions of) interatomic distances, which underlies the SPRINT method\cite{piet-andr11prl} as well the overlap matrix eigenvalue fingerprints\cite{sade+13jcp, zhu+16jcp}, also effectively achieves permutation invariance by similar means, since the vector of eigenvalues is taken to be sorted in ascending or descending order. The earliest implementation of the DeepMD scheme\cite{wang+18cpc} also relied on sorting a local distance matrix. However, the sorting operation introduces derivative discontinuities in the mapping between Cartesian coordinates and features, because the order of the distance vector changes as atoms are displaced in the structure. Figure~\ref{fig:3B_discont} illustrates the discontinuity of the derivatives of a function that is built from an ordered list of features. Consider a system of 3 atoms that is uniquely defined by the 3 interatomic distances $r_i$, where the index $i$ denotes the position of the interatomic distance $r_i$ in the ordered list of distances. We define a smooth function of the sorted distances, $f = \sum_i c_i \left(r_i-r_i^0 \right)^2$ parameterized by $\mathbf{c}$ and $\mathbf{r}^0$. The function $f$ is indeed invariant to the permutations of the atom order in the trimer, but at the price of introducing kinks in $f$ and discontinuities in its derivative when the distance ordering changes. Fitting any smooth function of the trimer geometry by optimizing the parameters $\mathbf{c}$ and $\mathbf{r}^0$ would necessarily lead to poor approximation accuracy. \begin{figure} \centering \includegraphics[width=0.9\linewidth]{fig3.pdf} \caption{Toy model demonstrating a non-smooth property (solid line) and its discontinuous derivative (dashed line) that are defined as functions of the ordered list of interatomic distances for a three-atom cluster. % } \label{fig:3B_discont} \end{figure} The lack of regularity has implications for the accuracy and stability of machine-learning models built on such features, as has been shown recently by using a Wasserstein metric to compare Coulomb matrices in a permutation-invariant manner\cite{cayl+20mlst}. In this context it is worth noting the remarkable connection linking the Euclidean distance between vectors of sorted distances and the Wasserstein distance between radial distribution functions (Section III.F in Ref.~\citenum{will+19jcp}), which builds a formal bridge between conceptually unrelated families of atomic-scale representations. \subsection{Locality and additivity} \label{sub:locality} The overwhelming majority of empirical interatomic potentials are expressed as an additive combination of local terms, or of long-range pairwise contributions. Early models built to fit molecular potential energy surfaces were built explicitly as a function of the coordinates of all atoms in the system.\cite{part-schw97jcp,isch-coll94jcp,ho-rabi96jcp} Besides the issues of computational cost, this approach is problematic, as it hinders the application of the potential to a molecule with a different number of atoms, or chemical composition. The work of Behler and Parrinello\cite{behl-parr07prl} did not only have the merit of emphasizing the importance of symmetries in atomistic machine learning, but it also applied to ML interatomic potentials an additive expansion of the molecular energy $E(A)$, writing it as a sum of atom-centered contributions, $E(A)\approx \sum_{i\in A} E(A_i)$. The notion of an additive decomposition of properties, which is implicit in the functional forms of most interatomic potentials, has far reaching consequences in terms of the data efficiency of the model, as discussed in Subsection~\ref{sub:feature-optimization}. Combined with the requirement that the atomic contributions only depend on the position of atoms within a finite range of distances, which is needed for the method to be computationally practical and is supported by fundamental physical principles\cite{prod-kohn05pnas}, the additivity assumption breaks down the problem of predicting the properties of a complex structure into simpler, short-range problems. An additive decomposition is also the most straightforward way to ensure extensivity of predictions\cite{jung+20csc}, i.e. that the prediction of a property for two copies of a molecule at infinite distance from each other is equal to twice the prediction for a single molecule. It is not by chance that also in the field of molecular machine learning, for which many of the early representations aimed at a \emph{global} description of a molecule\cite{rupp+12prl,fabe+15ijqc,huo-rupp17arxiv,stuk+19jcp}, most of the recent approaches have moved to additive, atom-centered representations\cite{fabe+18jcp,chri+20jcp}, that yield more accurate and transferable models, at least for extensive properties\cite{rama-vonl15cijc}. Oftentimes it is possible, and relatively straightforward, to modify a global representation to describe an atom-centered environment\cite{barr-kato13prb,sade+13jcp,vand+20mlst}, or to combine atom-centered representations to build a global description\cite{de+16pccp}, e.g. by summing or averaging the values of all the atom-centered features that are present in the structure, as we discuss in Section~\ref{sub:measuring-similarity}. In fact, one could regard the list of atom-centered features for all the atoms in a structure as an \emph{equivariant} global representation of the structure -- one in which the entries in the feature vector transform according to the permutation of the atomic indices. This notion underlies for instance the concept of self-attention\cite{zhen19jcim,shin2019self}, which has been very fruitfully applied in the construction of neural networks and models for cheminformatics. The connection between symmetry, locality, additivity, and the nature of the structure-property relation that one wants to model is essential to the construction of effective and transferable machine-learning models. \subsection{Completeness} The requirements of symmetry, smoothness and locality can be seen as geared towards reducing the complexity of the structural representation, eliminating redundant structures, reducing the resolution to the intrinsic length scale over which the target property exhibits substantial variations, and breaking down complicated compounds into simple fragments. This simplification should not, however, come at the expense of the completeness of the representation, meaning that the mapping between Cartesian and feature spaces should keep inequivalent structures distinct. For example, it has been known for some time that a histogram of interatomic distances (discarding the identity of the connected atoms) is insufficient to fully characterize a structure composed of more than three atoms\cite{bout-kemp04aam,bart+13prb,huan-vonl16jcp}. More recently, counterexamples have emerged showing that atom-centered correlations -- at least those of low order -- are also insufficient to preserve the injectivity of the structure-feature mapping (see Ref.~\citenum{pozd+20prl} and Section~\ref{sub:geo-completeness} for a more thorough discussion). Besides completeness in terms of the geometric structure-feature mapping, one should also consider whether \emph{for a chosen regression scheme} the feature-property mapping can be converged to arbitrary accuracy. More complex, non-linear models can often provide good results even when using a representation that involves excessive smoothing, or an highly truncated version of a family of features. The interplay between model and features is discussed in more detail in Section~\ref{sec:models}, and the (largely open) problem of completeness in Section~\ref{sec:incompleteness}. \section{Symmetrized atomic field representations}\label{sec:symmetry-fields} As discussed in the previous Section, a multitude of representations have been introduced over the past decade, attempting to incorporate basic principles of symmetry and locality at the very core of atomistic machine learning. The differences between them are much less fundamental than it appears at a first glance, and in fact several works have recently pointed at the existence of a unified framework, in which an explicit formal connection can be established between the vast majority of representations.\cite{will+18pccp, will+19jcp,drau19prb,Bachmayr2019} In this Section we summarize the construction of a class of features, that we refer to as ``symmetrized atomic field representations'', emphasizing the role played by symmetry and locality, as well as hint to the connection between this class of features and a linear mapping between structure and properties, which is discussed in more detail in Section~\ref{sec:models}. \subsection{Dirac notation for atomic representations} \label{sub:bra-ket} We formalize a notation, that extends the one introduced in Refs.~\citenum{will+18pccp,will+19jcp} and used in Ref.~\citenum{langer2020arxiv} to compare different kinds of local and global representations, which expresses the feature vectors associated with the representation of a structure in a way that mimics Dirac notation in quantum mechanics. At the most basic level, this notation can be seen as a way to indicate expressively the nature of the representation used, and to tidily enumerate the components of the associated feature vector. Much like in the quantum case, the real value of the formalism is that it emphasizes the basis-set independence of the class of representations we concentrate on, and that it provides visual cues that help recognizing at a glance the linear operations that occur in the construction and manipulation of the feature vectors, and of the models built on them.\footnote{To facilitate the use of this notation in \LaTeX documents, we provide a set of macros at \url{https://github.com/cosmo-epfl/cosmo-tools/tree/master/tex/dirac-rep}} We will use this notation consistently throughout this review as a neutral medium to express general results that reflect concepts shared by many of the most widespread representation, but occasionally make a link to the different notations that have become established to describe specific frameworks. \begin{figure}[tbp] \centering \includegraphics{fig4.pdf} \caption{Top: overview of the notation we use to indicate the features that represent an atomistic structure; bottom: summary of the steps in a symmetrized field construction. } \label{fig:fields} \end{figure} \paragraph*{Representations in bra-ket notation} We use a ket $\rep|A>$ to indicate an abstract feature vector associated with a structure $A$, and -- when necessary -- complement the indication of the structure with one or more symbols and indices (e.g. $\rep|A;\alpha>$) that describe the nature of the representation. These indices might specify the portion of the structure the representation refers to, its symmetry properties, or serve as a reminder of the way the representation was constructed. When we need to explicitly enumerate the elements of the feature vector, we use one or more indices in the bra, leading to expressions of the form $\rep<\Q||A>$. In this review, we use $\Q$ to indicate a generic continuous index, and $\q$ to indicate a discrete feature index. Both the ket and the bra indices can (and will) be used with some looseness, to emphasize the most relevant elements of a representation while keeping the notation slim. For instance, as shown in Fig.~\ref{fig:fields}, one can indicate explicitly multiple bra indices when their meaning in the definition of a representation is important, separating with a semicolon groups of indices that are conceptually related, or condense them in a compound index when the substructure is irrelevant. Occasionally, e.g. when juxtaposing different choices of basis functions, one may also include qualifiers in the bra, e.g. $\rep<n; \text{GTO}|$ to indicate that Gaussian type orbitals are used as a basis. Moreover, when discussing the construction of a representation, the reference structure is not important, and so one may drop the structure index from the notation and write $\rep|\alpha>$ instead of $\rep|A; \alpha>$. Conversely, when the representation of choice is well-established -- e.g. when writing expressions that describe the regression scheme after having discussed the choice of representation -- one may omit the specifics of the representation and write simply $\rep|A>$. The indices and the qualifiers that are associated with the structure index (typically in the ket) describe the essential nature of the representation and will be reflected in the architecture of a model built on it. The indices in the bra, instead, simply enumerate features that are of homogeneous nature, are usually manipulated together in the construction of the model, and can be transformed, contracted or sub-selected in a way that does not change the fundamental properties of the representation. In many cases, it is possible to describe the construction of a representation as a combination of kets, without indicating explicitly the use of a particular basis. This notation can be applied in a way that yields usage patterns that are very similar to those that are common in quantum mechanics, e.g. bra and ket can be interchanged using the convention $\rep<A||\Q> = \rep<\Q||A>^\star$. However, much as in the case of the formalism we take inspiration from, a rigorous characterization of the mathematical relations between bras and kets is problematic\cite{gier00rpp}. It is better to see this notation as a form of symbolic calculus that facilitates memorizing and applying correctly recurring operations and transformations. Let us give a few examples, which also provide a reference of how the notation will be applied in this review. \paragraph*{Change of basis.} A change in the basis that is used to practically compute a representation can be written as a linear transformation, \begin{equation} \rep<T||A> = \int \D{\Q} \rep<T||\Q> \rep<\Q||A>, \end{equation} where $\rep<T||\Q>$ indicates the coefficients that enact the change of basis. This kind of manipulations will be used in Section~\ref{sub:lm-rep} to convert between a real-space description of the atom-centred density and one based on radial functions and spherical harmonics.\footnote{Note that, much as it is the case in quantum chemistry, non-orthogonal bases introduce some ambiguity in the bra-ket notation, because the coefficients in the expansion of a function in the basis differ from the scalar product between the basis and the function -- the two being related by the overlap matrix of the basis. The notation should be treated with some care when translating it into a practical implementation if the basis used is not orthonormal.} All of the expressions discussed here as integrals over a continuous index can be formulated as sums over (finitely or infinitely) countable, discrete indices \begin{equation} \int \D{\Q} \rep|\Q>\rep<\Q| \sim \sum_\q \rep|\q>\rep<\q|. \end{equation} \begin{figure*}[tbp] \centering \includegraphics[width=0.9\linewidth]{fig5.pdf} \caption{To obtain features that are invariant to inversion with respect to the vertical dotted line, Haar integration over the symmetry group in this case just corresponds to summing over two symmetry related images. Starting from two distinct functions $\rep|f>$ (left panels, red) and $\rep|g>$ (right panels, blue), the functions (full lines) and their mirror transformation (dotted lines) are summed to obtain invariant features (bottom row). Direct symmetrization is depicted in the central panels, yielding $\rep|\field{f}^1>$, while the external panels visualize the construction of tensor-product features, their symmetrization and summation, yielding $\rep|\field{f}^2>$. } \label{fig:inversion_invariance} \end{figure*} \paragraph*{Scalar product and kernels.} The scalar product between the features of two structures $A$ and $A'$ can be written using a complete basis indexed by $Q$ as \begin{equation} \rep<A||A'> = \int \D{\Q} \rep<A||\Q> \rep<\Q||A'>, \end{equation} where one recognizes an expression that is reminiscent of a completeness relation $\int \D{\Q} \rep|\Q>\rep<\Q| = 1 $. This definition only holds for a complete, orthogonal basis and might entail an approximation when computed with a finite basis. The notation $\rep<A||A'>$ can also be used to refer to a kernel $\krn(A,A')$ that expresses the similarity between two configurations; this is obvious when considering a linear kernel, but can also be used for non-linear kernels, keeping in mind that it might not be possible to write explicitly the features that correspond to the Hilbert space that reproduces the kernel.\cite{aron50tams} \paragraph*{Linear models.} The bra-ket notation implicitly assumes linearity in the transformation between different choices of basis, and in the modeling of target properties. Even though the features can be used as an input of an arbitrarily complex nonlinear regression scheme (see Section~\ref{sub:non-linear-model}), we will often investigate their behavior in the context of linear models, because they reveal more transparently how a given representation reflects structure-property relations. When using a representation $\rep|A; \alpha>$ to describe structures, a linear model for a property $\y(A)$ can be written as \begin{equation} \y(A) \equiv \rep<\y||A> \approx \int \D{\Q} \rep<\y; \alpha||\Q> \rep<\Q||A; \alpha>, \label{eq:dirac-lr} \end{equation} where $\rep<\y; \alpha||\Q>$ indicates the regression weights for a model based on $\rep|A; \alpha>$. Leaving aside (important) issues related to regularization, this expression emphasizes that one can transform simultaneously the weights and the features to a different basis, and the predicted value is unchanged. The expression $\rep<\y||A>$ can also be seen as a hint of the fact that a collection of properties could be used as descriptors for a structure $A$, although this is an approach we only discuss briefly in this review. \paragraph*{Tensor product.} A pattern we use frequently in what follows, and that mimics a construction used in quantum mechanics, is the combination of multiple kets to build a tensor-product space, e.g. \begin{equation} \rep|(A; \alpha) \otimes (A'; \alpha')> = \rep|A; \alpha> \otimes \rep|A'; \alpha'>. \label{eq:dirac-tensorproduct} \end{equation} The construction of a tensor-product representation is well-defined even without indicating explicitly the basis used to describe either side of Eq.~\eqref{eq:dirac-tensorproduct}, and it is often possible to use either an explicit Cartesian product of the bases on the right-hand side, or a combined basis \begin{equation} \rep<\Q_1; \Q_2||A\otimes A> \equiv \rep<\Q_1||A> \rep<\Q_2||A> \rightarrow \rep<T||A\otimes A>, \label{eq:dirac-tensorproduct-bras} \end{equation} using only $\rep|A>$ as a special case of Eq.~\eqref{eq:dirac-tensorproduct} in which $A\equiv A'$, and $\alpha\equiv \alpha'$ can be omitted. \paragraph*{Operators and symmetry averages.} Finally, we can consider the action of an ``operator'' on a ket, that is to be interpreted as a linear map that transforms the atomic structure. Taking for instance the operator $\hat{i}$ associated with inversion symmetry, $\hat{i}\rep|A>$ indicates the representation associated with structure $A$ after the coordinates of all atoms have been reflected relative to the origin. Much as in quantum mechanics, the operator can also be applied to the bra, where it corresponds to a transformation of the basis. In terms of symmetry operations, this corresponds to the active or passive transformations, acting on the structure or on the reference frame. By summing over the operators associated with a symmetry group, an operation which is also referred to as Haar integration\cite{nachbin1976haar}, one can build symmetrized representations that are covariant under the actions of the elements of the group, e.g. for the $C_i$ point group, \begin{equation} \rep|\ev{A\otimes A}_{C_i}; \sigma> = \rep|A>\otimes \rep|A> + \sigma ( \hat{i}\rep|A>\otimes \hat{i}\rep|A> ). \end{equation} The index $\sigma$ takes the value $-1$ for representations that change sign under inversion, and $+1$ for invariant features; in the invariant case, $\sigma$ may be omitted. When the resulting symmetric representation is used often, and the symmetry group is clear from the context, we indicate the averaging with an overline and omit the explicit indication of the group it has been symmetrized over, e.g., $\rep|\ev*{A\otimes A}_{C_i}>\rightarrow\rep|\field{A}[A]>\rightarrow\rep|\field{A}^2>$. Figure~\ref{fig:inversion_invariance} illustrates the notation and the Haar integration in one dimension. Two distinct functions, $f$ and $g$ are plotted using their usual real-space features, $f(x) \equiv \rep<x || f >$ and $g(x) \equiv \rep< x || g>$. Applying inversion yields $\rep<x|\hat{i}\rep|f> = f(-x)$. An inversion-invariant feature can be created by symmetrizing: $\rep|\field{f}^1> = \rep|f> + \hat{i} \rep|f>$, but our choice of $f$ and $g$ leads to a degenerate description, as $\rep|\field{f}^1>=\rep|\field{g}^1>$. A second order feature may be obtained by generating the tensor product of the functions, e.g. $\rep|f> \otimes \rep|f> $, which in real space results in $\rep<x_1;x_2 || f \otimes f > \equiv f(x_1) f(x_2)$. Symmetrizing this tensor product yields features $\rep|\field{g}^2>$ and $\rep|\field{f}^2>$ that are also inversion-invariant, but are still able to distinguish between the two functions. \paragraph*{An example: SOAP in bra-ket notation} To give a concrete example of the use of this formalism, let us compare the functional notation used in Refs.~\citenum{de+16pccp,bart+13prb} to indicate the components of a SOAP feature vector with the corresponding bra-ket notation. The reader who is unfamiliar with the SOAP construction will find the remainder of this Section, and in particular Section~\ref{sub:lm-rep}, to give a very detailed account of this family of features, and might better skip this brief overview, that assumes knowledge of the derivation from Ref.~\citenum{bart+13prb}. The SOAP power spectrum describes the two-point correlations between the atom density centered around the $i$-th atom of structure $A$, expanded in terms of atomic species (labeled by the indices $\e_{1,2}$), radial basis functions (labeled by $n_{1,2}$) and angular momentum channels (labeled by $l$). The density expansion coefficients can be written as \begin{equation} \begin{split} \rep<\enlm||A; \rho_i> =& \int \D{\mbf{x}} \rep<n||x> \rep<lm||\hat{\mbf{x}}> \rep<\ex||A; \frho_i> \\ &\hfill \rotatebox{90}{$\;\equiv\;$} \hfill \\ c^{i,\e}_{\nlm} = & \int\D{\mbf{x}} R_n(x)^\star Y^m_l(\hat{\mbf{x}})^\star \rho_i^\e(\mbf{x}). \end{split} \end{equation} In this expression, $\rep<\ex||A; \frho_i>\equiv \rho^{i,\e}(\mbf{x})$ indicates the atom-centred density, $\rep<x||n>\equiv R_n(x)$ an orthonormal set of radial functions, and $\bra{\hat{\mbf{x}}}\ket{lm}\equiv Y^m_l(\hat{\mbf{x}})$ the spherical harmonics. The SOAP features for the environment $A_i$ can be written as \begin{multline} \rep<a_1 n_1; a_2 n_2; l||A; \frho_i^2> \propto \hfill \quad\\ \sum_m \rep<A; \rho_i||\en_2 l m >\rep<\en_1 l m||A; \rho_i> \\ \hfill \rotatebox{90}{$\;\equiv\;$} \hfill \\ p^{i,a_1a_2}_{n_1 n_2 l} \propto \sum_m c^{i,\e_1}_{n_1 lm} (c^{i,\e_2}_{n_2 lm})^\star. \label{eq:dirac-soap} \end{multline} In the functional notation, one relies on the convention that $c$ corresponds to the density expansion coefficients and $p$ to the power spectrum, while the Dirac notation uses the more expressive symbols $\rho_i$ to indicate the $i$-centered atom density, and $\frho_i^2$ as a reminder that SOAP features can be derived as a symmetry-averaged 2-point correlation of $\rep|\rho_i>$. This expanded notation is indicative of the place of the SOAP powerspectrum in the hierarchy of density-correlation features, and is useful to distinguish between different kinds of features (radial correlations, power spectrum, bispectrum \ldots). When it is clear that one is only using one type of representation, the compact (and generic) form $\rep|A_i>$ can be used instead. When it comes to the indices labelling different features, the functional notation mixes the indices ($\e$) associated with the chemical species of the neighbors and the index $i$ of the central atom, separating them from those associated with the radial channel ($n$). This reflects how SOAP was originally introduced to describe single-element systems. In the Dirac notation, on the other hand, the $(\en_1)$ and $(\en_2)$ indices are grouped together to indicate that they are conceptually linked in the construction as a tensor product of two densities, and the index indicating the identity of the central atom is associated with the ket. \subsection{Global field representations} The starting point for the construction of a symmetry-adapted field representation is a field that describes the structure in terms of the distribution of its atoms -- or, more generally, of points that are associated with the building blocks of the material, as one would have in a coarse-grained model. In the simplest possible case, one would take localized functions $g$ centered on each atomic position $\mbf{r}_i$ and define \begin{equation} \rep<\mbf{x}||A;\frho> \equiv \sum_{i\in A} \rep<\mbf{x}||\mbf{r}_i; g>, \label{eq:a-rho-simple} \end{equation} where $\rep<\mbf{x}||\mbf{r}_i; g>\equiv g(\mbf{x}-\mbf{r}_i)$ is a localized function (e.g. a Gaussian) centered on the $i$-th atom, and the $\rho$ in the ket indicates the kind of field used to describe the structure. As we discuss in more detail in Section~\ref{sub:lm-rep}, the atomic density functions can be either finite-width Gaussians, which leads to representations akin to SOAP features\cite{bart+13prb}, or Dirac $\delta$ distributions, which recovers representations similar to the current implementation of moment tensor potentials\cite{shap16mms} or the atomic cluster expansion\cite{drau19prb}. To indicate the $g\rightarrow\delta$ limit, we use the notation $\rep|\rho>\rightarrow\rep|\delta>$. Atoms, or more generally, ``point particles'' such as those one could associate to a coarse grained description of a molecular system, can be further characterized by internal attributes, that could be discrete (e.g. the chemical nature of an atom, or a molecule, which we indicate as $\e_i$) or continuous (e.g. an atomic or molecular dipole $\mbf{u}_i$) \begin{equation} \rep<\e\mbf{u}\mbf{x}||A; \field{\rho u}> \equiv \sum_{i\in A} \delta_{\e \e_i} \rep<\mbf{u}||\mbf{u}_i; g> \rep<\mbf{x}||\mbf{r}_i; g>.\label{eq:a-rho-messy} \end{equation} In this form, Eq.~\eqref{eq:a-rho-messy} can be seen as an abstraction of the many real-space ``voxel'' representations of materials,\cite{kaji+17sr,Noh2019} that are used often in the context of generative models and reinforcement learning\cite{chri+20jcp2}. The ket $\rep|A; \rho>$ defined by expressions like~\eqref{eq:a-rho-simple} or~\eqref{eq:a-rho-messy} could be equally well expressed in a different basis, e.g. expanded in plane waves \begin{equation} \rep<\mbf{k}||A; \rho> =\frac{1}{(2\pi)^{3/2}} \int\D{\mbf{x}} e^{-\ensuremath{\mathrm{i}} \mbf{k}\cdot\mbf{x}} \rep<\mbf{x}||A; \rho> =\sum_{i\in A} \rep<\mbf{k} || \mbf{r}_i; g>, \label{eq:a-rho-k} \end{equation} which also shows how the change of basis can be applied directly to the atom-centred density contributions. Eqs.~\eqref{eq:a-rho-simple} and~\eqref{eq:a-rho-k} contain the same amount of information, and can be seen as special cases of a formal definition of the representation for the structure $A$ as a sum of atomic representations, \begin{equation} \rep|A; \rho> =\sum_{i\in A} \rep| \mbf{r}_i; g>. \label{eq:a-rho-formal} \end{equation} Even though the choice of a basis can be very important to simplify analytical derivations or practical implementation, representations can be regarded as abstract objects that can be defined independently of the basis set, much as it is the case for the wavefunction in quantum mechanics. \subsection{Translational invariance and atom-centered features}\label{sub:translational-sym} One way to make $\rep<\mbf{x}||\rho>$ translationally invariant is to sum over the continuous translation group, $\int\D{\hat{t}}\rep<\mbf{x}|\hat{t}\rep|\rho>$. Summing directly over the atom density eliminates all structural information, because $\int\D{\hat{t}}\rep<\mbf{x}|\hat{t}\rep|\mbf{r}_i; g>= \int \D{\mbf{t}} g(\mbf{t}-\mbf{r}_i)=1$. Information loss is a usual issue with Haar integration, as exemplified in Figure~\ref{fig:inversion_invariance}. One can avoid or reduce it by summing over \emph{tensor products} of the atom density field. Considering the case in which atoms are described only by their position and chemical identity, integrating over translations $\hat{t}$ yields a two-point density correlation function \begin{multline} \rep<\ex_1; \ex_2||\ev*{\rho\otimes \rho}_{{\mathbb{R}^3}}> \equiv \rep<\ex_1; \ex_2||\frho^2> \\ = \int \D{\hat{t}} \rep<\ex_1|\hat{t}\rep|\frho> \rep<\ex_2|\hat{t}\rep|\frho>\\ = \sum_{ij} \delta_{\e_1\e_j} \delta_{\e_2\e_i} \int \D{\hat{t}} \rep<\mbf{x}_1 - \mbf{t}||\mbf{r}_j; g> \rep<\mbf{x}_2 - \mbf{t}||\mbf{r}_i ; g> \\ \propto \sum_{ij} \delta_{\e_1\e_j} \delta_{\e_2\e_i} \rep<(\mbf{x}_1-\mbf{x}_2)|| (\mbf{r}_j-\mbf{r}_i); \tilde{g}> \label{eq:rho2t} \end{multline} where $\tilde{g}$ indicates the cross-correlation of two of the localized density functions. In the case of a Gaussian density, $\tilde{g}$ is simply a Gaussian with twice the variance, and outside this section we will use just $g$ to indicate the atomic density both in $\rep|\rho>$ and $\rep|\rho_i>$. As a remindet that the representation has been obtained by averaging over translations the tensor product of two density fields, we use the superscript notation $\frho^2$, and we separate with a semicolon groups of feature indices that are associated with each factor in the tensor product, as discussed in Section~\ref{sub:bra-ket}. Note that the representation in Eq.~\eqref{eq:rho2t} has a large null space, as it depends only on $\mbf{x}_1-\mbf{x}_2$. One could then re-define it by labelling features using a single position vector, or transform it in a plane wave basis: \begin{multline} \rep<\e_1; \e_2; \mbf{k}||\frho^2> = \int \D{\mbf{x}} e^{-\ensuremath{\mathrm{i}}\mbf{k}\cdot\mbf{x}} \rep<\e_1 \mbf{0}; \e_2 \mbf{x}||\frho^2>\\ = \rep<\e_1 \mbf{k}||\rho>^\star \rep<\e_2 \mbf{k}||\rho> \end{multline} where the second equality is a consequence of the convolution theorem. One sees that the translationally-symmetrized density is essentially equivalent to the diffraction pattern of the atomic structure $I(\mathbf{k})$, that has been already used as a descriptor to classify crystalline configurations.\cite{zile+18nc} This construction can be taken as an inspiration to introduce an atom-centered representation \begin{equation} \rep<\ex||A;\frho_i> = \sum_{j\in A} \delta_{\e\e_j} \rep<\mbf{x} ||\mbf{r}_{ji};\tilde{g}>, \label{eq:rhoi-ket} \end{equation} where $\mbf{r}_{ji}=\mbf{r}_j -\mbf{r}_i$. The fact that $\rep|A;\frho_i>$ is atom centered (and hence translationally invariant) is hinted at by the subscript notation $\frho_i$, and so in what follows we only use this subscript to distinguish it from its non-symmetrized counterpart~\eqref{eq:a-rho-simple} and simultaneously to indicate the central atom index. When expressing a representation centered around atom $i$ without emphasis on its precise nature, we will use the notation $\rep|A_i>$. % Writing the symmetrized two-point density correlation in terms of Eq.~\eqref{eq:rhoi-ket} clarifies how an atom-centered representation is a natural consequence of the translational symmetrization: \begin{equation} \rep<\ex_1; \ex_2||A;\frho^2> = \sum_{i \in A} \delta_{\e_2\e_i} \rep<\e_1 (\mbf{x}_1-\mbf{x}_2)||A;\frho_i>. \label{eq:additive-rho2} \end{equation} When building a linear model, this expression implies an additive decomposition of the target property, as well as the use of separate models depending on the nature of the central atomic species: \begin{equation} \begin{split} \rep<\y||A> \approx & \sum_{i\in A} \rep<\y; \e_i||A_i> \\ &= \sum_{i\in A} \sum_{\e} \int \D{\mbf{x}} \rep<\y; \e_i||\ex> \rep<\ex||A;\frho_i>. \end{split} \end{equation} Note that in this case we assume that only the regression weights depend on the nature of the central atom, but one might as well fine-tune the atom-centred features depending on the central atom. As discussed in Section~\ref{sub:linear-models}, this expression can be taken as the prototype of all pair potentials, and higher-order of many-body interaction can be incorporated by taking higher tensor powers before symmetrization, or in the subsequent step of rotational averaging. Localization can be enforced by introducing a cutoff function in the definition~\eqref{eq:rhoi-ket}. This is far from being an inconsequential operation, as it introduces an error: atomic energies and properties cannot depend on neighbors farther than this limit, as one can measure in terms of the locality of the response of forces to atomic displacements of neighbors\cite{deri-csan17prb}. However, introducing a relatively short-range cutoff often results in more robust models, which perform better in the data-poor regime. We discuss this in more detail in Section~\ref{sub:feature-optimization}. \subsection{Rotational invariance and body-ordered representations} \label{sub:body-order-representations} The atom-centered representation~\eqref{eq:rhoi-ket} is translationally invariant, but does depend on the orientation of the structure. One should then proceed to perform Haar integration over the rotation group and (possibly) over inversion. \begin{figure} \centering \includegraphics[width=1.0\linewidth]{fig6.pdf} \caption{Graphical scheme of the construction of a ${SO(3)}$-symmetrized tensor product representation. Copies of the atom-centered density are evaluated at $\nu$ separate points, and the tensor product is averaged by simultaneously rotating all densities. } \label{fig:rho-average} \end{figure} We can define the ($\nu+1$)-body order symmetrized field representation as \begin{multline}\label{eq:body-order} \rep|\frho_i^{\nu}> \equiv \rep|\ev*{\underbrace{\rho_i\otimes\cdots\otimes\rho_i}_{\nu\ \text{times}} }_{O(3)} > \\= \sum_{k=0,1}\int_{{SO(3)}}\hspace{-4mm}\D{\hat{R}}\, \hat{i}^k\hat{R}\rep|\frho_i> \otimes\ldots\otimes \hat{i}^k\hat{R}\rep|\frho_i>. \end{multline} This can be expanded on an explicit position basis \begin{multline}\label{eq:body-order-x} \rep<\ex_1; \ldots \ex_{\nu}||\frho_i^{\nu}> \\ =\sum_{k=0,1}\int_{{SO(3)}} \hspace{-4mm}\D{\hat{R}} \rep<\ex_1|\hat{i}^k\hat{R}\rep|\frho_i> \ldots \rep<\ex_{\nu}|\hat{i}^k\hat{R}\rep|\frho_i>, \end{multline} emphasizing that $\rep|\frho_i^\nu>$ corresponds to a symmetrized, $\nu$-point correlation of the atom density centered on the $i$-th atom (Fig. \ref{fig:rho-average}) -- a $(\nu+1)$-point correlation function, in the language used in statistical mechanics to describe the structure of liquids\cite{ande-chan72jcp,chan87book}. Similar to the case of Eq.~\eqref{eq:rho2t}, this object has a large null space (e.g. in the $\nu=1$ case it only depends on $x_1=\left|\mbf{x}_1\right|$). As discussed in Ref.~\citenum{will+19jcp}, one can choose a more concise enumeration of the real-space correlations in terms of distances and angles, that reduces in the limit $g \to \delta$ to a sum over distances and angles between atoms. For instance, for the $\nu=2$ case one can write \begin{multline} \rep<\e_1 r_1; \e_2 r_2; \omega||\fdelta_i^2> \\ \propto \sum_{jj'} \delta_{\e_1 \e_j} \delta_{\e_2 \e_{j'}} \delta(r_1 - r_{ji}) \delta(r_2 - r_{j'i}) \delta(\omega - \hat{\mbf{r}}_{ji}\cdot\hat{\mbf{r}}_{j'i}), \label{eq:rho2-delta} \end{multline} where we use $\rho\rightarrow \delta$ to indicate that the correlation function is built on the Dirac-$\delta$ limit of the atom density field. Expressions of this kind reveal the close connection between symmetrized-field representations and atom-centered symmetry functions\cite{behl-parr07prl,behl11jcp,smit+17cs}, as well as equivalent constructions such as those used in the ANI\cite{smit+17cs} and DeepMD\cite{zhan+18prl} frameworks, and the FCHL features\cite{fabe+18jcp,chri+20jcp}. Features that describe a chemical environment are written as a sum over tuples of neighbors of appropriate functions of their distances and angles, and can be seen as just a different choice of basis set for Eq.~\eqref{eq:rho2-delta} \begin{multline} \rep<\e_1\e_2 k||\fdelta_i^2> = \int \D{r_1}\D{r_2}\D\omega \\ \times \rep<k; G^3||r_1 r_2 \omega> \rep<\e_1 r_1; \e_2 r_2; \omega||\fdelta_i^2>\\ \hfill \rotatebox{90}{$\;\equiv\;$} \hfill \\ \sum_{jj'} \delta_{\e_1 \e_j} \delta_{\e_2 \e_{j'}} G^3_k(r_{ji}, r_{j'i}, \hat{\mbf{r}}_{ji}\cdot\hat{\mbf{r}}_{j'i}), \label{eq:rho2-g3} \end{multline} that demonstrates the connection between density correlations and atom-centered symmetry functions computed as a sum over groups of neighbors following the notation used in Ref.~\citenum{behl11jcp}. Note that we choose to symmetrize the atom-centered description $\rep|\frho_i>$ -- given that this is the procedure that recovers most of the existing representations -- but one could as well proceed by averaging over tensor products of the translationally invariant representation of the full structure $\rep|\frho^2>$ \begin{multline}\label{eq:global-rot-rep} \rep|\ev*{ \ev*{\rho\otimes\rho}_{\mathbb{R}^3} \otimes \ev*{\rho\otimes\rho}_{\mathbb{R}^3}}_{SO(3)} >\sim\\ \int_{{SO(3)}}\hspace{-4mm}\D{\hat{R}}\, \sum_{ii'} \hat{R}\rep|\frho_i> \otimes \hat{R}\rep|\rho_{i'}>, \end{multline} as it was done for instance in Ref.~\citenum{mavr+18jpcl}. Doing so results in the appearance of cross terms involving correlations between densities centered on different atoms, which could be used to systematically incorporate in this framework machine-learning approaches based on convolutional, and message-passing, neural networks that combine information centered on neighboring atoms.\cite{schu+18jcp,ande+19nips} \subsection{Density correlations in an angular momentum basis} \label{sub:lm-rep} More concise (and easier to evaluate) expressions for the density correlation representations can be obtained with a change of basis. Using orthonormal radial functions $R_n(x)\equiv \bra{x}\ket{n}$ and spherical harmonics $Y^m_l(\hat{\mbf{x}})\equiv \bra{\hat{\mbf{x}}}\ket{lm}$ yields a discrete set of coefficients that transform as spherical harmonics \begin{multline} \rep<\enlm||A; \frho_i> = \int \D{\mbf{x}} \rep<n||x> \rep<lm||\hat{\mbf{x}}> \rep<\ex||A; \frho_i>\\ = \sum_{j\in A_i} \delta_{aa_j} \int \D{\mbf{x}} \rep<n||x> \rep<lm||\hat{\mbf{x}}> \rep<x\hat{\mbf{x}}||\mbf{r}_{ji}; g>\\ =\sum_{j\in A_i} \delta_{aa_j} \rep<nlm||\mbf{r}_{ji}; g>, \label{eq:density-nlm} \end{multline} where $\rep<nlm||\mbf{r}_{ji}; g>$ corresponds to the expansion in radial functions and spherical harmonics of a Gaussian centered on the interatomic vector $\mbf{r}_{ji}$. These expansion coefficients can be seen as functions of $\mbf{r}_{ji}$, enumerated by the indices $(n,l,m)$, that can be evaluated numerically or analytically, depending on the choice of basis (see Section~\ref{sub:implementation} for a few examples). The use of spherical harmonics $\rep|lm>$ for the angular basis is natural, and makes it easy to evaluate the rotational integral of \cref{eq:body-order} analytically, because the matrix elements $\mel{lm}{\hat{R}}{l'm'}=\delta_{ll'}D^l_{m'm}(\hat{R})$ correspond to Wigner-D matrices, an irreducible representation of ${SO(3)}$. Well-known results from the theory of angular momentum,\cite{Thompson2004} such as the orthonormality and the product reduction formula for Wigner-$D$ matrices, allow deriving explicit expressions for the symmetrized field representations of order $\nu=1,2,3$ \begin{equation} \rep<\enlm_1||\frho_i^1> = \frac{8\pi^2}{2l_1+1} \rep<\enlm_1||\frho_i> \delta_{l_10}\delta_{m_10} \label{eq:nu1-basis-uncoupled} \end{equation} \begin{multline} \rep<\enlm_1;\enlm_2||\frho_i^2> = \delta_{l_1l_2}\delta_{m_1m_2}\frac{8\pi^2}{2l_1+1} \\ \sum_s (-1)^{s-m1} \rep<\enl_1 s||\frho_i> \rep<\enl_2 (-s)||\frho_i>, \label{eq:nu2-basis-uncoupled} \end{multline} \begin{multline} \rep<\enlm_1; \enlm_2; \enlm_3||\frho_i^3> = \\ \frac{8\pi^2}{2l_1+1} (-1)^{-m_1} \cg{\lm_2}{\lm_3}{l_1(-m_1)}\\ \sum_{s_1 s_2 s_3} (-1)^{-s_1} \cg{l_2 s_2}{l_3s_3}{l_1 (-s_1)} \rep<\enl_1 s_1||\frho_1> \\ \rep<\enl_2 s_2||\frho_2> \rep<\enl_3 s_3||\frho_3>, \label{eq:nu3-basis-uncoupled} \end{multline} where $\cg{\lm_1}{\lm_2}{LM}$ is a Clebsch–Gordan coefficient. Much as it was the case for the real-space versions of the density correlation representations, there are several redundant indices in these expressions, resulting from the rotational averaging that leaves some of the $m_i$ as free parameters. We can then re-label the invariant features, in a way that emphasizes the connection to existing representations, by coupling the angular basis and absorbing some of the inconsequential constant factors. For the case $\nu=1$ one can define \begin{equation} \rep<\en||\frho_i^1>=\rep<\e n 0 0||\frho_i> \label{eq:nu1-basis-coupled} \end{equation} which corresponds to a discretized version of a pair correlation function \begin{multline} \rep<\en||\frho_i^1> = \int \D{\mbf{x}} \rep<n||x> \rep<00||\hat{\mbf{x}}> \rep<\e (x\hat{\mbf{x}})||\frho_i> \\ \propto \int \D{x} x^2 \rep<n||x> \int \D{\hat{\mbf{x}}} \rep<\e (x\hat{\mbf{x}})||\frho_i>\\ \sim \int \D{r} r^2 R_n(r)^\star g_{\e}(r), \end{multline} in which we use the usual notation $g_{\e}(r)$ to indicate the distribution of $\e$ atoms (although in this case it is restricted to an $i$-centered environment rather than averaged over an equilibrium distribution). For the $\nu=2$ case, \cref{eq:nu2-basis-uncoupled} can be redefined as \begin{multline} \rep<\ennl||\frho_i^2> = \frac{(-1)^l}{\sqrt{2l+1}} \\ \sum_m (-1)^m \rep<\en_1 lm||\frho_i> \rep<\en_2 l(-m)||\frho_i> \label{eq:nu2-basis-coupled} \end{multline} This corresponds -- modulo irrelevant constants -- to the rotation invariant 3D shape descriptor\cite{Rusinkiewicz2003} and to the SOAP features, which would be written, in the notation of Refs.~\citenum{bart+13prb,de+16pccp} as \begin{equation} p^{i, \e_1\e_2}_{n_1 n_2 l} = \frac{1}{\sqrt{2l+1}} \sum_m c^{i, \e_1}_{n_1lm}(c^{i,\e_2}_{n_2lm})^\star, \end{equation} where $c_{\nlm}^{i,\e}=\rep<\enlm||\rho_i>$ indicate the density expansion coefficients following the same notation. The $\nu=2$ representation can also be written on a real-space basis as $\rep<\e_1r_1; \e_2 r_2; \omega||\frho_i^2>$, emphasizing its nature as three-body density correlation function that depends on two distances $r_1$, $r_2$ and the cosine $\omega$ of the angle between the directions along which they are evaluated. The 4-body order invariant representation becomes \begin{multline} \rep<\enl_1; \enl_2; \enl_3||\frho_i^3> = \frac{(-1)^{l_3}}{\sqrt{2l_3+1}}\\ \sum_{m_1 m_2 m_3} (-1)^{m_3} \cg{\lm_1}{\lm_2}{\lm_3} \rep<\enlm_1||\frho_i> \\[-2mm] \rep<\enlm_2||\frho_i> \rep<\enl_3 (-m_3)||\frho_i> \label{eq:nu3-basis-coupled} \end{multline} corresponding to the SOAP bispectrum\cite{bart+13prb} \begin{multline} b^{i,\e_1\e_2\e_3 }_{\nl_1 \nl_2 \nl_3} = \frac{1}{\sqrt{2l+1}} \sum_{m_1 m_2 m_3} \cg{\lm_1}{\lm_2}{\lm_3} \\ c^{i,\e_1}_{\nlm_1} c^{i,\e_2}_{\nlm_2} (c^{i,\e_3}_{\nlm_3})^\star, \end{multline} and closely related to the bispectrum used in the spectral neighbor analysis method\cite{thom+15jcp,wood-thom18jcp}, which is essentially equivalent to a different choice of basis. As discussed in more detail in Ref.~\citenum{niga+20jcp} and in the next sections, the relationship between the redundant expressions~(\ref{eq:nu1-basis-uncoupled}, \ref{eq:nu2-basis-uncoupled}, \ref{eq:nu3-basis-uncoupled}) that arise from the integral over rotations, and the more concise versions~(\ref{eq:nu1-basis-coupled}, \ref{eq:nu2-basis-coupled}, \ref{eq:nu3-basis-coupled}) can be seen as a transformation from the uncoupled to the coupled angular momentum basis, and starting from the $\nu=4$ additional indices $k_\nu$ must be included to account for the different ways the coupling can be realized. A practical implementation of these higher body order features is given by the the atomic cluster expansion (ACE), which is usually computed based on the $g\rightarrow\delta$ limit of $\rho$. The coefficients of the atom density are indicated as $\rep<nlm||\fdelta_i>\equiv A_{inlm}$ following the notation of Ref.~\citenum{drau19prb}, and \begin{equation} \rep< n_1l_1k_1 \cdots n_\nu l_\nu k_\nu||\fdelta_i^{\nu}> \equiv B_{\substack{i n_1 \cdots n_\nu \\ l_1 \cdots l_\nu}}^{(\nu)} \end{equation} correspond to the features associated with $\nu$-order neighbor clusters. Note that each $B_{\substack{i n_1 \cdots n_\nu \\ l_1 \cdots l_\nu}}^{(\nu)}$ indicates a group of basis functions indexed by $k_1,\dots, k_\nu$. An equivalent construction, that emphasizes the connection with angular momentum theory, is provided by the N-body iterative contraction of equivariants\cite{niga+20jcp}, that is discussed in Section~\ref{sub:equivariants}. Through a further linear transformation (change of basis) made explicit in Refs.~\citenum{drau20prb,Bachmayr2019} the moment tensor potential (MTP) of Ref.~\citenum{shap16mms} can also be related to this construction. The {\em philosophy} behind the density correlation features is different from that behind MTPs and ACE, in that these methods were at least originally thought of as bases for polynomial regression. While these basis functions can be equally used as symmetry-adapted features there are subtleties to be considered that we discuss in Sec.~\ref{sec:incompleteness} and in Sec.~\ref{sub:feature-selection}. Note that even though the contracted basis $\rep<(\enlk_i)_{i=1\ldots \nu}|$ eliminates some of the redundant indices that are present in the tensor-product basis, the indices do not label a set of linearly independent features. Symmetries and selection rules -- some of which, listed in Ref.~\citenum{niga+20jcp}, can be derived from results of angular momentum theory\cite{bied-louc84book} -- restrict greatly the number of independent entries that need to be computed. However, the non-trivial interaction between the radial and angular basis component makes this list incomplete. A mixed algebraic/numerical precomputation step can further reduce the required features\cite{Bachmayr2019}. Finally, the global SOAP-like descriptors introduced in Ref.~\citenum{mavr+18jpcl}, corresponding to Eq.~\eqref{eq:global-rot-rep}, can be readily expressed in an angular momentum basis as \begin{multline} \rep<\ennl||A; \frho^2 \otimes \frho^2> = \frac{(-1)^l}{\sqrt{2l+1}} \\ \sum_m (-1)^m \rep<\en_1 lm||\frho^2> \rep<\en_2 l(-m)||\frho^2>, \end{multline} where we recall that $\rep<\enlm||A; \frho^2>=\sum_{i\in A} \rep<\enlm||\frho_i>$. \subsection{The density trick} \label{sub:density-trick} A crucial point in comparing different representations is that with an appropriate discretization of the angular basis one can evaluate symmetrized high-order correlations as sum of products of the density coefficients defined in \cref{eq:density-nlm}. This ensures that the cost of computing \emph{all} coefficients of a given order $\nu$, scales only linearly with the number of neighbors included within the cutoff around atom $i$, even though it scales exponentially with $\nu$ in terms of the number of basis functions, at least with a naive choice of basis. This is to be contrasted with atom-centered symmetry functions (ACSF),\cite{behl11jcp,smit+17cs,zhan+18prl} and permutation invariant polynomials (PIP),\cite{braa-bowm09irpc} in which function are evaluated over all possible tuples composed of $\nu$ neighbors of the central atom (or on all the possible tuples in a structure to yield a global descriptor). In these frameworks, the cost depends linearly on the number of basis functions, but exponentially with $\nu$ in terms of the number of neighbors. This crucial difference makes density-expansion frameworks more convenient when one wants to ramp up the value of $\nu$, and there are many neighbors. A-priori sparsification schemes, exemplified in~\eqref{eq:totaldegree}, and feature selection schemes, discussed in \cref{sub:feature-selection}, allow one to keep only the most important basis functions, and eliminate the exponential scaling with $\nu$ altogether. Despite this rather fundamental difference in philosophy and computational cost, the two families of representations compute entities that are essentially equivalent, which we see by writing explicitly Eq.~\eqref{eq:nu2-basis-coupled} in the $g\rightarrow\delta$ limit as a sum over neighbors $j$ and $j'$ \begin{multline}\label{eq:nu2-delta} \rep<\ennl||\fdelta_i^2> \propto \sum_{jj'} \frac{\delta_{\e_1\e_j} \delta_{\e_1\e_{j'}}}{\sqrt{2l+1}} \rep<n_1||r_{ji}> \rep<n_2||r_{j'i}> \\ \times \sum_m (-1)^{m} \rep<\lm||\hat{\mbf{r}}_{ji}> \rep<l ({-m})||\hat{\mbf{r}}_{j'i}>. \end{multline} By using the addition formula of the spherical harmonics we get the equivalent formulation \begin{multline} \rep<\ennl||\fdelta_i^2> \propto \sqrt{2l+1} \\ \sum_{jj'} \delta_{\e_1\e_j} \delta_{\e_1\e_{j'}} \rep<n_1||r_{ji}> \rep<n_2||r_{j'i}> \rep<l ||\hat{\mbf{r}}_{ji}\cdot \hat{\mbf{r}}_{j'i}>, \label{eq:nu2-acsf} \end{multline} in which $\rep<\omega||l>\equiv P_l(\omega)$ is a Legendre polynomial of order $l$. In Eq.~\eqref{eq:nu2-acsf}, the $\nu=2$ density correlation coefficients are computed as a function of the distances and angles between triplets of atoms including the central atom $i$. By plugging this expression for $\rep<\ennl||\fdelta_i^2>$ into Eq.~\eqref{eq:rho2-g3}, that evaluates the value of an arbitrary atom-centered symmetry function, % one sees that this result is not specific to the choice of $P_l$ as angular functions: in the limit of a complete basis set, it is equally possible to compute any ACSF using a sum over neighbor tuples \emph{or} a contraction of density coefficients, drawing an explicit link between the SOAP power spectrum features,\cite{bart+13prb,de+16pccp} Behler-Parrinello symmetry functions,\cite{behl11pccp,smit+17cs} the DeepMD framework,\cite{zhan+18prl} and FCHL features\cite{fabe+18jcp}. Similar expressions could be derived for higher-order atom-centered symmetry functions, showing the complete equivalence -- but dramatically different computational scaling with the number of neighbors -- of the two frameworks.% \subsection{Equivariant representations and tensorial features}\label{sub:equivariants} The previous construction is suitable to represent any rotationally-invariant atomic property. In many circumstances, however, one is interested in representing vector-valued or general tensorial quantities $\by$. In this case, the prescribed transformations that the tensor undergoes under the symmetry operations of the $O(3)$ group (e.g. $\by(\hat{R} A)=\hat{R} \by(A)$) have to be incorporated into the atomic representation in the form of covariant, rather than simply invariant, features, so that the representation follows the same transformation as the target property, $ \rep|\hat{R} A>=\hat{R} \rep|A>$. % Equivariance (the general concept that indicates symmetry-adapted behavior, encompassing both invariance and covariance) can be enforced by comparing environments and defining the local contribution to the target relative to a pre-defined local reference frame, which has been used to build machine-learning models of tensorial properties in molecular systems\cite{hand-pope09jctc,bere+15jctc,lian+17prb,sche+20jctc}. A more general approach for achieving this goal consists in endowing the representation with the symmetries of spherical harmonics $\rep<\hat{\mbf{x}}||\lambda\mu> = Y^\mu_\lambda(\hat{\mbf{x}})$, as well as the desired parity under the action of the inversion operator $\hat{i}$, which we associate with a ket $\rep|\sigma>$ such that $\hat{i}\rep|\sigma>=\sigma \rep|\sigma>$. The eigenvalue $\sigma$ is 1 for polar tensors, and $-1$ for pseudotensors. Features that transform as $\rep|\sigma>\otimes\rep|\lambda\mu>$ can be achieved by including two additional fields\cite{will+19jcp,gris+19book} within the symmetrized tensor product of Eq.~\eqref{eq:body-order}, i.e., \begin{multline}\label{eq:equiv-features} \rep|\ev*{\rho_i^{\otimes\nu}\otimes \sigma \otimes \lambda\mu}_{O(3)}>\equiv \rep|\frho[\gslm]_i^{\nu}>\\ =\sum_{k=0,1}\int_{SO(3)}\!\!\!\!\!\!\D{\hat{R}} \hat{i}^k\rep|\sigma> \otimes \hat{i}^k\hat{R}\rep|\lambda\mu> \\\otimes \hat{i}^k\hat{R}\rep|\frho_i> \otimes\cdots \otimes \hat{i}^k\hat{R}\rep|\frho_i> \,. \end{multline} The operation is depicted in Fig.~\ref{fig:rho-lm-average}, showing how the $\lambda\mu$ ket corresponds to the evaluation of a set of spherical harmonics that anchors the atom-centered density to a reference frame. The scalar and rotationally-invariant case is recovered by taking $\rep|\gslm> = \rep|1; 00>$. \begin{figure} \centering \includegraphics[width=1.0\linewidth]{fig7.pdf} \caption{Graphical scheme of the construction of a ${SO(3)}$ equivariant tensor product representation. Copies of the atom-centered density are evaluated at $\nu$ separate points, together with a set of spherical harmonics that provide a basis to expand the components of a tensorial property. The tensor product is averaged by simultaneously rotating all densities and the $\rep|\lambda\mu>$ term. } \label{fig:rho-lm-average} \end{figure} This construction represents a particularly convenient framework to target the prediction of any Cartesian tensor $\by$ in terms of its irreducible spherical components,\cite{stone1975} namely $\y^{\sigma\lambda}_\mu$, that transform under rotation and inversion as \begin{equation} \begin{split} \y^{\sigma\lambda}_\mu(\hat{R} A) = & \sum_m D^\lambda_{\mu m}(\hat{R}) \y^{\sigma\lambda}_m(A), \\ \y^{\sigma\lambda}_\mu(\hat{i} A) =& \sigma(-1)^\lambda \y^{\sigma\lambda}_m(A). \end{split}\label{eq:tensprop} \end{equation} Within a linear regression model, they can be written as the combination of equivariant representations of the proper order $\lambda$ and parity $\sigma$ with a set of rotationally-invariant weights~$\rep<\Q||\by;\sigma;\lambda>$: \begin{multline}\label{eq:tenspred} \y^{\sigma\lambda}_\mu(A)= \rep<\by||A; \gslm> \\\approx \sum_i\int \D{\Q} \rep<\by; \sigma\lambda; ||\Q> \rep<\Q||A; \frho[\gslm]_i^{\nu}>\, . \end{multline} Each irreducible spherical component of $\by$ gives rise to a separate equivariant model, and the appropriate transformation rules are ensured by the fact that each equivariant feature $\rep<\Q||A; \frho[\gslm]_i^{\nu};>$ separately transforms as the spherical harmonics $\rep|lm>$ and the parity function $\rep|\sigma>$. Much like the case of invariant symmetrized fields features, Eq.~\eqref{eq:equiv-features} can be most effectively computed by first expanding the atom-centered field on a basis of spherical harmonics, and is equivalent to an equivariant extension of the atomic cluster expansion\cite{drau20prb} or the moment tensor potentials, that are usually evaluated in the $g\rightarrow\delta$ limit. A concrete example of these features is given by the density coefficients themselves: in fact, one can see that the $\nu=1$ equivariant reads simply \begin{equation} \rep<n||\frho[\gslm]_i^{1}> \equiv \rep<n\lambda \mu||\frho_i>^\star\delta_{\sigma 1}. \end{equation} Note how in the bra-ket notation the $(\lambda,\mu)$ indices on the two sides of this equation carry a different meaning. When used in the bra of the local density expansion $\rep<n\lambda \mu||\frho_i>$, they identify one of many components that are translationally invariant, but are not required to be rotationally equivariant; there is no explicit link to their behavior under rotation, and one could build a model by selecting only some of the $\mu$ values for a given $(n, \lambda)$. When used in the ket of an equivariant feature $\rep<n||\frho[\gslm]_i^{1}>$, they label groups of features that should be taken together, because they transform in a specific way under the symmetries of the ${O(3)}$ group. By using $\rep<n||\frho[\gslm]_i^{1}>$ features in Eq.~\eqref{eq:tenspred} one obtains a model that fulfills~\eqref{eq:tensprop} (with the caveat that pseudotensors cannot be described by $\nu=1$ features) because acting on the spherical harmonics with $\hat{R}$ yields a product with the associated Wigner matrix \begin{multline}\label{eq:rot-nu1} \sum_{n} \rep<\by;\lambda||n> \rep<n||\hat{R} A; \frho[\glm]_i^{1}>\, =\\ =\sum_{n} \rep<\by;\lambda||n> \rep<n l (-\mu)||\hat{R} A;\rho_i> \\= \sum_{n} \rep<\by;\lambda||n> \sum_m D^\lambda_{\mu m}(\hat{R}) \rep<n l (-m)|| A;\rho_i>\\ =\sum_m D^\lambda_{\mu m}(\hat{R}) \sum_{n} \rep<\by;\lambda||n> \rep<n||A; \frho[\lambda m]_i^{1}>\,. \end{multline} The same covariant property applies to all density-correlation features, \begin{equation} \rep|\hat{R} A; \frho[\sigma;\lambda \mu]_i^{\nu}>= \sum_m D^\lambda_{\mu m}(\hat{R}) \rep|A; \frho[\sigma;\lambda m]_i^{\nu}>.\label{eq:covariant-ket} \end{equation} Scalar products of these equivariant features generate matrix-valued kernels, that are suitable for symmetry-adapted Gaussian process regression -- for example $\lambda$-SOAP kernels\cite{gris+18prl,raim+19njp}. Each entry in the kernel describes the coupling between the $\mu$ channels associated with the two environments, \begin{multline} \krn^{\sigma\lambda}_{\mu\mu'}(A_i,A'_{i'}) = \int \D{\Q} \\ \times \rep<A; \frho[\gslm]_i^{\nu}||\Q>\rep<\Q||A'; \frho[\gslm]_{{i'}}^{\nu}>. \end{multline} The symmetry properties of the features translate into the a kernel that transforms under rotations of the environments as \begin{multline} \krn^{\sigma\lambda}_{\mu\mu'}(\hat{R} A_i,\hat{R}' A'_{i'}) =\\ \sum_{mm'}D^\lambda_{\mu m}(\hat{R}) \krn^{\sigma\lambda}_{mm'}(A_i, A'_{i'}) D^\lambda_{\mu' m'}(\hat{R}') ^\star, \label{eq:covariant-kernel} \end{multline} which generalizes the covariant property for kernels introduced by Glielmo et al. for the case of Cartesian vectors.\cite{glie+17prb} The fact that equivariant features of the form~\eqref{eq:equiv-features} follow ${O(3)}$ transformation rules means that they can be combined using established relationships in the quantum theory of angular momentum. In particular, the coupled-basis representation used in the definition of Eqs.~(\ref{eq:nu1-basis-coupled}--\ref{eq:nu3-basis-coupled}) can be formulated for an arbitrary value of $\nu$, and in this form it is possible to express succintly\cite{niga+20jcp} a recursive formula to evaluate $\rep|\frho[\gslm]_i^\nu>$ based on lower order terms: \begin{multline} \rep<\ldots \nlk_\nu;\nlk||\frho[\gslm]_i^{(\nu+1)}>\propto \delta_{s\sigma((-1)^{l+k+\lambda})} \times \\ \sum_{m} \cg{\lm}{k (\mu-m)}{\glm} \rep<n||\frho[\lm]_i^1> \\ \rep<\ldots; \nlk_\nu||\frho[s; k (\mu-m)]_i^{\nu}>. \label{eq:rho-recursion} \end{multline} For $\nu=2$, the recursion yields the original expression for $\lambda$-SOAP equivariants\cite{gris+18prl} \begin{multline} \rep<\nl_1;\nl_2|| \frho[\gslm]_i^{2}> =\\\frac{\delta_{\sigma (-1)^{l_1+l_2+\lambda}}}{\sqrt{2\lambda+1}} \sum_m \cg{l_1 m}{l_2 (\mu-m)}{\lambda \mu}\\ \times \rep<\nl_1m||\rho_i>^\star \rep<\nl_2 (\mu-m)||\rho_i>^\star . \label{eq:soap-lambda-2} \end{multline} Similar recursive expressions have been independently proposed to efficiently compute \emph{invariant} features\cite{Bachmayr2019,shap16mms}, that can be obtained by taking $\rep|\gslm> = \rep|1; 00>$ in Eq.~\eqref{eq:rho-recursion}. The possibility of combining equivariant features using angular momentum rules is also exploited in the construction of covariant neural networks\cite{ande+19nips,thomas2018arxiv} \begin{figure*}[tbp] \centering \includegraphics[width=0.9\linewidth]{fig8.pdf} \caption{Relationship between Cartesian coordinates, local and long-range fields. The top row shows a 1D cartoon, and the second row a more realistic, hypothetical ``doped graphene'' system in 2D. Left: Reference structure; middle: atom-density field, divided in three elemental channels, color-coded; right: atom-density potential, color-coded. Adapted with permission from Ref.~\citenum{gris+21cs}. Copyright 2020 Royal Society of Chemistry.} \label{fig:lode} \end{figure*} One can also build models that are imbued with the appropriate transformation properties in an indirect fashion, by learning atom-centered scalars and combining them with the atomic positions to evaluate formal (or actual) molecular multipoles. This is easily seen for the case of the dipole moment of a neutral molecule, that can be computed as \begin{equation} \boldsymbol{\mu}(A) = \sum_{i\in A} q(A_i) \mbf{r}_i. \label{eq:point-charge} \end{equation} Models of this form have been used since the early days of the construction of molecular potential and dipole moment surfaces\cite{huan+05jcp,yu-bowm19jpca}, combined with neural-network potentials to compute IR spectra in the condensed phases\cite{gast+17cs}, and more recently combined with tensorial models, to describe the interplay of atomic charges and polarization contributing to the total dipole moment\cite{veit+20jcp}. Assigning constant formal charges $q_i$ to atoms has also been used to derive covariant kernels, in the so-called operator machine learning framework\cite{chri+19jcp}, which is also similar in spirit to the tensorial embedded atom neural network\cite{zhan+20jpcb}. The gist of the idea (although expressed in a feature rather than kernel (or NN) language) is that one can define a translationally-invariant representation that depends formally on an applied electric field, e.g. \begin{equation} \rep<\mbf{x}||A_i;\mbf{E}> = \sum_{j\in A} \rep<\mbf{x}||\mbf{r}_{ji}; g> (\mbf{r}_{ji}\cdot \mbf{E}) q_j \end{equation} Deriving with respect to one of the components of \mbf{E} brings a dependency on the corresponding component of $\mbf{r}_{ji}$, that upon rotational averaging (keeping in mind that $\hat{R}$ acts on atomic coordinates and not on the external field) plays the same role as $\rep|\lambda\mu>$ in Eq.~\eqref{eq:equiv-features}, providing a basis of features that can be used to learn vectors covariantly. The use of local interatomic vectors to build a covariant reference system is similar to the approach adopted in Ref.~\citenum{kim+19jpcc} to define a general atomic neighborhood fingerprint, and in Ref.~\citenum{zhan+20prb} to learn the position of electronic Wannier centers. Despite the superficial similarity with the environment-dependent point-charge model of Eq.~\eqref{eq:point-charge}, this scheme more closely resembles a framework based on atomic dipoles, since its predictions can be decomposed as a sum of atom-centered equivariant terms. \begin{figure*}[bthp] \includegraphics[width=1.0\linewidth]{fig9.pdf} \caption{Median-error binding curves for six different classes of intermolecular interactions, involving charged, polar and apolar molecules extracted from the BioFragment Database\cite{burn+17jcp}. (black lines) reference quantum-mechanical calculations. (green lines) predictions of a local ($\rep|\frho_i^2>$-based) model. (blue lines) predictions of a multi-scale ($\rep|\field{\rho}_i[V]_i>$-based) model. The shaded area indicates the confidence interval for the prediction estimated from a committee model\cite{musi+19jctc}. Reproduced from Ref.~\citenum{gris+21cs}. } \label{fig:ms-lode} \end{figure*} \begin{figure}[bp] \centering \includegraphics[width=1.0\linewidth]{fig10.pdf} \caption{A multi-scale equivariant representation combining atom-centered density fields $\rep|\frho_i>$, long-range fields $\rep|V_i>$ and a set of spherical harmonics. } \label{fig:rho-lm-V-average} \end{figure} \subsection{Long-range features} \label{sub:long-range} Introducing a cutoff in the definition of the local density is not only necessary to reduce the cost of evaluating the expansion coefficients, or the number of terms that have to be included to obtain a converged expansion of the density correlations. Increasing the range of the environment makes the model more complex, which often results in slower learning when limited training data is available.\cite{bart+17sa} The problem is particularly evident when studying systems with a prominent electrostatic component\cite{gris+18prl,yue+21jcp}, but long-range physics is ubiquitous\cite{ambr+16science}, and ultimately limits the accuracy and transferability of machine-learning models\cite{wilk+19pnas,veit+20jcp,yue+21jcp}. One pragmatic solution is to build models that explicitly incorporate a physically-motivated functional form as a baseline, which could take the form of an existing model\cite{medd+14jctc,medd+15jcp}, an electrostatic scheme based on machine-learned partial charges\cite{artr+11prb,ghas+15prb,gast+17cs} or atomic multipoles\cite{bere+15jctc,bere+18jcp}. Alternatively, one may attempt to construct representations that are multi-scale in nature, and are therefore suitable to describe, in a data-driven manner, properties that depend on multiple length scales. This idea has been implemented by combining local representations with different cutoffs\cite{bart+17sa}, scaling atomic contributions according to distance\cite{fabe+18jcp,will+18pccp} (see also Section~\ref{sub:feature-optimization}), treating separately intra- and inter-molecular correlations\cite{veit+19jctc,metc+20jcp}, as well as by building global structural representations based on an intrinsically multi-scale wavelet scattering transform\cite{eick+17nips}. A recently-proposed, more radical take to the problem, extends the symmetrized atomic field construction beyond the use of the atomic density as the starting point. In order to describe more naturally the long-range behavior that is typical of electrostatic interactions, it defines a Coulomb-like potential field based on the smoothed atomic density (Figure~\ref{fig:lode}) \begin{equation} \rep<\ex||A; V> =\int \D{\mbf{x}'} \frac{\rep<\ex||A; \rho>}{\left|\mbf{x} - \mbf{x}'\right|} . \label{eq:lode-v} \end{equation} This is a \emph{global} operation, which can however be performed efficiently by transforming the density in plane waves, using one of the many different schemes that are routinely used to model electrostatics. Symmetrizing $\rep|V>$ in the same way as for $\rep|\rho>$ leads to an atom-centered potential, \begin{multline} \rep<\ex||A; V_i> =\int \D{\mbf{x}'} \frac{\rep<\ex||A; \rho_i^{<} >}{\left|\mbf{x} - \mbf{x}'\right|} + \int \D{\mbf{x}'} \frac{\rep<\ex||A; \rho_i^{>} >}{\left|\mbf{x} - \mbf{x}'\right|}\\ \equiv \rep<\ex||A; V_i^{<}> + \rep<\ex||A; V_i^{>}>\,, \label{eq:lode-vi} \end{multline} where we introduce the short-range density $\rep|\rho_i^{<}>$, restricted to the region within the cutoff, and the far-field density $\rep|\rho_i^{>}>$, restricted outside the cutoff, and the corresponding local and non-local fields $\rep|V^{<}_i>$ and $\rep|V^{>}_i>$. Crucially, these features incorporate information on atoms outside the cutoff, yet their complexity can be kept under control by restricting the range of the spherical environment over which they are computed. Just as for $\rep|\rho_i>$, the ket can be discretized by expanding it on an orthogonal basis of radial functions and spherical harmonics to obtain $\rep<\enlm||\field{V}_i>$. One can then build features that are fully equivariant by averaging $\rep|V_i>$ over the symmetry operations of the ${O(3)}$ group, leading to $\nu$-point correlations analogous to those discussed above. Furthermore, one can combine local and long-range fields, as in Figure~\ref{fig:rho-lm-V-average}, constructing a family of multi-scale long-distance equivariants (LODE) features\cite{gris+21cs}, that in the most general form can be written as $\rep|\field[\gslm]{\rho}_i^\nu[V]_i^{\nu'}>$: \begin{multline} \label{eq:ms-lode} \rep|\ev*{\rho_i^{\otimes \nu}\otimes V_i^{\otimes \nu'}\otimes \sigma \otimes \lambda\mu}_{O(3)}> = \sum_{k=0,1}\int_{SO(3)}\!\!\!\!\!\!\!\D{\hat{R}}\,\hat{i}^k\rep|\sigma> \otimes \\ \hat{i}^k\hat{R}\rep|\lambda\mu> \otimes\underbrace{\hat{i}^k\hat{R}\rep|\rho_i> \cdots\otimes \hat{i}^k\hat{R}\rep|\rho_i> }_{\nu\ \text{times}} \otimes\underbrace{\hat{i}^k\hat{R}\rep|V_i> \cdots\otimes \hat{i}^k\hat{R}\rep|V_i> }_{\nu'\ \text{times}}\,. \end{multline} The simplest multi-scale representation $\rep|\field{\rho}_i[V]_i>$ can be linked to physics-based models using an atom-centered multipole expansion of electrostatic interactions, as we discuss further in Section~\ref{sub:ms-model}, but are effective to learn a multitude of long-ranged interactions, from permanent electrostatics, to polarization and dispersion. When trying to represent long-range interactions between molecular fragments, a model based on local $\rep|\frho_i^2>$ features produces a completely unphysical behavior, with the interaction reaching a plateau when the molecules are separated by more than the cutoff distance (Figure~\ref{fig:ms-lode}). Multi-scale LODE features, instead, can describe the asymptotic tail even when using a 3\AA{} cutoff in the definition of the atom-centered environments, and are capable of representing interactions of very different chemical nature. Using a non-local field as the starting point of the symmetrization procedure provides interesting opportunities to incorporate long-range, many-body interactions in atomistic machine learning. \section{Representations and models} \label{sec:models} Even though this review focuses on the problem of representing atomic structures in terms of a vector of features, one cannot ignore the intimate connection between the choice of features and how they are used to construct models of symmetric properties, such as site energies, which are then used in the context of regression schemes.\cite{bart-csan15ijqc,behl-parr07prl,shap16mms,drau19prb,ande+19nips,schu+18jcp,gilm+17mlr,duve+15nips,Chmiela2017,gris+18prl,gris+21cs,vand+20mlst} The purpose of this section is therefore to discuss the interplay between representations and models. Given a set of symmetric features $\bra{\q}\ket{A_i}$ of an atomic environment $A_i$, we explore how to use it to represent a symmetric property $\y(A_i)$. We discuss linear approximations, % \begin{equation} \label{eq:models:linear} \y(A_i) \approx \sum_{\q} \bra{\y}\ket{\q} \bra{\q}\ket{A_i} \end{equation} and show that the family of features we introduced in Section~\ref{sec:symmetry-fields} lead to natural generalisations of well-established models of interactions between atoms and molecules in terms of a body-ordered expansion. These relatively simple models put stringent requirements on the quality of the feature sets. We then go on to review how highly non-linear models may provide more flexibility in describing the relationship between a structure and its properties, and yield satisfactory results even with a rather simple, imperfect choice of features. Here, and in the following, we always understand implicitly that equality in these approximations can only be attained in the limit of an infinite cutoff radius and suitably converged parameterisation. \subsection{Linear models and body-order expansion} \label{sub:linear-models} An advantage of linear models is that they can often be connected to classical physics-inspired frameworks, and bring to light physical-chemical insights on the nature of the underlying representations An example of this connection involves the construction of interatomic potentials in terms of a body-ordered hierarchy of atom-centered energy terms \begin{equation} E(A) = \sum_{i\in A} E(A_i) = \sum_\nu \sum_{i\in A} E^{(\nu+1)}(A_i), \end{equation} in which each term can be written as a sum over $\nu$ neighbors of the central atom \begin{equation} E^{(\nu+1)}(A_i) = \sum_{j_1 < \cdots < j_\nu} v^{(\nu+1)}(\mbf{r}_{ji_1}, \ldots \mbf{r}_{ji_\nu}). \label{eq:bo-sum-nu} \end{equation} This kind of expansion underlies the vast majority of empirical force fields, that are customarily written as a combination of pair potentials, and short-range 2, 3, and 4-body bonded terms. Most potentials truncate this expansion at body-order three, i.e. $\nu = 2$ -- a notable exception being the dihedral angle potentials used in force fields, that are four-body but involve selected groups of atoms rather than a sum over all possible triplets. This is because the cost of a naive evaluation of the sum $\sum_{j_1 < \dots < j_\nu}$ scales exponentially with the body order $\nu$, i.e. as $\mathcal{O}(N_i^\nu)$ for an environment containing $N_i$ atoms. More sophisticated ways of symmetrizing the body-ordered terms, such as those discussed in Refs.~\citenum{bowm+09jcp} and~\citenum{vand+20mlst}, alleviate this behavior. In the following paragraphs we demonstrate, in particular, how this exponential scaling can be overcome by using the density correlation representations discussed in Section~\ref{sec:symmetry-fields}. \paragraph*{The three-body case.} It is illuminating to first discuss in full detail the representation of a 3-body site potential, written traditionally in internal coordinates, in the form \begin{equation} \label{eq:models:naive3b} E(A_i) = \sum_{j} v^{(2)}(r_{ji}) + \sum_{j < j'} v^{(3)}(r_{ji}, r_{j'i}, \omega_{ijj'}), \end{equation} where $\omega_{ijj'} := \hat{\mbf{r}}_{ji} \cdot \hat{\mbf{r}}_{j'i}$. In order to connect to the atomic density correlations we first rewrite this as \begin{multline} E(A_i) = \sum_{j} \Big(v^{(2)}(r_{ji}) - \frac{1}{2} v^{(3)}(r_{ji}, r_{ji}, 0) \Big) \\ \qquad + \frac{1}{2} \sum_{j j'} v^{(3)}(r_{ji}, r_{j'i}, \omega_{ijj'}) \\ \label{eq:models:selfinteraction3b} =: \sum_{j} u^{(2)}(r_{ji}) + \sum_{j j'} u^{(3)}(r_{ji}, r_{j'i}, \omega_{ijj'}), \end{multline} adding and subtracting a self-interaction from the 3-body term. Approximating $u^{(2)}(r)$ in terms of a radial basis $\rep<r||n>\equiv R_n(r) $ yields \begin{multline} E^{(2)}(A_i)= \sum_{j} u^{(2)}(r_{ji})\\ \equiv \sum_j \rep<u^{(2)}||r_{ji}>\approx\sum_{j}\sum_n \rep<u^{(2)}||n>\rep<n||r_{ji}>\\ =\sum_n \rep<u^{(2)}||n> \int \D r \rep<n||r>\sum_j \delta(r-r_{ji}) \\ =\sum_{n}\rep<u^{(2)}||n>\rep<n||\fdelta_i^1> % \end{multline} where $\rep|\fdelta_i>$ is the $g \to \delta$ limit of the atom-centered density $\rep|\frho_i>$. As in Eq.~\eqref{eq:dirac-lr}, the use of the Dirac notation to express the pair potential highlights the fact that (atom-centered) properties can be seen as a type of representation, and that in this sense a linear model is nothing but an expansion in a discrete basis of $\rep<u^{(2)}||r>\equiv u^{(2)}(r)$. For the three-body term we revisit \eqref{eq:rho2-g3}: first, we approximate $u^{(3)}$ in terms of the radial basis $\rep<r||n>\equiv R_n(r)$ and the Legendre polynomials $ \rep<\omega||l>\equiv P_l(\omega)$, \begin{multline} u^{(3)}(r_{ji}, r_{j'i}, \omega_{ijj'}) \\ \approx \sum_{n n' l} \rep<{u^{(3)}}||{nn'l}> \rep<n||r_{ji}> \rep<n'||r_{j'i}> \rep<l||\omega_{ijj'}>. % \end{multline} Applying Legendre's addition theorem to expand the $P_l$ in terms of spherical harmonics $\bra{\hat\mbf{r}}\ket{lm}\equiv Y_l^m(\hat\mbf{r})$, \[ \rep<l||\omega_{ijj'}> = \frac{4\pi}{2l+1} \sum_{m = -l}^l (-1)^m \rep<lm||\hat{\mbf{r}}_{ji}> \rep<l(-m)||\hat{\mbf{r}}_{ji}>, \] absorbing the $\frac{4\pi}{2l+1}$ into the weights $\bra{u^{(3)}}\ket{nn'l}$ and reordering the summation yields \begin{multline} u^{(3)}(r_{ji}, r_{j'i}, \omega_{ijj'}) = \sum_{nn'l} \rep<u^{(3)}||{nn'l}> \rep<{n}||{r_{ji}}> \rep<{n'}||r_{j'i}> \\[-3mm] \qquad \qquad \times \sum_{m = -l}^l (-1)^m \rep<lm||\hat{\mbf{r}}_{ji}> \rep<l(-m)||\hat{\mbf{r}}_{j'i}> \\ = \sum_{nn'l} \rep<u^{(3)}||{nn'l}> \sum_m (-1)^m \rep<nlm||\mbf{r}_{ji}> \rep<n'l(-m)||\mbf{r}_{j'i}>. % \end{multline} Finally, we sum over all $(j,j')$ and reorder the summation to arrive at \begin{multline} \sum_{j j'} u^{(3)}(r_{ji}, r_{j'i}, \omega_{ijj'}) = \sum_{nn'l} \rep<{u^{(3)}}||{nn'l}> \\ \sum_m (-1)^m \sum_j \rep<nlm || \mbf{r}_{ji}; \delta> \sum_{j'} \rep<n'l(-m)|| \mbf{r}_{j'i}; \delta> \\ \label{eq:models:magic_scaling} =\sum_{nn'l} \rep<{u^{(3)}}||{nn'l}> \sum_m (-1)^m \rep<nlm||\fdelta_i> {\rep<nl(-m)||\fdelta_i>} \\ =\sum_{nn'l} \rep<u^{(3)}||nn'l> \rep<nn'l||\fdelta_i^{2}>. \end{multline} In summary, we have written an arbitrary 3-body site potential in terms of 1- and 2-correlations of the atomic density, \begin{equation}\label{eq:models:result_3body} \begin{split} E(A_i) &= \sum_n \rep<{u^{(2)}}||{n}> \rep<{n}||\fdelta_i^1> \\ & \qquad + \sum_{nn'l} \rep<{u^{(3)}}||{nn'l}> \rep<{nn'l}||\fdelta_i^{2}> \end{split} \end{equation} Aside from connecting classical body-ordered interatomic potentials and $\nu$-correlations of the atomic density this formulation has significant advantages in terms of computational complexity which we discuss below after generalising the argument to arbitrary body-order. \paragraph*{General ($\nu+1$)-body order potentials.} The systematic expansion to arbitrary body orders has been applied to the description of alloys in terms of a cluster expansion, a procedure that was very early shown to provide a complete description of the problem\cite{sanc+84pa}, to the rationalization of fragment-based electronic structure methods\cite{rich-herb12jcp}, and to the construction of last-generation potentials for water and aqueous systems\cite{medd+14jctc}. We adopt the generalisation of \eqref{eq:models:selfinteraction3b} that includes self-interaction, \begin{equation} E^{(\nu+1)}(A_i) = \sum_{j_1, \ldots, j_\nu} u^{(\nu+1)}(\mbf{r}_{j_1i} \ldots \mbf{r}_{j_\nu i}), \label{eq:bo-sum-nu-self} \end{equation} which can be obtained from the more natural formulation \eqref{eq:bo-sum-nu} by incorporating the self-interaction terms into the $\nu$-body-order energy similarly to Eq.~\eqref{eq:models:selfinteraction3b}.% To connect \eqref{eq:bo-sum-nu-self} to the density correlations we represent the rotationally invariant $(\nu+1)$-body function $u^{(\nu+1)}$ as \begin{equation} \begin{split} & u^{(\nu+1)}(\mbf{r}_{j_1 i}, \dots, \mbf{r}_{j_\nu i}) \\ &= \int_{{O(3)}}\!\!\!\!\!\D\hat{R}\int \D{\Q} \rep<u^{(\nu+1)}||\Q> \rep<\Q|\hat{R}\rep|\mbf{r}_{j_1 i}, \dots, \mbf{r}_{j_\nu i}>, \end{split} \end{equation} where we use $\Q$ as a shorthand for $(\mbf{x}_1;\ldots \mbf{x}_\nu)$, so that $\rep<\Q||\mbf{r}_{j_1 i}, \dots, \mbf{r}_{j_\nu i}>\equiv \prod_{k=1}^\nu \delta(\mbf{x}_k - \mbf{r}_{j_k i}) $. % The rotation can be made to act on the atomic positions or on the basis, depending on convenience. The $(\nu+1)$-order site energy is obtained by summing over clusters of neighbors \begin{multline} \label{eq:Enu1beforedensitytrick} E^{(\nu+1)}(A_i)\\\approx \!\! \sum_{j_1, \dots, j_\nu}\!\! \int_{{O(3)}}\!\!\!\!\!\!\! \D{\hat{R}} \! \int \!\D{\Q }\! \rep<u^{(\nu+1)}||\Q> \!\rep<\Q|\hat{R}\rep| \mbf{r}_{j_1 i} \cdots \mbf{r}_{j_\nu i}> \\ =\!\!\int\! \D{\Q} \!\rep<u^{(\nu+1)}||\Q> \int_{{O(3)}}\!\!\!\!\!\!\! \D{\hat{R}}\!\!\! \sum_{j_1, \dots, j_\nu} \!\!\!\! \rep<\Q|\hat{R}\rep| \mbf{r}_{j_1i} \cdots \mbf{r}_{j_\nu i}>. \end{multline} The symmetrized sum can be reordered to show that it corresponds to the $\nu$-point density correlation \begin{multline} \int_{{O(3)}}\!\!\!\!\! \D{\hat{R}} \sum_{j_1, \dots, j_\nu} \rep<\mbf{x}_1; \ldots \mbf{x}_\nu|\hat{R}\rep| \mbf{r}_{j_1 i} \cdots \mbf{r}_{j_\nu i}> \\ =\int_{{O(3)}}\!\!\!\!\! \D{\hat{R}} \sum_{j_1\ldots j_\nu} \prod_k \delta(\hat{R} \mbf{x}_k-\mbf{r}_{j_ki})\\ =\int_{{O(3)}}\!\!\!\!\! \D{\hat{R}} \prod_k \sum_{j_k} \delta(\hat{R} \mbf{x}_k- \mbf{r}_{j_ki}) \\ =\!\!\int_{{O(3)}}\!\!\!\!\! \D{\hat{R}} \prod_k \rep<\hat{R}\mbf{x}_k||\delta_i>=\rep<\mbf{x}_1; \ldots \mbf{x}_{\nu}||\fdelta_i^{\nu}>, \end{multline} which is precisely Eq.~\eqref{eq:body-order-x} written in the $g\rightarrow\delta$ limit. Thus we have explicitly represented $E^{(\nu+1)}$ in terms of the symmetry-adapted density correlations. We emphasize again that this calculation {\em required} the inclusion of the self-interactions as the starting point \eqref{eq:bo-sum-nu-self} -- even though, if one wishes so, they can be removed from the final result\cite{jinn+20jcp}. \paragraph*{Linear completeness.} For a practical implementation we can choose a finite, discrete basis, approximating $E^{(\nu+1)}$ as \begin{equation} \label{eq:Enu_correlations} E^{(\nu+1)}(A_i) \approx \sum_{\q} \rep<u^{(\nu+1)}||\q> \rep<\q||\fdelta_i^\nu>. \end{equation} Any complete implementation of $\nu$-order density correlation features\cite{shap16mms,drau19prb,Bachmayr2019,niga+20jcp} provides a basis to expand $u^{(\nu+1)}$ and approximate the $(\nu+1)$-order term, that contributes to the body-ordered expansion of $E(A)$. The foregoing discussion shows that these bases are complete in the following sense. An (infinite) collection of symmetrized features $\{\bra{q}\ket{A_i}\}_{q\in \mbf{q}_{\rm total}}$ is a {\em complete linear basis} if there exists a sequence of finite subsets $\mbf{q} \subset \mbf{q}_{\rm total}$ such that \begin{equation} \y(A_i) \approx \y_{\mbf{q}}(A_i) := \sum_{\q \in \mbf{q}} \bra{\y}\ket{\q} \bra{\q}\ket{A_i}, \end{equation} i.e. $\y_{\mbf{q}}$ approximates $\y$ to within arbitrary accuracy in the limit as the number of features tends to infinity. We stress here that the weights $\rep<\y||\q>$ depend on the entire choice of feature set $\mbf{q}$ and not just the single index $\q$. Therefore the density correlation features provide a universal, complete linear basis to approximate body-ordered potentials and, more generally, body-ordered expansions of properties that can be meaningfully written as a sum of atom-centered contributions. For the specific choice \begin{equation} \rep<\q| = \otimes_{\alpha = 1}^\nu \rep< \nlm_\alpha| \end{equation} Eq.~\eqref{eq:Enu_correlations} is the ACE model\cite{drau19prb,Bachmayr2019}. Note that the symmetrized correlations $\rep<\q||\fdelta_i^\nu>$ can be efficiently and conveniently evaluated as already hinted at in Section~\ref{sub:lm-rep}. Since MTPs provide an alternative basis set for the same space, they are complete as well, and in the same sense. We also emphasize that a rigorous proof of completeness of MTPs was already given by \citet{shap16mms}, and the essence of the idea can be traced back to the cluster expansion theory of alloys\cite{sanc+84pa}. The ``density trick'', i.e., expanding in terms of the density correlations, ensures linear scaling in terms of the number of neighbors $N_i$ rather than the $\binom{N_i}{\nu}$ scaling of the naive representation \eqref{eq:bo-sum-nu}, which enables modeling very high body-orders. A recursive evaluation of the $\nu$-correlations implemented by the MTP and ACE bases, or by the NICE formalism, avoids an unfavorable scaling of the evaluation of the high-order terms (see Section~\ref{sub:implementation} for a summary of these techniques). \subsection{Density smearing.}\label{sub:smearing} The real-space view of the density correlation features may be more intuitive when considering finite smearing of the atomic contributions to $\rep|\rho_i>$, that gives rise to a smooth function that can be seen as a proxy for the electronic density, and is reminiscent of the atoms-in-molecules\cite{bade94book} description of the electronic structure of a molecule or a condensed-phase system as a collection of atom-centered densities. In the literature using SOAP features, the width of the atom-centrered Gaussians has been often indicated as a hyperparameter with an important influence on the robustness\cite{deri+18prl} and accuracy\cite{caro19prb,kondati2020arxiv} of the resulting machine-learning models. Since we derived the link between density correlations and body-ordered potentials, and in particular the proof of the completeness of the linear expansion, only in the limit of a sharp density we now discuss whether a similar formal guarantee holds for a general $\rep|\rho_i>$, admitting in particular smearing of the atomic contributions. With tensor-product bases, all statements derived for higher correlation orders can eventually be reduced to a one-dimensional description, that is sufficient to reveal the essential features of the problem. Note that the following discussion provides only {\em theoretical guarantees}; we explain below that excessive smearing creates severe numerical ill-conditioning which must be carefully considered in practical implementations. We begin by noting that the expansion of a smeared density in a basis $\rep<x||n>$ is identical to the expansion of a $\delta$-like density in the corresponding smeared (a.k.a. {\it mollified}) basis $\rep<x||n; g>\equiv \int \D{x'} \rep<n||x'> g(x-x')$: \begin{multline} \rep<n||\rho> = \int \D{x} \rep<n||x> \sum_i g(x-x_i) \\= \int \D{x} \sum_i \delta(x-x_i) \int \D{x'} \rep<n||x'> g(x-x') \\= \int \D{x} \sum_i \delta(x-x_i) \rep<n; g||x> = \rep<n; g||\delta>. \end{multline} With this observation in hand showing that $\rep<x||n; g>$ inherits completeness from $\rep<x||n>$ is sufficient to ensure that all our results apply also to smeared densities. We first consider the case of standard monomials. Any continuous function $f(x)$ can be expanded to within arbitrary accuracy into polynomials $x^n$ : \begin{equation}\label{eq:fn-poly} f(x) \approx f_\nmax(x) = \sum_{n = 0}^\nmax c_n x^n \underset{\nmax\rightarrow\infty}{\rightarrow}f(x). \end{equation} We want to check whether we can also represent $f$ in terms of smeared polynomials, \begin{equation} p_n^g(x) = g \ast x^n = \int (t -x)^n e^{-t^2/2\sigma^2}/\sqrt{2\sigma^2\pi} \,\D{t}. \end{equation} For the particular choice of Gaussian smearing we can evaluate this expression explicitly and obtain \begin{equation} p_n^g(x) = x^n + \text{lower order terms}, \end{equation} i.e., $p_n^g$ is in fact still a polynomial with leading-order term $x^n$ and this means it forms a basis. In particular we can now again represent $f_\nmax(x)$ {\em exactly} as \begin{equation} f_\nmax(x) = \sum_{n=0}^\nmax c_n' p_n^g(x) \end{equation} And in the limit $\nmax \to \infty$ we recover $f$. In the more general case, suppose that we have an arbitrary complete basis $\rep<x||j>$. Then we can approximate $x^n \approx \sum_j b_{nj} \rep<x||j>$. The smearing operator $g\ast \cdot$ is bounded, which allows us to write \begin{multline} p_n^g(x) = g \ast x^n \approx \sum_j b_{nj} \int \D{x'}g(x-x') \rep<x'||j> \\ =\sum_j b_{nj} \rep<x||j; g> .\quad\quad \end{multline} Given that $p_n^g$ are dense, it follows that also the smeared basis functions $\rep<x||j; g> \equiv g \ast \rep<x||j>$ are dense. From these arguments it is reasonable to conclude that the smeared density correlations also form a complete linear basis. As already mentioned above, this is a purely theoretical statement, and there is an important caveat: The inverse of the smearing operator is unbounded, which implies that the coefficients of the expansion of $f$ in terms of the smoothed polynomial basis necessarily blow up when the size of the basis is increased, even if $f$ has a stable expansion in a polynomial basis. Therefore, in practice, the smoothing of the density, the truncation of the basis, and the regularisation of the regression, must be carefully coordinated and adapted to the natural scale of the variations of the target function $f$, i.e. to its ``natural'' smoothness. Failure to do so may result in a representation that has insufficient resolution to describe the response of the target property to structural deformations, or vice versa to one that contains redundant information and is prone to overfitting. \subsection{Long-range features and potential tails} \label{sub:ms-model} A similar formal correspondence with well-established functional forms of physical interactions can be derived when using (scalar) multiscale LODE features~\eqref{eq:ms-lode} within an additive, linear learning model, using as target the electrostatic energy $U(A)$, \begin{equation}\label{eq:epred} U(A) =\sum_{i\in A} U(A_i) =\sum_{i\in A} \int\D{\Q} \rep<U||\Q> \rep<\Q||A;\field{\rho}_i[V]_i>. \end{equation} The fact that the representation is linear both in the density and in the potential fields allows one to derive rigorous asymptotic relationships for the interaction between two distant portions of the system, that resemble the electrostatic interactions between the multipoles of a localized charge density distribution and any other charge that is located arbitrarily far away.\cite{gris+21cs} Focusing only on the long-range contribution $U^>$ to $U(A_i)$, that is associated with the part of $\rep|A; V_i>$ generated by the far-field density, $\rep|A; V_i^{>} >$, one can write \begin{multline} \label{eq:ulr-multipoles} U^>(A_i) = \sum_{l=0}^{\lmax}\int\! \D{r_1}\!\D{r_2}\!\rep<U||r_1 r_2 l> \rep<r_1 r_2 l ||\overline{\rho_i^<\otimes V_i^>}>\\ =\sum_{l=0}^{\lmax} \sum_{m=-l}^{+l} \int_{\rcut}^{\infty} \!\!\!\D{r} \frac{1}{r^{l+1}}\rep<\lm||M_i^<(U)> \rep<\rho^>_i||r \lm>\,. \end{multline} In this expression, in which the reader can recognize the similarity with the multipole expansion of the electrostatic potential,\cite{stone1975} $\rep|\rho^{>}_i>$ indicates the atom density outside the cutoff, which is not computed explicitly but is encoded in the expansion of the local atomic potential~\eqref{eq:lode-v}. The coefficients $\rep< \lm||M_i^<(U)>$ can be written as a combination of the regression weights $\rep<r_1r_2l||U>$ and the local density coefficients $\rep<rlm||\rho_i^{<}>$, and can be interpreted as adaptive multipole coefficients that depend in a general manner on the atomic distribution within the environment. \begin{figure}[tbp] \centering \includegraphics[width=0.9\linewidth]{fig11.pdf} \caption{Extrapolated asymptotic interaction profiles for a given configuration of H$_2$O and CO$_2$ at different angular cutoff values $\lmax$. Top and bottom panels show the results of the asymptotic extrapolation when centring the representation (a) on the oxygen atom of H$_2$O and (b) on the carbon atom of CO$_2$. Adapted with permission from Ref.~\citenum{gris+21cs}. Copyright 2020 Royal Society of Chemistry.} \label{fig:multipoles} \end{figure} Given that the atomic densities and potentials are not the physical charge density and electrostatic potential of the system, it is the role of the regression procedure to modulate the multipoles so as to reproduce the reference data for the electrostatic energy. In Fig.~\ref{fig:multipoles} we report an example where this is demonstrated by extrapolating the long-range interaction between a pair of rigid H$_2$O and CO$_2$ molecules, upon training the multiscale LODE model on the long-range, yet not asymptotic, interaction profiles associated with 33 different reciprocal orientations of the two molecules. The figure compares the asymptotic extrapolation performance upon centering the representation on different atoms, as well as by truncating the angular expansion at different $l_\text{max}$. It is apparent that the angular cutoff chosen reflects the number of multipoles introduced in the expansion of Eq.~\eqref{eq:ulr-multipoles} and thus determines sharp crossovers of the prediction accuracy across critical $l_\text{max}$ values. For instance, a model that uses only features centered on the oxygen atom of \ce{H2O} improves dramatically its performance when $l_\text{max}$ is increased from zero to one. A model using the carbon atom of \ce{CO2} as the only environment shows a similar, sharp improvement in accuracy when going from $l_\text{max}=1$ to $l_\text{max}=2$. This is consistent with the primarily dipolar nature of the electrostatic field generated by a water molecule, and with the quadrupolar nature of the center-symmetric carbon dioxide. Even though this example showcases the link between a linear model based on $\rep|\field{\rho}_i[V]_i>$ and multipole electrostatics, the representation is sufficiently flexible to describe also other kinds of interactions, as demonstrated in Figure~\ref{fig:ms-lode}. \subsection{Non-linear models} \label{sub:non-linear-model} Historically, linear representations used basis sets in internal coordinates (typically interatomic distances or simple transformations of them) that exploded in size with body order, see e.g. Refs.~\citenum{coll-pars93jcp,bowm+09jcp}, and with exponential scaling in their computational cost of prediction due to the need to sum over all $\nu$-clusters in a configuration or atomic environment. Moreover, it is clear that high body orders would be needed to obtain the desired accuracy, especially for models of materials. About a decade ago, {\em nonlinear} fits using low body order ($\nu=2$) descriptors appeared, with the surprising result that a few hundred degrees of freedom were enough to get good potentials\cite{behl-parr07prl,bart+10prl}. Contrary to linear modeling where the symmetry-adapted features $\rep<\q||A_i>$ are used as a basis, in the context of non-linear regression they are best thought of as a coordinate transformation. In a linear setting the choice of a basis, and the details of the implementation, are a matter of computational performance but can be converged to a well-defined, basis-set independent limit. When taken as the input of a non-linear model, instead, the entries of the feature vector must always be precisely defined, because there is no complete basis set limit in which the models become equivalent. To emphasize that many of the formal manipulations that are possible in a linear context take on a different meaning when features are used for a non-linear model, we abandon the Dirac notation and indicate as $\bfeat(A_i)$ the feature vector that describes the atom-centred environment $A_i$, whose components are $\upxi_{\q}(A_i)=\rep<\q||A_i>$. If $\y(A_i)$ is a symmetric property such as a site energy, we aim to construct approximations of the general form \begin{equation}\label{eq:models-nonlinear} \y(A_i) \approx \yt\big(\bfeat(A_i)\big). \end{equation} The two most commonly used models for $\yt$ are artificial neural networks\cite{behl11pccp,gast+17cs,schu+18jcp,smit+17cs,Mills2019,gilm+17mlr,Kondor2018,wang+18cpc,chemrev2021behler,chemrev2021smallmolecules} (ANN) and kernel ridge regression\cite{bart+17sa,fabe+18jcp,bere+18jcp,caro19prb,glie+18prb,Chmiela2017,paru+18ncomm,Botu2015,gris+19acscs,chemrev2021gdml} (KRR) models. In KRR models,\cite{Saunders1998} one builds a kernel matrix $\mbf{K}$ with elements \begin{equation} K_{ij} = \krn(\bfeat(A_i) , \bfeat(A_j) ), \end{equation} which provides a similarity measure between the environments $A_i$ and $A_j$, measured in terms of the similarity between the corresponding feature vectors $\bfeat(A_i)$ and $\bfeat(A_j)$. Useful kernel functions, $\krn$, are nonlinear, e.g. polynomials, Gaussians, etc.\cite{rasm05book}. The kernel inherits the symmetry of the feature vectors, and therefore a model for a symmetry-invariant property $\y(A_i)$ can be obtained as \begin{equation} \yt(A_i) = \sum_{j\in M} b_j \krn(\bfeat(A_i) , \bfeat(M_j) ), \end{equation} where, in the simplest setting, the $M_j$ are scattered interpolation points, but more generally are simply a collection of ``centers'' which induce a basis $\{\krn(\cdot, \bfeat(M_j))\}_j$ in the symmetrized feature space. The weights $b_j$ are then obtained by a linear regression. Kernel models have two main advantages over ``naive'' linear regression using the same features. (1) They introduce implicitly a non-linear mapping between the inputs and a ``reproducing kernel Hilbert space'' $\rep|A_i>\rightarrow \rep|A_i; \krn>$, which has a larger (often infinite) dimensionality, allowing for a more flexible approximation of $\y(A_i)$. (2) Given that the basis is centered on the training points, it is adapted to the geometry of the data set in feature space. For example, if the centers $\rep|A_i; \krn>$ in feature space fall on (or close to) a low-dimensional manifold then the KRR model naturally exploits this. For a comprehensive discussion of the use of kernel methods in atomistic modeling, see Ref.~\citenum{chemrev2021deringer}. In the context of body ordered features discussed above, the non-linearity in the kernel effectively increases the body order of the features used in the regression model, but in a rather special way: only those high body order terms are present that can be obtained as functions of low body order features. See \cref{sec:incompleteness} on completeness for a more detailed discussion. \begin{figure} \centering \includegraphics[width=1.0\linewidth]{fig12.pdf} \caption{Learning curves for the formation energy of CH$_4$ structures using linear models based on NICE features truncated to increasing body order $\nu$ ($\rcut= 6$\AA{}, $\nmax= 10$, and $\lmax= 10$, up to 3200 invariants retained at each body order) and an ANN model using NICE features up to $\nu= 4$. Errors are expressed both in absolute terms and as a percentage of the standard deviation of the dataset. The models are trained using features centered on both C and H. Reproduced with permission from Ref.~\citenum{niga+20jcp}. Copyright 2020 American Institute of Physics. } \label{fig:nice-methane} \end{figure} While nonlinear models are by their very nature more flexible in representing complex high-dimensional features, linear models come with different advantages. As we have shown in \cref{sub:linear-models} and \cref{sub:ms-model}, they tend to be more easily ``interpretable'', e.g. in terms of a body-ordered expansion of the target properties, or in terms of physically-motivated asymptotic forms of the interactions. But are nonlinear models necessary to achieve high accuracy? This notion is challenged by the SNAP,\cite{thom+15jcp,wood-thom18jcp}, the MTP,\cite{shap16mms}, the ACE\cite{drau19prb} and the NICE\cite{niga+20jcp} representations: the ``density trick'' and its generalisations to higher body-orders, replacing polynomials with correlations of the atom-centered density, circumvents both the explicit symmetrization as well as the summation of all $\nu$-clusters of traditional body ordered expansions. Particularly when using density correlations above $\nu=2$, it is critical to fully exploit the computational cost gains offered by permutation symmetric properties. Even if one were to initially specify a model in terms of the ``natural'' body-order expansion~\eqref{eq:bo-sum-nu}, one should convert it for computationally efficient evaluation to one of the many representation built in terms of $\nu$-correlations. By employing the recursive evaluations introduced in Refs.~\citenum{shap16mms,Bachmayr2019,niga+20jcp}, this transformation makes it possible to truncate at very high body-orders without significant penalty in computational cost, as discussed in more detail in~\cref{sub:implementation}. As an illustration of how a linear fit based on high-quality density-correlation representations can compete with non-linear models we show in \cref{fig:nice-methane} the learning curves resulting from the regression of the atomization energy for a very large and geometrically diverse database of \ce{CH4} configurations (generated by randomly displacing the H atoms around the central carbon, in a sphere with a radius of 3.5\AA{}). The plot reflects a tradeoff between model complexity and the availability of training data. Saturation of the learning curves indicates that the model does not have sufficient flexibility to describe fully the underlying structure-property relations.\cite{huan-vonl16jcp,bart+17sa} Thus, linear models based on NICE features incorporating higher and higher body order are capable of describing the structure-property relations to a higher degree of accuracy, which is apparent in the delayed saturation of the learning curve. One sees that a $\nu=4$ model starts saturating around $n_\text{train}=10^5$, even though the system is composed of 5 atoms, and so the body-ordered expansion should be fully converged. This is because a linear model requires a \emph{complete} basis, while here we select only a few 1000s invariants at each body order. A NN model can be designed to be more flexible and beat this saturation, at the expense, however, of performance in the small data set limit - which, in a more chemically and structurally diverse regression exercise, usually translates to poorer transferability. \section{Alternative notions of completeness} \label{sec:incompleteness} Suppose we are given a finite collection of symmetry adapted features $\bfeat(A) = \left\{\rep<\q||A>\right\}_\q$ which we wish to use as a {\em descriptor} for atomic structures or environments, for example symmetrized correlations of the density as described in the foregoing sections. In Section~\ref{sec:models} we discussed two classes of models built from such equivariant features: linear models, \begin{equation} A \mapsto \sum_q \rep<y||q>\rep<\q||A>, \end{equation} for which the representation $\bfeat(A)$ plays the role of a basis to expand the target property; and nonlinear models, \begin{equation} A \mapsto \yt(\bfeat(A)), \end{equation} where the representation plays the role of a coordinate transformation generating a finite-dimensional feature vector used as the argument of a non-linear function $\yt$. In order to guarantee systematic convergence of these models to an arbitrary target, in suitable limits, we require that the employed set of features is {\em complete}. We already hinted in Section~\ref{sub:non-linear-model} that these two scenarios lead to different requirements on the notion of completeness. In this section we provide a more in-depth discussion of the completeness issue in the nonlinear setting, and point out open problems. Recall from Section~\ref{sub:non-linear-model} that for linear models the correct notion of completeness is the well-known and well-understood concept of a complete (linear) basis from linear algebra. In the context of a nonlinear model $\yt(\bfeat(A))$ it is instructive to think of $\yt$ as a universal approximator in feature space (e.g., an ANN, GP, etc). We then ask the question whether (in a suitable limit) the model can represent an arbitrary symmetric property $\y(A)$, i.e., whether \begin{equation} \y(A) = \yt(\bfeat(A)), \end{equation} is achievable. This is the case if and only if the mapping $A \mapsto \bfeat(A)$ is {\em injective}: this means that any two atomic configurations that are {\em not} related by symmetry are mapped to different descriptors. In particular knowledge of $\bfeat$ would then enable us in principle to reconstruct the configuration $A$. When this is the case, we say that the descriptor $\bfeat$ is {\em geometrically complete}. \subsection{A pedagogical example} \label{sub:field-completeness} The ideal goal would be to have complete {\em finite} feature sets, that allow to approximate any symmetric function of the coordinates to arbitrary accuracy. As an elementary introduction to how such a construction might be achieved in principle, we consider a collection of $N$ particles in 1D, $\{x_i\}_{i = 1}^N$. As a concrete example, one can take two particles with positions $(x_1, x_2)$. In the absence of an angular component, we only need to consider the projection of the density $\rho(x) = \sum_i \delta(x - x_i)$ onto the monomial basis $x^n$: \begin{equation} \label{eq:n-rho-1d} \rep<n||\rho> = \sum_{i = 1}^N x_i^n, \quad n \in \mathbb{N} \end{equation} For example, if $N=2$, $\rep<1||\rho>=x_1+x_2$, $\rep<2||\rho>=x_1^2+x_2^2$, etc. In this simple setting, one sees easily how the $\nu$-point density correlations form a basis of symmetric polynomials \begin{equation} \label{eq:nu-rho-1d} \rep<n_1 \cdots n_\nu||\rho^{\otimes \nu}> = \sum_{i_1 \ldots i_\nu} x_{i_1}^{n_1} \cdots x_{i_\nu}^{n_\nu} = \prod_{k = 1}^\nu \rep<n_k||\rho> \end{equation} which is complete (in the sense of a linear basis) because it contains all possible symmetrized monomials. In analogy to what we did in Section~\ref{sub:linear-models}, we use the ``self-interaction'' formulation in which the sum extends over all the tuples of particle indices. For the case of two particles, linear combinations of $\rep<n_1 n_2||\rho^{\otimes 2}> = x_1^{n_1+n_2}+ x_1^{n_1} x_2^{n_2} + x_2^{n_1} x_1^{n_2} + x_2^{n_1+n_2} $ are sufficient to write any symmetric polynomial of the particle positions. Thus, if we allow for \emph{algebraic} operations on the $\rep<n||\rho>$, it is clear that the $\nu=1$ coefficients provide a sufficient basis, because the elements of the linear basis~\eqref{eq:nu-rho-1d} can be obtained as a product, e.g. $\rep<n_1 n_2||\rho^{\otimes 2}> = \rep<n_1||\rho> \rep<n_2||\rho>$. In fact, well-established results from the theory of symmetric polynomials\cite{macd15book} allow making an even stronger statement. The first $N$ power sum polynomials $\left(\rep<n||\rho>\right)_{n=1}^N$ provide an algebraically-complete basis to write any symmetric polynomial function of the coordinates of $N$ particles. For instance, for $N=2$ we can express the $n=3$ term as a polynomial of $\rep<1||\rho>$ and $\rep<2||\rho>$ \begin{multline} \rep<3||\rho> = x_1^3+x_2^3 = \frac{3}{2}(x_1+x_2)(x_1^2+x_2^2)-\frac{1}{2} (x_1+x_2)^3 \\=\frac{3}{2}\rep<1||\rho>\rep<2||\rho>-\frac{1}{2}\rep<1||\rho>^3 \end{multline} This result implies, in general, that the mapping \begin{equation} \left\{ x_i \right\}_{i = 1}^N \mapsto \bfeat=\left\{\rep<n||\rho>\right\}_{n=1}^N \end{equation} is injective: knowledge of the first $N$ features $\rep<n||\rho>$ allows us to uniquely reconstruct the configuration (but not the index of the atoms). That is, this {\em minimal feature set} $\bfeat(A)$ is indeed {\em geometrically complete}. It is not too difficult to construct similar complete and finite feature sets for finitely many particles in two and three dimensions as long as only permutational symmetry is considered. However, incorporating also rotational symmetry into the equivalence of particle configurations makes this much more challenging as we discuss next. \subsection{Geometric completeness of density correlations}\label{sub:geo-completeness} In general, for three-dimensional atom configurations it is clear that taking {\em all} $\nu$-correlations provides a complete set of features (after all, they are even complete in the sense of forming a complete linear basis), however, as we explained at the beginning of Sec.~\ref{sec:incompleteness}, this is not a practically useful property when considering nonlinear regression schemes. As we explain next, it remains an open problem how to construct a minimal complete feature set in this general setting. It is clear just based on dimensionality arguments that a descriptor that has fewer than $3N-6$ components (the number of elements in the Cartesian position vectors, subtracting the degrees of freedom associated to translations and rotations) cannot be complete for $N$ particles. On the other hand, the descriptors based on $\nu$-point correlations have a number of components that scales with $N^\nu$. But having more than the necessary minimum number of components does not ensure that a descriptor is complete. \begin{figure}[btp] \newlength{\pica}\settowidth{\pica}{$\boldsymbol{\pi-\alpha}$} \newlength{\gnat}\settowidth{\gnat}{4'} \newlength{\gnatt}\settowidth{\gnatt}{$\pi-\alpha$} \centering \includegraphics[width=3cm]{fig13.pdf} \vbox{ \hbox{\begin{tabular}{l|cccc} &\hbox to\gnatt{\hfil1\hfil}&2&3&4\\\hline 1&0&$\frac{\pi}{2}+\alpha$ & $\frac{\pi}{2}-\alpha$ & $\frac{\pi}{2}$\\ 2&&0&$\pi$&\colorbox{lightgray}{\makebox[\pica]{$\boldsymbol{\alpha}$}}\\ 3&&&0&\colorbox{lightgray}{$\boldsymbol{\pi-\alpha}$}\\ \hbox to\gnat{4}&&&&0 \end{tabular}} \medskip \hbox{\begin{tabular}{l|cccc} &\hbox to\gnatt{\hfil1\hfil}&2&3&4'\\\hline 1&0&$\frac{\pi}{2}+\alpha$ & $\frac{\pi}{2}-\alpha$ & $\frac{\pi}{2}$\\ 2&&0&$\pi$&\colorbox{lightgray}{$\boldsymbol{\pi-\alpha}$}\\ 3&&&0&\colorbox{lightgray}{\makebox[\pica]{$\boldsymbol{\alpha}$}}\\ 4'&&&&0 \end{tabular}} } \caption{A pair of environments that are not distinguished by two-correlations (sets of distances from the origin and central angles), formed from the blue atoms (1-3) and either one of 4 or 4'. The angle $\alpha$ is arbitrary. The tables on the right show the angles (or equivalently, distances) between the numbered particles in each configuration. The two environments are not related by symmetry, but the sets of distances are identical, only a pair are swapped, that are highlighted with the gray background. } \label{fig:degeneracy} \end{figure} Although it was appreciated for a long time that symmetrized two-correlations for entire structures are not complete, i.e. knowing the set of distances between points is not enough to reconstruct the point set\cite{bart+13prb,vonl+15ijqc, bout-kemp04aam}, it was not until recently that the connection to environment descriptors was made\cite{pozd+20prl}. The fact that degenerate pairs of inequivalent environments mapping to the same descriptor exist for two-correlation (distance-angle) representations came as a surprise because so many ``successful'' models for potential energy surfaces have been published based on such descriptors in the past decade\cite{behl16jcp,chemrev2021deringer}. An example of such ``degenerate pair'' is given in Figure~\ref{fig:degeneracy}. The construction involves an environment with four neighbors on the unit circle, with the two structures corresponding to the labels $(1,2,3,4)$ and $(1,2,3,4')$ being different, but having the same unordered list of distances and angles. The total number of degrees of freedom for this layout is three (because one neighbor can be fixed on the $x$ axis), and there is one degree of freedom in the construction of the degenerate pair (the angle labelled $\alpha$ in Fig.~\ref{fig:degeneracy}). Thus, this manifold of pairs of degenerate configurations has a {\em codimension} of two, i.e. it has a dimensionality that involves two fewer degrees of freedom than the total. A more general construction, that yields a family of 3D degenerate pairs including an arbitrary number of neighbors, is discussed in Ref.~\citenum{pozd+20prl}. The fact that the degenerate pairs form a manifold does not mean that there is a {\em degenerate manifold}, i.e. a manifold of configurations all mapping to the same descriptor. This type of degeneracy occurs between pairs of configurations which are typically far from one another, and so this degeneracy problem differs from that of assessing the sensitivity of a representation to small atomic displacements\cite{onat+20jcp,pars+20mlst}. As was shown in Ref.~\citenum{pozd+20prl}, in order to break this degeneracy, the correlation order has to be increased. Three-correlations ($\rep|\frho_i^3>$, equivalent to the unordered set of central tetrahedra, and the bispectrum of the atomic density) indeed distinguish environments such as those in Fig.~\ref{fig:degeneracy}. It is however possible to build pairs of environments, composed of 7 or more neighbors, which are distinct but have the same three-correlations. This example, also discussed in Ref.~\citenum{pozd+20prl}, raises a number of open mathematical questions: (i) is the $\nu=3$ descriptor complete for $N < 7$ neighbors, (ii) are all $\nu$-correlations degenerate for sufficiently many neighbors, (iii) what is the codimension of the manifold of degenerate configurations for $\nu > 2$? The concept of completeness applies both to representing entire structures and to atomic environments, but the relationship between these two cases is subtle. Given an entire structure, it can be considered to be the ``environment'' of the point at the origin, and the same symmetries apply. However, specific representations appear differently in the two views. For example, the $\nu=2$ correlations around a central atom contain information on the full set of interparticle distances between the neighbors, and so any pair of environments that are degenerate in terms of $\rep|\frho_i^2>$ is also (removing the particle at the origin) a pair of \emph{structures} with a degenerate description in terms of distances.\footnote{While the opposite is generally not true, the usual example of the pair of degenerate tetrahedra, as well as any pair of degenerate structures that can be inscribed in a sphere, correspond to a pair of environment placed at the center of such a sphere that is degenerate for $\nu=2$ correlations.} Note that the problem of completeness for entire structures is exactly the same as the problem of reconstructing point sets\cite{bout-kemp04aam}. One way to break the degeneracy between the representations of two entire structures involves combining information on different environments. For instance, one can describe the entire structure using an additive combination of atom-centered features analogous to Eq.~\eqref{eq:additive-rho2}. Following the above reasoning, a pair of environments that are degenerate in terms of the list of distances and angles are also (removing the central atom) structures that are degenerate in terms of the list of distances. However, these structures are not necessarily degenerate in terms of the combined list of distance and angle histograms of each local environment. Thus, taking non-linear transformations of atom-centered features cannot resolve the environment-level degeneracies, but can provide a way to differentiate entire structures.\cite{pozd+20prl} The construction of injective yet concise representations for environments and structures is still an open problem, whose solution may help to improve the accuracy and computational efficiency of machine-learning models. Note that in this discussion we are implicitly taking atomic structures related by symmetry as identical, and we focus on whether the injectivity holds for the domain of the descriptor map being the original atomic structures. The case of whether the same consideration hold for general scalar fields (e.g. those arising in the LODE construction) is a separate problem. For the case of translation symmetry (torus geometry) it is well-known that no finite correlation order suffices to reconstruct all signals\cite{Yellott1992-gh}, however {\em most} signals can be reconstructed already from the bi-spectrum ($\nu=3$). To the best of our knowledge it is an open problem whether analogous results hold for the case of rotational symmetry of 3D spherical geometry\cite{Kakarala:2012dt,kaka12jmiv}. See also \citet{Uhrin2021} for an excellent review connecting 3D signal processing and reconstruction of atomic configurations. \subsection{Spectral representations} \label{sub:spectral_rep} As we explained above the set of all $(N-1)$-correlations is complete for $N$ particles, because it is equivalent to the completeness of polynomial basis sets such as MTP\cite{shap16mms}, PIP\cite{bowm+09jcp}, aPIP\cite{vand+20mlst}, ACE\cite{drau19prb,seko+19prb} and NICE\cite{niga+20jcp} (see also Section~\ref{sub:linear-models}). Any of these bases can be expressed in terms of the $\nu$-correlations via a linear transformation, and vice-versa. Even for fixed maximum polynomial degree, these are enormous representations. Depending on how $\nu$-correlation features are chosen their number might scale as rapidly as $\binom{\qmax+\nu}{\nu}$, where $\qmax$ is the number of one-particle features. There is a class of much lower-dimensional descriptor maps based on the eigenspectra of overlap matrices\cite{sade+13jcp,zhu+16jcp} that lifts the degeneracy for the known examples, although their actual completeness is unknown. A simplified construction of these ``spectral representations'' proceeds as follows: First, one constructs an artificial overlap matrix based on the positions of atoms within the $i$-centered environment $A_i$: \begin{equation} \label{eq:overlap-elements} T_{jj'} = f_{\rm cut}(r_{ji}) f_{\rm cut}(r_{i j'}) t(r_{jj'}), \end{equation} where $t : \mathbb{R} \to \mathbb{R}$. Then, one computes the ordered spectrum $\{\tau_k\}_{k=1}^N$ of $T$. If $T$ is invariant (or covariant) $\{\tau_k\}_k$ is an invariant descriptor of $A_i$. Due to eigenvalue crossings, the mapping $A_i \mapsto \{\tau_k\}_k$ is non-smooth, hence one may wish to project it on a smooth basis, e.g. polynomials, \begin{equation} \label{eq:overlap-eva} \rep<n||A_i; \mbf{T}> := \sum_k (\tau_k)^n. \end{equation} The spectral features (or, {\em fingerprints} as they are also called\cite{zhu+16jcp}) $\{ \rep<n||\mbf{T}>\}_{n = 1}^N$ correspond to the moments of the histogram of eigenvalues, and contain precisely the same information. An alternative way to write $\rep<n||T>$ is \begin{equation} \label{eq:goed:defn_Fk_v2} \rep<n||\mbf{T}> = \operatorname{Tr} \mbf{T}^n, \end{equation} which is {\em not} computationally more efficient, but highlights the close connection between $\{\rep<n||\mbf{T}>\}_n$ and the body-ordered features we discussed in previous sections. From \eqref{eq:goed:defn_Fk_v2} we observe that \begin{equation} \label{eq:goed:proj_nbodyhist} \begin{aligned} \rep<1||\mbf{T}> &= N t(0), \\ \rep<2||\mbf{T}> &= \sum_{j_1, j_2} t(r_{j_1 j_2})^2 \cdot f_{\rm cut}(r_{i j_1}) f_{\rm cut}(r_{i j_2}) \\ \rep<3||\mbf{T}> &= \sum_{j_1, j_2, j_3} t(r_{j_1j_2})t(r_{j_2j_3}) t(r_{j_3j_1}) \cdot \prod_{\alpha=1}^3 f_{\rm cut}(r_{i j_\alpha}), \end{aligned} \end{equation} and so forth. That is, $\rep<n||\mbf{T}>$ contains the projection of the histogram of $n$-simplices onto a single basis function. In other words, for $n=2$, the cutoff function $f_{\rm cut}$ and the overlap function $t$ play the role of $R_n$ and $P_l$ in~\eqref{eq:nu2-acsf}. More in general, $\rep<n||\mbf{T}>$ describes $n$-neighbors correlations, and so it could be written, in principle, as a linear combination of a complete set of $\rep|\frho_i^n>$ features. Thus, the $\rep<n||\mbf{T}>$ provide invariant high body-order features at relatively low computational cost, even though each scalar overlap matrix $\mbf{T}$ contains information on a single feature per body order. If one takes $t$ to be scalar (as we have done here) then there are at most $N$ invariant features for $N$ neighbors, but $3N-6$ independent coordinates -- so that the spectral features \eqref{eq:overlap-eva} must be grossly undercomplete. This source of incompleteness is easily lifted by simply taking multiple overlap matrices with different $t$ functions, or taking $t$ to be matrix-valued, as done in Ref.~\citenum{zhu+16jcp}. However, even with that modification in mind, it is not at all understood whether these features are complete or can be made complete with limited modifications. For example it can be shown\cite{Bachmayr2019, niga+20jcp} that {\em most} high-body order features are actually polynomials of low body-order features, which means that they do not contain {\em genuine} high correlation information. This can be observed very easily with a seemingly trivial modification to the spectral representation construction. Consider $N$ particles on the unit-circle at positions $\mbf{r}_{ji}$, as in Fig.~\ref{fig:degeneracy}. In particular we then have only $N-1$ independent variables, which means that a scalar $t$ is {\em in principle} sufficient to identify the configuration. However, choosing \[ T_{jj'} := \cos \theta_{ijj'} \] it is straightforward to see that the two overlap matrices $T$ for the two configurations of Figure~\ref{fig:degeneracy} have eigenvalues $\{0, 0, 1, 3\}$. That is, this particular choice of spectral descriptor is unable to distinguish them nor any two configurations for different $\alpha$. Even for a general atomic environment, $T_{jj'} = r_{ji} r_{j'i} \cos \theta_{ijj'}$ is the Gram matrix of the interatomic distance vectors, which has at most three non-zero eigenvalues -- and hence the collection $(\rep<n||\mbf{T}>)_{n = 1}^N$ contains at most three independent features even though {\em formally}, $\rep<n||\mbf{T}>$ has body-order $n$. For a configuration in which the neighbors lie on a sphere, this case can be written as an overlap matrix by choosing an appropriate, monotonically decreasing $t(r_{jj'})$, and for the general case with an appropriate (albeit contrived) choice of $\fcut$ and $t$. The purpose of these examples is to highlight that, although spectral descriptors offer some attractive features such as their computationally cheap high body-order nature, understanding under which conditions they are {\it complete} is subtle and requires a much deeper investigation. \subsection{Completeness: summary and open challenges} To conclude our discussion of {\em completeness of representations} we briefly review and contrast the two key notions of completeness that we introduced and also mention a third concept that we implicitly encountered in Sec.~\ref{sub:field-completeness}. In the following, let $\bfeat(A) = \{ \rep<q||A>\}_q$ again denote a finite or infinite collection of equivariant features of a configuration or environment $A$. {\it Complete linear basis:} This is the correct notion of completeness of $\bfeat$ for {\em linear models}, $\sum_q \rep<y||q> \rep<q||A>$, such as PIPs, aPIPs, MTP, ACE, NICE. It is now well-understood how to systematically generate such a complete linear basis in a variety of different ways. This is the strongest requirement one can make on a feature set. {\it Geometric completeness:} This is the correct notion of $\bfeat$ completeness for nonlinear models, $\yt(\bfeat(A))$, i.e., it is the minimal requirement to ensure systematic convergence of such a model. Ensuring only injectivity of the mapping $A \mapsto \bfeat(A)$, means it is a much weaker requirement than being a complete linear basis. We therefore expect that complete feature vectors are generally significantly sparser, which is important for the performance of nonlinear regression schemes. At present, there is no systematic construction of minimal geometrically complete feature sets. {\it Algebraic completeness:} We say that {\it $\bfeat$ is algebraically complete} if every element of a complete linear basis $\rep<q||A; \frho_i^\nu>$ can be written as a polynomial of the entries of $\bfeat$, $p_q(\bfeat(A_i))$. This is precisely the concept we used to construct a geometrically complete feature set in the pedagogical example of Sec.~\ref{sub:field-completeness}. The set of invariants used to construct PIP\cite{bowm+09jcp} and aPIP\cite{vand+20mlst} potentials form a minimal algebraically complete descriptor. The concept was also proposed as part of the NICE framework\cite{niga+20jcp} as a mechanism to reduce the size of descriptor set. In general, algebraic completeness is strictly stronger than geometric completeness and an algebraically complete feature set will be larger than a minimal geometrically complete one. It is nevertheless an interesting and useful concept: (i) it provides a stepping stone towards a theoretical understanding of geometric completeness; (ii) for the purpose of effective regression schemes it may in fact prove to be more important since it preserves polynomials, while inverting a minimal geometrically complete descriptor is likely to introduce singularities. Indeed, reducing algebraic dependence is a common technique in the signal processing literature. \citet{Uhrin2021} reviews those techniques and modifies them for the construction of descriptors with relatively few entries, that can in principle be made complete. \begin{figure*} \centering \includegraphics[width=0.31\linewidth]{fig14_1.pdf}\ \includegraphics[width=0.31\linewidth]{fig14_2.pdf}\ \includegraphics[width=0.31\linewidth]{fig14_3.pdf}\\ \includegraphics[width=0.31\linewidth]{fig14_4.pdf}\ \includegraphics[width=0.31\linewidth]{fig14_5.pdf}\ \includegraphics[width=0.31\linewidth]{fig14_6.pdf}\\ \caption{Visualizing crystallization in a million-atoms simulation of undercooled iron (data from Ref.~\citenum{shib+16am}). The inset shows a KPCA map of the environments, and the atoms are color-coded following the same scheme. Top: map and coloring based on translationally-invariant $\rep<\nlm||\rho_i>$. Bottom: map and coloring based on fully-invariant $\rep<\nnl*||\frho_i^2>$. } \label{fig:shibuta} \end{figure*} \section{Representations, structures, properties and insights} \label{sec:maps} A mathematical representation of the structure of an atomic configuration is not only useful as the starting point of supervised-learning algorithms, aimed at predicting its energy and properties. It can also be used, in combination with unsupervised learning schemes, to compare structures in search for repeating atomic patterns\cite{macq67proc,este+96proc,cafl06cosb,rupp+08ps,gasp-ceri14jcp,rodr-laio14science,murt-cont17wir,gasp+18jctc,piet-mart15jcp,piag-parr18pnas,kahl+18prm,chen+20arc}, to obtain low-dimensional projections that help visualize complex datasets\cite{coif+05pnas,ferg+10pnas,rohr+11jcp,ceri+11pnas,rohr+13arpc,isay+15cm,ramp+17npjcm,lemk-pete19jctc}, and more generally to describe the lie of the land in (free)energy landscapes and interpret structure-property relationships in complex systems\cite{wale03book,karp+93bc,tord-vang94jcc,helf+19jcp,chemrev2021unsupervised}. There is a long-standing tradition of developing domain-specific descriptors to use in the automatic analysis of structural data. For instance, simulations of polypeptides have been interpreted in terms of backbone dihedral angles\cite{rama+63jmb}, discrete secondary-structure categories\cite{fris-argo96peds,kabs-sand83bp}, as well as sophisticated continuous fingerprints of secondary structure and backbone chirality\cite{piet-laio09jctc,piet+11jcc}. Simulations of clusters and condensed-phase systems have often used more general indicators, such as Steinhardt order parameters\cite{stei+83prb}, cubic harmonics\cite{angi+10prb,cari+16pccp}, radial distribution functions (either directly\cite{vall-ogan09jcp,vall-ogan10ac} or in the form of entropy-inspired fingerprints\cite{piag-parr17jcp}), histograms of coordination numbers\cite{ceri+11pnas}, that can be seen as precursors of the atom-density correlation representations that we discuss in Section~\ref{sub:body-order-representations}. More broadly, general-purpose descriptors that can be understood, more or less transparently, as a special case of the density-correlation features $\rep|\frho_i^\nu>$ have been developed and used in unsupervised-learning contexts as much as in the context of regression models. A few examples include the diffraction-based fingerprints of Ziletti et al.\cite{zile+18nc}, the local order metric of Martelli et al.\cite{mart+18prb}, the spectral representations of Sadeghi et al.\cite{sade+13jcp}, the Minkowski structure metric of Mickel et al.\cite{mick+13jcp} (that closely resembles and anticipates the construction of the moment tensor potentials), and the use of SOAP features to analyze materials and molecules\cite{de+16pccp, de+16jci, bern+19acie}. \begin{figure*} \centering \includegraphics[width=0.8\linewidth]{fig15.pdf} \caption{Comparison of distances between local minimum-energy configurations of various clusters (rows) constructed based on the sorted eigenvalues of the Kohn-Sham Hamiltonian matrix (first row), the overlap matrix (second row), and the Lennard-Jones Hessian matrix, and plotted against a permutation-invariant RMSD. For the overlap matrix, results are shown for matrices based only on $s$-type orbitals (red) and both $s$ and $p$ orbitals (green). Details of the different systems and the fingerprint construction are discussed in Ref.~\citenum{sade+13jcp}. Reproduced with permission from Ref.~\citenum{sade+13jcp}. Copyright 2013 American Institute of Physics. } \label{fig:goedecker-fingerprints} \end{figure*} Understanding the way a representation converts the Cartesian coordinates of atoms into features is necessary to make sense of any subsequent analysis, because any explicit or implicit assumption made in the structure-feature map will be reflected in the unsupervised analyses based on those features\cite{ceri19jcp}. An example of this is given in Figure~\ref{fig:shibuta}, that shows the effect of using rotationally variant or invariant features (respectively, $\rep<\nlm||\rho_i>$ and $\rep<\nnl*||\frho_i^2>$) to analyze a simulation of undercooled iron\cite{shib+16am}. Atoms are colored according to a two-dimensional projection describing the associated environments, in this case obtained using a kernel principal component analysis\cite{scho+98nc} built on the feature vectors $\bfeat(A_i)$. Using orientation-dependent features makes it possible to distinguish more clearly the presence of multiple grains, and would be useful, for instance, to investigate the texture of the nanocrystalline sample, much like one would do with an electron backscattering diffraction analysis. Using invariant features highlights that all nanocrystals have the same structure, and makes it possible to recognize the disordered environments at the grain boundaries. This kind of analysis can also be used to elucidate the properties of different representations, investigating the effect of different choices on the unsupervised analysis of a well-understood system to better appreciate the relation between structure and features. In this Section we summarize recent developments, and identify clear insights, related to the use of representations to determine the similarity between structures, to perform clustering and dimensionality reductions analyses, and to build models that go beyond the injective structure-property map that we have used this far. \subsection{Features, distances, kernels} Before delving into the use of structural representations to visualize and classify atomic configurations, let us recall the link between feature vectors $\bfeat(A_i)$, that are associated to structures or environments, and distances or kernels, that express the relationship between two of these entities. For example, given a feature vector $\bfeat$, it is possible to define a distance using e.g. a Euclidean metric, $\dst(A_i, A'_{i'})^2 = \left\| \bfeat(A_i)-\bfeat(A'_{i'})\right\|^2$, and use as a kernel the scalar product $\krn(A_i, A'_{i'})=\bfeat(A_i)\cdot\bfeat(A'_{i'})$, or a non-linear function, e.g. an exponential of a squared distance $\krn(A_i, A'_{i'})=\exp -\gamma \dst(A_i, A'_{i'})^2$. The opposite is also true: for a given set of configurations $M$, and any (negative definite) distance or (positive definite) kernel\cite{cutu10arxiv} it is possible to construct a set of features that generate the kernel by taking their scalar product -- a practical implementation of the concept of reproducing kernel Hilbert space that underlies kernel methods. One only needs to construct the kernel matrix $K_{ij}=\krn(M_i, M_j)$, and find its eigenvalues and eigenvectors $\mbf{K}\mbf{u}^{(j)} =\lambda_j\mbf{u}^{(j)}$. It is easy to see that the scalar product between the reproducing features \begin{equation} \label{eq:rkhs} \phi^K_j(A) = \sum_{i\in M} \krn(A,M_i) u_i^{(j)}/\sqrt{\lambda_j} \end{equation} computed for two members of the reference dataset yields exactly the value of the kernel function between the two configurations.\cite{scho+98nc} It is also possible to define a kernel-induced distance \begin{equation} \dst(A,A')^2 = \krn(A,A)+\krn(A,A')-2\krn(A,A'). \end{equation} Even though different techniques may be formulated more naturally in terms of features, distances or kernels, it is always possible to translate -- at least approximately -- one description into another. \subsection{Measuring structural similarity} \label{sub:measuring-similarity} Most unsupervised learning algorithms rely on the definition of a metric to tell apart structures depending on their similarity. A metric that is capable of identifying identical structures is extremely useful in all the applications that aim at automating the search of materials or molecules with desirable properties\cite{ogan-glas06jcp,amsl-goed10jcp,pick-need11jpcm,curt+18jctc,ogan+19nrm}. This is not an entirely trivial task: in molecular searches, a mismatch in the simple ordering of atomic indices can lead to the failure of metrics based on the alignment of conformers, such as the root mean square distance (RMSD), and the exact calculation of a permutation invariant version would involve combinatorially increasing computational effort.\cite{sade+13jcp}. In the case of condensed phases, one needs to deal with the problem that the same periodic structure can be described by different choices of unit cell size and orientation. The requirements for a metric to compare atomic structures are similar to those discussed in Section~\ref{sec:history-wishes}, and have been discussed in great detail in Ref.~\citenum{sade+13jcp}: a good metric needs to be invariant to rotations, translations, and permutations\cite{ferr+15jcp}, and still be capable of telling distinct structures apart\cite{zhu+16jcp}. The comparison between the resolving power of different metrics has been often determined using distance-distance correlation maps\cite{sade+13jcp,de+16pccp,pozd+20prl,pars+20mlst}, such as those shown in Figure~\ref{fig:goedecker-fingerprints}, that compare the distance between pairs of structures in a reference dataset, as computed by two metrics. In the most extreme case, one observes pairs structures that are identical based on a metric, and distinct based on another -- indicating the presence of a manifold of degenerate structures that are distinct, but cannot be told apart by one of the distances\cite{pozd+20prl}. \begin{figure} \centering \includegraphics[width=1.0\linewidth]{fig16.pdf} \caption{Distance-distance correlation plots comparing the average environment distance~\eqref{eq:d-average} to the best-match~\eqref{eq:d-bestmatch} and REMatch~\eqref{eq:d-rematch} distances, with different values of the entropy regularization parameter $\gamma$. The reference structures are taken from the QM7b dataset of small organic molecules\cite{mont+13njp}, and the environments are described by SOAP features $\rep<\ennl||\frho_i^2>$. Reproduced with permission from Ref.~\citenum{de+16pccp}. Copyright 2016 PCCP Owner Societies. } \label{fig:qm7-rematch} \end{figure} \begin{figure*} \centering \includegraphics[width=1.0\linewidth]{fig17.pdf} \caption{Each map describes a set of 156 low-energy polymorphs of 21 different isomers of azaphenacene. The configurations are the same subset of the structures from Ref.~\citenum{yang+18cm} that was used in Ref.~\citenum{helf+20mlst}. Each point corresponds to a structure, color-coded based on its lattice energy, and with a symbol that indicates the number of hydrogen bonds per molecule, identified with a self-consistent definition\cite{gasp-ceri14jcp}. The top row reports the first two principal components from a principal component analysis of SOAP $\rep|\frho_i^2>$ structures. The bottom row shows maps obtained using KPCovR\cite{helf+20mlst}. Each column is computed using different SOAP hyperparameters, as indicated in the plot titles. } \label{fig:aza-pcov} \end{figure*} An important aspect when defining a metric for structural comparison is the fact one is often interested in measuring the dissimilarity between entire structures, $\dst(A,A')$. Most of the representations we discussed this far are designed to compare atom-centered environments, and therefore yield $\dst(A_i,A'_{i'})$. As a practical example, we define $\dst$ as the Euclidean distance between the feature vectors, \begin{equation} \dst^2(A_i,A'_{i'})\equiv \left\| \bfeat(A_i)-\bfeat(A'_{i'})\right\|^2 \label{eq:dist-rep}. \end{equation} Different ways of combining atom-centered representations to obtain a structure-level comparison are discussed and benchmarked in Ref.~\citenum{de+16pccp}, using a construction based on the definition of global \emph{kernels}. Here we present the same strategies, but express them directly in terms of distances. The two formulations are equivalent when using the kernel-induced distance. The simplest global distance can be defined as a mean over all environment pairs, \begin{equation} \bar{\dst}^2(A,A') = \frac{1}{N_A N_{A'}}\sum_{i\in A, i'\in A'} \dst^2(A_i,A'_{i'}). \label{eq:d-average} \end{equation} Using the abstract notation $\rep|A_i>$ rather than $\bfeat(A_i)$ to highlight the connection with the definition of the global representation $\rep|A; \frho^{2}>$ as the sum of environmental $\rep|A; \frho_i>$ (see Section~\ref{sub:translational-sym}) it is easy to see that \begin{multline} \bar{\dst}^2(A,A') = \frac{1}{N_A N_{A'}}\sum_{i\in A, i'\in A'}\|\rep|A'_{i'}>-\rep|A_i>\|^2 = \\ \left[ \sum_{i\in A} \frac{\rep|A_i>}{N_A} - \sum_{i'\in A'} \frac{\rep|A'_{i'}>}{N_{A'}} \right]^2 \equiv \|\rep|\overline{A'}>-\rep|\overline{A}>\|^2, \end{multline} i.e. that the average environment distance $\bar{\dst}^2(A,A')$ can be computed by taking the Euclidean distance between the mean of the environment's features in the two structures. This construction is very natural, and consistent with an additive decomposition of properties in a regression model, but potentially lacks resolving power: two structures with very different environments could end up having a similar value of the average feature vector. An alternative way to determine a global metric involves finding the best match between the environments of the two structures, defining \begin{equation} \!\!\!\hat{\dst}^2(A,A') =\!\! \operatorname*{argmin}_{\mbf{P}\in\mathbb{U}^{N_A\times N_{A'}} }\sum_{i\in A, i'\in A'} \!\!\!\dst^2(A_i,A'_{i'}) P_{ii'}~\label{eq:d-bestmatch} \end{equation} where $\mathbb{U}^{N_A\times N_{A'}}$ is the set of $N_A\times N_{A'}$ doubly-stochastic matrices, i.e. matrices with positive entries such that sums of rows and columns all equal $1/N_A$ and $1/N_{A'}$ respectively. When $N_A=N_{A'}$, the optimal $\mbf{P}$ contains only zeros and $1/N_A$, and the problem can be construed as a linear assignment problem, and solved in $O(N_A^3)$ time using the Hungarian algorithm\cite{kuhn55nrlq}. Much like the case of the use of sorted interatomic distances as a structural representation (Section~\ref{sub:smoothness}), the process of matching entries in the environment distance matrix introduces discontinuities in the derivatives of the distance metric. One can solve this problem, obtaining at the same time a scheme with a cost that scales as $O(N_A^2)$ and that can be applied to the comparison of structures of different sizes, by introducing an entropy regularization in Eq.~\eqref{eq:d-bestmatch} \begin{equation} \hat{\dst}^\gamma(A,A')^2 =\!\!\!\! \operatorname*{argmin}_{\mbf{P}\in\mathbb{U}^{N_A\times N_{A'}} }\!\sum_{i\in A, i'\in A'}\!\!\!\!\!\! P_{ii'}(\dst^2(A_i,A'_{i'}) +\gamma \ln P_{ii'}), ~\label{eq:d-rematch} \end{equation} controlled by the magnitude of the parameter $\gamma$. This approach was introduced in Ref.~\citenum{cutu13nips} for the general problem of solving optimal transport problems and of evaluating the Wasserstein distance between probability distributions, and was first applied in Ref.~\citenum{de+16pccp} to atomistic problems in terms of regularized entropy match (REMatch) kernels. By introducing a non-additive combination of the environments, REMatch kernels and the associated distances offer an increased resolving power compared to the plain average distance~\eqref{eq:d-average}, as demonstrated in Figure~\ref{fig:qm7-rematch}. The figure also shows that Eq.~\eqref{eq:d-rematch} interpolates between the average and the best-match metrics, to which it tends respectively for $\gamma\rightarrow\infty$ and $\gamma\rightarrow 0$. \subsection{Representations for unsupervised learning} As stressed in the introduction of this Section, in performing cluster analysis or dimensionality reduction, the choice of featurization is not a neutral one, but introduces a bias that will be visible in the end result of the analysis.\cite{ceri19jcp}. While sometimes this bias is desirable, such as in Fig.~\ref{fig:shibuta} in which a judicious choice of features makes it possible to emphasize, or ignore, the orientation of grains in a polycrystalline sample, one should resist the temptation to fine-tune parameters that do not have an obvious meaning to obtain a result that reflects a preconceived interpretation of the data. The top row of Fig.~\ref{fig:aza-pcov} shows how different choices of the hyperparameters of the SOAP powerspectrum (cutoff radius $\rcut$, density smearing $\sigmaa$, and the types of atoms that are used as environment centers) change unpredictably the distribution of the points on the 2D map obtained by principal components analysis of a dataset that consists in different polymorphs of a family of molecular materials\cite{yang+18cm}. In the first panel, in particular, one can recognize a degree of correlation between the position of the points, and intuitive structural and energetic properties, such as the number of H-bonds, and the lattice energy. The correlation is however far from perfect, and with other reasonable choices of hyperparameters it disappears almost completely. One possible approach to make unsupervised models less dependent on the details of the underlying featurization is to combine them with an element of supervised learning. This includes, for instance, combining or contrasting density-based clustering with (kernel) support vector machines classification\cite{helf+19fmb}. Even more explicitly, one can combine a variance-maximization scheme analogous to PCA with the regression of a target property, as in principal covariates regression (PCovR)\cite{dejo-kier92cils}. In PCovR one minimizes a loss built as a mixture of a PCA and a linear regression loss, weighted by a mixing parameter $\alpha$ \begin{multline} \ell = \sum_i \alpha \left\|\bm{\Xi} - \bm{\Xi} \mbf{P}_{\Xi T}\mbf{P}_{T\Xi }\right\|^2 \\+ (1-\alpha) \left\|\mbf{Y} - \bm{\Xi} \mbf{P}_{\Xi T}\mbf{P}_{TY}\right\|^2 \label{eq:pcovr-loss}. \end{multline} The matrix $\mbf{P}_{\Xi T}$ projects from the feature space to a low-dimensional latent space, $\mbf{P}_{T\Xi}$ reconstructs an approximation of the full-dimensional feature vector based on its latent-space embedding, and $\mbf{P}_{TY}$ regresses the property matrix $\mbf{Y}$ using the latent-space coordinates as inputs. By explicitly looking for a latent-space projection that allows to regress linearly a target property, one forces the dimensionality reduction to identify a subspace of the chosen features that correlates well with one or more quantities of interest. The lower row of Fig.~\ref{fig:aza-pcov} is obtained using a recent kernel extension of this method (KPCovR\cite{helf+20mlst}) attempting simultaneously to maximise the spread of data and the kernel regression of the lattice energy, giving equal weight to the two components ($\alpha=0.5$). Not only points on the resulting map correlate very well with the target: one observes that also structural parameters such as the H-bond counts are now clearly separated between different regions, and the appearance of further groups of well-clustered structures that correspond to similar isomers of azaphenacene\cite{helf+20mlst}. What is perhaps more important, introducing an explicit supervised learning target leads to maps that are more consistent across different choices of hyperparameters. Thus, (K)PCovR reduces the arbitrariness of the description, and mitigates the risk of implicitly introducing an unknown bias by deliberate or accidental tuning of the hyperparameters of the representation. \begin{figure}[tbhp] \centering \includegraphics[width=1.0\linewidth]{fig18.pdf} \caption{ (a) A sketch-map\cite{ceri+11pnas} representation of the QM7 molecular dataset\cite{mont+13njp} based on a SOAP kernel distance. Each point corresponds to one molecule. Left: points are colored according to the atomization energy; right: points are colored according to composition. Adapted with permission from Ref.~\citenum{de+16pccp}. Copyright 2016 PCCP Owner Societies. (b) Principal component analysis (PCA) on the multiple layers of a deep NN learning simultaneously the 14 properties of the QM7 molecular dataset, using Coulomb matrix features as representation. Each point (molecule) is colored according to the rule: $E$ and HOMO (highest occupied molecular orbital energy) large $\rightarrow$ red; $E$ large and HOMO small $\rightarrow$ blue; $E$ small and HOMO large $\rightarrow$ green; $E$ and HOMO small $\rightarrow$ black. The NN extracts, layer after layer, a representation of the chemical space that better captures the multiple properties of the molecule. Reproduced from Ref.~\citenum{mont+13njp}. Copyright 2013 American Chemical Society. } \label{fig:montavon-qm7} \end{figure} \begin{figure}[tbhp] \centering \includegraphics[width=1.0\linewidth]{fig19.jpg} \caption{2D maps obtained applying the t-SNE dimensionality reduction algorithm\cite{maat-hint08jmlr} to three different molecular datasets -- the systematic enumeration of 9-non-H-atoms molecules in QM9\cite{rama+14sd}, the conformers of aminoacids in the Berlin aminoacid dataset AA\cite{ropo+16sd} and the large molecules extracted from the Cambridge structural dataset of the OE dataset\cite{scho+16jpcl} . Panel (a) uses a Coulomb matrix representation, panel (b) uses the MBTR features\cite{huo-rupp17arxiv}. Reproduced with permission from Ref.~\citenum{stuk+19jcp}. Copyright 2019 American Institute of Physics. } \label{fig:datasets-maps} \end{figure} \subsection{Analyzing representations and datasets} The unsupervised analysis of a dataset helps building an intuitive understanding of complicated structure-property relations for a material or a class of materials. Given the ``black box'' nature of many machine-learning models (and the fact that even the rigorously-defined density correlation features we focus on in this review have a high-dimensional nature and non-trivial relationship to the actual atomic structure) low-dimensional projections of the feature space can also be useful to gain a better understanding of the structure of feature space. For example, Fig.~\ref{fig:montavon-qm7}a tells us less about the QM7 dataset\cite{mont+13njp} (that contains small organic molecules containing C, H, N, O, S, Cl) than about the SOAP features that underlie the representation: the unsupervised analysis shows that the chemical composition is the most clear-cut differentiating characteristic when looking at this dataset through SOAP lenses. Fig.~\ref{fig:montavon-qm7}b visualizes the same QM7 data using a different representation, based on the Coulomb matrix, and shows how successive layers of a neural network transform these features into non-linear combinations that correlate very well with the target properties. Thus, this visualization helps understand how a highly-nonlinear function transforms a description of the system into combinations that can be more easily used for regression, and diagnose the inner workings of the deep neural network. A final ``introspective'' application of this kind of analysis involves examining the structure of a dataset -- not as a way to learn about the atomistic configurations it contains, but about its makeup, or the relationship with other datasets. An example is given in Fig.~\ref{fig:datasets-maps}, showing the comparison between the chemical space covered by three databases of organic molecules, with QM9 and AA being mostly disjoint, and the more diverse OE molecules encompassing both the other sets. Other examples of this kind of analysis are discussed in Section~\ref{sec:applications}. \begin{figure} \centering \includegraphics[width=1.0\linewidth]{fig20.pdf} \caption{A schematic overview of the process of using atomic structure representations to predict properties that are not directly associated with the starting structure. (a) prediction of the properties of the minimum-energy configuration of a structure; the problem can be made well-posed by using a cheap approximate method to optimize the structure, and taking the representation of this approximate structure as the input to regress accurate energy and geometry. (b) prediction of a property that is associated with a thermodynamic average; the minimum energy structure can be taken as a proxy for the ensemble, but a more formally precise ``ensemble representation'' is also possible. } \label{fig:indirect} \end{figure} \subsection{Indirect structure-property relationships} \label{sub:indirect-struc-prop-rel} The one-to-one mapping between an atomic structure and its representation is one of the key requirements to achieve accurate ``surrogate quantum models'' of atomic-scale properties. However, it can also be a limitation whenever one wants to describe properties that are not strictly associated with the specific configuration at hand. For example, consider the databases of molecular properties (e.g. the QM9 dataset\cite{rama+14sd}) that have been extensively used as a benchmark, and have been a powerful driving force behind the development of the representations we describe here. The typical benchmark involves taking a structure whose geometry has been optimized at the DFT level and use it to predict the DFT energy -- an exercise that is manifestly of little practical utility. A more useful approach, instead, would be using a non-optimized structure to predict the properties of the nearest local configurational optimum. As shown in Fig.~\ref{fig:indirect}a, this is conceptually problematic, because we are now trying to achieve a many-to-one mapping. A possible solution is to map each distorted geometry to an idealized one, or to use a lower level of theory to determine an unique structure $\tilde{A}_0$. Thus, the many-to-one mapping is realized by the local optimization procedure, and the corresponding representation $\rep|\tilde{A}_0>$ can be used to uniquely identify the entire basin of attraction of the local minimum. Only for the training structures, this geometry is optimized further at a higher level of theory, obtaining the structure $A_0$ for which properties are meant to be computed. When the model is fitted, the relationship between $\tilde{A}_0$ and its high-quality counterpart is learned implicitly. This kind of ``indirect'' model has been used, for instance, in Ref.~\citenum{bart+17sa}, where structures optimized at the semiempirical PM7\cite{stew13jmm} level were used to predict CCSD energetics computed for a DFT-optimized version of the same compound. While the error was almost twice as large as a model using directly $\rep|A_0>$ as input, chemical accuracy could be reached when discarding \emph{from the training set} structures for which the DFT-optimized structure was too different from the PM7-optimized geometry. A similar conceptual problem arises when one wants to build models for properties that are associated with a thermodynamic state rather than a precise structure, such as a melting point or solubility of a material. The problem is very well understood in the context of cheminformatics, where molecular-graph descriptors can be thought as representing the entire set of molecular conformers. In the technique known as 4D-QSAR, ``ensembles'' of conformers are used to build fingerprints that encompass explicitly the structural variability of each compound\cite{andr+10m}. These two approaches can also be applied while using the kind of representations discussed in the present review. Typically, and particularly if the ensemble consists in relatively small fluctuations around equilibrium, one might take a representative structure (e.g. the minimum energy configuration) and use its $\rep|\tilde{A}_0>$ as a proxy of the thermodynamic state (Fig.~\ref{fig:indirect}b). The case in which the target property can be estimated as an ensemble average can be formulated very elegantly in the case of a linear model. Consider for instance the mean of a property $y$ over the Boltzmann distribution at inverse temperature $\beta$, $P(A)= e^{-\beta E(A)}/Z$, \begin{equation} \langle y\rangle_\beta \equiv \frac{1}{Z}\int \D{A} e^{-\beta E(A)} y(A) \end{equation} where $Z=\int \D{A} e^{-\beta E(A)}$ is the canonical partition function. Exploiting the linear nature of the representation one can define an ``ensemble ket'' \begin{equation} \rep|A; \beta> \equiv\frac{1}{Z} \int \D{A} e^{-\beta E(A)} \rep|A>. \end{equation} With this definition, one could use a linear model for $y(A)$ with weights $\rep<q||y>$ and see that \begin{equation} \langle y\rangle_\beta\approx \sum_q \rep<y||q>\rep<q||A; \beta>, \end{equation} which is convenient because it allows using properties of configurations and of ensembles on the same footings -- and possibly combining them in a single training exercise. The same approach can also be applied in a kernel setting, computing the ensemble average of the reproducing kernel Hilbert space vector associated with the structures. \section{Efficiency and effectiveness} \label{sec:efficiency} We have discussed in Section~\ref{sec:history-wishes} how most of the existing choices of representations share profound similarities, and shown, in Section~\ref{sec:symmetry-fields}, that many alternative schemes can be formally related to each other by means of a linear transformation, smoothening or a limit operation. However, this is not to say that in practical applications they are entirely equivalent. The computational cost of evaluating them, and their performance in classifying structures, and in regressing their properties, is determined by the choice of basis functions. Even for formally equivalent representations, the condition number of the linear transformation between them and their corresponding bases have significant impact on the numerical behavior of the computed coefficients and the quantities derived from these coefficients. \begin{figure*} \centering \includegraphics[width=1.0\linewidth]{fig21.pdf} \caption{(a) a $4\times4\times4$ Si cell, that is taken as the reference structure for radial and tangential perturbation of the neighbors of the central atom. (b,c) Norm of difference of atomic descriptors on atom i as a neighboring atom j is perturbed from its reference position. (b) A radial perturbation yields a linear change in the features; (c) a tangential perturbations in a high symmetry direction for the first shell yields a quadratic change in the features. Reproduced with permission from Ref.~\citenum{onat+20jcp}. Copyright 2020 American Institute of Physics. } \label{fig:sensitivity} \end{figure*} \subsection{Comparison of features}\label{sub:feat-compare} A preliminary question when comparing alternative choices of features for the description of atomic structures and/or environments is that of establishing an objective way of assessing their relative merits. The performance when used in the regression of useful atomic-scale properties is an obvious criterion, but such a comparison is intimately intertwined with the target property and the regression algorithm.\cite{fabe+17jctc,nguy+18jcp,zuo+20jpcl}. Very recent efforts have attempted to characterize different representations in terms of their information content -- for instance through the eigenvalue spectrum of the covariance or kernel matrix associated with a dataset, the decrease in accuracy when reducing the number of features\cite{onat+20jcp}, or the sensitivity of the features to atomic displacements. This latter approach can be realized by directly comparing the separation in feature space against finite displacements of the atoms\cite{onat+20jcp}, or through an analysis of the Jacobian $J_{jk}=\partial\rep<k||A_i>/\partial \mbf{r}_j$\cite{pars+20mlst}. The sensitivity of the features to small changes of the atomic positions indicates their usability and performance in regression of classification tasks. \citet{onat+20jcp} analysed the effect of random perturbations in crystalline environments, finding that, for features based on atomic density correlations, displacements of atoms in the environment usually cause a linear response. One notable deviation from this trend are perturbations along some high-symmetry directions in atomic environments carved from perfect crystals, where the response to displacements is second-order, implying that the representations cannot capture these types of deformations (Fig.~\ref{fig:sensitivity}). However, as discussed in reference~\citenum{onat+20jcp} the types of symmetric deformations applied in the study correspond to reflection operations. Due to the body-correlation order considered, features are invariant to mirror symmetry, and so the observed loss of sensitivity is not unexpected. Analizing the response of the features to perturbations in terms of the Jacobian, as in Ref.~\citenum{pars+20mlst}, has the advantage of characterizing fully the sensitivity at a given point. The Jacobian should have six zero principal values, corresponding to rigid rotations and translations of the environment. Additional zeros could be associated with the presence of a continuous manifold of degenerate structures. In some cases, as demonstrated by the finite-displacement deformation in Fig.~\ref{fig:sensitivity}b, high-symmetry configurations can result in directions with zero gradient that have no adverse effect on the accuracy of a model built on the density correlation features. Another comparison between different bases is to analyse the landscape defined by the similarity or distance between environments, $\dst(A_i,A'_{i'})$ where the environment $A_i$ is kept fixed. The distance between the atom-centered environments $A_i$ and $A'_{i'}$ can be defined as the Eucledian distance between feature vectors, Eq.~\eqref{eq:dist-rep}. Written as a function of the Cartesian coordinates of $A'_{i'}$, $\dst(A_i,A'_{i'})$ is a scalar field which will have a global minimum manifold where the field is exactly zero, corresponding to equivalent environments $A_i$ and $A'_{i'}$ that are related by symmetry operations. Whether there are other manifolds at exactly $\dst(A_i,A'_{i'})=0$, corresponding to the same features resulting from symmetrically nonequivalent environments is related to the question of completeness (Section~\ref{sub:geo-completeness}). In practical applications, the shape of the global minimum manifold has also implications for the numerical evaluation. In particular, one could examine how different $A_i$ and $A'_{i'}$ may be for $\dst(A_i,A'_{i'}) < \epsilon$ where $\epsilon$ is a small number. Using a random search approach, the numerical sensitivity of the feature landscape has been analysed in Ref~\citenum{bart+13prb}. Reference structures $A_i$ were perturbed and then reconstructed by minimising the distance $\dst(A_i,A'_{i'})$, and the optimised structures compared to the reference ones. For small numbers of neighbors in the reference environment, all the examined representations performed similarly well, but only SOAP was capable of accurately reconstructing the reference environments of more than 12 neighbors. As we have seen in earlier sections, this differences can be attributed to the choice of basis functions other representations use, although it should be noted that SOAP distances and similarities converge in the limit of a complete basis, therefore the actual form of the basis might affect the convergence, and the computational cost of the representation, but does not impact its resolving power. \begin{figure}[tbp] \includegraphics[width=1.0\linewidth]{fig22.pdf} \caption{ (a) Schematic depiction of the interpretation of the error (GFRE, Eq.~\eqref{eq:GFRE}) and the distortion (GFRD, Eq.~\eqref{eq:GFRD}) that describe the relationship between two feature spaces. (b) Comparison between density correlation features of different order, as well as the NICE features\cite{niga+20jcp} up to $\nu=4$, computed in terms of the GFRE and GFRD, for a data set of random \ce{CH4} configurations\cite{matcloud20a} and hypothetical carbon allotropes predicted by AIRSS\cite{pick-need11jpcm,matcloud20b}. Adapted from Ref.~\citenum{gosc+21mlst}. Copyright 2021 IOP Publishing under Creative Commons Attribution 4.0 International License \url{https://creativecommons.org/licenses/by/4.0/}. \label{fig:gfrm-bodyorder}% } \end{figure} A more explicit comparison between pairs of representations can be obtained by evaluating the error one incurs when using a set of features, arranged in a feature matrix $\bm{\Xi}$ in which each row corresponds to a sample in a reference dataset, to linearly reconstruct a second featurization of the same structures or environments $\bm{\Xi}'$, defining a global feature space reconstruction error \begin{equation} \text{GFRE}(\bm{\Xi},\bm{\Xi}') = \min_{\mbf{P}} \sqrt{{\norm{\bm{\Xi}'_\text{test} - \bm{\Xi}_\text{test} \mbf{P} }^2}/n_\text{test}}. \label{eq:GFRE} \end{equation} $\mbf{P}$ is a linear regression weight matrix obtained on a training subset of the rows of $\bm{\Xi}$ and $\bm{\Xi}'$, and both sets of features are assumed to be standardised.\cite{gosc+21mlst} The GFRE can be extended to also incorporate non-linearity in the mapping, either by a locally-linear approach, or by using a kernelized version. Loosely speaking, it measures the relative amount of information encoded by the two feature spaces, and is not symmetric. $\text{GFRE}(\bm{\Xi},\bm{\Xi}')\ll\text{GFRE}(\bm{\Xi}',\bm{\Xi})$ indicates that the featurization underlying $\bm{\Xi}$ is more informative than that used to build $\bm{\Xi}'$, and vice versa. $\text{GFRE}(\bm{\Xi},\bm{\Xi}')\approx\text{GFRE}(\bm{\Xi}',\bm{\Xi})\approx 0$ implies that the two featurizations contain similar information (Fig.~\ref{fig:gfrm-bodyorder}a). A similar asymmetric measure of similarity between feature spaces can be defined by comparing the resolving power of the corresponding metrics\cite{glielmo2021arxiv}, translating the information that is present in distance-distance correlation plots (Sec.~\ref{sub:measuring-similarity}) into a quantitative measure of information content. Having $\text{GFRE}(\bm{\Xi},\bm{\Xi}')\approx\text{GFRE}(\bm{\Xi}',\bm{\Xi})\approx 0$ does not mean that $\bm{\Xi}$ and $\bm{\Xi}'$ they are equivalent and can be used interchangeably. One could emphasize more some structural correlations than others: imagine for instance multiplying by a large constant the entries of one column. This kind of distortions, which can have a substantial impact on the performance of models built on $\bm{\Xi}$ or $\bm{\Xi}'$, can be measured by defining a global feature space distortion (GFRD) \begin{equation} \text{GFRD}(\bm{\Xi},\bm{\Xi}') = \min_{\mbf{Q}\in\mathbb{U}} \sqrt{{\norm{\bm{\Xi}_\text{test}\mbf{P} - \bm{\Xi}_\text{test} \mbf{Q} }^2}/n_\text{test}}. \label{eq:GFRD} \end{equation} $\mbf{P}$ is the same projection matrix that enters the definition of the GFRE (so that $\bm{\Xi}\mbf{P}\approx \bm{\Xi}'$), and $\mbf{Q}$ is the unitary transformation that best aligns $\bm{\Xi}$ and the best linear approximation of $\bm{\Xi}'$. \begin{figure*}[tbhp] \centering \includegraphics[width=0.9\linewidth]{fig23.pdf} \caption{Test-set error in the prediction of a linear regression (left) and kernel ridge regression (right) model of the nuclear chemical shieldings of atoms in a set of molecular materials, as a function of the number of features used in the model. Features are selected using the FPS and CUR methods (full lines) from a set of 2520 SOAP features. The shaded areas indicate the range of values obtained varying the mixing parameter $\alpha$ in a principal covariate-augmented version of the methods. Adapted from Ref.~\citenum{cers+21mlst}. Copyright 2021 IOP Publishing under Creative Commons Attribution 4.0 International License \url{https://creativecommons.org/licenses/by/4.0/}. } \label{fig:pcov-cur} \end{figure*} If both GFRE and GFRD are zero, then the linearly independent components of $\bm{\Xi}$ and $\bm{\Xi}'$ are related by a unitary transformation, which implies that distances and scalar products between feature vectors are equal in $\bm{\Xi}$ and in $\bm{\Xi}'$. Figure~\ref{fig:gfrm-bodyorder} demonstrates the use of these measures to compare $\rep|\frho_i^\nu>$ features of different body order. The asymmetry is very clear, with higher-order features containing more information than their lower-order counterparts. Note that -- in view of the linear nature of the mapping -- this is not entirely obvious: formally, $\nu=1$ features are \emph{not} linearly dependent on higher-$\nu$ features, and so these observations reflect the specific nature of the atom-density field whose correlations are being represented, and the nature of the structures in the benchmark datasets. The figure also includes invariants built with the N-body iterative contraction of equivariants (NICE) framework, that are designed to capture most of the information up to high body orders. The truncation of the expansion, that is necessary to keep the evaluation of $\nu=4$ order features affordable, leads to a small residual GFRE when reconstructing the full $\nu=3$ features. The GFRD is rather large between all featurizations, indicating that -- even though higher-order features contain sufficient information to describe lower-order correlations -- they weight the information differently, which is why it is often beneficial to treat different orders of correlation separately in the construction of interatomic potentials.\cite{bart-csan15ijqc,deri-csan17prb,glie+18prb,veit+19jctc} \subsection{Feature selection} \label{sub:feature-selection} Numerical feature vectors $\bfeat(A_i)$ are the result of a basis set expansion of the abstract atom-centered representations, which are, for practical purposes, truncated. A concrete discretization of the symmetrized $\nu$-correlations is obtained by choosing a finite subset from the set of all possible features, \begin{equation} \mbf{q} \subset \mbf{q}_{\rm total} := \big\{ (n_\alpha l_\alpha)_{\alpha = 1}^\nu, \quad \nu \in \mathbb{N} \big\}. \end{equation} (A choice of $(n_\alpha,l_\alpha)_{\alpha}$ naturally induces a choice of $m_\alpha$ and symmetrized features.) The role of the discretization $\mbf{q}$ is very different for linear and nonlinear models and therefore warrants a brief comment: For nonlinear models we typically only require {\em geometric completeness} (see Section~\ref{sec:incompleteness}), which means that the feature set can be chosen to be {\em minimal} but in a way so that all possible configurations, or at least all configurations of interest (e.g. from a training set) can be distinguished in a stable and smooth way. While it is an open problem to characterize precisely what this entails, we generally expect that relatively small feature sets on the order of hundreds for single-species scenarios could be sufficient. On the other hand, converging a linear model requires eventually letting the discretisation $\mbf{q}$ converge to the full feature set $\mbf{q}_{\rm total}$, which in practice leads to a much larger set $\mbf{q}$ and in particular higher correlation-orders $\nu$ to achieve a desired accuracy, e.g. on the order $O(10'000)$ features for single-species models. The additional cost in training and evaluating the features is of course offset by the fact there is no additional cost in evaluating the nonlinear models. Due to the large feature sets the selection of effective subset of $\mbf{q}$ may be even more important in the linear setting. In particular it will be crucial to {\it a priori} choose {\em sparse} subsets of $\mbf{q}_{\rm total}$ rather than tensor-product sets due to the combinatorial explosion of the number of features with high $\nu$ (curse of dimensionality). For example, a total-degree $D$ discretisation, \begin{equation} \label{eq:totaldegree} \begin{aligned} \mbf{q}(\nu^{\rm max}, D) = \big\{ (n_\alpha l_\alpha m_\alpha)_{\alpha = 1}^\nu \,:\,\, \nu \leq \nu^{\rm max} & \\ \sum_\alpha n_\alpha + l_\alpha \leq D \,& \big\} \end{aligned} \end{equation} was used by \citet{Bachmayr2019}, while closely related a priori sparsifications were used by \citet{shap16mms,braa-bowm09irpc} in all cases demonstrating accuracy/performance competitive with or outperforming nonlinear models. \paragraph*{Data-driven selections} When using high-body order features, some of the components can be related by non-trivial linear dependencies, that can be enumerated numerically\cite{Bachmayr2019,niga+20jcp}. The construction does not ensure that there is no other linear dependence that is specific to a given dataset, meaning that feature vectors could potentially be compressed even further without noticeable deterioration in the quality of the representation. The benefits of the compression are clear: if only a few components need to be evaluated, significant efficiency gains may be realised both in computational effort and storage requirements. Thus, the objective of feature selection or truncation is to find a subset of features that retain the information content of the original, untruncated representation. This is to be contrasted with dimensionality reduction techniques, that apply a linear transformation on the full feature vector to generate a lower dimensional representation. These only reduce the computational cost of operations that are applied on the reduced feature vectors: the whole feature vector must be evaluated first, before being able to determine its projections. A simple example of a feature selection strategy is the farthest point sampling (FPS) technique\cite{elda+97ieee}. One chooses an initial column $\bfeatc_{c_0}$ (indexed by $c_0$) of the feature matrix, and then iterates selecting the columns that maximize the Haussdorf distance to the previously selected columns \begin{equation} c_{m+1} = \operatorname{argmax}_j \left\{ \min_{i \in \mbf{c}_m}\left\|\bfeatc_i - \bfeatc_j\right\|\right\}, \end{equation} effectively identifying the indices $\mbf{c}$ of the features that have the most diverse values across the data set. FPS has also been used in a similar manner, but on the rows of $\bm{\Xi}$ in order to select a representative set of data points.\cite{ceri+13jctc,bart+17sa,de+16pccp} The CUR matrix decomposition\cite{maho-drin09pnas}, instead, generates a low-rank approximation of the feature matrix $\bm{\Xi}$, in the form \begin{equation} \bm{\Xi} \approx \mathbf{C} \mathbf{U} \mathbf{R}. \end{equation} Unlike singular value decomposition, CUR uses the actual columns ($\mathbf{C}$) and rows ($\mathbf{R}$) of $\bm{\Xi}$. To make the selection, a \emph{leverage score} is associated with each feature $c$ \begin{equation} \pi_c = \frac{1}{k}\sum_{i=1}^{k} (\mathbf{v}_{i})_c^2 \textrm{,}\label{eq:cur-leverage} \end{equation} based on the right singular vectors $\mathbf{v}_i$ of the singular value decomposition of $\bm{\Xi}$. $k$ is usually taken to be the approximate rank of $\bm{\Xi}$. Features may be selected in a probabilistic procedure or simply based on their score. Imbalzano \textit{et al}.\cite{imba+18jcp} argued that the scores associated with feature vector components which are linearly dependent are close, therefore the selection can easily result in a redundant set. Instead, in Ref.~\citenum{imba+18jcp} a greedy algorithm based on the CUR decomposition was suggested, where features were selected iteratively. The feature with the highest score is selected, and the columns of $\bm{\Xi}$ are orthogonalised relative to the column corresponding to the selected feature. The scores are updated in each step, so the linear dependence of already selected features are removed. This iterative scheme often performs better when using a very small value of $k$ in constructing the $\pi_c$, Eq.~\eqref{eq:cur-leverage}. Fig.~\ref{fig:pcov-cur} shows that a data-driven selection of the most relevant/diverse features makes it possible to achieve models with an accuracy that approaches that of the full model while reducing the number of components by a factor of about 3 (for linear regression) or 10 (for KRR). Particularly for intermediate sizes of the selection, the improvement in accuracy with respect to a random selection can be dramatic. Both FPS and CUR methods can be improved further by incorporating information on the properties associated with the structures,\cite{cers+21mlst} as in Eq.~\eqref{eq:pcovr-loss}. Including a supervised component by setting $\alpha<1$ in the feature selection usually leads to more performing models, as shown in Fig.~\ref{fig:pcov-cur}. Feature selection methods can be applied to any flavor of density correlation features. Imbalzano \textit{et al}.\cite{imba+18jcp} used a reference data set on liquid water\cite{mora+10pnas} and a large set of systematically generated ACSFs. Evaluating the RMSE of the predicted energies and forces revealed that automatic selections performed by a CUR or FPS approach may achieve similar performance to features selected based on chemical intuition and heuristics, while keeping approximately the selection size. A dramatic reduction in numbers of features is also possible for the SOAP power spectrum, and a data-driven selection of the most important components has quietly become commonplace to accelerate SOAP-based ML models\cite{wilk+19pnas,enge+19pccp,benm+20prb}. A more systematic investigation of the effectiveness of feature selection for many commonly used atomic descriptors has been recently reported by \citet{onat+20jcp}, who analysed how accurately the original feature vector can be reconstructed from the reduced set, as well as the performance on a practical regression task. \begin{figure}[tbhp] \includegraphics[width=1.0\linewidth]{fig24.pdf} \caption{\label{fig:lc-rcut} Learning curves for the atomization energy of molecules in the QM9 data set\cite{rama+14sd}. Four of the lines show the MAE on the test set for kernel regression models based on SOAP ($\rep|\frho_i^2>$) features with different cutoff radii (dashed lines graduating from red to blue). The other lines show the MAE on the test set for the optimal radially-scaled (RS) and multiple-kernel (MK) SOAP models (black and grey lines respectively). In every model, the features were constructed with very converged hyperparameters, $\nmax = 12$ and $\lmax=9$. The inset shows the radial-scaling function $u(r)$ from $r = 0$\AA{} to $r = 5$\AA{} with the parameters that were found to minimize the ten-fold cross validation MAE on the optimization set through a grid search, $r_0 = 2$\AA{} and $m = 7$. The multiple-kernel model combines the $\rcut= 2, 3, 4$ and RS kernels in the ratio 100'000 : 1 : 2 : 10'000, and the learning curve agrees with the RS result to within graphical accuracy. Error bars are omitted because they are as small as the data point markers. Note that errors are expressed on a per-atom basis. Error per molecule expressed in kcal/mol can be obtained approximately by multiplying the scale by 0.4147, that is computed based on the average size of a molecule in the QM9 database. Reproduced with permission from Ref.~\citenum{will+18pccp}. Copyright 2018 PCCP Owner Societies. } \end{figure} \begin{figure}[tbhp] \includegraphics[width=0.95\linewidth]{fig25.pdf} \caption{\label{fig:lc-fchl} Optimization of the exponents in scaling power laws. a) Out-of-sample MAE for atomization/formation energy predictions as a function of training set size on the QM9 dataset. Learning curves are generated using KRR with a 2-body FCHL representation. The legends indicate the exponent $n_2$ used in the scaling power law, $\xi_2(d)$. Leftb) Out-of-sample MAE for atomization/formation energy predictions as a function of training set size on the QM9 dataset. Learning curves are generated using KRR with a 3-body FCHL representation. The legends indicate the exponent $n_3$ used in the scaling power law, $\xi_3(d)$. In order to compare results to Fig.~\ref{fig:lc-rcut}, the ordinates must be divided by 18. Adapted from Ref.~\citenum{fabe+18jcp}. } \end{figure} \subsection{Feature optimization} \label{sub:feature-optimization} As discussed in \cref{sub:non-linear-model}, non-linear models optimize the description of their inputs by generating new features that are best correlated with the target property, or that are adapted to the structure of the dataset. For instance, taking products of 2-body features results in an effective representation that incorporates some, but not all, features of body order 3, 4\dots In some cases it is possible to find an expression for the effective representation associated with a kernel model\cite{bart+13prb,glie+18prb,chri+20jcp}, while other cases (most notably deep neural network models) put less focus on the interpretability of the intermediate features, and act largely as data-driven `black boxes'. Alternatively, feature optimization can be performed explicitly on the representations presented in \cref{sub:lm-rep}. Such optimization could take the form of the choice of basis functions. In the Behler-Parrinello framework, it is customary to select a small number of atom-centered symmetry functions based on experience and heuristics\cite{behl11jcp}. An optimization of the hyperparameters by gradient descent has also been proposed\cite{gao+19jcp} to obtain more accurate models based on atom-centered symmetry functions. When considering systematically-convergent implementations of density-correlation features, the optimization of the basis set is less crucial, although one may want to reduce the size of the basis for the sake of computational efficiency, as discussed in Section~\ref{sub:feature-selection}. That is not to say that the details of the practical implementation of the features does not change the behavior of a model built upon them. Optimizing hyperparameters such as cutoff radius, density smearing, basis set cutoff, affects how naturally the features correlate with the target property, which is one of the factors determining how quickly a regression model becomes capable of performing accurate predictions\cite{huan-vonl16jcp}. For example, the smearing of the atom density, or the truncation of the basis set, should reflect the natural scale over which the target properties vary. Similarly, the size of the local environment determined by $\rcut$ relates to the typical decay length of interactions, as mentioned in \cref{sub:locality}, but it also changes the effective dimensionality of feature space, which affects the accuracy of the model in a non-trivial way. Consider the learning curves shown in Fig.~\ref{fig:lc-rcut}, that report on the prediction accuracy, as a function of the train set size, for a kernel ridge regression model of molecular atomization energies, based on SOAP features that differ by the value of $\rcut$. A very large cutoff $\rcut=5$\AA{} does not yield the best performance, despite providing information on a wider range of distances. In fact, one observes the need to balance the complexity of the model and the available data: a very short-range $\rcut=2$\AA{} yields the most effective description in the data-poor regime, but the accuracy of the corresponding model saturates due to lack of information on non-covalent interactions. Combining multiple representations in a ``multi-kernel'' model (which is effectively equivalent to concatenating multiple feature vectors, each scaled separately) yields consistently better performances\cite{bart+17sa,paru+18ncomm}. The weighting of different components -- that can be optimized by cross-validation -- indicates the relative importance of correlations on various length-scales. The fact that large-$\rcut$ features carry low weight in the optimal combination suggests that an improvement of performance can be obtained by calibrating the distance-dependent contributions of neighbors to the environment description. This can be achieved by introducing a radial scaling function (indicated as $u(r)$ in Ref.~\citenum{will+18pccp}, as $f(r,r_j,\rcut)$ in Ref.\cite{caro19prb} and as $\xi_\nu(d)$ in Ref.~\citenum{fabe+18jcp}) that downweights the contributions of atoms in the far field. As shown in Fig.~\ref{fig:lc-fchl} for the FCHL representation\cite{fabe+18jcp}, the choice of the form of this scaling can change the accuracy of the model by more than a factor of 2. A similar effect is seen in Fig.~\ref{fig:lc-rcut} for the case of SOAP features. It is also worth noting that the cutoff function usually adopted in Behler-Parrinello-like frameworks decays rapidly well before reaching $\rcut$ -- suggesting that a similar optimization is implicitly at play.\cite{behl11pccp} Optimization of a radial scaling function has become commonplace, and most recent applications based on the SOAP power spectrum rely on it to achieve consistently optimal performance in both the data-poor and data-rich regime. \begin{figure}[tbhp] \includegraphics[width=1.0\linewidth]{fig26.pdf} \caption{\label{fig:lc-elpa} Learning curves for a model of the cohesive energy of a database of elpasolite structures, each containing a random selection of four elements chosen among 39 main group elements.\cite{fabe+16prl} The standard SOAP curve is shown in black, the best curve from Ref.~\citenum{fabe+16prl} is shown in bright red (REF) and the curves obtained with an alchemical model with reduced dimensionality $d_J$ are shown in dark red ($d_J$ = 1), purple ($d_J = 2$) and blue ($d_J$ = 4). The multiple-kernel model (shown in grey) combines three standard SOAP kernels with different cutoff and one alchemically optimized kernel with $d_J=4$. Reproduced with permission from Ref.~\citenum{will+18pccp}. Copyright 2018 PCCP Owner Societies. } \end{figure} \begin{figure}[tbhp] \includegraphics[width=1.0\linewidth]{fig27.pdf} \caption{\label{fig:periodic-elpa} Data-driven representations of the chemical space. (a) A 2D map of the elements contained in the elpasolite data set,\cite{fabe+16prl} with the coordinates corresponding to $\rep<1||a>$ and $\rep<2||a>$ for the case with $d_J = 2$ (see also Fig.~\ref{fig:lc-elpa}). Points are colored according to the group. (b) A periodic table colored according to the coordinates in the 2D chemical space. $\rep<1||a>$ corresponds to the red channel and $\rep<2||a>$ to the blue channel. (c) A periodic table colored according to $\rep<1||a>$ (red channel) for a 1D chemical space. (d) A periodic table colored according to 4D chemical coordinates ($\rep<1||a>$: red channel, $\rep<2||a>$: green channel, $\rep<3||a>$: blue channel, $\rep<4||a>$: hatches opacity) Reproduced with permission from Ref.~\citenum{will+18pccp}. Copyright 2018 PCCP Owner Societies. } \end{figure} Rather than optimizing the correlations between \emph{geometric} features and the target properties, one can attempt to build features that incorporate a notion of chemical similarity between different elements. The idea was introduced in terms of an alchemical similarity kernel in Ref.~\citenum{de+16pccp}, that is also a core component of the FCHL framework\cite{fabe+18jcp}, but has been implemented in different forms in the context of atom-centered symmetry functions\cite{artr+17prb,gast+18jcp,rost+18jcp} and of generic atom-density correlation features\cite{will+18pccp}. In general terms, the idea is to achieve a reduction of the dimensionality of the chemical space, writing formally a (linear) projection of the elemental features \newcommand{\etilde}[0]{\tilde{\e}} \begin{equation} \label{eq:alchemy} \rep<\etilde|=\sum_a \rep<\etilde||a>\rep<a|, \end{equation} where the coefficients $\rep<\etilde||a>$ enact the projection between the elemental and the ``alchemical'' basis. The reduction in the dimensionality of the feature space can be substantial: for powerspectrum ($\nu=2$) features, the number of components scales quadratically with the number of species, and so even just halving the dimension of the chemical space reduces the number of powerspectrum features by 75\%{}: \begin{multline} \rep<\etilde_1 n_1; \etilde_2 n_2; l||\frho_i^2>=\\ \sum_{a_1a_2}\rep<\etilde_1||a_1>\rep<\etilde_2||a_2> \rep<\ennl{}||\frho_i^2>. \label{eq:alchemy-soap} \end{multline} Figure~\ref{fig:lc-elpa} demonstrates how reducing the dimensionality of chemical space helps achieving a transferable, accurate model with a small number of training structures. By comparing learning curves with different degrees of compression, one sees that there is a similar data/complexity interplay as observed for radial correlations. A low-dimensional alchemical space is beneficial in the data-poor regime, as it allows the model to make an educated guess about the interactions of pairs of elements that are not represented in the training set. Learning curves with low chemical complexity, however, saturate in the limit of large training set, because they generate features that are not sufficiently flexible, and cannot describe the differences between elements. The optimization of both geometrical and compositional components of the density-correlation features can be construed as a linear transformation of the kets (or, when seen in terms of the linear kernels built on such features, as the action of a Hermitian operator\cite{will+19jcp}). The requirement that such transformations do not affect the symmetry properties of the features restricts form they can take -- for instance, they cannot mix different $l$ or $m$ dependent channels. These observations imply that (1) \emph{linear} feature optimizations do not change the nature of the representations, and can be applied equally well to any implementation of $\rep|\frho_i^\nu>$ features, (2) as long as the linear transformation is full rank, there is no loss of information, which means that the observed change in performance is linked to the details of the regression scheme, such as regularization in linear or kernel models. As a final remark, let us mention that a critical analysis of a feature-optimization effort often reveals insights into the physical-chemical properties of the system being studied and the target properties. For instance comparing models of the energy using different $\rcut$ can be used to infer relationships between the length and energy scales\cite{bart+17sa}, and the inspection of the chemical mapping coefficients in Eq.~\eqref{eq:alchemy} can be used to construct a data-driven periodic table of the elements (see Fig.~\ref{fig:periodic-elpa}). The use of interpretable, physics-inspired features can also be used to provide intuitive chemical insights by the construction of \emph{knock-out models}\footnote{A knockout mice is a genetically-modified mouse in which one or more genes have been inactivated. The effect on the development of the animal can be used to understand the role played by the affected gene(s).} in which for instance correlations are restricted to 2-bodies, the cutoff reduced to first or second neighbors. The impact of these artificial restrictions on the features information content, and therefore on the asymptotic performance of the model, indicates how important 3 or higher-body order interactions are, or how much long-range effects are relevant to determine the value of the target property.\cite{helf+19jcp} \begin{figure*} \begin{minipage}{0.75\linewidth} \includegraphics[width=1.0\linewidth]{fig28.pdf} \end{minipage}\hfill \begin{minipage}{0.22\linewidth} \caption{Schematic overview of the process of expanding the density in a radial and angular basis set, and recombining those to form spherical invariants (or covariants). Reproduced with permission from Ref.~\citenum{musi+21jcp}. Copyright 2021 American Institute of Physics. \label{fig:expansion-schematics}} \vfill\vspace{32mm}\ \end{minipage} \end{figure*} \subsection{Efficient implementation}\label{sub:implementation} Despite encoding similar information content, the differences in formulation of competing structural representations may lead to large variations in implementation and performance. A first fundamental divide is between evaluation of features by summing over clusters of $\nu$ neighbors and computing $\nu$ tensor products of atomic densities (see \cref{sub:density-trick}). Consider the case of evaluating ``SOAP-like'' ACSF by cluster sum (cost $\nmax^2 \lmax \nneigh^2$) and by density expansion (cost $\nneigh \nmax \lmax^2$ for the density, and $\nmax^2 \lmax^2$ for the SOAP evaluation). Despite the adverse scaling of ACSF computed as a sum over clusters of neighbors, these representations can be implemented efficiently\cite{zuo+20jpcl,nguy+18jcp,Kamath2018} by relying on a careful selection of the features (discussed in \cref{sub:feature-selection}), reuse of parts of the computations, parallelism and GPU acceleration.\cite{sing+19jctc,Gao2020,Lu2020} In fact, when computing a linear model which is explicitly equivalent to a $(\nu+1)$-body order potential, the low-order terms can be more efficiently evaluated as a sum over neighbors\cite{glie+18prb,pozdnyakov2019arxiv} In line with the general focus of this review, we concentrate in particular on the efficient implementation of atom-density representations. As we shall see, roughly the same considerations apply to both those representations that are usually built on a \emph{smooth} atom density,\cite{will+18pccp,will+19jcp,niga+20jcp} that generalize the construction of the SOAP powerspectrum and bispectrum,\cite{bart+13prb} and those that are usually computed in a way that corresponds to a $\delta$-like density, such as ACE\cite{drau19prb,drau20prb} and MTP.\cite{shap16mms,novi+21mlst} Indeed, both families of representations rely on three steps: (i) expansion of the local atom density on a suitable basis, e.g. \cref{eq:density-nlm}, (ii) computation of $\nu$ tensor products of the expansion, and then (iii) contraction over the correlations to obtain equivariant features (Fig.~\ref{fig:expansion-schematics}). While these three steps have been implemented in different ways, their efficient implementation relies on similar considerations. \paragraph*{Atomic density expansion} \Cref{eq:body-order-x} provides the blueprints for a broad class of $(\nu+1)$-body atom-density representation. Practical implementations differ by the type of localized function used to construct the local atom density (see \cref{eq:rhoi-ket}), and by the radial and angular basis used for its expansion. As discussed in \cref{sub:lm-rep}, spherical harmonics are a natural angular basis, but other choices are possible. For instance, the MTP representation projects the atomic density onto a tensor product of direction vectors leading to the covariant \textit{moment tensor}\cite{mick+13jcp,shap16mms} \begin{equation} \mathbf{M}_n^{\otimes \nu}(\rho_i) = \sum_{j\in A_i} P_{n,\nu}(r_{ji})\,\,\underbrace{\hat{\mbf{r}}_{ji}\otimes\hat{\mbf{r}}_{ji}\ldots \otimes\hat{\mbf{r}}_{ji}}_{\nu \text{ times}} \end{equation} where $P_{\mu,\nu}$ is a radial function. \emph{Invariant} components can be obtained by combining and contracting products of the elements of these tensors. The tensor product basis is directly related to spherical harmonics, as shown in appendix B.2 of Ref.~\citenum{Bachmayr2019}. The performance of the MTP representation,\cite{zuo+20jpcl} which relies on an efficient recursive evaluation of the basis functions\cite{shap16mms}, are a testament to the effectiveness of this basis choice. As shown in Section~\ref{sub:lm-rep}, the choice of an angular basis of spherical harmonics simplifies greatly the evaluation of \cref{eq:body-order-x}, that can be written in terms of contractions of density coefficients $\rep<\nlm||\frho_i>$ (cf. \cref{eq:density-nlm}). If the environment-centered density is written in terms of a sum of density functions $g(\mbf{x}-\mbf{r}_{ji})\equiv\rep<\mbf{x}||\mbf{r}_{ji}; g>$, peaked at the neighbors positions, the expansion coefficients can be written as the accumulation \begin{equation} \rep<\nlm||\frho_i> = \sum_{j\in i} \fcut(r_{ji})\rep<\nlm||\mbf{r}_{ji}; g> \end{equation} of terms that correspond to an expansion over a basis of radial functions $\rep<x||nl>$ and spherical harmonics $\rep<\hat{\mbf{x}}||lm>$ of contributions coming from Gaussians centered on each neighbor \begin{equation} \rep<\nlm||\mbf{r}_{ji}; g> = \int\D{\mbf{x}} \rep<nl||x>\rep<\lm||\hat{\mbf{x}}> \rep<\mbf{x}||\mbf{r}_{ji}; g>.\label{eq:g-nlm-r-integral} \end{equation} In the $g\rightarrow\delta$ limit, the contribution from the $j$-th neighbor amounts simply to a product of the radial and angular functions evaluated at $\mbf{r}_{ji}$, \begin{equation} \rep<\nlm||\mbf{r}_{ji}; \delta> = \rep<nl||r_{ji}>\rep<\lm||\hat{\mbf{r}}_{ji}>. \end{equation} Similar to the 1D case discussed in Sec.~\ref{sub:smearing}, \emph{for a given choice of radial basis} the smearing of the density can be achieved by a mollification of the basis: \begin{multline} \rep<\nlm||\mbf{r}_{ji}; g> = \\\int\D{\mbf{x}} \rep<nl||x>\rep<\lm||\hat{\mbf{x}}> \int\D{\mbf{x}'} g(\mbf{x} - \mbf{x}') \rep<\mbf{x}'||\mbf{r}_{ji}; \delta > \\= \int\D{\mbf{x}'}\rep<\mbf{x}'||\mbf{r}_{ji}; \delta > \int\D{\mbf{x}} \rep<nl||x>\rep<\lm||\hat{\mbf{x}}> g(\mbf{x} - \mbf{x}') \\ =\int\D{\mbf{x}'}\rep<\mbf{x}'||\mbf{r}_{ji}; \delta > \rep<\lm||\hat{\mbf{x}}'> \rep<nl; g||x'> \\ \equiv \rep<\nlm; g||\mbf{r}_{ji}; \delta>, \label{eq:g-nlm-mollified} \end{multline} where we use $\rep<nl; g|$ to indicate the radial term that results from the Gaussian convolution. Each of these terms can be computed very efficiently, exploiting in particular the fact that all orders of the spherical harmonics and their derivatives can be computed using recursion relations.\cite{Limpanuparb2014,Bachmayr2019,drau19prb} It might appear that using a smooth atom density $g$ complicates substantially the evaluation of \cref{eq:g-nlm-r-integral}. However when $g$ is a spherical Gaussian with standard deviation $\sigma$, the integral over $\D{\hat{\mbf{x}}}$ can be computed analytically\cite{kauf-baum89jpb} \begin{equation} \int\D{\hat{\mbf{x}}} \rep<\lm||\hat{\mbf{x}}> \rep<x\hat{\mbf{x}}||\mbf{r}_{ji}; g> = \rep<x; l; ||r_{ji}; g>\rep<\lm||\hat{\mbf{r}}_{ji}>. \label{eq:g-integral-angular} \end{equation} where the radial integral reads \begin{equation} \rep<x; l;||r; g> = 4\pi e^{-r^2/2\sigma^2}\!\! x^2 e^{- x^2/2\sigma^2}\mathsf{i}_{l}\!\left( x r/\sigma^2\right), \end{equation} so one gets \begin{equation} \rep<\nlm||\mbf{r}_{ji}; g>= \rep<\lm||\hat{\mbf{r}}_{ji}> \int\D{x} \rep<nl||x> \rep<l; x|| r_{ji}; g>. \end{equation} The radial part of the integral \begin{equation} \int\D{x} \rep<nl||x> \rep<l; x||r_{ji}; g> = \rep<nl||r_{ji}; g> \label{eq:g-integral-radial} \end{equation} can be computed numerically for any form of the radial basis resulting in $\nmax\lmax n_{grid}$ evaluations of special functions. For instance, the original implementation of the SOAP representation uses a numerically orthogonalized, equispaced Gaussian basis.\cite{bart+13prb} Alternatively, this integral might also be performed analytically by using Gaussian type orbitals (GTO) as the radial basis\cite{gris+18prl,Himanen2020}, $\rep<x||nl; \text{GTO}>$. This choice makes it possible to compute the coefficients of the smeared density as easily as for the $g\rightarrow \delta$ case \begin{equation} \rep<\nlm;\text{GTO} ||\mbf{r}_{ji}; g> = \rep<\lm||\hat{\mbf{r}}_{ji}> \rep<nl;\text{GTO} ||r_{ji};g>, \end{equation} where the only overhead comes from having to compute $\order{\nmax\lmax}$ terms for the radial part and its orthonormalization. This is asymptotically cheaper than combining radial and angular terms -- which requires $\order{\nmax\lmax^2}$ multiplications per neighbor -- but can be substantial in practical cases, because the analytical integrals in \cref{eq:g-integral-angular,eq:g-integral-radial} yield non-standard special functions. \newcommand{\ghat}[0]{\hat{g}} To reduce this overhead, one can choose a form of the atomic density that is symmetric about $\mbf{r}_i$ instead of $\mbf{r}_{ji}$\cite{caro19prb} \begin{equation} \rep<\mbf{x}||\mbf{r}_{ji};\ghat>=\exp[-\frac{(x-r_{ji})^2}{2\sigma^2_{r}}-\frac{r_{ji}^2}{\sigma^2_{\perp}} (1 - \hat{\mbf{r}}_{ji} \cdot \hat{\mbf{x}} )]. \end{equation} Together with a choice of radial functions that do not depend explicitly on $l$, this allows factorizing the radial integral~\eqref{eq:g-integral-radial} as \begin{equation} \int\D{x} \rep<n||x> \rep<x; l||r_{ji}; \ghat> = \rep<n||r_{ji};\ghat> \rep<l||r_{ji};\ghat>. \label{eq:g-integral-radial-caro} \end{equation} Coupled with the polynomial basis proposed in Ref.~\citenum{bart+13prb}, these expansion coefficients can be computed efficiently using recurrence relations in the radial and angular coefficients. More in general, the cost of evaluating the radial integrals $\rep<\nl|| r; g>$ can be made negligible by using splines to approximate the value of the special functions resulting from the integrals, or the numerical integration of basis functions for which there is no analytical expression. Another aspect that does not affect the asymptotic scaling of the expansion, but can significantly influence the prefactor, involves the evaluation of spherical harmonics.\cite{Limpanuparb2014,drau20prb} Several well-established techniques can be used to speed up the calculation of $Y^m_l$, including the use of real-valued spherical harmonics, the use of recurrence relations, and the use of formulations that are entirely written in terms of the Cartesian components of $\hat{\mbf{r}}_{ji}$. \begin{figure} \centering \includegraphics[width=1.0\linewidth]{fig29.pdf} \caption{A schematic representation of the NICE framework. A hierarchy of $N$-body equivariant features is built by iterative combination with the atom density coefficients, and the exponential increase in feature space size is kept at bay by successive contractions. Reproduced with permission from Ref.~\citenum{niga+20jcp}. Copyright 2020 American Institute of Physics.} \label{fig:nice-scheme} \end{figure} \paragraph*{Symmetrized $n$-body correlations} The density coefficients $\rep<\enlm||\frho_i>$ are then combined to compute invariant (or covariant) features. Formally, the evaluation of the symmetry-adapted features -- both those built using only local $\rep|\frho_i>$ features, and the multi-scale features that combine $\rep|\frho_i>$ and $\rep|V_i>$ -- involves a tensor product of $\nu$ sets of density coefficients to yield density correlations in the uncoupled basis $\rep<(\enlm_i)_{i=1}^{\nu}|$, and then a contraction along the $m_i$ indices, that generates the equivariant features expressed in the coupled basis $\rep<(\enlk_i)_{i=1}^{\nu}|$. A technical difficulty one has to keep in mind when implementing the calculation of equivariant features is that the angular $(l,m)$ indices have an irregular memory layout, with $-l\le m \le l$. Depending on the hardware architecture, it might be beneficial to store the coefficients in a regular $(\lmax+1)\times(2\lmax+1)$ array, padded with zeros. A more substantial challenge associated with the increase of the body order is that both the number of linearly independent features and the cost of evaluating each of them based on a naive contraction of the tensor products of density coefficients (e.g. based on the expressions in Ref.\cite{drau19prb}) increase exponentially with $\nu$. Even though the exponential scaling is related to the expansion parameters $\lmax$ and $\nmax$, and not on the number of neighbors, as it would be the case for the calculation of the features as a sum over clusters of $\nu$ atoms (see Sec.~\ref{sub:density-trick} and~\ref{sub:linear-models}), it makes the enumeration of a complete linear basis prohibitively expensive. The recurrence relations\cite{niga+20jcp} of~\cref{eq:rho-recursion} (or the equivalent ones for the invariant features proposed in Ref.\cite{Bachmayr2019}) make it possible to evaluate individual equivariant features with a cost that scales only linearly with $\nu$. To beat completely the exponential scaling, these recursive expressions should be combined with feature selection schemes such as those discussed in Section~\ref{sub:feature-selection}. For example, the $n$-body iterative contraction of equivariant (NICE) features incorporates a selection/contraction step at each level of the iteration. For each equivariant component $\rep<\q'||\rrhoislm{\nu}>$, one determines (e.g. by principal component analysis, or just by dropping some components) a set of coefficients $U^{\nu;\sigma\lambda}_{\q'\q}$ that can be used to reduce the dimensionality of the features \begin{equation} \rep<\q^{\nu;\sigma\lambda}||\rrhoislm{\nu}> = \sum_{\q'} U^{\nu;\sigma\lambda}_{\q\q'} \rep<\q'||\rrhoislm{\nu}>. \label{eq:nice-contraction} \end{equation} Given that this operation only mixes features with the same equivariant behavior, it is then possible to perform an iteration equivalent to~\cref{eq:rho-recursion} to increase the body order further \begin{multline} \rep<\q||\rrhoislm{(\nu+1)}>\equiv \rep<\q^{\nu;\tau k}; n l k||\rrhoislm{(\nu+1)}> =\\ \delta_{\sigma(\tau(-1)^{l+k+\lambda})} \sum_{m} \cg{l m}{k (\mu -m)}{\lambda\mu} \\ \times\rep<n||\frho[lm]_i^1> \rep<\q^{\nu;\tau\lambda}||\frho[\tau;k(\mu-m)]_i^\nu>. \label{eq:nice-contract-recursion} \end{multline} Note that in the first line we use the loose definition of the indices in the bra-ket notation (Section~\ref{sub:bra-ket}): the $\nu+1$ term can be indexed explicitly, with a notation that recalls the lower-order terms that are combined to obtain it; once it is computed, the granularity of the indexing becomes irrelevant, and a flat index can be used to streamline the notation. With this combination of expansion and contraction only the components that contribute significantly to the description of the structural diversity of the dataset, or to the prediction of the target properties, are retained to evaluate higher-order correlations. An alternative perspective for developing efficient implementations is to represent invariant or equivariant properties $\y(A_i)$ in terms of the {\em unsymmetrized} correlations, \[ \begin{aligned} \y(A_i) &\approx \sum_{\nlm_1\ldots \nlm_{\nu}} \rep<\y||\nlm_1\ldots n_\nu l_\nu m_\nu> \\ & \qquad \qquad \times \rep<\nlm_1\ldots \nlm_\nu||\rho_i^{\otimes \nu}>, \end{aligned} \] with the desired symmetries imposed through constraints on the coefficients $\rep<\y||n_1l_1m_1\cdots n_\nu l_\nu m_\nu>$. While this perspective imposes additional complexity on regression schemes it is convenient for fast {\em evaluation} of a fitted model (with coefficients now ensuring the correct symmetries) since the coupling coefficients need not be stored or evaluated anymore. An efficient evaluation now requires a recursion for the unsymmetrized correlations \[ \rep<\nlm_1;\ldots \nlm_\nu||\rho_i^{\otimes\nu}> = \prod_{\alpha = 1}^\nu \rep<n_\alpha l_\alpha m_\alpha || \rho_i >, \] which is relatively straightforward to construct,\cite{Bachmayr2019} the key challenge being to retain only the $(n_\alpha,l_\alpha,m_\alpha)_\alpha$ features that give rise to non-zero coefficients. % \begin{figure}[tbp] \includegraphics[width=0.99\linewidth]{fig30.pdf} \caption{ (a) Single-core timings for the evaluation of radial expansion, angular expansion, and SOAP vector construction for an atomic structure containing 10'000 randomly-placed atoms, using the implementation discussed in Ref.~\citenum{caro19prb} and as a function of $(\nmax,\lmax)$. Reproduced with permission from Ref.~\citenum{caro19prb}. Copyright 2019 American Physical Society. (b) Single-core timings for the evaluation of SOAP features for a dataset of molecular crystals\cite{musi+19jctc}, using the implementation in librascal\cite{LIBRASCAL}, as a function of $(\nmax,\lmax)$; to compare with panel (a), consider that the presence of 4 distinct chemical elements corresponds roughly to a fourfold increase of $\nmax$. The breakdown of the total timing in the different steps of the calculation is shown for a few representative sizes of the expansion. (c) As in (b), including also the calculations of the gradients of the features with respect to atomic positions. Reproduced with permission from Ref.~\citenum{musi+21jcp}. Copyright 2021 American Institute of Physics. \label{fig:soap-timings} } \end{figure} \begin{figure*}[tbp] \begin{minipage}{0.64\linewidth} \includegraphics[width=1.0\linewidth]{fig31.pdf} \end{minipage} \ \begin{minipage}{0.34\linewidth} \caption{The panels demonstrate the convergence of SOAP features as computed for 10'000 random \ce{CH4} configurations\cite{matcloud20a} using the radial bases implemented in different codes, and measured in terms of the error one incurs when linearly predicting fully-converged features $\bm{\Xi}_\text{full}$ ($\nmax=24,\lmax=12$, computed with the GTO implementation in librascal) using features with $\lmax=8$ and growing values of $\nmax$ (left) and with $\nmax=14$ (16 for librascal) and growing values of $\lmax$ (right). Top panels show the linear reconstruction error (GFRE) which measures the amount of information that cannot be linearly decoded from the coarser features. Bottom panels show the reconstruction distortion (GFRD) which measures the additional error one makes when limiting the reconstruction to an orthogonal transformation.\cite{gosc+21mlst} }\label{fig:feature-reconstruction} \end{minipage} \end{figure*} \subsection{Packages to evaluate atom-density representations} To provide a practical example of the use of software to compute representations, we compare three packages, namely quippy\cite{QUIP}, dscribe\cite{Himanen2020} and librascal\cite{LIBRASCAL,musi+21jcp}, that are open source, and can be easily used in a Python code. We do not discuss the internals of the implementations, but show code snippets that can be readily used to evaluate descriptors of atomic structures, primarily focusing on the SOAP powerspectrum. All examples use the Atomic Simulation Environment\cite{hjor+17jpcm}, and atomic structures are assumed to be stored in the variable \verb+structures+, an instance of ASE's \verb+Atoms+ object. In all of these implementations, the descriptor vectors are returned as \verb+numpy.array+ objects, from which kernel values may be obtained by computing the dot products between descriptor vectors. We also do not discuss the computational efficiency of the different codes, which is still the subject of very active development. Fig.~\ref{fig:soap-timings} provides some representative timings from librascal, and from a recent implementation of SOAP that uses non-Gaussian atomic densities\cite{caro19prb}. The wildly different breakdown of the computational effort as a function of the basis set size, and the large overhead associated with the evaluation of the gradients of the features highlight some of the implementation challenges. The quippy python package is based on the QUIP suite with the GAP extension, which provides the \verb+descriptors+ module. QUIP must be downloaded and built using a Fortran compiler before quippy, which uses f90wrap to access the compiled functions in QUIP via python interfaces. In the GAP implementation, Gaussian radial basis functions are used, placed at equal intervals, and orthogonalized. \begin{lstlisting} from quippy.descriptors import Descriptor soap = Descriptor("soap cutoff=3.5 cutoff_transition_width=0.0 atom_sigma=0.3 n_max=8 l_max=6") # returns a dictionary containing the features and connectivity information features = soap.calc(structures) # features["data"] is a numpy array with the shape (\n_environments,n_features) \end{lstlisting} The \verb+Descriptor+ object is initialised using a string containing the kernel parameters in a \verb+key=value+ format, with some keys being mandatory. The \verb+dscribe+ package\cite{Himanen2020} implements multiple descriptors, including SOAP, MBTR\cite{huo-rupp17arxiv} and ACSF. A python interface is used to interact with calculator functions written in C/C++, ensuring efficient evaluation. The main difference between the SOAP implementation of \verb+quippy+ and \verb+dscribe+ are the choice of radial basis functions, which are spherical primitive Gaussian Type Orbitals (GTOs), orthogonalised using the method suggested by L\"owdin\cite{lowd50jcp}. Alternatively, cubic or higher order polynomials may also be chosen. In analogy with the definition of GTOs used in quantum chemistry, the radial basis has an explicit dependence on $l$. \begin{lstlisting} from dscribe.descriptors import SOAP soap = SOAP( rcut=3.5, nmax=8, lmax=6, sigma=0.3, species=["H","C"] ) # returns a (n_environments,n_features) numpy array X = soap.create(structures) \end{lstlisting} The the python object providing the descriptor is constructed from the class \verb+SOAP+ and specifying the parameters in the initialisation arguments. The package librascal also provides a variety of descriptors, but chiefly focuses on the calculation of density-based representations, including SOAP and the $\nu=1$ and $\nu=3$ correlations. The back-end, written in C++, can be accessed from python interfaces. Exploiting the spirit of the general construction of $\rep|\frho_i^\nu>$ features, librascal implements two kinds of radial functions, namely a family of GTO-like radial functions\cite{gris+19book} as well as a discrete variable representation (DVR) basis, corresponding to a real-space evaluation of the symmetrized density using a Gauss-Legendre quadrature rule. \begin{lstlisting} from rascal.representations import SphericalInvariants hypers = { 'soap_type': 'PowerSpectrum', 'interaction_cutoff': 3.5, 'radial_basis': 'GTO', # or 'DVR' 'max_radial': 8, 'max_angular': 6, 'gaussian_sigma_constant': 0.3, 'gaussian_sigma_type': 'Constant', 'cutoff_smooth_width': 0.0, 'normalize' : False } soap = SphericalInvariants(**hypers) # returns a (n_environments,n_features) numpy array X = soap.transform(structures).get_features(soap) \end{lstlisting} The \verb+SphericalInvariants+ object uses the \verb+transform+ method to compute SOAP features, that are stored internally in a sparse format, in which each dense block corresponds to a $(\e,\e')$ pair of elemental densities. These features can be used to compute scalar-product kernels between two environments, or cast to a dense array through the \verb+get_features+ method. These three packages all compute ``SOAP'' features, but differ in the choice of basis functions. Much as with electronic structure codes, that often yield results that differ significantly despite performing nominally the same type of calculations,\cite{leja+16science} one cannot expect to be able to combine the features computed by one package with the regression weights computed by another. It is however important to assess whether the features are equivalent in a less stringent sense, e.g. whether they contain analogous information, and whether they converge to the same limit when the expansion parameters $(\nmax, \lmax)$ are increased. Figure~\ref{fig:feature-reconstruction} demonstrates the convergence of the GFRE and GFRD (see Section~\ref{sub:feat-compare} and Ref.~\citenum{gosc+21mlst}) between small-$(\nmax, \lmax)$ features and a highly converged $\bm{\Xi}_\text{full}$ featurization. In all cases we consider GFRE$(\bm{\Xi}_\text{full},\bm{\Xi})$ is at least one order of magnitude smaller than GFRE$(\bm{\Xi},\bm{\Xi}_\text{full})$. One sees that, reassuringly, in all cases the feature reconstruction errors converge towards zero. For $\nmax=16$ all choices of radial bases are essentially converged, and the residual error is due to the convergence of the angular channels. Since all implementations use equivalent spherical harmonics expansions, the convergence with the angular cutoff $\lmax$ is nearly identical. The convergence rate of the radial bases, however, is not the same. The GTO bases in librascal and dscribe have similar amounts of information (although they are not fully equivalent, as they are parameterized differently), and converge faster than the bases used in quippy and the librascal DVR implementation. The GFRD also converges to zero for most implementations -- meaning that in the complete basis set limit the corresponding features become equivalent. The implementation in dscribe is an exception, with a GFRD saturating at approximately 0.1, suggesting that implementation details lead to persistent differences in the weighting of different kinds of correlations even when $(\nmax, \lmax)$ increase beyond the values that are typically used in practice. \section{Applications and current trends}\label{sec:applications} In this Section we report some representative applications that highlight different aspects of the representations discussed in this Review -- demonstrating how an understanding of the nature and properties of the structure/features mapping can be used to construct efficient and insightful machine-learning models. \begin{figure}[hbpt] \centering \includegraphics[width=1.0\linewidth]{fig32.pdf} \caption{ROCs of binary classifiers based on a SOAP kernel, applied to the prediction of the binding behavior of ligands and decoys taken from the DUD-E\cite{Mysinger2012}, trained on 60 examples. Each ROC corresponds to one specific protein receptor, and plots the fraction of true positives $p(+|+)$ against the fraction of false negatives $p(+|-)$. The red curve is the average over the individual ROCs. The dashed line corresponds to receptor FGFR1, which contains inconsistent data in the version of the DUD-E at the time of the original publication\cite{bart+17sa}. Inset: AUC performance measure as a function of the number of ligands used in the training, for the ``best match''-SOAP kernel (MATCH) and average molecular SOAP kernel (AVG). Reprinted with permission from Ref.~\citenum{bart+17sa}. © The Authors, some rights reserved; exclusive licensee AAAS. Distributed under a \href{http://creativecommons.org/licenses/by-nc/4.0/}{Creative Commons Attribution License 4.0 (CC BY-NC)}. } \label{fig:dude} \end{figure} \subsection{Best match kernels for ligand binding} Contrary to the problem of predicting interatomic potentials, or other extensive properties, the affinity between a protein and a small drug-like molecule does not fit well into the mold of an additive property model. The structure of the ligand must allow for the active portion of the molecule to fit in the binding pocket of the target protein, and the nature of the chemical groups in this ``warhead'' portion are more important to determine the strength of the interaction than peripheral portions of the molecule. Figure~\ref{fig:dude} shows the accuracy of a classifier based on SOAP features, that aims to distinguish active components from decoys for a given target protein. The targets and the ligands, as well as their ``ground truth'' binding behavior are taken from the database of useful decoys, enhanced (DUD-E)\cite{Mysinger2012}. The performance of the classifier is represented in terms of the receiver operating characteristic (ROC) curves (the ROC curve of a perfect classifier would run along the left and top margins of the plot, while a classifier that is as good as random would run along the diagonal), and their area under the curve (AUC) (the AUC is the integral of the ROC, and roughly corresponds to the fraction of molecules that are classified correctly). The AUC plot, in the inset of Fig.~\ref{fig:dude} shows that a model based on an average metric -- that describes each molecule as the average of its environments, Eq.~\eqref{eq:d-average} -- performs rather poorly, which is unsurprising given the highly non-additive nature of the binding affinity. Using a ``best-match'' kernel (equivalent to the distance in Eq.~\ref{eq:d-bestmatch}, and implemented in practice as the small-$\gamma$ limit of the REMatch kernel\cite{de+16pccp}) improves dramatically the accuracy of the classifier, bringing the AUC to well above 0.95. A judicious choice of the training structures, based on farthest point sampling, accelerates even further the convergence of the classifier with train set size. This application provides an example of how local representations can be combined in a non-additive way, resulting in a dramatic improvement of the machine-learning performance for a problem in which non-additive behavior is to be expected. \begin{figure}[bt] \centering \includegraphics[width=\linewidth]{fig33.pdf} \caption{Predicted atomic contributions to the total CCSD polarizability tensor for a selection of the showcase dataset as reported in Refs.~\citenum{wilk+19pnas,yang+19sd}. The ellipsoids are aligned along the principal axes of $\boldsymbol{\alpha}_i$, and their extent is proportional to the square root of the corresponding eigenvalue. The principal axes are shown, and are colored based on whether the corresponding eigenvalues are positive (black) or negative (red). Reproduced with permission from Ref.~\citenum{wilk+19pnas}. Copyright 2019 National Academy of Sciences. } \label{fig:anisotropies_showcase} \end{figure} \subsection{Tensorial features and polarizability} Some of the early examples of machine-learning models leveraging covariant features focused on the prediction of dielectric response functions, such as the dipole moment $\boldsymbol{\mu}$ (and the equivalent bulk quantity, polarization), polarizability $\boldsymbol{\alpha}$ (and the closely-related electronic dielectric constant) as well as higher-order terms, such as the first hyperpolarizability $\boldsymbol{\beta}$. We discuss the case of the static dipole polarizability $\boldsymbol{\alpha}$ as a representative case that highlights many of the current ideas and applications. In its Cartesian form, $\boldsymbol{\alpha}$ is a symmetric tensor, fully determined by six components $(\alpha_{xx},\alpha_{yy},\alpha_{zz},\alpha_{xy},\alpha_{xz},\alpha_{yz})$. In order to build a machine-learning model based on equivariant density correlation features, it is more convenient to apply a unitary transformation that casts it into its irreducible spherical components (ISCs). The spherically symmetric term, $\alpha^{(0)}_0$, corresponds to the trace of the tensor, while the 5 anisotropic components, $\alpha^{(2)}_{\{-2,-1,0,+1,+2\}}$ transform collectively as $\lambda=2$ spherical harmonics, and can be computed using recursive relationships that are explicitly reported in Ref.~\citenum{stone1975}. A clear advantage of this construction is that, unlike the components of the Cartesian tensor, the two ISCs of $\boldsymbol{\alpha}$ can be independently represented by the equivariant density-based features corresponding to $\lambda=0$ and $\lambda=2$, relying on a linear prediction model similar to the one reported in Eq.~\eqref{eq:tenspred}.\cite{gris+18prl,wilk+19pnas,gris+19book} \begin{figure}[tb] \centering \includegraphics[width=0.95\linewidth]{fig34.pdf} \caption{ Polarizability per carbon atom ($\alpha/n_C$) vs. number of carbons ($n_C$) for the series of s-\textit{trans} alkenes (from \ce{C6H8} to \ce{C22H24}, full line) and acenes (from benzene to pentacene, dotted line), as well as fullerene (\ce{C60}). The green squares (and error bars) indicate the experimental measurements for \ce{C60}\cite{FullereneReview}. Results are provided from DFT (blue) and CCSD (red) calculations, as well as the corresponding AlphaML models. Reproduced with permission from Ref.~\citenum{wilk+19pnas}. Copyright 2019 National Academy of Sciences. }\label{fig:conjugated} \end{figure} The inherent locality of the model means that the tensor prediction can be broken down in the sum of individual atomic contributions $\boldsymbol{\alpha}=\sum_i\boldsymbol{\alpha}_i$. These local components can be combined to make predictions on larger, and more complex molecules than those included in the training set. This transferability was exploited in the AlphaML model\cite{wilk+19pnas,alphaml} to fit against coupled-clusters (CCSD) reference values, computed on small organic molecules from the QM7b dataset\cite{mont+13njp,yang+19sd}, and predict on 52 larger ``showcase'' molecules that are at the limit of what is computable with state-of-the-art quantum chemistry methods. On these molecules, the error of AlphaML against the CCSD reference (0.24 a.u./atom) was less than half the discrepancy between CCSD and DFT (0.57 a.u./atom). An additive model also provides predictions for the local contributions to $\boldsymbol{\alpha}$, which are represented in Fig.~\ref{fig:anisotropies_showcase}, in terms of ellipsoids aligned along the principal axes of $\boldsymbol{\alpha}(A_i)$. Even though these components do not have to be physically meaningful -- given that the only training target is given by \emph{total} polarizabilities -- the local $\boldsymbol{\alpha}(A_i)$ reflect some chemical insights, e.g. the model predicts large components when centering the representation on the highly-polarizable sulfur atoms, as well as along the directions where the molecules are highly polarizable. Highly conjugated molecules are also interesting because they exhibit a non-additive behavior of the polarizability, due to the vanishing HOMO-LUMO gap. Due to the spatial nearsightedness of the representation, the model breaks down when asked to predict the polarizability of large polyenes and polyacenes based on the information learned on simpler and smaller molecular units. This is well represented in Fig.~\ref{fig:conjugated}, where the prediction of $\boldsymbol{\alpha}$ is tested for conjugated carbon-based molecules of increasing size, including fullerene\cite{wilk+19pnas}. \begin{figure}[tbp] \centering \includegraphics[width=\linewidth]{fig35.pdf} \caption{(\emph{black line}) Raman spectrum prediction of paracetamol form-I averaged over 16 different training models. Each training model is obtained by a random subselection of 2000 configurations over a total of 2500. (\emph{shaded area}) Standard deviation of the predicted spectra over the 16 models, calibrated with a likelihood maximization procedure described in Ref.~\citenum{musi+19jctc}. (\emph{blue line}) Reference \emph{ab initio} Raman spectrum. Adapted from Ref.~\citenum{raim+19njp}. Copyright 2019 IOP Publishing under Creative Commons Attribution 4.0 International License \url{https://creativecommons.org/licenses/by/4.0/}. } \label{fig:raman} \end{figure} The prediction of $\boldsymbol{\alpha}$ using equivariant features can also be extended to the condensed phase and provides a crucial ingredient to compute Raman spectra. An example of this is reported in Ref.~\citenum{raim+19njp}, where the polarizability of crystal polymorphs of paracetamol are predicted along a full molecular dynamics trajectory, thus allowing for the calculation of the Raman intensity in terms of the polarizability correlation spectrum. As shown in Fig.~\ref{fig:raman}, given the local nature of the polarizability response in this kind of systems, accurate Raman intensities and lineshapes can be predicted for the entire range of frequencies. The low cost associated with computing dielectric response functions by ML models using symmetry-adapted features makes it possible to routinely evaluate condensed-phases infrared and Raman spectra including also a description quantum mechanical nature of the nuclei\cite{kapi+20jcp} -- a task that until very recently required enormous computational effort\cite{mars-mark17jpcl}. \begin{figure}[tbp] \centering \includegraphics[width=\linewidth]{fig36.pdf} \caption{(a) Learning curves of the $\lambda=0$ and $\lambda=2$ components of the dielectric response tensor $\boldsymbol{\epsilon}_\infty$ of water, through direct learning (red and green lines, respectively) and indirect learning going through the Clausius-Mossotti relation (blue and gray). The testing data set consists of 500 independent configurations. Arrows indicate the intrinsic standard deviation of the testing samples. Crosses show the predictions for 5 hexagonal ice structures using the ML model trained on liquid water. Adapted with permission from Ref.~\citenum{gris+18prl}. Copyright 2018 American Physical Society (b) Absolute RMSE in learning the $\lambda=0$ spherical tensor of polarizability of polypeptides as a function of the peptide length. The model was trained on 27428 single amino acids and 370 dipeptides. The error was computed on 30 dipeptides, 20 tripeptides, 16 tetrapeptides and 10 pentapeptides respectively. The curves correspond to a LODE model (blue) a squared-kernel SOAP model (green) and a hybrid model mixing the two kernels (red). Adapted with permission from Ref.~\citenum{gris+21cs}. Copyright 2020 Royal Society of Chemistry. } \label{fig:nonlocal-alpha} \end{figure} \subsection{Long-range and non-local responses} The clear breakdown of a ML model based on local features that is apparent in Fig.~\ref{fig:conjugated} is representative of a general limitation of density-based features. There are essentially two approaches one can take to tackle the issue of the non-locality of the structure-property relations, both of which are illustrated in Figure~\ref{fig:nonlocal-alpha}. One approach is to learn a proxy of the target property, which has a more localized nature, and which can then be easily manipulated to obtain the end result. The top panel of Fig.~\ref{fig:nonlocal-alpha}, adapted from Ref.~\citenum{gris+18prl}, is an example of this approach. The electronic dielectric response $\boldsymbol{\epsilon}_\infty$ of bulk water is affected by a collective, macroscopic electrostatic effect that is captured, in the continuum limit, by well-known expressions such as the Clausius-Mossotti relation, $\boldsymbol{\alpha}=V(\boldsymbol{\epsilon}-1)/(\boldsymbol{\epsilon}+2)$, that links $\boldsymbol{\epsilon}_\infty$ to an effective molecular polarizability. This effective $\boldsymbol{\alpha}$ is more readily learnable by a local model, leading to better accuracy and transferability in predicting $\boldsymbol{\epsilon}_\infty$. A different approach is needed when there is no obvious transformation of the target property to a more local version, as is the case for the polarizability of conjugated hydrocarbons. In these cases, one needs a model that is able to describe arbitrary non-local correlations. Long-range representations such as multiscale LODE features (Section~\ref{sub:long-range} and~\ref{sub:ms-model}) are particularly attractive, in that they combine a long-range character (coming from the potential field) with an additive decomposition that provides the transferability needed to extend the prediction to systems of increasing size. This is demonstrated in Fig.~\ref{fig:nonlocal-alpha}, where the multiscale LODE model is tested for predicting the isotropic component of the polarizability of a series of polypeptides of increasing length. While the prediction at small peptides lengths share a similar accuracy as that obtained using a pure density-based representation, the inclusion of the potential field greatly decreases the prediction error when considering longer molecular chains. A large, overall improvement of the prediction accuracy is observed when adopting an optimized, weighted combination between local and LODE features. These result suggests that the inclusion of long-range features within the regression model provides a better description of the intermediate-range interactions, and that by adjusting the relative importance of local and delocalized terms the model can be trained only on small molecules, and extrapolate reliably across systems of increasing size. Very similar findings were reported on the transferability of models of molecular dipoles\cite{veit+20jcp} -- where however the splitting between local and long-range physics was achieved by combining different regression models rather than by different choices of features. \begin{figure}[bp] \includegraphics[width=0.9\linewidth]{fig37.png} \caption{Extrapolation results for the valence electron density of one octane (\emph{left}) and one octatetraene (\emph{right}) conformer, using a model trained on butadiene and butane. (\emph{top}) DFT/PBE density isosurface at 0.25, 0.1, 0.01 Bohr$^{-3}$, (\emph{middle}) machine-learning prediction isosurface at 0.25, 0.1, 0.01 Bohr$^{-3}$, (\emph{bottom}) machine-learning error, red and blue isosurfaces refer to $\pm$ 0.005 Bohr$^{-3}$ respectively. Reproduced from Ref.~\citenum{gris+19acscs}. Copyright 2018 American Chemical Society. \label{fig:extrapolation}} \end{figure} \newcommand{\tilde{\rho}}{\tilde{\rho}} \newcommand{\tilde{c}}{\tilde{c}} \subsection{Electronic charge densities} Another relevant scenario where the data-driven prediction of a quantum property benefits from a representation that relies on the use of local and equivariant features is the electron density $\tilde{\rho}(\mbf{r})$ of an atomic structure.\footnote{We use $\tilde{\rho}$ and $\tilde{c}$ to refer to electron density and its expansion coefficients, to distinguish them from the similar terms used for the atom density.} The density is a scalar field, and has been modeled with some success by predicting its value at a specific point by an invariant representation \emph{centered on that point}\cite{alre+18cst,chan+19npjcm}. Given that (particularly in the case of an all-electron calculation) atomic nuclei are a natural vantage point to decompose the overall electron density, one may want instead to model $\tilde{\rho}(\mbf{r})$ as a sum of atom-centered contributions, $\tilde{\rho}(\mbf{r})=\sum_i \tilde{\rho}(A_i; \mbf{r})$. These atom-centered terms can then be conveniently decomposed as a sum of local functions, at the price of adopting a multi-centered non-orthogonal basis for the expansion i.e., \begin{equation} \tilde{\rho}(A_i,\mbf{r}) = \sum_{n\lambda\mu} \tilde{c}_{n\lambda\mu}(A_i) R_n(\left|\mbf{r}-\mbf{r}_i\right|) Y^\lambda_\mu\left(\widehat{\mbf{r}-\mbf{r}_i}\right) \end{equation} where $R_n$ represent some suitably optimized radial functions (for instance those used in resolution of the identity methods in quantum chemistry\cite{whit73jcp}) and $\tilde{c}_{n\lambda\mu}(A_i)$ correspond to the non-orthogonal expansion coefficients, that depend on the arrangement of atoms in the environment $A_i$. These coefficients must transform in a covariant fashion with a rotation of the environment, and each $\lambda$-component can be independently predicted using equivariant features of the corresponding order -- for instance with a linear model \begin{equation} \tilde{c}_{n\lambda\mu}(A_i) \approx \sum_{\q} \rep<\tilde{c}_{n\lambda}||\Q> \rep<\Q||A_i; \rrhoislm{\nu}>, \end{equation} even though current implementations use a kernel regression scheme\cite{gris+19acscs,fabr+19cs}. The non-orthogonality of the basis used to represent $\tilde{\rho}(\boldsymbol r)$, implies that the learning phase has now to be performed considering all the different density components at the same time\cite{gris+19acscs,fabr+19cs}. While this may sound as a computational drawback of the model, it also improves the locality of the coefficients, which underlies its remarkable transferability across vast conformational and chemical spaces, since the electron density can be effectively learned as a collection of local contributions. This is well exemplified in Figs.~\ref{fig:extrapolation}, where the electron density prediction of C(8) hydrocarbons\cite{gris+19acscs} is tested upon having trained the model on much smaller compounds, with only 4 carbon atoms. This approach has since been applied to more complex systems, such as oligopeptides\cite{fabr+19cs}, and to the prediction of other scalar fields such as the on-top density\cite{fabr+20jcp}. \begin{figure}[bp] \includegraphics[width=1.0\linewidth]{fig38.pdf} \caption{Scatter plot and histograms based on Steinhardt order parameters\cite{stei+83prb} $q_n$ computed for simulations of liquid water and different phases of ice. Reproduced with permission from Ref.~\citenum{geig-dell13jcp}. Copyright 2013 American Institute of Physics. \label{fig:geig-dell}} \end{figure} \begin{figure*}[tbhp] \begin{minipage}{0.75\linewidth} \vspace{0mm} \includegraphics[width=1.0\linewidth]{fig39.pdf} \end{minipage} \begin{minipage}{0.24\linewidth} \caption{Sketch map of the structural similarity of 15,869 distinct PBE-DFT geometry-optimised ice structures, as computed by the Euclidean distance in SOAP space. The sketch-map coordinates are obtained by minimizing the error in reproducing this similarity in terms of distances between points on a 2D projection. The density and static lattice energy of each structure are encoded by the size and colour of the respective point, and correlate strongly with the position on the map. Known ice phases are labelled in blue. 34 new candidates are labelled in black and numbered in order of increasing dressed energy relative to a generalized convex hull\cite{anel+18prm} construction. Reproduced from Ref.~\citenum{enge+18ncomm}. Copyright 2018 Springer Nature under Creative Commons Attribution 4.0 International License \url{https://creativecommons.org/licenses/by/4.0/}. \label{fig:gch-water}} \end{minipage} \end{figure*} \subsection{Structural classification and structural landscapes} As discussed in Section~\ref{sec:maps}, the choice of a representation to describe atomic structures determines the ``lens'' through which they are interpreted, which in turns has a strong impact on the way unsupervised learning schemes, such as clustering and dimensionality reduction, bring to light recurring patterns, and structure-property relations. The potential of general-purpose, atom-density correlation features for these tasks has been recognized rather early. Figure~\ref{fig:geig-dell}, adapted from Ref.~\citenum{geig-dell13jcp} shows a classification of snapshots taken from simulations of different phases of water, based on Steinhardt order parameters\cite{stei+83prb}, which are closely related to $\rep|\frho_i^2>$ features, and make it possible to partly differentiate between phases. In the same study it is shown how a neural network based on atom-centered symmetry functions can be trained to achieve near-perfect classification accuracy. An even more comprehensive mapping of the phase diagram of water -- in which crystalline and amorphous phases from across the phase diagram, as well as transition pathways between them were considered -- was produced in Ref.~\citenum{piet-mart15jcp}, using permutation-invariant vectors\cite{gall-piet13jcp} as global descriptors for the different configurations. Abstract structural descriptors are particularly useful when applied to datasets that contain hypothetical structures, generated by a high-throughput procedure\cite{isay+15cm}. In combination with a dimensionality-reduction scheme\cite{ceri+11pnas}, and with a generalized convex hull construction that attempts to estimate the synthesizability of materials by considering jointly their predicted stability, and the structural similarity to other potential candidates\cite{anel+18prm}, a SOAP representation has been able to rediscover all known (meta)stable ice phases, as well as to propose another 34 structures which might be also stabilizable by pressure, doping, or co-crystallization\cite{enge+18ncomm} (see Fig.~\ref{fig:gch-water}). \begin{figure}[tbhp] \includegraphics[width=1.0\linewidth]{fig40.jpg} \caption{Sketch-map describing the makeup of the structures included in the train set of an accurate and transferable potential for carbon. Selected structures are identified for graphite, diamond, hexagonal diamond (Lonsdaleite), amorphous carbon and fullerenes. Points are coloured according to their energy, while contours indicate the density of the database population in a particular region. Adapted with permission from Ref.~\citenum{rowe+20jcp}. Copyright 2020 American Institute of Physics. \label{fig:carbon}} \end{figure} An incomplete list of applications that use general-purpose features for structural analysis and classification includes: the construction of structure-property maps for small organic molecules\cite{de+16jci,maks+20ijqc}, molecular materials\cite{musi+18cs,yang+18cm,gryn+18jacs}, inorganic perovskites\cite{yang20jmcc}, corrosion inhibitors\cite{wurg+19fm}; the identification and characterization of defects in solids\cite{shar+18pnas,prie+18am,home+19fm} and self-assembled polymers\cite{gasp+20jpcb,capelli2021chemrxiv}; the classification of secondary-structure patterns in polypeptides\cite{helf+19fmb} and the building blocks of zeolites\cite{helf+19jcp, schw+19nm} and porous materials\cite{nich+20cs}; the classification of different phases in multi-phase materials\cite{diet+17pre,fulf+19jcim}; the characterization of amorphous systems\cite{deri+18cm,zhou+20jmcc,huan+19jmca,caro+20prb,deri+21nature}; the search of stable phases of materials\cite{rein+20pccp}; the determination of the convergence of microsolvation studies of the hydration free energy\cite{basd+20jctc}. There are also several examples, besides those given in Section~\ref{sec:maps} where low-dimensional maps have been used as a tool to understand the structure of a data set or the nature of a representation. In Ref.~\citenum{hans+13jctc} a PCA map was used to understand the effect of randomizing the atom ordering on the feature space associated with a Coulomb matrix description of molecules, emphasizing the information loss associated with sorting of the elements -- an alternative route to achieve permutation invariance. In Ref.~\citenum{de+16pccp}, maps based on different kinds of SOAP kernels provided an understanding of the effect of different approaches to combining environment-level kernels, and of different definitions of an alchemical kernel between chemical elements, on the similarity between molecules as measured by the representation. In Ref.~\citenum{nguy+18jcp}, maps of a dataset of water oligomers were used to compare the performance of different ML scheme to build 2 and 3-body models of the energy of water clusters. The use of low-dimensional representations to visualize the structure of a dataset, showing the relationship between different kinds of training structures, identifying regions that are poorly sampled, and determining how new configurations relate to the data the ML model has been fitted, is also gaining traction.\cite{fabe+15ijqc,de+16pccp,bart+17sa,stuk+19jcp,bern+19npjcm,benm+20prb,mons+20nc,deri+20nc} An example of such map is given in Fig.~\ref{fig:carbon}, showing the diversity of the structures used to train a transferable machine-learning potential for carbon.\cite{rowe+20jcp} Adopting the same type of representations used for the regression model as the basis of this kind of analysis ensures that the maps describe the same feature space that underlies the fit. \subsection{3D representations for QSPR and reaction predictions} Even though the focus of this review is on descriptors of the 3D structure of materials applied to the construction of surrogate models of quantum mechanical properties, there is also growing interest in their application to QSPR tasks. As we briefly discuss in Section~\ref{sec:history-wishes}, the descriptors that have been traditionally used in cheminformatics are based on a collection of molecular properties, or on molecular graph descriptors that do not depend on the particular conformation.\cite{Shen2020} From a conceptual point of view, their coarsness is an advantage, because it is compatible with the definition of thermodynamic properties that are not associated with a single specific configuration, such as solvation and ligand binding free energies. Nevertheless, there is growing evidence that the use of descriptors incorporating information on the 3D geometries can improve the accuracy of QSPR models, especially for difficult cases that involve very flexible molecules,\cite{Dastmalchi2012,Jagiello2016} as well as for data analytics approaches for materials informatics\cite{chou+18prm}. One of the core challenges in these efforts is the determination of the conformer geometries that should be used to evaluate the 3D descriptors, an operation for which several strategies have been explored to enhance the accuracy of QSPR models.\cite{Kuzmin2005,Zankov2020} As we briefly discuss in \cref{sub:indirect-struc-prop-rel}, one of the most promising research directions involves combining the high fidelity of density based representations with a well-principled construction of ensembles of features. This is still a very active subject of research, with very encouraging results having been recently demonstrated for the prediction of the solubility of small molecules\cite{wein+21jcp}, the computational screening for antiviral drugs\cite{Axelrod2020}, % and the prediction of enantioselectivity of organocatalysts\cite{gall+21cs}. \subsection{Descriptors from electronic-structure theory} \label{sub:electronic-structure-descriptors} Another growing trend that is worth a brief mention involves the use of information from electronic-structure calculations in the construction of structural representations. The idea has been applied in different forms. At the simplest level, electronic-structure-based indicators of chemical similarity, obtained for bulk elements, have been used in the construction of elemental similarity kernels,\cite{de+16pccp} to obtain models that are more predictive across chemical space\cite{jinn-asah17jpcl}. Alternatively, electronic-structure indicators, such as the local density of states, can be used side-by-side with purely structural representations, yielding a substantial improvement of the accuracy of the model\cite{caro+18cm,aarv+19cm}. Elements of an electronic structure calculation, such as the charge density\cite{dick-fern19jcp}, the electron density of states\cite{fung+21nc} or the elements of the Fock matrix\cite{welb+18jctc} can be used directly as the basis for a molecular representation. This approach requires an electronic structure calculation in order to make predictions for each new structure, which implies a substantial overhead in comparison with methods using as inputs only the atomic positions. However, the increase in the transferability of the models may well justified the greater computational effort, particularly when using descriptors based on low levels of quantum mechanical theory to predict high-end, accurate molecular properties.\cite{chen+19jcp, qiao+20jcp} \section*{Conclusions and outlook} The description of atomic structures in terms of mathematically sound, computationally efficient, and physically-inspired representations has largely driven the extraordinarily successful application of machine-learning schemes to atomic-scale modeling. Independently-developed representations have undergone a process of convergent evolution to fulfill a concurrent set of requirements, such as symmetry with respect to translations and rotations, smoothness and injectivity -- a clear indication of the importance of these criteria to obtain efficient machine-learning models. Over the past few years, a more systematic study of the problem of representing atomic structures has clarified the connections between most of the successful representations, and between these and well-established concepts in the statistical physics of liquids ($\nu$-point density correlations) and of alloys (the cluster expansion), as well as with the construction of potential energy surfaces for molecules and the condensed phase. A formal treatment of symmetries enabled the development of equivariant features that are suitable to build models that automatically obey the same transformation rules as vectors and tensors, making it possible to learn efficiently properties such as dipole moments, polarizability and density fields. This equivariant formulation can also be used to iteratively increase the body order of a structural representation: An important open question is how to best treat these high-body-order terms, whether by linear models that explicitly include dedicated high-order features, or by non-linear models that generate (some of) them algebraically. The answer rests both on practical considerations and on the very fundamental, highly non-trivial issue of whether a representation of limited body order provides a complete (injective) description of an atomic structure. Even though it is possible to build systematically a complete basis to expand in a linear fashion any structure-property relation, it is not clear how to build a \emph{minimal} set of features that guarantees an injective mapping when used as the input of a general \emph{non-linear} model, or how to reduce in an effective manner the size of a complete linear basis. A better understanding of the mathematical properties of representations is likely to lead, in the near future, to more robust and better performing implementations, and might also help design better ``deep'' models, by identifying the algebraic manipulations that increase most effectively the expressive power of the features used as inputs. Another open challenge is how to deal with non-additivity, and with properties that depend on long-range interactions between far-away atoms. Particularly promising is a long-distance equivariant framework, that can be formulated as as a rather straightforward extension of the same density-correlations scheme that underlies local features, and can be related to a multipole expansion of interactions. It is yet to be seen whether it can describe more subtle physical phenomena such as quantum delocalization, polarization and charge transfer, and how it compares with more explicitly physically-motivated ``hybrid'' models. A better control of the multi-scale nature of the interactions, including the use of ``multi-resolution'' features, is likely to be one of the focal point of feature-engineering efforts, which may lead to an incremental -- but nevertheless important -- increase of the accuracy of ML models of matter. The optimization of features for a specific problem may however impact their general applicability, which is one of the critical advantages of the class of abstract, generic representations we focus on in this review, that can be seen as the point of convergence of molecular potential energy surfaces and condensed-phase potentials. The quantitative assessment of the mutual information content of alternative descriptors, of their sensitivity to structural deformations, and to the degree to which they correlate with the target properties may serve as a guide to strike a balance between these conflicting goals, and to make better informed choices between alternative frameworks. One of the most recent research directions aims at extending even further the reach of the class of descriptors we discuss in this review, by resolving the divide between three dimensional continuous representations and discrete fingerprints, for applications to quantitative structure-property relations. The challenge here is to reconcile the superior resolving power of 3D, atom-density-correlation representations with the fact that traditional cheminformatics tasks aim to predict macroscopic properties, such as solubility or toxicity, that are not associated with an individual configuration, but rather with the ensemble of conformers corresponding to a specific thermodynamic state point. Another traditional application of cheminformatics is the inverse design of molecules with prescribed (or optimized) properties, and the construction for generative models. While one could envisage to use 3D representations for this task, a substantial hurdle would be the fact that the map between structure and density-correlation features is not bijective: there are feature vectors that do not correspond to any structure, and even feature vectors that cannot be obtained as a symmetrized correlation of an arbitrary scalar field. Thus, the unconstrained search for the ``optimal feature vector'' might result in a set of features that do not correspond to an actual structure. Until this issue is better understood, efforts to use atom-density representations for inverse design should rely on approaches that do not require an inverse feature map. In the quest for more accurate and efficient machine-learning models of the structure and properties of atomistic systems, physically-motivated concepts have been incorporated into the mathematical representation of atomic configurations, resulting in striking connections with traditional modeling frameworks. When treading the fine line between data-driven and physics-based approaches, the core question is how to achieve a natural description of well-understood phenomena without giving up the flexibility to model unexpected, complex effects -- and how to build features that can be optimized for a specific application, while still being universally applicable. A definitive answer to this question is still lacking, but we believe that the general principles that we have summarized in this review may indicate the direction to follow, and provide some guidance to the practitioners who seek to make an informed choice among the ever increasing number of representations for atomic-scale modeling. \begin{acknowledgments} The authors would like to thank Yasushi Shibuta for providing the structures used in Fig.~\ref{fig:shibuta}, and Stefan Goedecker for providing Fig.~\ref{fig:goedecker-fingerprints}, and the many colleagues and friends who discussed with us about this review, and the ideas it summarizes. FM, MC and AG acknowledge support by the National Center of Competence in Research MARVEL, funded by the Swiss National Science Foundation. \end{acknowledgments} \section*{Author biographies} {\bf F\'elix Musil} studied physics at the EPFL and received his MSc in applied physics in 2015, with a thesis on the modeling of plasma in a fusion reactor. For his PhD he joined in 2016 the group of Prof. Ceriotti at the EPFL to develop and apply methods to investigate structure–property relationships in materials using atomistic modeling and machine learning techniques. {\bf Andrea Grisafi} studied chemistry at the University of Pisa and Scuola Normale Superiore of Pisa. In 2016, he received his MSc in physical chemistry with a thesis on the statistical mechanics of simple ionic liquids. Since then, he is a PhD student in the group of Prof. Michele Ceriotti at EPFL, where he works on the development of atomic-scale representations that are suitable to incorporate physical symmetries and long-range effects within machine-learning models of molecular and materials properties. {\bf Albert P. Bart\'ok} is an Assistant Professor at the University of Warwick. He earned his PhD degree in physics from the University of Cambridge in 2010, his research having been on developing interatomic potentials based on ab inito data using machine learning. He was a Junior Research Fellow at Magdalene College, Cambridge and later a Leverhulme Early Career Fellow. Before taking up his current position, he was a Research Scientist at the Science and Technology Facilities Council. His research focuses on developing theoretical and computational tools to understand atomistic processes. {\bf Christoph Ortner} is Professor of Mathematics at the University of British Columbia (Canada). After obtaining his doctorate in numerical analysis in 2007 at the University of Oxford (UK) and remaining there as an RCUK fellow, he moved to the University of Warwick in 2011 and to UBC in 2020. His main interests revolve around mathematical and computational aspects of atomistic and multi-scale modeling. {\bf G\'abor Cs\'anyi} is Professor of Molecular Modelling at the University of Cambridge (UK). He obtained his doctorate in computational physics (2001) from the Massachusetts Institute of Technology (USA), having worked on electronic structure problems. He was in the group of Mike Payne in the Cavendish Laboratory before joining the faculty of the Engineering Laboratory at Cambridge. He is developing algorithms and data driven numerical methods for atomic scale problems in materials science and chemistry. {\bf Michele Ceriotti} is Associate Professor at the Institute of Materials at the {\'E}cole Polytechnique F{\'e}d{\'e}rale de Lausanne. He received his Ph.D. in Physics from ETH Z\"urich in 2010, under the supervision of Professor Michele Parrinello. He spent three years in Oxford as a Junior Research Fellow at Merton College, and joined EPFL in 2013, where he leads the laboratory for Computational Science and Modeling. His research interests focus on the development of methods for molecular dynamics and the simulation of complex systems at the atomistic level, as well as their application to problems in chemistry and materials science -- using machine learning both as an engine to drive more accurate and predictive simulations, and as a conceptual tool to investigate the interplay between data-driven and physics-inspired modeling. \providecommand{\latin}[1]{#1} \makeatletter \providecommand{\doi} {\begingroup\let\do\@makeother\dospecials \catcode`\{=1 \catcode`\}=2 \doi@aux} \providecommand{\doi@aux}[1]{\endgroup\texttt{#1}} \makeatother \providecommand*\mcitethebibliography{\thebibliography} \csname @ifundefined\endcsname{endmcitethebibliography} {\let\endmcitethebibliography\endthebibliography}{} \begin{mcitethebibliography}{357} \providecommand*\natexlab[1]{#1} \providecommand*\mciteSetBstSublistMode[1]{} \providecommand*\mciteSetBstMaxWidthForm[2]{} \providecommand*\mciteBstWouldAddEndPuncttrue {\def\unskip.}{\unskip.}} \providecommand*\mciteBstWouldAddEndPunctfalse {\let\unskip.}\relax} \providecommand*\mciteSetBstMidEndSepPunct[3]{} \providecommand*\mciteSetBstSublistLabelBeginEnd[3]{} \providecommand*\unskip.}{} \mciteSetBstSublistMode{f} \mciteSetBstMaxWidthForm{subitem}{(\alph{mcitesubitemcount})} \mciteSetBstSublistLabelBeginEnd {\mcitemaxwidthsubitemform\space} {\relax} {\relax} \bibitem[Isayev \latin{et~al.}(2015)Isayev, Fourches, Muratov, Oses, Rasch, Tropsha, and Curtarolo]{isay+15cm} Isayev,~O.; Fourches,~D.; Muratov,~E.~N.; Oses,~C.; Rasch,~K.; Tropsha,~A.; Curtarolo,~S. Materials Cartography: {{Representing}} and Mining Materials Space Using Structural and Electronic Fingerprints. \emph{Chem. Mater.} \textbf{2015}, \emph{27}, 735--743\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[{Sanchez-Lengeling} and {Aspuru-Guzik}(2018){Sanchez-Lengeling}, and {Aspuru-Guzik}]{sanc-aspu18science} {Sanchez-Lengeling},~B.; {Aspuru-Guzik},~A. Inverse Molecular Design Using Machine Learning: {{Generative}} Models for Matter Engineering. \emph{Science} \textbf{2018}, \emph{361}, 360--365\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Das \latin{et~al.}(2006)Das, Moll, Stamati, Kavraki, and Clementi]{das+06pnas} Das,~P.; Moll,~M.; Stamati,~H.; Kavraki,~L.~E.; Clementi,~C. Low-Dimensional, Free-Energy Landscapes of Protein-Folding Reactions by Nonlinear Dimensionality Reduction. \emph{Proc. Natl. Acad. Sci. U. S. A.} \textbf{2006}, \emph{103}, 9885--9890\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Ceriotti \latin{et~al.}(2011)Ceriotti, Tribello, and Parrinello]{ceri+11pnas} Ceriotti,~M.; Tribello,~G.~A.; Parrinello,~M. Simplifying the Representation of Complex Free-Energy Landscapes Using Sketch-Map. \emph{Proc. Natl. Acad. Sci. U. S. A.} \textbf{2011}, \emph{108}, 13023--13028\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Spiwok and Kr{\'a}lov{\'a}(2011)Spiwok, and Kr{\'a}lov{\'a}]{spiw-kral11jcp} Spiwok,~V.; Kr{\'a}lov{\'a},~B. Metadynamics in the Conformational Space Nonlinearly Dimensionally Reduced by {{Isomap}}. \emph{J. Chem. Phys.} \textbf{2011}, \emph{135}, 224504\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Rohrdanz \latin{et~al.}(2013)Rohrdanz, Zheng, and Clementi]{rohr+13arpc} Rohrdanz,~M.~A.; Zheng,~W.; Clementi,~C. Discovering Mountain Passes via Torchlight: Methods for the Definition of Reaction Coordinates and Pathways in Complex Macromolecular Reactions. \emph{Annu. Rev. Phys. Chem.} \textbf{2013}, \emph{64}, 295--316\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Kanekal and Bereau(2019)Kanekal, and Bereau]{Kanekal2019} Kanekal,~K.~H.; Bereau,~T. {Resolution limit of data-driven coarse-grained models spanning chemical space}. \emph{Journal of Chemical Physics} \textbf{2019}, \emph{151}\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Jackson \latin{et~al.}(2019)Jackson, Bowen, Antony, Webb, Vishwanath, and de~Pablo]{Jackson2019} Jackson,~N.~E.; Bowen,~A.~S.; Antony,~L.~W.; Webb,~M.~A.; Vishwanath,~V.; de~Pablo,~J.~J. {Electronic structure at coarse-grained resolutions from supervised machine learning}. \emph{Science Advances} \textbf{2019}, \emph{5}, eaav1190\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Wang \latin{et~al.}(2019)Wang, Olsson, Wehmeyer, P{\'{e}}rez, Charron, {De Fabritiis}, No{\'{e}}, and Clementi]{Wang2019} Wang,~J.; Olsson,~S.; Wehmeyer,~C.; P{\'{e}}rez,~A.; Charron,~N.~E.; {De Fabritiis},~G.; No{\'{e}},~F.; Clementi,~C. {Machine Learning of Coarse-Grained Molecular Dynamics Force Fields}. \emph{ACS Central Science} \textbf{2019}, \emph{5}, 755--767\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Behler and Parrinello(2007)Behler, and Parrinello]{behl-parr07prl} Behler,~J.; Parrinello,~M. Generalized {{Neural}}-{{Network Representation}} of {{High}}-{{Dimensional Potential}}-{{Energy Surfaces}}. \emph{Phys. Rev. Lett.} \textbf{2007}, \emph{98}, 146401\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Braams and Bowman(2009)Braams, and Bowman]{braa-bowm09irpc} Braams,~B.~J.; Bowman,~J.~M. Permutationally Invariant Potential Energy Surfaces in High Dimensionality. \emph{Int. Rev. Phys. Chem.} \textbf{2009}, \emph{28}, 577--606\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Bart{\'o}k \latin{et~al.}(2010)Bart{\'o}k, Payne, Kondor, and Cs{\'a}nyi]{bart+10prl} Bart{\'o}k,~A.~P.; Payne,~M.~C.; Kondor,~R.; Cs{\'a}nyi,~G. Gaussian {{Approximation Potentials}}: {{The Accuracy}} of {{Quantum Mechanics}}, without the {{Electrons}}. \emph{Phys. Rev. Lett.} \textbf{2010}, \emph{104}, 136403\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Sosso \latin{et~al.}(2012)Sosso, Miceli, Caravati, Behler, and Bernasconi]{soss+12prb} Sosso,~G.~C.; Miceli,~G.; Caravati,~S.; Behler,~J.; Bernasconi,~M. Neural Network Interatomic Potential for the Phase Change Material {{GeTe}}. \emph{Phys. Rev. B} \textbf{2012}, \emph{85}, 174103\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Behler(2016)]{behl16jcp} Behler,~J. Perspective: {{Machine}} Learning Potentials for Atomistic Simulations. \emph{J. Chem. Phys.} \textbf{2016}, \emph{145}, 170901\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Deringer and Cs{\'a}nyi(2017)Deringer, and Cs{\'a}nyi]{deri-csan17prb} Deringer,~V.~L.; Cs{\'a}nyi,~G. Machine Learning Based Interatomic Potential for Amorphous Carbon. \emph{Phys. Rev. B} \textbf{2017}, \emph{95}, 094203\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Dragoni \latin{et~al.}(2018)Dragoni, Daff, Cs{\'a}nyi, and Marzari]{drag+18prm} Dragoni,~D.; Daff,~T.~D.; Cs{\'a}nyi,~G.; Marzari,~N. Achieving {{DFT}} Accuracy with a Machine-Learning Interatomic Potential: {{Thermomechanics}} and Defects in Bcc Ferromagnetic Iron. \emph{Phys. Rev. Materials} \textbf{2018}, \emph{2}, 013808\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Cheng \latin{et~al.}(2020)Cheng, Mazzola, Pickard, and Ceriotti]{chen+20nature} Cheng,~B.; Mazzola,~G.; Pickard,~C.~J.; Ceriotti,~M. Evidence for Supercritical Behaviour of High-Pressure Liquid Hydrogen. \emph{Nature} \textbf{2020}, \emph{585}, 217--220\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Deringer \latin{et~al.}(2021)Deringer, Bernstein, Cs{\'a}nyi, Ben~Mahmoud, Ceriotti, Wilson, Drabold, and Elliott]{deri+21nature} Deringer,~V.~L.; Bernstein,~N.; Cs{\'a}nyi,~G.; Ben~Mahmoud,~C.; Ceriotti,~M.; Wilson,~M.; Drabold,~D.~A.; Elliott,~S.~R. Origins of Structural and Electronic Transitions in Disordered Silicon. \emph{Nature} \textbf{2021}, \emph{589}, 59--64\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Rupp \latin{et~al.}(2012)Rupp, Tkatchenko, M{\"u}ller, and {von Lilienfeld}]{rupp+12prl} Rupp,~M.; Tkatchenko,~A.; M{\"u}ller,~K.-R.; {von Lilienfeld},~O.~A. Fast and {{Accurate Modeling}} of {{Molecular Atomization Energies}} with {{Machine Learning}}. \emph{Phys. Rev. Lett.} \textbf{2012}, \emph{108}, 058301\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Smith \latin{et~al.}(2017)Smith, Isayev, and Roitberg]{smit+17cs} Smith,~J.~S.; Isayev,~O.; Roitberg,~A.~E. {{ANI}}-1: An Extensible Neural Network Potential with {{DFT}} Accuracy at Force Field Computational Cost. \emph{Chem. Sci.} \textbf{2017}, \emph{8}, 3192--3203\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Sch{\"u}tt \latin{et~al.}(2018)Sch{\"u}tt, Sauceda, Kindermans, Tkatchenko, and M{\"u}ller]{schu+18jcp} Sch{\"u}tt,~K.~T.; Sauceda,~H.~E.; Kindermans,~P.-J.; Tkatchenko,~A.; M{\"u}ller,~K.-R. {{SchNet}} \textendash{} {{A}} Deep Learning Architecture for Molecules and Materials. \emph{J. Chem. Phys.} \textbf{2018}, \emph{148}, 241722\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Paruzzo \latin{et~al.}(2018)Paruzzo, Hofstetter, Musil, De, Ceriotti, and Emsley]{paru+18ncomm} Paruzzo,~F.~M.; Hofstetter,~A.; Musil,~F.; De,~S.; Ceriotti,~M.; Emsley,~L. Chemical Shifts in Molecular Solids by Machine Learning. \emph{Nat. Commun.} \textbf{2018}, \emph{9}, 4501\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Grisafi \latin{et~al.}(2019)Grisafi, Fabrizio, Meyer, Wilkins, Corminboeuf, and Ceriotti]{gris+19acscs} Grisafi,~A.; Fabrizio,~A.; Meyer,~B.; Wilkins,~D.~M.; Corminboeuf,~C.; Ceriotti,~M. Transferable {{Machine}}-{{Learning Model}} of the {{Electron Density}}. \emph{ACS Cent. Sci.} \textbf{2019}, \emph{5}, 57--64\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Wilkins \latin{et~al.}(2019)Wilkins, Grisafi, Yang, Lao, DiStasio, and Ceriotti]{wilk+19pnas} Wilkins,~D.~M.; Grisafi,~A.; Yang,~Y.; Lao,~K.~U.; DiStasio,~R.~A.; Ceriotti,~M. Accurate Molecular Polarizabilities with Coupled Cluster Theory and Machine Learning. \emph{Proc. Natl. Acad. Sci. U. S. A.} \textbf{2019}, \emph{116}, 3401--3406\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Sch{\"u}tt \latin{et~al.}(2019)Sch{\"u}tt, Gastegger, Tkatchenko, M{\"u}ller, and Maurer]{schu+19nc} Sch{\"u}tt,~K.~T.; Gastegger,~M.; Tkatchenko,~A.; M{\"u}ller,~K.-R.; Maurer,~R.~J. Unifying Machine Learning and Quantum Chemistry with a Deep Neural Network for Molecular Wavefunctions. \emph{Nat Commun} \textbf{2019}, \emph{10}, 5024\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Kalita \latin{et~al.}(2021)Kalita, Li, McCarty, and Burke]{kali+21acr} Kalita,~B.; Li,~L.; McCarty,~R.~J.; Burke,~K. Learning to {{Approximate Density Functionals}}. \emph{Acc. Chem. Res.} \textbf{2021}, acs.accounts.0c00742\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Ouyang \latin{et~al.}(2018)Ouyang, Curtarolo, Ahmetcik, Scheffler, and Ghiringhelli]{ouya+18prm} Ouyang,~R.; Curtarolo,~S.; Ahmetcik,~E.; Scheffler,~M.; Ghiringhelli,~L.~M. {{SISSO}}: {{A}} Compressed-Sensing Method for Identifying the Best Low-Dimensional Descriptor in an Immensity of Offered Candidates. \emph{Phys. Rev. Mater.} \textbf{2018}, \emph{2}, 083802\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Behler \latin{et~al.}(2007)Behler, Lorenz, and Reuter]{behl+07jcp} Behler,~J.; Lorenz,~S.; Reuter,~K. Representing Molecule-Surface Interactions with Symmetry-Adapted Neural Networks. \emph{The Journal of Chemical Physics} \textbf{2007}, \emph{127}, 014705\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Bart{\'o}k \latin{et~al.}(2013)Bart{\'o}k, Kondor, and Cs{\'a}nyi]{bart+13prb} Bart{\'o}k,~A.~P.; Kondor,~R.; Cs{\'a}nyi,~G. On Representing Chemical Environments. \emph{Phys. Rev. B} \textbf{2013}, \emph{87}, 184115\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Bart{\'o}k \latin{et~al.}(2017)Bart{\'o}k, De, Poelking, Bernstein, Kermode, Cs{\'a}nyi, and Ceriotti]{bart+17sa} Bart{\'o}k,~A.~P.; De,~S.; Poelking,~C.; Bernstein,~N.; Kermode,~J.~R.; Cs{\'a}nyi,~G.; Ceriotti,~M. Machine Learning Unifies the Modeling of Materials and Molecules. \emph{Sci. Adv.} \textbf{2017}, \emph{3}, e1701816\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Huo and Rupp(2017)Huo, and Rupp]{huo-rupp17arxiv} Huo,~H.; Rupp,~M. Unified Representation for Machine Learning of Molecules and Crystals. \emph{ArXiv Prepr. ArXiv170406439} \textbf{2017}, \emph{13754}\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Chen \latin{et~al.}(2019)Chen, Ye, Zuo, Zheng, and Ong]{chen+19cm} Chen,~C.; Ye,~W.; Zuo,~Y.; Zheng,~C.; Ong,~S.~P. Graph {{Networks}} as a {{Universal Machine Learning Framework}} for {{Molecules}} and {{Crystals}}. \emph{Chem. Mater.} \textbf{2019}, \emph{31}, 3564--3572\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Deringer \latin{et~al.}(2021)Deringer, Bart\'ok, Noam~Bernstein, Ceriotti, and Cs\'anyi]{chemrev2021deringer} Deringer,~V.~L.; Bart\'ok,~A.~P.; Noam~Bernstein,~D. M.~W.; Ceriotti,~M.; Cs\'anyi,~G. Gaussian Process Regression for Materials and Molecules. \emph{Chem. Rev. (under review)} \textbf{2021}, \relax \mciteBstWouldAddEndPunctfalse \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Unke \latin{et~al.}(2021)Unke, Chmiela, Sauceda, Gastegger, Poltavsky, Schütt, Tkatchenko, and Müller]{chemrev2021gdml} Unke,~O.~T.; Chmiela,~S.; Sauceda,~H.~E.; Gastegger,~M.; Poltavsky,~I.; Schütt,~K.~T.; Tkatchenko,~A.; Müller,~K.-R. Machine Learning Force Fields. \emph{Chem. Rev.} \textbf{2021}, \relax \mciteBstWouldAddEndPunctfalse \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Manzhos and Carrington(2020)Manzhos, and Carrington]{chemrev2021smallmolecules} Manzhos,~S.; Carrington,~T. Neural Network Potential Energy Surfaces for Small Molecules and Reactions. \emph{Chem. Rev.} \textbf{2020}, \relax \mciteBstWouldAddEndPunctfalse \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Behler(2021)]{chemrev2021behler} Behler,~J. Four Generations of High-Dimensional Neural Network Potentials. \emph{Chem. Rev.} \textbf{2021}, \relax \mciteBstWouldAddEndPunctfalse \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Westermayr and Marquetand(2020)Westermayr, and Marquetand]{chemrev2021excited} Westermayr,~J.; Marquetand,~P. Machine Learning for Electronically Excited States of Molecules. \emph{Chem. Rev.} \textbf{2020}, \relax \mciteBstWouldAddEndPunctfalse \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Glielmo \latin{et~al.}(2021)Glielmo, Husic, Rodriguez, Clementi, No{\'{e}}, and Laio]{chemrev2021unsupervised} Glielmo,~A.; Husic,~B.~E.; Rodriguez,~A.; Clementi,~C.; No{\'{e}},~F.; Laio,~A. Unsupervised Learning Methods for Molecular Simulation Data. \emph{Chem. Rev.} \textbf{2021}, \relax \mciteBstWouldAddEndPunctfalse \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Blum and Reymond(2009)Blum, and Reymond]{blum-reym09jacs} Blum,~L.~C.; Reymond,~J.-L. 970 {{Million Druglike Small Molecules}} for {{Virtual Screening}} in the {{Chemical Universe Database GDB}}-13. \emph{J. Am. Chem. Soc.} \textbf{2009}, \emph{131}, 8732--8733\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Karelson(2000)]{kare00book} Karelson,~M. \emph{Molecular Descriptors in {{QSAR}}/{{QSPR}}}; {Wiley-Interscience}: {New York}, 2000\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Weininger(1988)]{wein88jcim} Weininger,~D. {{SMILES}}, a Chemical Language and Information System. 1. {{Introduction}} to Methodology and Encoding Rules. \emph{J. Chem. Inf. Model.} \textbf{1988}, \emph{28}, 31--36\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Todeschini and Consonni(2010)Todeschini, and Consonni]{Todeschini2010} Todeschini,~R.; Consonni,~V. \emph{Molecular Descriptors for Chemoinformatics}; Methods and Principles in Medicinal Chemistry; Wiley, 2010; Vol.~2; pp 1--252\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Wills \latin{et~al.}(2020)Wills, Polshakov, Robinson, and Lee]{will+20jcim} Wills,~T.~J.; Polshakov,~D.~A.; Robinson,~M.~C.; Lee,~A.~A. Impact of {{Chemist}}-{{In}}-{{The}}-{{Loop Molecular Representations}} on {{Machine Learning Outcomes}}. \emph{J. Chem. Inf. Model.} \textbf{2020}, \emph{60}, 4449--4456\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Schneider and Fechner(2005)Schneider, and Fechner]{schn-fech05nrdd} Schneider,~G.; Fechner,~U. Computer-Based de Novo Design of Drug-like Molecules. \emph{Nat Rev Drug Discov} \textbf{2005}, \emph{4}, 649--663\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Karelson \latin{et~al.}(1996)Karelson, Lobanov, and Katritzky]{kare+96cr} Karelson,~M.; Lobanov,~V.~S.; Katritzky,~A.~R. Quantum-{{Chemical Descriptors}} in {{QSAR}}/{{QSPR Studies}}. \emph{Chem. Rev.} \textbf{1996}, \emph{96}, 1027--1044\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Gaulton \latin{et~al.}(2012)Gaulton, Bellis, Bento, Chambers, Davies, Hersey, Light, McGlinchey, Michalovich, Al-Lazikani, and Overington]{Gaulton2012} Gaulton,~A.; Bellis,~L.~J.; Bento,~A.~P.; Chambers,~J.; Davies,~M.; Hersey,~A.; Light,~Y.; McGlinchey,~S.; Michalovich,~D.; Al-Lazikani,~B.; Overington,~J.~P. {ChEMBL: a large-scale bioactivity database for drug discovery}. \emph{Nucleic Acids Research} \textbf{2012}, \emph{40}, D1100--D1107\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Sterling and Irwin(2015)Sterling, and Irwin]{Sterling2015} Sterling,~T.; Irwin,~J.~J. {ZINC 15 – Ligand Discovery for Everyone}. \emph{Journal of Chemical Information and Modeling} \textbf{2015}, \emph{55}, 2324--2337\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Kim \latin{et~al.}(2016)Kim, Thiessen, Bolton, Chen, Fu, Gindulyte, Han, He, He, Shoemaker, Wang, Yu, Zhang, and Bryant]{Kim2016} Kim,~S.; Thiessen,~P.~A.; Bolton,~E.~E.; Chen,~J.; Fu,~G.; Gindulyte,~A.; Han,~L.; He,~J.; He,~S.; Shoemaker,~B.~A.; Wang,~J.; Yu,~B.; Zhang,~J.; Bryant,~S.~H. {PubChem substance and compound databases}. \emph{Nucleic Acids Research} \textbf{2016}, \emph{44}, D1202--D1213\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Wu \latin{et~al.}(2018)Wu, Ramsundar, Feinberg, Gomes, Geniesse, Pappu, Leswing, and Pande]{Wu2018} Wu,~Z.; Ramsundar,~B.; Feinberg,~E.~N.; Gomes,~J.; Geniesse,~C.; Pappu,~A.~S.; Leswing,~K.; Pande,~V. {MoleculeNet: a benchmark for molecular machine learning}. \emph{Chemical Science} \textbf{2018}, \emph{9}, 513--530\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Obrezanova \latin{et~al.}(2007)Obrezanova, Cs{\'a}nyi, Gola, and Segall]{obre+07jcim} Obrezanova,~O.; Cs{\'a}nyi,~G.; Gola,~J. M.~R.; Segall,~M.~D. Gaussian {{Processes}}: {{A Method}} for {{Automatic QSAR Modeling}} of {{ADME Properties}}. \emph{J. Chem. Inf. Model.} \textbf{2007}, \emph{47}, 1847--1857\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Mysinger \latin{et~al.}(2012)Mysinger, Carchia, Irwin, and Shoichet]{Mysinger2012} Mysinger,~M.~M.; Carchia,~M.; Irwin,~J.~J.; Shoichet,~B.~K. {Directory of useful decoys, enhanced (DUD-E): Better ligands and decoys for better benchmarking}. \emph{Journal of Medicinal Chemistry} \textbf{2012}, \emph{55}, 6582--6594\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Jones(1924)]{jone24prsa} Jones,~J.~E. On the Determination of Molecular Fields. \textemdash{{II}}. {{From}} the Equation of State of a Gas. \emph{Proc. R. Soc. Lond. A} \textbf{1924}, \emph{106}, 463--477\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Alder \latin{et~al.}(1970)Alder, Gass, and Wainwright]{Alder1970} Alder,~B.~J.; Gass,~D.~M.; Wainwright,~T.~E. {Studies in molecular dynamics. VIII. The transport coefficients for a hard-sphere fluid}. \emph{The Journal of Chemical Physics} \textbf{1970}, \emph{53}, 3813--3826\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Stillinger and Rahman(1974)Stillinger, and Rahman]{rahm-stil71jcp} Stillinger,~F.~H.; Rahman,~A. Improved Simulation of Liquid Water by Molecular Dynamics {{Comparison}} of Simple Potential Functions for Simulating Liquid Water {{Improved}} Simulation of Liquid Water by Molecular Dynamics*. \emph{J. Chem. Phys. J. Chem. Phys. J. Chem. Phys. Gen. Method J. Chem. Phys. J. Chem. Phys. J. Chem. Phys.} \textbf{1974}, \emph{601}, 1545--926\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Car and Parrinello(1985)Car, and Parrinello]{car-parr85prl} Car,~R.; Parrinello,~M. Unified {{Aproach}} for {{Molecular Dynamics}} and {{Density}}-{{Functional}} Theory. {{R}}. {{Car}} and {{M}}. {{Parrinello}}.Pdf. \emph{Phys. Rev. Lett.} \textbf{1985}, \emph{55}, 2471--2474\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Allen and Tildesley(1990)Allen, and Tildesley]{alle-tild90book} Allen,~M.~P.; Tildesley,~D.~J. \emph{Computer Simulation of Liquids}; {Oxford University Press, USA}, 1990\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Frenkel and Smit(2002)Frenkel, and Smit]{fren-smit02book} Frenkel,~D.; Smit,~B. \emph{Understanding {{Molecular Simulation}}}, 2nd ed.; {Academic Press}: {London}, 2002\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Parr and Yang(1994)Parr, and Yang]{parr-yang94book} Parr,~R.~G.; Yang,~W. \emph{Density-Functional Theory of Atoms and Molecules}, 1st ed.; International Series of Monographs on Chemistry 16; {Oxford Univ. Press [u.a.]}: {New York, NY}, 1994\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Burke(2012)]{burk12jcp} Burke,~K. Perspective on Density Functional Theory. \emph{J. Chem. Phys.} \textbf{2012}, \emph{136}, 150901\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Booth \latin{et~al.}(2013)Booth, Gr{\"u}neis, Kresse, and Alavi]{boot+13nature} Booth,~G.~H.; Gr{\"u}neis,~A.; Kresse,~G.; Alavi,~A. Towards an Exact Description of Electronic Wavefunctions in Real Solids. \emph{Nature} \textbf{2013}, \emph{493}, 365--370\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Partridge and Schwenke(1997)Partridge, and Schwenke]{part-schw97jcp} Partridge,~H.; Schwenke,~D.~W. The Determination of an Accurate Isotope Dependent Potential Energy Surface for Water from Extensive Ab Initio Calculations and Experimental Data. \emph{J. Chem. Phys.} \textbf{1997}, \emph{106}, 4618\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Huang \latin{et~al.}(2005)Huang, Braams, and Bowman]{huan+05jcp} Huang,~X.; Braams,~B.~J.; Bowman,~J.~M. Ab Initio Potential Energy and Dipole Moment Surfaces for \${{H}}\_{{5O}}\_2\^+\$. \emph{J. Chem. Phys.} \textbf{2005}, \emph{122}, 44308\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Russell and Manolopoulos(1996)Russell, and Manolopoulos]{russ-mano96cpl} Russell,~C.~L.; Manolopoulos,~D.~E. How to Observe the Elusive Resonances in {{F}} + {{H2}} Reactive Scattering. \emph{Chemical Physics Letters} \textbf{1996}, \emph{256}, 465--473\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Kim \latin{et~al.}(2015)Kim, Weichman, Sjolander, Neumark, {K os}, Alexander, and Manolopoulos]{kim+15science} Kim,~J.~B.; Weichman,~M.~L.; Sjolander,~T.~F.; Neumark,~D.~M.; {K os},~J.; Alexander,~M.~H.; Manolopoulos,~D.~E. Spectroscopic Observation of Resonances in the {{F}} + {{H2}} Reaction. \emph{Science} \textbf{2015}, \emph{349}, 510--513\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Tuckerman(2008)]{tuck08book} Tuckerman,~M. \emph{Statistical {{Mechanics}} and {{Molecular Simulations}}}; {Oxford University Press}, 2008\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Feynman and Hibbs(1964)Feynman, and Hibbs]{feyn-hibb65book} Feynman,~R.~P.; Hibbs,~A.~R. \emph{Quantum {{Mechanics}} and {{Path Integrals}}}; {McGraw-Hill}: {New York}, 1964\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Markland and Ceriotti(2018)Markland, and Ceriotti]{mark-ceri18nrc} Markland,~T.~E.; Ceriotti,~M. Nuclear Quantum Effects Enter the Mainstream. \emph{Nat. Rev. Chem.} \textbf{2018}, \emph{2}, 0109\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Sadeghi \latin{et~al.}(2013)Sadeghi, Ghasemi, Schaefer, Mohr, Lill, and Goedecker]{sade+13jcp} Sadeghi,~A.; Ghasemi,~S.~A.; Schaefer,~B.; Mohr,~S.; Lill,~M.~A.; Goedecker,~S. Metrics for Measuring Distances in Configuration Spaces. \emph{J. Chem. Phys.} \textbf{2013}, \emph{139}, 184118\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[De \latin{et~al.}(2016)De, Bart{\'o}k, Cs{\'a}nyi, and Ceriotti]{de+16pccp} De,~S.; Bart{\'o}k,~A.~P.; Cs{\'a}nyi,~G.; Ceriotti,~M. Comparing Molecules and Solids across Structural and Alchemical Space. \emph{Phys. Chem. Chem. Phys.} \textbf{2016}, \emph{18}, 13754--13769\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Bernstein \latin{et~al.}(2019)Bernstein, Bhattarai, Cs{\'a}nyi, Drabold, Elliott, and Deringer]{bern+19acie} Bernstein,~N.; Bhattarai,~B.; Cs{\'a}nyi,~G.; Drabold,~D.~A.; Elliott,~S.~R.; Deringer,~V.~L. Quantifying {{Chemical Structure}} and {{Machine}}-{{Learned Atomic Energies}} in {{Amorphous}} and {{Liquid Silicon}}. \emph{Angew. Chem. Int. Ed.} \textbf{2019}, \emph{58}, 7057--7061\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Yang(1991)]{yang91prl} Yang,~W. Direct Calculation of Electron Density in Density-Functional Theory. \emph{Phys. Rev. Lett.} \textbf{1991}, \emph{66}, 1438--1441\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Galli and Parrinello(1992)Galli, and Parrinello]{gall-parr92prl} Galli,~G.; Parrinello,~M. Large Scale Electronic Structure Calculations. \emph{Phys. Rev. Lett.} \textbf{1992}, \emph{69}, 3547--3550\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Pulay \latin{et~al.}(1979)Pulay, Fogarasi, Pang, and Boggs]{pula+79jacs} Pulay,~P.; Fogarasi,~G.; Pang,~F.; Boggs,~J.~E. Systematic Ab Initio Gradient Calculation of Molecular Geometries, Force Constants, and Dipole Moment Derivatives. \emph{J. Am. Chem. Soc.} \textbf{1979}, \emph{101}, 2550--2560\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Mayo \latin{et~al.}(1990)Mayo, Olafson, and Goddard]{mayo+90jpc} Mayo,~S.~L.; Olafson,~B.~D.; Goddard,~W.~A. {{DREIDING}}: A Generic Force Field for Molecular Simulations. \emph{J. Phys. Chem.} \textbf{1990}, \emph{94}, 8897--8909\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Vanommeslaeghe \latin{et~al.}(2009)Vanommeslaeghe, Hatcher, Acharya, Kundu, Zhong, Shim, Darian, Guvench, Lopes, Vorobyov, and Mackerell]{vano+09jcc} Vanommeslaeghe,~K.; Hatcher,~E.; Acharya,~C.; Kundu,~S.; Zhong,~S.; Shim,~J.; Darian,~E.; Guvench,~O.; Lopes,~P.; Vorobyov,~I.; Mackerell,~A.~D. {{CHARMM}} General Force Field: {{A}} Force Field for Drug-like Molecules Compatible with the {{CHARMM}} All-Atom Additive Biological Force Fields. \emph{J. Comput. Chem.} \textbf{2009}, NA--NA\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Halgren(1996)]{halg96jcc} Halgren,~T.~A. Merck Molecular Force Field. {{I}}. {{Basis}}, Form, Scope, Parameterization, and Performance of {{MMFF94}}. \emph{J. Comput. Chem.} \textbf{1996}, \emph{17}, 490--519\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Damm \latin{et~al.}(1997)Damm, Frontera, {Tirado{\textendash}Rives}, and Jorgensen]{damm+97jcc} Damm,~W.; Frontera,~A.; {Tirado{\textendash}Rives},~J.; Jorgensen,~W.~L. {{OPLS}} All-Atom Force Field for Carbohydrates. \emph{J. Comput. Chem.} \textbf{1997}, \emph{18}, 1955--1970\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Baker and Hehre(1991)Baker, and Hehre]{bake-hehr91jcc} Baker,~J.; Hehre,~W.~J. Geometry Optimization in Cartesian Coordinates: {{The}} End of {{theZ}}-Matrix? \emph{J. Comput. Chem.} \textbf{1991}, \emph{12}, 606--610\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Baker and Chan(1996)Baker, and Chan]{bake-chan96jcc} Baker,~J.; Chan,~F. The Location of Transition States: {{A}} Comparison of {{Cartesian}}, {{Z}}-Matrix, and Natural Internal Coordinates. \emph{J. Comput. Chem.} \textbf{1996}, \emph{17}, 888--904\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Harrison \latin{et~al.}(2018)Harrison, Schall, Maskey, Mikulski, Knippenberg, and Morrow]{Harrison2018} Harrison,~J.~A.; Schall,~J.~D.; Maskey,~S.; Mikulski,~P.~T.; Knippenberg,~M.~T.; Morrow,~B.~H. {Review of force fields and intermolecular potentials used in atomistic computational materials research}. \emph{Applied Physics Reviews} \textbf{2018}, \emph{5}, 031104\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Duvenaud \latin{et~al.}(2015)Duvenaud, Maclaurin, Iparraguirre, Bombarell, Hirzel, {Aspuru-Guzik}, and Adams]{duve+15nips} Duvenaud,~D.~K.; Maclaurin,~D.; Iparraguirre,~J.; Bombarell,~R.; Hirzel,~T.; {Aspuru-Guzik},~A.; Adams,~R.~P. Convolutional Networks on Graphs for Learning Molecular Fingerprints. Advances in Neural Information Processing Systems. 2015; pp 2224--2232\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Kamerlin and Warshel(2011)Kamerlin, and Warshel]{kame-wars11wcms} Kamerlin,~S. C.~L.; Warshel,~A. The Empirical Valence Bond Model: Theory and Applications. \emph{WIREs Comput Mol Sci} \textbf{2011}, \emph{1}, 30--45\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Brown \latin{et~al.}(2004)Brown, McCoy, Braams, Jin, and Bowman]{brow+04jcp} Brown,~A.; McCoy,~A.~B.; Braams,~B.~J.; Jin,~Z.; Bowman,~J.~M. Quantum and Classical Studies of Vibrational Motion of {{CH5}} on a Global Potential Energy Surface Obtained from a Novel Ab Initio Direct Dynamics Approach. \emph{J. Chem. Phys.} \textbf{2004}, \emph{121}, 4105--4116\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Bowman \latin{et~al.}(2010)Bowman, Braams, Carter, Chen, Czak{\'o}, Fu, Huang, Kamarchik, Sharma, Shepler, Wang, and Xie]{bowm+10jpcl} Bowman,~J.~M.; Braams,~B.~J.; Carter,~S.; Chen,~C.; Czak{\'o},~G.; Fu,~B.; Huang,~X.; Kamarchik,~E.; Sharma,~A.~R.; Shepler,~B.~C.; Wang,~Y.; Xie,~Z. Ab-{{Initio}}-{{Based Potential Energy Surfaces}} for {{Complex Molecules}} and {{Molecular Complexes}}. \emph{J. Phys. Chem. Lett.} \textbf{2010}, \emph{1}, 1866--1874\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Xie and Bowman(2010)Xie, and Bowman]{xie-bowm10jctc} Xie,~Z.; Bowman,~J.~M. Permutationally {{Invariant Polynomial Basis}} for {{Molecular Energy Surface Fitting}} via {{Monomial Symmetrization}}. \emph{J. Chem. Theory Comput.} \textbf{2010}, \emph{6}, 26--34\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Jiang and Guo(2013)Jiang, and Guo]{jian-guo13jcp} Jiang,~B.; Guo,~H. Permutation Invariant Polynomial Neural Network Approach to Fitting Potential Energy Surfaces. \emph{The Journal of Chemical Physics} \textbf{2013}, \emph{139}, 054112\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Collins and Parsons(1993)Collins, and Parsons]{coll-pars93jcp} Collins,~M.~A.; Parsons,~D.~F. Implications of Rotation\textendash Inversion\textendash Permutation Invariance for Analytic Molecular Potential Energy Surfaces. \emph{The Journal of Chemical Physics} \textbf{1993}, \emph{99}, 6756--6772\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Blank \latin{et~al.}(1995)Blank, Brown, Calhoun, and Doren]{blan+95jcp} Blank,~T.~B.; Brown,~S.~D.; Calhoun,~A.~W.; Doren,~D.~J. Neural Network Models of Potential Energy Surfaces. \emph{J. Chem. Phys.} \textbf{1995}, \emph{103}, 4129\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Gassner \latin{et~al.}(1998)Gassner, Probst, Lauenstein, and Hermansson]{gass+98jpca} Gassner,~H.; Probst,~M.; Lauenstein,~A.; Hermansson,~K. Representation of {{Intermolecular Potential Functions}} by {{Neural Networks}}. \emph{J. Phys. Chem. A} \textbf{1998}, \emph{102}, 4596--4605\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Sanchez \latin{et~al.}(1984)Sanchez, Ducastelle, and Gratias]{sanc+84pa} Sanchez,~J.; Ducastelle,~F.; Gratias,~D. Generalized Cluster Description of Multicomponent Systems. \emph{Physica A: Statistical Mechanics and its Applications} \textbf{1984}, \emph{128}, 334--350\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Pettifor(1989)]{pett89prl} Pettifor,~D. New Many-Body Potential for the Bond Order. \emph{Phys. Rev. Lett.} \textbf{1989}, \emph{63}, 2480--2483\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Horsfield \latin{et~al.}(1996)Horsfield, Bratkovsky, Fearn, Pettifor, and Aoki]{hors+96prb2} Horsfield,~A.~P.; Bratkovsky,~A.~M.; Fearn,~M.; Pettifor,~D.~G.; Aoki,~M. Bond-Order Potentials: {{Theory}} and Implementation. \emph{Phys. Rev. B} \textbf{1996}, \emph{53}, 12694--12712\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Ozaki \latin{et~al.}(2000)Ozaki, Aoki, and Pettifor]{ozak+00prb} Ozaki,~T.; Aoki,~M.; Pettifor,~D.~G. Block Bond-Order Potential as a Convergent Moments-Based Method. \emph{Phys. Rev. B} \textbf{2000}, \emph{61}, 7972--7988\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Nguyen \latin{et~al.}(2018)Nguyen, Sz{\'e}kely, Imbalzano, Behler, Cs{\'a}nyi, Ceriotti, G{\"o}tz, and Paesani]{nguy+18jcp} Nguyen,~T.~T.; Sz{\'e}kely,~E.; Imbalzano,~G.; Behler,~J.; Cs{\'a}nyi,~G.; Ceriotti,~M.; G{\"o}tz,~A.~W.; Paesani,~F. Comparison of Permutationally Invariant Polynomials, Neural Networks, and {{Gaussian}} Approximation Potentials in Representing Water Interactions through Many-Body Expansions. \emph{J. Chem. Phys.} \textbf{2018}, \emph{148}, 241725\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[{van der Oord} \latin{et~al.}(2020){van der Oord}, Dusson, Cs{\'a}nyi, and Ortner]{vand+20mlst} {van der Oord},~C.; Dusson,~G.; Cs{\'a}nyi,~G.; Ortner,~C. Regularised Atomic Body-Ordered Permutation-Invariant Polynomials for the Construction of Interatomic Potentials. \emph{Mach. Learn. Sci. Technol.} \textbf{2020}, \emph{1}, 015004\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Moussa(2012)]{mous12prl} Moussa,~J.~E. Comment on ``{{Fast}} and {{Accurate Modeling}} of {{Molecular Atomization Energies}} with {{Machine Learning}}''. \emph{Phys. Rev. Lett.} \textbf{2012}, \emph{109}, 059801\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Montavon \latin{et~al.}(2012)Montavon, Hansen, Fazli, Rupp, Biegler, Ziehe, Tkatchenko, Lilienfeld, and M{\"u}ller]{mont+12nips} Montavon,~G.; Hansen,~K.; Fazli,~S.; Rupp,~M.; Biegler,~F.; Ziehe,~A.; Tkatchenko,~A.; Lilienfeld,~A.~V.; M{\"u}ller,~K.-R. In \emph{Advances in Neural Information Processing Systems 25}; Pereira,~F., Burges,~C. J.~C., Bottou,~L., Weinberger,~K.~Q., Eds.; {Curran Associates, Inc.}, 2012; pp 440--448\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Hansen \latin{et~al.}(2013)Hansen, Montavon, Biegler, Fazli, Rupp, Scheffler, {von Lilienfeld}, Tkatchenko, and M{\"u}ller]{hans+13jctc} Hansen,~K.; Montavon,~G.; Biegler,~F.; Fazli,~S.; Rupp,~M.; Scheffler,~M.; {von Lilienfeld},~O.~A.; Tkatchenko,~A.; M{\"u}ller,~K.-R. Assessment and {{Validation}} of {{Machine Learning Methods}} for {{Predicting Molecular Atomization Energies}}. \emph{J. Chem. Theory Comput.} \textbf{2013}, \emph{9}, 3404--3419\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Rupp \latin{et~al.}(2015)Rupp, Ramakrishnan, and {von Lilienfeld}]{rupp+15jpcl} Rupp,~M.; Ramakrishnan,~R.; {von Lilienfeld},~O.~A. Machine {{Learning}} for {{Quantum Mechanical Properties}} of {{Atoms}} in {{Molecules}}. \emph{J. Phys. Chem. Lett.} \textbf{2015}, \emph{6}, 3309--3313\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Pipolo \latin{et~al.}(2017)Pipolo, Salanne, Ferlat, Klotz, Saitta, and Pietrucci]{pipo+17prl} Pipolo,~S.; Salanne,~M.; Ferlat,~G.; Klotz,~S.; Saitta,~A. {\textbackslash}.~e.; Pietrucci,~F. Navigating at {{Will}} on the {{Water Phase Diagram}}. \emph{Phys. Rev. Lett.} \textbf{2017}, \emph{119}\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Hansen \latin{et~al.}(2015)Hansen, Biegler, Ramakrishnan, Pronobis, Von~Lilienfeld, M{\"u}ller, and Tkatchenko]{hans+15jpcl} Hansen,~K.; Biegler,~F.; Ramakrishnan,~R.; Pronobis,~W.; Von~Lilienfeld,~O.~A.; M{\"u}ller,~K.~R.; Tkatchenko,~A. Machine Learning Predictions of Molecular Properties: {{Accurate}} Many-Body Potentials and Nonlocality in Chemical Space. \emph{J. Phys. Chem. Lett.} \textbf{2015}, \emph{6}, 2326--2331\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Vilhelmsen and Hammer(2012)Vilhelmsen, and Hammer]{vilh-hamm12prl} Vilhelmsen,~L.~B.; Hammer,~B. Systematic {{Study}} of {{Au}} 6 to {{Au}} 12 {{Gold Clusters}} on {{MgO}}(100) {{F Centers Using Density}}-{{Functional Theory}}. \emph{Phys. Rev. Lett.} \textbf{2012}, \emph{108}, 126101\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Vilhelmsen and Hammer(2014)Vilhelmsen, and Hammer]{vilh-hamm14jcp} Vilhelmsen,~L.~B.; Hammer,~B. A Genetic Algorithm for First Principles Global Structure Optimization of Supported Nano Structures. \emph{The Journal of Chemical Physics} \textbf{2014}, \emph{141}, 044711\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Chen \latin{et~al.}(2018)Chen, J{\o}rgensen, Li, and Hammer]{chen+18jctc} Chen,~X.; J{\o}rgensen,~M.~S.; Li,~J.; Hammer,~B. Atomic {{Energies}} from a {{Convolutional Neural Network}}. \emph{J. Chem. Theory Comput.} \textbf{2018}, \emph{14}, 3933--3942\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Pietrucci and Andreoni(2011)Pietrucci, and Andreoni]{piet-andr11prl} Pietrucci,~F.; Andreoni,~W. Graph {{Theory Meets Ab Initio Molecular Dynamics}}: {{Atomic Structures}} and {{Transformations}} at the {{Nanoscale}}. \emph{Phys. Rev. Lett.} \textbf{2011}, \emph{107}, 085504\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Zhu \latin{et~al.}(2016)Zhu, Amsler, Fuhrer, Schaefer, Faraji, Rostami, Ghasemi, Sadeghi, Grauzinyte, Wolverton, and Goedecker]{zhu+16jcp} Zhu,~L.; Amsler,~M.; Fuhrer,~T.; Schaefer,~B.; Faraji,~S.; Rostami,~S.; Ghasemi,~S.~A.; Sadeghi,~A.; Grauzinyte,~M.; Wolverton,~C.; Goedecker,~S. A Fingerprint Based Metric for Measuring Similarities of Crystalline Structures. \emph{J. Chem. Phys.} \textbf{2016}, \emph{144}, 034203\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Wang \latin{et~al.}(2018)Wang, Zhang, Han, and E]{wang+18cpc} Wang,~H.; Zhang,~L.; Han,~J.; E,~W. {{DeePMD}}-Kit: {{A}} Deep Learning Package for Many-Body Potential Energy Representation and Molecular Dynamics. \emph{Computer Physics Communications} \textbf{2018}, \emph{228}, 178--184\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[{\c C}aylak \latin{et~al.}(2020){\c C}aylak, {von Lilienfeld}, and Baumeier]{cayl+20mlst} {\c C}aylak,~O.; {von Lilienfeld},~A.; Baumeier,~B. Wasserstein Metric for Improved Quantum Machine Learning with Adjacency Matrix Representations. \emph{Mach. Learn.: Sci. Technol.} \textbf{2020}, \relax \mciteBstWouldAddEndPunctfalse \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Willatt \latin{et~al.}(2019)Willatt, Musil, and Ceriotti]{will+19jcp} Willatt,~M.~J.; Musil,~F.; Ceriotti,~M. Atom-Density Representations for Machine Learning. \emph{J. Chem. Phys.} \textbf{2019}, \emph{150}, 154110\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Ischtwan and Collins(1994)Ischtwan, and Collins]{isch-coll94jcp} Ischtwan,~J.; Collins,~M.~A. Molecular Potential Energy Surfaces by Interpolation. \emph{The Journal of Chemical Physics} \textbf{1994}, \emph{100}, 8080--8088\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Ho and Rabitz(1996)Ho, and Rabitz]{ho-rabi96jcp} Ho,~T.-S.; Rabitz,~H. A General Method for Constructing Multidimensional Molecular Potential Energy Surfaces from {\emph{Ab}} {\emph{Initio}} Calculations. \emph{The Journal of Chemical Physics} \textbf{1996}, \emph{104}, 2584--2597\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Prodan and Kohn(2005)Prodan, and Kohn]{prod-kohn05pnas} Prodan,~E.; Kohn,~W. Nearsightedness of Electronic Matter. \emph{Proc. Natl. Acad. Sci.} \textbf{2005}, \emph{102}, 11635--11638\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Jung \latin{et~al.}(2020)Jung, Stocker, Kunkel, Oberhofer, Han, Reuter, and Margraf]{jung+20csc} Jung,~H.; Stocker,~S.; Kunkel,~C.; Oberhofer,~H.; Han,~B.; Reuter,~K.; Margraf,~J.~T. Size-{{Extensive Molecular Machine Learning}} with {{Global Representations}}. \emph{ChemSystemsChem} \textbf{2020}, \emph{2}\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Faber \latin{et~al.}(2015)Faber, Lindmaa, {von Lilienfeld}, and Armiento]{fabe+15ijqc} Faber,~F.; Lindmaa,~A.; {von Lilienfeld},~O.~A.; Armiento,~R. Crystal Structure Representations for Machine Learning Models of Formation Energies. \emph{Int. J. Quantum Chem.} \textbf{2015}, n/a--n/a\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Stuke \latin{et~al.}(2019)Stuke, Todorovi{\'c}, Rupp, Kunkel, Ghosh, Himanen, and Rinke]{stuk+19jcp} Stuke,~A.; Todorovi{\'c},~M.; Rupp,~M.; Kunkel,~C.; Ghosh,~K.; Himanen,~L.; Rinke,~P. Chemical Diversity in Molecular Orbital Energy Predictions with Kernel Ridge Regression. \emph{J. Chem. Phys.} \textbf{2019}, \emph{150}, 204121\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Faber \latin{et~al.}(2018)Faber, Christensen, Huang, and Von~Lilienfeld]{fabe+18jcp} Faber,~F.~A.; Christensen,~A.~S.; Huang,~B.; Von~Lilienfeld,~O.~A. Alchemical and Structural Distribution Based Representation for Universal Quantum Machine Learning. \emph{J. Chem. Phys.} \textbf{2018}, \emph{148}, 241717\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Christensen \latin{et~al.}(2020)Christensen, Bratholm, Faber, and {Anatole von Lilienfeld}]{chri+20jcp} Christensen,~A.~S.; Bratholm,~L.~A.; Faber,~F.~A.; {Anatole von Lilienfeld},~O. {{FCHL}} Revisited: {{Faster}} and More Accurate Quantum Machine Learning. \emph{J. Chem. Phys.} \textbf{2020}, \emph{152}, 044107\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Ramakrishnan and {von Lilienfeld}(2015)Ramakrishnan, and {von Lilienfeld}]{rama-vonl15cijc} Ramakrishnan,~R.; {von Lilienfeld},~O.~A. Many {{Molecular Properties}} from {{One Kernel}} in {{Chemical Space}}. \emph{Chim. Int. J. Chem.} \textbf{2015}, \emph{69}, 182--186\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Barros and Kato(2013)Barros, and Kato]{barr-kato13prb} Barros,~K.; Kato,~Y. Efficient {{Langevin}} Simulation of Coupled Classical Fields and Fermions. \emph{Phys. Rev. B} \textbf{2013}, \emph{88}, 235101\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Zheng \latin{et~al.}(2019)Zheng, Yan, Yang, and Xu]{zhen19jcim} Zheng,~S.; Yan,~X.; Yang,~Y.; Xu,~J. Identifying {{Structure}}\textendash{{Property Relationships}} through {{SMILES Syntax Analysis}} with {{Self}}-{{Attention Mechanism}}. \emph{J. Chem. Inf. Model.} \textbf{2019}, \emph{59}, 914--923\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Shin \latin{et~al.}(2019)Shin, Park, Kang, and Ho]{shin2019self} Shin,~B.; Park,~S.; Kang,~K.; Ho,~J.~C. Self-attention based molecule representation for predicting drug-target interaction. Machine Learning for Healthcare Conference. 2019; pp 230--248\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Boutin and Kemper(2004)Boutin, and Kemper]{bout-kemp04aam} Boutin,~M.; Kemper,~G. On Reconstructing N-Point Configurations from the Distribution of Distances or Areas. \emph{Advances in Applied Mathematics} \textbf{2004}, \emph{32}, 709--735\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Huang and {von Lilienfeld}(2016)Huang, and {von Lilienfeld}]{huan-vonl16jcp} Huang,~B.; {von Lilienfeld},~O.~A. Communication: {{Understanding}} Molecular Representations in Machine Learning: {{The}} Role of Uniqueness and Target Similarity. \emph{The Journal of Chemical Physics} \textbf{2016}, \emph{145}, 161102\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Pozdnyakov \latin{et~al.}(2020)Pozdnyakov, Willatt, Bart{\'o}k, Ortner, Cs{\'a}nyi, and Ceriotti]{pozd+20prl} Pozdnyakov,~S.~N.; Willatt,~M.~J.; Bart{\'o}k,~A.~P.; Ortner,~C.; Cs{\'a}nyi,~G.; Ceriotti,~M. Incompleteness of {{Atomic Structure Representations}}. \emph{Phys. Rev. Lett.} \textbf{2020}, \emph{125}, 166001\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Willatt \latin{et~al.}(2018)Willatt, Musil, and Ceriotti]{will+18pccp} Willatt,~M.~J.; Musil,~F.; Ceriotti,~M. Feature Optimization for Atomistic Machine Learning Yields a Data-Driven Construction of the Periodic Table of the Elements. \emph{Phys. Chem. Chem. Phys.} \textbf{2018}, \emph{20}, 29661--29668\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Drautz(2019)]{drau19prb} Drautz,~R. Atomic Cluster Expansion for Accurate and Transferable Interatomic Potentials. \emph{Phys. Rev. B} \textbf{2019}, \emph{99}, 014104\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Bachmayr \latin{et~al.}(2019)Bachmayr, Csanyi, Drautz, Dusson, Etter, van~der Oord, and Ortner]{Bachmayr2019} Bachmayr,~M.; Csanyi,~G.; Drautz,~R.; Dusson,~G.; Etter,~S.; van~der Oord,~C.; Ortner,~C. {Approximation of Atomic Interactions with Spherical Harmonics}. \textbf{2019}, \relax \mciteBstWouldAddEndPunctfalse \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Langer \latin{et~al.}(2020)Langer, Goeßmann, and Rupp]{langer2020arxiv} Langer,~M.~F.; Goeßmann,~A.; Rupp,~M. Representations of molecules and materials for interpolation of quantum-mechanical simulations via machine learning. \emph{arxiv:2003.12081} \textbf{2020}, \relax \mciteBstWouldAddEndPunctfalse \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Note1()]{Note1} To facilitate the use of this notation in \protect \LaTeX documents, we provide a set of macros at \protect \url {https://github.com/cosmo-epfl/cosmo-tools/tree/master/tex/dirac-rep}\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Gieres(2000)]{gier00rpp} Gieres,~F. Mathematical Surprises and {{Dirac}}'s Formalism in Quantum Mechanics. \emph{Rep. Prog. Phys.} \textbf{2000}, \emph{63}, 1893--1931\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Note2()]{Note2} Note that, much as it is the case in quantum chemistry, non-orthogonal bases introduce some ambiguity in the bra-ket notation, because the coefficients in the expansion of a function in the basis differ from the scalar product between the basis and the function -- the two being related by the overlap matrix of the basis. The notation should be treated with some care when translating it into a practical implementation if the basis used is not orthonormal.\relax \mciteBstWouldAddEndPunctfalse \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Aronszajn(1950)]{aron50tams} Aronszajn,~N. Theory of Reproducing Kernels. \emph{Trans. Amer. Math. Soc.} \textbf{1950}, \emph{68}, 337--337\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Nachbin(1976)]{nachbin1976haar} Nachbin,~L. \emph{{The Haar integral}}; R. E. Krieger Pub. Co., 1976\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Shapeev(2016)]{shap16mms} Shapeev,~A.~V. Moment {{Tensor Potentials}}: {{A Class}} of {{Systematically Improvable Interatomic Potentials}}. \emph{Multiscale Model. Simul.} \textbf{2016}, \emph{14}, 1153--1173\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Kajita \latin{et~al.}(2017)Kajita, Ohba, Jinnouchi, and Asahi]{kaji+17sr} Kajita,~S.; Ohba,~N.; Jinnouchi,~R.; Asahi,~R. A {{Universal 3D Voxel Descriptor}} for {{Solid}}-{{State Material Informatics}} with {{Deep Convolutional Neural Networks}}. \emph{Sci. Rep.} \textbf{2017}, \emph{7}, 1--9\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Noh \latin{et~al.}(2019)Noh, Kim, Stein, Sanchez-Lengeling, Gregoire, Aspuru-Guzik, and Jung]{Noh2019} Noh,~J.; Kim,~J.; Stein,~H.~S.; Sanchez-Lengeling,~B.; Gregoire,~J.~M.; Aspuru-Guzik,~A.; Jung,~Y. {Inverse Design of Solid-State Materials via a Continuous Representation}. \emph{Matter} \textbf{2019}, \emph{1}, 1370--1384\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Christiansen \latin{et~al.}(2020)Christiansen, Mortensen, Meldgaard, and Hammer]{chri+20jcp2} Christiansen,~M.-P.~V.; Mortensen,~H.~L.; Meldgaard,~S.~A.; Hammer,~B. Gaussian Representation for Image Recognition and Reinforcement Learning of Atomistic Structure. \emph{J. Chem. Phys.} \textbf{2020}, \emph{153}, 044107\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Ziletti \latin{et~al.}(2018)Ziletti, Kumar, Scheffler, and Ghiringhelli]{zile+18nc} Ziletti,~A.; Kumar,~D.; Scheffler,~M.; Ghiringhelli,~L.~M. Insightful Classification of Crystal Structures Using Deep Learning. \emph{Nat. Commun.} \textbf{2018}, \emph{9}, 2775\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Andersen and Chandler(1972)Andersen, and Chandler]{ande-chan72jcp} Andersen,~H.~C.; Chandler,~D. Optimized Cluster Expansions for Classical Fluids. {{I}}. {{General}} Theory and Variational Formulation of the Mean Spherical Model and Hard Sphere Percus-Yevick Equations. \emph{J. Chem. Phys.} \textbf{1972}, \emph{57}, 1918--1929\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Chandler(1987)]{chan87book} Chandler,~D. \emph{Introduction to Modern Statistical Mechanics}; {Oxford University Press}: {New York}, 1987\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Behler(2011)]{behl11jcp} Behler,~J. Atom-Centered Symmetry Functions for Constructing High-Dimensional Neural Network Potentials. \emph{The Journal of Chemical Physics} \textbf{2011}, \emph{134}, 074106\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Zhang \latin{et~al.}(2018)Zhang, Han, Wang, Car, and E]{zhan+18prl} Zhang,~L.; Han,~J.; Wang,~H.; Car,~R.; E,~W. Deep {{Potential Molecular Dynamics}}: {{A Scalable Model}} with the {{Accuracy}} of {{Quantum Mechanics}}. \emph{Phys. Rev. Lett.} \textbf{2018}, \emph{120}, 143001\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Mavra{\v c}i{\'c} \latin{et~al.}(2018)Mavra{\v c}i{\'c}, Mocanu, Deringer, Cs{\'a}nyi, and Elliott]{mavr+18jpcl} Mavra{\v c}i{\'c},~J.; Mocanu,~F.~C.; Deringer,~V.~L.; Cs{\'a}nyi,~G.; Elliott,~S.~R. Similarity {{Between Amorphous}} and {{Crystalline Phases}}: {{The Case}} of {{TiO}} {\textsubscript{2}}. \emph{J. Phys. Chem. Lett.} \textbf{2018}, \emph{9}, 2985--2990\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Anderson \latin{et~al.}(2019)Anderson, Hy, and Kondor]{ande+19nips} Anderson,~B.; Hy,~T.~S.; Kondor,~R. Cormorant: {{Covariant Molecular Neural Networks}}. {{NeurIPS}}. 2019; p~10\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Thompson(2004)]{Thompson2004} Thompson,~W. J. W.~J. \emph{{Angular momentum : an illustrated guide to rotational symmetries for physical systems}}; Wiley-VCH, 2004; p 461\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Kazhdan \latin{et~al.}(2003)Kazhdan, Funkhouser, and Rusinkiewicz]{Rusinkiewicz2003} Kazhdan,~M.; Funkhouser,~T.; Rusinkiewicz,~S. Rotation Invariant Spherical Harmonic Representation of 3D Shape Descriptors. Proceedings of the 2003 Eurographics/ACM SIGGRAPH Symposium on Geometry Processing. Goslar, DEU, 2003; p 156–164\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Thompson \latin{et~al.}(2015)Thompson, Swiler, Trott, Foiles, and Tucker]{thom+15jcp} Thompson,~A.; Swiler,~L.; Trott,~C.; Foiles,~S.; Tucker,~G. Spectral Neighbor Analysis Method for Automated Generation of Quantum-Accurate Interatomic Potentials. \emph{Journal of Computational Physics} \textbf{2015}, \emph{285}, 316--330\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Wood and Thompson(2018)Wood, and Thompson]{wood-thom18jcp} Wood,~M.~A.; Thompson,~A.~P. Extending the Accuracy of the {{SNAP}} Interatomic Potential Form. \emph{The Journal of Chemical Physics} \textbf{2018}, \emph{148}, 241721\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Nigam \latin{et~al.}(2020)Nigam, Pozdnyakov, and Ceriotti]{niga+20jcp} Nigam,~J.; Pozdnyakov,~S.; Ceriotti,~M. Recursive Evaluation and Iterative Contraction of {{{\emph{N}}}} -Body Equivariant Features. \emph{J. Chem. Phys.} \textbf{2020}, \emph{153}, 121101\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Drautz(2020)]{drau20prb} Drautz,~R. Atomic Cluster Expansion of Scalar, Vectorial, and Tensorial Properties Including Magnetism and Charge Transfer. \emph{Phys. Rev. B} \textbf{2020}, \emph{102}, 024104\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Biedenharn and Louck(1984)Biedenharn, and Louck]{bied-louc84book} Biedenharn,~L.~C.; Louck,~J.~D. \emph{The {{Racah}}-{{Wigner Algebra}} in {{Quantum Theory}}}, 1st ed.; {Cambridge University Press}, 1984\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Behler(2011)]{behl11pccp} Behler,~J. Neural Network Potential-Energy Surfaces in Chemistry: A Tool for Large-Scale Simulations. \emph{Phys. Chem. Chem. Phys. PCCP} \textbf{2011}, \emph{13}, 17930--55\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Handley and Popelier(2009)Handley, and Popelier]{hand-pope09jctc} Handley,~C.~M.; Popelier,~P. L.~A. Dynamically {{Polarizable Water Potential Based}} on {{Multipole Moments Trained}} by {{Machine Learning}}. \emph{J. Chem. Theory Comput.} \textbf{2009}, \emph{5}, 1474--1489\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Bereau \latin{et~al.}(2015)Bereau, Andrienko, and Von~Lilienfeld]{bere+15jctc} Bereau,~T.; Andrienko,~D.; Von~Lilienfeld,~O.~A. Transferable {{Atomic Multipole Machine Learning Models}} for {{Small Organic Molecules}}. \emph{J. Chem. Theory Comput.} \textbf{2015}, \emph{11}, 3225--3233\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Liang \latin{et~al.}(2017)Liang, Tocci, Wilkins, Grisafi, Roke, and Ceriotti]{lian+17prb} Liang,~C.; Tocci,~G.; Wilkins,~D.~M.; Grisafi,~A.; Roke,~S.; Ceriotti,~M. Solvent Fluctuations and Nuclear Quantum Effects Modulate the Molecular Hyperpolarizability of Water. \emph{Phys. Rev. B} \textbf{2017}, \emph{96}, 041407\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Scherer \latin{et~al.}(2020)Scherer, Scheid, Andrienko, and Bereau]{sche+20jctc} Scherer,~C.; Scheid,~R.; Andrienko,~D.; Bereau,~T. Kernel-{{Based Machine Learning}} for {{Efficient Simulations}} of {{Molecular Liquids}}. \emph{J. Chem. Theory Comput.} \textbf{2020}, \emph{16}, 3194--3204\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Grisafi \latin{et~al.}(2019)Grisafi, Wilkins, Willatt, and Ceriotti]{gris+19book} Grisafi,~A.; Wilkins,~D.~M.; Willatt,~M.~J.; Ceriotti,~M. In \emph{Machine {{Learning}} in {{Chemistry}}}; {Pyzer-Knapp},~E.~O., Laino,~T., Eds.; {American Chemical Society}: {Washington, DC}, 2019; Vol. 1326; pp 1--21\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Stone(1975)]{stone1975} Stone,~A.~J. {Transformation between cartesian and spherical tensors}. \emph{Mol. Phys.} \textbf{1975}, \emph{29}, 1461--1471\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Grisafi \latin{et~al.}(2018)Grisafi, Wilkins, Cs{\'a}nyi, and Ceriotti]{gris+18prl} Grisafi,~A.; Wilkins,~D.~M.; Cs{\'a}nyi,~G.; Ceriotti,~M. Symmetry-{{Adapted Machine Learning}} for {{Tensorial Properties}} of {{Atomistic Systems}}. \emph{Phys. Rev. Lett.} \textbf{2018}, \emph{120}, 036002\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Raimbault \latin{et~al.}(2019)Raimbault, Grisafi, Ceriotti, and Rossi]{raim+19njp} Raimbault,~N.; Grisafi,~A.; Ceriotti,~M.; Rossi,~M. Using {{Gaussian}} Process Regression to Simulate the Vibrational {{Raman}} Spectra of Molecular Crystals. \emph{New J. Phys.} \textbf{2019}, \emph{21}, 105001\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Glielmo \latin{et~al.}(2017)Glielmo, Sollich, and De~Vita]{glie+17prb} Glielmo,~A.; Sollich,~P.; De~Vita,~A. Accurate Interatomic Force Fields via Machine Learning with Covariant Kernels. \emph{Phys. Rev. B} \textbf{2017}, \emph{95}, 214302\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Thomas \latin{et~al.}(2018)Thomas, Smidt, Kearnes, Yang, Li, Kohlhoff, and Riley]{thomas2018arxiv} Thomas,~N.; Smidt,~T.; Kearnes,~S.; Yang,~L.; Li,~L.; Kohlhoff,~K.; Riley,~P. Tensor field networks: Rotation-and translation-equivariant neural networks for 3d point clouds. \emph{arXiv preprint arXiv:1802.08219} \textbf{2018}, \relax \mciteBstWouldAddEndPunctfalse \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Grisafi \latin{et~al.}(2021)Grisafi, Nigam, and Ceriotti]{gris+21cs} Grisafi,~A.; Nigam,~J.; Ceriotti,~M. Multi-Scale Approach for the Prediction of Atomic Scale Properties. \emph{Chem. Sci.} \textbf{2021}, \emph{12}, 2078--2090\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Yu and Bowman(2019)Yu, and Bowman]{yu-bowm19jpca} Yu,~Q.; Bowman,~J.~M. Classical, {{Thermostated Ring Polymer}}, and {{Quantum VSCF}}/{{VCI Calculations}} of {{IR Spectra}} of {{H}} {\textsubscript{7}} {{O}} {\textsubscript{3}} {\textsuperscript{+}} and {{H}} {\textsubscript{9}} {{O}} {\textsubscript{4}} {\textsuperscript{+}} ({{Eigen}}) and {{Comparison}} with {{Experiment}}. \emph{J. Phys. Chem. A} \textbf{2019}, \emph{123}, 1399--1409\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Gastegger \latin{et~al.}(2017)Gastegger, Behler, and Marquetand]{gast+17cs} Gastegger,~M.; Behler,~J.; Marquetand,~P. Machine Learning Molecular Dynamics for the Simulation of Infrared Spectra. \emph{Chem. Sci.} \textbf{2017}, \emph{8}, 6924--6935\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Veit \latin{et~al.}(2020)Veit, Wilkins, Yang, DiStasio, and Ceriotti]{veit+20jcp} Veit,~M.; Wilkins,~D.~M.; Yang,~Y.; DiStasio,~R.~A.; Ceriotti,~M. Predicting Molecular Dipole Moments by Combining Atomic Partial Charges and Atomic Dipoles. \emph{J. Chem. Phys.} \textbf{2020}, \emph{153}, 024113\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Christensen \latin{et~al.}(2019)Christensen, Faber, and {von Lilienfeld}]{chri+19jcp} Christensen,~A.~S.; Faber,~F.~A.; {von Lilienfeld},~O.~A. Operators in Quantum Machine Learning: {{Response}} Properties in Chemical Space. \emph{J. Chem. Phys.} \textbf{2019}, \emph{150}, 064105\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Zhang \latin{et~al.}(2020)Zhang, Ye, Zhang, Hu, Jiang, and Jiang]{zhan+20jpcb} Zhang,~Y.; Ye,~S.; Zhang,~J.; Hu,~C.; Jiang,~J.; Jiang,~B. Efficient and {{Accurate Simulations}} of {{Vibrational}} and {{Electronic Spectra}} with {{Symmetry}}-{{Preserving Neural Network Models}} for {{Tensorial Properties}}. \emph{J. Phys. Chem. B} \textbf{2020}, \emph{124}, 7284--7290\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Batra \latin{et~al.}(2019)Batra, Tran, Kim, Chapman, Chen, Chandrasekaran, and Ramprasad]{kim+19jpcc} Batra,~R.; Tran,~H.~D.; Kim,~C.; Chapman,~J.; Chen,~L.; Chandrasekaran,~A.; Ramprasad,~R. General {{Atomic Neighborhood Fingerprint}} for {{Machine Learning}}-{{Based Methods}}. \emph{J. Phys. Chem. C} \textbf{2019}, \emph{123}, 15859--15866\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Zhang \latin{et~al.}(2020)Zhang, Chen, Wu, Wang, E, and Car]{zhan+20prb} Zhang,~L.; Chen,~M.; Wu,~X.; Wang,~H.; E,~W.; Car,~R. Deep Neural Network for the Dielectric Response of Insulators. \emph{Phys. Rev. B} \textbf{2020}, \emph{102}, 041121\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Burns \latin{et~al.}(2017)Burns, Faver, Zheng, Marshall, Smith, Vanommeslaeghe, MacKerell, Merz, and Sherrill]{burn+17jcp} Burns,~L.~A.; Faver,~J.~C.; Zheng,~Z.; Marshall,~M.~S.; Smith,~D. G.~A.; Vanommeslaeghe,~K.; MacKerell,~A.~D.; Merz,~K.~M.; Sherrill,~C.~D. The {{BioFragment Database}} ({{BFDb}}): {{An}} Open-Data Platform for Computational Chemistry Analysis of Noncovalent Interactions. \emph{The Journal of Chemical Physics} \textbf{2017}, \emph{147}, 161727\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Musil \latin{et~al.}(2019)Musil, Willatt, Langovoy, and Ceriotti]{musi+19jctc} Musil,~F.; Willatt,~M.~J.; Langovoy,~M.~A.; Ceriotti,~M. Fast and {{Accurate Uncertainty Estimation}} in {{Chemical Machine Learning}}. \emph{J. Chem. Theory Comput.} \textbf{2019}, \emph{15}, 906--915\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Yue \latin{et~al.}(2021)Yue, Muniz, Calegari~Andrade, Zhang, Car, and Panagiotopoulos]{yue+21jcp} Yue,~S.; Muniz,~M.~C.; Calegari~Andrade,~M.~F.; Zhang,~L.; Car,~R.; Panagiotopoulos,~A.~Z. When Do Short-Range Atomistic Machine-Learning Models Fall Short? \emph{J. Chem. Phys.} \textbf{2021}, \emph{154}, 034111\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Ambrosetti \latin{et~al.}(2016)Ambrosetti, Ferri, DiStasio, and Tkatchenko]{ambr+16science} Ambrosetti,~A.; Ferri,~N.; DiStasio,~R.~A.; Tkatchenko,~A. Wavelike Charge Density Fluctuations and van Der {{Waals}} Interactions at the Nanoscale. \emph{Science} \textbf{2016}, \emph{351}, 1171--1176\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Medders \latin{et~al.}(2014)Medders, Babin, and Paesani]{medd+14jctc} Medders,~G.~R.; Babin,~V.; Paesani,~F. Development of a "First-Principles" Water Potential with Flexible Monomers. {{III}}. {{Liquid}} Phase Properties. \emph{J. Chem. Theory Comput.} \textbf{2014}, \emph{10}, 2906--2910\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Medders \latin{et~al.}(2015)Medders, G{\"o}tz, Morales, Bajaj, and Paesani]{medd+15jcp} Medders,~G.~R.; G{\"o}tz,~A.~W.; Morales,~M.~A.; Bajaj,~P.; Paesani,~F. On the Representation of Many-Body Interactions in Water. \emph{J. Chem. Phys.} \textbf{2015}, \emph{143}, 104102\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Artrith \latin{et~al.}(2011)Artrith, Morawietz, and Behler]{artr+11prb} Artrith,~N.; Morawietz,~T.; Behler,~J. High-Dimensional Neural-Network Potentials for Multicomponent Systems: {{Applications}} to Zinc Oxide. \emph{Phys. Rev. B} \textbf{2011}, \emph{83}, 153101\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Ghasemi \latin{et~al.}(2015)Ghasemi, Hofstetter, Saha, and Goedecker]{ghas+15prb} Ghasemi,~S.~A.; Hofstetter,~A.; Saha,~S.; Goedecker,~S. Interatomic Potentials for Ionic Systems with Density Functional Accuracy Based on Charge Densities Obtained by a Neural Network. \emph{Phys. Rev. B} \textbf{2015}, \emph{92}, 045131\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Bereau \latin{et~al.}(2018)Bereau, DiStasio, Tkatchenko, and {von Lilienfeld}]{bere+18jcp} Bereau,~T.; DiStasio,~R.~A.; Tkatchenko,~A.; {von Lilienfeld},~O.~A. Non-Covalent Interactions across Organic and Biological Subsets of Chemical Space: {{Physics}}-Based Potentials Parametrized from Machine Learning. \emph{The Journal of Chemical Physics} \textbf{2018}, \emph{148}, 241706\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Veit \latin{et~al.}(2019)Veit, Jain, Bonakala, Rudra, Hohl, and Cs{\'a}nyi]{veit+19jctc} Veit,~M.; Jain,~S.~K.; Bonakala,~S.; Rudra,~I.; Hohl,~D.; Cs{\'a}nyi,~G. Equation of {{State}} of {{Fluid Methane}} from {{First Principles}} with {{Machine Learning Potentials}}. \emph{J. Chem. Theory Comput.} \textbf{2019}, \emph{15}, 2574--2586\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Metcalf \latin{et~al.}(2020)Metcalf, Koutsoukas, Spronk, Claus, Loughney, Johnson, Cheney, and Sherrill]{metc+20jcp} Metcalf,~D.~P.; Koutsoukas,~A.; Spronk,~S.~A.; Claus,~B.~L.; Loughney,~D.~A.; Johnson,~S.~R.; Cheney,~D.~L.; Sherrill,~C.~D. Approaches for Machine Learning Intermolecular Interaction Energies and Application to Energy Components from Symmetry Adapted Perturbation Theory. \emph{J. Chem. Phys.} \textbf{2020}, \emph{152}, 074103\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Eickenberg \latin{et~al.}(2017)Eickenberg, Exarchakis, Hirn, and Mallat]{eick+17nips} Eickenberg,~M.; Exarchakis,~G.; Hirn,~M.; Mallat,~S. Solid Harmonic Wavelet Scattering: {{Predicting}} Quantum Molecular Energy from Invariant Descriptors of {{3D}} Electronic Densities. \emph{Adv. Neural Inf. Process. Syst.} \textbf{2017}, \emph{2017-Decem}, 6541--6550\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Bart{\'o}k and Cs{\'a}nyi(2015)Bart{\'o}k, and Cs{\'a}nyi]{bart-csan15ijqc} Bart{\'o}k,~A.~P.; Cs{\'a}nyi,~G. Gaussian Approximation Potentials: {{A}} Brief Tutorial Introduction. \emph{Int. J. Quantum Chem.} \textbf{2015}, \emph{115}, 1051--1057\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Gilmer \latin{et~al.}(2017)Gilmer, Schoenholz, Riley, Vinyals, and Dahl]{gilm+17mlr} Gilmer,~J.; Schoenholz,~S.~S.; Riley,~P.~F.; Vinyals,~O.; Dahl,~G.~E. Neural Message Passing for Quantum Chemistry. International Convention Centre, Sydney, Australia, 2017; pp 1263--1272\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Chmiela \latin{et~al.}(2017)Chmiela, Tkatchenko, Sauceda, Poltavsky, Sch{\"{u}}tt, and M{\"{u}}ller]{Chmiela2017} Chmiela,~S.; Tkatchenko,~A.; Sauceda,~H.~E.; Poltavsky,~I.; Sch{\"{u}}tt,~K.~T.; M{\"{u}}ller,~K.~R. {Machine learning of accurate energy-conserving molecular force fields}. \emph{Science Advances} \textbf{2017}, \emph{3}, e1603015\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Bowman \latin{et~al.}(2009)Bowman, Beauchamp, Boxer, and Pande]{bowm+09jcp} Bowman,~G.~R.; Beauchamp,~K.~A.; Boxer,~G.; Pande,~V.~S. Progress and Challenges in the Automated Construction of {{Markov}} State Models for Full Protein Systems. \emph{J. Chem. Phys.} \textbf{2009}, \emph{131}, 124101\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Richard and Herbert(2012)Richard, and Herbert]{rich-herb12jcp} Richard,~R.~M.; Herbert,~J.~M. A Generalized Many-Body Expansion and a Unified View of Fragment-Based Methods in Electronic Structure Theory. \emph{The Journal of Chemical Physics} \textbf{2012}, \emph{137}, 064113\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Jinnouchi \latin{et~al.}(2020)Jinnouchi, Karsai, Verdi, Asahi, and Kresse]{jinn+20jcp} Jinnouchi,~R.; Karsai,~F.; Verdi,~C.; Asahi,~R.; Kresse,~G. Descriptors Representing Two- and Three-Body Atomic Distributions and Their Effects on the Accuracy of Machine-Learned Inter-Atomic Potentials. \emph{J. Chem. Phys.} \textbf{2020}, \emph{152}, 234102\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Bader(1994)]{bade94book} Bader,~R. F.~W. \emph{Atoms in Molecules: A Quantum Theory}; The {{International}} Series of Monographs on Chemistry 22; {Clarendon Press ; Oxford University Press}: {Oxford [England] : New York}, 1994\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Deringer \latin{et~al.}(2018)Deringer, Pickard, and Cs{\'a}nyi]{deri+18prl} Deringer,~V.~L.; Pickard,~C.~J.; Cs{\'a}nyi,~G. Data-{{Driven Learning}} of {{Total}} and {{Local Energies}} in {{Elemental Boron}}. \emph{Phys. Rev. Lett.} \textbf{2018}, \emph{120}, 156001\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Caro(2019)]{caro19prb} Caro,~M.~A. Optimizing Many-Body Atomic Descriptors for Enhanced Computational Performance of Machine Learning Based Interatomic Potentials. \emph{Phys. Rev. B} \textbf{2019}, \emph{100}, 024112\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Natarajan and Caro(2020)Natarajan, and Caro]{kondati2020arxiv} Natarajan,~S.~K.; Caro,~M.~A. Particle Swarm Based Hyper-Parameter Optimization for Machine Learned Interatomic Potentials. \emph{arxiv:2101.00049} \textbf{2020}, \relax \mciteBstWouldAddEndPunctfalse \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Mills \latin{et~al.}(2019)Mills, Ryczko, Luchak, Domurad, Beeler, and Tamblyn]{Mills2019} Mills,~K.; Ryczko,~K.; Luchak,~I.; Domurad,~A.; Beeler,~C.; Tamblyn,~I. {Extensive deep neural networks for transferring small scale learning to large scale systems}. \emph{Chemical Science} \textbf{2019}, \emph{10}, 4129--4140\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Kondor(2018)]{Kondor2018} Kondor,~R. {N-body Networks: a Covariant Hierarchical Neural Network Architecture for Learning Atomic Potentials}. \textbf{2018}, \relax \mciteBstWouldAddEndPunctfalse \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Glielmo \latin{et~al.}(2018)Glielmo, Zeni, and De~Vita]{glie+18prb} Glielmo,~A.; Zeni,~C.; De~Vita,~A. Efficient Nonparametric n -Body Force Fields from Machine Learning. \emph{Phys. Rev. B} \textbf{2018}, \emph{97}, 184307\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Botu and Ramprasad(2015)Botu, and Ramprasad]{Botu2015} Botu,~V.; Ramprasad,~R. {Learning scheme to predict atomic forces and accelerate materials simulations}. \emph{Physical Review B - Condensed Matter and Materials Physics} \textbf{2015}, \emph{92}, 094306\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Saunders \latin{et~al.}(1998)Saunders, Gammerman, and Vovk]{Saunders1998} Saunders,~C.; Gammerman,~A.; Vovk,~V. {Ridge Regression Learning Algorithm in Dual Variables}. \emph{Proceedings of the 15th International Conference on Machine Learning} \textbf{1998}, 515--521\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Rasmussen and Williams(2005)Rasmussen, and Williams]{rasm05book} Rasmussen,~C.~E.; Williams,~C. K.~I. \emph{Gaussian {{Processes}} for {{Machine Learning}} ({{Adaptive Computation}} and {{Machine Learning}})}; {The MIT Press}, 2005\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Macdonald(2015)]{macd15book} Macdonald,~I.~G. \emph{Symmetric Functions and {{Hall}} Polynomials}, reprinted in paperback ed.; Oxford Classic Texts in the Physical Sciences; {Clarendon Press}: {Oxford}, 2015\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[{von Lilienfeld} \latin{et~al.}(2015){von Lilienfeld}, Ramakrishnan, Rupp, and Knoll]{vonl+15ijqc} {von Lilienfeld},~O.~A.; Ramakrishnan,~R.; Rupp,~M.; Knoll,~A. Fourier Series of Atomic Radial Distribution Functions: {{A}} Molecular Fingerprint for Machine Learning Models of Quantum Chemical Properties. \emph{Int. J. Quantum Chem.} \textbf{2015}, \emph{115}, 1084--1093\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Onat \latin{et~al.}(2020)Onat, Ortner, and Kermode]{onat+20jcp} Onat,~B.; Ortner,~C.; Kermode,~J.~R. Sensitivity and Dimensionality of Atomic Environment Representations Used for Machine Learning Interatomic Potentials. \emph{J. Chem. Phys.} \textbf{2020}, \emph{153}, 144106\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Parsaeifard \latin{et~al.}(2020)Parsaeifard, De, Christensen, Faber, Kocer, De, Behler, {von Lilienfeld}, and Goedecker]{pars+20mlst} Parsaeifard,~B.; De,~D.~S.; Christensen,~A.~S.; Faber,~F.~A.; Kocer,~E.; De,~S.; Behler,~J.; {von Lilienfeld},~A.; Goedecker,~S. An Assessment of the Structural Resolution of Various Fingerprints Commonly Used in Machine Learning. \emph{Mach. Learn.: Sci. Technol.} \textbf{2020}, \relax \mciteBstWouldAddEndPunctfalse \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Note3()]{Note3} While the opposite is generally not true, the usual example of the pair of degenerate tetrahedra, as well as any pair of degenerate structures that can be inscribed in a sphere, correspond to a pair of environment placed at the center of such a sphere that is degenerate for $\nu =2$ correlations.\relax \mciteBstWouldAddEndPunctfalse \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Yellott and Iverson(1992)Yellott, and Iverson]{Yellott1992-gh} Yellott,~J.~I.; Iverson,~G.~J. Uniqueness properties of higher-order autocorrelation functions. \emph{J. Opt. Soc. Am. A, JOSAA} \textbf{1992}, \emph{9}, 388--404\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Kakarala(2012)]{Kakarala:2012dt} Kakarala,~R. {The Bispectrum as a Source of Phase-Sensitive Invariants for Fourier Descriptors: A Group-Theoretic Approach}. \emph{J. Math. Imaging Vis.} \textbf{2012}, \emph{44}, 341--353\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Kakarala(2012)]{kaka12jmiv} Kakarala,~R. The {{Bispectrum}} as a {{Source}} of {{Phase}}-{{Sensitive Invariants}} for {{Fourier Descriptors}}: {{A Group}}-{{Theoretic Approach}}. \emph{J Math Imaging Vis} \textbf{2012}, \emph{44}, 341--353\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Uhrin(2021)]{Uhrin2021} Uhrin,~M. Through the eyes of a descriptor: Constructing complete, invertible, descriptions of atomic environments. \emph{ArXiV e-prints} \textbf{2021}, \emph{2104.09319}\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Seko \latin{et~al.}(2019)Seko, Togo, and Tanaka]{seko+19prb} Seko,~A.; Togo,~A.; Tanaka,~I. Group-Theoretical High-Order Rotational Invariants for Structural Representations: {{Application}} to Linearized Machine Learning Interatomic Potential. \emph{Phys. Rev. B} \textbf{2019}, \emph{99}, 214108\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Shibuta \latin{et~al.}(2016)Shibuta, Sakane, Takaki, and Ohno]{shib+16am} Shibuta,~Y.; Sakane,~S.; Takaki,~T.; Ohno,~M. Submicrometer-Scale Molecular Dynamics Simulation of Nucleation and Solidification from Undercooled Melt: {{Linkage}} between Empirical Interpretation and Atomistic Nature. \emph{Acta Materialia} \textbf{2016}, \emph{105}, 328--337\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[MacQueen(1967)]{macq67proc} MacQueen,~J. Some Methods for Classification and Analysis of Multivariate Observations. Proceedings of the {{Fifth Berkeley Symposium}} on {{Mathematical Statistics}} and {{Probability}}, {{Volume}} 1: {{Statistics}}. {Berkeley, Calif.}, 1967; pp 281--297\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Ester \latin{et~al.}(1996)Ester, Kriegel, Sander, and Xu]{este+96proc} Ester,~M.; Kriegel,~H.-P.; Sander,~J.; Xu,~X. A Density-Based Algorithm for Discovering Clusters in Large Spatial Databases with Noise. {{KDD}} 1996. 1996\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Caflisch(2006)]{cafl06cosb} Caflisch,~A. Network and Graph Analyses of Folding Free Energy Surfaces. \emph{Curr. Opin. Struct. Biol.} \textbf{2006}, \emph{16}, 71--78\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Ruppert \latin{et~al.}(2008)Ruppert, Welch, and Jain]{rupp+08ps} Ruppert,~J.; Welch,~W.; Jain,~A.~N. Automatic Identification and Representation of Protein Binding Sites for Molecular Docking. \emph{Protein Sci.} \textbf{2008}, \emph{6}, 524--533\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Gasparotto and Ceriotti(2014)Gasparotto, and Ceriotti]{gasp-ceri14jcp} Gasparotto,~P.; Ceriotti,~M. Recognizing Molecular Patterns by Machine Learning: {{An}} Agnostic Structural Definition of the Hydrogen Bond. \emph{J. Chem. Phys.} \textbf{2014}, \emph{141}, 174110\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Rodriguez and Laio(2014)Rodriguez, and Laio]{rodr-laio14science} Rodriguez,~A.; Laio,~A. Clustering by Fast Search and Find of Density Peaks. \emph{Science} \textbf{2014}, \emph{344}, 1492--1496\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Murtagh and Contreras(2017)Murtagh, and Contreras]{murt-cont17wir} Murtagh,~F.; Contreras,~P. Algorithms for Hierarchical Clustering: An Overview, {{II}}. \emph{Wiley Interdiscip. Rev. Data Min. Knowl. Discov.} \textbf{2017}, \emph{7}, e1219\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Gasparotto \latin{et~al.}(2018)Gasparotto, Mei{\ss}ner, and Ceriotti]{gasp+18jctc} Gasparotto,~P.; Mei{\ss}ner,~R.~H.; Ceriotti,~M. Recognizing {{Local}} and {{Global Structural Motifs}} at the {{Atomic Scale}}. \emph{J. Chem. Theory Comput.} \textbf{2018}, \emph{14}, 486--498\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Pietrucci and Marto{\v n}{\'a}k(2015)Pietrucci, and Marto{\v n}{\'a}k]{piet-mart15jcp} Pietrucci,~F.; Marto{\v n}{\'a}k,~R. Systematic Comparison of Crystalline and Amorphous Phases: {{Charting}} the Landscape of Water Structures and Transformations. \emph{J. Chem. Phys.} \textbf{2015}, \emph{142}, 104704\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Piaggi and Parrinello(2018)Piaggi, and Parrinello]{piag-parr18pnas} Piaggi,~P.~M.; Parrinello,~M. Predicting Polymorphism in Molecular Crystals Using Orientational Entropy. \emph{Proc. Natl. Acad. Sci.} \textbf{2018}, \emph{115}, 10251--10256\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Kahle \latin{et~al.}(2018)Kahle, Marcolongo, and Marzari]{kahl+18prm} Kahle,~L.; Marcolongo,~A.; Marzari,~N. Modeling Lithium-Ion Solid-State Electrolytes with a Pinball Model. \emph{Phys. Rev. Mater.} \textbf{2018}, \emph{2}, 065405\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Cheng \latin{et~al.}(2020)Cheng, Griffiths, Wengert, Kunkel, Stenczel, Zhu, Deringer, Bernstein, Margraf, Reuter, and Csanyi]{chen+20arc} Cheng,~B.; Griffiths,~R.-R.; Wengert,~S.; Kunkel,~C.; Stenczel,~T.; Zhu,~B.; Deringer,~V.~L.; Bernstein,~N.; Margraf,~J.~T.; Reuter,~K.; Csanyi,~G. Mapping {{Materials}} and {{Molecules}}. \emph{Acc. Chem. Res.} \textbf{2020}, \emph{53}, 1981--1991\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Coifman \latin{et~al.}(2005)Coifman, Lafon, Lee, Maggioni, Nadler, Warner, and Zucker]{coif+05pnas} Coifman,~R.~R.; Lafon,~S.; Lee,~A.~B.; Maggioni,~M.; Nadler,~B.; Warner,~F.; Zucker,~S.~W. Geometric Diffusions as a Tool for Harmonic Analysis and Structure Definition of Data: {{Diffusion}} Maps. \emph{Proc. Natl. Acad. Sci. U. S. A.} \textbf{2005}, \emph{102}, 7426--7431\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Ferguson \latin{et~al.}(2010)Ferguson, Panagiotopoulos, Debenedetti, and Kevrekidis]{ferg+10pnas} Ferguson,~A.~L.; Panagiotopoulos,~A.~Z.; Debenedetti,~P.~G.; Kevrekidis,~I.~G. Systematic Determination of Order Parameters for Chain Dynamics Using Diffusion Maps. \emph{Proc. Natl. Acad. Sci. U. S. A.} \textbf{2010}, \emph{107}, 13597--602\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Rohrdanz \latin{et~al.}(2011)Rohrdanz, Zheng, Maggioni, and Clementi]{rohr+11jcp} Rohrdanz,~M.~A.; Zheng,~W.; Maggioni,~M.; Clementi,~C. Determination of Reaction Coordinates via Locally Scaled Diffusion Map. \emph{J. Chem. Phys.} \textbf{2011}, \emph{134}, 124116\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Ramprasad \latin{et~al.}(2017)Ramprasad, Batra, Pilania, {Mannodi-Kanakkithodi}, and Kim]{ramp+17npjcm} Ramprasad,~R.; Batra,~R.; Pilania,~G.; {Mannodi-Kanakkithodi},~A.; Kim,~C. Machine Learning in Materials Informatics: Recent Applications and Prospects. \emph{Npj Comput. Mater.} \textbf{2017}, \emph{3}, 54\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Lemke and Peter(2019)Lemke, and Peter]{lemk-pete19jctc} Lemke,~T.; Peter,~C. {{EncoderMap}}: {{Dimensionality Reduction}} and {{Generation}} of {{Molecule Conformations}}. \emph{J. Chem. Theory Comput.} \textbf{2019}, \emph{15}, 1209--1215\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Wales(2003)]{wale03book} Wales,~D. \emph{Energy Landscapes: {{Applications}} to Clusters, Biomolecules and Glasses}; {Cambridge University Press}, 2003\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Karpen \latin{et~al.}(1993)Karpen, Tobias, and Brooks]{karp+93bc} Karpen,~M.~E.; Tobias,~D.~J.; Brooks,~C.~L. Statistical Clustering Techniques for the Analysis of Long Molecular Dynamics Trajectories: Analysis of 2.2-Ns Trajectories of {{YPGDV}}. \emph{Biochemistry} \textbf{1993}, \emph{32}, 412--420\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Torda and {van Gunsteren}(1994)Torda, and {van Gunsteren}]{tord-vang94jcc} Torda,~A.~E.; {van Gunsteren},~W.~F. Algorithms for Clustering Molecular Dynamics Configurations. \emph{J. Comput. Chem.} \textbf{1994}, \emph{15}, 1331--1340\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Helfrecht \latin{et~al.}(2019)Helfrecht, Semino, Pireddu, Auerbach, and Ceriotti]{helf+19jcp} Helfrecht,~B.~A.; Semino,~R.; Pireddu,~G.; Auerbach,~S.~M.; Ceriotti,~M. A New Kind of Atlas of Zeolite Building Blocks. \emph{J. Chem. Phys.} \textbf{2019}, \emph{151}, 154112\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Ramachandran \latin{et~al.}(1963)Ramachandran, Ramakrishnan, and Sasisekharan]{rama+63jmb} Ramachandran,~G.; Ramakrishnan,~C.; Sasisekharan,~V. Stereochemistry of Polypeptide Chain Configurations. \emph{Journal of Molecular Biology} \textbf{1963}, \emph{7}, 95--99\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Frishman and Argos(1996)Frishman, and Argos]{fris-argo96peds} Frishman,~D.; Argos,~P. Incorporation of Non-Local Interactions in Protein Secondary Structure Prediction from the Amino Acid Sequence. \emph{Protein Eng Des Sel} \textbf{1996}, \emph{9}, 133--142\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Kabsch and Sander(1983)Kabsch, and Sander]{kabs-sand83bp} Kabsch,~W.; Sander,~C. Dictionary of Protein Secondary Structure: {{Pattern}} Recognition of Hydrogen-Bonded and Geometrical Features. \emph{Biopolymers} \textbf{1983}, \emph{22}, 2577--2637\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Pietrucci and Laio(2009)Pietrucci, and Laio]{piet-laio09jctc} Pietrucci,~F.; Laio,~A. A {{Collective Variable}} for the {{Efficient Exploration}} of {{Protein Beta}}-{{Sheet Structures}}: {{Application}} to {{SH3}} and {{GB1}}. \emph{J. Chem. Theory Comput.} \textbf{2009}, \emph{5}, 2197--2201\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Pietropaolo \latin{et~al.}(2011)Pietropaolo, Branduardi, Bonomi, and Parrinello]{piet+11jcc} Pietropaolo,~A.; Branduardi,~D.; Bonomi,~M.; Parrinello,~M. A Chirality-Based Metrics for Free-Energy Calculations in Biomolecular Systems. \emph{J. Comput. Chem.} \textbf{2011}, \emph{32}, 2627--2637\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Steinhardt \latin{et~al.}(1983)Steinhardt, Nelson, and Ronchetti]{stei+83prb} Steinhardt,~P.~J.; Nelson,~D.~R.; Ronchetti,~M. Bond-Orientational Order in Liquids and Glasses. \emph{Phys. Rev. B} \textbf{1983}, \emph{28}, 784--805\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[{Angioletti-Uberti} \latin{et~al.}(2010){Angioletti-Uberti}, Ceriotti, Lee, and Finnis]{angi+10prb} {Angioletti-Uberti},~S.; Ceriotti,~M.; Lee,~P.~D.; Finnis,~M.~W. Solid-Liquid Interface Free Energy through Metadynamics Simulations. \emph{Phys. Rev. B - Condens. Matter Mater. Phys.} \textbf{2010}, \emph{81}, 125416\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Carignano \latin{et~al.}(2016)Carignano, Saeed, Aravindh, Roqan, Even, and Katan]{cari+16pccp} Carignano,~M.~A.; Saeed,~Y.; Aravindh,~S.~A.; Roqan,~I.~S.; Even,~J.; Katan,~C. A Close Examination of the Structure and Dynamics of {{HC}}({{NH}} {\textsubscript{2}} ) {\textsubscript{2}} {{PbI}} {\textsubscript{3}} by {{MD}} Simulations and Group Theory. \emph{Phys. Chem. Chem. Phys.} \textbf{2016}, \emph{18}, 27109--27118\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Oganov and Valle(2009)Oganov, and Valle]{vall-ogan09jcp} Oganov,~A.~R.; Valle,~M. How to Quantify Energy Landscapes of Solids. \emph{The Journal of Chemical Physics} \textbf{2009}, \emph{130}, 104504\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Valle and Oganov(2010)Valle, and Oganov]{vall-ogan10ac} Valle,~M.; Oganov,~A.~R. Crystal Fingerprint Space \textendash{} a Novel Paradigm for Studying Crystal-Structure Sets. \emph{Acta Crystallogr A Found Crystallogr} \textbf{2010}, \emph{66}, 507--517\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Piaggi and Parrinello(2017)Piaggi, and Parrinello]{piag-parr17jcp} Piaggi,~P.~M.; Parrinello,~M. Entropy Based Fingerprint for Local Crystalline Order. \emph{The Journal of Chemical Physics} \textbf{2017}, \emph{147}, 114112\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Martelli \latin{et~al.}(2018)Martelli, Ko, O{\u g}uz, and Car]{mart+18prb} Martelli,~F.; Ko,~H.-Y.; O{\u g}uz,~E.~C.; Car,~R. Local-Order Metric for Condensed-Phase Environments. \emph{Phys. Rev. B} \textbf{2018}, \emph{97}, 064105\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Mickel \latin{et~al.}(2013)Mickel, Kapfer, {Schr{\"o}der-Turk}, and Mecke]{mick+13jcp} Mickel,~W.; Kapfer,~S.~C.; {Schr{\"o}der-Turk},~G.~E.; Mecke,~K. Shortcomings of the Bond Orientational Order Parameters for the Analysis of Disordered Particulate Matter. \emph{The Journal of Chemical Physics} \textbf{2013}, \emph{138}, 044501\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[De \latin{et~al.}(2017)De, Musil, Ingram, Baldauf, and Ceriotti]{de+16jci} De,~S.; Musil,~F.; Ingram,~T.; Baldauf,~C.; Ceriotti,~M. Mapping and Classifying Molecules from a High-Throughput Structural Database. \emph{J. Cheminformatics} \textbf{2017}, \emph{9}, 1--14\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Ceriotti(2019)]{ceri19jcp} Ceriotti,~M. Unsupervised Machine Learning in Atomistic Simulations, between Predictions and Understanding. \emph{J. Chem. Phys.} \textbf{2019}, \emph{150}, 150901\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Sch{\"o}lkopf \latin{et~al.}(1998)Sch{\"o}lkopf, Smola, and M{\"u}ller]{scho+98nc} Sch{\"o}lkopf,~B.; Smola,~A.; M{\"u}ller,~K.-R. Nonlinear {{Component Analysis}} as a {{Kernel Eigenvalue Problem}}. \emph{Neural Comput.} \textbf{1998}, \emph{10}, 1299--1319\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Cuturi(2009)]{cutu10arxiv} Cuturi,~M. Positive {{Definite Kernels}} in {{Machine Learning}}. \emph{ArXiv Prepr. ArXiv09115367} \textbf{2009}, \relax \mciteBstWouldAddEndPunctfalse \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Oganov and Glass(2006)Oganov, and Glass]{ogan-glas06jcp} Oganov,~A.~R.; Glass,~C.~W. Crystal Structure Prediction Using Ab Initio Evolutionary Techniques: {{Principles}} and Applications. \emph{J. Chem. Phys.} \textbf{2006}, \emph{124}, 244704\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Amsler and Goedecker(2010)Amsler, and Goedecker]{amsl-goed10jcp} Amsler,~M.; Goedecker,~S. Crystal Structure Prediction Using the Minima Hopping Method. \emph{J. Chem. Phys.} \textbf{2010}, \emph{133}, 224104\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Pickard and Needs(2011)Pickard, and Needs]{pick-need11jpcm} Pickard,~C.~J.; Needs,~R.~J. Ab Initio Random Structure Searching. \emph{J. Phys. Condens. Matter} \textbf{2011}, \emph{23}, 053201\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Curtis \latin{et~al.}(2018)Curtis, Li, Rose, {V{\'a}zquez-Mayagoitia}, Bhattacharya, Ghiringhelli, and Marom]{curt+18jctc} Curtis,~F.; Li,~X.; Rose,~T.; {V{\'a}zquez-Mayagoitia},~{\'A}.; Bhattacharya,~S.; Ghiringhelli,~L.~M.; Marom,~N. {{GAtor}}: {{A First}}-{{Principles Genetic Algorithm}} for {{Molecular Crystal Structure Prediction}}. \emph{J. Chem. Theory Comput.} \textbf{2018}, \emph{14}, 2246--2264\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Oganov \latin{et~al.}(2019)Oganov, Pickard, Zhu, and Needs]{ogan+19nrm} Oganov,~A.~R.; Pickard,~C.~J.; Zhu,~Q.; Needs,~R.~J. Structure Prediction Drives Materials Discovery. \emph{Nat Rev Mater} \textbf{2019}, \emph{4}, 331--348\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Ferr{\'e} \latin{et~al.}(2015)Ferr{\'e}, Maillet, and Stoltz]{ferr+15jcp} Ferr{\'e},~G.; Maillet,~J.-B.; Stoltz,~G. Permutation-Invariant Distance between Atomic Configurations. \emph{The Journal of Chemical Physics} \textbf{2015}, \emph{143}, 104114\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Montavon \latin{et~al.}(2013)Montavon, Rupp, Gobre, {Vazquez-Mayagoitia}, Hansen, Tkatchenko, M{\"u}ller, and Anatole Von~Lilienfeld]{mont+13njp} Montavon,~G.; Rupp,~M.; Gobre,~V.; {Vazquez-Mayagoitia},~A.; Hansen,~K.; Tkatchenko,~A.; M{\"u}ller,~K.~R.; Anatole Von~Lilienfeld,~O. Machine Learning of Molecular Electronic Properties in Chemical Compound Space. \emph{New J. Phys.} \textbf{2013}, \emph{15}, 095003\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Yang \latin{et~al.}(2018)Yang, De, Campbell, Li, Ceriotti, and Day]{yang+18cm} Yang,~J.; De,~S.; Campbell,~J.~E.; Li,~S.; Ceriotti,~M.; Day,~G.~M. Large-{{Scale Computational Screening}} of {{Molecular Organic Semiconductors Using Crystal Structure Prediction}}. \emph{Chem. Mater.} \textbf{2018}, \emph{30}, 4361--4371\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Helfrecht \latin{et~al.}(2020)Helfrecht, Cersonsky, Fraux, and Ceriotti]{helf+20mlst} Helfrecht,~B.~A.; Cersonsky,~R.~K.; Fraux,~G.; Ceriotti,~M. Structure-Property Maps with {{Kernel}} Principal Covariates Regression. \emph{Mach. Learn.: Sci. Technol.} \textbf{2020}, \emph{1}, 045021\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Kuhn(1955)]{kuhn55nrlq} Kuhn,~H.~W. The {{Hungarian}} Method for the Assignment Problem. \emph{Nav. Res. Logist. Q.} \textbf{1955}, \emph{2}, 83--97\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Cuturi(2013)]{cutu13nips} Cuturi,~M. In \emph{Advances in {{Neural Information Processing Systems}} 26}; Burges,~C. J.~C., Bottou,~L., Welling,~M., Ghahramani,~Z., Weinberger,~K.~Q., Eds.; {Curran Associates, Inc.}, 2013; pp 2292--2300\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Helfrecht \latin{et~al.}(2019)Helfrecht, Gasparotto, Giberti, and Ceriotti]{helf+19fmb} Helfrecht,~B.~A.; Gasparotto,~P.; Giberti,~F.; Ceriotti,~M. Atomic Motif Recognition in (Bio)Polymers: {{Benchmarks}} from the Protein Data Bank. \emph{Front. Mol. Biosci.} \textbf{2019}, \emph{6}, 1--14\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[{de Jong} and Kiers(1992){de Jong}, and Kiers]{dejo-kier92cils} {de Jong},~S.; Kiers,~H.~A. Principal Covariates Regression. \emph{Chemometrics and Intelligent Laboratory Systems} \textbf{1992}, \emph{14}, 155--164\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[van~der Maaten and Hinton(2008)van~der Maaten, and Hinton]{maat-hint08jmlr} van~der Maaten,~L.; Hinton,~G. Visualizing Data Using T-{{SNE}}. \emph{J. Mach. Learn. Res.} \textbf{2008}, \emph{9}, 2579--2605\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Ramakrishnan \latin{et~al.}(2014)Ramakrishnan, Dral, Rupp, and Von~Lilienfeld]{rama+14sd} Ramakrishnan,~R.; Dral,~P.~O.; Rupp,~M.; Von~Lilienfeld,~O.~A. Quantum Chemistry Structures and Properties of 134 Kilo Molecules. \emph{Sci. Data} \textbf{2014}, \emph{1}, 1--7\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Ropo \latin{et~al.}(2016)Ropo, Schneider, Baldauf, and Blum]{ropo+16sd} Ropo,~M.; Schneider,~M.; Baldauf,~C.; Blum,~V. First-Principles Data Set of 45,892 Isolated and Cation-Coordinated Conformers of 20 Proteinogenic Amino Acids. \emph{Sci. Data} \textbf{2016}, \emph{3}, 160009\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Schober \latin{et~al.}(2016)Schober, Reuter, and Oberhofer]{scho+16jpcl} Schober,~C.; Reuter,~K.; Oberhofer,~H. Virtual {{Screening}} for {{High Carrier Mobility}} in {{Organic Semiconductors}}. \emph{J. Phys. Chem. Lett.} \textbf{2016}, \emph{7}, 3973--3977\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Stewart(2013)]{stew13jmm} Stewart,~J. J.~P. Optimization of Parameters for Semiempirical Methods {{VI}}: More Modifications to the {{NDDO}} Approximations and Re-Optimization of Parameters. \emph{J Mol Model} \textbf{2013}, \emph{19}, 1--32\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Andrade \latin{et~al.}(2010)Andrade, Pasqualoto, Ferreira, and Hopfinger]{andr+10m} Andrade,~C.~H.; Pasqualoto,~K. F.~M.; Ferreira,~E.~I.; Hopfinger,~A.~J. {{4D}}-{{QSAR}}: {{Perspectives}} in {{Drug Design}}. \emph{Molecules} \textbf{2010}, \emph{15}, 3281--3294\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Faber \latin{et~al.}(2017)Faber, Hutchison, Huang, Gilmer, Schoenholz, Dahl, Vinyals, Kearnes, Riley, and {von Lilienfeld}]{fabe+17jctc} Faber,~F.~A.; Hutchison,~L.; Huang,~B.; Gilmer,~J.; Schoenholz,~S.~S.; Dahl,~G.~E.; Vinyals,~O.; Kearnes,~S.; Riley,~P.~F.; {von Lilienfeld},~O.~A. Prediction {{Errors}} of {{Molecular Machine Learning Models Lower}} than {{Hybrid DFT Error}}. \emph{J. Chem. Theory Comput.} \textbf{2017}, \emph{13}, 5255--5264\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Zuo \latin{et~al.}(2020)Zuo, Chen, Li, Deng, Chen, Behler, Cs{\'a}nyi, Shapeev, Thompson, Wood, and Ong]{zuo+20jpcl} Zuo,~Y.; Chen,~C.; Li,~X.; Deng,~Z.; Chen,~Y.; Behler,~J.; Cs{\'a}nyi,~G.; Shapeev,~A.~V.; Thompson,~A.~P.; Wood,~M.~A.; Ong,~S.~P. Performance and {{Cost Assessment}} of {{Machine Learning Interatomic Potentials}}. \emph{J. Phys. Chem. A} \textbf{2020}, acs.jpca.9b08723\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Pozdnyakov \latin{et~al.}(2020)Pozdnyakov, Willatt, and Ceriotti]{matcloud20a} Pozdnyakov,~S.; Willatt,~M.; Ceriotti,~M. Dataset: {{Randomly}}-Displaced Methane Configurations. \url{https://archive.materialscloud.org/record/2020.110}, 2020; (accessed 2020-11-05)\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Zamani \latin{et~al.}(2020)Zamani, Imbalzano, Tappy, Alexander, {Mart{\'i}-S{\'a}nchez}, Ghisalberti, Ramasse, Friedl, T{\"u}t{\"u}nc{\"u}oglu, Francaviglia, Bienvenue, H{\'e}bert, Arbiol, Ceriotti, and Fontcuberta I~Morral]{matcloud20b} Zamani,~M.; Imbalzano,~G.; Tappy,~N.; Alexander,~D. T.~L.; {Mart{\'i}-S{\'a}nchez},~S.; Ghisalberti,~L.; Ramasse,~Q.~M.; Friedl,~M.; T{\"u}t{\"u}nc{\"u}oglu,~G.; Francaviglia,~L.; Bienvenue,~S.; H{\'e}bert,~C.; Arbiol,~J.; Ceriotti,~M.; Fontcuberta I~Morral,~A. Dataset: {{3D}} Ordering at the Liquid\textendash Solid Polar Interface of Nanowires. \url{https://archive.materialscloud.org/record/2020.141}, 2020; (accessed 2021-01-07)\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Goscinski \latin{et~al.}(2021)Goscinski, Fraux, Imbalzano, and Ceriotti]{gosc+21mlst} Goscinski,~A.; Fraux,~G.; Imbalzano,~G.; Ceriotti,~M. The Role of Feature Space in Atomistic Learning. \emph{Mach. Learn.: Sci. Technol.} \textbf{2021}, \emph{2}, 025028\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Glielmo \latin{et~al.}(2021)Glielmo, Zeni, Cheng, Csanyi, and Laio]{glielmo2021arxiv} Glielmo,~A.; Zeni,~C.; Cheng,~B.; Csanyi,~G.; Laio,~A. Ranking the information content of distance measures. \emph{arxiv:2104.15079} \textbf{2021}, \relax \mciteBstWouldAddEndPunctfalse \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Cersonsky \latin{et~al.}(2021)Cersonsky, Helfrecht, Engel, Kliavinek, and Ceriotti]{cers+21mlst} Cersonsky,~R.~K.; Helfrecht,~B.; Engel,~E.~A.; Kliavinek,~S.; Ceriotti,~M. Improving {{Sample}} and {{Feature Selection}} with {{Principal Covariates Regression}}. \emph{Mach. Learn.: Sci. Technol.} \textbf{2021}, \relax \mciteBstWouldAddEndPunctfalse \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Eldar \latin{et~al.}(1997)Eldar, Lindenbaum, Porat, and Zeevi]{elda+97ieee} Eldar,~Y.; Lindenbaum,~M.; Porat,~M.; Zeevi,~Y.~Y. The Farthest Point Strategy for Progressive Image Sampling. \emph{IEEE Trans. Image Process. Publ. IEEE Signal Process. Soc.} \textbf{1997}, \emph{6}, 1305--15\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Ceriotti \latin{et~al.}(2013)Ceriotti, Tribello, and Parrinello]{ceri+13jctc} Ceriotti,~M.; Tribello,~G.~A.; Parrinello,~M. Demonstrating the Transferability and the Descriptive Power of Sketch-Map. \emph{J. Chem. Theory Comput.} \textbf{2013}, \emph{9}, 1521--1532\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Mahoney and Drineas(2009)Mahoney, and Drineas]{maho-drin09pnas} Mahoney,~M.~W.; Drineas,~P. {{CUR}} Matrix Decompositions for Improved Data Analysis. \emph{Proc. Natl. Acad. Sci. U. S. A.} \textbf{2009}, \emph{106}, 697--702\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Imbalzano \latin{et~al.}(2018)Imbalzano, Anelli, Giofr{\'e}, Klees, Behler, and Ceriotti]{imba+18jcp} Imbalzano,~G.; Anelli,~A.; Giofr{\'e},~D.; Klees,~S.; Behler,~J.; Ceriotti,~M. Automatic Selection of Atomic Fingerprints and Reference Configurations for Machine-Learning Potentials. \emph{J. Chem. Phys.} \textbf{2018}, \emph{148}, 241730\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Morales \latin{et~al.}(2010)Morales, Pierleoni, Schwegler, and Ceperley]{mora+10pnas} Morales,~M.~A.; Pierleoni,~C.; Schwegler,~E.; Ceperley,~D.~M. Evidence for a First-Order Liquid-Liquid Transition in High-Pressure Hydrogen from Ab Initio Simulations. \emph{Proc. Natl. Acad. Sci. U. S. A.} \textbf{2010}, \emph{107}, 12799--12803\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Engel \latin{et~al.}(2019)Engel, Anelli, Hofstetter, Paruzzo, Emsley, and Ceriotti]{enge+19pccp} Engel,~E.~A.; Anelli,~A.; Hofstetter,~A.; Paruzzo,~F.; Emsley,~L.; Ceriotti,~M. A {{Bayesian}} Approach to {{NMR}} Crystal Structure Determination. \emph{Phys. Chem. Chem. Phys.} \textbf{2019}, \emph{21}, 23385--23400\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Ben~Mahmoud \latin{et~al.}(2020)Ben~Mahmoud, Anelli, Cs{\'a}nyi, and Ceriotti]{benm+20prb} Ben~Mahmoud,~C.; Anelli,~A.; Cs{\'a}nyi,~G.; Ceriotti,~M. Learning the Electronic Density of States in Condensed Matter. \emph{Phys. Rev. B} \textbf{2020}, \emph{102}, 235130\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Gao \latin{et~al.}(2019)Gao, Wang, and Sun]{gao+19jcp} Gao,~H.; Wang,~J.; Sun,~J. Improve the Performance of Machine-Learning Potentials by Optimizing Descriptors. \emph{J. Chem. Phys.} \textbf{2019}, \emph{150}, 244110\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Faber \latin{et~al.}(2016)Faber, Lindmaa, Von~Lilienfeld, and Armiento]{fabe+16prl} Faber,~F.~A.; Lindmaa,~A.; Von~Lilienfeld,~O.~A.; Armiento,~R. Machine {{Learning Energies}} of 2 {{Million Elpasolite}} ({{ABC2D6}}) {{Crystals}}. \emph{Phys. Rev. Lett.} \textbf{2016}, \emph{117}, 135502\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Artrith \latin{et~al.}(2017)Artrith, Urban, and Ceder]{artr+17prb} Artrith,~N.; Urban,~A.; Ceder,~G. Efficient and Accurate Machine-Learning Interpolation of Atomic Energies in Compositions with Many Species. \emph{Phys. Rev. B} \textbf{2017}, \emph{96}, 014112\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Gastegger \latin{et~al.}(2018)Gastegger, Schwiedrzik, Bittermann, Berzsenyi, and Marquetand]{gast+18jcp} Gastegger,~M.; Schwiedrzik,~L.; Bittermann,~M.; Berzsenyi,~F.; Marquetand,~P. {{wACSF}}\textemdash{{Weighted}} Atom-Centered Symmetry Functions as Descriptors in Machine Learning Potentials. \emph{J. Chem. Phys.} \textbf{2018}, \emph{148}, 241709\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Rostami \latin{et~al.}(2018)Rostami, Amsler, and Ghasemi]{rost+18jcp} Rostami,~S.; Amsler,~M.; Ghasemi,~S.~A. Optimized Symmetry Functions for Machine-Learning Interatomic Potentials of Multicomponent Systems. \emph{The Journal of Chemical Physics} \textbf{2018}, \emph{149}, 124106\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Note4()]{Note4} A knockout mice is a genetically-modified mouse in which one or more genes have been inactivated. The effect on the development of the animal can be used to understand the role played by the affected gene(s).\relax \mciteBstWouldAddEndPunctfalse \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Musil \latin{et~al.}(2021)Musil, Veit, Goscinski, Fraux, Willatt, Stricker, and Ceriotti]{musi+21jcp} Musil,~F.; Veit,~M.; Goscinski,~A.; Fraux,~G.; Willatt,~M.~J.; Stricker,~M.; Ceriotti,~M. Efficient Implementation of Atom-Density Representations. \emph{J. Chem. Phys.} \textbf{2021}, \emph{154}, 114109\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Kamath \latin{et~al.}(2018)Kamath, Vargas-Hern{\'{a}}ndez, Krems, Carrington, and Manzhos]{Kamath2018} Kamath,~A.; Vargas-Hern{\'{a}}ndez,~R.~A.; Krems,~R.~V.; Carrington,~T.; Manzhos,~S. {Neural networks vs Gaussian process regression for representing potential energy surfaces: A comparative study of fit quality and vibrational spectrum accuracy}. \emph{Journal of Chemical Physics} \textbf{2018}, \emph{148}, 241702\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Singraber \latin{et~al.}(2019)Singraber, Morawietz, Behler, and Dellago]{sing+19jctc} Singraber,~A.; Morawietz,~T.; Behler,~J.; Dellago,~C. Parallel {{Multistream Training}} of {{High}}-{{Dimensional Neural Network Potentials}}. \emph{J. Chem. Theory Comput.} \textbf{2019}, \emph{15}, 3075--3092\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Gao \latin{et~al.}(2020)Gao, Ramezanghorbani, Isayev, Smith, and Roitberg]{Gao2020} Gao,~X.; Ramezanghorbani,~F.; Isayev,~O.; Smith,~J.~S.; Roitberg,~A.~E. {TorchANI: A Free and Open Source PyTorch-Based Deep Learning Implementation of the ANI Neural Network Potentials}. \emph{Journal of chemical information and modeling} \textbf{2020}, \emph{60}, 3408--3415\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Lu \latin{et~al.}(2020)Lu, Wang, Chen, Liu, Lin, Car, E, Jia, and Zhang]{Lu2020} Lu,~D.; Wang,~H.; Chen,~M.; Liu,~J.; Lin,~L.; Car,~R.; E,~W.; Jia,~W.; Zhang,~L. {86 PFLOPS Deep Potential Molecular Dynamics simulation of 100 million atoms with ab initio accuracy}. \textbf{2020}, \relax \mciteBstWouldAddEndPunctfalse \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Pozdnyakov \latin{et~al.}(2019)Pozdnyakov, Oganov, Mazitov, Kruglov, and Mazhnik]{pozdnyakov2019arxiv} Pozdnyakov,~S.; Oganov,~A.~R.; Mazitov,~A.; Kruglov,~I.; Mazhnik,~E. Fast general two- and three-body interatomic potential. \emph{arxiv:1910.07513} \textbf{2019}, \relax \mciteBstWouldAddEndPunctfalse \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Novikov \latin{et~al.}(2021)Novikov, Gubaev, Podryabinkin, and Shapeev]{novi+21mlst} Novikov,~I.~S.; Gubaev,~K.; Podryabinkin,~E.~V.; Shapeev,~A.~V. The {{MLIP}} Package: Moment Tensor Potentials with {{MPI}} and Active Learning. \emph{Mach. Learn.: Sci. Technol.} \textbf{2021}, \emph{2}, 025002\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Limpanuparb and Milthorpe(2014)Limpanuparb, and Milthorpe]{Limpanuparb2014} Limpanuparb,~T.; Milthorpe,~J. {Associated Legendre Polynomials and Spherical Harmonics Computation for Chemistry Applications}. \textbf{2014}, \relax \mciteBstWouldAddEndPunctfalse \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Kaufmann and Baumeister(1989)Kaufmann, and Baumeister]{kauf-baum89jpb} Kaufmann,~K.; Baumeister,~W. Single-Centre Expansion of {{Gaussian}} Basis Functions and the Angular Decomposition of Their Overlap Integrals. \emph{J. Phys. B At. Mol. Opt. Phys.} \textbf{1989}, \emph{22}, 1--12\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Himanen \latin{et~al.}(2020)Himanen, J{\"a}ger, Morooka, Federici~Canova, Ranawat, Gao, Rinke, and Foster]{Himanen2020} Himanen,~L.; J{\"a}ger,~M. O.~J.; Morooka,~E.~V.; Federici~Canova,~F.; Ranawat,~Y.~S.; Gao,~D.~Z.; Rinke,~P.; Foster,~A.~S. {DScribe: Library of descriptors for machine learning in materials science}. \emph{Computer Physics Communications} \textbf{2020}, \emph{247}, 106949\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Musil \latin{et~al.}(2020)Musil, Veit, Junge, Stricker, Goscinki, Fraux, and Ceriotti]{LIBRASCAL} Musil,~F.; Veit,~M.; Junge,~T.; Stricker,~M.; Goscinki,~A.; Fraux,~G.; Ceriotti,~M. {{LIBRASCAL}}. \url{https://github.com/cosmo-epfl/librascal}, 2020; \url{https://github.com/cosmo-epfl/librascal}\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Kermode \latin{et~al.}()Kermode, Bart{\'o}k, and Cs{\'a}nyi]{QUIP} Kermode,~J.~R.; Bart{\'o}k,~A.~P.; Cs{\'a}nyi,~G. {{QUIP}}. \url{http://www.libatoms.org/}, \url{http://www.libatoms.org/}\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Hjorth~Larsen \latin{et~al.}(2017)Hjorth~Larsen, J{\o}rgen~Mortensen, Blomqvist, Castelli, Christensen, Du{\l}ak, Friis, Groves, Hammer, Hargus, Hermes, Jennings, Bjerre~Jensen, Kermode, Kitchin, Leonhard~Kolsbjerg, Kubal, Kaasbjerg, Lysgaard, Bergmann~Maronsson, Maxson, Olsen, Pastewka, Peterson, Rostgaard, Schi{\o}tz, Sch{\"u}tt, Strange, Thygesen, Vegge, Vilhelmsen, Walter, Zeng, and Jacobsen]{hjor+17jpcm} Hjorth~Larsen,~A. \latin{et~al.} The Atomic Simulation Environment\textemdash a {{Python}} Library for Working with Atoms. \emph{J. Phys.: Condens. Matter} \textbf{2017}, \emph{29}, 273002\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[L{\"o}wdin(1950)]{lowd50jcp} L{\"o}wdin,~P.-O. On the {{Non}}-{{Orthogonality Problem Connected}} with the {{Use}} of {{Atomic Wave Functions}} in the {{Theory}} of {{Molecules}} and {{Crystals}}. \emph{J. Chem. Phys.} \textbf{1950}, \emph{18}, 365--375\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Lejaeghere \latin{et~al.}(2016)Lejaeghere, Bihlmayer, Bjorkman, Blaha, Blugel, Blum, Caliste, Castelli, Clark, Dal~Corso, {de Gironcoli}, Deutsch, Dewhurst, Di~Marco, Draxl, {Du ak}, Eriksson, {Flores-Livas}, Garrity, Genovese, Giannozzi, Giantomassi, Goedecker, Gonze, Granas, Gross, Gulans, Gygi, Hamann, Hasnip, Holzwarth, {Iu an}, Jochym, Jollet, Jones, Kresse, Koepernik, Kucukbenli, Kvashnin, Locht, Lubeck, Marsman, Marzari, Nitzsche, Nordstrom, Ozaki, Paulatto, Pickard, Poelmans, Probert, Refson, Richter, Rignanese, Saha, Scheffler, Schlipf, Schwarz, Sharma, Tavazza, Thunstrom, Tkatchenko, Torrent, Vanderbilt, {van Setten}, Van~Speybroeck, Wills, Yates, Zhang, and Cottenier]{leja+16science} Lejaeghere,~K. \latin{et~al.} Reproducibility in Density Functional Theory Calculations of Solids. \emph{Science} \textbf{2016}, \emph{351}, aad3000--aad3000\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Yang \latin{et~al.}(2019)Yang, Lao, Wilkins, Grisafi, and Ceriotti]{yang+19sd} Yang,~Y.; Lao,~K.-U.; Wilkins,~D.~M.; Grisafi,~A.; Ceriotti,~M. Quantum Mechanical Static Dipole Polarizabilities in the {{QM7b}} and {{AlphaML}} Showcase Databases. \emph{Sci Data} \textbf{2019}, \emph{6}, 152\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Sabirov(2014)]{FullereneReview} Sabirov,~D.~S. Polarizability as a landmark property for fullerene chemistry and materials science. \emph{RSC Adv.} \textbf{2014}, \emph{4}, 44996\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Wilkins \latin{et~al.}(2018)Wilkins, Grisafi, Yang, Lao, A.~DiStasio~Jr., and Ceriotti]{alphaml} Wilkins,~D.~M.; Grisafi,~A.; Yang,~Y.; Lao,~K.~U.; A.~DiStasio~Jr.,~R.; Ceriotti,~M. {{AlphaML Website}}. \url{http://alphaml.org}, 2018; \url{http://alphaml.org}\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Kapil \latin{et~al.}(2020)Kapil, Wilkins, Lan, and Ceriotti]{kapi+20jcp} Kapil,~V.; Wilkins,~D.~M.; Lan,~J.; Ceriotti,~M. Inexpensive Modeling of Quantum Dynamics Using Path Integral Generalized {{Langevin}} Equation Thermostats. \emph{J. Chem. Phys.} \textbf{2020}, \emph{152}, 124104\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Marsalek and Markland(2017)Marsalek, and Markland]{mars-mark17jpcl} Marsalek,~O.; Markland,~T.~E. Quantum {{Dynamics}} and {{Spectroscopy}} of {{Ab Initio Liquid Water}}: {{The Interplay}} of {{Nuclear}} and {{Electronic Quantum Effects}}. \emph{J. Phys. Chem. Lett.} \textbf{2017}, \emph{8}, 1545--1551\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Note5()]{Note5} We use $\protect \tilde {\rho }$ and $\protect \tilde {c}$ to refer to electron density and its expansion coefficients, to distinguish them from the similar terms used for the atom density.\relax \mciteBstWouldAddEndPunctfalse \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Alred \latin{et~al.}(2018)Alred, Bets, Xie, and Yakobson]{alre+18cst} Alred,~J.~M.; Bets,~K.~V.; Xie,~Y.; Yakobson,~B.~I. Machine Learning Electron Density in Sulfur Crosslinked Carbon Nanotubes. \emph{Composites Science and Technology} \textbf{2018}, \emph{166}, 3--9\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Chandrasekaran \latin{et~al.}(2019)Chandrasekaran, Kamal, Batra, Kim, Chen, and Ramprasad]{chan+19npjcm} Chandrasekaran,~A.; Kamal,~D.; Batra,~R.; Kim,~C.; Chen,~L.; Ramprasad,~R. Solving the Electronic Structure Problem with Machine Learning. \emph{npj Comput Mater} \textbf{2019}, \emph{5}, 22\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Whitten(1973)]{whit73jcp} Whitten,~J.~L. Coulombic Potential Energy Integrals and Approximations. \emph{The Journal of Chemical Physics} \textbf{1973}, \emph{58}, 4496--4501\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Fabrizio \latin{et~al.}(2019)Fabrizio, Grisafi, Meyer, Ceriotti, and Corminboeuf]{fabr+19cs} Fabrizio,~A.; Grisafi,~A.; Meyer,~B.; Ceriotti,~M.; Corminboeuf,~C. Electron Density Learning of Non-Covalent Systems. \emph{Chem. Sci.} \textbf{2019}, \emph{10}, 9424\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Fabrizio \latin{et~al.}(2020)Fabrizio, Briling, Girardier, and Corminboeuf]{fabr+20jcp} Fabrizio,~A.; Briling,~K.~R.; Girardier,~D.~D.; Corminboeuf,~C. Learning On-Top: {{Regressing}} the on-Top Pair Density for Real-Space Visualization of Electron Correlation. \emph{J. Chem. Phys.} \textbf{2020}, \emph{153}, 204111\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Geiger and Dellago(2013)Geiger, and Dellago]{geig-dell13jcp} Geiger,~P.; Dellago,~C. Neural Networks for Local Structure Detection in Polymorphic Systems. \emph{The Journal of Chemical Physics} \textbf{2013}, \emph{139}, 164105\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Anelli \latin{et~al.}(2018)Anelli, Engel, Pickard, and Ceriotti]{anel+18prm} Anelli,~A.; Engel,~E.~A.; Pickard,~C.~J.; Ceriotti,~M. Generalized Convex Hull Construction for Materials Discovery. \emph{Phys. Rev. Mater.} \textbf{2018}, \emph{2}, 103804\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Engel \latin{et~al.}(2018)Engel, Anelli, Ceriotti, Pickard, and Needs]{enge+18ncomm} Engel,~E.~A.; Anelli,~A.; Ceriotti,~M.; Pickard,~C.~J.; Needs,~R.~J. Mapping Uncharted Territory in Ice from Zeolite Networks to Ice Structures. \emph{Nat. Commun.} \textbf{2018}, \emph{9}, 2173\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Gallet and Pietrucci(2013)Gallet, and Pietrucci]{gall-piet13jcp} Gallet,~G.~A.; Pietrucci,~F. Structural Cluster Analysis of Chemical Reactions in Solution. \emph{J Chem Phys} \textbf{2013}, \emph{139}, 74101\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Rowe \latin{et~al.}(2020)Rowe, Deringer, Gasparotto, Cs{\'a}nyi, and Michaelides]{rowe+20jcp} Rowe,~P.; Deringer,~V.~L.; Gasparotto,~P.; Cs{\'a}nyi,~G.; Michaelides,~A. An Accurate and Transferable Machine Learning Potential for Carbon. \emph{J. Chem. Phys.} \textbf{2020}, \emph{153}, 034702\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Maksimov \latin{et~al.}(2020)Maksimov, Baldauf, and Rossi]{maks+20ijqc} Maksimov,~D.; Baldauf,~C.; Rossi,~M. The Conformational Space of a Flexible Amino Acid at Metallic Surfaces. \emph{Int J Quantum Chem} \textbf{2020}, \relax \mciteBstWouldAddEndPunctfalse \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Musil \latin{et~al.}(2018)Musil, De, Yang, Campbell, Day, and Ceriotti]{musi+18cs} Musil,~F.; De,~S.; Yang,~J.; Campbell,~J.~E.; Day,~G.~M.; Ceriotti,~M. Machine Learning for the Structure-Energy-Property Landscapes of Molecular Crystals. \emph{Chem. Sci.} \textbf{2018}, \emph{9}, 1289--1300\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Gryn'ova \latin{et~al.}(2018)Gryn'ova, Lin, and Corminboeuf]{gryn+18jacs} Gryn'ova,~G.; Lin,~K.-H.; Corminboeuf,~C. Read between the {{Molecules}}: {{Computational Insights}} into {{Organic Semiconductors}}. \emph{J. Am. Chem. Soc.} \textbf{2018}, \emph{140}, 16370--16386\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Yang(2020)]{yang20jmcc} Yang,~J. Mapping Temperature-Dependent Energy\textendash Structure\textendash Property Relationships for Solid Solutions of Inorganic Halide Perovskites. \emph{J. Mater. Chem. C} \textbf{2020}, 10.1039.D0TC04515B\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[W{\"u}rger \latin{et~al.}(2019)W{\"u}rger, Feiler, Musil, Feldbauer, H{\"o}che, Lamaka, Zheludkevich, and Mei{\ss}ner]{wurg+19fm} W{\"u}rger,~T.; Feiler,~C.; Musil,~F.; Feldbauer,~G. B.~V.; H{\"o}che,~D.; Lamaka,~S.~V.; Zheludkevich,~M.~L.; Mei{\ss}ner,~R.~H. Data {{Science Based Mg Corrosion Engineering}}. \emph{Front. Mater.} \textbf{2019}, \emph{6}, 53\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Sharp \latin{et~al.}(2018)Sharp, Thomas, Cubuk, Schoenholz, Srolovitz, and Liu]{shar+18pnas} Sharp,~T.~A.; Thomas,~S.~L.; Cubuk,~E.~D.; Schoenholz,~S.~S.; Srolovitz,~D.~J.; Liu,~A.~J. Machine Learning Determination of Atomic Dynamics at Grain Boundaries. \emph{Proc Natl Acad Sci USA} \textbf{2018}, \emph{115}, 10943--10947\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Priedeman \latin{et~al.}(2018)Priedeman, Rosenbrock, Johnson, and Homer]{prie+18am} Priedeman,~J.~L.; Rosenbrock,~C.~W.; Johnson,~O.~K.; Homer,~E.~R. Quantifying and Connecting Atomic and Crystallographic Grain Boundary Structure Using Local Environment Representation and Dimensionality Reduction Techniques. \emph{Acta Materialia} \textbf{2018}, \emph{161}, 431--443\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Homer \latin{et~al.}(2019)Homer, Hensley, Rosenbrock, Nguyen, and Hart]{home+19fm} Homer,~E.~R.; Hensley,~D.~M.; Rosenbrock,~C.~W.; Nguyen,~A.~H.; Hart,~G. L.~W. Machine-{{Learning Informed Representations}} for {{Grain Boundary Structures}}. \emph{Front. Mater.} \textbf{2019}, \emph{6}, 168\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Gasparotto \latin{et~al.}(2020)Gasparotto, Bochicchio, Ceriotti, and Pavan]{gasp+20jpcb} Gasparotto,~P.; Bochicchio,~D.; Ceriotti,~M.; Pavan,~G.~M. Identifying and {{Tracking Defects}} in {{Dynamic Supramolecular Polymers}}. \emph{J. Phys. Chem. B} \textbf{2020}, \emph{124}, 589--599\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Capelli \latin{et~al.}(2021)Capelli, Gardin, Empereur-mot, Doni, and Pavan]{capelli2021chemrxiv} Capelli,~R.; Gardin,~A.; Empereur-mot,~C.; Doni,~G.; Pavan,~G.~M. A Data-Driven Dimensionality Reduction Approach to Compare and Classify Lipid Force Fields. \emph{ChemRxiv:14039834.v3} \textbf{2021}, \relax \mciteBstWouldAddEndPunctfalse \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[{Schwalbe-Koda} \latin{et~al.}(2019){Schwalbe-Koda}, Jensen, Olivetti, and {G{\'o}mez-Bombarelli}]{schw+19nm} {Schwalbe-Koda},~D.; Jensen,~Z.; Olivetti,~E.; {G{\'o}mez-Bombarelli},~R. Graph Similarity Drives Zeolite Diffusionless Transformations and Intergrowth. \emph{Nat. Mater.} \textbf{2019}, \emph{18}, 1177--1181\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Nicholas \latin{et~al.}(2020)Nicholas, Goodwin, and Deringer]{nich+20cs} Nicholas,~T.~C.; Goodwin,~A.~L.; Deringer,~V.~L. Understanding the Geometric Diversity of Inorganic and Hybrid Frameworks through Structural Coarse-Graining. \emph{Chem. Sci.} \textbf{2020}, \emph{11}, 12580--12587\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Dietz \latin{et~al.}(2017)Dietz, Kretz, and Thoma]{diet+17pre} Dietz,~C.; Kretz,~T.; Thoma,~M.~H. Machine-Learning Approach for Local Classification of Crystalline Structures in Multiphase Systems. \emph{Phys. Rev. E} \textbf{2017}, \emph{96}, 011301\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Fulford \latin{et~al.}(2019)Fulford, Salvalaglio, and Molteni]{fulf+19jcim} Fulford,~M.; Salvalaglio,~M.; Molteni,~C. {{DeepIce}}: {{A Deep Neural Network Approach To Identify Ice}} and {{Water Molecules}}. \emph{J. Chem. Inf. Model.} \textbf{2019}, \emph{59}, 2141--2149\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Deringer \latin{et~al.}(2018)Deringer, Caro, Jana, Aarva, Elliott, Laurila, Cs{\'a}nyi, and Pastewka]{deri+18cm} Deringer,~V.~L.; Caro,~M.~A.; Jana,~R.; Aarva,~A.; Elliott,~S.~R.; Laurila,~T.; Cs{\'a}nyi,~G.; Pastewka,~L. Computational {{Surface Chemistry}} of {{Tetrahedral Amorphous Carbon}} by {{Combining Machine Learning}} and {{Density Functional Theory}}. \emph{Chem. Mater.} \textbf{2018}, \emph{30}, 7438--7445\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Zhou \latin{et~al.}(2020)Zhou, Sun, Zewdie, Mazzarello, Deringer, Ma, and Zhang]{zhou+20jmcc} Zhou,~Y.; Sun,~L.; Zewdie,~G.~M.; Mazzarello,~R.; Deringer,~V.~L.; Ma,~E.; Zhang,~W. Bonding Similarities and Differences between {{Y}}\textendash{{Sb}}\textendash{{Te}} and {{Sc}}\textendash{{Sb}}\textendash{{Te}} Phase-Change Memory Materials. \emph{J. Mater. Chem. C} \textbf{2020}, \emph{8}, 3646--3654\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Huang \latin{et~al.}(2019)Huang, Cs{\'a}nyi, Zhao, Cheng, and Deringer]{huan+19jmca} Huang,~J.-X.; Cs{\'a}nyi,~G.; Zhao,~J.-B.; Cheng,~J.; Deringer,~V.~L. First-Principles Study of Alkali-Metal Intercalation in Disordered Carbon Anode Materials. \emph{J. Mater. Chem. A} \textbf{2019}, \emph{7}, 19070--19080\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Caro \latin{et~al.}(2020)Caro, Cs{\'a}nyi, Laurila, and Deringer]{caro+20prb} Caro,~M.~A.; Cs{\'a}nyi,~G.; Laurila,~T.; Deringer,~V.~L. Machine Learning Driven Simulated Deposition of Carbon Films: {{From}} Low-Density to Diamondlike Amorphous Carbon. \emph{Phys. Rev. B} \textbf{2020}, \emph{102}, 174201\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Reinhardt \latin{et~al.}(2020)Reinhardt, Pickard, and Cheng]{rein+20pccp} Reinhardt,~A.; Pickard,~C.~J.; Cheng,~B. Predicting the Phase Diagram of Titanium Dioxide with Random Search and Pattern Recognition. \emph{Phys. Chem. Chem. Phys.} \textbf{2020}, \emph{22}, 12697--12705\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Basdogan \latin{et~al.}(2020)Basdogan, Groenenboom, Henderson, De, Rempe, and Keith]{basd+20jctc} Basdogan,~Y.; Groenenboom,~M.~C.; Henderson,~E.; De,~S.; Rempe,~S.~B.; Keith,~J.~A. Machine {{Learning}}-{{Guided Approach}} for {{Studying Solvation Environments}}. \emph{J. Chem. Theory Comput.} \textbf{2020}, \emph{16}, 633--642\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Bernstein \latin{et~al.}(2019)Bernstein, Cs{\'a}nyi, and Deringer]{bern+19npjcm} Bernstein,~N.; Cs{\'a}nyi,~G.; Deringer,~V.~L. De Novo Exploration and Self-Guided Learning of Potential-Energy Surfaces. \emph{npj Comput Mater} \textbf{2019}, \emph{5}, 99\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Monserrat \latin{et~al.}(2020)Monserrat, Brandenburg, Engel, and Cheng]{mons+20nc} Monserrat,~B.; Brandenburg,~J.~G.; Engel,~E.~A.; Cheng,~B. Liquid Water Contains the Building Blocks of Diverse Ice Phases. \emph{Nat Commun} \textbf{2020}, \emph{11}, 5757\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Deringer \latin{et~al.}(2020)Deringer, Caro, and Cs{\'a}nyi]{deri+20nc} Deringer,~V.~L.; Caro,~M.~A.; Cs{\'a}nyi,~G. A General-Purpose Machine-Learning Force Field for Bulk and Nanostructured Phosphorus. \emph{Nat Commun} \textbf{2020}, \emph{11}, 5461\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Shen \latin{et~al.}(2020)Shen, Ding, Wang, Cao, Ding, and Hou]{Shen2020} Shen,~C.; Ding,~J.; Wang,~Z.; Cao,~D.; Ding,~X.; Hou,~T. {From machine learning to deep learning: Advances in scoring functions for protein–ligand docking}. \emph{WIREs Computational Molecular Science} \textbf{2020}, \emph{10}\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Dastmalchi \latin{et~al.}(2012)Dastmalchi, Hamzeh-Mivehroud, and Asadpour-Zeynali]{Dastmalchi2012} Dastmalchi,~S.; Hamzeh-Mivehroud,~M.; Asadpour-Zeynali,~K. {Comparison of different 2D and 3D-QSAR methods on activity prediction of histamine H3 receptor antagonists}. \emph{Iranian Journal of Pharmaceutical Research} \textbf{2012}, \emph{11}, 97--108\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Jagiello \latin{et~al.}(2016)Jagiello, Grzonkowska, Swirog, Ahmed, Rasulev, Avramopoulos, Papadopoulos, Leszczynski, and Puzyn]{Jagiello2016} Jagiello,~K.; Grzonkowska,~M.; Swirog,~M.; Ahmed,~L.; Rasulev,~B.; Avramopoulos,~A.; Papadopoulos,~M.~G.; Leszczynski,~J.; Puzyn,~T. {Advantages and limitations of classic and 3D QSAR approaches in nano-QSAR studies based on biological activity of fullerene derivatives}. \emph{Journal of Nanoparticle Research} \textbf{2016}, \emph{18}, 256\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Choudhary \latin{et~al.}(2018)Choudhary, DeCost, and Tavazza]{chou+18prm} Choudhary,~K.; DeCost,~B.; Tavazza,~F. Machine Learning with Force-Field-Inspired Descriptors for Materials: {{Fast}} Screening and Mapping Energy Landscape. \emph{Phys. Rev. Materials} \textbf{2018}, \emph{2}, 083801\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Kuz'min \latin{et~al.}(2005)Kuz'min, Artemenko, Polischuk, Muratov, Hromov, Liahovskiy, Andronati, and Makan]{Kuzmin2005} Kuz'min,~V.~E.; Artemenko,~A.~G.; Polischuk,~P.~G.; Muratov,~E.~N.; Hromov,~A.~I.; Liahovskiy,~A.~V.; Andronati,~S.~A.; Makan,~S.~Y. {Hierarchic system of QSAR models (1D-4D) on the base of simplex representation of molecular structure}. \emph{Journal of Molecular Modeling} \textbf{2005}, \emph{11}, 457--467\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Zankov \latin{et~al.}(2020)Zankov, V., Matveieva, Nikonenko, Nugmanov, Varnek, Polishchuk, and Madzhidov]{Zankov2020} Zankov,~D.; V.,; Matveieva,~M.; Nikonenko,~A.; Nugmanov,~R.; Varnek,~A.; Polishchuk,~P.; Madzhidov,~T. {QSAR Modeling Based on Conformation Ensembles Using a Multi-Instance Learning Approach}. \textbf{2020}, \relax \mciteBstWouldAddEndPunctfalse \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Weinreich \latin{et~al.}(2021)Weinreich, Browning, and {von Lilienfeld}]{wein+21jcp} Weinreich,~J.; Browning,~N.~J.; {von Lilienfeld},~O.~A. Machine Learning of Free Energies in Chemical Compound Space Using Ensemble Representations: {{Reaching}} Experimental Uncertainty for Solvation. \emph{J. Chem. Phys.} \textbf{2021}, \emph{154}, 134113\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Axelrod and Gomez-Bombarelli(2020)Axelrod, and Gomez-Bombarelli]{Axelrod2020} Axelrod,~S.; Gomez-Bombarelli,~R. {Molecular machine learning with conformer ensembles}. \textbf{2020}, \relax \mciteBstWouldAddEndPunctfalse \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Gallarati \latin{et~al.}(2021)Gallarati, Fabregat, Laplaza, Bhattacharjee, Wodrich, and Corminboeuf]{gall+21cs} Gallarati,~S.; Fabregat,~R.; Laplaza,~R.; Bhattacharjee,~S.; Wodrich,~M.~D.; Corminboeuf,~C. Reaction-Based Machine Learning Representations for Predicting the Enantioselectivity of Organocatalysts. \emph{Chem. Sci.} \textbf{2021}, 10.1039.D1SC00482D\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Jinnouchi and Asahi(2017)Jinnouchi, and Asahi]{jinn-asah17jpcl} Jinnouchi,~R.; Asahi,~R. Predicting {{Catalytic Activity}} of {{Nanoparticles}} by a {{DFT}}-{{Aided Machine}}-{{Learning Algorithm}}. \emph{J. Phys. Chem. Lett.} \textbf{2017}, \emph{8}, 4279--4283\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Caro \latin{et~al.}(2018)Caro, Aarva, Deringer, Cs{\'a}nyi, and Laurila]{caro+18cm} Caro,~M.~A.; Aarva,~A.; Deringer,~V.~L.; Cs{\'a}nyi,~G.; Laurila,~T. Reactivity of {{Amorphous Carbon Surfaces}}: {{Rationalizing}} the {{Role}} of {{Structural Motifs}} in {{Functionalization Using Machine Learning}}. \emph{Chem. Mater.} \textbf{2018}, \emph{30}, 7446--7455\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Aarva \latin{et~al.}(2019)Aarva, Deringer, Sainio, Laurila, and Caro]{aarv+19cm} Aarva,~A.; Deringer,~V.~L.; Sainio,~S.; Laurila,~T.; Caro,~M.~A. Understanding {{X}}-Ray {{Spectroscopy}} of {{Carbonaceous Materials}} by {{Combining Experiments}}, {{Density Functional Theory}}, and {{Machine Learning}}. {{Part II}}: {{Quantitative Fitting}} of {{Spectra}}. \emph{Chem. Mater.} \textbf{2019}, \emph{31}, 9256--9267\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Dick and {Fernandez-Serra}(2019)Dick, and {Fernandez-Serra}]{dick-fern19jcp} Dick,~S.; {Fernandez-Serra},~M. Learning from the Density to Correct Total Energy and Forces in First Principle Simulations. \emph{J. Chem. Phys.} \textbf{2019}, \emph{151}, 144102\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Fung \latin{et~al.}(2021)Fung, Hu, Ganesh, and Sumpter]{fung+21nc} Fung,~V.; Hu,~G.; Ganesh,~P.; Sumpter,~B.~G. Machine Learned Features from Density of States for Accurate Adsorption Energy Prediction. \emph{Nat Commun} \textbf{2021}, \emph{12}, 88\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Welborn \latin{et~al.}(2018)Welborn, Cheng, and Miller]{welb+18jctc} Welborn,~M.; Cheng,~L.; Miller,~T.~F. Transferability in {{Machine Learning}} for {{Electronic Structure}} via the {{Molecular Orbital Basis}}. \emph{J. Chem. Theory Comput.} \textbf{2018}, \emph{14}, 4772--4779\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Cheng \latin{et~al.}(2019)Cheng, Welborn, Christensen, and Miller]{chen+19jcp} Cheng,~L.; Welborn,~M.; Christensen,~A.~S.; Miller,~T.~F. A Universal Density Matrix Functional from Molecular Orbital-Based Machine Learning: {{Transferability}} across Organic Molecules. \emph{J. Chem. Phys.} \textbf{2019}, \emph{150}, 131103\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \bibitem[Qiao \latin{et~al.}(2020)Qiao, Welborn, Anandkumar, Manby, and Miller]{qiao+20jcp} Qiao,~Z.; Welborn,~M.; Anandkumar,~A.; Manby,~F.~R.; Miller,~T.~F. {{OrbNet}}: {{Deep}} Learning for Quantum Chemistry Using Symmetry-Adapted Atomic-Orbital Features. \emph{J. Chem. Phys.} \textbf{2020}, \emph{153}, 124111\relax \mciteBstWouldAddEndPuncttrue \mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct} {\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax \unskip.} \end{mcitethebibliography} \clearpage \begin{figure*} \includegraphics[width=0.5\linewidth]{fig41.pdf}\\ TOC GRAPHICS \end{figure*} \end{document}
\section{Introduction} Exponential stability of vector, scalar and higher order delay differential equations has attracted a lot of attention, see \cite{AS,BB1,BDSZ1,Hale,Gil,Gopalsamy,KN,KM,Kuang,Ngoc1} and the bibliography therein. Considered models included neutral equations and systems with both concentrated and distributed delays. However, for two classes of linear functional differential equations there are only few stability results. These types are systems of several linear delay differential equations of the first order with matrix coefficients and systems, where at least one equation is of the second or higher order. Scientific interest to these models is not purely theoretical. There are many interesting real-world applications of such systems. For example, the ordinary differential vector equation of the second order \begin{equation}\label{1.1} \ddot{x}(t)+A(t)\dot{x}(t)+B(t)x(t)=0 \end{equation} arises in control theory \cite{Harris, Rugh}. Explicit asymptotic stability conditions for vector ordinary differential equations of the second order were obtained in \cite{Harris, Gil_a, Rugh, Sun, Zevin}. Delay differential vector equations of the second order are natural generalizations of \eqref{1.1} that also can be applied in control theory. However, presently this application is not practical due to lack of qualitative results for this class of equations. We can mention only the paper \cite{Tunc1}, where for the nonlinear vector equation \begin{equation}\label{1.2} \ddot{x}(t)+F(x(t),\dot{x}(t))\dot{x}(t)+H(x(t-\tau))=L(t) \end{equation} asymptotic stability of the zero solution and the boundedness of all solutions of equation \eqref{1.2} were investigated. One of the goals of this paper is to fill this gap, by studying exponential stability of linear and nonlinear vector delay differential equations of the second order. The paper is organized as follows. Section 2 contains relevant definitions, notations and auxiliary statements. In Section 3, we obtain the main result of the paper on exponential stability for linear systems of functional differential equations with matrix coefficients. We also give several corollaries, one of them will further be applied to second order vector equations. Section 4 deals with exponential stability for a linear delay differential equation of the second order with matrix coefficients. A stability test obtained here is one of the first stability results for this class of equations. As a corollary, we deduce new stability conditions for non-delay vector equation \eqref{1.1}. In Section 5, we compare stability results of the present paper with known ones. Section 5 also includes some open problems and topics for future research. \section{Preliminaries} The main object of the present paper is \begin{equation} \label{2.1} \dot{x_i}(t)= A_i(t)x_i(h_i(t)) +\sum_{j=1}^n \sum_{k=1}^{m_{ij}} B_{ij}^k(t)x_j(h_{ij}^k(t)) + \displaystyle \sum_{j=1}^n\int\limits_{g_{ij}(t)}^t K_{ij}(t,s)x_j(s)ds,~i=1,\dots,n, ~ t \geq t_0\geq 0, \end{equation} where $x_i: {\mathbb R} \to {\mathbb R}^d$, $i=1,\dots,n$ are unknown vector-functions, $A_i, B_{ij}^k, K_{ij}$ are given $d\times d$ matrices with Lebesgue measurable essentially bounded on the semi-axis $[0,\infty)$ entries, and the delays $h_i,h_{ij}^k, g_{ij}$ are Lebesgue measurable functions. Let us denote by $\| \cdot \|$ an arbitrary vector norm, the same notation will be used for the induced matrix norm, $I$ is the identity matrix. The absolute value of the matrix is understood componentwise: if $B=\left(b_{ij}\right)_{i,j=1}^d$ then $|B|:=\left(|b_{ij}|\right)_{i,j=1}^d$, we use the same notation for vectors. Matrix or vector inequalities $A\leq B$ or $A<B$ are also understood componentwise: each entry satisfies the inequality. All the relations (equations and inequalities) with Lebesgue measurable functions are understood almost everywhere. To get main results, we will utilize the matrix measure (the logarithmic norm) defined in~\cite{S,Z} and~\cite[Table 3.1, p. 286]{KM} as \begin{equation*} \mu(B):=\lim_{\vartheta\rightarrow 0^+}\frac{\|I+\vartheta B\|-1}{\vartheta} \, . \end{equation*} In particular, for the maximum norm ${\|x\|}_{\infty}:=\max_{i=1,\dots, d}|x_i|$ we have for $B=(b_{ij})_{i,j=1}^d$ $${\|B\|}_{\infty}:=\max_{i=1,\dots,d}\sum_{j=1}^{d} |b_{ij}|, ~~ \mu_{\infty}(B)=\max_{i=1\dots,d}\left\{b_{ii}+\sum_{j=1,j\neq i}^{d} |a_{ij}|\right\}. $$ The following classical definition for an $M$-matrix will be used. \begin{definition} \cite{Berman} A matrix $B=(b_{ij})_{i,j=1}^n$ is called a (non-singular) {\em $M$-matrix} if $b_{ij}\leq 0, i\neq j$, and one of the following equivalent conditions holds: \begin{enumerate} \item $B$ is invertible, and $B^{-1} \geq 0$; \item the leading principal minors of the matrix $B$ are positive. \end{enumerate} \end{definition} \begin{remark} \label{obvious} Note that for any three column vectors $X\leq Y$ and $Z\geq 0$ we have $Z^T(Y-X) \geq 0$ as a sum of non-negative numbers. Thus, for any matrix $A\geq 0$ and $X\leq Y$ with entries of arbitrary signs, we have $AX \leq AY$. \end{remark} For a fixed bounded interval $\Omega=[t_0,t_1]$, let $\|y\|_{\Omega}= \mbox{ess}\sup_{t\in \Omega} \|y(t)\|$, also for a half-line $\|f\|_{[t_0,\infty)}=\mbox{ess}\sup_{t\geq t_0} \|f(t)\|$. Denote by ${{\bf L}}_{\infty}^d[t_0,t_1]$ the space of all essentially bounded on $\Omega$ vector functions $y$ with the norm $\|y\|_{\Omega}$, the same for ${{\bf L}}_{\infty}^d[t_0,\infty)$ and for the spaces ${{\bf L}}_{\infty}^{d \times d} [t_0,t_1]$, ${{\bf L}}_{\infty}^{d \times d} [t_0,\infty)$ of matrix functions. Assume that for a fixed $t_0\geq 0$ vector-functions $ \varphi_ \colon(-\infty,t_0]\rightarrow {\mathbb R}^d$, $i=1, \dots, n $ are Borel measurable and bounded. Below for every $t_0\geq 0$, system \eqref{2.1} will be considered with the initial condition \begin{equation}\label{2.2} x_i(t)=\varphi_i(t),\,\,\,\,t\leq t_0, ~~i=1, \dots, n \end{equation} under the hypotheses: \begin{itemize} \item[$(i)$] $A_i, B_{ij}^{k},K_{ij} \colon [0,\infty)\to\mathbb{R}^{d\times d}$, $k=1,\dots,m_{ij}$, $i,j=1,\dots,n$ belong to ${{\bf L}}_{\infty}^{d \times d} [0,\infty)$. \item[$(ii)$] $ h_{i}, h_{ij}^k, g_{ij} \colon [0,\infty)\to\mathbb{R}$, are Lebesgue measurable functions, and there are numbers $\tau_{ij}^k>0, \sigma_{ij}>0, \tau_{i}\geq 0$ such that almost everywhere \begin{equation}\label{2.3} 0 \leq t-h_{ij}^k(t)\leq \tau_{ij}^k,~ 0 \leq t-g_{ij}(t)\leq \sigma_{ij}, ~0 \leq t-h_{i}(t)\leq \tau_{i}, ~k=1,\dots,m_{ij}, ~i,j=1,\dots,n, ~t\geq 0. \end{equation} \end{itemize} A solution of problem~\eqref{2.1},~\eqref{2.2} is understood in the sense of the following definition. \begin{definition}\label{definition2.1} A set of vector-functions $x_i\colon {\mathbb R}\rightarrow {\mathbb R}^d, ~i=1,\dots,n$ is called {\bf a solution of problem}~\eqref{2.1},~\eqref{2.2} if $x_i$ satisfy~\eqref{2.1} for almost all $t\in [t_0,\infty)$ and \eqref{2.2} for all $t\in [t_0,t_0-\tilde{\tau}_i]$, where $\displaystyle \tilde{\tau}_i = \max\left\{ \max_{j,k} \tau_{ij}^k, \max_{j} \sigma_{ij} , \tau_i \right\}$, $i=1, \dots, n$. \end{definition} Let $x_i,i=1,\dots,n$ be a solution of problem~\eqref{2.1},~\eqref{2.2}. Introduce the matrix function $\Phi(t)=\{\varphi_1(t),\dots,\varphi_n(t)\}$ with $\varphi_i$ as columns. \begin{definition}\label{definition2.2} System~\eqref{2.1} is called {\bf uniformly exponentially stable}, if there exist positive constants $H$ and $\nu$, such that any solution $X$ of~\eqref{2.1},~\eqref{2.2} satisfies $$ \|x_i(t)\|\leq H e^{-\nu (t-t_0)}\sup_{t\in [t_0,t_0-\max_i\tilde{\tau}_i]}\|\Phi(t)\|,\,\,\,t\geq t_ 0 \geq 0, ~~i=1, \dots, n, $$ where $H$ and $\nu$ do not depend on $t_ 0$ and $\Phi$. \end{definition} Consider a non-homogeneous version of~\eqref{2.1} \begin{equation} \label{2.4} \begin{array}{ll} \dot{x_i}(t)= & \displaystyle A_i(t)x_i(h_i(t)) +\sum_{j=1}^n \sum_{k=1}^{m_{ij}} B_{ij}^k(t)x_j(h_{ij}^k(t)) \vspace{2mm} \\ & \displaystyle + \sum_{j=1}^n\int\limits_{g_{ij}(t)}^t K_{ij}(t,s)x_j(s)ds+f_i(t),~i=1,\dots,n, ~t\geq t_0 \geq 0 \end{array} \end{equation} and assume that $f_i\in {{\bf L}}_{\infty}^d[t_0,\infty)$. The definition of a solution for \eqref{2.4}, \eqref{2.2} is similar to that of \eqref{2.1}, \eqref{2.2}. A modification of~\cite[Lemma 2]{BDSZ1} will further be used. \begin{uess}\label{lemma2.1} Let a function $a\colon [t_0,\infty)\to [0,\infty)$ be Lebesgue measurable and $\omega\in {{\bf L}}_{\infty}^1[t_0,\infty)$. Then the inequality $\displaystyle \left|\int_{t_0}^t e^{-\int_s^t a(\tau)d\tau}a(s)\omega(s)ds\right| \leq {\mathrm{ess\,sup}}_{t\in[t_0,t_1]}|\omega(t)|,\,\,\,\, t\in [t_0,t_1], $ holds for any $t_1>t_0$. \end{uess} Let $x_i$ be a solution of non-homogeneous system~\eqref{2.4}, where $f_i\in {\bf L}_{\infty}^d[t_0,\infty)$ satisfy \begin{equation}\label{2.5} x_i(t)=0,\,\,\,\,t\le t_0, ~~i=1, \dots, n. \end{equation} The following Bohl-Perron type result is cited from~\cite{AS, Gil}. \begin{uess}\label{lemma2.2} If, for any $t_0\geq 0$ and any $f_i\in {{\bf L}}_{\infty}^d[t_0,\infty)$, $i=1, \dots, n$, all $x_i$ in the solution of problem~\eqref{2.4}, \eqref{2.5} belong to ${{\bf L}}_{\infty}^d[t_0,\infty)$, $i=1, \dots, n$ then system~\eqref{2.1} is uniformly exponentially stable. \end{uess} Below, we use the Coppel inequality~\cite{Desoer,Z} for a system of ordinary differential equations \begin{equation}\label{2.6} \dot{x}(t)=D(t)x(t),\,\,\,\,\,t\ge 0, \end{equation} where the columns of $D$ are in ${{\bf L}}_{\infty}^d[0,\infty)$. Let $\Phi (t,s)$ be the fundamental matrix of~\eqref{2.6}, i.e. a solution of the problem $$ \dot{x}(t)=D(t)x(t),\,\,\,\,\,t>s\ge 0,\,\,\,\,\,x(s)=I. $$ \begin{uess}[Coppel inequality]\label{lemma2.3} The fundamental matrix $\Phi(t,s)$ of~\eqref{2.6} satisfies \begin{equation}\label{2.7} \left\| \Phi(t,s)\right\|\leq \exp \left({\int_s^t \mu(D (\xi)) d\xi}\right),\,\,\,\,\,t>s\ge 0. \end{equation} \end{uess} \begin{remark}\label{remark2.1} By Lemma~\ref{lemma2.3}, the condition $\mu(D(t))\leq d_0<0$, $t\in[t_0,\infty)$, $\forall t_0 \ge 0$ for the matrix measure implies uniform exponential stability of system~\eqref{2.6}. \end{remark} The final auxiliary result gives an a priori estimate for the derivative of a solution. Let $\Omega :=[t_0,t_1]\subset [t_0,\infty)$, $t_1>t_0$ and \begin{equation* C_{ij}(t) :=\int_{g_{ij}(t)}^t |K_{ij}(t,s)|ds. \end{equation*} \begin{uess}\label{lemma2.4} Let $x_i=x_i(t)$, $i=1,\dots,n$ be a solution of problem~\eqref{2.4},\eqref{2.5}, $\Omega=[t_0,t_1]$. Then the derivatives $\dot{x_i}$ satisfy \begin{equation}\label{2.10} {\|\dot{x_i}\|}_{\Omega} \leq \|A_i\|_{[t_0,\infty)}{\|x_i\|}_{\Omega}+\sum_{j=1}^n \left(\sum_{k=1}^{m_{ij}} \|B_{ij}^k\|_{[t_0,\infty)} + \|C_{ij}\|_{[t_0,\infty)}\right){\|x_j\|}_{\Omega} +\|f_i\|_{[t_0,\infty)}. \end{equation} \end{uess} \begin{proof} Let $t\in \Omega$ and $x=x(t)$ be a solution of~\eqref{2.4}, \eqref{2.5}. By \eqref{2.5}, $x(t)=0$ if $t\le t_0$. Estimating the norm in the left-hand side of~\eqref{2.4}, we derive \begin{equation}\label{2.11} \|\dot{x_i}(t)\|\leq \|A_i\|_{[t_0,\infty)}{\|x_i\|}_{\Omega}+\sum_{j=1}^n \left(\sum_{k=1}^{m_{ij}} \|B_{ij}^k\|_{[t_0,\infty)} + \|C_{ij}\|_{[t_0,\infty)}\right){\|x_j\|}_{\Omega} + \| f_i \|_{\Omega}. \end{equation} Since the right-hand side of~\eqref{2.11} does not depend on $t\in \Omega$, inequality~\eqref{2.11} implies \eqref{2.10}. \end{proof} \section{Main Results}\label{main_result} \subsection{The main theorem} \begin{guess}\label{theorem3.1} Let there exist $\alpha_i$ such that $\mu(A_i(t))\leq \alpha_i<0$, $i=1,\dots,n$ and $L=I-D$ be an $M-$matrix, where the entries of $D=(d_{ij})_{i,j=1}^n$ be defined as follows: $$ \begin{array}{ll} d_{ii}=& \displaystyle \tau_i\left\|\frac{A_i}{\mu(A_i)}\right\|_{[t_0,\infty)} \left(\|A_i\|_{[t_0,\infty)}+\sum_{k=1}^{m_{ii}} \|B_{ii}^k\|_{[t_0,\infty)}+\|C_{ii}\|_{[t_0,\infty)}\right) \displaystyle +\sum_{k=1}^{m_{ii}}\left\|\frac{B_{ii}^k}{\mu(A_i)}\right\|_{[t_0,\infty)} \!\!\!\!\!\! +\left\|\frac{C_{ii}}{\mu(A_i)}\right\|_{[t_0,\infty)}, \vspace{2mm} \\ d_{ij}= & \displaystyle \tau_i\left\|\frac{A_i}{\mu(A_i)}\right\|_{[t_0,\infty)}\left(\sum_{k=1}^{m_{ij}} \|B_{ij}^k\|_{[t_0,\infty)}+\|C_{ij}\|_{[t_0,\infty)}\right) +\sum_{k=1}^{m_{ij}}\left\|\frac{B_{ij}^k}{\mu(A_i)}\right\|_{[t_0,\infty)}+\left\|\frac{C_{ij}}{\mu(A_i)}\right\|_{[t_0,\infty)}, ~~j\neq i. \end{array} $$ Then system \eqref{2.1} is uniformly exponentially stable. \end{guess} \begin{proof} To apply Lemma~\ref{lemma2.2}, we explore boundedness of solutions to \eqref{2.4},\eqref{2.5}. First, transform \eqref{2.4} to the form $$ \dot{x_i}(t)= A_i(t)x_i(t) -A_i(t)\int\limits_{h_i(t)}^t \dot{x_i}(s)ds+\sum_{j=1}^n \sum_{k=1}^{m_{ij}} B_{ij}^k(t)x_j(h_{ij}^k(t)) +\sum_{j=1}^n \int\limits_{g_{ij}(t)}^t K_{ij}(t,s)x_j(s)ds+f_i(t). $$ Denote by $\Phi_i(t,s)$ the fundamental matrix of \begin{equation}\label{3.1} \dot{x}(t)=A_i(t)x(t). \end{equation} Since $\mu(A_i(t))\leq \alpha_i<0$, \eqref{3.1} is uniformly exponentially stable. Continue transformations of equation \eqref{2.4} $$ \begin{array}{ll} x_i(t)= & \displaystyle \int_{t_0}^t \Phi_i(t,s)\left[-A_i(s)\int\limits_{h_i(s)}^s \dot{x_i}(\xi)d\xi +\sum_{j=1}^n \sum_{k=1}^{m_{ij}} B_{ij}^k(s)x_j(h_{ij}^k(s))\right. \\ & \displaystyle \left.+ \sum_{j=1}^n \int\limits_{g_{ij}(s)}^s K_{ij}(s,\xi)x_j(\xi)d\xi\right]ds+\tilde{f_i}(t), \end{array} $$ where $\tilde{f_i}(t)=\int_{t_0}^t \Phi_i(t,s) f_i(s)ds \in {{\bf L}}_{\infty}^d[t_0,\infty)$. Hence by Lemma~\ref{lemma2.3}, $$ \begin{array}{lll} \|x_i(t)\| & \leq & \displaystyle \int_{t_0}^t \left. \left. e^{\int_s^t \mu(A_i(\xi))d\xi} \right| \mu(A_i(s)) \right| \left[\left\|\frac{A_i(s)}{\mu(A_i(s))}\right\| \int\limits_{h_i(s)}^s \|\dot{x_i}(\xi)\|d\xi \right. \vspace{2mm} \\ & & + \displaystyle \sum_{j=1}^n \sum_{k=1}^{m_{ij}}\left\|\frac{B_{ij}^k(s)}{\mu(A_i(s))}\right\|\|x_j(h_{ij}^k(s))\| \left. \displaystyle +\sum_{j=1}^n \left\|\frac{C_{ij}(s)}{\mu(A_i(s))}\right\|\max_{\xi\in [g_{ij}(s),s]}\|x_j(\xi)\|\right]ds+\|\tilde{f_i}(t)\| \vspace{2mm} \\ & \leq & \displaystyle \tau_i\left\|\frac{A_i}{\mu(A_i)}\right\|_{[t_0,\infty)}\|\dot{x_i}\|_{\Omega}+\|\tilde{f_i}\|_{[t_0,\infty)} +\sum_{j=1}^n \left(\sum_{k=1}^{m_{ij}}\left\|\frac{B_{ij}^k}{\mu(A_i)}\right\|_{[t_0,\infty)} + \left\|\frac{C_{ij}}{\mu(A_i)}\right\|_{[t_0,\infty)}\right)\|x_j\|_{\Omega}. \end{array} $$ Therefore by Lemma~\ref{lemma2.4}, $$ \begin{array}{lll} \|x_i\|_{\Omega} & \leq & \displaystyle \tau_i\left\|\frac{A_i}{\mu(A_i)}\right\|_{[t_0,\infty)}\left(\|A_i\|_{[t_0,\infty)}{\|x_i\|}_{\Omega} +\sum_{j=1}^n \left(\sum_{k=1}^{m_{ij}} \|B_{ij}^k\|_{[t_0,\infty)}+\|C_{ij}\|_{[t_0,\infty)}\right){\|x_j\|}_{\Omega}\right) \vspace{2mm} \\ & & \displaystyle +\sum_{j=1}^n \left(\sum_{k=1}^{m_{ij}}\left\|\frac{B_{ij}^k}{\mu(A_i)}\right\|_{[t_0,\infty)} + \left\|\frac{C_{ij}}{\mu(A_i)}\right\|_{[t_0,\infty)}\right)\|x_j\|_{\Omega}+M_i \vspace{2mm} \\ & = & \displaystyle d_{ii}\|x_i\|_{\Omega} +\sum_{j\neq i} d_{ij}\|x_j\|_{\Omega} +M_i, \end{array} $$ where $M_i>0$ are constants, not dependent on $t_1>t_0$. Introduce the column vectors $X_{\Omega}=(\|x_1\|_{\Omega},\dots,\|x_n\|_{\Omega})^T,M=(\|M_1\|,\dots,\|M_n\|)^T$. Then $(I-D)X_\Omega\leq M$. Since $I-D$ is an $M$-matrix, there exists $(I-D)^{-1}\geq 0$. Therefore (see Remark~\ref{obvious}) $X_{\Omega}\leq (I-D)^{-1}M$, where the right-hand side of the last inequality does not depend on the interval~$\Omega$. Hence the solution of problem \eqref{2.4},\eqref{2.5} is bounded on $[t_0,\infty)$. By Lemma \ref{lemma2.2}, system \eqref{2.1} is uniformly exponentially stable. \end{proof} \subsection{Corollaries of the main theorem} Consider several particular cases of \eqref{2.1}. We start with the system where the first term in each vector equation is non-delayed \begin{equation}\label{3.2} \dot{x_i}(t)=A_i(t)x_i(t) +\sum_{j=1}^n \sum_{k=1}^{m_{ij}} B_{ij}^k(t)x_j(h_{ij}^k(t)) +\sum_{j=1}^n \int\limits_{g_{ij}(t)}^t K_{ij}(t,s)x_j(s)ds,~i=1,\dots,n. \end{equation} \begin{corollary}\label{c3.1} Assume that $\mu(A_i(t))\leq \alpha_i<0$, $i=1,\dots,n$ and $L=I-D$ is an $M-$matrix, where $D=(d_{ij})_{i,j=1}^n$ has the entries $$ d_{ij}=\sum_{k=1}^{m_{ij}}\left\|\frac{B_{ij}^k}{\mu(A_i)}\right\|_{[t_0,\infty)}+\left\|\frac{C_{ij}}{\mu(A_i)}\right\|_{[t_0,\infty)},~i,j=1,\dots,n. $$ Then system \eqref{3.2} is uniformly exponentially stable. \end{corollary} Next, consider a system without integral terms and with single delays in the diagonal terms \begin{equation}\label{3.4} \dot{x_i}(t)=A_i(t)x_i(h_i(t)) +\sum_{j\neq i} \sum_{k=1}^{m_{ij}} B_{ij}^k(t)x_j(h_{ij}^k(t)),~i=1,\dots,n. \end{equation} \begin{corollary}\label{c3.2} Assume that $\mu(A_i(t))\leq \alpha_i<0, i=1,\dots,n$, and the matrix $I-D$ is an $M-$matrix, where $D=(d_{ij})_{i,j=1}^n$ are defined as $$ d_{ii} = \displaystyle \tau_i\left\|\frac{A_i}{\mu(A_i)}\right\|_{[t_0,\infty)}\|A_i\|_{[t_0,\infty)}, d_{ij} = \tau_i\left\|\frac{A_i}{\mu(A_i)}\right\|_{[t_0,\infty)}\sum_{k=1}^{m_{ij}} \|B_{ij}^k\|_{[t_0,\infty)} +\sum_{k=1}^{m_{ij}}\left\|\frac{B_{ij}^k}{\mu(A_i)}\right\|_{[t_0,\infty)}, ~j\neq i. $$ Then system \eqref{3.4} is uniformly exponentially stable. \end{corollary} We proceed to the case of two vector equations: \begin{equation}\label{3.5} \begin{array}{l} \displaystyle \dot{x_1}(t)=A_1(t)x_1(h_1(t)) +\sum_{j=1}^2 \sum_{k=1}^{m_{1j}} B_{1j}^k(t)x_j(h_{1j}^k(t))+ \sum_{j=1}^2 \int_{g_{1j}(t)}^t K_{1j} (t,s) x_j(s)ds, \vspace{2mm} \\ \displaystyle \dot{x_2}(t)=A_2(t)x_2(h_2(t)) +\sum_{j=1}^2 \sum_{k=1}^{m_{2j}} B_{2j}^k(t)x_j(h_{2j}^k(t))+ \sum_{j=1}^2 \int_{g_{2j}(t)}^t K_{2j} (t,s) x_j(s)ds. \end{array} \end{equation} \begin{corollary}\label{c3.4} Let $\mu(A_i(t))\leq \alpha_i<0, i=1,2$ and \begin{equation}\label{3.6} d_{11}<1, ~d_{22}<1, ~d_{12}d_{21}<(1-d_{11})(1-d_{22}), \end{equation} where $$ \begin{array}{ll} d_{11}= & \displaystyle \tau_1\left\|\frac{A_1}{\mu(A_1)}\right\|_{[t_0,\infty)}\left(\|A_1\|_{[t_0,\infty)} +\sum_{k=1}^{m_{11}}\left\|B_{11}^k \right\|_{[t_0,\infty)} \!\!\!\!\!\!+\left\|C_{11} \right\|_{[t_0,\infty)}\right) +\sum_{k=1}^{m_{11}}\left\|\frac{B_{11}^k}{\mu(A_1)}\right\|_{[t_0,\infty)} \!\!\!\!\!\! +\left\|\frac{C_{11}}{\mu(A_1)}\right\|_{[t_0,\infty)}, \\ d_{22}= & \displaystyle \tau_2\left\|\frac{A_2}{\mu(A_2)}\right\|_{[t_0,\infty)}\left(\|A_2\|_{[t_0,\infty)} +\sum_{k=1}^{m_{22}}\left\|B_{22}^k \right\|_{[t_0,\infty)} \!\!\!\!\!\!+\left\|C_{22} \right\|_{[t_0,\infty)}\right) +\sum_{k=1}^{m_{22}}\left\|\frac{B_{22}^k}{\mu(A_2)}\right\|_{[t_0,\infty)} \!\!\!\!\!\! +\left\|\frac{C_{22}}{\mu(A_2)}\right\|_{[t_0,\infty)}, \end{array} $$ $$ \begin{array}{ll} d_{12}= & \displaystyle \tau_1\left\|\frac{A_1}{\mu(A_1)}\right\|_{[t_0,\infty)}\left(\sum_{k=1}^{m_{12}}\left\|B_{12}^k \right\|_{[t_0,\infty)} +\left\|C_{12} \right\|_{[t_0,\infty)}\right) + \displaystyle \sum_{k=1}^{m_{12}}\left\|\frac{B_{12}^k}{\mu(A_1)}\right\|_{[t_0,\infty)} +\left\|\frac{C_{12}}{\mu(A_1)}\right\|_{[t_0,\infty)}, \\ d_{21}= & \displaystyle \tau_2\left\|\frac{A_2}{\mu(A_2)}\right\|_{[t_0,\infty)}\left(\sum_{k=1}^{m_{21}}\left\|B_{21}^k \right\|_{[t_0,\infty)} +\left\|C_{21} \right\|_{[t_0,\infty)}\right) +\sum_{k=1}^{m_{21}}\left\|\frac{B_{21}^k}{\mu(A_2)}\right\|_{[t_0,\infty)} +\left\|\frac{C_{21}}{\mu(A_1)}\right\|_{[t_0,\infty)}. \end{array} $$ Then system \eqref{3.5} is uniformly exponentially stable. \end{corollary} For only two delays in each vector equation in \eqref{3.5}, we get \begin{equation}\label{3.7} \begin{array}{lll} \dot{x_1}(t) & = & A_1(t)x_1(h_1(t)) +B_{12}(t)x_2(h_{12}(t)), \\ \dot{x_2}(t) & = & A_2(t)x_2(h_2(t)) +B_{21}(t)x_1(h_{21}(t)). \end{array} \end{equation} \begin{corollary}\label{c3.5} Let $\mu(A_i(t))\leq \alpha_i<0$, $i=1,2$ and there exist constant matrices $\tilde{A_1},\tilde{A_2}$, $\tilde{B}_{12}$, $\tilde{B}_{21}$, such that $|A_i(t)|\leq \tilde{A_i}$, $i=1,2$, $|B_{12}(t)|\leq \tilde{B}_{12}$, $|B_{21}(t)|\leq \tilde{B}_{21}$. If \begin{equation}\label{3.8} \begin{array}{l} \displaystyle \tau_i\|\tilde{A_i}\|^2<|\alpha_i|, i=1,2, \vspace{2mm} \\ \displaystyle \|\tilde{B}_{12}\|\|\tilde{B}_{21}\|(1+\tau_1 \|\tilde{A_1}\|)(1+\tau_2 \|\tilde{A_2}\|) <(|\alpha_1|-\tau_1\|\tilde{A_1}\|^2)(|\alpha_2|-\tau_2\|\tilde{A_2}\|^2) \end{array} \end{equation} then system \eqref{3.7} is uniformly exponentially stable. \end{corollary} \begin{proof} Let us check that conditions of Corollary \ref{c3.4} hold, where $B_{ii} \equiv 0, C_{ij}\equiv 0$. For brevity, we omit the interval index $[t_0,\infty)$ for the norms of matrix functions. We have $$ d_{ii}=\tau_i\left\|\frac{A_i}{\mu(A_i)}\right\|\|A_i\|,~i=1,2,~ $$$$ d_{12}= \tau_1\left\|\frac{A_1}{\mu(A_1)}\right\|\|B_{12}\|+\left\|\frac{B_{12}}{\mu(A_1)}\right\| ,~ d_{21}= \tau_2\left\|\frac{A_2}{\mu(A_2)}\right\|\|B_{21}\|+\left\|\frac{B_{21}}{\mu(A_2)}\right\|. $$ The inequality $|A| \leq B$ implies $\| |A| \| \leq \| B \|$ for any matrix norm. Hence \begin{equation}\label{3.9} d_{ii}\leq \tau_i\frac{\|\tilde{A_i}\|^2}{|\alpha_i|}, i=1,2, \end{equation} \begin{equation}\label{3.10} d_{12}\leq \frac{\|\tilde{B}_{12}\|(1+\tau_1 \|\tilde{A_1}\|)}{|\alpha_1|},~ d_{21}\leq \frac{\|\tilde{B}_{21}\|(1+\tau_2 \|\tilde{A_2}\|)}{|\alpha_2|}. \end{equation} Inequality \eqref{3.9} and the first inequality in \eqref{3.8} imply $d_{ii}<1$, $i=1,2$. By \eqref{3.10}, inequality $d_{12}d_{21}<(1-d_{11})(1-d_{22})$ holds if $$ \frac{\|\tilde{B}_{12}\|\|\tilde{B}_{21}\|(1+\tau_1 \|\tilde{A_1}\|)(1+\tau_2 \|\tilde{A_2}\|)}{|\alpha_1||\alpha_2|}< \left(1-\frac{\tau_1\|\tilde{A_1}\|^2}{|\alpha_1|}\right)\left(1-\frac{\tau_2\|\tilde{A_2}\|^2}{|\alpha_2|}\right), $$ which is equivalent to the second inequality in \eqref{3.8}. Since all the conditions in \eqref{3.6} hold, by Corollary \ref{c3.4} system \eqref{3.7} is uniformly exponentially stable. \end{proof} \begin{remark}\label{remark3.1} Theorem~\ref{theorem3.1} and its corollaries also hold for vector differential equations if the terms $\displaystyle \int\limits_{g_{ij}^k(t)}^t K_{ij} (t,s)x_j(s)ds$ in equation \eqref{2.1} are replaced with $\displaystyle C_{ij} (t) \int\limits_{g_{ij} (t)}^t d_s R_{ij} (t,s)x_j(s)$, where distributed delays are of a more general type, and $\displaystyle \int\limits_{g_{ij}(t)}^t d_s |R_{ij}(t,s)|=I$. \end{remark} \section{Applications to Second Order Vector Delay Differential Equations} \subsection{Linear equations} In this section we consider a second order vector equation \begin{equation}\label{4.1} \ddot{x}(t)+A(t)\dot{x}(t)+B(t)x(h(t))=0,~~ t\geq t_0\geq 0, \end{equation} where for the matrices $A, B$ and the delay $h$ the same conditions hold as $(i), (ii)$ for system \eqref{2.1}. Definitions of solutions of an initial value problem for vector equation \eqref{4.1} and of uniform exponential stability are also similar to the definitions for \eqref{2.1}, and we omit them. \begin{guess}\label{theorem4.1} Assume that for some $t\geq t_0\geq 0$, there exist a constant matrix $\tilde{A}$ and numbers $\alpha<0$, $\tau\geq 0$ such that $t-h(t)\leq \tau$, $\mu(-\tilde{A})<0$, $\mu\left(\tilde{A}-2A(t)\right)\leq \alpha<0$ and \begin{equation}\label{4.0} \frac{1}{|\mu(-\tilde{A})|}\left(\left\|\frac{2\tilde{A}A-\tilde{A}^2-4B}{\mu(\tilde{A}-2A)}\right\|_{[t_0,\infty)} \!\!\!\!\!\! +2\tau \left\|\frac{\tilde{A}B}{\mu(\tilde{A}-2A)}\right\|_{[t_0,\infty)}\right) <1-2\tau\left\|\frac{B}{\mu(\tilde{A}-2A)}\right\|_{[t_0,\infty)} \!\!. \end{equation} Then equation \eqref{4.1} is uniformly exponentially stable. \end{guess} \begin{proof} Equation \eqref{4.1} can be transformed to the form \begin{equation}\label{4.2} \ddot{x}(t)+A(t)\dot{x}(t)+B(t)x(t)-B(t)\int_{h(t)}^t \dot{x}(s)ds=0. \end{equation} After the substitution $$\dot{x}(t)=-\frac{\tilde{A}}{2}x(t)+y(t), ~~\ddot{x}(t)=\frac{\tilde{A}^2}{4}x(t)-\frac{\tilde{A}}{2}y(t)+ \dot{y}(t),$$ equation \eqref{4.2} becomes $$ \frac{\tilde{A}^2}{4}x(t)-\frac{\tilde{A}}{2}y(t)+ \dot{y}(t)+A(t)\left[-\frac{\tilde{A}}{2}x(t)+y(t)\right] +B(t)x(t)-B(t)\int\limits_{h(t)}^t \left(-\frac{\tilde{A}}{2}x(s)+y(s)\right)ds=0. $$ Hence equation \eqref{4.1} is equivalent to the system \begin{equation}\label{4.3} \begin{array}{ll} \dot{x}(t) = & \displaystyle -\frac{\tilde{A}}{2}x(t)+y(t) \vspace{2mm} \\ \dot{y}(t) = & \displaystyle \left(\frac{\tilde{A}}{2}-A(t)\right)y(t)+\left(\frac{\tilde{A}}{2}A(t)-\frac{\tilde{A}^2}{4}-B(t)\right)x(t) \vspace{2mm} \\ & \displaystyle -\frac{\tilde{A}}{2}B(t)\int_{h(t)}^t x(s)ds+B(t)\int_{h(t)}^t y(s)ds=0. \end{array} \end{equation} For system \eqref{4.3}, let us apply Corollary \ref{c3.4}. System \eqref{4.3} has a form of \eqref{3.5}, where $$ x_1=x, ~x_2=y, ~~A_1=-\frac{\tilde{A}}{2}, ~~h_1(t)=t, ~\tau_1=0, ~~m_{11}=0, ~m_{12}=1, $$ $$B_{11}=0, ~B_{12}=1, ~~h_{12}(t)=t, ~~C_{11}=C_{12}=0, $$ $$ A_2=\frac{\tilde{A}}{2}-A(t), ~h_2(t)=t, ~\tau_2=0, ~~m_{21}=1, ~m_{22}=0, ~~B_{21}=\frac{\tilde{A}}{2}A(t)-\frac{\tilde{A}^2}{4}-B(t), $$$$ C_{21}=\frac{\tilde{A}}{2}|B(t)|(t-h(t))\leq \frac{\tilde{A}}{2}|B(t)|\tau,~~ C_{22}=|B(t)|(t-h(t))\leq |B(t)|\tau. $$ We have $$ \mu(A_1)<0,~\mu(A_2)<0,~~ d_{11}=0, ~d_{22}\leq \tau\left\|\frac{B}{\mu(\frac{\tilde{A}}{2}-A)}\right\|_{[t_0,\infty)}, d_{12}=\frac{2}{|\mu(-\tilde{A})|}, $$$$ d_{21}\leq \left\|\frac{\frac{\tilde{A}}{2}A-\frac{\tilde{A}^2}{4}-B}{\mu(\frac{\tilde{A}}{2}-A)}\right\|_{[t_0,\infty)} +\tau \left\|\frac{\frac{\tilde{A}}{2}B}{\mu(\frac{\tilde{A}}{2}-A)}\right\|_{[t_0,\infty)}. $$ Then $d_{12}d_{21} \leq (1-d_{11})(1-d_{22})$ takes the form $$ \frac{2}{|\mu(-\tilde{A})|}\left(\left\|\frac{\frac{\tilde{A}}{2}A-\frac{\tilde{A}^2}{4}-B}{\mu(\frac{\tilde{A}}{2}-A)}\right\|_{[t_0,\infty)} +\tau \left\|\frac{\frac{\tilde{A}}{2}B}{\mu(\frac{\tilde{A}}{2}-A)}\right\|_{[t_0,\infty)}\right) <1-\tau\left\|\frac{B}{\mu(\frac{\tilde{A}}{2}-A)}\right\|_{[t_0,\infty)}, $$ which is equivalent to \eqref{4.0}. Hence all the conditions of Corollary~\ref{c3.4} hold for \eqref{4.3}. Thus, system \eqref{4.3} and therefore equation \eqref{4.2} are uniformly exponentially stable. \end{proof} \begin{remark}\label{remark4.1} If $A_1\leq A(t)\leq A_2$ then anyone of $A_1,A_2$ can be taken as $\tilde{A}$, see examples below. \end{remark} \begin{corollary}\label{c4.0} Let there exist a constant matrix $\tilde{A}$, $\alpha<0$ and $\tau\geq 0$ such that for $t\geq t_0\geq 0$, $t-h(t)\leq \tau$, $\mu(-\tilde{A})<0$, $\displaystyle \mu\left(\tilde{A}-2A(t)\right)\leq \alpha<0$ and \begin{equation}\label{4.a} \|2\tilde{A}A-\tilde{A}^2-4B\|_{[t_0,\infty)} +2\tau\|\tilde{A}B\|_{[t_0,\infty)} <|\mu(-\tilde{A})| \left( |\alpha|-2\tau \|B\|_{[t_0,\infty)} \right). \end{equation} Then equation \eqref{4.1} is uniformly exponentially stable. \end{corollary} Consider now a second order system with constant coefficients \begin{equation}\label{4.4} \ddot{x}(t)+A\dot{x}(t)+Bx(h(t))=0. \end{equation} Choosing $\tilde{A}=A$, $\alpha = \mu(-A)$ in Corollary~\ref{c4.0}, we get a result for \eqref{4.4}. \begin{corollary}\label{c4.1} Let $t-h(t) \leq \tau<\infty$ for $t\geq t_0\geq 0$, $\mu(-A)<0$ and \begin{equation}\label{4.5} \|A^2-4B\|+2\tau \|AB\|<|\mu(-A)|(|\mu(-A)|-2\tau \|B\|). \end{equation} Then equation \eqref{4.4} is uniformly exponentially stable. \end{corollary} Next, taking $h(t)=t$ in Theorem \ref{theorem4.1}, we get a result for a vector ordinary differential equation of the second order. \begin{corollary}\label{c4.2} Let there exist a constant matrix $\tilde{A}$, $\alpha<0$ and $\tau\geq 0$ such that for $t\geq t_0\geq 0$, $\mu(-\tilde{A})<0$, $\displaystyle \mu\left(\tilde{A}-2A(t)\right)\leq \alpha<0$ and \begin{equation}\label{4.5a} \|2\tilde{A}A-\tilde{A}^2-4B\|_{[t_0,\infty)} <|\alpha||\mu(-\tilde{A})|. \end{equation} Then equation \eqref{1.1} is uniformly exponentially stable. \end{corollary} \begin{corollary}\label{c4.3} Assume that $\mu(-A)<0$ and $\|A^2-4B\|<(\mu(-A))^2$. Then equation \eqref{1.1} with constant matrices $A$ and $B$ is uniformly exponentially stable. \end{corollary} \begin{example}\label{example4.1} Consider equation \eqref{4.1}, where $t-h(t)\leq \tau$, $\displaystyle A(t)=\left(\begin{array}{cc} 4&\sin^2 t\\ \cos^2 t&6 \end{array}\right)$, $\displaystyle B(t)=\left(\begin{array}{cc} 4&2\sin^2 t\\ 2\cos^2 t&8 \end{array}\right)$. Choosing $\displaystyle \tilde{A}:=\left(\begin{array}{cc} 4&1\\ 1 &6 \end{array}\right)$, we have $\mu(-\tilde{A})=-3<0$. $\tilde{A}-2A(t)=\left(\begin{array}{cc} -4&1-2\sin^2 t\\ 1-2\cos^2 t &-6 \end{array}\right),~~\mu(\tilde{A}-2A(t))\leq \alpha=-3<0$. Next, $$ 2\tilde{A}A(t)= \left(\begin{array}{cc} 32+2\cos^2 t&12+8\sin^2 t\\ 8+12\cos^2 t &72+2\sin^2 t \end{array}\right),~~ \tilde{A}^2=\left(\begin{array}{cc} 17&10\\ 10&37 \end{array}\right),~~ 4B(t)=\left(\begin{array}{cc} 16&8\sin^2 t\\ 8\cos^2 t &32 \end{array}\right), $$$$ 2\tilde{A}A(t)-\tilde{A}^2-4B(t)= \left(\begin{array}{ll} -1+2\cos^2 t&2\\ -2+4\cos^2 t &3+2\sin^2 t \end{array}\right), ~~\tilde{A}B(t) = \left(\begin{array}{ll} 16+2\cos^2 t&8+8\sin^2 t\\ 4+12\cos^2 t &48+2\sin^2 t \end{array}\right), $$$$ \|2\tilde{A}A(t)-\tilde{A}^2-4B(t)\|_{[0,\infty)}=7,~\|\tilde{A}B\|_{[0,\infty)}=66, \|B\|_{[0,\infty)}=10. $$ For $\alpha =-3$, inequality \eqref{4.a} is $7+132 \tau <3(3-20 \tau)$, which holds if $\tau<\frac{1}{96}$. Thus for $\tau<\frac{1}{96}$ vector equation \eqref{4.1} is uniformly exponentially stable. \end{example} Next, consider equation \eqref{4.1} with a non-zero right-hand side \begin{equation}\label{4.1a} \ddot{x}(t)+A(t)\dot{x}(t)+B(t)x(h(t))=L(t),~~ t\geq t_0\geq 0. \end{equation} The following statement can be justified for a variety of uniformly exponentially stable differential equations with bounded delays, we prove it here for second order vector equations. \begin{uess}\label{lemma4.1} Let equation \eqref{4.1} be uniformly exponentially stable and $L(t)$ have one of the following properties: a) $L(t)$ is bounded, $t \in [t_0,\infty)$; b) $\int_t^{t+1} \|L(s)\|ds$ is bounded, $t \in [t_0,\infty)$; c) $\lim_{t\rightarrow\infty} L(t)=0$; d) $\lim_{t\rightarrow\infty} \int_t^{t+1} \|L(s)\|ds =0$. Then any solution of equation \eqref{4.1a} possesses the same property. \end{uess} \begin{proof} According to \cite[page 3]{BDK}, \cite{AMR}, there are matrix functions $X_1(t), X_2(t), X(t,s)$ such that a solution $x$ of equation \eqref{4.1a} with the initial condition $x(t)=\varphi(t)$, $t \leq t_0$ satisfies $$ x(t)=X_1(t)x(t_0)+X_2(t)\dot{x}(t_0)-\int_{t_0}^{t_0+\tau} X(t,s)B(s)\varphi (h(s))ds+\int_{t_0}^t X(t,s) L(s)ds, $$ where $\varphi (h(s))=0, ~h(s)\geq t_0$. Exponential stability of \eqref{4.1} implies for some $M_i>0$, $\lambda_i>0$, $i=1,2$, $M>0$, $\lambda>0$, $$ \|X_i(t)\|\leq M_i e^{-\lambda_i t}, ~~i=1,2,~~\|X(t,s)\|\leq M e^{-\lambda (t-s)}. $$ Assume that condition b) holds: $\int_t^{t+1} \|L(s)\|ds\leq K$ for $t\geq t_0$. We have $$ \begin{array}{lll} \|x(t)\| & \leq & \displaystyle M_1 e^{-\lambda_1 t} \|x(t_0)\|+ M_2 e^{-\lambda_2 t} \|\dot{x}(t_0)\| +M \|B\|_{[t_0,\infty)}\|\varphi \|_{[t_0-\tau,t_0]}\int\limits_{t_0}^{t_0+\tau} e^{-\lambda (t-s)}ds \\ & & \displaystyle +M\int\limits_{t_0}^t e^{-\lambda (t-s)} \|L(s)\|ds \\ & \leq & \displaystyle M_1\|x(t_0)\|+M_2\|\dot{x}(t_0)\| +\frac{M}{\lambda}\|B\|_{[t_0,\infty)}\|\varphi \|_{[t_0-\tau,t_0]} e^{\lambda (t_0+\tau)} \\ & & \displaystyle +M\int\limits_{t_0}^t e^{-\lambda (t-s)} \|L(s)\|ds. \end{array} $$ Let $t\in [t_0+m, t_0+m+1]$ for some integer $m \geq 0$. Then $$ \begin{array}{ll} \displaystyle \int\limits_{t_0}^t e^{-\lambda (t-s)} \|L(s)\|ds & \leq \displaystyle \sum_{k=0}^m \int\limits_{t_0+k}^{t_0+k+1} e^{-\lambda (t-s)} \|L(s)\|ds \leq \sum_{k=0}^m e^{-\lambda (m-k)} \int\limits_{t_0+k}^{t_0+k+1} \|L(s)\|ds \\ & \displaystyle \leq K\sum_{k=0}^m e^{-\lambda (m-k)} < \frac{K}{1-e^{-\lambda}}, \end{array} $$ where the last expression does not depend on $m$. Hence the solution $x$ of equation \eqref{4.1a} is bounded, and $\int_t^{t+1} \|x(s)\|\, ds$ is bounded. Therefore a) and b) yield that solutions of equation \eqref{4.1a} are bounded. Similarly, c)-d) imply convergence of all solutions to zero. \end{proof} \begin{guess}\label{theorem4.3} Let all the conditions of Theorem \ref{theorem4.1} hold and $L(t)$ have one of the properties a)-d) of Lemma \ref{lemma4.1}. Then any solution of equation \eqref{4.1a} possesses the same property. \end{guess} \subsection{Nonlinear equations} In this section consider a nonlinear equation \begin{equation}\label{4.7} \ddot{x}(t)+A(t,x(t),\dot{x}(t))\dot{x}(t)+B(t,x(t),\dot{x}(t))x(h(t))=L(t),~~ t\geq t_0\geq 0, \end{equation} where the matrices $A(\cdot,u,v)$ and $B(\cdot,u,v)$ belong to ${{\bf L}}_{\infty}^{d\times d } [0,\infty)$ for any pair $(u,v) $ of locally integrable on $[0,\infty)$ vector functions, and $L\in {{\bf L}}_{\infty}^d [0,\infty)$. A solution of an initial value problem for \eqref{4.7} is defined similarly to that of \eqref{4.1}. We assume that a solution exists and is unique. Consider first equation \eqref{4.7} with $L(t)\equiv 0$. \begin{guess}\label{theorem4.2} Let for any $t \geq t_0\geq 0$, $L(t)\equiv 0$, there exist a constant matrix $\tilde{A}$ and $\alpha<0$, $\tau\geq 0$ such that $t-h(t)\leq \tau$, $\mu(-\tilde{A})<0$, and for any pair $(u,v)$ of constant vectors, $\mu(\tilde{A}-2A(t,u,v))\leq \alpha<0$ and \begin{equation} \label{4.8} \begin{array}{ll} & \displaystyle \frac{1}{|\mu(-\tilde{A})|}\left(\left\|\frac{2\tilde{A}A(\cdot,u,v)-\tilde{A}^2-4B(\cdot,u,v)}{\mu(\tilde{A}-2A(\cdot,u,v))}\right\|_{[t_0,\infty)}\right. \vspace{1mm} \\ + & \left. 2\tau \left\|\frac{\tilde{A}B(\cdot,u,v)}{\mu(\tilde{A}-2A(\cdot,u,v))}\right\|_{[t_0,\infty)}\right) <1-2\tau\left\|\frac{B(\cdot,u,v)}{\mu(\tilde{A}-2A(\cdot,u,v))}\right\|_{[t_0,\infty)}. \end{array} \end{equation} Then any solution $x$ of \eqref{4.7} with $L \equiv 0$ tends to zero as $t\rightarrow\infty$, together with its derivative. \end{guess} \begin{proof} Let $x$ be a solution of \eqref{4.7} with $L \equiv 0$. Consider the linear equation with variable coefficients for this fixed $x$: \begin{equation}\label{4.9} \ddot{y}(t)+A(t,x(t),\dot{x}(t))\dot{y}(t)+B(t,x(t),\dot{x}(t))y(h(t))=0, ~~t\geq t_0\geq 0. \end{equation} All conditions of Theorem~\ref{theorem4.1} hold for \eqref{4.9}. Hence this equation is uniformly exponentially stable. Then any solution $y$ of this equation tends to zero, together with its derivative . But the vector-function $x$ is one of these solutions. Therefore any solution $x$ of \eqref{4.7} tends to zero as $t\rightarrow\infty$, together with its derivative. \end{proof} Consider now equation \eqref{4.7} with a non-zero right-hand side $L(t)$. \begin{corollary}\label{c4.4} Let all the conditions of Theorem \ref{theorem4.2} hold and $L(t)$ possess one of Properties a)-d) of Lemma~\ref{lemma4.1}. Then any solution of equation \eqref{4.7} has the same property. \end{corollary} \begin{proof} For any solution $x$ of \eqref{4.7}, consider the linear equation \begin{equation}\label{4.10} \ddot{y}(t)+A(t,x(t),\dot{x}(t))\dot{y}(t)+B(t,x(t),\dot{x}(t))y(h(t))=L(t),~~ t\geq t_0\geq 0. \end{equation} Assume that $L(t)$ satisfies one of a)-d). Since equation \eqref{4.10} with $L \equiv 0$ is exponentially stable, by Lemma~\ref{lemma4.1} all solutions of \eqref{4.10}, as well as the solution $x$ of \eqref{4.7}, possess this property. \end{proof} \begin{corollary}\label{c4.5} Let there exist a constant matrix $\tilde{A}$, $\alpha<0$ and $\tau\geq 0$ such that $ \mu(-\tilde{A})<0$, $t-h(t)\leq \tau$ for $t\geq t_0\geq 0$, and for any pair $(u,v)$ of constant vectors, $\mu\left(\tilde{A}-2A(t,u,v)\right)\leq \alpha<0$ and \begin{equation}\label{4.11} \begin{array}{ll} & \displaystyle \|2\tilde{A}A(\cdot,u,v)-\tilde{A}^2-4B(\cdot,u,v)\|_{[t_0,\infty)} +2\tau\|\tilde{A}B(\cdot,u,v)\|_{[t_0,\infty)} \\ < & \displaystyle |\mu(-\tilde{A})|(|\alpha|-2\tau \|B(\cdot,u,v)\|_{[t_0,\infty)}). \end{array} \end{equation} Then any solution $x$ of \eqref{4.7} with $L \equiv 0$ tend to zero as $t\rightarrow\infty$, together with its derivative. \end{corollary} \begin{example}\label{example4.2} Consider equation \eqref{4.7}, where $L(t)\equiv 0$, $t-h(t)\leq \tau$, $x=(x_1,x_2)$, $$ A(t)=\left(\begin{array}{cc} 4&\sin^2 (tx_1(t))\\ \cos^2 (tx_2(t))&6 \end{array}\right),~~ B(t)=\left(\begin{array}{cc} 4&2\sin^2 (tx_1(t))\\ 2\cos^2 (tx_2(t))&8 \end{array}\right). $$ Exactly the same calculations as in Example \ref{example4.1} and condition \eqref{4.11} imply that for $\tau<\frac{1}{96}$, any solution of \eqref{4.7} tends to zero as $t\rightarrow\infty$, together with its derivative. \end{example} \section{Discussion and Topics for Further Research} We investigated uniform exponential stability for systems of linear vector functional differential equations, as well as asymptotic stability of linear and certain nonlinear vector equations of the second order. System \eqref{2.1} has many applications to real-word models but, to the best of our knowledge, very little is known about its exponential stability. One of most common applications is to second order vector delay differential equations, which is considered in the paper for equations with one delay. However, since the general theory is developed for a more general model, the results are easily extended to equations with several bounded delays \begin{equation}\label{5.1} \ddot{x}(t)+A(t)\dot{x}(t)+\sum_{k=1}^m B_k(t)x(h_k(t))=0,~~ t\geq t_0\geq 0, \end{equation} and with a bounded distributed delay \begin{equation}\label{5.2} \ddot{x}(t)+A(t)\dot{x}(t)+\int_{h(t)}^t B(t,s)x(s)ds=0,~~ t\geq t_0\geq 0. \end{equation} Corollary \ref{c4.2} gives a new simple and general stability test for linear ordinary differential vector equations of the second order, compared to the papers \cite{Harris, Gil_a, Rugh, Sun, Zevin} where only matrices of a specific form were considered. For example, in the recent paper \cite{Gil_a} the following stability test was obtained. Denote $\displaystyle A_R=\frac{A+A^*}{2},~A_I=\frac{A-A^*}{2i}$\,. \begin{proposition}\label{p5.0} Let there exist $m_A>0$ such that $$ A_R(t)\geq 2m_A I, ~T_R(t)\geq m_A I, ~\|T_R\|_{[0,\infty)}+\|T_I\|_{[0,\infty)}\leq 2 m_A^2, $$ where $T(t)=m_A A(t)-B(t)$ and inequality $A\geq B$ means that $A-B$ is a positive definite matrix (all eigenvalues are non-negative). Then equation \eqref{1.1} is exponentially stable. \end{proposition} Actually it is not easy to check that all eigenvalues of time-variable matrix $T(t)$ are non-negative. For a nonlinear delay vector equation of the second order \begin{equation}\label{5.4} \ddot{X}(t)+F(X(t),\dot{X}(t))\dot{X}(t)+H(X(t-\tau))=0, \end{equation} where the matrix-function $F(u,v)$ and vector-function $H(u)$ are continuous, an interesting explicit stability test was obtained in \cite{Tunc1}. \begin{proposition}\cite{Tunc1}\label{p5.1} Let there exist positive numbers $a_0,a_1,a_2$ such that \\ 1) the matrix $F(u,v)$ is symmetric, and the eigenvalues of this matrix $\lambda_i(F(u,v)) \geq a_1$ for all pairs $(u,v)\in {\mathbb R}^d\times {\mathbb R}^d$ . \\ 2) $H(0)=0$, $H(X)\neq 0$, $X\neq 0$, the Jacobian $J_H(X)$ is symmetric and $a_2 \leq \lambda_i(J_H(X))\leq a_0$. If $\tau<\frac{a_1}{a_0\sqrt{d}}$ then the trivial solution of \eqref{5.4} is asymptotically stable. \end{proposition} Compare now Proposition~\ref{p5.1} of \cite{Tunc1} and the test in Theorem \ref{theorem4.2}. The stability result of Proposition \ref{p5.1} applies only to autonomous equations, with continuous functions $G,H$ and constant delay $\tau$. Our result works for non-autonomous equations, with measurable coefficients and a variable delay. We also apply different stability methods: in \cite{Tunc1} the method of Krasovskii-Lyapunov functionals was applied, in this paper the stability results are based on Bohl-Perron theorem. The linear equation \begin{equation}\label{5.5} \ddot{X}(t)+A\dot{X}(t)+Bx(t-\tau)=0, \end{equation} where $A,B$ are constant matrices, is a partial case of equation \eqref{5.4}. Let us compare for \eqref{5.5} the results of Corollary~\ref{c4.1} and Proposition~\ref{p5.1}. For the scalar case ($d=1$) Proposition~\ref{p5.1} leads to $B>0$, $A>0$, $B\tau<A$, while Corollary \ref{c4.1} reduces to $B>0, A>0, |A^2-4B|<A^2-4AB\tau$. In the scalar case (and presumably also for small $d$), Proposition~\ref{p5.1} is better than Corollary~\ref{c4.1}. But for large $d$, Corollary~\ref{c4.1} could be better than Proposition \ref{p5.1}. Assume, for example, that in \eqref{5.5} $A=aI, B=bI, a>0, b>0$. Then the condition of Proposition \ref{p5.1} becomes $ b\tau<\frac{a}{\sqrt{d}}$, where $\tau \rightarrow 0$ for fixed $a,b$ and $ d \rightarrow\infty$. Proposition \ref{p5.1} gives the same condition as for the scalar case: $|a^2-4b|<a^2-4ab\tau$ and does not depend on $d$. Consider for comparison $A=aI$, $B= \frac{1}{4}a^2 I$, where $a>0$. Then Proposition \ref{p5.1} implies asymptotic stability for $\tau<\frac{4}{a\sqrt{d}}$ compared to $\tau<\frac{1}{a}$ in Corollary~\ref{c4.1}. Thus Corollary~\ref{c4.1} gives a sharper result for $d>16$. Together with stability results obtained here, the aim of the paper was also to attract attention to the new class of systems of functional differential equations. It is not yet clear how to obtain exponential stability tests for equations with unbounded delays, for example, pantograph-type with $h(t)=\lambda t$, and for equations with delays in the derivative terms such as \begin{equation}\label{5.3} \ddot{x}(t)+A(t)\dot{x}(g(t))+B(t)x(h(t))=0. \end{equation} Further, let us discuss other possible problems for future research. An interesting extension of \eqref{2.1} is a nonlinear system $$ \dot{x_i}(t)=A_i(t)x_i(h_i(t)) +\sum_{j=1}^n \sum_{k=1}^{m_{ij}} H_{ij}(t,x_j(h_{ij}^k(t))) + \sum_{j=1}^n F_{ij} \left( t,\int\limits_{g_{ij}(t)}^t K_{ij}(t,s)x_j(s)ds\right),~i=1,\dots,n. $$ Results for this system can be applied to a nonlinear vector delay equation of the second order $$ \ddot{x}(t)+F(t,\dot{x}(t))+H(t,x(h(t))=0. $$ Also, there are no results on asymptotic behavior of solutions to neutral systems of vector differential equations $$ \dot{x_i}(t)-Q_i(t)\dot{x}_i(g_i(t))=A_i(t)x_i(h_i(t)) +\sum_{j=1}^n \sum_{k=1}^{m_{ij}} B_{ij}^k(t)x_j(h_{ij}^k(t)) + \sum_{j=1}^n\int\limits_{g_{ij}(t)}^t K_{ij}(t,s)x_j(s)ds, $$ $i=1,\dots,n$ and neutral vector equations of the second order $$ \ddot{x}(t)+A\dot{x}(g(t))+Bx(h(t))=C\ddot{x}(p(t)). $$ It would be interesting to study stability for systems of second order equations even in the scalar case, such as $$ \ddot{x}(t)+A_1\dot{x}(g_1(t))+B_1y(h_1(t))=0, $$$$ \ddot{y}(t)+A_2\dot{y}(g_2(t))+B_2x(h_2(t))=0 $$ and $$ \ddot{x}(t)+A_1\dot{x}(g_1(t))+B_1x(h_1(t))=C_1y(p_1(t)), $$$$ \ddot{y}(t)+A_2\dot{y}(g_2(t))+B_2y(h_2(t))=C_2x(p_2(t)). $$
\section{Introduction} \label{sec:intro} In relativistic heavy ion collisions, high transverse momentum (\pt) jets originate from partons that have undergone a hard scattering and may be used to probe the properties of the quark-gluon plasma (QGP) created in such collisions~\cite{heavyIonReview}. One phenomenon related to the properties of the QGP is parton energy loss~\cite{BjorkenQGP}, also known as jet quenching, which was first observed at the BNL RHIC~\cite{Adams:2006yt, Adare:2007vu} and subsequently at the CERN LHC~\cite{Aad:2010bu, Chatrchyan:2011sx, centralityDetermination, Adam:2015ewa}. Jet quenching is seen as a suppression of high-\pt leading charged-particle and jet yields in heavy ion collisions relative to a proton-proton (\ensuremath{\Pp\Pp}\xspace) reference~\cite{qgpBrahms, qgpPhobos, qgpStar, qgpPhenix}. Using data collected at the LHC, studies have shown that the jet structure is also modified by the medium, as observed with measurements of the fragmentation functions~\cite{CMS:2012vba, Aad:2014wha}, and by the distribution of charged-particle \pt as a function of the radial distance from the jet axis~\cite{Chatrchyan:2013kwa}. These modifications are found to extend to large distances in relative pseudorapidity ($\Delta\eta$) and relative azimuth ($\Delta\varphi$) with respect to the jet axis~\cite{mpt, Khachatryan:2016erx, lowerEnergyDijet, inclusiveJetShape}. Various theoretical models have attempted to account for these modifications~\cite{Apolinario:2012cg, Ayala:2015jaa, Blaizot:2014ula, Escobedo:2016jbm, Casalderrey-Solana:2016jvj, Tachibana:2017syd} and while most models reproduce the modifications close to the jet axis, the large modifications observed far from the jet axis $\Delta r = \sqrt{\smash[b]{(\Delta\varphi)^{2} + (\Delta\eta)^{2}}} > 0.5$ are not yet well modeled. The analysis presented in this paper uses LHC data collected by the CMS experiment at a collision energy of $\sqrtsNN = 5.02\TeV$ in 2017 and 2018, corresponding to integrated luminosities of 320\pbinv for \ensuremath{\Pp\Pp}\xspace and 1.7\nbinv for lead-lead (PbPb) collisions, respectively. Events are selected with nearly back-to-back ($\Delta\varphi > 5 \pi / 6$), high-\pt leading and subleading jet pairs. Correlations in relative pseudorapidity are measured for charged particles with respect to both the leading and subleading jet axes, where the relative azimuthal angle between the jet axes and charged particles is restricted to $\abs{\Delta\varphi} < 1.0$. The ``jet shape," which is the distribution of charged-particle transverse momentum (\ptSuper{ch}) as a function of the distance from the jet axis $\Delta r$, is also studied. Results are presented differentially as functions of PbPb collision centrality (\ie, the degree of overlap of the colliding nuclei, with head-on collisions defined as ``most central")~\cite{centralityDetermination}, \ptSuper{ch}, and dijet momentum balance $\ensuremath{x_{j}}\xspace = \ptText{subleading} / \ptText{leading}$. Compared to previous jet shape analyses in Refs.~\cite{lowerEnergyDijet, inclusiveJetShape}, the large PbPb data sample recorded in 2018 allows for differentiation in \ensuremath{x_{j}}\xspace for leading and subleading jet shapes extended to large distances from the jet axis. \section{The CMS experiment} \label{sec:cms} The central feature of the CMS apparatus is a superconducting solenoid of 6\unit{m} internal diameter, providing a magnetic field of 3.8\unit{T}. Within the solenoid volume are a silicon pixel and strip tracker, a lead tungstate crystal electromagnetic calorimeter (ECAL), and a brass and scintillator hadron calorimeter (HCAL), each composed of barrel and two endcap sections. Two hadronic forward (HF) steel and quartz-fiber calorimeters complement the barrel and endcap detectors, extending the calorimeter from the range $\abs{\eta} < 3.0$ provided by the barrel and endcap out to $\abs{\eta} < 5.2$. The HF calorimeters are segmented to form $0.175{\times}0.175$ ($\Delta\eta{\times}\Delta\varphi$) towers. The sum of the transverse energies detected in the HF detectors $(3.0 < \abs{\eta} < 5.2)$ is used to define the event centrality in PbPb events and to divide the event sample into centrality classes, each representing a percentage of the total nucleus-nucleus hadronic interaction cross section. A detailed description of the centrality determination can be found in Ref.~\cite{centralityDetermination}. Jets used in this analysis are reconstructed within the range $\abs{\eta} < 1.6$. In the region $\abs{\eta} < 1.74$, the HCAL cells have widths of 0.087 in both $\eta$ and $\varphi$ and thus provide high granularity. Within the central barrel region of $\abs{\eta} < 1.48$, the HCAL cells map onto $5{\times}5$ ECAL crystal arrays to form calorimeter towers projecting radially outwards from the nominal interaction point. Within each tower, the energy deposits in ECAL and HCAL cells are summed to define the calorimeter tower energy. The CMS silicon tracker measures charged-particle tracks within $\abs{\eta} < 2.5$. It consists of 1856 silicon pixel and $15\,148$ silicon strip detector modules. Muons are measured in the pseudorapidity range $\abs{\eta} < 2.4$, with detection planes made using three technologies: drift tubes, cathode strip chambers, and resistive plate chambers. Events of interest are selected using a two-tiered trigger system. The first level (L1), composed of custom hardware processors, uses information from the calorimeters and muon detectors to select events at a rate of around 100\unit{kHz}~\cite{Sirunyan:2020zal}. The second level, known as the high-level trigger (HLT), consists of a farm of processors running a version of the full event reconstruction software optimized for fast processing, and reduces the event rate to around 1\unit{kHz} before data storage~\cite{Khachatryan:2016bia}. A detailed description of the CMS detector, together with a definition of the coordinate system used and the relevant kinematic variables, can be found in Ref.~\cite{CMSexperiment}. \section{Event selection} \label{sec:eventSelection} The \ensuremath{\Pp\Pp}\xspace and PbPb data are selected with a calorimeter-based HLT trigger that uses the anti-\kt jet clustering algorithm with a distance parameter of $R = 0.4$~\cite{antiKt}. The trigger requires events to contain at least one jet with $\pt > 80$ and $> 100\GeV$ for \ensuremath{\Pp\Pp}\xspace and PbPb collisions, respectively. For PbPb collisions, the underlying event contribution is subtracted from the jet \pt using an iterative method~\cite{puSubtraction} before comparing to the threshold. The data sample selected by this trigger is referred to as ``jet-triggered." For the PbPb event selection, a minimum bias triggered~\cite{Chatrchyan:2011pb} sample is also used in the analysis. To reduce contamination from noncollision events, including calorimeter noise and beam-gas collisions, vertex and noise filters are applied offline to both the \ensuremath{\Pp\Pp}\xspace and PbPb data, following previous analyses of lower-energy data~\cite{Chatrchyan:2011sx, centralityDetermination}. These filters include requirements that at least three HF towers on either side of the interaction point have a tower energy above 3\GeV and that the vertex position along the beam line lies within 15\unit{cm} of the nominal interaction point. The average pileup (the number of collisions per beam bunch crossing) is about 2 in \ensuremath{\Pp\Pp}\xspace, and close to 1 in PbPb collisions. Because of the low pileup in the data samples, no pileup corrections are necessary. Monte Carlo simulated event samples are used to evaluate the performance of the event reconstruction, particularly the track reconstruction efficiency, and the jet energy response and resolution. The hard scattering, parton shower, and fragmentation of the partons are modeled using the \PYTHIA~8 event generator with tune CP5~\cite{pythia82, pythiaCP5tune}. The specific \PYTHIA version used is 8.226 and the parton distribution function set is NNPDF3.1 at next-to-next-to-leading order~\cite{nnpdf31}. The CMS detector response is simulated using the \GEANTfour toolkit~\cite{geant4}. The soft underlying event for the PbPb collisions is simulated by the \HYDJET 1.9 event generator~\cite{hydjet}. The energy density in the \HYDJET simulation is tuned to match the data by shifting the centrality binning in standard \HYDJET simulation by 5 percentage points upwards. This tuning is based on a random cone study, where rigid cones with a radius 0.4 are placed in random directions in events, and the energy densities in the cones are determined by summing the particle transverse momenta within the cone. The above tuning provides the best agreement in random cone energy densities between data and \HYDJET. To simulate jet events in PbPb collisions, \PYTHIA~8 generated hard events are embedded into soft \HYDJET events. This sample is denoted as {\PYTHIA}+\HYDJET. In PbPb collisions, jets are produced more frequently in central events than in noncentral events because of the large number of binary collisions per nuclear interaction. A centrality-based reweighting is applied to the {\PYTHIA}+\HYDJET sample in order to match the centrality distribution of the jet-triggered PbPb data. An additional reweighting procedure is performed to match the simulated vertex distributions to data for both the \ensuremath{\Pp\Pp}\xspace and PbPb samples. The event selection works as follows. First, the two jets with highest \pt are located in the range of $\abs{\eta} < 2$. The highest \pt jet is called the leading jet and it is required to pass a \pt cut of $p_{\mathrm{T},1} > 120\GeV$. The second highest \pt jet is termed the subleading jet and for it a cut $p_{\mathrm{T},2} > 50\GeV$ is applied. Then, the back-to-back requirement, a condition demanding that the jet separation in $\varphi$ obeys $\Delta\varphi_{1,2} > 5 \pi / 6$ is enforced. Finally, both jets are required to fall within $\abs{\eta} < 1.6$ to ensure the most stable jet reconstruction performance and to allow for good tracker acceptance on both sides of the jets. There is no veto for additional jets in the event. The events containing such pairs of back-to-back jets are referred as dijet events for the remainder of the paper. \section{Jet and track reconstruction} \label{sec:jetTrackReconstruction} For this analysis, jets in both \ensuremath{\Pp\Pp}\xspace and PbPb collisions are reconstructed using the anti-\kt algorithm with a distance parameter $R = 0.4$, as implemented in the \textsc{FastJet} framework~\cite{fastJet}. A particle flow (PF) algorithm using an optimized combination of information from various elements of the CMS detector is used to reconstruct leptons, photons, and charged and neutral hadrons~\cite{particleFlow}. These PF candidates are employed to reconstruct the jets used in this analysis. The jets are first clustered using E-scheme clustering~\cite{fastJet} and the jet axis is recalculated with the winner-take-all algorithm~\cite{wta1, wta2} using anti-\kt and the same constituents. In the E-scheme clustering, particle pairs are iteratively combined to form pseudo-jets (an object that is a combination of particles or other pseudo-jets), with the direction of the new pseudo-jet given by the sum of the four-momenta of the particles. In the winner-take-all scheme, the direction of the new pseudo-jet in each iteration is aligned with the direction of the particle or pseudo-jet with higher \pt. It follows that the E-scheme axis for the final jet is given by the sum of pseudo-jet four-momenta, while the winner-take-all axis is determined by the axis of the hardest pseudo-jet. The winner-take-all axis is preferred in this analysis over the default E-scheme axis because of an artificial feature created by the E-scheme axis that results in a strong depletion of particles just outside of the jet cone radius. Not having to correct for this feature leads to smaller uncertainties. In order to subtract the soft underlying event contribution to the jet energy in PbPb collisions, a constituent subtraction method~\cite{constituentSubtraction} is employed. This involves a particle-by-particle approach that corrects jet constituents based on the local average underlying event density. The energy density is estimated using an event-by-event, iterative algorithm~\cite{puSubtraction} that finds the mean value, $\langle E_{\mathrm{PF}}\rangle$, and dispersion, $\sigma(E_{\mathrm{PF}})$, of the energies from the PF candidates in $\eta$ strips~\cite{Chatrchyan:2011sx,centralityDetermination}. In \ensuremath{\Pp\Pp}\xspace collisions, where the underlying event level is negligible, jets are reconstructed without underlying event subtraction. The track reconstruction used in \ensuremath{\Pp\Pp}\xspace and PbPb collisions is described in Ref.~\cite{trackResolution}. For the charged-particle tracks used in jet to charged-particle correlations, it is required that the relative \pt uncertainty of each track is less than 10\%. In PbPb collisions, tracks must also have at least 11 hits in the tracker layers and satisfy a stringent fit quality requirement, specifically that the $\chi^{2}$, divided by the product of the number of fit degrees of freedom and the number of tracker layers hit, be less than 0.18. Furthermore, it is required that the significance of the distance of closest approach of a charged-particle track to at least one primary vertex in the event is less than 3 standard deviations. This is done to decrease the likelihood of counting nonprimary charged particles originating from secondary decay products, and is applied for both \ensuremath{\Pp\Pp}\xspace and PbPb collisions. Finally, for PbPb collisions a selection based on the relationship of a track to the calorimeter energy deposits along its trajectory is applied in order to reduce the contribution of misreconstructed tracks with very high \pt. Tracks with $\pt > 20\GeV$ are required to have an associated energy deposit of at least half of their momentum in the CMS calorimeters. Corrections for tracking efficiency, detector acceptance, and misreconstruction rate are obtained and applied following the procedure of Ref.~\cite{Khachatryan:2016odn}. \section{Jet to charged-particle angular correlations} \label{sec:analysisMethods} \linespread{1.01} \selectfont Correlations between reconstructed jets and charged-particle tracks are studied by forming a two-dimensional distribution of $\Delta\eta$ and $\Delta\varphi$ of the charged particles relative to the jet axis. Events in PbPb collisions are divided into four centrality intervals, 0--10, 10--30, 30--50, and 50--90\%, based on the total energy collected in the HF calorimeter~\cite{centralityDetermination}. The events are also binned by the charged-particle \pt with bin boundaries of 0.7, 1, 2, 3, 4, 8, 12, and 300\GeV and in the dijet momentum balance \ensuremath{x_{j}}\xspace with bin boundaries of 0, 0.6, 0.8, and 1. The effects of jet energy resolution to the \ensuremath{x_{j}}\xspace binning are explored in Appendix~\ref{app:Matrices}. The two-dimensional correlation histograms are filled by correlating all charged particles in the event with the leading jet and the subleading jet, separately. For the jet shape measurement, each entry is weighted by the charged particle \pt value. The histograms are then normalized by the number of dijets. The numbers of dijets in the data samples for each \ensuremath{x_{j}}\xspace and centrality bin are summarized in Table~\ref{tab:xjbinning}. \begin{table} \centering{ \topcaption{The total number of events for \ensuremath{\Pp\Pp}\xspace and for different PbPb centrality bins are shown in the top row. The other rows show the percentage of all events that falls within a given \ensuremath{x_{j}}\xspace bin.} \label{tab:xjbinning} \begin{tabular}{cccccc} \ensuremath{x_{j}}\xspace & 0--10\% & 10--30\% & 30--50\% & 50--90\% & \ensuremath{\Pp\Pp}\xspace \\ \hline $0 < \ensuremath{x_{j}}\xspace < 1$ & $5.8 \times 10^{5} $ & $6.6 \times 10^{5}$ & $2.6 \times 10^{5}$ & $0.78 \times 10^{5}$ & $110 \times 10^{5}$ \\[\cmsTabSkip] $0 < \ensuremath{x_{j}}\xspace < 0.6$ & 40\% & 35\% & 29\% & 26\% & 24\% \\ $0.6 < \ensuremath{x_{j}}\xspace < 0.8$ & 33\% & 34\% & 36\% & 35\% & 36\% \\ $0.8 < \ensuremath{x_{j}}\xspace < 1$ & 27\% & 31\% & 35\% & 39\% & 40\% \\ \end{tabular} } \end{table} Since the detector has limited acceptance in $\eta$, it is more probable to find jet-charged-particle pairs with small rather than large $\Delta\eta$ values. Thus, the raw correlations have a shape where the charged-particle yield strongly decreases toward large $\Delta\eta$. A mixed-event method is employed to correct for these detector acceptance effects. In this method, the jet and charged particles from different events are mixed to ensure that no physical correlations exist in the resulting distribution. What is left is the structure arising from the detector acceptance. When the mixed events are constructed, it is required that the primary vertex positions along the beam axis match within 0.5\unit{cm} and that the centrality values match within 0.5 percentage points between the two events. For \ensuremath{\Pp\Pp}\xspace collisions, a jet-triggered sample is used for the mixed events, while for PbPb collisions a minimum bias sample is used to properly capture the long range correlations. This procedure is similar to that used in previous analyses~\cite{lowerEnergyDijet, inclusiveJetShape}. Denoting the number of dijets satisfying the selection criteria as \NText{dijet}, the per-dijet associated charged-particle yield corrected for the acceptance effects is given by \begin{linenomath} \begin{equation} \frac{1}{\NText{dijet}} \frac{\rd^{2}N}{\rd\Delta\eta\rd\Delta\varphi} = \frac{ME(0,0)}{ME(\Delta\eta,\Delta\varphi)} S(\Delta\eta,\Delta\varphi), \label{eq:acceptanceCorrection} \end{equation} \end{linenomath} where $N$ is the number of jet-particle pairs, the signal pair distribution $S(\Delta\eta,\Delta\varphi)$ represents the per-dijet normalized yield of jet-particle pairs from the same event, \begin{linenomath} \begin{equation} S(\Delta\eta,\Delta\varphi) = \frac{1}{\NText{dijet}} \frac{\rd^{2}N^{\text{same}}}{\rd\Delta\eta\rd\Delta\varphi}, \label{eq:sameEvent} \end{equation} \end{linenomath} and the mixed-event pair distribution $ME(\Delta\eta,\Delta\varphi)$ is given by \begin{linenomath} \begin{equation} ME(\Delta\eta,\Delta\varphi) = \frac{\rd^{2}N^{\text{mixed}}}{\rd\Delta\eta\rd\Delta\varphi}. \label{eq:mixedEvent} \end{equation} \end{linenomath} The ratio $ME(0,0) / ME(\Delta\eta,\Delta\varphi)$ is the normalized correction factor. The maximum of the mixed event distribution can be found at $(0,0)$ as no pairs with $\Delta\eta = 0$ are lost as a consequence of acceptance effects. The acceptance-corrected distribution has contributions from several sources. The jet correlation shows up as a Gaussian peak around $(\Delta\eta,\Delta\varphi) = (0,0)$ together with a peak elongated in $\Delta\eta$ around $\Delta\varphi = \pi$. While the underlying event contribution to jet energy and momentum is corrected for as previously discussed in Section~\ref{sec:jetTrackReconstruction}, the underlying event particles paired with the jet remain within the acceptance-corrected distribution, and thus have to be removed. To model this background, the $\Delta\varphi$ distribution is averaged over the region $1.5 < \abs{\Delta\eta} < 2.5$ on the near side ( $\abs{\Delta\varphi} < \pi/2$) of the jet. The same background region criteria are used for correlations of charged particles with both leading and subleading jets and the backgrounds are combined to cover the full $\Delta\varphi$ range. This procedure is applied to avoid an ``eta swing" effect. Momentum conservation dictates that in a statistical ensemble of dijets, the two jets must be approximately back-to-back in $\Delta\varphi$, but no such requirement exists for the $\Delta\eta$ separation. Thus, the away side $(\abs{\Delta\varphi} > \pi/2 )$ jet peak is prolonged in $\Delta\eta$ in jet to charged-particle correlation distributions. To avoid mixing the jet signal with the background, the away side region needs to be avoided in the background estimation. The background determined using the respective near-side components is propagated to the full $(\Delta\eta,\Delta\varphi)$ plane and subtracted from the acceptance-corrected distribution to obtain the jet signal. Finally, simulation-based corrections are applied to account for a bias toward selecting jets with a harder constituent \pt spectrum (affecting PbPb and \ensuremath{\Pp\Pp}\xspace events similarly) and a bias toward selecting jets that are affected by upward fluctuations in the soft underlying event yield (relevant for PbPb events only). Jets with a harder constituent \pt spectrum are more likely to be successfully reconstructed than jets with a softer \pt spectrum because the calorimeter response does not scale linearly with the incident particle energy, resulting in a bias toward the selection of jets with fewer associated particles. A residual correction for this bias is derived and applied following the method described in Refs.~\cite{mpt, Khachatryan:2016erx, lowerEnergyDijet}, by comparing per-jet yields of generated particles correlated to reconstructed jets relative to those correlated to generated jets. This correction is derived using a \PYTHIA~8 simulation for \ensuremath{\Pp\Pp}\xspace events and considering only generated particles coming from the embedded \PYTHIA hard process in {\PYTHIA}+\HYDJET simulation for PbPb events. For PbPb events, there is an additional jet reconstruction bias toward the selection of jets that are produced in the vicinity of upward fluctuations in the underlying event background. The underlying event fluctuations together with a steeply falling jet \pt spectrum produce a resolution effect on the jet energy scale. This causes more jets associated with upward fluctuations than with downward fluctuations of the underlying event to pass the analysis threshold. To account for this bias, a similar procedure to that outlined in Refs.~\cite{Khachatryan:2016erx, lowerEnergyDijet, Chatrchyan:2012gw} is followed. Correlations in the {\PYTHIA}+\HYDJET sample between reconstructed jets and generated particles are constructed using only particles from the \HYDJET underlying event, excluding those from the embedded hard process. This gives an estimate of the underlying event yield on top of which the jet correlations are found in the data. To reduce the fluctuations in the generated sample, the obtained distribution is symmetrized in $\Delta\eta$ and $\Delta\varphi$, before being applied as a correction to the PbPb data. \linespread{1.00} \selectfont \section{Systematic uncertainties} \label{sec:systematics} The following sources of uncertainty are considered in this analysis: \begin{itemize} \item \emph{Underlying event fluctuation bias}. This source accounts for uncertainties in correcting for the jet reconstruction bias resulting from upwards fluctuations of the underlying event background. Three different causes are considered. The first is a potential difference between the quark and gluon jet fraction in simulation and in data. The potential difference is estimated to be less than 25\% using a template fit to the multiplicity distribution of PF candidates within the jet cone in the data. Then the uncertainty is estimated by varying the quark/gluon jet fraction in simulation by this amount. The second source considers the difference in the underlying event energy density between simulation and data, and is estimated by random cone studies. The uncertainty is determined by varying the centrality binning of the \HYDJET simulation by 1 percentage point around the best match to data, which is the range giving a reasonable agreement. Finally, there is the uncertainty in the underlying event level for the simulation from which the underlying event fluctuation bias correction is derived. This uncertainty is obtained in a similar manner as for data, as discussed below in the ``underlying event subtraction" bullet point. \item \emph{Jet fragmentation bias}. Most of the detector and resolution effects contributing to the jet fragmentation bias uncertainty arise from the uncertainty in the ratios of quark and gluon jets between data and simulation, as discussed for the underlying event fluctuation bias above. Deriving the corrections separately for quark and gluon jets and varying their relative contribution within the estimated difference between data and Monte Carlo, a 10\% variation in the fragmentation bias correction is observed. This difference is assigned as a systematic uncertainty. \item \emph{Jet energy scale}. These uncertainties are estimated by varying the jet energy corrections within their uncertainties and seeing how these changes affect the final correlations. The uncertainties of the jet energy corrections are discussed in detail in Ref.~\cite{jetEnergyScale}. \item \emph{Jet energy resolution}. This uncertainty is estimated by adding a Gaussian spread to the nominal jet energies such that the jet energy resolution estimated from the simulation is worsened by 20\% and comparing the obtained results to the nominal ones. The value of 20\% comes from the maximal estimated difference in the jet energy resolution between data and simulation. \item T\emph{rigger bias}. The calorimeter-based trigger with a threshold of 100\GeV is not fully efficient for the PbPb collisions. To see if this has an effect on the final results, the analysis was repeated requiring a prescaled trigger with a threshold of 80\GeV and the results with this trigger were compared to the nominal ones. For the leading jet shapes, it was found that there is a 2\% yield difference in the bin closest to the jet axis, while for the other bins and for the subleading jets the difference is negligible. The 2\% difference is therefore applied as a systematic uncertainty on the first bin. The trigger used for the \ensuremath{\Pp\Pp}\xspace collisions is fully efficient and thus has no trigger bias uncertainty. \item \emph{Tracking efficiency}. Two sources of uncertainty are considered. First, there are possible track reconstruction differences in data and simulation. Following the method in Ref.~\cite{Khachatryan:2016odn}, it is estimated that the uncertainty in the track reconstruction efficiency and misidentification rate corrections is 5\% for PbPb and 2.4\% for \ensuremath{\Pp\Pp}\xspace collisions. Second, the ratio of corrected reconstructed yields to generator level yields is studied for \PYTHIA~8 and {\PYTHIA}+\HYDJET simulations. It is found that the reconstructed and generated yields match within 3\% in PbPb and 1\% in \ensuremath{\Pp\Pp}\xspace collisions, and these numbers are used as a systematic uncertainty from this source. An extra uncertainty is added to tracks close to the jet axis, as in the high multiplicity environment around the jet, the tracking efficiency is found to be 1--2\% worse than far away from the jets. \item \emph{Acceptance correction}. In an ideal case, the mixed-event corrected jet to charged-particle angular distribution contains a jet peak and an uncorrelated underlying event background. Since jet correlations are small angle correlations, the underlying event is expected to dominate far from the jet axis (sideband), and thus the distribution at $\abs{\eta} > 1.5$ should be uniform. To evaluate possible deviations from the uniformity, a constant function is separately fit to each sideband region of the acceptance-corrected $\Delta\eta$ distribution ($-2.5<\Delta\eta<-1.5$ and $1.5<\Delta\eta<2.5$). The difference between the average yield in the positive and negative sides determined this way is assigned as a systematic uncertainty. \item \emph{Underlying event subtraction}. Uncertainties resulting from the underlying event subtraction are determined by considering the two parts of the sideband region, $1.5<\abs{\Delta\eta}<2.0$ and $2.0<\abs{\Delta\eta}<2.5$, after the underlying event subtraction. The average yield is calculated in each of the regions and the larger deviation from zero is assigned as a systematic uncertainty. \end{itemize} The total systematic uncertainties are obtained by adding all the individual components together in quadrature. For the leading and subleading jet correlations, the uncertainties integrated over \ensuremath{x_{j}}\xspace and $\Delta r$ are listed in Tables~\ref{tab:leadingJetSystematics} and~\ref{tab:subleadingJetSystematics}, respectively. \begin{table}[htbp] \centering{ \topcaption{Systematic uncertainties for the leading jet shape components, integrated over \ensuremath{x_{j}}\xspace, and $\Delta r$, and shown for \ensuremath{\Pp\Pp}\xspace and centrality-binned PbPb collisions. The ranges correspond to the \pt dependence of the uncertainty. If some \pt bins have an uncertainty smaller than 0.5\%, the range is presented with a ``$<$" symbol and the upper bound.} \label{tab:leadingJetSystematics} \begin{tabular}{cccccc} Source & 0--10\% & 10--30\% & 30--50\%& 50--90\% & \ensuremath{\Pp\Pp}\xspace\\ \hline Underlying event fluctuation bias & $<$4\% & $<$3\% & $<$2\% & $<$1\% & \NA \\ Jet fragmentation bias & $<$3\% & $<$2\% & $<$2\% & $<$2\% & $<$1\% \\ Residual jet energy scale & 3--7\% & 3--8\% & 3--8\% & 3--9\% & 1--9\% \\ Jet energy resolution & 1--3\% & 1--3\% & 1--3\% & 1--3\% & $<$2\% \\ Trigger bias & $<$2\% & $<$2\% & $<$2\% & $<$2\% & \NA \\ Tracking efficiency & 6--8\% & 6--8\% & 6--7\% & 6--7\% & 3\% \\ Acceptance correction & $<$3\% & $<$3\% & $<$3\% & $<$3\% & $<$1\% \\ Underlying event subtraction & $<$4\% & $<$3\% & $<$3\% & $<$3\% & $<$2\% \\[\cmsTabSkip] Total & 8--14\% & 8--12\% & 8--12\% & 8--11\% & 3--10\% \\ \end{tabular} } \end{table} \begin{table}[htbp] \centering{ \topcaption{Systematic uncertainties for the subleading jet shape components, integrated over \ensuremath{x_{j}}\xspace, and $\Delta r$, and shown for \ensuremath{\Pp\Pp}\xspace and centrality-binned PbPb collisions. The ranges correspond to the \pt dependence of the uncertainty. If some \pt bins have an uncertainty smaller than 0.5\%, the range is presented with a ``$<$" symbol and the upper bound.} \label{tab:subleadingJetSystematics} \begin{tabular}{cccccc} Source & 0--10\% & 10--30\% & 30--50\% & 50--90\% & \ensuremath{\Pp\Pp}\xspace \\ \hline Underlying event fluctuation bias & $<$1\% & $<$1\% & $<$1\% & $<$1\% & \NA \\ Jet fragmentation bias & $<$3\% & $<$2\% & $<$1\% & $<$1\% & $<$1\% \\ Residual jet energy scale & 2--9\% & 2--9\% & 2--10\% & 2--10\% & 1--11\% \\ Jet energy resolution & 1--3\% & 1--2\% & 1--2\% & 1--2\% & 1\% \\ Tracking efficiency & 6\% & 6\% & 6\% & 6\% & 3\% \\ Acceptance correction & $<$1\% & $<$1\% & $<$1\% & $<$1\% & $<$1\% \\ Underlying event subtraction & $<$3\% & $<$3\% & $<$3\% & $<$3\% & $<$3\% \\[\cmsTabSkip] Total & 7--11\% & 7--11\% & 7--11\% & 7--11\% & 4--11\% \\ \end{tabular} } \end{table} \section{Results} \label{sec:results} Figure~\ref{fig:yieldDeltaEtaLeading} shows the results for charged-particle yields in the region $\abs{\Delta\varphi} < 1$ as a function of $\abs{\Delta\eta}$ from the leading jets. The intervals in track \pt are indicated by the stacked histograms. The first row shows the charged-particle yields without any selection on \ensuremath{x_{j}}\xspace, while other rows show the charged-particle yields in different bins of \ensuremath{x_{j}}\xspace from the most unbalanced $0 < \ensuremath{x_{j}}\xspace < 0.6$ (second row) to the most balanced $0.8 < \ensuremath{x_{j}}\xspace < 1.0$ (fourth row) dijet events. The first panel in each row shows the charged-particle yields for the \ensuremath{\Pp\Pp}\xspace collisions while other panels show the same yields for the PbPb collisions in different centrality bins, from the most peripheral 50--90\% (second panel) to the most central 0--10\% (fifth panel) collisions. Measurements of the per-jet invariant charged-particle yields show an enhancement of these yields in PbPb relative to \ensuremath{\Pp\Pp}\xspace collisions. The enhancement is greatest for central collisions and decreases for more peripheral collisions. Comparing the different \ensuremath{x_{j}}\xspace bins, the enhancement of the total PbPb yield relative to \ensuremath{\Pp\Pp}\xspace yield is seen to increase slightly as the dijet momenta become more balanced. A geometrical bias could explain this, as discussed, for example, in Ref.~\cite{Renk:jetProductionPoint}, since it can result in different path lengths inside the medium for the leading and subleading jets. In balanced dijet events, both jets lose significant amounts of energy, while in events with unbalanced dijet momenta, the leading jet is most likely produced closer to the surface of the plasma, thus losing less energy. The \ensuremath{x_{j}}\xspace trend in PbPb collisions could also be influenced by energy loss fluctuations, as studied in Ref.~\cite{asymmetryOrigins}. \begin{figure}[p] \centering{ \includegraphics[width=0.99\textwidth]{Figure_001} \caption{Distributions of charged-particle yields correlated to leading jets in the region $\abs{\Delta\varphi} < 1$ as a function of $\abs{\Delta\eta}$ for \ensuremath{\Pp\Pp}\xspace (first column) and PbPb (second to fifth columns) collisions in different centrality bins, shown differentially for all \ptSuper{ch} bins. The first row shows the charged-particle yields without any selection on \ensuremath{x_{j}}\xspace, while other rows show the charged-particle yields in different bins of \ensuremath{x_{j}}\xspace, starting with the most unbalanced $0 < \ensuremath{x_{j}}\xspace < 0.6$ (second row) to the most balanced $0.8 < \ensuremath{x_{j}}\xspace < 1.0$ (fourth row) dijet events.} \label{fig:yieldDeltaEtaLeading} } \end{figure} Figure~\ref{fig:yieldDeltaEtaSubleading} shows the results for charged-particle yields in the region $\abs{\Delta\varphi} < 1$ presented differentially in \ptSuper{ch}, as a function of $\abs{\Delta\eta}$ for the subleading jets. The results are arranged in the same manner as for leading jets in Fig.~\ref{fig:yieldDeltaEtaLeading}. As with the leading jets, the measurements of the per-jet invariant charged-particle yields for subleading jets show an enhancement in PbPb relative to \ensuremath{\Pp\Pp}\xspace collisions, with the greatest enhancement observed for central collisions. The magnitude of this enhancement is larger than for the leading jets in Fig.~\ref{fig:yieldDeltaEtaLeading} (note the different vertical scales between the two figures). Comparing the different \ensuremath{x_{j}}\xspace bins for the subleading jets, the enhancement of the total PbPb yield relative to the \ensuremath{\Pp\Pp}\xspace yield is seen to slightly decrease as the dijet momenta become more balanced. This is opposite to the trend found for the leading jets and may reflect the greater path length through the plasma taken by the subleading jets for more unbalanced dijet events. When comparing leading and subleading results, there also might be an effect where the selection of leading and subleading jets in PbPb collisions is reversed as a consequence of parton energy loss in quark-gluon plasma. \begin{figure}[hp!] \centering{ \includegraphics[width=0.99\textwidth]{Figure_002} \caption{Distributions of charged-particle yields correlated to subleading jets in the region $\abs{\Delta\varphi} < 1$ as a function of $\abs{\Delta\eta}$ for \ensuremath{\Pp\Pp}\xspace (first column) and PbPb (second to fifth columns) collisions in different centrality bins, shown differentially for all \ptSuper{ch} bins. The first row shows the charged-particle yields without any selection on \ensuremath{x_{j}}\xspace, while other rows show the charged-particle yields in different bins of \ensuremath{x_{j}}\xspace, starting with the most unbalanced $0 < \ensuremath{x_{j}}\xspace < 0.6$ (second row) to the most balanced $0.8 < \ensuremath{x_{j}}\xspace < 1.0$ (fourth row) dijet events.} \label{fig:yieldDeltaEtaSubleading} } \end{figure} The jet radial momentum distributions $\mathrm{P} (\Delta r)$ and jet shapes $\rho(\Delta r)$ are studied by examining the distribution of charged particles in annular rings of width $\delta r = 0.05$ around the jet axis. The jet radial momentum profile $\mathrm{P} (\Delta r)$ is the transverse momentum weighted distribution of particles around the jet axis: \begin{linenomath} \begin{equation} \mathrm{P} (\Delta r) = \frac{1}{\delta r} \frac{1}{\NText{jets}} \large{\Sigma_{\text{jets}}} \Sigma_{\text{tracks} \in (\Delta r_{a},\,\Delta r_{b})} \ptSuper{ch} , \end{equation} \end{linenomath} where $\Delta r_{a}$ and $\Delta r_{b}$ define the annular edges of $\Delta r$, and $\delta r = \Delta r_{b} - \Delta r_{a}$. The jet shape $\rho(\Delta r)$ is the momentum distribution normalized to unity over $\Delta r < 1$, with \begin{linenomath} \begin{equation} \rho(\Delta r) = \frac{\mathrm{P} (\Delta r)}{\Sigma_{\text{jets}} \Sigma_{\text{tracks} \in \Delta r < 1} \, \ptSuper{ch}} . \label{eq:jetShape} \end{equation} \end{linenomath} The main difference between these two is that while jet shapes focus exclusively on studying the shape of the distribution, jet radial momentum distributions are sensitive to changes in the absolute scale of the in-jet momentum flow between \ensuremath{\Pp\Pp}\xspace and PbPb collisions. Figure~\ref{fig:momentumProfileLeadingSubleadingJet} shows the jet radial momentum distributions in PbPb and \ensuremath{\Pp\Pp}\xspace collisions differentially in \ptSuper{ch}. The first row shows the jet radial momentum distribution for the leading jets, while the second row is for subleading jets. The first panel in each row shows the results for \ensuremath{\Pp\Pp}\xspace collisions, while other panels are for PbPb collisions in different centrality bins, starting from the most peripheral 50--90\% (second panel) to the most central 0--10\% (fifth panel) collisions. For both leading and subleading jets, when going toward more central events, the momentum profile at large $\Delta r$ is enhanced in PbPb collisions over the one in \ensuremath{\Pp\Pp}\xspace collisions. The enhancement is largest for the low-\pt charged particles, as expected if the energy lost at high \pt resulting from interactions of partons with the quark-gluon plasma reappears in the form of low-\pt particles far away from the jet axis. \begin{figure}[hp!] \centering{ \includegraphics[width=0.99\linewidth]{Figure_003} \caption{Jet radial momentum profile $\mathrm{P}(\Delta r)$ for \ensuremath{\Pp\Pp}\xspace (first column) and PbPb (second to fifth columns) collisions in different centrality bins as a function of $\Delta r$, shown differentially in \ptSuper{ch} for leading (upper row) and subleading (lower row) jets.} \label{fig:momentumProfileLeadingSubleadingJet} } \end{figure} Figure~\ref{fig:momentumProfileRatioLeadingSubleadingJet} shows the PbPb to \ensuremath{\Pp\Pp}\xspace collision ratio of the jet radial momentum profiles for different centrality bins. A clear trend can be seen in these plots. The enhancement of the PbPb radial momentum distribution over the \ensuremath{\Pp\Pp}\xspace distribution is the largest for the most central collisions and for larger separations of the charged particles from the jet axis. The enhancement for subleading jets is not as large as for the leading jets because of the widening of the \ensuremath{\Pp\Pp}\xspace reference distribution. The main reason of this widening is the fact that subleading jets have significantly lower \pt compared to leading jets, and jet shapes for lower \pt jets are wider. \begin{figure}[hp!] \centering{ \includegraphics[width=0.99\linewidth]{Figure_004} \caption{The PbPb to \ensuremath{\Pp\Pp}\xspace ratio of the jet radial momentum distributions as a function of $\Delta r$, $\mathrm{P} (\Delta r)_{\mathrm{PbPb}}/\mathrm{P} (\Delta r)_{\ensuremath{\Pp\Pp}\xspace}$, for different centrality bins for the leading jets (upper row) and subleading jets (lower row).} \label{fig:momentumProfileRatioLeadingSubleadingJet} } \end{figure} The jet shape results for the leading jets are presented in Fig.~\ref{fig:jetShapeLeadingJet_Temp}. The first row shows the jet shape without any selection on \ensuremath{x_{j}}\xspace, while other rows show the jet shape in different \ensuremath{x_{j}}\xspace bins. The first panel in each row shows the jet shape for \ensuremath{\Pp\Pp}\xspace collisions. Without \ensuremath{x_{j}}\xspace selection, about 3.7\% of the total charged-particle constituent \pt is out-of-cone ($R > 0.4$). This does not change significantly as a function of \ensuremath{x_{j}}\xspace, varying between 3.5\% and 3.8\% from the most unbalanced to the most balanced studied \ensuremath{x_{j}}\xspace bins. The other panels are for PbPb collisions in different centrality bins. When compared to \ensuremath{\Pp\Pp}\xspace collisions, there is an enhancement of low-\pt charged particles in PbPb collisions. This enhancement is greater for central events than for peripheral events. \begin{figure}[hp!] \centering{ \includegraphics[width=0.99\linewidth]{Figure_005} \caption{Leading jet shapes $\rho(\Delta r)$ (normalized to unity over $\Delta r < 1$) for \ensuremath{\Pp\Pp}\xspace (first column) and PbPb (second to fifth columns) collisions in different centrality bins as a function of $\Delta r$, shown differentially in \ptSuper{ch} for the inclusive \ensuremath{x_{j}}\xspace bin (first row) and in differential bins $0 < \ensuremath{x_{j}}\xspace < 0.6$ (second row), $0.6 < \ensuremath{x_{j}}\xspace < 0.8$ (third row), and $0.8 < \ensuremath{x_{j}}\xspace < 1.0$ (fourth row).} \label{fig:jetShapeLeadingJet_Temp} } \end{figure} The modifications to the leading jet shapes in PbPb collisions are quantified in Fig.~\ref{fig:jetShapeLeadingJet_ratio_Temp}, which shows the $\rhoSub{PbPb} / \rhoSub{\pp}$ ratios in different centrality and \ensuremath{x_{j}}\xspace bins. When going toward more central events from the peripheral ones, there is an enhancement of the PbPb jet shape compared to the \ensuremath{\Pp\Pp}\xspace shape at large $\Delta r$. As already seen in the charged-particle yield plots of Fig.~\ref{fig:yieldDeltaEtaLeading}, the differences between \ensuremath{\Pp\Pp}\xspace and PbPb results for leading jets are the largest for the most balanced collisions ($0.8 < \ensuremath{x_{j}}\xspace < 1.0$) and become smaller as the two jet momenta become less balanced. \begin{figure}[hp!] \centering{ \includegraphics[width=0.99\linewidth]{Figure_006} \caption{The PbPb to \ensuremath{\Pp\Pp}\xspace ratio as a function of $\Delta r$ for leading jet shapes, $\rhoSub{PbPb} / \rhoSub{\pp}$, in different centrality bins for $0 < \ensuremath{x_{j}}\xspace < 0.6$ (upper row), $0.6 < \ensuremath{x_{j}}\xspace < 0.8$ (middle row) and $0.8 < \ensuremath{x_{j}}\xspace < 1.0$ (lower row) dijet selections. The leading jet shape ratio for all dijets, \ie, without any selection on the dijet momentum balance are also shown in each row for comparison. The error bars represent the statistical uncertainties and the shaded areas the systematic uncertainties.} \label{fig:jetShapeLeadingJet_ratio_Temp} } \end{figure} Figure~\ref{fig:jetShapeSubleadingJet_Temp} shows the jet shape results differentially in charged-particle \pt for the subleading jets, for different selections of centrality and \ensuremath{x_{j}}\xspace. As also found for the leading jet results, an enhancement of low-\pt charged particles in PbPb collisions is seen for the subleading jet. Also, the unbalanced \ensuremath{\Pp\Pp}\xspace collision distribution is not monotonically decreasing toward large $\Delta r$, but there is an enhancement around $\Delta r \sim 0.5$, which is mostly caused by high-\pt particles. As the jet cone size used for this analysis is $R = 0.4$, these particles are not a part of the subleading jet. This enhancement is still somewhat visible in the peripheral PbPb collisions, but disappears for the central events. In the balanced collisions, no enhancement of high-\pt particles at large $\Delta r$ is visible. To create an unbalanced dijet configuration in \ensuremath{\Pp\Pp}\xspace collisions, there is most often a third jet to conserve momentum, as confirmed by Monte Carlo studies and 3-jet selection in \ensuremath{\Pp\Pp}\xspace events, which explains the enhancement of high-\pt particles outside of the jet cone. The observed features lead to a much more significant \ensuremath{x_{j}}\xspace dependence for the out-of-cone charged-particle constituent \pt fractions compared to those seen for leading jets. While only 7\% of the total charged-particle constituent \pt is out-of-cone for balanced dijets ($0.8 < \ensuremath{x_{j}}\xspace < 1$) in \ensuremath{\Pp\Pp}\xspace collisions, this fraction increases to 20\% for unbalanced dijets ($0 < \ensuremath{x_{j}}\xspace < 0.6$). Without \ensuremath{x_{j}}\xspace selection, the fraction is about 11\%. In central heavy ion collisions, the jet energy can be lost to the medium and is seen as excess low-\pt particles at larger angles rather than as a third reconstructed jet. \begin{figure}[hp!] \centering{ \includegraphics[width=0.99\linewidth]{Figure_007} \caption{Subleading jet shapes $\rho(\Delta r)$ (normalized to unity over $\Delta r < 1$) for \ensuremath{\Pp\Pp}\xspace (first column) and PbPb (second to fifth columns) collisions in different centrality bins as a function of $\Delta r$, shown differentially in \ptSuper{ch} for the inclusive \ensuremath{x_{j}}\xspace bin (first row) and in differential bins $0 < \ensuremath{x_{j}}\xspace < 0.6$ (second row), $0.6 < \ensuremath{x_{j}}\xspace < 0.8$ (third row), and $0.8 < \ensuremath{x_{j}}\xspace < 1.0$ (fourth row).} \label{fig:jetShapeSubleadingJet_Temp} } \end{figure} The subleading jet shape ratios $\rhoSub{PbPb} / \rhoSub{\pp}$ in different centrality and \ensuremath{x_{j}}\xspace bins are shown in Fig.~\ref{fig:jetShapeSubleadingJet_ratio_Temp}. There is a broadening of the PbPb jet shape compared to the \ensuremath{\Pp\Pp}\xspace shape when going toward more central events from the peripheral ones. However, in the most unbalanced ($0.0 < \ensuremath{x_{j}}\xspace < 0.6$) and in moderately balanced ($0.6 < \ensuremath{x_{j}}\xspace < 0.8$) events, the ratio between PbPb and \ensuremath{\Pp\Pp}\xspace jet shapes first peaks around $\Delta r = 0.4$, then gets close to one at large $\Delta r$. The enhancement from small $\Delta r$ toward the edge of the jet cone at $\Delta r = 0.4$ is explained by jet quenching. Outside the jet cone, the ratio gets closer to unity because of the reduced influence of any potential third jet in PbPb collisions, as discussed for Fig.~\ref{fig:jetShapeSubleadingJet_Temp}. If there would be no contribution from particles related to the third jet in the \ensuremath{\Pp\Pp}\xspace jet shape, the enhancement would be the greatest at high $\Delta r$ also in these events, as is the case for the most balanced ($0.8 < \ensuremath{x_{j}}\xspace < 1.0$) events. Notice that the leading and subleading jet \pt can still be up to 20\% different in this most balanced bin. This explains the ratio differences in this bin between leading jets in Fig.~\ref{fig:jetShapeLeadingJet_ratio_Temp} and subleading jets in Fig.~\ref{fig:jetShapeSubleadingJet_ratio_Temp}. \begin{figure}[hp!] \centering{ \includegraphics[width=0.99\linewidth]{Figure_008} \caption{The PbPb to \ensuremath{\Pp\Pp}\xspace ratio as a function of $\Delta r$ for subleading jet shapes, $\rhoSub{PbPb} / \rhoSub{\pp}$, in different centrality bins for $0 < \ensuremath{x_{j}}\xspace < 0.6$ (upper row), $0.6 < \ensuremath{x_{j}}\xspace < 0.8$ (middle row) and $0.8 < \ensuremath{x_{j}}\xspace < 1.0$ (lower row) dijet selections. The subleading jet shape ratio for all dijets, \ie, without any selection on the dijet momentum balance are also shown in each row for comparison. The error bars represent the statistical uncertainties and the shaded areas the systematic uncertainties.} \label{fig:jetShapeSubleadingJet_ratio_Temp} } \end{figure} The ratio of jet shapes in momentum balanced and unbalanced samples with the \ensuremath{x_{j}}\xspace inclusive sample for leading jets is presented in Fig.~\ref{fig:jetShapeAsymmetryRatioLeading} and for subleading jets in Fig.~\ref{fig:jetShapeAsymmetryRatioSubleading}. Taking this ratio cancels the systematic uncertainties related to tracking and the jet energy scale. However, the uncertainties related to the jet energy resolution do not cancel and are included in the systematic uncertainties. For the leading jets, the jet shapes in the unbalanced $0 < \ensuremath{x_{j}}\xspace < 0.6$ bin are narrower than in the \ensuremath{x_{j}}\xspace inclusive sample. Conversely, in the balanced $0.8 < \ensuremath{x_{j}}\xspace < 1.0$ bin, the jet shapes are wider. For the subleading jets in Fig.~\ref{fig:jetShapeAsymmetryRatioSubleading}, the behavior is exactly opposite to the leading jets, the jet shapes in the unbalanced bin are wider and in the balanced bin narrower compared to the \ensuremath{x_{j}}\xspace inclusive case. This is similar to the \ensuremath{x_{j}}\xspace dependence seen for the charged-particle distributions. \begin{figure}[hp!] \centering{ \includegraphics[width=0.99\linewidth]{Figure_009} \caption{Ratio of momentum-unbalanced ($0.0 < \ensuremath{x_{j}}\xspace < 0.6$, upper row) and balanced ($0.8 < \ensuremath{x_{j}}\xspace < 1.0$, lower row) jet shapes to \ensuremath{x_{j}}\xspace integrated jet shapes for leading jets in \ensuremath{\Pp\Pp}\xspace collisions and different PbPb centrality bins as a function of $\Delta r$. The error bars represent the statistical uncertainties and the shaded areas the systematic uncertainties.} \label{fig:jetShapeAsymmetryRatioLeading} } \end{figure} \begin{figure}[hp!] \centering{ \includegraphics[width=0.99\linewidth]{Figure_010} \caption{Ratio of momentum-unbalanced ($0.0 < \ensuremath{x_{j}}\xspace < 0.6$, upper row) and balanced ($0.8 < \ensuremath{x_{j}}\xspace < 1.0$, lower row) jet shapes to \ensuremath{x_{j}}\xspace integrated jet shapes for subleading jets in \ensuremath{\Pp\Pp}\xspace collisions and different PbPb centrality bins as a function of $\Delta r$. The error bars represent the statistical uncertainties and the shaded areas the systematic uncertainties.} \label{fig:jetShapeAsymmetryRatioSubleading} } \end{figure} \section{Summary} \label{sec:summary} The CMS experiment has measured charged-particle yields and jet shapes in events containing back-to-back dijet pairs around the jet axes using data from proton-proton (\ensuremath{\Pp\Pp}\xspace) and lead-lead (PbPb) collisions at $\sqrtsNN = 5.02\TeV$ collected in 2017 and 2018. When comparing the charged-particle yields around the jet axes, an excess of low transverse momentum (\pt) particles is observed in PbPb with respect to \ensuremath{\Pp\Pp}\xspace collisions. This excess is larger for subleading jets compared to leading jets. The excess is also found to have a different dijet momentum balance $\ensuremath{x_{j}}\xspace = \ptText{subleading} / \ptText{leading}$ dependence for the leading and subleading jets. A possible cause for \ensuremath{x_{j}}\xspace imbalance is that the leading jet is produced near the surface of the quark-gluon plasma while the subleading jet needs to traverse a longer distance through the plasma. The leading jets show the strongest modifications in balanced events ($\ensuremath{x_{j}}\xspace \approx 1$), while subleading jets experience the most pronounced modifications in events with a large jet momentum imbalance. A possible explanation is that in balanced events both jets lose a comparable amount of energy, while in events with a momentum imbalance the leading jet loses significantly less energy. Furthermore, jet quenching could lead to the reversal of the apparent leading/subleading ordering and energy loss fluctuations in PbPb collisions could also play a role. For the jet shapes, which are normalized distributions of charged-particle transverse momentum as a function of the distance from the jet axis, a redistribution of energy is observed from small angles with respect to the jet axis to larger angles when comparing PbPb and \ensuremath{\Pp\Pp}\xspace events. The difference between the PbPb and \ensuremath{\Pp\Pp}\xspace results is larger for the leading jets compared to the subleading jets, which can be explained by the subleading jet distribution in \ensuremath{\Pp\Pp}\xspace collisions being significantly wider than that for leading jets. When studying the unbalanced \ensuremath{x_{j}}\xspace selection for the subleading jets in \ensuremath{\Pp\Pp}\xspace collisions, a fragmentation pattern consistent with the presence of a third jet is observed. Such a pattern is not observed in balanced \ensuremath{\Pp\Pp}\xspace events or in the PbPb sample. As a result, the enhancement of the PbPb to \ensuremath{\Pp\Pp}\xspace ratio for unbalanced events peaks around $\Delta r = 0.4$ and becomes smaller at larger $\Delta r$. When comparing the jet shapes corresponding to different dijet momentum balance conditions, the distributions for leading jets are found to be the widest for events with balanced jet momenta. For subleading jets, the situation is the opposite, and the widest distributions are found from events having a significant momentum imbalance. These observations are consistent with the interpretation of the charged-particle yield measurements, namely that the average path length inside the medium for leading jets is larger for momentum balanced events, while for subleading jets it is larger in unbalanced events. By studying the charged-particle yields correlated to jets and jet shapes for the first time as a function of dijet momentum balance, this study provides new constraints to the theoretical models and provides a unique way to explore the transition between the domains of weakly and strongly interacting QCD matter. \begin{acknowledgments} We congratulate our colleagues in the CERN accelerator departments for the excellent performance of the LHC and thank the technical and administrative staffs at CERN and at other CMS institutes for their contributions to the success of the CMS effort. In addition, we gratefully acknowledge the computing centres and personnel of the Worldwide LHC Computing Grid and other centres for delivering so effectively the computing infrastructure essential to our analyses. Finally, we acknowledge the enduring support for the construction and operation of the LHC, the CMS detector, and the supporting computing infrastructure provided by the following funding agencies: BMBWF and FWF (Austria); FNRS and FWO (Belgium); CNPq, CAPES, FAPERJ, FAPERGS, and FAPESP (Brazil); MES (Bulgaria); CERN; CAS, MoST, and NSFC (China); COLCIENCIAS (Colombia); MSES and CSF (Croatia); RIF (Cyprus); SENESCYT (Ecuador); MoER, ERC PUT and ERDF (Estonia); Academy of Finland, MEC, and HIP (Finland); CEA and CNRS/IN2P3 (France); BMBF, DFG, and HGF (Germany); GSRT (Greece); NKFIA (Hungary); DAE and DST (India); IPM (Iran); SFI (Ireland); INFN (Italy); MSIP and NRF (Republic of Korea); MES (Latvia); LAS (Lithuania); MOE and UM (Malaysia); BUAP, CINVESTAV, CONACYT, LNS, SEP, and UASLP-FAI (Mexico); MOS (Montenegro); MBIE (New Zealand); PAEC (Pakistan); MSHE and NSC (Poland); FCT (Portugal); JINR (Dubna); MON, RosAtom, RAS, RFBR, and NRC KI (Russia); MESTD (Serbia); SEIDI, CPAN, PCTI, and FEDER (Spain); MOSTR (Sri Lanka); Swiss Funding Agencies (Switzerland); MST (Taipei); ThEPCenter, IPST, STAR, and NSTDA (Thailand); TUBITAK and TAEK (Turkey); NASU (Ukraine); STFC (United Kingdom); DOE and NSF (USA). \hyphenation{Rachada-pisek} Individuals have received support from the Marie-Curie programme and the European Research Council and Horizon 2020 Grant, contract Nos.\ 675440, 724704, 752730, and 765710 (European Union); the Leventis Foundation; the Alfred P.\ Sloan Foundation; the Alexander von Humboldt Foundation; the Belgian Federal Science Policy Office; the Fonds pour la Formation \`a la Recherche dans l'Industrie et dans l'Agriculture (FRIA-Belgium); the Agentschap voor Innovatie door Wetenschap en Technologie (IWT-Belgium); the F.R.S.-FNRS and FWO (Belgium) under the ``Excellence of Science -- EOS" -- be.h project n.\ 30820817; the Beijing Municipal Science \& Technology Commission, No. Z191100007219010; the Ministry of Education, Youth and Sports (MEYS) of the Czech Republic; the Deutsche Forschungsgemeinschaft (DFG), under Germany's Excellence Strategy -- EXC 2121 ``Quantum Universe" -- 390833306, and under project number 400140256 - GRK2497; the Lend\"ulet (``Momentum") Programme and the J\'anos Bolyai Research Scholarship of the Hungarian Academy of Sciences, the New National Excellence Program \'UNKP, the NKFIA research grants 123842, 123959, 124845, 124850, 125105, 128713, 128786, and 129058 (Hungary); the Council of Science and Industrial Research, India; the HOMING PLUS programme of the Foundation for Polish Science, cofinanced from European Union, Regional Development Fund, the Mobility Plus programme of the Ministry of Science and Higher Education, the National Science Center (Poland), contracts Harmonia 2014/14/M/ST2/00428, Opus 2014/13/B/ST2/02543, 2014/15/B/ST2/03998, and 2015/19/B/ST2/02861, Sonata-bis 2012/07/E/ST2/01406; the National Priorities Research Program by Qatar National Research Fund; the Ministry of Science and Higher Education, project no. 0723-2020-0041 (Russia); the Tomsk Polytechnic University Competitiveness Enhancement Program; the Programa Estatal de Fomento de la Investigaci{\'o}n Cient{\'i}fica y T{\'e}cnica de Excelencia Mar\'{\i}a de Maeztu, grant MDM-2015-0509 and the Programa Severo Ochoa del Principado de Asturias; the Thalis and Aristeia programmes cofinanced by EU-ESF and the Greek NSRF; the Rachadapisek Sompot Fund for Postdoctoral Fellowship, Chulalongkorn University and the Chulalongkorn Academic into Its 2nd Century Project Advancement Project (Thailand); the Kavli Foundation; the Nvidia Corporation; the SuperMicro Corporation; the Welch Foundation, contract C-1845; and the Weston Havens Foundation (USA).\end{acknowledgments}
\section{Introduction} \label{sec:introduction} Quantum spin liquids are intriguing phases of matter which can manifest when strong quantum fluctuations inhibit the formation of conventional magnetic order~\cite{Balents2010,Witczak-Krempa2014}. They are accompanied by massive long-range entanglement which enables them to possess unusual properties; the physical constituents of the system may fractionalize and give rise to an emergent gauge structure as well as to the formation of collective parton degrees of freedom with new, effective quantum numbers~\cite{Savary2017,Broholm2020}. Among the many candidate models to host a quantum spin liquid ground state, the Kitaev honeycomb model stands out. It is not only exactly solvable at zero temperature~\cite{Kitaev2006}, but it is also amenable to quasi-exact Monte Carlo studies at finite temperature~\cite{Nasu2014,Nasu2015}, thus giving unprecedented systematic insight into the fractionalization process in frustrated quantum magnets. Following the theoretical inception of the Kitaev model and its generalization to three-dimensional lattices~\cite{OBrien2016,Eschmann2020}, a flurry of activity commenced in an effort to identify materials which could potentially realize the microscopic model. A number of so-called Kitaev materials with strong bond-directional interactions have been found since~\cite{Jackeli2009,Rau2016,Trebst2017,Takagi2019}. Prominent examples include \ce{Na2IrO3}~\cite{Singh2010,Chaloupka2010}, $\alpha$-\ce{Li2IrO3}~\cite{Singh2012}, and $\alpha$-\ce{RuCl3}~\cite{Plumb2014,Banerjee2016,Banerjee2017,Kasahara2018,Chern2020b} on the honeycomb lattice and $\beta$-\ce{Li2IrO3} on the three-dimensional hyper-honeycomb lattice~\cite{Takayama2015,Lee2014,Kimchi2014,Lee2015,Kim2015,Lee2016,Schaffer2016,Huang2018,Choi2019}. All these materials, however, exhibit magnetic ordering at temperatures below $T \approx 10\,\mathrm{K}$ ($T\approx 38\,\mathrm{K}$ for the 3D compound) which is driven by competing interactions that deviate from the perfect Kitaev model; such additional interactions often involve higher-symmetry Heisenberg interactions or lower-symmetry off-diagonal interactions, commonly referred to as $\Gamma$ interactions in the literature~\cite{Winter2016,Winter2017}. To this day, it is subject of ongoing research to further refine the available palette of Kitaev material candidates. The magnetic transition temperature can be suppressed, for example, by chemical substitution of inter-layer \ce{Li}-atoms as demonstrated in \ce{Ag3LiIr2O6} and \ce{H3LiIr2O6}~\cite{Bahrami2019,Kitagawa2018}, although for the latter material it is argued that chemical disorder may play a relevant role in the suppression of magnetic order~\cite{Li2018,Yadav2018}. In order to provide guidance for further material synthesis and refinement, it is immensely valuable to understand the underlying microscopic spin model and its associated phase diagram. As a minimal model for the microscopic description, the Kitaev-$\Gamma$ model has received ample attention. It comprises both, Kitaev and $\Gamma$ interactions, which are believed to be the two dominant terms in $\alpha$-\ce{RuCl3}~\cite{Winter2016,Winter2017,Sears2020}. Previous model calculations indicate that multiple competing ground states are in close vicinity to each other in the part of the parameter space which is relevant for $\alpha$-\ce{RuCl3}, i.e. ferromagnetic Kitaev interactions ($K<0$) in conjunction with antiferromagnetic $\Gamma$ interactions ($\Gamma>0$) -- thereby rendering the theoretical analysis of the model extremely challenging~\cite{Rau2014,Gohlke2018,Gohlke2020}. Furthermore, in some of the Kitaev materials, including $\alpha$-\ce{Li2IrO3} and $\beta$-\ce{Li2IrO3}, the formation of incommensurate counter-rotating magnetic spirals has been reported, making their numerical simulation on finite-size model clusters notoriously difficult~\cite{Williams2016,Biffin2014,Rousochatzakis2018,Ducatman2018}. Most importantly, however, the connection between model calculations and experiments remained incomplete, since previous studies have only focused on the zero-temperature properties of the model and experiments are necessarily performed at finite temperature. The role of thermal fluctuations and their potential driving of an entropic magnetic ordering transition (order by disorder) has not yet been explored. In this paper, we present a take on the spin-1/2 quantum Kitaev-$\Gamma$ model which is based on a pseudofermion functional renormalization group (pf-FRG) approach. The pf-FRG formalism operates on a genuinely infinite representation of the underlying honeycomb lattice and is thus able to faithfully resolve commensurate as well as incommensurate magnetic correlations, in contrast to approaches which operate on finite-size systems. Furthermore, the approach is sensitive to the impact of thermal and quantum fluctuations, thus complementing previous studies of the zero-temperature ground state. We study the phase diagram of the Kitaev-$\Gamma$ model and show that two extended phases exist which exhibit incommensurate spin correlations at finite temperature; in the context of the pf-FRG approach, these phases manifest as the first instability of the RG flow when the energy scale of the RG cutoff is lowered. For the incommensurate phases, we demonstrate that the dominant intensity peaks in the structure factor, which characterize the incommensurate order, shift continuously upon variation of the coupling constant ratio. Moreover, we identify magnetic vortex phases which are overshadowed by a sub-dominant incommensurability effect. The resulting phase diagram is summarized in Fig.~\ref{fig:introduction:phasediagram}. In view of potential future studies, we point out that the pervasiveness of incommensurate correlations poses a challenge to many established methods which may rely on finite lattice representations; to substantiate this observation, we perform pf-FRG calculations on a finite cylinder geometry, assessing the extent to which an anisotropy is imposed by geometrical constraints. We find that this unphysical anisotropy can become sizable in phases with incommensurate magnetic correlations, whereas it remains negligible in the Kitaev spin liquid phases where correlations are short ranged. The structure of the paper is as follows. In Sec.~\ref{sec:model}, we define the Kitaev-$\Gamma$ model, set the notation, and review previous studies of the quantum model at zero temperature. We then briefly introduce the pf-FRG formalism in Sec.~\ref{sec:frg}, before we discuss our findings for the phase diagram in Sec.~\ref{sec:phasediagram}. We further focus on the incommensurate phases in Sec.~\ref{sec:icphases} and study the constraints of a finite cylinder geometry. Our conclusions are summarized in Sec.~\ref{sec:conclusions}. \begin{figure} \includegraphics[width=\linewidth]{phasediagram.pdf} \caption{{\bf Phase diagram} of the Kitaev-$\Gamma$ model on the honeycomb lattice as a function of the angle $\alpha$, which parametrizes the ratio of Kitaev coupling $K=-\cos(\alpha)$ and $\Gamma$ interaction $\Gamma=\sin(\alpha)$. The black curve indicates the characteristic RG scale $\widetilde{\Lambda}_{c}$ which is an indicator for the onset energy scale of the magnetic order, see text for details. The shaded regions indicate ordered phases with finite $\widetilde{\Lambda}_{c}$. Observed ordered phases are ferromagnetic order (FM), incommensurate phase 1 (IC1), vortex phase 1 (V1), antiferromagnetic order (AFM), incommensurate phase 2 (IC2), and vortex phase 2 (V2). White regions indicate spin liquid phases and the absence of spontaneous symmetry breaking, mainly the FM and AFM Kitaev spin liquids around $\alpha/\pi=0$ and $\alpha/\pi=1$, respectively.} \label{fig:introduction:phasediagram} \end{figure} \section{Model} \label{sec:model} We study the quantum-mechanical spin-1/2 Kitaev-$\Gamma$ model on the honeycomb lattice, which is described by the microscopic Hamiltonian \begin{equation} \label{eq:model:hamiltonian} H=\sum\limits_{\langle i, j \rangle_\gamma} K S_i^\gamma S_j^\gamma + \Gamma \left( S_i^\alpha S_j^\beta + S_i^\beta S_j^\alpha \right) \,, \end{equation} where the sum runs over pairs of nearest neighbor lattice sites $i$ and $j$ which are connected by a lattice bond of type $\gamma\in x,y,z$ (with $\alpha,\beta$ denoting the remaining two orthogonal components). The exchange constant $K$ quantifies the diagonal, bond-directional couplings of Kitaev type, whereas $\Gamma$ captures symmetric off-diagonal interactions. We parametrize the ratio of Kitaev and $\Gamma$ interactions by an angle $\alpha \in [0,2\pi)$ which is connected to the exchange constants via \begin{equation} K=-\cos(\alpha) \quad\mathrm{and}\quad \Gamma=\sin(\alpha) \,. \end{equation} Throughout the remainder of this paper, all energy scales are reported in units of $\sqrt{K^2+\Gamma^2}$. In terms of the parametrization described above, the regime $0<\alpha<\pi/2$, i.e. ferromagnetic (FM) Kitaev interactions $K<0$ in conjunction with antiferromagnetic (AFM) $\Gamma$ interactions $\Gamma>0$, is believed to be most relevant for the Kitaev material $\alpha$-\ce{RuCl3}~\cite{Winter2016}. Earlier zero-temperature model calculations have established, however, that this combination of exchange constants is not only particularly relevant for experiments, but it is also a challenging and controversial part of the phase diagram; various studies employing different methods have predicted different results. (i)~Variational Monte Carlo simulations suggest the existence of a sequence of small windows of ferromagnetic order, proximate Kitaev spin liquid, and incommensurate spiral order in vicinity to the Kitaev spin liquid around $\alpha=0$~\cite{Wang2019,Wang2020}. Zigzag order eventually manifests when the $\Gamma$ interaction becomes comparable in magnitude to the Kitaev contribution. (ii)~Tensor network representations of the model predict a slim region of ferromagnetic order and a nematic paramagnet near the Kitaev spin liquid, as well as more intricate magnetic order with a 6-site unit cell~\cite{Lee2020}. (iii)~Exact diagonalization studies on 24-site clusters point towards an extended spin liquid regime spanning all the way from the pure Kitaev spin liquid to pure $\Gamma$ interactions~\cite{Rau2014,Catuneanu2018}. (iv)~Recent density matrix renormalization group calculations find an extended nematic paramagnet regime in proximity to the Kitaev spin liquid~\cite{Gohlke2020}. Extensions of the pure Kitaev-$\Gamma$ model by additional detuning parameters have revealed additional insight into the structure of the phase diagram and the stability of competing phases; many of the aforementioned candidate ground states appear to have a phase boundary close the the pure Kitaev-$\Gamma$ model in this extended parameter space. Detuning parameters which have been studied in the past include competing Heisenberg interactions~\cite{Wang2019}, a spatial anisotropy in the interaction constants~\cite{Wang2020,Catuneanu2018}, a type of symmetric, off-diagonal exchange known as $\Gamma'$-interactions~\cite{Lee2020,Gohlke2020}, or simply a magnetic field~\cite{Lee2020,Chern2020a,Chern2020,Gohlke2020}. Further related efforts to grow our understanding of the model also include studies of the dimensionally reduced one-dimensional Kitaev-$\Gamma$ chain~\cite{Yang2020,Yang2020a,Luo2020} or the Kitaev-$\Gamma$ ladder~\cite{Sorensen2021}. The close competition of many potential ground states has proven to render the numerical exploration of the phase space a formidable challenge. \section{Functional renormalization group} \label{sec:frg} Our aim is to analyze the phase diagram of the model Hamiltonian Eq.~\eqref{eq:model:hamiltonian} within a pseudofermion functional renormalization group (pf-FRG) approach~\cite{Reuther2010,Buessen2019}. The pf-FRG approach is particularly intriguing in this situation, because it operates on an infinite representation of the honeycomb lattice, making it naturally compatible with incommensurate magnetic correlations, which have been suggested as one candidate among the potential ground states. Moreover, the method does not rely on an explicit bias that would favor certain types of ground states, as would be the case e.g. in a mean-field construction or in the choice of initial states for variational approaches. In this section, we briefly outline our implementation of the pf-FRG approach, deferring the discussion of the resulting phase diagram to Sec.~\ref{sec:phasediagram}. We adopt an established formulation of the pf-FRG which is readily applicable to general time-reversal invariant Hamiltonians with two-spin interactions, including our model Hamiltonian Eq.~\eqref{eq:model:hamiltonian}~\cite{Buessen2019,Buessen2019a}. The approach is based on a parton construction in terms of spinful pseudofermions, $S_i^\mu=f^\dagger_{i,\alpha} \sigma^\mu_{\alpha\beta} f^{\phantom\dagger}_{i,\beta}$, with the indices $\alpha$ and $\beta$ implicitly summed over the two spin-1/2 basis states at every lattice site $i$, and a subsequent solution of the functional renormalization group flow equations for the resulting quartic fermion model within the well-developed framework of the fermionic functional renormalization group~\cite{Metzner2012,Wetterich1993}. The pseudofermion parton construction provides a faithful representation of the spin Hamiltonian if the half-filling constraint $\sum_\alpha f^\dagger_{i,\alpha} f^{\phantom\dagger}_{i,\alpha}=1$ is fulfilled at every lattice site $i$. Whereas the constraint can in principle be enforced by implementing an imaginary chemical potential $\mu_\mathrm{chem}=-\frac{i \pi T}{2}$~\cite{Popov1988}, such an approach is unfeasible numerically due to the concomitant reduction of symmetries of the Hamiltonian. Yet, it has been demonstrated that within the pf-FRG approach the constraint tends to be automatically fulfilled even for subtle incommensurate magnetic order~\cite{Baez2017,Kiese2020a,Buessen2018}. The implicit fulfillment of the constraint can be attributed to the fact that the pf-FRG approach is formulated at zero temperature and violations of the half-filling constraint, which lead to effective spin-0 defects, are thus energetically suppressed. The renormalization group (RG) flow equations are obtained by introducing a cutoff $\Lambda$ in the (Matsubara) frequency dependence of the bare propagator $G_0(\omega) \to G_0^\Lambda(\omega)=\frac{\theta\left( | \omega | - \Lambda \right)}{i \omega}$ (note the absence of a kinetic term in the bare propagator for pseudofermions); they form a set of differential equations which describes the evolution of higher-order fermionic interaction vertices under infinitesimal variation of the RG cutoff in the bare propagator. Per construction of the RG cutoff, the model remains unchanged at $\Lambda=0$, whereas in the opposite limit $\Lambda\to\infty$ the bare propagator vanishes, rendering the model particularly simple. In fact, when the bare propagator vanishes, the fermionic interaction vertices exactly match the frequency-independent interactions as defined in the model Hamiltonian Eq.~\eqref{eq:model:hamiltonian}, thus marking a well-defined starting point for the RG analysis. Imposing the cutoff, an exact hierarchy of coupled differential equations (flow equations) for fermionic $n$-particle vertices is generated at any order of $n$, which connects the known initial conditions at $\Lambda\to\infty$ to the physically relevant zero-cutoff limit. In general, this hierarchy of flow equations does not close, and it contains terms to arbitrary order of $n$. Within the pf-FRG approach, the hierarchy is then truncated such that it fully resolves the lattice site and frequency dependence of the self-energy and of the pseudofermionic two-particle interaction vertex, partially retaining feedback from the three-particle vertex~\cite{Reuther2010,Katanin2004}. The truncated flow equations are detailed in Ref.~\onlinecite{Buessen2019} and schematically shown in Fig.~\ref{fig:frg:flowequations}. \begin{figure} \includegraphics[width=\linewidth]{flowequations.pdf} \caption{{\bf Flow equations} for the cutoff-dependent self-energy $\Sigma^\Lambda(\omega)$ and the fermionic two-particle interaction vertices (dashed lines) $\Gamma_{i_1i_2}^\Lambda(1',2';1,2)$ in diagrammatic representation, where composite indices $k=(\omega_k,\alpha_k)$ comprise frequency and spin index. Lattice sites are preserved along solid lines. The self-energy is independent of lattice site and spin index. Slashed propagator lines resemble the single-scale propagator $S(\omega)=\frac{\delta\left( | \omega | - \Lambda \right)}{i \omega - \Sigma^\Lambda(\omega)}$, pairs of slashed propagator lines denote $G(\omega_1)S_\mathrm{kat}(\omega_2)+G(\omega_2)S_\mathrm{kat}(\omega_1)$ with $G(\omega)= \frac{\theta\left( | \omega | - \Lambda \right)}{i \omega - \Sigma^\Lambda(\omega)}$ and $S_\mathrm{kat}(\omega)=-\frac{\mathrm{d}}{\mathrm{d}\Lambda}G(\omega)$. Details are provided in Ref.~\onlinecite{Buessen2019}.} \label{fig:frg:flowequations} \end{figure} \begin{figure*} \includegraphics[width=\linewidth]{characteristicscale_composite.pdf} \caption{{\bf Renormalization group flow} of the onsite magnetic susceptibility $\chi^\Lambda_{ii}$ for different lattice truncation ranges $N_L$. The dashed lines (if present) indicate the characteristic RG scale $\widetilde{\Lambda}_c$ which is associated with the occurrence of spontaneous symmetry breaking. The data displayed is in the (a)~Kitaev spin liquid (KSL) phase at $\alpha/\pi=0$, (b)~incommensurate phase 1 (IC1) at $\alpha/\pi=0.37$, (c)~vortex phase 1 (V1) at $\alpha/\pi=0.72$, (d)~incommensurate phase 2 (IC2) at $\alpha/\pi=1.30$, and (e)~vortex phase 2 (V2) at $\alpha/\pi=1.68$. } \label{fig:phasediagram:characteristicscale_composite} \end{figure*} On this level of truncation, the pf-FRG formalism is understood to combine aspects of a large-S expansion~\cite{Baez2017} and an SU($N$) large-$N$ expansion~\cite{Buessen2018a,Roscher2018} on equal footing, recovering the mean-field exact results in the two separate limits. We formally consider the flow equations at zero temperature, where Matsubara frequencies become continuous. However, for the numerical solution of the flow equations we re-discretize the Matsubara frequency dependence and interpolate linearly in between the discrete grid points. In our implementation, the Matsubara frequency space is approximated by a mesh of $N_\omega=144$ points which are spaced logarithmically around the origin in the range $-250<\omega<250$. The dependence of the interaction vertices on the lattice site indices is treated as follows. We consider an infinite representation of the honeycomb lattice, but set any two-particle interactions to zero if the lattice sites involved are further apart than $N_L=7$ lattice bonds. This truncation scheme can be viewed as a series expansion in system size which eventually converges to a well-defined value when $N_L$ is chosen large enough. Most importantly, the truncation does not impose an artificial boundary onto the system. It has been shown that this approach is well suited to resolve incommensurate magnetic correlations~\cite{Buessen2018,Niggemann2020} -- which are typically difficult to simulate on finite lattice systems. Employing the aforementioned discretization schemes, one obtains a finite set of approximately $5 \times 10^7$ coupled integro-differential equations which describe the RG flow. The flow is evolved numerically from $\Lambda_\mathrm{UV}=500$, which exceeds any intrinsic energy scale of the system, to the effective low-energy theory. We stop the RG flow at $\Lambda_\mathrm{IR}=0.01$, below which no further qualitative changes are expected to occur. Throughout the evolution of the RG flow, instabilities may occur which signal spontaneous symmetry breaking and the onset of magnetic order~\cite{Reuther2010}. Such instabilities can be observed as nonanalyticities (kinks) in the flow of the magnetic susceptibility $\chi^\Lambda(\mathbf{k}) = \sum_{i,j} e^{-i \mathbf{k}\cdot (\mathbf{r}_i-\mathbf{r}_j)} \chi^\Lambda_{ij}$, where $\chi^\Lambda_{ij}$ are the real-space elastic spin correlations $\left< \mathbf{S}_i(\omega=0) \cdot \mathbf{S}_j(\omega=0) \right>$ which can be computed from the fermionic interaction vertices at any given RG scale~\cite{Reuther2010}. If no nonanalyticity is present down to the lowest energy scale $\Lambda_\mathrm{IR}$, the ground state of the system is assumed to retain its full symmetry -- which we loosely associate with spin liquid behavior. Locating the critical breakdown scale $\Lambda_c$ merely by visual inspection of the susceptibility curves introduces some uncertainty to the results. Attempts to identify more robust signatures of phase transitions within pf-FRG are therefore subject of current research~\cite{Keles2018,Kiese2020a,Kiese2020,Thoenniss2020}. Here, we employ an approach introduced in Ref.~\cite{Kiese2020a} which defines a characteristic RG scale $\widetilde{\Lambda}_c$ via the finite-size convergence of the system as follows. If one computes the on-site susceptibility $\chi^\Lambda_{ii}$ for different lattice truncation ranges $N_L=3,5,7$, one finds that the results converge beyond a truncation range which is comparable to the length scale of relevant interactions. In trivial paramagnets and spin liquid phases, only the short-range correlations are relevant and the susceptibility is typically converged already for a small truncation range $N_L=3$. Close to a magnetic ordering transition, however, long-range correlations proliferate and a discrepancy between results for $N_L=3$ and results for greater truncation ranges $N_L>3$ develops. The occurrence of such a sudden change in convergence behavior defines the characteristic RG scale $\widetilde{\Lambda}_c$ which, unlike the naive definition of $\Lambda_c$, can be computed systematically. On our level of numerical uncertainty, a minimum relative deviation of approximately 1\% between the susceptibility values for the different truncation ranges is found to be a good measure to determine $\widetilde{\Lambda}_c$. Ultimately, our goal is to compute the $\omega=0$ component of the dynamic structure factor to characterize the phase diagram. If the system does not undergo spontaneous symmetry breaking, we calculate the structure factor for the effective low-energy theory at the smallest cutoff scale $\Lambda_\mathrm{IR}$. If, on the other hand, a breakdown of the flow is observed, we calculate the structure factor at the characteristic scale $\widetilde{\Lambda}_c$. In the latter case, intensity maxima in the structure factor emerge already slightly above the transition scale and we can read off the nature of the incipient magnetic order. In fact, with the specific choice of the RG cutoff function in the pf-FRG approach, the RG scale $\Lambda$ can be interpreted as a temperature via a linear rescaling $\Lambda=\frac{2}{\pi}T$~\cite{Iqbal2016,Buessen2018a}, with the critical scale $\Lambda_c$ corresponding to the critical temperature of an ordering transition. As such, at finite RG cutoff, the pf-FRG approach resolves the combined effects of thermal fluctuations and quantum fluctuations~\cite{Buessen2018,Ghosh2019,Kiese2020}. We point out, however, that the RG flow is only meaningful until the first breakdown occurs, and we can thus only detect the first finite-temperature transition. If the model implies a multi-step ordering process, the lower-temperature phases cannot be resolved. \section{Phase diagram} \label{sec:phasediagram} We now turn to the discussion of the phase diagram associated with our model Hamiltonian Eq.~\eqref{eq:model:hamiltonian} as a function of the angle $\alpha$, which parametrizes the ratio of Kitaev coupling and $\Gamma$ interactions. The main phase diagram, obtained within the pf-FRG approach, is summarized in Fig.~\ref{fig:introduction:phasediagram}. In the vicinity of the FM Kitaev point ($\alpha/\pi=0$), we naturally observe the manifestation of a paramagnetic ground state -- the ferromagnetic Kitaev spin liquid (KSL). The concomitant absence of spontaneous symmetry breaking is indicated by a smooth RG flow of the magnetic susceptibility down to the lowest cutoff $\Lambda_\mathrm{IR}$, as depicted in Fig.~\ref{fig:phasediagram:characteristicscale_composite}a. The corresponding momentum-resolved structure factor $\chi(\mathbf{k})$ of the FM KSL is displayed in Fig.~\ref{fig:phasediagram:sf_composite}a, revealing a broad maximum around the Brillouin zone (BZ) center. \begin{figure} \includegraphics[width=\linewidth]{sf_composite.pdf} \caption{{\bf Structure factors} of the Kitaev-$\Gamma$ model on the honeycomb lattice in the different phases. The dashed black lines indicate the first Brillouin zone, the extended Brillouin zone is denoted by the the solid lines. (a)~FM KSL phase, plotted at $\alpha \!=\! 0$. (b)~IC1 phase at $\alpha/\pi \!=\! 0.37$. (c)~V1 phase at $\alpha/\pi \!=\! 0.72$. (d)~AFM KSL phase at $\alpha/\pi \!=\! 1$. (e)~IC2 phase at $\alpha/\pi \!=\! 1.30$. (f)~V2 phase at $\alpha/\pi \!=\! 1.68$. The color code is normalized within each plot. All structure factors are plotted at the characteristic RG scale $\widetilde{\Lambda}_c$. } \label{fig:phasediagram:sf_composite} \end{figure} From the analytical solution in the pure Kitaev limit, it is known that this broad maximum results from the superposition of three cosine profiles associated with nearest-neighbor correlations along the $x$, $y$, and $z$-type bonds. The KSL phase remains stable upon inclusion of small AFM $\Gamma$ interactions. When the strength of AFM $\Gamma$ interactions is increased further, the spin liquid eventually becomes unstable and a finite characteristic scale $\widetilde{\Lambda}_c$ is observed beyond $\alpha/\pi > 0.05$. For a brief window, $0.05<\alpha/\pi<0.15$, the dominant wave vector remains indifferent from our findings for the FM KSL phase -- peaking at the BZ center -- which, in combination with the finite characteristic scale $\widetilde{\Lambda}_c$, suggests the formation of ferromagnetic (FM) order. The manifestation of a small region of ferromagnetic order has previously also been observed in variational Monte Carlo calculations~\cite{Wang2019} and tensor network optimizations~\cite{Lee2020}. In the latter study it was found that the FM order is in close energetic proximity to competing configurations, being selected as the ground state only by an energy difference $\Delta E \sim \mathcal{O}(10^{-4})$. Such near-degeneracy of potential ground state configurations in this region of the phase space could contribute to our finding that the finite characteristic scale $\widetilde{\Lambda}_c$ appears to connect smoothly to the neighboring phase upon further increasing the angle $\alpha/\pi$. In the range $0.15 < \alpha/\pi < 0.61$, we observe a broad regime in which the model exhibits incommensurate magnetic correlations. We refer to this regime as the first incommensurate phase~(IC1). While the characteristic scale $\widetilde{\Lambda}_c$ is non-zero, see Fig.~\ref{fig:phasediagram:characteristicscale_composite}b, it remains relatively small compared to the characteristic scale of other magnetically ordered phases in the phase diagram (c.f. Fig.~\ref{fig:introduction:phasediagram}), suggesting that the overall ordering tendency in this regime is only weak. The characteristic wave vector which describes the evolution of incommensurate spiral order lies on the line connecting the BZ center and the edges of the first BZ ($M$-points), see Fig.~\ref{fig:phasediagram:sf_composite}b. Its precise position along the line shifts continuously within the phase; we discuss the IC1 phase in greater detail in Sec.~\ref{sec:icphases}. Around $0.61 < \alpha/\pi < 0.94$, where the Kitaev interaction and $\Gamma$ interaction are both finite and AFM, the system transitions into conventional magnetic order, signaled by a distinct breakdown of the RG flow as displayed in Fig.~\ref{fig:phasediagram:characteristicscale_composite}c. The associated structure factor shows dominant peaks on the corners of the extended BZ and sub-dominant peaks in close vicinity to the corners of the first BZ ($K$-points), see Fig.~\ref{fig:phasediagram:sf_composite}c. We refer to this phase as the first vortex (V1) phase; it nucleates around the special point $\alpha_\mathrm{FM}/\pi=0.75$ which is dual to the Heisenberg ferromagnet via an underlying six-sublattice duality transformation~\cite{Chaloupka2015}. Its existence has previously been established also in ED calculations~\cite{Rau2014} and DMRG calculations~\cite{Gohlke2018}. However, in our calculations we also observe a small drift of the sub-dominant peak position, $\mathbf{k}_s$, near the $K$-points. Upon entry at the lower phase boundary, the peak is slightly dislocated from the $K$-point towards the BZ center and it subsequently shifts outwards as $\alpha$ is increased; it crosses the $K$-point approximately when $\alpha$ is tuned to the center of the V1 phase, near the special point $\alpha_\mathrm{FM}$. The overall shift is observed to be small, on the order $|\delta \mathbf{k}_s|/|\mathbf{k}_s|\approx 0.05$. In the vicinity of the AFM Kitaev point, magnetic order is eventually destabilized in favor of the AFM Kitaev spin liquid, which forms the ground state between $0.94 < \alpha/\pi < 1.09$. In analogy to the FM KSL phase, the corresponding structure factor reveals broad maxima around the corners of the extended BZ, resulting from the superposition of three cosine profiles (Fig.~\ref{fig:phasediagram:sf_composite}d). The sequence of phases which follow in the second half of the phase diagram, i.e. for $\alpha/\pi >1$, is remarkably similar to the first half. A small region of antiferromagnetic order ($1.09<\alpha/\pi <1.12$) separates the AFM KSL from a second phase of incommensurate spiral order, the IC2 phase ($1.12<\alpha/\pi <1.34$). In the latter phase, the dominant wave vectors characterizing the incommensurate order continuously shift on the edges of the extended Brillouin zone, between the $\Gamma'$-points and the $M'$-points, see Fig.~\ref{fig:phasediagram:sf_composite}e and Sec.~\ref{sec:icphases} for a more detailed discussion. Subsequently, for a broad parameter regime with Kitaev and $\Gamma$ interactions being mostly ferromagnetic, a second vortex phase is stabilized (V2, $1.38<\alpha/\pi <1.98$), with the possibility of a slim paramagnetic regime in between the IC2 and V2 phases. The V2 phase is associated with a structure factor that is peaked at the Brillouin zone center, with sub-leading maxima appearing on the corners of the first BZ as well as of the extended BZ (Fig.~\ref{fig:phasediagram:sf_composite}f). It nucleates around the special point $\alpha_\mathrm{AFM}/\pi=1.75$, which is dual to the Heisenberg antiferromagnet via a six-sublattice transformation~\cite{Chaloupka2015}. Similar to our observations in the V1 phase, the sub-leading peaks near the $K$-point in the V2 phase show a small drift, whereas the peaks at the $\Gamma$-point and the $\Gamma'$-points remain immobile. Our overall phase diagram holds remarkable similarity to previous zero-temperature ED calculations, which have been performed across the full parameter space on 24-site clusters~\cite{Rau2014}. We emphasize two important benchmarks: (i) First, we compare the stability of the Kitaev spin liquid under perturbation of small $\Gamma$ interactions. Since any finite spin correlations in the unperturbed Kitaev spin liquid are restricted to nearest neighbors only, one can expect that finite-size effects in ED calculations remain small in the vicinity of the pure Kitaev points, and ED results may thus provide good numerical guidance. We find that our pf-FRG calculations correctly reproduce the stability of the Kitaev spin liquid under perturbations of AFM $\Gamma$ interactions, which is approximately the same for the FM KSL and the AFM KSL~\cite{Rau2014,Gohlke2018}, whereas under perturbation of FM $\Gamma$ interactions the AFM KSL is significantly more robust than the FM KSL~\cite{Rau2014}. (ii) Second, we focus on the formation of the magnetic vortex phases V1 and V2. Since these phases nucleate around the special points $\alpha_\mathrm{FM}$ and $\alpha_\mathrm{AFM}$, respectively, where it is known that the magnetic order has a six-site unit cell~\cite{Chaloupka2015}, they can be well captured in ED calculations~\cite{Rau2014} and in DMRG calculations~\cite{Gohlke2018}. Similar to those ED and DMRG results, our pf-FRG calculations correctly capture the extended domain of stability for the V2 phase and the smaller parametric extent of the V1 phase. Our identification of the incommensurate phases IC1 and IC2, however, deviates from previous ED and DMRG results. Furthermore, we observed a small, sub-dominant incommensurability effect in the vortex phases. While the incommensurate phases have not been reported in DMRG calculations, the formation of spiral order has been reported in ED calculations in parametric regimes where pf-FRG observes incommensurate order -- albeit in ED calculations the spiral pitch vectors are naturally locked to momentum points which are compatible with the finite system size~\cite{Rau2014}. In this comparison, it is important to keep in mind that pf-FRG calculations only resolve the system at RG scales down to the flow breakdown. A potential multi-step ordering process below the critical scale $\Lambda_c$ cannot be resolved. In particular, the results at a finite RG scale $\Lambda>0$ incorporate the joint effect of thermal and quantum fluctuations and related order-by-disorder effects, which can be decisively different from results obtained in zero-temperature ED or DMRG calculations. \section{Incommensurate phases} \label{sec:icphases} \begin{figure} \includegraphics[width=\linewidth]{kEvolution_composite.pdf} \caption{{\bf Incommensurate ordering vectors} in the two incommensurate phases IC1 and IC2. The plots show the position $\mathbf{k}_\mathrm{max}$ of the structure factor peak within the Brillouin zone. (a) The peak in the IC1 phase moves continuously on the momentum-space line (indicated as a red arrow in the inset) from the BZ center ($\Gamma$-point, corresponds to relative distance $d_{M\Gamma}=0$) to the BZ edge ($M$-point, corresponds to relative distance $d_{M\Gamma}=1$) as a function of the angle $\alpha$. The dashed lines indicate the phase boundaries of the IC1 phase. (b) Relative distance of the peak in the IC2 phase between the $\Gamma'$-point and the $M'$-point.} \label{fig:icphases:kEvolution_composite} \end{figure} \begin{figure} \includegraphics[width=\linewidth]{cylindergeometry.pdf} \caption{{\bf Finite cylinder geometry}. (a) The rhombic unit cell is indicated by dashed lines. The cylinder extends infinitely in the $a_1$-direction and is assumed to have periodic boundary conditions in the $a_2$-direction. (b) Red lines indicate lines of allowed momenta within the extended BZ for a circumference of 6 lattice sites (3 unit cells). Dashed lines indicate the first BZ. (c) Explicit breaking of symmetry by modulating the exchange constants $(\widetilde{K},\widetilde{\Gamma}) \neq (K,\Gamma)$ along the $x$ and $y$-bonds. } \label{fig:icphases:cylindergeometry} \end{figure} We now turn our attention to the two incommensurate phases, IC1 and IC2. Conventional magnetic long-range order is usually characterized by a single peak (and symmetry-related copies) in the spin structure factor which defines the ordering vector in momentum space, cf. the structure factors of the V1 and V2 vortex phases displayed in Fig.~\ref{fig:phasediagram:sf_composite}. Typically, this ordering vector remains constant within the phase. This is, however, qualitatively different in the incommensurate spiral phases IC1 and IC2: Here, the associated ordering vector evolves continuously within the phase upon variation of the underlying exchange constants, yielding an ordering vector~$\mathbf{k}_\mathrm{max}$ that is dependent on the angle $\alpha$. In the IC1 phase, the ordering vector shifts within the first BZ along the line which connects the BZ center (the $\Gamma$-point) to the mid-point of the BZ edge (the $M$-point). Upon entry of the IC1 phase at $\alpha/\pi \approx 0.15$, the ordering vector $\mathbf{k}_\mathrm{max}$ is located approximately in the middle between the $\Gamma$-point and the $M$-point, corresponding to a relative distance $d_{M\Gamma} \approx 0.5$, where $d_{M\Gamma} = \left| \mathbf{k}_\mathrm{max}-\mathbf{k}_\Gamma \right| / \left| \mathbf{k}_M-\mathbf{k}_\Gamma \right|$ with $\mathbf{k}_\Gamma$ the position of the $\Gamma$-point, $\mathbf{k}_M$ the position of the $M$-point, and $|.|$ measures the usual Euclidean distance. When $\alpha$ is increased, the structure factor peak monotonically shifts outwards until it approaches the $M$-point ($d_{M\Gamma}=1$) near the phase boundary at $\alpha/\pi \approx 0.61$. The precise trajectory of the peak is shown in Fig.~\ref{fig:icphases:kEvolution_composite}a. Similarly, in the IC2 phase, the ordering vector continuously shifts along the edge of the extended BZ. Unlike in the IC1 phase, however, the shift is non-monotonic. As shown in Fig.~\ref{fig:icphases:kEvolution_composite}b, at the lower phase boundary ($\alpha / \pi \approx 1.12$) the peak starts out near the mid-point of the extended BZ edge ($M'$-point), $d_{M'\Gamma'} \approx 0.9$, retracts closer towards the extended BZ corner ($\Gamma'$-point) deep inside the IC2 phase, $d_{M'\Gamma'} \approx 0.7$, before extending again towards the $M'$-point near the upper phase boundary ($\alpha / \pi \approx 1.34$), $d_{M'\Gamma'} \approx 0.8$. A continuous shifting of the incommensurate magnetic ordering vector can often be cumbersome for numerical studies on finite lattices: If the lattice is treated with open boundary conditions, boundary effects can become sizable. If, on the other hand, periodic boundary conditions are applied, only a restricted set of momentum points within the Brillouin zone can be resolved (c.f. Fig.~\ref{fig:icphases:cylindergeometry}b). Within the pf-FRG approach, however, we were able to treat the system in the thermodynamic limit where the continuous momentum dependence of the ordering vector is accessible. We now complement our calculations on the infinite system with additional pf-FRG calculations on a semi-infinite cylinder in an attempt to estimate the impact of periodic boundary conditions. We chose a rhombic unit cell as depicted in Fig.~\ref{fig:icphases:cylindergeometry}a and consider a cylinder with a 6-site (3 unit cell) circumference, which has also been employed in previous DMRG calculations~\cite{Gohlke2018,Gohlke2020}. Potential anisotropies in the ground state which may result from the geometric constraints can be quantified via the deviation of the nearest-neighbor spin correlation $\chi^\Lambda_{ij}$ on a $\mu$-bond ($\mu=x,y,z$) from the mean value across all three types of bonds. We thus define the anisotropy measure \begin{equation} \zeta^\Lambda_\mu = \frac{3 \chi^\Lambda_\mu}{\chi^\Lambda_x + \chi^\Lambda_y + \chi^\Lambda_z} - 1 \,, \end{equation} where $\chi^\Lambda_\mu$ is a shorthand notation for the spin correlation $\chi^\Lambda_{ij}$ with $i$ and $j$ being nearest neighbors along a $\mu$-bond. Performing the pf-FRG calculations on the cylinder geometry, we find that the characteristic RG scale $\widetilde{\Lambda}_c$ remains qualitatively unchanged across the full phase diagram. We further observe that the anisotropy in the Kitaev spin liquid remains negligible, since the correlation length is short compared to the cylinder circumference. In the magnetically ordered phases, on the other hand, a finite anisotropy develops, see Fig.~\ref{fig:icphases:anisotropy}. \begin{figure} \includegraphics[width=\linewidth]{anisotropy.pdf} \caption{{\bf Bond anisotropy} on a cylinder with rhombic unit cell and 6-site circumference as a function of the angle $\alpha$ (blue curve), plotted at the characteristic scale $\widetilde{\Lambda}_c$. Solid markers denote $\zeta_x = \zeta_y$, open markers denote $\zeta_z$. The grey shaded regions correspond to the incommensurate phases IC1 and IC2, respectively. The yellow curve shows the anisotropy on an infinite lattice with small explicit symmetry breaking in the exchange constants, $\epsilon = 0.01$ (see text for details).} \label{fig:icphases:anisotropy} \end{figure} Similar to the phase diagram in the thermodynamic limit, there exists a striking resemblance between the first half of the phase diagram $0<\alpha/\pi<1$, and the second half $1<\alpha/\pi<2$: Being negligible in the FM (AFM) KSL phase, the anisotropy becomes finite upon entering the incommensurate phase IC1 (IC2), continuously growing larger as the angle $\alpha$ is increased, reaching its maximum near the phase transition into the V1 (V2) phase. The finite extent of the anisotropy into the V1 and V2 ordered phases may seem surprising, since the phases nucleate around the special points $\alpha_\mathrm{FM}$ and $\alpha_\mathrm{AFM}$, respectively, where it is known that the underlying magnetic order is compatible with the rhombic 6-site cylinder geometry~\cite{Chaloupka2015}. Yet, our observation of finite anisotropy is in agreement with the weak incommensurate shift of sub-leading peaks in the corresponding structure factors away from the special points, which we discussed in Sec.~\ref{sec:phasediagram}. This incommensurate displacement is largest at the phase boundary and vanishes near the special points -- similarly, we observe that the anisotropy vanishes as the special points are approached, cf. Fig.~\ref{fig:icphases:anisotropy}. Having established the different proliferation of anisotropy across the various phases on a cylinder geometry, we now assess the absolute magnitude of the anisotropy. To this end, we compare our results on the cylinder geometry to a system in the thermodynamic limit, where we explicitly break the rotational symmetry in the Hamiltonian. In the model Hamiltonian Eq.~\eqref{eq:model:hamiltonian} we thus replace the exchange constants $K$ and $\Gamma$ on the $x$-bonds and $y$-bonds by modified interactions \begin{equation} \begin{pmatrix} \widetilde{K} \\ \widetilde{\Gamma} \end{pmatrix} = (1+\epsilon)\times \begin{pmatrix} K \\ \Gamma \end{pmatrix} \,, \end{equation} where $\epsilon$ parametrizes the strength of the initial symmetry breaking (cf. Fig.~\ref{fig:icphases:cylindergeometry}c). For a negligible symmetry breaking ($\epsilon = 0.01$) in the initial model we do not observe a substantial RG flow towards an enhanced anisotropy, as shown in Fig.~\ref{fig:icphases:anisotropy}. Instead, the anisotropy measure $\zeta^{\widetilde{\Lambda}_c}_\mu$, plotted at the characteristic scale $\widetilde{\Lambda}_c$, remains small and with little variation across the different phases when compared to the anisotropy arising on the cylinder geometry. We find that the level of anisotropy induced by the cylinder geometry would require a more substantial initial symmetry-breaking of approximately $\epsilon \approx 0.05$ -- though we note that the absolute magnitude of the anisotropy measure is of limited meaning, since within the pf-FRG approach we can only trace its evolution up to the phase transition at the critical scale $\Lambda_c$, and we cannot estimate the value it assumes deep within the ordered phase. Regardless, these results suggest that the tendency of the ground state configuration to become anisotropic in the incommensurate phases IC1 and IC2, but also in the vortex phases V1 and V2, is significantly enhanced on the cylinder geometry, and a careful finite-size analysis is crucial in this setting. \section{Conclusions} \label{sec:conclusions} We have mapped out the phase diagram of the spin-1/2 Kitaev-$\Gamma$ model defined in Eq.~\eqref{eq:model:hamiltonian} as a function of the angle $\alpha$, which parametrizes the ratio of Kitaev and $\Gamma$ interactions, utilizing a pf-FRG approach which is sensitive to both, quantum and thermal fluctuations. Away from the pure Kitaev limit, we have identified four extended, magnetically ordered phases which are stabilized by non-vanishing $\Gamma$ interactions at finite temperature: the incommensurate spiral phases IC1 and IC2, as well as the vortex phases V1 and V2; we further identified two narrow phases with predominantly FM and AFM magnetic correlations, respectively. In comparison to the pronounced breakdown of the RG flow in in the vortex phases V1 and V2, the breakdown in the incommensurate phases IC1 and IC2 is less distinct and happens at a low characteristic scale $\widetilde{\Lambda}_c$, which we associate with a low ordering temperature. In light of previous zero-temperature ED calculations, which revealed a close competition of many competing phases in the parameter regions in question~\cite{Rau2014}, the observation of a suppressed ordering temperature seems plausible. However, some uncertainty about the interpretation of the breakdown of the RG flow remains, since it does not manifest as a true divergence. The classification of a finite kink in the RG flow as either a genuine flow breakdown, or merely a non-analytic feature, introduces some ambiguity -- which is an inherent limitation of the pf-FRG approach. In this work, we followed a classification scheme for the flow breakdown which is based on the finite-size scaling behavior of the RG flow and has proven useful in previous studies~\cite{Kiese2020a}. Yet, a more rigorous classification would be desirable, since even the finite-size scaling approach cannot fully resolve all ambiguity and could, in principle, overestimate magnetic ordering tendencies. Such a rigorous approach seems within reach: Only recently, a truncation of the flow equations has been proposed which goes beyond the standard pf-FRG truncation employed here. For Heisenberg-like quantum spin models, it was demonstrated that this so-called \emph{multiloop} pf-FRG scheme can significantly sharpen the signature of the flow breakdown and consequently reduce uncertainty~\cite{Kiese2020,Thoenniss2020}. It would thus be an exciting project for future research to generalize the multiloop truncation to microscopic spin models with reduced symmetry, akin to the one studied here. Regardless of their eventual stability, we were able to identify the leading magnetic ordering channels in the thermodynamic limit and explicitly resolve the role of incommensurate magnetic correlations, which could only be speculated on in previous finite-size calculations. Most notably, we showed that large portions of the phase diagram, namely the IC1 and IC2 regions, are governed by incommensurate magnetic correlations which continuously evolve under variation of the angle $\alpha$. On a more subtle note, in the vortex phase V1 (V2), we observed a small incommensurate drift of sub-leading peaks around the corners of the Brillouin zone which vanishes near the special point $\alpha_\mathrm{FM}$ ($\alpha_\mathrm{AFM}$), where the Kitaev-$\Gamma$ model becomes dual to the Heisenberg ferromagnet (antiferromagnet). In order to aid the interpretation of our results and to connect to previous zero-temperature numerical results on finite lattices, obtained e.g. by ED or DMRG calculations, we further performed pf-FRG calculations on a semi-infinite cylinder. We found that a significant lattice anisotropy in the two-spin correlation function arises if the underlying magnetic order is incompatible with the periodic boundary conditions of the cylinder geometry. The latter is naturally the case for incommensurate magnetic order, i.e. in the incommensurate phases IC1 and IC2. Yet, we also observed the anisotropy to extend into the vortex phases V1 and V2, which we associate with the weak incommensurability effect of sub-dominant peaks showing a small drift near the corners of the Brillouin zone. The anisotropy vanishes concurrently with the displacement of sub-dominant peaks when the special point $\alpha_\mathrm{FM}$ or $\alpha_\mathrm{AFM}$, respectively, is approached. Going beyond the scope of our current work, where we focused on the minimal Kitaev-$\Gamma$ model for a general set of Kitaev honeycomb materials, it would be instructive to extend the analysis to cover more specific material parameters, informed by \emph{ab initio} calculations, and potentially including Heisenberg and $\Gamma'$ interactions. Incorporating these extra interactions in the pf-FRG approach is straight-forward. Eventually, it would also be interesting to study the related model on the hyperhoneycomb lattice, which is relevant to the Kitaev material $\beta$-\ce{Li2IrO3} -- in a three-dimensional setting, the pf-FRG approach would have a decisive advantage over other numerical techniques like ED or DMRG, which are severely limited by finite system sizes. \begin{acknowledgments} We thank Matthias Gohlke for helpful discussions. Parts of the numerical simulations were performed on the Cedar cluster, hosted by WestGrid and Compute Canada. This work is supported by the NSERC of Canada and the Center for Quantum Materials at the University of Toronto. YBK is also supported by the Killam Research Fellowship from the Canada Council for the Arts. \end{acknowledgments}
\section{Introduction and preliminaries} A graph or digraph is \emph{simple} if there are no loops or parallel edges. For a simple digraph $G$ and a vertex $v \in V(G)$, let $\delta^+(v)$ denote the number of out-neighbors of $v$ in $G$. A famous conjecture in graph theory is the following, due to Caccetta and H\"{a}ggkvist [\ref{ch}]: \begin{conjecture}[Caccetta-H\"{a}ggkvist]\label{ch_thm} Suppose $n,k$ are positive integers, and let $G$ be a simple digraph on $n$ vertices with $\delta^+(v) \ge k$ for all $v \in V(G)$; then $G$ contains a directed cycle of length at most $\lceil n/k \rceil$. \end{conjecture} For a graph $G$ and a function $c: E(G) \rightarrow \{1, \dots, |V(G)|\}$, a \emph{rainbow cycle (with respect to $c$)} is a cycle $C$ in $G$ such that for all $e, f \in E(C)$ with $e \neq f$, we have $c(e) \neq c(f)$. We will refer to $c$ as a \emph{coloring} of the edges of $G$.\footnote{Note that $c$ is not required to be a proper edge-coloring.} We say that $c$ has \emph{color classes of size at least $k$} for $k \in \mathbb{N}$ if $|c^{-1}(i)| \geq k$ for all $i \in \{1, \dots, |V(G)|\}$. In [\ref{aharoni}], Aharoni proposes a generalization of Conjecture \ref{ch_thm}: \begin{conjecture}[\cite{aharoni}]\label{aharoni_thm} Let $n,k$ be positive integers, and let $G$ be a simple graph on $n$ vertices. Let $c : E(G) \rightarrow \{1, \dots, n\}$ be a coloring of the edges of $G$ with color classes of size at least $k$; then $G$ has a rainbow cycle of length at most $\lceil n/k \rceil$. \end{conjecture} In a recent paper, Devos et al.\ [\ref{devos}] prove that Conjecture \ref{aharoni_thm} is true for $k=2$: \begin{thm}[\cite{devos}]\label{devos_thm} Let $G$ be a simple graph on $n$ vertices, and let $c$ be a coloring of the edges of $G$ with color classes of size at least $2$; then there exists a rainbow cycle of length at most $\lceil n/2 \rceil$. \end{thm} We also make use of the following results due to Bollob\'{a}s and Szemer\'{e}di [\ref{bollobas}] and Shen [\ref{shen}], respectively. The first deals with the girth of a simple graph, while the second is an approximate result for Conjecture \ref{ch_thm}. In this paper, $\log$ denotes the logarithm with base $2$. \begin{thm}[\cite{bollobas}]\label{bollobas_thm} For all $n \ge 4$ and $k \ge 2$, if $G$ is a simple graph on $n$ vertices with $n+k$ edges, then $G$ contains a cycle of length at most $$\frac{2(n+k)}{3k}(\log k+\log \log k + 4).$$ \end{thm} \begin{thm}[\cite{shen}]\label{shen_thm} Let $G$ be a simple digraph with $\delta^+(v) \ge k$ for all $v \in V(G)$. Then $G$ contains a directed cycle of length at most $\lceil n/k \rceil + 73$. \end{thm} \section{Main result} Our main result is the following: \begin{thm}\label{main} Let $k > 1$ be an integer, and let $G$ be a graph. Let $c$ be a coloring of the edges of $G$ with color classes of size at least $301k \log k$. Then $G$ contains a rainbow cycle of length at most $\lceil n/k \rceil$. \end{thm} \Proof We proceed by induction on the number of vertices. Let $f(k) = 7k \log k$, and let $G$ be a graph on $n$ vertices. Let $c$ be a coloring of the edges of $G$ with color classes of size at least $43f(k)$. Suppose for a contradiction that there is no rainbow cycle of length at most $\lceil n/k \rceil$. Note that $G$ has at least $43f(k)n$ edges, and therefore, $n > 43f(k)$. For $v \in V(G)$ and $i \in \{1, \dots, n\}$, we say that $i$ \emph{is dominant at} $v$ if $v$ is incident with at least $7f(k)$ edges $e$ such that $c(e) = i$. We call a vertex $v \in V(G)$ \textit{color-dominating} if there exists $i \in \{1, \dots, n\}$ such that $i$ is dominant at $v$. We call a color $i \in \{1, \dots, n\}$ \textit{vertex-dominating} if there exists a vertex $v \in V(G)$ such that $i$ is dominant at $v$. Let us say that $H \subseteq V(G)$ is \textit{nice} if \begin{itemize} \item for every vertex-dominating color $i \in \{1, \dots, n\}$, there is a vertex $v \in V(G) \setminus H$ such that $i$ is dominant at $v$; and \item there are at most $|H|$ colors $i \in \{1, \dots, n\}$ such that $i$ is not vertex-dominating and for all $e \in c^{-1}(i)$, at least one end of $e$ is in $H$. \end{itemize} \lem{\label{lemma1} If there is a nice set $H \subseteq V(G)$ with $6f(k) \le |H| < n$, then there is a nice set $H' \subseteq V(G)$ with $|H'| = \lceil 6f(k) \rceil$.} We remove vertices from $H$ one-by-one such that the remaining set is nice. Suppose that we have removed $j \ge 0$ vertices from $H$, leaving a nice set $H_j$ with $|H_j| > \lceil 6f(k) \rceil$. Let $C_j$ be the set of colors $i \in \{1, \dots, n\}$ which are not vertex-dominating and also do not have an edge $e$ with $c(e) = i$ such that both ends of $e$ are in $V(G) \setminus H_j$. From the definition of a nice set, we know $|C_j| \le |H_j|$. If $|C_j| < |H_j|$, then removing any vertex from $H_j$ gives a smaller nice set. So, we may assume that $|C_j| = |H_j|$. If there is a color $i$ in $C_j$ and an edge $e = uv \in c^{-1}(i)$ with $v \in H_j$ and $u \in G \setminus H_j$, then $H_j \setminus \{v\}$ is nice. If there is no such $i \in C_j$, then for every color $i \in C_j$, all edges in $c^{-1}(i)$ have both their ends in $H_j$. Now applying induction to the subgraph of $G$ with vertex set $H_j$ and edge set $c^{-1}(C_j)$ gives a rainbow cycle of length at most $\lceil n/k \rceil$ in $G$, a contradiction. This proves \ref{lemma1}. \lem{\label{lemma2} There is a nice set $H' \subseteq V(G)$ with $|H'| = \lceil 6f(k) \rceil$.} For each vertex-dominating color $i$, we pick a vertex $v_i$ such that $i$ is dominant at $v_i$, and let $S$ be the set of these vertices $v_i$. Let $H=V(G) \setminus S$. Note that $H$ is nice; thus by \ref{lemma1}, we may assume that either $|H| < 6f(k)$ or $|H| = n$. We first consider the case when $|H| = n$. Since $43f(k) \ge 2$, Theorem \ref{devos_thm} guarantees the existence of a rainbow cycle $K$ of length at most $n/2+1$ in $G$. Let $H' = V(G) \setminus V(K)$. Then $H'$ is nice, and $n > |H'| \ge n/2 - 1 \ge 6f(k)$; so by \ref{lemma1}, $G$ contains a nice set of size $\lceil 6f(k) \rceil$. Now we may assume that $|H| < 6f(k)$. We construct a digraph $G'$ with $V(G') = S$, and for all $i, j$ with $v_i, v_j \in S$, there is an arc $v_i \rightarrow v_j$ if $v_iv_j \in E(G)$ and $c(v_iv_j) = i$. Every vertex $v_i$ is incident with at least $7f(k)$ edges $e$ with $c(e) = i$, and since $|H| < 6f(k)$, there are at least $f(k)$ edges $e = v_iu$ with $c(e) = i$ and $u \in S$. Therefore, $\delta^+(G') \geq f(k)$. Now, we claim $n/f(k) + 74 \le n/k$, which is equivalent to $74kf(k) \le n(f(k)-k)$. Since $k \ge 2$, we have $\log(k) \ge 117/301$, and thus $74kf(k) \le 43f(k)(f(k)-k) \le n(f(k)-k)$, as claimed. Then, by applying Theorem \ref{shen_thm} to $G'$ we obtain a directed cycle $K$ of length at most $\lceil n/f(k) \rceil + 73 \le \lceil n/k \rceil$ in $G'$. The edges of $G$ that correspond to arcs of $K$ form a rainbow cycle of length at most $\lceil n/k \rceil$ in $G$, a contradiction. This proves \ref{lemma2}.\bbox{} \lem{\label{lemma3} Let $H \subseteq V(G)$ be a nice set with $|H| = \lceil 6f(k) \rceil$. Then there exists $H' \subseteq H$ such that $|H'| \geq \lceil 2f(k) \rceil$ and such that for at least $n - \lceil{f(k)}\rceil + 1$ colors $i$, at least one edge $e \in c^{-1}(i)$ has both ends in $V(G) \setminus H'$.} Let $C$ be the set of colors $i$ which are not vertex-dominating and for which no edge of $c^{-1}(i)$ has both ends in $V(G) \setminus H$. Since $H$ is nice, it follows that $|C| \le |H| = \lceil 6f(k) \rceil$. Let $D \subseteq C$ be the set of colors $i \in C$ such that there is a vertex $v \in H$ which is incident with all edges in $c^{-1}(i)$ that have one end in $H$ and the other in $V(G) \setminus H$. We claim that $|D| \le \lceil f(k) \rceil - 1$. Indeed, for each color $i \in D$, there are at least $\lceil{36f(k)}\rceil$ edges in $c^{-1}(i)$ with both ends in $H$ since $i$ is not vertex-dominating. If $|D| > \lceil f(k)\rceil - 1$, then we obtain more than $(f(k)-1)(36f(k))$ edges with both ends in $H$. Now, since $k \ge 2$, we have $f(k) \ge 72/23$, and it follows that: $$(f(k)-1)(36f(k)) \ge \frac{49f(k)^2}{2} \ge \frac{(6f(k)+1)^2}{2} \ge \frac{|H|^2}{2}$$ which gives a contradiction. Thus, $|D| \le \lceil f(k)\rceil - 1$. Next, we claim there exists $H' \subseteq H$ such that $|H'| = \lceil 2f(k) \rceil$ and such that for all $i \in \{1, \dots, n\} \setminus D$, there is an edge $e \in c^{-1}(i)$ with both ends in $V(G) \setminus H'$. To see this, we construct a graph $J$ with vertex set $H$ and the following set of edges. For each $i \in C \setminus D$, we choose two vertices $v_1^i, v_2^i \in H$, each incident with an edge in $c^{-1}(i)$ whose other end is in $V(G) \setminus H$; we know from the definition of $D$ that this is possible. Now, the graph $J$ has $|H|$ vertices and at most $|H|$ edges, and so $J$ has a stable set $H' \subseteq V(J)$ of size at least $|V(J)|/3 \geq 2f(k)$; and so $|H'| \geq \lceil{2f(k)}\rceil$. Now, for every color $i \in C \setminus D$, $V(G) \setminus H'$ contains at least one of $v_1^i, v_2^i$, and therefore, there is an edge in $c^{-1}(i)$ with both ends in $V(G) \setminus H'$. Moreover, for every $i \in \{1, \dots, n\} \setminus C$, either $i$ dominates a vertex $v$ in $V(G) \setminus H \subseteq V(G) \setminus H'$ (and so, since $|H'| < 7f(k)$, there is an edge in $c^{-1}(i)$ incident with $v$ whose other end is not in $H'$); or there is an edge in $c^{-1}(i)$ with both ends in $V(G) \setminus H \subseteq V(G) \setminus H'$. Thus, for at least $n - |D| \geq n - \lceil f(k) \rceil + 1$ colors $i$, at least one edge in $c^{-1}(i)$ has both ends in $V(G) \setminus H'$. This proves \ref{lemma3}. \medskip By combining \ref{lemma2} and \ref{lemma3}, we conclude that there exists $H' \subseteq V(G)$ with $|H'| \geq \lceil{2f(k)}\rceil$, and such that for at least $n - \lceil f(k) \rceil + 1$ colors $i$, at least one edge in $c^{-1}(i)$ has both ends in $V(G) \setminus H'$. Let $H''$ be a subgraph of $G$ with vertex set $V(G) \setminus H'$, obtained by taking exactly one edge in $c^{-1}(i)$ with both ends in $V(G) \setminus H'$ for all $i \in \{1, \dots, n\}$ which have such an edge. It follows that $|E(H'')| \geq |V(H'')| + \lceil f(k) \rceil$. Now, we claim that $\frac{2(n+f(k))}{3(f(k))}(\log \log (f(k)) + \log (f(k)) + 4) \leq \frac{n}{k}$. Using $f(k) < n/43$, it suffices to show: $$\frac{88(\log \log (f(k)) + \log (f(k)) + 4)}{129} \le 7\log(k)$$ Let $g(k) = 7\log(k) - \frac{88}{129}(\log \log (f(k)) + \log (f(k)) + 4)$. We have that $g(2) > 0$, and for $k \ge 2$ we have: $$f(k)g'(k) \ln(2) = 49\log(k) - \frac{88}{129}f'(k)\left(\frac{1}{\log(f(k))\ln(2)}+1\right) > 0$$ since for $k \ge 2$ we have: $$f'(k)\left(\frac{1}{\log(f(k))\ln(2)}+1\right) < (7+7\log(k))(3) \le 49\log(k)$$ So $g'(k) > 0$ for $k \ge 2$, and it follows that $g(k) \ge 0$ for $k \ge 2$, as desired. Then, Theorem \ref{bollobas_thm} gives a rainbow cycle of length at most $\frac{2(n+f(k))}{3(f(k))}(\log \log (f(k)) + \log (f(k)) + 4) \leq \lceil \frac{n}{k}\rceil$, a contradiction. This proves Theorem \ref{main}.\bbox{} We have an immediate corollary which gives us a result for the case of $\Omega(n \log n)$ color classes each of size $k$: \begin{cor}\label{maincor} Let $k$ be a positive integer and let $G$ be a simple graph on $n$ vertices. Let $c : E(G) \rightarrow \{1, \dots, t\}$ with $t \geq 303n \log n$, and with $|c^{-1}(i)| \geq k$ for all $i \in \{1, \dots, t\}$. Then $G$ contains a rainbow cycle in $G$ of length at most $\lceil n/k \rceil$. \end{cor} \Proof Note that $t \geq 303n \log n \ge 303n \log k$. Since $303n\log k \ge n \lceil 301 \log k \rceil$, we can partition $\{1, \dots, t\}$ into $n$ parts, each of size at least $\lceil 301 \log k \rceil$; that is, there is a function $f : \{1, \dots, t\} \rightarrow \{1, \dots, n\}$ such that $|f^{-1}(i)| \geq \lceil 301 \log k \rceil$ for all $i \in \{1, \dots, n\}$. By Theorem \ref{main}, applied to $G$ and $f \circ c$, we obtain a rainbow cycle of length at most $\lceil n/k \rceil$ in $G$ with respect to $f \circ c$, which is also rainbow with respect to $c$. This proves Corollary \ref{maincor}.\bbox{} \section*{Acknowledgments} This paper is partially based on research performed at the DIMACS REU 2019, which has been supported by the H2020-MSCA-RISE project CoSP- GA No. 823748. The third author was supported by GAUK 1277018. Part of this research was performed while the third author was at Rutgers University. This material is based upon work supported by the National Science Foundation under Award No.DMS-1802201. We acknowledge the support of the Natural Sciences and Engineering Research Council of Canada (NSERC), [funding reference number RGPIN-2020-03912]. Cette recherche a été financée par le Conseil de recherches en sciences naturelles et en génie du Canada (CRSNG), [numéro de référence RGPIN-2020-03912].
\section{Introduction and Prior Work} \label{sec:intro} Machine learning (ML) models are increasingly trained on data collected by wireless sensor networks, with the goal to perform ML tasks in these networks such as QoS prediction and anomaly detection. ML has undeniably a great potential, but it is not available for free. The benefits of ML must be set in relation to the effort and resources required. Since radio communication resources (spectrum and energy) are generally scarce, there is a strong interest~\cite{jordan2015machine} in resource-saving methods that would allow ML models to be efficiently trained and used in resource-constrained wireless networks. In fact, great efforts have been made in recent years to reduce the communication overhead for training and deploying ML models~\cite{amiri2020machine,ahn2019wireless,mcmahan2017communication,konecny2016federated}. However, for applications in massive networks of IoT devices, it is no longer sufficient to achieve constant or linear improvements, and instead the scaling in the number of users needs to be improved fundamentally, otherwise the system performance may be severely degraded~\cite{gupta2000capacity}. Such improvements can be achieved by abandoning the philosophy of strictly separating the process of communication and application-specific computation. For training of ML models and the computation of predictors, it is usually not necessary to accumulate the full data at a central point. Instead, it suffices to compute a function of the raw data (such as, e.g., the parameters of an ML model that fits the distributed training data). Since the amount of training data scales at least linearly with the number of users in the network while the complexity of the employed ML models could be constant or at least scale much more favorably, the paradigm shift from accumulating all of the data and processing it centrally towards over-the-air computation has the potential to realize fundamental gains in the scaling behavior of the communication cost. Of course, these observations are known and have been used to improve the performance of wireless systems in many scenarios~\cite{gastpar2003source,goldenbaum2013robust,goldenbaum2013harnessing,goldenbaum2014nomographic,nazer2007computation,zhan2009mimo,ordentlich2011practical,nazer2011compute,nazer2016expanding,goldenbaum2016harnessing}. Against this background, in this paper, we advocate application-specific schemes that take into account the underlying task, such as computation of a function, directly at the physical layer. The key ingredients that open up the door to such a paradigm shift in the design of such schemes are provided by a fundamental result~\cite{kolmogorov1957representation,sprecher1965structure,buck1976approximate,buck1982nomographic} stating that every function has a \emph{nomographic representation}. These representations allow us to exploit the \emph{superposition property of the wireless channel} for an efficient function computation over the ``air''. The superposition (or broadcast) property is the ability of the wireless channel to ``form'' (noisy) linear combinations of information-bearing symbols transmitted by different nodes. This property is usually seen as a problem in traditional wireless networks where it is the source for interference between concurrent independent transmissions. If in contrast, nodes cooperate for a common goal of function computation, then the superposition property is in general not a source for interference but rather for \emph{``inference''} which should be exploited to compute functions. Whether the superposition property can be exploited for performance gains strongly depends on errors and uncertainties introduced by the wireless channel, and on how it combines the transmitted signals at the output. In this paper, we focus on the class ${\mathcal F}_{\textrm{\textrm{mon}}}$ consisting of bounded and measurable nomographic functions, where the outer function is restricted in a way that allows for controlling the impact of noise and fading introduced by the channel. We derive bounds on the number of channel uses needed to approximate a function in ${\mathcal F}_{\textrm{\textrm{mon}}}$ up to a desired accuracy and deal with a channel model that may exhibit a certain degree of correlation in noise and fading between users and over time. Pre- and post-processing schemes for function approximation over fast-fading channels appeared in~\cite{kiril}, but no theoretical guarantees are derived. In~\cite{bjelakovic2019distributed}, we derived such theoretical guarantees for the case of independent fading and noise. \cite{liu2020over,dong2020blind} derived theoretical bounds on the error of over-the-air function computation, using either an assumption of known channel state information or of slow fading. The direct application of over-the-air computation techniques to distributed gradient descent has received a lot of attention recently since such techniques can be used to solve the empirical risk minimization problem for ML models such as neural networks in the case of distributed training data without having to collect the training data at a central point~\cite{amiri2020machine,ahn2019wireless,mcmahan2017communication,konecny2016federated}. \subsection{Paper Contributions} Contrary to this prior work, in this paper we do not assume a particular source distribution on the transmitted messages; indeed, we derive uniform bounds that hold independently of how the sources are distributed and therefore also cover the important case of arbitrarily correlated sources. We focus on one-shot approximation of function values, which stands in contrast to a scenario in which the same functions are computed repeatedly, as in the case of the works that focus on the application to network coding. Our channel model is more general than in prior works, since we do not only consider sub-gaussian fading and noise, but generalize the system model from~\cite{bjelakovic2019distributed} to allow for correlations in fading and noise both between users and over time. Due to lack of space, we omit the details on how our results can be applied to ML problems. Two examples of such applications can be found in~\cite{frey2020over}. \section{System Model and Problem Statement} \subsection{System Model} \label{sec:systemmodel} We consider the following channel model with $K$ transmitters and one receiver: For $m=1,\ldots, M$, the channel output at the $m$-th channel use is given by \begin{equation* Y(m)=\sum\nolimits_{k=1}^{K} H_k(m)x_k(m)+ N(m). \end{equation*} $x_k(m)\in \mathbb{C}$ for $k=1,\ldots, K$ and $m=1,\ldots, M$ are the transmit symbols which have to satisfy the peak power constraint $|x_k(m) |^2 \le P$. $H_k(m)$, $k=1\ldots, K$, $m=1,\ldots, M$, are complex-valued random variables such that for every $m=1, \ldots ,M$ and $k=1,\ldots,K$, the real part $H_k^r (m)$ and the imaginary part $H_k^i (m)$ of $H_k(m)$ are zero-mean sub-gaussian\footnote{A random variable $X$ is called \emph{sub-gaussian} if $\subgaussnorm{X} := \inf \{t > 0: \forall \lambda \in {\mathbb{R}}~~ \mathbb{E}\exp \left( \lambda (X - \mathbb{E} X) \right) \le \exp \left( \lambda^2 t^2 / 2 \right) \}$ is finite. $\subgaussnorm{\cdot}$ defines a semi-norm on the space of sub-gaussian variables and is called the \emph{sub-gaussian norm}. For more details see~\cite{frey2020over,buldygin,wainwright,vershynin}.} random variables with variance $1$. $N(m)$, $m=1,\ldots, M$, are complex-valued random variables, with both the real and the imaginary parts assumed to be centered and sub-gaussian. \begin{definition} \label{def:user-uncorrelated} We say that the fading is \emph{user-uncorrelated} if for every ${k}_1 \neq {k}_2$, $j \in \{i,r\}$ and ${m}$, the random variables $H^j_{{k}_1}({m})$ and $H^j_{{k}_2}({m})$ are independent. \end{definition} In order to introduce our dependency model for the fading and noise, we define \begin{align} \label{eq:channelvector} {H} := \transpose{({H}(1), \dots, {H}(2{M}))} \end{align} where for ${m} = 1, \dots, {M}$, \begin{align*} {H}(2{m}-1) &:= (H_1^r({m}), \dots, H_K^r({m})) \\ {H}(2{m}) &:= (H_1^i({m}), \dots, H_K^i({m})). \end{align*} So ${H}$ is the vector of all fading coefficients. Similarly, let \begin{align} \label{eq:noisevector} {N} := \transpose{(N^r(1), N^i(1), \dots, N^r({M}), N^i({M}))} \end{align} be the vector of all the instances of additive noise. \begin{assume} \label{assume:correlation-model} There exist a vector ${R}$ of $(2{K}{M} + 2{M})$ independent random variables with sub-gaussian norm at most $1$ and matrices ${A} \in {\mathbb{R}}^{2{K}{M} \times (2{K}{M} + 2{M})}$ and ${B} \in {\mathbb{R}}^{2{M} \times (2{K}{M} + 2{M})}$ such that ${H} = {A} {R}$ and ${N} = {B} {R}$. \end{assume} In the case of ${R}$ distributed i.i.d. standard Gaussian, Assumption~\ref{assume:correlation-model} amounts to a standard representation of arbitrarily correlated (and thus arbitrarily interdependent) multivariate Gaussian vectors. Therefore, by replacing ${R}$ with a vector of independent sub-gaussian entries, we obtain a straightforward generalization of the Gaussian case which specializes to arbitrary correlations (which means that it also covers arbitrary stochastic dependence in the Gaussian case). \begin{definition} \label{def:user-uncorrelated-matrix} We say that a matrix ${A}$ \emph{generates user-uncorrelated fading} if $H = {A} {R}$ is user-uncorrelated according to Definition~\ref{def:user-uncorrelated}. \end{definition} The instantaneous realizations of the fading and noise need not be known at the transmitters, but statistical information on the average noise power and channel gain is necessary. This typically amounts to information about large scale fading at the transmitters only, but not about the small scale fading. While the error bounds depend on the structure of the correlation in fading and noise, the design of the pre- and post-processing operations does not require this knowledge. \subsection{Distributed Approximation of Functions} \begin{figure} \begin{tikzpicture} \coordinate (inK) at (0,0); \coordinate (in2) at (0,2); \coordinate (in1) at (0,3); \node[rectangle,draw] (encK) at (2,0) {$E_K^M$}; \node[rectangle,draw] (enc2) at (2,2) {$E_2^M$}; \node[rectangle,draw] (enc1) at (2,3) {$E_1^M$}; \node[rectangle,minimum height=3.5cm,align=center,draw] (channel) at (4,1.5) {$M$-fold\\channel}; \node[rectangle,draw] (dec) at (6,1.5) {$D_M$}; \coordinate (out) at (8,1.5); \node (vdots) at (.8,1.2) {\Shortstack{. . . . . .}}; \draw[->] (inK) -- (encK) node[midway,above] {$s_K$}; \draw[->] (in2) -- (enc2) node[midway,above] {$s_2$}; \draw[->] (in1) -- (enc1) node[midway,above] {$s_1$}; \draw[->] (encK) -- (encK-|channel.west) node[midway,above] {$x_K^M$}; \draw[->] (enc2) -- (enc2-|channel.west) node[midway,above] {$x_2^M$}; \draw[->] (enc1) -- (enc1-|channel.west) node[midway,above] {$x_1^M$}; \draw[->] (channel) -- (dec) node[midway,above] {$Y^M$}; \draw[->] (dec) -- (out) node[midway,above] {$\tilde{f}$}; \end{tikzpicture} \caption{System model. $E_1^M, \dots, E_K^M$ are randomized pre-processing functions, and $D^M$ is the post-processing function.} \label{fig:system} \end{figure} Our goal is to approximate functions $f: {\mathcal{S}}_1\times \ldots \times {\mathcal{S}}_K\to{\mathbb{R}}$ in a distributed setting. The sets ${\mathcal{S}}_1,\ldots {\mathcal{S}}_K\subseteq {\mathbb{R}} $ are assumed to be closed and endowed with their natural Borel $\sigma$-algebras ${\mathcal{B}}({\mathcal{S}}_1),\ldots ,{\mathcal{B}}({\mathcal{S}}_K)$, and we consider the product $\sigma$-algebra ${\mathcal{B}} ({\mathcal{S}}_1)\otimes \ldots \otimes {\mathcal{B}}({\mathcal{S}}_K)$ on the set $ {\mathcal{S}}_1\times \ldots \times {\mathcal{S}}_K $. Furthermore, the functions $f: {\mathcal{S}}_1\times \ldots \times {\mathcal{S}}_K\to{\mathbb{R}}$ under consideration are assumed to be measurable. A Distributed Function Approximation scheme (DFA) consists of pre- and post-processing functions as depicted in Fig.~\ref{fig:system}. So in order to approximate $f$, the transmitters apply their pre-processing maps to $(s_1,\ldots, s_K)\in {\mathcal{S}}_1\times \ldots \times {\mathcal{S}}_K$ resulting in $E_1^M (s_1), \ldots, E_K^M(s_K)$ which are sent to the receiver using the channel $M$ times. The receiver observes the output of the channel and applies the recovery map $D^M$. The whole process defines an estimate $\tilde{f}$ of $f$. Let $\varepsilon > 0,\delta \in (0,1)$ and $f: {\mathcal{S}}_1\times \ldots \times {\mathcal{S}}_K\to{\mathbb{R}} $ be given. We say that $f$ is $\varepsilon$-approximated after $M$ channel uses with confidence level $\delta$ if there is a DFA $(E^M,D^M)$ such that the resulting estimate $\tilde{f}$ of $f$ satisfies \begin{equation}\label{eq:eps-delta-approx} \mathbb{P}( | \tilde{f} (s^K)- f(s^K) |\ge \eps )\le \delta \end{equation} for all $s^K:= (s_1, \ldots , s_K) \in {\mathcal{S}}_1\times \ldots \times {\mathcal{S}}_K $. Let $M(f, \varepsilon, \delta)$ denote the smallest number of channel uses such that there is an approximation scheme $(E^M, D^M)$ for $f$ satisfying (\ref{eq:eps-delta-approx}). We call $M(f, \varepsilon, \delta)$ the communication cost for approximating a function $f$ with accuracy $\varepsilon$ and confidence $\delta$. \subsection{The class of functions to be approximated} \begin{definition} \label{def:Fmon} A measurable function $f: {\mathcal{S}}_1\times \ldots \times {\mathcal{S}}_K\to {\mathbb{R}}$ is said to belong to ${\mathcal F}_{\textrm{\textrm{mon}}}$ if there exist bounded and measurable functions $(f_k)_{k \in \{1, \ldots , K\}}$, a measurable set $D\subseteq {\mathbb{R}}$ with the property $f_1({\mathcal{S}}_1)+\ldots + f_K({\mathcal{S}}_K)\subseteq D$, a measurable function $F:D\to {\mathbb{R}}$ such that for all $(s_1, \ldots , s_K)\in {\mathcal{S}}_1\times \ldots \times {\mathcal{S}}_K$ we have \begin{equation* f(s_1, \ldots, s_K)= F\left( \sum\nolimits_{k=1}^K f_k(s_k) \right ), \end{equation*} and there is a strictly increasing function $\Phi : [0, \infty) \to [0, \infty)$ with $\Phi(0)=0$ and \begin{equation* | F(x)-F(y)|\le \Phi( | x-y | ) \end{equation*} for all $x,y \in D$. We call $\Phi$ an \emph{increment majorant} of $f$. \end{definition} Notable examples of functions in $ {\mathcal F}_{\textrm{\textrm{mon}}}$ include sums and weighted means as well as $p$-norms for $p \geq 1$. For more details and more general characterizations, see~\cite{bjelakovic2019distributed,frey2020over}. We are now in a position to state our main theorem on approximation of functions in $ {\mathcal F}_{\textrm{\textrm{mon}}}$. To this end, we introduce the notion of total spread of the inner part of $ f\in {\mathcal F}_{\textrm{\textrm{mon}}}$ as \begin{equation* \bar{\Delta}(f):=\sum\nolimits_{k=1}^K ( \phi_{\max,k}-\phi_{\min,k}), \end{equation*} along with the $\max $-spread \begin{equation}\label{eq:max-inner-spread} \Delta (f):= \max_{1\le k \le K} ( \phi_{\max,k}-\phi_{\min,k}), \end{equation} where \begin{equation}\label{eq:phi-def-spread} \phi_{\min,k}:= \inf_{s \in \mathcal{S}_k} f_k (s), \quad \phi_{\max,k}:=\sup_{s \in \mathcal{S}_k} f_k( s). \end{equation} We define the relative spread with power constraint $P$ as \begin{equation* \Delta (f\| P):= P \cdot \frac{\bar{\Delta} (f)}{\Delta (f)}. \end{equation*} We use $\operatornorm{\cdot}$ and $\frobeniusnorm{\cdot}$ to denote the operator and Frobenius norm of matrices, respectively. \begin{theorem} \label{th:correlated} Let $f\in {\mathcal F}_{\textrm{\textrm{mon}}}$, $M\in {\mathbb{N}}$, and the power constraint $P \in {\mathbb{R}}_{+} $ be given. Let $\Phi$ be an increment majorant of $f$. Assume the correlation in the fading $H$ and noise $N$ is described by ${A}$ and ${B}$ as described in Assumption~\ref{assume:correlation-model}. Let $A_i \in {\mathbb{R}}^{2{M}{K} \times (2{M}{K} + 2{M})}$ be a matrix which generates user-uncorrelated fading (as described in Definition~\ref{def:user-uncorrelated-matrix}), and let \[ {\eta} := \operatornorm{({A}+A_i)\transpose{({A}-A_i)}}. \] Then there exist pre- and post-processing operations such that \begin{multline} \label{eq:correlated-statement} {\mathbb{P}}\left( \absolute{\bar{f}-f(s_1, \dots, s_{K})} \geq {\varepsilon} \right) \\ \leq \begin{aligned}[t] &2\exp\left( - \frac{{M} \Phi^{-1}({\varepsilon})^2}{ 16F + D + 4\Phi^{-1}({\varepsilon}) L } \right) \\ &+ 2\exp\left( - \frac{{M} \Phi^{-1}({\varepsilon})^2}{ 256 F + 32 \Phi^{-1}({\varepsilon}) L } \right), \end{aligned} \end{multline} where \begin{align*} L &= \left( \sqrt{\bar{\Delta}(f)} \operatornorm{{A}} + \sqrt{\frac{\Delta(f)}{{P}}}\operatornorm{{B}} \right)^2 \\ F &= L \left( \sqrt{\frac{\bar{\Delta}(f)}{{M}}} \frobeniusnorm{{A}} + \sqrt{\frac{\Delta(f)}{{P}{M}}} \frobeniusnorm{{B}} \right)^2 \\ D &= \bigg( 4\sqrt{2{M}} \bar{\Delta}(f) {\eta} + 4 \frac{\Delta(f)}{\sqrt{{P}{M}}} \frobeniusnorm{{A}\transpose{{B}}} \bigg)^2. \end{align*} \end{theorem} \begin{remark} The matrix $A_i$ can be regarded as a user-uncorrelated approximation of ${A}$ and Theorem~\ref{th:correlated} leaves the choice of $A_i$ free. ${\eta}$ is thus a measure for how strong the correlation is between different users. Important special cases are \begin{itemize} \item $A_i = {A}$ (i.e., the fading in the considered channel shows no correlations between the users) and consequently ${\eta} = 0$ \item $A_i = 0$ (i.e., we have no user-uncorrelated approximation of ${A}$) and therefore $ {\eta} = \operatornorm{{A}}^2. $ This shows us that $A_i$ in the sense of Theorem~\ref{th:correlated} always exists. \end{itemize} \end{remark} \begin{cor} (cf. \cite{frey2020over}) In the setting of Theorem~\ref{th:correlated} with uncorrelated fading and noise, i.e., \begin{align*} {A} := \begin{pmatrix} \sigma_F {\mathbf{id}}_{2{M}{K}} & 0 \end{pmatrix} ,~~ {B} := \begin{pmatrix} 0 & \sigma_N {\mathbf{id}}_{2{M}} \end{pmatrix}, \end{align*} we have \begin{multline*} {\mathbb{P}}\left( \absolute{\bar{f}-f(s_1, \dots, s_{K})} \geq {\varepsilon} \right) \\ \leq \begin{aligned}[t] &2\exp\left( - \frac{{M} \Phi^{-1}({\varepsilon})^2}{ 16F' + 4\Phi^{-1}({\varepsilon}) L' } \right) \\ &+ 2\exp\left( - \frac{{M} \Phi^{-1}({\varepsilon})^2}{ 256 F' + 32 \Phi^{-1}({\varepsilon}) L' } \right), \end{aligned} \end{multline*} where \begin{align*} L' &= \left( \sqrt{\bar{\Delta}(f)} \sigma_F + \sqrt{\frac{\Delta(f)}{{P}}}\sigma_N \right)^2 \\ F' &= L' \left( \sqrt{2{K}\bar{\Delta}(f)} \sigma_F + \sqrt{\frac{2\Delta(f)}{{P}}}\sigma_N \right)^2. \end{align*} \end{cor} \begin{cor} \label{cor:communication-cost} As for the approximation communication cost, we have \begin{align}\label{eq:commcost} M(f,\varepsilon,\delta) \leq \frac{\log 4 - \log \delta}{\Phi^{-1}(\varepsilon)^2} \Gamma, \end{align} where \begin{multline*} \Gamma := \max\big( 16F + D + 4\Phi^{-1}({\varepsilon}) L 256 F + 32 \Phi^{-1}({\varepsilon}) L \big). \end{multline*} \end{cor} \begin{proof} We upper bound (\ref{eq:correlated-statement}) as \begin{align*} \mathbb{P} ( | \bar{f} (s^K)- f(s^K) |\ge \eps ) \le 4\exp\left( -\frac{{M} \Phi^{-1}({\varepsilon})^2}{\Gamma} \right), \end{align*} and solve the expression for $M$ concluding the proof. \end{proof} \begin{remark} If $F$ is $C$-Lipschitz continuous, we can replace $\Phi^{-1}(\varepsilon)$ in (\ref{eq:commcost}) and the expression for $\Gamma$ with $\varepsilon/C$. \end{remark} \section{Sketch of the Proof of Theorem~\ref{th:correlated}} In this section, we give the details of the pre- and post-processing steps that realize the error bounds given in the statement of Theorem~\ref{th:correlated}. The complete proof can be found in~\cite{frey2020over}. We only mention here that the proof requires a derivation of a slight variation of the Hanson-Wright inequality~\cite[Theorem 6.2.1]{vershynin}. The scheme presented here is a variation of the one that originally appeared in~\cite{kiril} and is based on concepts and ideas, e.g., from~\cite{gastpar2003source,goldenbaum2013robust,goldenbaum2013harnessing,goldenbaum2014nomographic}, but we extend the theoretical analysis to cover sub-gaussian correlated fading and noise and derive finite blocklength bounds. \subsection{Pre-Processing}\label{sec:pre-proc} In the pre-processing step we encode the function values $f_k(s_k)$, $k=1,\ldots ,K$ as transmit power: \begin{equation*} X_k(m):= \sqrt{{a}_k} U_k (m), 1\leq m\leq M \end{equation*} with ${a}_k = g_k(f_k (s_k))$ and $g_k: [ \phi_{\min,k}, \phi_{\max,k}] \to [ 0, P ] $, \begin{equation* g_k(t):= \frac{P}{\Delta(f)} (t-\phi_{\min,k}), \end{equation*} where $\Delta(f)$ is given in (\ref{eq:max-inner-spread}) and $\phi_{\min,k}$ is defined in (\ref{eq:phi-def-spread}).\\ $U_k (m)$, $k=1, \ldots, K$, $m=1, \ldots ,M$ are i.i.d. with the uniform distribution on $\{-1,+1\}$. We assume the random variables $U_k (m)$, $k=1,\ldots,K$, $m=1\ldots,M$ are independent of $H_k(m)$, $k=1,\ldots, K$, $m=1,\ldots,M$, and $N(m)$, $m=1,\ldots,M$. We write the vector of transmitted signals at channel use ${m}$ as $ {X}({m}) := \left(X_1(m),\dots,X_K(m)\right) $ and combine them in a matrix as \begin{align*} \begin{multlined} {Q} :=\\ \begin{pmatrix} {X}(1) & 0 & 0 & 0 & 0 & \dots & 0 \\ 0 & {X}(1) & 0 & 0 & 0 & \dots & 0 \\ 0 & 0 & {X}(2) & 0 & 0 & \dots & 0 \\ 0 & 0 & 0 & {X}(2) & 0 & \dots & 0 \\ & & & & \ddots & & \\ 0 & 0 & 0 & \dots & 0 & {X}({M}) & 0 \\ 0 & 0 & 0 & \dots & 0 & 0 & {X}({M}) \end{pmatrix}. \end{multlined} \end{align*} \subsection{Post-Processing}\label{sec:post-proc} The vector ${Y}$ of received signals across the ${M}$ channel uses can be written as $ {Y} = {Q} \cdot {H} + {N}, $ where ${H}$ and ${N}$ are given in (\ref{eq:channelvector}) and (\ref{eq:noisevector}). The post-processing is based on the received energy which has the form \begin{align} \label{eq:hwExpression} \vectorNorm{{Y}}^2 &= \transpose{{Y}} {Y} = \transpose{({Q} {A} {R} + {B} {R})} ({Q} {A} {R} + {B} {R}). \end{align} The receiver computes its estimate $\bar{f}$ of $f(s_1, \dots, s_K)$ as \begin{align*} \bar{f} := F(\bar{g}( \vectorNorm{{Y}}^2 - {\mathbb{E}} \vectorNorm{{N}}^2 )), \end{align*} where \[ \bar{g}(t) := \frac{\Delta(f)}{2 \cdot M \cdot P}t + \sum\nolimits_{k=1}^K\phi_{\min,k}. \] \section{Numerical Results} \begin{figure} \centering \vspace{-6pt} \begin{tikzpicture} \begin{axis}[ hide axis, xmin=10, xmax=50, ymin=0, ymax=0.4, legend columns = 4 ] \addlegendimage{mark=triangle}; \addlegendentry{~~mean~~~~}; \addlegendimage{mark=square}; \addlegendentry{~~norm~~~~}; \addlegendimage{}; \addlegendentry{~~DFA~~~~}; \addlegendimage{dashed}; \addlegendentry{~~TDMA}; \end{axis} \end{tikzpicture} \begin{subfigure}[b]{\textwidth} \vspace{6pt} \begin{tikzpicture}[scale=.97] \definecolor{col1}{named}{red} \definecolor{col2}{named}{blue} \begin{semilogyaxis}[ xlabel={noise power in dB}, ylabel={mean squared error}, ymin=1e-6, ymax=1e2, xmin=-20, xmax=50, legend style={legend pos=north west}, legend columns=2 ] \addlegendimage{empty legend}; \addlegendentry{$K$}; \addlegendimage{empty legend}; \addlegendentry{$M$}; \addlegendimage{col1}; \addlegendentry{$40$}; \addlegendimage{empty legend}; \addlegendentry{$10^3$}; \addlegendimage{col2}; \addlegendentry{$2560$}; \addlegendimage{empty legend}; \addlegendentry{$10^5$}; \addplot[col1,mark=triangle] table [x=noise_power_dB, y=dist_users_40_chuses_1000, col sep=comma] {noniid_mean_noise.csv}; \addplot[col2,mark=triangle] table [x=noise_power_dB, y=dist_users_2560_chuses_100000, col sep=comma] {noniid_mean_noise.csv}; \addplot[col1,dashed,mark=triangle,mark options={solid}] table [x=noise_power_dB, y=tdma_users_40_chuses_1000, col sep=comma] {noniid_mean_noise.csv}; \addplot[col2,dashed,mark=triangle,mark options={solid}] table [x=noise_power_dB, y=tdma_users_2560_chuses_100000, col sep=comma] {noniid_mean_noise.csv}; \addplot[col1,mark=square] table [x=noise_power_dB, y=dist_users_40_chuses_1000, col sep=comma] {noniid_norm_noise.csv}; \addplot[col2,mark=square] table [x=noise_power_dB, y=dist_users_2560_chuses_100000, col sep=comma] {noniid_norm_noise.csv}; \addplot[col1,dashed,mark=square,mark options={solid}] table [x=noise_power_dB, y=tdma_users_40_chuses_1000, col sep=comma] {noniid_norm_noise.csv}; \addplot[col2,dashed,mark=square,mark options={solid}] table [x=noise_power_dB, y=tdma_users_2560_chuses_100000, col sep=comma] {noniid_norm_noise.csv}; \end{semilogyaxis} \end{tikzpicture} \subcaption{Mean squared error of the approximation schemes dependent\newline on the channel noise power.} \label{fig:noise} \end{subfigure} \begin{subfigure}[b]{\textwidth} \vspace{6pt} \begin{tikzpicture}[scale=.97] \definecolor{col1}{named}{red} \definecolor{col2}{named}{blue} \begin{loglogaxis}[ xlabel={users}, ylabel={mean squared error}, ymin=1e-6, ymax=1e2, xmin=10, xmax=2560, legend style={at={(.5,.97)}, anchor=north}, legend columns=2 ] \addlegendimage{empty legend}; \addlegendentry{noise}; \addlegendimage{empty legend}; \addlegendentry{$M$}; \addlegendimage{col1}; \addlegendentry{$-20$ dB}; \addlegendimage{empty legend}; \addlegendentry{$10^3$}; \addlegendimage{col2}; \addlegendentry{$20$ dB}; \addlegendimage{empty legend}; \addlegendentry{$10^5$}; \addplot[col1,mark=triangle] table [x=users, y=dist_noise_-20.0_chuses_1000, col sep=comma] {noniid_mean_users.csv}; \addplot[col2,mark=triangle] table [x=users, y=dist_noise_20.0_chuses_100000, col sep=comma] {noniid_mean_users.csv}; \addplot[col1,dashed,mark=triangle,mark options={solid}] table [x=users, y=tdma_noise_-20.0_chuses_1000, col sep=comma] {noniid_mean_users.csv}; \addplot[col2,dashed,mark=triangle,mark options={solid}] table [x=users, y=tdma_noise_20.0_chuses_100000, col sep=comma] {noniid_mean_users.csv}; \addplot[col1,mark=square] table [x=users, y=dist_noise_-20.0_chuses_1000, col sep=comma] {noniid_norm_users.csv}; \addplot[col2,mark=square] table [x=users, y=dist_noise_20.0_chuses_100000, col sep=comma] {noniid_norm_users.csv}; \addplot[col1,dashed,mark=square,mark options={solid}] table [x=users, y=tdma_noise_-20.0_chuses_1000, col sep=comma] {noniid_norm_users.csv}; \addplot[col2,dashed,mark=square,mark options={solid}] table [x=users, y=tdma_noise_20.0_chuses_100000, col sep=comma] {noniid_norm_users.csv}; \end{loglogaxis} \end{tikzpicture} \subcaption{Mean squared error of the approximation schemes dependent\newline on the number of participating transmitters.} \label{fig:users} \end{subfigure} \begin{subfigure}[b]{\textwidth} \vspace{6pt} \begin{tikzpicture}[scale=.97] \definecolor{col1}{named}{red} \definecolor{col2}{named}{blue} \begin{semilogyaxis}[ xlabel={channel uses}, ylabel={mean squared error}, ymin=1e-6, ymax=1e2, xmin=1000, xmax=100000, legend style={at={(.97,.3)}, anchor=south east}, legend columns=2 ] \addlegendimage{empty legend}; \addlegendentry{noise/dB}; \addlegendimage{empty legend}; \addlegendentry{$K$}; \addlegendimage{col1}; \addlegendentry{$-20$}; \addlegendimage{empty legend}; \addlegendentry{$40$}; \addlegendimage{col2}; \addlegendentry{$30$}; \addlegendimage{empty legend}; \addlegendentry{$2560$}; \addplot[col1,mark=triangle] table [x=chuses, y=dist_users_40_noise_-20.0, col sep=comma] {noniid_mean_chuses.csv}; \addplot[col2,mark=triangle] table [x=chuses, y=dist_users_2560_noise_30.0, col sep=comma] {noniid_mean_chuses.csv}; \addplot[col1,dashed,mark=triangle,mark options={solid}] table [x=chuses, y=tdma_users_40_noise_-20.0, col sep=comma] {noniid_mean_chuses.csv}; \addplot[col2,dashed,mark=triangle,mark options={solid}] table [x=chuses, y=tdma_users_2560_noise_30.0, col sep=comma] {noniid_mean_chuses.csv}; \addplot[col1,mark=square] table [x=chuses, y=dist_users_40_noise_-20.0, col sep=comma] {noniid_norm_chuses.csv}; \addplot[col2,mark=square] table [x=chuses, y=dist_users_2560_noise_30.0, col sep=comma] {noniid_norm_chuses.csv}; \addplot[col1,dashed,mark=square,mark options={solid}] table [x=chuses, y=tdma_users_40_noise_-20.0, col sep=comma] {noniid_norm_chuses.csv}; \addplot[col2,dashed,mark=square,mark options={solid}] table [x=chuses, y=tdma_users_2560_noise_30.0, col sep=comma] {noniid_norm_chuses.csv}; \end{semilogyaxis} \end{tikzpicture} \subcaption{Mean squared error of the approximation schemes dependent\newline on the number of channel uses.} \label{fig:chuses} \end{subfigure} \caption{Visualization of the simulation results.} \end{figure} We have simulated the Distributed Function Approximation (DFA) scheme for Rayleigh fading channels with varying noise power, number of users and amount of channel resources. The simulations were done for two different functions, with the function arguments in both cases confined to the unit interval $[0,1]$, to highlight different aspects and properties of the scheme: The arithmetic mean function is linear and maps only to the interval $[0,1]$ (which means that no scheme can have an error larger than $1$), while the Euclidean norm function maps to $[0,\sqrt{K}]$ and can show how the DFA scheme deals with nonlinearities. We compare with a simple TDMA scheme, in which each user transmits separately in its designated slot, protecting the analog transmission against channel noise in the same fashion as the DFA scheme, but not sharing the channel use with other transmitters. In the case where the number of channel uses available is much larger than the number of users sharing the resources, this form of a TDMA scheme is of course highly suboptimal, as the transmitters could use source and channel coding to achieve a higher reliability. However, such an approach is infeasible if the number of users is so high in comparison to the number of channel uses that only a few or possibly even less than one channel use is available to each user, and in this work we are mainly interested in the scaling behavior of our schemes in the number of users $K$. Therefore, this comparison provides an insight into the gain achieved by exploiting the superposition properties of the wireless channel while keeping in mind that for the regime of low $K$, there are better coded schemes available. We also remark that the DFA scheme only needs coordination between the transmitters insofar as all users need to transmit roughly at the same time, while a TDMA scheme necessitates an allocation of the channel uses to the individual transmitters, which can be costly in the case of high $K$. The simulations carried out in this section do not consider this scheduling problem and assume for the TDMA scheme that the time slots have already been allocated, and this knowledge is available at both the transmitters and the receiver. If $M < K$, there is not at least one channel use available to each user and the TDMA scheme can therefore not be carried out. We set the error in such cases to the maximum of $1$ or $\sqrt{K}$, respectively. For the simulations, we assume a normalized peak transmitter power constraint of $1$ and channels with fading normalized to a variance of $1$ per complex dimension. The power of the additive noise is given in dB per complex dimension and its negative can therefore be considered as the signal-to-noise ratio (SNR). Each plotted data point is based on an average of $1000$ simulation runs. The messages transmitted by the users are generated in the following way: First, we draw a value $\mu$, which is common to all transmitters, uniformly at random from $[0,1]$. We then draw the messages of all the users from a convex combination of the uniform distributions on $[0,\mu]$ and $[\mu,1]$ where we choose the weights in such a way that each message has expectation $\mu$. The reason for choosing this procedure although the DFA scheme also performs well for more natural distributions such as i.i.d. uniform in $[0,1]$ for all users is that in case of messages distributed according to a known i.i.d. distribution, the problem is too easy in the sense that both the mean and the Euclidean norm concentrate around values that depend only on the distribution and $K$, and therefore even without any communication at all, the function value can be quite accurately guessed if $K$ is large. On the other hand, we intend the DFA scheme for applications in which the messages can be correlated and distributed according to unknown distributions, so we opt for this form of correlation between the messages for the sake of the numerical evaluation. In Fig.~\ref{fig:noise}, we can see that the DFA scheme is at least as good as the TDMA schemes for all the plotted data points and outperforms it in most cases, achieving a gain of up to $30$ dB for $K=2560$. For low powers of the additive noise, the effect of the multiplicative fading dominates, and therefore, the error saturates as the additive noise grows weaker. Fig.~\ref{fig:users} illustrates that the DFA scheme performs significantly better if the number of users is not too low, which is due to the superposition of the signals in the wireless channel resulting in a combined signal strength that grows with the number of users. We can also see the TDMA scheme performing similarly to the DFA scheme for low numbers of users, while quickly deteriorating in performance or even becoming infeasible as their number grows. In Fig.~\ref{fig:chuses}, we can observe the exponential decay of the error as the amount of channel resources used increases. Once again, we can observe that the TDMA scheme performs similarly to DFA for a low number of users, but becomes infeasible for larger $K$. \bibliographystyle{IEEEtran}
\section{Introduction} \label{Sec:Intro} Despite the successes of the cosmological constant plus cold dark matter ($\Lambda$CDM) model at explaining a wide range of cosmological observations, the physical origin of the driver of cosmic acceleration remains still unknown. The $\Lambda$CDM model assumes a constant dark energy (DE) density, with equation of state of $w_{\rm DE}=-1$. This is not the only possible driver of cosmic acceleration, and several others have been proposed (see~\cite{Clifton:2011jh, Silvestri:2009hh, Joyce:2014kja} for reviews). Quintessence~\cite{Ratra:1987rm} is the simplest of these models. It consists of a single scalar field with a canonical kinetic term, a potential that distinguishes different models, and no non-gravitational interactions with other sectors. Quintessence models are able to mimic the effect of the cosmological constant, while also possessing enough degrees of freedom to open up a wide range of theoretical and phenomenological possibilities that can be observed and tested with cosmological data. These considerations make quintessence an interesting prototype for deviations from the $\Lambda$CDM model and have spawned a wide array of theoretical studies of its cosmology (see~\cite{Tsujikawa:2013fta} for a review). These studies range from dynamical analyses to find attractor solutions~\cite{Copeland:1997et} to the classification of different families of potentials into, for example, ``thawing'' and ``freezing'' depending on their cosmological behavior~\cite{Caldwell:2005tm}. Quintessence models are also at the hearth of the Swampland Conjectures which put bounds on their properties, based on string theoretic considerations of cosmic expansion~\cite{Agrawal:2018own, Ooguri:2018wrx}. Much of these studies depend on specific models for the quintessence potential or specific model assumptions. These models have desirable qualities from a theoretical perspective, such as single scale dependence and existence of attractor solutions. Here we take a data first approach to reconstruct the cosmological behavior of quintessence and examine what the data has to say about the various aspects of the model. In particular, we do not assume the monotonicity of the potential, any closed form for the potential, or the existence of an attractor. Exploiting the Effective Field Theory of Dark Energy~\cite{Gubitosi:2012hu, Bloomfield:2012ff} (see~\cite{Frusciante:2019xia} for a review) and following the strategy outlined in~\cite{Raveri:2019mxg}, we reconstruct the family of quintessence models permitted by the data. We use a comprehensive array of cosmological observations to constrain different aspects of quintessence models that have been previously discussed only theoretically. In doing so, we also investigate what each piece of cosmological observable tells us, what the limiting factors are in our ability to constrain such theories, and what future data may be able to tell us about these theories. The paper is organized as follows. In Sec.~\ref{Sec:Theory} we briefly review quintessence models and the model properties that we will be reconstructing from data. In Sec.~\ref{Sec:Methods} we review the data reconstruction methods and the datasets used for this work. We present our results in full in Sec.~\ref{Sec:Results} and we conclude with a summary of our results and discussion in Sec.~\ref{Sec:Conclusions}. \section{Quintessence reconstruction} \label{Sec:Theory} The quintessence model of dark energy consists of a scalar field $\phi$ with a standard kinetic term and a potential $V(\phi)$, and is fully characterized by the action: \begin{align} \label{Eq:quintessenceAction} S_\phi \equiv \int d^4x \, \sqrt{-g} \left( \frac12 \nabla_\mu \phi \nabla^\mu \phi - V(\phi) \right) \,. \end{align} This is added to the Einstein-Hilbert action for gravity and the total matter action to give a working cosmological model. The dynamical behavior of a FRW background is given by the two Friedmann equations for $\mathcal{H} \equiv d \ln a / d\tau $ in conformal time $\tau$, and the scalar field equation of motion: \begin{align} \label{Eq:FRWequations} & 3 M_P^2 \mathcal{H}^2 = \frac{\dot{\phi}^2}{2} + V(\phi) a^2 + \rho_{\rm m} a^2 \,, \nonumber \\ & 6 M_P^2 \dot{\mathcal{H}} = -2 \dot{\phi}^2 +2 V(\phi) a^2 -(\rho_{\rm m} + 3 P_{\rm m} )a^2 \,, \nonumber \\ & \ddot{\phi} +2 \mathcal{H} \dot{\phi} + a^2 \frac{\partial V}{\partial \phi} = 0 \,, \end{align} where the dot represents a derivative with respect to conformal time; the subscript $\rm m$ indicates a sum over all matter species that, in total, have density $\rho_{\rm m}$ and pressure $P_{\rm m}$, and evolve according to their continuity equations; $M_P^2 = 1 / (8\pi G_N)$ denotes the Planck mass. Note that any solution satisfying the first two equations will also satisfy the third equation. The expansion history of a given model for the potential is fully determined by the field boundary conditions $(\phi_0, \dot{\phi}_0)$ at a given time. These two boundary conditions are effectively extra parameters of quintessence models, in addition to the parameters specifying the potential. The $\Lambda$CDM limit of quintessence is given by a constant potential, set to match the value of the cosmological constant, and field initially at rest $\dot{\phi}_0 = 0$. As we can see in Eq.~\eqref{Eq:FRWequations}, there is no explicit dependence on the value of the field and all dependencies go through the quintessence potential. It is then possible to shift the potential, $V(\phi) \rightarrow V(\phi -\phi_c)$, shift boundary conditions and obtain the exact same cosmology. This makes it impossible to design a unique potential as a function of $\phi$ to give the desired expansion history and effectively makes it impossible to perform data reconstructions of $V(\phi)$. This is crucially where it helps to take the approach of the Effective Field Theory of Dark Energy (EFTofDE)~\cite{Bloomfield:2012ff, Gubitosi:2012hu} which, assuming isotropy and homogeneity, parameterizes all deviations from the $\Lambda$CDM background allowed by these symmetries. Quintessence is in the model space covered by the EFTofDE and is described by two free functions of time, denoted $\Lambda$ and $c$, in the action: \begin{align} \label{Eq:EFTBackgroundAction} S_{\Lambda,c} \equiv \int d^4x \sqrt{-g} \left[ \Lambda(\tau) - c(\tau)\,a^2\delta g^{00} \right] \,, \end{align} in addition to the gravity and matter actions. Eq.~\eqref{Eq:EFTBackgroundAction} explicitly breaks time diff invariance which is ultimately what gives the quintessence scalar field as the Stueckelberg field restoring this symmetry. One can build the correspondence between the two actions mapping one into the other with: \begin{align} \label{Eq:quintessenceMapping} \Lambda =&\, \frac{1}{2a^2} \dot{\phi}^2 -V(\phi) \,, \nonumber \\ c =&\, \frac{1}{2a^2} \dot{\phi}^2 \,. \end{align} Friedmann equations are then given by: \begin{align} \label{Eq:EFTFRWequations} 3 M_P^2 \mathcal{H}^2 &= 2 c a^2 - \Lambda a^2 + \rho_{\rm m} a^2 \,, \nonumber \\ 6 M_P^2 \dot{\mathcal{H}} &= -2(c+\Lambda) a^2 - (\rho_{\rm m} + 3 P_{\rm m}) a^2 \,, \end{align} that we can use to verify the mapping relations in Eq.~\eqref{Eq:quintessenceMapping}. We can combine the two Eqs.~\eqref{Eq:EFTFRWequations} to obtain a differential equation for $\mathcal{H}$ as a function of $\Lambda$ only. As discussed in~\cite{Raveri:2017qvt} the dynamics are then fully set by $\Lambda$. Then Eqs.~\eqref{Eq:EFTFRWequations} can be used to determine $c$ so that the relationship between $\Lambda$ and $c$ is consistent with the $\phi$ equation of motion. Since the $V, \ \phi$ formulation and the $\Lambda, \ c$ EFT formulation of quintessence are equivalent, it is possible to compute all quantities of interest from $\Lambda$ and $c$. We start with the equation of state of dark energy that can be computed as: \begin{align} \label{Eq:wde} w_{\rm DE} \equiv \frac{P_{\rm DE}}{\rho_{\rm DE}} \equiv \frac{\frac{1}{2a^2} \dot{\phi}^2 -V}{\frac{1}{2a^2} \dot{\phi}^2 + V } = \frac{\Lambda}{2c-\Lambda} \,. \end{align} In quintessence models this is bounded to be $w_{\rm DE} \geq -1$ by the requirement that kinetic energy density of the scalar field has to be positive~\cite{Vikman:2004dc, Hu:2004kh, Caldwell:2005ai, Creminelli:2008wc}. Following~\cite{Caldwell:2005tm} we can describe quintessence models as ``thawing'' and ``freezing'' by looking at $w_{\rm DE}$ and its time derivative. This forms the $(w_{\rm DE}, w_{\rm DE}^\prime)$ plane that has been thoroughly studied in literature, {\it i.e.}~\cite{Scherrer:2005je, Linder:2006sv, Cortes:2009kc}. ``Thawing'' refers to a scenario in which $\phi$ starts nearly stationary away from the minimum due to the Hubble friction in the early universe. This corresponds to $w_{\rm DE} \sim -1$ and time derivatives $w_{\rm DE}' \sim 0$, where $' = d /d\ln a$. Then, $\phi$ starts to slowly roll down towards the minimum, which lifts $w_{\rm DE}$ above $-1$ with positive time derivatives. ``Freezing'' is the scenario in which the opposite happens: $\phi$ starts already rolling towards the minimum, corresponding to $w_{\rm DE} >-1$. As $\phi$ approaches the minimum, the potential and the Hubble friction slow down the field velocity and $w_{\rm DE}$ approaches -1, settling there asymptotically in the future. The quintessence potential, as a function of time, can be computed as: \begin{align} \label{Eq:Va} V(a) = c - \Lambda \,. \end{align} This quantity is of special interest for building working models of quintessence and, more recently, due to the Swampland Conjectures~\cite{Ooguri:2018wrx, Agrawal:2018own} putting bounds on properties of the potential. Given the difficulties with constructing a positive cosmological constant from the theory space of string theory, recent literature has conjectured that dark energy must be a scalar field that undergoes non-trivial changes throughout cosmic history such that it is decidedly unlike a cosmological constant. These conjectures state that for a single scalar field, in Planck mass units, \begin{align} \label{Eq:SwamplandConj} \abs{\nabla_\phi V}/V \gtrsim \mathcal{O}(1) \quad &\textbf{or} \quad -\nabla_\phi^2 V/V \gtrsim \mathcal{O}(1) \nonumber \\ \abs{\Delta\phi} &\lesssim \mathcal{O}(1) \end{align} The ratio of the absolute value of the gradient of the potential and its value must be bound from below by a number of order unity. Or, the ratio of the second derivative and the potential value must be bound from above by a negative number of order unity. These two conditions rule out behavior that mimics a cosmological constant. In addition, field traversal, $\abs{\Delta\phi}$, must be bounded from above by a number of order unity. For a discussion of the cosmological implications of the Swampland Conjectures see e.g.~\cite{Kinney:2018nny, Raveri:2018ddi}. Both quantities in Eqs.~\eqref{Eq:SwamplandConj} can be computed in terms of $\Lambda$. Suppose that we have $\Lambda$ as functions of e-folds, $N = \ln a$, and we can compute $c$ and their derivatives. Then we can also derive $V$ as a function of e-folds. The quantities of interest evolve as follows: \begin{align} \label{eq:phidir} \frac{d\phi}{d N} = \left(\frac{dN}{d\tau}\right)^{-1} \frac{d\phi}{d\tau}= \frac{\sqrt{2 c a^2}}{\mathcal{H}} \,, \end{align} where we assumed that $\phi$ increases monotonically at least at times of interest. With these we can compute the quantities relevant to the Swampland Conjectures: \begin{align} \frac{\nabla_\phi V}{V} &= \frac1V \frac{dV/dN}{d\phi/dN} = \frac{d \ln V}{dN} \sqrt{\frac{\mathcal{H}^2}{2ca^2}} \,, \nonumber \\ \frac{\nabla_\phi^2 V}{V} &= \frac1V \left( \frac{\partial_N^2 V}{(\partial_N \phi)^2} - \frac{(\partial_N V)( \partial_N^2\phi ) }{(\partial_N\phi)^3} \right) \,, \nonumber \\ \Delta\phi &= \int d\phi = \int_{N_0}^N \frac{\sqrt{2ca^2}}{\mathcal{H}} \, dN \,, \end{align} where $N_0$ is the cosmic time with respect to which one chooses to compute field traversal. Note that these equations highlight that the value of the scalar field has no physical meaning; the quantity relevant for cosmology is its variation. The cosmological dynamics of quintessence models have often been studied using a set of phase space variables~\cite{Copeland:1997et} that describe the field kinetic and potential energy. These were used to study the presence of attractor solutions that mitigate the need to fine-tune quintessence models. Starting from $\Lambda, \ c$ we can compute these as well: \begin{align} \label{eq:dym} x &= \frac{\dot{\phi}}{\sqrt{6} \mathcal{H} } = \frac{1}{\sqrt{6}} \frac{d\phi}{dN} = \sqrt{\frac{ca^2}{3\mathcal{H}^2}} \,,\\ y &= \frac{\sqrt{V} a}{\sqrt{3} \mathcal{H} } = \sqrt{\frac{(c-\Lambda)a^2}{3\mathcal{H}^2}} \,, \end{align} and notice that these variables are defined such that: \begin{align} x^2 + y^2 = \frac{\frac12 \dot{\phi}^2 + V a^2}{3 \mathcal{H}^2} = \Omega_{\rm DE} \leq 1 \,, \end{align} where $x^2$ and $y^2$ represent the contributions of the scalar field kinetic and potential energy respectively. It is impractical to consider the bare value of $\Lambda$ so in the following we consider relative variations with respect to the cosmological constant value of the corresponding $\Lambda$CDM model and define: \begin{align} \frac{\Delta\Lambda}{\Lambda} \equiv \frac{\Lambda(a)}{3(1-\Omega_{\rm m})M_P^2\mathcal{H}_0^2} -1 \,. \end{align} \section{Datasets and methodology} \label{Sec:Methods} To perform the EFT reconstruction we follow the methodology outlined in~\cite{Raveri:2019mxg}. This follows from~\cite{Crittenden:2011aa} and allows one to reconstruct a function of time by only imposing a correlation prior on its time variations. This type of prior enforces smoothness of the reconstructed function and behaves as a low-pass filter that allows slow variations in the reconstructed functions to go through while penalizing fast variations. Similar reconstruction approaches have already been successfully applied to different phenomenological DE/MG properties~\cite{Huterer:1998qv,Saini:1999ba,Huterer:2000mj,Chiba:2000im,Tegmark:2001zc,Huterer:2002hy,Huterer:2006mv,Sahni:2006pa,Mortonson:2008qy,Mortonson:2009hk,Zhao:2012aw,Vanderveld:2012ec,Wang:2015wga,Zhao:2017cud,Miranda:2017mnw,Li:2018nlh,Wang:2018fng,Li:2018dcf}. Following~\cite{Raveri:2017qvt} we impose a minimum correlation length of $\Delta a = 0.3$ and we reconstruct the EFT function $\Delta \Lambda(a) / \Lambda$ in the range $a\in [0.1, 1.0]$, imposing the early times limit that the $\Lambda$CDM scenario be recovered. This is ultimately due to the fact that the theoretical prior for the correlation length that we use was derived in~\cite{Raveri:2017qvt} only at late times. This leaves out early dark energy type models~\cite{Poulin:2018cxd, Lin:2019qug} that we will discuss in a separate paper. Once the reconstruction range and the prior correlation length are fixed we can represent the EFT function of interest as a spline going through a sufficient number of nodes per correlation length. In our reconstruction range we have three full correlation lengths and we pick 15 spline nodes. This ensures that we have five spline nodes per correlation length. Adding more nodes would not change results since sub-correlation length variations are suppressed by the correlation prior. The assumption of a $\Lambda$CDM cosmology at early times influences the first correlation length that spans redshifts greater than $z\sim 1.5$. For this reason we exclude the region $z > 1.5$ when reporting quantitative results. In plots we will highlight with a gray shading the part that is influenced by this constraint. The correlation prior decays exponentially so that one correlation length from the $\Lambda$CDM bound is enough for its impact to be negligible at later times. To perform the quintessence reconstruction we use three different combinations of datasets. We start with a ``baseline'' dataset that includes: the Planck 2018 measurements of CMB temperature and polarization at small (Planck 18 TTTEEE) and large angular scales (lowl+lowE)~\citep{Aghanim:2018eyx, Aghanim:2019ame}; the CMB lensing potential power spectrum in the multipole range $40 \leq \ell \leq 400$~\citep{Aghanim:2018oex}; BAO measurements from BOSS DR12~\cite{Alam:2016hwk}, SDSS Main Galaxy Sample~\cite{Ross:2014qpa}, and 6dFGS~\cite{Beutler:2011hx}. This dataset provides our baseline constraining power on all $\Lambda$CDM cosmological parameters and low redshift distances since geometric degeneracies from the CMB alone are broken. \begin{figure*}[!ht] \centering \includegraphics[width=\textwidth]{Figures/figure_1} \caption{ \label{fig:lambda} The data constraints on $\Delta \Lambda / \Lambda$ as a function of redshift and scale factor. Panel~a) shows the reconstruction obtained by fitting our baseline dataset combination of CMB and BAO measurements; Panel~b) shows the reconstruction with the addition of SN and DES data. In both panels the white line shows the mean reconstructed behavior, solid lines from darkest to lightest show the $68\%$, $95\%$, and $99.7\%$ C.L. regions. The two dashed vertical lines show the redshift of dark matter/dark energy equality, $z_{\rm eq}$, and the redshift when cosmic acceleration begins, $z_{\rm acc}$. The horizontal dashed line shows the $\Lambda$CDM limit of the model. The grey shading highlights the first reconstruction correlation length that is influenced by the assumption that the $\Lambda$CDM model should be recovered at early times. } \end{figure*} In addition to this we consider the Pantheon Supernovae (SN) sample~\cite{Scolnic:2017caz} that provides relative distance measurements in the redshift range $z\in[0.01,2.26]$. Then we add measurements of the clustering and lensing of large scale cosmological structures from the Dark Energy Survey (DES) via its Year 1 dataset~\cite{Abbott:2017wau}. We consider the DES measurements of galaxy clustering, lensing and their cross correlation ($3\times 2$) at large angular scales that are independent of the modeling of non-linear clustering~\cite{Abbott:2018xao}. This ``fiducial'' data set thus includes all datasets in the baseline combination along with SN and DES. We investigate the impact of the Hubble constant tension on the quintessence reconstruction using the SH0ES measurement of the Hubble constant, $H_0=74.03\pm1.42$ (in units of km\,s$^{-1}$\,Mpc$^{-1}$ here and throughout)~\citep{Riess:2019cxk}. Since late-times quintessence models cannot relieve this tension~\cite{Raveri:2018ddi, Benevento:2020fev} we do not include the Hubble constant measurement in the fiducial dataset combination that we use. Further we note that there are other measurements of the Hubble constant that have lower values~\cite{Freedman:2019jwv, Riess:2020fzl} but we do not consider them since they would not alter the results qualitatively. To summarize, we follow the naming convention: \begin{itemize} \item Baseline = Planck 18 TTTEEE + lowl + lowE + CMB lensing + BOSS DR12 BAO + SDSS MGS BAO + 6dFGS BAO \item Fiducial = Baseline + Pantheon SN + DES Y1 $3\times 2$ \item Fiducial + $H_0$ \end{itemize} In addition to the parameters used for the quintessence reconstruction we include the standard 6 parameters of the $\Lambda$CDM model: baryon density $\Omega_b h^2$; cold dark matter density $\Omega_c h^2$; the initial curvature spectrum normalization at $k=0.05$ Mpc$^{-1}$ $A_s$, and its tilt $n_s$; the optical depth to reionization $\tau$; the angular size of the CMB sound horizon $\theta_s$. All these parameters have the usual non-informative priors~\cite{Aghanim:2019ame}. We include all the recommended parameters and priors describing systematic effects in the different data sets we consider. We fix the sum of neutrino masses to the minimal value~(e.g.~\cite{Long:2017dru}). To produce cosmological predictions and compare them to data, we use the EFTCAMB and EFTCosmoMC codes~\cite{Hu:2013twa,Raveri:2014cka}, modifications to the Einstein-Boltzmann code CAMB~\cite{Lewis:1999bs} and the Markov Chain Monte Carlo (MCMC) code CosmoMC~\cite{Lewis:2002ah} respectively. For the statistical analysis of the MCMC results we use GetDist~\cite{Lewis:2019xzd}. We sample the posterior parameter distribution until the Gelman-Rubin convergence statistic~\cite{gelman1992} satisfies $R-1<0.01$ or better. \section{Results} \label{Sec:Results} \subsection{Reconstruction of quintessence} We start with constraints on $\Delta \Lambda / \Lambda$ as it is the quantity that is directly estimated from the data. Other results are derived from the $\Delta \Lambda / \Lambda$ reconstruction along with the standard cosmological parameters. In Fig.~\ref{fig:lambda} we show $\Delta \Lambda / \Lambda$ considering the baseline and fiducial dataset combinations. As we can see in Panel a) the baseline data combination constrains $|\Delta \Lambda / \Lambda| < 15\%$ at $95\%$ C.L. at all times of interest. The constraint that the present day value of $\Delta \Lambda / \Lambda$ should be negative follows from the positive definiteness of the scalar field kinetic energy density. At earlier times there is no such constraint. By comparing the two panels of Fig.~\ref{fig:lambda} we can see that the fiducial data combination is sensibly more constraining, enforcing $|\Delta \Lambda / \Lambda| < 11\%$ at $95\%$ C.L. at all redshifts of interest. This improvement is mostly driven by SN data that span a large redshift range with accurate distance measurements. From the figure we do not see any significant deviation from the $\Lambda$CDM model, and have confirmed that the $\chi^2$ of the fit does not show significant improvement over $\Lambda$CDM for either dataset combination. We note that the mean seems to show deviations from the $\Lambda$CDM model because of non-Gaussianity in the marginalized $\Delta \Lambda / \Lambda$ posterior close to the $\Lambda$CDM limit. We can compute how many quintessence parameters are constrained by data over the prior, as discussed in~\cite{Raveri:2018wln}, by comparing the prior and posterior covariances of the reconstruction parameters, {\it i.e.} the values of $\Delta \Lambda / \Lambda$ at the spline nodes. We find that our baseline data combination constrains four parameters, in addition to the six $\Lambda$CDM parameters. Our fiducial dataset constrains five. We notice that this number is higher than what reported in~\cite{Raveri:2019mxg} because of the updated datasets we use, including the latest release of CMB measurements from Planck and galaxy clustering from DES. This number is also significantly higher than what is commonly used in phenomenological parametrizations of the DE equation of state that are generally limited to one or two extra parameters. This means that these simpler parametrizations, while they might still allow the detection of deviations from $\Lambda$CDM, are not guaranteed to allow the data to express their full constraining power. \begin{figure}[!th] \centering \includegraphics[width = \linewidth]{Figures/figure_2} \caption{ \label{fig:wde} Constraints from data on the dark energy equation of state, $w_{\rm DE}(z)$, as a function of redshift. The colored bands show the 68\% C.L. regions, as a function of time, for the different dataset combinations we consider, as shown in legend. Other figure conventions follow Fig~\ref{fig:lambda}. We note that the model has to have $w_{\rm DE}(z) \geq -1$ to satisfy the theoretical viability requirement of positive kinetic energy density. } \end{figure} We can propagate the constraints on $\Delta \Lambda / \Lambda$ to constraints on $w_{\rm DE}(z)$, as discussed in Sec.~\ref{Sec:Methods}. The results are shown in Fig.~\ref{fig:wde} where we can see the 68\% C.L. constraints on $w_{\rm DE}(z)$ from the different dataset combinations we consider. As we can see for all dataset combinations $w_{\rm DE}(z)$ is forced against the $\Lambda$CDM limit. This limit cannot be crossed since quintessence models require that $w_{\rm DE}(z) \geq -1$ at all times. The baseline data combination pushes toward that boundary since CMB+BAO slightly prefers $w_{\rm DE}(z) < -1$, as noted in~\cite{Aghanim:2018eyx}. Additional datasets do not change this appreciably but are more constraining, especially at late times. In particular a large increase in constraining power results from the addition of the $H_0$ measurement. This reflects the fact that quintessence cannot solve the tension between local and CMB distance calibrations as that would require $w_{\rm DE}<-1$. So the $H_0$ measurement appears to provide more constraining power than is reasonable, which is the reason we exclude it from the fiducial results. At all times the DE equation of state is constrained to be $0 \leq 1+w_{\rm DE} \leq 0.15$ at 95\% C.L. by the baseline dataset and $0 \leq 1+w_{\rm DE} \leq 0.10$ by the fiducial dataset, compatible with the bounds on $\Delta \Lambda / \Lambda$. \begin{figure*}[!ht] \centering \includegraphics[width=\textwidth]{Figures/figure_3} \caption{ \label{fig:thaw} Reconstructed trajectories in the $(w_{\rm DE}, w_{\rm DE}^\prime)$ plane for two different dataset combinations. In both panels the shading represents the number density of trajectories. The arrows indicate the average velocity $(w_{\rm DE}^\prime, w_{\rm DE}^{\prime\prime})$ at a given position. The gray arrows highlight the behavior of the reconstructed trajectories before data constraints enter at $z=1.5$. The red lines enclose the ``thawing'' region from~\cite{Caldwell:2005tm} and the yellow lines enclose the ``freezing'' region. The black dashed line line shows where $w_{\rm DE}^\prime = -3(1-w_{\rm DE}^2)$~\cite{Scherrer:2005je}. Instead of a clear ``freezing'' or ``thawing'' behavior, trajectories reconstructed from the data start in the ``freezing'' region, reach $w_{\rm DE}=-1$, and oscillate around that point as a consequence of the data's preference for $w_{\rm DE} \approx -1$. } \end{figure*} \subsection{$(w_{\rm DE}, w_{\rm DE}^\prime)$ phase space trajectories} \label{Sec:wwp} From the DE equation of state we can reconstruct trajectories in the $(w_{\rm DE}, w_{\rm DE}^\prime)$ phase space, proposed by~\cite{Caldwell:2005tm} in the context of ``freezing'' and ``thawing'' scenarios. In Fig.~\ref{fig:thaw} we show the data constraint on the $(w_{\rm DE}, w_{\rm DE}^\prime)$ plane from the baseline and fiducial datasets. The shading represents the hit-count of how many times the $(w_{\rm DE}, w_{\rm DE}^\prime)$ trajectories passed through a certain bin of the phase space. The arrows represent the average velocity vector of the $(w_{\rm DE}, w_{\rm DE}^\prime)$ trajectories at a given bin. Gray arrows show the behavior of trajectories in the regime where there is no data constraint ($z>1.5$) while the black arrows highlight behavior in the data constrained regime ($z\in [0,1.5]$). The red region is approximately the allowed region for ``thawing'' scenarios and the yellow for ``freezing'' scenarios as described by~\cite{Caldwell:2005tm}. These plots show that in general the reconstructed cosmologies do not appear to follow either the ``freezing'' or ``thawing'' scenarios. This is not to say that we can rule out those scenarios. The constraining power necessary for such a distinction is on the order of $\sigma(w^\prime_{\rm DE} ) \approx 1+w_{\rm DE}$~\cite{Scherrer:2005je, Caldwell:2005tm}. For $z<1.5$ where we actually have data constraints, $1+w_{\rm DE} \lesssim \mathcal{O}(0.01)$ and $\sigma(w^\prime_{\rm DE})\sim \mathcal{O}(0.1)$. That is, the constraining power we have on $w_{\rm DE}^\prime$ is about 1 order of magnitude too weak to rule out either scenarios. Rather, trajectories come in toward $(-1,0)$ from the ``freezing'' region and once that point is reached start circling around that point. In doing so, some trajectories violate the $w_{\rm DE}^\prime > -3(1-w_{\rm DE}^2)$ limit set in~\cite{Scherrer:2005je}. That limit assumes the potential to be monotonically decreasing in $\phi$ whereas our results do not~\cite{Huterer:2006mv}. A sizable portion of the trajectories have non-monotonic potentials, as will be discussed later in relation to the Swampland Conjectures. Fig.~\ref{fig:thaw} highlights one aspect of the DE equation of state reconstruction that was hidden in Fig.~\ref{fig:wde}. Oscillations in $w_{\rm DE}$ weaken integral constraints. Present constraints on $w_{\rm DE}$ come from distance measurements which are related to integrals of $w_{\rm DE}$ instead of its actual value at different redshifts. The phase and frequency of oscillations in $w_{\rm DE}$ are then weakly constrained by data. This is similar in nature to the argument given in~\cite{Maor:2000jy}. Since the data prefers $w_{\rm DE}=-1$ and since physical viability enforces $w_{\rm DE} \geq -1$ the reconstructed $w_{\rm DE}(z)$ oscillates close to the $w_{\rm DE}=-1$ line. In Fig.~\ref{fig:wde} these oscillatory modes in the $w_{\rm DE}$ reconstruction are averaged away and the 68\% C.L. bounds look non-oscillatory. The oscillations are not synchronized across samples, so averaged over many samples the oscillatory behavior is not visible. In the $(w_{\rm DE}, w_{\rm DE}^\prime)$ space these bounces clearly look like circles as in the phase space of the harmonic oscillator. As we add more data constraints, in going from Panel a) to Panel b), we shrink the amplitude of these oscillations and hence the viable volume in phase space. This shows that, in order to distinguish between ``thawing'' and ``freezing'' models, independent of assumptions about the potential, we need to break the intrinsic data degeneracy that allows for oscillatory modes in $w_{\rm DE}(z)$. \begin{figure}[!th] \centering \includegraphics{Figures/figure_4} \caption{ \label{fig:vde} The reconstructed quintessence potential, $V(z)$, as a function of redshift for the fiducial dataset combination. Conventions for the different confidence interval curves follow Fig~\ref{fig:lambda}. Though the $V(z)$ behavior generally resembles a downhill motion of $\phi$, we note that individual $V(z)$ trajectories are not monotonic, as was the case with $w_{\rm DE}$. } \end{figure} \subsection{The Swampland Conjectures and the quintessence potential} We now turn to quintessence physical properties rather than phenomenological quantities. In Fig.~\ref{fig:vde} we show the reconstruction of the quintessence potential $V(z)$ as a function of redshift with the fiducial dataset combination. Other datasets do not qualitatively alter this picture but only quantitatively impact the error bars. As we can see the overall potential scale is set by the required energy density of DE at late times. At earlier times the potential is increasing as the field had to roll downhill. We note that, similarly to what happens for the equation of state, while the averaged reconstruction looks monotonic and smooth the single potential samples are usually not. \begin{figure}[!th] \centering \includegraphics{Figures/figure_5} \caption{ \label{fig:vpv} Reconstruction of the derivative of the quintessence potential, $V_\phi/V$, as a function of redshift for the fiducial dataset combination. The curves showing confidence intervals follow the conventions of Fig~\ref{fig:lambda}. We do not find a $\mathcal{O}(1)$ lower bound to $\abs{V_\phi/V}$ and would need more constraining power to find a $\mathcal{O}(0.1)$ one. } \end{figure} We can now consider the derivatives of the potential that are related to Swampland Conjectures. We start with the part of the conjecture that concerns the first derivative of the potential, shown in Fig.~\ref{fig:vpv}, {\it i.e.} the reconstruction of $V_\phi/V$ from the fiducial data set. With present constraining power, we find at the 68\% confidence level that $-1 \lesssim V_\phi/V \lesssim 0$ across $z\in [0,1.5]$. Consistent with prior work~\cite{Raveri:2018ddi}, there is no $\mathcal{O}(1)$ lower bound to $\abs{V_\phi/V}$. We need more constraining power to obtain a possible upper bound of $\mathcal{O}(0.1)$. We have tested the second derivative of the potential but found that the constraints are weak. This is understandable since $w_{\rm DE}$ is constrained by distance measurements. Distances are given by integrals of $w_{\rm DE}$. $w_{\rm DE}$ and $V_{\rm DE}$ are related algebraically, therefore $V_{\phi\phi}$ enters at the level of the third derivative of measured quantities. In a polynomial expansion third derivatives are related to the fourth coefficient so our weak constraining power on the second derivative of the potential is a reflection of the fact that present datasets measure 4 to 5 extra dark energy parameters -- constraints on the last two parameters are still weak. We can combine the two potential constraints in Eq.~\eqref{Eq:SwamplandConj} to see that one scenario unambiguously forbidden by this Swampland Conjecture is a local minimum in $V(\phi)$ at $V >0$ with $\abs{V^\prime/V} = 0$ and $V^{\prime\prime}/V > 0$. We find that the $V(\phi)$ implied by about 66\% of our MCMC samples violate the conjecture as they possess a local minimum for $z\in [ 0,1.5]$. This number allows us to conclude with more concreteness that our results do not clearly favor either compliance or non-compliance with the Swampland potential constraints. \begin{figure}[!t] \centering \includegraphics{Figures/figure_6} \caption{ \label{fig:phiat} The data reconstructed scalar field excursion, $\Delta \phi(z) = \phi(z) - \phi(z=0)$, as a function of redshift for the fiducial dataset combination. Figure conventions follow Fig.~\ref{fig:lambda}. To $95\%$ C.L., we find $\abs{\Delta\phi} < 0.2$, between $z=0$ and $1.5$, compatible with the Swampland Conjectures. This result is qualitatively robust to changing dataset combination. } \end{figure} We then consider the second part of the Swampland Conjectures which imposes an order unity upper bound on field traversal, $\Delta \phi \lesssim \mathcal{O}(1)$. This is tested in Fig.~\ref{fig:phiat} that computes field excursion from the present day value of the field. With current data, the constraints are already of order $0.1$, so we can make a more definite statements about the $\Delta \phi$ Swampland Conjecture than we can about the potential Swampland Conjecture. We find that at all redshifts of interest $|\Delta\phi| < 0.23$ at 95\% C.L. for our baseline dataset combination and $|\Delta\phi| < 0.20$ at 95\% C.L. for the fiducial data set, both of which are bounds compatible with the Swampland Conjectures. \begin{figure}[!th] \centering \includegraphics[width=\linewidth]{Figures/figure_vphi.pdf} \caption{ \label{fig:vphi} $V(\Delta \phi)$ reconstructed for the fiducial dataset combination. Shading represents the number density of $(\phi,V)$ trajectories and in addition five randomly selected reconstructions are shown by the curves. With current data, we cannot rule out non-monotonicity of $V(\phi)$. Note also that larger values of field excursion are correlated with larger values of the potential. } \end{figure} With knowledge of $\Delta \phi(z)$ as shown in Fig.~\ref{fig:phiat} and $V(\phi(z))$ as shown in Fig.~\ref{fig:vde}, it is possible to reconstruct $V(\Delta \phi)$ without reference to $z$. The results are shown in Fig.~\ref{fig:vphi}. Note that, as a consequence of translation invariance of the potential, cosmological observations cannot constrain $V(\phi)$ but only $V(\Delta\phi)$, {\it i.e.} the part of the potential that is traversed during cosmological evolution. The $(\phi, V)$ plot is a useful tool for examining general characteristics of the potential. The potential favored by the data appears to have, on average, a negative first derivative and a positive second derivative throughout $z\in [0,1.5]$. However, as Fig.~\ref{fig:thaw} hints, 69\% of our MCMC samples imply at least one extrema in their $V(\phi)$ reconstructions. Fig.~\ref{fig:vphi} shows five randomly selected samples, which typically have bumps and plateaus -- though at different values of $ \Delta \phi$. With current datasets we cannot rule out small bumps in $V(\phi)$ though the average behavior seems monotonic. \begin{figure}[!th] \centering \includegraphics{Figures/figure_7} \caption{ \label{fig:dym} The quintessence phase space as reconstructed from our fiducial dataset combination. The shading represents number density of trajectories and arrows the average velocity ($dx/da, dy/da$) at a given position in phase space. The gray shaded area indicates the region with of no data constraints. Since $x^2+y^2 = \Omega_{\rm DE}$ different solid circles indicate relevant values of $\Omega_{\rm DE}$ as shown in legend. The general flow in phase space is upwards, compatible with increasing DE density as a function of time. Using k-means clustering we find no definitive attractor, as explained in the text. } \end{figure} \subsection{Dynamical phase space trajectories} We can now look at the phase space of quintessence as defined in Eq.~\eqref{eq:dym}. This is shown in Fig.~\ref{fig:dym} for our fiducial dataset combination. Like in the $(w_{\rm DE}, w_{\rm DE}^\prime)$ phase space diagram, the background color indicates number density of trajectories in phase space, as allowed by data constraints, and the arrows are the average velocity in phase space at a given position. Since $x^2+y^2 = \Omega_{\rm DE}$, different solid lines indicate its early time value at $z=1.5$ and today. The gray box is the region where trajectories are not constrained by data. As we can see the phase space of quintessence is heavily constrained by data and there is no clear attractor to which the trajectories seem headed. Using the k-means clustering algorithm to detect clusters of paths and their representative dominant paths in the phase space, we find that the dominant paths' end points are scattered across the $\Omega_{\rm DE}=0.69$ line as one may expect from the arrows. This means that the data constraints do not appear to favor an attractor solution. The general flow is upwards and only slightly to the right, meaning that it is mostly the potential energy of $\phi$ that comes to dominate the universe. The conclusions are mostly the same with other dataset combinations. More constraining combinations just reduce the viable volume of phase space and does not change conclusions qualitatively. \section{Conclusions} \label{Sec:Conclusions} Using state of the art cosmological observations we have performed a fully non-parametric EFT based reconstruction of quintessence models from data. In particular, we make no assumptions about the potential of the scalar field. We show that our methodology and current data constraints are robust enough to study various theoretical aspects of quintessence. The datasets used are the CMB measurements from the Planck satellite, BAO measurements from BOSS, measurements of supernovae distances, and galaxy clustering and lensing from DES. The reconstructed equation of state of DE, $w_{\rm DE}$, does not deviate from $-1$ at late times by more than $10\%$, though it is given enough degrees of freedom to do so. Specifically for our fiducial choice of datasets we show that in the redshift range $z<1.5$, at 95\% C.L. $0 \leq 1+w_{\rm DE} \leq 0.10$, with the $w_{\rm DE}>-1$ constraint coming from the theoretical prior for single field quintessence models. Furthermore, reconstructing the ($w_{\rm DE} , w_{\rm DE}^\prime$) phase space, in Fig~\ref{fig:thaw}, we find that present cosmological data does not simply follow the classification in ``freezing'' or ``thawing'' scenarios. Instead, the preferred evolution of $w_{\rm DE}$ is such that it oscillates with the minimum close to $w_{\rm DE} = -1$. We discuss in Sec.~\ref{Sec:wwp} how the reconstructed phase space trajectories are sensitive to different assumptions in the literature about monotonicity of $V(\phi)$. In order to identify and discriminate between ``freezing'' and ``thawing'' scenarios we find that the constraints on the time derivative of the DE equation of state will need to be an order of magnitude stronger, so such a task awaits major improvements in the available data. From the equation of state of DE we have reconstructed the quintessence potential and obtained general constraints on Swampland Conjectures in the single field dark energy case. Regarding the conjecture on the slope of the potential $V(\phi)$, we find no evidence for an order unity lower bound on $\abs{V_\phi/V}$, as in Fig.~\ref{fig:vpv} -- consistent with our finding of no significant detection of deviations from $\Lambda$CDM. On the other hand an {\it upper} bound of $\mathcal{O}(0.1)$ could be obtained in the coming years as datasets with increased constraining power will become available. Current data constraints are also not strong enough to provide meaningful bounds on the alternative conjecture $- V_{\phi\phi}/V \gtrsim \mathcal{O}(1)$. Our fiducial dataset combination is, however, constraining enough to confirm the conjecture that field traversal is bound from above: we find $|\Delta\phi| < 0.20$ at 95\% C.L. We have shown the fully reconstructed dark energy phase space, Fig.~\ref{fig:dym}, and find that the viable region is severely constrained towards the slow roll limit. That is, the potential energy is dominant compared to the kinetic energy of the scalar field. We find no indication of the existence of an attractor towards which the phase space flows are headed. These general conclusions apply not just for our fiducial dataset choice but are stable to the inclusion or removal of its components. More and more accurate data in the low-z, late-time regime will add constraining power, strengthening the results above. In particular, as shown in Sec.~\ref{Sec:Results}, the preferred behavior of $w_{\rm DE}$ is to oscillate but the phase is entirely unconstrained. This occurs because present data constrain distances, {\it i.e.} integrals of $w_{\rm DE}$, at the first derivative level. Planned direct measurements of $H(z)$ from BAO surveys would allow us to constrain the phase of $w_{\rm DE}$ oscillations as well, and better constrain $V_{\phi\phi}/V$. The methodology used here to constrain the EFTofDE and then translate the constraints to covariant quantities could also be used to shed light on other Swampland Conjecture-like considerations, such as those for non-canonical kinetic terms considered in~\cite{Solomon:2020viz}, as well as the forms of general Horndeski coupling functions. \acknowledgments We thank Dragan Huterer, Justin Khoury, Eric Linder, Levon Pogosian and Paul Steinhardt for helpful comments. MR is supported in part by NASA ATP Grant No. NNH17ZDA001N, and by funds provided by the Center for Particle Cosmology. BJ is supported in part by the US Department of Energy Grant No. DE-SC0007901. Computing resources are provided by the University of Chicago Research Computing Center through the Kavli Institute for Cosmological Physics at the University of Chicago. \bibliographystyle{apsrev4-1}
\section{Introduction} A most important issue in the structure analysis of disordered materials is to find suitable and simple representation(s) of the studied material that can emphasize its characteristic property. Considering orientational correlations in condensed phases of high-symmetry molecules (including the ones whose shape belong to the most symmetrical ones called 'Platonic solids': tetrahedron, octahedron, cube, icosahedron and dodecahedron), there is a lack of suitable descriptions: atomic radial distribution function (RDF, g(r)) analysis is a frequently applied method, but it does not take into account the symmetry of molecules in a direct way. On the other hand, the application of symmetry adapted functions is restricted mainly to crystalline phases. In 2007 Rey\cite{rey_2007} introduced a scheme that classifies any mutual arrangement between pairs of tetrahedral molecules to an ideal arrangement. In order to characterize a given arrangement, two parallel planes are taken, each contains one of the molecular centres and perpendicular to the line connecting them. Then, the classification is performed by the number of corner (or ligand) atoms of each molecule are between the two planes. This way, six different kinds of ideal arrangements have been defined, covering all possible orientations, as corner to corner(1:1), corner to edge(1:2), corner to face(1:3), edge to edge(2:2), edge to face(2:3) and face to face(3:3). Thus, the probability of each arrangement can be determined for any centre-centre distances. The advantage of this method that it provides quantitative results and represents correlations continuously in distance rather than providing an average over a coordination shell. The method has contributed to the elucidation of the structure of liquids consisting of regular\cite{rey_2009, pothoczki_2009, morita_2009, pothoczki_2009b, pothoczki_2015} and distorted tetrahedral shapes of molecules\cite{pothoczki_2010, pothoczki_2017} and recently, of ionic conductors\cite{lacivita_2018}. Until now, this method has not been used for pairs of molecules whose shapes are non-tetrahedral Platonic. Note using the parallel planes as characterizing objects would provide useless results: only one class is formed as the non-tetrahedral Platonic solids possess inversion symmetry, which assigns exactly half of the corner atoms oriented to the other molecule in almost any case. Thus, the method should be generalized in another way: by keeping each class (corner, edge and face) and introducing orientation cones instead of planes as discussed in Section \ref{rey_general}. To demonstrate the applicability of this approach, orientational correlation analysis in condensed phases of the octahedral-shaped sulfur-hexafluoride (SF$_6$) and room temperature crystalline phase of the truncated icosahedral-shaped C$_{60}$ (based on various potential models) are selected. Sulfur hexafluoride (SF$_6$) is regularly used as an insulator in high-voltage circuit breakers\cite{nosseir_1965}. Apart from the technical importance, the high symmetry of the molecules and a peculiar body-centered plastic crystalline phase attracted much attention from a scientific point of view\cite{taylor_1976, dolling_1979, pawley_1981, dove_1983, dove_1984, dove_2002}. This phase is stable between the point of sublimation at 223K and phase transition to the low-temperature monoclinic phase\cite{cockroft_1988} occurs at 96K under ambient pressure\cite{dolling_1979}. While the centre of mass of the molecule possesses translational symmetry, apparent molecular rotations are only hindered by neighbouring molecules. Neutron diffraction\cite{taylor_1976, dolling_1979, cockroft_1988} and molecular dynamics (MD) modelling\cite{dove_1983, dove_1984} studies usually discussed correlations relative to the ordered crystalline lattice and concluded that fluorine atoms oriented close to the cubic cell axis. While the orientation of the molecule relative to the lattice is frequently taken into account in MD studies addressing the low-temperature phase\cite{pawley_1983} and the ordered-plastic phase transitions\cite{torchet_1990, boutin_1994}, there are only a few MD\cite{dove_1983, dove_1984}, and one\cite{dove_2002} Reverse Monte Carlo (RMC) studies that consider local atomic arrangements in terms of atomic RDF-s. RMC was developed originally for liquids and amorphous materials\cite{mcgreevy_1988} and provide sets of atomic configurations consistent with measured diffraction data without the need to use any potential. The gaseous, liquid and supercritical fluid states have triggered only a few diffraction studies\cite{powles_1983, strauss_1994}. MD simulations are compared to experimental properties of these phases by Dellis and Samios\cite{dellis_2010}, using potential sets optimized for describing supercritical fluid\cite{strauss_1994} and crystalline phases\cite{pawley_1981, kinney_1996}. Strauss et al.\cite{strauss_1994} used RMC modelling, and their description was focused on atomic RDFs. According to my best knowledge, there has not been any investigation performed yet that would take into account the symmetry of the SF$_6$ molecule and aim at mutual orientations both in liquid and crystalline phases. C$_{60}$ (fullerene, buckyball) has numerous phases depending on temperature and pressure\cite{moret_2005, alvarez-murga_2015}. At low-temperature and ambient pressure, it forms a simple cubic molecular crystal with some disorder. At 260K molecules start to rotate, thus inducing a phase transition\cite{david_1992} to the orientationally disordered face-centered cubic structure, stable at and above room temperature. Early diffraction studies\cite{li_1991, soper_1992, leclercq_1993} clarified the structure of the molecule: they observed a difference between single and double bonds ('D') separating pentagon ('P')-hexagon ('H') and hexagon-hexagon faces, respectively. Concerning the room temperature phase, powder diffraction and RDF (as derived from powder diffraction) studies suggested free and independent rotation\cite{david_1992} and a lack of intermolecular ordering\cite{soper_1992}. On the other hand, single-crystal studies provided evidence of a slightly (within 20\% intensity modulation) preferred orientation of molecules\cite{chow_1992} with more pentagonal than hexagonal faces turning towards nearest neighbour directions\cite{schiebel_1996}, and of local ordering of molecules by diffuse scattering\cite{moret_1992, launois_1995, chaplot_1995, pintschovius_1995a}. To describe the structure and take into account orientational ordering, various potential sets have been developed, as reviewed by Launois et. al\cite{launois_1997, launois_1999} and Chaplot et. al\cite{chaplot_2001}. These potential sets spread from simple van der Waals interactions on carbons\cite{girifalco_1992, monticelli_2012}, additional van der Waals centres on double-bonds with charges\cite{sprik_1992b}, additional charges on single and double-bonds\cite{lu_1992}, split charge on double-bonds\cite{pintschovius_1995c, chaplot_1995}, anisotropic van der Waals\cite{kita_2006}, mean-field\cite{michel_1997} to ab-initio\cite{tournus_2005}. The main reason to overcome the simple van der Waals potential is that it does not produce the experimentally observed low-temperature phase\cite{quo_1991}. Among the reviewed forcefields, none of them is able to describe all of the observed properties\cite{launois_1999}. Orientational correlations, for instance, depend significantly on the applied forcefield\cite{chaplot_2001} Details of the MD simulations and calculation of the orientational correlations are presented in Section \ref{methods}. Section \ref{resdis} contains the multiphase (gaseous, liquid, fluid, plastic crystalline) investigation of orientational correlations of octahedral SF$_6$ using the extended method. It is followed by the quantitative analysis of short-range order by different forcefields of room temperature C$_{60}$, consisting of truncated icosahedral molecules. Finally Section \ref{conclusions} summarizes the results. \section{\label{rey_general}Theory} \subsection{Generalization of the classification scheme} To extend the classification scheme introduced by Rey\cite{rey_2007} originally for tetrahedral molecules, the question of how many corner atoms of each molecule is between two \emph{planes} \emph{perpendicular} to the connecting line of the molecular centres should be replaced. Instead of \emph{perpendicular planes}, we should consider \emph{orientational cones} with proper \emph{angle} constructed by supposing: \begin{enumerate}[1.] \item The directions of corner atoms from the centre are distributed evenly on the surface of a sphere. \item The average number of corner atoms from one molecule inside the cone should be 2 when the molecule is oriented randomly. \item Only 1, 2, or 3 corner atoms are allowed to be inside the cone. \end{enumerate} The first two conditions determine the half apex angle ($\gamma$) of the cone that belong to the molecule possessing $N_{corner}$ corner atoms. According to them, the ratio of the solid angle of the orientation cone and the total solid angle should be equal to the ratio of the average number of corner atoms inside the cone at random orinetation of the molecule and $N_{corner}$: \begin{equation}\label{eq:gamma_basic} \frac{2}{N_{corner}} = \frac{2\pi \int_{\cos{\gamma}}^1 d (\cos{z})}{4\pi} = \frac{1-\cos{\gamma}}{2}, \end{equation} after some re-arrangement: \begin{equation}\label{eq:gamma} \gamma = \arccos{\left ( 1 -\frac{4}{N_{corner}}\right ) }, \end{equation} is obtained. This corresponds to the definition of a plane in the case of regular or slightly distorted tetrahedral molecules. The next task is the determination of the random orientation probabilities for each situation: the third condition limits them to three cases only. However, the second condition fixes the average to be 2, so the $P_i$ probabilities of having $i$ number of corner atoms inside a randomly directed cone for one and three atoms should be equal. Thus, only a single $P_i$ probability parameter exactly determines the other two: \begin{equation}\label{eq:general_rule} P_1=P_3=\frac{1-P_2}{2} \end{equation} The derivation and calculation method of $P_i$ with the help of corner-centre-corner bond angles is presented in SI 1 Combining these probabilities for pairs of molecules according to the appendix of \cite{rey_2007}, the asymptotic values of each of the 6 groups can be obtained for molecules having tetrahedral, octahedral and icosahedral symmetries (see TABLE \ref{tab:reygrprob}). \begin{table}[ht] \caption{\label{tab:reygrprob} Asymptotic probabilities of each groups for different symmetry of molecules obtained by taking into account the $p_{1:1}=p_{3:3}=P_1^2$, $p_{1:2}=p_{2:3}=2P_1P_2$, $p_{2:2}=P_2^2$ and $p_{1:3}=2P_1^2$ relations for single component molecular pairs (according to \cite{rey_2007}). $P_1$ is the probability to find one corner atom inside the cone, which is determined on the basis of angular separation of the number of corner atoms ($N_{corner}$) and half apex angle of the cone ($\gamma$).} \resizebox{\textwidth}{!}{ \begin{tabular}[c]{cccccccccc} \hline molecule & $N_{corner}$ & $\cos{\gamma}$ & $\gamma$ & $P_1=P_3$ & $P_2=1-2P_1$ & $p_{1:1};p_{3:3}$ & $p_{1:2};p_{2:3}$ & $p_{2:2}$ & $p_{1:3}$ \\ symmetry & & & [$^o$] & & & [\%] & [\%] & [\%] & [\%] \\ \hline tetrahedral & 4 & 0 & 90 & 0.17548 & 0.64904 & 3.079 & 22.779 & 42.125 & 6.159 \\ octahedral & 6 & $\frac{1}{3}$ & 70.53 & 0.22075 & 0.55850 & 4.873 & 24.658 & 31.193 & 9.746 \\ icosahedral & 12 & $\frac{2}{3}$ & 48.19 & 0.25251 & 0.49498 & 6.376 & 24.997 & 24.501 & 12.752 \\ \hline \end{tabular} } \end{table} The discussion of the studied system using this formalism is facilitated by the fact that each of the 6 ideal arrangement is broadly used (for instance octahedral molecules the figure 1 of REF \cite{dove_1983} contains almost all ideal arrangement except the edge to corner) and a given arrangement of a molecular pair is categorized unambiguously into one of the 6 idealized ones. \section{Computational details}\label{methods} \subsection{Simulations}\label{sim} Classical MD simulations with flexible molecules have been performed by the GROMACS\cite{gromacs_2015} package using version 2016.3. All simulations used Lennard-Jones interaction parameters and partial charges to model intermolecular and distant intramolecular dispersive and Coulombic interactions. Except for the case of one forcefield where the molecules are kept rigid, intramolecular interactions between adjacent atoms are modelled with harmonic bond stretching, angle bending and improper dihedral potentials. Among the \emph{sulfur-hexafluoride} forcefields reviewed by Dellis and Samios in table 1 of REF. \cite{dellis_2010}, both optimized (referred by the '-opt' postfix) and original forms of Pawley\cite{pawley_1981}, Kinney\cite{kinney_1996}, Strauss\cite{strauss_1994} and 7Sites\cite{dellis_2010} (referred as 'Pawley', 'Kinney', 'Strauss' and 'Dellis', respectively) are used in this study in flexible form\cite{dellis_2010}. Concerning the case of room temperature phase of \emph{fullerene}, three potential sets have been used to model intermolecular interactions: the 'Girifalco'\cite{girifalco_1992} forcefield with Lennard-Jones potential on each carbon atom; the 'Lu'\cite{lu_1992} forcefield with modified Lennard-Jones parameters on the atoms and additional charges on single and double-bonds; and the 'Sprik'\cite{sprik_1992b} forcefield with charges and Lennard-Jones potentials on each carbon atom and double-bonds, with Lorentz-Berthelot combination rules. According to 'Sprik', molecules were kept rigid, while in the former two forcefields the flexible potential set of Monticelli et al.\cite{monticelli_2012} has been used. Further details are presented in SI 2 \subsection{Calculating orientational correlations} In the saved trajectories of SF$_6$, positions of sulfur and fluorine served as the central and corner atoms, respectively. For the C$_{60}$ particle configurations the icosahedral symmetry was reconstructed for each molecule. One of the possible generation of the C$_{60}$ molecule from a perfect icosahedron is to truncate each edge at a given ratio around each corner. As in a \emph{corner} of the icosahedron 5 edges join, a \emph{pentagonal face} is formed after the truncation. On the other hand, each triangular \emph{face} of the icosahedron is truncated and a \emph{hexagonal face} is created. Then, the non-truncated \emph{edge}s of the icosahedron are the \emph{double bond}s of C$_{60}$ where two hexagonal faces join. As in the following, non-endohedral fullerenes are taken, the centres of them were calculated as the mean of atomic coordinates and the centre of each pentagon served as the virtual corner atom of the icosahedron at calculations of centre-centre RDF and orientations. Following the symmetry reconstruction, the categorization of the orientations of each pair of molecules into the 6 categories as a function of centre-centre distances is performed using custom-written software. During the examination of the pairs, the numbers of corner atoms inside the cones centred on the centre-centre connecting line and having half apex angles of 70.53$^o$ for SF$_6$ and 48.19$^o$ for icosahedral representant of C$_{60}$ have been taken into account, according to the requirement of section \ref{rey_general}. Next, each contribution in a given distance bin is normalized by the sum of them. Finally, the probabilities calculated from each of the 101 configurations are averaged. \section{Results and discussion\label{resdis}} \subsection{Orientational correlations in condensed phases of sulfur hexafluoride} Neutron diffraction measurements at various thermodynamical conditions (published for gaseous\cite{powles_1983}: 293.15 K and 10.2 bar, $\rho$=0.0021 {}\AA $^{-3}$; supercritical fluid\cite{strauss_1994}: 398 K; at 128 bar, $\rho$=0.0245 {}\AA $^{-3}$; at 155 bar, $\rho$=0.0289 {}\AA $^{-3}$; at 394 bar, $\rho$=0.0404 {}\AA $^{-3}$; at 1827 bar, $\rho$=0.0534 {}\AA $^{-3}$ and plastic crystalline\cite{dove_2002, rmcprofile_tutorial} states: 190 K and 1 bar, $\rho$=0.0685 {}\AA $^{-3}$) allow us to observe the changes of orientational correlations in the framework of the modified algorithm. Similarly, a large variety of forcefields are available for this material. In SI. 4., these forcefields are tested if they are able to reproduce the available total scattering neutron diffraction data (calculation method of them are presented in SI. 3.) and density. Concerning these quantities, the 'Dellis' ('7sites' in\cite{dellis_2010}) forcefield of Dellis and Samios\cite{dellis_2010} was proven to be the best and provided a good agreement with experimental results. Note that this forcefield had been optimized originally against densities in the liquid and supercritical fluid regions, it also performed well close to the triple point (225 K and 10.1 bar, $\rho$=0.0532 {}\AA $^{-3}$) and in the plastic crystal phase that had not been parts of the original range of validation. Thus, in the following, results of MD simulations from this potential set are used. FIGURES \ref{fig:sf6_reysh} and \ref{fig:sf6_reylong} \begin{figure}[htp] \begin{center} \rotatebox{0}{\resizebox{0.8\textwidth}{!}{\includegraphics{sf6_rey_shortrange}}} \caption{\label{fig:sf6_reysh} Orientational correlation probabilities focusing on short-range at 6 non-crystalline states of SF$_6$ using the classification method of Rey\cite{rey_2007} (extended here for other Platonic shapes). Probability scales are on the left, while scale for the molecular centre-centre radial distribution function (black dashed lines) on the right side of each subfigure. Face-face (3:3): red lines; corner-corner (1:1): straight black lines; edge-face (2:3): blue lines; corner-edge (1:2): orange lines; corner-face (1:3): green lines; edge-edge (2:2): magenta lines.} \end{center} \end{figure} \begin{figure}[htp] \begin{center} \rotatebox{0}{\resizebox{0.8\textwidth}{!}{\includegraphics{sf6_rey_longrange}}} \caption{\label{fig:sf6_reylong} The molecular centre-centre radial distribution function (on top) and orientational correlation probabilities (the lower 4 subfigures) focusing on the 10 to 25{}\AA{} range at 5 non-crystalline states of SF$_6$ using the classification method of Rey\cite{rey_2007} (extended here for other Platonic shapes). 398K (supercritical states), 128 bar: red lines; 155 bar: blue lines; 394 bar: orange lines; 1827 bar: dark green lines; 225K, 10.1 bar (liquid): magenta lines. In the bottom two figures, the groups of 1:1 and 1:2 represented by straight lines, while for 3:3 and 2:3 by straight lines with circles.} \end{center} \end{figure} contain the probabilities of each group with the molecular centre-centre radial distribution function in 6 non-crystalline states: one gaseous (FIGURE \ref{fig:sf6_reysh}a), 4 supercritical fluid (FIGURE \ref{fig:sf6_reysh}a-e) and a close-to-triple point liquid (FIGURE \ref{fig:sf6_reysh}f). In order to obtain a general picture, we start with the examination of the gaseous state (FIGURE \ref{fig:sf6_reysh}a). In this phase the colliding molecules determine the behaviour of the system, so we expect that the direct contact of atoms characterizes the short-lived orientational correlations. The molecular centre-centre RDF reflects this feature as only a broad first maximum is present with a maximum at 5.3 {}\AA{}, which slowly decays at higher distances. Focusing on the orientational correlations, they definitely depend on the molecular centre-centre distance: the face-face (3:3) arrangement is frequent at the shortest distances, while farther away, the probability drops until it reaches its equilibrium value at 6{ }\AA{}, slightly over the first maximum of the centre-centre RDF. Next, the edge-face (2:3) and further, the edge-edge (2:2) arrangement probabilities rise and have definite maxima at distances shorter than the maximum of the centre-centre RDF. The remaining corner-face (1:3), corner-edge (1:2) and corner-corner (1:1) arrangements have only the rising part in probability without a characteristic maximum: they reach their asymptotic values roughly at 6\AA{}. The observed behaviour has a simple geometric reason: the centre to a centre of a face, to mid of edge and to the corner atom distances are increasing, respectively. If we wish to pack atoms of molecular pairs as close as possible, the order of appearance of the arrangements should be 3:3, 3:2, 2:2 and 1:3, 1:2 and 1:1 as the centre-centre distance increases. A similar tendency is valid in most of the tetrahedral molecules\cite{rey_2009} when this method is applied. However, in the present case, there are apparent differences from it, namely the intensity of 3:3 is not 1 at the shortest distances, but it is somewhat comparable to the probability of 2:3 arrangements. The explaination may be that there are only a few pairs in this region. Extending the discussion to the supercritical fluid and liquid states (FIGURE \ref{fig:sf6_reysh}a-f), we can conclude that up to about 5.5 {}\AA {} orientational correlations do not alter in comparison with the gaseous state. This common behaviour is the direct consequence of the close contact of corner atoms as discussed above. While the gaseous state does not show any significant correlations, neither in the centre-centre, nor orientations beyond the first coordination shell, the centre-centre RDF becomes more structured as the density of the system increases. Oscillations also appear (FIGURES \ref{fig:sf6_reysh} and \ref{fig:sf6_reylong}) in the orientational correlations above 5.5..6 {}\AA{}, which is slightly less than the upper limit of the first coordination shell. These oscillations are observed up to the upper limit of the second coordination shell in the two lowest density fluid states, up to the third maximum of centre-centre RDF for 394 bar and up to the upper limit of the fourth shell for the highest density states. It is important to note here that the simulated molecules were flexible and atomic coordinates are used without any further alignment during the calculation of orientational correlations, which slightly biased the asymptotic probability value of some groups (the largest deviation is about 0.002 for the 2:2 pairs). Concerning the different kind of arrangement at medium-range, they do not show any preference for a specific correlation, but seemingly the probabilities of the 3:3 and the 3:2 arrangements are in opposite phase with probabilities of the 1:1 and the 1:2. Importantly, except the first common node point of probabilities of the 3:3 with the 1:1, of the 2:3 with the 1:2 and where the centre-centre RDF passing through unity, they coincide with each other. Moreover, the probability of arrangements having more corner atoms inside the orientational cones than the average 4 (the 3:3 and the 3:2) are in phase with, while arrangements indicate fewer corner atoms are in opposite phase with the centre-centre RDF. This observed medium-range order suggests a relationship with the tetrahedral-shaped CCl$_4$ liquid\cite{rey_2007}, where similar behaviour was found. However, due to the remarkable short-range order correlations, the medium-range order starts there about from the third coordination shell and correlations are slightly shifted in phase with the centre-centre RDF (see FIGURES 4 and 5 of\cite{rey_2007}). Thus, the two systems behave differently. One of the advantages of the formalism just introduced is that it can be applied to not just disordered, but crystalline phases, as well. In the body-centered cubic plastic crystalline state at 190 K, each sulfur atom has a definite equilibrium position, while fluorine atomic positions are disordered. This phenomenon implies that although equilibrium positions of sulfur atoms keep the translational symmetry, the molecular centre-centre RDF (FIGURE \ref{fig:sf6_rey_xtal}) expresses noticeable thermal displacements. \begin{figure}[htp] \begin{center} \rotatebox{0}{\resizebox{0.8\textwidth}{!}{\includegraphics{sf6_rey_crystal}}} \caption{\label{fig:sf6_rey_xtal} Comparing orientational correlation probabilities (lower 4 subfigures) in the plastic crystal (190 K, 1 bar, magenta lines) and liquid (225 K, 10.1 bar, black lines) states of SF$_6$ using the classification method of Rey\cite{rey_2007} (extended here for other Platonic shapes) and the molecule centre-centre radial distribution function (top). In the bottom two figures, the groups of 1:1 and 1:2 represented by straight lines, while for 3:3 and 2:3 by straight lines with circles.} \end{center} \end{figure} Thus, the nearest neighbours in the <111> (or half of cubic diagonal), and second neighbours in the <100> (or side of the cube) directions of the crystal are overlapping in the radial representation, as their ideal values are close: 5.10~\AA{} and 5.89~\AA{}, respectively. Although the present model is probably more disordered than in reality (as discussed in SI. 4.), the overlapping behaviour was also observed earlier by Dove and Pawley\cite{dove_1983} using another forcefield. Still, orientational correlations reveal some further features, allowing to separate the contributions of overlapping neighbours: in the <111> direction the 3:3 and 2:3 orientations dominate, meanwhile the 1:3 behaves like in the liquid states and correlations of 2:2 are less abundant. It is interesting to note that the probability of the 3:3 arrangements for close contact is high, while the 2:3 probability is more competitive with 3:3 for the studied liquids and gaseous states. At larger distances, the probabilities of 3:3 and 2:3 drop to the level of random orientations or even less, which shows the approximate limit between the first and second neighbours around 5.5{ }\AA{}. This distance was the rough upper limit of the effect of close contact in the disordered phases. Nevertheless, the most significant characteristic of neighbours in the <100> directions is the broad maxima of 1:1 and 1:2 arrangements. In the <110> (or diagonal of a face of the cube) direction (between 7 and 9 {}\AA) the 2:2 and 2:3 arrangements have maxima. Combining the arrangements found like the maxima of 1:1 to <100> and 3:3 or 2:3 to the <111> directions, the preferred position of fluorine atoms with respect to the lattice can be derived. For the first neighbour, 3 fluorines of each molecule should be placed inside the orientational cones around the cubic body diagonals, while at the same time only one fluorine is allowed to be inside the cone around the side of the cubic cell. As the cones with $\gamma=70.53^o$ half apex angle around the body diagonal (inclined $54.74^o$ to the side of the cubes in the ideal case) cover directions of the three cubic sides, the fluorine atoms should be placed approximately toward the <100> direction from the sulfur positions with higher probability, which agrees well with earlier suggestions\cite{dolling_1979, dove_1984, dove_2002}. \subsection{Short-range order orientation correlations in models of room temperature C$_{60}$} As a next step, the orientational correlation scheme is applied to \emph{quantitatively} describe orientational correlations of neighbouring molecules in C$_{60}$, as represented by three forcefields ('Girifalco'\cite{girifalco_1992}, 'Lu'\cite{lu_1992} and 'Sprik'\cite{sprik_1992b}) that had been proven to produce different kinds of short-range order. First, we start the examination of the molecular centre-centre RDF (FIGURE \ref{fig:c60_rey}). \begin{figure}[htp] \begin{center} \rotatebox{0}{\resizebox{0.8\textwidth}{!}{\includegraphics{c60_rey}}} \caption{\label{fig:c60_rey} Molecular centre-centre radial distribution function (uppermost panels) and orientational correlation probabilities (lower panels) using the classification method of Rey\cite{rey_2007} (extended here for other Platonic shapes) for different MD forcefields for the first (left panels) and second (right panels) nearest neighbours in room temperature C$_{60}$. The examined forcefields are from top to bottom in the lower panels (and color of the lines on the uppermost panels): 'Girifalco'\cite{girifalco_1992} (straight black lines), 'Lu'\cite{lu_1992} (straight red lines) and 'Sprik'\cite{sprik_1992b} (straight blue lines), respectively. The colors of different orientational classes on lower panels are arrangements of face-face (3:3, 'HH'): red lines; corner-corner (1:1, 'PP'): straight black lines; edge-face (2:3, 'HD'): blue line; corner-edge (1:2, 'PD'): orange line; corner-face (1:3, 'PH'): green line; edge-edge (2:2, 'DD'): magenta line.} \end{center} \end{figure} Although some models show a larger centre of mass motion, the most important feature of these RDFs, that the first and second neighbours are distinct. This allows separating orientational correlations unambiguously belonging to the different spheres, in contrast to the plastic crystal phase of SF$_6$, where first and second shells overlap. Touching the broadening issue, it is the result of a different kind of modelling of the intramolecular structure. It was flexible for the 'Girifalco' and 'Lu' models, so the motion of each individual carbon atom is successfully equilibrated by the internal freedom, making the centre less intact from the changes. On the other hand, the 'Sprik' model was rigid, which resulted in a larger displacement of the centres from the equilibrium positions. Focusing on the orientational correlations, the number of virtual corner atoms in the coordination cone should be assigned to the orientation of C$_{60}$ molecule. One corner atom (the "corner") in the coordination cone means the molecule is oriented by a pentagonal face ('P'), while two atoms ("edge") means between the centres of pentagons: the 'double-bond' ('D'). Finally, the "face" coordination realizes an orientation through the hexagonal faces ('H') of the molecule. As earlier investigations focused on the short-range order behaviour, here also the first and second neighbours are examined. In order to quantify orientational correlations within a specific coordination shell, the probabilities of each group have been averaged over the given shell. The averaging has been made between the two limiting distances where g$_{cc}$(r) intensity is 1/10 of the maximum intensity within the corresponding shell. Then the shell-averaged probabilities are divided by the corresponding random orientation probability (TABLE \ref{tab:reygrprob}) for icosahedral molecules: \begin{equation} C_{i:j} = \frac{< p_{i:j}(r) >_{shell}}{p_{i:j}^{random}} \end{equation} Thus, its value over 100\% indicates a preferred, while lower refers to a disliked orientation in TABLE \ref{tab:c60_rey_sums}. \begin{table}[ht] \caption{\label{tab:c60_rey_sums}Coordination shell averaged probability of orientation groups normalized by the corresponding random orientation probability of room temperature C$_{60}$ by different forcefield models. The 'D', 'H', 'P' are refer to double-bond, hexagonal face, pentagonal face, respectively.} \resizebox{\textwidth}{!}{ \begin{tabular}[c]{cccccccc} \hline Model & Coordination & \multicolumn{6}{c}{Group probability in shell normalized by random orientation [\%]} \\ & & 1:1 & 3:3 & 1:2 & 2:3 & 2:2 & 1:3 \\ & shell & 'PP' & 'HH' & 'PD' & 'HD' & 'DD' & 'PH' \\ \hline 'Girifalco' & 1\textsuperscript{st} & 4 & 191 & 23 & 193 & 120 & 33 \\ & 2\textsuperscript{nd} & 221 & 17 & 153 & 43 & 116 & 60 \\ 'Lu' & 1\textsuperscript{st} & 55 & 34 & 142 & 63 & 78 & 189 \\ & 2\textsuperscript{nd} & 30 & 71 & 102 & 100 & 151 & 47 \\ 'Sprik' & 1\textsuperscript{st} & 147 & 72 & 121 & 83 & 87 & 109 \\ & 2\textsuperscript{nd} & 74 & 113 & 90 & 110 & 109 & 91 \\ \hline \end{tabular} } \end{table} However, the probability of some arrangements changes by the centre-centre distance within the shell, so values of TABLE \ref{tab:reygrprob} are discussed together with tendencies on FIGURE \ref{fig:c60_rey}. In the first coordination shell, which corresponds to the closest atoms to <110> directions in the crystalline system, the 'Girifalco' model shows a strong preference of 'HH', 'HD' and a slight preference of 'DD' orientational groups. This suggests that local arrangements try to avoid turning into any of the pentagonal faces of them and prefers hexagonal face - hexagonal face or double-bonds at closer and double-bond-double-bond orientation at distant centre-centre distances, which gives a hint about the rotation mechanism. Looking at the second coordination shell (<100> direction), the opposite 'PP' and 'PD' are favoured strongly by increasing centre-centre distances and the 'DD' slightly, but mainly at closer distances. Even though the preference of 'HD' and unlike of 'PP' and 'PD' found in accordance with earlier study\cite{chaplot_2001}, it contradicts to single-crystal investigation\cite{schiebel_1996} concerning the preference of pentagonal over hexagonal faces for nearest neighbours. While the pentagonal coordination was disfavored in the first coordination shell by the 'Girifalco' model, the result by the 'Lu' forcefield shows a clear preference of it, agreeing with \cite{schiebel_1996}: both 'PH' (mainly closer distances) and 'PD' (mainly higher distances) kinds of correlations are favoured and the 'PH' arrangement at short distance is more probable. The second shell shows less varied arrangements: only the 'DD' arrangement is preferred. This result is in accord with earlier investigation\cite{chaplot_2001} about the first shell of 'PD' liked and 'PP' disliked. Interestingly, the 'Sprik' forcefield shows a somewhat opposite kind of preference in comparison with the 'Girifalco', but the deviations from random values are moderate. The pentagonal face related correlations are preferred in the first shell in order of decreasing probability as 'PP', 'PD', 'PH', while in the second shell the hexagonal face related to 'HH', 'HD' and 'DD' correlations are the preferred ones. The 'PP' and 'PD' preference of this model is in agreement with an ab-initio study\cite{tournus_2005}. \section{Conclusions}\label{conclusions} Based on the results the following statements can be made: \begin{enumerate}[(i)] \item The orientational correlation scheme introduced originally by Rey\cite{rey_2007} is extended to be capable of describing correlations between high symmetry molecules. The orientations of pairs of molecules are classified by the number of corner (aka ligand) atoms for each part found within orientational cones. The axes of the orientation cones correspond to the centre-centre connecting line with the apex at the centres. The extension is made by choosing its apex angle so that the number of corner atoms spans only from 1 to 3 and the average number over random orientation should be 2. Supposing even distribution of atoms, calculation methods for the half apex angle of the cones and asymptotic probabilities of each class are provided. \item In order to demonstrate the applicability of this method in various condensed phases, the octahedral-shaped SF$_6$ molecule is selected in its gaseous, supercritical fluid, triple point liquid and plastic crystalline phase. The modelling performed by the '7Sites' forcefield\cite{dellis_2010} provided the best agreement with density and total scattering diffraction data. \item The detailed analysis of different orientational groups for SF$_{6}$ revealed a close contact region in the first coordination shell. It shows a specific orientation pattern of orientational arrangement by distance, similarly to that found for tetrahedral molecules. For non-crystalline states, a medium-range ordered region is found that gradually extends with increasing density, even up to the 4th shell, as observed in high-density states. Its main characteristic feature is that the molecular centre-centre RDF is in phase with the probabilities of arrangements having more corner atoms within the orientational cones than the average 4. Although medium-range order appears for the tetrahedral CCl$_4$ too, it is different from the one observed here. In the plastic crystalline state, close contacts of 3:3, 2:3 correlations are found in the <111> directions, while the second neighbour in <100> showed the preference of 1:1 and 1:2 arrangements. This agrees with earlier studies, that fluorine atoms preferentially oriented in the <100> direction. \item For the room temperature crystalline C$_{60}$, three models ('Girifalco'\cite{girifalco_1992}, 'Lu'\cite{lu_1992} and 'Sprik'\cite{sprik_1992b}) were tested in the framework of icosahedral symmetry, providing different short-range order. The probability of each arrangement is averaged over the first and the second coordination shells and divided by the corresponding random probability. Thus a quantitative description of orientational correlations is provided for each model, where agreement found in each case with earlier studies. \end{enumerate} It is important to note that this method might be used not only to describe mutual orientational correlations between molecules belonging to the `Platonic` solids (the un-mentioned cube and dodecahedron are the corner-face duals of octahedron and icosahedron, respectively) but also between their distorted forms or any object, as long as the three conditions in section \ref{rey_general} are fulfilled (like for trigonal planar or bipyramidal molecules, where $N_{corner}$ is 3 and 5, respectively). Also, it is possible to use the new algorithm for their mixtures (like tetrahedral and octahedral). \section*{Acknowledgement} The author would like to thank the help of L\'aszl\'o Pusztai for discussions. The author is grateful that this project was supported by the János Bolyai Research Scholarship of the Hungarian Academy of Sciences and the National Research, Development and Innovation Office(NKFIH), under grant no. KH130425. \setcounter{equation}{0} \renewcommand{\theequation}{S\arabic{equation}} \setcounter{figure}{0} \renewcommand{\thefigure}{S\arabic{figure}} \setcounter{table}{0} \renewcommand{\thetable}{S\arabic{table}} \section{Supplementary Information} \subsection{\label{appendix_random}Calculating the random $P_i$ probabilities} In order to determine the $P_i$ values for a given molecule, we should consider that each corner atoms are spaced more or less regularly. Thus each $P_i$ probability corresponds to the surface ratio on a unit sphere, where the axis might pass through and there are $i$ number of atoms \emph{inside the cone} (according to EQ. A2 of REF \cite{rey_2007}). Now, let's fix a molecule and create a cone with $\gamma$ half apex angle around each centre to corner atom axis. By doing this, we get a picture like in fig \ref{fig:surface_map} \begin{figure}[ht] \begin{center} \rotatebox{0}{\resizebox{0.5\textwidth}{!}{\includegraphics[trim={3cm 15.5cm 5cm 1cm}, clip]{individual_surfaces.pdf}}} \caption{\label{fig:surface_map} Surface mapping on the unit sphere. The blue coloured arrows point toward ligand (corner) atoms from the centre of the molecule serving as axes of cones, which intersects the surface at lines marked by red circles. The light, middle and dark purple regions are surface areas containing 1, 2 and 3 ligands if the molecular centre-centre connecting line pass through them. To calculate surface ratios easy, individual surfaces of corner ($p_{cI}$; inside red circle), of edge ($p_{eI}$; surface limited by green lines) and of face ($p_{fI}$; surface limited by black lines) are introduced.} \end{center} \end{figure} around three corner atoms. If a molecular centre-centre connecting line passes through one of these regions on a unit spheres, which might belong to 3, 2 or only 1 such cone(s), it will find the corresponding number of corner atoms inside the orientation cone. Thus, summarizing all of those individual surface elements, which belong to $i$ number of cones, we get the corresponding probability. For practical reasons, we introduce the corner ($p_c$: surface ratio of a cone), the edge ($p_e$: surface ratio of 2 overlapping cones) and the face ($p_f$: surface ratio of three overlapping cones) surface ratios composed by the sum of each individual ratios ($p_x=\sum p_{xI}$) on the sphere (see fig \ref{fig:surface_map}). It is important to note, that $p_c$ contains areas, which belong to not just one cone and similarly $p_e$ contain areas, which belong to 3 cones. As a result, $p_c$ and $p_e$ are more than one. Connecting these ratios to the $P_i$ probabilities, the $P_3$ is exactly equal to $p_f$. On the other hand, the surface of $P_3$ is considered 3 times in the calculations of each $p_c$ and $p_e$. Similarly, the surface of $P_2$ is also considered twice in $p_c$ calculation: \begin{eqnarray} P_3 &=& p_f \\ P_2 &=& p_e - 3 P_3 = p_e - 3 p_f\\ P_1 &=& p_c - 2 P_2 - 3 P_3 = p_c - 2 p_e + 3 p_f \end{eqnarray} Using EQ. 3 we get \begin{eqnarray} p_c &=& 2 \label{eq:pcpe}\\ P_1 &=& P_3 = p_f = p_e-1 \label{eq:P1pe}\\ P_2 &=& 1 - 2p_f = 3-2p_e \label{eq:P2pe} \end{eqnarray} EQ. \ref{eq:pcpe} is just the reformulation of EQ. 1, that the orientation cone should contain 2 corner atoms. The least 2 equation states, that either $p_f$ or $p_e$ should be calculated to determine all $P_i$ probabilities. Although, appendix of\cite{rey_2007} calculated the $p_{fI}$ for tetrahedral molecules, in the following the $p_{eI}$ is calculated. It takes into account only pair of corner atoms, whose associated parameter (the corner-centre-corner bond angle) is more convenient to use in the case of non-regular shaped objects. In order to calculate the surface ratio, we should consider two cones with a common apex, both having the same half apex angle ($\gamma$) and their axes are separated by $\alpha_I$ degrees from each other. The surface ratio will be the common area within the two cones on the unit sphere in comparison with the whole surface. Let's choose a Cartesian coordinate system, direct the 'z' axis to the axis of one of the cones, place 'x' axis in the plane determined by the axes of each cone and 'y' perpendicular to them (see FIG. \ref{fig:integration}). \begin{figure}[ht] \begin{center} \rotatebox{0}{\resizebox{0.5\textwidth}{!}{\includegraphics[trim={0 18cm 3cm 0}, clip]{integration_on_edge_surface}}} \caption{\label{fig:integration} Calculation of 1/4 of the surface integral belonging to $p_{eI}$. The surface to be calculated is limited by thick red lines, the blue colored arrows are the axis of the cones, whereas each plane is a symmetry plane.} \end{center} \end{figure} The surface to be calculated posses two planes of symmetry: one is the 'xz' plane at y=0 and the other is the bisecting plane inclined by $\alpha_I/2$ degrees to the z-axis ($\tan{\alpha_I /2}=x/z$ on the plane). Taking that small surface element on the unit sphere ($S_I$), which is limited by the two symmetry planes and the intersecting cone, the corresponding probability: \begin{equation} p_{eI}=\frac{4S_I}{4\pi}=\frac{S_I}{\pi}. \end{equation} In order to calculate $S_I$, we parametrize its surface to spherical coordinates. Applying the Cartesian-spherical conversion form on unit of spheres $(x,y,z)=(\sin{\theta}\cos{\phi},$ $\sin{\theta}\sin{\phi}, \cos{\theta})$, the limits are: \begin{eqnarray} 0 \leq \phi &\leq& \arccos{\left\{ \frac{\tan{\alpha_I/2}}{\tan{\theta}}\right \}}, \\ \alpha_I/2 \leq \theta &\leq& \gamma \end{eqnarray} Thus, the individual ratio is obtained by evaluating the following surface integral: \begin{eqnarray} p_{eI}&=&\frac{S_I}{\pi}=\frac{\int \limits_{\alpha_I/2}^{\gamma} \int \limits_0^{\arccos{\left\{ \frac{\tan{\alpha_I/2}}{\tan{\theta}}\right \}}} d \phi \sin{\theta} d \theta }{\pi}=\nonumber \\ &=&\frac{\arctan{\sqrt{\left( \frac{ \sin{\gamma}}{\sin{\alpha_I/2}} \right)^2-1}} - \cos{\gamma}\arccos{\left(\frac{\tan{\alpha_I/2}}{\tan{\gamma}}\right)}}{\pi} \end{eqnarray} Introducing the $A=\cos{\alpha_I}$ and $G=\cos{\gamma_I}$ notations, the individual surface ratio of the edge becomes \begin{equation} p_{eI}=\frac{1}{\pi}\left\{\arctan{\sqrt{\frac{1+A-2G^2}{1-A}}}-G\arccos{\left(\sqrt{\frac{1-A}{1+A}}\frac{G}{\sqrt{1-G^2}}\right)}\right\} \end{equation} Evaluating it to tetrahedral ($A=-1/3$, $G=0$), octahedral ($A=0$, $G=1/3$) and icosahedral ($A=1/\sqrt{5}$, $G=2/3$) symmetries, we get: \begin{eqnarray} \tilde{p}_{eI\textrm{T}}&=&\frac{1}{\pi}\arctan{\frac{1}{\sqrt{2}}} \\ \tilde{p}_{eI\textrm{O}}&=&\frac{1}{\pi}\left\{\arctan{\left(\frac{\sqrt{7}}{3}\right)}-\frac{1}{3}\arccos{\left(\frac{1}{2\sqrt{2}}\right)}\right\} \\ \tilde{p}_{eI\textrm{I}}&=&\frac{1}{\pi}\left\{\arctan{\sqrt{\frac{7+5\sqrt{5}}{18}}}-\frac{2}{3}\arccos{\left(\sqrt{\frac{2(3-\sqrt{5})}{5}}\right)}\right\} \end{eqnarray} The individual surface ratios should be summed up in general, or simply multiplied with the corresponding number of edges in regular (aka Platonic solids) case to obtain $p_e$, then applying EQ. \ref{eq:P1pe} and \ref{eq:P2pe} to get any of the $P_i$ random orientation probabilities (TABLE \ref{tab:rorientprob}). \begin{table}[ht] \caption{\label{tab:rorientprob}Numerical values of random orientation probabilities for some high-symmetry molecules.} \resizebox{\textwidth}{!}{ \begin{tabular}[c]{ccccccccc} \hline symmetry & $N_{corner}$ & $N_{edges}$ & $\cos{\alpha}$/$\alpha$ [$^o$] & $\cos{\gamma}$/$\gamma$ [$^o$] & $p_{eI}$ & $p_e$ & $P_1=P_3=p_f$ & $P_2$ \\ \hline tetrahedral & 4 & 6 & $-\frac{1}{3}$/109.47 & 0/90 & 0.19591 & 1.17548 & 0.17548 & 0.64904 \\ octahedral & 6 & 12 & 0/90 & $\frac{1}{3}$/70.53 & 0.10173 & 1.22075 & 0.22075 & 0.55850 \\ icosahedral & 12 & 30 & $\frac{1}{\sqrt{5}}$/63.43 & $\frac{2}{3}$/48.19 & 0.04175 & 1.25251 & 0.25251 & 0.49498 \\ \hline \end{tabular} } \end{table} Note the exact agreement with the calculated value of $P_1$ of Rey\cite{rey_2007} for tetrahedral molecules. \subsection{\label{appendix_md}Details of the performed molecular dynamics simulations} For sulfur hexafluoride, calculations at various thermodynamic conditions done, where published diffraction datasets\cite{strauss_1994, dove_2002, rmcprofile_tutorial, powles_1983} were available. Thus, both NpT and NVT simulations have been performed in the supercritical state (temperature of 398 K and pressures of 128 bar, 155 bar, 394 bar and 1827 bar\cite{strauss_1994}), in the orientationally disordered/plastic crystalline phase I (190 K and 1 bar\cite{dove_2002, rmcprofile_tutorial}), in the liquid state close to the triple point (225 K and 10.0552 bar -- no measured diffraction data are available here). Only NVT calculations have been performed in the gaseous phase (293.15 K and 10.2 bar\cite{powles_1983}). Initial configurations containing 5000 molecules are created for gaseous, liquid and fluid phases by randomly placing and orienting molecules into the simulation box determined by the density. In the crystalline bcc phase, each of the 5488 molecules (cell size 14x14x14 of the crystallographic unit cell with 5.89 {}\AA{} lattice constant) are oriented randomly around equilibrium positions of sulfur. For fullerene, only its plastic crystalline phase is modelled at room temperature by NVT simulations using three forcefields (FIG. \ref{tab:c60ffpars}). Each simulation started from an 8x8x8 fcc unit cell (corresponds to 2048 molecules, with lattice constant of 14.16 {}\AA) points as centres of gravity of C$_{60}$, where molecules randomly oriented. \begin{table}[ht] \caption{\label{tab:c60ffpars}Lennard-Jones parameters and partial charges applied for fullerene MD simulations at room temperature, ambient conditions. For flexible molecules (applied with 'Girifalco'\cite{girifalco_1992} and 'Lu'\cite{lu_1992} forcefields), the flexible intramolecular potential set of Monticelli et al.\cite{monticelli_2012} has been used for carbon atoms: bondlengths of 0.14 and 0.145 nm with 392459.2 $\frac{kJ}{mol*nm^2}$, bond angles of 120 and 108 degrees with 527.184 $\frac{kJ}{mol*rad^2}$, improper dihedrals of 143 degrees with 100 $\frac{kJ}{mol*rad^2}$ force constant.} \resizebox{\textwidth}{!}{ \begin{tabular}[c]{ccccccccc} \hline \multicolumn{2}{c}{Forcefield} & \multicolumn{3}{c}{Carbon atoms} & \multicolumn{3}{c}{Double bonds} & Single bond\\ name & reference & charge [$e$] & $\sigma$ [nm] & $\epsilon$ [$\frac{kJ}{mol}$] & charge [$e$] & $\sigma$ [nm] & $\epsilon$ [$\frac{kJ}{mol}$] & charge [$e$] \\ \hline 'Girifalco' & \cite{girifalco_1992} & 0 & 0.346903 & 0.276427 & & & & \\ 'Lu' & \cite{lu_1992} & 0 & 0.3407 & 0.28598 & -0.54 & & & 0.27 \\ 'Sprik' & \cite{sprik_1992b} & 0.175 & 0.34 & 0.1247 & -0.35 & 0.36 & 0.1247 & \\ \hline \end{tabular} } \end{table} During the simulations, the Verlet cut-off scheme has been used with van der Waals cut-off at 2.0 nm (1.0 nm for C$_{60}$). For electrostatics, the particle-mesh Ewald algorithm has been applied, with the same Coulombic cut-off distance when partial charges were non-neutral. The simulation time step was 1 fs. The configuration energies were minimized first, then equilibrated at different levels: for 0.5 ns Berendsen-thermostat ($\tau_T$ = 0.2 ps, for C$_{60}$ it was 2 ps) applied at the right temperature first, then Nose-Hoover thermostat for 2 ns. For NpT runs, an additional 200 ps by Berendsen barostat (with $\tau_p$= 1.0) and at least 1 ns by Parinello-Rahman barostat were applied. Carrying out equilibration, production runs were started for 10 ns, saving coordinates at each 100 ps. In the case of simulations with the 'Lu' and 'Sprik' forcefields of C$_{60}$, a modelling sequence at 700K, then at 500K and finally at 300K has been conducted, where each modelling started from the final configuration of the previous simulation. For density determination NpT, while for other cases NVT simulations are performed. \subsection{\label{appendix_totscatcalc}Total scattering powder diffraction patterns: available data and way of calculation from simulations} All measured total scattering powder diffraction pattern have been taken from literature\cite{powles_1983, dove_2002, rmcprofile_tutorial, strauss_1994, leclercq_1993}. Numerical experimental datasets were available for the gaseous\cite{powles_1983} and plastic crystalline phase of SF$_6$ at 190K\cite{dove_2002, rmcprofile_tutorial} while for supercritical fluid states\cite{strauss_1994} and C$_{60}$ at room temperature\cite{leclercq_1993} datasets have been digitized from figures of differential cross-sections and intensity, respectively. For crystalline phases, total scattering structure factors have been calculated using a new implementation of the RMCPOW method\cite{rmcpow_1999}. For SF$_6$ 11 configurations were used for calculation, separated by at least 1 ns of NVT runs, while only the final configuration was taken for C$_{60}$s. Bragg contributions convoluted by the instrumental resolution function, which was "TOF profile function-2" of GSAS\cite{gsas_2004} for SF$_6$ and Gaussian shape for C$_{60}$. Their parameters are optimized by a trial configuration. Finally, individually calculated patterns are averaged. For other phases, the 'rdf' program of GROMACS provided the partial RDFs, averaged over 101 configurations taken at each 100 ps. Then RDFs are Fourier-transformed and weighted sum created according to neutron coherent scattering lengths and composition. Generally, during the comparison of the measured and simulated total structure factors, the former is rescaled and a constant background is subtracted to avoid errors from different normalization. For crystalline datasets, the measured pattern rescaled and corrected by 2nd order polynomials above 2.5 {}\AA$^{-1}$ first, then it has been compared directly over the full measured range. In order to compare the calculated pattern ($I^{calc}$) with the corrected measured one ($I^{meas}$), a reliability factor analogous to $R_{wp}$ at Rietveld-refinement\cite{young_1993} is used: \begin{equation}\label{eq:reliability} R_{wp} = \sqrt{\frac{\sum_i (I^{meas}_i - I^{calc}_i)^2}{\sum_i (I^{calc}_i)^2}} \end{equation} The difference is the weights by points are equal and the denominator contains the calculated data instead of the measured one. \subsection{\label{appendix_ffcheck}Checking the performance of SF$_6$ forcefields against total scattering powder diffraction data and density} The agreements between measured\cite{powles_1983, strauss_1994, rmcprofile_tutorial} and NVT MD simulated structure factors are compared in TABLE \ref{tab:sf6rwp} using the reliability factor defined in EQ. \ref{eq:reliability}. \begin{table}[ht] \caption{\label{tab:sf6rwp}R$_{wp}$ [\%] of simulated and measured\cite{powles_1983, strauss_1994, rmcprofile_tutorial} total scattering structure factors of SF$_6$ for NVT simulations.} \begin{center} \begin{tabular}{ccccccc} \hline Reference & \cite{powles_1983} & \cite{strauss_1994} & \cite{strauss_1994} & \cite{strauss_1994} & \cite{strauss_1994} & \cite{rmcprofile_tutorial}\\ Tempereture [K] & 293.15 & 398 & 398 & 398 & 398 & 190 \\ Pressure [bar] & 10.2 & 128 & 155 & 394 & 1827 & 1 \\ Density [kg/m$^3$] & 71.306 & 850 & 1000 & 1400 & 1850 & 2374 \\ \hline Kinney & 3.59 & 8.09 & 10.29 & 9.84 & 10.25 & 27.9 \\ Kinney-opt & 3.19 & 9.61 & 9.78 & 11.02 & 11.69 & 27.8 \\ Pawley & 3.01 & 7.34 & 11.41 & 11.07 & 9.06 & 29.3 \\ Pawley-opt & 3.28 & 9.11 & 9.77 & 11.10 & 13.03 & 27.3 \\ Strauss & 4.97 & 34.1 & 41.6 & 34.7 & 38.0 & 32.7 \\ Strauss-opt & 3.14 & 9.05 & 9.24 & 10.52 & 11.07 & 27.6 \\ Dellis & 3.15 & 9.19 & 9.91 & 10.89 & 11.67 & 27.3 \\ \hline \end{tabular} \end{center} \end{table} Comparing the performance of different forcefields, the worst agreements are found for the 'Strauss' one for each condition, while other forcefields show similar agreement. It is interesting to note that the non-optimized 'Pawley' forcefield shows the best agreement for some states. As a consequence, the 'Dellis', 'Pawley' and 'Strauss' forcefields are selected to represent the corresponding agreement in FIGURE \ref{fig:sf6_liq} for the disordered phases. \begin{figure}[ht] \begin{center} \rotatebox{0}{\resizebox{0.8\textwidth}{!}{\includegraphics{sf6_liquid_sq}}} \caption{\label{fig:sf6_liq} Comparison of the MD simulated and experimental\cite{powles_1983, strauss_1994} total scattering structure factors of gaseous\cite{powles_1983} (a), supercritical fluid\cite{strauss_1994} (b)-(e), and prediction for close to triple point liquid state (f) of SF$_6$. Experimental datasets\cite{powles_1983, strauss_1994}: red circles; MD with 'Dellis' forcefield\cite{dellis_2010}: straight blue lines; with 'Pawley' forcefield\cite{pawley_1981}: straight orange lines; with 'Strauss' forcefield\cite{strauss_1994}: straight black lines.} \end{center} \end{figure} In the gaseous phase (FIGURE \ref{fig:sf6_liq}a), each forcefield provides almost perfect agreements with the measured dataset\cite{powles_1983} because the intramolecular structure factor dominates the total structure factor. Focusing on more dense states, the 'Strauss' forcefield total structure factors have not reproduced the measured ones, and close to the triple point liquid phase (FIGURE \ref{fig:sf6_liq}f) large oscillations appeared as the simulated system becomes crystalline. An earlier MD investigation\cite{dellis_2010} also showed that this forcefield results in peak shifts of the total radial distribution function in comparison with the experimental one, while other forcefields show similar behaviours to each other. Observing the performance of the other forcefields, agreements at supercritical states (FIGURES \ref{fig:sf6_liq}b-e) are excellent. Only slight differences appear at the low-Q part: the total structure factors of 'Pawley' are slightly less intense than those of 'Dellis': in FIGURE \ref{fig:sf6_liq}d intensity starts to rise below 0.5{ }\AA $^{-1}$. The other differences between simulated and measured total structure factors can be explained by errors of digitalization. For the plastic crystalline state (FIGURE \ref{fig:sf6_xtal}), \begin{figure}[hp] \begin{center} \rotatebox{0}{\resizebox{0.8\textwidth}{!}{\includegraphics{sf6_cryst_easy}}} \caption{\label{fig:sf6_xtal} Comparison of MD simulated (with the 'Dellis' forcefield\cite{dellis_2010}) and experimental\cite{rmcprofile_tutorial} total scattering powder structure factors of SF$_6$ at 190 K in the plastic crystal state. The low-Q-part is shown on (a), while insets show the agreement at (110) Bragg-reflection (b) and high Q (c). Experimental \cite{rmcprofile_tutorial} datasets: red circles; MD simulated total (Bragg+diffuse) and only diffuse scattering contributions: straight black and green lines, respectively.} \end{center} \end{figure} the simulated pattern provides satisfactory agreement with the total structure factor. Three main differences can be identified: the Bragg-peak intensities; diffuse scattering intensity differences between 1.5 and 5{ }\AA $^{-1}$; and intensity differences beyond 15{ }\AA $^{-1}$. The first one might result from MD simulations provided a slightly disordered model in comparison with reality as the simulated intensity of Bragg-peaks become smaller as Q increases. The second one might come that in this range the measured 3 bank datasets overlap, making their alignment slightly difficult. The last one might originate from the limits of harmonic approximation of intramolecular bond lengths and angle bending instead of a more realistic approximation for far from its equilibrium value. Here, the 'Dellis' model performs better in comparison with the 'Pawley'. The average densities produced by NpT runs are shown in TABLE \ref{sf6dens} for almost every forcefield. \begin{table}[ht] \caption{\label{sf6dens}Differences of NpT simulated densities from the experimental one in [kg/m$^3$], using different forcefields for SF$_6$.} \begin{center} \begin{tabular}{ccccccc} \hline Reference & \cite{strauss_1994} & \cite{strauss_1994} & \cite{strauss_1994} & \cite{strauss_1994} & \cite{dove_2002, rmcprofile_tutorial} & \cite{funke_2002} \\ Tempereture [K] & 398 & 398 & 398 & 398 & 190 & 225 \\ Pressure [bar] & 128 & 155 & 394 & 1827 & 1 & 10.1 \\ Density [kg/m$^3$] & 850 & 1000 & 1400 & 1850 & 2374 & 1842 \\ \hline Kinney & 114 & 77 & 55 & 91 & -4 & 266 \\ Kinney-opt & -8 & -36 & -16 & 45 & -69 & 84 \\ Pawley & -112 & -117 & -12 & 118 & 81 & -185 \\ Pawley-opt & -17 & -42 & -20 & 34 & -45 & 42 \\ Strauss-opt & -8 & -34 & -9 & 57 & -43 & 71 \\ Dellis & 12 & -14 & -3 & 55 & -41 & 58 \\ \hline \end{tabular} \end{center} \end{table} It does not contain gaseous phase datasets, because large volume fluctuations prevented performing NpT simulations, while the 'Strauss' forcefield provided a poor agreement to the total structure factors in the NVT ensemble, so the corresponding NpT simulations have not been done. Comparing the experimental with the simulated densities at 6 states, we can conclude that generally, the optimized and the 7 sites 'Dellis' forcefields perform better even for the 190K and 225K states that are below the applied range used for optimization by Dellis and Samios\cite{dellis_2010}. The strong negative difference in the density of the 'Pawley' forcefield for states near the triple point refers to shifts towards the gaseous state (the difference is notable in terms of total scattering structure factor in FIG. \ref{fig:sf6_liq}f), while positive differences for 'Kinney' refer to some transition to the crystalline state. Taking into account the agreement with experimental density and with neutron total scattering diffraction patterns, the 7 sites 'Dellis' (with partial charges) or the 6 sites 'Pawley-opt' forcefields are recommended to use.
\section{Introduction}\label{intro} Over the last two decades, the study of ideals with combinatorial origins has been an appealing trend in commutative algebra. One of the most well-studied types of such ideals which has attracted special attention in the literature is the binomial edge ideal of a graph. \par Let $G$ be a graph on $[n]$ and $S=\KK[x_1 ,\ldots ,x_n , y_1 , \ldots , y_n]$ be the polynomial ring over a field $\KK$. Then, the \emph{binomial edge ideal} associated with $G$, denoted by $J_G$, is the ideal in $S$ generated by all the quadratic binomials of the form $f_{ij}=x_{i}y_{j}-x_{j}y_{i}$, where $\{i,j\}\in E(G)$ and $1\leq i<j\leq n$. This class of ideals was introduced in 2010 by Herzog, Hibi, Hreinsd{\'o}ttir, Kahle and Rauh in \cite{HHHKR}, and independently by Ohtani in \cite{O}, as a natural generalization of determinantal ideals, as well as ideals generated by adjacent $2$-minors of a $2\times n$-matrix of indeterminates. \par Since then, many researchers have studied the algebraic properties and homological invariants of binomial edge ideals. The main goal is to understand how the invariants of the associated graph are reflected in the algebra of the ideal and vice versa. Indeed, it has been proved that there exists a mutual interaction between algebraic properties of binomial edge ideals and combinatorial properties of the underlying graphs, see e.g., \cite{A, BN, BMS, BMS2, EHH, ERT, ERT2, EZ, G, JKS, KS2, Kumar3, MM, RSK2, RSK3, SK, SK2} for some efforts in this direction. \par One of the homological invariants associated with binomial edge ideals, which is not easy to compute, is \emph{depth}. Recall that \[ \depth S/J_G=\min \{i:H_{\mathfrak{m}}^{i}(S/J_G)\neq 0\}, \] where $H_{\mathfrak{m}}^{i}(S/J_G)$ denotes the $i^{th}$ local cohomology module of $S/J_G$ with support at the maximal homogeneous ideal $\mathfrak{m}=(x_1,\ldots,x_n,y_1,\ldots,y_n)$ of $S$. \par Notice that unlike some other homological invariants associated with binomial edge ideals, like the Castelnuovo-Mumford regularity, which has been studied extensively, little is known about the depth of binomial edge ideals. Moreover, since the depth is in general dependent on the characteristic of the base field, finding some characteristic-free results about the depth of such homogeneous ideals is of great interest. In the following we briefly summarize the results in this direction. \par The first important result about the depth of binomial edge ideals appeared in~\cite{EHH}, where the authors showed that $\depth S/J_G=n+1$, where $G$ is a connected \emph{block} graph. Afterward, in \cite{ZZ} it was shown that $\depth S/J_G=n$, where $G$ is a cycle with more than $3$ vertices. Later, this result was generalized in~\cite{Kumar2} for the so-called \emph{quasi-cycle} graphs. Also, it was shown in~\cite{S} that the depth of the binomial edge ideal of a \emph{unicyclic} graph is either $n$ or $n+1$, and all unicyclic graphs of depth $n$ and $n+1$ were characterized. In~\cite{KumarS}, by generalizing a formula for the depth of \emph{complete bipartite} graphs in~\cite{SZ}, the authors gave some precise formulas for the depth of the \emph{join product} of graphs. In \cite{BN}, Banerjee and N\'u\~nez-Betancourt established a nice combinatorial upper bound for the depth of binomial edge ideals in terms of the \emph{vertex connectivity} of the underlying graph. Indeed, for a non-complete connected graph $G$, they showed that \begin{equation}\label{upper} \depth S/J_G\leq n-\kappa(G)+2, \end{equation} where $\kappa(G)$ denotes the vertex connectivity of $G$, which is the minimum number of vertices of $G$ whose removal makes $G$ disconnected. \par It is worth mentioning here that to the best of our knowledge, besides the above combinatorial upper bound for the depth of binomial edge ideals, there is no combinatorial lower bound for the depth of $S/J_G$. So, as the first main result of this paper, we supply the following combinatorial lower bound for the depth of binomial edge ideals: \medskip \noindent\textbf{Theorem A}~(Theorem \ref{mixed})\textbf{.} \emph{Let $G$ be a graph on $[n]$. Then $$\depth S/J_G\geq \xi(G).$$ In particular, if $G$ is connected, then $$\depth S/J_G\geq f(G)+\diam(G).$$ } \par Here, $\xi(G)=f(G)+d(G)$ where $f(G)$ denotes the number of \emph{free} vertices (or \emph{simplicial} vertices) of the graph $G$, and $d(G)$ denotes the sum of the \emph{diameters} of the connected components of $G$, and the number of the isolated vertices of $G$. Moreover, $\diam(G)$ denotes the diameter of $G$. \par In order to prove Theorem A, we first introduce the concept of $d$-compatible maps. Such maps are defined from the set of all graphs to the set of non-negative integers that admit certain properties (see Definition \ref{psi}). Then, we exploit this concept to establish a general lower bound for the depth of binomial edge ideals. We also provide a combinatorial $d$-compatible map, which yields the above lower bound. We also show that our lower bound is best possible in the sense that there are graphs $G$ for which $\depth S/J_G=\xi(G)$, see Figures \ref{sharp} and \ref{new}. \par Now, we would like to mention another motivation of this paper. In \cite{RSK2}, the authors of the present paper provided a general lower bound for the depth of binomial edge ideals. Indeed, they showed that $\depth S/J_G\geq 4$, where $G$ is a connected graph with at least three vertices. Moreover, they gave an explicit characterization of the graphs $G$ for which $\depth S/J_G=4$. More precisely, they showed that for graphs $G$ with more than three vertices, $\depth S/J_G=4$ if and only if $G=G'\ast 2K_1$, for some graph $G'$, where $G'\ast 2K_1$ denotes the join product of a graph $G'$ and two isolated vertices denoted by $2K_1$. \par Now, it is natural to ask about a combinatorial characterization of binomial edge ideals of higher depths. In this paper, by using a wonderful Hochster type formula for the local cohomology modules of binomial edge ideals provided by \`Alvarez~ Montaner in \cite{A}, we give such a characterization. Indeed, we prove the following characterization of the graphs $G$ for which $\depth S/J_G=5$, see Definition \ref{D5} for the required notation. \medskip \noindent\textbf{Theorem B}~(Theorem \ref{main})\textbf{.} \emph{Let $G$ be a graph on $[n]$ with $n\geq 5$. Then the following statements are equivalent:} \begin{enumerate} \item[{(a)}] $\depth S/J_G=5$. \item[{(b)}] $G$ is a $D_5$-type graph. \end{enumerate} \par \medskip The proof of Theorem B involves some topological results that we obtain in this paper about some specific subposets of a poset associated with binomial edge ideals, which are indeed of independent interest. \par The organization of this paper is as follows. In Section \ref{per}, we fix the notation and review some facts and definitions that will be used throughout the paper. \par In Section \ref{benefit}, toward providing some lower bounds for the depth of binomial edge ideals, in Definition \ref{psi}, we introduce a concept which is named as $d$-compatible maps. Such maps are defined from the set of all graphs to the set of non-negative integers with some specific properties. Then, in Theorem \ref{dcompatible}, by using the aforementioned concept, a general lower bound is given for the depth of binomial edge ideals. In addition, after providing a combinatorial $d$-compatible map in Theorem~\ref{xi}, a combinatorial lower bound is given for the depth of binomial edge ideals in Theorem~\ref{mixed}. This bound, together with a result from \cite{RSK2}, provides a modified version of the bound given in Theorem \ref{mixed}. \par In Section \ref{hochster type}, following the poset theoretical as well as the topological approaches used in \cite{A} and \cite{RSK2}, we associate a new poset with binomial edge ideals in Definition \ref{typo}. Then, we state in Theorem~\ref{Hochster}, the Hochster type formula for the local cohomology modules of binomial edge ideals arose from \cite[Theorem~3.9]{A}. \par In Section \ref{topology}, we use the Hochster type formula provided in Section \ref{hochster type} to characterize all graphs $G$ for which $\depth S/J_G=5$, in Theorem~\ref{main}. To prove our characterization, we need to provide several auxiliary ingredients. In particular, Theorem \ref{corona} which studies the vanishing of the zeroth and the first reduced cohomology groups of some subposets of the associated poset with binomial edge ideals, plays a crucial role in the proof of Theorem \ref{main}. \section{Preliminaries}\label{per} In this section, we recall some notions and known facts that are used in this paper. \par \medskip \textbf{Graph theory.} Throughout the paper, all graphs are assumed to be simple (i.e. with no loops, directed and multiple edges). Let $G$ be a graph on the vertex set $[n]$ and $T\subseteq [n]$. A subgraph $H$ of $G$ on the vertex set $T$ is called an \emph{induced subgraph} of $G$, whenever for any two vertices $u,v\in T$, one has $\{u,v\}\in E(H)$ if $\{u,v\}\in E(G)$. Now, by $G-T$, we mean the induced subgraph of $G$ on the vertex set $[n]\backslash T$. In the special case, when $T=\{v\}$, we use the notation $G-v$ instead of $G-\{v\}$, for simplicity. \par Let $v\in [n]$. Denoted by $N_G(v)$, is the set of all vertices of $G$ which are adjacent to $v$. We say that $v$ is a \emph{free} vertex (or \emph{simplicial} vertex) of $G$, if the induced subgraph of $G$ on the vertex set $N_G(v)$ is a complete graph. Moreover, a vertex which is not free, is called a non-free (or non-simplicial) vertex. We use $f(G)$ and $iv(G)$ to denote the number of free vertices and the number of non-free vertices of a graph $G$, respectively. \par A vertex $v\in [n]$ is said to be a \emph{cut vertex} of $G$ whenever $G-v$ has more connected components than $G$. Moreover, we say that $T$ has the \emph{cut point property} for $G$, whenever each $v\in T$ is a cut vertex of the graph $G-(T\backslash \{v\})$. Particularly, the empty set $\emptyset$, has the cut point property for $G$. \par Let $G_1$ and $G_2$ be two graphs on the disjoint vertex sets $V(G_1)$ and $V(G_2)$, respectively. Then, by the \emph{join product} of $G_1$ and $G_2$, denoted by $G_1*G_2$, we mean the graph on the vertex set $V(G_1)\cup V(G_2)$ and with the edge set \[ E(G_1)\cup E(G_2)\cup \{\{u,v\}: u\in V(G_1)~\mathrm{and}~v\in V(G_2)\}. \] \par \textbf{Primary decomposition of binomial edge ideals.} Let $G$ be a graph on $[n]$ and $T\subseteq [n]$. Let also $G_1 , \ldots , G_{c_G(T)}$ be the connected components of $G-T$, and $\widetilde{G}_1 , \ldots , \widetilde{G}_{c_G(T)}$ be the complete graphs on the vertex sets $V(G_1), \ldots , V(G_{c_G(T)})$, respectively. Let \[ P_T(G)=(x_v,y_v)_{v\in T} +J_{\widetilde{G}_1}+\cdots +J_{\widetilde{G}_{c_G(T)}}. \] Then, by \cite[Theorem~3.2]{HHHKR}, it is known that $J_{G}=\bigcap\limits_{\substack{T\subseteq [n]}}P_T(G)$. Moreover, in \cite[Corollary~3.9]{HHHKR}, all the minimal prime ideals of $J_G$ were determined. Indeed, it was shown that $P_T(G)\in \Min(J_G)$ if and only if $T\in \mathcal{C}(G)$, where \[ \mathcal{C}(G)=\{T\subseteq [n]:T~\mathrm{has~the~cut~point~property~for}~G\}. \] Finally, the following useful formula could be easily verified: \[ \mathrm{ht}\hspace{0.9mm}P_T(G)=n-c_G(T)+|T|. \] \par \textbf{Poset topology.} Let $\Delta$ be a simplicial complex. Then, by the \emph{$1$-skeleton} graph of $\Delta$ we mean the subcomplex of $\Delta$ consisting of all the faces of $\Delta$ which have cardinality at most $2$. The simplicial complex $\Delta$ is said to be \emph{connected} if its $1$-skeleton graph is connected. \par Let $(\mathcal{P},\preccurlyeq)$ be a poset. Recall that the \emph{order complex} of $\mathcal{P}$, denoted by $\Delta(\mathcal{P})$, is the simplicial complex whose facets are the maximal chains in $\mathcal{P}$. We say that $\mathcal{P}$ is a connected poset if its order complex $\Delta(\mathcal{P})$ is connected. Similarly, we say that $\mathcal{P}$ is contractible if $\Delta(\mathcal{P})$ is contractible. If $\mathcal{P}$ is an empty poset, then we consider $\Delta(\mathcal{P})=\{\emptyset\}$, i.e. the empty simplicial complex. \par \medskip \textbf{Mayer-Vietoris sequence.} Let $\Delta$ be a simplicial complex and $v\in V(\Delta)$. Recall the following three subcomplexes of $\Delta$ that will be used in this paper. \begin{itemize} \item $\mathrm{star}_\Delta(v)=\{\sigma\in\Delta : \sigma\cup \{v\}\in \Delta\}$; \item $\mathrm{del}_\Delta(v)=\{\sigma\in\Delta : v\not\in\sigma\}$; \item $\mathrm{link}_\Delta(v)=\{\sigma\in\Delta : v\not\in\sigma \hbox{ and } \sigma\cup \{v\}\in \Delta\}$. \end{itemize} \par Let $\Delta_1=\mathrm{star}_\Delta(v)$ and $\Delta_2=\mathrm{del}_\Delta(v)$. Then $\Delta_1\cup \Delta_2=\Delta$ and $\Delta_1\cap \Delta_2=\mathrm{link}_\Delta(v)$, and we have the \emph{Mayer-Vietoris} sequence: \begin{eqnarray*} \cdots \rightarrow H_{i}(\mathrm{link}_\Delta(v);\KK) \rightarrow H_i(\mathrm{star}_\Delta(v);\KK)\oplus H_i(\mathrm{del}_\Delta(v);\KK)\rightarrow\\ H_i(\Delta;\KK)\rightarrow H_{i-1}(\mathrm{link}_\Delta(v);\KK)\rightarrow\cdots \hspace{1cm} \end{eqnarray*} Moreover, we have the reduced version \[ \cdots \rightarrow \widetilde{H}_{0}(\mathrm{link}_\Delta(v);\KK)\rightarrow \widetilde{H}_0(\mathrm{star}_\Delta(v);\KK)\oplus \widetilde{H}_0(\mathrm{del}_\Delta(v);\KK)\rightarrow \widetilde{H}_0(\Delta;\KK)\rightarrow 0, \] provided that $\Delta_1\cap\Delta_2\neq \{\emptyset\}$. \section{A combinatorial lower bound for the depth of binomial edge ideals}\label{benefit} Our main goal in this section is to establish some lower bounds for the depth of binomial edge ideals. We first introduce the concept of $d$-\emph{compatible} maps, which are defined from the set of all graphs to the set of non-negative integers $\NN_0$ with some desirable properties. Then, considering this concept, we give a general lower bound for the depth of binomial edge ideals. We also provide a combinatorial $d$-compatible map to obtain a combinatorial lower bound for the depth of such ideals as well. \par We first introduce a graph that plays an important role in proving the main theorem of this section. Let $G$ be a graph on $[n]$ and $v\in [n]$. Associated with the vertex $v$, there is a graph, denoted by $G_{v}$, with the vertex set $V(G)$ and the edge set \[ E(G)\cup \{\{u,w\}: \{u,w\}\subseteq N_{G}(v)\}. \] Note that by the definition, it is clear that $v$ is a free vertex of the graph $G_v$, and $N_G(v)=N_{G_v}(v)$. \par Now we are ready to define the notion of a $d$-compatible map. In the following, by $K_t$ we mean the complete graph on $t$ vertices, for every $t\in \mathbb{N}$. \begin{Definition}\label{psi} \em{ Let $\mathcal{G}$ be the set of all graphs. A map $\psi:\mathcal{G}\longrightarrow \NN_0$ is called \emph{d-compatible}, if it satisfies the following conditions: \begin{enumerate} \item[{(a)}] if $G=\dot{\cup}_{i=1}^{t}K_{n_i}$, where $n_i\geq 1$ for every $1\leq i\leq t$, then $\psi(G)\leq t+\sum_{i=1}^{t}n_i$; \item[{(b)}] if $G\neq \dot{\cup}_{i=1}^{t}K_{n_i}$, then there exists a non-free vertex $v\in V(G)$ such that \begin{enumerate} \item[{(1)}] $\psi(G-v)\geq \psi(G)$, and \item[{(2)}] $\psi(G_v)\geq \psi(G)$, and \item[{(3)}] $\psi(G_{v}-v)\geq \psi(G)-1$. \end{enumerate} \end{enumerate} } \end{Definition} \par We also use the following lemma from \cite{Kumar}. In the following, $iv(G)$ denotes the number of non-free vertices of a graph $G$. \begin{Lemma}{\cite[Lemma~3.4]{Kumar}}\label{simplicial} Let $G$ be a graph and $v$ be a non-free vertex of $G$. Then, $\max\{iv(G_v), iv(G-v), iv(G_{v}-v)\}< iv(G)$. \end{Lemma} \par \medskip The following theorem provides a general lower bound for the depth of binomial edge ideals. \begin{Theorem}\label{dcompatible} Let $G$ be a graph on $[n]$ and $\psi$ a $d$-compatible map. Then $$\depth S/J_G\geq \psi(G).$$ \end{Theorem} \begin{proof} We prove the assertion by using induction on $iv(G)$. If $iv(G)=0$, then $G$ is a disjoint union of complete graphs, that is, $G=\dot{\cup}_{i=1}^{t}K_{n_i}$, where $n_i\geq 1$ for every $1\leq i\leq t$. We have $\depth S/J_G=t+\sum_{i=1}^{t}n_i$, by \cite[Theorem~1.1]{EHH}. On the other hand, by condition $(a)$ of Definition \ref{psi} we have $\psi(G)\leq t+\sum_{i=1}^{t}n_i$, so that the assertion holds in this case. Now, we assume that $iv(G)>0$. Let $v\in [n]$ be a non-free vertex with the properties of condition $(b)$ of Definition~\ref{psi}. \par By \cite[Lemma~4.8]{O}, we have $J_G=J_{G_v}\cap((x_v,y_v) + J_{G-v})$. Therefore, the short exact sequence \[ 0\longrightarrow \dfrac{S}{J_G}\longrightarrow \dfrac{S}{J_{G_v}}\oplus \dfrac{S_v}{J_{G-v}} \longrightarrow \dfrac{S_v}{J_{{G_v}-v}}\longrightarrow 0 \] is induced, where $S_v=\KK[x_i,y_i:i\in[n]\backslash \{v\}]$. \par Now, the well-known depth lemma implies that \begin{equation}\label{exact} \depth S/J_G\geq \min\{\depth S/J_{G_v}, \depth S_v/J_{G-v}, \depth S_v/J_{G_v-v}+1\}. \end{equation} Moreover, by Lemma \ref{simplicial}, induction hypothesis and by Definition~\ref{psi} part $(b)$, we have \begin{equation}\label{first} \depth S/J_{G_v}\geq \psi(G_v)\geq \psi(G), \end{equation} \begin{equation}\label{second} \hspace{0.04cm}\depth S_v/J_{G-v}\geq \psi(G-v)\geq \psi(G) \end{equation} and \begin{equation}\label{third} \hspace{0.9cm}\depth S_v/J_{G_v-v}\geq \psi(G_{v}-v)\geq \psi(G)-1. \end{equation} So, \eqref{exact} together with \eqref{first}, \eqref{second}, and \eqref{third} imply the result. \end{proof} Now, we are going to provide a combinatorial $d$-compatible map. Before that, we need to recall the concept of \emph{diameter} of a connected graph. Let $G$ be a connected graph on $[n]$, $u$ and $v$ be two vertices of $G$. Then, by the \emph{distance} between the vertices $u$ and $v$ in $G$, which is denoted by $d_G(u,v)$, we mean the length of a shortest path connecting $u$ and $v$ in $G$. Now, the \emph{diameter} of $G$, denoted by $\diam(G)$, is defined as $$\diam(G)=\max\{d_G(u,v): u,v \in V(G)\}.$$ We call a shortest path between two vertices $u$ and $v$ of $G$ with $d_G(u,v)=\diam(G)$, an \emph{LSP} in $G$. \par Let $G$ be a graph on $[n]$ with the connected components $G_1,\ldots,G_t$. Then we set $$d(G):=\mathfrak{i}(G)+\sum_{i=1}^{t}\diam(G_i),$$ where $\mathfrak{i}(G)$ denotes the number of isolated vertices of $G$. \par Now, in the next theorem, we provide a $d$-compatible map given by $\xi(G)$. Here, $f(G)$ denotes the number of free vertices of $G$. \begin{Theorem}\label{xi} The map $\xi:\mathcal{G}\longrightarrow \NN_0$ defined by $$\xi(G)=f(G)+d(G),~\text{for~every}~G\in\mathcal{G}$$ is $d$-compatible. \end{Theorem} \begin{proof} Let $G\in \mathcal{G}$. First assume that $G=\dot{\cup}_{i=1}^{t}K_{n_i}$, where $n_i\geq 1$ for every $1\leq i\leq t$. Clearly we have $f(G)= \sum_{i=1}^{t}n_i$ and $d(G)=t$, and hence $\xi(G)=t+\sum_{i=1}^{t}n_i$. Therefore, we just need to show that $\xi$ satisfies condition $(b)$ of Definition \ref{psi}. To do so, without loss of generality we assume that $G$ is a non-complete connected graph. Therefore, we have $d(G)=\diam(G)$. For convenience, we set $d=d(G)$. Notice that $d\geq 2$, since $G$ is not a complete graph. \par First we show that there exists a non-free vertex $v\in [n]$ such that $\xi(G-v)\geq \xi(G)$. It is clear that for any non-free vertex $v$, we have $f(G-v)\geq f(G)$. If there exists a non-free vertex $v\in [n]$ such that $v$ does not belong to the vertex set of some LSP in $G$, then $v$ is certainly a vertex with the desired property. So, we may assume that every non-free vertex of $G$ belongs to the vertex set of every LSP in $G$. Let $P\hspace{-1.2mm}:v_1,v_2, \ldots ,v_{d+1}$ be an arbitrary LSP in $G$. Notice that $v_i$ is a non-free vertex of $G$ for every $2\leq i \leq d$. Also, every vertex $v$ of $G$ which is not on the path $P$ is a free vertex of $G$. These imply that for every $2\leq j \leq d$, the vertices $v_{j-1}$ and $v_{j+1}$ belong to two different connected components of the graph $G-v_j$. Indeed, assume on contrary that there exists a path $P'\hspace{-1.2mm}:v_{j-1},u_1,\ldots,u_t,v_{j+1}$ in the graph $G-v_j$. Without loss of generality we may assume that $P'$ is an induced path in $G-v_j$. This clearly implies that $\{u_1,\ldots,u_t\}\subseteq V(P)\setminus \{v_j\}$. So, we have that $u_1=v_{j-2},u_2=v_{j-3},\ldots,u_t=v_{j-t-1}$. Thus, $\{v_{j-t-1},v_{j+1}\}\in E(G)$, a contradiction. \par Now, let $2\leq j \leq d$, and $\{n_j,v_j\}\in E(G)$, where $n_j\in [n]\setminus V(P)$. By a similar argument one could see that $d_{G-v_{j+1}}(n_j,v_1)=j$, if $\{n_j,v_{j-1}\}\notin E(G)$, and $d_{G-v_j}(n_j,v_1)=j-1$, if $\{n_j,v_{j-1}\}\in E(G)$. Also, we have $d_{G-v_{j-1}}(n_j,v_{d+1})=d-j+2$, if $\{n_j,v_{j+1}\}\notin E(G)$, and $d_{G-v_j}(n_j,v_{d+1})=d-j+1$, if $\{n_j,v_{j+1}\}\in E(G)$. We use these facts throughout the proof. \par Now, assume that there exists $2\leq i\leq d$ such that $N_G(v_i)\cap N_G(v_{i+1})\neq\emptyset$. Let $j=\min \{i: 2\leq i\leq d, N_G(v_i)\cap N_G(v_{i+1})\neq\emptyset\}.$ We claim that $v_j$ is a vertex with the desired property. To prove the claim, we distinguish the following cases: \par First assume that $j>3$. Let $n_j\in N_G(v_j)\cap N_G(v_{j+1})$. We have $d_{G-v_j}(n_j,v_{d+1})=d-j+1$. Now, if $v_{j-1}$ is a free vertex of $G-v_j$, we have $f(G-v_j)\geq f(G)+1$. On the other hand, we have that $d(G-v_j)\geq j-2+d_{G-v_j}(n_j,v_{d+1})=d-1$, since the vertices $v_{j-1}$ and $v_{j+1}$ are contained in two connected components of the graph $G-v_j$. So, we get $f(G-v_j)+d(G-v_j)\geq f(G)+1+d-1=f(G)+d$, as desired. Now, if $v_{j-1}$ is a non-free vertex of $G-v_j$, then, there exists $n_{j-1}\in N_{G-v_j}(v_{j-1})$ such that $n_{j-1}$ is not on the path $P$. Since $j-2\geq 2$, by the choice of $j$, we have that $\{n_{j-1},v_{j-2}\}\notin E(G)$. This implies that $d_{G-v_j}(v_1,n_{j-1})=j-1$, and hence $d(G-v_j)\geq j-1+d_{G-v_j}(n_j,v_{d+1})=d$, which proves the claim in this case. \par Next suppose that $j=3$. Let $n_3\in N_G(v_3)\cap N_G(v_{4})$. If $v_2$ is a free vertex of $G-v_3$, then the claim follows by the same argument of the previous case. If $v_2$ is a non-free vertex of $G-v_3$, there exists an induced path $P''\hspace{-1.2mm}:\alpha,v_2,\beta$ in $G-v_3$. Therefore $d(G-v_3)\geq 2+d_{G-v_3}(n_3,v_{d+1})=d$. This implies the claim. \par Finally, suppose that $j=2$, and let $n_2\in N_G(v_2)\cap N_G(v_{3})$. Then $d_{G-v_2}(n_2,v_{d+1})=d-1$. Therefore, since $v_1$ and $v_3$ belong to two connected components of $G-v_2$, we get $d(G-v_2)\geq 1+d-1=d$, as desired. \par Now, we assume that $N_G(v_i)\cap N_G(v_{i+1})=\emptyset$, for every $2\leq i\leq d$. We show that $v_2$ is a vertex with the desired property. First, notice that either $v_3$ is a free vertex of $G-v_2$, or there exists a vertex $n_3$ such that $\{n_3,v_3\}\in E(G)$ and $\{n_3,v_4\}\notin E(G)$. This implies that either $f(G-v_2)\geq f(G)+1$ which completes the proof in this case or $d_{G-v_2}(n_3,v_{d+1})=d-1$. \par \vspace{.5cm} Now, for the rest of the proof, we show that all non-free vertices of $G$ satisfy conditions $(2)$ and $(3)$ of Definition \ref{psi}. Suppose that $v$ is an arbitrary non-free vertex of $G$. \par First we prove that $\xi(G_v)\geq \xi(G)$. Notice that $f(G_v)\geq f(G)+1$, by Lemma~\ref{simplicial}. Therefore, the result follows if we show that $d(G_v)\geq d-1$. Let $\alpha$ and $\beta$ be two vertices of $G$ with $d_G(\alpha,\beta)=d$. It suffices to show that $d_{G_v}(\alpha,\beta)\geq d-1$. Assume on contrary that there exists a path $P\hspace{-1.2mm}:\alpha=u_1,u_2, \ldots ,u_{\ell+1}=\beta$ in $G_v$ with $\ell\leq d-2$. Without loss of generality we may assume that $P$ is an induced path in $G_v$. Now we consider the following cases: \par First assume that $v\in V(P)$. This clearly implies that $v=\alpha$ or $v=\beta$, since $v$ is a free vertex of $G_v$. Therefore, $P$ is a path in $G$. So, we have that $d_G(\alpha,\beta)\leq d-2$, a contradiction. \par Next assume that $v\notin V(P)$. Now, since $P$ is an induced path in $G_v$ and since $P$ is not a path in $G$, we get $|N_{G_v}(v)\cap V(P)|=2$. Therefore, $N_{G_v}(v)\cap V(P)=\{u_i,u_{i+1}\}$ for some $1\leq i \leq \ell$. Now, the path $P'\hspace{-1.2mm}:\alpha=u_1,\ldots,u_i,v,u_{i+1},\ldots,u_{\ell+1}=\beta$ is a path in $G$ between $\alpha$ and $\beta$ with the length at most $d-1$, which is a contradiction. \par So, we have $d_{G_v}(\alpha,\beta)\geq d-1$, as desired. \par \vspace{.5cm} Finally, we show that $\xi(G_{v}-v)\geq \xi(G)-1$. To prove this, it is enough to show that $d(G_{v}-v)\geq d-1$, since $f(G_{v}-v)\geq f(G)$ by Lemma \ref{simplicial}. Let $P\hspace{-1.2mm}:v_1,v_2, \ldots ,v_{d+1}$ be an LSP in $G$. We consider the following cases: \par First assume that $v \neq v_1$ and $v\neq v_{d+1}$. We show that $d_{G_{v}-v}(v_1,v_{d+1})\geq d-1$. Suppose on contrary that $d_{G_{v}-v}(v_1,v_{d+1})\leq d-2$. Therefore, there exists a path $P'$ in $G_{v}-v$ between the vertices $v_1$ and $v_{d+1}$ with the length at most $d-2$. We may also assume that $P'$ is an induced path in $G_{v}-v$. Since $v$ is a free vertex of $G_v$ and since $P'$ is not a path in $G$, the vertex $v$ has exactly two adjacent neighbours in $G$ on the path $P'$. This implies that $d_G(v_1,v_{d+1})\leq d-1$, a contradiction. \par Next without loss of generality we assume that $v=v_1$. Now, the result follows if we show that $d_{G_{v}-v}(v_2,v_{d+1})\geq d-1$. Assume on contrary that there exists an induced path $P''\hspace{-1.2mm}:v_2,u_1,\ldots,u_r=v_{d+1}$ in $G_{v}-v$ between the vertices $v_2$ and $v_{d+1}$ with the length $r$, where $r\leq d-2$. Now, we have either $N_{G_v}(v)\cap V(P'')=\{v_2\}$ or $N_{G_v}(v)\cap V(P'')=\{v_2,u_1\}$. Therefore, we get a path in $G$ between $v_1$ and $v_{d+1}$, with the length at most $d-1$, and hence $d_G(v_1,v_{d+1})\leq d-1$, a contradiction. \par So, we have $d(G_{v}-v)\geq d-1$, as desired. \end{proof} Now, combining of Theorem \ref{dcompatible} and Theorem \ref{xi}, we get the following combinatorial lower bound for the depth of binomial edge ideals. \begin{Theorem}\label{mixed} Let $G$ be a graph on $[n]$. Then $$\depth S/J_G\geq \xi(G).$$ In particular, if $G$ is connected, then $$\depth S/J_G\geq f(G)+\diam(G).$$ \end{Theorem} We would like to remark that the lower bound in Theorem \ref{mixed} could be tight. For instance, let $G$ be the graph illustrated in Figure \ref{sharp}. Then $f(G)=8$ and $\diam(G)=4$, and hence $\depth S/J_G\geq \xi(G)=12$, by Theorem~\ref{mixed}. On the other hand, the upper bound given in \eqref{upper} implies that $\depth S/J_G\leq |V(G)|+1=12$, since $\kappa(G)=1$. Therefore, we get $\depth S/J_G=12$. \begin{figure}[H] \definecolor{qqqqff}{rgb}{0.,0.,1.} \centering \begin{tikzpicture}[scale=1.1,line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm] \draw (0.,0.)-- (1.,1.); \draw (0.,0.)-- (1.,-1.); \draw (1.,1.)-- (1.,0.); \draw (1.,-1.)-- (1.,0.); \draw (1.,0.)-- (2.,1.); \draw (1.,0.)-- (2.,-1.); \draw (2.,1.)-- (2.,-1.); \draw (0.,0.)-- (-1.,1.); \draw (0.,0.)-- (-1.,-1.); \draw (-1.,1.)-- (-1.,0.); \draw (-1.,-1.)-- (-1.,0.); \draw (-2.,1.)-- (-1.,0.); \draw (-1.,0.)-- (-2.,-1.); \draw (-1.,0.)-- (0.,0.); \draw (0.,0.)-- (1.,0.); \draw (-2.,1.)-- (-2.,-1.); \begin{scriptsize} \draw [fill=qqqqff] (0.,0.) circle (1.5pt); \draw [fill=qqqqff] (1.,1.) circle (1.5pt); \draw [fill=qqqqff] (1.,0.) circle (1.5pt); \draw [fill=qqqqff] (1.,-1.) circle (1.5pt); \draw [fill=qqqqff] (2.,1.) circle (1.5pt); \draw [fill=qqqqff] (2.,-1.) circle (1.5pt); \draw [fill=qqqqff] (-1.,1.) circle (1.5pt); \draw [fill=qqqqff] (-1.,0.) circle (1.5pt); \draw [fill=qqqqff] (-1.,-1.) circle (1.5pt); \draw [fill=qqqqff] (-2.,1.) circle (1.5pt); \draw [fill=qqqqff] (-2.,-1.) circle (1.5pt); \end{scriptsize} \end{tikzpicture} \vspace{1mm} \caption{A graph $G$ with $\depth S/J_G=\xi(G)=n-\kappa(G)+2=12$.} \label{sharp} \end{figure} \par It is also remarkable that there are connected graphs $G$ on $[n]$ for which the lower bound given in Theorem \ref{mixed} is attained while $\depth S/J_G <n-\kappa(G)+2$. For instance, let $G$ be the graph depicted in Figure \ref{new} with $f(G)=\diam(G)=4$. Then, a routine computation with Macaulay2~\cite{GS} over the base field $\QQ$ shows that $\depth S/J_G=\xi(G)=8$, whereas $n-\kappa(G)+2=9$. \begin{figure}[H] \definecolor{qqqqff}{rgb}{0.,0.,1.} \centering \begin{tikzpicture}[scale=1.3,line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm] \draw (-2.,1.)-- (-2.,0.); \draw (-2.,0.)-- (-3.,0.); \draw (-2.,1.)-- (-1.,1.); \draw (-1.,0.)-- (-2.,0.); \draw (-2.,1.)-- (-3.,0.); \draw (-2.,1.)-- (-3.,1.); \draw (-1.,1.)-- (-1.,0.); \draw (0.,1.)-- (-1.,1.); \draw (0.,1.)-- (-1.,0.); \draw (-1.,0.)-- (0.,0.); \begin{scriptsize} \draw [fill=qqqqff] (-2.,1.) circle (1.5pt); \draw [fill=qqqqff] (-1.,1.) circle (1.5pt); \draw [fill=qqqqff] (-2.,0.) circle (1.5pt); \draw [fill=qqqqff] (-3.,0.) circle (1.5pt); \draw [fill=qqqqff] (-1.,0.) circle (1.5pt); \draw [fill=qqqqff] (0.,1.) circle (1.5pt); \draw [fill=qqqqff] (-3.,1.) circle (1.5pt); \draw [fill=qqqqff] (0.,0.) circle (1.5pt); \end{scriptsize} \end{tikzpicture} \vspace{1.5mm} \caption{A graph $G$ with $\depth S/J_G=\xi(G)=8<n-\kappa(G)+2=9$.} \label{new} \end{figure} \par We should also remark that there are both Cohen-Macaulay and non Cohen-Macaulay graphs $G$ with $\depth S/J_G>\xi(G)$. For example, for the illustrated graph $G$ in Figure \ref{CM} with $\xi(G)=5$, a computation with Macaulay2 \cite{GS} (see also \cite[Theorem~3.9]{KumarS}), shows that $S/J_G$ is Cohen-Macaulay, which yields that $\depth S/J_G=~6$. On the other hand, for the non Cohen-Macaulay graph $G$ depicted in Figure \ref{nice}, we have $\depth S/J_G=5>\xi(G)=2$, see Theorem \ref{main}. Moreover, there are Cohen-Macaulay and non Cohen-Macaulay graphs $G$ with $\depth S/J_G=\xi(G)$. Indeed, one could easily see that all graphs $G$ satisfying equivalent conditions of \cite[Theorem~3.1]{EHH} are Cohen-Macaulay with $\depth S/J_G=\xi(G)$. Also, the graph $G$ depicted in Figure~\ref{new} is non Cohen-Macaulay with $\depth S/J_G=\xi(G)=8$. \begin{figure}[H] \definecolor{qqqqff}{rgb}{0.,0.,1.} \centering \begin{tikzpicture}[scale=1.3,line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm] \draw (3.,2.)-- (2.,2.); \draw (3.,2.)-- (4.,2.); \draw (3.,2.)-- (4.,3.); \draw (3.,2.)-- (3.,3.); \draw (4.,2.)-- (4.,3.); \draw (4.,3.)-- (3.,3.); \begin{scriptsize} \draw [fill=qqqqff] (2.,2.) circle (1.5pt); \draw [fill=qqqqff] (3.,2.) circle (1.5pt); \draw [fill=qqqqff] (4.,2.) circle (1.5pt); \draw [fill=qqqqff] (4.,3.) circle (1.5pt); \draw [fill=qqqqff] (3.,3.) circle (1.5pt); \end{scriptsize} \end{tikzpicture} \vspace{1.7mm} \caption{A Cohen-Macaulay graph $G$ with $\depth S/J_G=6>\xi(G)=5$.} \label{CM} \end{figure} \par Now, combining Theorem \ref{mixed} together with \cite[Theorem~5.2]{RSK2} yields the following bound for the depth of binomial edge ideals. \begin{Corollary} Let $G$ be a graph on $[n]$ with $n\geq 3$. Then \[ \depth S/J_G\geq \max\{4,\xi(G)\}. \] \end{Corollary} Moreover, in \cite[Theorem~5.3]{RSK2}, it was shown that for graphs $G$ with more than three vertices, $\depth S/J_G=4$ if and only if $G=G'\ast 2K_1$ for some graph $G'$. Therefore, we have: \begin{Corollary}\label{combin} Let $G$ be a graph on $[n]$ with $n\geq 4$ and $G\neq G'\ast 2K_1$ for every graph $G'$. Then \[ \depth S/J_G\geq \max\{5,\xi(G)\}. \] \end{Corollary} As we saw in Figure \ref{sharp}, there are graphs $G$ for which $\depth S/J_G=\xi(G)>5$. There are also graphs $G$ for which $\depth S/J_G=5$ while $\xi(G)<5$. For instance, let $G$ be the graph shown in Figure \ref{nice}. We have $\xi(G)=2$. However, we will see in Theorem \ref{main} that $\depth S/J_G=5$. Our main goal in the rest of this paper is to characterize all graphs $G$ with $\depth S/J_G=5$. \section{A poset associated with binomial edge ideals and a Hochster type formula}\label{hochster type} In this section, continuing the topological approach from \cite{A} and \cite{RSK2}, we study the local cohomology modules of binomial edge ideals. To this end, we first associate a new poset, adapted to our needs, with binomial edge ideals as follows. \par Let $I$ be an ideal in the polynomial ring $S$ and $I=q_1\cap \cdots \cap q_t$ be an arbitrary decomposition for the ideal $I$. Then, by the poset $\mathcal{R}_I$, ordered by the reverse inclusion, we mean the poset of all possible sums of ideals in this decomposition, defined in \cite[Example~2.1]{ABZ}. Now, we know that $J_{G}=\bigcap\limits_{\substack{T\subseteq [n]}}P_T(G)$. We use $\mathcal{R}_{G}$, instead of $\mathcal{R}_{J_G}$, to denote the poset arose from the above decomposition of $J_G$. \par Now, we define another poset associated with the binomial edge ideal of a graph $G$. \begin{Definition}\label{typo} \em{Let $G$ be a graph on $[n]$. Associated with the decomposition $J_{G}=\bigcap\limits_{\substack{T\subseteq [n]}}P_T(G)$, we consider the poset $(\mathcal{M}_G,\preccurlyeq)$, ordered by reverse inclusion, which is made up of the following elements: \begin{itemize} \item the prime ideals in the poset $\mathcal{R}_{G}$, \item the prime ideals in the posets $\mathcal{R}_{I}$, arising from the following type of decompositions: \[ I=q_1\cap q_2 \cap \cdots \cap q_t \cap (q_1+P_\emptyset(G)) \cap (q_2+P_\emptyset(G)) \cap \cdots \cap (q_t+P_\emptyset(G)),\] where $I$'s are the non-prime ideals in the poset $\mathcal{R}_{G}$ and $q_1, q_2,\ldots, q_t$ are the minimal prime ideals of $I$, and \item the prime ideals that we obtain repeatedly by this procedure every time that we find a non-prime ideal. \end{itemize} } \end{Definition} Note that using the non-minimal primary decomposition $J_{G}=\bigcap\limits_{\substack{T\subseteq [n]}}P_T(G)$ in Definition \ref{typo}, turns the poset $\mathcal{M}_G$ to be different from the posets $\mathcal{A}_G$ and $\mathcal{Q}_G$, considered by the authors in \cite{A} and \cite{RSK2}, respectively. We also notice that the significance of this new definition will be demonstrated in the proof of Theorem ~\ref{main} and Theorem \ref{corona}. Furthermore, the following lemma, which is a direct consequence of \cite[Proposition~3.4]{RSK2}, guarantees that the process of the construction of the poset $\mathcal{M}_G$ terminates after a finite number of steps just like the construction process of the poset $\mathcal{A}_{G}$ as well as the poset $\mathcal{Q}_G$. \begin{Lemma}\label{crucial} Let $G$ be a graph on $[n]$. Then every element $q$ of the poset $\mathcal{M}_G$ is of the form $P_T(H)$, for some graph $H$ on $[n]$ and some $T\subseteq [n]$. \end{Lemma} Now, by applying Lemma \ref{crucial} and thanks to the flexibility for the decomposition of the ideals in \cite[Theorem~5.22]{ABZ}, the following Hochster type decomposition formula for the local cohomology modules of binomial edge ideals is established by using the same argument that was applied in the proof of \cite[Theorem~3.9]{A}. We first need to fix a notation before stating the formula. \par Let $1_{{\mathcal{M}_G}}$ be a terminal element that we add to the poset $\mathcal{M}_G$. Then, recall that for every $q\in \mathcal{M}_G$, by the interval $(q,1_{\mathcal{M}_G})$, one means the subposet \[ \{z\in \mathcal{M}_G: q\precneqq z\precneqq 1_{{\mathcal{M}_G}}\}. \] \par \begin{Theorem}{\em(see} \cite[Theorem~3.9]{A} {\em and} \cite[Theorem~3.6]{RSK2}{\em .)}\label{Hochster} Let $G$ be a graph on $[n]$. Then we have the $\KK$-isomorphism \[ H_{\mathfrak{m}}^{i}(S/J_G)\cong\bigoplus_{q \in \mathcal{M}_G} H_{\mathfrak{m}}^{d_q}(S/q)^{\oplus M_{i,q}}, \] where $d_q=\dim S/q$ and $M_{i,q}=\dim_{\KK} \widetilde{H}^{i-d_q-1}((q,1_{{\mathcal{M}_G}});\KK)$. \end{Theorem} Note that the above theorem suggests an interesting and also a wonderful method to study the depth of binomial edge ideals. Indeed, instead of working directly with the minimal graded free resolution of $S/J_G$, which is almost an intractable task, we may elaborate the topological properties of the subposets $(q,1_{{\mathcal{M}_G}})$ of $\mathcal{M}_G$. In this approach, beside the algebraic tools, we also employ the topological tools. \section{Combinatorial characterization of some binomial edge ideals in terms of their depth}\label{topology} At the end of Section \ref{benefit}, we provided a lower bound for the depth of binomial edge ideals. We showed that for a graph $G$ with more than three vertices, $\depth S/J_G\geq \max\{5,\xi(G)\}$, if $G\neq G'\ast 2K_1$ for every graph $G'$. Now, our main goal in this section is to give a combinatorial characterization of graphs $G$ with $\depth S/J_G=5$. For this aim, we need to study topological properties of certain subposets of $\mathcal{M}_G$ to compute some local cohomology modules of $S/J_G$. \par First we need to state the following definition. \begin{Definition}\label{gpich} \em{ Let $T\subseteq [n]$ with $|T|=n-2$. Associated with $T$, we introduce a family of graphs on $[n]$, denoted by $\mathcal{G}_T$, such that for each $G\in \mathcal{G}_T$, there exist two non-adjacent vertices $u$ and $w$ of $G$ with $u,w\in [n]\backslash T$, and three disjoint subsets of $T$, say $V_0$, $V_1$ and $V_2$ with $V_1,V_2\neq \emptyset$ and $\bigcup_{i=0}^{2}V_i=T$, such that the following conditions hold: \begin{enumerate} \item[{(1)}] $N_G(u)=V_0\cup V_1$ and $N_G(w)=V_0\cup V_2$. \item[{(2)}] $\{v_1,v_2\}\in E(G)$, for every $v_1\in V_1$ and every $v_2\in V_2$. \end{enumerate} } \end{Definition} \begin{Remark} \em{Given three arbitrary graphs $G_0$, $G_1$ and $G_2$ on disjoint sets of vertices $V_0$, $V_1$ and $V_2$, respectively, where $V_1,V_2\neq \emptyset$, we can construct a graph in the family $\mathcal{G}_T$ with $T=\bigcup_{i=0}^{2}V_i$. Note that the vertices in $V_0$ can be adjacent to some vertices in $V_1$ and $V_2$.} \end{Remark} \par An explicit example of a graph $G$ for which $G\in \mathcal{G}_T$ for some $T\subseteq V(G)$ with $|T|=|V(G)|-2$ is depicted in Figure \ref{nice}. \par Before stating the main theorem of this section we need to introduce a family of graphs that is essential in our characterization. In the following, $3K_1$ denotes the graph consisting of three isolated vertices. \begin{Definition}\label{D5} \em{Let $G$ be a graph on $[n]$ with $G\neq G'\ast 2K_1$ for any graph $G'$. We say that $G$ is a $D_5$-type graph, if one of the following conditions holds: \begin{enumerate} \item[{(1)}] $G\in \mathcal{G}_T$ for some $T\subseteq [n]$; \item[{(2)}] $G=H\ast 3K_1$, for some graph $H$; \item[{(3)}] $G=H\ast(K_1\dot{\cup}K_2)$, for some graph $H$. \end{enumerate} } \end{Definition} \begin{figure}[H] \definecolor{qqffqq}{rgb}{0.,1.,0.} \definecolor{cczzqq}{rgb}{0.8,0.6,0.} \definecolor{ffqqqq}{rgb}{1.,0.,0.} \definecolor{xfqqff}{rgb}{0.4980392156862745,0.,1.} \centering \begin{tikzpicture}[scale=1,line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm] \draw (-3.6,0.5)-- (-2.,2.); \draw (-3.6,0.5)-- (-1.,2.); \draw (-1.,1.)-- (-2.,1.); \draw (-1.,0.)-- (-2.,0.); \draw (-1.,1.)-- (-2.,0.); \draw (-2.,1.)-- (-1.,0.); \draw (-3.6,0.5)-- (-2.,0.); \draw (0.6,0.45)-- (-1.,2.); \draw (0.6,0.45)-- (-2.,2.); \draw (0.6,0.45)-- (-1.,0.); \draw (-2.,2.)-- (-1.,1.); \draw (-1.,2.)-- (-2.,1.); \draw [color=ffqqqq] (-1.5,3.5)-- (-1.,2.); \draw [color=ffqqqq] (-1.5,3.5)-- (-2.,2.); \draw (-1.5,3.5)-- (-3.6,0.5); \draw (-1.5,3.5)-- (0.6,0.45); \draw [color=ffqqqq] (-2.,2.)-- (-1.,2.); \draw (-3.6,0.5)-- (-2.,1.); \draw (0.6,0.45)-- (-1.,1.); \draw (-2.,0.5)-- (-3.6,0.5); \draw [color=qqffqq] (-2.,0.5)-- (-2.,1.); \draw [color=qqffqq] (-2.,0.5)-- (-2.,0.); \draw [color=cczzqq] (-1.,0.5)-- (-1.,0.); \draw [color=cczzqq] (-1.,0.5)-- (-1.,1.); \draw (0.6,0.45)-- (-1.,0.5); \draw (-2.,1.)-- (-1.,0.5); \draw (-1.,0.5)-- (-2.,0.); \draw (-2.,0.5)-- (-1.,1.); \draw (-4.26,0.75) node[anchor=north west] {\large{$u$}}; \draw (0.65,0.71) node[anchor=north west] {\large{$w$}}; \draw (-2.,0.5)-- (-1.,0.5); \draw (-2.,0.5)-- (-1.,0.); \begin{scriptsize} \draw [fill=xfqqff] (-3.6,0.5) circle (1.5pt); \draw [fill=ffqqqq] (-2.,2.) circle (1.5pt); \draw [fill=ffqqqq] (-1.,2.) circle (1.5pt); \draw [fill=cczzqq] (-1.,1.) circle (1.5pt); \draw [fill=qqffqq] (-2.,1.) circle (1.5pt); \draw [fill=cczzqq] (-1.,0.) circle (1.5pt); \draw [fill=qqffqq] (-2.,0.) circle (1.5pt); \draw [fill=xfqqff] (0.6,0.45) circle (1.5pt); \draw [fill=ffqqqq] (-1.5,3.5) circle (1.5pt); \draw [fill=qqffqq] (-2.,0.5) circle (1.5pt); \draw [fill=cczzqq] (-1.,0.5) circle (1.5pt); \end{scriptsize} \end{tikzpicture} \vspace{1mm} \caption{A $D_5$-type graph $G$ with $G\in \mathcal{G}_T$, where $T=V(G)\setminus\{u,w\}$.} \label{nice} \end{figure} Now, we are ready to state the main result of this section which is an explicit characterization of graphs $G$ with $\depth S/J_G=5$. \begin{Theorem}\label{main} Let $G$ be a graph on $[n]$ with $n\geq 5$. Then the following statements are equivalent: \begin{enumerate} \item[{(a)}] $\depth S/J_G=5$. \item[{(b)}] $G$ is a $D_5$-type graph. \end{enumerate} \end{Theorem} To prove the above theorem, we need to prepare several auxiliary ingredients. First, we state the following lemma that follows with the same argument as in the proof of \cite[Lemma~4.1]{RSK2}. \begin{Lemma}\label{vital} Let $G$ be a graph on $[n]$. Then $q+P_\emptyset(G)\in \mathcal{M}_G$, for every $q\in \mathcal{M}_G$. \end{Lemma} We also need to recall a concept from the literature of topology of posets. \begin{Definition} \em{A poset $\mathcal{P}$ is said to be meet-contractible if there exists an element $\alpha\in \mathcal{P}$ such that $\alpha$ has a meet with every element $\beta\in \mathcal{P}$.} \end{Definition} The following lemma clarifies the importance of the notion of meet-contractible posets. \begin{Lemma}\em{(\cite[Theorem~3.2]{BW}, see also \cite[Proposition~2.4]{W})}\label{meet} \em{Every meet-contractible poset is contractible.} \end{Lemma} In the following theorem that is crucial in the proof of Theorem~\ref{main}, we discuss the vanishing of the zeroth and the first reduced cohomology groups of the subposets associated with the elements of $\mathcal{M}_G$, which are of the form $P_T(H)$ for some graph $H$ on $[n]$ and some $T\subseteq [n]$ with $|T|=n-2$. \begin{Theorem}\label{corona} Let $G$ be a graph on $[n]$ and $q\in \mathcal{M}_G$, where $q=P_{T}(H)$ for some graph $H$ on $[n]$ and some $T\subseteq [n]$ with $|T|=n-2$. \begin{enumerate} \item[{(a)}] If $c_H(T)=2$, then $(q,1_{\mathcal{M}_G})$ is connected if and only if $G\notin \mathcal{G}_T$. \item[{(b)}] If $c_H(T)=1$, then $\widetilde{H}^{1}((q,1_{{\mathcal{M}_G}});\KK)=0$ if and only if $G\notin \mathcal{G}_{T}$. \end{enumerate} \end{Theorem} \begin{proof} Without loss of generality we assume that $T=\{1,\ldots,n-2\}$. \par $(a)$ We have $q=(x_1,\ldots,x_{n-2},y_1,\ldots,y_{n-2})$, since $c_H(T)=2$. Also, $\{n-1,n\}\notin E(G)$. Indeed, assume on contrary that $\{n-1,n\}\in E(G)$. Since $q\in \mathcal{M}_G$, there exists $U\in \mathcal{C}(G)$ such that $P_U(G)\subseteq q$. It follows that $U\subseteq T$. On the other hand, $n-1$ and $n$ are two adjacent vertices of $G-U$. So, we get $f_{n-1,n}\in P_U(G)\subseteq q$, a contradiction. \par Now, assume that $G\notin \mathcal{G}_T$. We show that $(q,1_{\mathcal{M}_G})$ is a connected poset. We proceed in the following steps: \par Let $L_0=N_G(n-1)\cap N_G(n)$, $L_1=N_G(n)\backslash N_G(n-1)$, and $L_2=N_G(n-1)\backslash N_G(n)$. We also let $L_3=\{i\in T: i\notin N_G(n-1)\cup N_G(n)\}$. Set $X=\{P_{T\setminus \{\alpha\}}(G): \alpha \in L_1 \cup L_2 \cup L_3\}$. One has $X\subseteq(q,1_{\mathcal{M}_G})$, since $\{n-1,n\}\notin E(G)$ and $\alpha\notin L_0$ for every $\alpha\in L_1\cup L_2\cup L_3$. \par \textbf{Step 1:} Let $q'\in (q,1_{\mathcal{M}_G})$. We claim that there exists $P_{T\setminus\{\alpha\}}(G)\in X$ such that there is a path between $q'$ and $P_{T\setminus\{\alpha\}}(G)$ in the 1-skeleton graph of $(q,1_{\mathcal{M}_G})$. \par By Lemma \ref{crucial} we have that $q'=P_{T'}(H')$, for some graph $H'$ on $[n]$ and some $T'\subseteq [n]$. Now, there exists $U\in \mathcal{C}(G)$ such that $P_U(G)\subseteq q'$. It follows that $U\subseteq T'\subsetneq T$, since $q'\in (q,1_{\mathcal{M}_G})$. Now we consider the following cases: \par First assume that $T\setminus U\subseteq L_3$. Therefore, the vertices $n-1$ and $n$ are isolated in $G-U$. This implies that $P_U(G)\subseteq P_{T\setminus\{\alpha\}}(G)$, for every $\alpha\in T\setminus U$. \par Next assume that $T\setminus U\nsubseteq L_3$. Let $\alpha\in (T\setminus U)\setminus L_3$. Clearly, $\alpha\notin L_0$. Indeed, otherwise we get $f_{n-1,n}\in P_U(G)$, a contradiction. So, without loss of generality we assume that $\alpha\in L_1$. It follows that there is no path between vertices $\alpha$ and $n-1$ in $G-U$. Therefore, we have that $P_U(G)\subseteq P_{T\setminus\{\alpha\}}(G)$. \par Thus, the claim follows from both above cases. \par \textbf{Step 2:} Assume that $L_3\neq \emptyset$. Let $\alpha\in L_3$ and $q'\in (q,1_{\mathcal{M}_G})$. We show that there exists a path between $q'$ and $P_{T\setminus\{\alpha\}}(G)$ in the 1-skeleton graph of $(q,1_{\mathcal{M}_G})$. \par By Step 1, there exists $P_{T\setminus\{\beta\}}(G)\in X$ such that there is a path between $q'$ and $P_{T\setminus\{\beta\}}(G)$ in the 1-skeleton graph of $(q,1_{\mathcal{M}_G})$. Moreover, since $\alpha\in L_3$, it is not difficult to see that $P_{T\setminus\{\alpha\}}(G)+P_{T\setminus\{\alpha,\beta\}}(G)\in (q,1_{\mathcal{M}_G})$ and $P_{T\setminus\{\beta\}}(G)\supseteq P_{T\setminus\{\alpha,\beta\}}(G)$. Therefore, we have the path \[P_{T\setminus\{\alpha\}}(G),P_{T\setminus\{\alpha\}}(G)+P_{T\setminus\{\alpha,\beta\}}(G),P_{T\setminus\{\alpha,\beta\}}(G),P_{T\setminus\{\beta\}}(G),\] in the 1-skeleton graph of $(q,1_{\mathcal{M}_G})$. This implies that $(q,1_{\mathcal{M}_G})$ is connected. So, for the rest of the proof we may assume that $L_3=\emptyset$. \par \textbf{Step 3:} Now assume that $\alpha,\beta\in L_1$, and $\alpha<\beta$. We claim that there exists a path in the 1-skeleton graph of $(q,1_{\mathcal{M}_G})$ between $P_{T\setminus\{\alpha\}}(G)$ and $P_{T\setminus\{\beta\}}(G)$, (the situation in the case $\alpha,\beta\in L_2$ is similar). \par We have that \[P_{T\setminus\{\alpha\}}(G)=(x_i,y_i: i\in T\setminus\{\alpha\})+(f_{\alpha,n}),\] and \[P_{T\setminus\{\beta\}}(G)=(x_i,y_i: i\in T\setminus\{\beta\})+(f_{\beta,n}).\] So, we get \[P_{T\setminus\{\alpha,\beta\}}(G)=(x_i,y_i: i\in T\setminus\{\alpha,\beta\})+(f_{\alpha,n},f_{\beta,n},f_{\alpha,\beta}).\] Therefore, we get the path \[P_{T\setminus\{\alpha\}}(G),P_{T\setminus\{\alpha,\beta\}}(G),P_{T\setminus\{\beta\}}(G)\] in the 1-skeleton graph of $(q,1_{\mathcal{M}_G})$, as desired. \par \textbf{Step 4:} Let $\alpha \in L_1$ and $\beta \in L_2$. We show that there exists a path in the 1-skeleton graph of $(q,1_{\mathcal{M}_G})$ between the vertices $P_{T\setminus\{\alpha\}}(G)$ and $P_{T\setminus\{\beta\}}(G)$. \par First assume that $\{\alpha,\beta\}\notin E(G)$. It follows that \[P_{T\setminus\{\alpha,\beta\}}(G)=(x_i,y_i: i\in T\setminus\{\alpha,\beta\})+(f_{\beta,n-1},f_{\alpha,n}).\] Therefore, we get the path \[P_{T\setminus\{\alpha\}}(G),P_{T\setminus\{\alpha,\beta\}}(G),P_{T\setminus\{\beta\}}(G),\] as desired. \par Next assume that $\{\alpha,\beta\}\in E(G)$. Now, there exist vertices $t_1\in L_1$ and $t_2\in L_2$, such that $\{t_1,t_2\}\notin E(G)$. Indeed, if no such vertices exist, then by putting $u=n$ and $w=n-1$ and also $V_0=L_0,V_1=L_1$ and $V_2=L_2$ in Definition \ref{gpich}, we get $G\in \mathcal{G}_T$, since $\{n-1,n\}\notin E(G)$ and $L_3=\emptyset$. Therefore, we get a contradiction. Now, by Step 3, there is a path between $P_{T\setminus\{\alpha\}}(G)$ and $P_{T\setminus\{t_1\}}(G)$, and also a path between $P_{T\setminus\{\beta\}}(G)$ and $P_{T\setminus\{t_2\}}(G)$, in the underlying graph of $(q,1_{\mathcal{M}_G})$. On the other hand, since $\{t_1,t_2\}\notin E(G)$, the argument that we used in the first part of this step yields a path between $P_{T\setminus\{t_1\}}(G)$ and $P_{T\setminus\{t_2\}}(G)$. Therefore, we get a path between $P_{T\setminus\{\alpha\}}(G)$ and $P_{T\setminus\{\beta\}}(G)$ in the 1-skeleton graph of $(q,1_{\mathcal{M}_G})$, as desired. \par \textbf{Step 5:} Now suppose that $q_{1}, q_{2}\in (q,1_{\mathcal{M}_G})$ and $q_1\neq q_2$. Then, by Step 1, there exist $P_{T\setminus\{\alpha\}}(G),P_{T\setminus\{\beta\}}(G)\in X$ such that there is a path between $q_1$ and $P_{T\setminus\{\alpha\}}(G)$, and a path between $q_2$ and $P_{T\setminus\{\beta\}}(G)$ in the 1-skeleton graph of $(q,1_{\mathcal{M}_G})$. Moreover, we have a path between $P_{T\setminus\{\alpha\}}(G)$ and $P_{T\setminus\{\beta\}}(G)$, by Steps 3 and 4. Therefore, we get a path between $q_1$ and $q_2$ in the 1-skeleton graph of $(q,1_{\mathcal{M}_G})$. Thus, $(q,1_{\mathcal{M}_G})$ is connected. \par \vspace{.5cm} For the converse, assume that $G\in \mathcal{G}_T$. Therefore, there exist three disjoint subsets $V_0$, $V_1$ and $V_2$ of $T$, such that the conditions of Definition \ref{gpich} hold. Now, let $q_1=P_{V_0\cup V_1}(G)$, and $q_2=P_{V_0\cup V_2}(G)$. We have that $q_1,q_2\in (q,1_{\mathcal{M}_G})$. Now, we claim that there is no path between $q_1$ and $q_2$ in the 1-skeleton graph of $(q,1_{\mathcal{M}_G})$, and then we conclude the result. \par Notice that $\{V_0\cup V_1,V_0\cup V_2\}\subseteq \mathcal{C}(G)$. Moreover, we have $T'\in \{V_0\cup V_1,V_0\cup V_2\}$, for every $T'\in \mathcal{C}(G)$ such that $n-1\notin T'$ and $n\notin T'$. Indeed, one could see that $T'\supseteq V_0\cup V_1$ or $T'\supseteq V_0\cup V_2$, for every $T'\in \mathcal{C}(G)$ such that $n-1\notin T'$ and $n\notin T'$. Without loss of generality we can assume that $T'\supseteq V_0\cup V_1$. Now we claim that $T'= V_0\cup V_1$. Assume on contrary that there exists $v_2\in T'\cap V_2$. This implies that $v_2$ is not a cut vertex of $G-(T'\setminus \{v_2\})$, a contradiction to the fact that $T'\in \mathcal{C}(G)$. Therefore, we have either $q'\supseteq q_1$ or $q'\supseteq q_2$, for every $q'\in (q,1_{\mathcal{M}_G})$. Now, assume on contrary that there exists a path $\ell\hspace{-1.2mm}:q_1,q'_1,\ldots,q'_t,q_2$, between $q_1$ and $q_2$ in the 1-skeleton graph of $(q,1_{\mathcal{M}_G})$. Moreover, we may assume that $\ell$ is an induced path between the vertices $q_1$ and $q_2$. Now, we have that $t\geq 2$. Indeed, $t=1$ implies that $q'_1\supseteq q_1$ and $q'_1\supseteq q_2$, and hence $q'_1=q$, a contradiction. \par Now, if $q'_1\subseteq q'_2$, then $q'_2\supseteq q_1$. This clearly contradicts the minimality of the path $\ell$. So, we have $q'_1\supseteq q'_2$. On the other hand, we have $q'_2\supseteq q_2$, since $q'_2\nsupseteq q_1$. Therefore, $q'_1\supseteq q_2$, a contradiction to the minimality of $\ell$. \par So, there is no path between two vertices $q_1$ and $q_2$ in the 1-skeleton graph of $(q,1_{\mathcal{M}_G})$, as desired. \par \vspace{.5cm} $(b)$ Clearly we have $q=(x_1,\ldots,x_{n-2},y_1,\ldots,y_{n-2})+(f_{n-1,n})$, since $c_H(T)=1$. Let $q'=(x_1,\ldots,x_{n-2},y_1,\ldots,y_{n-2})$. \par First assume that $G\notin \mathcal{G}_T$. We show that $\widetilde{H}^{1}((q,1_{{\mathcal{M}_G}});\KK)=0$. We consider the following cases: \par Case 1: Assume that $q'\notin (q,1_{\mathcal{M}_G})$. We claim that $(q,1_{\mathcal{M}_G})$ is a meet-contractible poset. Then the result follows by Lemma \ref{meet}. \par Clearly, $P_\emptyset(G)\in (q,1_{\mathcal{M}_G})$. Now, let $q_1\in (q,1_{\mathcal{M}_G})$ such that $q_1\neq P_\emptyset(G)$. By Lemma \ref{crucial}, we have that $q_1=P_{T_1}(H_1)$, for some graph $H_1$ on $[n]$ and some $T_1\subseteq [n]$. Also, we have that $T_1\subsetneqq T$, since $q'\notin (q,1_{\mathcal{M}_G})$. Therefore, $q_1+P_\emptyset(G)\in (q,1_{\mathcal{M}_G})$, by Lemma \ref{vital}. Moreover, it is observed that $q_1+P_\emptyset(G)$ is the meet of the elements $q_1$ and $P_\emptyset(G)$. Therefore, $(q,1_{\mathcal{M}_G})$ is a meet-contractible poset, as desired. \par Case 2: Assume that $q'\in (q,1_{\mathcal{M}_G})$. Let $\Delta=\Delta(q,1_{\mathcal{M}_G})$, $\Delta_1=\mathrm{star}_{\Delta}(q')$ and $\Delta_2=\mathrm{del}_{\Delta}(q')$. One has $\mathrm{del}_{\Delta}(q')=\Delta ((q,1_{\mathcal{M}_G})\setminus \{q'\})$. Then by a similar argument as in Case 1, it follows that $\Delta_2$ is a contractible simplicial complex. On the other hand $\Delta_1\cap\Delta_2=\mathrm{link}_\Delta(q')=\Delta(q',1_{\mathcal{M}_G})$, since $q'$ is a minimal element in the poset $(q,1_{\mathcal{M}_G})$. \par Now, first assume that $\Delta_1\cap\Delta_2=\{\emptyset\}$. So, clearly we have ${H}_{0}(\mathrm{link}_{\Delta}(q');\KK)=0$. Now, since $\Delta_1$ is a cone and $\Delta_2$ is contractible, the Mayer-Vietoris sequence \[ \cdots\rightarrow H_1(\mathrm{star}_{\Delta}(q');\KK)\oplus H_1(\mathrm{del}_{\Delta}(q');\KK)\rightarrow H_1(\Delta;\KK)\rightarrow H_{0}(\mathrm{link}_{\Delta}(q');\KK)\rightarrow \cdots \] implies the result. \par Next assume that $\Delta_1\cap\Delta_2\neq \{\emptyset\}$. Hence, the reduced Mayer-Vietoris sequence \[ \cdots \rightarrow \widetilde{H}_1(\mathrm{star}_{\Delta}(q');\KK)\oplus \widetilde{H}_1(\mathrm{del}_{\Delta}(q');\KK)\rightarrow \widetilde{H}_1(\Delta;\KK)\rightarrow \widetilde{H}_{0}(\mathrm{link}_{\Delta}(q');\KK)\rightarrow\cdots \] is induced. On the other hand, $q'\in\mathcal{M}_G$. Thus, By Lemma \ref{crucial}, we have $q'=P_{T'}(H')$, for some graph $H'$ on $[n]$ and some $T'\subseteq [n]$. Now, it is easily seen that $T'=T$. Also, $c_{H'}(T')=2$, since otherwise we get $q'=q$, a contradiction. Therefore, since $G\notin\mathcal{G}_T$, by part $(a)$ we have $\widetilde{H}_{0}(\mathrm{link}_{\Delta}(q');\KK)=\widetilde{H}_{0}(\Delta(q',1_{\mathcal{M}_G});\KK)=0$, and hence by using the latter Mayer-Vietoris sequence we get the result. \par \vspace{.5cm} Now, for the converse, assume that $G\in \mathcal{G}_T$. We show that $\widetilde{H}^{1}((q,1_{{\mathcal{M}_G}});\KK)\neq0$. It is clear by Definition \ref{gpich} that $q'=P_T(G)$, and hence $q'\in (q,1_{\mathcal{M}_G})$. Moreover, Definition \ref{gpich} again implies that $(q',1_{\mathcal{M}_G})$ is a non-empty poset. Indeed, by the notation of Definition \ref{gpich} we have $P_{V_0\cup V_1}(G),P_{V_0\cup V_2}(G)\in (q',1_{\mathcal{M}_G})$. Now by keeping the same notation and also by the same argument as in Case 2 in above, the exact sequence \[ 0 \rightarrow \widetilde{H}_1(\Delta;\KK)\rightarrow \widetilde{H}_{0}(\mathrm{link}_{\Delta}(q');\KK)\rightarrow 0 \] is induced. On the other hand, we have $c_G(T)=2$, by Definition \ref{gpich}. Therefore, since $G\in \mathcal{G}_T$, part $(a)$ implies that $\widetilde{H}_{0}(\mathrm{link}_{\Delta}(q');\KK)\neq0$, and hence the result follows. \end{proof} Now we state the following lemma which is used in the proof of Theorem \ref{main}. \begin{Lemma}\label{nice suggestion} Let $G$ be a graph on $[n]$ with $n\geq 4$. If there exists $T'\in \mathcal{C}(G)$ with $|T'|=n-3$ and $c_G(T')=2$, then either $G\in \mathcal{G}_{T}$ for some $T\subseteq [n]$, or $G=H\ast(K_1\dot{\cup}K_2)$ for some graph $H$ on $n-3$ vertices. \end{Lemma} \begin{proof} Without loss of generality assume that $T'=\{1,\ldots,n-3\}$. We may also assume that $n$ is the isolated vertex of $G-T'$, since $c_G(T')=2$. Therefore, for every $i\in T'$ we have $i\in N_G(n)$, and either $i\in N_G(n-1)$ or $i\in N_G(n-2)$, since $T'\in \mathcal{C}(G)$. Now suppose that $G\neq H\ast(K_1\dot{\cup}K_2)$, for every graph $H$ on $n-3$ vertices. We show that $G\in \mathcal{G}_{T}$ for some $T\subseteq [n]$. \par Clearly, there exists $j\in \{n-2,n-1\}$ such that $T'\nsubseteq N_G(j)$. Let $V_0=N_G(j)\cap T', V_1=T'\setminus N_G(j)$ and $V_2=N_G(j)\setminus T'$. Now, by putting $u=n$ and $w=j$ in Definition \ref{gpich}, one checks that $G\in \mathcal{G}_T$, where $T=[n]\setminus \{n,j\}$. \end{proof} Finally, we need to state the following remark that will be used in the proof of Theorem~\ref{main}. The proof of this remark can be verified by taking a precise look at the proof of \cite[Theorem~4.4]{RSK2}. \begin{Remark}\label{remark} Let $G$ be a graph on $[n]$ with $n\geq 2$. Let $\widehat{\mathfrak{m}}=P_T(H)$, where $H$ is a graph on $[n]$ with $|T|=n-1$. Then the posets $(\mathfrak{m},1_{\mathcal{M}_G})$ and $(\widehat{\mathfrak{m}},1_{\mathcal{M}_G})$ are contractible. \end{Remark} Now we are ready to prove the main theorem of this section. \par \medskip Proof of Theorem \ref{main}: $(a)\Rightarrow (b)$ Assume that $G$ is not a $D_5$-type graph. We show $\depth S/J_G\neq 5$. Notice that if $G=G'\ast 2K_1$ for some graph $G'$, then $\depth S/J_G=4$, by \cite[Theorem~5.3]{RSK2}. So, we may assume that $G\neq G'\ast 2K_1$, for any graph $G'$. Now, by the definition of depth and by Theorem \ref{Hochster}, it is enough to show that $M_{5,q}=\dim_{\KK} \widetilde{H}^{4-d_q}((q,1_{{\mathcal{M}_G}});\KK)=0$, for all $q\in \mathcal{M}_G$. \par Let $q$ be an arbitrary element of the poset $\mathcal{M}_G$. We have $q=P_{T}(H)$ for some graph $H$ on $[n]$ and some $T\subseteq [n]$, by Lemma~\ref{crucial}. If $d_q\geq 6$, then obviously we have the result. Moreover, it is easily seen that there is no $q'\in \mathcal{M}_G$ such that $d_{q'}=1$. Therefore, we assume that $d_q\in\{0,2,3,4,5\}$. Now, we consider the following cases: \par Let $d_q\in \{0,2\}$. So, $\mathrm{ht}\hspace{0.9mm}q\in \{2n-2,2n\}$. This implies that $|T|-c_H(T)\in\{n-2,n\}$. Therefore, without loss of generality, we assume that either $q=\mathfrak{m}$ or $q=\widehat{\mathfrak{m}}$. Now, the result follows, since the posets $(\mathfrak{m},1_{{\mathcal{M}_G}})$ and $(\widehat{\mathfrak{m}},1_{{\mathcal{M}_G}})$ are contractible by Remark \ref{remark}. \par Let $d_q=3$. Then $|T|-c_H(T)=n-3$, and hence $|T|=n-2$ and $c_H(T)=1$. Now, by Definition \ref{D5}, $G\notin \mathcal{G}_T$, since $G$ is not a $D_5$-type graph. Thus, we have $M_{5,q}=\dim_{\KK}\widetilde{H}^{1}((q,1_{{\mathcal{M}_G}});\KK)=0$, by Theorem \ref{corona} part $(b)$. \par Let $d_q=4$. It follows that $|T|-c_H(T)=n-4$. So, we have either $|T|=n-2$ and $c_H(T)=2$, or $|T|=n-3$ and $c_H(T)=1$. \par First assume that $|T|=n-2$ and $c_H(T)=2$. Therefore, Theorem~\ref{corona} part $(a)$ implies that $M_{5,q}=\dim_{\KK} \widetilde{H}^{0}((q,1_{{\mathcal{M}_G}});\KK)=0$, since $G\notin \mathcal{G}_T$. \par Next assume that $|T|=n-3$ and $c_H(T)=1$. Without loss of generality we assume that $T=\{1,\ldots,n-3\}$. Therefore, \[q=(x_1,\ldots,x_{n-3},y_1,\ldots,y_{n-3})+(f_{n-2,n-1},f_{n-2,n},f_{n-1,n}).\] \par Let $q_{1}, q_{2}\in (q,1_{\mathcal{M}_G})$ and $q_1\neq q_2$. Then, there exist $T_1,T_2\in \mathcal{C}(G)$ such that $q_1\supseteq P_{T_1}(G)$ and $q_2\supseteq P_{T_2}(G)$. Moreover, we have $T_1,T_2\subseteq T$, since $q_{1}, q_{2}\in (q,1_{\mathcal{M}_G})$. Now, we distinguish the following cases: \par First assume that $T_1,T_2\subsetneqq T$. Therefore, by Lemma \ref{vital}, we have that $q_{1}+P_{\emptyset}(G)\in (q,1_{\mathcal{M}_G})$ and $q_{2}+P_{\emptyset}(G)\in (q,1_{\mathcal{M}_G})$, since $q_{1}+P_{\emptyset}(G)\subsetneqq q$ and $q_{2}+P_{\emptyset}(G)\subsetneqq q$. So, we get the path \[q_{1}, P_{T_1}(G), P_{T_1}(G)+P_{\emptyset}(G), P_{\emptyset}(G), P_{\emptyset}(G)+P_{T_2}(G), P_{T_2}(G), q_{2}\] in the 1-skeleton graph of the order complex of the poset $(q,1_{\mathcal{M}_G})$. \par Next assume that $T_1=T$ or $T_2=T$. If $T_1=T_2$, then we get the path $q_1,P_{T_1}(G)=P_{T_2}(G),q_2$, as desired. So, without loss of generality, we assume that $T_1=T$ and $T_2\subsetneqq T$. One has $c_G(T_1)\in\{2,3\}$, since $T_1\in \mathcal{C}(G)$. Notice that if $c_G(T_1)=2$, then Lemma \ref{nice suggestion} implies that $G$ is a $D_5$-type graph, a contradiction. So, we have $c_G(T_1)=3$. Furthermore, there exist two vertices $\alpha\in T_1$ and $\beta\in\{n-2,n-1,n\}$, such that $\{\alpha,\beta\}\notin E(G)$. Indeed, otherwise we get $G=H\ast 3K_1$, where $H=G-\{n-2,n-1,n\}$, which is a contradiction with Definition \ref{D5}. Now, one could see that \[P_{T_1}(G)+P_{{T_1}\setminus\{\alpha\}}(G)=(x_1,\ldots,x_{n-3},y_1,\ldots,y_{n-3})+(f_{i,j}),\] where $i<j$ and $i,j \in \{n-2,n-1,n\}\setminus \{\beta\}$. Therefore, we have that $P_{T_1}(G)+P_{{T_1}\setminus\{\alpha\}}(G)\in (q,1_{\mathcal{M}_G})$. So, we get the path \begin{figure}[H] \centering \begin{tikzpicture}[scale=1,line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm] \draw (-5.,0.)-- (-4.,1.); \draw (-4.,1.)-- (-3.02,0.); \draw (-3.02,0.)-- (-1.,1.); \draw (-1.,1.)-- (1.,0.); \draw (1.,0.)-- (3.,1.); \draw (3.,1.)-- (5.,0.); \draw (5.,0.)-- (6.,1.); \draw (6.,1.)-- (7.,0.); \draw (-5.45,0.) node[anchor=north west] {$q_1$}; \draw (-4.72,1.73) node[anchor=north west] {$P_{T_1}(G)$}; \draw (-4.8,0.) node[anchor=north west] {$P_{T_1}(G)+P_{{T_1}\setminus\{\alpha\}}(G)$}; \draw (-2.13,1.73) node[anchor=north west] {$P_{{T_1}\setminus\{\alpha\}}(G)$}; \draw (-0.59,0.) node[anchor=north west] {$P_{{T_1}\setminus\{\alpha\}}(G)+P_{\emptyset}(G)$}; \draw (2.32,1.72) node[anchor=north west] {$P_{\emptyset}(G)$}; \draw (3.5,0.) node[anchor=north west] {$P_{\emptyset}(G)+P_{T_2}(G)$}; \draw (5.25,1.73) node[anchor=north west] {$P_{T_2}(G)$}; \draw (6.9,0.) node[anchor=north west] {$q_{2}$}; \begin{scriptsize} \draw [fill=blue] (3.,1.) circle (1.5pt); \draw [fill=blue] (5.,0.) circle (1.5pt); \draw [fill=blue] (6.,1.) circle (1.5pt); \draw [fill=blue] (7.,0.) circle (1.5pt); \draw [fill=blue] (-1.,1.) circle (1.5pt); \draw [fill=blue] (-3.02,0.) circle (1.5pt); \draw [fill=blue] (-4.,1.) circle (1.5pt); \draw [fill=blue] (-5.,0.) circle (1.5pt); \draw [fill=blue] (1.,0.) circle (1.5pt); \end{scriptsize} \end{tikzpicture} \end{figure} between $q_1$ and $q_2$ in the 1-skeleton graph of the order complex of the poset $(q,1_{\mathcal{M}_G})$. \par Therefore, it follows from the both cases that $(q,1_{\mathcal{M}_G})$ is connected, and hence the desired result follows. \par Let $d_q=5$. It follows that $|T|-c_H(T)=n-5$. So, we have that either $|T|=n-3$ and $c_H(T)=2$, or $|T|=n-4$ and $c_H(T)=1$. Now the result follows once we show that $(q,1_{{\mathcal{M}_G}})$ is a non-empty poset. \par First suppose that $|T|=n-3$ and $c_H(T)=2$. Assume on contrary that $(q,1_{{\mathcal{M}_G}})$ is an empty poset, i.e. $q\in \Min(J_G)$. Then, $q=P_{T'}(G)$ for some $T'\in \mathcal{C}(G)$. It follows that $T'=T$ and $c_G(T')=c_H(T)=2$. Therefore, Lemma \ref{nice suggestion} implies that $G$ is a $D_5$-type graph, a contradiction. \par Next suppose that $|T|=n-4$ and $c_H(T)=1$. Therefore, we have $P_{\emptyset}(G)\subseteq q$. Moreover, the assumption $n\geq 5$ implies that $T\neq \emptyset$, and hence $P_{\emptyset}(G)\in (q,1_{\mathcal{M}_G})$, as desired. \par \vspace{.5cm} $(b)\Rightarrow (a)$ Assume that $G$ is a $D_5$-type graph. Then, Corollary \ref{combin} implies that $\depth S/J_G\geq5$. Therefore, the result follows if we show that $\depth S/J_G\leq5$. To do so, we consider the following cases: \par First assume that $G\in \mathcal{G}_T$, for some $T\subseteq [n]$ with $|T|=n-2$. Let $q=P_T(G)$. We have $q\in \mathcal{M}_G$ and by Definition \ref{gpich} we have $c_{G}(T)=2$. Thus, Theorem \ref{corona} part $(a)$ implies that $(q,1_{\mathcal{M}_G})$ is not connected. Since $d_q=4$, we have that $M_{5,q}=\dim_{\KK} \widetilde{H}^{0}((q,1_{{\mathcal{M}_G}});\KK)\neq 0$. Therefore, we get $H_{\mathfrak{m}}^{5}(S/J_G)\neq 0$, by Theorem~ \ref{Hochster}. This yields that $\depth S/J_G\leq5$, as desired. \par Next assume that $G=H\ast 3K_1$, for some graph $H$. If $H$ is a complete graph, then the result follows by \cite[Theorem~3.9]{KumarS}. If $H$ is not complete, then it follows from \cite[Theorem~4.3]{KumarS} and \cite[Theorem~4.4]{KumarS} that $\depth S/J_G=5$, as desired. \par Finally, suppose that $G=H\ast(K_1\dot{\cup}K_2)$, for some graph $H$. The result follows by \cite[Theorem~3.9]{KumarS} if $H$ is a complete graph. If $H$ is not complete, then it follows from \cite[Theorem~4.3]{KumarS} and \cite[Theorem~4.4]{KumarS} that $\depth S/J_G=5$, as desired. \vspace{1cm} \par \textbf{Acknowledgments:} The authors would like to thank the anonymous referees for their careful reading of the manuscript and for their valuable comments and suggestions. The authors would also like to thank Institute for Research in Fundamental Sciences (IPM) for financial support. The research of the second author was in part supported by a grant from IPM (No. 1400130113).